libsaria: Pass library path to Track()

This will eventually be used to determine if the track is visible based
on library path visibility.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-03-18 13:27:49 -04:00
parent b0c76f4b11
commit 011db26d92
5 changed files with 12 additions and 7 deletions

View File

@ -2,7 +2,6 @@
#define LIBSARIA_LIBRARY_H
#include <libsaria/fs.h>
#include <libsaria/track.h>
#include <string>
using namespace std;
@ -10,6 +9,8 @@ using namespace std;
namespace libsaria
{
class Track;
namespace library
{

View File

@ -1,6 +1,7 @@
#ifndef LIBSARIA_TRACK_H
#define LIBSARIA_TRACK_H
#include <libsaria/library.h>
#include <string>
using namespace std;
@ -10,8 +11,9 @@ namespace libsaria
class Track
{
private:
/* string filepath;
string title;
library::Path *path;
string filepath;
/* string title;
string artist;
string album;
string comment;
@ -31,7 +33,7 @@ namespace libsaria
void do_bookkeeping();*/
public:
Track(string);
Track(string, library::Path *);
~Track();
/* Track();
Track(string, sid_t);

View File

@ -1,5 +1,6 @@
// Copyright (c) 2011 Bryan Schumaker.
#include <libsaria/library.h>
#include <libsaria/track.h>
#include "library.h"
//#include <map>

View File

@ -56,7 +56,7 @@ void ScanTask::run_task()
list<libsaria::library::Driver *>::iterator d_it;
for (it = file_list.begin(); it != file_list.end(); it++)
path->tracks.push_back(libsaria::Track(*it));
path->tracks.push_back(libsaria::Track(*it, path));
for (d_it = driver_list.begin(); d_it != driver_list.end(); d_it++)
(*d_it)->path_updated(path);

View File

@ -11,9 +11,10 @@
namespace libsaria
{
Track::Track(string file)
Track::Track(string file, struct library::Path *lib_path)
{
filepath = file;
path = lib_path;
}
Track::~Track()