mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-UI tooltip & updated
This commit is contained in:
parent
dc1ffecebb
commit
a99daa5aa8
5 changed files with 41 additions and 20 deletions
|
@ -59,10 +59,10 @@ class GMasterTrack : public Fl_Group
|
|||
title( strdup(l) ),
|
||||
bg( x, y , w, h, title ),
|
||||
|
||||
clipSel(x + 5, y + 26, 140, 294,"Testing"),
|
||||
clipSel(x + 5, y + 26 + 26, 140, 294,"Testing"),
|
||||
|
||||
|
||||
tapTempo(x + 25 + 22, y + 475, 44, 44,"Tap"),
|
||||
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"),
|
||||
|
@ -70,14 +70,14 @@ class GMasterTrack : public Fl_Group
|
|||
button5(x +57, y + 84, 48, 18,"+"),
|
||||
button6(x + 5, y +104, 18, 18,"6"),
|
||||
*/
|
||||
metronomeButton(x + 5,y + 424,140,30,"Metro"),
|
||||
metronomeButton(x + 5,y + 424 + 26,140,30,"Metro"),
|
||||
|
||||
dial1(x+25-22, y +475, 44, 44, "BPM"),
|
||||
dial1(x+25-22, y +475 + 26, 44, 44, "BPM"),
|
||||
/*
|
||||
dial2(x+45, y +155, 24, 24, "B"),
|
||||
dial3(x+75, y +155, 24, 24, "C")
|
||||
*/
|
||||
volume(x+108, y +495, 36, 150, "Vol")
|
||||
volume(x+108, y +495 + 26, 36, 150, "Vol")
|
||||
{
|
||||
ID = privateID++;
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "avtk/avtk_clip_selector.h"
|
||||
|
||||
|
||||
#include "config.hxx"
|
||||
#include "worker.hxx"
|
||||
#include "audiobuffer.hxx"
|
||||
#include "eventhandler.hxx"
|
||||
|
@ -55,11 +56,13 @@ static void gtrack_button_callback(Fl_Widget *w, void *data) {
|
|||
{
|
||||
EventLooperState e = EventLooperState(track,Looper::STATE_RECORD_QUEUED);
|
||||
writeToDspRingbuffer( &e );
|
||||
w->tooltip( "Rec Clicked" );
|
||||
}
|
||||
else if ( strcmp( w->label() , "Play" ) == 0 )
|
||||
{
|
||||
EventLooperState e = EventLooperState(track,Looper::STATE_PLAY_QUEUED);
|
||||
writeToDspRingbuffer( &e );
|
||||
w->tooltip( "Play clicked" );
|
||||
}
|
||||
else if ( strcmp( w->label() , "Stop" ) == 0 )
|
||||
{
|
||||
|
@ -102,23 +105,23 @@ class GTrack : public Fl_Group
|
|||
title( strdup(l) ),
|
||||
bg( x, y , w, h, title ),
|
||||
|
||||
clipSel(x + 5, y + 26, 100, 294,"Clip"),
|
||||
clipSel(x + 5, y + 26 + 26, 100, 294,""),
|
||||
|
||||
button1(x + 5, y + 324, 100, 18,"Rec"),
|
||||
button2(x + 5, y + 344, 100, 18,"Play"),
|
||||
button3(x + 5, y + 364, 100, 18,"Stop"),
|
||||
button4(x + 5, y + 384, 48, 18,"-"),
|
||||
button5(x +57, y + 384, 48, 18,"+"),
|
||||
button1(x + 5, y + 324 + 26, 100, 18,"Rec"),
|
||||
button2(x + 5, y + 344 + 26, 100, 18,"Play"),
|
||||
button3(x + 5, y + 364 + 26, 100, 18,"Stop"),
|
||||
button4(x + 5, y + 384 + 26, 48, 18,"-"),
|
||||
button5(x +57, y + 384 + 26, 48, 18,"+"),
|
||||
|
||||
button6(x + 5, y + 404, 100, 18,"Load"),
|
||||
button6(x + 5, y + 404 + 26, 100, 18,"Load"),
|
||||
|
||||
volume(x+68, y +495, 36, 150, "Vol"),
|
||||
volume(x+68, y +495 + 26, 36, 150, "Vol"),
|
||||
|
||||
dial1(x+15, y +452, 24, 24, "REV"),
|
||||
dial2(x+45, y +452, 24, 24, "SC"),
|
||||
dial3(x+75, y +452, 24, 24, "POST"),
|
||||
dial1(x+15, y +452 + 26, 24, 24, "REV"),
|
||||
dial2(x+45, y +452 + 26, 24, 24, "SC"),
|
||||
dial3(x+75, y +452 + 26, 24, 24, "POST"),
|
||||
|
||||
progress(x+5, y+428, 100, 18, "")
|
||||
progress(x+5, y+428 + 26, 100, 18, "")
|
||||
{
|
||||
ID = privateID++;
|
||||
|
||||
|
|
14
src/gui.cxx
14
src/gui.cxx
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include <sstream>
|
||||
|
||||
#include <FL/Fl_Tooltip.H>
|
||||
|
||||
#include "audiobuffer.hxx"
|
||||
|
||||
// include the header.c file in the planning dir:
|
||||
|
@ -11,12 +13,14 @@
|
|||
#include "../planning/header.c"
|
||||
|
||||
// Hack, move to gtrack.cpp
|
||||
Fl_Box* Gui::tooltipLabel = 0;
|
||||
int GTrack::privateID = 0;
|
||||
int GMasterTrack::privateID = 0;
|
||||
int AudioBuffer::privateID = 0;
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
void close_cb(Fl_Widget*o, void*) {
|
||||
if ((Fl::event() == FL_KEYDOWN || Fl::event() == FL_SHORTCUT)
|
||||
&& Fl::event_key() == FL_Escape)
|
||||
|
@ -34,15 +38,18 @@ static void gui_static_read_rb(void* inst)
|
|||
Gui::Gui() :
|
||||
window(1272,750)
|
||||
{
|
||||
fl_show_tooltip = &Gui::show_tooltip;
|
||||
|
||||
window.color(FL_BLACK);
|
||||
window.label("Luppp 5");
|
||||
//window.callback( close_cb, 0 );
|
||||
|
||||
|
||||
|
||||
Avtk::Image* headerImage = new Avtk::Image(0,0,1272,36,"header.png");
|
||||
headerImage->setPixbuf( header.pixel_data, 4 );
|
||||
|
||||
Gui::tooltipLabel = new Fl_Box(100, 20, 200, 20, "tooltips go here");
|
||||
|
||||
//window.resizable( headerImage );
|
||||
|
||||
int i = 0;
|
||||
|
@ -80,3 +87,8 @@ int Gui::show()
|
|||
|
||||
return Fl::run();
|
||||
}
|
||||
|
||||
void Gui::show_tooltip( const char* c )
|
||||
{
|
||||
tooltipLabel->label( c );
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "gmastertrack.hxx"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -23,6 +24,9 @@ class Gui
|
|||
Gui();
|
||||
int show();
|
||||
GTrack* getTrack(int id);
|
||||
|
||||
// for pushing strings to tooltip area
|
||||
static void show_tooltip( const char* );
|
||||
|
||||
private:
|
||||
Fl_Double_Window window;
|
||||
|
@ -32,6 +36,8 @@ class Gui
|
|||
GUnitTrack* unit;
|
||||
|
||||
vector<GTrack*> tracks;
|
||||
|
||||
static Fl_Box* tooltipLabel;
|
||||
};
|
||||
|
||||
#endif // LUPPP_GUI
|
||||
|
|
|
@ -36,8 +36,8 @@ int main()
|
|||
rbToGui = jack_ringbuffer_create( 5000 * sizeof(EventBase));
|
||||
|
||||
|
||||
jack = new Jack();
|
||||
jack->activate();
|
||||
//jack = new Jack();
|
||||
//jack->activate();
|
||||
|
||||
gui = new Gui();
|
||||
gui->show();
|
||||
|
|
Loading…
Add table
Reference in a new issue