Free Rec Mode Button works now
parent
307a28a84a
commit
f41d76b3d7
|
@ -47,6 +47,7 @@ const char *EventAutoStopRecClipLengthUp::prettyName =
|
|||
"auto_stop_rec:clip_length_up";
|
||||
const char *EventAutoStopRecClipLengthDown::prettyName =
|
||||
"auto_stop_rec:clip_length_down";
|
||||
const char *EventFreeRecordMode::prettyName = "master:free_rec_mode";
|
||||
|
||||
EVENT_TYPE Event::getTypeFromName(const char* name)
|
||||
{
|
||||
|
|
|
@ -65,11 +65,11 @@ enum EVENT_TYPE {
|
|||
MASTER_RETURN,
|
||||
RECORD,
|
||||
|
||||
SESSION_SAVE, // save hole session
|
||||
CLIP_SAVE, // save single clip
|
||||
SESSION_SAVE, // save hole session
|
||||
CLIP_SAVE, // save single clip
|
||||
STATE_RESET, // reset all state
|
||||
STATE_SAVE_FINISH,// save action finished, flush metadata to disk
|
||||
STATE_SAVE_BUFFER,// save an individual AudioBuffer* to disk
|
||||
STATE_SAVE_FINISH, // save action finished, flush metadata to disk
|
||||
STATE_SAVE_BUFFER, // save an individual AudioBuffer* to disk
|
||||
|
||||
REQUEST_SAVE_BUFFER, // gets an audioBuffer of a certain size
|
||||
|
||||
|
@ -104,6 +104,9 @@ enum EVENT_TYPE {
|
|||
AUTO_STOP_REC_CLIP_LENGTH_UP,
|
||||
AUTO_STOP_REC_CLIP_LENGTH_DOWN,
|
||||
|
||||
//
|
||||
FREE_REC_MODE,
|
||||
|
||||
/// Transport etc
|
||||
METRONOME_ACTIVE,
|
||||
METRONOME_VOLUME,
|
||||
|
@ -890,6 +893,32 @@ public:
|
|||
EventAutoStopRecClipLength(int l) : clipLength(l) {}
|
||||
};
|
||||
|
||||
class EventFreeRecordMode : public EventBase {
|
||||
public:
|
||||
static const char *prettyName;
|
||||
bool enable;
|
||||
|
||||
const char *name() {
|
||||
return prettyName;
|
||||
}
|
||||
|
||||
int type() {
|
||||
return int(FREE_REC_MODE);
|
||||
}
|
||||
|
||||
uint32_t size() {
|
||||
return sizeof(EventFreeRecordMode);
|
||||
}
|
||||
|
||||
EventFreeRecordMode() {
|
||||
enable = true;
|
||||
}
|
||||
|
||||
EventFreeRecordMode(bool e) {
|
||||
enable = e;
|
||||
}
|
||||
};
|
||||
|
||||
class EventAutoStopRecClipLengthUp : public EventBase {
|
||||
public:
|
||||
static const char *prettyName;
|
||||
|
|
|
@ -284,6 +284,17 @@ void handleDspEvents()
|
|||
break;
|
||||
}
|
||||
|
||||
case Event::FREE_REC_MODE: {
|
||||
if(availableRead >= sizeof(EventFreeRecordMode)) {
|
||||
EventFreeRecordMode e;
|
||||
jack_ringbuffer_read(rbToDsp,
|
||||
(char *)&e,
|
||||
sizeof(EventFreeRecordMode));
|
||||
jack->setFreeRecMode(e.enable);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Event::TIME_BPM: {
|
||||
if ( availableRead >= sizeof(EventTimeBPM) ) {
|
||||
EventTimeBPM ev;
|
||||
|
|
|
@ -135,6 +135,17 @@ void handleGuiEvents()
|
|||
}
|
||||
break;
|
||||
}
|
||||
case Event::FREE_REC_MODE: {
|
||||
if(availableRead >= sizeof(EventFreeRecordMode)) {
|
||||
EventFreeRecordMode e;
|
||||
jack_ringbuffer_read(rbToGui,
|
||||
(char *)&e,
|
||||
sizeof(EventFreeRecordMode));
|
||||
gui->getMasterTrack()->setFreeRecMode(
|
||||
e.enable);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Event::LOOPER_STATE: {
|
||||
if ( availableRead >= sizeof(EventLooperState) ) {
|
||||
EventLooperState ev;
|
||||
|
|
|
@ -231,6 +231,12 @@ static void gmastertrack_autoStopRec_callback(Fl_Widget *w, void *data) {
|
|||
}
|
||||
}
|
||||
|
||||
static void gmastertrack_freeRecMode_callback(Fl_Widget *w, void *data) {
|
||||
Avtk::LightButton *b = (Avtk::LightButton *)w;
|
||||
EventFreeRecordMode e = EventFreeRecordMode(!b->value());
|
||||
writeToDspRingbuffer(&e);
|
||||
}
|
||||
|
||||
#define OFST 55
|
||||
#define COLUMN_RIGHT x + w * 2 / 4.f - 15
|
||||
#define COLUMN_LEFT x + w * 1 / 4.f - 26
|
||||
|
@ -283,6 +289,8 @@ GMasterTrack::GMasterTrack(int x, int y, int w, int h, const char *l)
|
|||
metronomeButton.callback( gmastertrack_button_callback, 0 );
|
||||
|
||||
autoStopRecButton.callback(gmastertrack_autoStopRec_callback, &ID);
|
||||
freeRec.callback(gmastertrack_freeRecMode_callback, &ID);
|
||||
freeRec.value(0);
|
||||
|
||||
tempoDial.callback( gmastertrack_tempoDial_callback, 0 );
|
||||
|
||||
|
@ -377,6 +385,10 @@ GMasterTrack::setClipLength(int l)
|
|||
autoStopRecButton.copy_label(str);
|
||||
}
|
||||
|
||||
void GMasterTrack::setFreeRecMode(bool e) {
|
||||
freeRec.value(e);
|
||||
}
|
||||
|
||||
float GMasterTrack::getBpm()
|
||||
{
|
||||
return bpm;
|
||||
|
|
|
@ -61,6 +61,7 @@ public:
|
|||
void metronomeEnable( bool b );
|
||||
void
|
||||
setClipLength(int l);
|
||||
void setFreeRecMode(bool e);
|
||||
|
||||
Avtk::Volume* getInputVolume();
|
||||
Avtk::Volume* getVolume();
|
||||
|
|
|
@ -782,4 +782,12 @@ Jack::setClipLength(int l)
|
|||
|
||||
EventAutoStopRecClipLength e = EventAutoStopRecClipLength(clipLength);
|
||||
writeToGuiRingbuffer(&e);
|
||||
}
|
||||
|
||||
void Jack::setFreeRecMode(bool e)
|
||||
{
|
||||
freeRecMode = e;
|
||||
|
||||
EventFreeRecordMode ev = EventFreeRecordMode(e);
|
||||
writeToGuiRingbuffer(&ev);
|
||||
}
|
|
@ -93,6 +93,9 @@ public:
|
|||
{
|
||||
return clipLength;
|
||||
}
|
||||
bool getFreeRecMode() {
|
||||
return freeRecMode;
|
||||
}
|
||||
GridLogic* getGridLogic()
|
||||
{
|
||||
return gridLogic;
|
||||
|
@ -126,6 +129,7 @@ public:
|
|||
|
||||
void
|
||||
setClipLength(int l);
|
||||
void setFreeRecMode(bool e);
|
||||
|
||||
jack_client_t* getJackClientPointer()
|
||||
{
|
||||
|
@ -158,6 +162,8 @@ private:
|
|||
ControllerUpdater* controllerUpdater;
|
||||
|
||||
int clipLength;
|
||||
bool freeRecMode;
|
||||
|
||||
vector<Looper*> loopers;
|
||||
vector<JackSendReturn*> tracksendreturns;
|
||||
vector<TrackOutput*> trackOutputs;
|
||||
|
|
Loading…
Reference in New Issue