|
Lines 91-107
Link Here
|
| 91 |
_pollingTimer = new TQTimer(); // will be started on open() and stopped on close() |
91 |
_pollingTimer = new TQTimer(); // will be started on open() and stopped on close() |
| 92 |
connect( _pollingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(readSetFromHW())); |
92 |
connect( _pollingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(readSetFromHW())); |
| 93 |
|
93 |
|
| 94 |
TQCString objid; |
94 |
setDCOP_id(); |
| 95 |
#ifndef KMIX_DCOP_OBJID_TEST |
|
|
| 96 |
objid.setNum(_mixerBackend->m_devnum); |
| 97 |
#else |
| 98 |
// should use a nice name like the Unique-Card-ID instead !! |
| 99 |
objid.setNum(Mixer::_dcopID); |
| 100 |
Mixer::_dcopID ++; |
| 101 |
#endif |
| 102 |
objid.prepend("Mixer"); |
| 103 |
DCOPObject::setObjId( objid ); |
| 104 |
|
| 105 |
} |
95 |
} |
| 106 |
|
96 |
|
| 107 |
Mixer::~Mixer() { |
97 |
Mixer::~Mixer() { |
|
Lines 110-115
Link Here
|
| 110 |
delete _pollingTimer; |
100 |
delete _pollingTimer; |
| 111 |
} |
101 |
} |
| 112 |
|
102 |
|
|
|
103 |
void Mixer::setDCOP_id( bool master ) |
| 104 |
{ |
| 105 |
TQCString objid; |
| 106 |
|
| 107 |
if(master) objid = "MixerMaster"; |
| 108 |
else { |
| 109 |
#ifndef KMIX_DCOP_OBJID_TEST |
| 110 |
objid.setNum(_mixerBackend->m_devnum); |
| 111 |
#else |
| 112 |
// should use a nice name like the Unique-Card-ID instead !! |
| 113 |
objid.setNum(Mixer::_dcopID); |
| 114 |
Mixer::_dcopID ++; |
| 115 |
#endif |
| 116 |
objid.prepend("Mixer"); |
| 117 |
} |
| 118 |
|
| 119 |
DCOPObject::setObjId( objid ); |
| 120 |
} |
| 121 |
|
| 113 |
void Mixer::volumeSave( TDEConfig *config ) |
122 |
void Mixer::volumeSave( TDEConfig *config ) |
| 114 |
{ |
123 |
{ |
| 115 |
// kdDebug(67100) << "Mixer::volumeSave()" << endl; |
124 |
// kdDebug(67100) << "Mixer::volumeSave()" << endl; |
|
Lines 201-208
Link Here
|
| 201 |
} |
210 |
} |
| 202 |
} |
211 |
} |
| 203 |
*/ |
212 |
*/ |
| 204 |
if ( _mixerBackend->needsPolling() ) { |
213 |
|
| 205 |
_pollingTimer->start(50); |
214 |
if ( _mixerBackend->needsPolling() || id() == "PulseAudio" ) { |
|
|
215 |
_pollingTimer->start(500); |
| 206 |
} |
216 |
} |
| 207 |
else { |
217 |
else { |
| 208 |
_mixerBackend->prepareSignalling(this); |
218 |
_mixerBackend->prepareSignalling(this); |
|
Lines 280-291
Link Here
|
| 280 |
// This can happen currently only, if the user executes the DCOP close() call. |
290 |
// This can happen currently only, if the user executes the DCOP close() call. |
| 281 |
return; |
291 |
return; |
| 282 |
} |
292 |
} |
| 283 |
bool updated = _mixerBackend->prepareUpdateFromHW(); |
293 |
bool updated = _mixerBackend->prepareUpdateFromHW() || (id().section(':',2,2) == "PulseAudio"); |
| 284 |
if ( (! updated) && (! _readSetFromHWforceUpdate) ) { |
294 |
if ( (! updated) && (! _readSetFromHWforceUpdate) ) { |
| 285 |
// Some drivers (ALSA) are smart. We don't need to run the following |
295 |
// Some drivers (ALSA) are smart. We don't need to run the following |
| 286 |
// time-consuming update loop if there was no change |
296 |
// time-consuming update loop if there was no change |
| 287 |
return; |
297 |
return; |
| 288 |
} |
298 |
} |
|
|
299 |
|
| 289 |
_readSetFromHWforceUpdate = false; |
300 |
_readSetFromHWforceUpdate = false; |
| 290 |
MixDevice* md; |
301 |
MixDevice* md; |
| 291 |
for( md = _mixerBackend->m_mixDevices.first(); md != 0; md = _mixerBackend->m_mixDevices.next() ) |
302 |
for( md = _mixerBackend->m_mixDevices.first(); md != 0; md = _mixerBackend->m_mixDevices.next() ) |
|
Lines 374-384
Link Here
|
| 374 |
|
385 |
|
| 375 |
void Mixer::setMasterCard(const TQString& ref_id) |
386 |
void Mixer::setMasterCard(const TQString& ref_id) |
| 376 |
{ |
387 |
{ |
|
|
388 |
//Restore DCOP id for previous master |
| 389 |
Mixer *tCard = NULL; |
| 390 |
if((tCard=masterCard())) tCard->setDCOP_id(); |
| 391 |
|
| 377 |
// The value is taken over without checking on existance. This allows the User to define |
392 |
// The value is taken over without checking on existance. This allows the User to define |
| 378 |
// a MasterCard that is not always available (e.g. it is an USB hotplugging device). |
393 |
// a MasterCard that is not always available (e.g. it is an USB hotplugging device). |
| 379 |
// Also you can set the master at any time you like, e.g. after reading the KMix configuration file |
394 |
// Also you can set the master at any time you like, e.g. after reading the KMix configuration file |
| 380 |
// and before actually constructing the Mixer instances (hint: this mehtod is static!). |
395 |
// and before actually constructing the Mixer instances (hint: this mehtod is static!). |
| 381 |
_masterCard = ref_id; |
396 |
_masterCard = ref_id; |
|
|
397 |
|
| 398 |
if((tCard=masterCard())) tCard->setDCOP_id(true); |
| 382 |
} |
399 |
} |
| 383 |
|
400 |
|
| 384 |
Mixer* Mixer::masterCard() |
401 |
Mixer* Mixer::masterCard() |