You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
860 B
37 lines
860 B
4 years ago
|
// (C) 2005 Max Howell (max.howell@methylblue.com)
|
||
|
// 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(); }
|
||
|
QString error() const { return m_error; }
|
||
|
|
||
|
private:
|
||
|
/// both only return first url currently
|
||
|
void parsePlsFile( QTextStream& );
|
||
|
void parseM3uFile( QTextStream& );
|
||
|
|
||
|
KURL m_url;
|
||
|
bool m_isRemoteFile;
|
||
|
bool m_isValid;
|
||
|
QString m_error;
|
||
|
FileFormat m_type;
|
||
|
QString m_path;
|
||
|
KURL::List m_contents;
|
||
|
};
|
||
|
|
||
|
#endif
|