Browse Source

Add a command line option to override the plugin path.

master
thesloth 23 years ago
parent
commit
7e774f371d
3 changed files with 21 additions and 6 deletions
  1. +10
    -2
      SpiralSynthModular.C
  2. +1
    -1
      SpiralSynthModular.h
  3. +10
    -3
      main.cpp

+ 10
- 2
SpiralSynthModular.C View File

@@ -383,7 +383,7 @@ SpiralWindowType *SynthModular::CreateWindow()

//////////////////////////////////////////////////////////

void SynthModular::LoadPlugins()
void SynthModular::LoadPlugins(string pluginPath)
{

int Width = 40;
@@ -423,7 +423,15 @@ void SynthModular::LoadPlugins()
for (vector<string>::iterator i=SpiralSynthModularInfo::PLUGINVEC.begin();
i!=SpiralSynthModularInfo::PLUGINVEC.end(); i++)
{
string Fullpath=SpiralSynthModularInfo::PLUGIN_PATH+*i;
string Fullpath;
if (pluginPath=="")
{
Fullpath=SpiralSynthModularInfo::PLUGIN_PATH+*i;
}
else
{
Fullpath=pluginPath+*"/"+*i;
}

ID=PluginManager::Get()->LoadPlugin(Fullpath.c_str());
if (ID!=PluginError)


+ 1
- 1
SpiralSynthModular.h View File

@@ -64,7 +64,7 @@ public:
~SynthModular();
SpiralWindowType * CreateWindow();
void LoadPlugins();
void LoadPlugins(string pluginPath);
void Update();
void AddDevice(int n, int x, int y);
void AddComment(int n);


+ 10
- 3
main.cpp View File

@@ -70,6 +70,7 @@ int main(int argc, char **argv)
// get args
string cmd_filename="";
bool cmd_specd = false;
string cmd_pluginPath="";
// parse the args
if (argc>1)
@@ -87,13 +88,19 @@ int main(int argc, char **argv)
<<"-v : print version"<<endl
<<"--NoGUI : run without GUI (only useful when loading patch from command line"<<endl
<<"--SHED_FIFO : spawn audio thread with FIFO sheduling (run as root)"<<endl
<<"--CallbackOnly : prevents 100% cpu usage when idle, but makes OSS output unsable"<<endl;
<<"--CallbackOnly : prevents 100% cpu usage when idle, but makes OSS output unsable"<<endl
<<"--PluginPath <PATH> : look for plugins in the specified directory"<<endl;
exit(0);
}
else if (!strcmp(argv[a],"-v"))
{
cout<<VER_STRING<<endl; exit(0);
}
}
else if (!strcmp(argv[a],"--PluginPath"))
{
a++;
cmd_pluginPath=argv[a];
}
else
{
cmd_filename = argv[1];
@@ -113,7 +120,7 @@ int main(int argc, char **argv)
// setup the synth
Fl_Window* win = synth->CreateWindow();
synth->LoadPlugins();
synth->LoadPlugins(cmd_pluginPath);
win->xclass("");
if (GUI) win->show(1, argv); // prevents stuff happening before the plugins have loaded


Loading…
Cancel
Save