#ifndef LIBSARIA_LIBRARY_PATH_H
#define LIBSARIA_LIBRARY_PATH_H

#include <string>
#include <list>
#include <map>
using namespace std;

#include <libsaria/path.h>
#include <libsaria/idle.h>
#include <libsaria/tags.h>
#include <libsaria/track.h>
#include <libsaria/files.h>

class LibraryPath
{
	private:
		string path;
		map <ino_t, TrackTag> file_map;

	public:
		LibraryPath(string);
		LibraryPath(InFile &, string);
		~LibraryPath();

		void update();
		string get_path();
		void insert_track(ino_t, TrackTag &);
		unsigned int size();
		void list_all(list<Track> &track_list);
		bool play_id(ino_t);
		void save(OutFile &);
};

class ScanTask : public IdleTask
{
	private:
		LibraryPath *library;
		string dir;
		bool end_dir;
		void tag_file(file);

	public:
		ScanTask(LibraryPath *, string, bool);
		~ScanTask();
		void run_task();
};

#endif /* LIBSARIA_LIBRARY_PATH_H */
