Ok, I’ll put it sometimes next week, have to clean it before.
That’s funny because I just set up my first GitHub account yesterday,
I’ve uploaded my first library here https://github.com/aybe/GLA
In the mean time if someone fluent in JUCE can see the code and tell anything wrong,
I’ve spent quite some time trying to avoid ‘new’ as said in the docs,
but I concluded that it’s (mostly) unavoidable at least for my case,
pretty much all members are global, I couldn’t initialize them like int i(0);
I couldn’t put the AudioFormatReader in a ScopedPointer, in the samples it’s like that
so I left it as is.
Beside that I’ve seen how ScopedPointer works when cleaning stuff,
read a few docs etc but it’ll still take some time for me to digest all that,
at least now JUCE does not complain about leaks when I exit the program !
Oh and yes, I thought I could reduce compilation time by removing some modules,
build time did not improve much but my executable got bigger, how come ?
void initialise (const String& commandLine)
// Do your application's initialisation code here..
mainWindow = new MainAppWindow();
//mainWindow->setResizeLimits(256, 256, 256, 256);
// Load a file
File & currentDir = File::getCurrentWorkingDirectory();
File & audioFile = currentDir.getChildFile("audio.mp3");
/* Create required classes for playback */
audioFormatManager = (new AudioFormatManager());
audioFormatReader = (audioFormatManager->createReaderFor(audioFile));
audioFormatReaderSource = (new AudioFormatReaderSource(audioFormatReader,true));
audioTransportSource = (new AudioTransportSource());
audioTransportSource->setSource(audioFormatReaderSource, 0, nullptr, 44100.0, 2);
audioSourcePlayer = (new AudioSourcePlayer());
audioDeviceManager = (new AudioDeviceManager());
audioDeviceManager->initialise(2, 2, 0, true);
_image = new Image(Image::ARGB,256,256,true);
_imageComponent = new ImageComponent();
_imageComponent->setBounds(0, 0, 256, 256);
myTimer1 = (new MyTimer1(_imageComponent));
myTimer1->startTimer((int)(1.0f / 30 * 1000));