2013-04-20 13:20:46 +02:00
|
|
|
|
|
|
|
#ifndef LUPPP_G_TRACK_H
|
|
|
|
#define LUPPP_G_TRACK_H
|
|
|
|
|
2013-05-13 23:04:12 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
2013-04-20 13:20:46 +02:00
|
|
|
#include <FL/Fl.H>
|
|
|
|
#include <FL/Fl_Group.H>
|
|
|
|
#include <FL/Fl_Slider.H>
|
2013-05-16 14:38:46 +02:00
|
|
|
#include <FL/Fl_Progress.H>
|
2013-05-20 00:57:12 +02:00
|
|
|
#include <FL/Fl_Native_File_Chooser.H>
|
2013-04-20 13:20:46 +02:00
|
|
|
|
2013-05-13 03:43:44 +02:00
|
|
|
#include "avtk/avtk_dial.h"
|
2013-07-22 09:38:18 +02:00
|
|
|
#include "avtk/avtk_volume.h"
|
2013-04-20 13:20:46 +02:00
|
|
|
#include "avtk/avtk_button.h"
|
2013-05-13 03:43:44 +02:00
|
|
|
#include "avtk/avtk_background.h"
|
2013-07-21 17:04:54 +02:00
|
|
|
#include "avtk/avtk_clip_selector.h"
|
2013-04-20 13:20:46 +02:00
|
|
|
|
2013-05-13 23:04:12 +02:00
|
|
|
|
2013-07-24 20:09:35 +02:00
|
|
|
#include "config.hxx"
|
2013-05-20 00:57:12 +02:00
|
|
|
#include "worker.hxx"
|
|
|
|
#include "audiobuffer.hxx"
|
2013-05-13 23:04:12 +02:00
|
|
|
#include "eventhandler.hxx"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2013-07-28 15:56:34 +02:00
|
|
|
static void gtrack_reverb_cb(Fl_Widget *w, void *data);
|
2013-07-25 00:23:30 +02:00
|
|
|
extern void gtrack_button_callback(Fl_Widget *w, void *data);
|
2013-05-13 23:04:12 +02:00
|
|
|
|
2013-04-20 13:20:46 +02:00
|
|
|
class GTrack : public Fl_Group
|
|
|
|
{
|
|
|
|
public:
|
2013-07-25 16:20:16 +02:00
|
|
|
|
2013-07-26 02:27:19 +02:00
|
|
|
Avtk::Volume* getVolume(){return &volume;}
|
2013-07-25 16:20:16 +02:00
|
|
|
Avtk::ClipSelector* getClipSelector(){return &clipSel;}
|
|
|
|
|
2013-05-13 03:43:44 +02:00
|
|
|
GTrack(int x, int y, int w, int h, const char* l = 0 ) :
|
2013-04-20 13:20:46 +02:00
|
|
|
Fl_Group(x, y, w, h),
|
2013-05-13 22:11:21 +02:00
|
|
|
title( strdup(l) ),
|
|
|
|
bg( x, y , w, h, title ),
|
2013-05-13 03:43:44 +02:00
|
|
|
|
2013-07-25 00:58:08 +02:00
|
|
|
clipSel(x + 5, y + 26 + 102, 100, 294,""),
|
2013-07-21 17:04:54 +02:00
|
|
|
|
2013-07-25 18:40:25 +02:00
|
|
|
volBox(x+5, y+422, 100, 172, ""),
|
2013-05-16 02:38:11 +02:00
|
|
|
|
2013-07-25 18:40:25 +02:00
|
|
|
volume(x+65, y +427, 36, 150, "Vol"),
|
2013-05-13 03:43:44 +02:00
|
|
|
|
2013-07-25 19:05:23 +02:00
|
|
|
|
2013-07-28 15:56:34 +02:00
|
|
|
side(x+22, y +440 + 0, 30, 30, "S-C"),
|
|
|
|
post(x+22, y +440 + 50, 30, 30, "P-S"),
|
|
|
|
rev (x+22, y +440 +100, 30, 30, "Rev"),
|
2013-05-16 18:16:18 +02:00
|
|
|
|
2013-07-25 18:40:25 +02:00
|
|
|
progress(x+5, y+ 26, 100, 100, "Source UI")
|
2013-04-20 13:20:46 +02:00
|
|
|
{
|
2013-05-15 03:17:08 +02:00
|
|
|
ID = privateID++;
|
2013-07-25 18:40:25 +02:00
|
|
|
|
2013-07-26 02:45:40 +02:00
|
|
|
clipSel.setID( ID );
|
|
|
|
|
2013-07-28 15:56:34 +02:00
|
|
|
rev.callback( gtrack_reverb_cb, this );
|
|
|
|
|
2013-05-16 18:16:18 +02:00
|
|
|
volume.callback( gtrack_button_callback, 0 );
|
|
|
|
|
2013-05-16 14:38:46 +02:00
|
|
|
progress.maximum(1.0f);
|
|
|
|
progress.minimum(0.0f);
|
2013-07-21 17:04:54 +02:00
|
|
|
progress.color( FL_BLACK );
|
2013-07-21 16:47:35 +02:00
|
|
|
progress.selection_color( FL_BLUE );
|
2013-05-16 14:38:46 +02:00
|
|
|
|
2013-07-25 00:58:08 +02:00
|
|
|
volBox.maximum(1.0f);
|
|
|
|
volBox.minimum(0.0f);
|
|
|
|
volBox.color( FL_BLACK );
|
|
|
|
volBox.selection_color( FL_BLUE );
|
2013-07-25 18:40:25 +02:00
|
|
|
|
2013-04-20 13:20:46 +02:00
|
|
|
end(); // close the group
|
|
|
|
}
|
|
|
|
|
2013-05-13 22:11:21 +02:00
|
|
|
~GTrack()
|
|
|
|
{
|
|
|
|
free(title);
|
|
|
|
}
|
|
|
|
|
2013-05-15 03:17:08 +02:00
|
|
|
int ID;
|
|
|
|
|
2013-05-13 22:11:21 +02:00
|
|
|
char* title;
|
|
|
|
|
2013-05-13 03:43:44 +02:00
|
|
|
Avtk::Background bg;
|
|
|
|
|
2013-07-21 17:04:54 +02:00
|
|
|
Avtk::ClipSelector clipSel;
|
|
|
|
|
2013-07-25 00:58:08 +02:00
|
|
|
Fl_Progress volBox;
|
|
|
|
/*
|
2013-05-13 03:43:44 +02:00
|
|
|
Avtk::Button button1;
|
|
|
|
Avtk::Button button2;
|
|
|
|
Avtk::Button button3;
|
|
|
|
Avtk::Button button4;
|
|
|
|
Avtk::Button button5;
|
|
|
|
Avtk::Button button6;
|
2013-07-25 00:58:08 +02:00
|
|
|
*/
|
2013-07-21 17:04:54 +02:00
|
|
|
|
2013-07-22 09:38:18 +02:00
|
|
|
Avtk::Volume volume;
|
2013-05-16 18:16:18 +02:00
|
|
|
|
2013-07-28 15:56:34 +02:00
|
|
|
Avtk::Dial side;
|
|
|
|
Avtk::Dial post;
|
|
|
|
Avtk::Dial rev;
|
2013-05-13 03:43:44 +02:00
|
|
|
|
2013-05-16 14:38:46 +02:00
|
|
|
Fl_Progress progress;
|
2013-05-13 22:11:21 +02:00
|
|
|
|
2013-05-13 03:43:44 +02:00
|
|
|
static int privateID;
|
2013-04-20 13:20:46 +02:00
|
|
|
};
|
|
|
|
|
2013-07-28 15:56:34 +02:00
|
|
|
void gtrack_reverb_cb(Fl_Widget *w, void *data)
|
|
|
|
{
|
|
|
|
GTrack* track = (GTrack*) data;
|
|
|
|
EventTrackSend e( track->ID, SEND_REV, ((Avtk::Dial*)w)->value() );
|
|
|
|
writeToDspRingbuffer( &e );
|
|
|
|
//printf("track %i reverb send %f\n", track->ID, ((Avtk::Dial*)w)->value() );
|
|
|
|
}
|
|
|
|
|
2013-04-20 13:20:46 +02:00
|
|
|
#endif // LUPPP_G_TRACK_H
|
|
|
|
|