/usr/include/qmmp/inputsource.h is in libqmmp-dev 0.7.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | /***************************************************************************
* Copyright (C) 2009-2012 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef INPUTSOURCE_H
#define INPUTSOURCE_H
#include <QObject>
#include <QString>
#include <QStringList>
#include <QIODevice>
#include <QMap>
#include <QHash>
#include "qmmp.h"
#include "inputsourcefactory.h"
/*! @brief The InputSource class provides the base interface class of transports.
* @author Ilya Kotov <forkotov02@hotmail.ru>
*/
class InputSource : public QObject
{
Q_OBJECT
public:
/*!
* Object contsructor.
* @param url Input source path or url.
* @param parent Parent object.
*/
InputSource(const QString &url, QObject *parent = 0);
/*!
* Returns QIODevice-based object for I/O operations.
* Subclass shoud reimplement this function.
*/
virtual QIODevice *ioDevice() = 0;
/*!
* Prepares input data source for usage.
* Subclass shoud reimplement this function.
*/
virtual bool initialize() = 0;
/*!
* Returns \b true if transport is ready for usage; otherwise returns \b false.
*/
virtual bool isReady() = 0;
/*!
* Returns content type of the input stream. Default implementation returns empty string.
*/
virtual QString contentType() const;
/*!
* Returns input source path or url.
*/
const QString url() const;
/*!
* Returns start position in ms;
*/
qint64 offset() const;
/*!
* Sets start position to \b offset ms.
*/
void setOffset(qint64 offset);
/*!
* Informs input source object about new received metadata.
* Call of this function is required for all non-local streams/files
* @param metaData Metadata map.
*/
void addMetaData(const QMap<Qmmp::MetaData, QString> &metaData);
/*!
* Returns \b true when new metadata has received, otherwise returns \b false.
*/
bool hasMetaData() const;
/*!
* Takes metadata out of InputSource object and returns it.
* Attention: hasMetaData() should return \b true before use of this fuction.
*/
QMap<Qmmp::MetaData, QString> takeMetaData();
/*!
* Informs input source object about received stream information (for example icy data).
* Call of this function is required for all non-local streams/files
* @param info Stream information map.
*/
void addStreamInfo(const QHash<QString, QString> &info);
/*!
* Returns \b true when stream information has received, otherwise returns \b false.
*/
bool hasStreamInfo() const;
/*!
* Takes stream information out of InputSource object and returns it.
* Attention: hasStreamInfo() should return \b true before use of this fuction.
*/
QHash<QString, QString> takeStreamInfo();
/*!
* Creates InputSource object.
* @param url Input source path or url.
* @param parent Parent object.
* Returns \b 0 if the given url is not supported.
*/
static InputSource *create(const QString &url, QObject *parent = 0);
/*!
* Returns a list of transport factories.
*/
static QList<InputSourceFactory *> *factories();
/*!
* Returns plugin file path.
* @param factory Transport plugin factory.
*/
static QString file(InputSourceFactory *factory);
/*!
* Returns a list of supported protocols.
*/
static QStringList protocols();
signals:
/*!
* This signal is emitted when transport is ready for usage.
*/
void ready();
/*!
* This signal is emitted after an error occurred.
*/
void error();
private:
QString m_url;
qint64 m_offset;
QMap<Qmmp::MetaData, QString> m_metaData;
QHash<QString, QString> m_streamInfo;
bool m_hasMetaData, m_hasStreamInfo;
static void checkFactories();
static QList<InputSourceFactory*> *m_factories;
static QHash <InputSourceFactory*, QString> *m_files;
};
#endif // INPUTSOURCE_H
|