libsaria: Create library and track counters

I plan on using (library, track) ids as a way of storing playlists.  I
made both counters unsigned ints, since I'm willing to bet that people
won't have 4,294,967,295 songs or library paths...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-03-24 09:00:44 -04:00
parent 41dac97711
commit ab687a49bc
4 changed files with 7 additions and 0 deletions

View File

@ -17,6 +17,8 @@ namespace libsaria
struct Path {
bool visible;
unsigned int id;
unsigned int next_track;
string path;
list<Track> tracks;
};

View File

@ -19,6 +19,7 @@ namespace libsaria
string comment;
string genre;
string lenstr;
unsigned int id;
unsigned int year;
unsigned int track;
unsigned int count;

View File

@ -15,6 +15,7 @@ using namespace std;
#include <libsaria/playlist.h>
#include <libsaria/stack.h>*/
static int next_id = 0;
static list<struct libsaria::library::Path> path_list;
list<libsaria::library::Driver *> driver_list;
libsaria::Set lib_playlist("Library", PL_STATIC);
@ -48,6 +49,8 @@ namespace libsaria
list<libsaria::library::Driver *>::iterator it;
path.visible = true;
path.id = next_id++;
path.next_track = 0;
path.path = dir;
path_list.push_back(path);

View File

@ -64,6 +64,7 @@ namespace libsaria
{
filepath = file;
path = lib_path;
id = lib_path->next_track++;
count = 0;
last_day = 0;
last_month = 0;