mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-01 03:17:39 +01:00
pass a Strip & to strip_display instead of integer. Implement and use strip_display_blank.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2186 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
3451e48530
commit
aee603ea9d
4 changed files with 23 additions and 14 deletions
|
|
@ -1,4 +1,5 @@
|
|||
* if mackie wheel moves too fast, it's ignored.
|
||||
* active (pressed?) state for controls, including timeout
|
||||
* update manual with jog wheel states
|
||||
* alsa/sequencer ports unstable. possibly problems with use of ::poll
|
||||
* use glib::timeout for check_scrubbing
|
||||
|
|
|
|||
|
|
@ -1003,7 +1003,6 @@ void MackieControlProtocol::notify_name_changed( void *, RouteSignal * route_sig
|
|||
if ( !strip.is_master() )
|
||||
{
|
||||
string line1;
|
||||
string line2;
|
||||
string fullname = route_signal->route().name();
|
||||
|
||||
if ( fullname.length() <= 6 )
|
||||
|
|
@ -1013,14 +1012,13 @@ void MackieControlProtocol::notify_name_changed( void *, RouteSignal * route_sig
|
|||
else
|
||||
{
|
||||
line1 = PBD::short_version( fullname, 6 );
|
||||
line2 = fullname.substr( fullname.length() - 6, 6 );
|
||||
}
|
||||
|
||||
route_signal->port().write_sysex(
|
||||
builder.strip_display( strip.index(), 0, line1 )
|
||||
builder.strip_display( strip, 0, line1 )
|
||||
);
|
||||
route_signal->port().write_sysex(
|
||||
builder.strip_display( strip.index(), 1, line2 )
|
||||
builder.strip_display_blank( strip, 1 )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,8 @@ MidiByteArray MackieMidiBuilder::zero_strip( const Strip & strip )
|
|||
if ( control.accepts_feedback() )
|
||||
retval << zero_control( control );
|
||||
}
|
||||
retval << strip_display_blank( strip, 0 );
|
||||
retval << strip_display_blank( strip, 1 );
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -172,30 +174,35 @@ MidiByteArray MackieMidiBuilder::two_char_display( unsigned int value, const std
|
|||
return two_char_display( os.str() );
|
||||
}
|
||||
|
||||
MidiByteArray MackieMidiBuilder::strip_display( unsigned int strip_index, unsigned int line_number, const std::string & line )
|
||||
MidiByteArray MackieMidiBuilder::strip_display_blank( const Strip & strip, unsigned int line_number )
|
||||
{
|
||||
// 6 spaces, not 7 because strip_display adds a space where appropriate
|
||||
return strip_display( strip, line_number, " " );
|
||||
}
|
||||
|
||||
MidiByteArray MackieMidiBuilder::strip_display( const Strip & strip, unsigned int line_number, const std::string & line )
|
||||
{
|
||||
if ( line_number > 1 )
|
||||
{
|
||||
throw runtime_error( "line_number must be 0 or 1" );
|
||||
}
|
||||
|
||||
if ( strip_index > 7 )
|
||||
if ( strip.index() > 7 )
|
||||
{
|
||||
throw runtime_error( "strip_index must be between 0 and 7" );
|
||||
throw runtime_error( "strip.index() must be between 0 and 7" );
|
||||
}
|
||||
|
||||
cout << "MackieMidiBuilder::strip_display index: " << strip_index << ", line " << line_number << ": " << line << endl;
|
||||
cout << "MackieMidiBuilder::strip_display index: " << strip.index() << ", line " << line_number << ": " << line << endl;
|
||||
|
||||
MidiByteArray retval;
|
||||
// code for display
|
||||
retval << 0x12;
|
||||
// offset (0 to 0x37 first line, 0x38 to 0x6f for second line )
|
||||
retval << ( strip_index * 7 + ( line_number * 0x38 ) );
|
||||
retval << ( strip.index() * 7 + ( line_number * 0x38 ) );
|
||||
// ascii data to display
|
||||
retval << line;
|
||||
|
||||
// column spacer, unless it's the right-hand column
|
||||
if ( strip_index < 7 )
|
||||
if ( strip.index() < 7 )
|
||||
{
|
||||
retval << ' ';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ public:
|
|||
MidiByteArray build_fader( const Fader & fader, float pos );
|
||||
|
||||
/// return bytes that will reset all controls to their zero positions
|
||||
/// And blank the display for the strip
|
||||
MidiByteArray zero_strip( const Strip & strip );
|
||||
|
||||
// provide bytes to zero the given control
|
||||
|
|
@ -73,9 +74,11 @@ public:
|
|||
MidiByteArray two_char_display( const std::string & msg, const std::string & dots = " " );
|
||||
MidiByteArray two_char_display( unsigned int value, const std::string & dots = " " );
|
||||
|
||||
/// for displaying a particular strip name
|
||||
/// index is zero-based
|
||||
MidiByteArray strip_display( unsigned int strip_index, unsigned int line_number, const std::string & line );
|
||||
/// for displaying characters on the strip LCD
|
||||
MidiByteArray strip_display( const Strip & strip, unsigned int line_number, const std::string & line );
|
||||
|
||||
/// blank the strip LCD, ie write all spaces
|
||||
MidiByteArray strip_display_blank( const Strip & strip, unsigned int line_number );
|
||||
|
||||
/// for generating all strip names
|
||||
MidiByteArray all_strips_display( std::vector<std::string> & lines1, std::vector<std::string> & lines2 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue