-rw-r--r-- | noncore/settings/sound/sound.pro | 6 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 84 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.cpp | 252 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.h | 63 |
4 files changed, 364 insertions, 41 deletions
diff --git a/noncore/settings/sound/sound.pro b/noncore/settings/sound/sound.pro index 9649262..a4f6333 100644 --- a/noncore/settings/sound/sound.pro +++ b/noncore/settings/sound/sound.pro @@ -3,5 +3,5 @@ CONFIG += qt warn_on release DESTDIR = ../../bin -HEADERS = soundsettings.h -SOURCES = soundsettings.cpp main.cpp -INTERFACES = soundsettingsbase.ui +HEADERS = soundsettings.h soundsettingsbase.h +SOURCES = soundsettings.cpp soundsettingsbase.cpp main.cpp +#INTERFACES = soundsettingsbase.ui INCLUDEPATH += $(OPIEDIR)/include diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index c1918de..cdee87c 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp @@ -19,2 +19,3 @@ **********************************************************************/ + #include "soundsettings.h" @@ -35,23 +36,26 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) { - Config config( "Sound" ); - config.setGroup( "System" ); - volume->setValue(100-config.readNumEntry("Volume")); + Config config( "qpe"); + config.setGroup( "Volume" ); + volume->setValue(100-config.readNumEntry("VolumePercent")); mic->setValue(100-config.readNumEntry("Mic")); - touchsound->setChecked(config.readBoolEntry("Touch")); - keysound->setChecked(config.readBoolEntry("Key")); - AlertCheckBox->setChecked(config.readBoolEntry("Alert")); +// touchsound->setChecked(config.readBoolEntry("TouchSound")); +// keysound->setChecked(config.readBoolEntry("KeySound")); + Config cfg("Vmemo"); + AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); - config.setGroup("Record"); + cfg.setGroup("Record"); int rate=config.readNumEntry("SampleRate", 22050); - if(rate == 11025) + if(rate == 8000) sampleRate->setCurrentItem(0); - else if(rate == 22050) + else if(rate == 11025) sampleRate->setCurrentItem(1); - else if(rate == 32000) + else if(rate == 22050) sampleRate->setCurrentItem(2); + else if(rate == 33075) + sampleRate->setCurrentItem(3); else if(rate==44100) - sampleRate->setCurrentItem(2); + sampleRate->setCurrentItem(4); - stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); - sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1)); + stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0)); + sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); @@ -68,6 +72,6 @@ void SoundSettings::reject() { - Config config( "Sound" ); - config.setGroup( "System" ); + Config config( "qpe"); + config.setGroup( "Volume"); - setVolume(100-config.readNumEntry("Volume")); + setVolume(100-config.readNumEntry("VolumePercent")); setMic(100-config.readNumEntry("Mic")); @@ -92,9 +96,11 @@ void SoundSettings::accept() { - Config config( "Sound" ); - config.setGroup( "System" ); - config.writeEntry("Volume",100-volume->value()); + Config config( "qpe" ); + config.setGroup( "Volume" ); + config.writeEntry("VolumePercent",100-volume->value()); config.writeEntry("Mic",100-mic->value()); - config.writeEntry("Touch",touchsound->isChecked()); - config.writeEntry("Key",keysound->isChecked()); - config.writeEntry("Alert",AlertCheckBox->isChecked()); +// config.writeEntry("TouchSound",touchsound->isChecked()); +// config.writeEntry("KeySound",keysound->isChecked()); + + Config cfg("Vmemo"); + cfg.writeEntry("Alert",AlertCheckBox->isChecked()); setVolume(volume->value()); @@ -102,7 +108,9 @@ void SoundSettings::accept() - config.setGroup("Record"); - config.writeEntry("SampleRate",sampleRate->currentText()); - config.writeEntry("Stereo",stereoCheckBox->isChecked()); - config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); - + cfg.setGroup("Record"); + cfg.writeEntry("SampleRate",sampleRate->currentText()); + cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); + cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); +// Config cfg( "VMemo" ); +// cfg.setGroup( "Defaults" ); +// cfg.writeEntry( "hideIcon", HideIcon_CheckBox->isChecked()); QDialog::accept(); @@ -112,5 +120,5 @@ void SoundSettings::setVolume(int v) { - Config config( "Sound" ); - config.setGroup( "System" ); - config.writeEntry("Volume",100-v); + Config config( "qpe" ); + config.setGroup( "Volume" ); + config.writeEntry("VolumePercent",100-v); #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) @@ -122,4 +130,4 @@ void SoundSettings::setMic(int m) { - Config config( "Sound" ); - config.setGroup( "System" ); + Config config( "qpe" ); + config.setGroup( "Volume" ); config.writeEntry("Mic",100-m); @@ -132,5 +140,5 @@ void SoundSettings::volumeChanged( bool ) { - Config config( "Sound" ); - config.setGroup( "System" ); - volume->setValue(100-config.readNumEntry("Volume")); + Config config( "qpe" ); + config.setGroup( "Volume" ); + volume->setValue(100-config.readNumEntry("VolumePercent")); } @@ -139,4 +147,4 @@ void SoundSettings::micChanged( bool ) { - Config config( "Sound" ); - config.setGroup( "System" ); + Config config( "qpe" ); + config.setGroup( "Volume" ); mic->setValue(100-config.readNumEntry("Mic")); @@ -162,3 +170,3 @@ void SoundSettings::updateStorageCombo() { void SoundSettings::setLocation(const QString & string) { - Config config( "Sound" ); + Config config( "Vmemo" ); config.setGroup( "System" ); diff --git a/noncore/settings/sound/soundsettingsbase.cpp b/noncore/settings/sound/soundsettingsbase.cpp new file mode 100644 index 0000000..937b068 --- a/dev/null +++ b/noncore/settings/sound/soundsettingsbase.cpp @@ -0,0 +1,252 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'soundsettingsbase.ui' +** +** Created: Sun May 19 12:11:35 2002 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "soundsettingsbase.h" + +#include <qcheckbox.h> +#include <qcombobox.h> +#include <qgroupbox.h> +#include <qlabel.h> +#include <qpushbutton.h> +#include <qslider.h> +#include <qlayout.h> +#include <qvariant.h> +#include <qtooltip.h> +#include <qwhatsthis.h> +#include <qimage.h> +#include <qpixmap.h> + +static const char* const image0_data[] = { +"16 16 3 1", +". c None", +"a c #000000", +"# c #ff0000", +"............#...", +"............##..", +"..........#..#..", +".....a..#..#.#..", +"....aa..##.#..#.", +"...aaa...#.##.#.", +"aaaaaa.#.#..#.##", +"aaaaaa.#.##.#.##", +"aaaaaa.#.##.#.##", +"aaaaaa.#.##.#.##", +"aaaaaa.#.#..#.##", +"...aaa...#.##.#.", +"....aa..#..#..#.", +".....a.....#.##.", +"..........#..#..", +"............##.."}; + +static const char* const image1_data[] = { +"16 16 3 1", +". c None", +"# c #000000", +"a c #ff0000", +"................", +"................", +"................", +".....#..........", +"....##..........", +"...###...a...a..", +"######..aaa.aaa.", +"######...aaaaa..", +"######....aaa...", +"######...aaaaa..", +"######..aaa.aaa.", +"...###...a...a..", +"....##..........", +".....#..........", +"................", +"................"}; + + +/* + * Constructs a SoundSettingsBase which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + * + * The dialog will by default be modeless, unless you set 'modal' to + * TRUE to construct a modal dialog. + */ +SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool modal, WFlags fl ) + : QDialog( parent, name, modal, fl ) +{ + QPixmap image0( ( const char** ) image0_data ); + QPixmap image1( ( const char** ) image1_data ); + if ( !name ) + setName( "SoundSettingsBase" ); + resize( 255, 301 ); + setCaption( tr( "Vmemo Settings" ) ); + SoundSettingsBaseLayout = new QGridLayout( this ); + SoundSettingsBaseLayout->setSpacing( 6 ); + SoundSettingsBaseLayout->setMargin( 11 ); + + GroupBox3 = new QGroupBox( this, "GroupBox3" ); + GroupBox3->setFrameShape( QGroupBox::Box ); + GroupBox3->setFrameShadow( QGroupBox::Sunken ); + GroupBox3->setTitle( tr( "Levels" ) ); + GroupBox3->setColumnLayout(0, Qt::Vertical ); + GroupBox3->layout()->setSpacing( 0 ); + GroupBox3->layout()->setMargin( 0 ); + GroupBox3Layout = new QVBoxLayout( GroupBox3->layout() ); + GroupBox3Layout->setAlignment( Qt::AlignTop ); + GroupBox3Layout->setSpacing( 2 ); + GroupBox3Layout->setMargin( 2 ); + + Layout10 = new QVBoxLayout; + Layout10->setSpacing( 2 ); + Layout10->setMargin( 2 ); + + Layout16 = new QHBoxLayout; + Layout16->setSpacing( 2 ); + Layout16->setMargin( 2 ); + QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout16->addItem( spacer ); + + PixmapLabel1_2 = new QLabel( GroupBox3, "PixmapLabel1_2" ); + PixmapLabel1_2->setPixmap( image0 ); + PixmapLabel1_2->setScaledContents( FALSE ); + Layout16->addWidget( PixmapLabel1_2 ); + + TextLabel1_2 = new QLabel( GroupBox3, "TextLabel1_2" ); + TextLabel1_2->setText( tr( "Loud" ) ); + Layout16->addWidget( TextLabel1_2 ); + QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout16->addItem( spacer_2 ); + Layout10->addLayout( Layout16 ); + + Layout13 = new QHBoxLayout; + Layout13->setSpacing( 2 ); + Layout13->setMargin( 2 ); + + volLabel = new QLabel( GroupBox3, "volLabel" ); + volLabel->setText( tr( "Output" ) ); + Layout13->addWidget( volLabel ); + QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout13->addItem( spacer_3 ); + + micLabel = new QLabel( GroupBox3, "micLabel" ); + micLabel->setText( tr( "Mic" ) ); + Layout13->addWidget( micLabel ); + QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout13->addItem( spacer_4 ); + Layout10->addLayout( Layout13 ); + + Layout12 = new QHBoxLayout; + Layout12->setSpacing( 2 ); + Layout12->setMargin( 2 ); + + volume = new QSlider( GroupBox3, "volume" ); + volume->setMaxValue( 100 ); + volume->setValue( 50 ); + volume->setOrientation( QSlider::Vertical ); + volume->setTickmarks( QSlider::Right ); + volume->setTickInterval( 5 ); + Layout12->addWidget( volume ); + QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout12->addItem( spacer_5 ); + + mic = new QSlider( GroupBox3, "mic" ); + mic->setMaxValue( 100 ); + mic->setValue( 50 ); + mic->setOrientation( QSlider::Vertical ); + mic->setTickmarks( QSlider::Right ); + mic->setTickInterval( 5 ); + Layout12->addWidget( mic ); + QSpacerItem* spacer_6 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout12->addItem( spacer_6 ); + Layout10->addLayout( Layout12 ); + + Layout17 = new QHBoxLayout; + Layout17->setSpacing( 2 ); + Layout17->setMargin( 2 ); + QSpacerItem* spacer_7 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout17->addItem( spacer_7 ); + + PixmapLabel2_2 = new QLabel( GroupBox3, "PixmapLabel2_2" ); + PixmapLabel2_2->setPixmap( image1 ); + PixmapLabel2_2->setScaledContents( FALSE ); + Layout17->addWidget( PixmapLabel2_2 ); + + TextLabel2_2 = new QLabel( GroupBox3, "TextLabel2_2" ); + TextLabel2_2->setText( tr( "Silent" ) ); + Layout17->addWidget( TextLabel2_2 ); + QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout17->addItem( spacer_8 ); + Layout10->addLayout( Layout17 ); + GroupBox3Layout->addLayout( Layout10 ); + + SoundSettingsBaseLayout->addWidget( GroupBox3, 0, 0 ); + + Layout12_2 = new QVBoxLayout; + Layout12_2->setSpacing( 2 ); + Layout12_2->setMargin( 2 ); + + GroupBox1 = new QGroupBox( this, "GroupBox1" ); + GroupBox1->setTitle( tr( "Vmemo" ) ); + + QWidget* privateLayoutWidget = new QWidget( GroupBox1, "Layout11" ); + privateLayoutWidget->setGeometry( QRect( 5, 16, 96, 169 ) ); + Layout11 = new QVBoxLayout( privateLayoutWidget ); + Layout11->setSpacing( 2 ); + Layout11->setMargin( 0 ); + + sampleRateLabel = new QLabel( privateLayoutWidget, "sampleRateLabel" ); + sampleRateLabel->setText( tr( "Sample Rate" ) ); + Layout11->addWidget( sampleRateLabel ); + + sampleRate = new QComboBox( FALSE, privateLayoutWidget, "sampleRate" ); + sampleRate->insertItem( tr( "8000" ) ); + sampleRate->insertItem( tr( "11025" ) ); + sampleRate->insertItem( tr( "22050" ) ); + sampleRate->insertItem( tr( "33075" ) ); + sampleRate->insertItem( tr( "44100" ) ); + sampleRate->setFixedWidth(90); + Layout11->addWidget( sampleRate ); + + stereoCheckBox = new QCheckBox( privateLayoutWidget, "stereoCheckBox" ); + stereoCheckBox->setText( tr( "Stereo" ) ); + Layout11->addWidget( stereoCheckBox ); + + sixteenBitCheckBox = new QCheckBox( privateLayoutWidget, "sixteenBitCheckBox" ); + sixteenBitCheckBox->setText( tr( "16 bit" ) ); + Layout11->addWidget( sixteenBitCheckBox ); + + AlertCheckBox = new QCheckBox( privateLayoutWidget, "AlertCheckBox" ); + AlertCheckBox->setText( tr( "Visual Alerts" ) ); + Layout11->addWidget( AlertCheckBox ); + + TextLabel1 = new QLabel( privateLayoutWidget, "TextLabel1" ); + TextLabel1->setText( tr( "Location" ) ); + Layout11->addWidget( TextLabel1 ); + + LocationComboBox = new QComboBox( FALSE, privateLayoutWidget, "LocationComboBox" ); + Layout11->addWidget( LocationComboBox ); + Layout12_2->addWidget( GroupBox1 ); + +// // touchsound = new QCheckBox( this, "touchsound" ); +// // touchsound->setText( tr( "Screen sounds" ) ); +// // Layout12_2->addWidget( touchsound ); + +// // keysound = new QCheckBox( this, "keysound" ); +// // keysound->setText( tr( "Keyboard sounds" ) ); +// // Layout12_2->addWidget( keysound ); + QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout12_2->addItem( spacer_9 ); + + SoundSettingsBaseLayout->addLayout( Layout12_2, 0, 1 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +SoundSettingsBase::~SoundSettingsBase() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/noncore/settings/sound/soundsettingsbase.h b/noncore/settings/sound/soundsettingsbase.h new file mode 100644 index 0000000..8ad80f6 --- a/dev/null +++ b/noncore/settings/sound/soundsettingsbase.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'soundsettingsbase.ui' +** +** Created: Sun May 19 12:11:23 2002 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef SOUNDSETTINGSBASE_H +#define SOUNDSETTINGSBASE_H + +#include <qvariant.h> +#include <qdialog.h> +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QCheckBox; +class QComboBox; +class QGroupBox; +class QLabel; +class QSlider; + +class SoundSettingsBase : public QDialog +{ + Q_OBJECT + +public: + SoundSettingsBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + ~SoundSettingsBase(); + + QGroupBox* GroupBox3; + QLabel* PixmapLabel1_2; + QLabel* TextLabel1_2; + QLabel* volLabel; + QLabel* micLabel; + QSlider* volume; + QSlider* mic; + QLabel* PixmapLabel2_2; + QLabel* TextLabel2_2; + QGroupBox* GroupBox1; + QLabel* sampleRateLabel; + QComboBox* sampleRate; + QCheckBox* stereoCheckBox; + QCheckBox* sixteenBitCheckBox; + QCheckBox* AlertCheckBox; + QLabel* TextLabel1; + QComboBox* LocationComboBox; +/* QCheckBox* touchsound; */ +/* QCheckBox* keysound; */ + +protected: + QGridLayout* SoundSettingsBaseLayout; + QVBoxLayout* GroupBox3Layout; + QVBoxLayout* Layout10; + QHBoxLayout* Layout16; + QHBoxLayout* Layout13; + QHBoxLayout* Layout12; + QHBoxLayout* Layout17; + QVBoxLayout* Layout12_2; + QVBoxLayout* Layout11; +}; + +#endif // SOUNDSETTINGSBASE_H |