#ifndef __TRACKS_H
#define __TRACKS_H

#include <string>
#include <vdr/plugin.h>

using std::string;

// --- cTrack --------------------------------------------------------
class cTrack : public cListObject {
public:
    string eventtitle;
    string eventsubtitle;
    string eventsummary;

    string artist;  
    string title;
    int year;
    time_t starttime;
    int duration;
    int status; // 0 = on, 1 = off, 2 = converted
    string channelID;

    static char *buffer;
    
    cTrack();
    cTrack(const cEvent* Event);
    ~cTrack();
    bool operator== (const cTrack &arg) const;

    static bool Read(FILE *f);
    bool Parse(const char *s);
    const char *ToText(void) const;
    bool Save(FILE *f);
    void CreateTrackInfo();
};

class cTracks : public cConfig<cTrack> {
 public:
    bool InList(const cEvent* e);
    bool IsTrack(const cEvent* e);
    void SetConverted(cRecording* recording);
    bool AlreadyDone(const cEvent* e);
    bool Blacklisted(const cEvent* e);
    bool Blacklisted(const cTrack& track);
};

extern cTracks Tracks;

#endif
