pad out lcd sdisplay strings to 6 chars with spaces to overwrite previous track name
authorJohn Anderson <ardour@semiosix.com>
Sun, 9 Sep 2007 20:19:07 +0000 (20:19 +0000)
committerJohn Anderson <ardour@semiosix.com>
Sun, 9 Sep 2007 20:19:07 +0000 (20:19 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2442 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/surfaces/mackie/mackie_midi_builder.cc

index 1ef2853114d5940447765df4850320e154e46ad3..a1040ae11164f6216a9db08a4b00e7097951188d 100644 (file)
@@ -208,17 +208,17 @@ MidiByteArray MackieMidiBuilder::strip_display( MackiePort & port, const Strip &
        retval << 0x12;
        // offset (0 to 0x37 first line, 0x38 to 0x6f for second line )
        retval << ( strip.index() * 7 + ( line_number * 0x38 ) );
+       
        // ascii data to display
        retval << line;
+       // pad with " " out to 6 chars
+       for ( int i = line.length(); i < 6; ++i ) retval << ' ';
+       
        // column spacer, unless it's the right-hand column
-       if ( strip.index() < 7 )
-       {
-               retval << ' ';
-       }
+       if ( strip.index() < 7 ) retval << ' ';
 
        // sysex trailer
        retval << MIDI::eox;
-
        
 #ifdef DEBUG   
        cout << "MackieMidiBuilder::strip_display midi: " << retval << endl;