Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

experimental branch - ofxSoundPlayerObject - setId #36

Open
stephanschulz opened this issue May 7, 2021 · 3 comments
Open

experimental branch - ofxSoundPlayerObject - setId #36

stephanschulz opened this issue May 7, 2021 · 3 comments

Comments

@stephanschulz
Copy link

stephanschulz commented May 7, 2021

Using the experimental Branch:

With ofxSoundPlayerObject:

no of these work does not work anymore:

- players[id]->instances[0].id = i; //used to work
    players[i]->instances[0].setId(i);
    players[i]->setId(i);

How do you set ID so that a player[i]->endEvent gets called?

@stephanschulz stephanschulz changed the title experimental branch - ofxSoundPlayerObject - setID experimental branch - ofxSoundPlayerObject - setId May 7, 2021
@roymacdonald
Copy link
Owner

Hi Stephan,
I made the instances to be private. Is that the problem? otherwise I can still set the id and the event gets triggered

@stephanschulz
Copy link
Author

ofxSoundPlayerObject needs some way to setId, otherwise endEvent won't know which to react to. No?

@roymacdonald
Copy link
Owner

I just added the following functions to ofxSoundPlayerObject

ofxSingleSoundPlayer& getPlayInstance(size_t index);
const ofxSingleSoundPlayer& getPlayInstance(size_t index) const;
size_t getNumPlayInstances() const;

so you can do something as
players[i]->getPlayInstance(0).setId(i);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants