@@ -555,6 +555,13 @@ void Fl_Canvas::Clear() | |||
} | |||
//////////////////////////////////////////////////////////////////////// | |||
void Fl_Canvas::Rename(Fl_DeviceGUI* Device) | |||
{ | |||
if (cb_Rename) cb_Rename(this,Device); | |||
} | |||
//////////////////////////////////////////////////////////////////////// | |||
@@ -68,10 +68,12 @@ public: | |||
virtual void draw(); | |||
virtual int handle(int event); | |||
void PortClicked(Fl_DeviceGUI* Device, int Type, int Port, bool Value); | |||
void Rename(Fl_DeviceGUI* Device); | |||
void SetConnectionCallback(Fl_Callback* s) { cb_Connection=s; } | |||
void SetUnconnectCallback(Fl_Callback* s) { cb_Unconnect=s; } | |||
void SetAddDeviceCallback(Fl_Callback* s) { cb_AddDevice=s; } | |||
void SetRenameCallback(Fl_Callback* s) { cb_Rename=s; } | |||
void ClearConnections(Fl_DeviceGUI* Device); | |||
void RemoveDevice(Fl_DeviceGUI* Device); | |||
@@ -95,6 +97,7 @@ private: | |||
void (*cb_Connection)(Fl_Widget*, void*); | |||
void (*cb_Unconnect)(Fl_Widget*, void*); | |||
void (*cb_AddDevice)(Fl_Widget*, void*); | |||
void (*cb_Rename)(Fl_Widget*, void*); | |||
vector<CanvasWire> m_WireVec; | |||
CanvasWire m_IncompleteWire; | |||
@@ -18,6 +18,8 @@ | |||
#include "Fl_DeviceGUI.h" | |||
#include "Fl_Canvas.h" | |||
#include "Fl_Canvas.h" | |||
#include "PawfalInput.h" | |||
#include "../../SpiralSynthModularInfo.h" | |||
int Fl_DeviceGUI::Numbers[512]; | |||
@@ -75,8 +77,20 @@ m_IsTerminal(Terminal) | |||
m_DragBar->type(Fl_DragBar::FLDRAG); | |||
m_DragBar->color(SpiralSynthModularInfo::GUICOL_Device); | |||
m_Menu = new Fl_Menu_Button(x(),y(),w(),h(),""); | |||
m_Menu->type(Fl_Menu_Button::POPUP3); | |||
m_Menu->textsize(8); | |||
m_Menu->add("rename", 0, (Fl_Callback*)cb_Rename,this); | |||
m_Menu->add("delete", 0, (Fl_Callback*)cb_Delete,this); | |||
m_PluginWindow = PW; | |||
#ifdef PLUGINGUI_IN_MODULE_TEST | |||
m_PluginWindow->show(); | |||
add(m_PluginWindow); | |||
#endif | |||
//Add the input/output ports | |||
Setup(Info, true); | |||
} | |||
@@ -106,10 +120,6 @@ int Fl_DeviceGUI::handle(int event) | |||
}*/ | |||
} | |||
} | |||
if (event==FL_RELEASE && Fl::event_button()==2) | |||
{ | |||
m_DelMe = true; | |||
} | |||
} | |||
return t; | |||
@@ -118,12 +128,14 @@ int Fl_DeviceGUI::handle(int event) | |||
void Fl_DeviceGUI::draw() | |||
{ | |||
Fl_Group::draw(); | |||
#ifndef PLUGINGUI_IN_MODULE_TEST | |||
if (m_Icon) | |||
{ | |||
int Centx=x()+w()/2; | |||
int Centy=y()+h()/2; | |||
m_Icon->draw(Centx-m_Icon->w()/2,Centy-m_Icon->h()/2); | |||
} | |||
#endif | |||
} | |||
void Fl_DeviceGUI::Setup(const DeviceGUIInfo& Info, bool FirstTime) | |||
@@ -273,3 +285,24 @@ inline void Fl_DeviceGUI::cb_Port_i(Fl_Button* o, void* v) | |||
} | |||
void Fl_DeviceGUI::cb_Port(Fl_Button* o, void* v) | |||
{((Fl_DeviceGUI*)(o->parent()))->cb_Port_i(o,v);} | |||
inline void Fl_DeviceGUI::cb_Rename_i(Fl_Menu_Button* o, void* v) | |||
{ | |||
char name[256]; | |||
if (Pawfal_Input("Rename the module:",m_DragBar->label(),name)) | |||
{ | |||
m_Name=name; | |||
m_DragBar->label(m_Name.c_str()); | |||
((Fl_Canvas*)(parent()))->Rename(this); | |||
} | |||
} | |||
void Fl_DeviceGUI::cb_Rename(Fl_Menu_Button* o, void* v) | |||
{((Fl_DeviceGUI*)(o->parent()))->cb_Rename_i(o,v);} | |||
inline void Fl_DeviceGUI::cb_Delete_i(Fl_Menu_Button* o, void* v) | |||
{ | |||
m_DelMe=true; | |||
} | |||
void Fl_DeviceGUI::cb_Delete(Fl_Menu_Button* o, void* v) | |||
{((Fl_DeviceGUI*)(o->parent()))->cb_Delete_i(o,v);} |
@@ -20,6 +20,7 @@ | |||
#include <FL/Fl_Group.H> | |||
#include <FL/Fl_Button.H> | |||
#include <FL/Fl_Pixmap.h> | |||
#include <FL/Fl_Menu_Button.h> | |||
#include <iostream> | |||
#include <vector> | |||
#include <string> | |||
@@ -88,12 +89,11 @@ public: | |||
int GetID() { return m_ID; } | |||
void SetID(int s) { m_ID=s; /*DisplayID(s);*/ } | |||
bool Killed() { return m_DelMe; } | |||
int GetPortX(int n) { return m_PortVec[n]->x()+PortSize/2; } | |||
int GetPortY(int n) { return m_PortVec[n]->y()+PortSize/2; } | |||
// aesthitic, to keep track of number of connections to know whether to | |||
// aesthetic, to keep track of number of connections to know whether to | |||
// draw the port as occupied or not. | |||
bool AddConnection(int n); | |||
void RemoveConnection(int n); | |||
@@ -101,6 +101,8 @@ public: | |||
bool GetPortValue(int n) { return m_PortVec[n]->value(); } | |||
const DeviceGUIInfo* GetInfo() { return &m_Info; } | |||
Fl_Group* GetPluginWindow() { return m_PluginWindow; } | |||
string GetName() { return m_Name; } | |||
void SetName(const string &s) { m_Name=s; m_DragBar->label(m_Name.c_str()); } | |||
// automatically called from the constructor, but may be redone at any time. | |||
virtual void Setup(const DeviceGUIInfo& Info, bool FirstTime = false); | |||
@@ -117,11 +119,16 @@ protected: | |||
Fl_DragBar* m_DragBar; | |||
Fl_Group* m_PluginWindow; | |||
Fl_Pixmap* m_Icon; | |||
Fl_Menu_Button* m_Menu; | |||
private: | |||
inline void cb_Port_i(Fl_Button* o, void* v); | |||
static void cb_Port(Fl_Button* o, void* v); | |||
inline void cb_Rename_i(Fl_Menu_Button* o, void* v); | |||
static void cb_Rename(Fl_Menu_Button* o, void* v); | |||
inline void cb_Delete_i(Fl_Menu_Button* o, void* v); | |||
static void cb_Delete(Fl_Menu_Button* o, void* v); | |||
vector<Fl_PortButton*> m_PortVec; | |||
@@ -34,7 +34,7 @@ char** GetIcon() | |||
int GetID() | |||
{ | |||
return 50; | |||
return 52; | |||
} | |||
string GetGroupName() | |||
@@ -36,18 +36,22 @@ m_HelpWin(NULL) | |||
m_GUICH = ch; | |||
#ifndef PLUGINGUI_IN_MODULE_TEST | |||
box(FL_THIN_UP_BOX); | |||
m_DragBar = new Fl_DragBar(0,0,w,15,o->GetName().c_str()); | |||
m_DragBar->labelsize(10); | |||
m_DragBar->type(Fl_DragBar::FLDRAG); | |||
add(m_DragBar); | |||
m_Hide = new Fl_Button(2,2,10,10,"X"); | |||
m_Hide->labeltype(FL_ENGRAVED_LABEL); | |||
m_Hide->labelsize(10); | |||
m_Hide->box(FL_NO_BOX); | |||
m_Hide->callback((Fl_Callback*)cb_Hide); | |||
add(m_Hide); | |||
#else | |||
box(FL_NO_BOX); | |||
#endif | |||
m_Help = new Fl_Button(w-11,2,10,10,"?"); | |||
m_Help->labeltype(FL_ENGRAVED_LABEL); | |||
@@ -42,6 +42,8 @@ public: | |||
// spiralplugin is acceptable | |||
virtual void UpdateValues(SpiralPlugin *o)=0; | |||
void RenameTitleBar(const string &s) { m_Title=s; m_DragBar->label(m_Title.c_str()); } | |||
protected: | |||
ChannelHandler *m_GUICH; | |||
@@ -53,6 +55,8 @@ private: | |||
Fl_Button* m_Help; | |||
Fl_Double_Window *m_HelpWin; | |||
string m_Title; | |||
//// Callbacks //// | |||
inline void cb_Hide_i(Fl_Button* o, void* v); | |||
static void cb_Hide(Fl_Button*, void*); | |||
@@ -3,6 +3,7 @@ | |||
#include "Fl_Knob.H" | |||
#include <Fl/fl_draw.H> | |||
#include <math.h> | |||
#include <iostream.h> | |||
Fl_Knob::Fl_Knob(int xx,int yy,int ww,int hh,const char *l): Fl_Valuator(xx,yy,ww,hh,l) { | |||
int side; | |||
@@ -129,7 +130,6 @@ unsigned char rr,gg,bb; | |||
int Fl_Knob::handle(int event) { | |||
int ox,oy,ww,hh; | |||
ox = x() + 10; oy = y() + 10; | |||
ww = w() - 20; | |||
hh = h()-20; | |||
@@ -166,6 +166,32 @@ int Fl_Knob::handle(int event) { | |||
case FL_RELEASE: | |||
handle_release(); | |||
return 1; | |||
case FL_KEYUP: | |||
/*if (Fl::event_key()=='=') | |||
{ | |||
handle_drag(clamp(round(value()+step()))); | |||
return 1; | |||
} | |||
if (Fl::event_key()=='-') | |||
{ | |||
handle_drag(clamp(round(value()-step()))); | |||
return 1; | |||
} | |||
if (Fl::event_key()==FL_Page_Up) | |||
{ | |||
handle_drag(clamp(round(value()+step()*10))); | |||
return 1; | |||
} | |||
if (Fl::event_key()==FL_Page_Down) | |||
{ | |||
handle_drag(clamp(round(value()-step()*10))); | |||
return 1; | |||
}*/ | |||
return 0; | |||
case FL_FOCUS: | |||
return 1; | |||
case FL_UNFOCUS: | |||
return 1; | |||
default: | |||
return 0; | |||
} | |||
@@ -19,6 +19,8 @@ | |||
#ifndef SAMPLE | |||
#define SAMPLE | |||
//#define PLUGINGUI_IN_MODULE_TEST | |||
#include <assert.h> | |||
#include <limits.h> | |||
#include <iostream> | |||
@@ -66,7 +66,7 @@ void SpiralInfo::StreamInPrefs(istream &s) | |||
s>>temp>>temp>>FILTERGRAN; | |||
s>>temp>>temp>>OUTPUTFILE; | |||
s>>temp>>temp>>MIDIFILE; | |||
s>>temp>>temp>>REALTIMEOUT; | |||
s>>temp>>temp>>USEPLUGINLIST; | |||
s>>temp>>temp>>POLY; | |||
//s>>temp>>temp>>GUI_COLOUR; | |||
//s>>temp>>temp>>GUIBG_COLOUR; | |||
@@ -86,7 +86,7 @@ void SpiralInfo::StreamOutPrefs(ostream &s) | |||
s<<"FilterGranularity = "<<FILTERGRAN<<endl; | |||
s<<"Output = "<<OUTPUTFILE<<endl; | |||
s<<"Midi = "<<MIDIFILE<<endl; | |||
s<<"WantRealtimeOut = "<<REALTIMEOUT<<endl; | |||
s<<"UsePluginList = "<<USEPLUGINLIST<<endl; | |||
s<<"Polyphony = "<<POLY<<endl; | |||
//s<<"GUIColour = "<<GUI_COLOUR<<endl; | |||
//s<<"GUIBGColour = "<<GUIBG_COLOUR<<endl; | |||
@@ -53,7 +53,7 @@ public: | |||
static int FILTERGRAN; | |||
static string OUTPUTFILE; | |||
static string MIDIFILE; | |||
static bool REALTIMEOUT; | |||
static bool USEPLUGINLIST; | |||
static int POLY; | |||
static string LOCALE; | |||
@@ -68,7 +68,7 @@ protected: | |||
SpiralInfo() : m_HomeDir(getenv("HOME")), m_Version(0) {} | |||
virtual ~SpiralInfo() {} | |||
virtual string GetResFileName() { return "ballsSpiralrc"; } | |||
virtual string GetResFileName() { return "Spiralrc"; } | |||
virtual void StreamInPrefs(istream &s); | |||
virtual void StreamOutPrefs(ostream &s); | |||
@@ -20,6 +20,11 @@ | |||
#include <iostream> | |||
#include <fstream> | |||
#include <sstream> | |||
#include <sys/types.h> | |||
#include <sys/stat.h> | |||
#include <dirent.h> | |||
#include <dlfcn.h> | |||
#include <FL/Fl.H> | |||
#include <FL/Enumerations.H> | |||
#include <FL/fl_file_chooser.h> | |||
@@ -45,7 +50,7 @@ | |||
const static string LABEL = "SpiralSynthModular "+VER_STRING; | |||
static string TITLEBAR; | |||
static const int FILE_VERSION = 3; | |||
static const int FILE_VERSION = 4; | |||
static int Numbers[512]; | |||
static const int MAIN_WIDTH = 700; | |||
@@ -364,6 +369,7 @@ SpiralWindowType *SynthModular::CreateWindow() | |||
m_Canvas->SetConnectionCallback((Fl_Callback*)cb_Connection); | |||
m_Canvas->SetUnconnectCallback((Fl_Callback*)cb_Unconnect); | |||
m_Canvas->SetAddDeviceCallback((Fl_Callback*)cb_NewDeviceFromMenu); | |||
m_Canvas->SetRenameCallback((Fl_Callback*)cb_RenameDevice); | |||
m_CanvasScroll->add(m_Canvas); | |||
m_NewComment = new Fl_Button(TOOLBOX_WIDTH/2-16, MAIN_HEIGHT*2-25, 40, 40, ""); | |||
@@ -428,6 +434,61 @@ void SynthModular::ToolBox::AddIcon(Fl_Button *Icon) | |||
m_Icon++; | |||
} | |||
vector<string> SynthModular::BuildPluginList(const string &Path) | |||
{ | |||
// Scan plugin path for plugins. | |||
DIR *dp; | |||
struct dirent *ep; | |||
struct stat sb; | |||
void *handle; | |||
string fullpath; | |||
const char *path = Path.c_str(); | |||
vector<string> ret; | |||
dp = opendir(path); | |||
if (!dp) | |||
{ | |||
cerr << "WARNING: Could not open path " << path << endl; | |||
} | |||
else | |||
{ | |||
while ((ep = readdir(dp))) | |||
{ | |||
// Need full path | |||
fullpath = path; | |||
fullpath.append(ep->d_name); | |||
// Stat file to get type | |||
if (!stat(fullpath.c_str(), &sb)) | |||
{ | |||
// We only want regular files | |||
if (S_ISREG(sb.st_mode)) | |||
{ | |||
// We're not fussed about resolving symbols yet, since we are just | |||
// checking if it's a DLL. | |||
handle = dlopen(fullpath.c_str(), RTLD_LAZY); | |||
if (!handle) | |||
{ | |||
cerr << "WARNING: File " << path << ep->d_name | |||
<< " could not be examined" << endl; | |||
cerr << "dlerror() output:" << endl; | |||
cerr << dlerror() << endl; | |||
} | |||
else | |||
{ | |||
// It's a DLL. Add name to list | |||
ret.push_back(ep->d_name); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
return ret; | |||
} | |||
void SynthModular::LoadPlugins(string pluginPath) | |||
{ | |||
@@ -457,8 +518,20 @@ void SynthModular::LoadPlugins(string pluginPath) | |||
int ID=-1; | |||
for (vector<string>::iterator i=SpiralSynthModularInfo::PLUGINVEC.begin(); | |||
i!=SpiralSynthModularInfo::PLUGINVEC.end(); i++) | |||
vector<string> PluginVector; | |||
if (SpiralSynthModularInfo::USEPLUGINLIST) | |||
{ | |||
PluginVector=SpiralSynthModularInfo::PLUGINVEC; | |||
} | |||
else | |||
{ | |||
if (!pluginPath.empty()) PluginVector=BuildPluginList(pluginPath); | |||
else PluginVector=BuildPluginList(SpiralSynthModularInfo::PLUGIN_PATH); | |||
} | |||
for (vector<string>::iterator i=PluginVector.begin(); | |||
i!=PluginVector.end(); i++) | |||
{ | |||
string Fullpath; | |||
if (pluginPath=="") | |||
@@ -606,6 +679,7 @@ DeviceWin* SynthModular::NewDeviceWin(int n, int x, int y) | |||
Fl_Pixmap *Pix = new Fl_Pixmap(Plugin->GetIcon()); | |||
nlw->m_PluginID = n; | |||
#ifndef PLUGINGUI_IN_MODULE_TEST | |||
if (temp) | |||
{ | |||
temp->hide(); | |||
@@ -613,10 +687,23 @@ DeviceWin* SynthModular::NewDeviceWin(int n, int x, int y) | |||
m_AppGroup->add(temp); | |||
m_MainWindow->redraw(); | |||
} | |||
#else | |||
if (temp) | |||
{ | |||
temp->position(x+10,y+5); | |||
} | |||
#endif | |||
DeviceGUIInfo Info=BuildDeviceGUIInfo(PInfo); | |||
Info.XPos = x; //TOOLBOX_WIDTH+(rand()%400); | |||
Info.YPos = y; //rand()%400; | |||
#ifdef PLUGINGUI_IN_MODULE_TEST | |||
Info.Width = PInfo.Width; | |||
Info.Height = PInfo.Height; | |||
#endif | |||
nlw->m_DeviceGUI = new Fl_DeviceGUI(Info, temp, Pix, nlw->m_Device->IsTerminal()); | |||
m_Canvas->add(nlw->m_DeviceGUI); | |||
m_Canvas->redraw(); | |||
@@ -785,6 +872,19 @@ istream &operator>>(istream &s, SynthModular &o) | |||
s>>PluginID; | |||
s>>x>>y; | |||
string Name; | |||
if (ver>3) | |||
{ | |||
// load the device name | |||
int size; | |||
char Buf[1024]; | |||
s>>size; | |||
s.ignore(1); | |||
s.get(Buf,size+1); | |||
Name=Buf; | |||
} | |||
#ifdef DEBUG_STREAM | |||
cerr<<dummy<<" "<<ID<<" "<<dummy2<<" "<<PluginID<<" "<<x<<" "<<y<<endl; | |||
#endif | |||
@@ -815,6 +915,16 @@ istream &operator>>(istream &s, SynthModular &o) | |||
if (temp) | |||
{ | |||
temp->m_DeviceGUI->SetID(ID); | |||
if (ver>3) | |||
{ | |||
// set the titlebars | |||
temp->m_DeviceGUI->SetName(Name); | |||
if (temp->m_DeviceGUI->GetPluginWindow()) | |||
{ | |||
((SpiralPluginGUI*)(temp->m_DeviceGUI->GetPluginWindow()))->RenameTitleBar(Name); | |||
} | |||
} | |||
temp->m_Device->SetUpdateInfoCallback(ID,o.cb_UpdatePluginInfo); | |||
o.m_DeviceWinMap[ID]=temp; | |||
o.m_DeviceWinMap[ID]->m_Device->StreamIn(s); // load the plugin | |||
@@ -894,6 +1004,8 @@ ostream &operator<<(ostream &s, SynthModular &o) | |||
s<<i->second->m_PluginID<<endl; | |||
s<<i->second->m_DeviceGUI->x()<<" "; | |||
s<<i->second->m_DeviceGUI->y()<<" "; | |||
s<<i->second->m_DeviceGUI->GetName().size()<<" "; | |||
s<<i->second->m_DeviceGUI->GetName()<<" "; | |||
if (i->second->m_DeviceGUI->GetPluginWindow()) | |||
{ | |||
@@ -1185,6 +1297,16 @@ void SynthModular::cb_Unconnect(Fl_Canvas* o, void* v) | |||
////////////////////////////////////////////////////////// | |||
inline void SynthModular::cb_RenameDevice_i(Fl_Canvas* o, void* v) | |||
{ | |||
Fl_DeviceGUI* device = (Fl_DeviceGUI*)v; | |||
((SpiralPluginGUI*)(device->GetPluginWindow()))->RenameTitleBar(device->GetName()); | |||
} | |||
void SynthModular::cb_RenameDevice(Fl_Canvas* o, void* v) | |||
{((SynthModular*)(o->user_data()))->cb_RenameDevice_i(o,v);} | |||
////////////////////////////////////////////////////////// | |||
void SynthModular::cb_UpdatePluginInfo(int ID, void *PInfo) | |||
{ | |||
map<int,DeviceWin*>::iterator i=m_DeviceWinMap.find(ID); | |||
@@ -92,6 +92,8 @@ public: | |||
private: | |||
vector<string> BuildPluginList(const string &Path); | |||
DeviceWin* NewDeviceWin(int n, int x, int y); | |||
DeviceWin* NewComment(int n, int x, int y); | |||
@@ -188,7 +190,9 @@ private: | |||
static void cb_PluginGroupLeft(Fl_Button* o, void* v); | |||
inline void cb_PluginGroupRight_i(Fl_Button* o, void* v); | |||
static void cb_PluginGroupRight(Fl_Button* o, void* v); | |||
inline void cb_RenameDevice_i(Fl_Canvas* o, void* v); | |||
static void cb_RenameDevice(Fl_Canvas* o, void* v); | |||
inline void cb_Rload_i(Fl_Button* o, void* v); | |||
static void cb_Rload(Fl_Button* o, void* v); | |||
@@ -16,11 +16,6 @@ | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include <sys/types.h> | |||
#include <sys/stat.h> | |||
#include <dirent.h> | |||
#include <dlfcn.h> | |||
#include "SpiralSynthModularInfo.h" | |||
#include "SpiralSynthPluginLocation.h" | |||
#include "FL/fl_draw.h" | |||
@@ -37,7 +32,7 @@ int SpiralInfo::FILTERGRAN = 50; | |||
string SpiralInfo::OUTPUTFILE = "/dev/dsp"; | |||
string SpiralInfo::MIDIFILE = "/dev/midi"; | |||
int SpiralInfo::POLY = 1; | |||
bool SpiralInfo::REALTIMEOUT = true; | |||
bool SpiralInfo::USEPLUGINLIST = false; | |||
//int SpiralInfo::GUI_COLOUR = 139; | |||
//int SpiralInfo::GUIBG_COLOUR = 0; | |||
@@ -67,100 +62,7 @@ SpiralSynthModularInfo* SpiralSynthModularInfo::Get() | |||
SpiralSynthModularInfo::SpiralSynthModularInfo() | |||
{ | |||
BGIMG="None"; | |||
// default plugins + path, check these before dist... | |||
// this is one of the two plugin lists, th other is in | |||
// the SpiralSound/Plugins/PluginList.txt for the | |||
// configure/make/install scripts | |||
PLUGIN_PATH = PLUGIN_PATH_LOCATION; | |||
#ifdef SSM_EXPLICIT_PLUGIN_LIST | |||
PLUGINVEC.push_back("OutputPlugin.so"); | |||
PLUGINVEC.push_back("DiskWriterPlugin.so"); | |||
PLUGINVEC.push_back("ScopePlugin.so"); | |||
PLUGINVEC.push_back("MidiPlugin.so"); | |||
PLUGINVEC.push_back("KeyboardPlugin.so"); | |||
PLUGINVEC.push_back("ControllerPlugin.so"); | |||
PLUGINVEC.push_back("MatrixPlugin.so"); | |||
PLUGINVEC.push_back("SeqSelectorPlugin.so"); | |||
PLUGINVEC.push_back("SequencerPlugin.so"); | |||
PLUGINVEC.push_back("PoshSamplerPlugin.so"); | |||
PLUGINVEC.push_back("WaveTablePlugin.so"); | |||
PLUGINVEC.push_back("OscillatorPlugin.so"); | |||
PLUGINVEC.push_back("LFOPlugin.so"); | |||
PLUGINVEC.push_back("NoisePlugin.so"); | |||
PLUGINVEC.push_back("EnvelopePlugin.so"); | |||
PLUGINVEC.push_back("SampleHoldPlugin.so"); | |||
PLUGINVEC.push_back("NoteSnapPlugin.so"); | |||
PLUGINVEC.push_back("MixerPlugin.so"); | |||
PLUGINVEC.push_back("StereoMixerPlugin.so"); | |||
PLUGINVEC.push_back("AmpPlugin.so"); | |||
PLUGINVEC.push_back("RingModPlugin.so"); | |||
PLUGINVEC.push_back("FilterPlugin.so"); | |||
PLUGINVEC.push_back("SVFilterPlugin.so"); | |||
PLUGINVEC.push_back("MoogFilterPlugin.so"); | |||
PLUGINVEC.push_back("FormantPlugin.so"); | |||
PLUGINVEC.push_back("AnotherFilterPlugin.so"); | |||
PLUGINVEC.push_back("EchoPlugin.so"); | |||
PLUGINVEC.push_back("DelayPlugin.so"); | |||
PLUGINVEC.push_back("EnvFollowerPlugin.so"); | |||
PLUGINVEC.push_back("SmoothPlugin.so"); | |||
PLUGINVEC.push_back("LADSPAPlugin.so"); | |||
PLUGINVEC.push_back("XFadePlugin.so"); | |||
PLUGINVEC.push_back("DistributorPlugin.so"); | |||
PLUGINVEC.push_back("SplitterPlugin.so"); | |||
PLUGINVEC.push_back("StreamPlugin.so"); | |||
PLUGINVEC.push_back("OperatorPlugin.so"); | |||
PLUGINVEC.push_back("CounterPlugin.so"); | |||
PLUGINVEC.push_back("FlipflopPlugin.so"); | |||
PLUGINVEC.push_back("SwitchPlugin.so"); | |||
PLUGINVEC.push_back("BeatMatchPlugin.so"); | |||
PLUGINVEC.push_back("LogicPlugin.so"); | |||
#else | |||
// Scan plugin path for plugins. | |||
DIR *dp; | |||
struct dirent *ep; | |||
struct stat sb; | |||
void *handle; | |||
string fullpath; | |||
const char *path = PLUGIN_PATH.c_str(); | |||
dp = opendir(path); | |||
if (!dp) { | |||
cerr << "WARNING: Could not open path " << path << endl; | |||
} else { | |||
while ((ep = readdir(dp))) { | |||
// Need full path | |||
fullpath = path; | |||
fullpath.append(ep->d_name); | |||
// Stat file to get type | |||
if (!stat(fullpath.c_str(), &sb)) { | |||
// We only want regular files | |||
if (S_ISREG(sb.st_mode)) { | |||
// We're not fussed about resolving symbols yet, since we are just | |||
// checking if it's a DLL. | |||
handle = dlopen(fullpath.c_str(), RTLD_LAZY); | |||
if (!handle) { | |||
cerr << "WARNING: File " << path << ep->d_name | |||
<< " could not be examined" << endl; | |||
cerr << "dlerror() output:" << endl; | |||
cerr << dlerror() << endl; | |||
} else { | |||
// It's a DLL. Add name to list | |||
PLUGINVEC.push_back(ep->d_name); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
#endif | |||
} | |||
void SpiralSynthModularInfo::StreamInPrefs(istream &s) | |||
@@ -179,15 +81,16 @@ void SpiralSynthModularInfo::StreamInPrefs(istream &s) | |||
s>>temp>>temp; | |||
string st; | |||
#ifdef SSM_EXPLICIT_PLUGIN_LIST | |||
PLUGINVEC.clear(); | |||
while(st!="end" && !s.eof()) | |||
if (USEPLUGINLIST) | |||
{ | |||
s>>st; | |||
if (st!="end") PLUGINVEC.push_back(st); | |||
while(st!="end" && !s.eof()) | |||
{ | |||
s>>st; | |||
if (st!="end") PLUGINVEC.push_back(st); | |||
} | |||
} | |||
#endif | |||
#if __APPLE__ | |||
// ignore custom paths, plugins are encapsulated in the app anyway | |||
// this prevents the program to fail if the user move the application icon | |||
@@ -46,7 +46,7 @@ if test $ac_arg_jack = "Y" ; then | |||
DistributorPlugin LFOPlugin KeyboardPlugin DiskWriterPlugin FormantFilterPlugin \ | |||
AnotherFilterPlugin OperatorPlugin CounterPlugin FlipflopPlugin SwitchPlugin \ | |||
BeatMatchPlugin NoisePlugin SequencerPlugin LogicPlugin SplitSwitchPlugin \ | |||
MixSwitchPlugin JackPlugin" | |||
MixSwitchPlugin MeterPlugin WaveShaperPlugin JackPlugin" | |||
else | |||
PLUGINLIST="AmpPlugin ControllerPlugin DelayPlugin EchoPlugin EnvFollowerPlugin \ | |||
EnvelopePlugin FilterPlugin MatrixPlugin MidiPlugin MixerPlugin MoogFilterPlugin \ | |||
@@ -55,7 +55,8 @@ else | |||
WaveTablePlugin LADSPAPlugin XFadePlugin PoshSamplerPlugin SeqSelectorPlugin\ | |||
DistributorPlugin LFOPlugin KeyboardPlugin DiskWriterPlugin FormantFilterPlugin \ | |||
AnotherFilterPlugin OperatorPlugin CounterPlugin FlipflopPlugin SwitchPlugin \ | |||
BeatMatchPlugin NoisePlugin SequencerPlugin LogicPlugin SplitSwitchPlugin MixSwitchPlugin" | |||
BeatMatchPlugin NoisePlugin SequencerPlugin LogicPlugin SplitSwitchPlugin \ | |||
MixSwitchPlugin MeterPlugin WaveShaperPlugin " | |||
fi | |||
echo "$PLUGINLIST" > SpiralSound/PluginList.txt | |||