|
|
@@ -26,15 +26,18 @@ static const int GUIBG_COLOUR = 144; |
|
|
|
static const int GUIBG2_COLOUR = 145; |
|
|
|
char PitchLabel[256]; |
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////// |
|
|
|
|
|
|
|
StreamPluginGUI::StreamPluginGUI(int w, int h,StreamPlugin *o,const HostInfo *Info) : |
|
|
|
SpiralPluginGUI(w,h,o) |
|
|
|
StreamPluginGUI::StreamPluginGUI(int w, int h,StreamPlugin *o,ChannelHandler *ch,const HostInfo *Info) : |
|
|
|
SpiralPluginGUI(w,h,o,ch) |
|
|
|
{ |
|
|
|
m_Plugin=o; |
|
|
|
|
|
|
|
int Width=20; |
|
|
|
int Height=100; |
|
|
|
|
|
|
|
//int Width=20; |
|
|
|
//int Height=100; |
|
|
|
//What are Width and Height for. |
|
|
|
|
|
|
|
m_PitchValue=1.0f; |
|
|
|
|
|
|
|
m_Load = new Fl_Button(2, 130, 30, 30, "Load"); |
|
|
|
m_Load->labelsize(9); |
|
|
@@ -158,8 +161,34 @@ SpiralPluginGUI(w,h,o) |
|
|
|
end(); |
|
|
|
} |
|
|
|
|
|
|
|
void StreamPluginGUI::SetTime(float t) |
|
|
|
StreamPluginGUI::~StreamPluginGUI() |
|
|
|
{ |
|
|
|
cerr << "~StreamPluginGUI" << endl; |
|
|
|
} |
|
|
|
|
|
|
|
void StreamPluginGUI::Update() |
|
|
|
{ |
|
|
|
float t=m_GUICH->GetFloat("TimeOut"); |
|
|
|
|
|
|
|
m_Pos->value(t); |
|
|
|
|
|
|
|
m_Display[5]->value((int)(t*100)%10); |
|
|
|
m_Display[4]->value((int)(t*10)%10); |
|
|
|
|
|
|
|
m_Display[3]->value((int)t%10); |
|
|
|
m_Display[2]->value((int)(t/10)%6); |
|
|
|
|
|
|
|
m_Display[1]->value((int)(t/60)%10); |
|
|
|
m_Display[0]->value((int)(t/600)%10); |
|
|
|
redraw(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/*void StreamPluginGUI::SetTime() |
|
|
|
{ |
|
|
|
cerr << "foo" << endl; |
|
|
|
float t=m_GUICH->GetFloat("TimeOut"); |
|
|
|
|
|
|
|
m_Pos->value(t); |
|
|
|
|
|
|
|
m_Display[5]->value((int)(t*100)%10); |
|
|
@@ -171,14 +200,16 @@ void StreamPluginGUI::SetTime(float t) |
|
|
|
m_Display[1]->value((int)(t/60)%10); |
|
|
|
m_Display[0]->value((int)(t/600)%10); |
|
|
|
redraw(); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
void StreamPluginGUI::UpdateValues() |
|
|
|
void StreamPluginGUI::UpdateValues(SpiralPlugin *o) |
|
|
|
{ |
|
|
|
m_Volume->value(m_Plugin->GetVolume()); |
|
|
|
m_Pitch->value(m_Plugin->GetPitch()+10); |
|
|
|
m_Loop->value(m_Plugin->GetLoop()); |
|
|
|
StreamPlugin *Plugin = (StreamPlugin*)o; |
|
|
|
|
|
|
|
m_Volume->value(Plugin->GetVolume()); |
|
|
|
m_Pitch->value(Plugin->GetPitch()+10); |
|
|
|
m_Loop->value(Plugin->GetLoop()); |
|
|
|
} |
|
|
|
|
|
|
|
inline void StreamPluginGUI::cb_Load_i(Fl_Button* o, void* v) |
|
|
@@ -187,33 +218,36 @@ inline void StreamPluginGUI::cb_Load_i(Fl_Button* o, void* v) |
|
|
|
|
|
|
|
if (fn && fn!='\0') |
|
|
|
{ |
|
|
|
m_Plugin->OpenStream(fn); |
|
|
|
strcpy(m_TextBuf,fn); |
|
|
|
m_GUICH->Set("FileName",m_TextBuf); |
|
|
|
m_GUICH->SetCommand(StreamPlugin::LOAD); |
|
|
|
} |
|
|
|
} |
|
|
|
void StreamPluginGUI::cb_Load(Fl_Button* o, void* v) |
|
|
|
{ ((StreamPluginGUI*)(o->parent()))->cb_Load_i(o,v);} |
|
|
|
|
|
|
|
inline void StreamPluginGUI::cb_Volume_i(Fl_Knob* o, void* v) |
|
|
|
{ m_Plugin->SetVolume(o->value()); } |
|
|
|
{ m_GUICH->Set("Volume",(float)o->value()); } |
|
|
|
void StreamPluginGUI::cb_Volume(Fl_Knob* o, void* v) |
|
|
|
{ ((StreamPluginGUI*)(o->parent()))->cb_Volume_i(o,v);} |
|
|
|
|
|
|
|
inline void StreamPluginGUI::cb_Pitch_i(Fl_Slider* o, void* v) |
|
|
|
{ |
|
|
|
m_Plugin->SetPitch(o->value()-10); |
|
|
|
m_GUICH->Set("Pitch",(float)o->value()-10); |
|
|
|
sprintf(PitchLabel,"%1.3f ",o->value()-10); |
|
|
|
m_Pitch->label(PitchLabel); |
|
|
|
m_PitchValue=o->value()-10; |
|
|
|
} |
|
|
|
void StreamPluginGUI::cb_Pitch(Fl_Slider* o, void* v) |
|
|
|
{ ((StreamPluginGUI*)(o->parent()))->cb_Pitch_i(o,v);} |
|
|
|
|
|
|
|
inline void StreamPluginGUI::cb_Loop_i(Fl_Button* o, void* v) |
|
|
|
inline void StreamPluginGUI::cb_Loop_i(Fl_Button* o, void* v) //Why is this function named so. |
|
|
|
{ |
|
|
|
float p=m_Plugin->GetPitch()*2; |
|
|
|
m_Plugin->SetPitch(p); |
|
|
|
sprintf(PitchLabel,"%1.3f ",p); |
|
|
|
m_PitchValue*=2.0f; |
|
|
|
m_GUICH->SetCommand(StreamPlugin::DOUBLE); |
|
|
|
sprintf(PitchLabel,"%1.3f ",m_PitchValue); |
|
|
|
m_Pitch->label(PitchLabel); |
|
|
|
m_Pitch->value(p+10); |
|
|
|
m_Pitch->value(m_PitchValue+10); |
|
|
|
redraw(); |
|
|
|
} |
|
|
|
void StreamPluginGUI::cb_Loop(Fl_Button* o, void* v) |
|
|
@@ -221,37 +255,38 @@ void StreamPluginGUI::cb_Loop(Fl_Button* o, void* v) |
|
|
|
|
|
|
|
inline void StreamPluginGUI::cb_Div_i(Fl_Button* o, void* v) |
|
|
|
{ |
|
|
|
float p=m_Plugin->GetPitch()/2.0f; |
|
|
|
m_Plugin->SetPitch(p); |
|
|
|
sprintf(PitchLabel,"%1.3f ",p); |
|
|
|
m_PitchValue/=2.0f; |
|
|
|
m_GUICH->SetCommand(StreamPlugin::HALF); |
|
|
|
sprintf(PitchLabel,"%1.3f ",m_PitchValue); |
|
|
|
m_Pitch->label(PitchLabel); |
|
|
|
m_Pitch->value(p+10); |
|
|
|
m_Pitch->value(m_PitchValue+10); |
|
|
|
redraw(); |
|
|
|
} |
|
|
|
void StreamPluginGUI::cb_Div(Fl_Button* o, void* v) |
|
|
|
{ ((StreamPluginGUI*)(o->parent()))->cb_Div_i(o,v);} |
|
|
|
|
|
|
|
inline void StreamPluginGUI::cb_ToStart_i(Fl_Button* o, void* v) |
|
|
|
{ m_Plugin->Restart(); } |
|
|
|
{ m_GUICH->SetCommand(StreamPlugin::RESTART); } |
|
|
|
void StreamPluginGUI::cb_ToStart(Fl_Button* o, void* v) |
|
|
|
{ ((StreamPluginGUI*)(o->parent()))->cb_ToStart_i(o,v);} |
|
|
|
|
|
|
|
inline void StreamPluginGUI::cb_Stop_i(Fl_Button* o, void* v) |
|
|
|
{ m_Plugin->Stop(); } |
|
|
|
{ m_GUICH->SetCommand(StreamPlugin::STOP); } |
|
|
|
void StreamPluginGUI::cb_Stop(Fl_Button* o, void* v) |
|
|
|
{ ((StreamPluginGUI*)(o->parent()))->cb_Stop_i(o,v);} |
|
|
|
|
|
|
|
inline void StreamPluginGUI::cb_Play_i(Fl_Button* o, void* v) |
|
|
|
{ m_Plugin->Play(); } |
|
|
|
{ m_GUICH->SetCommand(StreamPlugin::PLAY); } |
|
|
|
void StreamPluginGUI::cb_Play(Fl_Button* o, void* v) |
|
|
|
{ ((StreamPluginGUI*)(o->parent()))->cb_Play_i(o,v);} |
|
|
|
|
|
|
|
inline void StreamPluginGUI::cb_Reset_i(Fl_Button* o, void* v) |
|
|
|
{ |
|
|
|
m_Plugin->SetPitch(1); |
|
|
|
m_GUICH->SetCommand(StreamPlugin::RESET); |
|
|
|
sprintf(PitchLabel,"%1.3f ",1.0); |
|
|
|
m_Pitch->label(PitchLabel); |
|
|
|
m_Pitch->value(11); |
|
|
|
m_PitchValue=1.0f; |
|
|
|
redraw(); |
|
|
|
} |
|
|
|
void StreamPluginGUI::cb_Reset(Fl_Button* o, void* v) |
|
|
@@ -259,13 +294,16 @@ void StreamPluginGUI::cb_Reset(Fl_Button* o, void* v) |
|
|
|
|
|
|
|
inline void StreamPluginGUI::cb_Nudge_i(Fl_Button* o, void* v) |
|
|
|
{ |
|
|
|
m_Plugin->Nudge(); |
|
|
|
m_GUICH->SetCommand(StreamPlugin::NUDGE); |
|
|
|
} |
|
|
|
void StreamPluginGUI::cb_Nudge(Fl_Button* o, void* v) |
|
|
|
{ ((StreamPluginGUI*)(o->parent()))->cb_Nudge_i(o,v);} |
|
|
|
|
|
|
|
inline void StreamPluginGUI::cb_Pos_i(Fl_Slider* o, void* v) |
|
|
|
{ m_Plugin->SetTime(o->value()); } |
|
|
|
{ |
|
|
|
m_GUICH->Set("Time",(float)o->value()); |
|
|
|
m_GUICH->SetCommand(StreamPlugin::SET_TIME); |
|
|
|
} |
|
|
|
void StreamPluginGUI::cb_Pos(Fl_Slider* o, void* v) |
|
|
|
{ ((StreamPluginGUI*)(o->parent()))->cb_Pos_i(o,v);} |
|
|
|
|