1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 08:39:46 +02:00

A few minor fixes to Quick-Play (now hyphenated for consistency).

This commit is contained in:
Steve Daulton 2015-04-21 19:44:38 +00:00
parent 8bcec00e65
commit e45afbaa76
3 changed files with 37 additions and 27 deletions

View File

@ -1741,9 +1741,11 @@ wxUint32 AudacityProject::GetUpdateFlags()
flags |= GetFocusedFrame(); flags |= GetFocusedFrame();
double start, end;
GetPlayRegion(&start, &end);
if (IsPlayRegionLocked()) if (IsPlayRegionLocked())
flags |= PlayRegionLockedFlag; flags |= PlayRegionLockedFlag;
else else if (start != end)
flags |= PlayRegionNotLockedFlag; flags |= PlayRegionNotLockedFlag;
if (flags & AudioIONotBusyFlag) { if (flags & AudioIONotBusyFlag) {
@ -6223,21 +6225,21 @@ void AudacityProject::OnAudioDeviceInfo()
if (dlg.ShowModal() == wxID_OK) if (dlg.ShowModal() == wxID_OK)
{ {
wxString fName = FileSelector(_("Save Device Info"), wxString fName = FileSelector(_("Save Device Info"),
wxEmptyString, wxEmptyString,
wxT("deviceinfo.txt"), wxT("deviceinfo.txt"),
wxT("txt"), wxT("txt"),
wxT("*.txt"), wxT("*.txt"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER, wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
this); this);
if (!fName.IsEmpty()) if (!fName.IsEmpty())
{ {
if (!text->SaveFile(fName)) if (!text->SaveFile(fName))
{ {
wxMessageBox(_("Unable to save device info"), _("Save Device Info")); wxMessageBox(_("Unable to save device info"), _("Save Device Info"));
} }
} }
} }
} }
void AudacityProject::OnSeparator() void AudacityProject::OnSeparator()
@ -6312,8 +6314,16 @@ void AudacityProject::OnUnMuteAllTracks()
void AudacityProject::OnLockPlayRegion() void AudacityProject::OnLockPlayRegion()
{ {
mLockPlayRegion = true; double start, end;
mRuler->Refresh(false); GetPlayRegion(&start, &end);
if (start >= mTracks->GetEndTime()) {
wxMessageBox(_("Cannot lock region beyond\nend of project."),
_("Error"));
}
else {
mLockPlayRegion = true;
mRuler->Refresh(false);
}
} }
void AudacityProject::OnUnlockPlayRegion() void AudacityProject::OnUnlockPlayRegion()

View File

@ -576,7 +576,7 @@ protected:
double mLastIndicator; double mLastIndicator;
double mLastCursor; double mLastCursor;
// Quick Play indicator postion // Quick-Play indicator postion
double mOldQPIndicatorPos; double mOldQPIndicatorPos;
int mTimeCount; int mTimeCount;

View File

@ -1701,10 +1701,10 @@ void AdornedRulerPanel::RegenerateTooltips()
this->SetToolTip(_("Timeline actions disabled during recording")); this->SetToolTip(_("Timeline actions disabled during recording"));
} }
else if (!mQuickPlayEnabled) { else if (!mQuickPlayEnabled) {
this->SetToolTip(_("Quick Play disabled")); this->SetToolTip(_("Quick-Play disabled"));
} }
else { else {
this->SetToolTip(_("Quick Play enabled")); this->SetToolTip(_("Quick-Play enabled"));
} }
} }
else { else {
@ -1853,7 +1853,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
double sel0 = mProject->GetSel0(); double sel0 = mProject->GetSel0();
double sel1 = mProject->GetSel1(); double sel1 = mProject->GetSel1();
// Restrict Quick Play region to where there is something to play or is selected. // Restrict Quick-Play region to where there is something to play or is selected.
mQuickPlayPos = wxMax(0.0, mQuickPlayPos); mQuickPlayPos = wxMax(0.0, mQuickPlayPos);
// If not looping, restrict selection to end of project // If not looping, restrict selection to end of project
@ -2004,7 +2004,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
ClearPlayRegion(); ClearPlayRegion();
} }
// Disable if empty selection before start. // Disable if empty selection before start.
// (allow Quick Play region to include 'pre-roll' white space) // (allow Quick-Play region to include 'pre-roll' white space)
else if (((mPlayRegionEnd - mPlayRegionStart) > 0.0) && (mPlayRegionEnd < t0)) { else if (((mPlayRegionEnd - mPlayRegionStart) > 0.0) && (mPlayRegionEnd < t0)) {
ClearPlayRegion(); ClearPlayRegion();
} }
@ -2083,9 +2083,9 @@ void AdornedRulerPanel::ShowMenu(const wxPoint & pos)
wxMenu *rulerMenu = new wxMenu(); wxMenu *rulerMenu = new wxMenu();
if (mQuickPlayEnabled) if (mQuickPlayEnabled)
rulerMenu->Append(OnToggleQuickPlayID, _("Disable Quick Play")); rulerMenu->Append(OnToggleQuickPlayID, _("Disable Quick-Play"));
else else
rulerMenu->Append(OnToggleQuickPlayID, _("Enable Quick Play")); rulerMenu->Append(OnToggleQuickPlayID, _("Enable Quick-Play"));
wxMenuItem *dragitem; wxMenuItem *dragitem;
if (mPlayRegionDragsSelection && !mProject->IsPlayRegionLocked()) if (mPlayRegionDragsSelection && !mProject->IsPlayRegionLocked())
@ -2111,12 +2111,12 @@ void AdornedRulerPanel::ShowMenu(const wxPoint & pos)
prlitem = rulerMenu->Append(OnLockPlayRegionID, _("Lock Play Region")); prlitem = rulerMenu->Append(OnLockPlayRegionID, _("Lock Play Region"));
else else
prlitem = rulerMenu->Append(OnLockPlayRegionID, _("Unlock Play Region")); prlitem = rulerMenu->Append(OnLockPlayRegionID, _("Unlock Play Region"));
prlitem->Enable(mProject->IsPlayRegionLocked() || mProject->GetSel0() != mProject->GetSel1()); prlitem->Enable(mProject->IsPlayRegionLocked() || (mPlayRegionStart != mPlayRegionEnd));
PopupMenu(rulerMenu, pos); PopupMenu(rulerMenu, pos);
delete rulerMenu; delete rulerMenu;
// dismiss and clear Quick Play indicator // dismiss and clear Quick-Play indicator
mQuickPlayInd = false; mQuickPlayInd = false;
wxClientDC cdc(this); wxClientDC cdc(this);
DrawQuickPlayIndicator(&cdc, true); DrawQuickPlayIndicator(&cdc, true);