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

ColiseuPlayer: Singleton #3

Open
ricardopereira opened this issue Oct 13, 2014 · 7 comments
Open

ColiseuPlayer: Singleton #3

ricardopereira opened this issue Oct 13, 2014 · 7 comments

Comments

@ricardopereira
Copy link
Owner

No description provided.

@ricardopereira
Copy link
Owner Author

Lazy initialization and thread safety.

@SentulAsia
Copy link
Contributor

@ricardopereira does this involve dispatch_async?

@ricardopereira
Copy link
Owner Author

@SentulAsia Yes for different queues but it's a premature optimisation 😁
Not necessary for now.

@SentulAsia
Copy link
Contributor

@ricardopereira for singleton, should I add static shared instance and make init as private?

@ricardopereira
Copy link
Owner Author

@SentulAsia Yes, static shared and the init as @unavailable.

@ricardopereira
Copy link
Owner Author

Well, now that I'm thinking about it, maybe we don't need a singleton and we can assume the latest ColiseuPlayer instance will always take control of the audio.

@SentulAsia What your thoughts about this?

@SentulAsia
Copy link
Contributor

As discussed in #26 :

@ricardopereira static shared is another way to solve this problem...
Multiple audio instance fighting to play audio on the same speaker would be troublesome...
My previous app have a playlist audio which is consistently playing, then when some button is tapped, there is an effect sound (a short 1 sec sound)...
It turns out we need to have only 1 instance of audio object or else, the latest object will get to play audio, while the older instance object will stay in silence...

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

No branches or pull requests

2 participants