diff options
author | Michele Calgaro <[email protected]> | 2022-05-30 19:40:31 +0900 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2022-05-30 21:55:12 +0200 |
commit | 9d7329284fd42187092c829ae6ed030561002776 (patch) | |
tree | 1d53503d17938eca725caee7ff783fccf52ca509 /tderadio3/plugins/alsa-sound/alsa-mixer-element.cpp | |
parent | fac82f62f156c76cb4b23c313111283b30a778b5 (diff) | |
download | tderadio-9d7329284fd42187092c829ae6ed030561002776.tar.gz tderadio-9d7329284fd42187092c829ae6ed030561002776.zip |
Standardize folder structure.
Signed-off-by: Michele Calgaro <[email protected]>
(cherry picked from commit d95a4fea540b371fa86493d069fdbd54f33c5b40)
Diffstat (limited to 'tderadio3/plugins/alsa-sound/alsa-mixer-element.cpp')
-rw-r--r-- | tderadio3/plugins/alsa-sound/alsa-mixer-element.cpp | 139 |
1 files changed, 0 insertions, 139 deletions
diff --git a/tderadio3/plugins/alsa-sound/alsa-mixer-element.cpp b/tderadio3/plugins/alsa-sound/alsa-mixer-element.cpp deleted file mode 100644 index 53a7216..0000000 --- a/tderadio3/plugins/alsa-sound/alsa-mixer-element.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/*************************************************************************** - alsa-mixer-element.cpp - description - ------------------- - begin : Mon Aug 15 2005 - copyright : (C) 2005 by Martin Witte - email : [email protected] - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "alsa-mixer-element.h" - -#include <knuminput.h> -#include <tqslider.h> -#include <tqlabel.h> -#include <tqcheckbox.h> - -#include <math.h> - -QAlsaMixerElement::QAlsaMixerElement(TQWidget *parent, const TQString &label, bool has_switch, bool has_volume) - : AlsaMixerElementUI(parent), - m_HasVolume(has_volume), - m_HasSwitch(has_switch), - m_dirty(false), - m_ignore_updates(false) -{ - setLabel(label); - setVolume(0); - - TQObject::connect(m_spinboxVolume, TQT_SIGNAL(valueChanged(int)), - this, TQT_SLOT (slotSpinboxValueChanged(int))); - TQObject::connect(m_sliderVolume, TQT_SIGNAL(valueChanged(int)), - this, TQT_SLOT (slotSliderValueChanged(int))); - - if (m_HasVolume) { - TQObject::connect(m_checkboxOverride, TQT_SIGNAL(toggled(bool)), - m_spinboxVolume, TQT_SLOT (setEnabled(bool))); - TQObject::connect(m_checkboxOverride, TQT_SIGNAL(toggled(bool)), - m_sliderVolume, TQT_SLOT (setEnabled(bool))); - } else { - m_spinboxVolume->hide(); - m_sliderVolume->hide(); - } - if (m_HasSwitch) { - TQObject::connect(m_checkboxOverride, TQT_SIGNAL(toggled(bool)), - m_checkboxActive, TQT_SLOT (setEnabled(bool))); - } else { - //m_checkboxActive->hide(); - m_checkboxActive->setEnabled(false); - m_checkboxActive->setChecked(true); - } - - connect(m_checkboxOverride, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty())); - connect(m_checkboxActive, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty())); - connect(m_spinboxVolume, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty())); - connect(m_sliderVolume, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty())); -} - - -QAlsaMixerElement::~QAlsaMixerElement() -{ -} - -float QAlsaMixerElement::getVolume() const -{ - return ((float)m_spinboxVolume->value())/100.0; -} - -bool QAlsaMixerElement::getActive() const -{ - return m_checkboxActive->isChecked(); -} - -bool QAlsaMixerElement::getOverride() const -{ - return m_checkboxOverride->isChecked(); -} - -void QAlsaMixerElement::setLabel(const TQString &label) -{ - m_labelMixerElementName->setText(label); -} - -void QAlsaMixerElement::setOverride(bool ov) -{ - m_ignore_updates = true; - m_checkboxOverride->setChecked(ov); - m_ignore_updates = false; -} - -void QAlsaMixerElement::setActive(bool active) -{ - m_ignore_updates = true; - m_checkboxActive->setChecked(active); - m_ignore_updates = false; -} - -void QAlsaMixerElement::setVolume(float vol) -{ - m_ignore_updates = true; - int v = (int)rint(vol*100 + 0.5); - m_sliderVolume->setValue(100 - v); - m_spinboxVolume->setValue(v); - m_ignore_updates = false; -} - -void QAlsaMixerElement::slotSpinboxValueChanged(int v) -{ - m_sliderVolume->setValue(100-v); -} - -void QAlsaMixerElement::slotSliderValueChanged(int v) -{ - m_spinboxVolume->setValue(100-v); -} - - -void QAlsaMixerElement::slotSetDirty() -{ - if (!m_dirty && !m_ignore_updates) { - m_dirty = true; - emit sigDirty(); - } -} - - -void QAlsaMixerElement::slotResetDirty() -{ - m_dirty = false; -} - -#include "alsa-mixer-element.moc" |