Hi guys,
it’s me again…
After having successfully completed my first plugin, I want to built a standalone version of the filter. So I tried to set up the audio processing, similar to the plugin host demo.
I wrote a class, that inherits AudioIODeviceCallback, where I want to handle all the Midi and Audio stuff:
#include "../JuceLibraryCode/JuceHeader.h"
class AudioMidiHandler : public AudioIODeviceCallback
{
public:
AudioMidiHandler (void);
~AudioMidiHandler (void);
void audioDeviceAboutToStart (AudioIODevice* device);
void audioDeviceStopped();
void audioDeviceIOCallback ( const float** inputChannelData,
int numInputChannels,
float** outputChannelData,
int numOutputChannels,
int numSamples );
private:
double sampleRate;
//==============================================================================
// (prevent copy constructor and operator= being generated..)
AudioMidiHandler (const AudioMidiHandler&);
AudioMidiHandler& operator= (const AudioMidiHandler&);
};
Furthermore, I have a MainComponent and in it’s constructor, I’m setting up a new member of the AudioDeviceManager:
audioMidiHandler = new AudioMidiHandler();
deviceManager.initialise (2, 2, 0, true, String::empty, 0);
deviceManager.addAudioCallback (audioMidiHandler);
In the audioIODeviceCallback method, I pass the inputChannelData to the outputChannelData. But, strangely, I don’t hear anything when playing trough my soundcard. Did I miss something?
It’s also strange, that in the “Audio Settings” (which I’ve implemented in exactly the same way as it is done in the plugin host, but without saving a XML file), in my app the “audio device type” combo box is missing.
I hope, that this is the right way, doing the audio processing in standalone apps. Would be great, if someone could give me a hint, how to make it work…
Best,
Philipp.