void ofApp::dragEvent(ofDragInfo dragInfo) {
if (dragInfo.files.size() > 0) {
sound.assign(dragInfo.files.size(), ofSoundPlayer());
for (int s = 0; s < dragInfo.files.size(); s++) {
musicpath = dragInfo.files[s];
sound[s].load(dragInfo.files[s]);
sound[s].play();
sound[s].setVolume(0.5);
}
dropped = true;
}
}
This is my code where I drag music into OFX. I tried some different stuff to stop the sound with a ofxButton, but it is not possible to change the ‘sound[s]’ in the dragEvent.
What should I do?