1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 06:01:13 +02:00

Add DragCommand. Default Y/N on optional fields. Open/Save project items.

- 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:
James Crook
2018-02-17 13:29:46 +00:00
committed by Paul Licameli
parent bcf0865c1a
commit e3ef968d57
27 changed files with 286 additions and 67 deletions

View File

@@ -295,6 +295,7 @@ bool CommandImplementation::Apply(const CommandContext & WXUNUSED(context))
#include "SetLabelCommand.cpp"
#include "SetProjectCommand.cpp"
#include "SetEnvelopeCommand.cpp"
#include "DragCommand.cpp"
#endif
#endif

View File

@@ -313,6 +313,7 @@ LongMessageDialog::LongMessageDialog(wxWindow * parent,
{
mType = type;
mAdditionalButtons = additionalButtons;
SetName( "Long Message" );
}
LongMessageDialog::~LongMessageDialog(){

View File

@@ -0,0 +1,121 @@
/**********************************************************************
Audacity - A Digital Audio Editor
Copyright 1999-2018 Audacity Team
License: wxwidgets
James Crook
******************************************************************//**
\file DragCommand.cpp
\brief Definitions for DragCommand
\class DragCommand
\brief Command that sets clip information
*//*******************************************************************/
#include "../Audacity.h"
#include "DragCommand.h"
#include "../Project.h"
#include "../Track.h"
#include "../TrackPanel.h"
#include "../WaveTrack.h"
#include "../ShuttleGui.h"
#include "CommandContext.h"
DragCommand::DragCommand()
{
}
enum kCoordTypes
{
kPanel,
kApp,
kTrack0,
kTrack1,
nCoordTypes
};
static const wxString kCoordTypeStrings[nCoordTypes] =
{
XO("Panel"),
XO("App"),
XO("Track0"),
XO("Track1"),
};
bool DragCommand::DefineParams( ShuttleParams & S ){
wxArrayString coords( nCoordTypes, kCoordTypeStrings );
S.OptionalN( bHasId ).Define( mId, wxT("Id"), 0.0, 11000.0, 1000000.0);
S.OptionalY( bHasWinName ).Define( mWinName, wxT("Window"), "Timeline");
S.OptionalY( bHasFromX ).Define( mFromX, wxT("FromX"), 200.0, 0.0, 1000000.0);
S.OptionalY( bHasFromY ).Define( mFromY, wxT("FromY"), 10.0, 0.0, 1000000.0);
S.OptionalN( bHasToX ).Define( mToX, wxT("ToX"), 400.0, 0.0, 1000000.0);
S.OptionalN( bHasToY ).Define( mToY, wxT("ToY"), 10.0, 0.0, 1000000.0);
S.OptionalN( bHasRelativeTo ).DefineEnum( mRelativeTo, wxT("RelativeTo"), kPanel, coords );
return true;
};
void DragCommand::PopulateOrExchange(ShuttleGui & S)
{
wxArrayString coords( nCoordTypes, kCoordTypeStrings );
S.AddSpace(0, 5);
S.StartMultiColumn(3, wxALIGN_CENTER);
{
S.Optional( bHasId ).TieNumericTextBox( _("Id:"), mId );
S.Optional( bHasWinName ).TieTextBox( _("Window Name:"), mWinName );
S.Optional( bHasFromX ).TieNumericTextBox( _("From X:"), mFromX );
S.Optional( bHasFromY ).TieNumericTextBox( _("From Y:"), mFromY );
S.Optional( bHasToX ).TieNumericTextBox( _("To X:"), mToX );
S.Optional( bHasToY ).TieNumericTextBox( _("To Y:"), mToY );
S.Optional( bHasRelativeTo ).TieChoice( _("Relative To:"), mRelativeTo, &coords );
}
S.EndMultiColumn();
}
bool DragCommand::Apply(const CommandContext & context)
{
wxWindow * pWin = context.GetProject();
wxWindow * pWin1 = nullptr;
wxMouseEvent Evt( wxEVT_MOTION );
Evt.m_x = mFromX;
Evt.m_y = mFromY;
if( bHasId )
pWin1 = pWin->FindWindowById( mId );
if( bHasWinName )
pWin1 = pWin->FindWindowByName( mWinName );
if( pWin1 )
pWin = pWin1;
// Process twice - possible bug in Audacity being worked around
// where we need an event to enter AND an event to move.
// AdornedRuler Quick-Play bug.
pWin->GetEventHandler()->ProcessEvent( Evt );
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;
pWin->GetEventHandler()->ProcessEvent( Evt2 );
wxMouseEvent Evt3( wxEVT_MOTION );
Evt3.m_leftDown = true;
Evt2.m_aux2Down = true;
Evt3.m_x = mToX;
Evt3.m_y = mToY;
// AdornedRuler Quick-Play bug again.
pWin->GetEventHandler()->ProcessEvent( Evt3 );
pWin->GetEventHandler()->ProcessEvent( Evt3 );
wxMouseEvent Evt4( wxEVT_LEFT_UP );
Evt2.m_aux2Down = true;
Evt4.m_x = mToX;
Evt4.m_y = mToY;
pWin->GetEventHandler()->ProcessEvent( Evt4 );
}
return true;
}

View File

@@ -0,0 +1,59 @@
/**********************************************************************
Audacity - A Digital Audio Editor
Copyright 1999-2009 Audacity Team
License: wxwidgets
James Crook
******************************************************************//**
\file DragCommand.h
\brief Declarations of DragCommand and DragCommandType classes
*//*******************************************************************/
#ifndef __DRAG_COMMAND__
#define __DRAG_COMMAND__
#include "Command.h"
#include "CommandType.h"
#define DRAG_PLUGIN_SYMBOL XO("Drag")
class DragCommand : public AudacityCommand
{
public:
DragCommand();
// CommandDefinitionInterface overrides
wxString GetSymbol() override {return DRAG_PLUGIN_SYMBOL;};
wxString GetDescription() override {return _("Drags mouse from one place to another.");};
bool DefineParams( ShuttleParams & S ) override;
void PopulateOrExchange(ShuttleGui & S) override;
// AudacityCommand overrides
wxString ManualPage() override {return wxT("Extra_Menu:_Automation#drag");};
bool Apply(const CommandContext & context) override;
public:
double mFromX;
double mFromY;
double mToX;
double mToY;
int mRelativeTo;
int mId;
wxString mWinName;
bool bHasFromX;
bool bHasFromY;
bool bHasToX;
bool bHasToY;
bool bHasRelativeTo;
bool bHasId;
bool bHasWinName;
};
#endif /* End of include guard: __DRAG_COMMAND__ */

View File

@@ -311,7 +311,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" );
@@ -586,7 +586,8 @@ void GetInfoCommand::ExploreWindows( const CommandContext &context,
context.AddItem( R.GetTop() );
context.AddItem( R.GetRight() );
context.AddItem( R.GetBottom() );
context.AddItem( Name );
context.AddItem( Name );
context.AddItem( item->GetId() );
context.EndArray();
ExploreWindows( context, P, item, item->GetId(), depth+1 );

View File

@@ -37,7 +37,7 @@ modelled on BuiltinEffectsModule
#include "../commands/SetEnvelopeCommand.h"
#include "../commands/SetClipCommand.h"
#include "../commands/SetProjectCommand.h"
#include "../commands/DragCommand.h"
//
// Define the list of COMMANDs that will be autoregistered and how to instantiate each
@@ -46,6 +46,7 @@ modelled on BuiltinEffectsModule
COMMAND( DEMO, DemoCommand, () ) \
COMMAND( MESSAGE, MessageCommand, () ) \
COMMAND( SCREENSHOT, ScreenshotCommand, () ) \
COMMAND( DRAG, DragCommand, () ) \
COMMAND( COMPARE_AUDIO, CompareAudioCommand, () ) \
COMMAND( SET_TRACK, SetTrackCommand, () ) \
COMMAND( SET_ENVELOPE, SetEnvelopeCommand, () ) \

View File

@@ -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;
}

View File

@@ -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;
};

