summaryrefslogtreecommitdiffstats
path: root/src/app/playlistFile.h
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2020-06-13 22:45:28 +0900
committerMichele Calgaro <[email protected]>2020-06-13 22:45:28 +0900
commit5f44f7b187093ef290315b7f8766b540a31de35f (patch)
tree27ffb7b218199ca04f240c390c52426c65f45dce /src/app/playlistFile.h
downloadcodeine-5f44f7b187093ef290315b7f8766b540a31de35f.tar.gz
codeine-5f44f7b187093ef290315b7f8766b540a31de35f.zip
Initial code import from debian snapshot
https://snapshot.debian.org/package/codeine/1.0.1-3.dfsg-3.1/ Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'src/app/playlistFile.h')
-rw-r--r--src/app/playlistFile.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/app/playlistFile.h b/src/app/playlistFile.h
new file mode 100644
index 0000000..0302a85
--- /dev/null
+++ b/src/app/playlistFile.h
@@ -0,0 +1,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(); }
+ 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