Browse Source

GUI Updates, New Echo/Delay GUI, New Echo Functionality (take 2)

master
edgeeffect 22 years ago
parent
commit
20751cfc4b
8 changed files with 57 additions and 41 deletions
  1. +1
    -3
      SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.C
  2. +38
    -9
      SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.C
  3. +1
    -1
      SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.h
  4. +2
    -0
      SpiralSound/Plugins/TransposePlugin/TransposePluginGUI.C
  5. +0
    -21
      SpiralSound/Plugins/Widgets/Fl_SevenSeg.H
  6. +5
    -2
      SpiralSound/Plugins/Widgets/Fl_VU_Meter.cxx
  7. +4
    -0
      SpiralSound/Plugins/Widgets/Fl_VU_Meter.h
  8. +6
    -5
      SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.C

+ 1
- 3
SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.C View File

@@ -39,6 +39,7 @@ SpiralPluginGUI(w,h,o,ch) {
m_Chan[n] = new Fl_Slider (20 + (2 + Width * 2) * n, 22, Width, Height, "");
m_Chan[n]->type (4);
m_Chan[n]->selection_color (GUI_COLOUR);
m_Chan[n]->box (FL_PLASTIC_DOWN_BOX);
m_Chan[n]->labelsize (10);
m_Chan[n]->maximum (2);
m_Chan[n]->step (0.01);
@@ -54,9 +55,6 @@ SpiralPluginGUI(w,h,o,ch) {
m_Pan[n]->step (0.01);
m_Pan[n]->value (0.5);
m_Pan[n]->callback ((Fl_Callback*)cb_Pan, (void*)&Numbers[n]);
// This line used to be
// add (m_Chan[n]);
// I'm guessing this an error, but I could be wrong there
add (m_Pan[n]);
}



+ 38
- 9
SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.C View File

@@ -25,8 +25,6 @@ static const int GUI_COLOUR = 179;
static const int GUIBG_COLOUR = 144;
static const int GUIBG2_COLOUR = 145;

char PitchLabel[256];

////////////////////////////////////////////

StreamPluginGUI::StreamPluginGUI(int w, int h,StreamPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
@@ -37,8 +35,8 @@ m_PitchValue (1.0f)
for (int dis=0; dis<6; dis++) {
m_Display[dis] = new Fl_SevenSeg (5 + 28*dis, 20, 28, 60);
m_Display[dis] -> bar_width (4);
m_Display[dis] -> color (FL_WHITE);
m_Display[dis] -> color2 (GUI_COLOUR);
m_Display[dis] -> color (FL_BLACK);
m_Display[dis] -> color2 (FL_GRAY);
if (dis > 0 && dis % 2 == 0) m_Display[dis] -> dp (colon);
add (m_Display[dis]);
}
@@ -55,9 +53,11 @@ m_PitchValue (1.0f)
// pitch indicator
m_Pitch = new Fl_Slider (5, 85, 235, 20, "");
m_Pitch->type (FL_HORIZONTAL);
m_Pitch->align (FL_ALIGN_INSIDE | FL_ALIGN_RIGHT);
m_Pitch->labelsize (10);
m_Pitch->labelcolor (GUI_COLOUR);
m_Pitch->label (m_PitchLabel);
m_Pitch->selection_color (GUI_COLOUR);
m_Pitch->box (FL_PLASTIC_DOWN_BOX);
m_Pitch->maximum (20);
m_Pitch->step (0.001);
UpdatePitch (true, false, false);
@@ -66,51 +66,78 @@ m_PitchValue (1.0f)
// position indicator
m_Pos = new Fl_Slider (5, 108, 235, 20, "");
m_Pos->type (FL_HORIZONTAL);
m_Pos->box (FL_PLASTIC_DOWN_BOX);
m_Pos->labelcolor (GUI_COLOUR);
m_Pos->selection_color (GUI_COLOUR);
m_Pos->maximum (1);
m_Pos->callback ((Fl_Callback*)cb_Pos);
add (m_Pos);
// load btn
m_Load = new Fl_Button (2, 130, 30, 30, "Load");
m_Load->labelsize (9);
m_Load->box (FL_PLASTIC_UP_BOX);
m_Load->color (GUI_COLOUR);
m_Load->selection_color (GUI_COLOUR);
m_Load->callback ((Fl_Callback*)cb_Load);
add (m_Load);
// reset btn
m_ToStart = new Fl_Button (32, 130, 30, 30, "@|<");
m_ToStart->labelsize (10);
m_ToStart->labeltype (FL_SYMBOL_LABEL);
m_ToStart->box (FL_PLASTIC_UP_BOX);
m_ToStart->color (GUI_COLOUR);
m_ToStart->selection_color (GUI_COLOUR);
m_ToStart->callback ((Fl_Callback*)cb_ToStart);
add (m_ToStart);
// stop btn
m_Stop = new Fl_Button (62, 130, 30, 30, "@||");
m_Stop->labelsize (10);
m_Stop->labeltype (FL_SYMBOL_LABEL);
m_Stop->box (FL_PLASTIC_UP_BOX);
m_Stop->color (GUI_COLOUR);
m_Stop->selection_color (GUI_COLOUR);
m_Stop->callback ((Fl_Callback*)cb_Stop);
add (m_Stop);
// play btn
m_Play = new Fl_Button (92, 130, 30, 30, "@>");
m_Play->labelsize (10);
m_Play->labeltype (FL_SYMBOL_LABEL);
m_Play->box (FL_PLASTIC_UP_BOX);
m_Play->color (GUI_COLOUR);
m_Play->selection_color (GUI_COLOUR);
m_Play->callback ((Fl_Callback*)cb_Play);
add (m_Play);
// 1/2 speed btn
m_Div = new Fl_Button (122, 130, 30, 30, "/2");
m_Div->labelsize (9);
m_Div->box (FL_PLASTIC_UP_BOX);
m_Div->color (GUI_COLOUR);
m_Div->selection_color (GUI_COLOUR);
m_Div->callback ((Fl_Callback*)cb_Div);
add (m_Div);
// normal speed btn
m_Reset = new Fl_Button (152, 130, 30, 30, "Reset");
m_Reset->labelsize (9);
m_Reset->box (FL_PLASTIC_UP_BOX);
m_Reset->color (GUI_COLOUR);
m_Reset->selection_color (GUI_COLOUR);
m_Reset->callback ((Fl_Callback*)cb_Reset);
add (m_Reset);
// dbl speed btn
m_Dbl = new Fl_Button (182, 130, 30, 30, "X2");
m_Dbl->labelsize (9);
m_Dbl->box (FL_PLASTIC_UP_BOX);
m_Dbl->color (GUI_COLOUR);
m_Dbl->selection_color (GUI_COLOUR);
m_Dbl->callback ((Fl_Callback*)cb_Dbl);
add (m_Dbl);
// nudge btn
m_Nudge = new Fl_Repeat_Button (212, 130, 30, 30, "Nudge");
m_Nudge->labelsize (9);
m_Nudge->callback ((Fl_Callback*)cb_Nudge);
m_Nudge->box (FL_PLASTIC_UP_BOX);
m_Nudge->color (GUI_COLOUR);
m_Nudge->selection_color (GUI_COLOUR);
m_Nudge->callback ((Fl_Callback*)cb_Nudge);
add (m_Nudge);
}

@@ -137,7 +164,8 @@ void StreamPluginGUI::Update() {
void StreamPluginGUI::UpdateValues (SpiralPlugin *o) {
StreamPlugin *Plugin = (StreamPlugin*)o;
m_Volume->value (Plugin->GetVolume());
m_Pitch->value (Plugin->GetPitch()+10);
m_PitchValue = Plugin->GetPitch();
UpdatePitch (true, true, false);
}

// volume
@@ -153,8 +181,9 @@ void StreamPluginGUI::cb_Volume (Fl_Knob* o, void* v) {
// pitch

void StreamPluginGUI::UpdatePitch (bool UpdateIt, bool DrawIt, bool SendIt) {
sprintf( PitchLabel, "%1.3f ", m_PitchValue);
m_Pitch->label (PitchLabel);
if (m_PitchValue<0) m_Pitch->align (FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
else m_Pitch->align (FL_ALIGN_INSIDE | FL_ALIGN_RIGHT);
sprintf (m_PitchLabel, " %1.3f ", m_PitchValue);
if (UpdateIt) m_Pitch->value (m_PitchValue+10);
if (DrawIt) redraw();
if (SendIt) m_GUICH->Set ("Pitch", m_PitchValue);


+ 1
- 1
SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.h View File

@@ -40,7 +40,7 @@ class StreamPluginGUI : public SpiralPluginGUI {
const string GetHelpText (const string &loc);
private:
float m_PitchValue;
char m_TextBuf[256];
char m_TextBuf[256], m_PitchLabel[256];
void SetMaxTime (float t) { m_Pos->maximum(t); }
void UpdatePitch (bool UpdateIt = true, bool DrawIt = true, bool SendIt = true);
// Widgets


+ 2
- 0
SpiralSound/Plugins/TransposePlugin/TransposePluginGUI.C View File

@@ -31,6 +31,8 @@ SpiralPluginGUI (w, h, o, ch)
m_Amount = new Fl_Counter (10, 20, 50, 20, "Amount");
m_Amount->color (GUI_COLOUR);
m_Amount->type (FL_SIMPLE_COUNTER);
m_Amount->box (FL_PLASTIC_UP_BOX);
m_Amount->color (GUI_COLOUR);
m_Amount->textsize (10);
m_Amount->labelsize (10);
m_Amount->step (1);


+ 0
- 21
SpiralSound/Plugins/Widgets/Fl_SevenSeg.H View File

@@ -6,38 +6,19 @@
#include <FL/fl_draw.H>
#include <FL/Fl_Widget.H>

// Andy Preston
enum dp_type { off, point, colon };




class Fl_SevenSeg : public Fl_Widget {

// Andy Preston changed
// int digit,decpt,segwidth;
// to
int digit, segwidth;
dp_type decpt;


public:
Fl_SevenSeg(int x,int y,int w,int h);
~Fl_SevenSeg(void);
void value(int v);
void value(char c);
const int value(void);

// Andy Preston changed
// void dp (int onoff);
// to
void dp (dp_type state);

// Andy Preston changed
// const int dp(void);
// to
const dp_type dp (void);

const int bar_width(void);
void bar_width(int w);
private:
@@ -49,8 +30,6 @@ private:
void draw_seg_e(int xx,int yy,int ww,int hh);
void draw_seg_f(int xx,int yy,int ww,int hh);
void draw_seg_g(int xx,int yy,int ww,int hh);

// Andy Preston
void draw_seg_dp (int xx, int yy, int ww, int hh);
void draw_seg_col (int xx, int yy, int ww, int hh);



+ 5
- 2
SpiralSound/Plugins/Widgets/Fl_VU_Meter.cxx View File

@@ -27,8 +27,11 @@ void Fl_VU_Meter::draw() {
int block = 0;
for (int block_pos = 0; block_pos < progress; block_pos += block_width) {
Fl_Color colour;
if (++block == 16) colour = FL_RED;
else if (block > 10) colour = FL_YELLOW;
if (m_VUMode) {
if (++block == 16) colour = FL_RED;
else if (block > 10) colour = FL_YELLOW;
else colour = FL_GREEN;
}
else colour = FL_GREEN;
if (!active_r()) colour = fl_inactive (colour);
fl_push_clip (x() + block_pos, y(), block_width - 2, h());


+ 4
- 0
SpiralSound/Plugins/Widgets/Fl_VU_Meter.h View File

@@ -6,8 +6,12 @@
class Fl_VU_Meter : public Fl_Progress {
public:
FL_EXPORT Fl_VU_Meter (int x, int y, int w, int h, const char *l = 0);
const bool vu_mode (void) { return m_VUMode; };
void vu_mode (bool m) { m_VUMode=m; };
protected:
FL_EXPORT virtual void draw();
private:
bool m_VUMode;
};

#endif

+ 6
- 5
SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.C View File

@@ -30,13 +30,14 @@ XFadePluginGUI::XFadePluginGUI(int w, int h,XFadePlugin *o,ChannelHandler *ch,co
SpiralPluginGUI(w,h,o,ch)
{
m_Mix = new Fl_Slider(5, 20, 200, 20, "");
m_Mix->type(FL_HORIZONTAL);
m_Mix->type(FL_HOR_NICE_SLIDER);
m_Mix->box (FL_PLASTIC_DOWN_BOX);
m_Mix->selection_color(GUI_COLOUR);
m_Mix->labelsize(10);
m_Mix->labelsize(10);
m_Mix->maximum(1);
m_Mix->step(0.0001);
m_Mix->value(0.5);
m_Mix->callback((Fl_Callback*)cb_Mix);
m_Mix->step(0.0001);
m_Mix->value(0.5);
m_Mix->callback((Fl_Callback*)cb_Mix);
end();
}


Loading…
Cancel
Save