View File

@@ -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;
}

View File

@@ -63,6 +63,7 @@ public:
wxString mName;
wxString mValue;
bool mbReload;
bool bHasReload;
};
#endif /* End of include guard: __PREFERENCE_COMMANDS__ */

View File

@@ -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

View File

@@ -46,6 +46,7 @@ private:
wxString mWhat;
wxString mBack;
wxString mPath;
bool bHasBackground;
friend class ScreenshotCommand;
friend class ScreenFrame;

View File

@@ -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();
@@ -77,8 +78,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;
}
@@ -113,9 +114,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;
}
@@ -133,6 +134,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();

View File

@@ -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;

View File

@@ -49,13 +49,13 @@ static const wxString kColourStrings[nColours] =
bool SetClipCommand::DefineParams( ShuttleParams & S ){
wxArrayString colours( nColours, kColourStrings );
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( bHasColour ).DefineEnum( mColour, wxT("Color"), kColour0, colours );
S.OptionalY( bHasTrackIndex ).Define( mTrackIndex, wxT("Track"), 0, 0, 100 );
S.OptionalN( bHasChannelIndex ).Define( mChannelIndex, wxT("Channel"), 0, 0, 100 );
S.OptionalY( bHasContainsTime ).Define( mContainsTime, wxT("At"), 0.0, 0.0, 100000.0 );
S.OptionalN( bHasColour ).DefineEnum( mColour, wxT("Color"), kColour0, colours );
// Allowing a negative start time is not a mistake.
// It will be used in demonstrating time before zero.
S.Optional( bHasT0 ).Define( mT0, wxT("Start"), 0.0, -5.0, 1000000.0);
S.OptionalN( bHasT0 ).Define( mT0, wxT("Start"), 0.0, -5.0, 1000000.0);
return true;
};

