ocarina/design/deck.txt

57 lines
1.3 KiB
Plaintext

== Files ==
ocarina/include/
deck.h
ocarina/lib/
deck.cpp
$HOME/.ocarina{-debug}/
playlists.lst
== Depends ==
playlist
Deck: (lib/deck.cpp)
The playlist deck is used to hold the temporary playlists created by
the user.
- Deck:
list<Playlist> deck;
File << current_track << deck.size() << endl;
File << deck[0] << endl;
File << deck[N] << endl;
- API
void deck :: read(File &);
void deck :: write(File &);
Read or write the playlist file. This will be called
from the audio layer to store state.
Playlist *deck :: create();
Adds a new playlist to the end of the deck and returns a
pointer to it.
void deck :: remove(N);
Remove playlist N from the deck.
Playlist *deck :: get(N);
Return playlist N from the deck.
void deck :: move(M, N);
Move playlist at index M to index N.
unsigned int deck :: next();
Iterate through the deck until you find a playlist with the
flag PL_ENABLED set. Call next() on this playlist and return
the result.
If the playlist is empty after calling next(), remove it from
the deck.
void deck :: reset();
This function only exists if CONFIG_DEBUG is enabled. Erase
all the playlist information and reset the deck list.
void deck :: print_info();
This function only exists if CONFIG_DEBUG is enabled. Print
out helpful stats about the current state of the playlist deck.