mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 09:09:47 +02:00
Merge branch 'master' into HEAD
This commit is contained in:
commit
becff90842
@ -239,12 +239,7 @@ AboutDialog::AboutDialog(wxWindow * parent)
|
||||
PopulateLicensePage( S );
|
||||
}
|
||||
S.EndNotebook();
|
||||
/* i18n-hint: "OK... Audacious" appears on a button at the
|
||||
* foot of the 'About Audacity' dialog box, after some text to read.
|
||||
* In English it is slightly humorous alternative to an 'OK' button.
|
||||
* If the humour doesn't work in your language, then just use whatever
|
||||
* you would use for a translation for 'OK' on a button. */
|
||||
wxButton *ok = safenew wxButton(S.GetParent(), wxID_OK, _("OK... Audacious!"));
|
||||
wxButton *ok = safenew wxButton(S.GetParent(), wxID_OK, _("OK"));
|
||||
ok->SetDefault();
|
||||
S.Prop(0).AddWindow( ok );
|
||||
|
||||
|
@ -113,6 +113,8 @@ It handles initialization and termination by subclassing wxApp.
|
||||
#include "effects/ScoreAlignDialog.h"
|
||||
#endif
|
||||
|
||||
#include "tracks/ui/Scrubbing.h"
|
||||
|
||||
#if 0
|
||||
#ifdef _DEBUG
|
||||
#ifdef _MSC_VER
|
||||
@ -766,6 +768,9 @@ BEGIN_EVENT_TABLE(AudacityApp, wxApp)
|
||||
|
||||
// Handle AppCommandEvents (usually from a script)
|
||||
EVT_APP_COMMAND(wxID_ANY, AudacityApp::OnReceiveCommand)
|
||||
|
||||
// Global ESC key handling
|
||||
EVT_KEY_DOWN(AudacityApp::OnKeyDown)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// backend for OnMRUFile
|
||||
@ -1519,7 +1524,29 @@ void AudacityApp::OnReceiveCommand(AppCommandEvent &event)
|
||||
mCmdHandler->OnReceiveCommand(event);
|
||||
}
|
||||
|
||||
// We now disallow temp directory name that puts it where cleaner apps will
|
||||
void AudacityApp::OnKeyDown(wxKeyEvent &event)
|
||||
{
|
||||
if(event.GetKeyCode() == WXK_ESCAPE) {
|
||||
// Stop play, including scrub, but not record
|
||||
auto project = ::GetActiveProject();
|
||||
auto token = project->GetAudioIOToken();
|
||||
auto &scrubber = project->GetScrubber();
|
||||
if(scrubber.HasStartedScrubbing())
|
||||
// ESC out of scrubbing
|
||||
scrubber.StopScrubbing();
|
||||
else if(token > 0 &&
|
||||
gAudioIO->IsAudioTokenActive(token) &&
|
||||
gAudioIO->GetNumCaptureChannels() == 0)
|
||||
// ESC out of other play (but not record)
|
||||
project->OnStop();
|
||||
else
|
||||
event.Skip();
|
||||
}
|
||||
else
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
// We now disallow temp directory name that puts it where cleaner apps will
|
||||
// try to clean out the files.
|
||||
bool AudacityApp::IsTempDirectoryNameOK( const wxString & Name ){
|
||||
#ifndef __WXMSW__
|
||||
|
@ -132,6 +132,8 @@ class AudacityApp final : public wxApp {
|
||||
|
||||
void OnReceiveCommand(AppCommandEvent &event);
|
||||
|
||||
void OnKeyDown(wxKeyEvent &event);
|
||||
|
||||
void OnTimer(wxTimerEvent & event);
|
||||
|
||||
// IPC communication
|
||||
|
@ -5597,9 +5597,11 @@ bool AudacityProject::DoEditMetadata
|
||||
auto newTags = mTags->Duplicate();
|
||||
|
||||
if (newTags->ShowEditDialog(this, title, force)) {
|
||||
// Commit the change to project state only now.
|
||||
mTags = newTags;
|
||||
PushState(title, shortUndoDescription);
|
||||
if (*mTags != *newTags) {
|
||||
// Commit the change to project state only now.
|
||||
mTags = newTags;
|
||||
PushState(title, shortUndoDescription);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1042,15 +1042,14 @@ void Sequence::WriteXML(XMLWriter &xmlFile)
|
||||
// See http://bugzilla.audacityteam.org/show_bug.cgi?id=451.
|
||||
// Also, don't check against mMaxSamples for AliasBlockFiles, because if you convert sample format,
|
||||
// mMaxSample gets changed to match the format, but the number of samples in the aliased file
|
||||
// has not changed (because sample format conversion was not actually done in the aliased file.
|
||||
// has not changed (because sample format conversion was not actually done in the aliased file).
|
||||
if (!bb.f->IsAlias() && (bb.f->GetLength() > mMaxSamples))
|
||||
{
|
||||
wxString sMsg =
|
||||
wxString::Format(
|
||||
_("Sequence has block file with length %s > mMaxSamples %s.\nTruncating to mMaxSamples."),
|
||||
Internat::ToString(((wxLongLong)bb.f->GetLength()).ToDouble(), 0).c_str(),
|
||||
_("Sequence has block file exceeding maximum %s samples per block.\nTruncating to this maximum length."),
|
||||
Internat::ToString(((wxLongLong)mMaxSamples).ToDouble(), 0).c_str());
|
||||
wxMessageBox(sMsg, _("Warning - Length in Writing Sequence"), wxICON_EXCLAMATION | wxOK);
|
||||
wxMessageBox(sMsg, _("Warning - Truncating Overlong Block File"), wxICON_EXCLAMATION | wxOK);
|
||||
wxLogWarning(sMsg);
|
||||
bb.f->SetLength(mMaxSamples);
|
||||
}
|
||||
|
36
src/Tags.cpp
36
src/Tags.cpp
@ -302,6 +302,42 @@ void Tags::Clear()
|
||||
mMap.clear();
|
||||
}
|
||||
|
||||
namespace {
|
||||
bool EqualMaps(const TagMap &map1, const TagMap &map2)
|
||||
{
|
||||
for (auto it1 = map1.begin(), end1 = map1.end(),
|
||||
it2 = map2.begin(), end2 = map2.end();
|
||||
it1 != end1 || it2 != end2;) {
|
||||
if (it1 == end1 || it2 == end2)
|
||||
return false;
|
||||
else if (it1->first != it2->first)
|
||||
return false;
|
||||
else if (it1->second != it2->second)
|
||||
return false;
|
||||
else
|
||||
++it1, ++it2;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool operator== (const Tags &lhs, const Tags &rhs)
|
||||
{
|
||||
if (!EqualMaps(lhs.mXref, rhs.mXref))
|
||||
return false;
|
||||
|
||||
if (!EqualMaps(lhs.mMap, rhs.mMap))
|
||||
return false;
|
||||
|
||||
return
|
||||
lhs.mGenres == rhs.mGenres
|
||||
&&
|
||||
lhs.mEditTitle == rhs.mEditTitle
|
||||
&&
|
||||
lhs.mEditTrackNumber == rhs.mEditTrackNumber
|
||||
;
|
||||
}
|
||||
|
||||
void Tags::AllowEditTitle(bool editTitle)
|
||||
{
|
||||
mEditTitle = editTitle;
|
||||
|
@ -118,6 +118,8 @@ class AUDACITY_DLL_API Tags final : public XMLTagHandler {
|
||||
bool IsEmpty();
|
||||
void Clear();
|
||||
|
||||
friend bool operator == (const Tags &lhs, const Tags &rhs);
|
||||
|
||||
private:
|
||||
void LoadDefaults();
|
||||
|
||||
@ -130,6 +132,9 @@ class AUDACITY_DLL_API Tags final : public XMLTagHandler {
|
||||
bool mEditTrackNumber;
|
||||
};
|
||||
|
||||
inline bool operator != (const Tags &lhs, const Tags &rhs)
|
||||
{ return !(lhs == rhs); }
|
||||
|
||||
class TagsEditor final : public wxDialog
|
||||
{
|
||||
public:
|
||||
|
@ -1145,15 +1145,17 @@ void TrackPanel::MakeParentRedrawScrollbars()
|
||||
mListener->TP_RedrawScrollbars();
|
||||
}
|
||||
|
||||
void TrackPanel::HandleEscapeKey(bool down)
|
||||
bool TrackPanel::HandleEscapeKey(bool down)
|
||||
{
|
||||
if (!down)
|
||||
return;
|
||||
// Note that this dispatches some keystrokes even when track panel is not focused.
|
||||
// So it works as a place for escaping from playing and scrub as well as other
|
||||
// drag actions specific to track panel. If there is a drag and a play at the
|
||||
// same time, the first ESC applies to the drag action only.
|
||||
|
||||
auto &scrubber = GetProject()->GetScrubber();
|
||||
if(scrubber.HasStartedScrubbing())
|
||||
scrubber.StopScrubbing();
|
||||
else switch (mMouseCapture)
|
||||
if (!down)
|
||||
return false;
|
||||
|
||||
switch (mMouseCapture)
|
||||
{
|
||||
case IsSelecting:
|
||||
{
|
||||
@ -1195,16 +1197,21 @@ void TrackPanel::HandleEscapeKey(bool down)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
{
|
||||
// Not escaping from a mouse drag
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Common part in all cases that do anything
|
||||
// Common part in all cases that escape from a drag
|
||||
SetCapturedTrack(NULL, IsUncaptured);
|
||||
if (HasCapture())
|
||||
ReleaseMouse();
|
||||
wxMouseEvent dummy;
|
||||
HandleCursor(dummy);
|
||||
Refresh(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void TrackPanel::HandleAltKey(bool down)
|
||||
@ -5758,8 +5765,12 @@ void TrackPanel::OnKeyDown(wxKeyEvent & event)
|
||||
switch (event.GetKeyCode())
|
||||
{
|
||||
case WXK_ESCAPE:
|
||||
HandleEscapeKey(true);
|
||||
break;
|
||||
if(HandleEscapeKey(true))
|
||||
// Don't skip the event, eat it so that
|
||||
// AudacityApp does not also stop any playback.
|
||||
return;
|
||||
else
|
||||
break;
|
||||
|
||||
case WXK_ALT:
|
||||
HandleAltKey(true);
|
||||
@ -5858,10 +5869,11 @@ void TrackPanel::OnChar(wxKeyEvent & event)
|
||||
|
||||
void TrackPanel::OnKeyUp(wxKeyEvent & event)
|
||||
{
|
||||
bool didSomething = false;
|
||||
switch (event.GetKeyCode())
|
||||
{
|
||||
case WXK_ESCAPE:
|
||||
HandleEscapeKey(false);
|
||||
didSomething = HandleEscapeKey(false);
|
||||
break;
|
||||
case WXK_ALT:
|
||||
HandleAltKey(false);
|
||||
@ -5876,7 +5888,8 @@ void TrackPanel::OnKeyUp(wxKeyEvent & event)
|
||||
break;
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
if(!didSomething)
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
/// Should handle the case when the mouse capture is lost.
|
||||
|
@ -195,7 +195,7 @@ class AUDACITY_DLL_API TrackPanel final : public wxPanel {
|
||||
//virtual void SetSelectionFormat(int iformat)
|
||||
//virtual void SetSnapTo(int snapto)
|
||||
|
||||
virtual void HandleEscapeKey(bool down);
|
||||
virtual bool HandleEscapeKey(bool down);
|
||||
virtual void HandleAltKey(bool down);
|
||||
virtual void HandleShiftKey(bool down);
|
||||
virtual void HandleControlKey(bool down);
|
||||
|
@ -2011,6 +2011,16 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
if (mIsRecording)
|
||||
return;
|
||||
|
||||
// Handle status bar messages
|
||||
if(evt.Leaving()) {
|
||||
mProject->TP_DisplayStatusMessage(wxT(""));
|
||||
}
|
||||
else if(evt.Entering()) {
|
||||
// Insert timeline status bar messages here
|
||||
mProject->TP_DisplayStatusMessage
|
||||
(wxT(""));
|
||||
}
|
||||
|
||||
// Store the initial play region state
|
||||
if(mMouseEventState == mesNone) {
|
||||
mOldPlayRegionStart = mPlayRegionStart;
|
||||
|
Loading…
x
Reference in New Issue
Block a user