#include "audiocallbacks.h"
AudioCallbacks::AudioCallbacks(QObject *parent) :
- RaopCallbacks(parent)
+ RaopAudioHandler(parent)
{
}
#include "audiooutput.h"
-class AudioCallbacks : public RaopCallbacks
+class AudioCallbacks : public RaopAudioHandler
{
Q_OBJECT
public:
{
}
-void RaopCallbackHandler::init(RaopCallbacks *callbacks)
+void RaopCallbackHandler::init(RaopAudioHandler *callbacks)
{
m_callbacks = callbacks;
}
Q_OBJECT
public:
explicit RaopCallbackHandler(QObject *parent = 0);
- void init(RaopCallbacks *callbacks);
+ void init(RaopAudioHandler *callbacks);
private:
- RaopCallbacks * m_callbacks;
+ RaopAudioHandler * m_callbacks;
signals:
#include <QObject>
-class RaopCallbacks : public QObject
+class RaopLogHandler : public QObject
{
Q_OBJECT
public:
- explicit RaopCallbacks(QObject *parent = 0) : QObject(parent) {}
+ explicit RaopLogHandler(QObject *parent = 0) : QObject(parent) {}
+
+ virtual void logCallback(int level, const char *msg) = 0;
+};
+
+class RaopAudioHandler : public QObject
+{
+ Q_OBJECT
+public:
+ explicit RaopAudioHandler(QObject *parent = 0) : QObject(parent) {}
virtual void *audioInit(int bits, int channels, int samplerate) = 0;
virtual void audioProcess(void *session, const QByteArray & buffer) = 0;
virtual void audioSetVolume(void *session, float volume) { Q_UNUSED(session) Q_UNUSED(volume) }
virtual void audioSetMetadata(void *session, const QByteArray & buffer) { Q_UNUSED(session) Q_UNUSED(buffer) }
virtual void audioSetCoverart(void *session, const QByteArray & buffer) { Q_UNUSED(session) Q_UNUSED(buffer) }
-
-signals:
-
-public slots:
-
};
#endif // RAOPCALLBACKS_H
* outside Qt are not allowed (they have no eventloop) */
audio_session->cb_handler = new RaopCallbackHandler();
audio_session->cb_handler->moveToThread(audio_session->cb_thread);
- audio_session->cb_handler->init((RaopCallbacks *)cls);
+ audio_session->cb_handler->init((RaopAudioHandler *)cls);
QMetaObject::invokeMethod(audio_session->cb_handler, "audioInit",
Qt::BlockingQueuedConnection,
raop_destroy(m_raop);
}
-bool RaopService::init(int max_clients, RaopCallbacks *callbacks)
+bool RaopService::init(int max_clients, RaopAudioHandler *callbacks)
{
raop_callbacks_t raop_cbs;
return true;
}
+void RaopService::setLogLevel(int level)
+{
+ Q_UNUSED(level)
+}
+
+void RaopService::setLogHandler(RaopLogHandler *logger)
+{
+ Q_UNUSED(logger)
+}
+
bool RaopService::isRunning()
{
return (raop_is_running(m_raop) != 0);
return true;
}
+
void RaopService::stop()
{
if (m_raop) {
explicit RaopService(QObject *parent = 0);
~RaopService();
- bool init(int max_clients, RaopCallbacks *callbacks);
+ bool init(int max_clients, RaopAudioHandler *callbacks);
+ void setLogLevel(int level);
+ void setLogHandler(RaopLogHandler *logger);
bool start(quint16 port, const QByteArray & hwaddr);
bool isRunning();
void stop();