lbajardsilogic@0: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ lbajardsilogic@0: lbajardsilogic@0: /* lbajardsilogic@0: Sonic Visualiser lbajardsilogic@0: An audio file viewer and annotation editor. lbajardsilogic@0: Centre for Digital Music, Queen Mary, University of London. lbajardsilogic@0: This file copyright 2006 Chris Cannam. lbajardsilogic@0: lbajardsilogic@0: This program is free software; you can redistribute it and/or lbajardsilogic@0: modify it under the terms of the GNU General Public License as lbajardsilogic@0: published by the Free Software Foundation; either version 2 of the lbajardsilogic@0: License, or (at your option) any later version. See the file lbajardsilogic@0: COPYING included with this distribution for more information. lbajardsilogic@0: */ lbajardsilogic@0: lbajardsilogic@0: #ifndef _BZIP_FILE_DEVICE_H_ lbajardsilogic@0: #define _BZIP_FILE_DEVICE_H_ lbajardsilogic@0: lbajardsilogic@0: #include lbajardsilogic@0: lbajardsilogic@0: #include lbajardsilogic@0: lbajardsilogic@0: class BZipFileDevice : public QIODevice lbajardsilogic@0: { lbajardsilogic@0: Q_OBJECT lbajardsilogic@0: lbajardsilogic@0: public: lbajardsilogic@0: BZipFileDevice(QString fileName); lbajardsilogic@0: virtual ~BZipFileDevice(); lbajardsilogic@0: lbajardsilogic@0: virtual bool open(OpenMode mode); lbajardsilogic@0: virtual void close(); lbajardsilogic@0: lbajardsilogic@0: virtual bool isOK() const; lbajardsilogic@0: lbajardsilogic@0: virtual bool isSequential() const { return true; } lbajardsilogic@0: lbajardsilogic@0: protected: lbajardsilogic@0: virtual qint64 readData(char *data, qint64 maxSize); lbajardsilogic@0: virtual qint64 writeData(const char *data, qint64 maxSize); lbajardsilogic@0: lbajardsilogic@0: QString m_fileName; lbajardsilogic@0: lbajardsilogic@0: FILE *m_file; lbajardsilogic@0: BZFILE *m_bzFile; lbajardsilogic@0: bool m_atEnd; lbajardsilogic@0: bool m_ok; lbajardsilogic@0: }; lbajardsilogic@0: lbajardsilogic@0: #endif