From 793cf2dff35dffe3ec4c7b24252947dde758a1b2 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 01:04:32 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- tdeioslave/audiocd/kcmaudiocd/Makefile.am | 17 + tdeioslave/audiocd/kcmaudiocd/audiocd.desktop | 182 +++++++ tdeioslave/audiocd/kcmaudiocd/audiocdconfig.ui | 628 +++++++++++++++++++++++++ tdeioslave/audiocd/kcmaudiocd/kcmaudiocd.cpp | 267 +++++++++++ tdeioslave/audiocd/kcmaudiocd/kcmaudiocd.h | 66 +++ 5 files changed, 1160 insertions(+) create mode 100644 tdeioslave/audiocd/kcmaudiocd/Makefile.am create mode 100644 tdeioslave/audiocd/kcmaudiocd/audiocd.desktop create mode 100644 tdeioslave/audiocd/kcmaudiocd/audiocdconfig.ui create mode 100644 tdeioslave/audiocd/kcmaudiocd/kcmaudiocd.cpp create mode 100644 tdeioslave/audiocd/kcmaudiocd/kcmaudiocd.h (limited to 'tdeioslave/audiocd/kcmaudiocd') diff --git a/tdeioslave/audiocd/kcmaudiocd/Makefile.am b/tdeioslave/audiocd/kcmaudiocd/Makefile.am new file mode 100644 index 00000000..73d6be2d --- /dev/null +++ b/tdeioslave/audiocd/kcmaudiocd/Makefile.am @@ -0,0 +1,17 @@ +kde_module_LTLIBRARIES = kcm_audiocd.la + +kcm_audiocd_la_SOURCES = audiocdconfig.ui kcmaudiocd.cpp + +kcm_audiocd_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +kcm_audiocd_la_LIBADD = ../plugins/libaudiocdplugins.la $(LIB_TDEUI) + +INCLUDES = -I$(srcdir)/../plugins -I$(top_srcdir)/libkcddb $(all_includes) + +kcm_audiocd_la_METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kcmaudiocd.pot + +xdg_apps_DATA = audiocd.desktop + +audiocdconfig.cpp: audiocdconfig.h diff --git a/tdeioslave/audiocd/kcmaudiocd/audiocd.desktop b/tdeioslave/audiocd/kcmaudiocd/audiocd.desktop new file mode 100644 index 00000000..88bfedde --- /dev/null +++ b/tdeioslave/audiocd/kcmaudiocd/audiocd.desktop @@ -0,0 +1,182 @@ +[Desktop Entry] +Exec=tdecmshell audiocd +Icon=cdaudio_unmount +Type=Application + +X-TDE-ModuleType=Library +X-TDE-Library=audiocd + +Name=Audio CDs +Name[af]=Audio Cds +Name[ar]=أقراص مدمجة صوتية +Name[bg]=Аудио диск +Name[bn]=অডিও সিডি +Name[br]=CD klevet +Name[bs]=Audio CDi +Name[ca]=CD d'àudio +Name[cs]=Zvuková CD +Name[cy]=CDau Sain +Name[da]=Lyd-cd'er +Name[de]=Audio-CDs +Name[el]=CD μουσικής +Name[eo]=Son-KDoj +Name[es]=CDs audio +Name[et]=Audioplaadid +Name[eu]=Audio CD-ak +Name[fa]=دیسکهای فشردۀ صوتی +Name[fi]=Ääni-CD:t +Name[fr]=CD audio +Name[ga]=Dlúthdhioscaí Fuaime +Name[he]=תקליטורי שמע +Name[hi]=ऑडीयो सीडी +Name[hr]=Audio CD-i +Name[hu]=Hang-CD-böngésző +Name[is]=Tónlistardiskaflakkari +Name[it]=CD Audio +Name[ja]=オーディオ CD +Name[kk]=Аудио CD +Name[km]=ស៊ីឌី​អ៉ូឌីយ៉ូ +Name[ko]=오디오 CD +Name[lt]=Audio kompaktai +Name[mk]=Аудио ЦД-а +Name[nb]=Lyd-CD-er +Name[nds]=Klang-CDs +Name[ne]=अडियो सीडी +Name[nl]=Audio-cd's +Name[nn]=Lyd-CD-ar +Name[pa]=ਆਡੀਓ CD +Name[pl]=Przeglądarka audio CD +Name[pt]=CDs de Áudio +Name[pt_BR]=CDs de Áudio +Name[ro]=CD-uri audio +Name[ru]=Аудио CD +Name[se]=Jietna-CD:at +Name[sk]=Zvukové CD +Name[sl]=Avdio CD-ji +Name[sr]=Аудио CD-ови +Name[sr@Latn]=Audio CD-ovi +Name[sv]=Ljud-cd +Name[ta]=கேட்பொலி குறுந்தகடுகள் +Name[tg]=Дискҳои Фишурдаи Садо +Name[th]=ซีดีบันทึกเสียง +Name[tr]=Müzik CD +Name[uk]=Аудіо-КД +Name[uz]=Audio kompakt-disklar +Name[uz@cyrillic]=Аудио компакт-дисклар +Name[ven]=CD ino thetsheleswa +Name[xh]=CDs Zokuvakalayo +Name[zh_CN]=音频 CD +Name[zh_HK]=音樂 CD +Name[zh_TW]=音樂光碟 +Name[zu]=Ama-CD Okuzwakalayo +Comment=Audiocd IO Slave Configuration +Comment[af]=Klank cd Io Slaaf Opstelling +Comment[az]=Name=Audiosd IO Kölələri Quraşdırması +Comment[bg]=Настройване на аудио диска +Comment[bn]=অডিও-সিডি আই/ও স্লেভ কনফিগারেশন +Comment[br]=Kefluniadur Sklav IO Audiocd +Comment[bs]=Podešavanje Audiocd IO Slave +Comment[ca]=Configuració de l'E/S esclava dels CD àudio +Comment[cs]=Nastavení IO klienta pro zvuková CD +Comment[cy]=Gosodiad Gwas IO ar gyfer CDau Sain +Comment[da]=Lyd-cd IO-slave-indstilling +Comment[de]=Einrichtung des Ein-/Ausgabemoduls für Audio-CDs +Comment[el]=Ρύθμιση Audiocd IO Slave +Comment[eo]=Agordo por la muzikdiska sklavo +Comment[es]=Configuración del esclavo de E/S de audiocd +Comment[et]=Audio CD IO mooduli seadistamine +Comment[eu]=Audiocd IO mendekoaren konfigurazioa +Comment[fa]=پیکربندی پی‌رو IO دیسک فشردۀ صوتی +Comment[fi]=Audiocd-siirräntätyöskentelijän asetukset +Comment[fr]=Configuration du module pour CD audio +Comment[gl]=Configuración do escravo IO de audiocd +Comment[he]=שינוי הגדרות פרוטוקול תקליטורי השמע +Comment[hi]=ऑडियो-सीडी आई-ओ स्लेव कॉन्फ़िगरेशन +Comment[hr]=Postava Audiocd IO poslužnika +Comment[hu]=Az audiocd TDE-protokoll beállításai +Comment[is]=Stillingar Audiocd I/O þrælsins +Comment[it]=Configurazione dell'IO Slave per i CD Audio +Comment[ja]=オーディオ CD IO スレーブの設定 +Comment[kk]=AudioCD IO Slave баптауы +Comment[km]=ការ​កំណត់​រចនាសម្ព័ន្ធ IO Slave របស់​ស៊ីឌី​អូឌីយ៉ូ +Comment[ko]=오디오 CD IO 슬레이브 설정 +Comment[lt]=Audio kompakto IO vergo derinimas +Comment[ms]=Penyelarasan Hamba IO Audiocd +Comment[mt]=Konfigurazzjoni tal-iskjav IO AudioCD +Comment[nb]=Oppsett av lyd-CD IO-slave +Comment[nds]=Instellen för dat In-/Utgaavmoduul för Klang-CDs +Comment[ne]=Audiocd IO स्लेभ कन्फिगरेसन +Comment[nl]=AudioCD IO slave instellen +Comment[nn]=Oppsett av IU-slave for lyd-CD +Comment[pa]=ਆਡੀਓ ਸੀਡੀ IO ਸਲੇਵ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja procedury we/wy dla audio CD +Comment[pt]=Configuração do IO Slave de CDs-Áudio +Comment[pt_BR]=Configuração do Áudio CD Escravo +Comment[ro]=Configurează dispozitivul I/O pentru CD audio +Comment[ru]=Настройка протокола AudioCD +Comment[se]=Heivet SO-šláva jietna-CD:aid várás +Comment[sk]=Nastavenie IO klienta pre zvukové CD +Comment[sl]=Nastavitve Audiocd podrejeni V/I +Comment[sr]=Подешавање Audiocd IO Slave-а +Comment[sr@Latn]=Podešavanje Audiocd IO Slave-a +Comment[sv]=Anpassa I/O-slav för ljud-cd +Comment[ta]=ஒலிக் குறுந்தகடு உள்-வெளி அடிமை வடிவமைப்பு +Comment[tg]=Танзими Фармонбари Ворид/Хориҷи Дискҳои Фишурдаи Садо +Comment[th]=ปรับแต่ง Audiocd IO Slave +Comment[tr]=Müzik CD Yapılandırması +Comment[uk]=Налаштування підлеглого В/В "Audiocd" +Comment[ven]=Nzudzanyo Audiocd IO Slave +Comment[xh]=Video-DVD IO Slave Uqwalaselo +Comment[zh_CN]=音频 CD 输入输出从属模块配置 +Comment[zh_HK]=音樂 CD IO Slave 設定 +Comment[zh_TW]=音樂光碟 IO Slave 組態 +Comment[zu]=Inhlanganiselo ye-Audiocd IO Slave +Keywords=Audio CD,CD,Ogg,Vorbis,Encoding,CDDA,Bitrate +Keywords[bg]=аудио, диск, компактдиск, КД, кодек, музика, Audio CD, CD, Ogg, Vorbis, Encoding, CDDA, Bitrate +Keywords[br]=CD klevet,CD,Ogg,Vorbis,Kodadur,CDDA,Feur +Keywords[ca]=Àudio CD,CD,Ogg,Vorbis,Codificació,CDDA,Taxa de bits +Keywords[cs]=Zvukové CD,CD,Ogg,Vorbis,Kódování,CDDA,Bitrate,CDDB +Keywords[cy]=CD Sain,CD,crynoddisg,Ogg,Vorbis,Amgodio,CDDA,Cyfradd Ddidau +Keywords[da]=Lyd-cd,CD,Ogg,Vorbis,Indkodning,CDDA,Bitrate +Keywords[de]=Audio CD,CD,Ogg,Vorbis,Encoding,CDDA,Bitrate,MP3 +Keywords[el]=CD μουσικής,CD,Ogg,Vorbis,Κωδικοποίηση,CDDA,Ρυθμός bit +Keywords[es]=CD de audio,CD,Ogg,Vorbis,Codificación,CDDA,Ratio de bits +Keywords[et]=audio,CD,Ogg,Vorbis,kodeering,CDDA,bitikiirus +Keywords[eu]=Audio CD,CD,Ogg,Vorbis,Kdeketa,CDDA,bit-maiztasuna +Keywords[fa]=دیسک فشرده، دیسک فشرده، Ogg، Vorbis، کدبندی، CDDA، میزان ارسال بیت صوتی +Keywords[fi]=Ääni-CD,CD,Ogg,Vorbis,Koodaus,CDDA,Bittinopeus +Keywords[fr]=CD audio,CD,Ogg,Vorbis,Encodage,CDDA,débit +Keywords[ga]=CD Fuaime,CD,Ogg,Vorbis,Ionchódú,CDDA,Ráta Giotán +Keywords[gl]=Audio CD,CD,Ogg,Vorbis,Codificación,CDDA,Razón de Bits +Keywords[hi]=ऑडियो सीडी,सीडी,ऑग,वॉर्बिस,एनकोडिंग,सीडीडीए,बिटरेट +Keywords[hu]=hang-CD,CD,Ogg,Vorbis,kódolás,CDDA,bitráta +Keywords[it]=CD Audio,CD,Ogg,Vorbis,Codifica,CDDA,Bitrate +Keywords[ja]=オーディオ CD,CD,Ogg,Vorbis,エンコーディング,CDDA,ビットレート +Keywords[km]=ស៊ីឌី​អូឌីយ៉ូ,ស៊ីឌី,Ogg,Vorbis,អ៊ិនកូដ,CDDA,អត្រាប៊ីត +Keywords[ko]=오디오 CD,CD,Ogg,인코딩,CDDA +Keywords[lt]=Audio CD,CD,Ogg,Vorbis,Encoding,CDDA,Bitrate,įkodavimas +Keywords[mk]=Аудио CD,CD,Ogg,Vorbis,Кодирање,CDDA,Брзина во битови +Keywords[nb]=Audio CD,CD,Ogg,Vorbis,Koding,CDDA,Bitrate +Keywords[nds]=Audio-CD,Klang-CD,CD,Ogg,Vorbis,Koderen,CDDA,Bitrate +Keywords[ne]=अडियो सीडी,सीडी,अग,भर्बिस,सङ्केतन,सीडीडीए,बिटरेट +Keywords[nl]=Audio-cd,cd,Ogg,Vorbis,Encoding,CDDA,Bitrate +Keywords[nn]=lyd-CD,CD,Ogg,Vorbis,koding,CDDA,bitrate +Keywords[pa]=ਆਡੀਓ CD,CD,Ogg,Vorbis,ਇਕੋਡਿੰਗ,CDDA,ਬਿੱਟਰੇਟ +Keywords[pl]=Audio CD,CD,Ogg,Vorbis,Encoding,CDDA,Bitrate, Kodowanie +Keywords[pt]=CD de Áudio,CD,Ogg,Vorbis,Codificação,CDDA,Taxa de Bits +Keywords[pt_BR]=CD de Áudio,CD,Ogg,Vorbis,Codificação,CDDA,Bitrate +Keywords[ro]=CD audio,ogg,vorbis,codare,CDDA,rată de bit +Keywords[ru]=Audio CD,CD,Ogg,Vorbis,Encoding,CDDA,Bitrate,битрейт +Keywords[sk]=zvukové CD,CD,Ogg,Vorbis,kódovanie,CDDA,bitová frekvencia +Keywords[sl]=Avdio CD,CD,Ogg,Vorbis,kodiranje,CDDA,bitna hitrost +Keywords[sr]=Audio CD,CD,Ogg,Vorbis,Encoding,CDDA,Bitrate, Аудио CD, кодирање,битрата +Keywords[sr@Latn]=Audio CD,CD,Ogg,Vorbis,Encoding,CDDA,Bitrate, Audio CD, kodiranje,bitrata +Keywords[sv]=ljud-cd,cd,Ogg,Vorbis,kodning,CDDA,bithastighet +Keywords[ta]=கேட்பொலி குறுந்தகடு,குறுந்தகடு,ஓஜிஜி,வோர்பிஸ்,குறியிடுதல்,சிடிடேஏ,பிட் மதிப்பு +Keywords[tg]=Диски Фишурдаи Садо,Диски Фишурда,Ogg,Vorbis,Рамзигузор,CDDA,Bitrate +Keywords[th]=ซีดีบันทึกเสียง, ซีดี,Ogg,Vorbis,เข้ารหัส,CDDA,บิตเรต +Keywords[tr]=Ses CD,CD,Ogg,Vorbis,Kodlama,CDDA,Bitrate +Keywords[uk]=Аудіо-КД,КД,Ogg,Vorbis,кодування,CDDA,частота вибірки +Keywords[zh_CN]=音频 CD,CD,Ogg,Vorbis,编码,CDDA,Bitrate + +Categories=Qt;TDE;Settings;X-TDE-settings-sound; diff --git a/tdeioslave/audiocd/kcmaudiocd/audiocdconfig.ui b/tdeioslave/audiocd/kcmaudiocd/audiocdconfig.ui new file mode 100644 index 00000000..a3b98507 --- /dev/null +++ b/tdeioslave/audiocd/kcmaudiocd/audiocdconfig.ui @@ -0,0 +1,628 @@ + +AudiocdConfig + + + AudiocdConfig + + + + 0 + 0 + 640 + 563 + + + + + + + + + unnamed + + + 0 + + + 0 + + + + tabWidget + + + + 5 + 5 + 0 + 0 + + + + + + + + + tab + + + &General + + + + unnamed + + + + Spacer5 + + + Vertical + + + Expanding + + + + 20 + 210 + + + + + + encoderPriority + + + Encoder Priority + + + + unnamed + + + + niceLevel + + + -19 + + + 19 + + + 5 + + + Horizontal + + + NoMarks + + + + + textLabel2 + + + Highest + + + + + textLabel3 + + + Lowest + + + AlignVCenter|AlignRight + + + + + textLabel4 + + + Normal + + + AlignCenter + + + + + + + cd_device_string + + + false + + + /dev/cdrom + + + Specify a location for the drive you want to use. Normally, this is a file inside the /dev folder representing your CD or DVD drive. + + + + + cd_specify_device + + + &Specify CD device: + + + Check this to specify a CD device different from the one which is detected automatically + + + + + ec_enable_check + + + Use &error correction when reading the CD + + + true + + + If you uncheck this option, the slave will not try to use error correction which can be useful for reading damaged CDs. However, this feature can be problematic in some cases, so you can switch it off here. + + + + + ec_skip_check + + + &Skip on errors + + + false + + + + + spacer4_2 + + + Horizontal + + + Fixed + + + + 20 + 20 + + + + + + + + tab + + + &Names + + + + unnamed + + + + fileNameGroupBox + + + File Name (without extension) + + + + unnamed + + + + textLabel1_2 + + + The following macros will be expanded: + + + + + layout7 + + + + unnamed + + + + textLabel13 + + + Genre + + + + + textLabel7 + + + Track Number + + + + + textLabel2_3 + + + %{title} + + + + + textLabel11 + + + Year + + + + + textLabel3_3 + + + Track Title + + + + + textLabel9 + + + Album Artist + + + + + textLabel10 + + + %{year} + + + + + textLabel6 + + + %{albumtitle} + + + + + textLabel5 + + + Album Title + + + + + textLabel12 + + + %{genre} + + + + + textLabel8 + + + %{albumartist} + + + + + textLabel4_2 + + + %{number} + + + + + + + fileNameLineEdit + + + + + + + groupBox2 + + + Name Regular Expression Replacement + + + + unnamed + + + + textLabel2_2 + + + Selection: + + + + + textLabel1 + + + Regular expression used on all file names. For example using selection " " and replace with "_" would replace all the spaces with underlines. + + + + WordBreak|AlignVCenter + + + + + inputlabel + + + Input: + + + + + outputLabel + + + Output: + + + + + exampleLabel + + + Example + + + + + exampleOutput + + + Cool artist - example audio file.wav + + + + + example + + + Cool artist - example audio file.wav + + + + + kcfg_replaceInput + + + + + kcfg_replaceOutput + + + + + textLabel3_2 + + + Replace with: + + + + + line1 + + + HLine + + + Sunken + + + Horizontal + + + + + + + spacer4 + + + Vertical + + + Expanding + + + + 21 + 16 + + + + + + fileNameGroupBox_2 + + + Album Name + + + + unnamed + + + + fileNameLabel_2 + + + The following macros will be expanded: + + + + + layout9 + + + + unnamed + + + + textLabel20 + + + Year + + + + + textLabel15 + + + %{albumartist} + + + + + textLabel16 + + + %{year} + + + + + textLabel21 + + + Genre + + + + + textLabel19 + + + Album Artist + + + + + textLabel18 + + + Album Title + + + + + textLabel17 + + + %{genre} + + + + + textLabel14 + + + %{albumtitle} + + + + + + + spacer3 + + + Vertical + + + Expanding + + + + 20 + 31 + + + + + + albumNameLineEdit + + + + + + + + + + + + ec_enable_check + toggled(bool) + ec_skip_check + setEnabled(bool) + + + cd_specify_device + toggled(bool) + cd_device_string + setEnabled(bool) + + + + tabWidget + cd_device_string + ec_enable_check + ec_skip_check + niceLevel + fileNameLineEdit + albumNameLineEdit + kcfg_replaceInput + kcfg_replaceOutput + example + + + tdecmodule.h + + + toggleLowpass() + + + + klineedit.h + + diff --git a/tdeioslave/audiocd/kcmaudiocd/kcmaudiocd.cpp b/tdeioslave/audiocd/kcmaudiocd/kcmaudiocd.cpp new file mode 100644 index 00000000..f3190d43 --- /dev/null +++ b/tdeioslave/audiocd/kcmaudiocd/kcmaudiocd.cpp @@ -0,0 +1,267 @@ +/* + Copyright (C) 2001 Carsten Duvenhorst + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "kcmaudiocd.moc" +#include + +KAudiocdModule::KAudiocdModule(TQWidget *parent, const char *name) + : AudiocdConfig(parent, name), configChanged(false) +{ + TQString foo = i18n("Report errors found on the cd."); + + setButtons(Default|Apply); + + config = new TDEConfig("kcmaudiocdrc"); + + TQPtrList encoders; + AudioCDEncoder::findAllPlugins(0, encoders); + AudioCDEncoder *encoder; + for ( encoder = encoders.first(); encoder; encoder = encoders.next() ){ + if (encoder->init()) { + TDEConfigSkeleton *config = NULL; + TQWidget *widget = encoder->getConfigureWidget(&config); + if(widget && config){ + tabWidget->addTab(widget, i18n("%1 Encoder").arg(encoder->type())); + TDEConfigDialogManager *configManager = new TDEConfigDialogManager(widget, config, TQString(encoder->type()+" EncoderConfigManager").latin1()); + encoderSettings.append(configManager); + } + } + } + + load(); + + TDEConfigDialogManager *widget; + for ( widget = encoderSettings.first(); widget; widget = encoderSettings.next() ){ + connect(widget, TQT_SIGNAL(widgetModified()), this, TQT_SLOT(slotModuleChanged())); + } + + //CDDA Options + connect(cd_specify_device,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotConfigChanged())); + connect(ec_enable_check,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotEcEnable())); + connect(ec_skip_check,TQT_SIGNAL(clicked()),TQT_SLOT(slotConfigChanged())); + connect(cd_device_string,TQT_SIGNAL(textChanged(const TQString &)),TQT_SLOT(slotConfigChanged())); + connect(niceLevel,TQT_SIGNAL(valueChanged(int)),TQT_SLOT(slotConfigChanged())); + + // File Name + connect(fileNameLineEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotConfigChanged())); + connect(albumNameLineEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotConfigChanged())); + connect( kcfg_replaceInput, TQT_SIGNAL( textChanged(const TQString&) ), this, TQT_SLOT( updateExample() ) ); + connect( kcfg_replaceOutput, TQT_SIGNAL( textChanged(const TQString&) ), this, TQT_SLOT( updateExample() ) ); + connect( example, TQT_SIGNAL( textChanged(const TQString&) ), this, TQT_SLOT( updateExample() ) ); + connect( kcfg_replaceInput, TQT_SIGNAL( textChanged(const TQString&) ), this, TQT_SLOT( slotConfigChanged() ) ); + connect( kcfg_replaceOutput, TQT_SIGNAL( textChanged(const TQString&) ), this, TQT_SLOT( slotConfigChanged() ) ); + connect( example, TQT_SIGNAL( textChanged(const TQString&) ), this, TQT_SLOT( slotConfigChanged() ) ); + + TDEAboutData *about = + new TDEAboutData(I18N_NOOP("kcmaudiocd"), I18N_NOOP("TDE Audio CD IO Slave"), + 0, 0, TDEAboutData::License_GPL, + I18N_NOOP("(c) 2000 - 2005 Audio CD developers")); + + about->addAuthor("Benjamin C. Meyer", I18N_NOOP("Current Maintainer"), "ben@meyerhome.net"); + about->addAuthor("Carsten Duvenhorst", 0, "duvenhorst@duvnet.de"); + setAboutData(about); +} + +KAudiocdModule::~KAudiocdModule() +{ + delete config; +} + +TQString removeQoutes(const TQString& text) +{ + TQString deqoutedString=text; + TQRegExp qoutedStringRegExp("^\".*\"$"); + if (qoutedStringRegExp.exactMatch(text)) + { + deqoutedString=text.mid(1, text.length()-2); + } + return deqoutedString; +} + +bool needsQoutes(const TQString& text) +{ + TQRegExp spaceAtTheBeginning("^\\s+.*$"); + TQRegExp spaceAtTheEnd("^.*\\s+$"); + return (spaceAtTheBeginning.exactMatch(text) || spaceAtTheEnd.exactMatch(text)); + + +} + +void KAudiocdModule::updateExample() +{ + TQString text = example->text(); + TQString deqoutedReplaceInput=removeQoutes(kcfg_replaceInput->text()); + TQString deqoutedReplaceOutput=removeQoutes(kcfg_replaceOutput->text()); + + text.replace( TQRegExp(deqoutedReplaceInput), deqoutedReplaceOutput ); + exampleOutput->setText(text); +} + +void KAudiocdModule::defaults() { + load( false ); +} + +void KAudiocdModule::save() { + if (!configChanged ) return; + + { + TDEConfigGroupSaver saver(config, "CDDA"); + + // autosearch is the name of the config option, which has the + // reverse sense of the current text of the configuration option, + // which is specify the device. Therefore, invert the value on write. + // + config->writeEntry("autosearch", !(cd_specify_device->isChecked()) ); + config->writeEntry("device",cd_device_string->text()); + config->writeEntry("disable_paranoia",!(ec_enable_check->isChecked())); + config->writeEntry("never_skip",!(ec_skip_check->isChecked())); + config->writeEntry("niceLevel", niceLevel->value()); + } + + { + TDEConfigGroupSaver saver(config, "FileName"); + config->writeEntry("file_name_template", fileNameLineEdit->text()); + config->writeEntry("album_name_template", albumNameLineEdit->text()); + config->writeEntry("regexp_example", example->text()); + // save qouted if required + TQString replaceInput=kcfg_replaceInput->text(); + TQString replaceOutput=kcfg_replaceOutput->text(); + if (needsQoutes(replaceInput)) + { + replaceInput=TQString("\"")+replaceInput+TQString("\""); + } + if (needsQoutes(replaceOutput)) + { + replaceOutput=TQString("\"")+replaceOutput+TQString("\""); + } + config->writeEntry("regexp_search", replaceInput); + config->writeEntry("regexp_replace", replaceOutput); + } + + TDEConfigDialogManager *widget; + for ( widget = encoderSettings.first(); widget; widget = encoderSettings.next() ){ + widget->updateSettings(); + } + + config->sync(); + + configChanged = false; + +} + +void KAudiocdModule::load() { + load( false ); +} + +void KAudiocdModule::load(bool useDefaults) { + + config->setReadDefaults( useDefaults ); + + { + TDEConfigGroupSaver saver(config, "CDDA"); + + + // Specify <=> not autosearch, as explained above in ::save() + cd_specify_device->setChecked( !(config->readBoolEntry("autosearch",true)) ); + cd_device_string->setText(config->readEntry("device","/dev/cdrom")); + ec_enable_check->setChecked(!(config->readBoolEntry("disable_paranoia",false))); + ec_skip_check->setChecked(!(config->readBoolEntry("never_skip",true))); + niceLevel->setValue(config->readNumEntry("niceLevel", 0)); + } + + { + TDEConfigGroupSaver saver(config, "FileName"); + fileNameLineEdit->setText(config->readEntry("file_name_template", "%{albumartist} - %{number} - %{title}")); + albumNameLineEdit->setText(config->readEntry("album_name_template", "%{albumartist} - %{albumtitle}")); + kcfg_replaceInput->setText(config->readEntry("regexp_search")); + kcfg_replaceOutput->setText(config->readEntry("regexp_replace")); + example->setText(config->readEntry("example", i18n("Cool artist - example audio file.wav"))); + } + + TDEConfigDialogManager *widget; + for ( widget = encoderSettings.first(); widget; widget = encoderSettings.next() ){ + widget->updateWidgets(); + } + + emit changed( useDefaults ); +} + +void KAudiocdModule::slotModuleChanged() { + TDEConfigDialogManager *widget; + for ( widget = encoderSettings.first(); widget; widget = encoderSettings.next() ){ + if(widget->hasChanged()){ + slotConfigChanged(); + break; + } + } +} + +void KAudiocdModule::slotConfigChanged() { + configChanged = true; + emit changed(true); +} + +/* +# slot for the error correction settings +*/ +void KAudiocdModule::slotEcEnable() { + if (!(ec_skip_check->isChecked())) { + ec_skip_check->setChecked(true); + } else { + if (ec_skip_check->isEnabled()) { + ec_skip_check->setChecked(false); + } + } + + slotConfigChanged(); +} + +TQString KAudiocdModule::quickHelp() const +{ + return i18n("

