design: Fix up formatting
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
parent
37d4085d27
commit
0d84f92d2a
42
design.txt
42
design.txt
|
@ -75,6 +75,7 @@ Printing: (include/print.h>
|
|||
API:
|
||||
void print(string fmt, ...)
|
||||
Print text to the screen.
|
||||
|
||||
void dprint(string fmt, ...)
|
||||
Print text to the screen when debugging or testing is enabled.
|
||||
|
||||
|
@ -153,7 +154,7 @@ On-disk files: (lib/file.cpp)
|
|||
File << <OTHER_DATA>;
|
||||
|
||||
- API:
|
||||
File : File(string filepath, FileLocHint hint)
|
||||
File :: File(string filepath, FileLocHint hint)
|
||||
Resolve filepath to one of:
|
||||
XDG_{CONFIG|DATA}_HOME/ocarina/filepath
|
||||
XDG_{CONFIG|DATA}_HOME/ocarina-debug/filepath
|
||||
|
@ -164,20 +165,20 @@ On-disk files: (lib/file.cpp)
|
|||
If filepath is an empty string, set the file hint to
|
||||
FILE_TYPE_INVALID and do not set the filepath field.
|
||||
|
||||
File : ~File()
|
||||
File :: ~File()
|
||||
Close the file stream if it is open.
|
||||
|
||||
const char *File : get_filepath()
|
||||
const char *File :: get_filepath()
|
||||
Return the full filepath to the file.
|
||||
|
||||
const unsigned int File : get_version()
|
||||
const unsigned int File :: get_version()
|
||||
Return the file version number.
|
||||
|
||||
bool File : exists()
|
||||
bool File :: exists()
|
||||
Return true if the file exists in the filesystem.
|
||||
Return false otherwise.
|
||||
|
||||
bool File : open(OpenMode mode)
|
||||
bool File :: open(OpenMode mode)
|
||||
When opening a file for reading (mode == OPEN_READ),
|
||||
- Return false if the file does not exist
|
||||
- Open the file
|
||||
|
@ -194,10 +195,10 @@ On-disk files: (lib/file.cpp)
|
|||
Return false if the file is already open.
|
||||
Return false if there are any other errors.
|
||||
|
||||
bool File : close()
|
||||
bool File :: close()
|
||||
Close a file after IO.
|
||||
|
||||
string File : getline();
|
||||
string File :: getline();
|
||||
Read an entire line from the file and return it to the caller.
|
||||
In theory a return value optimization will occur so returning
|
||||
a string by value won't be a problem.
|
||||
|
@ -531,10 +532,13 @@ Groups: (lib/group.cpp)
|
|||
- API
|
||||
void group :: add(name, track_id)
|
||||
group_idx.insert(name, track_id);
|
||||
|
||||
void group :: del(name, track_id)
|
||||
grou_idx.delete(name, track_id)
|
||||
|
||||
void void group :: list(list<string> &);
|
||||
return group_idx.keys();
|
||||
|
||||
void group :: get_tracks(name):
|
||||
return group_idx[name]
|
||||
|
||||
|
@ -655,22 +659,31 @@ Library: (lib/library.cpp)
|
|||
library :: init();
|
||||
Initialize databases and read files from disk. Fill out
|
||||
groups and prepare filter as tracks are read.
|
||||
|
||||
library :: add_path(string dir);
|
||||
Add new row to paths table, update
|
||||
|
||||
library :: del_path(unsigned int lib_id);
|
||||
Invalidate a path row and all tracks owned by that path
|
||||
|
||||
library :: update_path(lib_id);
|
||||
Update the given library path, if valid.
|
||||
|
||||
struct Track library :: resolve(track_id)
|
||||
Fill out a Track structure for the provided track_id
|
||||
|
||||
const Database<library :: Album> &library :: get_albums();
|
||||
Return the album database.
|
||||
|
||||
const Database<library :: Artist> &library :: get_artists();
|
||||
Return the artist database.
|
||||
|
||||
const Database<library :: Genre> &library :: get_genres();
|
||||
Return the genre database.
|
||||
|
||||
const Database<library :: Library> &library :: get_libraries();
|
||||
Return the library database.
|
||||
|
||||
const Database<library :: Track> &library :: get_tracks();
|
||||
Return the track database.
|
||||
|
||||
|
@ -733,12 +746,16 @@ Playlist: (lib/playlist.cpp)
|
|||
- API
|
||||
deck :: init();
|
||||
Read in the playlist file
|
||||
|
||||
deck :: new();
|
||||
Adds a new playlist to the deck
|
||||
|
||||
deck :: rm(N)
|
||||
Removes playlist N from the deck
|
||||
|
||||
Playlist *deck :: get(N)
|
||||
Return playlist N from the deck
|
||||
|
||||
deck :: next()
|
||||
Play the next song from the deck
|
||||
|
||||
|
@ -771,21 +788,29 @@ Audio: (lib/audio.cpp)
|
|||
Initialize the gstreamer layer and reload the track that was
|
||||
last loaded before shutdown. Please only pass --gst-* options
|
||||
for argv.
|
||||
|
||||
audio :: load_file(filepath)
|
||||
Loads a file path but does not begin playback.
|
||||
|
||||
audio :: play()
|
||||
Begin playback
|
||||
|
||||
audio :: pause()
|
||||
Pause playback
|
||||
|
||||
audio :: seek_to(X)
|
||||
Seek to a position X seconds into the track
|
||||
|
||||
audio :: stop()
|
||||
pause()
|
||||
seek_to(0)
|
||||
|
||||
audio :: pause_after(N)
|
||||
Pause after N tracks, pass a negative number to disable.
|
||||
|
||||
audio :: position()
|
||||
Return the number of seconds that the song has played
|
||||
|
||||
audio :: duration()
|
||||
Return the duration of the current song in seconds
|
||||
|
||||
|
@ -801,6 +826,7 @@ Preferences: (lib/prefs.cpp)
|
|||
- API:
|
||||
prefs :: set(string, val);
|
||||
prefs.replace(string, val);
|
||||
|
||||
prefs :: get(string)
|
||||
return prefs[string].begin()
|
||||
|
||||
|
|
|
@ -28,20 +28,28 @@ Audio: (lib/audio.cpp)
|
|||
Initialize the gstreamer layer and reload the track that was
|
||||
last loaded before shutdown. Please only pass --gst-* options
|
||||
for argv.
|
||||
|
||||
audio :: load_file(filepath)
|
||||
Loads a file path but does not begin playback.
|
||||
|
||||
audio :: play()
|
||||
Begin playback
|
||||
|
||||
audio :: pause()
|
||||
Pause playback
|
||||
|
||||
audio :: seek_to(X)
|
||||
Seek to a position X seconds into the track
|
||||
|
||||
audio :: stop()
|
||||
pause()
|
||||
seek_to(0)
|
||||
|
||||
audio :: pause_after(N)
|
||||
Pause after N tracks, pass a negative number to disable.
|
||||
|
||||
audio :: position()
|
||||
Return the number of seconds that the song has played
|
||||
|
||||
audio :: duration()
|
||||
Return the duration of the current song in seconds
|
||||
|
|
|
@ -70,7 +70,7 @@ On-disk files: (lib/file.cpp)
|
|||
File << <OTHER_DATA>;
|
||||
|
||||
- API:
|
||||
File : File(string filepath, FileLocHint hint)
|
||||
File :: File(string filepath, FileLocHint hint)
|
||||
Resolve filepath to one of:
|
||||
XDG_{CONFIG|DATA}_HOME/ocarina/filepath
|
||||
XDG_{CONFIG|DATA}_HOME/ocarina-debug/filepath
|
||||
|
@ -81,20 +81,20 @@ On-disk files: (lib/file.cpp)
|
|||
If filepath is an empty string, set the file hint to
|
||||
FILE_TYPE_INVALID and do not set the filepath field.
|
||||
|
||||
File : ~File()
|
||||
File :: ~File()
|
||||
Close the file stream if it is open.
|
||||
|
||||
const char *File : get_filepath()
|
||||
const char *File :: get_filepath()
|
||||
Return the full filepath to the file.
|
||||
|
||||
const unsigned int File : get_version()
|
||||
const unsigned int File :: get_version()
|
||||
Return the file version number.
|
||||
|
||||
bool File : exists()
|
||||
bool File :: exists()
|
||||
Return true if the file exists in the filesystem.
|
||||
Return false otherwise.
|
||||
|
||||
bool File : open(OpenMode mode)
|
||||
bool File :: open(OpenMode mode)
|
||||
When opening a file for reading (mode == OPEN_READ),
|
||||
- Return false if the file does not exist
|
||||
- Open the file
|
||||
|
@ -111,10 +111,10 @@ On-disk files: (lib/file.cpp)
|
|||
Return false if the file is already open.
|
||||
Return false if there are any other errors.
|
||||
|
||||
bool File : close()
|
||||
bool File :: close()
|
||||
Close a file after IO.
|
||||
|
||||
string File : getline();
|
||||
string File :: getline();
|
||||
Read an entire line from the file and return it to the caller.
|
||||
In theory a return value optimization will occur so returning
|
||||
a string by value won't be a problem.
|
||||
|
|
|
@ -32,9 +32,12 @@ Groups: (lib/group.cpp)
|
|||
- API
|
||||
void group :: add(name, track_id)
|
||||
group_idx.insert(name, track_id);
|
||||
|
||||
void group :: del(name, track_id)
|
||||
grou_idx.delete(name, track_id)
|
||||
|
||||
void void group :: list(list<string> &);
|
||||
return group_idx.keys();
|
||||
|
||||
void group :: get_tracks(name):
|
||||
return group_idx[name]
|
||||
|
|
|
@ -128,21 +128,30 @@ Library: (lib/library.cpp)
|
|||
library :: init();
|
||||
Initialize databases and read files from disk. Fill out
|
||||
groups and prepare filter as tracks are read.
|
||||
|
||||
library :: add_path(string dir);
|
||||
Add new row to paths table, update
|
||||
|
||||
library :: del_path(unsigned int lib_id);
|
||||
Invalidate a path row and all tracks owned by that path
|
||||
|
||||
library :: update_path(lib_id);
|
||||
Update the given library path, if valid.
|
||||
|
||||
struct Track library :: resolve(track_id)
|
||||
Fill out a Track structure for the provided track_id
|
||||
|
||||
const Database<library :: Album> &library :: get_albums();
|
||||
Return the album database.
|
||||
|
||||
const Database<library :: Artist> &library :: get_artists();
|
||||
Return the artist database.
|
||||
|
||||
const Database<library :: Genre> &library :: get_genres();
|
||||
Return the genre database.
|
||||
|
||||
const Database<library :: Library> &library :: get_libraries();
|
||||
Return the library database.
|
||||
|
||||
const Database<library :: Track> &library :: get_tracks();
|
||||
Return the track database.
|
||||
|
|
|
@ -66,12 +66,16 @@ Playlist: (lib/playlist.cpp)
|
|||
- API
|
||||
deck :: init();
|
||||
Read in the playlist file
|
||||
|
||||
deck :: new();
|
||||
Adds a new playlist to the deck
|
||||
|
||||
deck :: rm(N)
|
||||
Removes playlist N from the deck
|
||||
|
||||
Playlist *deck :: get(N)
|
||||
Return playlist N from the deck
|
||||
|
||||
deck :: next()
|
||||
Play the next song from the deck
|
||||
|
||||
|
|
|
@ -17,5 +17,6 @@ Preferences: (lib/prefs.cpp)
|
|||
- API:
|
||||
prefs :: set(string, val);
|
||||
prefs.replace(string, val);
|
||||
|
||||
prefs :: get(string)
|
||||
return prefs[string].begin()
|
||||
|
|
|
@ -14,5 +14,6 @@ Printing: (include/print.h>
|
|||
API:
|
||||
void print(string fmt, ...)
|
||||
Print text to the screen.
|
||||
|
||||
void dprint(string fmt, ...)
|
||||
Print text to the screen when debugging or testing is enabled.
|
||||
|
|
Loading…
Reference in New Issue