author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (side-by-side diff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/settings/sound | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
-rw-r--r-- | noncore/settings/sound/sound.pro | 11 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 16 |
2 files changed, 15 insertions, 12 deletions
diff --git a/noncore/settings/sound/sound.pro b/noncore/settings/sound/sound.pro index a3804c3..58e94f3 100644 --- a/noncore/settings/sound/sound.pro +++ b/noncore/settings/sound/sound.pro @@ -1,10 +1,9 @@ -CONFIG += qt warn_on quick-app -HEADERS = soundsettings.h soundsettingsbase.h -SOURCES = soundsettings.cpp soundsettingsbase.cpp main.cpp -#INTERFACES = soundsettingsbase.ui +CONFIG += qt warn_on quick-app +HEADERS = soundsettings.h soundsettingsbase.h +SOURCES = soundsettings.cpp soundsettingsbase.cpp main.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopiecore2 -TARGET = sound +LIBS += -lqpe -lopiecore2 +TARGET = sound include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index 8ad0a3f..d55a751 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp @@ -1,112 +1,116 @@ /********************************************************************** ** 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. ** **********************************************************************/ // parts copyright 2002 L.J. Potter #include "soundsettings.h" +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/storage.h> +using namespace Opie::Core; +/* QT */ #include <qcheckbox.h> #include <qcombobox.h> #include <qlabel.h> +/* STD */ #include <sys/utsname.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> -#include <stdio.h> #include <sys/stat.h> SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) : SoundSettingsBase( parent, objname, TRUE, fl ) { keyReset=FALSE; noWarning=false; Config config( "qpe"); config.setGroup( "Volume" ); Config cfg("Vmemo"); connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); cfg.setGroup("Record"); int rate=config.readNumEntry("SampleRate", 22050); if(rate == 8000) sampleRate->setCurrentItem(0); else if(rate == 11025) sampleRate->setCurrentItem(1); else if(rate == 22050) sampleRate->setCurrentItem(2); else if(rate == 33075) sampleRate->setCurrentItem(3); else if(rate==44100) sampleRate->setCurrentItem(4); stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0)); //TODO hide if zaurus- mono only #if defined(QT_QWS_IPAQ) || defined(QT_QWS_SL5XXX) //since ipaq and zaurus have particular //devices bool systemZaurus=FALSE; struct utsname name; /* check for embedix kernel running on the zaurus*/ if (uname(&name) != -1) {// TODO change this here,... QString release=name.release; if( release.find("embedix",0,TRUE) != -1) { - qDebug("IS System Zaurus"); + odebug << "IS System Zaurus" << oendl; systemZaurus=TRUE; } } if(!systemZaurus) { stereoCheckBox->setChecked(TRUE); } stereoCheckBox->setEnabled(FALSE); sixteenBitCheckBox->setEnabled(FALSE); #else #endif int sRate=cfg.readNumEntry("SizeLimit", 30); - qDebug("%d",sRate); + odebug << "" << sRate << "" << oendl; if(sRate ==30) timeLimitComboBox->setCurrentItem(0); else if(sRate==20) 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)); @@ -122,66 +126,66 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) 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(); QListIterator<FileSystem> it ( fs ); for( ; it.current(); ++it ){ const QString name = (*it)->name(); const QString path = (*it)->path(); - qDebug("storage name "+name +" storage path is "+path); + odebug << "storage name "+name +" storage path is "+path << oendl; list << name + ": " +path; if( loc.find( path,0,TRUE) != -1) set = i; // if(dit.current()->file().find(path) != -1 ) storage=name; i++; } LocationComboBox->insertStringList(list); - qDebug("set item %d", set); + odebug << "set item " << set << "" << oendl; LocationComboBox->setCurrentItem(set); } void SoundSettings::setLocation(const QString & string) { Config config( "Vmemo" ); config.setGroup( "System" ); config.writeEntry("RecLocation",string); - qDebug("set location "+string); + odebug << "set location "+string << oendl; 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")); |