New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual device #41

Merged
merged 122 commits into from Oct 2, 2017
Commits
Jump to file or symbol
Failed to load files and symbols.
+120 −4
Diff settings

Always

Just for now

Viewing a subset of changes. View all

jam: add device layout info

Feedback IDs remain todo, but inputs from UI seem to be working fine

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
  • Loading branch information...
harryhaaren committed Oct 1, 2017
commit 0f49cac920b5412c91a0c5ae263f57101875bfdb
@@ -123,6 +123,96 @@ static const char *ni_maschine_jam_control_names[] = {
#define CONTROL_NAMES_SIZE (sizeof(ni_maschine_jam_control_names) /\
sizeof(ni_maschine_jam_control_names[0]))
#define JAM_BTN (CTLRA_ITEM_BUTTON | CTLRA_ITEM_LED_INTENSITY | CTLRA_ITEM_LED_COLOR | CTLRA_ITEM_HAS_FB_ID)
static struct ctlra_item_info_t buttons_info[] = {
/* song, step, pad mode, clear, duplicate */
{.x = 10, .y = 20, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 10, .y = 39, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 10, .y = 54, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 10, .y = 68, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 10, .y = 82, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
/* Up Left Right Down */
{.x = 16, .y = 120, .w = 8, .h = 8, .flags = JAM_BTN, .fb_id = 1},
{.x = 6, .y = 130, .w = 8, .h = 8, .flags = JAM_BTN, .fb_id = 1},
{.x = 26, .y = 130, .w = 8, .h = 8, .flags = JAM_BTN, .fb_id = 1},
{.x = 16, .y = 140, .w = 8, .h = 8, .flags = JAM_BTN, .fb_id = 1},
/* Note Repeat, macro, level, aux */
{.x = 10, .y = 160, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 10, .y = 184, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 10, .y = 196, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 10, .y = 209, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
/* control, auto, shift */
{.x = 10, .y = 228, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 10, .y = 240, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 10, .y = 260, .w = 20, .h = 10, .flags = JAM_BTN, .fb_id = 1},
/* play rec < > */
{.x = 50, .y = 260, .w = 20, .h = 10, .flags = JAM_BTN, .fb_id = 1},
{.x = 78, .y = 260, .w = 20, .h = 10, .flags = JAM_BTN, .fb_id = 1},
{.x = 107, .y = 260, .w = 20, .h = 10, .flags = JAM_BTN, .fb_id = 1},
{.x = 136, .y = 260, .w = 20, .h = 10, .flags = JAM_BTN, .fb_id = 1},
/* Tempo, Grid, Solo, Mute */
{.x = 164, .y = 260, .w = 20, .h = 10, .flags = JAM_BTN, .fb_id = 1},
{.x = 192, .y = 260, .w = 20, .h = 10, .flags = JAM_BTN, .fb_id = 1},
{.x = 221, .y = 260, .w = 20, .h = 10, .flags = JAM_BTN, .fb_id = 1},
{.x = 250, .y = 260, .w = 20, .h = 10, .flags = JAM_BTN, .fb_id = 1},
/* Select, Swing, Tune, Lock */
{.x = 290, .y = 260, .w = 20, .h = 10, .flags = JAM_BTN, .fb_id = 1},
{.x = 290, .y = 240, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 290, .y = 227, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
/* Lock, notes, perform, browse */
{.x = 290, .y = 208, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 290, .y = 196, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 290, .y = 184, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 290, .y = 160, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
/* Encoder Touch, press, etc */
{.x = 290, .y = 120, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 290, .y = 148, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 1},
/* In 1, Headphone, Mst, Grp */
{.x = 290, .y = 100, .w = 6, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 304, .y = 100, .w = 6, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 290, .y = 82, .w = 6, .h = 6, .flags = JAM_BTN, .fb_id = 1},
{.x = 304, .y = 82, .w = 6, .h = 6, .flags = JAM_BTN, .fb_id = 1},
/* 1,2,3,4 */
{.x = 50, .y = 20, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 78, .y = 20, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 107, .y = 20, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 136, .y = 20, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
/* 5,6,7,8 */
{.x = 164, .y = 20, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 192, .y = 20, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 221, .y = 20, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 250, .y = 20, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
/* a, b, c, d */
{.x = 50, .y = 160, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 78, .y = 160, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 107, .y = 160, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 136, .y = 160, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
/* 5,6,7,8 */
{.x = 164, .y = 160, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 192, .y = 160, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 221, .y = 160, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
{.x = 250, .y = 160, .w = 20, .h = 6, .flags = JAM_BTN, .fb_id = 0},
};
static struct ctlra_item_info_t sliders_info[] = {
/* 8 touch faders left-to-right */
{.x = 52, .y = 185, .w = 16, .h = 65, .flags = CTLRA_ITEM_FADER},
{.x = 81, .y = 185, .w = 16, .h = 65, .flags = CTLRA_ITEM_FADER},
{.x = 110, .y = 185, .w = 16, .h = 65, .flags = CTLRA_ITEM_FADER},
{.x = 137, .y = 185, .w = 16, .h = 65, .flags = CTLRA_ITEM_FADER},
/* */
{.x = 165, .y = 185, .w = 16, .h = 65, .flags = CTLRA_ITEM_FADER},
{.x = 196, .y = 185, .w = 16, .h = 65, .flags = CTLRA_ITEM_FADER},
{.x = 224, .y = 185, .w = 16, .h = 65, .flags = CTLRA_ITEM_FADER},
{.x = 256, .y = 185, .w = 16, .h = 65, .flags = CTLRA_ITEM_FADER},
};
static struct ctlra_item_info_t encoder_info[] = {
/* 8 touch faders left-to-right */
{.x = 287, .y = 125, .w = 24, .h = 24, .flags = CTLRA_ITEM_ENCODER},
};
enum BTN_T {
NI_MASCHINE_JAM_BTN_SONG,
NI_MASCHINE_JAM_BTN_STEP,
@@ -783,13 +873,32 @@ struct ctlra_dev_info_t ctlra_ni_maschine_jam_info = {
.control_count[CTLRA_EVENT_BUTTON] = BUTTONS_SIZE,
.control_count[CTLRA_EVENT_SLIDER] = SLIDERS_SIZE,
.control_count[CTLRA_EVENT_ENCODER] = 1,
//.control_count[CTLRA_FEEDBACK_ITEM] = FEEDBACK_SIZE,
.control_count[CTLRA_EVENT_GRID] = 1,
.control_info[CTLRA_EVENT_BUTTON] = buttons_info,
.control_info[CTLRA_EVENT_SLIDER] = sliders_info,
.control_info[CTLRA_EVENT_ENCODER] = encoder_info,
//.control_info[CTLRA_EVENT_BUTTON] = buttons_info,
//.control_info[CTLRA_EVENT_SLIDER] = sliders_info,
//.control_info[CTLRA_EVENT_ENCODER] = sliders_info,
//.control_count[CTLRA_FEEDBACK_ITEM] = FEEDBACK_SIZE,
//.control_info[CTLRA_FEEDBACK_ITEM] = feedback_info,
.grid_info[0] = {
.rgb = 1,
.x = 8,
.y = 8,
.info = {
.x = 51,
.y = 39,
.w = 215,
.h = 100,
/* TODO: Figure out the light mappings */
/* start light id */
//.params[0] = NI_MASCHINE_MIKRO_MK2_LED_PAD_1,
/* end light id */
//.params[1] = NI_MASCHINE_MIKRO_MK2_LED_PAD_16,
}
},
.get_name = ni_maschine_jam_control_get_name,
};
@@ -90,6 +90,13 @@ int main(int argc, char** argv)
int num_devs = ctlra_probe(ctlra, accept_dev_func, &dummy);
printf("vegas_mode: connected devices: %d\n", num_devs);
int ret = ctlra_dev_virtualize(ctlra, "Native Instruments", "Maschine Mikro Mk2");
if(ret) {
printf("failed to virtualize dev\n");
exit(0);
}
audio_init(&dummy);
while(!done) {
ProTip! Use n and p to navigate between commits in a pull request.