1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-18 12:10:40 +02:00

Bug2159: Ruler play region should update when play/record stops

This commit is contained in:
Paul Licameli
2019-07-15 23:17:58 -04:00
parent f5efb17046
commit 7969b5a9e9
3 changed files with 41 additions and 25 deletions

View File

@@ -937,6 +937,9 @@ AdornedRulerPanel::AdornedRulerPanel(AudacityProject* project,
wxTheApp->Bind(EVT_AUDIOIO_CAPTURE,
&AdornedRulerPanel::OnRecordStartStop,
this);
wxTheApp->Bind(EVT_AUDIOIO_PLAYBACK,
&AdornedRulerPanel::OnRecordStartStop,
this);
// Delay until after CommandManager has been populated:
this->CallAfter( &AdornedRulerPanel::UpdatePrefs );
@@ -1115,7 +1118,11 @@ namespace {
void AdornedRulerPanel::OnIdle( wxIdleEvent &evt )
{
evt.Skip();
DoIdle();
}
void AdornedRulerPanel::DoIdle()
{
bool changed = UpdateRects();
changed = SetPanelSize() || changed;
@@ -1144,17 +1151,25 @@ void AdornedRulerPanel::OnRecordStartStop(wxCommandEvent & evt)
{
evt.Skip();
if (evt.GetInt() != 0)
{
mIsRecording = true;
this->CellularPanel::CancelDragging( false );
this->CellularPanel::ClearTargets();
if ( evt.GetEventType() == EVT_AUDIOIO_CAPTURE ) {
if (evt.GetInt() != 0)
{
mIsRecording = true;
this->CellularPanel::CancelDragging( false );
this->CellularPanel::ClearTargets();
UpdateButtonStates();
UpdateButtonStates();
}
else {
mIsRecording = false;
UpdateButtonStates();
}
}
else {
mIsRecording = false;
UpdateButtonStates();
if ( evt.GetInt() == 0 ) {
// So that the play region is updated
mLastDrawnSelectedRegion.setTimes( -1, -1 );
DoIdle();
}
}