@@ -21,6 +21,8 @@ | |||
#include "SpiralIcon.xpm" | |||
#include "../../NoteTable.h" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() | |||
{ | |||
@@ -32,8 +32,8 @@ public: | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
float GetSensitivity() { return m_Sensitivity; } | |||
@@ -20,6 +20,8 @@ | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
BeatMatchPluginGUI::BeatMatchPluginGUI(int w, int h,BeatMatchPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
@@ -32,7 +32,7 @@ public: | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
Fl_Knob* m_Sense; | |||
@@ -21,6 +21,8 @@ | |||
#include "SpiralIcon.xpm" | |||
#include "../../NoteTable.h" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() | |||
{ | |||
@@ -32,8 +32,8 @@ public: | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
int GetCount() { return m_Count; } | |||
@@ -21,6 +21,8 @@ | |||
#include <FL/fl_draw.H> | |||
#include <stdio.h> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
CounterPluginGUI::CounterPluginGUI(int w, int h,CounterPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
@@ -32,7 +32,7 @@ public: | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
Fl_Input* m_Count; | |||
@@ -34,6 +34,8 @@ | |||
#include <FL/fl_file_chooser.H> | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
static const HostInfo* host; | |||
#define CHECK_AND_REPORT_ERROR if (result<0) \ | |||
@@ -33,8 +33,8 @@ public: | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s) {} | |||
virtual void StreamIn(istream &s) {} | |||
virtual void StreamOut(std::ostream &s) {} | |||
virtual void StreamIn(std::istream &s) {} | |||
enum GUICommands {NONE,OPENWAV,CLOSEWAV,RECORD,STOP}; | |||
struct GUIArgs | |||
@@ -20,6 +20,8 @@ | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_file_chooser.H> | |||
using namespace std; | |||
DiskWriterPluginGUI::DiskWriterPluginGUI(int w, int h, SpiralPlugin *o, ChannelHandler *ch,const HostInfo *Info) : | |||
SpiralPluginGUI(w,h,o,ch) | |||
{ | |||
@@ -32,7 +32,7 @@ public: | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
@@ -20,6 +20,8 @@ | |||
#include <FL/Fl_Button.h> | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() | |||
{ | |||
@@ -31,8 +31,8 @@ public: | |||
virtual PluginInfo& Initialise(const HostInfo *Host); | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void StreamOut(ostream &s) {} | |||
virtual void StreamIn(istream &s) {} | |||
virtual void StreamOut(std::ostream &s) {} | |||
virtual void StreamIn(std::istream &s) {} | |||
private: | |||
bool m_Triggered; | |||
@@ -20,6 +20,8 @@ | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
DistributorPluginGUI::DistributorPluginGUI(int w, int h,DistributorPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
@@ -23,6 +23,8 @@ | |||
#include "JackPluginGUI.h" | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
static const HostInfo* host; | |||
JackClient* JackClient::m_Singleton = NULL; | |||
bool JackClient::m_Attached = false; | |||
@@ -37,18 +37,18 @@ class JackClient | |||
public: | |||
static JackClient *Get() { if(!m_Singleton) m_Singleton=new JackClient; return m_Singleton; } | |||
static void PackUpAndGoHome() { if(m_Singleton) { delete m_Singleton; m_Singleton=NULL; } } | |||
bool Attach(); | |||
void Detach(); | |||
bool IsAttached() { return m_Attached; } | |||
void SetCallback(void(*Run)(void*, bool m),void *Context) { RunCallback=Run; RunContext=Context; } | |||
void GetPortNames(vector<string> &InputNames,vector<string> &OutputNames); | |||
void ConnectInput(int n, const string &JackPort); | |||
void ConnectOutput(int n, const string &JackPort); | |||
void SetCallback(void(*Run)(void*, bool m),void *Context) { RunCallback=Run; RunContext=Context; } | |||
void GetPortNames(std::vector<std::string> &InputNames,std::vector<std::string> &OutputNames); | |||
void ConnectInput(int n, const std::string &JackPort); | |||
void ConnectOutput(int n, const std::string &JackPort); | |||
void DisconnectInput(int n); | |||
void DisconnectOutput(int n); | |||
string GetInputName(int ID) { return m_InputPortMap[ID]->Name; } | |||
string GetOutputName(int ID) { return m_OutputPortMap[ID]->Name; } | |||
std::string GetInputName(int ID) { return m_InputPortMap[ID]->Name; } | |||
std::string GetOutputName(int ID) { return m_OutputPortMap[ID]->Name; } | |||
void SetInputBuf(int ID, float* s); | |||
void SetOutputBuf(int ID, float* s); | |||
@@ -69,17 +69,17 @@ private: | |||
JackPort::JackPort() : | |||
Connected(false),Buf(NULL),Port(NULL) {} | |||
string Name; | |||
std::string Name; | |||
bool Connected; | |||
float* Buf; | |||
jack_port_t* Port; | |||
string ConnectedTo; | |||
std::string ConnectedTo; | |||
}; | |||
static JackClient* m_Singleton; | |||
static jack_client_t* m_Client; | |||
static map<int,JackPort*> m_InputPortMap; | |||
static map<int,JackPort*> m_OutputPortMap; | |||
static std::map<int,JackPort*> m_InputPortMap; | |||
static std::map<int,JackPort*> m_OutputPortMap; | |||
static long unsigned int m_BufferSize; | |||
static long unsigned int m_SampleRate; | |||
static bool m_Attached; | |||
@@ -100,8 +100,8 @@ public: | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s) {} | |||
virtual void StreamIn(istream &s) {} | |||
virtual void StreamOut(std::ostream &s) {} | |||
virtual void StreamIn(std::istream &s) {} | |||
enum GUICommands{NONE,ATTACH,DETACH,CONNECTINPUT,CONNECTOUTPUT,UPDATE_NAMES}; | |||
struct GUIArgs | |||
@@ -121,9 +121,9 @@ private: | |||
void Attach() { JackClient::Get()->Attach(); } | |||
void Detach() { JackClient::Get()->Detach(); } | |||
void GetPortNames(vector<string> &InputNames,vector<string> &OutputNames) { JackClient::Get()->GetPortNames(InputNames,OutputNames); } | |||
void ConnectInput(int n, const string &JackPort) { JackClient::Get()->ConnectInput(n,JackPort); } | |||
void ConnectOutput(int n, const string &JackPort) { JackClient::Get()->ConnectOutput(n,JackPort); } | |||
void GetPortNames(std::vector<std::string> &InputNames,std::vector<std::string> &OutputNames) { JackClient::Get()->GetPortNames(InputNames,OutputNames); } | |||
void ConnectInput(int n, const std::string &JackPort) { JackClient::Get()->ConnectInput(n,JackPort); } | |||
void ConnectOutput(int n, const std::string &JackPort) { JackClient::Get()->ConnectOutput(n,JackPort); } | |||
static int m_RefCount; | |||
static int m_NoExecuted; | |||
@@ -22,6 +22,8 @@ | |||
#include <FL/fl_file_chooser.H> | |||
#include <FL/Fl_Hold_Browser.H> | |||
using namespace std; | |||
static int Numbers[255]; | |||
//////////////////////////////////////////////////////////////////////// | |||
@@ -39,7 +39,7 @@ public: | |||
virtual void Update(); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
@@ -29,6 +29,8 @@ | |||
#include <FL/Fl_Button.h> | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
LowLevelJoystick* LowLevelJoystick::m_Singleton = NULL; | |||
int JoystickPlugin::m_RefCount=0; | |||
int JoystickPlugin::m_NoExecuted=0; | |||
@@ -62,8 +62,8 @@ public: | |||
virtual PluginInfo& Initialise(const HostInfo *Host); | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void StreamOut(ostream &s) {} | |||
virtual void StreamIn(istream &s) {} | |||
virtual void StreamOut(std::ostream &s) {} | |||
virtual void StreamIn(std::istream &s) {} | |||
// has to be defined in the plugin | |||
virtual void UpdateGUI() { Fl::check(); } | |||
@@ -19,6 +19,8 @@ | |||
#include "JoystickPluginGUI.h" | |||
#include <FL/fl_draw.h> | |||
using namespace std; | |||
JoystickPluginGUI::JoystickPluginGUI(int w, int h,JoystickPlugin *o,const HostInfo *Info) : | |||
SpiralPluginGUI(w,h,o) | |||
{ | |||
@@ -21,6 +21,8 @@ | |||
#include "../../NoteTable.h" | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() | |||
{ | |||
@@ -31,8 +31,8 @@ public: | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
enum GUICommands{NONE,NOTE_ON,NOTE_OFF}; | |||
struct GUIArgs | |||
@@ -23,6 +23,8 @@ | |||
#include <FL/Fl_Double_Window.H> | |||
#include <FL/Fl_Scroll.H> | |||
using namespace std; | |||
static int NKEYS = 30; | |||
static char KEYMAP[30]={'z','s','x','d','c','v','g','b','h','n','j','m','q', | |||
'2','w','3','e','r','5','t','6','y','7','u','i','9', | |||
@@ -35,7 +35,7 @@ public: | |||
virtual void Update(); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
int m_Num[NUM_KEYS]; | |||
@@ -37,6 +37,8 @@ | |||
#include "LADSPAPluginGUI.h" | |||
#include "LADSPAInfo.h" | |||
using namespace std; | |||
//////////////////////////////////////////////////// | |||
extern "C" { | |||
@@ -58,8 +58,8 @@ public: | |||
virtual SpiralGUIType *CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
unsigned long GetUniqueID() { return m_UniqueID; } | |||
const char *GetName() { return (const char *)m_Name; } | |||
@@ -105,15 +105,15 @@ private: | |||
void ResetPortSettings(void); | |||
void SetGUIExports(void); | |||
const LADSPA_Descriptor *m_PlugDesc; | |||
vector<LADSPA_Data*> m_LADSPABufVec; | |||
LADSPA_Handle m_PlugInstHandle; | |||
const LADSPA_Descriptor *m_PlugDesc; | |||
std::vector<LADSPA_Data*> m_LADSPABufVec; | |||
LADSPA_Handle m_PlugInstHandle; | |||
vector<int> m_PortID; | |||
vector<float> m_InputPortMin; | |||
vector<float> m_InputPortMax; | |||
vector<bool> m_InputPortClamp; | |||
vector<float> m_InputPortDefault; | |||
std::vector<int> m_PortID; | |||
std::vector<float> m_InputPortMin; | |||
std::vector<float> m_InputPortMax; | |||
std::vector<bool> m_InputPortClamp; | |||
std::vector<float> m_InputPortDefault; | |||
int m_Version; | |||
@@ -31,6 +31,8 @@ | |||
#include "LADSPAPluginGUI.h" | |||
#include "LADSPAInfo.h" | |||
using namespace std; | |||
LADSPAPluginGUI::LADSPAPluginGUI(int w, int h, | |||
LADSPAPlugin *o, | |||
ChannelHandler *ch, | |||
@@ -60,7 +60,7 @@ public: | |||
virtual void Update(void); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
void ClearPlugin(void); | |||
void SelectPlugin(void); | |||
@@ -91,7 +91,7 @@ private: | |||
float ConvertControlValue(unsigned long p, float value); | |||
Fl_Color m_GUIColour; | |||
Fl_Boxtype m_GUIBox; | |||
Fl_Boxtype m_GUIBox; | |||
// Buttons | |||
Fl_Button *m_BKnob; | |||
@@ -21,6 +21,8 @@ | |||
#include <FL/Fl_Button.h> | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() { return new LFOPlugin; } | |||
@@ -32,8 +32,8 @@ class LFOPlugin : public SpiralPlugin { | |||
virtual PluginInfo &Initialise (const HostInfo *Host); | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void StreamOut (ostream &s); | |||
virtual void StreamIn (istream &s); | |||
virtual void StreamOut (std::ostream &s); | |||
virtual void StreamIn (std::istream &s); | |||
//typedef char Type; | |||
enum Type {SINE, TRIANGLE, SQUARE, SAW}; | |||
void WriteWaves(); | |||
@@ -50,11 +50,11 @@ class LFOPlugin : public SpiralPlugin { | |||
float m_Freq; | |||
Sample m_Table[NUM_TABLES]; | |||
int m_TableLength; | |||
friend istream &operator>> (istream &s, LFOPlugin &o); | |||
friend ostream &operator<< (ostream &s, LFOPlugin &o); | |||
friend std::istream &operator>> (std::istream &s, LFOPlugin &o); | |||
friend std::ostream &operator<< (std::ostream &s, LFOPlugin &o); | |||
}; | |||
istream &operator>> (istream &s, LFOPlugin &o); | |||
ostream &operator<< (ostream &s, LFOPlugin &o); | |||
std::istream &operator>> (std::istream &s, LFOPlugin &o); | |||
std::ostream &operator<< (std::ostream &s, LFOPlugin &o); | |||
#endif |
@@ -1,207 +1,209 @@ | |||
/* SpiralPlugin | |||
* Copyleft (C) 2002 Andy Preston <andy@clubunix.co.uk> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "LFOPluginGUI.h" | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
#include "../GUI/WS_Sine.h" | |||
#include "../GUI/WS_Tri.h" | |||
#include "../GUI/WS_Square.h" | |||
#include "../GUI/WS_Saw.h" | |||
LFOPluginGUI::LFOPluginGUI (int w, int h, LFOPlugin *o, ChannelHandler *ch, const HostInfo *Info) : | |||
SpiralPluginGUI (w, h, o, ch), | |||
m_PixmapSine (image_Sine), | |||
m_PixmapTri (image_Tri), | |||
m_PixmapSquare (image_Square), | |||
m_PixmapSaw (image_Saw) { | |||
m_ShapeSine = new Fl_LED_Button (0, 10, 23, 23); | |||
m_ShapeSine->type (FL_RADIO_BUTTON); | |||
m_PixmapSine.label (m_ShapeSine); | |||
m_ShapeSine->set(); | |||
m_ShapeSine->callback ((Fl_Callback*)cb_Sine); | |||
m_ShapeTri = new Fl_LED_Button (0, 31, 23, 23); | |||
m_ShapeTri->type (FL_RADIO_BUTTON); | |||
m_PixmapTri.label (m_ShapeTri); | |||
m_ShapeTri->callback ((Fl_Callback*)cb_Tri); | |||
m_ShapeSquare = new Fl_LED_Button (0, 53, 23, 23); | |||
m_ShapeSquare->type (FL_RADIO_BUTTON); | |||
m_PixmapSquare.label (m_ShapeSquare); | |||
m_ShapeSquare->callback ((Fl_Callback*)cb_Square); | |||
m_ShapeSaw = new Fl_LED_Button (0, 74, 23, 23); | |||
m_ShapeSaw->type (FL_RADIO_BUTTON); | |||
m_PixmapSaw.label (m_ShapeSaw); | |||
m_ShapeSaw->callback ((Fl_Callback*)cb_Saw); | |||
m_TheTabs = new Fl_Tabs (50, 10, 119, 88, ""); | |||
m_TheTabs->box (FL_PLASTIC_DOWN_BOX); | |||
m_TheTabs->color (Info->GUI_COLOUR); | |||
add (m_TheTabs); | |||
m_CtlGroup = new Fl_Group (50, 24, 119, 64, "Control"); | |||
m_CtlGroup->labelsize (10); | |||
m_TheTabs->add (m_CtlGroup); | |||
m_Perd = new Fl_Knob (85, 30, 50, 50, "Period"); | |||
m_Perd->user_data ((void*)(this)); | |||
m_Perd->color (Info->GUI_COLOUR); | |||
m_Perd->type (Fl_Knob::LINELIN); | |||
m_Perd->labelsize (10); | |||
m_Perd->scaleticks (20); | |||
m_Perd->maximum (120); | |||
m_Perd->minimum (0.1); | |||
m_Perd->step (0.001); | |||
m_Perd->value (10); | |||
m_Perd->callback ((Fl_Callback*)cb_Perd); | |||
m_CtlGroup->add (m_Perd); | |||
m_NumGroup = new Fl_Group (50, 24, 119, 64, "Numbers"); | |||
m_NumGroup->labelsize (10); | |||
m_TheTabs->add (m_NumGroup); | |||
m_NumPerd = new Fl_Counter (55, 30, 110, 20, "Period (Secs)"); | |||
m_NumPerd->user_data ((void*)(this)); | |||
m_NumPerd->textsize (10); | |||
m_NumPerd->labelsize (10); | |||
m_NumPerd->box (FL_PLASTIC_UP_BOX); | |||
m_NumPerd->color (Info->GUI_COLOUR); | |||
m_NumPerd->value (m_Perd->value()); | |||
m_NumPerd->step (m_Perd->step()); | |||
m_NumPerd->lstep (0.1); | |||
m_NumPerd->maximum (m_Perd->maximum()); | |||
m_NumPerd->minimum (m_Perd->minimum()); | |||
m_NumPerd->callback ((Fl_Callback*)cb_NumPerd); | |||
m_NumGroup->add (m_NumPerd); | |||
m_NumFreq = new Fl_Counter (55, 64, 110, 20, "Freq (Hz)"); | |||
m_NumFreq->user_data ((void*)(this)); | |||
m_NumFreq->textsize (10); | |||
m_NumFreq->labelsize (10); | |||
m_NumFreq->box (FL_PLASTIC_UP_BOX); | |||
m_NumFreq->color (Info->GUI_COLOUR); | |||
m_NumFreq->value (1 / m_Perd->value()); | |||
m_NumFreq->step (0.001); | |||
m_NumFreq->lstep (0.1); | |||
m_NumFreq->maximum (1 / m_Perd->minimum()); | |||
m_NumFreq->minimum (1 / m_Perd->maximum()); | |||
m_NumFreq->callback ((Fl_Callback*)cb_NumFreq); | |||
m_NumGroup->add (m_NumFreq); | |||
end(); | |||
} | |||
void LFOPluginGUI::UpdateValues (SpiralPlugin *o) { | |||
LFOPlugin* Plugin = (LFOPlugin*)o; | |||
m_ShapeSine->value (0); | |||
m_ShapeTri->value (0); | |||
m_ShapeSquare->value (0); | |||
m_ShapeSaw->value (0); | |||
switch (Plugin->GetType()) { | |||
case LFOPlugin::SINE : m_ShapeSine->value (1); break; | |||
case LFOPlugin::TRIANGLE : m_ShapeTri->value (1); break; | |||
case LFOPlugin::SQUARE : m_ShapeSquare->value (1); break; | |||
case LFOPlugin::SAW : m_ShapeSaw->value (1); break; | |||
} | |||
float x = Plugin->GetFreq(); | |||
m_NumFreq->value (x); | |||
x = 1 / x; | |||
m_Perd->value (x); | |||
m_NumPerd->value (x); | |||
} | |||
// Callbacks for Knob | |||
inline void LFOPluginGUI::cb_Perd_i (Fl_Knob* o, void* v) { | |||
m_NumPerd->value ((double)o->value()); | |||
float f = 1.0f / o->value(); | |||
m_NumFreq->value (f); | |||
m_GUICH->Set ("Freq", f); | |||
} | |||
void LFOPluginGUI::cb_Perd (Fl_Knob* o, void* v) { | |||
((LFOPluginGUI*)(o->user_data()))->cb_Perd_i (o, v); | |||
} | |||
// Callbacks for Counters | |||
inline void LFOPluginGUI::cb_NumPerd_i (Fl_Knob* o, void* v) { | |||
m_Perd->value (o->value()); | |||
float f = 1.0f / o->value(); | |||
m_NumFreq->value (f); | |||
m_GUICH->Set ("Freq", f); | |||
} | |||
void LFOPluginGUI::cb_NumPerd (Fl_Knob* o, void* v) { | |||
((LFOPluginGUI*)(o->user_data()))->cb_NumPerd_i (o, v); | |||
} | |||
inline void LFOPluginGUI::cb_NumFreq_i (Fl_Knob* o, void* v) { | |||
float p = 1.0f / o->value(); | |||
m_Perd->value (p); | |||
m_NumPerd->value (p); | |||
m_GUICH->Set ("Freq", (float)(o->value())); | |||
} | |||
void LFOPluginGUI::cb_NumFreq (Fl_Knob* o, void* v) { | |||
((LFOPluginGUI*)(o->user_data()))->cb_NumFreq_i (o, v); | |||
} | |||
// Callbacks for waveform buttons | |||
inline void LFOPluginGUI::cb_Sine_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set("Type", LFOPlugin::SINE); | |||
} | |||
void LFOPluginGUI::cb_Sine(Fl_LED_Button* o, void* v) { | |||
((LFOPluginGUI*)(o->parent()))->cb_Sine_i (o, v); | |||
} | |||
inline void LFOPluginGUI::cb_Tri_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set("Type", LFOPlugin::TRIANGLE); | |||
} | |||
void LFOPluginGUI::cb_Tri (Fl_LED_Button* o, void* v) { | |||
((LFOPluginGUI*)(o->parent()))->cb_Tri_i (o, v); | |||
} | |||
inline void LFOPluginGUI::cb_Square_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set("Type", LFOPlugin::SQUARE); | |||
} | |||
void LFOPluginGUI::cb_Square (Fl_LED_Button* o, void* v) { | |||
((LFOPluginGUI*)(o->parent()))->cb_Square_i (o, v); | |||
} | |||
inline void LFOPluginGUI::cb_Saw_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set("Type", LFOPlugin::SAW); | |||
} | |||
void LFOPluginGUI::cb_Saw (Fl_LED_Button* o, void* v) { | |||
((LFOPluginGUI*)(o->parent()))->cb_Saw_i (o, v); | |||
} | |||
const string LFOPluginGUI::GetHelpText(const string &loc){ | |||
return string("") | |||
+ "A very low frequency oscillator. Also produces inverted and \"cosine\"\n" | |||
+ "outputs (output phase shifted by 180 degrees)\n" | |||
+ "Period length goes down to 2 minutes :]\n"; | |||
} | |||
/* SpiralPlugin | |||
* Copyleft (C) 2002 Andy Preston <andy@clubunix.co.uk> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "LFOPluginGUI.h" | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
#include "../GUI/WS_Sine.h" | |||
#include "../GUI/WS_Tri.h" | |||
#include "../GUI/WS_Square.h" | |||
#include "../GUI/WS_Saw.h" | |||
using namespace std; | |||
LFOPluginGUI::LFOPluginGUI (int w, int h, LFOPlugin *o, ChannelHandler *ch, const HostInfo *Info) : | |||
SpiralPluginGUI (w, h, o, ch), | |||
m_PixmapSine (image_Sine), | |||
m_PixmapTri (image_Tri), | |||
m_PixmapSquare (image_Square), | |||
m_PixmapSaw (image_Saw) { | |||
m_ShapeSine = new Fl_LED_Button (0, 10, 23, 23); | |||
m_ShapeSine->type (FL_RADIO_BUTTON); | |||
m_PixmapSine.label (m_ShapeSine); | |||
m_ShapeSine->set(); | |||
m_ShapeSine->callback ((Fl_Callback*)cb_Sine); | |||
m_ShapeTri = new Fl_LED_Button (0, 31, 23, 23); | |||
m_ShapeTri->type (FL_RADIO_BUTTON); | |||
m_PixmapTri.label (m_ShapeTri); | |||
m_ShapeTri->callback ((Fl_Callback*)cb_Tri); | |||
m_ShapeSquare = new Fl_LED_Button (0, 53, 23, 23); | |||
m_ShapeSquare->type (FL_RADIO_BUTTON); | |||
m_PixmapSquare.label (m_ShapeSquare); | |||
m_ShapeSquare->callback ((Fl_Callback*)cb_Square); | |||
m_ShapeSaw = new Fl_LED_Button (0, 74, 23, 23); | |||
m_ShapeSaw->type (FL_RADIO_BUTTON); | |||
m_PixmapSaw.label (m_ShapeSaw); | |||
m_ShapeSaw->callback ((Fl_Callback*)cb_Saw); | |||
m_TheTabs = new Fl_Tabs (50, 10, 119, 88, ""); | |||
m_TheTabs->box (FL_PLASTIC_DOWN_BOX); | |||
m_TheTabs->color (Info->GUI_COLOUR); | |||
add (m_TheTabs); | |||
m_CtlGroup = new Fl_Group (50, 24, 119, 64, "Control"); | |||
m_CtlGroup->labelsize (10); | |||
m_TheTabs->add (m_CtlGroup); | |||
m_Perd = new Fl_Knob (85, 30, 50, 50, "Period"); | |||
m_Perd->user_data ((void*)(this)); | |||
m_Perd->color (Info->GUI_COLOUR); | |||
m_Perd->type (Fl_Knob::LINELIN); | |||
m_Perd->labelsize (10); | |||
m_Perd->scaleticks (20); | |||
m_Perd->maximum (120); | |||
m_Perd->minimum (0.1); | |||
m_Perd->step (0.001); | |||
m_Perd->value (10); | |||
m_Perd->callback ((Fl_Callback*)cb_Perd); | |||
m_CtlGroup->add (m_Perd); | |||
m_NumGroup = new Fl_Group (50, 24, 119, 64, "Numbers"); | |||
m_NumGroup->labelsize (10); | |||
m_TheTabs->add (m_NumGroup); | |||
m_NumPerd = new Fl_Counter (55, 30, 110, 20, "Period (Secs)"); | |||
m_NumPerd->user_data ((void*)(this)); | |||
m_NumPerd->textsize (10); | |||
m_NumPerd->labelsize (10); | |||
m_NumPerd->box (FL_PLASTIC_UP_BOX); | |||
m_NumPerd->color (Info->GUI_COLOUR); | |||
m_NumPerd->value (m_Perd->value()); | |||
m_NumPerd->step (m_Perd->step()); | |||
m_NumPerd->lstep (0.1); | |||
m_NumPerd->maximum (m_Perd->maximum()); | |||
m_NumPerd->minimum (m_Perd->minimum()); | |||
m_NumPerd->callback ((Fl_Callback*)cb_NumPerd); | |||
m_NumGroup->add (m_NumPerd); | |||
m_NumFreq = new Fl_Counter (55, 64, 110, 20, "Freq (Hz)"); | |||
m_NumFreq->user_data ((void*)(this)); | |||
m_NumFreq->textsize (10); | |||
m_NumFreq->labelsize (10); | |||
m_NumFreq->box (FL_PLASTIC_UP_BOX); | |||
m_NumFreq->color (Info->GUI_COLOUR); | |||
m_NumFreq->value (1 / m_Perd->value()); | |||
m_NumFreq->step (0.001); | |||
m_NumFreq->lstep (0.1); | |||
m_NumFreq->maximum (1 / m_Perd->minimum()); | |||
m_NumFreq->minimum (1 / m_Perd->maximum()); | |||
m_NumFreq->callback ((Fl_Callback*)cb_NumFreq); | |||
m_NumGroup->add (m_NumFreq); | |||
end(); | |||
} | |||
void LFOPluginGUI::UpdateValues (SpiralPlugin *o) { | |||
LFOPlugin* Plugin = (LFOPlugin*)o; | |||
m_ShapeSine->value (0); | |||
m_ShapeTri->value (0); | |||
m_ShapeSquare->value (0); | |||
m_ShapeSaw->value (0); | |||
switch (Plugin->GetType()) { | |||
case LFOPlugin::SINE : m_ShapeSine->value (1); break; | |||
case LFOPlugin::TRIANGLE : m_ShapeTri->value (1); break; | |||
case LFOPlugin::SQUARE : m_ShapeSquare->value (1); break; | |||
case LFOPlugin::SAW : m_ShapeSaw->value (1); break; | |||
} | |||
float x = Plugin->GetFreq(); | |||
m_NumFreq->value (x); | |||
x = 1 / x; | |||
m_Perd->value (x); | |||
m_NumPerd->value (x); | |||
} | |||
// Callbacks for Knob | |||
inline void LFOPluginGUI::cb_Perd_i (Fl_Knob* o, void* v) { | |||
m_NumPerd->value ((double)o->value()); | |||
float f = 1.0f / o->value(); | |||
m_NumFreq->value (f); | |||
m_GUICH->Set ("Freq", f); | |||
} | |||
void LFOPluginGUI::cb_Perd (Fl_Knob* o, void* v) { | |||
((LFOPluginGUI*)(o->user_data()))->cb_Perd_i (o, v); | |||
} | |||
// Callbacks for Counters | |||
inline void LFOPluginGUI::cb_NumPerd_i (Fl_Knob* o, void* v) { | |||
m_Perd->value (o->value()); | |||
float f = 1.0f / o->value(); | |||
m_NumFreq->value (f); | |||
m_GUICH->Set ("Freq", f); | |||
} | |||
void LFOPluginGUI::cb_NumPerd (Fl_Knob* o, void* v) { | |||
((LFOPluginGUI*)(o->user_data()))->cb_NumPerd_i (o, v); | |||
} | |||
inline void LFOPluginGUI::cb_NumFreq_i (Fl_Knob* o, void* v) { | |||
float p = 1.0f / o->value(); | |||
m_Perd->value (p); | |||
m_NumPerd->value (p); | |||
m_GUICH->Set ("Freq", (float)(o->value())); | |||
} | |||
void LFOPluginGUI::cb_NumFreq (Fl_Knob* o, void* v) { | |||
((LFOPluginGUI*)(o->user_data()))->cb_NumFreq_i (o, v); | |||
} | |||
// Callbacks for waveform buttons | |||
inline void LFOPluginGUI::cb_Sine_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set("Type", LFOPlugin::SINE); | |||
} | |||
void LFOPluginGUI::cb_Sine(Fl_LED_Button* o, void* v) { | |||
((LFOPluginGUI*)(o->parent()))->cb_Sine_i (o, v); | |||
} | |||
inline void LFOPluginGUI::cb_Tri_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set("Type", LFOPlugin::TRIANGLE); | |||
} | |||
void LFOPluginGUI::cb_Tri (Fl_LED_Button* o, void* v) { | |||
((LFOPluginGUI*)(o->parent()))->cb_Tri_i (o, v); | |||
} | |||
inline void LFOPluginGUI::cb_Square_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set("Type", LFOPlugin::SQUARE); | |||
} | |||
void LFOPluginGUI::cb_Square (Fl_LED_Button* o, void* v) { | |||
((LFOPluginGUI*)(o->parent()))->cb_Square_i (o, v); | |||
} | |||
inline void LFOPluginGUI::cb_Saw_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set("Type", LFOPlugin::SAW); | |||
} | |||
void LFOPluginGUI::cb_Saw (Fl_LED_Button* o, void* v) { | |||
((LFOPluginGUI*)(o->parent()))->cb_Saw_i (o, v); | |||
} | |||
const string LFOPluginGUI::GetHelpText(const string &loc){ | |||
return string("") | |||
+ "A very low frequency oscillator. Also produces inverted and \"cosine\"\n" | |||
+ "outputs (output phase shifted by 180 degrees)\n" | |||
+ "Period length goes down to 2 minutes :]\n"; | |||
} |
@@ -1,60 +1,60 @@ | |||
/* SpiralPlugin | |||
* Copyleft (C) 2002 Andy Preston <andy@clubunix.co.uk> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#ifndef LFO_GUI_H | |||
#define LFO_GUI_H | |||
#include <FL/Fl_Pixmap.H> | |||
#include <FL/Fl_Tabs.H> | |||
#include <FL/Fl_Counter.H> | |||
#include "../Widgets/Fl_Knob.H" | |||
#include "../Widgets/Fl_LED_Button.H" | |||
#include "../SpiralPluginGUI.h" | |||
#include "LFOPlugin.h" | |||
class LFOPluginGUI : public SpiralPluginGUI { | |||
public: | |||
LFOPluginGUI (int w, int h, LFOPlugin *o, ChannelHandler *ch, const HostInfo *Info); | |||
virtual void UpdateValues (SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText (const string &loc); | |||
private: | |||
Fl_Tabs *m_TheTabs; | |||
Fl_Group *m_CtlGroup, *m_NumGroup; | |||
Fl_LED_Button *m_ShapeSine, *m_ShapeTri, *m_ShapeSquare, *m_ShapeSaw; | |||
Fl_Pixmap m_PixmapSine, m_PixmapTri, m_PixmapSquare, m_PixmapSaw; | |||
Fl_Knob *m_Perd; | |||
Fl_Counter *m_NumFreq, *m_NumPerd; | |||
// callbacks | |||
inline void cb_Perd_i (Fl_Knob *o, void *v); | |||
static void cb_Perd (Fl_Knob *o, void *v); | |||
inline void cb_NumFreq_i (Fl_Knob *o, void *v); | |||
static void cb_NumFreq (Fl_Knob *o, void *v); | |||
inline void cb_NumPerd_i (Fl_Knob *o, void *v); | |||
static void cb_NumPerd (Fl_Knob *o, void *v); | |||
inline void cb_Sine_i (Fl_LED_Button *o, void *v); | |||
static void cb_Sine (Fl_LED_Button *o, void *v); | |||
inline void cb_Tri_i (Fl_LED_Button *o, void *v); | |||
static void cb_Tri (Fl_LED_Button *o, void *v); | |||
inline void cb_Square_i (Fl_LED_Button *o, void *v); | |||
static void cb_Square (Fl_LED_Button *o, void *v); | |||
inline void cb_Saw_i (Fl_LED_Button *o, void *v); | |||
static void cb_Saw (Fl_LED_Button *o, void *v); | |||
}; | |||
#endif | |||
/* SpiralPlugin | |||
* Copyleft (C) 2002 Andy Preston <andy@clubunix.co.uk> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#ifndef LFO_GUI_H | |||
#define LFO_GUI_H | |||
#include <FL/Fl_Pixmap.H> | |||
#include <FL/Fl_Tabs.H> | |||
#include <FL/Fl_Counter.H> | |||
#include "../Widgets/Fl_Knob.H" | |||
#include "../Widgets/Fl_LED_Button.H" | |||
#include "../SpiralPluginGUI.h" | |||
#include "LFOPlugin.h" | |||
class LFOPluginGUI : public SpiralPluginGUI { | |||
public: | |||
LFOPluginGUI (int w, int h, LFOPlugin *o, ChannelHandler *ch, const HostInfo *Info); | |||
virtual void UpdateValues (SpiralPlugin *o); | |||
protected: | |||
const std::string GetHelpText (const std::string &loc); | |||
private: | |||
Fl_Tabs *m_TheTabs; | |||
Fl_Group *m_CtlGroup, *m_NumGroup; | |||
Fl_LED_Button *m_ShapeSine, *m_ShapeTri, *m_ShapeSquare, *m_ShapeSaw; | |||
Fl_Pixmap m_PixmapSine, m_PixmapTri, m_PixmapSquare, m_PixmapSaw; | |||
Fl_Knob *m_Perd; | |||
Fl_Counter *m_NumFreq, *m_NumPerd; | |||
// callbacks | |||
inline void cb_Perd_i (Fl_Knob *o, void *v); | |||
static void cb_Perd (Fl_Knob *o, void *v); | |||
inline void cb_NumFreq_i (Fl_Knob *o, void *v); | |||
static void cb_NumFreq (Fl_Knob *o, void *v); | |||
inline void cb_NumPerd_i (Fl_Knob *o, void *v); | |||
static void cb_NumPerd (Fl_Knob *o, void *v); | |||
inline void cb_Sine_i (Fl_LED_Button *o, void *v); | |||
static void cb_Sine (Fl_LED_Button *o, void *v); | |||
inline void cb_Tri_i (Fl_LED_Button *o, void *v); | |||
static void cb_Tri (Fl_LED_Button *o, void *v); | |||
inline void cb_Square_i (Fl_LED_Button *o, void *v); | |||
static void cb_Square (Fl_LED_Button *o, void *v); | |||
inline void cb_Saw_i (Fl_LED_Button *o, void *v); | |||
static void cb_Saw (Fl_LED_Button *o, void *v); | |||
}; | |||
#endif |
@@ -22,6 +22,8 @@ | |||
#include "SpiralIcon.xpm" | |||
#include "../../NoteTable.h" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() | |||
{ | |||
@@ -32,8 +32,8 @@ public: | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
enum OperatorType{NONE,AND,OR,NOT,NAND,NOR,XOR,XNOR}; | |||
@@ -21,6 +21,8 @@ | |||
#include <FL/fl_draw.H> | |||
#include <stdio.h> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
LogicPluginGUI::LogicPluginGUI(int w, int h,LogicPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
@@ -33,7 +33,7 @@ public: | |||
LogicPluginGUI(int w, int h, LogicPlugin *o,ChannelHandler *ch,const HostInfo *Info); | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
Fl_Counter *m_Inputs; | |||
Fl_Button *m_AND,*m_OR,*m_NOT,*m_NAND,*m_NOR,*m_XOR,*m_XNOR; | |||
@@ -23,6 +23,8 @@ | |||
#define PI 3.141592654 | |||
using namespace std; | |||
float RandRange(float L, float H) | |||
{ | |||
return ((rand()%10000/10000.0f)*(H-L))+L; | |||
@@ -33,8 +33,8 @@ public: | |||
virtual PluginInfo &Initialise(const HostInfo *Host); | |||
virtual SpiralGUIType *CreateGUI(); | |||
virtual void Execute(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
// has to be defined in the plugin | |||
virtual void UpdateGUI() { Fl::check(); } | |||
@@ -63,12 +63,12 @@ private: | |||
int Grain; | |||
}; | |||
vector<GrainDesc> m_OverlapVec; | |||
std::vector<GrainDesc> m_OverlapVec; | |||
friend istream &operator>>(istream &s, MasherPlugin &o); | |||
friend ostream &operator<<(ostream &s, MasherPlugin &o); | |||
friend std::istream &operator>>(std::istream &s, MasherPlugin &o); | |||
friend std::ostream &operator<<(std::ostream &s, MasherPlugin &o); | |||
}; | |||
istream &operator>>(istream &s, MasherPlugin &o); | |||
ostream &operator<<(ostream &s, MasherPlugin &o); | |||
std::istream &operator>>(std::istream &s, MasherPlugin &o); | |||
std::ostream &operator<<(std::ostream &s, MasherPlugin &o); | |||
#endif |
@@ -1,121 +1,123 @@ | |||
/* SpiralPlugin | |||
* Copyleft (C) 2000 David Griffiths <dave@pawfal.org> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "MasherPluginGUI.h" | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
//////////////////////////////////////////// | |||
MasherPluginGUI::MasherPluginGUI(int w, int h,MasherPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
SpiralPluginGUI(w,h,o,ch) | |||
{ | |||
m_Plugin=o; | |||
m_Pitch = new Fl_Knob (5, 20, 40, 40, "GrainPitch"); | |||
m_Pitch->type(Fl_Knob::DOTLIN); | |||
m_Pitch->color(Info->GUI_COLOUR); | |||
m_Pitch->labelsize(10); | |||
m_Pitch->maximum(5); | |||
m_Pitch->step(0.001); | |||
m_Pitch->value(1); | |||
m_Pitch->callback((Fl_Callback*)cb_Pitch); | |||
m_Random = new Fl_Knob (70, 20, 40, 40, "Randomness"); | |||
m_Random->type(Fl_Knob::DOTLIN); | |||
m_Random->color(Info->GUI_COLOUR); | |||
m_Random->labelsize(10); | |||
m_Random->maximum(100); | |||
m_Random->step(1); | |||
m_Random->value(1); | |||
m_Random->callback((Fl_Callback*)cb_Random); | |||
m_GrainStoreSize = new Fl_Knob (5, 80, 40, 40, "Num Grains"); | |||
m_GrainStoreSize->type(Fl_Knob::DOTLIN); | |||
m_GrainStoreSize->color(Info->GUI_COLOUR); | |||
m_GrainStoreSize->labelsize(10); | |||
m_GrainStoreSize->maximum(MAX_GRAINSTORE_SIZE-2); | |||
m_GrainStoreSize->step(1); | |||
m_GrainStoreSize->value(1); | |||
m_GrainStoreSize->callback((Fl_Callback*)cb_GrainStoreSize); | |||
m_Density = new Fl_Knob (70, 80, 40, 40, "Density"); | |||
m_Density->type(Fl_Knob::DOTLIN); | |||
m_Density->color(Info->GUI_COLOUR); | |||
m_Density->labelsize(10); | |||
m_Density->maximum(MAX_GRAINSTORE_SIZE); | |||
m_Density->step(1); | |||
m_Density->value(1); | |||
m_Density->callback((Fl_Callback*)cb_Density); | |||
end(); | |||
} | |||
extern "C" int sprintf(char *,const char *,...); | |||
void MasherPluginGUI::UpdateValues(SpiralPlugin *o) | |||
{ | |||
MasherPlugin* Plugin = (MasherPlugin*)o; | |||
m_Pitch->value(Plugin->GetGrainPitch()); | |||
m_Random->value(Plugin->GetRandomness()); | |||
m_GrainStoreSize->value(Plugin->GetGrainStoreSize()); | |||
m_Density->value(Plugin->GetDensity()); | |||
} | |||
inline void MasherPluginGUI::cb_Random_i(Fl_Knob* o, void* v) | |||
{ | |||
m_GUICH->Set("Randomness",(int)o->value()); | |||
} | |||
void MasherPluginGUI::cb_Random(Fl_Knob* o, void* v) | |||
{ ((MasherPluginGUI*)(o->parent()))->cb_Random_i(o,v); } | |||
inline void MasherPluginGUI::cb_Pitch_i(Fl_Knob* o, void* v) | |||
{ | |||
m_GUICH->Set("GrainPitch",(float)o->value()); | |||
} | |||
void MasherPluginGUI::cb_Pitch(Fl_Knob* o, void* v) | |||
{ ((MasherPluginGUI*)(o->parent()))->cb_Pitch_i(o,v); } | |||
inline void MasherPluginGUI::cb_MinGrainSize_i(Fl_Knob* o, void* v) | |||
{ | |||
m_GUICH->Set("Period",(int)o->value()+1); | |||
} | |||
void MasherPluginGUI::cb_MinGrainSize(Fl_Knob* o, void* v) | |||
{ ((MasherPluginGUI*)(o->parent()))->cb_MinGrainSize_i(o,v); } | |||
inline void MasherPluginGUI::cb_GrainStoreSize_i(Fl_Knob* o, void* v) | |||
{ | |||
m_GUICH->Set("GrainStoreSize",(int)o->value()+1); | |||
} | |||
void MasherPluginGUI::cb_GrainStoreSize(Fl_Knob* o, void* v) | |||
{ ((MasherPluginGUI*)(o->parent()))->cb_GrainStoreSize_i(o,v); } | |||
inline void MasherPluginGUI::cb_Density_i(Fl_Knob* o, void* v) | |||
{ | |||
m_GUICH->Set("Density",(int)o->value()); | |||
} | |||
void MasherPluginGUI::cb_Density(Fl_Knob* o, void* v) | |||
{ ((MasherPluginGUI*)(o->parent()))->cb_Density_i(o,v); } | |||
const string MasherPluginGUI::GetHelpText(const string &loc){ | |||
return string("") | |||
+ "Top secret sample masher plugin. Granulates the incoming stream and\n" | |||
+ "carries out various patented algorithms on the result.\n\n" | |||
+ "Truth is I don't really know how it works, but makes sounds like\n" | |||
+ "tttttthhhIIiissssSSSSSSsssssSsSSsS."; | |||
} | |||
/* SpiralPlugin | |||
* Copyleft (C) 2000 David Griffiths <dave@pawfal.org> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "MasherPluginGUI.h" | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
MasherPluginGUI::MasherPluginGUI(int w, int h,MasherPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
SpiralPluginGUI(w,h,o,ch) | |||
{ | |||
m_Plugin=o; | |||
m_Pitch = new Fl_Knob (5, 20, 40, 40, "GrainPitch"); | |||
m_Pitch->type(Fl_Knob::DOTLIN); | |||
m_Pitch->color(Info->GUI_COLOUR); | |||
m_Pitch->labelsize(10); | |||
m_Pitch->maximum(5); | |||
m_Pitch->step(0.001); | |||
m_Pitch->value(1); | |||
m_Pitch->callback((Fl_Callback*)cb_Pitch); | |||
m_Random = new Fl_Knob (70, 20, 40, 40, "Randomness"); | |||
m_Random->type(Fl_Knob::DOTLIN); | |||
m_Random->color(Info->GUI_COLOUR); | |||
m_Random->labelsize(10); | |||
m_Random->maximum(100); | |||
m_Random->step(1); | |||
m_Random->value(1); | |||
m_Random->callback((Fl_Callback*)cb_Random); | |||
m_GrainStoreSize = new Fl_Knob (5, 80, 40, 40, "Num Grains"); | |||
m_GrainStoreSize->type(Fl_Knob::DOTLIN); | |||
m_GrainStoreSize->color(Info->GUI_COLOUR); | |||
m_GrainStoreSize->labelsize(10); | |||
m_GrainStoreSize->maximum(MAX_GRAINSTORE_SIZE-2); | |||
m_GrainStoreSize->step(1); | |||
m_GrainStoreSize->value(1); | |||
m_GrainStoreSize->callback((Fl_Callback*)cb_GrainStoreSize); | |||
m_Density = new Fl_Knob (70, 80, 40, 40, "Density"); | |||
m_Density->type(Fl_Knob::DOTLIN); | |||
m_Density->color(Info->GUI_COLOUR); | |||
m_Density->labelsize(10); | |||
m_Density->maximum(MAX_GRAINSTORE_SIZE); | |||
m_Density->step(1); | |||
m_Density->value(1); | |||
m_Density->callback((Fl_Callback*)cb_Density); | |||
end(); | |||
} | |||
extern "C" int sprintf(char *,const char *,...); | |||
void MasherPluginGUI::UpdateValues(SpiralPlugin *o) | |||
{ | |||
MasherPlugin* Plugin = (MasherPlugin*)o; | |||
m_Pitch->value(Plugin->GetGrainPitch()); | |||
m_Random->value(Plugin->GetRandomness()); | |||
m_GrainStoreSize->value(Plugin->GetGrainStoreSize()); | |||
m_Density->value(Plugin->GetDensity()); | |||
} | |||
inline void MasherPluginGUI::cb_Random_i(Fl_Knob* o, void* v) | |||
{ | |||
m_GUICH->Set("Randomness",(int)o->value()); | |||
} | |||
void MasherPluginGUI::cb_Random(Fl_Knob* o, void* v) | |||
{ ((MasherPluginGUI*)(o->parent()))->cb_Random_i(o,v); } | |||
inline void MasherPluginGUI::cb_Pitch_i(Fl_Knob* o, void* v) | |||
{ | |||
m_GUICH->Set("GrainPitch",(float)o->value()); | |||
} | |||
void MasherPluginGUI::cb_Pitch(Fl_Knob* o, void* v) | |||
{ ((MasherPluginGUI*)(o->parent()))->cb_Pitch_i(o,v); } | |||
inline void MasherPluginGUI::cb_MinGrainSize_i(Fl_Knob* o, void* v) | |||
{ | |||
m_GUICH->Set("Period",(int)o->value()+1); | |||
} | |||
void MasherPluginGUI::cb_MinGrainSize(Fl_Knob* o, void* v) | |||
{ ((MasherPluginGUI*)(o->parent()))->cb_MinGrainSize_i(o,v); } | |||
inline void MasherPluginGUI::cb_GrainStoreSize_i(Fl_Knob* o, void* v) | |||
{ | |||
m_GUICH->Set("GrainStoreSize",(int)o->value()+1); | |||
} | |||
void MasherPluginGUI::cb_GrainStoreSize(Fl_Knob* o, void* v) | |||
{ ((MasherPluginGUI*)(o->parent()))->cb_GrainStoreSize_i(o,v); } | |||
inline void MasherPluginGUI::cb_Density_i(Fl_Knob* o, void* v) | |||
{ | |||
m_GUICH->Set("Density",(int)o->value()); | |||
} | |||
void MasherPluginGUI::cb_Density(Fl_Knob* o, void* v) | |||
{ ((MasherPluginGUI*)(o->parent()))->cb_Density_i(o,v); } | |||
const string MasherPluginGUI::GetHelpText(const string &loc){ | |||
return string("") | |||
+ "Top secret sample masher plugin. Granulates the incoming stream and\n" | |||
+ "carries out various patented algorithms on the result.\n\n" | |||
+ "Truth is I don't really know how it works, but makes sounds like\n" | |||
+ "tttttthhhIIiissssSSSSSSsssssSsSSsS."; | |||
} |
@@ -1,61 +1,61 @@ | |||
/* SpiralPlugin | |||
* Copyleft (C) 2000 David Griffiths <dave@pawfal.org> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include <FL/Fl.H> | |||
#include "../Widgets/Fl_Knob.H" | |||
#include "MasherPlugin.h" | |||
#include "../SpiralPluginGUI.h" | |||
#ifndef MASHER_GUI_H | |||
#define MASHER_GUI_H | |||
class MasherPluginGUI : public SpiralPluginGUI | |||
{ | |||
public: | |||
MasherPluginGUI(int w, int h, MasherPlugin *o,ChannelHandler *ch,const HostInfo *Info); | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
virtual SpiralPlugin* GetPlugin() { return m_Plugin; } | |||
MasherPlugin *m_Plugin; | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
private: | |||
Fl_Knob *m_Random; | |||
Fl_Knob *m_Pitch; | |||
Fl_Knob *m_GrainStoreSize; | |||
Fl_Knob *m_Density; | |||
//// Callbacks //// | |||
inline void cb_Random_i(Fl_Knob* o, void* v); | |||
static void cb_Random(Fl_Knob*, void*); | |||
inline void cb_Pitch_i(Fl_Knob* o, void* v); | |||
static void cb_Pitch(Fl_Knob*, void*); | |||
inline void cb_MinGrainSize_i(Fl_Knob* o, void* v); | |||
static void cb_MinGrainSize(Fl_Knob*, void*); | |||
inline void cb_GrainStoreSize_i(Fl_Knob* o, void* v); | |||
static void cb_GrainStoreSize(Fl_Knob*, void*); | |||
inline void cb_Density_i(Fl_Knob* o, void* v); | |||
static void cb_Density(Fl_Knob*, void*); | |||
}; | |||
#endif | |||
/* SpiralPlugin | |||
* Copyleft (C) 2000 David Griffiths <dave@pawfal.org> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include <FL/Fl.H> | |||
#include "../Widgets/Fl_Knob.H" | |||
#include "MasherPlugin.h" | |||
#include "../SpiralPluginGUI.h" | |||
#ifndef MASHER_GUI_H | |||
#define MASHER_GUI_H | |||
class MasherPluginGUI : public SpiralPluginGUI | |||
{ | |||
public: | |||
MasherPluginGUI(int w, int h, MasherPlugin *o,ChannelHandler *ch,const HostInfo *Info); | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
virtual SpiralPlugin* GetPlugin() { return m_Plugin; } | |||
MasherPlugin *m_Plugin; | |||
protected: | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
Fl_Knob *m_Random; | |||
Fl_Knob *m_Pitch; | |||
Fl_Knob *m_GrainStoreSize; | |||
Fl_Knob *m_Density; | |||
//// Callbacks //// | |||
inline void cb_Random_i(Fl_Knob* o, void* v); | |||
static void cb_Random(Fl_Knob*, void*); | |||
inline void cb_Pitch_i(Fl_Knob* o, void* v); | |||
static void cb_Pitch(Fl_Knob*, void*); | |||
inline void cb_MinGrainSize_i(Fl_Knob* o, void* v); | |||
static void cb_MinGrainSize(Fl_Knob*, void*); | |||
inline void cb_GrainStoreSize_i(Fl_Knob* o, void* v); | |||
static void cb_GrainStoreSize(Fl_Knob*, void*); | |||
inline void cb_Density_i(Fl_Knob* o, void* v); | |||
static void cb_Density(Fl_Knob*, void*); | |||
}; | |||
#endif |
@@ -19,6 +19,8 @@ | |||
#include "MeterPluginGUI.h" | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() { return new MeterPlugin; } | |||
@@ -29,8 +29,8 @@ class MeterPlugin : public SpiralPlugin { | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut (ostream &s); | |||
virtual void StreamIn (istream &s); | |||
virtual void StreamOut (std::ostream &s); | |||
virtual void StreamIn (std::istream &s); | |||
int GetVUMode (void) { return m_VUMode; } | |||
enum GUICommands {NONE, SETVU, SETMM}; | |||
private: | |||
@@ -19,6 +19,8 @@ | |||
#include "MeterPluginGUI.h" | |||
#include <stdio.h> | |||
using namespace std; | |||
char label_buf[10]; | |||
MeterPluginGUI::MeterPluginGUI (int w, int h, MeterPlugin *o, ChannelHandler *ch, const HostInfo *Info) : | |||
@@ -34,7 +34,7 @@ class MeterPluginGUI : public SpiralPluginGUI { | |||
virtual void Update (); | |||
virtual void draw (); | |||
protected: | |||
const string GetHelpText (const string &loc); | |||
const std::string GetHelpText (const std::string &loc); | |||
private: | |||
bool m_Bypass; | |||
float *m_Data, m_Min, m_Max; | |||
@@ -23,6 +23,8 @@ | |||
#include "../../Midi.h" | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
int MidiPlugin::m_RefCount = 0; | |||
extern "C" { | |||
@@ -32,8 +32,8 @@ public: | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
// has to be defined in the plugin | |||
virtual void UpdateGUI() { Fl::check(); } | |||
@@ -52,7 +52,7 @@ public: | |||
private: | |||
GUIArgs m_GUIArgs; | |||
void AddControl(int s,const string &Name); | |||
void AddControl(int s,const std::string &Name); | |||
void DeleteControl(); | |||
int m_DeviceNum; | |||
@@ -69,7 +69,7 @@ private: | |||
static int m_RefCount; | |||
vector<int> m_ControlList; | |||
std::vector<int> m_ControlList; | |||
}; | |||
#endif |
@@ -22,6 +22,8 @@ | |||
#include <FL/Fl_Hold_Browser.H> | |||
#include <FL/Fl_Double_Window.H> | |||
using namespace std; | |||
//////////////////////////////////////////////////////////////////////// | |||
int OptionsList(const vector<string> &List) | |||
@@ -25,7 +25,7 @@ | |||
#ifndef MIDIGUI | |||
#define MIDIGUI | |||
int OptionsList(const vector<string> &List); | |||
int OptionsList(const std::vector<std::string> &List); | |||
class MidiPluginGUI : public SpiralPluginGUI | |||
{ | |||
@@ -35,7 +35,7 @@ public: | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
@@ -21,6 +21,8 @@ | |||
#include <stdio.h> | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance () { return new MixSwitchPlugin; } | |||
@@ -30,8 +30,8 @@ class MixSwitchPlugin : public SpiralPlugin { | |||
virtual SpiralGUIType* CreateGUI (); | |||
virtual void Execute (); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut (ostream &s); | |||
virtual void StreamIn (istream &s); | |||
virtual void StreamOut (std::ostream &s); | |||
virtual void StreamIn (std::istream &s); | |||
int GetSwitch (void) { return m_SwitchPos + 1; } | |||
int GetChans (void) { return m_PluginInfo.NumInputs - 2; } | |||
enum GUICommands {NONE, SETCHANS}; | |||
@@ -46,11 +46,11 @@ class MixSwitchPlugin : public SpiralPlugin { | |||
int m_SwitchPos; | |||
bool m_Triggered; | |||
void CreatePorts (int n = 2, bool AddPorts = false); | |||
friend istream &operator>> (istream &s, MixSwitchPlugin &o); | |||
friend ostream &operator<< (ostream &s, MixSwitchPlugin &o); | |||
friend std::istream &operator>> (std::istream &s, MixSwitchPlugin &o); | |||
friend std::ostream &operator<< (std::ostream &s, MixSwitchPlugin &o); | |||
}; | |||
istream &operator>> (istream &s, MixSwitchPlugin &o); | |||
ostream &operator<< (ostream &s, MixSwitchPlugin &o); | |||
std::istream &operator>> (std::istream &s, MixSwitchPlugin &o); | |||
std::ostream &operator<< (std::ostream &s, MixSwitchPlugin &o); | |||
#endif |
@@ -22,6 +22,8 @@ | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
MixSwitchPluginGUI::MixSwitchPluginGUI (int w, int h, MixSwitchPlugin *o, ChannelHandler *ch, const HostInfo *Info) : | |||
@@ -30,7 +30,7 @@ class MixSwitchPluginGUI : public SpiralPluginGUI { | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
virtual void Update(); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
Fl_Counter *m_Switch, *m_Chans; | |||
inline void cb_Switch_i (Fl_Counter* o, void* v); | |||
@@ -22,6 +22,8 @@ | |||
#include <FL/Fl_Button.h> | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() { | |||
@@ -31,8 +31,8 @@ class MixerPlugin : public SpiralPlugin { | |||
virtual SpiralGUIType *CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
// has to be defined in the plugin | |||
virtual void UpdateGUI() { Fl::check(); } | |||
enum GUICommands { NONE, SETCH, SETNUM }; | |||
@@ -20,6 +20,8 @@ | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
MixerPluginGUI::MixerPluginGUI (int w, int h, MixerPlugin *o, ChannelHandler *ch, const HostInfo *Info) : | |||
@@ -34,11 +34,11 @@ class MixerPluginGUI : public SpiralPluginGUI { | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
virtual void Update (); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
void AddChan (bool SendData = false, bool ResizeIt = false); | |||
void DeleteChan (bool SendData = true); | |||
vector<Fl_Slider*> m_SlidVec; | |||
std::vector<Fl_Slider*> m_SlidVec; | |||
Fl_Pack *m_MainPack, *m_Buttons; | |||
Fl_Button *m_Add, *m_Delete; | |||
Fl_LED_Button *m_PeakInd; | |||
@@ -23,6 +23,8 @@ | |||
#define PI 3.141592654 | |||
using namespace std; | |||
static const int GRANULARITY = 10; | |||
extern "C" { | |||
@@ -31,8 +31,8 @@ public: | |||
virtual PluginInfo &Initialise(const HostInfo *Host); | |||
virtual SpiralGUIType *CreateGUI(); | |||
virtual void Execute(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
float GetCutoff() { return Cutoff; } | |||
float GetResonance() { return Resonance; } | |||
@@ -49,10 +49,10 @@ private: | |||
float in1,in2,in3,in4,out1,out2,out3,out4; | |||
friend istream &operator>>(istream &s, MoogFilterPlugin &o); | |||
friend ostream &operator<<(ostream &s, MoogFilterPlugin &o); | |||
friend std::istream &operator>>(std::istream &s, MoogFilterPlugin &o); | |||
friend std::ostream &operator<<(std::ostream &s, MoogFilterPlugin &o); | |||
}; | |||
istream &operator>>(istream &s, MoogFilterPlugin &o); | |||
ostream &operator<<(ostream &s, MoogFilterPlugin &o); | |||
std::istream &operator>>(std::istream &s, MoogFilterPlugin &o); | |||
std::ostream &operator<<(std::ostream &s, MoogFilterPlugin &o); | |||
#endif |
@@ -20,6 +20,8 @@ | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
MoogFilterPluginGUI::MoogFilterPluginGUI(int w, int h,MoogFilterPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
@@ -33,7 +33,7 @@ public: | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
Fl_Slider *Cutoff; | |||
@@ -21,6 +21,8 @@ | |||
#include <limits.h> | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() | |||
{ | |||
@@ -31,8 +31,8 @@ public: | |||
virtual PluginInfo &Initialise(const HostInfo *Host); | |||
virtual SpiralGUIType *CreateGUI(); | |||
virtual void Execute(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
enum Type {WHITE,PINK}; | |||
Type GetType() {return m_Type;} | |||
@@ -1,71 +1,73 @@ | |||
/* SpiralPlugin | |||
* Copyleft (C) 2000 David Griffiths <dave@pawfal.org> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "NoisePluginGUI.h" | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
NoisePluginGUI::NoisePluginGUI(int w, int h,NoisePlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
SpiralPluginGUI(w,h,o,ch) | |||
{ | |||
White = new Fl_LED_Button (15, 12, 55, 20, "White"); | |||
White->type (FL_RADIO_BUTTON); | |||
White->labelsize (10); | |||
White->set (); | |||
White->callback ((Fl_Callback*)cb_White); | |||
Pink = new Fl_LED_Button (15, 34, 55, 20, "Pink"); | |||
Pink->type (FL_RADIO_BUTTON); | |||
Pink->labelsize (10); | |||
Pink->callback ((Fl_Callback*)cb_Pink); | |||
end(); | |||
} | |||
void NoisePluginGUI::UpdateValues(SpiralPlugin *o) | |||
{ | |||
NoisePlugin *Plugin = (NoisePlugin*)o; | |||
switch (Plugin->GetType()) | |||
{ | |||
case NoisePlugin::WHITE : White->value(1); break; | |||
case NoisePlugin::PINK : Pink->value(1); break; | |||
} | |||
} | |||
//// Callbacks //// | |||
inline void NoisePluginGUI::cb_White_i(Fl_LED_Button* o, void* v) | |||
{ m_GUICH->Set("Type",(char)NoisePlugin::WHITE); } | |||
void NoisePluginGUI::cb_White(Fl_LED_Button* o, void* v) | |||
{ ((NoisePluginGUI*)(o->parent()))->cb_White_i(o,v); } | |||
inline void NoisePluginGUI::cb_Pink_i(Fl_LED_Button* o, void* v) | |||
{ m_GUICH->Set("Type",(char)NoisePlugin::PINK); } | |||
void NoisePluginGUI::cb_Pink(Fl_LED_Button* o, void* v) | |||
{ ((NoisePluginGUI*)(o->parent()))->cb_Pink_i(o,v); } | |||
const string NoisePluginGUI::GetHelpText(const string &loc){ | |||
return string("") | |||
+ "Makes noise, white noise is just raw randomness, pink noise\n" | |||
+ "is white noise filtered to contain equal amounts of each\n" | |||
+ "frequency, it should sound more natural and be more useful\n" | |||
+ "for synthesis uses"; | |||
} | |||
/* SpiralPlugin | |||
* Copyleft (C) 2000 David Griffiths <dave@pawfal.org> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "NoisePluginGUI.h" | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
using namespace std; | |||
NoisePluginGUI::NoisePluginGUI(int w, int h,NoisePlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
SpiralPluginGUI(w,h,o,ch) | |||
{ | |||
White = new Fl_LED_Button (15, 12, 55, 20, "White"); | |||
White->type (FL_RADIO_BUTTON); | |||
White->labelsize (10); | |||
White->set (); | |||
White->callback ((Fl_Callback*)cb_White); | |||
Pink = new Fl_LED_Button (15, 34, 55, 20, "Pink"); | |||
Pink->type (FL_RADIO_BUTTON); | |||
Pink->labelsize (10); | |||
Pink->callback ((Fl_Callback*)cb_Pink); | |||
end(); | |||
} | |||
void NoisePluginGUI::UpdateValues(SpiralPlugin *o) | |||
{ | |||
NoisePlugin *Plugin = (NoisePlugin*)o; | |||
switch (Plugin->GetType()) | |||
{ | |||
case NoisePlugin::WHITE : White->value(1); break; | |||
case NoisePlugin::PINK : Pink->value(1); break; | |||
} | |||
} | |||
//// Callbacks //// | |||
inline void NoisePluginGUI::cb_White_i(Fl_LED_Button* o, void* v) | |||
{ m_GUICH->Set("Type",(char)NoisePlugin::WHITE); } | |||
void NoisePluginGUI::cb_White(Fl_LED_Button* o, void* v) | |||
{ ((NoisePluginGUI*)(o->parent()))->cb_White_i(o,v); } | |||
inline void NoisePluginGUI::cb_Pink_i(Fl_LED_Button* o, void* v) | |||
{ m_GUICH->Set("Type",(char)NoisePlugin::PINK); } | |||
void NoisePluginGUI::cb_Pink(Fl_LED_Button* o, void* v) | |||
{ ((NoisePluginGUI*)(o->parent()))->cb_Pink_i(o,v); } | |||
const string NoisePluginGUI::GetHelpText(const string &loc){ | |||
return string("") | |||
+ "Makes noise, white noise is just raw randomness, pink noise\n" | |||
+ "is white noise filtered to contain equal amounts of each\n" | |||
+ "frequency, it should sound more natural and be more useful\n" | |||
+ "for synthesis uses"; | |||
} |
@@ -30,7 +30,7 @@ class NoisePluginGUI : public SpiralPluginGUI | |||
NoisePluginGUI(int w, int h, NoisePlugin *o, ChannelHandler *ch, const HostInfo *Info); | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
Fl_LED_Button *White, *Pink; | |||
//// Callbacks //// | |||
@@ -21,6 +21,8 @@ | |||
#include "SpiralIcon.xpm" | |||
#include "../../NoteTable.h" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() | |||
{ | |||
@@ -32,8 +32,8 @@ public: | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
bool GetFilter(int n) { return m_Filter[n]; } | |||
@@ -20,6 +20,8 @@ | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
NoteSnapPluginGUI::NoteSnapPluginGUI(int w, int h,NoteSnapPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
@@ -33,7 +33,7 @@ public: | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
int m_Num[NUM_KEYS]; | |||
@@ -21,6 +21,8 @@ | |||
#include "SpiralIcon.xpm" | |||
#include "../../NoteTable.h" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() | |||
{ | |||
@@ -32,8 +32,8 @@ public: | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
enum OperatorType{NONE,ADD,SUB,DIV,MUL}; | |||
@@ -21,6 +21,8 @@ | |||
#include <FL/fl_draw.H> | |||
//#include <stdio.h> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
OperatorPluginGUI::OperatorPluginGUI(int w, int h,OperatorPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
@@ -30,7 +30,7 @@ class OperatorPluginGUI : public SpiralPluginGUI { | |||
OperatorPluginGUI (int w, int h, OperatorPlugin *o, ChannelHandler *ch, const HostInfo *Info); | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
Fl_Button *m_Add, *m_Sub, *m_Mul, *m_Div; | |||
Fl_Counter *m_Constant; | |||
@@ -21,6 +21,8 @@ | |||
#include <limits.h> | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
static const int IN_FREQ = 0; | |||
static const int IN_PW = 1; | |||
static const int IN_SHLEN = 2; | |||
@@ -31,8 +31,8 @@ public: | |||
virtual PluginInfo &Initialise(const HostInfo *Host); | |||
virtual SpiralGUIType *CreateGUI(); | |||
virtual void Execute(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
typedef char Type; | |||
enum {NONE,SQUARE,SAW,NOISE}; | |||
@@ -71,11 +71,11 @@ private: | |||
static const int FIXED; | |||
friend istream &operator>>(istream &s, OscillatorPlugin &o); | |||
friend ostream &operator<<(ostream &s, OscillatorPlugin &o); | |||
friend std::istream &operator>>(std::istream &s, OscillatorPlugin &o); | |||
friend std::ostream &operator<<(std::ostream &s, OscillatorPlugin &o); | |||
}; | |||
istream &operator>>(istream &s, OscillatorPlugin &o); | |||
ostream &operator<<(ostream &s, OscillatorPlugin &o); | |||
std::istream &operator>>(std::istream &s, OscillatorPlugin &o); | |||
std::ostream &operator<<(std::ostream &s, OscillatorPlugin &o); | |||
#endif |
@@ -1,417 +1,419 @@ | |||
/* SpiralPlugin | |||
* Copyleft (C) 2000 David Griffiths <dave@pawfal.org> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "OscillatorPluginGUI.h" | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
#include "../GUI/WS_Square.h" | |||
#include "../GUI/WS_Noise.h" | |||
#include "../GUI/WS_Saw.h" | |||
OscillatorPluginGUI::OscillatorPluginGUI (int w, int h, OscillatorPlugin *o, ChannelHandler *ch, const HostInfo *Info) : | |||
SpiralPluginGUI (w, h, o, ch), | |||
m_PixmapSquare (image_Square), | |||
m_PixmapNoise (image_Noise), | |||
m_PixmapSaw (image_Saw), | |||
m_FineFreq (0) | |||
{ | |||
m_ShapeSquare = new Fl_LED_Button (2, 24, 23, 23); | |||
m_ShapeSquare->type (FL_RADIO_BUTTON); | |||
m_PixmapSquare.label (m_ShapeSquare); | |||
m_ShapeSquare->set(); | |||
m_ShapeSquare->callback ((Fl_Callback*)cb_Square); | |||
add (m_ShapeSquare); | |||
m_ShapeSaw = new Fl_LED_Button (2, 58, 23, 23); | |||
m_ShapeSaw->type (FL_RADIO_BUTTON); | |||
m_PixmapSaw.label (m_ShapeSaw); | |||
m_ShapeSaw->callback ((Fl_Callback*)cb_Saw); | |||
add (m_ShapeSaw); | |||
m_ShapeNoise = new Fl_LED_Button (2, 92, 23, 23); | |||
m_ShapeNoise->type (FL_RADIO_BUTTON); | |||
m_PixmapNoise.label (m_ShapeNoise); | |||
m_ShapeNoise->callback ((Fl_Callback*)cb_Noise); | |||
add (m_ShapeNoise); | |||
m_Tabs = new Fl_Tabs (44, 10, 168, 124); | |||
m_Tabs->box (FL_PLASTIC_DOWN_BOX); | |||
m_Tabs->color (Info->GUI_COLOUR); | |||
add (m_Tabs); | |||
m_CtlGroup = new Fl_Group (44, 24, 168, 110, "Control"); | |||
m_CtlGroup->labelsize (10); | |||
m_Tabs->add (m_CtlGroup); | |||
m_PulseWidth = new Fl_Slider (50, 32, 20, 86, "PW"); | |||
m_PulseWidth->user_data ((void*)(this)); | |||
m_PulseWidth->type (FL_VERT_NICE_SLIDER); | |||
m_PulseWidth->box (FL_PLASTIC_DOWN_BOX); | |||
m_PulseWidth->selection_color (Info->GUI_COLOUR); | |||
m_PulseWidth->labelsize (10); | |||
m_PulseWidth->maximum (1); | |||
m_PulseWidth->step (0.01); | |||
m_PulseWidth->value (0.5); | |||
m_PulseWidth->callback ((Fl_Callback*)cb_PulseWidth); | |||
m_CtlGroup->add (m_PulseWidth); | |||
m_SHLen = new Fl_Slider (74, 32, 20, 86, "SH"); | |||
m_SHLen->user_data ((void*)(this)); | |||
m_SHLen->type (FL_VERT_NICE_SLIDER); | |||
m_SHLen->box (FL_PLASTIC_DOWN_BOX); | |||
m_SHLen->selection_color (Info->GUI_COLOUR); | |||
m_SHLen->labelsize (10); | |||
m_SHLen->maximum (0.2); | |||
m_SHLen->step (0.001); | |||
m_SHLen->value (0.1); | |||
m_SHLen->callback ((Fl_Callback*)cb_SHLen); | |||
m_CtlGroup->add (m_SHLen); | |||
m_FineTune = new Fl_Knob (98, 32, 60, 60, "Fine Tune"); | |||
m_FineTune->user_data ((void*)(this)); | |||
m_FineTune->color (Info->GUI_COLOUR); | |||
m_FineTune->type (Fl_Knob::LINELIN); | |||
m_FineTune->labelsize (10); | |||
m_FineTune->scaleticks (20); | |||
m_FineTune->maximum (1.414); | |||
m_FineTune->step (0.000001); | |||
m_FineTune->value (1); | |||
m_FineTune->callback ((Fl_Callback*)cb_FineTune); | |||
m_CtlGroup->add (m_FineTune); | |||
m_Reset = new Fl_Button (108, 106, 40, 20, "Reset"); | |||
m_Reset->user_data ((void*)(this)); | |||
m_Reset->labelsize (10); | |||
m_Reset->box (FL_PLASTIC_UP_BOX); | |||
m_Reset->color (Info->GUI_COLOUR); | |||
m_Reset->selection_color (Info->GUI_COLOUR); | |||
m_Reset->callback ((Fl_Callback*)cb_Reset); | |||
m_CtlGroup->add (m_Reset); | |||
m_Octave = new Fl_Knob (160, 27, 40, 40, "Octave"); | |||
m_Octave->user_data ((void*)(this)); | |||
m_Octave->color (Info->GUI_COLOUR); | |||
m_Octave->type (Fl_Knob::LINELIN); | |||
m_Octave->labelsize (10); | |||
m_Octave->maximum (6); | |||
m_Octave->step (1); | |||
m_Octave->value (3); | |||
m_Octave->scaleticks (6); | |||
m_Octave->cursor (50); | |||
m_Octave->callback ((Fl_Callback*)cb_Octave); | |||
m_CtlGroup->add (m_Octave); | |||
m_ModAmount = new Fl_Knob (160, 79, 40, 40, "Mod Depth"); | |||
m_ModAmount->user_data ((void*)(this)); | |||
m_ModAmount->color (Info->GUI_COLOUR); | |||
m_ModAmount->type (Fl_Knob::LINELIN); | |||
m_ModAmount->labelsize (10); | |||
m_ModAmount->maximum (2.0f); | |||
m_ModAmount->step (0.001); | |||
m_ModAmount->value (1.0); | |||
m_ModAmount->callback ((Fl_Callback*)cb_ModAmount); | |||
m_CtlGroup->add (m_ModAmount); | |||
m_NumGroup = new Fl_Group (44, 24, 168, 110, "Numbers"); | |||
m_NumGroup->labelsize (10); | |||
m_Tabs->add (m_NumGroup); | |||
m_NumPulseWidth = new Fl_Counter (54, 32, 55, 20, "PW (%)"); | |||
m_NumPulseWidth->user_data ((void*)(this)); | |||
m_NumPulseWidth->type (FL_SIMPLE_COUNTER); | |||
m_NumPulseWidth->box (FL_PLASTIC_UP_BOX); | |||
m_NumPulseWidth->color (Info->GUI_COLOUR); | |||
m_NumPulseWidth->labelsize (10); | |||
m_NumPulseWidth->textsize (10); | |||
m_NumPulseWidth->minimum (0); | |||
m_NumPulseWidth->maximum (100); | |||
m_NumPulseWidth->step (1); | |||
m_NumPulseWidth->value (m_PulseWidth->value() * 100); | |||
m_NumPulseWidth->callback ((Fl_Callback*)cb_NumPulseWidth); | |||
m_NumGroup->add (m_NumPulseWidth); | |||
m_NumSHLen = new Fl_Counter (54, 98, 55, 20, "S&H (Secs)"); | |||
m_NumSHLen->user_data ((void*)(this)); | |||
m_NumSHLen->type (FL_SIMPLE_COUNTER); | |||
m_NumSHLen->box (FL_PLASTIC_UP_BOX); | |||
m_NumSHLen->color (Info->GUI_COLOUR); | |||
m_NumSHLen->labelsize (10); | |||
m_NumSHLen->textsize (10); | |||
m_NumSHLen->minimum (0); | |||
m_NumSHLen->maximum (0.2f); | |||
m_NumSHLen->step (.001); | |||
//m_NumSHLen->lstep (.1); | |||
m_NumSHLen->value (0.2f - m_SHLen->value()); | |||
m_NumSHLen->callback ((Fl_Callback*)cb_NumSHLen); | |||
m_NumGroup->add (m_NumSHLen); | |||
m_NumFreq = new Fl_Counter (114, 32, 90, 20, "Freq (Hz)"); | |||
m_NumFreq->user_data ((void*)(this)); | |||
m_NumFreq->box (FL_PLASTIC_UP_BOX); | |||
m_NumFreq->color (Info->GUI_COLOUR); | |||
m_NumFreq->labelsize (10); | |||
m_NumFreq->textsize (10); | |||
m_NumFreq->minimum (0); | |||
m_NumFreq->step (0.1); | |||
m_NumFreq->lstep (10); | |||
m_NumFreq->callback ((Fl_Callback*)cb_NumFreq); | |||
m_NumGroup->add (m_NumFreq); | |||
m_NumOctave = new Fl_Counter (128, 66, 64, 20, "Octave"); | |||
m_NumOctave->user_data ((void*)(this)); | |||
m_NumOctave->type (FL_SIMPLE_COUNTER); | |||
m_NumOctave->box (FL_PLASTIC_UP_BOX); | |||
m_NumOctave->color (Info->GUI_COLOUR); | |||
m_NumOctave->labelsize (10); | |||
m_NumOctave->textsize (10); | |||
m_NumOctave->minimum (-3); | |||
m_NumOctave->maximum (3); | |||
m_NumOctave->step (1); | |||
m_NumOctave->value (0); | |||
m_NumOctave->callback ((Fl_Callback*)cb_NumOctave); | |||
m_NumGroup->add (m_NumOctave); | |||
m_NumModAmount = new Fl_Counter (128, 98, 64, 20, "Mod (%)"); | |||
m_NumModAmount->user_data ((void*)(this)); | |||
m_NumModAmount->type (FL_SIMPLE_COUNTER); | |||
m_NumModAmount->box (FL_PLASTIC_UP_BOX); | |||
m_NumModAmount->color (Info->GUI_COLOUR); | |||
m_NumModAmount->labelsize (10); | |||
m_NumModAmount->textsize (10); | |||
m_NumModAmount->minimum (0); | |||
m_NumModAmount->maximum (200); | |||
m_NumModAmount->step (1); | |||
m_NumModAmount->value (m_ModAmount->value() * 100); | |||
m_NumModAmount->callback ((Fl_Callback*)cb_NumModAmount); | |||
m_NumGroup->add (m_NumModAmount); | |||
end(); | |||
UpdateFreq(); | |||
} | |||
void OscillatorPluginGUI::UpdateValues (SpiralPlugin *o) { | |||
float val; | |||
OscillatorPlugin *Plugin = (OscillatorPlugin*)o; | |||
m_ShapeSquare->value(0); | |||
m_ShapeNoise->value(0); | |||
m_ShapeSaw->value(0); | |||
switch (Plugin->GetType()) { | |||
case OscillatorPlugin::SQUARE : m_ShapeSquare->value(1); break; | |||
case OscillatorPlugin::NOISE : m_ShapeNoise->value(1); break; | |||
case OscillatorPlugin::SAW : m_ShapeSaw->value(1); break; | |||
case OscillatorPlugin::NONE : break; | |||
} | |||
val = Plugin->GetPulseWidth(); | |||
m_PulseWidth->value (val); | |||
m_NumPulseWidth->value (val * 100); | |||
val = 0.2f - Plugin->GetSHLen(); | |||
m_SHLen->value (val); | |||
m_NumSHLen->value (val); | |||
val = Plugin->GetModAmount(); | |||
m_ModAmount->value (val); | |||
m_NumModAmount->value (val * 100); | |||
m_NumOctave->value (Plugin->GetOctave()); | |||
m_Octave->value ((int)m_NumOctave->value() + 3); | |||
m_FineTune->value (sqrt (Plugin->GetFineFreq())); | |||
UpdateFreq(); | |||
} | |||
// Utility functions | |||
float OscillatorPluginGUI::CalcFineFreq (float Fine) { | |||
int oct = (int)m_NumOctave->value(); | |||
m_FineFreq = Fine * Fine; | |||
float fr = 110.0f * m_FineFreq; | |||
if (oct > 0) fr *= 1 << oct; | |||
if (oct < 0) fr /= 1 << (-oct); | |||
return fr; | |||
} | |||
void OscillatorPluginGUI::UpdateFreq (void) { | |||
// always do max first - CalcFineFreq leaves a value in m_FineFreq | |||
m_NumFreq->maximum (CalcFineFreq (m_FineTune->maximum())); | |||
m_NumFreq->value (CalcFineFreq (m_FineTune->value())); | |||
} | |||
// Callbacks - Controls outside the tabs | |||
inline void OscillatorPluginGUI::cb_Square_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set ("Type", (char)OscillatorPlugin::SQUARE); | |||
} | |||
void OscillatorPluginGUI::cb_Square (Fl_LED_Button* o, void* v) { | |||
((OscillatorPluginGUI*)(o->parent()))->cb_Square_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_Saw_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set ("Type", (char)OscillatorPlugin::SAW); | |||
} | |||
void OscillatorPluginGUI::cb_Saw (Fl_LED_Button* o, void* v) { | |||
((OscillatorPluginGUI*)(o->parent()))->cb_Saw_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_Noise_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set ("Type",(char)OscillatorPlugin::NOISE); | |||
} | |||
void OscillatorPluginGUI::cb_Noise (Fl_LED_Button* o, void* v) { | |||
((OscillatorPluginGUI*)(o->parent()))->cb_Noise_i (o, v); | |||
} | |||
// Callbacks - Control Group | |||
inline void OscillatorPluginGUI::cb_PulseWidth_i (Fl_Slider* o, void* v) { | |||
float val = o->value(); | |||
m_GUICH->Set ("PulseWidth", val); | |||
m_NumPulseWidth->value (val * 100); | |||
} | |||
void OscillatorPluginGUI::cb_PulseWidth (Fl_Slider* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_PulseWidth_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_SHLen_i (Fl_Slider* o, void* v) { | |||
float val = 0.2f - o->value(); | |||
m_GUICH->Set ("SHLen", val); | |||
m_NumSHLen->value (val); | |||
} | |||
void OscillatorPluginGUI::cb_SHLen (Fl_Slider* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_SHLen_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_FineTune_i (Fl_Knob* o, void* v) { | |||
UpdateFreq(); | |||
m_GUICH->Set ("FineFreq", m_FineFreq); | |||
} | |||
void OscillatorPluginGUI::cb_FineTune (Fl_Knob* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_FineTune_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_Reset_i (Fl_Button* o, void* v) { | |||
m_FineTune->value (1); | |||
UpdateFreq(); | |||
m_GUICH->Set ("FineFreq", m_FineFreq); | |||
} | |||
void OscillatorPluginGUI::cb_Reset (Fl_Button* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_Reset_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_Octave_i (Fl_Knob* o, void* v) { | |||
m_NumOctave->value ((int)m_Octave->value() - 3); | |||
UpdateFreq(); | |||
m_GUICH->Set ("Octave", (int)m_NumOctave->value ()); | |||
} | |||
void OscillatorPluginGUI::cb_Octave (Fl_Knob* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_Octave_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_ModAmount_i (Fl_Knob* o, void* v) { | |||
float val = o->value(); | |||
m_GUICH->Set ("ModAmount", val); | |||
m_NumModAmount->value (val * 100); | |||
} | |||
void OscillatorPluginGUI::cb_ModAmount (Fl_Knob* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_ModAmount_i (o, v); | |||
} | |||
// Callbacks - Number Group | |||
inline void OscillatorPluginGUI::cb_NumPulseWidth_i (Fl_Counter* o, void* v) { | |||
float val = o->value() / 100; | |||
m_GUICH->Set ("PulseWidth", val); | |||
m_PulseWidth->value (val); | |||
} | |||
void OscillatorPluginGUI::cb_NumPulseWidth (Fl_Counter* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_NumPulseWidth_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_NumSHLen_i (Fl_Counter* o, void* v) { | |||
float val = o->value(); | |||
m_GUICH->Set ("SHLen", val); | |||
m_SHLen->value (0.2f - val); | |||
} | |||
void OscillatorPluginGUI::cb_NumSHLen (Fl_Counter* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_NumSHLen_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_NumFreq_i (Fl_Counter* o, void* v) { | |||
int oct = (int)m_NumOctave->value(); | |||
float fr = o->value (); | |||
if (oct > 0) fr /= 1 << oct; | |||
if (oct < 0) fr *= 1 << (-oct); | |||
m_FineFreq = fr / 110.0f; | |||
m_GUICH->Set ("FineFreq", m_FineFreq); | |||
m_FineTune->value (sqrt (m_FineFreq)); | |||
} | |||
void OscillatorPluginGUI::cb_NumOctave (Fl_Counter* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_NumOctave_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_NumOctave_i (Fl_Counter* o, void* v) { | |||
m_Octave->value ((int)m_NumOctave->value() + 3); | |||
UpdateFreq(); | |||
m_GUICH->Set ("Octave", (int)m_NumOctave->value ()); | |||
} | |||
void OscillatorPluginGUI::cb_NumFreq (Fl_Counter* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_NumFreq_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_NumModAmount_i (Fl_Counter* o, void* v) { | |||
float val = o->value() / 100; | |||
m_GUICH->Set ("ModAmount", val); | |||
m_ModAmount->value (val); | |||
} | |||
void OscillatorPluginGUI::cb_NumModAmount (Fl_Counter* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_NumModAmount_i (o, v); | |||
} | |||
// Help Text | |||
const string OscillatorPluginGUI::GetHelpText(const string &loc){ | |||
return string("") | |||
+ "The Oscillator generates raw waveforms from CV controls. Three wave \n" | |||
+ "shapes are included, Square wave, Triangle wave and white noise.\n\n" | |||
+ "In the square and triangle shapes, the Frequency CV controls the pitch \n" | |||
+ "of the signal generated, and the pulse-width turns the squarewave into \n" | |||
+ "a pulse wave of varying harmonics, and the triangle wave into a sawtooth,\n" | |||
+ "or reverse sawtooth wave.\n\n" | |||
+ "The sample & hold CV changes the time between samples with the white noise.\n" | |||
+ "This is usful for making the Oscillator into a random CV generator.\n\n" | |||
+ "The plugin window allows you to select the wave shape, set the octave and\n" | |||
+ "fine tune the frequency (use the reset button to reset the frequency back\n" | |||
+ "to it's default value). There are also controls to set the pulse-width,\n" | |||
+ "sample and hold manually, and control the modulation depth of the input CV's.\n\n" | |||
+ "The frequency can be set extremely low on this oscillator, so you can use\n" | |||
+ "it as an LFO for controlling other plugins."; | |||
} | |||
/* SpiralPlugin | |||
* Copyleft (C) 2000 David Griffiths <dave@pawfal.org> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "OscillatorPluginGUI.h" | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
#include "../GUI/WS_Square.h" | |||
#include "../GUI/WS_Noise.h" | |||
#include "../GUI/WS_Saw.h" | |||
using namespace std; | |||
OscillatorPluginGUI::OscillatorPluginGUI (int w, int h, OscillatorPlugin *o, ChannelHandler *ch, const HostInfo *Info) : | |||
SpiralPluginGUI (w, h, o, ch), | |||
m_PixmapSquare (image_Square), | |||
m_PixmapNoise (image_Noise), | |||
m_PixmapSaw (image_Saw), | |||
m_FineFreq (0) | |||
{ | |||
m_ShapeSquare = new Fl_LED_Button (2, 24, 23, 23); | |||
m_ShapeSquare->type (FL_RADIO_BUTTON); | |||
m_PixmapSquare.label (m_ShapeSquare); | |||
m_ShapeSquare->set(); | |||
m_ShapeSquare->callback ((Fl_Callback*)cb_Square); | |||
add (m_ShapeSquare); | |||
m_ShapeSaw = new Fl_LED_Button (2, 58, 23, 23); | |||
m_ShapeSaw->type (FL_RADIO_BUTTON); | |||
m_PixmapSaw.label (m_ShapeSaw); | |||
m_ShapeSaw->callback ((Fl_Callback*)cb_Saw); | |||
add (m_ShapeSaw); | |||
m_ShapeNoise = new Fl_LED_Button (2, 92, 23, 23); | |||
m_ShapeNoise->type (FL_RADIO_BUTTON); | |||
m_PixmapNoise.label (m_ShapeNoise); | |||
m_ShapeNoise->callback ((Fl_Callback*)cb_Noise); | |||
add (m_ShapeNoise); | |||
m_Tabs = new Fl_Tabs (44, 10, 168, 124); | |||
m_Tabs->box (FL_PLASTIC_DOWN_BOX); | |||
m_Tabs->color (Info->GUI_COLOUR); | |||
add (m_Tabs); | |||
m_CtlGroup = new Fl_Group (44, 24, 168, 110, "Control"); | |||
m_CtlGroup->labelsize (10); | |||
m_Tabs->add (m_CtlGroup); | |||
m_PulseWidth = new Fl_Slider (50, 32, 20, 86, "PW"); | |||
m_PulseWidth->user_data ((void*)(this)); | |||
m_PulseWidth->type (FL_VERT_NICE_SLIDER); | |||
m_PulseWidth->box (FL_PLASTIC_DOWN_BOX); | |||
m_PulseWidth->selection_color (Info->GUI_COLOUR); | |||
m_PulseWidth->labelsize (10); | |||
m_PulseWidth->maximum (1); | |||
m_PulseWidth->step (0.01); | |||
m_PulseWidth->value (0.5); | |||
m_PulseWidth->callback ((Fl_Callback*)cb_PulseWidth); | |||
m_CtlGroup->add (m_PulseWidth); | |||
m_SHLen = new Fl_Slider (74, 32, 20, 86, "SH"); | |||
m_SHLen->user_data ((void*)(this)); | |||
m_SHLen->type (FL_VERT_NICE_SLIDER); | |||
m_SHLen->box (FL_PLASTIC_DOWN_BOX); | |||
m_SHLen->selection_color (Info->GUI_COLOUR); | |||
m_SHLen->labelsize (10); | |||
m_SHLen->maximum (0.2); | |||
m_SHLen->step (0.001); | |||
m_SHLen->value (0.1); | |||
m_SHLen->callback ((Fl_Callback*)cb_SHLen); | |||
m_CtlGroup->add (m_SHLen); | |||
m_FineTune = new Fl_Knob (98, 32, 60, 60, "Fine Tune"); | |||
m_FineTune->user_data ((void*)(this)); | |||
m_FineTune->color (Info->GUI_COLOUR); | |||
m_FineTune->type (Fl_Knob::LINELIN); | |||
m_FineTune->labelsize (10); | |||
m_FineTune->scaleticks (20); | |||
m_FineTune->maximum (1.414); | |||
m_FineTune->step (0.000001); | |||
m_FineTune->value (1); | |||
m_FineTune->callback ((Fl_Callback*)cb_FineTune); | |||
m_CtlGroup->add (m_FineTune); | |||
m_Reset = new Fl_Button (108, 106, 40, 20, "Reset"); | |||
m_Reset->user_data ((void*)(this)); | |||
m_Reset->labelsize (10); | |||
m_Reset->box (FL_PLASTIC_UP_BOX); | |||
m_Reset->color (Info->GUI_COLOUR); | |||
m_Reset->selection_color (Info->GUI_COLOUR); | |||
m_Reset->callback ((Fl_Callback*)cb_Reset); | |||
m_CtlGroup->add (m_Reset); | |||
m_Octave = new Fl_Knob (160, 27, 40, 40, "Octave"); | |||
m_Octave->user_data ((void*)(this)); | |||
m_Octave->color (Info->GUI_COLOUR); | |||
m_Octave->type (Fl_Knob::LINELIN); | |||
m_Octave->labelsize (10); | |||
m_Octave->maximum (6); | |||
m_Octave->step (1); | |||
m_Octave->value (3); | |||
m_Octave->scaleticks (6); | |||
m_Octave->cursor (50); | |||
m_Octave->callback ((Fl_Callback*)cb_Octave); | |||
m_CtlGroup->add (m_Octave); | |||
m_ModAmount = new Fl_Knob (160, 79, 40, 40, "Mod Depth"); | |||
m_ModAmount->user_data ((void*)(this)); | |||
m_ModAmount->color (Info->GUI_COLOUR); | |||
m_ModAmount->type (Fl_Knob::LINELIN); | |||
m_ModAmount->labelsize (10); | |||
m_ModAmount->maximum (2.0f); | |||
m_ModAmount->step (0.001); | |||
m_ModAmount->value (1.0); | |||
m_ModAmount->callback ((Fl_Callback*)cb_ModAmount); | |||
m_CtlGroup->add (m_ModAmount); | |||
m_NumGroup = new Fl_Group (44, 24, 168, 110, "Numbers"); | |||
m_NumGroup->labelsize (10); | |||
m_Tabs->add (m_NumGroup); | |||
m_NumPulseWidth = new Fl_Counter (54, 32, 55, 20, "PW (%)"); | |||
m_NumPulseWidth->user_data ((void*)(this)); | |||
m_NumPulseWidth->type (FL_SIMPLE_COUNTER); | |||
m_NumPulseWidth->box (FL_PLASTIC_UP_BOX); | |||
m_NumPulseWidth->color (Info->GUI_COLOUR); | |||
m_NumPulseWidth->labelsize (10); | |||
m_NumPulseWidth->textsize (10); | |||
m_NumPulseWidth->minimum (0); | |||
m_NumPulseWidth->maximum (100); | |||
m_NumPulseWidth->step (1); | |||
m_NumPulseWidth->value (m_PulseWidth->value() * 100); | |||
m_NumPulseWidth->callback ((Fl_Callback*)cb_NumPulseWidth); | |||
m_NumGroup->add (m_NumPulseWidth); | |||
m_NumSHLen = new Fl_Counter (54, 98, 55, 20, "S&H (Secs)"); | |||
m_NumSHLen->user_data ((void*)(this)); | |||
m_NumSHLen->type (FL_SIMPLE_COUNTER); | |||
m_NumSHLen->box (FL_PLASTIC_UP_BOX); | |||
m_NumSHLen->color (Info->GUI_COLOUR); | |||
m_NumSHLen->labelsize (10); | |||
m_NumSHLen->textsize (10); | |||
m_NumSHLen->minimum (0); | |||
m_NumSHLen->maximum (0.2f); | |||
m_NumSHLen->step (.001); | |||
//m_NumSHLen->lstep (.1); | |||
m_NumSHLen->value (0.2f - m_SHLen->value()); | |||
m_NumSHLen->callback ((Fl_Callback*)cb_NumSHLen); | |||
m_NumGroup->add (m_NumSHLen); | |||
m_NumFreq = new Fl_Counter (114, 32, 90, 20, "Freq (Hz)"); | |||
m_NumFreq->user_data ((void*)(this)); | |||
m_NumFreq->box (FL_PLASTIC_UP_BOX); | |||
m_NumFreq->color (Info->GUI_COLOUR); | |||
m_NumFreq->labelsize (10); | |||
m_NumFreq->textsize (10); | |||
m_NumFreq->minimum (0); | |||
m_NumFreq->step (0.1); | |||
m_NumFreq->lstep (10); | |||
m_NumFreq->callback ((Fl_Callback*)cb_NumFreq); | |||
m_NumGroup->add (m_NumFreq); | |||
m_NumOctave = new Fl_Counter (128, 66, 64, 20, "Octave"); | |||
m_NumOctave->user_data ((void*)(this)); | |||
m_NumOctave->type (FL_SIMPLE_COUNTER); | |||
m_NumOctave->box (FL_PLASTIC_UP_BOX); | |||
m_NumOctave->color (Info->GUI_COLOUR); | |||
m_NumOctave->labelsize (10); | |||
m_NumOctave->textsize (10); | |||
m_NumOctave->minimum (-3); | |||
m_NumOctave->maximum (3); | |||
m_NumOctave->step (1); | |||
m_NumOctave->value (0); | |||
m_NumOctave->callback ((Fl_Callback*)cb_NumOctave); | |||
m_NumGroup->add (m_NumOctave); | |||
m_NumModAmount = new Fl_Counter (128, 98, 64, 20, "Mod (%)"); | |||
m_NumModAmount->user_data ((void*)(this)); | |||
m_NumModAmount->type (FL_SIMPLE_COUNTER); | |||
m_NumModAmount->box (FL_PLASTIC_UP_BOX); | |||
m_NumModAmount->color (Info->GUI_COLOUR); | |||
m_NumModAmount->labelsize (10); | |||
m_NumModAmount->textsize (10); | |||
m_NumModAmount->minimum (0); | |||
m_NumModAmount->maximum (200); | |||
m_NumModAmount->step (1); | |||
m_NumModAmount->value (m_ModAmount->value() * 100); | |||
m_NumModAmount->callback ((Fl_Callback*)cb_NumModAmount); | |||
m_NumGroup->add (m_NumModAmount); | |||
end(); | |||
UpdateFreq(); | |||
} | |||
void OscillatorPluginGUI::UpdateValues (SpiralPlugin *o) { | |||
float val; | |||
OscillatorPlugin *Plugin = (OscillatorPlugin*)o; | |||
m_ShapeSquare->value(0); | |||
m_ShapeNoise->value(0); | |||
m_ShapeSaw->value(0); | |||
switch (Plugin->GetType()) { | |||
case OscillatorPlugin::SQUARE : m_ShapeSquare->value(1); break; | |||
case OscillatorPlugin::NOISE : m_ShapeNoise->value(1); break; | |||
case OscillatorPlugin::SAW : m_ShapeSaw->value(1); break; | |||
case OscillatorPlugin::NONE : break; | |||
} | |||
val = Plugin->GetPulseWidth(); | |||
m_PulseWidth->value (val); | |||
m_NumPulseWidth->value (val * 100); | |||
val = 0.2f - Plugin->GetSHLen(); | |||
m_SHLen->value (val); | |||
m_NumSHLen->value (val); | |||
val = Plugin->GetModAmount(); | |||
m_ModAmount->value (val); | |||
m_NumModAmount->value (val * 100); | |||
m_NumOctave->value (Plugin->GetOctave()); | |||
m_Octave->value ((int)m_NumOctave->value() + 3); | |||
m_FineTune->value (sqrt (Plugin->GetFineFreq())); | |||
UpdateFreq(); | |||
} | |||
// Utility functions | |||
float OscillatorPluginGUI::CalcFineFreq (float Fine) { | |||
int oct = (int)m_NumOctave->value(); | |||
m_FineFreq = Fine * Fine; | |||
float fr = 110.0f * m_FineFreq; | |||
if (oct > 0) fr *= 1 << oct; | |||
if (oct < 0) fr /= 1 << (-oct); | |||
return fr; | |||
} | |||
void OscillatorPluginGUI::UpdateFreq (void) { | |||
// always do max first - CalcFineFreq leaves a value in m_FineFreq | |||
m_NumFreq->maximum (CalcFineFreq (m_FineTune->maximum())); | |||
m_NumFreq->value (CalcFineFreq (m_FineTune->value())); | |||
} | |||
// Callbacks - Controls outside the tabs | |||
inline void OscillatorPluginGUI::cb_Square_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set ("Type", (char)OscillatorPlugin::SQUARE); | |||
} | |||
void OscillatorPluginGUI::cb_Square (Fl_LED_Button* o, void* v) { | |||
((OscillatorPluginGUI*)(o->parent()))->cb_Square_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_Saw_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set ("Type", (char)OscillatorPlugin::SAW); | |||
} | |||
void OscillatorPluginGUI::cb_Saw (Fl_LED_Button* o, void* v) { | |||
((OscillatorPluginGUI*)(o->parent()))->cb_Saw_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_Noise_i (Fl_LED_Button* o, void* v) { | |||
m_GUICH->Set ("Type",(char)OscillatorPlugin::NOISE); | |||
} | |||
void OscillatorPluginGUI::cb_Noise (Fl_LED_Button* o, void* v) { | |||
((OscillatorPluginGUI*)(o->parent()))->cb_Noise_i (o, v); | |||
} | |||
// Callbacks - Control Group | |||
inline void OscillatorPluginGUI::cb_PulseWidth_i (Fl_Slider* o, void* v) { | |||
float val = o->value(); | |||
m_GUICH->Set ("PulseWidth", val); | |||
m_NumPulseWidth->value (val * 100); | |||
} | |||
void OscillatorPluginGUI::cb_PulseWidth (Fl_Slider* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_PulseWidth_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_SHLen_i (Fl_Slider* o, void* v) { | |||
float val = 0.2f - o->value(); | |||
m_GUICH->Set ("SHLen", val); | |||
m_NumSHLen->value (val); | |||
} | |||
void OscillatorPluginGUI::cb_SHLen (Fl_Slider* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_SHLen_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_FineTune_i (Fl_Knob* o, void* v) { | |||
UpdateFreq(); | |||
m_GUICH->Set ("FineFreq", m_FineFreq); | |||
} | |||
void OscillatorPluginGUI::cb_FineTune (Fl_Knob* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_FineTune_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_Reset_i (Fl_Button* o, void* v) { | |||
m_FineTune->value (1); | |||
UpdateFreq(); | |||
m_GUICH->Set ("FineFreq", m_FineFreq); | |||
} | |||
void OscillatorPluginGUI::cb_Reset (Fl_Button* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_Reset_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_Octave_i (Fl_Knob* o, void* v) { | |||
m_NumOctave->value ((int)m_Octave->value() - 3); | |||
UpdateFreq(); | |||
m_GUICH->Set ("Octave", (int)m_NumOctave->value ()); | |||
} | |||
void OscillatorPluginGUI::cb_Octave (Fl_Knob* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_Octave_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_ModAmount_i (Fl_Knob* o, void* v) { | |||
float val = o->value(); | |||
m_GUICH->Set ("ModAmount", val); | |||
m_NumModAmount->value (val * 100); | |||
} | |||
void OscillatorPluginGUI::cb_ModAmount (Fl_Knob* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_ModAmount_i (o, v); | |||
} | |||
// Callbacks - Number Group | |||
inline void OscillatorPluginGUI::cb_NumPulseWidth_i (Fl_Counter* o, void* v) { | |||
float val = o->value() / 100; | |||
m_GUICH->Set ("PulseWidth", val); | |||
m_PulseWidth->value (val); | |||
} | |||
void OscillatorPluginGUI::cb_NumPulseWidth (Fl_Counter* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_NumPulseWidth_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_NumSHLen_i (Fl_Counter* o, void* v) { | |||
float val = o->value(); | |||
m_GUICH->Set ("SHLen", val); | |||
m_SHLen->value (0.2f - val); | |||
} | |||
void OscillatorPluginGUI::cb_NumSHLen (Fl_Counter* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_NumSHLen_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_NumFreq_i (Fl_Counter* o, void* v) { | |||
int oct = (int)m_NumOctave->value(); | |||
float fr = o->value (); | |||
if (oct > 0) fr /= 1 << oct; | |||
if (oct < 0) fr *= 1 << (-oct); | |||
m_FineFreq = fr / 110.0f; | |||
m_GUICH->Set ("FineFreq", m_FineFreq); | |||
m_FineTune->value (sqrt (m_FineFreq)); | |||
} | |||
void OscillatorPluginGUI::cb_NumOctave (Fl_Counter* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_NumOctave_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_NumOctave_i (Fl_Counter* o, void* v) { | |||
m_Octave->value ((int)m_NumOctave->value() + 3); | |||
UpdateFreq(); | |||
m_GUICH->Set ("Octave", (int)m_NumOctave->value ()); | |||
} | |||
void OscillatorPluginGUI::cb_NumFreq (Fl_Counter* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_NumFreq_i (o, v); | |||
} | |||
inline void OscillatorPluginGUI::cb_NumModAmount_i (Fl_Counter* o, void* v) { | |||
float val = o->value() / 100; | |||
m_GUICH->Set ("ModAmount", val); | |||
m_ModAmount->value (val); | |||
} | |||
void OscillatorPluginGUI::cb_NumModAmount (Fl_Counter* o, void* v) { | |||
((OscillatorPluginGUI*)(o->user_data()))->cb_NumModAmount_i (o, v); | |||
} | |||
// Help Text | |||
const string OscillatorPluginGUI::GetHelpText(const string &loc){ | |||
return string("") | |||
+ "The Oscillator generates raw waveforms from CV controls. Three wave \n" | |||
+ "shapes are included, Square wave, Triangle wave and white noise.\n\n" | |||
+ "In the square and triangle shapes, the Frequency CV controls the pitch \n" | |||
+ "of the signal generated, and the pulse-width turns the squarewave into \n" | |||
+ "a pulse wave of varying harmonics, and the triangle wave into a sawtooth,\n" | |||
+ "or reverse sawtooth wave.\n\n" | |||
+ "The sample & hold CV changes the time between samples with the white noise.\n" | |||
+ "This is usful for making the Oscillator into a random CV generator.\n\n" | |||
+ "The plugin window allows you to select the wave shape, set the octave and\n" | |||
+ "fine tune the frequency (use the reset button to reset the frequency back\n" | |||
+ "to it's default value). There are also controls to set the pulse-width,\n" | |||
+ "sample and hold manually, and control the modulation depth of the input CV's.\n\n" | |||
+ "The frequency can be set extremely low on this oscillator, so you can use\n" | |||
+ "it as an LFO for controlling other plugins."; | |||
} |
@@ -35,7 +35,7 @@ class OscillatorPluginGUI : public SpiralPluginGUI { | |||
OscillatorPluginGUI (int w, int h, OscillatorPlugin *o, ChannelHandler *ch, const HostInfo *Info); | |||
virtual void UpdateValues (SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
// Utility Functions | |||
void UpdateFreq (void); | |||
@@ -44,6 +44,8 @@ | |||
#include <FL/fl_file_chooser.H> | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
static const int IN_FREQ = 0; | |||
static const int IN_PW = 1; | |||
static const int IN_SHLEN = 2; | |||
@@ -77,8 +77,8 @@ public: | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s) {} | |||
virtual void StreamIn(istream &s) {} | |||
virtual void StreamOut(std::ostream &s) {} | |||
virtual void StreamIn(std::istream &s) {} | |||
enum GUICommands {NONE, OPENREAD, OPENWRITE, OPENDUPLEX, CLOSE, SET_VOLUME, CLEAR_NOTIFY}; | |||
float m_Volume; | |||
@@ -20,6 +20,8 @@ | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_file_chooser.H> | |||
using namespace std; | |||
OutputPluginGUI::OutputPluginGUI(int w, int h, SpiralPlugin *o, ChannelHandler *ch,const HostInfo *Info) : | |||
SpiralPluginGUI(w,h,o,ch) | |||
{ | |||
@@ -34,7 +34,7 @@ public: | |||
virtual void Update(); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
Fl_Knob *Volume; | |||
@@ -23,6 +23,8 @@ | |||
#include "../../NoteTable.h" | |||
#include <stdio.h> | |||
using namespace std; | |||
static const int NOTETRIG = NUM_SAMPLES*2+1; | |||
static const int REC_INPUT = 16; | |||
@@ -27,7 +27,7 @@ static const int TRANSBUF_SIZE = 0x10000; | |||
struct SampleDesc | |||
{ | |||
string Pathname; | |||
std::string Pathname; | |||
float Volume; | |||
float Velocity; | |||
float Pitch; | |||
@@ -55,11 +55,11 @@ public: | |||
virtual SpiralGUIType *CreateGUI(); | |||
virtual void Execute(); | |||
virtual void ExecuteCommands(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
virtual bool SaveExternalFiles(const string &Dir); | |||
virtual void LoadExternalFiles(const string &Dir); | |||
virtual bool SaveExternalFiles(const std::string &Dir); | |||
virtual void LoadExternalFiles(const std::string &Dir); | |||
enum GUICommands{NONE,LOAD,SAVE,SETVOL,SETPITCH,SETLOOP,SETPING,SETNOTE,SETOCT, | |||
SETPLAYPOINTS,SETREC,CUT,COPY,PASTE,CROP,MIX,REV,AMP,SETCURRENT, | |||
@@ -77,8 +77,8 @@ public: | |||
char Name[256]; | |||
}; | |||
void LoadSample(int n, const string &Name); | |||
void SaveSample(int n, const string &Name); | |||
void LoadSample(int n, const std::string &Name); | |||
void SaveSample(int n, const std::string &Name); | |||
Sample* GetSample(int n) { return m_SampleVec[n]; } | |||
float GetVolume(int n) { return m_SampleDescVec[n]->Volume; } | |||
@@ -92,8 +92,8 @@ public: | |||
long GetLoopStart(int n) { return m_SampleDescVec[n]->LoopStart; } | |||
long GetLoopEnd(int n) { return m_SampleDescVec[n]->LoopEnd; } | |||
vector<Sample*> m_SampleVec; | |||
vector<SampleDesc*> m_SampleDescVec; | |||
std::vector<Sample*> m_SampleVec; | |||
std::vector<SampleDesc*> m_SampleDescVec; | |||
private: | |||
@@ -21,6 +21,8 @@ | |||
#include <FL/fl_draw.H> | |||
#include <FL/fl_file_chooser.h> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
Fl_WaveDisplay::Fl_WaveDisplay(int x,int y,int w,int h, char *Name) : | |||
@@ -83,7 +83,7 @@ public: | |||
int GetCurrentSample() { return (int)m_SampleNum->value(); } | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
@@ -21,6 +21,8 @@ | |||
#include <FL/Fl_Button.h> | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() | |||
{ | |||
@@ -31,8 +31,8 @@ public: | |||
virtual PluginInfo &Initialise(const HostInfo *Host); | |||
virtual SpiralGUIType *CreateGUI(); | |||
virtual void Execute(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
float GetAmount() { return m_Amount; } | |||
@@ -41,10 +41,10 @@ public: | |||
private: | |||
float m_Amount; | |||
friend istream &operator>>(istream &s, RingModPlugin &o); | |||
friend ostream &operator<<(ostream &s, RingModPlugin &o); | |||
friend std::istream &operator>>(std::istream &s, RingModPlugin &o); | |||
friend std::ostream &operator<<(std::ostream &s, RingModPlugin &o); | |||
}; | |||
istream &operator>>(istream &s, RingModPlugin &o); | |||
ostream &operator<<(ostream &s, RingModPlugin &o); | |||
std::istream &operator>>(std::istream &s, RingModPlugin &o); | |||
std::ostream &operator<<(std::ostream &s, RingModPlugin &o); | |||
#endif |
@@ -20,6 +20,8 @@ | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
RingModPluginGUI::RingModPluginGUI (int w, int h, RingModPlugin *o, ChannelHandler *ch, const HostInfo *Info) : | |||
@@ -33,7 +33,7 @@ public: | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
Fl_Knob *m_Amount; | |||
@@ -20,6 +20,8 @@ | |||
#include "SVFilterPluginGUI.h" | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
static const double PI = 3.141592654; | |||
static const int GRANULARITY = 10; | |||
@@ -34,8 +34,8 @@ public: | |||
virtual PluginInfo &Initialise(const HostInfo *Host); | |||
virtual SpiralGUIType *CreateGUI(); | |||
virtual void Execute(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
float GetCutoff() { return Cutoff; } | |||
float GetResonance() { return Resonance; } | |||
@@ -56,10 +56,10 @@ private: | |||
// Outputs | |||
double m_h, m_b, m_l, m_p, m_n; | |||
friend istream &operator>>(istream &s, SVFilterPlugin &o); | |||
friend ostream &operator<<(ostream &s, SVFilterPlugin &o); | |||
friend std::istream &operator>>(std::istream &s, SVFilterPlugin &o); | |||
friend std::ostream &operator<<(std::ostream &s, SVFilterPlugin &o); | |||
}; | |||
istream &operator>>(istream &s, SVFilterPlugin &o); | |||
ostream &operator<<(ostream &s, SVFilterPlugin &o); | |||
std::istream &operator>>(std::istream &s, SVFilterPlugin &o); | |||
std::ostream &operator<<(std::ostream &s, SVFilterPlugin &o); | |||
#endif |
@@ -20,6 +20,8 @@ | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
SVFilterPluginGUI::SVFilterPluginGUI(int w, int h,SVFilterPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
@@ -33,7 +33,7 @@ public: | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
Fl_Slider *Cutoff; | |||
@@ -20,6 +20,8 @@ | |||
#include <FL/Fl_Button.h> | |||
#include "SpiralIcon.xpm" | |||
using namespace std; | |||
extern "C" { | |||
SpiralPlugin* SpiralPlugin_CreateInstance() | |||
{ | |||
@@ -31,8 +31,8 @@ public: | |||
virtual PluginInfo& Initialise(const HostInfo *Host); | |||
virtual SpiralGUIType* CreateGUI(); | |||
virtual void Execute(); | |||
virtual void StreamOut(ostream &s) {} | |||
virtual void StreamIn(istream &s) {} | |||
virtual void StreamOut(std::ostream &s) {} | |||
virtual void StreamIn(std::istream &s) {} | |||
private: | |||
float m_val; | |||
@@ -20,6 +20,8 @@ | |||
#include <FL/fl_draw.h> | |||
#include <FL/fl_draw.H> | |||
using namespace std; | |||
//////////////////////////////////////////// | |||
SampleHoldPluginGUI::SampleHoldPluginGUI(int w, int h,SampleHoldPlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
@@ -31,7 +31,7 @@ public: | |||
virtual void UpdateValues(SpiralPlugin *o); | |||
protected: | |||
const string GetHelpText(const string &loc); | |||
const std::string GetHelpText(const std::string &loc); | |||
private: | |||
@@ -22,6 +22,8 @@ | |||
#include "../../RiffWav.h" | |||
#include "../../NoteTable.h" | |||
using namespace std; | |||
static const int NOTETRIG = NUM_SAMPLES*2+1; | |||
extern "C" { | |||
@@ -26,7 +26,7 @@ static const int NUM_SAMPLES = 8; | |||
struct SampleDesc | |||
{ | |||
string Pathname; | |||
std::string Pathname; | |||
float Volume; | |||
float Pitch; | |||
float PitchMod; | |||
@@ -47,13 +47,13 @@ public: | |||
virtual PluginInfo &Initialise(const HostInfo *Host); | |||
virtual SpiralGUIType *CreateGUI(); | |||
virtual void Execute(); | |||
virtual void StreamOut(ostream &s); | |||
virtual void StreamIn(istream &s); | |||
virtual void StreamOut(std::ostream &s); | |||
virtual void StreamIn(std::istream &s); | |||
// has to be defined in the plugin | |||
virtual void UpdateGUI() { Fl::check(); } | |||
void LoadSample(int n, const string &Name); | |||
void LoadSample(int n, const std::string &Name); | |||
void SetVolume(int n, float s) { m_SampleDescVec[n]->Volume=s; } | |||
float GetVolume(int n) { return m_SampleDescVec[n]->Volume; } | |||
@@ -64,8 +64,8 @@ public: | |||
void SetNote(int n, int s) { m_SampleDescVec[n]->Note=s; } | |||
int GetNote(int n) { return m_SampleDescVec[n]->Note; } | |||
vector<Sample*> m_SampleVec; | |||
vector<SampleDesc*> m_SampleDescVec; | |||
std::vector<Sample*> m_SampleVec; | |||
std::vector<SampleDesc*> m_SampleDescVec; | |||
private: | |||
}; | |||