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/plugins/lame/Makefile.am | 18 + .../audiocd/plugins/lame/audiocd_lame_encoder.kcfg | 138 +++ .../plugins/lame/audiocd_lame_encoder.kcfgc | 4 + .../audiocd/plugins/lame/collectingprocess.cpp | 134 +++ .../audiocd/plugins/lame/collectingprocess.h | 73 ++ tdeioslave/audiocd/plugins/lame/encoderlame.cpp | 366 ++++++++ tdeioslave/audiocd/plugins/lame/encoderlame.h | 68 ++ .../audiocd/plugins/lame/encoderlameconfig.ui | 930 +++++++++++++++++++++ 8 files changed, 1731 insertions(+) create mode 100644 tdeioslave/audiocd/plugins/lame/Makefile.am create mode 100644 tdeioslave/audiocd/plugins/lame/audiocd_lame_encoder.kcfg create mode 100644 tdeioslave/audiocd/plugins/lame/audiocd_lame_encoder.kcfgc create mode 100644 tdeioslave/audiocd/plugins/lame/collectingprocess.cpp create mode 100644 tdeioslave/audiocd/plugins/lame/collectingprocess.h create mode 100644 tdeioslave/audiocd/plugins/lame/encoderlame.cpp create mode 100644 tdeioslave/audiocd/plugins/lame/encoderlame.h create mode 100644 tdeioslave/audiocd/plugins/lame/encoderlameconfig.ui (limited to 'tdeioslave/audiocd/plugins/lame') diff --git a/tdeioslave/audiocd/plugins/lame/Makefile.am b/tdeioslave/audiocd/plugins/lame/Makefile.am new file mode 100644 index 00000000..49ddddd9 --- /dev/null +++ b/tdeioslave/audiocd/plugins/lame/Makefile.am @@ -0,0 +1,18 @@ +INCLUDES = -I$(top_srcdir)/libkcddb -I$(srcdir)/.. $(taglib_includes) $(all_includes) + +kde_kcfg_DATA = audiocd_lame_encoder.kcfg + +kde_module_LTLIBRARIES = libaudiocd_encoder_lame.la + +libaudiocd_encoder_lame_la_SOURCES = audiocd_lame_encoder.kcfgc encoderlame.cpp encoderlameconfig.ui collectingprocess.cpp + +libaudiocd_encoder_lame_la_LIBADD = $(LIB_KIO) ../libaudiocdplugins.la + +libaudiocd_encoder_lame_la_LDFLAGS = -avoid-version -module -no-undefined $(taglib_libs) $(all_libraries) + +pluginsdir = $(kde_datadir)/audiocd/plugins + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/audiocd_encoder_lame.pot diff --git a/tdeioslave/audiocd/plugins/lame/audiocd_lame_encoder.kcfg b/tdeioslave/audiocd/plugins/lame/audiocd_lame_encoder.kcfg new file mode 100644 index 00000000..c752fd81 --- /dev/null +++ b/tdeioslave/audiocd/plugins/lame/audiocd_lame_encoder.kcfg @@ -0,0 +1,138 @@ + + + + + + + + + false + + + + true + + + + + 0 + + + + -2 + + + + + + false + + + + true + + + + false + + + + false + + + + true + + + + + + 10 + 0 + 13 + + + + + + false + + + + false + + + + false + + + + false + + + + true + + + + + 40 + 0 + 13 + + + + 13 + 0 + 13 + + + + 10 + 0 + 13 + + + + + + + false + + + + 18000 + + + + + false + + + + 0 + + + + + false + + + + 900 + + + + + false + + + + 0 + + + + diff --git a/tdeioslave/audiocd/plugins/lame/audiocd_lame_encoder.kcfgc b/tdeioslave/audiocd/plugins/lame/audiocd_lame_encoder.kcfgc new file mode 100644 index 00000000..b62f454d --- /dev/null +++ b/tdeioslave/audiocd/plugins/lame/audiocd_lame_encoder.kcfgc @@ -0,0 +1,4 @@ +# Code generation options for tdeconfig_compiler +File=audiocd_lame_encoder.kcfg +ClassName=Settings +Singleton=true diff --git a/tdeioslave/audiocd/plugins/lame/collectingprocess.cpp b/tdeioslave/audiocd/plugins/lame/collectingprocess.cpp new file mode 100644 index 00000000..4eaf5304 --- /dev/null +++ b/tdeioslave/audiocd/plugins/lame/collectingprocess.cpp @@ -0,0 +1,134 @@ +/* + collectingprocess.cpp + + This file is part of libtdepim. + Copyright (c) 2004 Ingo Kloecker + + This library 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 library 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 + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the TQt library by Trolltech AS, Norway (or with modified versions + of TQt that use the same license as TQt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + TQt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#include "collectingprocess.h" + +#include + +#include + +struct CollectingProcess::Private { + Private() : stdoutSize( 0 ), stderrSize( 0 ) + {} + + uint stdoutSize; + TQValueList stdoutBuffer; + uint stderrSize; + TQValueList stderrBuffer; +}; + + +CollectingProcess::CollectingProcess( TQObject * parent, const char * name ) + : TDEProcess( parent, name ) +{ + d = new Private(); +} + +CollectingProcess::~CollectingProcess() { + delete d; d = 0; +} + +bool CollectingProcess::start( RunMode runmode, Communication comm ) { + // prevent duplicate connection + disconnect( this, TQT_SIGNAL( receivedStdout( TDEProcess *, char *, int ) ), + this, TQT_SLOT( slotReceivedStdout( TDEProcess *, char *, int ) ) ); + if ( comm & Stdout ) { + connect( this, TQT_SIGNAL( receivedStdout( TDEProcess *, char *, int ) ), + this, TQT_SLOT( slotReceivedStdout( TDEProcess *, char *, int ) ) ); + } + // prevent duplicate connection + disconnect( this, TQT_SIGNAL( receivedStderr( TDEProcess *, char *, int ) ), + this, TQT_SLOT( slotReceivedStderr( TDEProcess *, char *, int ) ) ); + if ( comm & Stderr ) { + connect( this, TQT_SIGNAL( receivedStderr( TDEProcess *, char *, int ) ), + this, TQT_SLOT( slotReceivedStderr( TDEProcess *, char *, int ) ) ); + } + return TDEProcess::start( runmode, comm ); +} + +void CollectingProcess::slotReceivedStdout( TDEProcess *, char *buf, int len ) +{ + TQByteArray b; + b.duplicate( buf, len ); + d->stdoutBuffer.append( b ); + d->stdoutSize += len; +} + +void CollectingProcess::slotReceivedStderr( TDEProcess *, char *buf, int len ) +{ + TQByteArray b; + b.duplicate( buf, len ); + d->stderrBuffer.append( b ); + d->stderrSize += len; +} + +TQByteArray CollectingProcess::collectedStdout() +{ + if ( d->stdoutSize == 0 ) { + return TQByteArray(); + } + + uint offset = 0; + TQByteArray b( d->stdoutSize ); + for ( TQValueList::const_iterator it = d->stdoutBuffer.begin(); + it != d->stdoutBuffer.end(); + ++it ) { + memcpy( b.data() + offset, (*it).data(), (*it).size() ); + offset += (*it).size(); + } + d->stdoutBuffer.clear(); + d->stdoutSize = 0; + + return b; +} + +TQByteArray CollectingProcess::collectedStderr() +{ + if ( d->stderrSize == 0 ) { + return TQByteArray(); + } + + uint offset = 0; + TQByteArray b( d->stderrSize ); + for ( TQValueList::const_iterator it = d->stderrBuffer.begin(); + it != d->stderrBuffer.end(); + ++it ) { + memcpy( b.data() + offset, (*it).data(), (*it).size() ); + offset += (*it).size(); + } + d->stderrBuffer.clear(); + d->stderrSize = 0; + + return b; +} + +#include "collectingprocess.moc" diff --git a/tdeioslave/audiocd/plugins/lame/collectingprocess.h b/tdeioslave/audiocd/plugins/lame/collectingprocess.h new file mode 100644 index 00000000..df5c180d --- /dev/null +++ b/tdeioslave/audiocd/plugins/lame/collectingprocess.h @@ -0,0 +1,73 @@ +/* -*- mode: C++ -*- + collectingprocess.h + + This file is a copy of the collectingprocess.h which is part of tdepim/libtdepim. + Copyright (c) 2004 Ingo Kloecker + + This library 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 library 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 + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the TQt library by Trolltech AS, Norway (or with modified versions + of TQt that use the same license as TQt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + TQt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __COLLECTINGPROCESS_H__ +#define __COLLECTINGPROCESS_H__ + +#include + +/** + * @short An output collecting TDEProcess class. + * + * This class simplifies the usage of TDEProcess by collecting all output + * (stdout/stderr) of the process. + * + * @author Ingo Kloecker + */ +class CollectingProcess : public TDEProcess { + Q_OBJECT + +public: + CollectingProcess( TQObject * parent = 0, const char * name = 0 ); + ~CollectingProcess(); + + /** Starts the process in NotifyOnExit mode and writes in to stdin of + the process. + */ + bool start( RunMode runmode, Communication comm ); + + /** Returns the contents of the stdout buffer and clears it afterwards. */ + TQByteArray collectedStdout(); + /** Returns the contents of the stderr buffer and clears it afterwards. */ + TQByteArray collectedStderr(); + +private slots: + void slotReceivedStdout( TDEProcess *, char *, int ); + void slotReceivedStderr( TDEProcess *, char *, int ); + +private: + class Private; + Private * d; +protected: +}; + +#endif // __COLLECTINGPROCESS_H__ diff --git a/tdeioslave/audiocd/plugins/lame/encoderlame.cpp b/tdeioslave/audiocd/plugins/lame/encoderlame.cpp new file mode 100644 index 00000000..8984bb33 --- /dev/null +++ b/tdeioslave/audiocd/plugins/lame/encoderlame.cpp @@ -0,0 +1,366 @@ +/* + Copyright (C) 2005 Benjamin Meyer + + 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 "encoderlame.h" +#include "encoderlameconfig.h" +#include "audiocd_lame_encoder.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include "collectingprocess.h" + +extern "C" +{ + KDE_EXPORT void create_audiocd_encoders(TDEIO::SlaveBase *slave, TQPtrList &encoders) { + encoders.append(new EncoderLame(slave)); + } +} + +static int bitrates[] = { 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 }; + +class EncoderLame::Private +{ +public: + int bitrate; + bool waitingForWrite; + bool processHasExited; + TQString lastErrorMessage; + TQStringList genreList; + uint lastSize; + TDEProcess *currentEncodeProcess; + KTempFile *tempFile; +}; + +EncoderLame::EncoderLame(TDEIO::SlaveBase *slave) : TQObject(), AudioCDEncoder(slave) { + d = new Private(); + d->waitingForWrite = false; + d->processHasExited = false; + d->lastSize = 0; + loadSettings(); +} + +EncoderLame::~EncoderLame(){ + delete d; +} + +TQWidget* EncoderLame::getConfigureWidget(TDEConfigSkeleton** manager) const { + (*manager) = Settings::self(); + TDEGlobal::locale()->insertCatalogue("audiocd_encoder_lame"); + EncoderLameConfig *config = new EncoderLameConfig(); + config->cbr_settings->hide(); + return config; +} + +bool EncoderLame::init(){ + // Determine if lame is installed on the system or not. + if ( KStandardDirs::findExe( "lame" ).isEmpty() ) + return false; + + // Ask lame for the list of genres it knows; otherwise it barfs when doing + // e.g. lame --tg 'Vocal Jazz' + CollectingProcess proc; + proc << "lame" << "--genre-list"; + proc.start(TDEProcess::Block, TDEProcess::Stdout); + + if(proc.exitStatus() != 0) + return false; + + const TQByteArray data = proc.collectedStdout(); + TQString str; + if ( !data.isEmpty() ) + str = TQString::fromLocal8Bit( data, data.size() ); + + d->genreList = TQStringList::split( '\n', str ); + // Remove the numbers in front of every genre + for( TQStringList::Iterator it = d->genreList.begin(); it != d->genreList.end(); ++it ) { + TQString& genre = *it; + uint i = 0; + while ( i < genre.length() && ( genre[i].isSpace() || genre[i].isDigit() ) ) + ++i; + genre = genre.mid( i ); + + } + //kdDebug(7117) << "Available genres:" << d->genreList << endl; + + return true; +} + +void EncoderLame::loadSettings(){ + // Generate the command line arguments for the current settings + args.clear(); + + Settings *settings = Settings::self(); + + int quality = settings->quality(); + if (quality < 0 ) quality = quality *-1; + if (quality > 9) quality = 9; + + int method = settings->bitrate_constant() ? 0 : 1 ; + + if (method == 0) { + // Constant Bitrate Encoding + args.append("-b"); + args.append(TQString("%1").arg(bitrates[settings->cbr_bitrate()])); + d->bitrate = bitrates[settings->cbr_bitrate()]; + args.append("-q"); + args.append(TQString("%1").arg(quality)); + } + else { + // Variable Bitrate Encoding + if (settings->vbr_average_br()) { + args.append("--abr"); + args.append(TQString("%1").arg(bitrates[settings->vbr_mean_brate()])); + d->bitrate = bitrates[settings->vbr_mean_brate()]; + if (settings->vbr_min_br()){ + args.append("-b"); + args.append(TQString("%1").arg(bitrates[settings->vbr_min_brate()])); + } + if (settings->vbr_min_hard()) + args.append("-F"); + if (settings->vbr_max_br()){ + args.append("-B"); + args.append(TQString("%1").arg(bitrates[settings->vbr_max_brate()])); + } + } else { + d->bitrate = 128; + args.append("-V"); + args.append(TQString("%1").arg(quality)); + } + if ( !settings->vbr_xing_tag() ) + args.append("-t"); + } + + args.append("-m"); + switch ( settings->stereo() ) { + case 0: + args.append("s"); + break; + case 1: + args.append("j"); + break; + case 2: + args.append("d"); + break; + case 3: + args.append("m"); + break; + default: + args.append("s"); + break; + } + + if(settings->copyright()) + args.append("-c"); + if(!settings->original()) + args.append("-o"); + if(settings->iso()) + args.append("--strictly-enforce-ISO"); + if(settings->crc()) + args.append("-p"); + + if ( settings->enable_lowpass() ) { + args.append("--lowpass"); + args.append(TQString("%1").arg(settings->lowfilterfreq())); + + if (settings->set_lpf_width()){ + args.append("--lowpass-width"); + args.append(TQString("%1").arg(settings->lowfilterwidth())); + } + } + + if ( settings->enable_highpass()) { + args.append("--hipass"); + args.append(TQString("%1").arg(settings->highfilterfreq())); + + if (settings->set_hpf_width()){ + args.append("--hipass-width"); + args.append(TQString("%1").arg(settings->highfilterwidth())); + } + } +} + +unsigned long EncoderLame::size(long time_secs) const { + return (time_secs * d->bitrate * 1000)/8; +} + +long EncoderLame::readInit(long /*size*/){ + // Create TDEProcess + d->currentEncodeProcess = new TDEProcess(0); + TQString prefix = locateLocal("tmp", ""); + d->tempFile = new KTempFile(prefix, ".mp3"); + d->tempFile->setAutoDelete(true); + d->lastErrorMessage = TQString(); + d->processHasExited = false; + + // -x bitswap + // -r raw/pcm + // -s 44.1 (because it is raw you have to specify this) +// #if __BYTE_ORDER == __LITTLE_ENDIAN +// *(d->currentEncodeProcess) << "lame" << "--verbose" << "-x" << "-r" << "-s" << "44.1"; +// #else + *(d->currentEncodeProcess) << "lame" << "--verbose" << "-r" << "-s" << "44.1"; +// #endif + + *(d->currentEncodeProcess) << args; + if(Settings::self()->id3_tag()) + *d->currentEncodeProcess << trackInfo; + + // Read in stdin, output to the temp file + *d->currentEncodeProcess << "-" << d->tempFile->name().latin1(); + + //kdDebug(7117) << d->currentEncodeProcess->args() << endl; + + + connect(d->currentEncodeProcess, TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int)), + this, TQT_SLOT(receivedStdout(TDEProcess *, char *, int))); + connect(d->currentEncodeProcess, TQT_SIGNAL(receivedStderr(TDEProcess *, char *, int)), + this, TQT_SLOT(receivedStderr(TDEProcess *, char *, int))); + connect(d->currentEncodeProcess, TQT_SIGNAL(wroteStdin(TDEProcess *)), + this, TQT_SLOT(wroteStdin(TDEProcess *))); + + connect(d->currentEncodeProcess, TQT_SIGNAL(processExited(TDEProcess *)), + this, TQT_SLOT(processExited(TDEProcess *))); + + // Launch! + d->currentEncodeProcess->start(TDEProcess::NotifyOnExit, KShellProcess::All); + return 0; +} + +void EncoderLame::processExited ( TDEProcess *process ){ + kdDebug(7117) << "Lame Encoding process exited with: " << process->exitStatus() << endl; + d->processHasExited = true; +} + +void EncoderLame::receivedStderr( TDEProcess * /*process*/, char *buffer, int /*buflen*/ ){ + kdDebug(7117) << "Lame stderr: " << buffer << endl; + if ( !d->lastErrorMessage.isEmpty() ) + d->lastErrorMessage += '\t'; + d->lastErrorMessage += TQString::fromLocal8Bit( buffer ); +} + +void EncoderLame::receivedStdout( TDEProcess * /*process*/, char *buffer, int /*length*/ ){ + kdDebug(7117) << "Lame stdout: " << buffer << endl; +} + +void EncoderLame::wroteStdin( TDEProcess * /*procces*/ ){ + d->waitingForWrite = false; +} + +long EncoderLame::read(int16_t *buf, int frames){ + if(!d->currentEncodeProcess) + return 0; + if (d->processHasExited) + return -1; + + // Pipe the raw data to lame + char * cbuf = reinterpret_cast(buf); + d->currentEncodeProcess->writeStdin( cbuf, frames*4); + + // We can't return until the buffer has been written + d->waitingForWrite = true; + while(d->waitingForWrite && d->currentEncodeProcess->isRunning()){ + kapp->processEvents(); + usleep(1); + } + + // Determine the file size increase + TQFileInfo file(d->tempFile->name()); + uint change = file.size() - d->lastSize; + d->lastSize = file.size(); + return change; +} + +long EncoderLame::readCleanup(){ + if(!d->currentEncodeProcess) + return 0; + + // Let lame tag the first frame of the mp3 + d->currentEncodeProcess->closeStdin(); + while( d->currentEncodeProcess->isRunning()){ + kapp->processEvents(); + usleep(1); + } + + // Now copy the file out of the temp into kio + TQFile file( d->tempFile->name() ); + if ( file.open( IO_ReadOnly ) ) { + TQByteArray output; + char data[1024]; + while ( !file.atEnd() ) { + uint read = file.readBlock(data, 1024); + output.setRawData(data, read); + ioslave->data(output); + output.resetRawData(data, read); + } + file.close(); + } + + // cleanup the process and temp + delete d->currentEncodeProcess; + delete d->tempFile; + d->lastSize = 0; + + return 0; +} + +void EncoderLame::fillSongInfo( KCDDB::CDInfo info, int track, const TQString &comment ){ + trackInfo.clear(); + trackInfo.append("--tt"); + trackInfo.append(info.trackInfoList[track].get("title").toString()); + + trackInfo.append("--ta"); + trackInfo.append(info.get("artist").toString()); + + trackInfo.append("--tl"); + trackInfo.append(info.get("title").toString()); + + trackInfo.append("--ty"); + trackInfo.append(TQString("%1").arg(info.get("year").toString())); + + trackInfo.append("--tc"); + trackInfo.append(comment); + + trackInfo.append("--tn"); + trackInfo.append(TQString("%1").arg(track+1)); + + const TQString genre = info.get( "genre" ).toString(); + if ( d->genreList.find( genre ) != d->genreList.end() ) + { + trackInfo.append("--tg"); + trackInfo.append(genre); + } +} + + +TQString EncoderLame::lastErrorMessage() const +{ + return d->lastErrorMessage; +} + +#include "encoderlame.moc" diff --git a/tdeioslave/audiocd/plugins/lame/encoderlame.h b/tdeioslave/audiocd/plugins/lame/encoderlame.h new file mode 100644 index 00000000..09c323c3 --- /dev/null +++ b/tdeioslave/audiocd/plugins/lame/encoderlame.h @@ -0,0 +1,68 @@ +/* + Copyright (C) 2005 Benjamin Meyer + + 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. +*/ + +#ifndef ENCODER_LAME_H +#define ENCODER_LAME_H + +#include "audiocdencoder.h" + +class TDEProcess; + +/** + * MP3 encoder using the LAME encoder. + * Go to http://lame.sourceforge.net/ for lots of information. + */ +class EncoderLame : public TQObject, public AudioCDEncoder { + +Q_OBJECT + + +public: + EncoderLame(TDEIO::SlaveBase *slave); + ~EncoderLame(); + + virtual TQString type() const { return "MP3"; }; + virtual bool init(); + virtual void loadSettings(); + virtual unsigned long size(long time_secs) const; + virtual const char * fileType() const { return "mp3"; }; + virtual const char * mimeType() const { return "audio/x-mp3"; }; + virtual void fillSongInfo( KCDDB::CDInfo info, int track, const TQString &comment ); + virtual long readInit(long size); + virtual long read(int16_t * buf, int frames); + virtual long readCleanup(); + virtual TQString lastErrorMessage() const; + + virtual TQWidget* getConfigureWidget(TDEConfigSkeleton** manager) const; + +protected slots: + void wroteStdin(TDEProcess *proc); + void receivedStdout(TDEProcess *, char *buffer, int length); + void receivedStderr(TDEProcess *proc, char *buffer, int buflen); + void processExited(TDEProcess *proc); + +private: + class Private; + Private * d; + + TQStringList args; + TQStringList trackInfo; +}; + +#endif // ENCODER_LAME_H + diff --git a/tdeioslave/audiocd/plugins/lame/encoderlameconfig.ui b/tdeioslave/audiocd/plugins/lame/encoderlameconfig.ui new file mode 100644 index 00000000..f8149741 --- /dev/null +++ b/tdeioslave/audiocd/plugins/lame/encoderlameconfig.ui @@ -0,0 +1,930 @@ + +EncoderLameConfig + + + LameConfig + + + + 0 + 0 + 471 + 598 + + + + + unnamed + + + + GroupBox1_2 + + + Options + + + + unnamed + + + 11 + + + 6 + + + + kcfg_copyright + + + Cop&yrighted + + + Mark MP3 file as copyrighted + + + Mark MP3 file as copyrighted. + + + + + kcfg_original + + + Origi&nal + + + true + + + Mark MP3 file as an original + + + Mark MP3 file as an original. + + + + + kcfg_iso + + + &ISO encoding + + + Try to use strict ISO encoding + + + This selects the maximal bitrate used for encoding. + + + + + kcfg_crc + + + &Error protection + + + + + kcfg_id3_tag + + + &Write ID3 tag + + + true + + + If checked and if cddb support is available, an id3 tag will be appended + + + If checked and if cddb support is available, an id3 tag will be appended + + + + + + + buttonGroup1 + + + Encoding Method + + + + unnamed + + + + Layout21 + + + + unnamed + + + 0 + + + 6 + + + + TextLabel3_2 + + + Low + + + + + kcfg_quality + + + -9 + + + 0 + + + 1 + + + -7 + + + Horizontal + + + NoMarks + + + + + TextLabel2_2 + + + High + + + + + + + TextLabel1_2 + + + &Quality: + + + AlignLeft + + + kcfg_quality + + + + + + Stereo + + + + + Joint Stereo + + + + + Dual Channel + + + + + Mono + + + + kcfg_stereo + + + This option controls whether MP3 files are recorded with one or two channels. Note that choosing <i>"Mono"</i> reduces file size, but also kills the stereo signal. + + + + + kcfg_bitrate_constant + + + Constant bitrate + + + + + kcfg_bitrate_variable + + + Variable bitrate + + + true + + + + + + + spacer11 + + + Vertical + + + Expanding + + + + 20 + 16 + + + + + + vbr_settings + + + true + + + Variable Bitrate Settings + + + + unnamed + + + 11 + + + 6 + + + + kcfg_vbr_average_br + + + Specify avera&ge bitrate: + + + This selects the maximal bitrate used for encoding. + + + + + + 32 kbs + + + + + 40 kbs + + + + + 48 kbs + + + + + 56 kbs + + + + + 64 kbs + + + + + 80 kbs + + + + + 96 kbs + + + + + 112 kbs + + + + + 128 kbs + + + + + 160 kbs + + + + + 192 kbs + + + + + 224 kbs + + + + + 256 kbs + + + + + 320 kbs + + + + kcfg_vbr_max_brate + + + false + + + 13 + + + + + kcfg_vbr_max_br + + + false + + + Maximal bi&trate: + + + This selects the maximal bitrate used for encoding. + + + + + kcfg_vbr_xing_tag + + + Write &Xing VBR tag + + + true + + + This writes additional information related to VBR as introduced by Xing. + + + + + + 32 kbs + + + + + 40 kbs + + + + + 48 kbs + + + + + 56 kbs + + + + + 64 kbs + + + + + 80 kbs + + + + + 96 kbs + + + + + 112 kbs + + + + + 128 kbs + + + + + 160 kbs + + + + + 192 kbs + + + + + 224 kbs + + + + + 256 kbs + + + + + 320 kbs + + + + kcfg_vbr_mean_brate + + + false + + + 9 + + + + + kcfg_vbr_min_hard + + + false + + + Minimal &value is a hard limit + + + + + kcfg_vbr_min_br + + + false + + + Minimal &bitrate: + + + This selects the minimal bitrate used for encoding. + + + + + + 32 kbs + + + + + 40 kbs + + + + + 48 kbs + + + + + 56 kbs + + + + + 64 kbs + + + + + 80 kbs + + + + + 96 kbs + + + + + 112 kbs + + + + + 128 kbs + + + + + 160 kbs + + + + + 192 kbs + + + + + 224 kbs + + + + + 256 kbs + + + + + 320 kbs + + + + kcfg_vbr_min_brate + + + false + + + 1 + + + + + + + cbr_settings + + + Constant Bitrate Settings + + + + unnamed + + + 11 + + + 6 + + + + TextLabel4_2 + + + Bitrate: + + + kcfg_cbr_bitrate + + + + + + 32 kbs + + + + + 40 kbs + + + + + 48 kbs + + + + + 56 kbs + + + + + 64 kbs + + + + + 80 kbs + + + + + 96 kbs + + + + + 112 kbs + + + + + 128 kbs + + + + + 160 kbs + + + + + 192 kbs + + + + + 224 kbs + + + + + 256 kbs + + + + + 320 kbs + + + + kcfg_cbr_bitrate + + + 9 + + + The higher the bitrate, the better the quality and the larger the file. + + + + + + + GroupBox83_2 + + + Filter Settings + + + AlignVCenter|AlignLeft + + + + + + + + unnamed + + + 11 + + + 6 + + + + kcfg_enable_lowpass + + + &Lowpass filter cutoff above + + + + + kcfg_lowfilterfreq + + + false + + + Hz + + + 20000 + + + + + kcfg_enable_highpass + + + &Highpass filter cutoff below + + + + + kcfg_highfilterfreq + + + false + + + Hz + + + 200 + + + + + kcfg_set_lpf_width + + + false + + + Low&pass filter width + + + + + kcfg_lowfilterwidth + + + false + + + Hz + + + 5000 + + + + + kcfg_set_hpf_width + + + false + + + Highpa&ss filter width + + + + + kcfg_highfilterwidth + + + false + + + Hz + + + 50 + + + + + + + + + kcfg_bitrate_constant + toggled(bool) + cbr_settings + setShown(bool) + + + kcfg_enable_highpass + toggled(bool) + kcfg_highfilterfreq + setEnabled(bool) + + + kcfg_enable_highpass + toggled(bool) + kcfg_highfilterwidth + setEnabled(bool) + + + kcfg_enable_lowpass + toggled(bool) + kcfg_lowfilterfreq + setEnabled(bool) + + + kcfg_enable_lowpass + toggled(bool) + kcfg_lowfilterwidth + setEnabled(bool) + + + kcfg_enable_highpass + toggled(bool) + kcfg_set_hpf_width + setEnabled(bool) + + + kcfg_enable_lowpass + toggled(bool) + kcfg_set_lpf_width + setEnabled(bool) + + + kcfg_vbr_average_br + toggled(bool) + kcfg_vbr_max_br + setEnabled(bool) + + + kcfg_vbr_max_br + toggled(bool) + kcfg_vbr_max_brate + setEnabled(bool) + + + kcfg_vbr_average_br + toggled(bool) + kcfg_vbr_mean_brate + setEnabled(bool) + + + kcfg_vbr_average_br + toggled(bool) + kcfg_vbr_min_br + setEnabled(bool) + + + kcfg_vbr_min_br + toggled(bool) + kcfg_vbr_min_brate + setEnabled(bool) + + + kcfg_vbr_min_br + toggled(bool) + kcfg_vbr_min_hard + setEnabled(bool) + + + kcfg_bitrate_variable + toggled(bool) + vbr_settings + setShown(bool) + + + + kcfg_bitrate_variable + kcfg_stereo + kcfg_quality + kcfg_copyright + kcfg_original + kcfg_iso + kcfg_crc + kcfg_id3_tag + kcfg_cbr_bitrate + kcfg_vbr_min_br + kcfg_vbr_min_hard + kcfg_vbr_max_br + kcfg_vbr_average_br + kcfg_vbr_xing_tag + kcfg_vbr_min_brate + kcfg_vbr_max_brate + kcfg_vbr_mean_brate + kcfg_enable_lowpass + kcfg_lowfilterfreq + kcfg_enable_highpass + kcfg_highfilterfreq + kcfg_set_lpf_width + kcfg_lowfilterwidth + kcfg_set_hpf_width + kcfg_highfilterwidth + + + -- cgit v1.2.1