1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Use track selection for SetTrack, SetClip and SetEnvelope

These commands now have shorter dialogs.
Also fixed SetEnvelope optionals, which were not being honoured.
This commit is contained in:
James Crook
2018-03-19 11:59:33 +00:00
parent e661c7da49
commit 0a7d0068ec
5 changed files with 61 additions and 112 deletions

View File

@@ -48,15 +48,22 @@ SetTrackBase::SetTrackBase(){
mbPromptForTracks = true;
}
//Define for the old scheme, where SetTrack defines its own track selection.
//rather than using the current selection.
//#define USE_OWN_TRACK_SELECTION
bool SetTrackBase::DefineParams( ShuttleParams & S )
{
#ifdef USE_OWN_TRACK_SELECTION
S.OptionalY( bHasTrackIndex ).Define( mTrackIndex, wxT("Track"), 0, 0, 100 );
S.OptionalN( bHasChannelIndex ).Define( mChannelIndex, wxT("Channel"), 0, 0, 100 );
#endif
return true;
}
void SetTrackBase::PopulateOrExchange(ShuttleGui & S)
{
#ifdef USE_OWN_TRACK_SELECTION
if( !mbPromptForTracks )
return;
S.AddSpace(0, 5);
@@ -67,6 +74,7 @@ void SetTrackBase::PopulateOrExchange(ShuttleGui & S)
S.Optional( bHasChannelIndex).TieNumericTextBox( _("Channel Index:"), mChannelIndex );
}
S.EndMultiColumn();
#endif
}
bool SetTrackBase::Apply(const CommandContext & context )
@@ -79,9 +87,13 @@ bool SetTrackBase::Apply(const CommandContext & context )
while (t )
{
bool bThisTrack =
#ifdef USE_OWN_TRACK_SELECTION
(bHasTrackIndex && (i==mTrackIndex)) ||
(bHasChannelIndex && (j==mChannelIndex ) ) ||
(!bHasTrackIndex && !bHasChannelIndex) ;
#else
t->GetSelected();
#endif
if( bThisTrack ){
ApplyInner( context, t );
@@ -95,8 +107,6 @@ bool SetTrackBase::Apply(const CommandContext & context )
return true;
}
bool SetTrackStatusCommand::DefineParams( ShuttleParams & S ){
SetTrackBase::DefineParams( S );
S.OptionalN( bHasTrackName ).Define( mTrackName, wxT("Name"), wxT("Unnamed") );