mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-06 01:21:38 -05:00
-Implemented Logic class as interface to functionality
This commit is contained in:
parent
0582b86d2e
commit
9dfd7ecdb8
7 changed files with 56 additions and 6 deletions
13
TODO
13
TODO
|
@ -1,5 +1,16 @@
|
||||||
|
|
||||||
= Interface / Logic class for all Luppp engines actions
|
=== NEW
|
||||||
|
|
||||||
|
- Update recording mechanism to request buffers when they're getting full
|
||||||
|
|
||||||
|
|
||||||
|
=== IN PROGRESS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=== COMPLETED
|
||||||
|
|
||||||
|
- Interface / Logic class for all Luppp engines actions
|
||||||
Needed to give Controller classes a way to tell Luppp what to do.
|
Needed to give Controller classes a way to tell Luppp what to do.
|
||||||
This class must update all controllers based on state. Essentially
|
This class must update all controllers based on state. Essentially
|
||||||
its like "GridLogic", but for the rest of the functionality.
|
its like "GridLogic", but for the rest of the functionality.
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
#include "event.hxx"
|
#include "event.hxx"
|
||||||
#include "eventhandler.hxx"
|
#include "eventhandler.hxx"
|
||||||
|
|
||||||
|
#include "logic.hxx"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
extern Jack* jack;
|
extern Jack* jack;
|
||||||
|
@ -89,15 +91,14 @@ void handleDspEvents()
|
||||||
if ( availableRead >= sizeof(EventTrackVol) ) {
|
if ( availableRead >= sizeof(EventTrackVol) ) {
|
||||||
EventTrackVol ev;
|
EventTrackVol ev;
|
||||||
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventTrackVol) );
|
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventTrackVol) );
|
||||||
jack->getTrackOutput(ev.track)->setMaster( ev.vol );
|
jack->getLogic()->trackVolume( ev.track, ev.vol );
|
||||||
break; }
|
break; }
|
||||||
}
|
}
|
||||||
case Event::TRACK_SEND: {
|
case Event::TRACK_SEND: {
|
||||||
if ( availableRead >= sizeof(EventTrackSend) ) {
|
if ( availableRead >= sizeof(EventTrackSend) ) {
|
||||||
EventTrackSend ev;
|
EventTrackSend ev;
|
||||||
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventTrackSend) );
|
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventTrackSend) );
|
||||||
jack->getTrackOutput(ev.track)->setSend( ev.send, ev.value );
|
jack->getLogic()->trackSend( ev.track, ev.send, ev.value );
|
||||||
jack->getControllerUpdater()->setTrackSend( ev.track, ev.send, ev.value );
|
|
||||||
} break; }
|
} break; }
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,6 +19,7 @@ Jack::Jack() :
|
||||||
controllerUpdater( new ControllerUpdater() ),
|
controllerUpdater( new ControllerUpdater() ),
|
||||||
timeManager(),
|
timeManager(),
|
||||||
metronome( new Metronome() ),
|
metronome( new Metronome() ),
|
||||||
|
logic( new Logic() ),
|
||||||
gridLogic( new GridLogic() )
|
gridLogic( new GridLogic() )
|
||||||
{
|
{
|
||||||
// open the client
|
// open the client
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <jack/midiport.h>
|
#include <jack/midiport.h>
|
||||||
#include <jack/transport.h>
|
#include <jack/transport.h>
|
||||||
|
|
||||||
|
#include "logic.hxx"
|
||||||
#include "config.hxx"
|
#include "config.hxx"
|
||||||
#include "looper.hxx"
|
#include "looper.hxx"
|
||||||
#include "metronome.hxx"
|
#include "metronome.hxx"
|
||||||
|
@ -44,6 +45,7 @@ class Jack
|
||||||
/// get functions for components owned by Jack
|
/// get functions for components owned by Jack
|
||||||
Looper* getLooper(int t) {return loopers.at(t); }
|
Looper* getLooper(int t) {return loopers.at(t); }
|
||||||
Metronome* getMetronome(){return metronome;}
|
Metronome* getMetronome(){return metronome;}
|
||||||
|
Logic* getLogic(){return logic;}
|
||||||
GridLogic* getGridLogic(){return gridLogic;}
|
GridLogic* getGridLogic(){return gridLogic;}
|
||||||
TrackOutput* getTrackOutput(int t){return trackOutputs.at(t);}
|
TrackOutput* getTrackOutput(int t){return trackOutputs.at(t);}
|
||||||
TimeManager* getTimeManager(){return &timeManager;}
|
TimeManager* getTimeManager(){return &timeManager;}
|
||||||
|
@ -67,6 +69,7 @@ class Jack
|
||||||
Buffers buffers;
|
Buffers buffers;
|
||||||
TimeManager timeManager;
|
TimeManager timeManager;
|
||||||
Metronome* metronome;
|
Metronome* metronome;
|
||||||
|
Logic* logic;
|
||||||
GridLogic* gridLogic;
|
GridLogic* gridLogic;
|
||||||
ControllerUpdater* controllerUpdater;
|
ControllerUpdater* controllerUpdater;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
|
||||||
|
#include "logic.hxx"
|
||||||
|
|
||||||
|
#include "jack.hxx"
|
||||||
|
extern Jack* jack;
|
||||||
|
|
||||||
|
Logic::Logic()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Logic::trackVolume(int t, float v)
|
||||||
|
{
|
||||||
|
printf( "Logic trackVolume() %i, %f\n", t, v );
|
||||||
|
jack->getTrackOutput( t )->setMaster( v );
|
||||||
|
jack->getControllerUpdater()->volume( t, v );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Logic::trackRecordArm(int t, bool v)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Logic::trackSend(int t, int send, float v)
|
||||||
|
{
|
||||||
|
jack->getTrackOutput( t )->setSend( send, v );
|
||||||
|
jack->getControllerUpdater()->setTrackSend( t, send, v );
|
||||||
|
}
|
|
@ -20,9 +20,11 @@
|
||||||
class Logic
|
class Logic
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Logic()
|
Logic();
|
||||||
|
|
||||||
void
|
void trackVolume(int t, float v);
|
||||||
|
void trackRecordArm(int t, bool v);
|
||||||
|
void trackSend(int t, int send, float v);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_LOGIC_H
|
#endif // LUPPP_LOGIC_H
|
||||||
|
|
2
wscript
2
wscript
|
@ -25,6 +25,8 @@ def build(bld):
|
||||||
'src/jack.cxx',
|
'src/jack.cxx',
|
||||||
'src/gtrack.cxx',
|
'src/gtrack.cxx',
|
||||||
'src/looper.cxx',
|
'src/looper.cxx',
|
||||||
|
|
||||||
|
'src/logic.cxx',
|
||||||
'src/gridlogic.cxx',
|
'src/gridlogic.cxx',
|
||||||
|
|
||||||
'src/observer/time.cxx',
|
'src/observer/time.cxx',
|
||||||
|
|
Loading…
Add table
Reference in a new issue