ocarina/design/deck.txt

59 lines
1.4 KiB
Plaintext

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