-Added EventSave, updated DSP handling code

This commit is contained in:
Harry van Haaren 2013-09-03 18:05:57 +01:00
parent 76a8fe7d91
commit 1b76c1ce2c
5 changed files with 31 additions and 0 deletions

View file

@ -30,6 +30,8 @@ namespace Event
MASTER_VOL,
RECORD,
SAVE,
GRID_EVENT, // press / release events
GRID_STATE, // state of one block
GRID_LAUNCH_SCENE,
@ -102,6 +104,15 @@ class EventTrackVol : public EventBase
}
};
class EventSave : public EventBase
{
public:
int type() { return int(SAVE); }
uint32_t size() { return sizeof(EventSave); }
EventSave(){};
};
class EventGridEvent : public EventBase
{
public:

View file

@ -34,6 +34,13 @@ void handleDspEvents()
{
switch ( e->type() )
{
case Event::SAVE: {
if ( availableRead >= sizeof(EventMasterVol) ) {
EventMasterVol ev(0);
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventMasterVol) );
jack->getSave()->save();
} break; }
case Event::MASTER_VOL: {
if ( availableRead >= sizeof(EventMasterVol) ) {
EventMasterVol ev(0);

View file

@ -30,6 +30,15 @@ LooperClip::LooperClip(int t, int s) :
_recordhead = 0;
}
void LooperClip::save()
{
char buffer [50];
sprintf (buffer, "LooperClip::save() track %i, scene %i", track,scene);
EventGuiPrint e( buffer );
writeToGuiRingbuffer( &e );
}
/// loads a sample: eg from disk, unloading current sample if necessary
void LooperClip::load( AudioBuffer* ab )
{

View file

@ -42,6 +42,9 @@ class LooperClip : public SaveAble
/// TimeObserver overrides
void bar();
/// SaveAble overrides
void save();
/// analyses current _playing _recording vars, returns the current State
GridLogic::State getState();
bool playing();

View file

@ -18,6 +18,7 @@ void Save::registerSaveable(SaveAble* s)
void Save::save()
{
cout << " Save::save() " << endl;
for( unsigned int i = 0; i < saveables.size(); i++)
{
saveables.at(i)->save();