1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
11 * All files in this archive are subject to the GNU General Public License.
12 * See the file COPYING in the source tree root for full license agreement.
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
17 ****************************************************************************/
19 #include "encoderbase.h"
21 #include "rbsettings.h"
22 #include "encoderrbspeex.h"
23 #include "encoderlame.h"
24 #include "encoderexe.h"
26 /*********************************************************************
28 **********************************************************************/
29 QMap
<QString
,QString
> EncoderBase::encoderList
;
31 EncoderBase::EncoderBase(QObject
*parent
): EncTtsSettingInterface(parent
)
36 // initialize list of encoders
37 void EncoderBase::initEncodernamesList()
39 encoderList
["rbspeex"] = "Rockbox Speex Encoder";
40 encoderList
["lame"] = "Lame Mp3 Encoder";
44 // get nice name for a specific encoder
45 QString
EncoderBase::getEncoderName(QString encoder
)
47 if(encoderList
.isEmpty())
48 initEncodernamesList();
49 return encoderList
.value(encoder
);
53 // get a specific encoder object
54 EncoderBase
* EncoderBase::getEncoder(QObject
* parent
,QString encoder
)
59 #if defined(Q_OS_MACX)
60 /* currently not on OS X */
61 enc
= new EncoderExe(encoder
,parent
);
63 enc
= new EncoderLame(parent
);
67 else // rbspeex is default
69 enc
= new EncoderRbSpeex(parent
);
75 QStringList
EncoderBase::getEncoderList()
77 if(encoderList
.isEmpty())
78 initEncodernamesList();
79 return encoderList
.keys();