-Rearranged master track, moved metro buttons / blocks to bottom right.

main
Harry van Haaren 2013-09-10 22:23:32 +01:00
parent 95d1d7af70
commit e90585bb39
3 changed files with 38 additions and 67 deletions

View File

@ -174,17 +174,25 @@ void DiskReader::readMaster()
// reverb // reverb
{ {
cJSON* reverb = cJSON_GetObjectItem( master, "reverb"); cJSON* reverb = cJSON_GetObjectItem( master, "reverb");
if ( reverb )
cJSON* active = cJSON_GetObjectItem( reverb, "active");
cJSON* size = cJSON_GetObjectItem( reverb, "size");
cJSON* wet = cJSON_GetObjectItem( reverb, "wet");
cJSON* damping = cJSON_GetObjectItem( reverb, "damping");
if ( active && size && wet && damping )
{ {
EventFxReverb e( active->valuedouble, size->valuedouble, cJSON* active = cJSON_GetObjectItem( reverb, "active");
wet->valuedouble, damping->valuedouble ); cJSON* size = cJSON_GetObjectItem( reverb, "size");
writeToDspRingbuffer( &e ); cJSON* wet = cJSON_GetObjectItem( reverb, "wet");
cJSON* damping = cJSON_GetObjectItem( reverb, "damping");
if ( active && size && wet && damping )
{
EventFxReverb e( active->valuedouble, size->valuedouble,
wet->valuedouble, damping->valuedouble );
writeToDspRingbuffer( &e );
}
}
else
{
#ifdef DEBUG_STATE
cout << "Session has no reverb element" << endl;
#endif
} }
} }

View File

