diff --git a/src/commands/SetClipCommand.cpp b/src/commands/SetClipCommand.cpp index b90ee7f39..92792aaf6 100644 --- a/src/commands/SetClipCommand.cpp +++ b/src/commands/SetClipCommand.cpp @@ -74,6 +74,7 @@ void SetClipCommand::PopulateOrExchange(ShuttleGui & S) bool SetClipCommand::ApplyInner( const CommandContext & context, Track * t ) { + static_cast(context); if( t->GetKind() != Track::Wave) return true; diff --git a/src/commands/SetEnvelopeCommand.cpp b/src/commands/SetEnvelopeCommand.cpp index cab2981a0..39b303616 100644 --- a/src/commands/SetEnvelopeCommand.cpp +++ b/src/commands/SetEnvelopeCommand.cpp @@ -53,6 +53,7 @@ void SetEnvelopeCommand::PopulateOrExchange(ShuttleGui & S) bool SetEnvelopeCommand::ApplyInner( const CommandContext & context, Track * t ) { + static_cast(context); if( (t->GetKind() != Track::Wave)) return true; diff --git a/src/commands/SetTrackInfoCommand.cpp b/src/commands/SetTrackInfoCommand.cpp index 3c4edbe22..35abb1fb0 100644 --- a/src/commands/SetTrackInfoCommand.cpp +++ b/src/commands/SetTrackInfoCommand.cpp @@ -52,8 +52,18 @@ SetTrackBase::SetTrackBase(){ //rather than using the current selection. //#define USE_OWN_TRACK_SELECTION -bool SetTrackBase::DefineParams( ShuttleParams & S ) + +bool SetTrackBase::ApplyInner( const CommandContext &context, Track *t ) { + static_cast(&context); + static_cast(&t); + return true; +}; + + +bool SetTrackBase::DefineParams( ShuttleParams & S) +{ + static_cast(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 ); @@ -63,6 +73,7 @@ bool SetTrackBase::DefineParams( ShuttleParams & S ) void SetTrackBase::PopulateOrExchange(ShuttleGui & S) { + static_cast(S); #ifdef USE_OWN_TRACK_SELECTION if( !mbPromptForTracks ) return; @@ -136,8 +147,8 @@ void SetTrackStatusCommand::PopulateOrExchange(ShuttleGui & S) bool SetTrackStatusCommand::ApplyInner(const CommandContext & context, Track * t ) { - auto wt = dynamic_cast(t); - auto pt = dynamic_cast(t); + //auto wt = dynamic_cast(t); + //auto pt = dynamic_cast(t); // You can get some intriguing effects by setting R and L channels to // different values. @@ -169,8 +180,8 @@ bool SetTrackAudioCommand::DefineParams( ShuttleParams & S ){ S.OptionalN( bHasMute ).Define( bMute, wxT("Mute"), false ); S.OptionalN( bHasSolo ).Define( bSolo, wxT("Solo"), false ); - 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( bHasGain ).Define( mGain, wxT("Gain"), 0.0, -36.0, 36.0); + S.OptionalN( bHasPan ).Define( mPan, wxT("Pan"), 0.0, -100.0, 100.0); return true; }; @@ -187,23 +198,22 @@ void SetTrackAudioCommand::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(3, wxEXPAND); { S.SetStretchyCol( 2 ); - S.Optional( bHasPan ).TieSlider( _("Pan:"), mPan, 1.0, -1.0); - S.Optional( bHasGain ).TieSlider( _("Gain:"), mGain, 10.0, 0.0); + S.Optional( bHasGain ).TieSlider( _("Gain:"), mGain, 36.0,-36.0); + S.Optional( bHasPan ).TieSlider( _("Pan:"), mPan, 100.0, -100.0); } S.EndMultiColumn(); } bool SetTrackAudioCommand::ApplyInner(const CommandContext & context, Track * t ) { + static_cast(context); auto wt = dynamic_cast(t); auto pt = dynamic_cast(t); - // You can get some intriguing effects by setting R and L channels to - // different values. - if( wt && bHasPan ) - wt->SetPan(mPan); if( wt && bHasGain ) - wt->SetGain(mGain); + wt->SetGain(DB_TO_LINEAR(mGain)); + if( wt && bHasPan ) + wt->SetPan(mPan/100.0); // These ones don't make sense on the second channel of a stereo track. if( !bIsSecondChannel ){ @@ -326,8 +336,9 @@ void SetTrackVisualsCommand::PopulateOrExchange(ShuttleGui & S) bool SetTrackVisualsCommand::ApplyInner(const CommandContext & context, Track * t ) { + static_cast(context); auto wt = dynamic_cast(t); - auto pt = dynamic_cast(t); + //auto pt = dynamic_cast(t); // You can get some intriguing effects by setting R and L channels to // different values. diff --git a/src/commands/SetTrackInfoCommand.h b/src/commands/SetTrackInfoCommand.h index 55687a7c0..bc6a4d3c0 100644 --- a/src/commands/SetTrackInfoCommand.h +++ b/src/commands/SetTrackInfoCommand.h @@ -32,7 +32,7 @@ class SetTrackBase : public AudacityCommand public: SetTrackBase(); bool Apply(const CommandContext & context) override; - virtual bool ApplyInner( const CommandContext & context, Track * t ){return true;}; + virtual bool ApplyInner( const CommandContext &context, Track *t ); virtual bool DefineParams( ShuttleParams & S ) override; virtual void PopulateOrExchange(ShuttleGui & S) override;