summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/sound/sound.pro2
-rw-r--r--noncore/settings/sound/soundsettings.cpp6
-rw-r--r--noncore/settings/sound/soundsettingsbase.ui6
3 files changed, 12 insertions, 2 deletions
diff --git a/noncore/settings/sound/sound.pro b/noncore/settings/sound/sound.pro
index 8b33ff2..fa87b86 100644
--- a/noncore/settings/sound/sound.pro
+++ b/noncore/settings/sound/sound.pro
@@ -1,12 +1,12 @@
TEMPLATE = app
CONFIG += qt warn_on release
DESTDIR = ../../bin
HEADERS = soundsettings.h
SOURCES = soundsettings.cpp main.cpp
INTERFACES = soundsettingsbase.ui
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += ../$(OPIEDIR)/include
LIBS += -lqpe
TARGET = sound
-TRANSLATIONS = ../../i18n/pt_BR/sound.ts
+TRANSLATIONS += ../../i18n/pt_BR/sound.ts
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp
index 55f6c99..467f23e 100644
--- a/noncore/settings/sound/soundsettings.cpp
+++ b/noncore/settings/sound/soundsettings.cpp
@@ -1,132 +1,136 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "soundsettings.h"
#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
#include <qapplication.h>
#include <qslider.h>
#include <qcheckbox.h>
#include <qlineedit.h>
#include <qcombobox.h>
SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
: SoundSettingsBase( parent, name, TRUE, fl )
{
Config config( "Sound" );
config.setGroup( "System" );
volume->setValue(100-config.readNumEntry("Volume"));
mic->setValue(100-config.readNumEntry("Mic"));
touchsound->setChecked(config.readBoolEntry("Touch"));
keysound->setChecked(config.readBoolEntry("Key"));
config.setGroup("Record");
int rate=config.readNumEntry("SampleRate", 11025);
if(rate == 11025)
sampleRate->setCurrentItem(0);
else if(rate == 22050)
sampleRate->setCurrentItem(1);
+ else if(rate == 32000)
+ sampleRate->setCurrentItem(2);
else if(rate==44100)
sampleRate->setCurrentItem(2);
stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1));
connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int)));
connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int)));
connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) );
connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) );
}
void SoundSettings::reject()
{
Config config( "Sound" );
config.setGroup( "System" );
setVolume(100-config.readNumEntry("Volume"));
setMic(100-config.readNumEntry("Mic"));
config.setGroup("Record");
int rate=config.readNumEntry("SampleRate", 11025);
if(rate == 11025)
sampleRate->setCurrentItem(0);
else if(rate == 22050)
sampleRate->setCurrentItem(1);
- else if(rate==44100)
+ else if(rate == 32000)
sampleRate->setCurrentItem(2);
+ else if(rate==44100)
+ sampleRate->setCurrentItem(3);
stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0));
QDialog::reject();
}
void SoundSettings::accept()
{
Config config( "Sound" );
config.setGroup( "System" );
config.writeEntry("Volume",100-volume->value());
config.writeEntry("Mic",100-mic->value());
config.writeEntry("Touch",touchsound->isChecked());
config.writeEntry("Key",keysound->isChecked());
setVolume(volume->value());
setMic(mic->value());
config.setGroup("Record");
config.writeEntry("SampleRate",sampleRate->currentText());
config.writeEntry("Stereo",stereoCheckBox->isChecked());
config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked());
QDialog::accept();
}
void SoundSettings::setVolume(int v)
{
Config config( "Sound" );
config.setGroup( "System" );
config.writeEntry("Volume",100-v);
#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE;
#endif
}
void SoundSettings::setMic(int m)
{
Config config( "Sound" );
config.setGroup( "System" );
config.writeEntry("Mic",100-m);
#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE;
#endif
}
void SoundSettings::volumeChanged( bool )
{
Config config( "Sound" );
config.setGroup( "System" );
volume->setValue(100-config.readNumEntry("Volume"));
}
void SoundSettings::micChanged( bool )
{
Config config( "Sound" );
config.setGroup( "System" );
mic->setValue(100-config.readNumEntry("Mic"));
}
diff --git a/noncore/settings/sound/soundsettingsbase.ui b/noncore/settings/sound/soundsettingsbase.ui
index 0351fd8..97bea2d 100644
--- a/noncore/settings/sound/soundsettingsbase.ui
+++ b/noncore/settings/sound/soundsettingsbase.ui
@@ -1,512 +1,518 @@
<!DOCTYPE UI><UI>
<class>SoundSettingsBase</class>
<widget>
<class>QDialog</class>
<property stdset="1">
<name>name</name>
<cstring>SoundSettingsBase</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
<width>286</width>
<height>338</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Sound Settings</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
<grid>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget row="0" column="1" >
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout9</cstring>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout8</cstring>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QGroupBox</class>
<property stdset="1">
<name>name</name>
<cstring>GroupBox1</cstring>
</property>
<property stdset="1">
<name>title</name>
<string>Vmemo</string>
</property>
<grid>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget row="0" column="0" >
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout15</cstring>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>sampleRateLabel</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Sample Rate</string>
</property>
</widget>
<widget>
<class>QComboBox</class>
<item>
<property>
<name>text</name>
<string>11025</string>
</property>
</item>
<item>
<property>
<name>text</name>
<string>22050</string>
</property>
</item>
<item>
<property>
<name>text</name>
+ <string>32000</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
<string>44100</string>
</property>
</item>
<property stdset="1">
<name>name</name>
<cstring>sampleRate</cstring>
</property>
</widget>
<widget>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>stereoCheckBox</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Stereo</string>
</property>
</widget>
<widget>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>sixteenBitCheckBox</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>16 bit</string>
</property>
</widget>
</vbox>
</widget>
</grid>
</widget>
<widget>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>touchsound</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Screen sounds</string>
</property>
</widget>
<widget>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>keysound</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Keyboard sounds</string>
</property>
</widget>
</vbox>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer10</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</vbox>
</widget>
<widget row="0" column="0" >
<class>QGroupBox</class>
<property stdset="1">
<name>name</name>
<cstring>GroupBox3</cstring>
</property>
<property stdset="1">
<name>title</name>
<string>Levels</string>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout10</cstring>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout16</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<spacer>
<property>
<name>name</name>
<cstring>Spacer37</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>PixmapLabel1_2</cstring>
</property>
<property stdset="1">
<name>pixmap</name>
<pixmap>image0</pixmap>
</property>
<property stdset="1">
<name>scaledContents</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel1_2</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Loud</string>
</property>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer7</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout13</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>volLabel</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Output</string>
</property>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer20</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>micLabel</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Mic</string>
</property>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer17</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout12</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QSlider</class>
<property stdset="1">
<name>name</name>
<cstring>volume</cstring>
</property>
<property stdset="1">
<name>maxValue</name>
<number>100</number>
</property>
<property stdset="1">
<name>value</name>
<number>50</number>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>tickmarks</name>
<enum>Right</enum>
</property>
<property stdset="1">
<name>tickInterval</name>
<number>5</number>
</property>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer19</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
<class>QSlider</class>
<property stdset="1">
<name>name</name>
<cstring>mic</cstring>
</property>
<property stdset="1">
<name>maxValue</name>
<number>100</number>
</property>
<property stdset="1">
<name>value</name>
<number>50</number>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>tickmarks</name>
<enum>Right</enum>
</property>
<property stdset="1">
<name>tickInterval</name>
<number>5</number>
</property>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer18</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>