Delay creation of the audio renderer until audio is actually opened

Originally committed to SVN as r5940.
This commit is contained in:
Thomas Goyne 2011-11-30 00:40:22 +00:00
parent 8632d5ce75
commit c6b97612ae
1 changed files with 5 additions and 4 deletions

View File

@ -565,8 +565,6 @@ AudioDisplay::AudioDisplay(wxWindow *parent, AudioController *controller, agi::C
audio_renderer->SetAmplitudeScale(scale_amplitude);
SetZoomLevel(0);
ReloadRenderingSettings();
SetMinClientSize(wxSize(-1, 70));
SetBackgroundStyle(wxBG_STYLE_PAINT);
SetThemeEnabled(false);
@ -1172,9 +1170,12 @@ void AudioDisplay::OnFocus(wxFocusEvent &event)
}
void AudioDisplay::OnAudioOpen(AudioProvider *_provider)
void AudioDisplay::OnAudioOpen(AudioProvider *provider)
{
provider = _provider;
this->provider = provider;
if (!audio_renderer_provider)
ReloadRenderingSettings();
audio_renderer->SetAudioProvider(provider);
audio_renderer->SetCacheMaxSize(OPT_GET("Audio/Renderer/Spectrum/Memory Max")->GetInt() * 1024 * 1024);