Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Sound playback and PureMVC  (Read 6371 times)
carnageblood
Newbie
*
Posts: 2


View Profile Email
« on: July 20, 2008, 11:11:58 »

I'm developing an mp3 player where I have a PlaybackProxy wich handles sound playback, volume, id3 etc but I do not know what the data for this proxy should be.
Can anyone suggest an aproach to this!
Logged
schickm
Newbie
*
Posts: 9


View Profile Email
« Reply #1 on: July 20, 2008, 04:06:11 »

Handling sound playback sounds like something that would be better suited for a Mediator & component pair.  I like to treat my proxies as holders of data that extend a few specific methods for the data.  Methods that return id3 information would be good to have in the proxy, but in terms of controlling what the volume level is, I would be putting that in the mediator that facilitates audio playback.

So rather than a PlaybackProxy, I would have your Mp3Proxy, or whatever you would choose to call it..and then a PlayerMediator that is responsible for plugging all of the proper stuff (the sound data, id3 tags, volume level) into your Playback component.  If you were storing the volume that the user set in a past session and then bringing it back then it would make sense to keep that in the proxy because you will have to load/save it when you start/close the application.  But when I get too many user settings I like to create an ApplicationStateProxy that is responsible for tracking all the things that the user has set that would need to be remembered.  Then I have that proxy store it's data in a http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/SharedObject.html.
Logged
Pages: [1]
Print