1 
2 #ifndef CONVERSIONOPTIONS_H
3 #define CONVERSIONOPTIONS_H
4 
5 #include <kcoreaddons_export.h>
6 
7 #include <KGenericFactory>
8 
9 #include <QString>
10 #include <QDomElement>
11 
12 
13 /**
14  * @short The options for the filter process can be stored here
15  * @author Daniel Faust <hessijames@gmail.com>
16  * @version 1.0
17  */
18 
19 class KCOREADDONS_EXPORT FilterOptions
20 {
21 public:
22     FilterOptions();
23     virtual ~FilterOptions();
24 
25     bool equalsBasics( FilterOptions *_other );
26     virtual bool equals( FilterOptions *_other ); // checks if the other FilterOptions is equal to this
27 
28     virtual QDomElement toXml( QDomDocument document, const QString& elementName ) const;
29 
30     virtual bool fromXml( QDomElement filterOptions );
31 
32     virtual FilterOptions* copy() const;
33 
34     QString pluginName;             // an identificator to see which plugin created the FilterOptions
35                                     // NOTE this must be unique for each plugin!
36 
37     QString cmdArguments;           // user defined command line arguments
38 };
39 
40 
41 /**
42  * @short The options for the conversion process can be stored here
43  * @author Daniel Faust <hessijames@gmail.com>
44  * @version 1.0
45  */
46 class KCOREADDONS_EXPORT ConversionOptions
47 {
48 public:
49     ConversionOptions();
50     virtual ~ConversionOptions();
51 
52     bool equalsBasics( ConversionOptions *_other );
53     bool equalsFilters( ConversionOptions *_other );
54     virtual bool equals( ConversionOptions *_other ); // checks if the other ConversionOptions is equal to this
55 
56     virtual QDomElement toXml( QDomDocument document ) const;
57 
58     virtual bool fromXml( QDomElement conversionOptions, QList<QDomElement> *filterOptionsElements = 0 );
59 
60     virtual ConversionOptions* copy() const;
61 
62     QString pluginName;             // an identificator to see which plugin created the ConversionOptions
63                                     // NOTE this must be unique for each plugin!
64 
65     // plugin must ensure that these values are set, so an alternative plugin can be used
66     enum QualityMode { Quality = 0, Bitrate = 1, Lossless = 2 } qualityMode;
67     double quality;                 // plugin specific quaily value
68     int bitrate;                    // set in order to fall back if the other plugin does not support the quality mode [kbit/s]
69     enum BitrateMode { Vbr = 0, Abr = 1, Cbr = 2 } bitrateMode;
70 
71     QString cmdArguments;           // user defined command line arguments
72 
73     // plugin specific, may not be used by alternative plugins
74     double compressionLevel;        // how hard should the encoder try
75 
76     // these values are set by OptionsDetailed::currentConversionOptions
77     QString profile;                // the precalculated profile for the simple tab
78     QString codecName;              // the output format (was outputFormat)
79 
80     int outputDirectoryMode;
81     QString outputDirectory;
82     QString outputFilesystem;       // the filesystem of the output directory
83 
84     bool replaygain;
85 
86     QList<FilterOptions*> filterOptions;
87 };
88 
89 #endif // CONVERSIONOPTIONS_H
90