1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-08 04:32:00 +01:00

Fixed playback/redraw interactions (redraw was converting from seconds to beats while player was trying to read seconds in another thread). Added compile-time option make channel select be the down position. Fixed problem with MIDI track mute to eliminate hung notes.

This commit is contained in:
rbdannenberg
2010-10-07 21:36:39 +00:00
parent f52bafbf05
commit 2fd5555378
6 changed files with 106 additions and 40 deletions

View File

@@ -206,7 +206,11 @@ int NoteTrack::DrawLabelControls(wxDC & dc, wxRect & r)
if (mVisibleChannels & (1 << (channel - 1))) {
AColor::MIDIChannel(&dc, channel);
dc.DrawRectangle(box);
// two choices: channel is enabled (to see and play) when button is in
// "up" position (original Audacity style) or in "down" position
//
#define CHANNEL_ON_IS_DOWN 0
#if !CHANNEL_ON_IS_DOWN
AColor::LightMIDIChannel(&dc, channel);
AColor::Line(dc, box.x, box.y, box.x + box.width - 1, box.y);
AColor::Line(dc, box.x, box.y, box.x, box.y + box.height - 1);
@@ -218,9 +222,23 @@ int NoteTrack::DrawLabelControls(wxDC & dc, wxRect & r)
AColor::Line(dc,
box.x, box.y + box.height - 1,
box.x + box.width - 1, box.y + box.height - 1);
#endif
} else {
AColor::MIDIChannel(&dc, 0);
dc.DrawRectangle(box);
#if CHANNEL_ON_IS_DOWN
AColor::LightMIDIChannel(&dc, 0);
AColor::Line(dc, box.x, box.y, box.x + box.width - 1, box.y);
AColor::Line(dc, box.x, box.y, box.x, box.y + box.height - 1);
AColor::DarkMIDIChannel(&dc, 0);
AColor::Line(dc,
box.x + box.width - 1, box.y,
box.x + box.width - 1, box.y + box.height - 1);
AColor::Line(dc,
box.x, box.y + box.height - 1,
box.x + box.width - 1, box.y + box.height - 1);
#endif
}
wxString t;
@@ -233,6 +251,7 @@ int NoteTrack::DrawLabelControls(wxDC & dc, wxRect & r)
dc.DrawText(t, box.x + (box.width - w) / 2, box.y + (box.height - h) / 2);
}
}
AColor::MIDIChannel(&dc, 0); // always return with gray color selected
return box.GetBottom();
}