2018-10-01 07:00:27 +00:00
|
|
|
#ifndef QPULSE_H
|
|
|
|
#define QPULSE_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <pulse/pulseaudio.h>
|
|
|
|
|
|
|
|
class QPulse : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit QPulse(QObject *parent = 0);
|
|
|
|
~QPulse();
|
|
|
|
|
|
|
|
pa_context_state_t ConnectionState();
|
|
|
|
|
2018-10-02 06:27:51 +00:00
|
|
|
bool RequestServerInfo();
|
|
|
|
bool RequestCardInfo();
|
2018-10-01 07:00:27 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void ConnectionStateChanged();
|
2018-10-02 06:27:25 +00:00
|
|
|
void GotServerInfo(const pa_server_info& i);
|
|
|
|
void GotCardInfoList(const pa_card_info& i, int eol);
|
2018-10-01 07:00:27 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
protected:
|
|
|
|
pa_threaded_mainloop* ml;
|
|
|
|
pa_context *c;
|
|
|
|
|
|
|
|
private:
|
|
|
|
static void onConnectionStateChangedSt(pa_context *c, void *userdata);
|
|
|
|
static void onGotServerInfoSt(pa_context *c, const pa_server_info *i, void *userdata);
|
|
|
|
static void onGotCardInfoListSt(pa_context *c, const pa_card_info *i, int eol, void *userdata);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QPULSE_H
|