mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-07 15:49:42 +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 );
|
pWin->GetEventHandler()->ProcessEvent( Evt );
|
||||||
if( bHasToX ){
|
if( bHasToX ){
|
||||||
wxMouseEvent Evt2( wxEVT_LEFT_DOWN );
|
wxMouseEvent Evt2( wxEVT_LEFT_DOWN );
|
||||||
|
Evt2.m_leftDown = true;
|
||||||
Evt2.m_x = mFromX;
|
Evt2.m_x = mFromX;
|
||||||
Evt2.m_y = mFromY;
|
Evt2.m_y = mFromY;
|
||||||
Evt2.m_aux2Down = true;
|
Evt2.m_aux2Down = true;
|
||||||
|
@ -310,7 +310,7 @@ bool GetInfoCommand::SendEnvelopes(const CommandContext &context)
|
|||||||
context.StartField( "points" );
|
context.StartField( "points" );
|
||||||
context.StartArray();
|
context.StartArray();
|
||||||
double offset = pEnv->mOffset;
|
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.StartStruct( );
|
||||||
context.AddItem( pEnv->mEnv[k].GetT()+offset, "t" );
|
context.AddItem( pEnv->mEnv[k].GetT()+offset, "t" );
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
bool OpenProjectCommand::DefineParams( ShuttleParams & S ){
|
bool OpenProjectCommand::DefineParams( ShuttleParams & S ){
|
||||||
S.Define( mFileName, wxT("Filename"), "test.aup" );
|
S.Define( mFileName, wxT("Filename"), "test.aup" );
|
||||||
S.Define( mbAddToHistory, wxT("AddToHistory"), false );
|
S.OptionalN(bHasAddToHistory).Define( mbAddToHistory, wxT("AddToHistory"), false );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,8 +62,8 @@ bool OpenProjectCommand::Apply(const CommandContext & context){
|
|||||||
|
|
||||||
bool SaveProjectCommand::DefineParams( ShuttleParams & S ){
|
bool SaveProjectCommand::DefineParams( ShuttleParams & S ){
|
||||||
S.Define( mFileName, wxT("Filename"), "name.aup" );
|
S.Define( mFileName, wxT("Filename"), "name.aup" );
|
||||||
S.Define( mbAddToHistory, wxT("AddToHistory"), false );
|
S.OptionalN(bHasAddToHistory).Define( mbAddToHistory, wxT("AddToHistory"), false );
|
||||||
S.Define( mbCompress, wxT("Compress"), false );
|
S.OptionalN(bHasCompress).Define( mbCompress, wxT("Compress"), false );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
wxString mFileName;
|
wxString mFileName;
|
||||||
bool mbAddToHistory;
|
bool mbAddToHistory;
|
||||||
|
bool bHasAddToHistory;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SAVE_PROJECT_PLUGIN_SYMBOL XO("Save Project")
|
#define SAVE_PROJECT_PLUGIN_SYMBOL XO("Save Project")
|
||||||
@ -58,4 +59,6 @@ public:
|
|||||||
wxString mFileName;
|
wxString mFileName;
|
||||||
bool mbAddToHistory;
|
bool mbAddToHistory;
|
||||||
bool mbCompress;
|
bool mbCompress;
|
||||||
|
bool bHasAddToHistory;
|
||||||
|
bool bHasCompress;
|
||||||
};
|
};
|
@ -50,9 +50,9 @@ bool GetPreferenceCommand::Apply(const CommandContext & context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool SetPreferenceCommand::DefineParams( ShuttleParams & S ){
|
bool SetPreferenceCommand::DefineParams( ShuttleParams & S ){
|
||||||
S.Define( mName, wxT("Name"), wxT("") );
|
S.Define( mName, wxT("Name"), wxT("") );
|
||||||
S.Define( mValue, wxT("Value"), wxT("") );
|
S.Define( mValue, wxT("Value"), wxT("") );
|
||||||
S.Define( mbReload, wxT("Reload"), false );
|
S.OptionalN(bHasReload).Define( mbReload, wxT("Reload"), false );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ public:
|
|||||||
wxString mName;
|
wxString mName;
|
||||||
wxString mValue;
|
wxString mValue;
|
||||||
bool mbReload;
|
bool mbReload;
|
||||||
|
bool bHasReload;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* End of include guard: __PREFERENCE_COMMANDS__ */
|
#endif /* End of include guard: __PREFERENCE_COMMANDS__ */
|
||||||
|
@ -139,9 +139,9 @@ static const wxString kBackgroundStrings[nBackgrounds] =
|
|||||||
bool ScreenshotCommand::DefineParams( ShuttleParams & S ){
|
bool ScreenshotCommand::DefineParams( ShuttleParams & S ){
|
||||||
wxArrayString whats(nCaptureWhats, kCaptureWhatStrings);
|
wxArrayString whats(nCaptureWhats, kCaptureWhatStrings);
|
||||||
wxArrayString backs(nBackgrounds, kBackgroundStrings);
|
wxArrayString backs(nBackgrounds, kBackgroundStrings);
|
||||||
S.Define( mPath, wxT("Path"), wxT(""), wxT(""), wxT(""), wxT(""));
|
S.Define( mPath, wxT("Path"), wxT(""));
|
||||||
S.DefineEnum( mWhat, wxT("CaptureWhat"), wxT("Window"), whats );
|
S.DefineEnum( mWhat, wxT("CaptureWhat"), wxT("Window"), whats );
|
||||||
S.DefineEnum( mBack, wxT("Background"), wxT("None"), backs );
|
S.OptionalN(bHasBackground).DefineEnum( mBack, wxT("Background"), wxT("None"), backs );
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -154,8 +154,8 @@ void ScreenshotCommand::PopulateOrExchange(ShuttleGui & S)
|
|||||||
S.StartMultiColumn(2, wxALIGN_CENTER);
|
S.StartMultiColumn(2, wxALIGN_CENTER);
|
||||||
{
|
{
|
||||||
S.TieTextBox( _("Path:"), mPath);
|
S.TieTextBox( _("Path:"), mPath);
|
||||||
S.TieChoice( _("Capture What:"), mWhat, &whats);
|
S.TieChoice( _("Capture What:"), mWhat, &whats);
|
||||||
S.TieChoice( _("Background:"), mBack, &backs);
|
S.TieChoice( _("Background:"), mBack, &backs);
|
||||||
}
|
}
|
||||||
S.EndMultiColumn();
|
S.EndMultiColumn();
|
||||||
}
|
}
|
||||||
@ -483,7 +483,8 @@ void ScreenshotCommand::CaptureWindowOnIdle(
|
|||||||
void ScreenshotCommand::CapturePreferences(
|
void ScreenshotCommand::CapturePreferences(
|
||||||
const CommandContext & context,
|
const CommandContext & context,
|
||||||
AudacityProject * pProject, const wxString &mFileName ){
|
AudacityProject * pProject, const wxString &mFileName ){
|
||||||
mFileName;//compiler food.
|
(void)&mFileName;//compiler food.
|
||||||
|
(void)&context;
|
||||||
CommandManager * pMan = pProject->GetCommandManager();
|
CommandManager * pMan = pProject->GetCommandManager();
|
||||||
|
|
||||||
// Yucky static variables. Is there a better way? The problem is that we need the
|
// 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(
|
void ScreenshotCommand::CaptureEffects(
|
||||||
const CommandContext & context,
|
const CommandContext & context,
|
||||||
AudacityProject * pProject, const wxString &mFileName ){
|
AudacityProject * pProject, const wxString &mFileName ){
|
||||||
mFileName;//compiler food.
|
(void)&mFileName;//compiler food.
|
||||||
|
(void)&context;
|
||||||
CommandManager * pMan = pProject->GetCommandManager();
|
CommandManager * pMan = pProject->GetCommandManager();
|
||||||
wxString Str;
|
wxString Str;
|
||||||
// Yucky static variables. Is there a better way? The problem is that we need the
|
// Yucky static variables. Is there a better way? The problem is that we need the
|
||||||
|
@ -46,6 +46,7 @@ private:
|
|||||||
wxString mWhat;
|
wxString mWhat;
|
||||||
wxString mBack;
|
wxString mBack;
|
||||||
wxString mPath;
|
wxString mPath;
|
||||||
|
bool bHasBackground;
|
||||||
friend class ScreenshotCommand;
|
friend class ScreenshotCommand;
|
||||||
friend class ScreenFrame;
|
friend class ScreenFrame;
|
||||||
|
|
||||||
|
@ -40,9 +40,9 @@ explicitly code all three.
|
|||||||
#include "CommandContext.h"
|
#include "CommandContext.h"
|
||||||
|
|
||||||
bool SelectTimeCommand::DefineParams( ShuttleParams & S ){
|
bool SelectTimeCommand::DefineParams( ShuttleParams & S ){
|
||||||
S.Optional( bHasT0 ).Define( mT0, wxT("Start"), 0.0, 0.0, (double)FLT_MAX);
|
S.OptionalY( 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.OptionalY( bHasT1 ).Define( mT1, wxT("End"), 0.0, 0.0, (double)FLT_MAX);
|
||||||
S.Define( mFromEnd, wxT("FromEnd"), false );
|
S.OptionalY( bHasFromEnd).Define( mFromEnd, wxT("FromEnd"), false );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,6 +58,7 @@ void SelectTimeCommand::PopulateOrExchange(ShuttleGui & S)
|
|||||||
S.EndMultiColumn();
|
S.EndMultiColumn();
|
||||||
S.StartMultiColumn(2, wxALIGN_CENTER);
|
S.StartMultiColumn(2, wxALIGN_CENTER);
|
||||||
{
|
{
|
||||||
|
// Always used, so no optional checkbox.
|
||||||
S.TieCheckBox(_("From End:"), mFromEnd );
|
S.TieCheckBox(_("From End:"), mFromEnd );
|
||||||
}
|
}
|
||||||
S.EndMultiColumn();
|
S.EndMultiColumn();
|
||||||
@ -81,8 +82,8 @@ bool SelectTimeCommand::Apply(const CommandContext & context){
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool SelectFrequenciesCommand::DefineParams( ShuttleParams & S ){
|
bool SelectFrequenciesCommand::DefineParams( ShuttleParams & S ){
|
||||||
S.Optional( bHasTop ).Define( mTop, wxT("High"), 0.0, 0.0, (double)FLT_MAX);
|
S.OptionalN( 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( bHasBottom ).Define( mBottom, wxT("Low"), 0.0, 0.0, (double)FLT_MAX);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,9 +122,9 @@ static const wxString kModes[nModes] =
|
|||||||
|
|
||||||
bool SelectTracksCommand::DefineParams( ShuttleParams & S ){
|
bool SelectTracksCommand::DefineParams( ShuttleParams & S ){
|
||||||
wxArrayString modes( nModes, kModes );
|
wxArrayString modes( nModes, kModes );
|
||||||
S.Optional( bHasFirstTrack).Define( mFirstTrack, wxT("First"), 0, 0, 100);
|
S.OptionalN( bHasFirstTrack).Define( mFirstTrack, wxT("First"), 0, 0, 100);
|
||||||
S.Optional( bHasLastTrack ).Define( mLastTrack, wxT("Last"), 0, 0, 100);
|
S.OptionalN( bHasLastTrack ).Define( mLastTrack, wxT("Last"), 0, 0, 100);
|
||||||
S.DefineEnum( mMode, wxT("Mode"), 0, modes );
|
S.OptionalY( bHasMode ).DefineEnum( mMode, wxT("Mode"), 0, modes );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -141,6 +142,7 @@ void SelectTracksCommand::PopulateOrExchange(ShuttleGui & S)
|
|||||||
S.EndMultiColumn();
|
S.EndMultiColumn();
|
||||||
S.StartMultiColumn(2, wxALIGN_CENTER);
|
S.StartMultiColumn(2, wxALIGN_CENTER);
|
||||||
{
|
{
|
||||||
|
// Always used, so no check box.
|
||||||
S.TieChoice( _("Mode:"), mMode, &modes);
|
S.TieChoice( _("Mode:"), mMode, &modes);
|
||||||
}
|
}
|
||||||
S.EndMultiColumn();
|
S.EndMultiColumn();
|
||||||
|
@ -45,6 +45,7 @@ public:
|
|||||||
|
|
||||||
bool bHasT0;
|
bool bHasT0;
|
||||||
bool bHasT1;
|
bool bHasT1;
|
||||||
|
bool bHasFromEnd;
|
||||||
|
|
||||||
double mT0;
|
double mT0;
|
||||||
double mT1;
|
double mT1;
|
||||||
@ -86,6 +87,7 @@ public:
|
|||||||
|
|
||||||
bool bHasFirstTrack;
|
bool bHasFirstTrack;
|
||||||
bool bHasLastTrack;
|
bool bHasLastTrack;
|
||||||
|
bool bHasMode;
|
||||||
|
|
||||||
int mFirstTrack;
|
int mFirstTrack;
|
||||||
int mLastTrack;
|
int mLastTrack;
|
||||||
|
@ -31,12 +31,11 @@ SetEnvelopeCommand::SetEnvelopeCommand()
|
|||||||
|
|
||||||
|
|
||||||
bool SetEnvelopeCommand::DefineParams( ShuttleParams & S ){
|
bool SetEnvelopeCommand::DefineParams( ShuttleParams & S ){
|
||||||
S.Optional( bHasTrackIndex ).Define( mTrackIndex, wxT("Track"), 0, 0, 100 );
|
S.OptionalY( bHasTrackIndex ).Define( mTrackIndex, wxT("Track"), 0, 0, 100 );
|
||||||
S.Optional( bHasChannelIndex ).Define( mChannelIndex, wxT("Channel"), 0, 0, 100 );
|
S.OptionalN( bHasChannelIndex ).Define( mChannelIndex, wxT("Channel"), 0, 0, 100 );
|
||||||
S.Optional( bHasContainsTime ).Define( mContainsTime, wxT("At"), 0.0, 0.0, 100000.0 );
|
S.OptionalY( bHasT ).Define( mT, wxT("Time"), 0.0, 0.0, 100000.0);
|
||||||
S.Optional( 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.Optional( bHasV ).Define( mV, wxT("Value"), 0.0, 0.0, 2.0);
|
S.OptionalN( bHasDelete ).Define( mbDelete, wxT("Delete"), false );
|
||||||
S.Optional( bHasDelete ).Define( mbDelete, wxT("Delete"), false );
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -48,7 +47,6 @@ void SetEnvelopeCommand::PopulateOrExchange(ShuttleGui & S)
|
|||||||
{
|
{
|
||||||
S.Optional( bHasTrackIndex ).TieNumericTextBox( _("Track Index:"), mTrackIndex );
|
S.Optional( bHasTrackIndex ).TieNumericTextBox( _("Track Index:"), mTrackIndex );
|
||||||
S.Optional( bHasChannelIndex).TieNumericTextBox( _("Channel Index:"), mChannelIndex );
|
S.Optional( bHasChannelIndex).TieNumericTextBox( _("Channel Index:"), mChannelIndex );
|
||||||
S.Optional( bHasContainsTime).TieNumericTextBox( _("At:"), mContainsTime );
|
|
||||||
S.Optional( bHasT ).TieNumericTextBox( _("Time:"), mT );
|
S.Optional( bHasT ).TieNumericTextBox( _("Time:"), mT );
|
||||||
S.Optional( bHasV ).TieNumericTextBox( _("Value:"), mV );
|
S.Optional( bHasV ).TieNumericTextBox( _("Value:"), mV );
|
||||||
S.Optional( bHasDelete ).TieCheckBox( _("Delete:"), mbDelete );
|
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++ ){
|
for(auto it = ptrs.begin(); (it != ptrs.end()); it++ ){
|
||||||
pClip = *it;
|
pClip = *it;
|
||||||
bFound =
|
bFound =
|
||||||
!bHasContainsTime || (
|
!bHasT || (
|
||||||
( pClip->GetStartTime() <= mContainsTime ) &&
|
( pClip->GetStartTime() <= mT) &&
|
||||||
( pClip->GetEndTime() >= mContainsTime )
|
( pClip->GetEndTime() >= mT )
|
||||||
);
|
);
|
||||||
if( bFound )
|
if( bFound )
|
||||||
{
|
{
|
||||||
|
@ -39,14 +39,12 @@ public:
|
|||||||
public:
|
public:
|
||||||
int mTrackIndex;
|
int mTrackIndex;
|
||||||
int mChannelIndex;
|
int mChannelIndex;
|
||||||
double mContainsTime;
|
|
||||||
double mT;
|
double mT;
|
||||||
double mV;
|
double mV;
|
||||||
bool mbDelete;
|
bool mbDelete;
|
||||||
|
|
||||||
bool bHasTrackIndex;
|
bool bHasTrackIndex;
|
||||||
bool bHasChannelIndex;
|
bool bHasChannelIndex;
|
||||||
bool bHasContainsTime;
|
|
||||||
bool bHasT;
|
bool bHasT;
|
||||||
bool bHasV;
|
bool bHasV;
|
||||||
bool bHasDelete;
|
bool bHasDelete;
|
||||||
|
@ -31,11 +31,11 @@ SetProjectCommand::SetProjectCommand()
|
|||||||
|
|
||||||
|
|
||||||
bool SetProjectCommand::DefineParams( ShuttleParams & S ){
|
bool SetProjectCommand::DefineParams( ShuttleParams & S ){
|
||||||
S.Optional( bHasName ).Define( mName, wxT("Name"), _("Project") );
|
S.OptionalN( bHasName ).Define( mName, wxT("Name"), _("Project") );
|
||||||
S.Optional( bHasSizing ).Define( mPosX, wxT("X"), 10.0, 0.0, 2000.0);
|
S.OptionalY( 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.OptionalY( 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.OptionalY( 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.OptionalY( bHasSizing ).Define( mHeight, wxT("Height"), 900.0, 200.0, 4000.0);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user