@ -1,6 +1,7 @@
#include "gmastertrack.hxx" #include "gmastertrack.hxx"
/*
static void gmastertrack_reverb_cb(Fl_Widget *w, void *data) static void gmastertrack_reverb_cb(Fl_Widget *w, void *data)
{ {
int enable = ((Avtk::Reverb*)w)->getActive(); int enable = ((Avtk::Reverb*)w)->getActive();
@ -8,6 +9,7 @@ static void gmastertrack_reverb_cb(Fl_Widget *w, void *data)
EventFxReverb e = EventFxReverb( enable, 0.5, 0.5, 0.5 ); EventFxReverb e = EventFxReverb( enable, 0.5, 0.5, 0.5 );
writeToDspRingbuffer( &e ); writeToDspRingbuffer( &e );
} }
*/
static void gmastertrack_button_callback(Fl_Widget *w, void *data) { static void gmastertrack_button_callback(Fl_Widget *w, void *data) {
if ( strcmp( w->label(), "Metro" ) == 0 ) if ( strcmp( w->label(), "Metro" ) == 0 )
@ -40,21 +42,19 @@ GMasterTrack::GMasterTrack(int x, int y, int w, int h, const char* l ) :
title( strdup(l) ), title( strdup(l) ),
bg( x, y , w, h, title ), bg( x, y , w, h, title ),
// with "true" master flag: won't influence grid // with "true" master flag: launches scenes instead of clips on tracks
clipSel(x + 5, y + 26 + 102, 140, 294,"", true), clipSel(x + 5, y + 26 + 102, 140, 294,"", true),
source(x+5, y+26, 140, 100, ""), source(x+5, y+26, 140, 100, ""),
volBox(x+5, y+422, 140, 172, ""), volBox(x+5, y+422, 140, 172, ""),
/*
tapTempo(x + 25 + 52, y + 26 + 4, 63, 29,"Tap"),
metronomeButton(x + 9,y + 26 + 4, 64, 29,"Metro"),
*/
sidechain(x+9, y +428, 94, 94, ""),
reverb (x+9, y +527, 94, 62, ""),
tapTempo ( x + w * 2/4.f - 18, y + 426 + 41 * 0, 44,38, "Tap"),
metronomeButton( x + w * 2/4.f - 18, y + 426 + 41 * 1, 44, 38,"Metro"),
tempoDial ( x + w * 2/4.f - 18, y + 426 + 41 * 2, 44, 38,"BPM"),
aboutButton ( x + w * 2/4.f - 18, y + 426 + 41 * 3, 44, 38,"About"),
inputVolume(x + 9,y + 26 + 4, w - 18, 29,""), inputVolume(x + 9,y + 26 + 4, w - 18, 29,""),
volume(x+106, y +425, 36, 166, "") volume(x+106, y +425, 36, 166, "")
{ {
ID = privateID++; ID = privateID++;
@ -62,12 +62,9 @@ GMasterTrack::GMasterTrack(int x, int y, int w, int h, const char* l ) :
bar = 0; bar = 0;
inputVolume.setOrientationHorizontal(); inputVolume.setOrientationHorizontal();
/*
tapTempo.callback( gmastertrack_button_callback, &ID ); tapTempo.callback( gmastertrack_button_callback, &ID );
metronomeButton.callback( gmastertrack_button_callback, 0 ); metronomeButton.callback( gmastertrack_button_callback, 0 );
*/
reverb.callback( gmastertrack_reverb_cb, 0 );
//tapTempo.setBgColor( 0, 0, 0 ); //tapTempo.setBgColor( 0, 0, 0 );
//metronomeButton.setBgColor( 0, 0, 0 ); //metronomeButton.setBgColor( 0, 0, 0 );
//metronomeButton.setColor( 0.4, 0.4, 0.4 ); //metronomeButton.setColor( 0.4, 0.4, 0.4 );
@ -75,34 +72,20 @@ GMasterTrack::GMasterTrack(int x, int y, int w, int h, const char* l ) :
for(int i = 0; i < 4; i++) for(int i = 0; i < 4; i++)
{ {
int offset = 0; beatLights[i] = new Avtk::LightButton( x + 11, y + 426 + 41 * i, 38, 38, "" );
/*
if ( i > 1 )
offset = 1;
*/
beatLights[i] = new Avtk::LightButton( x + 9 + 34 * i + offset, y + 25 + 37 , 30, 29, "" );
beatLights[i+4] = new Avtk::LightButton( x + 9 + 34 * i + offset, y + 25 + 37 + 32, 30, 29, "" );
} }
beatLights[0]->setColor( 1.0, 0.0 , 0.0 );
beatLights[0]->setColor( 0.0, 1.0 , 0.0 ); beatLights[1]->setColor( 1.0, 0.48, 0.0 );
beatLights[1]->setColor( 1.0, 1.0 , 0.0 ); beatLights[2]->setColor( 1.0, 1.0 , 0.0 );
beatLights[2]->setColor( 1.0, 0.48, 0.0 ); beatLights[3]->setColor( 0.0, 1.0 , 0.0 );
beatLights[3]->setColor( 1.0, 0.0 , 0.0 );
beatLights[4]->setColor( 0.0, 1.0 , 0.0 );
beatLights[5]->setColor( 1.0, 1.0 , 0.0 );
beatLights[6]->setColor( 1.0, 0.48, 0.0 );
beatLights[7]->setColor( 1.0, 0.0 , 0.0 );
volBox.maximum(1.0f); volBox.maximum(1.0f);
volBox.minimum(0.0f); volBox.minimum(0.0f);
volBox.color( FL_BLACK ); volBox.color( FL_BLACK );
volBox.selection_color( FL_BLUE );
source.maximum(1.0f); source.maximum(1.0f);
source.minimum(0.0f); source.minimum(0.0f);
source.color( FL_BLACK ); source.color( FL_BLACK );
source.selection_color( FL_BLUE );
volume.amplitude( 0.0, 0.0 ); volume.amplitude( 0.0, 0.0 );
@ -126,24 +109,14 @@ void GMasterTrack::setBarBeat(int b, int beat)
//cout << bar << " " << num << endl; //cout << bar << " " << num << endl;
// turn all off // turn all off
for( int i = 0; i < 8; i++) for( int i = 0; i < 4; i++)
beatLights[i]->value( 0 ); beatLights[i]->value( 0 );
// bar lights
for( int i = 0; i < bar; i++)
beatLights[i]->value( 1 );
// beat starts at 4 // beat starts at 4
for( int i = 0; i < num; i++) for( int i = 0; i < num; i++)
beatLights[i+4]->value( 1 ); beatLights[3-i]->value( 1 );
} }
// FIXME: refactor into time class?
int bpm;
Avtk::Volume* GMasterTrack::getInputVolume() Avtk::Volume* GMasterTrack::getInputVolume()
{ {
return &inputVolume; return &inputVolume;
@ -156,12 +129,6 @@ Avtk::ClipSelector* GMasterTrack::getClipSelector()
{ {
return &clipSel; return &clipSel;
} }
/*
Avtk::Reverb* GMasterTrack::getReverb()
{
return &reverb;
}
*/
GMasterTrack::~GMasterTrack() GMasterTrack::~GMasterTrack()
{ {

View File

@ -39,7 +39,6 @@ class GMasterTrack : public Fl_Group
Avtk::Volume* getInputVolume(); Avtk::Volume* getInputVolume();
Avtk::Volume* getVolume(); Avtk::Volume* getVolume();
Avtk::ClipSelector* getClipSelector(); Avtk::ClipSelector* getClipSelector();
// Avtk::Reverb* getReverb()
~GMasterTrack(); ~GMasterTrack();
@ -57,20 +56,17 @@ class GMasterTrack : public Fl_Group
Fl_Progress source; Fl_Progress source;
Fl_Progress volBox; Fl_Progress volBox;
/*
Avtk::Button tapTempo; Avtk::Button tapTempo;
Avtk::LightButton metronomeButton; Avtk::LightButton metronomeButton;
*/ Avtk::Dial tempoDial;
Avtk::LightButton* beatLights[8]; Avtk::Button aboutButton;
Avtk::LightButton* beatLights[4];
Avtk::SidechainGain sidechain;
Avtk::Reverb reverb;
Avtk::Volume inputVolume; Avtk::Volume inputVolume;
Avtk::Volume volume; Avtk::Volume volume;
static int privateID; static int privateID;
}; };