mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Added EventSave, updated DSP handling code
This commit is contained in:
parent
76a8fe7d91
commit
1b76c1ce2c
5 changed files with 31 additions and 0 deletions
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue