[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdemultimedia/kmix
From: Christian Esken <esken () kde ! org>
Date: 2005-04-27 20:58:44
Message-ID: 20050427205844.1950C630 () office ! kde ! org
[Download RAW message or body]
CVS commit by esken:
Users can now select the master device, which is displayed in the dock-area (feature \
is near-complete, only lacking save and restore the users selection in the config \
file).
M +19 -3 dialogselectmaster.cpp 1.4
M +11 -0 mixer.cpp 1.94
M +4 -2 mixer.h 1.59
--- kdemultimedia/kmix/dialogselectmaster.cpp #1.3:1.4
@@ -146,4 +146,6 @@ void DialogSelectMaster::createPage(Mixe
for( MixDevice* md = mset.first(); md != 0; md = mset.next() )
{
+ // Create a RadioButton for each MixDevice (excluding Enum's)
+ if ( ! md->isEnum() ) {
//kdDebug(67100) << "DialogSelectMaster::createPage() mset append qrb" \
<< endl; QString mdName = md->name();
@@ -152,6 +154,12 @@ void DialogSelectMaster::createPage(Mixe
m_buttonGroupForScrollView->insert(qrb, md->num());
//_qEnabledCB.append(qrb);
- qrb->setChecked(false); // cannot match the current master at the \
moment.
- //cb->setChecked( !mdw->isDisabled() ); // !! Select the currently \
active item + MixDevice* master = (*mixer)[mixer->masterDevice()];
+ if ( master!=0 && md->getPK() == master->getPK() ) {
+ qrb->setChecked(true); // preselect the current master
+ }
+ else {
+ qrb->setChecked(false);
+ }
+ }
}
@@ -171,6 +179,14 @@ void DialogSelectMaster::apply()
// A channel was selected by the user => emit the "newMasterSelected()" signal
kdDebug(67100) << "DialogSelectMaster::apply(): card=" << soundcard_id << ", \
channel=" << channel_id << endl; + Mixer *mixer = \
Mixer::mixers().at(soundcard_id); + if ( mixer == 0 ) {
+ kdError(67100) << "DialogSelectMaster::createPage(): Invalid Mixer (mixerID=" \
<< soundcard_id << ")" << endl; + return; // can not happen
+ }
+ else {
+ mixer->setMasterDevice(channel_id);
emit newMasterSelected(soundcard_id, channel_id);
}
+ }
}
--- kdemultimedia/kmix/mixer.cpp #1.93:1.94
@@ -458,4 +458,15 @@ void Mixer::setRecordSource( int devnum,
}
+
+int Mixer::masterDevice()
+{
+ return m_masterDevice;
+};
+
+void Mixer::setMasterDevice(int val_masterDevice)
+{
+ m_masterDevice = val_masterDevice;
+}
+
/**
* Sets the ID of the currently selected Enum entry.
--- kdemultimedia/kmix/mixer.h #1.58:1.59
@@ -108,6 +108,8 @@ class Mixer : public QObject, virtual pu
// virtual unsigned int recsrc() const;
- /// Returns the number of the master volume device */
- int masterDevice() { return m_masterDevice; };
+ /// Returns the id of the master volume device
+ int masterDevice();
+ /// Sets the id of the master volume device
+ void setMasterDevice(int);
/// Reads the volume of the given device into VolLeft and VolRight.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic