summaryrefslogtreecommitdiff
path: root/libopie2/opiemm/osoundsystem.cpp
Unidiff
Diffstat (limited to 'libopie2/opiemm/osoundsystem.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiemm/osoundsystem.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opiemm/osoundsystem.cpp b/libopie2/opiemm/osoundsystem.cpp
index 2b17230..763ff65 100644
--- a/libopie2/opiemm/osoundsystem.cpp
+++ b/libopie2/opiemm/osoundsystem.cpp
@@ -238,54 +238,56 @@ void OMixerInterface::init()
238 for ( it = _channels.begin(); it != _channels.end(); ++it ) 238 for ( it = _channels.begin(); it != _channels.end(); ++it )
239 { 239 {
240 odebug << "Channel " << it.key() << " available (bit " << it.data() << ")" << oendl; 240 odebug << "Channel " << it.key() << " available (bit " << it.data() << ")" << oendl;
241 odebug << " +--- Volume: " << volume( it.key() ) & 0xff << " | " << volume( it.key() ) >> 8 << "" << oendl; 241 odebug << " +--- Volume: " << volume( it.key() ) & 0xff << " | " << volume( it.key() ) >> 8 << "" << oendl;
242 } 242 }
243*/ 243*/
244} 244}
245 245
246QStringList OMixerInterface::allChannels() const 246QStringList OMixerInterface::allChannels() const
247{ 247{
248 ChannelIterator it = _channels.begin(); 248 ChannelIterator it = _channels.begin();
249 QStringList channels; 249 QStringList channels;
250 while ( it != _channels.end() ) 250 while ( it != _channels.end() )
251 { 251 {
252 channels += it.key(); 252 channels += it.key();
253 it++; 253 it++;
254 } 254 }
255 return channels; 255 return channels;
256} 256}
257 257
258 258
259QStringList OMixerInterface::recChannels() const 259QStringList OMixerInterface::recChannels() const
260{ 260{
261 owarn << "NYI" << oendl; 261 owarn << "NYI" << oendl;
262 return QStringList();
262} 263}
263 264
264 265
265QStringList OMixerInterface::playChannels() const 266QStringList OMixerInterface::playChannels() const
266{ 267{
267 owarn << "NYI" << oendl; 268 owarn << "NYI" << oendl;
269 return QStringList();
268} 270}
269 271
270 272
271bool OMixerInterface::hasChannel( const QString& channel ) 273bool OMixerInterface::hasChannel( const QString& channel )
272{ 274{
273 return _channels.contains( channel ); 275 return _channels.contains( channel );
274} 276}
275 277
276 278
277void OMixerInterface::setVolume( const QString& channel, int left, int right ) 279void OMixerInterface::setVolume( const QString& channel, int left, int right )
278{ 280{
279 int volume = left; 281 int volume = left;
280 volume |= ( right == -1 ) ? left << 8 : right << 8; 282 volume |= ( right == -1 ) ? left << 8 : right << 8;
281 283
282 if ( _channels.contains( channel ) ) 284 if ( _channels.contains( channel ) )
283 { 285 {
284 int result = ioctl( _fd, MIXER_WRITE( _channels[channel] ), &volume ); 286 int result = ioctl( _fd, MIXER_WRITE( _channels[channel] ), &volume );
285 if ( result == -1 ) 287 if ( result == -1 )
286 { 288 {
287 owarn << "Can't set volume: " << strerror( errno ) << oendl; 289 owarn << "Can't set volume: " << strerror( errno ) << oendl;
288 } 290 }
289 else 291 else
290 { 292 {
291 if ( result & 0xff != left ) 293 if ( result & 0xff != left )