Chris@297: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@297: Chris@297: /* Chris@297: Sonic Visualiser Chris@297: An audio file viewer and annotation editor. Chris@297: Centre for Digital Music, Queen Mary, University of London. Chris@297: This file copyright 2007 QMUL. Chris@297: Chris@297: This program is free software; you can redistribute it and/or Chris@297: modify it under the terms of the GNU General Public License as Chris@297: published by the Free Software Foundation; either version 2 of the Chris@297: License, or (at your option) any later version. See the file Chris@297: COPYING included with this distribution for more information. Chris@297: */ Chris@297: Chris@1581: #ifndef SV_PLAYLIST_FILE_READER_H Chris@1581: #define SV_PLAYLIST_FILE_READER_H Chris@297: Chris@401: #include "FileSource.h" Chris@401: Chris@297: #include Chris@297: Chris@297: #include Chris@297: #include Chris@297: Chris@297: class QFile; Chris@297: Chris@297: class PlaylistFileReader Chris@297: { Chris@297: public: Chris@297: typedef std::vector Playlist; Chris@297: Chris@297: PlaylistFileReader(QString path); Chris@401: PlaylistFileReader(FileSource source); Chris@297: virtual ~PlaylistFileReader(); Chris@297: Chris@297: virtual bool isOK() const; Chris@297: virtual QString getError() const; Chris@297: virtual Playlist load() const; Chris@297: Chris@1853: // Return the set of file extensions that are expected to Chris@1853: // represent parseable playlists. Chris@297: static void getSupportedExtensions(std::set &extensions); Chris@297: Chris@1853: // Return true if the given source has a file extension that is Chris@1853: // one of the supported extensions. Does not look at the content Chris@1853: // of the file. Chris@1853: static bool isSupported(FileSource source); Chris@1853: Chris@297: protected: Chris@401: void init(); Chris@401: Chris@401: FileSource m_source; Chris@297: QFile *m_file; Chris@440: QString m_basedir; Chris@297: QString m_error; Chris@297: }; Chris@297: Chris@297: #endif