rpms/kdemultimedia/devel kmix_pa-20100129.patch, NONE, 1.1 kdemultimedia.spec, 1.172, 1.173 kmix_pa-20100117.patch, 1.1, NONE
Rex Dieter
rdieter at fedoraproject.org
Fri Jan 29 16:20:05 UTC 2010
Author: rdieter
Update of /cvs/pkgs/rpms/kdemultimedia/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27184
Modified Files:
kdemultimedia.spec
Added Files:
kmix_pa-20100129.patch
Removed Files:
kmix_pa-20100117.patch
Log Message:
* Fri Jan 29 2010 Rex Dieter <rdieter at fedoraproject.org. - 4.3.95-2
- respin kmix_pa patch
kmix_pa-20100129.patch:
CMakeLists.txt | 1
KMixApp.cpp | 14
dialogviewconfiguration.cpp | 4
kmix-platforms.cpp | 8
kmix.cpp | 53 +
kmix.h | 1
kmixerwidget.cpp | 2
kmixerwidget.h | 1
kmixprefdlg.h | 2
main.cpp | 1
mdwmoveaction.cpp | 48 +
mdwmoveaction.h | 46 +
mdwslider.cpp | 133 ++--
mdwslider.h | 13
mixdevice.cpp | 105 +++
mixdevice.h | 15
mixdevicewidget.cpp | 1
mixdevicewidget.h | 2
mixer.cpp | 27
mixer.h | 9
mixer_alsa9.cpp | 4
mixer_backend.cpp | 17
mixer_backend.h | 8
mixer_pulse.cpp | 1219 +++++++++++++++++++++++++++++++++++++-------
mixer_pulse.h | 66 +-
mixertoolbox.cpp | 147 ++---
mixertoolbox.h | 3
viewbase.cpp | 72 ++
viewbase.h | 7
viewdockareapopup.cpp | 51 +
viewdockareapopup.h | 3
viewsliders.cpp | 18
viewsliders.h | 4
33 files changed, 1699 insertions(+), 406 deletions(-)
--- NEW FILE kmix_pa-20100129.patch ---
diff --git a/kmix/CMakeLists.txt b/kmix/CMakeLists.txt
index 4880470..d7929da 100644
--- a/kmix/CMakeLists.txt
+++ b/kmix/CMakeLists.txt
@@ -18,6 +18,7 @@ set(kmix_KDEINIT_SRCS ${kmix_adaptor_SRCS}
viewdockareapopup.cpp
viewsliders.cpp
mixdevicewidget.cpp
+ mdwmoveaction.cpp
mdwslider.cpp
mdwenum.cpp
kmixerwidget.cpp
diff --git a/kmix/KMixApp.cpp b/kmix/KMixApp.cpp
index a5cf1d5..43ec696 100644
--- a/kmix/KMixApp.cpp
+++ b/kmix/KMixApp.cpp
@@ -51,7 +51,8 @@ KMixApp::newInstance()
// There are 3 cases for a new instance
//kDebug(67100) << "KMixApp::newInstance() isRestored()=" << isRestored() << "_keepVisibility=" << _keepVisibility;
- if ( m_kmix )
+ static bool first = true;
+ if ( !first )
{ // There already exists an instance/window
/* !!! @bug : _keepVisibilty has the wrong value here.
@@ -74,7 +75,11 @@ KMixApp::newInstance()
// starts it again, the KMix main window will be shown.
// If KMix is restored by SM or the --keepvisibilty is used, KMix will NOT
// explicitly be shown.
- m_kmix->show();
+ if ( !m_kmix ) {
+ m_kmix->show();
+ } else {
+ kWarning(67100) << "KMixApp::newInstance() Window has not finished constructing yet so ignoring the show() request.";
+ }
}
else {
// CASE 2: If KMix is running, AND ( session gets restored OR keepvisibilty command line switch )
@@ -92,6 +97,11 @@ KMixApp::newInstance()
{
// CASE 3: KMix was not running yet => instanciate a new one
//kDebug(67100) << "KMixApp::newInstance() Instanciate: _keepVisibility=" << _keepVisibility ;
+ first = false; // NB See https://qa.mandriva.com/show_bug.cgi?id=56893#c3
+ // It is important to track this via a separate variable and not
+ // based on m_kmix to handle this race condition.
+ // Specific protection for the activation-prior-to-full-construction
+ // case exists above in the 'already running case'
m_kmix = new KMixWindow(_keepVisibility);
//connect(this, SIGNAL(stopUpdatesOnVisibility()), m_kmix, SLOT(stopVisibilityUpdates()));
if ( isSessionRestored() && KMainWindow::canBeRestored(0) )
diff --git a/kmix/dialogviewconfiguration.cpp b/kmix/dialogviewconfiguration.cpp
index c035037..e586186 100644
--- a/kmix/dialogviewconfiguration.cpp
+++ b/kmix/dialogviewconfiguration.cpp
@@ -264,10 +264,10 @@ void DialogViewConfiguration::createPage()
//qDebug() << "add DialogViewConfigurationItem: " << mdName << " visible=" << mdw->isVisible() << "splitted=" << splitted;
if ( mdw->isVisible() ) {
- new DialogViewConfigurationItem(_qlw, md->id(), mdw->isVisible(), mdName, splitted, mdw->iconName());
+ new DialogViewConfigurationItem(_qlw, md->id(), mdw->isVisible(), mdName, splitted, mdw->mixDevice()->iconName());
}
else {
- new DialogViewConfigurationItem(_qlwInactive, md->id(), mdw->isVisible(), mdName, splitted, mdw->iconName());
+ new DialogViewConfigurationItem(_qlwInactive, md->id(), mdw->isVisible(), mdName, splitted, mdw->mixDevice()->iconName());
}
/*
diff --git a/kmix/kmix-platforms.cpp b/kmix/kmix-platforms.cpp
index f7b8c9a..5f61989 100644
--- a/kmix/kmix-platforms.cpp
+++ b/kmix/kmix-platforms.cpp
@@ -129,6 +129,10 @@ MixerFactory g_mixerFactories[] = {
{ IRIX_getMixer, IRIX_getDriverName },
#endif
+#if defined(PULSE_MIXER)
+ { PULSE_getMixer, PULSE_getDriverName },
+#endif
+
#if defined(ALSA_MIXER)
{ ALSA_getMixer, ALSA_getDriverName },
#endif
@@ -145,10 +149,6 @@ MixerFactory g_mixerFactories[] = {
{ HPUX_getMixer, HPUX_getDriverName },
#endif
-#if defined(PULSE_MIXER)
- { PULSE_getMixer, PULSE_getDriverName },
-#endif
-
{ 0, 0 }
};
diff --git a/kmix/kmix.cpp b/kmix/kmix.cpp
index 30cc5d4..37a9066 100644
--- a/kmix/kmix.cpp
+++ b/kmix/kmix.cpp
@@ -49,6 +49,7 @@
#include <ktoggleaction.h>
// KMix
+#include "guiprofile.h"
#include "mixertoolbox.h"
#include "kmix.h"
#include "kmixdevicemanager.h"
@@ -399,11 +400,30 @@ void KMixWindow::recreateGUIwithoutSavingView()
*/
void KMixWindow::recreateGUI(bool saveConfig)
{
+ // Find out which of the tabs is currently selected for restoration
+ int current_tab = -1;
+ if (m_wsMixers)
+ current_tab = m_wsMixers->currentIndex();
+
+ // NOTE (coling) This is a bug but I don't have time to find the source.
+ // When returning from "Configure Mixers..." we MUST save, but the
+ // flag comes through as false, presumably due to the rebuildGUI() signal
+ // being tied to the recreateGUIwithoutSavingView() slot.
+ // This should really be fixed :s
+ Q_UNUSED(saveConfig);
saveViewConfig(); // save the state before recreating
+
+ // Before clearing the mixer widgets, we must increase the refcount on the guiprof to save it deleting the ViewBase object.
+ if ( Mixer::mixers().count() > 0 )
+ for (int i=0; i<Mixer::mixers().count(); ++i)
+ MixerToolBox::instance()->selectProfile((Mixer::mixers())[i])->increaseRefcount();
clearMixerWidgets();
+
if ( Mixer::mixers().count() > 0 ) {
for (int i=0; i<Mixer::mixers().count(); ++i) {
Mixer *mixer = (Mixer::mixers())[i];
+ // We've increased the refcount before clearing, so remember and decrease it again.
+ MixerToolBox::instance()->selectProfile(mixer)->decreaseRefcount();
addMixerWidget(mixer->id());
}
bool dockingSucceded = updateDocking();
@@ -415,6 +435,39 @@ void KMixWindow::recreateGUI(bool saveConfig)
updateDocking(); // -<- removes the DockIcon
hide();
}
+
+ if (current_tab >= 0) {
+ m_wsMixers->setCurrentIndex(current_tab);
+ }
+}
+
+
+/**
+* Create or recreate the Mixer GUI elements
+*/
+void KMixWindow::redrawMixer( const QString& mixer_ID )
+{
+ for ( int i=0; i<m_wsMixers->count() ; ++i )
+ {
+ QWidget *w = m_wsMixers->widget(i);
+ if ( w->inherits("KMixerWidget") )
+ {
+ KMixerWidget* kmw = (KMixerWidget*)w;
+ if ( kmw->mixer()->id() == mixer_ID )
+ {
+ kDebug(67100) << "KMixWindow::redrawMixer() " << mixer_ID << " is being redrawn";
+ kmw->loadConfig( KGlobal::config().data() );
+
+ // Is the below needed? It is done on startup so copied it here...
+ kmw->setTicks( m_showTicks );
+ kmw->setLabels( m_showLabels );
+
+ return;
+ }
+ }
+ }
+
+ kWarning(67100) << "KMixWindow::redrawMixer() Requested to redraw " << mixer_ID << " but I cannot find it :s";
}
diff --git a/kmix/kmix.h b/kmix/kmix.h
index 7fca083..81774ea 100644
--- a/kmix/kmix.h
+++ b/kmix/kmix.h
@@ -87,6 +87,7 @@ KMixWindow : public KXmlGuiWindow
virtual void applyPrefs( KMixPrefDlg *prefDlg );
void recreateGUI(bool saveView);
void recreateGUIwithoutSavingView();
+ void redrawMixer( const QString& mixer_ID );
//void stopVisibilityUpdates();
diff --git a/kmix/kmixerwidget.cpp b/kmix/kmixerwidget.cpp
index b7fdb2a..def1bae 100644
--- a/kmix/kmixerwidget.cpp
+++ b/kmix/kmixerwidget.cpp
@@ -92,6 +92,7 @@ void KMixerWidget::createLayout(ViewBase::ViewFlags vflags)
// delete old objects
if( m_balanceSlider ) {
delete m_balanceSlider;
+ m_balanceSlider = 0;
}
[...2634 lines suppressed...]
virtual void configureView();
void toggleMenuBarSlot();
diff --git a/kmix/viewdockareapopup.cpp b/kmix/viewdockareapopup.cpp
index 57ac597..f050800 100644
--- a/kmix/viewdockareapopup.cpp
+++ b/kmix/viewdockareapopup.cpp
@@ -46,7 +46,7 @@
// Users will not be able to close the Popup without opening the KMix main window then.
// See Bug #93443, #96332 and #96404 for further details. -- esken
ViewDockAreaPopup::ViewDockAreaPopup(QWidget* parent, const char* name, Mixer* mixer, ViewBase::ViewFlags vflags, GUIProfile *guiprof, KMixWindow *dockW )
- : ViewBase(parent, name, mixer, /*Qt::FramelessWindowHint | Qt::MSWindowsFixedSizeDialogHint*/0, vflags, guiprof), _mdw(0), _dock(dockW)
+ : ViewBase(parent, name, mixer, /*Qt::FramelessWindowHint | Qt::MSWindowsFixedSizeDialogHint*/0, vflags, guiprof), _dock(dockW)
{
_layoutMDW = new QGridLayout( this );
_layoutMDW->setSpacing( KDialog::spacingHint() );
@@ -63,14 +63,23 @@ ViewDockAreaPopup::~ViewDockAreaPopup() {
void ViewDockAreaPopup::wheelEvent ( QWheelEvent * e ) {
// Pass wheel event from "border widget" to child
- if ( _mdw != 0 ) {
- QApplication::sendEvent( _mdw, e);
- }
+ QWidget* mdw = 0;
+ if ( !_mdws.isEmpty() )
+ mdw = _mdws.first();
+
+ if ( mdw != 0 )
+ QApplication::sendEvent( mdw, e);
}
MixDevice* ViewDockAreaPopup::dockDevice()
{
- return _mdw->mixDevice();
+ MixDeviceWidget* mdw = 0;
+ if ( !_mdws.isEmpty() )
+ mdw = (MixDeviceWidget*)_mdws.first();
+
+ if ( mdw != 0 )
+ return mdw->mixDevice();
+ return (MixDevice*)(0);
}
@@ -81,9 +90,18 @@ void ViewDockAreaPopup::showContextMenu()
}
-void ViewDockAreaPopup::setMixSet()
+void ViewDockAreaPopup::_setMixSet()
{
// kDebug(67100) << "ViewDockAreaPopup::setMixSet()\n";
+
+ if ( _mixer->dynamic() ) {
+ // Our _layoutMDW now should only contain spacer widgets from the QSpacerItems's in add() below.
+ // We need to trash those too otherwise all sliders gradually migrate away from the edge :p
+ QLayoutItem *li;
+ while ( ( li = _layoutMDW->takeAt(0) ) )
+ delete li;
+ }
+
MixDevice *dockMD = Mixer::getGlobalMasterMD();
if ( dockMD == 0 ) {
// If we have no dock device yet, we will take the first available mixer device
@@ -98,7 +116,7 @@ void ViewDockAreaPopup::setMixSet()
QWidget* ViewDockAreaPopup::add(MixDevice *md)
{
- _mdw = new MDWSlider(
+ MixDeviceWidget *mdw = new MDWSlider(
md, // only 1 device. This is actually _dockDevice
true, // Show Mute LED
false, // Show Record LED
@@ -109,7 +127,7 @@ QWidget* ViewDockAreaPopup::add(MixDevice *md)
);
_layoutMDW->addItem( new QSpacerItem( 5, 20 ), 0, 2 );
_layoutMDW->addItem( new QSpacerItem( 5, 20 ), 0, 0 );
- _layoutMDW->addWidget( _mdw, 0, 1 );
+ _layoutMDW->addWidget( mdw, 0, 1 );
// Add button to show main panel
_showPanelBox = new QPushButton( i18n("Mixer"), this );
@@ -117,21 +135,28 @@ QWidget* ViewDockAreaPopup::add(MixDevice *md)
connect ( _showPanelBox, SIGNAL( clicked() ), SLOT( showPanelSlot() ) );
_layoutMDW->addWidget( _showPanelBox, 1, 0, 1, 3 );
- return _mdw;
+ return mdw;
}
void ViewDockAreaPopup::constructionFinished() {
// kDebug(67100) << "ViewDockAreaPopup::constructionFinished()\n";
- if (_mdw != 0) {
- _mdw->move(0,0);
- _mdw->show();
+ QWidget* mdw = 0;
+ if ( !_mdws.isEmpty() )
+ mdw = _mdws.first();
+
+ if ( mdw != 0 ) {
+ mdw->move(0,0);
+ mdw->show();
}
}
void ViewDockAreaPopup::refreshVolumeLevels() {
// kDebug(67100) << "ViewDockAreaPopup::refreshVolumeLevels()\n";
- QWidget* mdw = _mdws.first();
+ QWidget* mdw = 0;
+ if ( !_mdws.isEmpty() )
+ mdw = _mdws.first();
+
if ( mdw == 0 ) {
kError(67100) << "ViewDockAreaPopup::refreshVolumeLevels(): mdw == 0\n";
// sanity check (normally the lists are set up correctly)
diff --git a/kmix/viewdockareapopup.h b/kmix/viewdockareapopup.h
index f289dd6..68f1b22 100644
--- a/kmix/viewdockareapopup.h
+++ b/kmix/viewdockareapopup.h
@@ -43,7 +43,6 @@ public:
~ViewDockAreaPopup();
MixDevice* dockDevice();
- virtual void setMixSet();
virtual QWidget* add(MixDevice *mdw);
virtual void constructionFinished();
virtual void refreshVolumeLevels();
@@ -52,12 +51,12 @@ public:
//QSize sizeHint() const;
protected:
- MixDeviceWidget *_mdw;
KMixWindow *_dock;
//MixDevice *_dockDevice;
QPushButton *_showPanelBox;
void wheelEvent ( QWheelEvent * e );
+ virtual void _setMixSet();
private:
QGridLayout* _layoutMDW;
diff --git a/kmix/viewsliders.cpp b/kmix/viewsliders.cpp
index fa2246c..a43ceef 100644
--- a/kmix/viewsliders.cpp
+++ b/kmix/viewsliders.cpp
@@ -119,10 +119,20 @@ QWidget* ViewSliders::add(MixDevice *md)
}
-void ViewSliders::setMixSet()
+void ViewSliders::_setMixSet()
{
- const MixSet& mixset = _mixer->getMixSet();
-
+ const MixSet& mixset = _mixer->getMixSet();
+
+ if ( _mixer->dynamic() ) {
+ // We will be recreating our sliders, so make sure we trash all the separators too.
+ qDeleteAll(_separators);
+ _separators.clear();
+ // Our _layoutSliders now should only contain spacer widgets from the addSpacing() calls in add() above.
+ // We need to trash those too otherwise all sliders gradually migrate away from the edge :p
+ QLayoutItem *li;
+ while ( ( li = _layoutSliders->takeAt(0) ) )
+ delete li;
+ }
// This method iterates the controls from the Profile
// Each control is checked, whether it is also contained in the mixset, and
@@ -135,7 +145,7 @@ void ViewSliders::setMixSet()
if ( control->tab == id() ) {
// The TabName of the control matches this View name (!! attention: Better use some ID, due to i18n() )
bool isUsed = false;
-
+
QRegExp idRegexp(control->id);
//kDebug(67100) << "ViewSliders::setMixSet(): Check GUIProfile id==" << control->id << "\n";
// The following for-loop could be simplified by using a std::find_if
diff --git a/kmix/viewsliders.h b/kmix/viewsliders.h
index 1695595..9f7ce32 100644
--- a/kmix/viewsliders.h
+++ b/kmix/viewsliders.h
@@ -36,7 +36,6 @@ public:
ViewSliders(QWidget* parent, const char* name, Mixer* mixer, ViewBase::ViewFlags vflags, GUIProfile *guiprof, KActionCollection *actColl);
~ViewSliders();
- virtual void setMixSet();
virtual QWidget* add(MixDevice *mdw);
virtual void constructionFinished();
virtual void configurationUpdate();
@@ -44,6 +43,9 @@ public:
public slots:
virtual void refreshVolumeLevels();
+protected:
+ virtual void _setMixSet();
+
private:
QBoxLayout* _layoutMDW;
QLayout* _layoutSliders;
Index: kdemultimedia.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdemultimedia/devel/kdemultimedia.spec,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -p -r1.172 -r1.173
--- kdemultimedia.spec 20 Jan 2010 19:12:05 -0000 1.172
+++ kdemultimedia.spec 29 Jan 2010 16:20:04 -0000 1.173
@@ -2,7 +2,7 @@
Name: kdemultimedia
Epoch: 6
Version: 4.3.95
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: KDE Multimedia applications
Group: Applications/Multimedia
@@ -16,7 +16,7 @@ Patch1: kdemultimedia-4.3.75-nomplayerth
Patch2: kdemultimedia-4.3.75-kscd_doc.patch
# git clone git://colin.guthr.ie/kdemultimedia
# git diff master..remotes/origin/pulse > kmix_pa-<date>.patch
-Patch3: kmix_pa-20100117.patch
+Patch3: kmix_pa-20100129.patch
## upstream patches
@@ -183,6 +183,9 @@ fi
%changelog
+* Fri Jan 29 2010 Rex Dieter <rdieter at fedoraproject.org. - 4.3.95-2
+- respin kmix_pa patch
+
* Wed Jan 20 2010 Lukas Tinkl <ltinkl at redhat.com> - 4.3.95-1
- KDE 4.3.95 (4.4rc2)
--- kmix_pa-20100117.patch DELETED ---
More information about the scm-commits
mailing list