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.clear();
audioThumb.setSource(new juce::URLInputSource(audioURL));
More posts in cpp
- Add a component ID and converting between ints and strings
- Implement a play button and add a listener
- Implement paintRowBackground and paintCell
- Add a vector to store a list of files
- Add a TableListBox
- Create a PlaylistComponent in the Projucer project
- Threads
- Implement a timer
- Add getPosition and setPosition functions
- Refactor DJAudioPlayer to use app-scope formatManager
- Draw the thumbnail
- Hook up the load button to trigger the AudioThumbnail load
- The AudioThumbnail class in the API
- Creating a new component - WaveformDisplay
- Implementing drag and drop triggers
- Use a MixerAudioSource to play more than one file at a time
- Implement the listener interfaces to DeckGUI
- Creating a DeckGUI class
- setPosition control
- Implementing setGain and setSpeed
- Add audio playback functionality
- Writing the DJAudioPlayer class
- Creating a new JUCE class with Projucer
- Refactoring our code
- Using ResamplingAudioPlayer to implement variable speed playback
- Add stop, start and volume functionality
- Add a file chooser
- Audio file playback in JUCE
- Realtime sound synthesis in JUCE
- Adding a slider listener
- Introduction to event listeners
- Macros
- Inheritance
- Adding a GUI widget to the JUCE app
- Introduction to JUCE