Пример #1
0
void MacroCommandDialog::OnItemSelected(wxListEvent &event)
{
   const auto &command = mCatalog[ event.GetIndex() ];

   EffectManager & em = EffectManager::Get();
   PluginID ID = em.GetEffectByIdentifier( command.name.Internal() );

   // If ID is empty, then the effect wasn't found, in which case, the user must have
   // selected one of the "special" commands.
   mEditParams->Enable(!ID.empty());
   mUsePreset->Enable(em.HasPresets(ID));

   if ( command.name.Translated() == mCommand->GetValue() )
      // This uses the assumption of uniqueness of translated names!
      return;

   mCommand->SetValue(command.name.Translated());
   mInternalCommandName = command.name.Internal();

   wxString params = MacroCommands::GetCurrentParamsFor(mInternalCommandName);
   if (params.empty())
   {
      params = em.GetDefaultPreset(ID);
   }

   // Cryptic command and category.
   // Later we can put help information there, perhaps.
   mDetails->SetValue( mInternalCommandName + "\r\n" + command.category  );
   mParameters->SetValue(params);
}
Пример #2
0
void MacroCommandDialog::SetCommandAndParams(const CommandID &Command, const wxString &Params)
{
   auto iter = mCatalog.ByCommandId( Command );

   mParameters->SetValue( Params );

   mInternalCommandName = Command;
   if (iter == mCatalog.end())
      // Expose an internal name to the user in default of any friendly name
      // -- AVOID THIS!
      mCommand->SetValue( Command );
   else {
      mCommand->SetValue( iter->name.Translated() );
      mDetails->SetValue( iter->name.Internal() + "\r\n" + iter->category  );
      mChoices->SetItemState(iter - mCatalog.begin(),
                             wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);

      EffectManager & em = EffectManager::Get();
      PluginID ID = em.GetEffectByIdentifier(Command);

      // If ID is empty, then the effect wasn't found, in which case, the user must have
      // selected one of the "special" commands.
      mEditParams->Enable(!ID.empty());
      mUsePreset->Enable(em.HasPresets(ID));
   }
}
Пример #3
0
void BatchCommandDialog::OnItemSelected(wxListEvent &event)
{
   int itemNo = event.GetIndex();
   wxString command = mChoices->GetItemText( itemNo );
   mCommand->SetValue( command );
   wxString params = BatchCommands::GetCurrentParamsFor( command );
   mParameters->SetValue( params );
   PluginID ID = EffectManager::Get().GetEffectByIdentifier( command );
   mEditParams->Enable( !ID.empty() );
}
Пример #4
0
bool VampEffectsModule::IsPluginValid(const PluginID & ID,
                                      const wxString & path)
{
   Vamp::HostExt::PluginLoader *loader = Vamp::HostExt::PluginLoader::getInstance();
   Vamp::Plugin *plug = loader->loadPlugin(ID.ToUTF8().data(), 48000); // rate doesn't matter here

   if (plug)
   {
      delete plug;
      return true;
   }

   return false;
}