Mixer: Fix plugin loading chicken/egg problem.

This commit is contained in:
Jonathan Moore Liles 2010-01-16 19:24:09 -06:00
parent e1a41ba9c9
commit 355bf8dbe8
3 changed files with 10 additions and 7 deletions

View File

@ -38,7 +38,6 @@
#include <math.h> #include <math.h>
#include "Engine/Engine.H" #include "Engine/Engine.H"
#include "Chain.H"
@ -332,7 +331,7 @@ Plugin_Module::plugin_instances ( unsigned int n )
DMESSAGE( "Instantiating plugin..." ); DMESSAGE( "Instantiating plugin..." );
if ( ! (h = _idata->descriptor->instantiate( _idata->descriptor, chain()->engine()->sample_rate() ) ) ) if ( ! (h = _idata->descriptor->instantiate( _idata->descriptor, Engine::sample_rate() ) ) )
{ {
WARNING( "Failed to instantiate plugin" ); WARNING( "Failed to instantiate plugin" );
return false; return false;
@ -458,7 +457,7 @@ Plugin_Module::load ( unsigned long id )
Min=_idata->descriptor->PortRangeHints[Port].LowerBound; Min=_idata->descriptor->PortRangeHints[Port].LowerBound;
if (LADSPA_IS_HINT_SAMPLE_RATE(HintDesc)) if (LADSPA_IS_HINT_SAMPLE_RATE(HintDesc))
{ {
Min*=chain()->engine()->sample_rate(); Min*=Engine::sample_rate();
} }
} }
if (LADSPA_IS_HINT_BOUNDED_ABOVE(HintDesc)) if (LADSPA_IS_HINT_BOUNDED_ABOVE(HintDesc))
@ -466,7 +465,7 @@ Plugin_Module::load ( unsigned long id )
Max=_idata->descriptor->PortRangeHints[Port].UpperBound; Max=_idata->descriptor->PortRangeHints[Port].UpperBound;
if (LADSPA_IS_HINT_SAMPLE_RATE(HintDesc)) if (LADSPA_IS_HINT_SAMPLE_RATE(HintDesc))
{ {
Max*=chain()->engine()->sample_rate(); Max*=Engine::sample_rate();
} }
} }
@ -534,7 +533,7 @@ Plugin_Module::load ( unsigned long id )
} }
} }
if (LADSPA_IS_HINT_SAMPLE_RATE(HintDesc)) { if (LADSPA_IS_HINT_SAMPLE_RATE(HintDesc)) {
Default *= chain()->engine()->sample_rate(); Default *= Engine::sample_rate();
} }
if (LADSPA_IS_HINT_INTEGER(HintDesc)) { if (LADSPA_IS_HINT_INTEGER(HintDesc)) {
if ( p.hints.ranged && if ( p.hints.ranged &&

View File

@ -24,9 +24,13 @@
namespace JACK namespace JACK
{ {
nframes_t Client::_sample_rate = 0;
Client::Client ( ) Client::Client ( )
{ {
_freewheeling = false; _freewheeling = false;

View File

@ -36,7 +36,7 @@ namespace JACK
jack_client_t *_client; jack_client_t *_client;
nframes_t _sample_rate; static nframes_t _sample_rate;
volatile int _xruns; volatile int _xruns;
volatile bool _freewheeling; volatile bool _freewheeling;
volatile bool _zombified; volatile bool _zombified;
@ -88,7 +88,7 @@ namespace JACK
nframes_t nframes ( void ) const { return jack_get_buffer_size( _client ); } nframes_t nframes ( void ) const { return jack_get_buffer_size( _client ); }
float frame_rate ( void ) const { return jack_get_sample_rate( _client ); } float frame_rate ( void ) const { return jack_get_sample_rate( _client ); }
nframes_t sample_rate ( void ) const { return _sample_rate; } static nframes_t sample_rate ( void ) { return _sample_rate; }
int xruns ( void ) const { return _xruns; }; int xruns ( void ) const { return _xruns; };
bool freewheeling ( void ) const { return _freewheeling; } bool freewheeling ( void ) const { return _freewheeling; }
void freewheeling ( bool yes ); void freewheeling ( bool yes );