author | llornkcor <llornkcor> | 2003-08-10 23:02:47 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-08-10 23:02:47 (UTC) |
commit | 44bb1f23dcd0bea4775ba4b48fb370ad651290cc (patch) (side-by-side diff) | |
tree | 83028d0b3af21790e9e69dd83ce495a020bea948 | |
parent | 41b3267ce7142a62ac3d3d6eef3feb33f00deda5 (diff) | |
download | opie-44bb1f23dcd0bea4775ba4b48fb370ad651290cc.zip opie-44bb1f23dcd0bea4775ba4b48fb370ad651290cc.tar.gz opie-44bb1f23dcd0bea4775ba4b48fb370ad651290cc.tar.bz2 |
add adpcm checkbox
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 17 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.h | 1 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.cpp | 8 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.h | 2 |
4 files changed, 24 insertions, 4 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index 09d2e92..4bc86fa 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp @@ -93,41 +93,49 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) timeLimitComboBox->setCurrentItem(1); else if(sRate == 15) timeLimitComboBox->setCurrentItem(2); else if(sRate == 10) timeLimitComboBox->setCurrentItem(3); else if(sRate == 5) timeLimitComboBox->setCurrentItem(4); else timeLimitComboBox->setCurrentItem(5); sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); cfg.setGroup("Defaults"); keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") ); updateStorageCombo(); + + Config vmCfg("Vmemo"); + vmCfg.setGroup("Defaults"); + adpcmCheckBox->setChecked( vmCfg.readBoolEntry("use_ADPCM", 0)); + connect( LocationComboBox,SIGNAL(activated(const QString &)), this, SLOT( setLocation(const QString &))); connect( keyComboBox,SIGNAL(activated( int)), this, SLOT( setKeyButton( int))); connect( timeLimitComboBox,SIGNAL(activated( const QString &)), this, SLOT( setSizeLimitButton(const QString &))); connect( restartCheckBox,SIGNAL( toggled( bool)), this, SLOT( restartOpie( bool))); -// connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); + connect( adpcmCheckBox,SIGNAL( toggled( bool)), this, + SLOT( slotAdpcm( bool))); + + // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); } void SoundSettings::updateStorageCombo() { Config config( "Vmemo" ); config.setGroup( "System" ); QString loc = config.readEntry("RecLocation","/"); int i=0; int set=0; StorageInfo storageInfo; QString sName, sPath; QStringList list; list << "Documents : "+QPEApplication::documentDir(); list << "tmp : /tmp"; const QList<FileSystem> &fs = storageInfo.fileSystems(); @@ -151,33 +159,32 @@ void SoundSettings::updateStorageCombo() { void SoundSettings::setLocation(const QString & string) { Config config( "Vmemo" ); config.setGroup( "System" ); config.writeEntry("RecLocation",string); qDebug("set location "+string); config.write(); } void SoundSettings::cleanUp() { Config cfg("Vmemo"); cfg.writeEntry("Alert",AlertCheckBox->isChecked()); cfg.setGroup("Record"); cfg.writeEntry("SampleRate",sampleRate->currentText()); cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); - if(keyReset && noWarning) { QCopEnvelope ("QPE/System", "restart()"); } } void SoundSettings::setKeyButton( int index) { Config cfg("Vmemo"); cfg.setGroup("Defaults"); cfg.writeEntry( "toggleKey", index ); keyReset = TRUE; if( index == 1) { cfg.writeEntry( "hideIcon", 0 ); keyLabel->setText(tr("Shows icon")); } else { cfg.writeEntry( "hideIcon", 1); @@ -192,16 +199,22 @@ void SoundSettings::updateLocationCombo() { void SoundSettings::setSizeLimitButton(const QString &index) { Config cfg("Vmemo"); cfg.setGroup("Record"); if(index.find("Unlimited",0,TRUE) != -1) cfg.writeEntry("SizeLimit", -1); else cfg.writeEntry("SizeLimit", index); cfg.write(); } void SoundSettings::restartOpie(bool b) { noWarning=b; } +void SoundSettings::slotAdpcm(bool b) { + Config vmCfg("Vmemo"); + vmCfg.setGroup("Defaults"); + vmCfg.writeEntry("use_ADPCM", b); + vmCfg.write(); +} diff --git a/noncore/settings/sound/soundsettings.h b/noncore/settings/sound/soundsettings.h index 0f3605e..71ce6f5 100644 --- a/noncore/settings/sound/soundsettings.h +++ b/noncore/settings/sound/soundsettings.h @@ -31,21 +31,22 @@ Q_OBJECT public: SoundSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); protected: bool noWarning; /* void accept(); */ /* void reject(); */ void updateStorageCombo(); void updateLocationCombo(); private slots: void setKeyButton( int); void setSizeLimitButton(const QString &); void setLocation(const QString &); void cleanUp(); void restartOpie(bool); + void slotAdpcm(bool); }; #endif // SOUNDSETTINGS_H diff --git a/noncore/settings/sound/soundsettingsbase.cpp b/noncore/settings/sound/soundsettingsbase.cpp index af794ba..f283119 100644 --- a/noncore/settings/sound/soundsettingsbase.cpp +++ b/noncore/settings/sound/soundsettingsbase.cpp @@ -148,29 +148,33 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m timeLimitComboBox = new QComboBox( FALSE, this, "timeLimitComboBox" ); timeLimitComboBox->insertItem( tr( "30" ) ); timeLimitComboBox->insertItem( tr( "20" ) ); timeLimitComboBox->insertItem( tr( "15" ) ); timeLimitComboBox->insertItem( tr( "10" ) ); timeLimitComboBox->insertItem( tr( "5" ) ); timeLimitComboBox->insertItem( tr( "Unlimited" ) ); SoundSettingsBaseLayout->addMultiCellWidget(timeLimitComboBox , 8, 8, 0, 0, 1); restartCheckBox= new QCheckBox( this, "restartCheck" ); restartCheckBox->setText( tr( "Restart Opie if needed" ) ); SoundSettingsBaseLayout->addMultiCellWidget( restartCheckBox , 9, 9, 0, 0, 1); - + + adpcmCheckBox = new QCheckBox( this, "adpcmCheck" ); + adpcmCheckBox->setText( tr( "Use ADPCM compression" ) ); + + SoundSettingsBaseLayout->addMultiCellWidget( adpcmCheckBox , 10, 10, 0, 0, 1); QSpacerItem* spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); - SoundSettingsBaseLayout->addItem( spacer4, 9, 0 ); + SoundSettingsBaseLayout->addItem( spacer4, 10, 0 ); } /* * 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 index e6bc186..48c31e8 100644 --- a/noncore/settings/sound/soundsettingsbase.h +++ b/noncore/settings/sound/soundsettingsbase.h @@ -37,24 +37,26 @@ public: /* 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; QComboBox* keyComboBox; QComboBox* timeLimitComboBox; QCheckBox *restartCheckBox; + QCheckBox *adpcmCheckBox; + bool keyReset; protected: QGridLayout* SoundSettingsBaseLayout; protected slots: }; #endif // SOUNDSETTINGSBASE_H |