for(int i = 0; i < timeStamps.size(); i++) { timeStamps[i] = timeStamps[i] - referenceTime; } } } //If Load Audio was selected if (menu -> value() == 2) { Fl_File_Chooser file_chooser(".", "MP3 Files (*.{mp3,wav})", Fl_File_Chooser::SINGLE , "Open File"); file_chooser.show(); while (file_chooser.shown()) { Fl::wait(); } if(file_chooser.count() == 1) { //Stop all sounds first before loading a new one if (CurrentPlayingSound2) { CurrentPlayingSound2->drop(); } engine->stopAllSounds(); CurrentPlayingSound = engine->play2D(file_chooser.value(), true , true, true); CurrentPlayingSound2 = CurrentPlayingSound; //Update file output box audio_box->value(file_chooser.value()); audio_box->activate(); //Enable controls slider -> bounds(0, CurrentPlayingSound->getPlayLength() * timeDisplayFactor); play -> activate(); pause -> deactivate(); slider -> activate(); volumeSlider->value(currentVolume); CurrentPlayingSound2->setVolume(currentVolume); volumeSlider->redraw(); volumeSlider -> activate(); // initialize timer Fl::add_timeout(updateTimerSpeed, UpdateTimerCallback); }
for(int i = 0; i < timeStamps.size(); i++) { timeStamps[i] = timeStamps[i] - referenceTime; } } } //If Load Audio was selected if (menu -> value() == 2) { Fl_File_Chooser file_chooser(".", "MP3 Files (*.{mp3,wav})", Fl_File_Chooser::SINGLE , "Open File"); file_chooser.show(); while (file_chooser.shown()) { Fl::wait(); } if(file_chooser.count() == 1) { //Stop all sounds first before loading a new one if (CurrentPlayingSound2) { CurrentPlayingSound2->drop(); } engine->stopAllSounds(); CurrentPlayingSound = engine->play2D(file_chooser.value(), true , true, true); CurrentPlayingSound2 = CurrentPlayingSound; //Update file output box audio_box->value(file_chooser.value()); audio_box->activate(); //Enable controls slider -> bounds(0, CurrentPlayingSound->getPlayLength() * timeDisplayFactor); play -> activate(); pause -> deactivate(); slider -> activate(); volumeSlider->value(currentVolume); CurrentPlayingSound2->setVolume(currentVolume); volumeSlider->redraw(); volumeSlider -> activate(); // initialize timer Fl::add_timeout(updateTimerSpeed, UpdateTimerCallback); }