diff options
author | Roman Savochenko <roman@home.home> | 2023-11-19 10:20:26 +0200 |
---|---|---|
committer | Roman Savochenko <roman@home.home> | 2023-11-19 10:20:26 +0200 |
commit | 7173de9b1d76aada67d30573b764579a818ac684 (patch) | |
tree | 25afc726aa67b0ecd29b82f9066efb8a7809295e /kmix/kmix.cpp | |
parent | 268aed5464ce7c432e3c7320495e3767d8381a2b (diff) | |
download | tdemultimedia-7173de9b1d76aada67d30573b764579a818ac684.tar.gz tdemultimedia-7173de9b1d76aada67d30573b764579a818ac684.zip |
KMix: Dynamism in tracing of appearance new audio-controllersfeat/kmix-dyn
Signed-off-by: Roman Savochenko <roman@home.home>
Diffstat (limited to 'kmix/kmix.cpp')
-rw-r--r-- | kmix/kmix.cpp | 39 |
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; |