diff --git a/src/controller/genericmidi.cxx b/src/controller/genericmidi.cxx index dbbec9b..ef15fb1 100644 --- a/src/controller/genericmidi.cxx +++ b/src/controller/genericmidi.cxx @@ -8,6 +8,7 @@ #include #include "../jack.hxx" +#include "../logic.hxx" #include "../gridlogic.hxx" extern Jack* jack; diff --git a/src/controller/guicontroller.cxx b/src/controller/guicontroller.cxx index 9e1b1a4..5c5ed51 100644 --- a/src/controller/guicontroller.cxx +++ b/src/controller/guicontroller.cxx @@ -8,6 +8,8 @@ #include "../event.hxx" #include "../gridlogic.hxx" +#include "../eventhandler.hxx" + extern Jack* jack; LupppGUI::LupppGUI() : diff --git a/src/eventhandlerdsp.cxx b/src/eventhandlerdsp.cxx index 0c8dca2..b002088 100644 --- a/src/eventhandlerdsp.cxx +++ b/src/eventhandlerdsp.cxx @@ -15,6 +15,9 @@ #include "eventhandler.hxx" #include "logic.hxx" +#include "state/state.hxx" +#include "timemanager.hxx" +#include "controllerupdater.hxx" using namespace std; diff --git a/src/gaudioeditor.cxx b/src/gaudioeditor.cxx index e6b1880..92175a0 100644 --- a/src/gaudioeditor.cxx +++ b/src/gaudioeditor.cxx @@ -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"); diff --git a/src/gridlogic.cxx b/src/gridlogic.cxx index 320fe89..92b7ab8 100644 --- a/src/gridlogic.cxx +++ b/src/gridlogic.cxx @@ -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(); diff --git a/src/gridlogic.hxx b/src/gridlogic.hxx index 1e281cd..4b36625 100644 --- a/src/gridlogic.hxx +++ b/src/gridlogic.hxx @@ -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(GridLogic::State) to access diff --git a/src/jack.cxx b/src/jack.cxx index 08958cc..f13cbcf 100644 --- a/src/jack.cxx +++ b/src/jack.cxx @@ -5,6 +5,20 @@ #include #include +#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" diff --git a/src/jack.hxx b/src/jack.hxx index ce43100..cfe9a8c 100644 --- a/src/jack.hxx +++ b/src/jack.hxx @@ -9,23 +9,26 @@ #include #include -#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 diff --git a/src/logic.cxx b/src/logic.cxx index eab16ea..8012c12 100644 --- a/src/logic.cxx +++ b/src/logic.cxx @@ -4,6 +4,11 @@ #include "jack.hxx" extern Jack* jack; +#include "timemanager.hxx" +#include "controllerupdater.hxx" +#include "trackoutput.hxx" +#include "metronome.hxx" + Logic::Logic() { diff --git a/src/looper.cxx b/src/looper.cxx index 0fa4e96..bbf563a 100644 --- a/src/looper.cxx +++ b/src/looper.cxx @@ -4,6 +4,8 @@ #include "config.hxx" +#include + #include "jack.hxx" #include "audiobuffer.hxx" #include "eventhandler.hxx" diff --git a/src/looperclip.cxx b/src/looperclip.cxx index e4c890b..b28b949 100644 --- a/src/looperclip.cxx +++ b/src/looperclip.cxx @@ -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; diff --git a/src/looperclip.hxx b/src/looperclip.hxx index 421b858..29a1ecc 100644 --- a/src/looperclip.hxx +++ b/src/looperclip.hxx @@ -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 diff --git a/src/metronome.cxx b/src/metronome.cxx index b358c7b..729adad 100644 --- a/src/metronome.cxx +++ b/src/metronome.cxx @@ -40,7 +40,7 @@ void Metronome::setActive(bool a) playPoint = endPoint + 1; } -void Metronome::bar() +void Metronome::bar(int) { playPoint = 0; playBar = true; diff --git a/src/metronome.hxx b/src/metronome.hxx index 1e53f7f..5c28815 100644 --- a/src/metronome.hxx +++ b/src/metronome.hxx @@ -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); diff --git a/src/observer/time.cxx b/src/observer/time.cxx index e9b746b..61697a3 100644 --- a/src/observer/time.cxx +++ b/src/observer/time.cxx @@ -4,6 +4,8 @@ #include "../jack.hxx" extern Jack* jack; +#include "../timemanager.hxx" + TimeObserver::TimeObserver() { jack->getTimeManager()->registerObserver( this ); diff --git a/src/observer/time.hxx b/src/observer/time.hxx index 86d4b8c..b0158dc 100644 --- a/src/observer/time.hxx +++ b/src/observer/time.hxx @@ -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){}; diff --git a/src/timemanager.cxx b/src/timemanager.cxx index 1072014..06a1df7 100644 --- a/src/timemanager.cxx +++ b/src/timemanager.cxx @@ -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++) {