mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-06 23:29:24 +02:00
Better optionality.
- More Y/N in Optional, making it easier to omit parameters. - AT removed from Envelope, since T already gives it.
This commit is contained in:
parent
a36490a0b6
commit
43da4995a6
@ -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;
|
||||
|
@ -310,7 +310,7 @@ bool GetInfoCommand::SendEnvelopes(const CommandContext &context)
|
||||
context.StartField( "points" );
|
||||
context.StartArray();
|
||||
double offset = pEnv->mOffset;
|
||||
for( int k=0;k<pEnv->mEnv.size(); k++)
|
||||
for( size_t k=0;k<pEnv->mEnv.size(); k++)
|
||||
{
|
||||
context.StartStruct( );
|
||||
context.AddItem( pEnv->mEnv[k].GetT()+offset, "t" );
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
};
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -63,6 +63,7 @@ public:
|
||||
wxString mName;
|
||||
wxString mValue;
|
||||
bool mbReload;
|
||||
bool bHasReload;
|
||||
};
|
||||
|
||||
#endif /* End of include guard: __PREFERENCE_COMMANDS__ */
|
||||
|
@ -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
|
||||
|
@ -46,6 +46,7 @@ private:
|
||||
wxString mWhat;
|
||||
wxString mBack;
|
||||
wxString mPath;
|
||||
bool bHasBackground;
|
||||
friend class ScreenshotCommand;
|
||||
friend class ScreenFrame;
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user