The Red Penguin

Hook up the load button to trigger the AudioThumbnail load

Tuesday 4 August 2020

1. We need to go to WaveformDisplay.h and in public list a new function called
void loadURL(juce::URL audioURL);

2. We then need to make this function in the WaveformDisplay.cpp file. So at the bottom add:
void WaveformDisplay::loadURL(juce::URL audioURL)


3. We need to go to DeckGUI.cpp and go to the code for the button listener for &loadButton. Add this:
waveformDisplay.loadURL(juce::URL{ chooser.getResult() });
Because it's a regular object and not a pointer we don't use -> here.

4. In void WaveformDisplay::loadURL(juce::URL audioURL) in WaveformDisplay.cpp add:
audioThumb.setSource(new juce::URLInputSource(audioURL));