1936e7d03SDaniel Mack /* 2936e7d03SDaniel Mack * Copyright (c) 2007 Daniel Mack 3936e7d03SDaniel Mack * friendly supported by NI. 4936e7d03SDaniel Mack * 5936e7d03SDaniel Mack * This program is free software; you can redistribute it and/or modify 6936e7d03SDaniel Mack * it under the terms of the GNU General Public License as published by 7936e7d03SDaniel Mack * the Free Software Foundation; either version 2 of the License, or 8936e7d03SDaniel Mack * (at your option) any later version. 9936e7d03SDaniel Mack * 10936e7d03SDaniel Mack * This program is distributed in the hope that it will be useful, 11936e7d03SDaniel Mack * but WITHOUT ANY WARRANTY; without even the implied warranty of 12936e7d03SDaniel Mack * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13936e7d03SDaniel Mack * GNU General Public License for more details. 14936e7d03SDaniel Mack * 15936e7d03SDaniel Mack * You should have received a copy of the GNU General Public License 16936e7d03SDaniel Mack * along with this program; if not, write to the Free Software 17936e7d03SDaniel Mack * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18936e7d03SDaniel Mack */ 19936e7d03SDaniel Mack 20f1f6b8f6SDaniel Mack #include <linux/device.h> 21936e7d03SDaniel Mack #include <linux/init.h> 22936e7d03SDaniel Mack #include <linux/usb.h> 23936e7d03SDaniel Mack #include <sound/control.h> 24936e7d03SDaniel Mack #include <sound/core.h> 25936e7d03SDaniel Mack #include <sound/pcm.h> 26936e7d03SDaniel Mack 27936e7d03SDaniel Mack #include "device.h" 28936e7d03SDaniel Mack #include "control.h" 29936e7d03SDaniel Mack 30936e7d03SDaniel Mack #define CNT_INTVAL 0x10000 31d2724de1SHannes Gräuler #define MASCHINE_BANK_SIZE 32 32936e7d03SDaniel Mack 33936e7d03SDaniel Mack static int control_info(struct snd_kcontrol *kcontrol, 34936e7d03SDaniel Mack struct snd_ctl_elem_info *uinfo) 35936e7d03SDaniel Mack { 36936e7d03SDaniel Mack struct snd_usb_audio *chip = snd_kcontrol_chip(kcontrol); 371c8470ceSDaniel Mack struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card); 38936e7d03SDaniel Mack int pos = kcontrol->private_value; 39936e7d03SDaniel Mack int is_intval = pos & CNT_INTVAL; 406da7a2aaSDaniel Mack int maxval = 63; 41936e7d03SDaniel Mack 42936e7d03SDaniel Mack uinfo->count = 1; 43936e7d03SDaniel Mack pos &= ~CNT_INTVAL; 44936e7d03SDaniel Mack 451c8470ceSDaniel Mack switch (cdev->chip.usb_id) { 466da7a2aaSDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): 47bd4cbf6cSMark Hills case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): 486da7a2aaSDaniel Mack if (pos == 0) { 49bd4cbf6cSMark Hills /* current input mode of A8DJ and A4DJ */ 50936e7d03SDaniel Mack uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 51936e7d03SDaniel Mack uinfo->value.integer.min = 0; 52936e7d03SDaniel Mack uinfo->value.integer.max = 2; 53936e7d03SDaniel Mack return 0; 54936e7d03SDaniel Mack } 556da7a2aaSDaniel Mack break; 56936e7d03SDaniel Mack 576da7a2aaSDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1): 586da7a2aaSDaniel Mack maxval = 127; 596da7a2aaSDaniel Mack break; 6015c5ab60SDaniel Mack 6115c5ab60SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLS4): 6215c5ab60SDaniel Mack maxval = 31; 6315c5ab60SDaniel Mack break; 646da7a2aaSDaniel Mack } 65936e7d03SDaniel Mack 66936e7d03SDaniel Mack if (is_intval) { 67936e7d03SDaniel Mack uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 68936e7d03SDaniel Mack uinfo->value.integer.min = 0; 696da7a2aaSDaniel Mack uinfo->value.integer.max = maxval; 70936e7d03SDaniel Mack } else { 71936e7d03SDaniel Mack uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 72936e7d03SDaniel Mack uinfo->value.integer.min = 0; 73936e7d03SDaniel Mack uinfo->value.integer.max = 1; 74936e7d03SDaniel Mack } 75936e7d03SDaniel Mack 76936e7d03SDaniel Mack return 0; 77936e7d03SDaniel Mack } 78936e7d03SDaniel Mack 79936e7d03SDaniel Mack static int control_get(struct snd_kcontrol *kcontrol, 80936e7d03SDaniel Mack struct snd_ctl_elem_value *ucontrol) 81936e7d03SDaniel Mack { 82936e7d03SDaniel Mack struct snd_usb_audio *chip = snd_kcontrol_chip(kcontrol); 831c8470ceSDaniel Mack struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card); 84936e7d03SDaniel Mack int pos = kcontrol->private_value; 85936e7d03SDaniel Mack 86936e7d03SDaniel Mack if (pos & CNT_INTVAL) 87936e7d03SDaniel Mack ucontrol->value.integer.value[0] 881c8470ceSDaniel Mack = cdev->control_state[pos & ~CNT_INTVAL]; 89936e7d03SDaniel Mack else 90936e7d03SDaniel Mack ucontrol->value.integer.value[0] 911c8470ceSDaniel Mack = !!(cdev->control_state[pos / 8] & (1 << pos % 8)); 92936e7d03SDaniel Mack 93936e7d03SDaniel Mack return 0; 94936e7d03SDaniel Mack } 95936e7d03SDaniel Mack 96936e7d03SDaniel Mack static int control_put(struct snd_kcontrol *kcontrol, 97936e7d03SDaniel Mack struct snd_ctl_elem_value *ucontrol) 98936e7d03SDaniel Mack { 99936e7d03SDaniel Mack struct snd_usb_audio *chip = snd_kcontrol_chip(kcontrol); 1001c8470ceSDaniel Mack struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card); 101936e7d03SDaniel Mack int pos = kcontrol->private_value; 10215c5ab60SDaniel Mack int v = ucontrol->value.integer.value[0]; 103*e76bf634SDaniel Mack unsigned char cmd; 104936e7d03SDaniel Mack 105*e76bf634SDaniel Mack switch (cdev->chip.usb_id) { 106*e76bf634SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER): 107*e76bf634SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1): 108*e76bf634SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2): 109*e76bf634SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): 1106da7a2aaSDaniel Mack cmd = EP1_CMD_DIMM_LEDS; 111*e76bf634SDaniel Mack break; 112*e76bf634SDaniel Mack default: 113*e76bf634SDaniel Mack cmd = EP1_CMD_WRITE_IO; 114*e76bf634SDaniel Mack break; 115*e76bf634SDaniel Mack } 116d2724de1SHannes Gräuler 117936e7d03SDaniel Mack if (pos & CNT_INTVAL) { 11815c5ab60SDaniel Mack int i = pos & ~CNT_INTVAL; 11915c5ab60SDaniel Mack 1201c8470ceSDaniel Mack cdev->control_state[i] = v; 12115c5ab60SDaniel Mack 1221c8470ceSDaniel Mack if (cdev->chip.usb_id == 12315c5ab60SDaniel Mack USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLS4)) { 12415c5ab60SDaniel Mack int actual_len; 12515c5ab60SDaniel Mack 1261c8470ceSDaniel Mack cdev->ep8_out_buf[0] = i; 1271c8470ceSDaniel Mack cdev->ep8_out_buf[1] = v; 12815c5ab60SDaniel Mack 1291c8470ceSDaniel Mack usb_bulk_msg(cdev->chip.dev, 1301c8470ceSDaniel Mack usb_sndbulkpipe(cdev->chip.dev, 8), 1311c8470ceSDaniel Mack cdev->ep8_out_buf, sizeof(cdev->ep8_out_buf), 13215c5ab60SDaniel Mack &actual_len, 200); 133d2724de1SHannes Gräuler } else if (cdev->chip.usb_id == 134d2724de1SHannes Gräuler USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER)) { 135d2724de1SHannes Gräuler 136d2724de1SHannes Gräuler int bank = 0; 137d2724de1SHannes Gräuler int offset = 0; 138d2724de1SHannes Gräuler 139d2724de1SHannes Gräuler if (i >= MASCHINE_BANK_SIZE) { 140d2724de1SHannes Gräuler bank = 0x1e; 141d2724de1SHannes Gräuler offset = MASCHINE_BANK_SIZE; 142d2724de1SHannes Gräuler } 143d2724de1SHannes Gräuler 144d2724de1SHannes Gräuler snd_usb_caiaq_send_command_bank(cdev, cmd, bank, 145d2724de1SHannes Gräuler cdev->control_state + offset, 146d2724de1SHannes Gräuler MASCHINE_BANK_SIZE); 14715c5ab60SDaniel Mack } else { 1481c8470ceSDaniel Mack snd_usb_caiaq_send_command(cdev, cmd, 1491c8470ceSDaniel Mack cdev->control_state, sizeof(cdev->control_state)); 15015c5ab60SDaniel Mack } 151936e7d03SDaniel Mack } else { 15215c5ab60SDaniel Mack if (v) 1531c8470ceSDaniel Mack cdev->control_state[pos / 8] |= 1 << (pos % 8); 154936e7d03SDaniel Mack else 1551c8470ceSDaniel Mack cdev->control_state[pos / 8] &= ~(1 << (pos % 8)); 156936e7d03SDaniel Mack 1571c8470ceSDaniel Mack snd_usb_caiaq_send_command(cdev, cmd, 1581c8470ceSDaniel Mack cdev->control_state, sizeof(cdev->control_state)); 159936e7d03SDaniel Mack } 160936e7d03SDaniel Mack 161936e7d03SDaniel Mack return 1; 162936e7d03SDaniel Mack } 163936e7d03SDaniel Mack 16414c56706SBill Pemberton static struct snd_kcontrol_new kcontrol_template = { 165936e7d03SDaniel Mack .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, 166936e7d03SDaniel Mack .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, 167936e7d03SDaniel Mack .index = 0, 168936e7d03SDaniel Mack .info = control_info, 169936e7d03SDaniel Mack .get = control_get, 170936e7d03SDaniel Mack .put = control_put, 171936e7d03SDaniel Mack /* name and private_value filled later */ 172936e7d03SDaniel Mack }; 173936e7d03SDaniel Mack 174936e7d03SDaniel Mack struct caiaq_controller { 175936e7d03SDaniel Mack char *name; 176936e7d03SDaniel Mack int index; 177936e7d03SDaniel Mack }; 178936e7d03SDaniel Mack 179936e7d03SDaniel Mack static struct caiaq_controller ak1_controller[] = { 180936e7d03SDaniel Mack { "LED left", 2 }, 181936e7d03SDaniel Mack { "LED middle", 1 }, 182936e7d03SDaniel Mack { "LED right", 0 }, 183936e7d03SDaniel Mack { "LED ring", 3 } 184936e7d03SDaniel Mack }; 185936e7d03SDaniel Mack 186936e7d03SDaniel Mack static struct caiaq_controller rk2_controller[] = { 187936e7d03SDaniel Mack { "LED 1", 5 }, 188936e7d03SDaniel Mack { "LED 2", 4 }, 189936e7d03SDaniel Mack { "LED 3", 3 }, 190936e7d03SDaniel Mack { "LED 4", 2 }, 191936e7d03SDaniel Mack { "LED 5", 1 }, 192936e7d03SDaniel Mack { "LED 6", 0 }, 193936e7d03SDaniel Mack { "LED pedal", 6 }, 194936e7d03SDaniel Mack { "LED 7seg_1b", 8 }, 195936e7d03SDaniel Mack { "LED 7seg_1c", 9 }, 196936e7d03SDaniel Mack { "LED 7seg_2a", 10 }, 197936e7d03SDaniel Mack { "LED 7seg_2b", 11 }, 198936e7d03SDaniel Mack { "LED 7seg_2c", 12 }, 199936e7d03SDaniel Mack { "LED 7seg_2d", 13 }, 200936e7d03SDaniel Mack { "LED 7seg_2e", 14 }, 201936e7d03SDaniel Mack { "LED 7seg_2f", 15 }, 202936e7d03SDaniel Mack { "LED 7seg_2g", 16 }, 203936e7d03SDaniel Mack { "LED 7seg_3a", 17 }, 204936e7d03SDaniel Mack { "LED 7seg_3b", 18 }, 205936e7d03SDaniel Mack { "LED 7seg_3c", 19 }, 206936e7d03SDaniel Mack { "LED 7seg_3d", 20 }, 207936e7d03SDaniel Mack { "LED 7seg_3e", 21 }, 208936e7d03SDaniel Mack { "LED 7seg_3f", 22 }, 209936e7d03SDaniel Mack { "LED 7seg_3g", 23 } 210936e7d03SDaniel Mack }; 211936e7d03SDaniel Mack 212936e7d03SDaniel Mack static struct caiaq_controller rk3_controller[] = { 213936e7d03SDaniel Mack { "LED 7seg_1a", 0 + 0 }, 214936e7d03SDaniel Mack { "LED 7seg_1b", 0 + 1 }, 215936e7d03SDaniel Mack { "LED 7seg_1c", 0 + 2 }, 216936e7d03SDaniel Mack { "LED 7seg_1d", 0 + 3 }, 217936e7d03SDaniel Mack { "LED 7seg_1e", 0 + 4 }, 218936e7d03SDaniel Mack { "LED 7seg_1f", 0 + 5 }, 219936e7d03SDaniel Mack { "LED 7seg_1g", 0 + 6 }, 220936e7d03SDaniel Mack { "LED 7seg_1p", 0 + 7 }, 221936e7d03SDaniel Mack 222936e7d03SDaniel Mack { "LED 7seg_2a", 8 + 0 }, 223936e7d03SDaniel Mack { "LED 7seg_2b", 8 + 1 }, 224936e7d03SDaniel Mack { "LED 7seg_2c", 8 + 2 }, 225936e7d03SDaniel Mack { "LED 7seg_2d", 8 + 3 }, 226936e7d03SDaniel Mack { "LED 7seg_2e", 8 + 4 }, 227936e7d03SDaniel Mack { "LED 7seg_2f", 8 + 5 }, 228936e7d03SDaniel Mack { "LED 7seg_2g", 8 + 6 }, 229936e7d03SDaniel Mack { "LED 7seg_2p", 8 + 7 }, 230936e7d03SDaniel Mack 231936e7d03SDaniel Mack { "LED 7seg_3a", 16 + 0 }, 232936e7d03SDaniel Mack { "LED 7seg_3b", 16 + 1 }, 233936e7d03SDaniel Mack { "LED 7seg_3c", 16 + 2 }, 234936e7d03SDaniel Mack { "LED 7seg_3d", 16 + 3 }, 235936e7d03SDaniel Mack { "LED 7seg_3e", 16 + 4 }, 236936e7d03SDaniel Mack { "LED 7seg_3f", 16 + 5 }, 237936e7d03SDaniel Mack { "LED 7seg_3g", 16 + 6 }, 238936e7d03SDaniel Mack { "LED 7seg_3p", 16 + 7 }, 239936e7d03SDaniel Mack 240936e7d03SDaniel Mack { "LED 7seg_4a", 24 + 0 }, 241936e7d03SDaniel Mack { "LED 7seg_4b", 24 + 1 }, 242936e7d03SDaniel Mack { "LED 7seg_4c", 24 + 2 }, 243936e7d03SDaniel Mack { "LED 7seg_4d", 24 + 3 }, 244936e7d03SDaniel Mack { "LED 7seg_4e", 24 + 4 }, 245936e7d03SDaniel Mack { "LED 7seg_4f", 24 + 5 }, 246936e7d03SDaniel Mack { "LED 7seg_4g", 24 + 6 }, 247936e7d03SDaniel Mack { "LED 7seg_4p", 24 + 7 }, 248936e7d03SDaniel Mack 249936e7d03SDaniel Mack { "LED 1", 32 + 0 }, 250936e7d03SDaniel Mack { "LED 2", 32 + 1 }, 251936e7d03SDaniel Mack { "LED 3", 32 + 2 }, 252936e7d03SDaniel Mack { "LED 4", 32 + 3 }, 253936e7d03SDaniel Mack { "LED 5", 32 + 4 }, 254936e7d03SDaniel Mack { "LED 6", 32 + 5 }, 255936e7d03SDaniel Mack { "LED 7", 32 + 6 }, 256936e7d03SDaniel Mack { "LED 8", 32 + 7 }, 257936e7d03SDaniel Mack { "LED pedal", 32 + 8 } 258936e7d03SDaniel Mack }; 259936e7d03SDaniel Mack 260936e7d03SDaniel Mack static struct caiaq_controller kore_controller[] = { 261936e7d03SDaniel Mack { "LED F1", 8 | CNT_INTVAL }, 262936e7d03SDaniel Mack { "LED F2", 12 | CNT_INTVAL }, 263936e7d03SDaniel Mack { "LED F3", 0 | CNT_INTVAL }, 264936e7d03SDaniel Mack { "LED F4", 4 | CNT_INTVAL }, 265936e7d03SDaniel Mack { "LED F5", 11 | CNT_INTVAL }, 266936e7d03SDaniel Mack { "LED F6", 15 | CNT_INTVAL }, 267936e7d03SDaniel Mack { "LED F7", 3 | CNT_INTVAL }, 268936e7d03SDaniel Mack { "LED F8", 7 | CNT_INTVAL }, 269936e7d03SDaniel Mack { "LED touch1", 10 | CNT_INTVAL }, 270936e7d03SDaniel Mack { "LED touch2", 14 | CNT_INTVAL }, 271936e7d03SDaniel Mack { "LED touch3", 2 | CNT_INTVAL }, 272936e7d03SDaniel Mack { "LED touch4", 6 | CNT_INTVAL }, 273936e7d03SDaniel Mack { "LED touch5", 9 | CNT_INTVAL }, 274936e7d03SDaniel Mack { "LED touch6", 13 | CNT_INTVAL }, 275936e7d03SDaniel Mack { "LED touch7", 1 | CNT_INTVAL }, 276936e7d03SDaniel Mack { "LED touch8", 5 | CNT_INTVAL }, 277936e7d03SDaniel Mack { "LED left", 18 | CNT_INTVAL }, 278936e7d03SDaniel Mack { "LED right", 22 | CNT_INTVAL }, 279936e7d03SDaniel Mack { "LED up", 16 | CNT_INTVAL }, 280936e7d03SDaniel Mack { "LED down", 20 | CNT_INTVAL }, 281936e7d03SDaniel Mack { "LED stop", 23 | CNT_INTVAL }, 282936e7d03SDaniel Mack { "LED play", 21 | CNT_INTVAL }, 283936e7d03SDaniel Mack { "LED record", 19 | CNT_INTVAL }, 284936e7d03SDaniel Mack { "LED listen", 17 | CNT_INTVAL }, 285936e7d03SDaniel Mack { "LED lcd", 30 | CNT_INTVAL }, 286936e7d03SDaniel Mack { "LED menu", 28 | CNT_INTVAL }, 287936e7d03SDaniel Mack { "LED sound", 31 | CNT_INTVAL }, 288936e7d03SDaniel Mack { "LED esc", 29 | CNT_INTVAL }, 289936e7d03SDaniel Mack { "LED view", 27 | CNT_INTVAL }, 290936e7d03SDaniel Mack { "LED enter", 24 | CNT_INTVAL }, 291936e7d03SDaniel Mack { "LED control", 26 | CNT_INTVAL } 292936e7d03SDaniel Mack }; 293936e7d03SDaniel Mack 294936e7d03SDaniel Mack static struct caiaq_controller a8dj_controller[] = { 295936e7d03SDaniel Mack { "Current input mode", 0 | CNT_INTVAL }, 296936e7d03SDaniel Mack { "GND lift for TC Vinyl mode", 24 + 0 }, 297936e7d03SDaniel Mack { "GND lift for TC CD/Line mode", 24 + 1 }, 298936e7d03SDaniel Mack { "GND lift for phono mode", 24 + 2 }, 299936e7d03SDaniel Mack { "Software lock", 40 } 300936e7d03SDaniel Mack }; 301936e7d03SDaniel Mack 302936e7d03SDaniel Mack static struct caiaq_controller a4dj_controller[] = { 303936e7d03SDaniel Mack { "Current input mode", 0 | CNT_INTVAL } 304936e7d03SDaniel Mack }; 305936e7d03SDaniel Mack 3066da7a2aaSDaniel Mack static struct caiaq_controller kontrolx1_controller[] = { 3076da7a2aaSDaniel Mack { "LED FX A: ON", 7 | CNT_INTVAL }, 3086da7a2aaSDaniel Mack { "LED FX A: 1", 6 | CNT_INTVAL }, 3096da7a2aaSDaniel Mack { "LED FX A: 2", 5 | CNT_INTVAL }, 3106da7a2aaSDaniel Mack { "LED FX A: 3", 4 | CNT_INTVAL }, 3116da7a2aaSDaniel Mack { "LED FX B: ON", 3 | CNT_INTVAL }, 3126da7a2aaSDaniel Mack { "LED FX B: 1", 2 | CNT_INTVAL }, 3136da7a2aaSDaniel Mack { "LED FX B: 2", 1 | CNT_INTVAL }, 3146da7a2aaSDaniel Mack { "LED FX B: 3", 0 | CNT_INTVAL }, 3156da7a2aaSDaniel Mack 3166da7a2aaSDaniel Mack { "LED Hotcue", 28 | CNT_INTVAL }, 3176da7a2aaSDaniel Mack { "LED Shift (white)", 29 | CNT_INTVAL }, 3186da7a2aaSDaniel Mack { "LED Shift (green)", 30 | CNT_INTVAL }, 3196da7a2aaSDaniel Mack 3206da7a2aaSDaniel Mack { "LED Deck A: FX1", 24 | CNT_INTVAL }, 3216da7a2aaSDaniel Mack { "LED Deck A: FX2", 25 | CNT_INTVAL }, 3226da7a2aaSDaniel Mack { "LED Deck A: IN", 17 | CNT_INTVAL }, 3236da7a2aaSDaniel Mack { "LED Deck A: OUT", 16 | CNT_INTVAL }, 3246da7a2aaSDaniel Mack { "LED Deck A: < BEAT", 19 | CNT_INTVAL }, 3256da7a2aaSDaniel Mack { "LED Deck A: BEAT >", 18 | CNT_INTVAL }, 3266da7a2aaSDaniel Mack { "LED Deck A: CUE/ABS", 21 | CNT_INTVAL }, 3276da7a2aaSDaniel Mack { "LED Deck A: CUP/REL", 20 | CNT_INTVAL }, 3286da7a2aaSDaniel Mack { "LED Deck A: PLAY", 23 | CNT_INTVAL }, 3296da7a2aaSDaniel Mack { "LED Deck A: SYNC", 22 | CNT_INTVAL }, 3306da7a2aaSDaniel Mack 3316da7a2aaSDaniel Mack { "LED Deck B: FX1", 26 | CNT_INTVAL }, 3326da7a2aaSDaniel Mack { "LED Deck B: FX2", 27 | CNT_INTVAL }, 3336da7a2aaSDaniel Mack { "LED Deck B: IN", 15 | CNT_INTVAL }, 3346da7a2aaSDaniel Mack { "LED Deck B: OUT", 14 | CNT_INTVAL }, 3356da7a2aaSDaniel Mack { "LED Deck B: < BEAT", 13 | CNT_INTVAL }, 3366da7a2aaSDaniel Mack { "LED Deck B: BEAT >", 12 | CNT_INTVAL }, 3376da7a2aaSDaniel Mack { "LED Deck B: CUE/ABS", 11 | CNT_INTVAL }, 3386da7a2aaSDaniel Mack { "LED Deck B: CUP/REL", 10 | CNT_INTVAL }, 3396da7a2aaSDaniel Mack { "LED Deck B: PLAY", 9 | CNT_INTVAL }, 3406da7a2aaSDaniel Mack { "LED Deck B: SYNC", 8 | CNT_INTVAL }, 3416da7a2aaSDaniel Mack }; 3426da7a2aaSDaniel Mack 34315c5ab60SDaniel Mack static struct caiaq_controller kontrols4_controller[] = { 34415c5ab60SDaniel Mack { "LED: Master: Quant", 10 | CNT_INTVAL }, 34515c5ab60SDaniel Mack { "LED: Master: Headphone", 11 | CNT_INTVAL }, 34615c5ab60SDaniel Mack { "LED: Master: Master", 12 | CNT_INTVAL }, 34715c5ab60SDaniel Mack { "LED: Master: Snap", 14 | CNT_INTVAL }, 34815c5ab60SDaniel Mack { "LED: Master: Warning", 15 | CNT_INTVAL }, 34915c5ab60SDaniel Mack { "LED: Master: Master button", 112 | CNT_INTVAL }, 35015c5ab60SDaniel Mack { "LED: Master: Snap button", 113 | CNT_INTVAL }, 35115c5ab60SDaniel Mack { "LED: Master: Rec", 118 | CNT_INTVAL }, 35215c5ab60SDaniel Mack { "LED: Master: Size", 119 | CNT_INTVAL }, 35315c5ab60SDaniel Mack { "LED: Master: Quant button", 120 | CNT_INTVAL }, 35415c5ab60SDaniel Mack { "LED: Master: Browser button", 121 | CNT_INTVAL }, 35515c5ab60SDaniel Mack { "LED: Master: Play button", 126 | CNT_INTVAL }, 35615c5ab60SDaniel Mack { "LED: Master: Undo button", 127 | CNT_INTVAL }, 35715c5ab60SDaniel Mack 35815c5ab60SDaniel Mack { "LED: Channel A: >", 4 | CNT_INTVAL }, 35915c5ab60SDaniel Mack { "LED: Channel A: <", 5 | CNT_INTVAL }, 36015c5ab60SDaniel Mack { "LED: Channel A: Meter 1", 97 | CNT_INTVAL }, 36115c5ab60SDaniel Mack { "LED: Channel A: Meter 2", 98 | CNT_INTVAL }, 36215c5ab60SDaniel Mack { "LED: Channel A: Meter 3", 99 | CNT_INTVAL }, 36315c5ab60SDaniel Mack { "LED: Channel A: Meter 4", 100 | CNT_INTVAL }, 36415c5ab60SDaniel Mack { "LED: Channel A: Meter 5", 101 | CNT_INTVAL }, 36515c5ab60SDaniel Mack { "LED: Channel A: Meter 6", 102 | CNT_INTVAL }, 36615c5ab60SDaniel Mack { "LED: Channel A: Meter clip", 103 | CNT_INTVAL }, 36715c5ab60SDaniel Mack { "LED: Channel A: Active", 114 | CNT_INTVAL }, 36815c5ab60SDaniel Mack { "LED: Channel A: Cue", 116 | CNT_INTVAL }, 36915c5ab60SDaniel Mack { "LED: Channel A: FX1", 149 | CNT_INTVAL }, 37015c5ab60SDaniel Mack { "LED: Channel A: FX2", 148 | CNT_INTVAL }, 37115c5ab60SDaniel Mack 37215c5ab60SDaniel Mack { "LED: Channel B: >", 2 | CNT_INTVAL }, 37315c5ab60SDaniel Mack { "LED: Channel B: <", 3 | CNT_INTVAL }, 37415c5ab60SDaniel Mack { "LED: Channel B: Meter 1", 89 | CNT_INTVAL }, 37515c5ab60SDaniel Mack { "LED: Channel B: Meter 2", 90 | CNT_INTVAL }, 37615c5ab60SDaniel Mack { "LED: Channel B: Meter 3", 91 | CNT_INTVAL }, 37715c5ab60SDaniel Mack { "LED: Channel B: Meter 4", 92 | CNT_INTVAL }, 37815c5ab60SDaniel Mack { "LED: Channel B: Meter 5", 93 | CNT_INTVAL }, 37915c5ab60SDaniel Mack { "LED: Channel B: Meter 6", 94 | CNT_INTVAL }, 38015c5ab60SDaniel Mack { "LED: Channel B: Meter clip", 95 | CNT_INTVAL }, 38115c5ab60SDaniel Mack { "LED: Channel B: Active", 122 | CNT_INTVAL }, 38215c5ab60SDaniel Mack { "LED: Channel B: Cue", 125 | CNT_INTVAL }, 38315c5ab60SDaniel Mack { "LED: Channel B: FX1", 147 | CNT_INTVAL }, 38415c5ab60SDaniel Mack { "LED: Channel B: FX2", 146 | CNT_INTVAL }, 38515c5ab60SDaniel Mack 38615c5ab60SDaniel Mack { "LED: Channel C: >", 6 | CNT_INTVAL }, 38715c5ab60SDaniel Mack { "LED: Channel C: <", 7 | CNT_INTVAL }, 38815c5ab60SDaniel Mack { "LED: Channel C: Meter 1", 105 | CNT_INTVAL }, 38915c5ab60SDaniel Mack { "LED: Channel C: Meter 2", 106 | CNT_INTVAL }, 39015c5ab60SDaniel Mack { "LED: Channel C: Meter 3", 107 | CNT_INTVAL }, 39115c5ab60SDaniel Mack { "LED: Channel C: Meter 4", 108 | CNT_INTVAL }, 39215c5ab60SDaniel Mack { "LED: Channel C: Meter 5", 109 | CNT_INTVAL }, 39315c5ab60SDaniel Mack { "LED: Channel C: Meter 6", 110 | CNT_INTVAL }, 39415c5ab60SDaniel Mack { "LED: Channel C: Meter clip", 111 | CNT_INTVAL }, 39515c5ab60SDaniel Mack { "LED: Channel C: Active", 115 | CNT_INTVAL }, 39615c5ab60SDaniel Mack { "LED: Channel C: Cue", 117 | CNT_INTVAL }, 39715c5ab60SDaniel Mack { "LED: Channel C: FX1", 151 | CNT_INTVAL }, 39815c5ab60SDaniel Mack { "LED: Channel C: FX2", 150 | CNT_INTVAL }, 39915c5ab60SDaniel Mack 40015c5ab60SDaniel Mack { "LED: Channel D: >", 0 | CNT_INTVAL }, 40115c5ab60SDaniel Mack { "LED: Channel D: <", 1 | CNT_INTVAL }, 40215c5ab60SDaniel Mack { "LED: Channel D: Meter 1", 81 | CNT_INTVAL }, 40315c5ab60SDaniel Mack { "LED: Channel D: Meter 2", 82 | CNT_INTVAL }, 40415c5ab60SDaniel Mack { "LED: Channel D: Meter 3", 83 | CNT_INTVAL }, 40515c5ab60SDaniel Mack { "LED: Channel D: Meter 4", 84 | CNT_INTVAL }, 40615c5ab60SDaniel Mack { "LED: Channel D: Meter 5", 85 | CNT_INTVAL }, 40715c5ab60SDaniel Mack { "LED: Channel D: Meter 6", 86 | CNT_INTVAL }, 40815c5ab60SDaniel Mack { "LED: Channel D: Meter clip", 87 | CNT_INTVAL }, 40915c5ab60SDaniel Mack { "LED: Channel D: Active", 123 | CNT_INTVAL }, 41015c5ab60SDaniel Mack { "LED: Channel D: Cue", 124 | CNT_INTVAL }, 41115c5ab60SDaniel Mack { "LED: Channel D: FX1", 145 | CNT_INTVAL }, 41215c5ab60SDaniel Mack { "LED: Channel D: FX2", 144 | CNT_INTVAL }, 41315c5ab60SDaniel Mack 41415c5ab60SDaniel Mack { "LED: Deck A: 1 (blue)", 22 | CNT_INTVAL }, 41515c5ab60SDaniel Mack { "LED: Deck A: 1 (green)", 23 | CNT_INTVAL }, 41615c5ab60SDaniel Mack { "LED: Deck A: 2 (blue)", 20 | CNT_INTVAL }, 41715c5ab60SDaniel Mack { "LED: Deck A: 2 (green)", 21 | CNT_INTVAL }, 41815c5ab60SDaniel Mack { "LED: Deck A: 3 (blue)", 18 | CNT_INTVAL }, 41915c5ab60SDaniel Mack { "LED: Deck A: 3 (green)", 19 | CNT_INTVAL }, 42015c5ab60SDaniel Mack { "LED: Deck A: 4 (blue)", 16 | CNT_INTVAL }, 42115c5ab60SDaniel Mack { "LED: Deck A: 4 (green)", 17 | CNT_INTVAL }, 42215c5ab60SDaniel Mack { "LED: Deck A: Load", 44 | CNT_INTVAL }, 42315c5ab60SDaniel Mack { "LED: Deck A: Deck C button", 45 | CNT_INTVAL }, 42415c5ab60SDaniel Mack { "LED: Deck A: In", 47 | CNT_INTVAL }, 42515c5ab60SDaniel Mack { "LED: Deck A: Out", 46 | CNT_INTVAL }, 42615c5ab60SDaniel Mack { "LED: Deck A: Shift", 24 | CNT_INTVAL }, 42715c5ab60SDaniel Mack { "LED: Deck A: Sync", 27 | CNT_INTVAL }, 42815c5ab60SDaniel Mack { "LED: Deck A: Cue", 26 | CNT_INTVAL }, 42915c5ab60SDaniel Mack { "LED: Deck A: Play", 25 | CNT_INTVAL }, 43015c5ab60SDaniel Mack { "LED: Deck A: Tempo up", 33 | CNT_INTVAL }, 43115c5ab60SDaniel Mack { "LED: Deck A: Tempo down", 32 | CNT_INTVAL }, 43215c5ab60SDaniel Mack { "LED: Deck A: Master", 34 | CNT_INTVAL }, 43315c5ab60SDaniel Mack { "LED: Deck A: Keylock", 35 | CNT_INTVAL }, 43415c5ab60SDaniel Mack { "LED: Deck A: Deck A", 37 | CNT_INTVAL }, 43515c5ab60SDaniel Mack { "LED: Deck A: Deck C", 36 | CNT_INTVAL }, 43615c5ab60SDaniel Mack { "LED: Deck A: Samples", 38 | CNT_INTVAL }, 43715c5ab60SDaniel Mack { "LED: Deck A: On Air", 39 | CNT_INTVAL }, 43815c5ab60SDaniel Mack { "LED: Deck A: Sample 1", 31 | CNT_INTVAL }, 43915c5ab60SDaniel Mack { "LED: Deck A: Sample 2", 30 | CNT_INTVAL }, 44015c5ab60SDaniel Mack { "LED: Deck A: Sample 3", 29 | CNT_INTVAL }, 44115c5ab60SDaniel Mack { "LED: Deck A: Sample 4", 28 | CNT_INTVAL }, 44215c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - A", 55 | CNT_INTVAL }, 44315c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - B", 54 | CNT_INTVAL }, 44415c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - C", 53 | CNT_INTVAL }, 44515c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - D", 52 | CNT_INTVAL }, 44615c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - E", 51 | CNT_INTVAL }, 44715c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - F", 50 | CNT_INTVAL }, 44815c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - G", 49 | CNT_INTVAL }, 44915c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - dot", 48 | CNT_INTVAL }, 45015c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - A", 63 | CNT_INTVAL }, 45115c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - B", 62 | CNT_INTVAL }, 45215c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - C", 61 | CNT_INTVAL }, 45315c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - D", 60 | CNT_INTVAL }, 45415c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - E", 59 | CNT_INTVAL }, 45515c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - F", 58 | CNT_INTVAL }, 45615c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - G", 57 | CNT_INTVAL }, 45715c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - dot", 56 | CNT_INTVAL }, 45815c5ab60SDaniel Mack 45915c5ab60SDaniel Mack { "LED: Deck B: 1 (blue)", 78 | CNT_INTVAL }, 46015c5ab60SDaniel Mack { "LED: Deck B: 1 (green)", 79 | CNT_INTVAL }, 46115c5ab60SDaniel Mack { "LED: Deck B: 2 (blue)", 76 | CNT_INTVAL }, 46215c5ab60SDaniel Mack { "LED: Deck B: 2 (green)", 77 | CNT_INTVAL }, 46315c5ab60SDaniel Mack { "LED: Deck B: 3 (blue)", 74 | CNT_INTVAL }, 46415c5ab60SDaniel Mack { "LED: Deck B: 3 (green)", 75 | CNT_INTVAL }, 46515c5ab60SDaniel Mack { "LED: Deck B: 4 (blue)", 72 | CNT_INTVAL }, 46615c5ab60SDaniel Mack { "LED: Deck B: 4 (green)", 73 | CNT_INTVAL }, 46715c5ab60SDaniel Mack { "LED: Deck B: Load", 180 | CNT_INTVAL }, 46815c5ab60SDaniel Mack { "LED: Deck B: Deck D button", 181 | CNT_INTVAL }, 46915c5ab60SDaniel Mack { "LED: Deck B: In", 183 | CNT_INTVAL }, 47015c5ab60SDaniel Mack { "LED: Deck B: Out", 182 | CNT_INTVAL }, 47115c5ab60SDaniel Mack { "LED: Deck B: Shift", 64 | CNT_INTVAL }, 47215c5ab60SDaniel Mack { "LED: Deck B: Sync", 67 | CNT_INTVAL }, 47315c5ab60SDaniel Mack { "LED: Deck B: Cue", 66 | CNT_INTVAL }, 47415c5ab60SDaniel Mack { "LED: Deck B: Play", 65 | CNT_INTVAL }, 47515c5ab60SDaniel Mack { "LED: Deck B: Tempo up", 185 | CNT_INTVAL }, 47615c5ab60SDaniel Mack { "LED: Deck B: Tempo down", 184 | CNT_INTVAL }, 47715c5ab60SDaniel Mack { "LED: Deck B: Master", 186 | CNT_INTVAL }, 47815c5ab60SDaniel Mack { "LED: Deck B: Keylock", 187 | CNT_INTVAL }, 47915c5ab60SDaniel Mack { "LED: Deck B: Deck B", 189 | CNT_INTVAL }, 48015c5ab60SDaniel Mack { "LED: Deck B: Deck D", 188 | CNT_INTVAL }, 48115c5ab60SDaniel Mack { "LED: Deck B: Samples", 190 | CNT_INTVAL }, 48215c5ab60SDaniel Mack { "LED: Deck B: On Air", 191 | CNT_INTVAL }, 48315c5ab60SDaniel Mack { "LED: Deck B: Sample 1", 71 | CNT_INTVAL }, 48415c5ab60SDaniel Mack { "LED: Deck B: Sample 2", 70 | CNT_INTVAL }, 48515c5ab60SDaniel Mack { "LED: Deck B: Sample 3", 69 | CNT_INTVAL }, 48615c5ab60SDaniel Mack { "LED: Deck B: Sample 4", 68 | CNT_INTVAL }, 48715c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - A", 175 | CNT_INTVAL }, 48815c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - B", 174 | CNT_INTVAL }, 48915c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - C", 173 | CNT_INTVAL }, 49015c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - D", 172 | CNT_INTVAL }, 49115c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - E", 171 | CNT_INTVAL }, 49215c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - F", 170 | CNT_INTVAL }, 49315c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - G", 169 | CNT_INTVAL }, 49415c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - dot", 168 | CNT_INTVAL }, 49515c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - A", 167 | CNT_INTVAL }, 49615c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - B", 166 | CNT_INTVAL }, 49715c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - C", 165 | CNT_INTVAL }, 49815c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - D", 164 | CNT_INTVAL }, 49915c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - E", 163 | CNT_INTVAL }, 50015c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - F", 162 | CNT_INTVAL }, 50115c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - G", 161 | CNT_INTVAL }, 50215c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - dot", 160 | CNT_INTVAL }, 50315c5ab60SDaniel Mack 50415c5ab60SDaniel Mack { "LED: FX1: dry/wet", 153 | CNT_INTVAL }, 50515c5ab60SDaniel Mack { "LED: FX1: 1", 154 | CNT_INTVAL }, 50615c5ab60SDaniel Mack { "LED: FX1: 2", 155 | CNT_INTVAL }, 50715c5ab60SDaniel Mack { "LED: FX1: 3", 156 | CNT_INTVAL }, 50815c5ab60SDaniel Mack { "LED: FX1: Mode", 157 | CNT_INTVAL }, 50915c5ab60SDaniel Mack { "LED: FX2: dry/wet", 129 | CNT_INTVAL }, 51015c5ab60SDaniel Mack { "LED: FX2: 1", 130 | CNT_INTVAL }, 51115c5ab60SDaniel Mack { "LED: FX2: 2", 131 | CNT_INTVAL }, 51215c5ab60SDaniel Mack { "LED: FX2: 3", 132 | CNT_INTVAL }, 51315c5ab60SDaniel Mack { "LED: FX2: Mode", 133 | CNT_INTVAL }, 51415c5ab60SDaniel Mack }; 51515c5ab60SDaniel Mack 516d2724de1SHannes Gräuler static struct caiaq_controller maschine_controller[] = { 517d2724de1SHannes Gräuler { "LED: Pad 1", 3 | CNT_INTVAL }, 518d2724de1SHannes Gräuler { "LED: Pad 2", 2 | CNT_INTVAL }, 519d2724de1SHannes Gräuler { "LED: Pad 3", 1 | CNT_INTVAL }, 520d2724de1SHannes Gräuler { "LED: Pad 4", 0 | CNT_INTVAL }, 521d2724de1SHannes Gräuler { "LED: Pad 5", 7 | CNT_INTVAL }, 522d2724de1SHannes Gräuler { "LED: Pad 6", 6 | CNT_INTVAL }, 523d2724de1SHannes Gräuler { "LED: Pad 7", 5 | CNT_INTVAL }, 524d2724de1SHannes Gräuler { "LED: Pad 8", 4 | CNT_INTVAL }, 525d2724de1SHannes Gräuler { "LED: Pad 9", 11 | CNT_INTVAL }, 526d2724de1SHannes Gräuler { "LED: Pad 10", 10 | CNT_INTVAL }, 527d2724de1SHannes Gräuler { "LED: Pad 11", 9 | CNT_INTVAL }, 528d2724de1SHannes Gräuler { "LED: Pad 12", 8 | CNT_INTVAL }, 529d2724de1SHannes Gräuler { "LED: Pad 13", 15 | CNT_INTVAL }, 530d2724de1SHannes Gräuler { "LED: Pad 14", 14 | CNT_INTVAL }, 531d2724de1SHannes Gräuler { "LED: Pad 15", 13 | CNT_INTVAL }, 532d2724de1SHannes Gräuler { "LED: Pad 16", 12 | CNT_INTVAL }, 533d2724de1SHannes Gräuler 534d2724de1SHannes Gräuler { "LED: Mute", 16 | CNT_INTVAL }, 535d2724de1SHannes Gräuler { "LED: Solo", 17 | CNT_INTVAL }, 536d2724de1SHannes Gräuler { "LED: Select", 18 | CNT_INTVAL }, 537d2724de1SHannes Gräuler { "LED: Duplicate", 19 | CNT_INTVAL }, 538d2724de1SHannes Gräuler { "LED: Navigate", 20 | CNT_INTVAL }, 539d2724de1SHannes Gräuler { "LED: Pad Mode", 21 | CNT_INTVAL }, 540d2724de1SHannes Gräuler { "LED: Pattern", 22 | CNT_INTVAL }, 541d2724de1SHannes Gräuler { "LED: Scene", 23 | CNT_INTVAL }, 542d2724de1SHannes Gräuler 543d2724de1SHannes Gräuler { "LED: Shift", 24 | CNT_INTVAL }, 544d2724de1SHannes Gräuler { "LED: Erase", 25 | CNT_INTVAL }, 545d2724de1SHannes Gräuler { "LED: Grid", 26 | CNT_INTVAL }, 546d2724de1SHannes Gräuler { "LED: Right Bottom", 27 | CNT_INTVAL }, 547d2724de1SHannes Gräuler { "LED: Rec", 28 | CNT_INTVAL }, 548d2724de1SHannes Gräuler { "LED: Play", 29 | CNT_INTVAL }, 549d2724de1SHannes Gräuler { "LED: Left Bottom", 32 | CNT_INTVAL }, 550d2724de1SHannes Gräuler { "LED: Restart", 33 | CNT_INTVAL }, 551d2724de1SHannes Gräuler 552d2724de1SHannes Gräuler { "LED: Group A", 41 | CNT_INTVAL }, 553d2724de1SHannes Gräuler { "LED: Group B", 40 | CNT_INTVAL }, 554d2724de1SHannes Gräuler { "LED: Group C", 37 | CNT_INTVAL }, 555d2724de1SHannes Gräuler { "LED: Group D", 36 | CNT_INTVAL }, 556d2724de1SHannes Gräuler { "LED: Group E", 39 | CNT_INTVAL }, 557d2724de1SHannes Gräuler { "LED: Group F", 38 | CNT_INTVAL }, 558d2724de1SHannes Gräuler { "LED: Group G", 35 | CNT_INTVAL }, 559d2724de1SHannes Gräuler { "LED: Group H", 34 | CNT_INTVAL }, 560d2724de1SHannes Gräuler 561d2724de1SHannes Gräuler { "LED: Auto Write", 42 | CNT_INTVAL }, 562d2724de1SHannes Gräuler { "LED: Snap", 43 | CNT_INTVAL }, 563d2724de1SHannes Gräuler { "LED: Right Top", 44 | CNT_INTVAL }, 564d2724de1SHannes Gräuler { "LED: Left Top", 45 | CNT_INTVAL }, 565d2724de1SHannes Gräuler { "LED: Sampling", 46 | CNT_INTVAL }, 566d2724de1SHannes Gräuler { "LED: Browse", 47 | CNT_INTVAL }, 567d2724de1SHannes Gräuler { "LED: Step", 48 | CNT_INTVAL }, 568d2724de1SHannes Gräuler { "LED: Control", 49 | CNT_INTVAL }, 569d2724de1SHannes Gräuler 570d2724de1SHannes Gräuler { "LED: Top Button 1", 57 | CNT_INTVAL }, 571d2724de1SHannes Gräuler { "LED: Top Button 2", 56 | CNT_INTVAL }, 572d2724de1SHannes Gräuler { "LED: Top Button 3", 55 | CNT_INTVAL }, 573d2724de1SHannes Gräuler { "LED: Top Button 4", 54 | CNT_INTVAL }, 574d2724de1SHannes Gräuler { "LED: Top Button 5", 53 | CNT_INTVAL }, 575d2724de1SHannes Gräuler { "LED: Top Button 6", 52 | CNT_INTVAL }, 576d2724de1SHannes Gräuler { "LED: Top Button 7", 51 | CNT_INTVAL }, 577d2724de1SHannes Gräuler { "LED: Top Button 8", 50 | CNT_INTVAL }, 578d2724de1SHannes Gräuler 579d2724de1SHannes Gräuler { "LED: Note Repeat", 58 | CNT_INTVAL }, 580d2724de1SHannes Gräuler 581d2724de1SHannes Gräuler { "Backlight Display", 59 | CNT_INTVAL } 582d2724de1SHannes Gräuler }; 583d2724de1SHannes Gräuler 58414c56706SBill Pemberton static int add_controls(struct caiaq_controller *c, int num, 5851c8470ceSDaniel Mack struct snd_usb_caiaqdev *cdev) 586936e7d03SDaniel Mack { 587936e7d03SDaniel Mack int i, ret; 588936e7d03SDaniel Mack struct snd_kcontrol *kc; 589936e7d03SDaniel Mack 590936e7d03SDaniel Mack for (i = 0; i < num; i++, c++) { 591936e7d03SDaniel Mack kcontrol_template.name = c->name; 592936e7d03SDaniel Mack kcontrol_template.private_value = c->index; 5931c8470ceSDaniel Mack kc = snd_ctl_new1(&kcontrol_template, cdev); 5941c8470ceSDaniel Mack ret = snd_ctl_add(cdev->chip.card, kc); 595936e7d03SDaniel Mack if (ret < 0) 596936e7d03SDaniel Mack return ret; 597936e7d03SDaniel Mack } 598936e7d03SDaniel Mack 599936e7d03SDaniel Mack return 0; 600936e7d03SDaniel Mack } 601936e7d03SDaniel Mack 6021c8470ceSDaniel Mack int snd_usb_caiaq_control_init(struct snd_usb_caiaqdev *cdev) 603936e7d03SDaniel Mack { 604936e7d03SDaniel Mack int ret = 0; 605936e7d03SDaniel Mack 6061c8470ceSDaniel Mack switch (cdev->chip.usb_id) { 607936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1): 608936e7d03SDaniel Mack ret = add_controls(ak1_controller, 6091c8470ceSDaniel Mack ARRAY_SIZE(ak1_controller), cdev); 610936e7d03SDaniel Mack break; 611936e7d03SDaniel Mack 612936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL2): 613936e7d03SDaniel Mack ret = add_controls(rk2_controller, 6141c8470ceSDaniel Mack ARRAY_SIZE(rk2_controller), cdev); 615936e7d03SDaniel Mack break; 616936e7d03SDaniel Mack 617936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3): 618936e7d03SDaniel Mack ret = add_controls(rk3_controller, 6191c8470ceSDaniel Mack ARRAY_SIZE(rk3_controller), cdev); 620936e7d03SDaniel Mack break; 621936e7d03SDaniel Mack 622936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): 623936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2): 624936e7d03SDaniel Mack ret = add_controls(kore_controller, 6251c8470ceSDaniel Mack ARRAY_SIZE(kore_controller), cdev); 626936e7d03SDaniel Mack break; 627936e7d03SDaniel Mack 628936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): 629936e7d03SDaniel Mack ret = add_controls(a8dj_controller, 6301c8470ceSDaniel Mack ARRAY_SIZE(a8dj_controller), cdev); 631936e7d03SDaniel Mack break; 6326da7a2aaSDaniel Mack 633936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): 634936e7d03SDaniel Mack ret = add_controls(a4dj_controller, 6351c8470ceSDaniel Mack ARRAY_SIZE(a4dj_controller), cdev); 636936e7d03SDaniel Mack break; 6376da7a2aaSDaniel Mack 6386da7a2aaSDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1): 6396da7a2aaSDaniel Mack ret = add_controls(kontrolx1_controller, 6401c8470ceSDaniel Mack ARRAY_SIZE(kontrolx1_controller), cdev); 6416da7a2aaSDaniel Mack break; 64215c5ab60SDaniel Mack 64315c5ab60SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLS4): 64415c5ab60SDaniel Mack ret = add_controls(kontrols4_controller, 6451c8470ceSDaniel Mack ARRAY_SIZE(kontrols4_controller), cdev); 64615c5ab60SDaniel Mack break; 647d2724de1SHannes Gräuler 648d2724de1SHannes Gräuler case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER): 649d2724de1SHannes Gräuler ret = add_controls(maschine_controller, 650d2724de1SHannes Gräuler ARRAY_SIZE(maschine_controller), cdev); 651d2724de1SHannes Gräuler break; 652936e7d03SDaniel Mack } 653936e7d03SDaniel Mack 654936e7d03SDaniel Mack return ret; 655936e7d03SDaniel Mack } 656936e7d03SDaniel Mack 657