author | mickeyl <mickeyl> | 2004-01-01 14:49:23 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-01-01 14:49:23 (UTC) |
commit | 6bde04710d84fe2c5369c895bd784e9d81754550 (patch) (unidiff) | |
tree | 21f397e783d63b1fac53ee450edf780e09d0a70b | |
parent | a7908d91718d26b0d44e3aacb12fa87d9b548785 (diff) | |
download | opie-6bde04710d84fe2c5369c895bd784e9d81754550.zip opie-6bde04710d84fe2c5369c895bd784e9d81754550.tar.gz opie-6bde04710d84fe2c5369c895bd784e9d81754550.tar.bz2 |
bye bye qDebug, hello odebug
-rw-r--r-- | libopie2/opiemm/opiemm.pro | 4 | ||||
-rw-r--r-- | libopie2/opiemm/osoundsystem.cpp | 30 |
2 files changed, 14 insertions, 20 deletions
diff --git a/libopie2/opiemm/opiemm.pro b/libopie2/opiemm/opiemm.pro index d5c8238..d6f54ee 100644 --- a/libopie2/opiemm/opiemm.pro +++ b/libopie2/opiemm/opiemm.pro | |||
@@ -7,12 +7,8 @@ INTERFACES = | |||
7 | TARGET = opiemm2 | 7 | TARGET = opiemm2 |
8 | VERSION = 1.8.2 | 8 | VERSION = 1.8.2 |
9 | INCLUDEPATH += $(OPIEDIR)/include | 9 | INCLUDEPATH += $(OPIEDIR)/include |
10 | DEPENDPATH += $(OPIEDIR)/include | 10 | DEPENDPATH += $(OPIEDIR)/include |
11 | LIBS += | ||
12 | MOC_DIR = moc | ||
13 | OBJECTS_DIR = obj | ||
14 | |||
15 | 11 | ||
16 | !contains( platform, x11 ) { | 12 | !contains( platform, x11 ) { |
17 | include ( $(OPIEDIR)/include.pro ) | 13 | include ( $(OPIEDIR)/include.pro ) |
18 | } | 14 | } |
diff --git a/libopie2/opiemm/osoundsystem.cpp b/libopie2/opiemm/osoundsystem.cpp index d857659..ca63389 100644 --- a/libopie2/opiemm/osoundsystem.cpp +++ b/libopie2/opiemm/osoundsystem.cpp | |||
@@ -29,8 +29,9 @@ | |||
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include <opie2/osoundsystem.h> | 32 | #include <opie2/osoundsystem.h> |
33 | #include <opie2/odebug.h> | ||
33 | 34 | ||
34 | #include <errno.h> | 35 | #include <errno.h> |
35 | #include <fcntl.h> | 36 | #include <fcntl.h> |
36 | #include <string.h> | 37 | #include <string.h> |
@@ -48,9 +49,9 @@ | |||
48 | OSoundSystem* OSoundSystem::_instance = 0; | 49 | OSoundSystem* OSoundSystem::_instance = 0; |
49 | 50 | ||
50 | OSoundSystem::OSoundSystem() | 51 | OSoundSystem::OSoundSystem() |
51 | { | 52 | { |
52 | qDebug( "OSoundSystem::OSoundSystem()" ); | 53 | odebug << "OSoundSystem::OSoundSystem()" << oendl; |
53 | synchronize(); | 54 | synchronize(); |
54 | } | 55 | } |
55 | 56 | ||
56 | void OSoundSystem::synchronize() | 57 | void OSoundSystem::synchronize() |
@@ -64,17 +65,14 @@ void OSoundSystem::synchronize() | |||
64 | 65 | ||
65 | 66 | ||
66 | /* | 67 | /* |
67 | 68 | ||
68 | |||
69 | |||
70 | |||
71 | QString str; | 69 | QString str; |
72 | QFile f( "/dev/sound" ); | 70 | QFile f( "/dev/sound" ); |
73 | bool hasFile = f.open( IO_ReadOnly ); | 71 | bool hasFile = f.open( IO_ReadOnly ); |
74 | if ( !hasFile ) | 72 | if ( !hasFile ) |
75 | { | 73 | { |
76 | qDebug( "OSoundSystem: /dev/sound not existing. No sound devices available" ); | 74 | odebug << "OSoundSystem: /dev/sound not existing. No sound devices available" << oendl; |
77 | return; | 75 | return; |
78 | } | 76 | } |
79 | QTextStream s( &f ); | 77 | QTextStream s( &f ); |
80 | s.readLine(); | 78 | s.readLine(); |
@@ -125,9 +123,9 @@ OSoundSystem::CardIterator OSoundSystem::iterator() const | |||
125 | 123 | ||
126 | OSoundCard::OSoundCard( QObject* parent, const char* name ) | 124 | OSoundCard::OSoundCard( QObject* parent, const char* name ) |
127 | :QObject( parent, name ), _audio( 0 ), _mixer( 0 ) | 125 | :QObject( parent, name ), _audio( 0 ), _mixer( 0 ) |
128 | { | 126 | { |
129 | qDebug( "OSoundCard::OSoundCard()" ); | 127 | odebug << "OSoundCard::OSoundCard()" << oendl; |
130 | init(); | 128 | init(); |
131 | } | 129 | } |
132 | 130 | ||
133 | 131 | ||
@@ -149,9 +147,9 @@ void OSoundCard::init() | |||
149 | 147 | ||
150 | OAudioInterface::OAudioInterface( QObject* parent, const char* name ) | 148 | OAudioInterface::OAudioInterface( QObject* parent, const char* name ) |
151 | :QObject( parent, name ) | 149 | :QObject( parent, name ) |
152 | { | 150 | { |
153 | qDebug( "OAudioInterface::OAudioInterface()" ); | 151 | odebug << "OAudioInterface::OAudioInterface()" << oendl; |
154 | init(); | 152 | init(); |
155 | } | 153 | } |
156 | 154 | ||
157 | 155 | ||
@@ -173,9 +171,9 @@ void OAudioInterface::init() | |||
173 | 171 | ||
174 | OMixerInterface::OMixerInterface( QObject* parent, const char* name ) | 172 | OMixerInterface::OMixerInterface( QObject* parent, const char* name ) |
175 | :QObject( parent, name ) | 173 | :QObject( parent, name ) |
176 | { | 174 | { |
177 | qDebug( "OMixerInterface::OMixerInterface()" ); | 175 | odebug << "OMixerInterface::OMixerInterface()" << oendl; |
178 | init(); | 176 | init(); |
179 | } | 177 | } |
180 | 178 | ||
181 | 179 | ||
@@ -189,9 +187,9 @@ void OMixerInterface::init() | |||
189 | // open the device | 187 | // open the device |
190 | _fd = ::open( name(), O_RDWR ); | 188 | _fd = ::open( name(), O_RDWR ); |
191 | if ( _fd == -1 ) | 189 | if ( _fd == -1 ) |
192 | { | 190 | { |
193 | qWarning( "can't open mixer." ); | 191 | owarn << "OMixerInterface::init(): Can't open mixer." << oendl; |
194 | return; | 192 | return; |
195 | } | 193 | } |
196 | 194 | ||
197 | // construct the device capabilities | 195 | // construct the device capabilities |
@@ -211,9 +209,9 @@ void OMixerInterface::init() | |||
211 | if ( devmask & ( 1 << SOUND_MIXER_ALTPCM ) ) _channels.insert( "PlayAltPCM", SOUND_MIXER_ALTPCM ); | 209 | if ( devmask & ( 1 << SOUND_MIXER_ALTPCM ) ) _channels.insert( "PlayAltPCM", SOUND_MIXER_ALTPCM ); |
212 | if ( devmask & ( 1 << SOUND_MIXER_RECLEV ) ) _channels.insert( "PlayRecord", SOUND_MIXER_RECLEV ); | 210 | if ( devmask & ( 1 << SOUND_MIXER_RECLEV ) ) _channels.insert( "PlayRecord", SOUND_MIXER_RECLEV ); |
213 | if ( devmask & ( 1 << SOUND_MIXER_IGAIN ) ) _channels.insert( "PlayInputGain", SOUND_MIXER_IGAIN ); | 211 | if ( devmask & ( 1 << SOUND_MIXER_IGAIN ) ) _channels.insert( "PlayInputGain", SOUND_MIXER_IGAIN ); |
214 | if ( devmask & ( 1 << SOUND_MIXER_OGAIN ) ) _channels.insert( "PlayOutputGain", SOUND_MIXER_OGAIN ); | 212 | if ( devmask & ( 1 << SOUND_MIXER_OGAIN ) ) _channels.insert( "PlayOutputGain", SOUND_MIXER_OGAIN ); |
215 | //qDebug( "devmask available and constructed." ); | 213 | //odebug << "devmask available and constructed." << oendl; |
216 | } | 214 | } |
217 | 215 | ||
218 | devmask = 0; | 216 | devmask = 0; |
219 | if ( ioctl( _fd, SOUND_MIXER_READ_RECMASK, &devmask ) != -1 ) | 217 | if ( ioctl( _fd, SOUND_MIXER_READ_RECMASK, &devmask ) != -1 ) |
@@ -231,9 +229,9 @@ void OMixerInterface::init() | |||
231 | if ( devmask & ( 1 << SOUND_MIXER_ALTPCM ) ) _channels.insert( "RecAltPCM", SOUND_MIXER_ALTPCM ); | 229 | if ( devmask & ( 1 << SOUND_MIXER_ALTPCM ) ) _channels.insert( "RecAltPCM", SOUND_MIXER_ALTPCM ); |
232 | if ( devmask & ( 1 << SOUND_MIXER_RECLEV ) ) _channels.insert( "RecRecord", SOUND_MIXER_RECLEV ); | 230 | if ( devmask & ( 1 << SOUND_MIXER_RECLEV ) ) _channels.insert( "RecRecord", SOUND_MIXER_RECLEV ); |
233 | if ( devmask & ( 1 << SOUND_MIXER_IGAIN ) ) _channels.insert( "RecInputGain", SOUND_MIXER_IGAIN ); | 231 | if ( devmask & ( 1 << SOUND_MIXER_IGAIN ) ) _channels.insert( "RecInputGain", SOUND_MIXER_IGAIN ); |
234 | if ( devmask & ( 1 << SOUND_MIXER_OGAIN ) ) _channels.insert( "RecOutputGain", SOUND_MIXER_OGAIN ); | 232 | if ( devmask & ( 1 << SOUND_MIXER_OGAIN ) ) _channels.insert( "RecOutputGain", SOUND_MIXER_OGAIN ); |
235 | //qDebug( "recmask available and constructed." ); | 233 | //odebug << "recmask available and constructed." << oendl; |
236 | } | 234 | } |
237 | 235 | ||
238 | /* ChannelIterator it; | 236 | /* ChannelIterator it; |
239 | for ( it = _channels.begin(); it != _channels.end(); ++it ) | 237 | for ( it = _channels.begin(); it != _channels.end(); ++it ) |
@@ -258,15 +256,15 @@ QStringList OMixerInterface::allChannels() const | |||
258 | 256 | ||
259 | 257 | ||
260 | QStringList OMixerInterface::recChannels() const | 258 | QStringList OMixerInterface::recChannels() const |
261 | { | 259 | { |
262 | qWarning( "NYI" ); | 260 | owarn << "NYI" << oendl; |
263 | } | 261 | } |
264 | 262 | ||
265 | 263 | ||
266 | QStringList OMixerInterface::playChannels() const | 264 | QStringList OMixerInterface::playChannels() const |
267 | { | 265 | { |
268 | qWarning( "NYI" ); | 266 | owarn << "NYI" << oendl; |
269 | } | 267 | } |
270 | 268 | ||
271 | 269 | ||
272 | bool OMixerInterface::hasChannel( const QString& channel ) | 270 | bool OMixerInterface::hasChannel( const QString& channel ) |
@@ -284,15 +282,15 @@ void OMixerInterface::setVolume( const QString& channel, int left, int right ) | |||
284 | { | 282 | { |
285 | int result = ioctl( _fd, MIXER_WRITE( _channels[channel] ), &volume ); | 283 | int result = ioctl( _fd, MIXER_WRITE( _channels[channel] ), &volume ); |
286 | if ( result == -1 ) | 284 | if ( result == -1 ) |
287 | { | 285 | { |
288 | qWarning( "Can't set volume: %s", strerror( errno ) ); | 286 | owarn << "Can't set volume: " << strerror( errno ) << oendl; |
289 | } | 287 | } |
290 | else | 288 | else |
291 | { | 289 | { |
292 | if ( result & 0xff != left ) | 290 | if ( result & 0xff != left ) |
293 | { | 291 | { |
294 | qWarning( "Device adjusted volume from %d to %d", left, result & 0xff ); | 292 | owarn << "Device adjusted volume from " << left << " to " << (result & 0xff) << oendl; |
295 | } | 293 | } |
296 | } | 294 | } |
297 | } | 295 | } |
298 | } | 296 | } |
@@ -305,9 +303,9 @@ int OMixerInterface::volume( const QString& channel ) const | |||
305 | if ( _channels.contains( channel ) ) | 303 | if ( _channels.contains( channel ) ) |
306 | { | 304 | { |
307 | if ( ioctl( _fd, MIXER_READ( _channels[channel] ), &volume ) == -1 ) | 305 | if ( ioctl( _fd, MIXER_READ( _channels[channel] ), &volume ) == -1 ) |
308 | { | 306 | { |
309 | qWarning( "Can't get volume: %s", strerror( errno ) ); | 307 | owarn << "Can't get volume: " << strerror( errno ) << oendl; |
310 | } | 308 | } |
311 | else return volume; | 309 | else return volume; |
312 | } | 310 | } |
313 | return -1; | 311 | return -1; |