Fix no-backlight colours for H100 series and M3.
[kugel-rb.git] / rbutil / rbutilqt / encoders.h
blob8a1805545fbfee95e5635dd056813b957fdb1558
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id$
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 ****************************************************************************/
22 #ifndef ENCODERS_H
23 #define ENCODERS_H
25 #include <QtCore>
27 #include "rbsettings.h"
29 #include "rbspeex.h"
32 class EncBase : public QObject
34 Q_OBJECT
35 public:
36 EncBase(QObject *parent );
38 virtual bool encode(QString input,QString output)
39 {(void)input; (void)output; return false;}
40 virtual bool start(){return false;}
41 virtual bool stop(){return false;}
42 virtual void showCfg(){}
43 virtual bool configOk(){return false;}
45 void setCfg(RbSettings *sett){settings = sett;}
46 static QString getEncoderName(QString);
47 static EncBase* getEncoder(QString);
48 static QStringList getEncoderList(void);
50 public slots:
51 virtual void accept(void){}
52 virtual void reject(void){}
53 virtual void reset(void){}
54 private:
55 static void initEncodernamesList(void);
57 protected:
58 RbSettings* settings;
60 static QMap<QString,QString> encoderList;
61 static QMap<QString,EncBase*> encoderCache;
66 class EncExes : public EncBase
68 Q_OBJECT
69 public:
70 EncExes(QString name,QObject *parent = NULL);
71 virtual bool encode(QString input,QString output);
72 virtual bool start();
73 virtual bool stop() {return true;}
74 virtual void showCfg();
75 virtual bool configOk();
77 private:
78 QString m_name;
79 QString m_EncExec;
80 QString m_EncOpts;
81 QMap<QString,QString> m_TemplateMap;
82 QString m_EncTemplate;
85 class EncRbSpeex : public EncBase
87 Q_OBJECT
88 public:
89 EncRbSpeex(QObject *parent = NULL);
90 virtual bool encode(QString input,QString output);
91 virtual bool start();
92 virtual bool stop() {return true;}
93 virtual void showCfg();
94 virtual bool configOk();
96 private:
97 float quality;
98 float volume;
99 int complexity;
100 bool narrowband;
102 float defaultQuality;
103 float defaultVolume;
104 int defaultComplexity;
105 bool defaultBand;
109 #endif