Browse Source

Mixer: Fix plugin loading chicken/egg problem.

tags/non-daw-v1.1.0
Jonathan Moore Liles 15 years ago
parent
commit
355bf8dbe8
3 changed files with 10 additions and 7 deletions
  1. +4
    -5
      Mixer/Plugin_Module.C
  2. +4
    -0
      nonlib/JACK/Client.C
  3. +2
    -2
      nonlib/JACK/Client.H

+ 4
- 5
Mixer/Plugin_Module.C View File

@@ -38,7 +38,6 @@
#include <math.h>

#include "Engine/Engine.H"
#include "Chain.H"


@@ -332,7 +331,7 @@ Plugin_Module::plugin_instances ( unsigned int n )

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" );
return false;
@@ -458,7 +457,7 @@ Plugin_Module::load ( unsigned long id )
Min=_idata->descriptor->PortRangeHints[Port].LowerBound;
if (LADSPA_IS_HINT_SAMPLE_RATE(HintDesc))
{
Min*=chain()->engine()->sample_rate();
Min*=Engine::sample_rate();
}
}
if (LADSPA_IS_HINT_BOUNDED_ABOVE(HintDesc))
@@ -466,7 +465,7 @@ Plugin_Module::load ( unsigned long id )
Max=_idata->descriptor->PortRangeHints[Port].UpperBound;
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)) {
Default *= chain()->engine()->sample_rate();
Default *= Engine::sample_rate();
}
if (LADSPA_IS_HINT_INTEGER(HintDesc)) {
if ( p.hints.ranged &&


+ 4
- 0
nonlib/JACK/Client.C View File

@@ -24,9 +24,13 @@




namespace JACK
{

nframes_t Client::_sample_rate = 0;

Client::Client ( )
{
_freewheeling = false;


+ 2
- 2
nonlib/JACK/Client.H View File

@@ -36,7 +36,7 @@ namespace JACK

jack_client_t *_client;

nframes_t _sample_rate;
static nframes_t _sample_rate;
volatile int _xruns;
volatile bool _freewheeling;
volatile bool _zombified;
@@ -88,7 +88,7 @@ namespace JACK

nframes_t nframes ( void ) const { return jack_get_buffer_size( _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; };
bool freewheeling ( void ) const { return _freewheeling; }
void freewheeling ( bool yes );


Loading…
Cancel
Save