Add more to the Track tag design

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
This commit is contained in:
Anna Schumaker 2014-03-22 20:06:36 -04:00 committed by Anna Schumaker
parent 0fee94f76a
commit d61dbae47f
1 changed files with 31 additions and 11 deletions

42
DESIGN
View File

@ -760,6 +760,19 @@ Track Tag:
The track tag is used to store information about a single track in the
user's music collection.
- Sorting:
enum sort_t {
SORT_ARTIST,
SORT_ALBUM,
SORT_COUNT,
SORT_GENRE,
SORT_LENGTH,
SORT_PLAYED,
SORT_TITLE,
SORT_TRACK,
SORT_YEAR,
};
- Track:
class Track : public DatabaseEntry {
public:
@ -783,10 +796,12 @@ Track Tag:
Track();
Track(Library *, const std::string &);
const std::string primary_key();
const std::string path();
void tag();
void read(File &);
void write(File &);
void tag();
const std::string path();
bool less_than(Track *rhs, sort_t field);
};
- File Format:
@ -810,9 +825,13 @@ Track Tag:
const std::string Track :: primary_key();
return path();
const std::string Track :: path();
Combine library->path and filepath to find the full path to
the audio file.
void read(File &f);
Read track information from file. Look up the corresponding
Library, Artist, Album and Genre pointers. Add title to the
filter and find the string version of length.
void write(File &f);
Write track information to file.
void Track :: tag();
Use TagLib to find tags and audio properties for this file.
@ -823,13 +842,14 @@ Track Tag:
- Set play_count, last_year, last_month and last_day = 0.
- Set lowercase title and find the string form of length.
void read(File &f);
Read track information from file. Look up the corresponding
Library, Artist, Album and Genre pointers. Add title to the
filter and find the string version of length.
const std::string Track :: path();
Combine library->path and filepath to find the full path to
the audio file.
void write(File &f);
Write track information to file.
bool Track :: less_than(Track *rhs, sort_t field);
Compare the requested field for this Track instance to the same
field in the provided track. Return true if we find that this
instance is less than rhs and false otherwise.