@@ -64,8 +64,6 @@ LADSPAPlugin::LADSPAPlugin() | |||||
m_MaxInputPortCount = m_LADSPAInfo.GetMaxInputPortCount(); | m_MaxInputPortCount = m_LADSPAInfo.GetMaxInputPortCount(); | ||||
// For receiving from GUI | // For receiving from GUI | ||||
m_AudioCH->Register("SetGain",&(m_InData.Gain)); | |||||
m_AudioCH->Register("SetAmped",&(m_InData.Amped)); | |||||
m_AudioCH->RegisterData("SetPluginIndex", ChannelHandler::INPUT,&(m_InData.PluginIndex),sizeof(m_InData.PluginIndex)); | m_AudioCH->RegisterData("SetPluginIndex", ChannelHandler::INPUT,&(m_InData.PluginIndex),sizeof(m_InData.PluginIndex)); | ||||
// For sending to GUI | // For sending to GUI | ||||
@@ -77,7 +75,7 @@ LADSPAPlugin::LADSPAPlugin() | |||||
m_OutData.InputPortNames = (char *)malloc(256 * m_MaxInputPortCount); | m_OutData.InputPortNames = (char *)malloc(256 * m_MaxInputPortCount); | ||||
m_OutData.InputPortSettings = (PortSettings *)malloc(sizeof(PortSettings) * m_MaxInputPortCount); | m_OutData.InputPortSettings = (PortSettings *)malloc(sizeof(PortSettings) * m_MaxInputPortCount); | ||||
m_OutData.InputPortValues = (float *)calloc(m_MaxInputPortCount, sizeof(float)); | |||||
m_OutData.InputPortValues = (PortValues *)calloc(m_MaxInputPortCount, sizeof(PortValues)); | |||||
m_InData.InputPortSettings = (PortSettings *)malloc(sizeof(PortSettings) * m_MaxInputPortCount); | m_InData.InputPortSettings = (PortSettings *)malloc(sizeof(PortSettings) * m_MaxInputPortCount); | ||||
if (m_OutData.InputPortNames && | if (m_OutData.InputPortNames && | ||||
@@ -85,7 +83,7 @@ LADSPAPlugin::LADSPAPlugin() | |||||
m_InData.InputPortSettings) { | m_InData.InputPortSettings) { | ||||
m_AudioCH->RegisterData("GetInputPortNames", ChannelHandler::OUTPUT, m_OutData.InputPortNames, 256 * m_MaxInputPortCount); | m_AudioCH->RegisterData("GetInputPortNames", ChannelHandler::OUTPUT, m_OutData.InputPortNames, 256 * m_MaxInputPortCount); | ||||
m_AudioCH->RegisterData("GetInputPortSettings", ChannelHandler::OUTPUT, m_OutData.InputPortSettings, sizeof(PortSettings) * m_MaxInputPortCount); | m_AudioCH->RegisterData("GetInputPortSettings", ChannelHandler::OUTPUT, m_OutData.InputPortSettings, sizeof(PortSettings) * m_MaxInputPortCount); | ||||
m_AudioCH->RegisterData("GetInputPortValues", ChannelHandler::OUTPUT, m_OutData.InputPortValues, sizeof(float) * m_MaxInputPortCount); | |||||
m_AudioCH->RegisterData("GetInputPortValues", ChannelHandler::OUTPUT, m_OutData.InputPortValues, sizeof(PortValues) * m_MaxInputPortCount); | |||||
m_AudioCH->RegisterData("SetInputPortSettings", ChannelHandler::INPUT, m_InData.InputPortSettings, sizeof(PortSettings) * m_MaxInputPortCount); | m_AudioCH->RegisterData("SetInputPortSettings", ChannelHandler::INPUT, m_InData.InputPortSettings, sizeof(PortSettings) * m_MaxInputPortCount); | ||||
} else { | } else { | ||||
cerr<<"Memory allocation error"<<endl; | cerr<<"Memory allocation error"<<endl; | ||||
@@ -146,15 +144,17 @@ void LADSPAPlugin::Execute() | |||||
m_LADSPABufVec[n][i]=GetInput(n,i); | m_LADSPABufVec[n][i]=GetInput(n,i); | ||||
} | } | ||||
} | } | ||||
// Copy values into OutData value buffer for display in GUI | |||||
m_OutData.InputPortValues[n] = m_LADSPABufVec[n][0]; | |||||
m_OutData.InputPortValues[n].Connected = true; | |||||
} | } | ||||
else // Use default | else // Use default | ||||
{ | { | ||||
for (int i=0; i<m_HostInfo->BUFSIZE; i++) { | for (int i=0; i<m_HostInfo->BUFSIZE; i++) { | ||||
m_LADSPABufVec[n][i]=m_PortDefault[n]; | m_LADSPABufVec[n][i]=m_PortDefault[n]; | ||||
} | } | ||||
m_OutData.InputPortValues[n].Connected = false; | |||||
} | } | ||||
// Copy values into OutData value buffer for display in GUI | |||||
m_OutData.InputPortValues[n].Value = m_LADSPABufVec[n][0]; | |||||
} | } | ||||
// run plugin | // run plugin | ||||
@@ -163,19 +163,9 @@ void LADSPAPlugin::Execute() | |||||
// convert outputs | // convert outputs | ||||
for (int n=0; n<m_PluginInfo.NumOutputs; n++) | for (int n=0; n<m_PluginInfo.NumOutputs; n++) | ||||
{ | { | ||||
/*if (m_Amped) | |||||
for (int i=0; i<m_HostInfo->BUFSIZE; i++) | |||||
{ | { | ||||
for (int i=0; i<m_HostInfo->BUFSIZE; i++) | |||||
{ | |||||
SetOutput(n,i,m_LADSPABufVec[n+m_PluginInfo.NumInputs][i]*m_Gain*10); | |||||
} | |||||
} | |||||
else*/ | |||||
{ | |||||
for (int i=0; i<m_HostInfo->BUFSIZE; i++) | |||||
{ | |||||
SetOutput(n,i,m_LADSPABufVec[n+m_PluginInfo.NumInputs][i]*m_Gain); | |||||
} | |||||
SetOutput(n,i,m_LADSPABufVec[n+m_PluginInfo.NumInputs][i]); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -210,9 +200,8 @@ void LADSPAPlugin::StreamOut(ostream &s) | |||||
switch (m_Version) | switch (m_Version) | ||||
{ | { | ||||
case 5: | |||||
case 6: | |||||
{ | { | ||||
s<<m_Gain<<" "; | |||||
s<<m_UniqueID<<" "; | s<<m_UniqueID<<" "; | ||||
s<<m_PortMin.size()<<" "; | s<<m_PortMin.size()<<" "; | ||||
assert(m_PortMin.size()==m_PortMax.size()); | assert(m_PortMin.size()==m_PortMax.size()); | ||||
@@ -239,11 +228,40 @@ void LADSPAPlugin::StreamOut(ostream &s) | |||||
s<<*i<<" "; | s<<*i<<" "; | ||||
} | } | ||||
} | } | ||||
case 5: | |||||
{ | |||||
// Here for consistency - should never actually happen, as | |||||
// version is always 6! | |||||
// s<<m_Gain<<" "; | |||||
// s<<m_UniqueID<<" "; | |||||
// s<<m_PortMin.size()<<" "; | |||||
// assert(m_PortMin.size()==m_PortMax.size()); | |||||
// assert(m_PortMin.size()==m_PortClamp.size()); | |||||
// assert(m_PortMin.size()==m_PortDefault.size()); | |||||
// for (vector<float>::iterator i=m_PortMin.begin(); | |||||
// i!=m_PortMin.end(); i++) | |||||
// { | |||||
// s<<*i<<" "; | |||||
// } | |||||
// for (vector<float>::iterator i=m_PortMax.begin(); | |||||
// i!=m_PortMax.end(); i++) | |||||
// { | |||||
// s<<*i<<" "; | |||||
// } | |||||
// for (vector<bool>::iterator i=m_PortClamp.begin(); | |||||
// i!=m_PortClamp.end(); i++) | |||||
// { | |||||
// s<<*i<<" "; | |||||
// } | |||||
// for (vector<float>::iterator i=m_PortDefault.begin(); | |||||
// i!=m_PortDefault.end(); i++) | |||||
// { | |||||
// s<<*i<<" "; | |||||
// } | |||||
} | |||||
break; | break; | ||||
case 4: | case 4: | ||||
{ | { | ||||
// Here for consistency - should never actually happen, as | |||||
// version is always 5! | |||||
// s<<m_Gain<<" "; | // s<<m_Gain<<" "; | ||||
// s<<m_UniqueID<<" "; | // s<<m_UniqueID<<" "; | ||||
// s<<m_PortMin.size()<<" "; | // s<<m_PortMin.size()<<" "; | ||||
@@ -328,11 +346,52 @@ void LADSPAPlugin::StreamIn(istream &s) | |||||
switch (version) | switch (version) | ||||
{ | { | ||||
case 6: | |||||
{ | |||||
ClearPlugin(); | |||||
unsigned long UniqueID; | |||||
s>>UniqueID; | |||||
int PortCount; | |||||
s>>PortCount; | |||||
float Min, Max; | |||||
bool Clamp; | |||||
float Default; | |||||
for (int n=0; n<PortCount; n++) | |||||
{ | |||||
s>>Min; | |||||
m_PortMin.push_back(Min); | |||||
} | |||||
for (int n=0; n<PortCount; n++) | |||||
{ | |||||
s>>Max; | |||||
m_PortMax.push_back(Max); | |||||
} | |||||
for (int n=0; n<PortCount; n++) | |||||
{ | |||||
s>>Clamp; | |||||
m_PortClamp.push_back(Clamp); | |||||
} | |||||
for (int n=0; n<PortCount; n++) | |||||
{ | |||||
s>>Default; | |||||
m_PortDefault.push_back(Default); | |||||
} | |||||
if (SelectPlugin(UniqueID)) { | |||||
SetGUIExports(); | |||||
} else { | |||||
ClearPlugin(); | |||||
} | |||||
} | |||||
case 5: | case 5: | ||||
{ | { | ||||
ClearPlugin(); | ClearPlugin(); | ||||
s>>m_Gain; | |||||
float temp_gain; | |||||
s>>temp_gain; | |||||
unsigned long UniqueID; | unsigned long UniqueID; | ||||
s>>UniqueID; | s>>UniqueID; | ||||
@@ -375,7 +434,8 @@ void LADSPAPlugin::StreamIn(istream &s) | |||||
{ | { | ||||
ClearPlugin(); | ClearPlugin(); | ||||
s>>m_Gain; | |||||
float temp_gain; | |||||
s>>temp_gain; | |||||
unsigned long UniqueID; | unsigned long UniqueID; | ||||
s>>UniqueID; | s>>UniqueID; | ||||
@@ -418,7 +478,8 @@ void LADSPAPlugin::StreamIn(istream &s) | |||||
{ | { | ||||
ClearPlugin(); | ClearPlugin(); | ||||
s>>m_Gain; | |||||
float temp_gain; | |||||
s>>temp_gain; | |||||
string Filename,Label; | string Filename,Label; | ||||
s>>Filename>>Label; | s>>Filename>>Label; | ||||
@@ -467,7 +528,8 @@ void LADSPAPlugin::StreamIn(istream &s) | |||||
{ | { | ||||
ClearPlugin(); | ClearPlugin(); | ||||
s>>m_Gain; | |||||
float temp_gain; | |||||
s>>temp_gain; | |||||
string Filename,Label; | string Filename,Label; | ||||
s>>Filename>>Label; | s>>Filename>>Label; | ||||
@@ -513,7 +575,8 @@ void LADSPAPlugin::StreamIn(istream &s) | |||||
case 1: | case 1: | ||||
{ | { | ||||
s>>m_Gain; | |||||
float temp_gain; | |||||
s>>temp_gain; | |||||
string Filename,Label; | string Filename,Label; | ||||
s>>Filename>>Label; | s>>Filename>>Label; | ||||
@@ -653,8 +716,6 @@ void LADSPAPlugin::ClearPlugin(void) | |||||
m_PluginIndex = 0; | m_PluginIndex = 0; | ||||
m_InputPortCount = 0; | m_InputPortCount = 0; | ||||
m_Gain = 1.0f; | |||||
m_Amped = false; | |||||
strncpy(m_Name, "None\0", 5); | strncpy(m_Name, "None\0", 5); | ||||
strncpy(m_Maker, "None\0", 5); | strncpy(m_Maker, "None\0", 5); | ||||
@@ -34,6 +34,11 @@ struct PortSettings | |||||
bool Clamp; | bool Clamp; | ||||
float Default; | float Default; | ||||
}; | }; | ||||
struct PortValues | |||||
{ | |||||
float Value; | |||||
bool Connected; | |||||
}; | |||||
class LADSPAPlugin : public SpiralPlugin | class LADSPAPlugin : public SpiralPlugin | ||||
{ | { | ||||
@@ -48,14 +53,12 @@ public: | |||||
virtual void StreamOut(ostream &s); | virtual void StreamOut(ostream &s); | ||||
virtual void StreamIn(istream &s); | virtual void StreamIn(istream &s); | ||||
float GetGain() { return m_Gain; } | |||||
bool GetAmped() { return m_Amped; } | |||||
const char *GetName() { return (const char *)m_Name; } | const char *GetName() { return (const char *)m_Name; } | ||||
const char *GetMaker() { return (const char *)m_Maker; } | const char *GetMaker() { return (const char *)m_Maker; } | ||||
unsigned long GetInputPortCount() { return m_InputPortCount; } | unsigned long GetInputPortCount() { return m_InputPortCount; } | ||||
const char *GetPortName(unsigned long p) | const char *GetPortName(unsigned long p) | ||||
{ | { | ||||
return (const char *)(m_OutData.InputPortNames + p * 256); | |||||
return (const char *)(m_OutData.InputPortNames + p * 256); | |||||
} | } | ||||
PortSettings GetPortSettings(unsigned long p) | PortSettings GetPortSettings(unsigned long p) | ||||
{ | { | ||||
@@ -99,8 +102,6 @@ private: | |||||
unsigned long m_PluginIndex; | unsigned long m_PluginIndex; | ||||
unsigned long m_UniqueID; | unsigned long m_UniqueID; | ||||
float m_Gain; | |||||
bool m_Amped; | |||||
unsigned long m_MaxInputPortCount; | unsigned long m_MaxInputPortCount; | ||||
unsigned long m_InputPortCount; | unsigned long m_InputPortCount; | ||||
char m_Name[256]; | char m_Name[256]; | ||||
@@ -111,15 +112,13 @@ private: | |||||
{ | { | ||||
char *InputPortNames; | char *InputPortNames; | ||||
PortSettings *InputPortSettings; | PortSettings *InputPortSettings; | ||||
float *InputPortValues; | |||||
PortValues *InputPortValues; | |||||
}; | }; | ||||
// Data received from GUI | // Data received from GUI | ||||
struct InputChannelData | struct InputChannelData | ||||
{ | { | ||||
unsigned long PluginIndex; | unsigned long PluginIndex; | ||||
float Gain; | |||||
bool Amped; | |||||
PortSettings *InputPortSettings; | PortSettings *InputPortSettings; | ||||
}; | }; | ||||
@@ -50,14 +50,37 @@ SpiralPluginGUI(w,h,o,ch) | |||||
// Set up buffers for data transfer via ChannelHandler | // Set up buffers for data transfer via ChannelHandler | ||||
m_InData.InputPortNames = (char *)malloc(256 * m_InData.MaxInputPortCount); | m_InData.InputPortNames = (char *)malloc(256 * m_InData.MaxInputPortCount); | ||||
m_InData.InputPortSettings = (PortSettings *)malloc(sizeof(PortSettings) * m_InData.MaxInputPortCount); | m_InData.InputPortSettings = (PortSettings *)malloc(sizeof(PortSettings) * m_InData.MaxInputPortCount); | ||||
m_InData.InputPortValues = (float *)calloc(m_InData.MaxInputPortCount, sizeof(float)); | |||||
m_InData.InputPortValues = (PortValues *)calloc(m_InData.MaxInputPortCount, sizeof(PortValues)); | |||||
if (!(m_InData.InputPortNames && m_InData.InputPortSettings)) { | if (!(m_InData.InputPortNames && m_InData.InputPortSettings)) { | ||||
cerr<<"Memory allocation error\n"<<endl; | cerr<<"Memory allocation error\n"<<endl; | ||||
} | } | ||||
// Set up widgets | // Set up widgets | ||||
m_Browser = new Fl_Choice(60,20,420,25,"Plugin:"); | |||||
m_Name = new Fl_Box(10,20,480,15,"None"); | |||||
m_Name->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); | |||||
m_Name->labelcolor(GUI_COLOUR); | |||||
m_Name->labelsize(12); | |||||
add(m_Name); | |||||
m_Maker = new Fl_Box(10,40,480,15,"None"); | |||||
m_Maker->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); | |||||
m_Maker->labelcolor(GUI_COLOUR); | |||||
m_Maker->labelsize(12); | |||||
add(m_Maker); | |||||
m_Tab = new Fl_Tabs(5,60,490,255,""); | |||||
add(m_Tab); | |||||
m_ControlGroup = new Fl_Group(0,80,490,255,"Control"); | |||||
m_ControlGroup->labelsize(12); | |||||
m_SetupGroup = new Fl_Group(0,80,490,255,"Setup"); | |||||
m_SetupGroup->labelsize(12); | |||||
m_Browser = new Fl_Choice(50,85,440,22,"Plugin:"); | |||||
m_Browser->labelsize(12); | |||||
m_Browser->textsize(12); | |||||
m_Browser->callback((Fl_Callback *)cb_Select); | m_Browser->callback((Fl_Callback *)cb_Select); | ||||
m_Browser->add("(None)"); | m_Browser->add("(None)"); | ||||
@@ -68,54 +91,36 @@ SpiralPluginGUI(w,h,o,ch) | |||||
} | } | ||||
m_Browser->value(0); | m_Browser->value(0); | ||||
m_Name = new Fl_Box(10,50,480,20,"None"); | |||||
m_Name->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); | |||||
m_Name->labelcolor(GUI_COLOUR); | |||||
m_Name->labelsize(10); | |||||
add(m_Name); | |||||
m_Maker = new Fl_Box(10,70,480,20,"None"); | |||||
m_Maker->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); | |||||
m_Maker->labelcolor(GUI_COLOUR); | |||||
m_Maker->labelsize(10); | |||||
add(m_Maker); | |||||
m_SetupGroup->add(m_Browser); | |||||
m_InputScroll = new Fl_Scroll(10,110,480,150," Value Default Min Max Clamp? Port Name"); | |||||
m_InputScroll = new Fl_Scroll(10,130,480,145," Value Default Min Max Clamp? Port Name"); | |||||
m_InputScroll->labelsize(12); | m_InputScroll->labelsize(12); | ||||
m_InputScroll->align(FL_ALIGN_TOP_LEFT); | m_InputScroll->align(FL_ALIGN_TOP_LEFT); | ||||
m_InputScroll->type(Fl_Scroll::VERTICAL); | m_InputScroll->type(Fl_Scroll::VERTICAL); | ||||
m_InputScroll->box(FL_DOWN_BOX); | m_InputScroll->box(FL_DOWN_BOX); | ||||
add(m_InputScroll); | add(m_InputScroll); | ||||
m_InputPack = new Fl_Pack(5,115,460,20,""); | |||||
m_InputPack = new Fl_Pack(5,135,460,26,""); | |||||
m_InputScroll->add(m_InputPack); | m_InputScroll->add(m_InputPack); | ||||
m_PowerAmp = new Fl_Button(125,277,100,25,"PowerAmp"); | |||||
m_PowerAmp->labelsize(10); | |||||
m_PowerAmp->value(0); | |||||
m_PowerAmp->type(1); | |||||
m_PowerAmp->callback((Fl_Callback*)cb_PowerAmp); | |||||
add(m_PowerAmp); | |||||
m_SetupGroup->add(m_InputScroll); | |||||
m_UpdateMinMax = new Fl_Button(230,277,100,25,"Update Settings"); | |||||
m_UpdateMinMax->labelsize(10); | |||||
m_UpdateMinMax->callback((Fl_Callback*)cb_MinMax); | |||||
add(m_UpdateMinMax); | |||||
m_UpdateInputs = new Fl_Button(335,277,100,25,"Refresh"); | |||||
m_UpdateInputs->labelsize(10); | |||||
m_UpdateInputs = new Fl_Button(10,282,120,25,"Refresh"); | |||||
m_UpdateInputs->labelsize(12); | |||||
m_UpdateInputs->value(1); | m_UpdateInputs->value(1); | ||||
m_UpdateInputs->type(1); | m_UpdateInputs->type(1); | ||||
add(m_UpdateInputs); | add(m_UpdateInputs); | ||||
m_OutputGain = new Fl_Knob(440,265,40,40,"Output Gain"); | |||||
m_OutputGain->color(GUI_COLOUR); | |||||
m_OutputGain->type(Fl_Knob::DOTLIN); | |||||
m_OutputGain->maximum(2); | |||||
m_OutputGain->step(0.001); | |||||
m_OutputGain->value(1.0); | |||||
m_OutputGain->labelsize(10); | |||||
m_OutputGain->callback((Fl_Callback*)cb_Gain); | |||||
add(m_OutputGain); | |||||
m_SetupGroup->add(m_UpdateInputs); | |||||
m_UpdatePortSettings = new Fl_Button(140,282,120,25,"Update Settings"); | |||||
m_UpdatePortSettings->labelsize(12); | |||||
m_UpdatePortSettings->callback((Fl_Callback*)cb_PortSettings); | |||||
add(m_UpdatePortSettings); | |||||
m_SetupGroup->add(m_UpdatePortSettings); | |||||
m_Tab->add(m_ControlGroup); | |||||
m_Tab->add(m_SetupGroup); | |||||
end(); | end(); | ||||
} | } | ||||
@@ -127,12 +132,26 @@ LADSPAPluginGUI::~LADSPAPluginGUI(void) | |||||
Fl::check(); | Fl::check(); | ||||
} | } | ||||
void LADSPAPluginGUI::UpdatePortDisplay(int n, float v) | |||||
void LADSPAPluginGUI::UpdatePortDisplay(int n, PortValues pv) | |||||
{ | { | ||||
// Need to show that a connection is present | |||||
// regardless of Refresh being set | |||||
if (pv.Connected) { | |||||
// Disable | |||||
m_PortDefault[n]->readonly(1); | |||||
m_PortDefault[n]->color(FL_BACKGROUND_COLOR); | |||||
} else { | |||||
// Enable | |||||
m_PortDefault[n]->readonly(0); | |||||
m_PortDefault[n]->color(FL_BACKGROUND2_COLOR); | |||||
} | |||||
m_PortDefault[n]->redraw(); | |||||
// Only update values if Refresh is set | |||||
if (!m_UpdateInputs->value()) return; | if (!m_UpdateInputs->value()) return; | ||||
char temp[256]; | char temp[256]; | ||||
sprintf(temp,"%.4f",v); | |||||
sprintf(temp,"%.4f",pv.Value); | |||||
m_PortOutput[n]->value(temp); | m_PortOutput[n]->value(temp); | ||||
} | } | ||||
@@ -172,7 +191,7 @@ void LADSPAPluginGUI::ClearPortInfo() | |||||
m_InputScroll->remove(m_InputPack); | m_InputScroll->remove(m_InputPack); | ||||
delete m_InputPack; | delete m_InputPack; | ||||
m_InputPack = new Fl_Pack(x()+5,y()+115,460,20,""); | |||||
m_InputPack = new Fl_Pack(x()+5,y()+135,460,26,""); | |||||
m_InputScroll->add(m_InputPack); | m_InputScroll->add(m_InputPack); | ||||
m_PortOutput.clear(); | m_PortOutput.clear(); | ||||
@@ -185,7 +204,7 @@ void LADSPAPluginGUI::ClearPortInfo() | |||||
void LADSPAPluginGUI::AddPortInfo(const char *Info) | void LADSPAPluginGUI::AddPortInfo(const char *Info) | ||||
{ | { | ||||
Fl_Group* NewGroup = new Fl_Group(0,0,430,18,""); | |||||
Fl_Group* NewGroup = new Fl_Group(0,0,430,24,""); | |||||
NewGroup->box(FL_FLAT_BOX); | NewGroup->box(FL_FLAT_BOX); | ||||
m_InputPack->add(NewGroup); | m_InputPack->add(NewGroup); | ||||
m_PackVec.push_back(NewGroup); | m_PackVec.push_back(NewGroup); | ||||
@@ -194,6 +213,8 @@ void LADSPAPluginGUI::AddPortInfo(const char *Info) | |||||
Fl_Output* NewOutput = new Fl_Output(10,0,60,18,""); | Fl_Output* NewOutput = new Fl_Output(10,0,60,18,""); | ||||
NewOutput->value(0); | NewOutput->value(0); | ||||
NewOutput->textsize(10); | NewOutput->textsize(10); | ||||
NewOutput->color(FL_BACKGROUND_COLOR); | |||||
NewOutput->readonly(1); | |||||
NewGroup->add(NewOutput); | NewGroup->add(NewOutput); | ||||
m_PortOutput.push_back(NewOutput); | m_PortOutput.push_back(NewOutput); | ||||
@@ -219,13 +240,13 @@ void LADSPAPluginGUI::AddPortInfo(const char *Info) | |||||
m_PortMax.push_back(NewInput); | m_PortMax.push_back(NewInput); | ||||
// Clamp | // Clamp | ||||
Fl_Check_Button* NewCheckButton = new Fl_Check_Button(270,0,10,18,""); | |||||
Fl_Check_Button* NewCheckButton = new Fl_Check_Button(265,0,10,18,""); | |||||
NewCheckButton->value(0); | NewCheckButton->value(0); | ||||
NewGroup->add(NewCheckButton); | NewGroup->add(NewCheckButton); | ||||
m_PortClamp.push_back(NewCheckButton); | m_PortClamp.push_back(NewCheckButton); | ||||
// Port Name | // Port Name | ||||
Fl_Box* NewText = new Fl_Box(322,0,10,18,""); | |||||
Fl_Box* NewText = new Fl_Box(320,0,10,18,""); | |||||
NewText->label(Info); | NewText->label(Info); | ||||
NewText->labelsize(10); | NewText->labelsize(10); | ||||
NewText->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); | NewText->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); | ||||
@@ -239,8 +260,6 @@ void LADSPAPluginGUI::AddPortInfo(const char *Info) | |||||
void LADSPAPluginGUI::UpdateValues(SpiralPlugin *o) | void LADSPAPluginGUI::UpdateValues(SpiralPlugin *o) | ||||
{ | { | ||||
LADSPAPlugin* Plugin = (LADSPAPlugin*)o; | LADSPAPlugin* Plugin = (LADSPAPlugin*)o; | ||||
m_OutputGain->value(Plugin->GetGain()); | |||||
m_PowerAmp->value(Plugin->GetAmped()); | |||||
SetName(Plugin->GetName()); | SetName(Plugin->GetName()); | ||||
SetMaker(Plugin->GetMaker()); | SetMaker(Plugin->GetMaker()); | ||||
@@ -269,15 +288,6 @@ void LADSPAPluginGUI::Update(void) | |||||
} | } | ||||
} | } | ||||
inline void LADSPAPluginGUI::cb_Gain_i(Fl_Knob* o, void* v) | |||||
{ | |||||
m_GUICH->Set("SetGain",(float)(o->value())); | |||||
} | |||||
void LADSPAPluginGUI::cb_Gain(Fl_Knob* o, void* v) | |||||
{ | |||||
((LADSPAPluginGUI*)(o->parent()))->cb_Gain_i(o,v); | |||||
} | |||||
inline void LADSPAPluginGUI::cb_Select_i(Fl_Choice* o) | inline void LADSPAPluginGUI::cb_Select_i(Fl_Choice* o) | ||||
{ | { | ||||
if (o->value() == 0) { | if (o->value() == 0) { | ||||
@@ -317,10 +327,10 @@ inline void LADSPAPluginGUI::cb_Select_i(Fl_Choice* o) | |||||
} | } | ||||
void LADSPAPluginGUI::cb_Select(Fl_Choice* o) | void LADSPAPluginGUI::cb_Select(Fl_Choice* o) | ||||
{ | { | ||||
((LADSPAPluginGUI*)(o->parent()))->cb_Select_i(o); | |||||
((LADSPAPluginGUI*)(o->parent()->parent()->parent()))->cb_Select_i(o); | |||||
} | } | ||||
inline void LADSPAPluginGUI::cb_MinMax_i(Fl_Button* o, void* v) | |||||
inline void LADSPAPluginGUI::cb_PortSettings_i(Fl_Button* o, void* v) | |||||
{ | { | ||||
unsigned long n=0; | unsigned long n=0; | ||||
for (vector<Fl_Input*>::iterator i=m_PortMin.begin(); | for (vector<Fl_Input*>::iterator i=m_PortMin.begin(); | ||||
@@ -354,16 +364,7 @@ inline void LADSPAPluginGUI::cb_MinMax_i(Fl_Button* o, void* v) | |||||
m_GUICH->SetData("SetInputPortSettings", m_InData.InputPortSettings); | m_GUICH->SetData("SetInputPortSettings", m_InData.InputPortSettings); | ||||
m_GUICH->SetCommand(LADSPAPlugin::SETPORTSETTINGS); | m_GUICH->SetCommand(LADSPAPlugin::SETPORTSETTINGS); | ||||
} | } | ||||
void LADSPAPluginGUI::cb_MinMax(Fl_Button* o, void* v) | |||||
{ | |||||
((LADSPAPluginGUI*)(o->parent()))->cb_MinMax_i(o,v); | |||||
} | |||||
inline void LADSPAPluginGUI::cb_PowerAmp_i(Fl_Button* o, void* v) | |||||
{ | |||||
m_GUICH->Set("SetAmped",(bool)(o->value())); | |||||
} | |||||
void LADSPAPluginGUI::cb_PowerAmp(Fl_Button* o, void* v) | |||||
void LADSPAPluginGUI::cb_PortSettings(Fl_Button* o, void* v) | |||||
{ | { | ||||
((LADSPAPluginGUI*)(o->parent()))->cb_PowerAmp_i(o,v); | |||||
((LADSPAPluginGUI*)(o->parent()->parent()->parent()))->cb_PortSettings_i(o,v); | |||||
} | } |
@@ -24,12 +24,13 @@ | |||||
#include <FL/Fl_Group.H> | #include <FL/Fl_Group.H> | ||||
#include <FL/Fl_Pack.H> | #include <FL/Fl_Pack.H> | ||||
#include <FL/Fl_Choice.H> | #include <FL/Fl_Choice.H> | ||||
#include <FL/Fl_Tabs.H> | |||||
#include <FL/Fl_Scroll.H> | |||||
#include <FL/Fl_Input.H> | #include <FL/Fl_Input.H> | ||||
#include <FL/Fl_Button.H> | #include <FL/Fl_Button.H> | ||||
#include <FL/Fl_Check_Button.H> | #include <FL/Fl_Check_Button.H> | ||||
#include <FL/Fl_Box.H> | #include <FL/Fl_Box.H> | ||||
#include <FL/Fl_Output.H> | #include <FL/Fl_Output.H> | ||||
#include <FL/Fl_Scroll.H> | |||||
#include "../Widgets/Fl_Knob.H" | #include "../Widgets/Fl_Knob.H" | ||||
#include <vector> | #include <vector> | ||||
@@ -60,26 +61,26 @@ public: | |||||
void ClearPortInfo(); | void ClearPortInfo(); | ||||
void AddPortInfo(const char *Info); | void AddPortInfo(const char *Info); | ||||
void UpdatePortDisplay(int n, float v); | |||||
void UpdatePortDisplay(int n, PortValues pv); | |||||
void SetPortSettings(unsigned long n, float min, float max, bool clamp, float defolt); | void SetPortSettings(unsigned long n, float min, float max, bool clamp, float defolt); | ||||
// void SetMinMax(int n, float min, float max, bool clamp); | |||||
// void GetMinMax(int n, float &min, float &max, bool &clamp); | |||||
private: | private: | ||||
Fl_Scroll *m_InputScroll; | |||||
Fl_Pack *m_InputPack; | |||||
Fl_Choice *m_Browser; | |||||
Fl_Knob *m_OutputGain; | |||||
Fl_Box *m_Name; | |||||
Fl_Box *m_Maker; | |||||
Fl_Button *m_UpdateInputs; | |||||
Fl_Button *m_UpdateMinMax; | |||||
Fl_Button *m_PowerAmp; | |||||
std::vector<Fl_Output*> m_PortOutput; | |||||
std::vector<Fl_Input*> m_PortMin; | |||||
std::vector<Fl_Input*> m_PortMax; | |||||
std::vector<Fl_Check_Button*> m_PortClamp; | |||||
std::vector<Fl_Input*> m_PortDefault; | |||||
Fl_Tabs *m_Tab; | |||||
Fl_Group *m_ControlGroup; | |||||
Fl_Group *m_SetupGroup; | |||||
Fl_Scroll *m_InputScroll; | |||||
Fl_Pack *m_InputPack; | |||||
Fl_Choice *m_Browser; | |||||
Fl_Box *m_Name; | |||||
Fl_Box *m_Maker; | |||||
Fl_Button *m_UpdateInputs; | |||||
Fl_Button *m_UpdatePortSettings; | |||||
std::vector<Fl_Output*> m_PortOutput; | |||||
std::vector<Fl_Input*> m_PortMin; | |||||
std::vector<Fl_Input*> m_PortMax; | |||||
std::vector<Fl_Check_Button*> m_PortClamp; | |||||
std::vector<Fl_Input*> m_PortDefault; | |||||
std::vector<Fl_Knob*> m_PortDefaultKnob; | |||||
std::vector<LADSPAInfo::PluginEntry> PluginList; | std::vector<LADSPAInfo::PluginEntry> PluginList; | ||||
@@ -91,24 +92,19 @@ private: | |||||
inline void cb_Select_i(Fl_Choice* o); | inline void cb_Select_i(Fl_Choice* o); | ||||
static void cb_Select(Fl_Choice* o); | static void cb_Select(Fl_Choice* o); | ||||
inline void cb_Gain_i(Fl_Knob* o, void* v); | |||||
static void cb_Gain(Fl_Knob* o, void* v); | |||||
inline void cb_MinMax_i(Fl_Button* o, void* v); | |||||
static void cb_MinMax(Fl_Button* o, void* v); | |||||
inline void cb_PowerAmp_i(Fl_Button* o, void* v); | |||||
static void cb_PowerAmp(Fl_Button* o, void* v); | |||||
inline void cb_PortSettings_i(Fl_Button* o, void* v); | |||||
static void cb_PortSettings(Fl_Button* o, void* v); | |||||
struct InChannelData | struct InChannelData | ||||
{ | { | ||||
unsigned long PluginIndex; | unsigned long PluginIndex; | ||||
float Gain; | |||||
char Name[256]; | char Name[256]; | ||||
char Maker[256]; | char Maker[256]; | ||||
unsigned long MaxInputPortCount; | unsigned long MaxInputPortCount; | ||||
unsigned long InputPortCount; | unsigned long InputPortCount; | ||||
char *InputPortNames; | char *InputPortNames; | ||||
PortSettings *InputPortSettings; | PortSettings *InputPortSettings; | ||||
float *InputPortValues; | |||||
PortValues *InputPortValues; | |||||
}; | }; | ||||
InChannelData m_InData; | InChannelData m_InData; | ||||