diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2014-02-14 11:34:05 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2014-02-14 11:34:05 +0000 |
| commit | 68c87d72dd28b523a09f661264837f4aa3e7025d (patch) | |
| tree | 2c84d264a3d34ff39cb4d66407bcd8f3042a51f7 /src/plugins/Output/directsound/outputdirectsound.h | |
| parent | 1c04cf0a921cb403862778cd694adb9ecfddb28b (diff) | |
| download | qmmp-68c87d72dd28b523a09f661264837f4aa3e7025d.tar.gz qmmp-68c87d72dd28b523a09f661264837f4aa3e7025d.tar.bz2 qmmp-68c87d72dd28b523a09f661264837f4aa3e7025d.zip | |
added directsound plugin
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4089 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Output/directsound/outputdirectsound.h')
| -rw-r--r-- | src/plugins/Output/directsound/outputdirectsound.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/plugins/Output/directsound/outputdirectsound.h b/src/plugins/Output/directsound/outputdirectsound.h new file mode 100644 index 000000000..c78d88fb4 --- /dev/null +++ b/src/plugins/Output/directsound/outputdirectsound.h @@ -0,0 +1,73 @@ +/***************************************************************************
+ * Copyright (C) 2014 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 OUTPUTDIRECTSOUND_H
+#define OUTPUTDIRECTSOUND_H
+
+#include <stdio.h>
+#include <windows.h>
+#include <initguid.h>
+#include <dsound.h>
+#include <qmmp/volume.h>
+#include <qmmp/output.h>
+
+/**
+ @author Ilya Kotov <forkotov02@hotmail.ru>
+*/
+class OutputDirectSound : public Output
+{
+public:
+ OutputDirectSound();
+ ~OutputDirectSound();
+
+ bool initialize(quint32, int, Qmmp::AudioFormat format);
+
+ //output api
+ qint64 latency();
+ qint64 writeAudio(unsigned char *data, qint64 size);
+ void drain();
+ void suspend();
+ void resume();
+ void reset();
+
+private:
+ // helper functions
+ void status();
+ void uninitialize();
+ DWORD bytesToWrite();
+
+ IDirectSound8 *m_ds;
+ IDirectSoundBuffer *m_primaryBuffer;
+ IDirectSoundBuffer8 *m_dsBuffer;
+ DWORD m_dsBufferAt;
+};
+
+class VolumeDirectSound : public Volume
+{
+public:
+ VolumeDirectSound();
+ ~VolumeDirectSound();
+
+ void setVolume(const VolumeSettings &vol);
+ VolumeSettings volume() const;
+};
+
+
+#endif // OUTPUTDIRECTSOUND_H
|
