mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Fixes for the iCON Qcon mcp device - LED rings. Submitted by Michal Barhon : mbarhon@seznam.cz
This commit is contained in:
parent
16a5e3ce55
commit
3aacdd79ae
6 changed files with 64 additions and 13 deletions
|
|
@ -35,6 +35,7 @@ Led::factory (Surface& surface, int id, const char* name, Group& group)
|
||||||
{
|
{
|
||||||
Led* l = new Led (id, name, group);
|
Led* l = new Led (id, name, group);
|
||||||
surface.leds[id] = l;
|
surface.leds[id] = l;
|
||||||
|
l->is_qcon = surface.get_qcon_flag(); // get qcon flag from surface
|
||||||
surface.controls.push_back (l);
|
surface.controls.push_back (l);
|
||||||
group.add (*l);
|
group.add (*l);
|
||||||
return l;
|
return l;
|
||||||
|
|
@ -55,8 +56,17 @@ Led::set_state (LedState new_state)
|
||||||
msg = 0x00;
|
msg = 0x00;
|
||||||
break;
|
break;
|
||||||
case LedState::flashing:
|
case LedState::flashing:
|
||||||
|
|
||||||
|
if( !is_qcon ) { // Standard mackie surfaces supports flashing LEDs
|
||||||
msg = 0x01;
|
msg = 0x01;
|
||||||
break;
|
break;
|
||||||
|
} else {
|
||||||
|
msg = 0x7f; // For qcon set LED to ON state - qcon don't support LED flashing.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case LedState::none:
|
case LedState::none:
|
||||||
return MidiByteArray ();
|
return MidiByteArray ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,9 @@ public:
|
||||||
|
|
||||||
static Control* factory (Surface&, int id, const char*, Group&);
|
static Control* factory (Surface&, int id, const char*, Group&);
|
||||||
|
|
||||||
|
// qcon flag
|
||||||
|
bool is_qcon;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LedState state;
|
LedState state;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ Pot::factory (Surface& surface, int id, const char* name, Group& group)
|
||||||
{
|
{
|
||||||
Pot* p = new Pot (id, name, group);
|
Pot* p = new Pot (id, name, group);
|
||||||
surface.pots[id] = p;
|
surface.pots[id] = p;
|
||||||
|
p->is_qcon = surface.get_qcon_flag();
|
||||||
surface.controls.push_back (p);
|
surface.controls.push_back (p);
|
||||||
group.add (*p);
|
group.add (*p);
|
||||||
return p;
|
return p;
|
||||||
|
|
@ -43,11 +44,30 @@ Pot::set (float val, bool onoff, Mode mode)
|
||||||
{
|
{
|
||||||
// TODO do an exact calc for 0.50? To allow manually re-centering the port.
|
// TODO do an exact calc for 0.50? To allow manually re-centering the port.
|
||||||
|
|
||||||
|
MIDI::byte msg;
|
||||||
|
|
||||||
// center on if val is "very close" to 0.50
|
// center on if val is "very close" to 0.50
|
||||||
MIDI::byte msg = (val > 0.48 && val < 0.58 ? 1 : 0) << 6;
|
if( !is_qcon ) {
|
||||||
|
// center the position and shift bits for standard mackie surface
|
||||||
|
msg = (val > 0.48 && val < 0.58 ? 1 : 0) << 6;
|
||||||
|
} else { //center the position and don't shift anything for qcon - TODO: on center position lit the center LED on the ring
|
||||||
|
if(val > 0.48 && val < 0.58) {
|
||||||
|
val = 0.50;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set msg
|
||||||
|
msg = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Pot/LED mode
|
// Pot/LED mode
|
||||||
|
if( !is_qcon ) {
|
||||||
|
// Mackie mode - Supports all ring modes
|
||||||
msg |= (mode << 4);
|
msg |= (mode << 4);
|
||||||
|
} else {
|
||||||
|
// Qcon rotary mode - Only "DOT" mode? - TODO: Investigate how to proper set vpot rings to different modes on qcon
|
||||||
|
msg |= (0 << 4);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Even though a width value may be negative, there is
|
* Even though a width value may be negative, there is
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,8 @@ public:
|
||||||
|
|
||||||
static Control* factory (Surface&, int id, const char*, Group&);
|
static Control* factory (Surface&, int id, const char*, Group&);
|
||||||
|
|
||||||
|
bool is_qcon;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,13 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui
|
||||||
throw failed_constructor ();
|
throw failed_constructor ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Store Qcon flag
|
||||||
|
if( mcp.device_info().is_qcon() ) {
|
||||||
|
is_qcon = true;
|
||||||
|
} else {
|
||||||
|
is_qcon = false;
|
||||||
|
}
|
||||||
|
|
||||||
/* only the first Surface object has global controls */
|
/* only the first Surface object has global controls */
|
||||||
/* lets use master_position instead */
|
/* lets use master_position instead */
|
||||||
uint32_t mp = _mcp.device_info().master_position();
|
uint32_t mp = _mcp.device_info().master_position();
|
||||||
|
|
@ -1044,6 +1051,8 @@ Surface::show_two_char_display (unsigned int value, const std::string & /*dots*/
|
||||||
void
|
void
|
||||||
Surface::display_timecode (const std::string & timecode, const std::string & last_timecode)
|
Surface::display_timecode (const std::string & timecode, const std::string & last_timecode)
|
||||||
{
|
{
|
||||||
|
//TODO: Fix for Qcon to correct timecode value if is over 1000 bars
|
||||||
|
|
||||||
if (!_active || !_mcp.device_info().has_timecode_display()) {
|
if (!_active || !_mcp.device_info().has_timecode_display()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1288,6 +1297,7 @@ Surface::set_touch_sensitivity (int sensitivity)
|
||||||
|
|
||||||
/* sensitivity already clamped by caller */
|
/* sensitivity already clamped by caller */
|
||||||
|
|
||||||
|
if( !is_qcon ) { // Qcon doesn't support fader sensitivity
|
||||||
if (_port) {
|
if (_port) {
|
||||||
MidiByteArray msg;
|
MidiByteArray msg;
|
||||||
|
|
||||||
|
|
@ -1303,6 +1313,7 @@ Surface::set_touch_sensitivity (int sensitivity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Surface::hui_heartbeat ()
|
Surface::hui_heartbeat ()
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,8 @@ public:
|
||||||
XMLNode& get_state ();
|
XMLNode& get_state ();
|
||||||
int set_state (const XMLNode&, int version);
|
int set_state (const XMLNode&, int version);
|
||||||
|
|
||||||
|
bool get_qcon_flag() { return is_qcon; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MackieControlProtocol& _mcp;
|
MackieControlProtocol& _mcp;
|
||||||
SurfacePort* _port;
|
SurfacePort* _port;
|
||||||
|
|
@ -206,6 +208,9 @@ public:
|
||||||
|
|
||||||
int connection_state;
|
int connection_state;
|
||||||
|
|
||||||
|
// QCon Flag
|
||||||
|
bool is_qcon = false;
|
||||||
|
|
||||||
MidiByteArray display_line (std::string const& msg, int line_num);
|
MidiByteArray display_line (std::string const& msg, int line_num);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue