diff options
Diffstat (limited to 'kradio3/plugins/alsa-sound/alsa-sound-configuration.cpp')
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-sound-configuration.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/kradio3/plugins/alsa-sound/alsa-sound-configuration.cpp b/kradio3/plugins/alsa-sound/alsa-sound-configuration.cpp index f4914f2..f7d3bf4 100644 --- a/kradio3/plugins/alsa-sound/alsa-sound-configuration.cpp +++ b/kradio3/plugins/alsa-sound/alsa-sound-configuration.cpp @@ -15,10 +15,10 @@ * * ***************************************************************************/ -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qlayout.h> -#include <qscrollview.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqscrollview.h> #include <kurlrequester.h> #include <knuminput.h> @@ -32,8 +32,8 @@ #include "alsa-sound.h" -AlsaSoundConfiguration::AlsaSoundConfiguration (QWidget *parent, AlsaSoundDevice *dev) - : AlsaSoundConfigurationUI(parent), +AlsaSoundConfiguration::AlsaSoundConfiguration (TQWidget *tqparent, AlsaSoundDevice *dev) + : AlsaSoundConfigurationUI(tqparent), m_SoundDevice (dev), m_groupMixerLayout(NULL), m_groupMixerScrollView(NULL), @@ -41,30 +41,30 @@ AlsaSoundConfiguration::AlsaSoundConfiguration (QWidget *parent, AlsaSoundDevice m_dirty(true), m_ignore_updates(false) { - QObject::connect(m_comboPlaybackCard, SIGNAL(activated(int)), this, SLOT(slotSetDirty())); - QObject::connect(m_comboCaptureCard, SIGNAL(activated(int)), this, SLOT(slotSetDirty())); - QObject::connect(m_comboPlaybackDevice, SIGNAL(activated(int)), this, SLOT(slotSetDirty())); - QObject::connect(m_comboCaptureDevice, SIGNAL(activated(int)), this, SLOT(slotSetDirty())); - QObject::connect(editHWBufferSize, SIGNAL(valueChanged(int)), this, SLOT(slotSetDirty())); - QObject::connect(editBufferSize, SIGNAL(valueChanged(int)), this, SLOT(slotSetDirty())); - QObject::connect(chkDisablePlayback, SIGNAL(toggled(bool)), this, SLOT(slotSetDirty())); - QObject::connect(chkDisableCapture, SIGNAL(toggled(bool)), this, SLOT(slotSetDirty())); - - QObject::connect(m_comboPlaybackCard, SIGNAL(activated(const QString &)), - this, SLOT(slotPlaybackCardSelected(const QString &))); - QObject::connect(m_comboCaptureCard, SIGNAL(activated(const QString &)), - this, SLOT(slotCaptureCardSelected(const QString &))); + TQObject::connect(m_comboPlaybackCard, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(m_comboCaptureCard, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(m_comboPlaybackDevice, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(m_comboCaptureDevice, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(editHWBufferSize, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(editBufferSize, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(chkDisablePlayback, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(chkDisableCapture, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty())); + + TQObject::connect(m_comboPlaybackCard, TQT_SIGNAL(activated(const TQString &)), + this, TQT_SLOT(slotPlaybackCardSelected(const TQString &))); + TQObject::connect(m_comboCaptureCard, TQT_SIGNAL(activated(const TQString &)), + this, TQT_SLOT(slotCaptureCardSelected(const TQString &))); m_groupMixer->setColumnLayout(0, Qt::Horizontal ); - QHBoxLayout *tmp_layout = new QHBoxLayout( m_groupMixer->layout() ); + TQHBoxLayout *tmp_layout = new TQHBoxLayout( m_groupMixer->tqlayout() ); - m_groupMixerScrollView = new QScrollView (m_groupMixer); - m_groupMixerScrollView->setFrameShape(QFrame::NoFrame); - m_groupMixerScrollView->setFrameShadow(QFrame::Plain); + m_groupMixerScrollView = new TQScrollView (m_groupMixer); + m_groupMixerScrollView->setFrameShape(TQFrame::NoFrame); + m_groupMixerScrollView->setFrameShadow(TQFrame::Plain); m_groupMixerScrollView->enableClipper(true); - m_groupMixerScrollView->setResizePolicy(QScrollView::AutoOneFit); - //m_groupMixerScrollView->setHScrollBarMode(QScrollView::AlwaysOn); + m_groupMixerScrollView->setResizePolicy(TQScrollView::AutoOneFit); + //m_groupMixerScrollView->setHScrollBarMode(TQScrollView::AlwaysOn); tmp_layout->addWidget(m_groupMixerScrollView); @@ -102,18 +102,18 @@ AlsaSoundConfiguration::~AlsaSoundConfiguration () } -void AlsaSoundConfiguration::slotPlaybackCardSelected(const QString &cardname) +void AlsaSoundConfiguration::slotPlaybackCardSelected(const TQString &cardname) { - if (!m_name2card.contains(cardname)) + if (!m_name2card.tqcontains(cardname)) return; listSoundDevices(m_comboPlaybackDevice, &m_playbackDeviceName2dev, &m_dev2playbackDeviceName, &m_playbackDevice2idx, m_name2card[cardname], SND_PCM_STREAM_PLAYBACK); } -void AlsaSoundConfiguration::slotCaptureCardSelected(const QString &cardname) +void AlsaSoundConfiguration::slotCaptureCardSelected(const TQString &cardname) { - if (!m_name2card.contains(cardname)) + if (!m_name2card.tqcontains(cardname)) return; saveCaptureMixerSettings(); @@ -122,11 +122,11 @@ void AlsaSoundConfiguration::slotCaptureCardSelected(const QString &cardname) m_currentCaptureCard = m_name2card[cardname]; - QStringList vol_list, sw_list, all_list; - QMap<QString, AlsaMixerElement> vol_ch2id, sw_ch2id; + TQStringList vol_list, sw_list, all_list; + TQMap<TQString, AlsaMixerElement> vol_ch2id, sw_ch2id; AlsaSoundDevice::getCaptureMixerChannels(m_name2card[cardname], NULL, vol_list, vol_ch2id, sw_list, sw_ch2id, &all_list); - for (QMapIterator<QString, QAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { + for (TQMapIterator<TQString, TQAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { delete *it; } m_MixerElements.clear(); @@ -134,20 +134,20 @@ void AlsaSoundConfiguration::slotCaptureCardSelected(const QString &cardname) if (m_groupMixerSubFrame) delete m_groupMixerSubFrame; - m_groupMixerSubFrame = new QFrame(m_groupMixerScrollView->viewport()); - m_groupMixerSubFrame->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); + m_groupMixerSubFrame = new TQFrame(m_groupMixerScrollView->viewport()); + m_groupMixerSubFrame->tqsetSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Maximum); m_groupMixerScrollView->addChild(m_groupMixerSubFrame); int rows = 1; int cols = (all_list.count()+rows-1)/rows; - m_groupMixerLayout = new QGridLayout( m_groupMixerSubFrame, rows, cols, 0, 0 ); - m_groupMixerLayout->setAlignment( Qt::AlignBottom ); + m_groupMixerLayout = new TQGridLayout( m_groupMixerSubFrame, rows, cols, 0, 0 ); + m_groupMixerLayout->tqsetAlignment( TQt::AlignBottom ); int idx = 0; - for (QValueListConstIterator<QString> it = all_list.begin(); it != all_list.end(); ++it, ++idx) { - QAlsaMixerElement *e = new QAlsaMixerElement(m_groupMixerSubFrame, *it, - sw_list.contains(*it), vol_list.contains(*it)); - QObject::connect(e, SIGNAL(sigDirty()), this, SLOT(slotSetDirty())); + for (TQValueListConstIterator<TQString> it = all_list.begin(); it != all_list.end(); ++it, ++idx) { + TQAlsaMixerElement *e = new TQAlsaMixerElement(m_groupMixerSubFrame, *it, + sw_list.tqcontains(*it), vol_list.tqcontains(*it)); + TQObject::connect(e, TQT_SIGNAL(sigDirty()), this, TQT_SLOT(slotSetDirty())); m_groupMixerLayout->addWidget(e, idx > cols, idx % cols); e->show(); m_MixerElements.insert(*it, e); @@ -158,11 +158,11 @@ void AlsaSoundConfiguration::slotCaptureCardSelected(const QString &cardname) void AlsaSoundConfiguration::saveCaptureMixerSettings() { - for (QMapIterator<QString, QAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { - const QString &name = it.key(); + for (TQMapIterator<TQString, TQAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { + const TQString &name = it.key(); int card = m_currentCaptureCard; - QString id = AlsaConfigMixerSetting::getIDString(card, name); - QAlsaMixerElement *e = *it; + TQString id = AlsaConfigMixerSetting::getIDString(card, name); + TQAlsaMixerElement *e = *it; float vol = e->getVolume(); bool use = e->getOverride(); bool active = e->getActive(); @@ -173,13 +173,13 @@ void AlsaSoundConfiguration::saveCaptureMixerSettings() void AlsaSoundConfiguration::restoreCaptureMixerSettings() { - for (QMapIterator<QString, QAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { - const QString &name = it.key(); + for (TQMapIterator<TQString, TQAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { + const TQString &name = it.key(); int card = m_currentCaptureCard; - QString id = AlsaConfigMixerSetting::getIDString(card, name); - QAlsaMixerElement *e = *it; + TQString id = AlsaConfigMixerSetting::getIDString(card, name); + TQAlsaMixerElement *e = *it; - if (m_MixerSettings.contains(id)) { + if (m_MixerSettings.tqcontains(id)) { const AlsaConfigMixerSetting &s = m_MixerSettings[id]; e->setVolume(s.m_volume); e->setOverride(s.m_use); @@ -211,7 +211,7 @@ void AlsaSoundConfiguration::restoreCaptureMixerSettings() } } -int AlsaSoundConfiguration::listSoundDevices(KComboBox *combobox, QMap<QString, int> *devname2dev, QMap<int, QString> *dev2devname, QMap<int, int> *dev2idx, int card, snd_pcm_stream_t stream) +int AlsaSoundConfiguration::listSoundDevices(KComboBox *combobox, TQMap<TQString, int> *devname2dev, TQMap<int, TQString> *dev2devname, TQMap<int, int> *dev2idx, int card, snd_pcm_stream_t stream) { snd_ctl_t *handle = NULL; int dev = -1; @@ -221,7 +221,7 @@ int AlsaSoundConfiguration::listSoundDevices(KComboBox *combobox, QMap<QString, snd_ctl_card_info_alloca(&info); snd_pcm_info_alloca (&pcminfo); - QString ctlname = "hw:"+QString::number(card); + TQString ctlname = "hw:"+TQString::number(card); if (combobox) combobox->clear(); @@ -250,12 +250,12 @@ int AlsaSoundConfiguration::listSoundDevices(KComboBox *combobox, QMap<QString, int err = 0; if ((err = snd_ctl_pcm_info(handle, pcminfo)) < 0) { if (err != -ENOENT) { - //logError(QString("control digital audio info (%1): %2").arg(card).arg(snd_strerror(err))); + //logError(TQString("control digital audio info (%1): %2").tqarg(card).tqarg(snd_strerror(err))); } continue; } const char *dev_name = snd_pcm_info_get_name(pcminfo); - QString devname = i18n("context-card-plus-device-number", "%1 device %2").arg(dev_name).arg(dev); + TQString devname = i18n("context-card-plus-device-number", "%1 device %2").tqarg(dev_name).tqarg(dev); if (combobox) combobox->insertItem(devname); if (devname2dev) @@ -315,14 +315,14 @@ void AlsaSoundConfiguration::slotCancel() slotCaptureCardSelected(m_comboCaptureCard->currentText()); m_comboCaptureDevice->setCurrentItem(m_captureDevice2idx[dev]); - //IErrorLogClient::staticLogDebug(QString("capture: card = %1(%2), dev = %3").arg(card).arg(m_captureCard2idx[card]).arg(dev)); + //IErrorLogClient::staticLogDebug(TQString("capture: card = %1(%2), dev = %3").tqarg(card).tqarg(m_captureCard2idx[card]).tqarg(dev)); editHWBufferSize ->setValue (m_SoundDevice ? m_SoundDevice->getHWBufferSize()/1024 : 4); editBufferSize ->setValue (m_SoundDevice ? m_SoundDevice->getBufferSize()/1024 : 4); chkDisablePlayback->setChecked(m_SoundDevice ? !m_SoundDevice->isPlaybackEnabled() : false); chkDisableCapture ->setChecked(m_SoundDevice ? !m_SoundDevice->isCaptureEnabled() : false); - //IErrorLogClient::staticLogDebug(QString("capture: card = %1").arg(m_comboCaptureCard->currentText())); + //IErrorLogClient::staticLogDebug(TQString("capture: card = %1").tqarg(m_comboCaptureCard->currentText())); if (m_SoundDevice) |