diff options
Diffstat (limited to 'kmix/mixertoolbox.cpp')
-rw-r--r-- | kmix/mixertoolbox.cpp | 16 |
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 |