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 31*d2724de1SHannes 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]; 1036da7a2aaSDaniel Mack unsigned char cmd = EP1_CMD_WRITE_IO; 104936e7d03SDaniel Mack 1051c8470ceSDaniel Mack if (cdev->chip.usb_id == 1064efd7d8fSMark Hills USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1)) 1076da7a2aaSDaniel Mack cmd = EP1_CMD_DIMM_LEDS; 1086da7a2aaSDaniel Mack 109*d2724de1SHannes Gräuler if (cdev->chip.usb_id == 110*d2724de1SHannes Gräuler USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER)) 111*d2724de1SHannes Gräuler cmd = EP1_CMD_DIMM_LEDS; 112*d2724de1SHannes Gräuler 113936e7d03SDaniel Mack if (pos & CNT_INTVAL) { 11415c5ab60SDaniel Mack int i = pos & ~CNT_INTVAL; 11515c5ab60SDaniel Mack 1161c8470ceSDaniel Mack cdev->control_state[i] = v; 11715c5ab60SDaniel Mack 1181c8470ceSDaniel Mack if (cdev->chip.usb_id == 11915c5ab60SDaniel Mack USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLS4)) { 12015c5ab60SDaniel Mack int actual_len; 12115c5ab60SDaniel Mack 1221c8470ceSDaniel Mack cdev->ep8_out_buf[0] = i; 1231c8470ceSDaniel Mack cdev->ep8_out_buf[1] = v; 12415c5ab60SDaniel Mack 1251c8470ceSDaniel Mack usb_bulk_msg(cdev->chip.dev, 1261c8470ceSDaniel Mack usb_sndbulkpipe(cdev->chip.dev, 8), 1271c8470ceSDaniel Mack cdev->ep8_out_buf, sizeof(cdev->ep8_out_buf), 12815c5ab60SDaniel Mack &actual_len, 200); 129*d2724de1SHannes Gräuler } else if (cdev->chip.usb_id == 130*d2724de1SHannes Gräuler USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER)) { 131*d2724de1SHannes Gräuler 132*d2724de1SHannes Gräuler int bank = 0; 133*d2724de1SHannes Gräuler int offset = 0; 134*d2724de1SHannes Gräuler 135*d2724de1SHannes Gräuler if (i >= MASCHINE_BANK_SIZE) { 136*d2724de1SHannes Gräuler bank = 0x1e; 137*d2724de1SHannes Gräuler offset = MASCHINE_BANK_SIZE; 138*d2724de1SHannes Gräuler } 139*d2724de1SHannes Gräuler 140*d2724de1SHannes Gräuler snd_usb_caiaq_send_command_bank(cdev, cmd, bank, 141*d2724de1SHannes Gräuler cdev->control_state + offset, 142*d2724de1SHannes Gräuler MASCHINE_BANK_SIZE); 14315c5ab60SDaniel Mack } else { 1441c8470ceSDaniel Mack snd_usb_caiaq_send_command(cdev, cmd, 1451c8470ceSDaniel Mack cdev->control_state, sizeof(cdev->control_state)); 14615c5ab60SDaniel Mack } 147936e7d03SDaniel Mack } else { 14815c5ab60SDaniel Mack if (v) 1491c8470ceSDaniel Mack cdev->control_state[pos / 8] |= 1 << (pos % 8); 150936e7d03SDaniel Mack else 1511c8470ceSDaniel Mack cdev->control_state[pos / 8] &= ~(1 << (pos % 8)); 152936e7d03SDaniel Mack 1531c8470ceSDaniel Mack snd_usb_caiaq_send_command(cdev, cmd, 1541c8470ceSDaniel Mack cdev->control_state, sizeof(cdev->control_state)); 155936e7d03SDaniel Mack } 156936e7d03SDaniel Mack 157936e7d03SDaniel Mack return 1; 158936e7d03SDaniel Mack } 159936e7d03SDaniel Mack 16014c56706SBill Pemberton static struct snd_kcontrol_new kcontrol_template = { 161936e7d03SDaniel Mack .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, 162936e7d03SDaniel Mack .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, 163936e7d03SDaniel Mack .index = 0, 164936e7d03SDaniel Mack .info = control_info, 165936e7d03SDaniel Mack .get = control_get, 166936e7d03SDaniel Mack .put = control_put, 167936e7d03SDaniel Mack /* name and private_value filled later */ 168936e7d03SDaniel Mack }; 169936e7d03SDaniel Mack 170936e7d03SDaniel Mack struct caiaq_controller { 171936e7d03SDaniel Mack char *name; 172936e7d03SDaniel Mack int index; 173936e7d03SDaniel Mack }; 174936e7d03SDaniel Mack 175936e7d03SDaniel Mack static struct caiaq_controller ak1_controller[] = { 176936e7d03SDaniel Mack { "LED left", 2 }, 177936e7d03SDaniel Mack { "LED middle", 1 }, 178936e7d03SDaniel Mack { "LED right", 0 }, 179936e7d03SDaniel Mack { "LED ring", 3 } 180936e7d03SDaniel Mack }; 181936e7d03SDaniel Mack 182936e7d03SDaniel Mack static struct caiaq_controller rk2_controller[] = { 183936e7d03SDaniel Mack { "LED 1", 5 }, 184936e7d03SDaniel Mack { "LED 2", 4 }, 185936e7d03SDaniel Mack { "LED 3", 3 }, 186936e7d03SDaniel Mack { "LED 4", 2 }, 187936e7d03SDaniel Mack { "LED 5", 1 }, 188936e7d03SDaniel Mack { "LED 6", 0 }, 189936e7d03SDaniel Mack { "LED pedal", 6 }, 190936e7d03SDaniel Mack { "LED 7seg_1b", 8 }, 191936e7d03SDaniel Mack { "LED 7seg_1c", 9 }, 192936e7d03SDaniel Mack { "LED 7seg_2a", 10 }, 193936e7d03SDaniel Mack { "LED 7seg_2b", 11 }, 194936e7d03SDaniel Mack { "LED 7seg_2c", 12 }, 195936e7d03SDaniel Mack { "LED 7seg_2d", 13 }, 196936e7d03SDaniel Mack { "LED 7seg_2e", 14 }, 197936e7d03SDaniel Mack { "LED 7seg_2f", 15 }, 198936e7d03SDaniel Mack { "LED 7seg_2g", 16 }, 199936e7d03SDaniel Mack { "LED 7seg_3a", 17 }, 200936e7d03SDaniel Mack { "LED 7seg_3b", 18 }, 201936e7d03SDaniel Mack { "LED 7seg_3c", 19 }, 202936e7d03SDaniel Mack { "LED 7seg_3d", 20 }, 203936e7d03SDaniel Mack { "LED 7seg_3e", 21 }, 204936e7d03SDaniel Mack { "LED 7seg_3f", 22 }, 205936e7d03SDaniel Mack { "LED 7seg_3g", 23 } 206936e7d03SDaniel Mack }; 207936e7d03SDaniel Mack 208936e7d03SDaniel Mack static struct caiaq_controller rk3_controller[] = { 209936e7d03SDaniel Mack { "LED 7seg_1a", 0 + 0 }, 210936e7d03SDaniel Mack { "LED 7seg_1b", 0 + 1 }, 211936e7d03SDaniel Mack { "LED 7seg_1c", 0 + 2 }, 212936e7d03SDaniel Mack { "LED 7seg_1d", 0 + 3 }, 213936e7d03SDaniel Mack { "LED 7seg_1e", 0 + 4 }, 214936e7d03SDaniel Mack { "LED 7seg_1f", 0 + 5 }, 215936e7d03SDaniel Mack { "LED 7seg_1g", 0 + 6 }, 216936e7d03SDaniel Mack { "LED 7seg_1p", 0 + 7 }, 217936e7d03SDaniel Mack 218936e7d03SDaniel Mack { "LED 7seg_2a", 8 + 0 }, 219936e7d03SDaniel Mack { "LED 7seg_2b", 8 + 1 }, 220936e7d03SDaniel Mack { "LED 7seg_2c", 8 + 2 }, 221936e7d03SDaniel Mack { "LED 7seg_2d", 8 + 3 }, 222936e7d03SDaniel Mack { "LED 7seg_2e", 8 + 4 }, 223936e7d03SDaniel Mack { "LED 7seg_2f", 8 + 5 }, 224936e7d03SDaniel Mack { "LED 7seg_2g", 8 + 6 }, 225936e7d03SDaniel Mack { "LED 7seg_2p", 8 + 7 }, 226936e7d03SDaniel Mack 227936e7d03SDaniel Mack { "LED 7seg_3a", 16 + 0 }, 228936e7d03SDaniel Mack { "LED 7seg_3b", 16 + 1 }, 229936e7d03SDaniel Mack { "LED 7seg_3c", 16 + 2 }, 230936e7d03SDaniel Mack { "LED 7seg_3d", 16 + 3 }, 231936e7d03SDaniel Mack { "LED 7seg_3e", 16 + 4 }, 232936e7d03SDaniel Mack { "LED 7seg_3f", 16 + 5 }, 233936e7d03SDaniel Mack { "LED 7seg_3g", 16 + 6 }, 234936e7d03SDaniel Mack { "LED 7seg_3p", 16 + 7 }, 235936e7d03SDaniel Mack 236936e7d03SDaniel Mack { "LED 7seg_4a", 24 + 0 }, 237936e7d03SDaniel Mack { "LED 7seg_4b", 24 + 1 }, 238936e7d03SDaniel Mack { "LED 7seg_4c", 24 + 2 }, 239936e7d03SDaniel Mack { "LED 7seg_4d", 24 + 3 }, 240936e7d03SDaniel Mack { "LED 7seg_4e", 24 + 4 }, 241936e7d03SDaniel Mack { "LED 7seg_4f", 24 + 5 }, 242936e7d03SDaniel Mack { "LED 7seg_4g", 24 + 6 }, 243936e7d03SDaniel Mack { "LED 7seg_4p", 24 + 7 }, 244936e7d03SDaniel Mack 245936e7d03SDaniel Mack { "LED 1", 32 + 0 }, 246936e7d03SDaniel Mack { "LED 2", 32 + 1 }, 247936e7d03SDaniel Mack { "LED 3", 32 + 2 }, 248936e7d03SDaniel Mack { "LED 4", 32 + 3 }, 249936e7d03SDaniel Mack { "LED 5", 32 + 4 }, 250936e7d03SDaniel Mack { "LED 6", 32 + 5 }, 251936e7d03SDaniel Mack { "LED 7", 32 + 6 }, 252936e7d03SDaniel Mack { "LED 8", 32 + 7 }, 253936e7d03SDaniel Mack { "LED pedal", 32 + 8 } 254936e7d03SDaniel Mack }; 255936e7d03SDaniel Mack 256936e7d03SDaniel Mack static struct caiaq_controller kore_controller[] = { 257936e7d03SDaniel Mack { "LED F1", 8 | CNT_INTVAL }, 258936e7d03SDaniel Mack { "LED F2", 12 | CNT_INTVAL }, 259936e7d03SDaniel Mack { "LED F3", 0 | CNT_INTVAL }, 260936e7d03SDaniel Mack { "LED F4", 4 | CNT_INTVAL }, 261936e7d03SDaniel Mack { "LED F5", 11 | CNT_INTVAL }, 262936e7d03SDaniel Mack { "LED F6", 15 | CNT_INTVAL }, 263936e7d03SDaniel Mack { "LED F7", 3 | CNT_INTVAL }, 264936e7d03SDaniel Mack { "LED F8", 7 | CNT_INTVAL }, 265936e7d03SDaniel Mack { "LED touch1", 10 | CNT_INTVAL }, 266936e7d03SDaniel Mack { "LED touch2", 14 | CNT_INTVAL }, 267936e7d03SDaniel Mack { "LED touch3", 2 | CNT_INTVAL }, 268936e7d03SDaniel Mack { "LED touch4", 6 | CNT_INTVAL }, 269936e7d03SDaniel Mack { "LED touch5", 9 | CNT_INTVAL }, 270936e7d03SDaniel Mack { "LED touch6", 13 | CNT_INTVAL }, 271936e7d03SDaniel Mack { "LED touch7", 1 | CNT_INTVAL }, 272936e7d03SDaniel Mack { "LED touch8", 5 | CNT_INTVAL }, 273936e7d03SDaniel Mack { "LED left", 18 | CNT_INTVAL }, 274936e7d03SDaniel Mack { "LED right", 22 | CNT_INTVAL }, 275936e7d03SDaniel Mack { "LED up", 16 | CNT_INTVAL }, 276936e7d03SDaniel Mack { "LED down", 20 | CNT_INTVAL }, 277936e7d03SDaniel Mack { "LED stop", 23 | CNT_INTVAL }, 278936e7d03SDaniel Mack { "LED play", 21 | CNT_INTVAL }, 279936e7d03SDaniel Mack { "LED record", 19 | CNT_INTVAL }, 280936e7d03SDaniel Mack { "LED listen", 17 | CNT_INTVAL }, 281936e7d03SDaniel Mack { "LED lcd", 30 | CNT_INTVAL }, 282936e7d03SDaniel Mack { "LED menu", 28 | CNT_INTVAL }, 283936e7d03SDaniel Mack { "LED sound", 31 | CNT_INTVAL }, 284936e7d03SDaniel Mack { "LED esc", 29 | CNT_INTVAL }, 285936e7d03SDaniel Mack { "LED view", 27 | CNT_INTVAL }, 286936e7d03SDaniel Mack { "LED enter", 24 | CNT_INTVAL }, 287936e7d03SDaniel Mack { "LED control", 26 | CNT_INTVAL } 288936e7d03SDaniel Mack }; 289936e7d03SDaniel Mack 290936e7d03SDaniel Mack static struct caiaq_controller a8dj_controller[] = { 291936e7d03SDaniel Mack { "Current input mode", 0 | CNT_INTVAL }, 292936e7d03SDaniel Mack { "GND lift for TC Vinyl mode", 24 + 0 }, 293936e7d03SDaniel Mack { "GND lift for TC CD/Line mode", 24 + 1 }, 294936e7d03SDaniel Mack { "GND lift for phono mode", 24 + 2 }, 295936e7d03SDaniel Mack { "Software lock", 40 } 296936e7d03SDaniel Mack }; 297936e7d03SDaniel Mack 298936e7d03SDaniel Mack static struct caiaq_controller a4dj_controller[] = { 299936e7d03SDaniel Mack { "Current input mode", 0 | CNT_INTVAL } 300936e7d03SDaniel Mack }; 301936e7d03SDaniel Mack 3026da7a2aaSDaniel Mack static struct caiaq_controller kontrolx1_controller[] = { 3036da7a2aaSDaniel Mack { "LED FX A: ON", 7 | CNT_INTVAL }, 3046da7a2aaSDaniel Mack { "LED FX A: 1", 6 | CNT_INTVAL }, 3056da7a2aaSDaniel Mack { "LED FX A: 2", 5 | CNT_INTVAL }, 3066da7a2aaSDaniel Mack { "LED FX A: 3", 4 | CNT_INTVAL }, 3076da7a2aaSDaniel Mack { "LED FX B: ON", 3 | CNT_INTVAL }, 3086da7a2aaSDaniel Mack { "LED FX B: 1", 2 | CNT_INTVAL }, 3096da7a2aaSDaniel Mack { "LED FX B: 2", 1 | CNT_INTVAL }, 3106da7a2aaSDaniel Mack { "LED FX B: 3", 0 | CNT_INTVAL }, 3116da7a2aaSDaniel Mack 3126da7a2aaSDaniel Mack { "LED Hotcue", 28 | CNT_INTVAL }, 3136da7a2aaSDaniel Mack { "LED Shift (white)", 29 | CNT_INTVAL }, 3146da7a2aaSDaniel Mack { "LED Shift (green)", 30 | CNT_INTVAL }, 3156da7a2aaSDaniel Mack 3166da7a2aaSDaniel Mack { "LED Deck A: FX1", 24 | CNT_INTVAL }, 3176da7a2aaSDaniel Mack { "LED Deck A: FX2", 25 | CNT_INTVAL }, 3186da7a2aaSDaniel Mack { "LED Deck A: IN", 17 | CNT_INTVAL }, 3196da7a2aaSDaniel Mack { "LED Deck A: OUT", 16 | CNT_INTVAL }, 3206da7a2aaSDaniel Mack { "LED Deck A: < BEAT", 19 | CNT_INTVAL }, 3216da7a2aaSDaniel Mack { "LED Deck A: BEAT >", 18 | CNT_INTVAL }, 3226da7a2aaSDaniel Mack { "LED Deck A: CUE/ABS", 21 | CNT_INTVAL }, 3236da7a2aaSDaniel Mack { "LED Deck A: CUP/REL", 20 | CNT_INTVAL }, 3246da7a2aaSDaniel Mack { "LED Deck A: PLAY", 23 | CNT_INTVAL }, 3256da7a2aaSDaniel Mack { "LED Deck A: SYNC", 22 | CNT_INTVAL }, 3266da7a2aaSDaniel Mack 3276da7a2aaSDaniel Mack { "LED Deck B: FX1", 26 | CNT_INTVAL }, 3286da7a2aaSDaniel Mack { "LED Deck B: FX2", 27 | CNT_INTVAL }, 3296da7a2aaSDaniel Mack { "LED Deck B: IN", 15 | CNT_INTVAL }, 3306da7a2aaSDaniel Mack { "LED Deck B: OUT", 14 | CNT_INTVAL }, 3316da7a2aaSDaniel Mack { "LED Deck B: < BEAT", 13 | CNT_INTVAL }, 3326da7a2aaSDaniel Mack { "LED Deck B: BEAT >", 12 | CNT_INTVAL }, 3336da7a2aaSDaniel Mack { "LED Deck B: CUE/ABS", 11 | CNT_INTVAL }, 3346da7a2aaSDaniel Mack { "LED Deck B: CUP/REL", 10 | CNT_INTVAL }, 3356da7a2aaSDaniel Mack { "LED Deck B: PLAY", 9 | CNT_INTVAL }, 3366da7a2aaSDaniel Mack { "LED Deck B: SYNC", 8 | CNT_INTVAL }, 3376da7a2aaSDaniel Mack }; 3386da7a2aaSDaniel Mack 33915c5ab60SDaniel Mack static struct caiaq_controller kontrols4_controller[] = { 34015c5ab60SDaniel Mack { "LED: Master: Quant", 10 | CNT_INTVAL }, 34115c5ab60SDaniel Mack { "LED: Master: Headphone", 11 | CNT_INTVAL }, 34215c5ab60SDaniel Mack { "LED: Master: Master", 12 | CNT_INTVAL }, 34315c5ab60SDaniel Mack { "LED: Master: Snap", 14 | CNT_INTVAL }, 34415c5ab60SDaniel Mack { "LED: Master: Warning", 15 | CNT_INTVAL }, 34515c5ab60SDaniel Mack { "LED: Master: Master button", 112 | CNT_INTVAL }, 34615c5ab60SDaniel Mack { "LED: Master: Snap button", 113 | CNT_INTVAL }, 34715c5ab60SDaniel Mack { "LED: Master: Rec", 118 | CNT_INTVAL }, 34815c5ab60SDaniel Mack { "LED: Master: Size", 119 | CNT_INTVAL }, 34915c5ab60SDaniel Mack { "LED: Master: Quant button", 120 | CNT_INTVAL }, 35015c5ab60SDaniel Mack { "LED: Master: Browser button", 121 | CNT_INTVAL }, 35115c5ab60SDaniel Mack { "LED: Master: Play button", 126 | CNT_INTVAL }, 35215c5ab60SDaniel Mack { "LED: Master: Undo button", 127 | CNT_INTVAL }, 35315c5ab60SDaniel Mack 35415c5ab60SDaniel Mack { "LED: Channel A: >", 4 | CNT_INTVAL }, 35515c5ab60SDaniel Mack { "LED: Channel A: <", 5 | CNT_INTVAL }, 35615c5ab60SDaniel Mack { "LED: Channel A: Meter 1", 97 | CNT_INTVAL }, 35715c5ab60SDaniel Mack { "LED: Channel A: Meter 2", 98 | CNT_INTVAL }, 35815c5ab60SDaniel Mack { "LED: Channel A: Meter 3", 99 | CNT_INTVAL }, 35915c5ab60SDaniel Mack { "LED: Channel A: Meter 4", 100 | CNT_INTVAL }, 36015c5ab60SDaniel Mack { "LED: Channel A: Meter 5", 101 | CNT_INTVAL }, 36115c5ab60SDaniel Mack { "LED: Channel A: Meter 6", 102 | CNT_INTVAL }, 36215c5ab60SDaniel Mack { "LED: Channel A: Meter clip", 103 | CNT_INTVAL }, 36315c5ab60SDaniel Mack { "LED: Channel A: Active", 114 | CNT_INTVAL }, 36415c5ab60SDaniel Mack { "LED: Channel A: Cue", 116 | CNT_INTVAL }, 36515c5ab60SDaniel Mack { "LED: Channel A: FX1", 149 | CNT_INTVAL }, 36615c5ab60SDaniel Mack { "LED: Channel A: FX2", 148 | CNT_INTVAL }, 36715c5ab60SDaniel Mack 36815c5ab60SDaniel Mack { "LED: Channel B: >", 2 | CNT_INTVAL }, 36915c5ab60SDaniel Mack { "LED: Channel B: <", 3 | CNT_INTVAL }, 37015c5ab60SDaniel Mack { "LED: Channel B: Meter 1", 89 | CNT_INTVAL }, 37115c5ab60SDaniel Mack { "LED: Channel B: Meter 2", 90 | CNT_INTVAL }, 37215c5ab60SDaniel Mack { "LED: Channel B: Meter 3", 91 | CNT_INTVAL }, 37315c5ab60SDaniel Mack { "LED: Channel B: Meter 4", 92 | CNT_INTVAL }, 37415c5ab60SDaniel Mack { "LED: Channel B: Meter 5", 93 | CNT_INTVAL }, 37515c5ab60SDaniel Mack { "LED: Channel B: Meter 6", 94 | CNT_INTVAL }, 37615c5ab60SDaniel Mack { "LED: Channel B: Meter clip", 95 | CNT_INTVAL }, 37715c5ab60SDaniel Mack { "LED: Channel B: Active", 122 | CNT_INTVAL }, 37815c5ab60SDaniel Mack { "LED: Channel B: Cue", 125 | CNT_INTVAL }, 37915c5ab60SDaniel Mack { "LED: Channel B: FX1", 147 | CNT_INTVAL }, 38015c5ab60SDaniel Mack { "LED: Channel B: FX2", 146 | CNT_INTVAL }, 38115c5ab60SDaniel Mack 38215c5ab60SDaniel Mack { "LED: Channel C: >", 6 | CNT_INTVAL }, 38315c5ab60SDaniel Mack { "LED: Channel C: <", 7 | CNT_INTVAL }, 38415c5ab60SDaniel Mack { "LED: Channel C: Meter 1", 105 | CNT_INTVAL }, 38515c5ab60SDaniel Mack { "LED: Channel C: Meter 2", 106 | CNT_INTVAL }, 38615c5ab60SDaniel Mack { "LED: Channel C: Meter 3", 107 | CNT_INTVAL }, 38715c5ab60SDaniel Mack { "LED: Channel C: Meter 4", 108 | CNT_INTVAL }, 38815c5ab60SDaniel Mack { "LED: Channel C: Meter 5", 109 | CNT_INTVAL }, 38915c5ab60SDaniel Mack { "LED: Channel C: Meter 6", 110 | CNT_INTVAL }, 39015c5ab60SDaniel Mack { "LED: Channel C: Meter clip", 111 | CNT_INTVAL }, 39115c5ab60SDaniel Mack { "LED: Channel C: Active", 115 | CNT_INTVAL }, 39215c5ab60SDaniel Mack { "LED: Channel C: Cue", 117 | CNT_INTVAL }, 39315c5ab60SDaniel Mack { "LED: Channel C: FX1", 151 | CNT_INTVAL }, 39415c5ab60SDaniel Mack { "LED: Channel C: FX2", 150 | CNT_INTVAL }, 39515c5ab60SDaniel Mack 39615c5ab60SDaniel Mack { "LED: Channel D: >", 0 | CNT_INTVAL }, 39715c5ab60SDaniel Mack { "LED: Channel D: <", 1 | CNT_INTVAL }, 39815c5ab60SDaniel Mack { "LED: Channel D: Meter 1", 81 | CNT_INTVAL }, 39915c5ab60SDaniel Mack { "LED: Channel D: Meter 2", 82 | CNT_INTVAL }, 40015c5ab60SDaniel Mack { "LED: Channel D: Meter 3", 83 | CNT_INTVAL }, 40115c5ab60SDaniel Mack { "LED: Channel D: Meter 4", 84 | CNT_INTVAL }, 40215c5ab60SDaniel Mack { "LED: Channel D: Meter 5", 85 | CNT_INTVAL }, 40315c5ab60SDaniel Mack { "LED: Channel D: Meter 6", 86 | CNT_INTVAL }, 40415c5ab60SDaniel Mack { "LED: Channel D: Meter clip", 87 | CNT_INTVAL }, 40515c5ab60SDaniel Mack { "LED: Channel D: Active", 123 | CNT_INTVAL }, 40615c5ab60SDaniel Mack { "LED: Channel D: Cue", 124 | CNT_INTVAL }, 40715c5ab60SDaniel Mack { "LED: Channel D: FX1", 145 | CNT_INTVAL }, 40815c5ab60SDaniel Mack { "LED: Channel D: FX2", 144 | CNT_INTVAL }, 40915c5ab60SDaniel Mack 41015c5ab60SDaniel Mack { "LED: Deck A: 1 (blue)", 22 | CNT_INTVAL }, 41115c5ab60SDaniel Mack { "LED: Deck A: 1 (green)", 23 | CNT_INTVAL }, 41215c5ab60SDaniel Mack { "LED: Deck A: 2 (blue)", 20 | CNT_INTVAL }, 41315c5ab60SDaniel Mack { "LED: Deck A: 2 (green)", 21 | CNT_INTVAL }, 41415c5ab60SDaniel Mack { "LED: Deck A: 3 (blue)", 18 | CNT_INTVAL }, 41515c5ab60SDaniel Mack { "LED: Deck A: 3 (green)", 19 | CNT_INTVAL }, 41615c5ab60SDaniel Mack { "LED: Deck A: 4 (blue)", 16 | CNT_INTVAL }, 41715c5ab60SDaniel Mack { "LED: Deck A: 4 (green)", 17 | CNT_INTVAL }, 41815c5ab60SDaniel Mack { "LED: Deck A: Load", 44 | CNT_INTVAL }, 41915c5ab60SDaniel Mack { "LED: Deck A: Deck C button", 45 | CNT_INTVAL }, 42015c5ab60SDaniel Mack { "LED: Deck A: In", 47 | CNT_INTVAL }, 42115c5ab60SDaniel Mack { "LED: Deck A: Out", 46 | CNT_INTVAL }, 42215c5ab60SDaniel Mack { "LED: Deck A: Shift", 24 | CNT_INTVAL }, 42315c5ab60SDaniel Mack { "LED: Deck A: Sync", 27 | CNT_INTVAL }, 42415c5ab60SDaniel Mack { "LED: Deck A: Cue", 26 | CNT_INTVAL }, 42515c5ab60SDaniel Mack { "LED: Deck A: Play", 25 | CNT_INTVAL }, 42615c5ab60SDaniel Mack { "LED: Deck A: Tempo up", 33 | CNT_INTVAL }, 42715c5ab60SDaniel Mack { "LED: Deck A: Tempo down", 32 | CNT_INTVAL }, 42815c5ab60SDaniel Mack { "LED: Deck A: Master", 34 | CNT_INTVAL }, 42915c5ab60SDaniel Mack { "LED: Deck A: Keylock", 35 | CNT_INTVAL }, 43015c5ab60SDaniel Mack { "LED: Deck A: Deck A", 37 | CNT_INTVAL }, 43115c5ab60SDaniel Mack { "LED: Deck A: Deck C", 36 | CNT_INTVAL }, 43215c5ab60SDaniel Mack { "LED: Deck A: Samples", 38 | CNT_INTVAL }, 43315c5ab60SDaniel Mack { "LED: Deck A: On Air", 39 | CNT_INTVAL }, 43415c5ab60SDaniel Mack { "LED: Deck A: Sample 1", 31 | CNT_INTVAL }, 43515c5ab60SDaniel Mack { "LED: Deck A: Sample 2", 30 | CNT_INTVAL }, 43615c5ab60SDaniel Mack { "LED: Deck A: Sample 3", 29 | CNT_INTVAL }, 43715c5ab60SDaniel Mack { "LED: Deck A: Sample 4", 28 | CNT_INTVAL }, 43815c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - A", 55 | CNT_INTVAL }, 43915c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - B", 54 | CNT_INTVAL }, 44015c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - C", 53 | CNT_INTVAL }, 44115c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - D", 52 | CNT_INTVAL }, 44215c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - E", 51 | CNT_INTVAL }, 44315c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - F", 50 | CNT_INTVAL }, 44415c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - G", 49 | CNT_INTVAL }, 44515c5ab60SDaniel Mack { "LED: Deck A: Digit 1 - dot", 48 | CNT_INTVAL }, 44615c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - A", 63 | CNT_INTVAL }, 44715c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - B", 62 | CNT_INTVAL }, 44815c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - C", 61 | CNT_INTVAL }, 44915c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - D", 60 | CNT_INTVAL }, 45015c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - E", 59 | CNT_INTVAL }, 45115c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - F", 58 | CNT_INTVAL }, 45215c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - G", 57 | CNT_INTVAL }, 45315c5ab60SDaniel Mack { "LED: Deck A: Digit 2 - dot", 56 | CNT_INTVAL }, 45415c5ab60SDaniel Mack 45515c5ab60SDaniel Mack { "LED: Deck B: 1 (blue)", 78 | CNT_INTVAL }, 45615c5ab60SDaniel Mack { "LED: Deck B: 1 (green)", 79 | CNT_INTVAL }, 45715c5ab60SDaniel Mack { "LED: Deck B: 2 (blue)", 76 | CNT_INTVAL }, 45815c5ab60SDaniel Mack { "LED: Deck B: 2 (green)", 77 | CNT_INTVAL }, 45915c5ab60SDaniel Mack { "LED: Deck B: 3 (blue)", 74 | CNT_INTVAL }, 46015c5ab60SDaniel Mack { "LED: Deck B: 3 (green)", 75 | CNT_INTVAL }, 46115c5ab60SDaniel Mack { "LED: Deck B: 4 (blue)", 72 | CNT_INTVAL }, 46215c5ab60SDaniel Mack { "LED: Deck B: 4 (green)", 73 | CNT_INTVAL }, 46315c5ab60SDaniel Mack { "LED: Deck B: Load", 180 | CNT_INTVAL }, 46415c5ab60SDaniel Mack { "LED: Deck B: Deck D button", 181 | CNT_INTVAL }, 46515c5ab60SDaniel Mack { "LED: Deck B: In", 183 | CNT_INTVAL }, 46615c5ab60SDaniel Mack { "LED: Deck B: Out", 182 | CNT_INTVAL }, 46715c5ab60SDaniel Mack { "LED: Deck B: Shift", 64 | CNT_INTVAL }, 46815c5ab60SDaniel Mack { "LED: Deck B: Sync", 67 | CNT_INTVAL }, 46915c5ab60SDaniel Mack { "LED: Deck B: Cue", 66 | CNT_INTVAL }, 47015c5ab60SDaniel Mack { "LED: Deck B: Play", 65 | CNT_INTVAL }, 47115c5ab60SDaniel Mack { "LED: Deck B: Tempo up", 185 | CNT_INTVAL }, 47215c5ab60SDaniel Mack { "LED: Deck B: Tempo down", 184 | CNT_INTVAL }, 47315c5ab60SDaniel Mack { "LED: Deck B: Master", 186 | CNT_INTVAL }, 47415c5ab60SDaniel Mack { "LED: Deck B: Keylock", 187 | CNT_INTVAL }, 47515c5ab60SDaniel Mack { "LED: Deck B: Deck B", 189 | CNT_INTVAL }, 47615c5ab60SDaniel Mack { "LED: Deck B: Deck D", 188 | CNT_INTVAL }, 47715c5ab60SDaniel Mack { "LED: Deck B: Samples", 190 | CNT_INTVAL }, 47815c5ab60SDaniel Mack { "LED: Deck B: On Air", 191 | CNT_INTVAL }, 47915c5ab60SDaniel Mack { "LED: Deck B: Sample 1", 71 | CNT_INTVAL }, 48015c5ab60SDaniel Mack { "LED: Deck B: Sample 2", 70 | CNT_INTVAL }, 48115c5ab60SDaniel Mack { "LED: Deck B: Sample 3", 69 | CNT_INTVAL }, 48215c5ab60SDaniel Mack { "LED: Deck B: Sample 4", 68 | CNT_INTVAL }, 48315c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - A", 175 | CNT_INTVAL }, 48415c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - B", 174 | CNT_INTVAL }, 48515c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - C", 173 | CNT_INTVAL }, 48615c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - D", 172 | CNT_INTVAL }, 48715c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - E", 171 | CNT_INTVAL }, 48815c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - F", 170 | CNT_INTVAL }, 48915c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - G", 169 | CNT_INTVAL }, 49015c5ab60SDaniel Mack { "LED: Deck B: Digit 1 - dot", 168 | CNT_INTVAL }, 49115c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - A", 167 | CNT_INTVAL }, 49215c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - B", 166 | CNT_INTVAL }, 49315c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - C", 165 | CNT_INTVAL }, 49415c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - D", 164 | CNT_INTVAL }, 49515c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - E", 163 | CNT_INTVAL }, 49615c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - F", 162 | CNT_INTVAL }, 49715c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - G", 161 | CNT_INTVAL }, 49815c5ab60SDaniel Mack { "LED: Deck B: Digit 2 - dot", 160 | CNT_INTVAL }, 49915c5ab60SDaniel Mack 50015c5ab60SDaniel Mack { "LED: FX1: dry/wet", 153 | CNT_INTVAL }, 50115c5ab60SDaniel Mack { "LED: FX1: 1", 154 | CNT_INTVAL }, 50215c5ab60SDaniel Mack { "LED: FX1: 2", 155 | CNT_INTVAL }, 50315c5ab60SDaniel Mack { "LED: FX1: 3", 156 | CNT_INTVAL }, 50415c5ab60SDaniel Mack { "LED: FX1: Mode", 157 | CNT_INTVAL }, 50515c5ab60SDaniel Mack { "LED: FX2: dry/wet", 129 | CNT_INTVAL }, 50615c5ab60SDaniel Mack { "LED: FX2: 1", 130 | CNT_INTVAL }, 50715c5ab60SDaniel Mack { "LED: FX2: 2", 131 | CNT_INTVAL }, 50815c5ab60SDaniel Mack { "LED: FX2: 3", 132 | CNT_INTVAL }, 50915c5ab60SDaniel Mack { "LED: FX2: Mode", 133 | CNT_INTVAL }, 51015c5ab60SDaniel Mack }; 51115c5ab60SDaniel Mack 512*d2724de1SHannes Gräuler static struct caiaq_controller maschine_controller[] = { 513*d2724de1SHannes Gräuler { "LED: Pad 1", 3 | CNT_INTVAL }, 514*d2724de1SHannes Gräuler { "LED: Pad 2", 2 | CNT_INTVAL }, 515*d2724de1SHannes Gräuler { "LED: Pad 3", 1 | CNT_INTVAL }, 516*d2724de1SHannes Gräuler { "LED: Pad 4", 0 | CNT_INTVAL }, 517*d2724de1SHannes Gräuler { "LED: Pad 5", 7 | CNT_INTVAL }, 518*d2724de1SHannes Gräuler { "LED: Pad 6", 6 | CNT_INTVAL }, 519*d2724de1SHannes Gräuler { "LED: Pad 7", 5 | CNT_INTVAL }, 520*d2724de1SHannes Gräuler { "LED: Pad 8", 4 | CNT_INTVAL }, 521*d2724de1SHannes Gräuler { "LED: Pad 9", 11 | CNT_INTVAL }, 522*d2724de1SHannes Gräuler { "LED: Pad 10", 10 | CNT_INTVAL }, 523*d2724de1SHannes Gräuler { "LED: Pad 11", 9 | CNT_INTVAL }, 524*d2724de1SHannes Gräuler { "LED: Pad 12", 8 | CNT_INTVAL }, 525*d2724de1SHannes Gräuler { "LED: Pad 13", 15 | CNT_INTVAL }, 526*d2724de1SHannes Gräuler { "LED: Pad 14", 14 | CNT_INTVAL }, 527*d2724de1SHannes Gräuler { "LED: Pad 15", 13 | CNT_INTVAL }, 528*d2724de1SHannes Gräuler { "LED: Pad 16", 12 | CNT_INTVAL }, 529*d2724de1SHannes Gräuler 530*d2724de1SHannes Gräuler { "LED: Mute", 16 | CNT_INTVAL }, 531*d2724de1SHannes Gräuler { "LED: Solo", 17 | CNT_INTVAL }, 532*d2724de1SHannes Gräuler { "LED: Select", 18 | CNT_INTVAL }, 533*d2724de1SHannes Gräuler { "LED: Duplicate", 19 | CNT_INTVAL }, 534*d2724de1SHannes Gräuler { "LED: Navigate", 20 | CNT_INTVAL }, 535*d2724de1SHannes Gräuler { "LED: Pad Mode", 21 | CNT_INTVAL }, 536*d2724de1SHannes Gräuler { "LED: Pattern", 22 | CNT_INTVAL }, 537*d2724de1SHannes Gräuler { "LED: Scene", 23 | CNT_INTVAL }, 538*d2724de1SHannes Gräuler 539*d2724de1SHannes Gräuler { "LED: Shift", 24 | CNT_INTVAL }, 540*d2724de1SHannes Gräuler { "LED: Erase", 25 | CNT_INTVAL }, 541*d2724de1SHannes Gräuler { "LED: Grid", 26 | CNT_INTVAL }, 542*d2724de1SHannes Gräuler { "LED: Right Bottom", 27 | CNT_INTVAL }, 543*d2724de1SHannes Gräuler { "LED: Rec", 28 | CNT_INTVAL }, 544*d2724de1SHannes Gräuler { "LED: Play", 29 | CNT_INTVAL }, 545*d2724de1SHannes Gräuler { "LED: Left Bottom", 32 | CNT_INTVAL }, 546*d2724de1SHannes Gräuler { "LED: Restart", 33 | CNT_INTVAL }, 547*d2724de1SHannes Gräuler 548*d2724de1SHannes Gräuler { "LED: Group A", 41 | CNT_INTVAL }, 549*d2724de1SHannes Gräuler { "LED: Group B", 40 | CNT_INTVAL }, 550*d2724de1SHannes Gräuler { "LED: Group C", 37 | CNT_INTVAL }, 551*d2724de1SHannes Gräuler { "LED: Group D", 36 | CNT_INTVAL }, 552*d2724de1SHannes Gräuler { "LED: Group E", 39 | CNT_INTVAL }, 553*d2724de1SHannes Gräuler { "LED: Group F", 38 | CNT_INTVAL }, 554*d2724de1SHannes Gräuler { "LED: Group G", 35 | CNT_INTVAL }, 555*d2724de1SHannes Gräuler { "LED: Group H", 34 | CNT_INTVAL }, 556*d2724de1SHannes Gräuler 557*d2724de1SHannes Gräuler { "LED: Auto Write", 42 | CNT_INTVAL }, 558*d2724de1SHannes Gräuler { "LED: Snap", 43 | CNT_INTVAL }, 559*d2724de1SHannes Gräuler { "LED: Right Top", 44 | CNT_INTVAL }, 560*d2724de1SHannes Gräuler { "LED: Left Top", 45 | CNT_INTVAL }, 561*d2724de1SHannes Gräuler { "LED: Sampling", 46 | CNT_INTVAL }, 562*d2724de1SHannes Gräuler { "LED: Browse", 47 | CNT_INTVAL }, 563*d2724de1SHannes Gräuler { "LED: Step", 48 | CNT_INTVAL }, 564*d2724de1SHannes Gräuler { "LED: Control", 49 | CNT_INTVAL }, 565*d2724de1SHannes Gräuler 566*d2724de1SHannes Gräuler { "LED: Top Button 1", 57 | CNT_INTVAL }, 567*d2724de1SHannes Gräuler { "LED: Top Button 2", 56 | CNT_INTVAL }, 568*d2724de1SHannes Gräuler { "LED: Top Button 3", 55 | CNT_INTVAL }, 569*d2724de1SHannes Gräuler { "LED: Top Button 4", 54 | CNT_INTVAL }, 570*d2724de1SHannes Gräuler { "LED: Top Button 5", 53 | CNT_INTVAL }, 571*d2724de1SHannes Gräuler { "LED: Top Button 6", 52 | CNT_INTVAL }, 572*d2724de1SHannes Gräuler { "LED: Top Button 7", 51 | CNT_INTVAL }, 573*d2724de1SHannes Gräuler { "LED: Top Button 8", 50 | CNT_INTVAL }, 574*d2724de1SHannes Gräuler 575*d2724de1SHannes Gräuler { "LED: Note Repeat", 58 | CNT_INTVAL }, 576*d2724de1SHannes Gräuler 577*d2724de1SHannes Gräuler { "Backlight Display", 59 | CNT_INTVAL } 578*d2724de1SHannes Gräuler }; 579*d2724de1SHannes Gräuler 58014c56706SBill Pemberton static int add_controls(struct caiaq_controller *c, int num, 5811c8470ceSDaniel Mack struct snd_usb_caiaqdev *cdev) 582936e7d03SDaniel Mack { 583936e7d03SDaniel Mack int i, ret; 584936e7d03SDaniel Mack struct snd_kcontrol *kc; 585936e7d03SDaniel Mack 586936e7d03SDaniel Mack for (i = 0; i < num; i++, c++) { 587936e7d03SDaniel Mack kcontrol_template.name = c->name; 588936e7d03SDaniel Mack kcontrol_template.private_value = c->index; 5891c8470ceSDaniel Mack kc = snd_ctl_new1(&kcontrol_template, cdev); 5901c8470ceSDaniel Mack ret = snd_ctl_add(cdev->chip.card, kc); 591936e7d03SDaniel Mack if (ret < 0) 592936e7d03SDaniel Mack return ret; 593936e7d03SDaniel Mack } 594936e7d03SDaniel Mack 595936e7d03SDaniel Mack return 0; 596936e7d03SDaniel Mack } 597936e7d03SDaniel Mack 5981c8470ceSDaniel Mack int snd_usb_caiaq_control_init(struct snd_usb_caiaqdev *cdev) 599936e7d03SDaniel Mack { 600936e7d03SDaniel Mack int ret = 0; 601936e7d03SDaniel Mack 6021c8470ceSDaniel Mack switch (cdev->chip.usb_id) { 603936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1): 604936e7d03SDaniel Mack ret = add_controls(ak1_controller, 6051c8470ceSDaniel Mack ARRAY_SIZE(ak1_controller), cdev); 606936e7d03SDaniel Mack break; 607936e7d03SDaniel Mack 608936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL2): 609936e7d03SDaniel Mack ret = add_controls(rk2_controller, 6101c8470ceSDaniel Mack ARRAY_SIZE(rk2_controller), cdev); 611936e7d03SDaniel Mack break; 612936e7d03SDaniel Mack 613936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3): 614936e7d03SDaniel Mack ret = add_controls(rk3_controller, 6151c8470ceSDaniel Mack ARRAY_SIZE(rk3_controller), cdev); 616936e7d03SDaniel Mack break; 617936e7d03SDaniel Mack 618936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): 619936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2): 620936e7d03SDaniel Mack ret = add_controls(kore_controller, 6211c8470ceSDaniel Mack ARRAY_SIZE(kore_controller), cdev); 622936e7d03SDaniel Mack break; 623936e7d03SDaniel Mack 624936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): 625936e7d03SDaniel Mack ret = add_controls(a8dj_controller, 6261c8470ceSDaniel Mack ARRAY_SIZE(a8dj_controller), cdev); 627936e7d03SDaniel Mack break; 6286da7a2aaSDaniel Mack 629936e7d03SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): 630936e7d03SDaniel Mack ret = add_controls(a4dj_controller, 6311c8470ceSDaniel Mack ARRAY_SIZE(a4dj_controller), cdev); 632936e7d03SDaniel Mack break; 6336da7a2aaSDaniel Mack 6346da7a2aaSDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1): 6356da7a2aaSDaniel Mack ret = add_controls(kontrolx1_controller, 6361c8470ceSDaniel Mack ARRAY_SIZE(kontrolx1_controller), cdev); 6376da7a2aaSDaniel Mack break; 63815c5ab60SDaniel Mack 63915c5ab60SDaniel Mack case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLS4): 64015c5ab60SDaniel Mack ret = add_controls(kontrols4_controller, 6411c8470ceSDaniel Mack ARRAY_SIZE(kontrols4_controller), cdev); 64215c5ab60SDaniel Mack break; 643*d2724de1SHannes Gräuler 644*d2724de1SHannes Gräuler case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER): 645*d2724de1SHannes Gräuler ret = add_controls(maschine_controller, 646*d2724de1SHannes Gräuler ARRAY_SIZE(maschine_controller), cdev); 647*d2724de1SHannes Gräuler break; 648936e7d03SDaniel Mack } 649936e7d03SDaniel Mack 650936e7d03SDaniel Mack return ret; 651936e7d03SDaniel Mack } 652936e7d03SDaniel Mack 653