summaryrefslogtreecommitdiffstats
path: root/audiooutput.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-22 11:11:24 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-22 11:11:24 +0100
commite33b15c0bd75c1a115bf4d9f4159839368cceb13 (patch)
treec852c305370f2e66a2f7b30e7b90f924307e8643 /audiooutput.h
parent0b6fc109a7a2b4569afe21cc32627c9a0455ba6a (diff)
Make qtspotify work with latest version of despotifyHEADmaster
Add ALSA backend written by Jørgen Lind
Diffstat (limited to 'audiooutput.h')
-rw-r--r--audiooutput.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/audiooutput.h b/audiooutput.h
new file mode 100644
index 0000000..0534c43
--- /dev/null
+++ b/audiooutput.h
@@ -0,0 +1,42 @@
+#ifndef AUDIOOUTPUT_H
+#define AUDIOOUTPUT_H
+
+#include <QThread>
+#include <QMutex>
+#include <QWaitCondition>
+
+#include <alsa/asoundlib.h>
+
+#include <despotify_cpp.h>
+
+class AudioOutput : public QThread
+{
+public:
+ AudioOutput();
+ ~AudioOutput();
+ void setDespotifySession(despotify_session *ds);
+ void play();
+ void pause();
+ void flush();
+
+protected:
+ enum State { Play, Pause };
+ void run();
+
+private:
+ QWaitCondition m_isPlaying;
+ QWaitCondition m_isPause;
+ snd_pcm_t *m_alsaHandle;
+ despotify_session *m_despotifySession;
+
+ //is going to be 16 * 2 / 8
+ //bitwidth * channels
+ int frameSize;
+
+ uint m_channels;
+ uint m_bitrate;
+
+ State m_state;
+};
+
+#endif // AUDIOOUTPUT_H