I am trying to work through and understand the AudioDemoPlaybackPage module in the JUCE demo. I created a bare bones gui project (Main.cpp, MainComponent.h, and MainComponent.cpp), and am trying to expand that to play a soundfile.
What do I put in MainComponent.h and MainComponent.cpp to create a TimeSliceThread instance named 'thread' that I can eventually use in this line that I see in the JUCE AudioDemoPlaybackPage module:
The “: thread(“something”)” is the initialisation for the TimeSliceThread object. With a lot of classes you don’t need that, but some classes (like TimeSliceThread) have a no (or a private) standard constructor and you need to use a constructor with parameters.
For local use you would add this to the object declaration:
{
TimeSliceThread thead("audio");
// [...]
}
The initialisation list is the way to do the above with class members.