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 "encoderexe.h"
25 /*********************************************************************
27 **********************************************************************/
28 QMap
<QString
,QString
> EncoderBase::encoderList
;
30 EncoderBase::EncoderBase(QObject
*parent
): EncTtsSettingInterface(parent
)
35 // initialize list of encoders
36 void EncoderBase::initEncodernamesList()
38 encoderList
["rbspeex"] = "Rockbox Speex Encoder";
39 encoderList
["lame"] = "Lame Mp3 Encoder";
43 // get nice name for a specific encoder
44 QString
EncoderBase::getEncoderName(QString encoder
)
46 if(encoderList
.isEmpty())
47 initEncodernamesList();
48 return encoderList
.value(encoder
);
52 // get a specific encoder object
53 EncoderBase
* EncoderBase::getEncoder(QObject
* parent
,QString encoder
)
58 enc
= new EncoderExe(encoder
,parent
);
61 else // rbspeex is default
63 enc
= new EncoderRbSpeex(parent
);
69 QStringList
EncoderBase::getEncoderList()
71 if(encoderList
.isEmpty())
72 initEncodernamesList();
73 return encoderList
.keys();