mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Updated UI, clipselector has popup menu
This commit is contained in:
parent
3313e54d96
commit
7c6f09291d
3 changed files with 80 additions and 64 deletions
|
@ -44,7 +44,7 @@ class ClipState
|
|||
ClipState()
|
||||
{
|
||||
state = CLIP_EMPTY;
|
||||
name = "Clip";
|
||||
name = "";
|
||||
}
|
||||
ClipState(std::string n)
|
||||
{
|
||||
|
@ -189,7 +189,7 @@ class ClipSelector : public Fl_Button
|
|||
cairo_move_to( cr, x+clipHeight-1+ 10, drawY + 15 );
|
||||
cairo_set_source_rgba( cr, 255 / 255.f, 255 / 255.f , 255 / 255.f , 1 );
|
||||
cairo_set_font_size( cr, 10 );
|
||||
cairo_show_text( cr, label );
|
||||
cairo_show_text( cr, clips[i].name.c_str() );
|
||||
|
||||
drawY += clipHeight;
|
||||
}
|
||||
|
@ -236,32 +236,54 @@ class ClipSelector : public Fl_Button
|
|||
// handle right clicks: popup menu
|
||||
if ( Fl::event_state(FL_BUTTON3) )
|
||||
{
|
||||
|
||||
Fl_Menu_Item rclick_menu[] =
|
||||
{
|
||||
{ "Load" },
|
||||
{ "Duration" },
|
||||
{ 0 }
|
||||
};
|
||||
Fl_Menu_Item *m = (Fl_Menu_Item*) rclick_menu->popup(Fl::event_x(), Fl::event_y(), 0, 0, 0);
|
||||
if ( !m )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if ( strcmp(m->label(), "Load") == 0 )
|
||||
{
|
||||
fl_choice("Loading...", "OK", NULL, NULL);
|
||||
clips[clipNum].state = ClipState::CLIP_LOADED;
|
||||
}
|
||||
else if ( strcmp(m->label(), "Duration") == 0 )
|
||||
{
|
||||
//clips[clipNum].name = "title";
|
||||
clips[clipNum].state = ClipState::CLIP_QUEUED;
|
||||
}
|
||||
}
|
||||
|
||||
switch( clips[clipNum].state )
|
||||
else
|
||||
{
|
||||
case ClipState::CLIP_EMPTY:
|
||||
clips[clipNum].state = ClipState::CLIP_RECORDING;
|
||||
break;
|
||||
case ClipState::CLIP_LOADED:
|
||||
clips[clipNum].state = ClipState::CLIP_QUEUED;
|
||||
break;
|
||||
case ClipState::CLIP_QUEUED:
|
||||
clips[clipNum].state = ClipState::CLIP_PLAYING;
|
||||
break;
|
||||
case ClipState::CLIP_PLAYING:
|
||||
clips[clipNum].state = ClipState::CLIP_STOPPING;
|
||||
break;
|
||||
case ClipState::CLIP_RECORDING:
|
||||
clips[clipNum].state = ClipState::CLIP_STOPPING;
|
||||
break;
|
||||
case ClipState::CLIP_STOPPING:
|
||||
clips[clipNum].state = ClipState::CLIP_PLAYING;
|
||||
break;
|
||||
default:
|
||||
printf("Avtk::ClipSelector, warning: unknown clip type\n");
|
||||
|
||||
switch( clips[clipNum].state )
|
||||
{
|
||||
case ClipState::CLIP_EMPTY:
|
||||
clips[clipNum].state = ClipState::CLIP_RECORDING;
|
||||
break;
|
||||
case ClipState::CLIP_LOADED:
|
||||
clips[clipNum].state = ClipState::CLIP_QUEUED;
|
||||
break;
|
||||
case ClipState::CLIP_QUEUED:
|
||||
clips[clipNum].state = ClipState::CLIP_PLAYING;
|
||||
break;
|
||||
case ClipState::CLIP_PLAYING:
|
||||
clips[clipNum].state = ClipState::CLIP_STOPPING;
|
||||
break;
|
||||
case ClipState::CLIP_RECORDING:
|
||||
clips[clipNum].state = ClipState::CLIP_STOPPING;
|
||||
break;
|
||||
case ClipState::CLIP_STOPPING:
|
||||
clips[clipNum].state = ClipState::CLIP_PLAYING;
|
||||
break;
|
||||
default:
|
||||
printf("Avtk::ClipSelector, warning: unknown clip type\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
redraw();
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Group.H>
|
||||
#include <FL/Fl_Slider.H>
|
||||
#include <FL/Fl_Progress.H>
|
||||
|
||||
#include "avtk/avtk_dial.h"
|
||||
#include "avtk/avtk_button.h"
|
||||
|
@ -61,22 +62,16 @@ class GMasterTrack : public Fl_Group
|
|||
|
||||
clipSel(x + 5, y + 26 + 102, 140, 294,"Testing"),
|
||||
|
||||
volBox(x+5, y+522+2, 140, 172, ""),
|
||||
|
||||
tapTempo(x + 25 + 22, y + 475 + 26, 44, 44,"Tap"),
|
||||
/*
|
||||
button2(x + 5, y + 44, 100, 18,"Play"),
|
||||
button3(x + 5, y + 64, 100, 18,"Stop"),
|
||||
button4(x + 5, y + 84, 48, 18,"-"),
|
||||
button5(x +57, y + 84, 48, 18,"+"),
|
||||
button6(x + 5, y +104, 18, 18,"6"),
|
||||
*/
|
||||
metronomeButton(x + 5,y + 424 + 26,140,30,"Metro"),
|
||||
source(x+5, y+26, 140, 100, "Audio IN"),
|
||||
fxBox(x+5, y+ 421, 140, 100, ""),
|
||||
|
||||
tapTempo(x + 25 + 52, y + 450 + 26, 66, 30,"Tap"),
|
||||
metronomeButton(x + 7,y + 450 + 26, 66, 30,"Metro"),
|
||||
|
||||
dial1(x+54, y + 420, 44, 44, "BPM"),
|
||||
|
||||
dial1(x+25-22, y +465 + 26, 44, 44, "BPM"),
|
||||
/*
|
||||
dial2(x+45, y +155, 24, 24, "B"),
|
||||
dial3(x+75, y +155, 24, 24, "C")
|
||||
*/
|
||||
volume(x+108, y +530, 36, 150, "Vol")
|
||||
{
|
||||
ID = privateID++;
|
||||
|
@ -85,13 +80,19 @@ class GMasterTrack : public Fl_Group
|
|||
|
||||
volume.amplitude( 0.75, 0.8 );
|
||||
|
||||
/*
|
||||
button2.callback( gmastertrack_button_callback, &ID );
|
||||
button3.callback( gmastertrack_button_callback, &ID );
|
||||
button4.callback( gmastertrack_button_callback, &ID );
|
||||
button5.callback( gmastertrack_button_callback, &ID );
|
||||
button6.callback( gmastertrack_button_callback, &ID );
|
||||
*/
|
||||
volBox.maximum(1.0f);
|
||||
volBox.minimum(0.0f);
|
||||
volBox.color( FL_BLACK );
|
||||
volBox.selection_color( FL_BLUE );
|
||||
fxBox.maximum(1.0f);
|
||||
fxBox.minimum(0.0f);
|
||||
fxBox.color( FL_BLACK );
|
||||
fxBox.selection_color( FL_BLUE );
|
||||
source.maximum(1.0f);
|
||||
source.minimum(0.0f);
|
||||
source.color( FL_BLACK );
|
||||
source.selection_color( FL_BLUE );
|
||||
|
||||
metronomeButton.callback( gmastertrack_button_callback, 0 );
|
||||
dial1.callback( gmastertrack_button_callback, 0 );
|
||||
|
||||
|
@ -113,21 +114,14 @@ class GMasterTrack : public Fl_Group
|
|||
|
||||
Avtk::ClipSelector clipSel;
|
||||
|
||||
Fl_Progress source;
|
||||
Fl_Progress volBox;
|
||||
Fl_Progress fxBox;
|
||||
|
||||
Avtk::Button tapTempo;
|
||||
/*
|
||||
Avtk::Button button2;
|
||||
Avtk::Button button3;
|
||||
Avtk::Button button4;
|
||||
Avtk::Button button5;
|
||||
Avtk::Button button6;
|
||||
*/
|
||||
Avtk::LightButton metronomeButton;
|
||||
|
||||
Avtk::Dial dial1;
|
||||
/*
|
||||
Avtk::Dial dial2;
|
||||
Avtk::Dial dial3;
|
||||
*/
|
||||
|
||||
Avtk::Volume volume;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ class GTrack : public Fl_Group
|
|||
|
||||
clipSel(x + 5, y + 26 + 102, 100, 294,""),
|
||||
|
||||
volBox(x+5, y+522+2, 100, 250, ""),
|
||||
volBox(x+5, y+522+2, 100, 172, ""),
|
||||
|
||||
/*
|
||||
button1(x + 5, y + 324 + 102, 100, 18,"Rec"),
|
||||
|
@ -69,17 +69,17 @@ class GTrack : public Fl_Group
|
|||
button6(x + 5, y + 404 + 102, 100, 18,"Load"),
|
||||
*/
|
||||
|
||||
volume(x+66, y +526, 36, 160, "Vol"),
|
||||
volume(x+66, y +527, 36, 150, "Vol"),
|
||||
|
||||
dial1(x+25, y +452 + 102, 24, 24, "REV"),
|
||||
dial2(x+25, y +452 + 152, 24, 24, "SC"),
|
||||
dial3(x+25, y +452 + 202, 24, 24, "POST"),
|
||||
dial1(x+22, y +440 + 100, 30, 30, "Rev"),
|
||||
dial2(x+22, y +440 + 150, 30, 30, "S-C"),
|
||||
dial3(x+22, y +440 + 200, 30, 30, "P-S"),
|
||||
|
||||
progress(x+5, y+ 26, 100, 100, "Source UI"),
|
||||
|
||||
//unit(x+5, y+200+26, 100, 100, "Unit"),
|
||||
|
||||
fx(x+5, y+ 422, 100, 100, "FX")
|
||||
fx(x+5, y+ 421, 100, 100, "FX")
|
||||
{
|
||||
ID = privateID++;
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue