summaryrefslogtreecommitdiffstats
path: root/src/app/playlistFile.h
blob: 7e468afe07e80ef5dd2e0a5d917d4dbee02bac19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// (C) 2005 Max Howell ([email protected])
// See COPYING file for licensing information

#ifndef CODEINE_PLAYLIST_FILE_H
#define CODEINE_PLAYLIST_FILE_H

#include <kurl.h>

class PlaylistFile
{
public:
   PlaylistFile( const KURL &url );
  ~PlaylistFile();

   enum FileFormat { M3U, PLS, Unknown, NotPlaylistFile = Unknown };

   bool isPlaylist() const { return m_type != Unknown; }
   bool isValid() const { return m_isValid; }
   KURL firstUrl() const { return m_contents.isEmpty() ? KURL() : m_contents.first(); }
   TQString error() const { return m_error; }

private:
   /// both only return first url currently
   void parsePlsFile( TQTextStream& );
   void parseM3uFile( TQTextStream& );

   KURL m_url;
   bool m_isRemoteFile;
   bool m_isValid;
   TQString m_error;
   FileFormat m_type;
   TQString m_path;
   KURL::List m_contents;
};

#endif