diff --git a/src/commands/DragCommand.cpp b/src/commands/DragCommand.cpp index 920def2c2..638655a7c 100644 --- a/src/commands/DragCommand.cpp +++ b/src/commands/DragCommand.cpp @@ -97,6 +97,7 @@ bool DragCommand::Apply(const CommandContext & context) pWin->GetEventHandler()->ProcessEvent( Evt ); if( bHasToX ){ wxMouseEvent Evt2( wxEVT_LEFT_DOWN ); + Evt2.m_leftDown = true; Evt2.m_x = mFromX; Evt2.m_y = mFromY; Evt2.m_aux2Down = true; diff --git a/src/commands/GetInfoCommand.cpp b/src/commands/GetInfoCommand.cpp index 45e2dba3f..a97e851f4 100644 --- a/src/commands/GetInfoCommand.cpp +++ b/src/commands/GetInfoCommand.cpp @@ -310,7 +310,7 @@ bool GetInfoCommand::SendEnvelopes(const CommandContext &context) context.StartField( "points" ); context.StartArray(); double offset = pEnv->mOffset; - for( int k=0;kmEnv.size(); k++) + for( size_t k=0;kmEnv.size(); k++) { context.StartStruct( ); context.AddItem( pEnv->mEnv[k].GetT()+offset, "t" ); diff --git a/src/commands/OpenSaveCommands.cpp b/src/commands/OpenSaveCommands.cpp index d5d261990..1ce167544 100644 --- a/src/commands/OpenSaveCommands.cpp +++ b/src/commands/OpenSaveCommands.cpp @@ -24,7 +24,7 @@ bool OpenProjectCommand::DefineParams( ShuttleParams & S ){ S.Define( mFileName, wxT("Filename"), "test.aup" ); - S.Define( mbAddToHistory, wxT("AddToHistory"), false ); + S.OptionalN(bHasAddToHistory).Define( mbAddToHistory, wxT("AddToHistory"), false ); return true; } @@ -62,8 +62,8 @@ bool OpenProjectCommand::Apply(const CommandContext & context){ bool SaveProjectCommand::DefineParams( ShuttleParams & S ){ S.Define( mFileName, wxT("Filename"), "name.aup" ); - S.Define( mbAddToHistory, wxT("AddToHistory"), false ); - S.Define( mbCompress, wxT("Compress"), false ); + S.OptionalN(bHasAddToHistory).Define( mbAddToHistory, wxT("AddToHistory"), false ); + S.OptionalN(bHasCompress).Define( mbCompress, wxT("Compress"), false ); return true; } diff --git a/src/commands/OpenSaveCommands.h b/src/commands/OpenSaveCommands.h index 41798d3e9..9770b3749 100644 --- a/src/commands/OpenSaveCommands.h +++ b/src/commands/OpenSaveCommands.h @@ -38,6 +38,7 @@ public: public: wxString mFileName; bool mbAddToHistory; + bool bHasAddToHistory; }; #define SAVE_PROJECT_PLUGIN_SYMBOL XO("Save Project") @@ -58,4 +59,6 @@ public: wxString mFileName; bool mbAddToHistory; bool mbCompress; + bool bHasAddToHistory; + bool bHasCompress; }; \ No newline at end of file diff --git a/src/commands/PreferenceCommands.cpp b/src/commands/PreferenceCommands.cpp index 11f97db4a..fa2671aaa 100644 --- a/src/commands/PreferenceCommands.cpp +++ b/src/commands/PreferenceCommands.cpp @@ -50,9 +50,9 @@ bool GetPreferenceCommand::Apply(const CommandContext & context) } bool SetPreferenceCommand::DefineParams( ShuttleParams & S ){ - S.Define( mName, wxT("Name"), wxT("") ); - S.Define( mValue, wxT("Value"), wxT("") ); - S.Define( mbReload, wxT("Reload"), false ); + S.Define( mName, wxT("Name"), wxT("") ); + S.Define( mValue, wxT("Value"), wxT("") ); + S.OptionalN(bHasReload).Define( mbReload, wxT("Reload"), false ); return true; } diff --git a/src/commands/PreferenceCommands.h b/src/commands/PreferenceCommands.h index fba717242..c53e520df 100644 --- a/src/commands/PreferenceCommands.h +++ b/src/commands/PreferenceCommands.h @@ -63,6 +63,7 @@ public: wxString mName; wxString mValue; bool mbReload; + bool bHasReload; }; #endif /* End of include guard: __PREFERENCE_COMMANDS__ */ diff --git a/src/commands/ScreenshotCommand.cpp b/src/commands/ScreenshotCommand.cpp index 4984e5edd..dcbd95263 100644 --- a/src/commands/ScreenshotCommand.cpp +++ b/src/commands/ScreenshotCommand.cpp @@ -139,9 +139,9 @@ static const wxString kBackgroundStrings[nBackgrounds] = bool ScreenshotCommand::DefineParams( ShuttleParams & S ){ wxArrayString whats(nCaptureWhats, kCaptureWhatStrings); wxArrayString backs(nBackgrounds, kBackgroundStrings); - S.Define( mPath, wxT("Path"), wxT(""), wxT(""), wxT(""), wxT("")); - S.DefineEnum( mWhat, wxT("CaptureWhat"), wxT("Window"), whats ); - S.DefineEnum( mBack, wxT("Background"), wxT("None"), backs ); + S.Define( mPath, wxT("Path"), wxT("")); + S.DefineEnum( mWhat, wxT("CaptureWhat"), wxT("Window"), whats ); + S.OptionalN(bHasBackground).DefineEnum( mBack, wxT("Background"), wxT("None"), backs ); return true; }; @@ -154,8 +154,8 @@ void ScreenshotCommand::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(2, wxALIGN_CENTER); { S.TieTextBox( _("Path:"), mPath); - S.TieChoice( _("Capture What:"), mWhat, &whats); - S.TieChoice( _("Background:"), mBack, &backs); + S.TieChoice( _("Capture What:"), mWhat, &whats); + S.TieChoice( _("Background:"), mBack, &backs); } S.EndMultiColumn(); } @@ -483,7 +483,8 @@ void ScreenshotCommand::CaptureWindowOnIdle( void ScreenshotCommand::CapturePreferences( const CommandContext & context, AudacityProject * pProject, const wxString &mFileName ){ - mFileName;//compiler food. + (void)&mFileName;//compiler food. + (void)&context; CommandManager * pMan = pProject->GetCommandManager(); // Yucky static variables. Is there a better way? The problem is that we need the @@ -512,7 +513,8 @@ void ScreenshotCommand::CapturePreferences( void ScreenshotCommand::CaptureEffects( const CommandContext & context, AudacityProject * pProject, const wxString &mFileName ){ - mFileName;//compiler food. + (void)&mFileName;//compiler food. + (void)&context; CommandManager * pMan = pProject->GetCommandManager(); wxString Str; // Yucky static variables. Is there a better way? The problem is that we need the diff --git a/src/commands/ScreenshotCommand.h b/src/commands/ScreenshotCommand.h index cfdb47495..53ad6f41f 100644 --- a/src/commands/ScreenshotCommand.h +++ b/src/commands/ScreenshotCommand.h @@ -46,6 +46,7 @@ private: wxString mWhat; wxString mBack; wxString mPath; + bool bHasBackground; friend class ScreenshotCommand; friend class ScreenFrame; diff --git a/src/commands/SelectCommand.cpp b/src/commands/SelectCommand.cpp index 5fe0b6b12..bfc76ca8c 100644 --- a/src/commands/SelectCommand.cpp +++ b/src/commands/SelectCommand.cpp @@ -40,9 +40,9 @@ explicitly code all three. #include "CommandContext.h" bool SelectTimeCommand::DefineParams( ShuttleParams & S ){ - S.Optional( bHasT0 ).Define( mT0, wxT("Start"), 0.0, 0.0, (double)FLT_MAX); - S.Optional( bHasT1 ).Define( mT1, wxT("End"), 0.0, 0.0, (double)FLT_MAX); - S.Define( mFromEnd, wxT("FromEnd"), false ); + S.OptionalY( bHasT0 ).Define( mT0, wxT("Start"), 0.0, 0.0, (double)FLT_MAX); + S.OptionalY( bHasT1 ).Define( mT1, wxT("End"), 0.0, 0.0, (double)FLT_MAX); + S.OptionalY( bHasFromEnd).Define( mFromEnd, wxT("FromEnd"), false ); return true; } @@ -58,6 +58,7 @@ void SelectTimeCommand::PopulateOrExchange(ShuttleGui & S) S.EndMultiColumn(); S.StartMultiColumn(2, wxALIGN_CENTER); { + // Always used, so no optional checkbox. S.TieCheckBox(_("From End:"), mFromEnd ); } S.EndMultiColumn(); @@ -81,8 +82,8 @@ bool SelectTimeCommand::Apply(const CommandContext & context){ } bool SelectFrequenciesCommand::DefineParams( ShuttleParams & S ){ - S.Optional( bHasTop ).Define( mTop, wxT("High"), 0.0, 0.0, (double)FLT_MAX); - S.Optional( bHasBottom ).Define( mBottom, wxT("Low"), 0.0, 0.0, (double)FLT_MAX); + S.OptionalN( bHasTop ).Define( mTop, wxT("High"), 0.0, 0.0, (double)FLT_MAX); + S.OptionalN( bHasBottom ).Define( mBottom, wxT("Low"), 0.0, 0.0, (double)FLT_MAX); return true; } @@ -121,9 +122,9 @@ static const wxString kModes[nModes] = bool SelectTracksCommand::DefineParams( ShuttleParams & S ){ wxArrayString modes( nModes, kModes ); - S.Optional( bHasFirstTrack).Define( mFirstTrack, wxT("First"), 0, 0, 100); - S.Optional( bHasLastTrack ).Define( mLastTrack, wxT("Last"), 0, 0, 100); - S.DefineEnum( mMode, wxT("Mode"), 0, modes ); + S.OptionalN( bHasFirstTrack).Define( mFirstTrack, wxT("First"), 0, 0, 100); + S.OptionalN( bHasLastTrack ).Define( mLastTrack, wxT("Last"), 0, 0, 100); + S.OptionalY( bHasMode ).DefineEnum( mMode, wxT("Mode"), 0, modes ); return true; } @@ -141,6 +142,7 @@ void SelectTracksCommand::PopulateOrExchange(ShuttleGui & S) S.EndMultiColumn(); S.StartMultiColumn(2, wxALIGN_CENTER); { + // Always used, so no check box. S.TieChoice( _("Mode:"), mMode, &modes); } S.EndMultiColumn(); diff --git a/src/commands/SelectCommand.h b/src/commands/SelectCommand.h index 410e58f0d..457b67cfe 100644 --- a/src/commands/SelectCommand.h +++ b/src/commands/SelectCommand.h @@ -45,6 +45,7 @@ public: bool bHasT0; bool bHasT1; + bool bHasFromEnd; double mT0; double mT1; @@ -86,6 +87,7 @@ public: bool bHasFirstTrack; bool bHasLastTrack; + bool bHasMode; int mFirstTrack; int mLastTrack; diff --git a/src/commands/SetEnvelopeCommand.cpp b/src/commands/SetEnvelopeCommand.cpp index 621fee83f..8dc649d40 100644 --- a/src/commands/SetEnvelopeCommand.cpp +++ b/src/commands/SetEnvelopeCommand.cpp @@ -31,12 +31,11 @@ SetEnvelopeCommand::SetEnvelopeCommand() bool SetEnvelopeCommand::DefineParams( ShuttleParams & S ){ - S.Optional( bHasTrackIndex ).Define( mTrackIndex, wxT("Track"), 0, 0, 100 ); - S.Optional( bHasChannelIndex ).Define( mChannelIndex, wxT("Channel"), 0, 0, 100 ); - S.Optional( bHasContainsTime ).Define( mContainsTime, wxT("At"), 0.0, 0.0, 100000.0 ); - S.Optional( bHasT ).Define( mT, wxT("Time"), 0.0, 0.0, 100000.0); - S.Optional( bHasV ).Define( mV, wxT("Value"), 0.0, 0.0, 2.0); - S.Optional( bHasDelete ).Define( mbDelete, wxT("Delete"), false ); + S.OptionalY( bHasTrackIndex ).Define( mTrackIndex, wxT("Track"), 0, 0, 100 ); + S.OptionalN( bHasChannelIndex ).Define( mChannelIndex, wxT("Channel"), 0, 0, 100 ); + S.OptionalY( bHasT ).Define( mT, wxT("Time"), 0.0, 0.0, 100000.0); + S.OptionalY( bHasV ).Define( mV, wxT("Value"), 0.0, 0.0, 2.0); + S.OptionalN( bHasDelete ).Define( mbDelete, wxT("Delete"), false ); return true; }; @@ -48,7 +47,6 @@ void SetEnvelopeCommand::PopulateOrExchange(ShuttleGui & S) { S.Optional( bHasTrackIndex ).TieNumericTextBox( _("Track Index:"), mTrackIndex ); S.Optional( bHasChannelIndex).TieNumericTextBox( _("Channel Index:"), mChannelIndex ); - S.Optional( bHasContainsTime).TieNumericTextBox( _("At:"), mContainsTime ); S.Optional( bHasT ).TieNumericTextBox( _("Time:"), mT ); S.Optional( bHasV ).TieNumericTextBox( _("Value:"), mV ); S.Optional( bHasDelete ).TieCheckBox( _("Delete:"), mbDelete ); @@ -84,9 +82,9 @@ bool SetEnvelopeCommand::Apply(const CommandContext & context) for(auto it = ptrs.begin(); (it != ptrs.end()); it++ ){ pClip = *it; bFound = - !bHasContainsTime || ( - ( pClip->GetStartTime() <= mContainsTime ) && - ( pClip->GetEndTime() >= mContainsTime ) + !bHasT || ( + ( pClip->GetStartTime() <= mT) && + ( pClip->GetEndTime() >= mT ) ); if( bFound ) { diff --git a/src/commands/SetEnvelopeCommand.h b/src/commands/SetEnvelopeCommand.h index 635f59367..fb195576d 100644 --- a/src/commands/SetEnvelopeCommand.h +++ b/src/commands/SetEnvelopeCommand.h @@ -39,14 +39,12 @@ public: public: int mTrackIndex; int mChannelIndex; - double mContainsTime; double mT; double mV; bool mbDelete; bool bHasTrackIndex; bool bHasChannelIndex; - bool bHasContainsTime; bool bHasT; bool bHasV; bool bHasDelete; diff --git a/src/commands/SetProjectCommand.cpp b/src/commands/SetProjectCommand.cpp index 568288e74..ccf1bfcba 100644 --- a/src/commands/SetProjectCommand.cpp +++ b/src/commands/SetProjectCommand.cpp @@ -31,11 +31,11 @@ SetProjectCommand::SetProjectCommand() bool SetProjectCommand::DefineParams( ShuttleParams & S ){ - S.Optional( bHasName ).Define( mName, wxT("Name"), _("Project") ); - S.Optional( bHasSizing ).Define( mPosX, wxT("X"), 10.0, 0.0, 2000.0); - S.Optional( bHasSizing ).Define( mPosY, wxT("Y"), 10.0, 0.0, 2000.0); - S.Optional( bHasSizing ).Define( mWidth, wxT("Width"), 1000.0, 200.0, 4000.0); - S.Optional( bHasSizing ).Define( mHeight, wxT("Height"), 900.0, 200.0, 4000.0); + S.OptionalN( bHasName ).Define( mName, wxT("Name"), _("Project") ); + S.OptionalY( bHasSizing ).Define( mPosX, wxT("X"), 10.0, 0.0, 2000.0); + S.OptionalY( bHasSizing ).Define( mPosY, wxT("Y"), 10.0, 0.0, 2000.0); + S.OptionalY( bHasSizing ).Define( mWidth, wxT("Width"), 1000.0, 200.0, 4000.0); + S.OptionalY( bHasSizing ).Define( mHeight, wxT("Height"), 900.0, 200.0, 4000.0); return true; };