Diffstat (limited to 'core/multimedia/opieplayer/audiodevice.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/audiodevice.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.h b/core/multimedia/opieplayer/audiodevice.h index 928f134..dcd79fe 100644 --- a/core/multimedia/opieplayer/audiodevice.h +++ b/core/multimedia/opieplayer/audiodevice.h | |||
@@ -1,57 +1,61 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | // L.J.Potter added changes Fri 02-15-2002 | ||
21 | |||
22 | |||
20 | #ifndef AUDIODEVICE_H | 23 | #ifndef AUDIODEVICE_H |
21 | #define AUDIODEVICE_H | 24 | #define AUDIODEVICE_H |
22 | 25 | ||
23 | 26 | ||
24 | #include <qobject.h> | 27 | #include <qobject.h> |
28 | #include <sys/soundcard.h> | ||
25 | 29 | ||
26 | 30 | ||
27 | class AudioDevicePrivate; | 31 | class AudioDevicePrivate; |
28 | 32 | ||
29 | 33 | ||
30 | class AudioDevice : public QObject { | 34 | class AudioDevice : public QObject { |
31 | Q_OBJECT | 35 | Q_OBJECT |
32 | public: | 36 | public: |
33 | AudioDevice( unsigned int freq = 44000, unsigned int channels = 2, unsigned int bytesPerSample = 2 ); | 37 | AudioDevice( unsigned int freq = 44000, unsigned int channels = 2, unsigned int bytesPerSample = AFMT_S16_LE ); |
34 | ~AudioDevice(); | 38 | ~AudioDevice(); |
35 | 39 | ||
36 | unsigned int canWrite() const; | 40 | unsigned int canWrite() const; |
37 | void write( char *buffer, unsigned int length ); | 41 | void write( char *buffer, unsigned int length ); |
38 | int bytesWritten(); | 42 | int bytesWritten(); |
39 | 43 | ||
40 | unsigned int channels() const; | 44 | unsigned int channels() const; |
41 | unsigned int frequency() const; | 45 | unsigned int frequency() const; |
42 | unsigned int bytesPerSample() const; | 46 | unsigned int bytesPerSample() const; |
43 | unsigned int bufferSize() const; | 47 | unsigned int bufferSize() const; |
44 | 48 | ||
45 | // Each volume level is from 0 to 0xFFFF | 49 | // Each volume level is from 0 to 0xFFFF |
46 | static void getVolume( unsigned int& left, unsigned int& right, bool& muted ); | 50 | static void getVolume( unsigned int& left, unsigned int& right, bool& muted ); |
47 | static void setVolume( unsigned int left, unsigned int right, bool muted ); | 51 | static void setVolume( unsigned int left, unsigned int right, bool muted ); |
48 | 52 | ||
49 | static unsigned int leftVolume() { bool muted; unsigned int l, r; getVolume( l, r, muted ); return l; } | 53 | static unsigned int leftVolume() { bool muted; unsigned int l, r; getVolume( l, r, muted ); return l; } |
50 | static unsigned int rightVolume() { bool muted; unsigned int l, r; getVolume( l, r, muted ); return r; } | 54 | static unsigned int rightVolume() { bool muted; unsigned int l, r; getVolume( l, r, muted ); return r; } |
51 | static bool isMuted() { bool muted; unsigned int l, r; getVolume( l, r, muted ); return muted; } | 55 | static bool isMuted() { bool muted; unsigned int l, r; getVolume( l, r, muted ); return muted; } |
52 | 56 | ||
53 | static void increaseVolume() { setVolume( leftVolume() + 1968, rightVolume() + 1968, isMuted() ); } | 57 | static void increaseVolume() { setVolume( leftVolume() + 1968, rightVolume() + 1968, isMuted() ); } |
54 | static void decreaseVolume() { setVolume( leftVolume() - 1966, rightVolume() - 1966, isMuted() ); } | 58 | static void decreaseVolume() { setVolume( leftVolume() - 1966, rightVolume() - 1966, isMuted() ); } |
55 | 59 | ||
56 | public slots: | 60 | public slots: |
57 | // Convinence functions derived from above functions | 61 | // Convinence functions derived from above functions |