You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
3.3 KiB
87 lines
3.3 KiB
15 years ago
|
/***************************************************************************
|
||
|
oss-sound-configuration.cpp - description
|
||
|
-------------------
|
||
|
begin : Thu Sep 30 2004
|
||
|
copyright : (C) 2004 by Martin Witte
|
||
|
email : witte@kawo1.rwth-aachen.de
|
||
|
***************************************************************************/
|
||
|
|
||
|
/***************************************************************************
|
||
|
* *
|
||
|
* 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. *
|
||
|
* *
|
||
|
***************************************************************************/
|
||
|
|
||
14 years ago
|
#include <tqcheckbox.h>
|
||
15 years ago
|
|
||
|
#include <kurlrequester.h>
|
||
|
#include <knuminput.h>
|
||
|
|
||
|
#include "oss-sound-configuration.h"
|
||
|
#include "oss-sound.h"
|
||
|
|
||
13 years ago
|
OSSSoundConfiguration::OSSSoundConfiguration (TQWidget *parent, OSSSoundDevice *dev)
|
||
|
: OSSSoundConfigurationUI(parent),
|
||
15 years ago
|
m_SoundDevice (dev),
|
||
|
m_dirty(true),
|
||
|
m_ignore_gui_updates(false)
|
||
|
{
|
||
14 years ago
|
connect(editDSPDevice, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotSetDirty()));
|
||
|
connect(editMixerDevice, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotSetDirty()));
|
||
|
connect(editBufferSize, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty()));
|
||
|
connect(chkDisablePlayback, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty()));
|
||
|
connect(chkDisableCapture, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty()));
|
||
15 years ago
|
slotCancel();
|
||
|
}
|
||
|
|
||
|
|
||
|
OSSSoundConfiguration::~OSSSoundConfiguration ()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
|
||
|
void OSSSoundConfiguration::slotOK()
|
||
|
{
|
||
|
if (m_SoundDevice && m_dirty) {
|
||
|
m_SoundDevice->setBufferSize ( editBufferSize ->value() * 1024);
|
||
|
m_SoundDevice->enablePlayback (!chkDisablePlayback->isChecked());
|
||
|
m_SoundDevice->enableCapture (!chkDisableCapture ->isChecked());
|
||
|
m_SoundDevice->setDSPDeviceName ( editDSPDevice ->url());
|
||
|
m_SoundDevice->setMixerDeviceName( editMixerDevice ->url());
|
||
|
m_dirty = false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
void OSSSoundConfiguration::slotCancel()
|
||
|
{
|
||
|
if (m_dirty) {
|
||
|
m_ignore_gui_updates = true;
|
||
14 years ago
|
editDSPDevice ->setURL (m_SoundDevice ? m_SoundDevice->getDSPDeviceName() : TQString());
|
||
|
editMixerDevice ->setURL (m_SoundDevice ? m_SoundDevice->getMixerDeviceName() : TQString());
|
||
15 years ago
|
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);
|
||
|
m_ignore_gui_updates = false;
|
||
|
m_dirty = false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void OSSSoundConfiguration::slotUpdateConfig()
|
||
|
{
|
||
|
slotSetDirty();
|
||
|
slotCancel();
|
||
|
}
|
||
|
|
||
|
void OSSSoundConfiguration::slotSetDirty()
|
||
|
{
|
||
|
if (!m_ignore_gui_updates) {
|
||
|
m_dirty = true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#include "oss-sound-configuration.moc"
|