Disable Beat Light in Free Record Mode

main
Georg Krause 2019-06-06 15:10:06 +02:00
parent b69e3e4ce3
commit c2c1838756
3 changed files with 39 additions and 25 deletions

View File

@ -147,6 +147,7 @@ void handleGuiEvents()
e.enable); e.enable);
gm->metronomeEnable(!e.enable); gm->metronomeEnable(!e.enable);
gm->tapEnable(!e.enable); gm->tapEnable(!e.enable);
gm->beatLightEnable(!e.enable);
} }
break; break;
} }

View File

@ -311,7 +311,7 @@ GMasterTrack::GMasterTrack(int x, int y, int w, int h, const char *l)
returnVol.align( FL_ALIGN_CENTER ); returnVol.align( FL_ALIGN_CENTER );
returnVol.callback( gmastertrack_returnVol_callback, 0 ); returnVol.callback( gmastertrack_returnVol_callback, 0 );
beatLight.value(1); beatLightEnable(true);
volume.amplitude( 0.0, 0.0 ); volume.amplitude( 0.0, 0.0 );
volume.callback( gmastertrack_volume_callback, 0 ); volume.callback( gmastertrack_volume_callback, 0 );
@ -384,6 +384,18 @@ void GMasterTrack::tapEnable(bool b) {
tapTempo.deactivate(); tapTempo.deactivate();
} }
void GMasterTrack::beatLightEnable(bool b) {
if(b) {
beatLight.activate();
beatLight.value(1);
} else {
beatLight.deactivate();
beatLight.value(0);
beatLight.copy_label("");
beatLight.redraw();
}
}
void void
GMasterTrack::setClipLength(int l) GMasterTrack::setClipLength(int l)
{ {
@ -413,30 +425,30 @@ void GMasterTrack::setTapTempo( bool b )
void GMasterTrack::setBarBeat(int b, int beat) void GMasterTrack::setBarBeat(int b, int beat)
{ {
// FIXME hard coded beat number if(beatLight.active()) { // FIXME hard coded beat number
int beat_num = beat % 4; int beat_num = beat % 4;
switch (beat_num) switch(beat_num) {
{ case 0:
case 0: beatLight.setColor(1.0, 0.0, 0.0);
beatLight.setColor(1.0, 0.0, 0.0); break;
break; case 1:
case 1: beatLight.setColor(1.0, 0.48, 0.0);
beatLight.setColor(1.0, 0.48, 0.0); break;
break; case 2:
case 2: beatLight.setColor(1.0, 1.0, 0.0);
beatLight.setColor(1.0, 1.0, 0.0); break;
break; case 3:
case 3: beatLight.setColor(0.0, 1.0, 0.0);
beatLight.setColor(0.0, 1.0, 0.0); break;
break; default:
default: break;
break; }
}
char buf[2]; char buf[2];
sprintf(buf, "%d", beat_num+1); sprintf(buf, "%d", beat_num + 1);
beatLight.copy_label(buf); beatLight.copy_label(buf);
beatLight.redraw(); beatLight.redraw();
}
} }
Avtk::Volume* GMasterTrack::getInputVolume() Avtk::Volume* GMasterTrack::getInputVolume()

View File

@ -64,8 +64,9 @@ public:
setClipLength(int l); setClipLength(int l);
void setFreeRecMode(bool e); void setFreeRecMode(bool e);
void tapEnable(bool b); void tapEnable(bool b);
void beatLightEnable(bool b);
Avtk::Volume* getInputVolume(); Avtk::Volume *getInputVolume();
Avtk::Volume* getVolume(); Avtk::Volume* getVolume();
Avtk::ClipSelector* getClipSelector(); Avtk::ClipSelector* getClipSelector();