Dennis Schroeder wrote:But - the player instance itself shouldn't be contained in the created Bookmarks object, only the actual values from the player (see comments in code).
Paul Clapham wrote:
Dennis Schroeder wrote:But - the player instance itself shouldn't be contained in the created Bookmarks object, only the actual values from the player (see comments in code).
I don't understand why you make this requirement. And the comments in the code didn't enlighten me in any way. So could you explain in more detail why you say that?
Carey Brown wrote:Your Bookmark class should not have a getBookmark() method because it already is a Bookmark.
You will need getters for the fields (except for player). You should probably not have setters for the fields. It is possible you might want a play(AudioPlayer player) method to return to a bookmark. Other than that it's a bit hard to tell without the API for AudioPlayer.
So when I say "the player instance itself shouldn't be contained in the created Bookmarks object, only the actual values from the player. " I'm mainly concerned with efficient storage usage.
To resume the player from a bookmark it's sufficient to load the previously recieved player values (like current track etc.) back to the player, so it would be a waste of storage space (and possibly a performance decrease) to save the player instance with it also.
All things are lawful, but not all things are profitable.
Knute Snortum wrote:
So when I say "the player instance itself shouldn't be contained in the created Bookmarks object, only the actual values from the player. " I'm mainly concerned with efficient storage usage.
To resume the player from a bookmark it's sufficient to load the previously recieved player values (like current track etc.) back to the player, so it would be a waste of storage space (and possibly a performance decrease) to save the player instance with it also.
I don't think this is correct. If you need the values of a Player object, storing its reference is the way to do it.
Dennis Schroeder wrote:So when I say "the player instance itself shouldn't be contained in the created Bookmarks object, only the actual values from the player. " I'm mainly concerned with efficient storage usage.
To resume the player from a bookmark it's sufficient to load the previously recieved player values (like current track etc.) back to the player, so it would be a waste of storage space (and possibly a performance decrease) to save the player instance with it also.
Knute Snortum wrote:
If you're dead set on doing it your way, you could always to this:
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|