View File

@@ -32,12 +32,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;
};
@@ -49,7 +48,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 );
@@ -85,9 +83,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 )
{

View File

@@ -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;

View File

@@ -32,11 +32,11 @@ SetLabelCommand::SetLabelCommand()
bool SetLabelCommand::DefineParams( ShuttleParams & S ){
S.Define( mLabelIndex, wxT("Label"), 0, 0, 100 );
S.Optional( bHasText ).Define( mText, wxT("Text"), wxT("empty") );
S.Optional( bHasT0 ).Define( mT0, wxT("Start"), 0.0, 0.0, 100000.0);
S.Optional( bHasT1 ).Define( mT1, wxT("End"), 0.0, 0.0, 100000.0);
S.Optional( bHasSelected ).Define( mbSelected, wxT("Selected"), false );
S.Define( mLabelIndex, wxT("Label"), 0, 0, 100 );
S.OptionalY( bHasText ).Define( mText, wxT("Text"), wxT("empty") );
S.OptionalY( bHasT0 ).Define( mT0, wxT("Start"), 0.0, 0.0, 100000.0);
S.OptionalY( bHasT1 ).Define( mT1, wxT("End"), 0.0, 0.0, 100000.0);
S.OptionalN( bHasSelected ).Define( mbSelected, wxT("Selected"), false );
return true;
};

View File

@@ -32,11 +32,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;
};

View File

@@ -82,22 +82,22 @@ bool SetTrackCommand::DefineParams( ShuttleParams & S ){
wxArrayString displays( nDisplayTypes, kDisplayTypeStrings );
wxArrayString scales( nScaleTypes, kScaleTypeStrings );
S.Optional( bHasTrackIndex ).Define( mTrackIndex, wxT("Track"), 0, 0, 100 );
S.Optional( bHasChannelIndex ).Define( mChannelIndex, wxT("Channel"), 0, 0, 100 );
S.Optional( bHasTrackName ).Define( mTrackName, wxT("Name"), wxT("Unnamed") );
S.Optional( bHasPan ).Define( mPan, wxT("Pan"), 0.0, -1.0, 1.0);
S.Optional( bHasGain ).Define( mGain, wxT("Gain"), 1.0, 0.0, 10.0);
S.Optional( bHasHeight ).Define( mHeight, wxT("Height"), 120, 44, 700 );
S.Optional( bHasDisplayType ).DefineEnum( mDisplayType, wxT("Display"), kWaveform, displays );
S.Optional( bHasScaleType ).DefineEnum( mScaleType, wxT("Scale"), kLinear, scales );
S.Optional( bHasColour ).DefineEnum( mColour, wxT("Color"), kColour0, colours );
S.Optional( bHasSpectralSelect ).Define( bSpectralSelect, wxT("SpectralSel"),true );
S.Optional( bHasGrayScale ).Define( bGrayScale, wxT("GrayScale"), false );
S.OptionalY( bHasTrackIndex ).Define( mTrackIndex, wxT("Track"), 0, 0, 100 );
S.OptionalN( bHasChannelIndex ).Define( mChannelIndex, wxT("Channel"), 0, 0, 100 );
S.OptionalN( bHasTrackName ).Define( mTrackName, wxT("Name"), wxT("Unnamed") );
S.OptionalN( bHasPan ).Define( mPan, wxT("Pan"), 0.0, -1.0, 1.0);
S.OptionalN( bHasGain ).Define( mGain, wxT("Gain"), 1.0, 0.0, 10.0);
S.OptionalN( bHasHeight ).Define( mHeight, wxT("Height"), 120, 44, 700 );
S.OptionalN( bHasDisplayType ).DefineEnum( mDisplayType, wxT("Display"), kWaveform, displays );
S.OptionalN( bHasScaleType ).DefineEnum( mScaleType, wxT("Scale"), kLinear, scales );
S.OptionalN( bHasColour ).DefineEnum( mColour, wxT("Color"), kColour0, colours );
S.OptionalN( bHasSpectralSelect ).Define( bSpectralSelect, wxT("SpectralSel"),true );
S.OptionalN( bHasGrayScale ).Define( bGrayScale, wxT("GrayScale"), false );
// There is also a select command. This is an alternative.
S.Optional( bHasSelected ).Define( bSelected, wxT("Selected"), false );
S.Optional( bHasFocused ).Define( bFocused, wxT("Focused"), false );
S.Optional( bHasSolo ).Define( bSolo, wxT("Solo"), false );
S.Optional( bHasMute ).Define( bMute, wxT("Mute"), false );
S.OptionalN( bHasSelected ).Define( bSelected, wxT("Selected"), false );
S.OptionalN( bHasFocused ).Define( bFocused, wxT("Focused"), false );
S.OptionalN( bHasSolo ).Define( bSolo, wxT("Solo"), false );
S.OptionalN( bHasMute ).Define( bMute, wxT("Mute"), false );
return true;
};