summaryrefslogtreecommitdiffstats
path: root/kmix/kmix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmix/kmix.cpp')
-rw-r--r--kmix/kmix.cpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/kmix/kmix.cpp b/kmix/kmix.cpp
index 20e9c58f..bdc2c521 100644
--- a/kmix/kmix.cpp
+++ b/kmix/kmix.cpp
@@ -4,6 +4,7 @@
* Copyright (C) 2000 Stefan Schimanski <schimmi@kde.org>
* Copyright (C) 2001 Preston Brown <pbrown@kde.org>
* Copyright (C) 2003 Sven Leiber <s.leiber@web.de>
+ * Copyright (C) 2020 Roman Savochenko <roman@oscada.org>
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
@@ -98,12 +99,18 @@ KMixWindow::KMixWindow()
hide();
}
connect( kapp, TQT_SIGNAL( aboutToQuit()), TQT_SLOT( saveSettings()) );
+
+ mixersUpdTimer = new TQTimer();
+ connect(mixersUpdTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(mixersUpdate()));
+ mixersUpdTimer->start(10000);
}
KMixWindow::~KMixWindow()
{
- MixerToolBox::deinitMixer();
+ delete mixersUpdTimer;
+
+ MixerToolBox::deinitMixer(Mixer::mixers());
}
@@ -137,6 +144,34 @@ KMixWindow::initActions()
}
void
+KMixWindow::mixersUpdate()
+{
+ //Do not update the mixers at the mixer window and the dock widget visibility
+ if(!m_dockWidget || isVisible() || (m_dockWidget->_dockAreaPopup && ((TQWidget*)m_dockWidget->_dockAreaPopup)->isVisible())) return;
+ //Detection the mixers configuration change
+ else {
+ TQPtrList<Mixer> tmpMix;
+#ifdef WITH_KMIX_EXPERIMENTAL
+ MixerToolBox::initMixer(tmpMix, KMixSettings::multiDriver(), m_hwInfoString, true);
+#else
+ MixerToolBox::initMixer(tmpMix, false, m_hwInfoString, true);
+#endif
+ bool chMixers = (tmpMix.count() != Mixer::mixers().count());
+ MixerToolBox::deinitMixer(tmpMix);
+ if(!chMixers) return;
+ }
+ MixerToolBox::deinitMixer(Mixer::mixers());
+#ifdef WITH_KMIX_EXPERIMENTAL
+ MixerToolBox::initMixer(Mixer::mixers(), KMixSettings::multiDriver(), m_hwInfoString);
+#else
+ MixerToolBox::initMixer(Mixer::mixers(), false, m_hwInfoString);
+#endif
+
+ initMixerWidgets();
+ updateDocking();
+}
+
+void
KMixWindow::initWidgets()
{
// Main widget and layout
@@ -271,6 +306,8 @@ void
KMixWindow::initMixerWidgets()
{
m_mixerWidgets.clear();
+ m_cMixer->clear();
+ mixerNameLayout->show();
int id=0;
Mixer *mixer;