Audio CDs

The Audio CD IO-Slave enables you to easily" + " create wav, MP3 or Ogg Vorbis files from your audio CD-ROMs or DVDs." + " The slave is invoked by typing \"audiocd:/\" in Konqueror's location" + " bar. In this module, you can configure" + " encoding, and device settings. Note that MP3 and Ogg" + " Vorbis encoding are only available if TDE was built with a recent" + " version of the LAME or Ogg Vorbis libraries."); +} + +extern "C" +{ + TDECModule *create_audiocd(TQWidget *parent, const char */*name*/) + { + return new KAudiocdModule(parent, "kcmaudiocd"); + } + +} diff --git a/tdeioslave/audiocd/kcmaudiocd/kcmaudiocd.h b/tdeioslave/audiocd/kcmaudiocd/kcmaudiocd.h new file mode 100644 index 00000000..c9ec1bc7 --- /dev/null +++ b/tdeioslave/audiocd/kcmaudiocd/kcmaudiocd.h @@ -0,0 +1,66 @@ +/* + + Copyright (C) 2001 Carsten Duvenhorst + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Permission is also granted to link this program with the TQt + library, treating TQt like a library that normally accompanies the + operating system kernel, whether or not that is in fact the case. + +*/ + + +#ifndef KAUDIOCDCONFIG_H +#define KAUDIOCDCONFIG_H + +class TDEConfigDialogManager; + +#include "audiocdconfig.h" +class KAudiocdModule : public AudiocdConfig +{ + Q_OBJECT + + +public: + + KAudiocdModule(TQWidget *parent=0, const char *name=0); + ~KAudiocdModule(); + + TQString quickHelp() const; + +public slots: + void defaults(); + void save(); + void load(); + void load(bool useDefaults); + +private slots: + void updateExample(); + void slotConfigChanged(); + void slotEcEnable(); + void slotModuleChanged(); + +private: + TDEConfig *config; + bool configChanged; + + int getBitrateIndex(int value); + + TQPtrList encoderSettings; +}; + +#endif // KAUDIOCDCONFIG_H + -- cgit v1.2.1