diff --git a/src/jack.cxx b/src/jack.cxx index 86eaca7..87011be 100644 --- a/src/jack.cxx +++ b/src/jack.cxx @@ -84,6 +84,11 @@ Jack::Jack( std::string name ) : clientActive(false) { jack = this; + + samplerate = jack_get_sample_rate( client ); + + LUPPP_NOTE("Samplerate %i", samplerate ); + // construct Observer classes here, not in the initializer list as the Jack* // will be 0x0 until then. timeManager = new TimeManager(), @@ -91,7 +96,6 @@ Jack::Jack( std::string name ) : logic = new Logic(); gridLogic = new GridLogic(); - // CAREFUL: setup the size by default: otherwise malloc() is called on push_back midiIO.reserve( CONTROLLERS_PREALLOC ); @@ -554,7 +558,7 @@ int Jack::getBuffersize() int Jack::getSamplerate() { - return jack_get_sample_rate( client ); + return samplerate; } int Jack::timebase(jack_transport_state_t state, diff --git a/src/jack.hxx b/src/jack.hxx index c821e05..bb470ee 100644 --- a/src/jack.hxx +++ b/src/jack.hxx @@ -141,6 +141,7 @@ class Jack // JACK member variables bool clientActive; + int samplerate; jack_port_t* masterInput; jack_port_t* masterOutputL;