コード例 #1
0
ファイル: TruncSilence.cpp プロジェクト: jengelh/audacity
bool EffectTruncSilence::SetAutomationParameters(EffectAutomationParameters & parms)
{
   wxArrayString actions(kNumActions, kActionStrings);
   actions.Insert(wxT("0"), 0); // Compatible with 2.1.0 and before
   actions.Insert(wxT("1"), 1); // Compatible with 2.1.0 and before

   ReadAndVerifyDouble(Minimum);
   ReadAndVerifyDouble(Truncate);
   ReadAndVerifyDouble(Compress);
   ReadAndVerifyEnum(DbIndex, mDbChoices);
   ReadAndVerifyEnum(ActIndex, actions);
   ReadAndVerifyBool(Independent);

   mInitialAllowedSilence = Minimum;
   mTruncLongestAllowedSilence = Truncate;
   mSilenceCompressPercent = Compress;
   mTruncDbChoiceIndex = DbIndex;
   mActionIndex = ActIndex;
   mbIndependent = Independent;

   // Readjust for 2.1.0 or before
   if (mActionIndex >= kNumActions)
   {
      mActionIndex -= kNumActions;
   }

   return true;
}
コード例 #2
0
ファイル: Phaser.cpp プロジェクト: henricj/audacity
bool EffectPhaser::SetAutomationParameters(EffectAutomationParameters & parms)
{
   ReadAndVerifyInt(Stages);
   ReadAndVerifyInt(DryWet);
   ReadAndVerifyDouble(Freq);
   ReadAndVerifyDouble(Phase);
   ReadAndVerifyInt(Depth);
   ReadAndVerifyInt(Feedback);
   ReadAndVerifyDouble(OutGain);

   if (Stages & 1)    // must be even, but don't complain about it
   {
      Stages &= ~1;
   }

   mFreq = Freq;
   mFeedback = Feedback;
   mStages = Stages;
   mDryWet = DryWet;
   mDepth = Depth;
   mPhase = Phase;
   mOutGain = OutGain;

   return true;
}
コード例 #3
0
ファイル: DtmfGen.cpp プロジェクト: SteveDaulton/audacity
bool EffectDtmf::SetAutomationParameters(CommandParameters & parms)
{
   ReadAndVerifyDouble(DutyCycle);
   ReadAndVerifyDouble(Amplitude);
   ReadAndVerifyString(Sequence);

   wxString symbols;
   for (unsigned int i = 0; i < WXSIZEOF(kSymbols); i++)
   {
      symbols += kSymbols[i];
   }

   if (Sequence.find_first_not_of(symbols) != wxString::npos)
   {
      return false;
   }

   dtmfDutyCycle = DutyCycle;
   dtmfAmplitude = Amplitude;
   dtmfSequence = Sequence;
   
   Recalculate();

   return true;
}
コード例 #4
0
ファイル: TruncSilence.cpp プロジェクト: finefin/audacity
bool EffectTruncSilence::SetAutomationParameters(CommandParameters & parms)
{
   ReadAndVerifyDouble(Minimum);
   ReadAndVerifyDouble(Truncate);
   ReadAndVerifyDouble(Compress);

   // This control migrated from a choice to a text box in version 2.3.0
   double myThreshold {};
   bool newParams = [&] {
      ReadAndVerifyDouble(Threshold); // macro may return false
      myThreshold = Threshold;
      return true;
   } ();

   if ( !newParams ) {
      // Use legacy param:
      ReadAndVerifyEnum(DbIndex, Enums::DbChoices, Enums::NumDbChoices);
      myThreshold = enumToDB( DbIndex );
   }

   ReadAndVerifyEnumWithObsoletes(ActIndex, kActionStrings, nActions,
                                  kObsoleteActions, nObsoleteActions);
   ReadAndVerifyBool(Independent);

   mInitialAllowedSilence = Minimum;
   mTruncLongestAllowedSilence = Truncate;
   mSilenceCompressPercent = Compress;
   mThresholdDB = myThreshold;
   mActionIndex = ActIndex;
   mbIndependent = Independent;

   return true;
}
コード例 #5
0
ファイル: Reverb.cpp プロジェクト: AthiVarathan/audacity
bool EffectReverb::SetAutomationParameters(EffectAutomationParameters & parms)
{
   ReadAndVerifyDouble(RoomSize);
   ReadAndVerifyDouble(PreDelay);
   ReadAndVerifyDouble(Reverberance);
   ReadAndVerifyDouble(HfDamping);
   ReadAndVerifyDouble(ToneLow);
   ReadAndVerifyDouble(ToneHigh);
   ReadAndVerifyDouble(WetGain);
   ReadAndVerifyDouble(DryGain);
   ReadAndVerifyDouble(StereoWidth);
   ReadAndVerifyBool(WetOnly);

   mParams.mRoomSize = RoomSize;
   mParams.mPreDelay = PreDelay;
   mParams.mReverberance = Reverberance;
   mParams.mHfDamping = HfDamping;
   mParams.mToneLow = ToneLow;
   mParams.mToneHigh = ToneHigh;
   mParams.mWetGain = WetGain;
   mParams.mDryGain = DryGain;
   mParams.mStereoWidth = StereoWidth;
   mParams.mWetOnly = WetOnly;

   return true;
}
コード例 #6
0
ファイル: BassTreble.cpp プロジェクト: MindFy/audacity
bool EffectBassTreble::SetAutomationParameters(CommandParameters & parms)
{
   ReadAndVerifyDouble(Bass);
   ReadAndVerifyDouble(Treble);
   ReadAndVerifyDouble(Gain);
   ReadAndVerifyBool(Link);

   mBass = Bass;
   mTreble = Treble;
   mGain = Gain;
   mLink = Link;

   return true;
}
コード例 #7
0
ファイル: ChangeSpeed.cpp プロジェクト: rbuj/audacity
bool EffectChangeSpeed::SetAutomationParameters(EffectAutomationParameters & parms)
{
   ReadAndVerifyDouble(Percentage);

   m_PercentChange = Percentage;

   return true;
}
コード例 #8
0
ファイル: Wahwah.cpp プロジェクト: SteveDaulton/audacity
bool EffectWahwah::SetAutomationParameters(CommandParameters & parms)
{
   ReadAndVerifyDouble(Freq);
   ReadAndVerifyDouble(Phase);
   ReadAndVerifyInt(Depth);
   ReadAndVerifyDouble(Res);
   ReadAndVerifyInt(FreqOfs);
   ReadAndVerifyDouble(OutGain);

   mFreq = Freq;
   mPhase = Phase;
   mDepth = Depth;
   mRes = Res;
   mFreqOfs = FreqOfs;
   mOutGain = OutGain;

   return true;
}
コード例 #9
0
ファイル: ChangePitch.cpp プロジェクト: Avi2011class/audacity
bool EffectChangePitch::SetAutomationParameters(EffectAutomationParameters & parms)
{
   // Vaughan, 2013-06: Long lost to history, I don't see why m_dPercentChange was chosen to be shuttled.
   // Only m_dSemitonesChange is used in Process().
   ReadAndVerifyDouble(Percentage);

   m_dPercentChange = Percentage;

   return true;
}
コード例 #10
0
ファイル: Noise.cpp プロジェクト: finefin/audacity
bool EffectNoise::SetAutomationParameters(CommandParameters & parms)
{
   ReadAndVerifyEnum(Type, kTypeStrings, nTypes);
   ReadAndVerifyDouble(Amp);

   mType = Type;
   mAmp = Amp;

   return true;
}
コード例 #11
0
ファイル: Noise.cpp プロジェクト: MartynShaw/audacity
bool EffectNoise::SetAutomationParameters(EffectAutomationParameters & parms)
{
   ReadAndVerifyEnum(Type, wxArrayString(kNumTypes, kTypeStrings));
   ReadAndVerifyDouble(Amp);

   mType = Type;
   mAmp = Amp;

   return true;
}
コード例 #12
0
ファイル: Compressor.cpp プロジェクト: henricj/audacity
bool EffectCompressor::SetAutomationParameters(EffectAutomationParameters & parms)
{
   ReadAndVerifyDouble(Threshold);
   ReadAndVerifyDouble(NoiseFloor);
   ReadAndVerifyDouble(Ratio);
   ReadAndVerifyDouble(AttackTime);
   ReadAndVerifyDouble(ReleaseTime);
   ReadAndVerifyBool(Normalize);
   ReadAndVerifyBool(UsePeak);

   mThresholdDB = Threshold;
   mNoiseFloorDB = NoiseFloor;
   mRatio = Ratio;
   mAttackTime = AttackTime;
   mDecayTime = ReleaseTime;
   mNormalize = Normalize;
   mUsePeak = UsePeak;

   return true;
}
コード例 #13
0
ファイル: Distortion.cpp プロジェクト: alendubri/audacity
bool EffectDistortion::SetAutomationParameters(EffectAutomationParameters & parms)
{
   ReadAndVerifyEnum(TableTypeIndx,  wxArrayString(kNumTableTypes, kTableTypeStrings));
   ReadAndVerifyBool(DCBlock);
   ReadAndVerifyDouble(Threshold_dB);
   ReadAndVerifyDouble(NoiseFloor);
   ReadAndVerifyDouble(Param1);
   ReadAndVerifyDouble(Param2);
   ReadAndVerifyInt(Repeats);

   mParams.mTableChoiceIndx = TableTypeIndx;
   mParams.mDCBlock = DCBlock;
   mParams.mThreshold_dB = Threshold_dB;
   mParams.mNoiseFloor = NoiseFloor;
   mParams.mParam1 = Param1;
   mParams.mParam2 = Param2;
   mParams.mRepeats = Repeats;

   return true;
}
コード例 #14
0
bool EffectToneGen::SetAutomationParameters(EffectAutomationParameters & parms)
{
   ReadAndVerifyEnum(Waveform, mWaveforms);
   ReadAndVerifyEnum(Interp, mInterpolations);
   if (mChirp)
   {
      ReadAndVerifyDouble(StartFreq);
      ReadAndVerifyDouble(EndFreq);
      ReadAndVerifyDouble(StartAmp);
      ReadAndVerifyDouble(EndAmp);
      mFrequency[0] = StartFreq;
      mFrequency[1] = EndFreq;
      mAmplitude[0] = StartAmp;
      mAmplitude[1] = EndAmp;
   }
   else
   {
      ReadAndVerifyDouble(Frequency);
      ReadAndVerifyDouble(Amplitude);
      mFrequency[0] = Frequency;
      mFrequency[1] = Frequency;
      mAmplitude[0] = Amplitude;
      mAmplitude[1] = Amplitude;
   }

   mWaveform = Waveform;
   mInterpolation = Interp;

   double freqMax = (GetActiveProject() ? GetActiveProject()->GetRate() : 44100.0) / 2.0;
   mFrequency[1] = TrapDouble(mFrequency[1], MIN_EndFreq, freqMax);

   return true;
}
コード例 #15
0
ファイル: ChangePitch.cpp プロジェクト: MindFy/audacity
bool EffectChangePitch::SetAutomationParameters(CommandParameters & parms)
{
   // Vaughan, 2013-06: Long lost to history, I don't see why m_dPercentChange was chosen to be shuttled.
   // Only m_dSemitonesChange is used in Process().
   ReadAndVerifyDouble(Percentage);

   m_dPercentChange = Percentage;
   Calc_SemitonesChange_fromPercentChange();

#if USE_SBSMS
   ReadAndVerifyBool(UseSBSMS);
   mUseSBSMS = UseSBSMS;
#else
   mUseSBSMS = false;
#endif

   return true;
}
コード例 #16
0
bool EffectAutoDuck::SetAutomationParameters(EffectAutomationParameters & parms)
{
   ReadAndVerifyDouble(DuckAmountDb);
   ReadAndVerifyDouble(InnerFadeDownLen);
   ReadAndVerifyDouble(InnerFadeUpLen);
   ReadAndVerifyDouble(OuterFadeDownLen);
   ReadAndVerifyDouble(OuterFadeUpLen);
   ReadAndVerifyDouble(ThresholdDb);
   ReadAndVerifyDouble(MaximumPause);

   mDuckAmountDb = DuckAmountDb;
   mInnerFadeDownLen = InnerFadeDownLen;
   mInnerFadeUpLen = InnerFadeUpLen;
   mOuterFadeDownLen = OuterFadeDownLen;
   mOuterFadeUpLen = OuterFadeUpLen;
   mThresholdDb = ThresholdDb;
   mMaximumPause = MaximumPause;

   return true;
}