summaryrefslogtreecommitdiff
path: root/libopie2/opiemm/osoundsystem.cpp
authormickeyl <mickeyl>2005-01-24 18:56:14 (UTC)
committer mickeyl <mickeyl>2005-01-24 18:56:14 (UTC)
commitfa3041f9acfd171b62c0ab73cde8b9d0f0772a9c (patch) (side-by-side diff)
treec2ba9f2aaa744abaf4ac698eeeb27311dd81a50b /libopie2/opiemm/osoundsystem.cpp
parent176a421ade3f5baf07be9327cbdbfedea41fdd3c (diff)
downloadopie-fa3041f9acfd171b62c0ab73cde8b9d0f0772a9c.zip
opie-fa3041f9acfd171b62c0ab73cde8b9d0f0772a9c.tar.gz
opie-fa3041f9acfd171b62c0ab73cde8b9d0f0772a9c.tar.bz2
add isStereo to OMixerInterface to gather whether a given channel is a stereo or mono channel
Diffstat (limited to 'libopie2/opiemm/osoundsystem.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiemm/osoundsystem.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/libopie2/opiemm/osoundsystem.cpp b/libopie2/opiemm/osoundsystem.cpp
index 13b26e6..09fd28f 100644
--- a/libopie2/opiemm/osoundsystem.cpp
+++ b/libopie2/opiemm/osoundsystem.cpp
@@ -196,3 +196,3 @@ void OMixerInterface::init()
{
- owarn << "OMixerInterface::init(): Can't open mixer." << oendl;
+ owarn << "OMixerInterface::init(): Can't open mixer " << name() << oendl;
return;
@@ -241,2 +241,8 @@ void OMixerInterface::init()
+ devmask = 0;
+ if ( ioctl( _fd, SOUND_MIXER_READ_STEREODEVS, &devmask ) != -1 )
+ {
+ odebug << "stereomask = " << devmask << oendl;
+ }
+
/* ChannelIterator it;
@@ -277,3 +283,3 @@ QStringList OMixerInterface::playChannels() const
-bool OMixerInterface::hasChannel( const QString& channel )
+bool OMixerInterface::hasChannel( const QString& channel ) const
{
@@ -283,2 +289,17 @@ bool OMixerInterface::hasChannel( const QString& channel )
+bool OMixerInterface::isStereo( const QString& channel ) const
+{
+ bool result = false;
+ if ( _channels.contains( channel ) )
+ {
+ int devmask = 0;
+ if ( ioctl( _fd, SOUND_MIXER_READ_STEREODEVS, &devmask ) != -1 )
+ {
+ result = devmask & ( 1 << _channels[channel] );
+ }
+ }
+ return result;
+}
+
+
void OMixerInterface::setVolume( const QString& channel, int left, int right )