@@ -291,7 +291,7 @@ void Fl_Canvas::DrawWires() | |||
} | |||
} | |||
void Fl_Canvas::ClearIncompleteWire() | |||
{ | |||
{ | |||
// Turn off both ports | |||
if (m_IncompleteWire.OutputChild!=-1) | |||
{ | |||
@@ -52,7 +52,7 @@ public: | |||
virtual int handle(int event); | |||
void Add() { m_ConnectionCount++; } | |||
void Remove() { m_ConnectionCount--; } | |||
void Remove() { if (m_ConnectionCount>0) m_ConnectionCount--; } | |||
int GetCount() { return m_ConnectionCount; } | |||
int GetLastButton() { return m_LastButton; } | |||
@@ -1,171 +0,0 @@ | |||
############################################################################# | |||
# Makefile for building LFOPlugin.so | |||
# Generated by tmake at 22:13, 2001/09/17 | |||
# Project: LFOPlugin | |||
# Template: app | |||
############################################################################# | |||
####### Compiler, tools and options | |||
CC = gcc | |||
CXX = g++ | |||
CFLAGS = -pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused -fPIC | |||
CXXFLAGS= -pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused -fPIC -fPIC | |||
INCPATH = -I/usr/X11R6/include | |||
LINK = g++ -shared | |||
LFLAGS = | |||
LIBS = -L/usr/X11R6/lib -L/usr/X11R6/lib -lfltk -lGL -lGL -lXext -lX11 -ldl | |||
MOC = moc | |||
UIC = | |||
TAR = tar -cf | |||
GZIP = gzip -9f | |||
INSTALL = /usr/bin/install -c | |||
###### Autoconf variables | |||
prefix = /usr/local | |||
exec_prefix = ${prefix} | |||
bindir = ${exec_prefix}/bin | |||
sbindir = ${exec_prefix}/sbin | |||
libexecdir = ${exec_prefix}/libexec | |||
datadir = ${prefix}/share | |||
sysconfdir = ${prefix}/etc | |||
sharedstatedir = ${prefix}/com | |||
localstatedir = ${prefix}/var | |||
libdir = ${exec_prefix}/lib | |||
infodir = ${prefix}/info | |||
mandir = ${prefix}/man | |||
####### Files | |||
HEADERS = ../SpiralPlugin.h \ | |||
../SpiralPluginGUI.h \ | |||
../../ChannelHandler.h \ | |||
../Widgets/Fl_Knob.H \ | |||
../Widgets/Fl_DragBar.H \ | |||
../../Sample.h \ | |||
LFOPlugin.h \ | |||
LFOPluginGUI.h | |||
SOURCES = ../SpiralPlugin.C \ | |||
../SpiralPluginGUI.C \ | |||
../../ChannelHandler.C \ | |||
../Widgets/Fl_Knob.cxx \ | |||
../Widgets/Fl_DragBar.cxx \ | |||
../../Sample.C \ | |||
LFOPlugin.C \ | |||
LFOPluginGUI.C | |||
OBJECTS = ../SpiralPlugin.o \ | |||
../SpiralPluginGUI.o \ | |||
../../ChannelHandler.o \ | |||
../Widgets/Fl_Knob.o \ | |||
../Widgets/Fl_DragBar.o \ | |||
../../Sample.o \ | |||
LFOPlugin.o \ | |||
LFOPluginGUI.o | |||
INTERFACES = | |||
UICDECLS = | |||
UICIMPLS = | |||
SRCMOC = | |||
OBJMOC = | |||
DIST = | |||
TARGET = LFOPlugin.so | |||
####### Implicit rules | |||
.SUFFIXES: .cpp .cxx .cc .C .c | |||
.cpp.o: | |||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
.cxx.o: | |||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
.cc.o: | |||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
.C.o: | |||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
.c.o: | |||
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< | |||
####### Build rules | |||
all: $(TARGET) | |||
$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) | |||
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) | |||
moc: $(SRCMOC) | |||
tmake: | |||
tmake LFOPlugin.pro | |||
dist: | |||
$(TAR) LFOPlugin.tar LFOPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) | |||
$(GZIP) LFOPlugin.tar | |||
clean: | |||
-rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) | |||
-rm -f *~ core | |||
install: | |||
$(INSTALL) $(TARGET) $(libdir)/SpiralPlugins | |||
####### Sub-libraries | |||
###### Combined headers | |||
####### Compile | |||
../SpiralPlugin.o: ../SpiralPlugin.C \ | |||
../SpiralPlugin.h \ | |||
../../Sample.h | |||
../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ | |||
../SpiralPluginGUI.h \ | |||
../Widgets/Fl_DragBar.H \ | |||
../SpiralPlugin.h \ | |||
../../Sample.h | |||
../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ | |||
../Widgets/Fl_Knob.H | |||
../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ | |||
../Widgets/Fl_DragBar.H | |||
../../Sample.o: ../../Sample.C \ | |||
../../Sample.h \ | |||
../../SpiralInfo.h | |||
LFOPlugin.o: LFOPlugin.C \ | |||
LFOPlugin.h \ | |||
../SpiralPlugin.h \ | |||
../../Sample.h \ | |||
../../SpiralInfo.h \ | |||
../../Sample.h \ | |||
LFOPluginGUI.h \ | |||
../Widgets/Fl_Knob.H \ | |||
../SpiralPluginGUI.h \ | |||
../Widgets/Fl_DragBar.H \ | |||
SpiralIcon.xpm | |||
LFOPluginGUI.o: LFOPluginGUI.C \ | |||
LFOPluginGUI.h \ | |||
../Widgets/Fl_Knob.H \ | |||
../SpiralPluginGUI.h \ | |||
../Widgets/Fl_DragBar.H \ | |||
LFOPlugin.h \ | |||
../SpiralPlugin.h \ | |||
../../Sample.h \ | |||
../../SpiralInfo.h \ | |||
../../Sample.h | |||
../../ChannelHandler.o: ../../ChannelHandler.C \ | |||
../../ChannelHandler.h |
@@ -1,171 +0,0 @@ | |||
############################################################################# | |||
# Makefile for building MeterPlugin.so | |||
############################################################################# | |||
####### Compiler, tools and options | |||
CC = gcc | |||
CXX = g++ | |||
CFLAGS = -pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused -fPIC | |||
CXXFLAGS= -pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused -fPIC -fPIC | |||
INCPATH = -I/usr/X11R6/include | |||
LINK = g++ -shared | |||
LFLAGS = | |||
LIBS = -L/usr/X11R6/lib -L/usr/X11R6/lib -lfltk -lGL -lGL -lXext -lX11 -ldl | |||
MOC = moc | |||
UIC = | |||
TAR = tar -cf | |||
GZIP = gzip -9f | |||
INSTALL = /usr/bin/install -c | |||
###### Autoconf variables | |||
prefix = /usr/local | |||
exec_prefix = ${prefix} | |||
bindir = ${exec_prefix}/bin | |||
sbindir = ${exec_prefix}/sbin | |||
libexecdir = ${exec_prefix}/libexec | |||
datadir = ${prefix}/share | |||
sysconfdir = ${prefix}/etc | |||
sharedstatedir = ${prefix}/com | |||
localstatedir = ${prefix}/var | |||
libdir = ${exec_prefix}/lib | |||
infodir = ${prefix}/info | |||
mandir = ${prefix}/man | |||
####### Files | |||
HEADERS = ../SpiralPlugin.h \ | |||
../SpiralPluginGUI.h \ | |||
../Widgets/Fl_DragBar.H \ | |||
../Widgets/Fl_SevenSeg.H \ | |||
../Widgets/Fl_VU_Meter.h \ | |||
../../Sample.h \ | |||
MeterPlugin.h \ | |||
MeterPluginGUI.h | |||
SOURCES = ../SpiralPlugin.C \ | |||
../SpiralPluginGUI.C \ | |||
../Widgets/Fl_DragBar.cxx \ | |||
../Widgets/Fl_SevenSeg.cxx \ | |||
../Widgets/Fl_VU_Meter.cxx \ | |||
../../Sample.C \ | |||
MeterPlugin.C \ | |||
MeterPluginGUI.C | |||
OBJECTS = ../SpiralPlugin.o \ | |||
../SpiralPluginGUI.o \ | |||
../Widgets/Fl_DragBar.o \ | |||
../Widgets/Fl_SevenSeg.o \ | |||
../Widgets/Fl_VU_Meter.o \ | |||
../../Sample.o \ | |||
MeterPlugin.o \ | |||
MeterPluginGUI.o | |||
INTERFACES = | |||
UICDECLS = | |||
UICIMPLS = | |||
SRCMOC = | |||
OBJMOC = | |||
DIST = | |||
TARGET = MeterPlugin.so | |||
####### Implicit rules | |||
.SUFFIXES: .cpp .cxx .cc .C .c | |||
.cpp.o: | |||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
.cxx.o: | |||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
.cc.o: | |||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
.C.o: | |||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
.c.o: | |||
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< | |||
####### Build rules | |||
all: $(TARGET) | |||
$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) | |||
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) | |||
moc: $(SRCMOC) | |||
tmake: | |||
tmake MeterPlugin.pro | |||
dist: | |||
$(TAR) MeterPlugin.tar MeterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) | |||
$(GZIP) MeterPlugin.tar | |||
clean: | |||
-rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) | |||
-rm -f *~ core | |||
install: | |||
$(INSTALL) $(TARGET) $(libdir)/SpiralPlugins | |||
####### Sub-libraries | |||
###### Combined headers | |||
####### Compile | |||
../SpiralPlugin.o: ../SpiralPlugin.C \ | |||
../SpiralPlugin.h \ | |||
../../Sample.h | |||
../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ | |||
../SpiralPluginGUI.h \ | |||
../Widgets/Fl_DragBar.H \ | |||
../SpiralPlugin.h \ | |||
../../Sample.h | |||
../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ | |||
../Widgets/Fl_DragBar.H | |||
../Widgets/Fl_VU_Meter.o: ../Widgets/Fl_VU_Meter.cxx \ | |||
../Widgets/Fl_VU_Meter.h | |||
../Widgets/Fl_SevenSeg.o: ../Widgets/Fl_SevenSeg.cxx \ | |||
../Widgets/Fl_SevenSeg.H | |||
../../Sample.o: ../../Sample.C \ | |||
../../Sample.h \ | |||
../../SpiralInfo.h | |||
MeterPlugin.o: MeterPlugin.C \ | |||
MeterPlugin.h \ | |||
../SpiralPlugin.h \ | |||
../../Sample.h \ | |||
../../SpiralInfo.h \ | |||
../../Sample.h \ | |||
MeterPluginGUI.h \ | |||
../Widgets/Fl_DragBar.H \ | |||
../Widgets/Fl_VU_Meter.h \ | |||
../Widgets/Fl_SevenSeg.H \ | |||
../SpiralPluginGUI.h \ | |||
SpiralIcon.xpm | |||
MeterPluginGUI.o: MeterPluginGUI.C \ | |||
MeterPluginGUI.h \ | |||
../Widgets/Fl_DragBar.H \ | |||
../Widgets/Fl_VU_Meter.h \ | |||
../Widgets/Fl_SevenSeg.H \ | |||
MeterPlugin.h \ | |||
../SpiralPlugin.h \ | |||
../../Sample.h \ | |||
../../SpiralInfo.h \ | |||
../../Sample.h \ | |||
../SpiralPluginGUI.h | |||
@@ -43,8 +43,8 @@ int GetID() | |||
SeqSelectorPlugin::SeqSelectorPlugin() | |||
{ | |||
m_PluginInfo.Name="SeqSelector"; | |||
m_PluginInfo.Width=400; | |||
m_PluginInfo.Height=300; | |||
m_PluginInfo.Width=300; | |||
m_PluginInfo.Height=200; | |||
m_PluginInfo.NumInputs=1; | |||
m_PluginInfo.NumOutputs=8; | |||
m_PluginInfo.PortTips.push_back("Trigger"); | |||
@@ -60,11 +60,11 @@ SeqSelectorPlugin::SeqSelectorPlugin() | |||
m_Pos=0; | |||
m_Triggered=false; | |||
m_UseRange=false; | |||
for(int i=0; i<8; i++) | |||
{ | |||
m_OutTemp[i]=0; | |||
} | |||
m_AudioCH->Register("Num",&m_GUIArgs.Num); | |||
m_AudioCH->Register("Line",&m_GUIArgs.Line); | |||
m_AudioCH->Register("Val",&m_GUIArgs.Val); | |||
m_AudioCH->Register("Pos",(int*)&m_Pos,ChannelHandler::OUTPUT); | |||
} | |||
SeqSelectorPlugin::~SeqSelectorPlugin() | |||
@@ -78,18 +78,13 @@ PluginInfo &SeqSelectorPlugin::Initialise(const HostInfo *Host) | |||
SpiralGUIType *SeqSelectorPlugin::CreateGUI() | |||
{ | |||
m_GUI = new SeqSelectorPluginGUI(m_PluginInfo.Width, | |||
return new SeqSelectorPluginGUI(m_PluginInfo.Width, | |||
m_PluginInfo.Height, | |||
this,m_HostInfo); | |||
m_GUI->hide(); | |||
return m_GUI; | |||
this,m_AudioCH,m_HostInfo); | |||
} | |||
void SeqSelectorPlugin::Execute() | |||
{ | |||
SeqSelectorPluginGUI *ssp=(SeqSelectorPluginGUI*)m_GUI; | |||
for (int n=0; n<m_HostInfo->BUFSIZE; n++) | |||
{ | |||
// Sends momentary spike of value when triggered, | |||
@@ -101,7 +96,7 @@ void SeqSelectorPlugin::Execute() | |||
} | |||
else | |||
{ | |||
if (m_Triggered==true && ssp->GetNumLines()>0) | |||
if (m_Triggered==true && m_Lines.size()>0) | |||
{ | |||
m_Pos++; | |||
@@ -114,7 +109,7 @@ void SeqSelectorPlugin::Execute() | |||
} | |||
else | |||
{ | |||
if (m_Pos>=ssp->GetNumLines()) | |||
if (m_Pos>=m_Lines.size()) | |||
{ | |||
m_Pos=0; | |||
} | |||
@@ -122,9 +117,8 @@ void SeqSelectorPlugin::Execute() | |||
for(int i=0; i<8; i++) | |||
{ | |||
SetOutputPitch(i,n,NoteTable[(int)ssp->GetVal(m_Pos,i)]); | |||
SetOutputPitch(i,n,NoteTable[(int)m_Lines[m_Pos].Value[i]]); | |||
} | |||
ssp->SetLED(m_Pos); | |||
} | |||
else | |||
{ | |||
@@ -140,15 +134,68 @@ void SeqSelectorPlugin::Execute() | |||
} | |||
} | |||
void SeqSelectorPlugin::ExecuteCommands() | |||
{ | |||
if (m_AudioCH->IsCommandWaiting()) | |||
{ | |||
switch (m_AudioCH->GetCommand()) | |||
{ | |||
case SET_BEGIN : m_Begin=m_GUIArgs.Line; break; | |||
case SET_END : m_End=m_GUIArgs.Line; break; | |||
case RANGE : m_UseRange=m_GUIArgs.Val; break; | |||
case ADD_LINE : | |||
{ | |||
Line NewLine; | |||
if (m_Lines.size()) | |||
{ | |||
for (int n=0; n<NUM_VALUES; n++) NewLine.Value[n]=m_Lines[m_Lines.size()-1].Value[n]; | |||
} | |||
else | |||
{ | |||
for (int n=0; n<NUM_VALUES; n++) NewLine.Value[n]=0; | |||
} | |||
m_Lines.push_back(NewLine); | |||
} break; | |||
case REM_LINE : m_Lines.pop_back(); break; | |||
case SET_VAL : m_Lines[m_GUIArgs.Line].Value[m_GUIArgs.Num]=m_GUIArgs.Val; break; | |||
default: break; | |||
} | |||
} | |||
} | |||
void SeqSelectorPlugin::StreamOut(ostream &s) | |||
{ | |||
s<<m_Version<<" "; | |||
((SeqSelectorPluginGUI*)m_GUI)->StreamOut(s); | |||
s<<m_Lines.size()<<" "; | |||
if (m_Lines.size()>0) | |||
{ | |||
for (vector<Line>::iterator i = m_Lines.begin(); | |||
i!=m_Lines.end(); i++) | |||
{ | |||
for (int n=0; n<NUM_VALUES; n++) | |||
{ | |||
s<<i->Value[n]<<" "; | |||
} | |||
} | |||
} | |||
} | |||
void SeqSelectorPlugin::StreamIn(istream &s) | |||
{ | |||
int version; | |||
s>>version; | |||
((SeqSelectorPluginGUI*)m_GUI)->StreamIn(s); | |||
int Num; | |||
s>>Num; | |||
for (int i=0; i<Num; i++) | |||
{ | |||
Line NewLine; | |||
for (int n=0; n<NUM_VALUES; n++) | |||
{ | |||
s>>NewLine.Value[n]; | |||
} | |||
m_Lines.push_back(NewLine); | |||
} | |||
} |
@@ -22,6 +22,8 @@ | |||
#ifndef SEQSELECTORPlugin | |||
#define SEQSELECTORPlugin | |||
static const int NUM_VALUES = 8; | |||
class SeqSelectorPlugin : public SpiralPlugin | |||
{ | |||
public: | |||
@@ -31,24 +33,36 @@ public: | |||
virtual PluginInfo &Initialise(const HostInfo *Host); | |||
virtual SpiralGUIType *CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
// has to be defined in the plugin | |||
virtual void UpdateGUI() { Fl::check(); } | |||
void SetBegin(int s) { m_Begin=s; } | |||
void SetEnd(int s) { m_End=s; } | |||
int GetBegin() { return m_Begin; } | |||
int GetEnd() { return m_End; } | |||
void UseRange(bool s) { m_UseRange=s; } | |||
enum GUICommands{NONE,SET_BEGIN,SET_END,RANGE,ADD_LINE,REM_LINE,SET_VAL}; | |||
struct GUIArgs | |||
{ | |||
int Num; | |||
int Line; | |||
int Val; | |||
}; | |||
struct Line | |||
{ | |||
int Value[NUM_VALUES]; | |||
}; | |||
vector<Line> m_Lines; | |||
private: | |||
int m_Pos; | |||
short m_OutTemp[8]; | |||
GUIArgs m_GUIArgs; | |||
int m_Begin; | |||
int m_End; | |||
unsigned int m_Pos; | |||
unsigned int m_Begin; | |||
unsigned int m_End; | |||
bool m_UseRange; | |||
bool m_Triggered; | |||
}; | |||
@@ -28,11 +28,12 @@ static const int GUIBG2_COLOUR = 145; | |||
//////////////////////////////////////////// | |||
CountLine::CountLine(int n) : | |||
Fl_Group(0,0,330,25,"") | |||
Fl_Group(0,0,250,14,"") | |||
{ | |||
box(FL_FLAT_BOX); | |||
if (n%4==0) color(GUIBG2_COLOUR); | |||
if (n%8==0) color(GUI_COLOUR); | |||
m_Num=n; | |||
sprintf(m_Count,"%d",n); | |||
Fl_Box *Num = new Fl_Box(5,2,30,20,m_Count); | |||
@@ -41,14 +42,15 @@ Fl_Group(0,0,330,25,"") | |||
Num->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); | |||
add(Num); | |||
m_Flasher = new Fl_LED_Button(15,2,20,20,""); | |||
m_Flasher = new Fl_LED_Button(15,-3,20,20,""); | |||
m_Flasher->selection_color(FL_BLUE); | |||
add(m_Flasher); | |||
for (int n=0; n<NUM_VALUES; n++) | |||
{ | |||
m_Counter[n] = new Fl_Counter(30+n*35, 2, 35, 20, ""); | |||
m_Counter[n]->labelsize(10); | |||
m_Counter[n] = new Fl_Counter(30+n*25, 2, 25, 12, ""); | |||
m_Counter[n]->labelsize(8); | |||
m_Counter[n]->textsize(8); | |||
m_Counter[n]->type(FL_SIMPLE_COUNTER); | |||
m_Counter[n]->step(1); | |||
m_Counter[n]->value(0); | |||
@@ -75,14 +77,30 @@ float CountLine::GetVal(int n) | |||
assert(n>=0 && n<8); | |||
return m_Counter[n]->value(); | |||
} | |||
int CountLine::handle(int event) | |||
{ | |||
int temp = Fl_Group::handle(event); | |||
if (event==FL_PUSH) | |||
{ | |||
for(int n=0; n<NUM_VALUES; n++) | |||
{ | |||
m_GUICH->Set("Line",m_Num); | |||
m_GUICH->Set("Num",n); | |||
m_GUICH->Set("Val",(int)GetVal(n)); | |||
m_GUICH->SetCommand(SeqSelectorPlugin::SET_VAL); | |||
m_GUICH->Wait(); | |||
} | |||
} | |||
return temp; | |||
} | |||
//////////////////////////////////////////// | |||
SeqSelectorPluginGUI::SeqSelectorPluginGUI(int w, int h,SeqSelectorPlugin *o,const HostInfo *Info) : | |||
SpiralPluginGUI(w,h,o) | |||
SeqSelectorPluginGUI::SeqSelectorPluginGUI(int w, int h,SeqSelectorPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
SpiralPluginGUI(w,h,o,ch) | |||
{ | |||
m_Plugin=o; | |||
m_Scroll = new Fl_Scroll(0, 20, w, h-50, ""); | |||
m_Scroll->type(Fl_Scroll::VERTICAL_ALWAYS); | |||
m_Scroll->box(FL_NO_BOX); | |||
@@ -93,17 +111,17 @@ SpiralPluginGUI(w,h,o) | |||
m_Main->box(FL_NO_BOX); | |||
m_Scroll->add(m_Main); | |||
m_New = new Fl_Button(5,h-25,100,20,"New"); | |||
m_New = new Fl_Button(5,h-25,50,20,"New"); | |||
m_New->labelsize(10); | |||
m_New->callback((Fl_Callback*)cb_New); | |||
add(m_New); | |||
m_Delete = new Fl_Button(110,h-25,100,20,"Delete"); | |||
m_Delete = new Fl_Button(60,h-25,50,20,"Delete"); | |||
m_Delete->labelsize(10); | |||
m_Delete->callback((Fl_Callback*)cb_Delete); | |||
add(m_Delete); | |||
m_Begin = new Fl_Counter(220,h-28,50,15,"Begin"); | |||
m_Begin = new Fl_Counter(115,h-28,50,15,"Begin"); | |||
m_Begin->labelsize(10); | |||
m_Begin->type(FL_SIMPLE_COUNTER); | |||
m_Begin->step(1); | |||
@@ -111,7 +129,7 @@ SpiralPluginGUI(w,h,o) | |||
m_Begin->callback((Fl_Callback*)cb_Begin); | |||
add(m_Begin); | |||
m_End = new Fl_Counter(280,h-28,50,15,"End"); | |||
m_End = new Fl_Counter(175,h-28,50,15,"End"); | |||
m_End->labelsize(10); | |||
m_End->type(FL_SIMPLE_COUNTER); | |||
m_End->step(1); | |||
@@ -119,7 +137,7 @@ SpiralPluginGUI(w,h,o) | |||
m_End->callback((Fl_Callback*)cb_End); | |||
add(m_End); | |||
m_UseRange = new Fl_Button(340,h-25,55,20,"UseRange"); | |||
m_UseRange = new Fl_Button(230,h-25,55,20,"UseRange"); | |||
m_UseRange->labelsize(10); | |||
m_UseRange->type(1); | |||
m_UseRange->value(0); | |||
@@ -148,6 +166,7 @@ float SeqSelectorPluginGUI::GetVal(int l, int v) | |||
void SeqSelectorPluginGUI::AddLine(int* Val) | |||
{ | |||
CountLine *NewLine = new CountLine(m_LineVec.size()); | |||
NewLine->m_GUICH = m_GUICH; | |||
// copy the last line | |||
list<CountLine*>::iterator i=m_LineVec.begin(); | |||
@@ -190,9 +209,20 @@ void SeqSelectorPluginGUI::RemoveLine() | |||
} | |||
} | |||
void SeqSelectorPluginGUI::Update() | |||
{ | |||
int p=m_GUICH->GetInt("Pos"); | |||
if (m_LastLight!=p) | |||
{ | |||
m_LastLight=p; | |||
SetLED(p); | |||
} | |||
} | |||
void SeqSelectorPluginGUI::SetLED(int n) | |||
{ | |||
int c=0; | |||
if (m_LineVec.empty()) return; | |||
list<CountLine*>::iterator i = m_LineVec.end(); | |||
do | |||
@@ -205,13 +235,23 @@ void SeqSelectorPluginGUI::SetLED(int n) | |||
while (i!=m_LineVec.begin()); | |||
} | |||
void SeqSelectorPluginGUI::UpdateValues() | |||
void SeqSelectorPluginGUI::UpdateValues(SpiralPlugin *o) | |||
{ | |||
SeqSelectorPlugin *Plugin = (SeqSelectorPlugin *)o; | |||
int c=Plugin->m_Lines.size(); | |||
for (int n=0; n<c; n++) | |||
{ | |||
int temp[8]; | |||
for (int i=0; i<8; i++) temp[i]=Plugin->m_Lines[n].Value[i]; | |||
AddLine(temp); | |||
} | |||
} | |||
inline void SeqSelectorPluginGUI::cb_New_i(Fl_Button* o, void* v) | |||
{ | |||
AddLine(); | |||
m_GUICH->SetCommand(SeqSelectorPlugin::ADD_LINE); | |||
} | |||
void SeqSelectorPluginGUI::cb_New(Fl_Button* o, void* v) | |||
{ ((SeqSelectorPluginGUI*)(o->parent()))->cb_New_i(o,v); } | |||
@@ -219,64 +259,31 @@ void SeqSelectorPluginGUI::cb_New(Fl_Button* o, void* v) | |||
inline void SeqSelectorPluginGUI::cb_Delete_i(Fl_Button* o, void* v) | |||
{ | |||
RemoveLine(); | |||
m_GUICH->SetCommand(SeqSelectorPlugin::REM_LINE); | |||
} | |||
void SeqSelectorPluginGUI::cb_Delete(Fl_Button* o, void* v) | |||
{ ((SeqSelectorPluginGUI*)(o->parent()))->cb_Delete_i(o,v); } | |||
inline void SeqSelectorPluginGUI::cb_Begin_i(Fl_Counter* o, void* v) | |||
{ | |||
m_Plugin->SetBegin((int)o->value()); | |||
m_GUICH->Set("Line",(int)o->value()); | |||
m_GUICH->SetCommand(SeqSelectorPlugin::SET_BEGIN); | |||
} | |||
void SeqSelectorPluginGUI::cb_Begin(Fl_Counter* o, void* v) | |||
{ ((SeqSelectorPluginGUI*)(o->parent()))->cb_Begin_i(o,v); } | |||
inline void SeqSelectorPluginGUI::cb_End_i(Fl_Counter* o, void* v) | |||
{ | |||
m_Plugin->SetEnd((int)o->value()); | |||
m_GUICH->Set("Line",(int)o->value()); | |||
m_GUICH->SetCommand(SeqSelectorPlugin::SET_END); | |||
} | |||
void SeqSelectorPluginGUI::cb_End(Fl_Counter* o, void* v) | |||
{ ((SeqSelectorPluginGUI*)(o->parent()))->cb_End_i(o,v); } | |||
inline void SeqSelectorPluginGUI::cb_UseRange_i(Fl_Button* o, void* v) | |||
{ | |||
m_Plugin->UseRange(o->value()); | |||
m_GUICH->Set("Val",(int)o->value()); | |||
m_GUICH->SetCommand(SeqSelectorPlugin::RANGE); | |||
} | |||
void SeqSelectorPluginGUI::cb_UseRange(Fl_Button* o, void* v) | |||
{ ((SeqSelectorPluginGUI*)(o->parent()))->cb_UseRange_i(o,v); } | |||
void SeqSelectorPluginGUI::StreamOut(ostream &s) | |||
{ | |||
s<<m_LineVec.size()<<" "; | |||
if (m_LineVec.size()>0) | |||
{ | |||
// Stream out in reverse | |||
list<CountLine*>::iterator i = m_LineVec.end(); | |||
do | |||
{ | |||
i--; | |||
for (int n=0; n<NUM_VALUES; n++) | |||
{ | |||
s<<(*i)->GetVal(n)<<" "; | |||
} | |||
} | |||
while (i!=m_LineVec.begin()); | |||
} | |||
} | |||
void SeqSelectorPluginGUI::StreamIn(istream &s) | |||
{ | |||
int Num; | |||
s>>Num; | |||
for (int i=0; i<Num; i++) | |||
{ | |||
int Val[8]; | |||
for (int n=0; n<NUM_VALUES; n++) | |||
{ | |||
s>>Val[n]; | |||
} | |||
AddLine(Val); | |||
} | |||
} |
@@ -34,8 +34,6 @@ | |||
#ifndef MixerGUI | |||
#define MixerGUI | |||
static const int NUM_VALUES = 8; | |||
class CountLine : public Fl_Group | |||
{ | |||
public: | |||
@@ -46,22 +44,24 @@ public: | |||
float GetVal(int n); | |||
void SetLED(bool s) { m_Flasher->value(s); } | |||
virtual int handle(int event); | |||
ChannelHandler *m_GUICH; | |||
private: | |||
Fl_LED_Button *m_Flasher; | |||
Fl_Counter *m_Counter[NUM_VALUES]; | |||
int m_Num; | |||
char m_Count[32]; | |||
}; | |||
class SeqSelectorPluginGUI : public SpiralPluginGUI | |||
{ | |||
public: | |||
SeqSelectorPluginGUI(int w, int h, SeqSelectorPlugin *o,const HostInfo *Info); | |||
virtual void UpdateValues(); | |||
virtual SpiralPlugin* GetPlugin() { return m_Plugin; } | |||
SeqSelectorPluginGUI(int w, int h, SeqSelectorPlugin *o,ChannelHandler *ch,const HostInfo *Info); | |||
SeqSelectorPlugin *m_Plugin; | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
virtual void Update(); | |||
void AddLine(int* Val=NULL); | |||
void RemoveLine(); | |||
@@ -74,6 +74,8 @@ public: | |||
private: | |||
int m_LastLight; | |||
Fl_Pack *m_Main; | |||
Fl_Scroll *m_Scroll; | |||
Fl_Button *m_New; | |||
@@ -65,7 +65,7 @@ void SpiralPluginGUI::Update() | |||
{ | |||
} | |||
const string SpiralPluginGUI::GetHelpText() | |||
const string SpiralPluginGUI::GetHelpText(const string &loc) | |||
{ | |||
return "Help! I need some helptext!!!"; | |||
} | |||
@@ -85,7 +85,7 @@ inline void SpiralPluginGUI::cb_Help_i(Fl_Button* o, void* v) | |||
m_HelpWin = new Fl_Double_Window(w,h,"Help"); | |||
Fl_Multiline_Output* text= new Fl_Multiline_Output(0,0,w,h); | |||
text->value(GetHelpText().c_str()); | |||
text->value(GetHelpText(SpiralInfo::LOCALE).c_str()); | |||
text->textsize(10); | |||
text->set_output(); | |||
m_HelpWin->add(text); | |||
@@ -96,6 +96,7 @@ inline void SpiralPluginGUI::cb_Help_i(Fl_Button* o, void* v) | |||
{ | |||
m_HelpWin->hide(); | |||
delete m_HelpWin; | |||
m_HelpWin=NULL; | |||
} | |||
} | |||
void SpiralPluginGUI::cb_Help(Fl_Button* o, void* v) | |||
@@ -45,7 +45,7 @@ public: | |||
protected: | |||
ChannelHandler *m_GUICH; | |||
virtual const string GetHelpText(); | |||
virtual const string GetHelpText(const string &loc); | |||
private: | |||
Fl_DragBar* m_DragBar; | |||
@@ -52,4 +52,23 @@ inline void XFadePluginGUI::cb_Mix_i(Fl_Slider* o, void* v) | |||
m_GUICH->Set("Mix",o->value()); | |||
} | |||
void XFadePluginGUI::cb_Mix(Fl_Slider* o, void* v) | |||
{ ((XFadePluginGUI*)(o->parent()))->cb_Mix_i(o,v); } | |||
{ ((XFadePluginGUI*)(o->parent()))->cb_Mix_i(o,v); } | |||
const string XFadePluginGUI::GetHelpText(const string &loc) | |||
{ | |||
if (loc=="EN") | |||
{ | |||
return "For mixing stereo inputs like a superstar DJ would."; | |||
} | |||
else if (loc=="FR") | |||
{ | |||
return "FR: For mixing stereo inputs like a superstar DJ would."; | |||
} | |||
else if (loc=="DE") | |||
{ | |||
return "DE: For mixing stereo inputs like a superstar DJ would."; | |||
} | |||
// default to english? | |||
return "DE: For mixing stereo inputs like a superstar DJ would."; | |||
} |
@@ -36,6 +36,9 @@ public: | |||
XFadePluginGUI(int w, int h, XFadePlugin *o,ChannelHandler *ch,const HostInfo *Info); | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
virtual const string GetHelpText(const string &loc); | |||
private: | |||
@@ -57,6 +57,7 @@ void SpiralInfo::StreamInPrefs(istream &s) | |||
char temp[256]; | |||
s>>temp>>temp>>temp; | |||
s>>temp>>temp>>m_Version; | |||
s>>temp>>temp>>LOCALE; | |||
s>>temp>>temp>>BUFSIZE; | |||
s>>temp>>temp>>FRAGSIZE; | |||
s>>temp>>temp>>FRAGCOUNT; | |||
@@ -76,6 +77,7 @@ void SpiralInfo::StreamOutPrefs(ostream &s) | |||
{ | |||
s<<"SpiralSound resource file"<<endl<<endl; | |||
s<<"Version = "<<m_Version<<endl; | |||
s<<"Locale = "<<LOCALE<<endl; | |||
s<<"BufferSize = "<<BUFSIZE<<endl; | |||
s<<"FragmentSize = "<<FRAGSIZE<<endl; | |||
s<<"FragmentCount = "<<FRAGCOUNT<<endl; | |||
@@ -55,6 +55,7 @@ public: | |||
static string MIDIFILE; | |||
static bool REALTIMEOUT; | |||
static int POLY; | |||
static string LOCALE; | |||
//static int GUI_COLOUR; | |||
//static int GUIBG_COLOUR; | |||
@@ -394,8 +394,8 @@ void SynthModular::LoadPlugins(string pluginPath) | |||
int Width = 40; | |||
int Height = 40; | |||
int SWidth = 392; | |||
int SHeight = 187; | |||
int SWidth = 256; | |||
int SHeight = 256; | |||
Fl_Pixmap pic(SSM_xpm); | |||
@@ -20,6 +20,7 @@ | |||
#include "SpiralSynthPluginLocation.h" | |||
#include "FL/fl_draw.h" | |||
string SpiralInfo::LOCALE = "EN"; | |||
int SpiralInfo::BUFSIZE = 512; | |||
int SpiralInfo::FRAGSIZE = 256; | |||
int SpiralInfo::FRAGCOUNT = -1; | |||
@@ -76,7 +77,8 @@ SpiralSynthModularInfo::SpiralSynthModularInfo() | |||
PLUGINVEC.push_back("KeyboardPlugin.so"); | |||
PLUGINVEC.push_back("ControllerPlugin.so"); | |||
PLUGINVEC.push_back("MatrixPlugin.so"); | |||
PLUGINVEC.push_back("PoshSampler.so"); | |||
PLUGINVEC.push_back("SeqSelectorPlugin.so"); | |||
PLUGINVEC.push_back("PoshSamplerPlugin.so"); | |||
PLUGINVEC.push_back("WaveTablePlugin.so"); | |||
PLUGINVEC.push_back("OscillatorPlugin.so"); | |||
PLUGINVEC.push_back("LFOPlugin.so"); | |||
@@ -43,7 +43,7 @@ if test $ac_arg_jack = "Y" ; then | |||
NoteSnapPlugin OscillatorPlugin OutputPlugin RingModPlugin SVFilterPlugin \ | |||
SampleHoldPlugin ScopePlugin SmoothPlugin SplitterPlugin \ | |||
StereoMixerPlugin WaveTablePlugin LADSPAPlugin \ | |||
XFadePlugin JackPlugin PoshSamplerPlugin\ | |||
XFadePlugin JackPlugin PoshSamplerPlugin SeqSelectorPlugin \ | |||
DistributorPlugin LFOPlugin KeyboardPlugin DiskWriterPlugin" | |||
else | |||
PLUGINLIST="AmpPlugin ControllerPlugin DelayPlugin EchoPlugin EnvFollowerPlugin \ | |||
@@ -51,7 +51,7 @@ else | |||
NoteSnapPlugin OscillatorPlugin OutputPlugin RingModPlugin SVFilterPlugin \ | |||
SampleHoldPlugin ScopePlugin SmoothPlugin SplitterPlugin \ | |||
StereoMixerPlugin WaveTablePlugin LADSPAPlugin \ | |||
XFadePlugin PoshSamplerPlugin\ | |||
XFadePlugin PoshSamplerPlugin SeqSelectorPlugin \ | |||
DistributorPlugin LFOPlugin KeyboardPlugin DiskWriterPlugin" | |||
fi | |||
echo "$PLUGINLIST" > SpiralSound/PluginList.txt | |||
@@ -164,6 +164,7 @@ SpiralSound/Plugins/LFOPlugin/Makefile | |||
SpiralSound/Plugins/MeterPlugin/Makefile | |||
SpiralSound/Plugins/KeyboardPlugin/Makefile | |||
SpiralSound/Plugins/DiskWriterPlugin/Makefile | |||
SpiralSound/Plugins/SeqSelectorPlugin/Makefile | |||
Makefile | |||
) | |||