7 static const u8 turntable_id
[] = {0x03, 0x00, 0xa4, 0x20, 0x01, 0x03};
9 static const u16 turntable_button_bitmasks
[] =
11 Turntable::BUTTON_L_GREEN
,
12 Turntable::BUTTON_L_RED
,
13 Turntable::BUTTON_L_BLUE
,
14 Turntable::BUTTON_R_GREEN
,
15 Turntable::BUTTON_R_RED
,
16 Turntable::BUTTON_R_BLUE
,
17 Turntable::BUTTON_MINUS
,
18 Turntable::BUTTON_PLUS
,
19 Turntable::BUTTON_EUPHORIA
,
22 static const char* const turntable_button_names
[] =
24 "Green Left", "Red Left", "Blue Left",
25 "Green Right", "Red Right", "Blue Right",
29 Turntable::Turntable() : Attachment("Turntable")
32 // TODO: separate buttons into Left and Right
33 groups
.push_back(m_buttons
= new Buttons("Buttons"));
34 for (unsigned int i
= 0; i
< sizeof(turntable_button_names
)/sizeof(*turntable_button_names
); ++i
)
35 m_buttons
->controls
.push_back(new ControlGroup::Input( turntable_button_names
[i
]));
38 groups
.push_back(m_stick
= new AnalogStick("Stick"));
41 groups
.push_back(m_effect_dial
= new Triggers("Effect"));
42 m_effect_dial
->controls
.push_back(new ControlGroup::Input("Dial"));
50 memcpy(®
[0xfa], turntable_id
, sizeof(turntable_id
));
53 void Turntable::GetState(u8
* const data
, const bool focus
)
55 wm_turntable_extension
* const ttdata
= (wm_turntable_extension
*)data
;
61 m_stick
->GetState(&x
, &y
, 0x20, focus
? 0x1F /*0x15*/ : 0);
71 //m_left_turntable->GetState(&tt .....);
74 ttdata
->ltable2
= tt
<< 5;
81 //m_right_turntable->GetState(&tt .....);
84 ttdata
->rtable2
= tt
<< 1;
85 ttdata
->rtable3
= tt
<< 3;
86 ttdata
->rtable4
= tt
<< 5;
92 m_effect_dial
->GetState(&dial
, focus
? 0xF : 0);
95 ttdata
->dial2
= dial
<< 3;
102 //m_crossfade_slider->GetState(&cfs .....);
104 ttdata
->slider
= cfs
;
110 m_buttons
->GetState(&ttdata
->bt
, turntable_button_bitmasks
);
113 // flip button bits :/
115 BUTTON_L_GREEN
| BUTTON_L_RED
| BUTTON_L_BLUE
|
116 BUTTON_R_GREEN
| BUTTON_R_RED
| BUTTON_R_BLUE
|
117 BUTTON_MINUS
| BUTTON_PLUS
| BUTTON_EUPHORIA