summaryrefslogtreecommitdiff
path: root/libopie2
Unidiff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiemm/libopiemm2.control2
-rw-r--r--libopie2/opiemm/osoundsystem.cpp2
-rw-r--r--libopie2/opiemm/osoundsystem.h1
3 files changed, 1 insertions, 4 deletions
diff --git a/libopie2/opiemm/libopiemm2.control b/libopie2/opiemm/libopiemm2.control
index d0f34a8..0dd2df2 100644
--- a/libopie2/opiemm/libopiemm2.control
+++ b/libopie2/opiemm/libopiemm2.control
@@ -1,10 +1,10 @@
1Package: libopiemm2 1Package: libopiemm2
2Files: lib/libopiemm2.so.* 2Files: lib/libopiemm2.so.*
3Priority: optional 3Priority: optional
4Section: opie/system 4Section: opie/system
5Maintainer: Opie Team <opie@handhelds.org> 5Maintainer: Opie Team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: 1.8.2-$SUB_VERSION.2 7Version: $QPE_VERSION$EXTRAVERSION
8Depends: libqpe1, libopiecore2 (1.8.2) 8Depends: libqpe1, libopiecore2 (1.8.2)
9Provides: libopiemm2 9Provides: libopiemm2
10Description: Opie library 2.0 MM 10Description: Opie library 2.0 MM
diff --git a/libopie2/opiemm/osoundsystem.cpp b/libopie2/opiemm/osoundsystem.cpp
index 17e5cb0..13b26e6 100644
--- a/libopie2/opiemm/osoundsystem.cpp
+++ b/libopie2/opiemm/osoundsystem.cpp
@@ -289,34 +289,32 @@ void OMixerInterface::setVolume( const QString& channel, int left, int right )
289 if ( _channels.contains( channel ) ) 289 if ( _channels.contains( channel ) )
290 { 290 {
291 int result = ioctl( _fd, MIXER_WRITE( _channels[channel] ), &volume ); 291 int result = ioctl( _fd, MIXER_WRITE( _channels[channel] ), &volume );
292 if ( result == -1 ) 292 if ( result == -1 )
293 { 293 {
294 owarn << "Can't set volume: " << strerror( errno ) << oendl; 294 owarn << "Can't set volume: " << strerror( errno ) << oendl;
295 } 295 }
296 else 296 else
297 { 297 {
298 if ( result & 0xff != left ) 298 if ( result & 0xff != left )
299 { 299 {
300 owarn << "Device adjusted volume from " << left << " to " << (result & 0xff) << oendl; 300 owarn << "Device adjusted volume from " << left << " to " << (result & 0xff) << oendl;
301 } 301 }
302 } 302 }
303 } 303 }
304} 304}
305 305
306 306
307int OMixerInterface::volume( const QString& channel ) const 307int OMixerInterface::volume( const QString& channel ) const
308{ 308{
309 int volume; 309 int volume;
310 310
311 if ( _channels.contains( channel ) ) 311 if ( _channels.contains( channel ) )
312 { 312 {
313 if ( ioctl( _fd, MIXER_READ( _channels[channel] ), &volume ) == -1 ) 313 if ( ioctl( _fd, MIXER_READ( _channels[channel] ), &volume ) == -1 )
314 { 314 {
315 owarn << "Can't get volume: " << strerror( errno ) << oendl; 315 owarn << "Can't get volume: " << strerror( errno ) << oendl;
316 } 316 }
317 else return volume; 317 else return volume;
318 } 318 }
319 return -1; 319 return -1;
320} 320}
321
322
diff --git a/libopie2/opiemm/osoundsystem.h b/libopie2/opiemm/osoundsystem.h
index 3c3b622..bd69114 100644
--- a/libopie2/opiemm/osoundsystem.h
+++ b/libopie2/opiemm/osoundsystem.h
@@ -201,33 +201,32 @@ class OMixerInterface : public QObject
201 201
202 /** 202 /**
203 * @returns true, if @a channel exists. 203 * @returns true, if @a channel exists.
204 */ 204 */
205 bool hasChannel( const QString& channel ); 205 bool hasChannel( const QString& channel );
206 206
207 /** 207 /**
208 * Set the @a left and @a right volumes for @a channel. 208 * Set the @a left and @a right volumes for @a channel.
209 * If no value for right is given, the value for left is taken for that. 209 * If no value for right is given, the value for left is taken for that.
210 */ 210 */
211 void setVolume( const QString& channel, int left, int right = -1 ); 211 void setVolume( const QString& channel, int left, int right = -1 );
212 /** 212 /**
213 * @returns the volume of @a channel or -1, if the channel doesn't exist. 213 * @returns the volume of @a channel or -1, if the channel doesn't exist.
214 * @note You might want to use @ref hasChannel() to check if a channel exists. 214 * @note You might want to use @ref hasChannel() to check if a channel exists.
215 */ 215 */
216 int volume( const QString& channel ) const; 216 int volume( const QString& channel ) const;
217 217
218 protected: 218 protected:
219 int _fd; 219 int _fd;
220 QMap<QString, int> _channels; 220 QMap<QString, int> _channels;
221 221
222 private: 222 private:
223 void init(); 223 void init();
224 private: 224 private:
225 class Private; 225 class Private;
226 Private *d; 226 Private *d;
227}; 227};
228 228
229} 229}
230} 230}
231 231
232#endif // OSOUNDSYSTEM_H 232#endif // OSOUNDSYSTEM_H
233