I want to add a button to audacity to send info about the current audio being processed to another app ( in this case a .NET application ). I want to do it in the most flexible way and was thinking in a plugin of some sort.
I’ve seen the commands, nyquist, the script-pipe, etc… but none of them seem suit my needs.
Giving that my plugin has to be able to access: - Audacity internal structures to get the current project, current file, file paths, etc…, - wxWidget app to be able to trigger dialogs, audacity dialogs, etc…, Is there any support in Audacity for this kind of operation? Any Plug-in API?
I’m interested in the extensibility mechanisms of audacity. What I’m trying is to build some sort of dll that allows me to add a button to audacity to communicate with another application without having to distribute a modified version of audacity.
I’ve peeked audacity’s code and haven’t identified any plugin API or ad-hoc extensibility mechanism of some sort.
What would be the best strategy to develop such an extension for audacity without modifying audacity itself that assures my “plugin” will keep working in subsequent audacity releases?
I’ve advanced in my quest to develop some sort of plugin dll in audacity, this is the path I followed in case it is of any interest:
What i’ve done is implement a class that extends CommandFunctor:
class MyPluginCommandFunctor:public CommandFunctor
virtual void operator()(int index = 0)
// here is the entry point of the request to the functionallity of my plugin
Which gets registered as a menu option on plugin load by audacity ( it calls ModuleDispatch in each module it loads at start time ) :
extern int _declspec(dllexport) ModuleDispatch(ModuleDispatchTypes type);
int ModuleDispatch(ModuleDispatchTypes type)
AudacityProject *p = GetActiveProject();
CommandManager *c = p->GetCommandManager();
c->InsertItem(wxString(wxT("Send to my App")),
wxString(_("Send to my App..")),
Notice the use of CommandManager::InsertItem to add the menu option and the static GetActiveProject / AudacityProject as entry point to the internal structures of Audacity.
Remember to implement the GetVersionString function in your dll as audacity will check that the version declared by your module and audacity version match exactly and don’t forget to decorate your exported functions with “_declspec(dllexport)”.