summaryrefslogtreecommitdiffstats
path: root/kmix/mixertoolbox.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-03-25 17:53:28 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-03-25 17:53:28 +0000
commitba91edcc600a84fb3d3fc00f68454d2b0fc5063f (patch)
tree4da2e9dffc6f8b634a2f3c3f23dd6689016bd369 /kmix/mixertoolbox.cpp
parentb83c65dd813fdd4157234004197acf33ab01da93 (diff)
downloadtdemultimedia-ba91edcc600a84fb3d3fc00f68454d2b0fc5063f.tar.gz
tdemultimedia-ba91edcc600a84fb3d3fc00f68454d2b0fc5063f.zip
Add support for ALSA plugins to kmix
Patch courtesy of ledest@gmail.com and Michael Shigorin git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1107453 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmix/mixertoolbox.cpp')
-rw-r--r--kmix/mixertoolbox.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/kmix/mixertoolbox.cpp b/kmix/mixertoolbox.cpp
index 0480955b..38b404ac 100644
--- a/kmix/mixertoolbox.cpp
+++ b/kmix/mixertoolbox.cpp
@@ -99,11 +99,25 @@ void MixerToolBox::initMixer(QPtrList<Mixer> &mixers, bool multiDriverMode, QStr
// New: We don't try be that clever anymore. We now blindly scan 20 cards, as the clever
// approach doesn't work for the one or other user.
int devNumMax = 19;
- for( int dev=0; dev<=devNumMax; dev++ )
+ getDevIteratorFunc* f = g_mixerFactories[drv].getDevIterator;
+ for( DevIterator* I = f ? f() : new DevIterator(); !I->end(); I->next())
{
+ int dev = I->getdev();
Mixer *mixer = new Mixer( drv, dev );
if ( mixer->isValid() ) {
mixer->open();
+ Mixer* m;
+ if (dev >= 0) {
+ for (m = mixers.first(); m; m = mixers.next())
+#if 0
+ if ((mixer->devnum() == m->devnum()) &&
+ m->id().startsWith(mixer->driverName(drv) + "::", true))
+#else
+ if (mixer->devnum() == m->devnum())
+#endif
+ break;
+ if (m) continue;
+ }
mixers.append( mixer );
// Count mixer nums for every mixer name to identify mixers with equal names.
// This is for creating persistent (reusable) primary keys, which can safely