online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Test JUCE Sampler Based on AudioSynthesiserDemo from Demo Runner and JUCE MIDI Synthesiser Tutorial online *******************************************************************************/ class SynthAudioSource : public AudioSource { public: SynthAudioSource (MidiKeyboardState& keyState) : keyboardState (keyState) { for (auto i = 0; i < 4; ++i) // [1] { synth.addVoice(new SamplerVoice()); } } void setUsingSineWaveSound() { synth.clearSounds(); synth.addSound(new SineWaveSound()); } void setUsingSampledSound() { audioFormatManager.registerBasicFormats(); File* file = new File("../VeryHeavy1.wav"); ScopedPointer<AudioFormatReader> reader = audioFormatManager.createReaderFor(*file); // std::unique_ptr<AudioFormatReader> audioReader (wavFormat.createReaderFor (createAssetInputStream("VeryHeavy1.wav"), true)); BigInteger allNotes; allNotes.setRange(0, 128, true); synth.clearSounds(); synth.addSound( new SamplerSound ("button sounds", *reader, allNotes, 74, 0.1, 0.1, 10.0)); } void prepareToPlay (int /*samplesPerBlockExpected*/, double sampleRate) override { midiCollector.reset(sampleRate); synth.setCurrentPlaybackSampleRate (sampleRate); // [3] } void releaseResources() override {} void getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill) override { bufferToFill.clearActiveBufferRegion(); MidiBuffer incomingMidi; midiCollector.removeNextBlockOfMessages(incomingMidi, bufferToFill.numSamples); keyboardState.processNextMidiBuffer (incomingMidi, bufferToFill.startSample, bufferToFill.numSamples, true); // [4] synth.renderNextBlock (*bufferToFill.buffer, incomingMidi, bufferToFill.startSample, bufferToFill.numSamples); // [5] } private: AudioFormatManager audioFormatManager; MidiMessageCollector midiCollector; MidiKeyboardState& keyboardState; Synthesiser synth; }; };

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue