Audio Device Manager, playing file problem


#1

hi,

I’m having some problems making a wav file play. I made a class that creates my Interface (buttons, sliders, etc called MainUi). Then in this class I have added the audio functionality as in the Jucedemo audioPlayBack page. So I have:

AudioDeviceManager& deviceManager;
AudioSourcePlayer audioSourcePlayer;
AudioTransportSource transportSource;
ScopedPointer currentAudioFileSource;

At first My constructor was just: MainUi();
so in the constructor of the MainAppClass generated by the jucer to put the component in the document window I added it like this:

MainUi *dMain = new MainUi();

Up to this point it worked fine and I was loading a file and painting the waveform on a thumbnail perfectly. Then I added the deviceManager, audioSourePlayer,etc like above. I ,odified the constructor for it to get an AudioDeviceManager, so the constructor is MainUi(AudioDeviceManager& deviceManager);

What I don’t understand now is how can I add this component to the constructor of the MainApp Class. When I add it as MainUi *dMain = new MainUi(AudioDeviceManager& deviceManager);
I get the error “Data Formatters temporarliy unavailable”…Any help greatly appreciated!
Thanks.