mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Updated GridLogic playback code, config debug #defines
This commit is contained in:
parent
8b96ff9c22
commit
c439bb01e5
3 changed files with 27 additions and 18 deletions
|
@ -2,23 +2,19 @@
|
|||
#ifndef LUPPP_CONFIG_H
|
||||
#define LUPPP_CONFIG_H
|
||||
|
||||
/// Build options
|
||||
//#define DEBUG_ALL 1
|
||||
|
||||
|
||||
#ifdef DEBUG_ALL
|
||||
|
||||
/// DEBUG OPTIONS
|
||||
// Clip selection / queueing
|
||||
#define DEBUG_CLIP 1
|
||||
// Buffer loading / resizing
|
||||
#define DEBUG_BUFFER 1
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/// General Options
|
||||
#define NTRACKS 8
|
||||
#define NSCENES 10
|
||||
#define MAX_BUFFER_SIZE 1024
|
||||
|
||||
// nsamples remaining during recording before Looper requests larger buffer
|
||||
#define LOOPER_SAMPLES_BEFORE_REQUEST 44100
|
||||
|
||||
#endif // LUPPP_CONFIG_H
|
||||
|
|
|
@ -30,28 +30,38 @@ void GridLogic::launchScene( int scene )
|
|||
{
|
||||
for(unsigned int t = 0; t < NTRACKS; t++ )
|
||||
{
|
||||
for(unsigned int s = 0; s < NSCENES; s++ )
|
||||
for(int s = 0; s < NSCENES; s++ )
|
||||
{
|
||||
LooperClip* lc = jack->getLooper( t )->getClip( s );
|
||||
if ( s == scene )
|
||||
{
|
||||
lc->queuePlay();
|
||||
//else
|
||||
//lc->queueStop();
|
||||
jack->getControllerUpdater()->setSceneState( t, s, lc->getState() );
|
||||
}
|
||||
else
|
||||
{
|
||||
bool current = lc->playing();
|
||||
lc->queueStop();
|
||||
bool next = lc->playing();
|
||||
if ( current != next )
|
||||
{
|
||||
jack->getControllerUpdater()->setSceneState( t, s, lc->getState() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
for(unsigned int s = 0; s < NSCENES; s++ )
|
||||
{
|
||||
jack->getControllerUpdater()->setSceneState( -1, s, s );
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void GridLogic::pressed( int track, int scene )
|
||||
{
|
||||
// get the clip, do the "press" action based on current state.
|
||||
LooperClip* lc = jack->getLooper( track )->getClip( scene );
|
||||
GridLogic::State s = lc->getState();
|
||||
|
||||
|
@ -70,13 +80,10 @@ void GridLogic::pressed( int track, int scene )
|
|||
if ( s == STATE_RECORDING )
|
||||
lc->queueStop();
|
||||
|
||||
|
||||
s = lc->getState();
|
||||
|
||||
#ifdef DEBUG_CLIP
|
||||
printf("GridLogic::pressed() after press state = %s\n", StateString[ int(s) ] );
|
||||
#endif
|
||||
|
||||
jack->getControllerUpdater()->setSceneState(track, scene, s );
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ void LooperClip::bar()
|
|||
|
||||
_playhead = 0;
|
||||
}
|
||||
else if ( _queueStop )
|
||||
else if ( _queueStop && _loaded )
|
||||
{
|
||||
_playing = false;
|
||||
s = GridLogic::STATE_STOPPED;
|
||||
|
@ -162,6 +162,12 @@ void LooperClip::bar()
|
|||
|
||||
_recordhead = 0;
|
||||
}
|
||||
else if ( _queuePlay )
|
||||
{
|
||||
// clip was queued, but there's nothing loaded
|
||||
_queuePlay = false;
|
||||
change = true;
|
||||
}
|
||||
|
||||
if ( _recording )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue