Пример #1
0
bool BatchCommands::ApplyEffectCommand(const PluginID & ID, const wxString & command, const wxString & params)
{
   //Possibly end processing here, if in batch-debug
   if( ReportAndSkip(command, params))
      return true;

   AudacityProject *project = GetActiveProject();

   //FIXME: for later versions may want to not select-all in batch mode.
   //IF nothing selected, THEN select everything
   // (most effects require that you have something selected).
   project->SelectAllIfNone();

   bool res = false;

   EffectManager::Get().SetBatchProcessing(ID, true);

   // transfer the parameters to the effect...
   if (EffectManager::Get().SetEffectParameters(ID, params))
   {
      // and apply the effect...
      res = project->OnEffect(ID, AudacityProject::OnEffectFlags::kConfigured |
                                  AudacityProject::OnEffectFlags::kSkipState |
                                  AudacityProject::OnEffectFlags::kDontRepeatLast);
   }

   EffectManager::Get().SetBatchProcessing(ID, false);

   return res;
}
Пример #2
0
bool BatchCommands::ApplyEffectCommand(   Effect * f, const wxString command, const wxString params)
{
   //Possibly end processing here, if in batch-debug
   if( ReportAndSkip(command, params))
      return true;

   AudacityProject *project = GetActiveProject();

   //FIXME: for later versions may want to not select-all in batch mode.
   //IF nothing selected, THEN select everything 
   // (most effects require that you have something selected).
   project->SelectAllIfNone();

   // NOW actually apply the effect.
   return project->OnEffect(ALL_EFFECTS | CONFIGURED_EFFECT , f, params, false);
}