-Big refactor of #includes, less compilation deps. Updated TimeManager Bar() to include nframes data
This commit is contained in:
parent
f7aec84cf1
commit
09de7af563
17 changed files with 84 additions and 25 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <iostream>
|
||||
|
||||
#include "../jack.hxx"
|
||||
#include "../logic.hxx"
|
||||
#include "../gridlogic.hxx"
|
||||
|
||||
extern Jack* jack;
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include "../event.hxx"
|
||||
#include "../gridlogic.hxx"
|
||||
|
||||
#include "../eventhandler.hxx"
|
||||
|
||||
extern Jack* jack;
|
||||
|
||||
LupppGUI::LupppGUI() :
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
#include "eventhandler.hxx"
|
||||
|
||||
#include "logic.hxx"
|
||||
#include "state/state.hxx"
|
||||
#include "timemanager.hxx"
|
||||
#include "controllerupdater.hxx"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ void cancelCB(Fl_Widget*,void* data)
|
|||
|
||||
AudioEditor::AudioEditor()
|
||||
{
|
||||
window = new Fl_Double_Window(450,200,"Audio Editor : Beats?");
|
||||
window = new Fl_Double_Window(460,200,"Audio Editor : Beats?");
|
||||
waveform = new Avtk::Waveform(5, 5, 450, 150, "Waveform");
|
||||
cancel = new Avtk::Button(360, 160, 80,30, "Cancel");
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
#include "gridlogic.hxx"
|
||||
|
||||
#include "jack.hxx"
|
||||
#include "audiobuffer.hxx"
|
||||
|
||||
#include "trackoutput.hxx"
|
||||
#include "controllerupdater.hxx"
|
||||
|
||||
extern Jack* jack;
|
||||
|
||||
|
@ -223,7 +225,7 @@ void GridLogic::updateState()
|
|||
}
|
||||
}
|
||||
|
||||
void GridLogic::bar()
|
||||
void GridLogic::bar(int framesInNframes)
|
||||
{
|
||||
#ifdef DEBUG_CLIP
|
||||
EventGuiPrint e( "GridLogic::bar()" );
|
||||
|
@ -235,7 +237,7 @@ void GridLogic::bar()
|
|||
{
|
||||
int track = i / NSCENES;
|
||||
int scene = i - track * NSCENES;
|
||||
jack->getLooper( track )->getClip( scene )->bar();
|
||||
jack->getLooper( track )->getClip( scene )->bar(framesInNframes);
|
||||
|
||||
#ifdef DEBUG_CLIP
|
||||
GridLogic::State s = jack->getLooper( track )->getClip( scene )->getState();
|
||||
|
|
|
@ -67,7 +67,7 @@ class GridLogic : public TimeObserver
|
|||
void updateState();
|
||||
|
||||
/// time functions, not for use by Controller subclasses
|
||||
void bar();
|
||||
void bar(int nframes);
|
||||
void beat();
|
||||
|
||||
/// for debug purposes: use static_cast<int>(GridLogic::State) to access
|
||||
|
|
14
src/jack.cxx
14
src/jack.cxx
|
@ -5,6 +5,20 @@
|
|||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
#include "state/state.hxx"
|
||||
|
||||
#include "logic.hxx"
|
||||
#include "config.hxx"
|
||||
#include "looper.hxx"
|
||||
#include "metronome.hxx"
|
||||
#include "gridlogic.hxx"
|
||||
#include "trackoutput.hxx"
|
||||
#include "timemanager.hxx"
|
||||
#include "controllerupdater.hxx"
|
||||
|
||||
#include "dsp/dsp_reverb.hxx"
|
||||
#include "dsp/dsp_dbmeter.hxx"
|
||||
|
||||
#include "audiobuffer.hxx"
|
||||
#include "eventhandler.hxx"
|
||||
#include "controller/genericmidi.hxx"
|
||||
|
|
31
src/jack.hxx
31
src/jack.hxx
|
@ -9,23 +9,26 @@
|
|||
#include <jack/midiport.h>
|
||||
#include <jack/transport.h>
|
||||
|
||||
#include "state/state.hxx"
|
||||
|
||||
#include "logic.hxx"
|
||||
#include "config.hxx"
|
||||
#include "looper.hxx"
|
||||
#include "metronome.hxx"
|
||||
#include "gridlogic.hxx"
|
||||
#include "trackoutput.hxx"
|
||||
#include "timemanager.hxx"
|
||||
#include "controllerupdater.hxx"
|
||||
|
||||
#include "dsp/dsp_reverb.hxx"
|
||||
#include "dsp/dsp_dbmeter.hxx"
|
||||
#include "dsp/dsp_sidechain_gain.hxx"
|
||||
#include "event.hxx"
|
||||
|
||||
class MidiIO;
|
||||
|
||||
class Reverb;
|
||||
class DBMeter;
|
||||
|
||||
class State;
|
||||
class Logic;
|
||||
class Looper;
|
||||
class Metronome;
|
||||
class GridLogic;
|
||||
class TimeManager;
|
||||
class ControllerUpdater;
|
||||
|
||||
class TrackOutput;
|
||||
|
||||
// INPUT_TO
|
||||
//#include "gridlogic.hxx"
|
||||
|
||||
using namespace std;
|
||||
|
||||
/** Jack
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
#include "jack.hxx"
|
||||
extern Jack* jack;
|
||||
|
||||
#include "timemanager.hxx"
|
||||
#include "controllerupdater.hxx"
|
||||
#include "trackoutput.hxx"
|
||||
#include "metronome.hxx"
|
||||
|
||||
Logic::Logic()
|
||||
{
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "config.hxx"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "jack.hxx"
|
||||
#include "audiobuffer.hxx"
|
||||
#include "eventhandler.hxx"
|
||||
|
|
|
@ -8,6 +8,11 @@
|
|||
#include "eventhandler.hxx"
|
||||
#include "audiobuffer.hxx"
|
||||
|
||||
#include "controllerupdater.hxx"
|
||||
#include "timemanager.hxx"
|
||||
|
||||
|
||||
|
||||
extern Jack* jack;
|
||||
|
||||
LooperClip::LooperClip(int t, int s) :
|
||||
|
@ -220,7 +225,12 @@ long LooperClip::getBufferLenght()
|
|||
return _recordhead;
|
||||
}
|
||||
|
||||
void LooperClip::bar()
|
||||
void LooperClip::bar(int framesInNframes)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LooperClip::doBar()
|
||||
{
|
||||
bool change = false;
|
||||
GridLogic::State s = GridLogic::STATE_EMPTY;
|
||||
|
|
|
@ -42,7 +42,8 @@ class LooperClip : public Stately
|
|||
void record(int count, float* L, float* R);
|
||||
|
||||
/// TimeObserver overrides
|
||||
void bar();
|
||||
void bar(){}; // dummy override
|
||||
void bar(int);
|
||||
|
||||
/// SaveAble overrides
|
||||
void save();
|
||||
|
@ -112,6 +113,11 @@ class LooperClip : public Stately
|
|||
float _playhead;
|
||||
float _recordhead;
|
||||
AudioBuffer* _buffer;
|
||||
|
||||
/// causes buffer changing / bar() effect: note this is called internally due
|
||||
/// to a bar event being *inside* an nframes, *not* on a boundary
|
||||
int barCountdown;
|
||||
void doBar();
|
||||
};
|
||||
|
||||
#endif // LUPPP_LOOPER_CLIP_H
|
||||
|
|
|
@ -40,7 +40,7 @@ void Metronome::setActive(bool a)
|
|||
playPoint = endPoint + 1;
|
||||
}
|
||||
|
||||
void Metronome::bar()
|
||||
void Metronome::bar(int)
|
||||
{
|
||||
playPoint = 0;
|
||||
playBar = true;
|
||||
|
|
|
@ -19,7 +19,8 @@ class Metronome : public TimeObserver
|
|||
|
||||
void setActive(bool a);
|
||||
|
||||
void bar();
|
||||
void bar(){}; // dummy override
|
||||
void bar(int);
|
||||
void beat();
|
||||
void setFpb(int f);
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include "../jack.hxx"
|
||||
extern Jack* jack;
|
||||
|
||||
#include "../timemanager.hxx"
|
||||
|
||||
TimeObserver::TimeObserver()
|
||||
{
|
||||
jack->getTimeManager()->registerObserver( this );
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#ifndef LUPPP_TIME_OBSERVER_H
|
||||
#define LUPPP_TIME_OBSERVER_H
|
||||
|
||||
#include "../config.hxx"
|
||||
|
||||
class TimeObserver
|
||||
{
|
||||
public:
|
||||
|
@ -11,7 +13,11 @@ class TimeObserver
|
|||
|
||||
virtual void setFpb(int fpb){};
|
||||
|
||||
virtual void bar(){};
|
||||
|
||||
virtual void bar(){LUPPP_WARN("bar() int not overriden");}
|
||||
|
||||
virtual void bar(int framesInNframes){};
|
||||
|
||||
virtual void beat(){};
|
||||
|
||||
virtual void tapTempo(bool b){};
|
||||
|
|
|
@ -124,12 +124,14 @@ void TimeManager::process(Buffers* buffers)
|
|||
buffers->transportPosition->beat_type = 4;
|
||||
|
||||
int beat = buffers->transportFrame / fpb;
|
||||
//int beat = int(beat);
|
||||
int nframesRemainder = buffers->transportFrame % int(fpb);
|
||||
|
||||
//int tick = int( (beatFloat - beat) * 1920 );
|
||||
|
||||
if ( beat != oldBeat )
|
||||
{
|
||||
LUPPP_NOTE("Beat %i, nframes %i", beat, nframesRemainder );
|
||||
|
||||
// inform observers of new beat FIRST
|
||||
for(uint i = 0; i < observers.size(); i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue