1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
27 #include "rbsettings.h"
28 #include "encttssettings.h"
32 class EncBase
: public EncTtsSettingInterface
36 EncBase(QObject
*parent
);
38 //! Child class should encode a wav file
39 virtual bool encode(QString input
,QString output
) =0;
40 //! Child class should do startup
41 virtual bool start()=0;
42 //! Child class should stop
43 virtual bool stop()=0;
46 //! Child class should return true when configuration is ok
47 virtual bool configOk()=0;
48 //! Child class should fill in the setttingsList
49 virtual void generateSettings() = 0;
50 //! Chlid class should commit the from SettingsList to permanent storage
51 virtual void saveSettings() = 0;
54 static QString
getEncoderName(QString name
);
55 static EncBase
* getEncoder(QObject
* parent
,QString name
);
56 static QStringList
getEncoderList(void);
58 //set the config. users of Encoder classes, always have to call this first
59 void setCfg(RbSettings
*sett
){settings
= sett
;}
61 static void initEncodernamesList(void);
66 static QMap
<QString
,QString
> encoderList
;
70 class EncExes
: public EncBase
80 EncExes(QString name
,QObject
*parent
= NULL
);
81 bool encode(QString input
,QString output
);
83 bool stop() {return true;}
87 void generateSettings();
94 QMap
<QString
,QString
> m_TemplateMap
;
95 QString m_EncTemplate
;
98 class EncRbSpeex
: public EncBase
110 EncRbSpeex(QObject
*parent
= NULL
);
111 bool encode(QString input
,QString output
);
113 bool stop() {return true;}
117 void generateSettings();
126 float defaultQuality
;
128 int defaultComplexity
;