summaryrefslogtreecommitdiffstats
path: root/src/pluginloader/convertpluginloader.h
blob: 52c23740ec3db7ed97efcdbe2f153a55b3ff502d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191


#ifndef CONVERTPLUGINLOADER_H
#define CONVERTPLUGINLOADER_H

#include "pluginloaderbase.h"


/**
 * @short The complete data, how to use the backend
 * @author Daniel Faust <hessijames@gmail.com>
 * @version 0.3
 */
class ConvertPlugin
{
public:
    /**
     * Constructor
     */
    ConvertPlugin();

    /**
     * Destructor
     */
    virtual ~ConvertPlugin();

    TQString filePathName; // the file name of th plugin (needed to detect write permissions)

    struct Info
    {
        int version;    // the version of our plugin (v0.2.1 = 201, v11.3 = 110300)
        TQString name;   // the name of our plugin
        TQString author; // the author of the plugin
        TQString about;  // a short information aboue the plugin
    } info;

    struct Enc
    {
        bool enabled;
        int rank;
        TQString bin;
        TQString param;
        TQString silent_param;
        TQStringList mime_types;
        TQString in_out_files;
        TQString overwrite;

        struct Strength {
            bool enabled;
            TQString param;
            float range_min;
            float range_max;
            float step;
            TQChar separator;
            TQStringList profiles;
            float default_value;
        } strength;

        struct Lossy {
            bool enabled;

            struct Quality {
                bool enabled;
                TQString param;
                float range_min;
                float range_max;
                float step;
                TQChar separator;
                TQString help;
                TQString output;
                TQStringList profiles; // NOTE when using profiles, step must be 1 and range_min 0
            } quality;

            struct Bitrate {
                struct Abr
                {
                    bool enabled;
                    TQString param;
                    TQString output;

                    struct BitrateRange {
                        bool enabled;
                        TQString param_min;
                        TQString param_max;
                    } bitrate_range;

                } abr;

                struct Cbr {
                    bool enabled;
                    TQString param;
                    TQString output;
                } cbr;

            } bitrate;

            struct Samplingrate {
                bool enabled;
                TQString param;
                PluginLoaderBase::Unit unit;
            } samplingrate;

            struct Channels {
                bool stereo_enabled;
                TQString stereo_param;
                bool joint_stereo_enabled;
                TQString joint_stereo_param;
                bool forced_joint_stereo_enabled;
                TQString forced_joint_stereo_param;
                bool dual_channels_enabled;
                TQString dual_channels_param;
                bool mono_enabled;
                TQString mono_param;
            } channels;
        } lossy;

        struct Lossless {
            bool enabled;
            TQString param;
            TQString output;
        } lossless;

        struct Hybrid {
            bool enabled;
            TQString param;
            TQString output;
            TQString correction_file_mime_type;
        } hybrid;

        struct ReplayGain {
            bool enabled;
            TQString use;
            TQString avoid;
            int rank;
        } replaygain;

        struct Tag {
            bool enabled;
            TQString param;
            TQString artist;
            TQString composer;
            TQString album;
            TQString disc;
            TQString title;
            TQString genre;
            TQString comment;
            TQString track;
            TQString year;
        } tag;
    } enc;

    struct Dec {
        bool enabled;
        int rank;
        TQString bin;
        TQString param;
        TQString silent_param;
        TQStringList mime_types;
        TQString output;
        TQString in_out_files;
        TQString overwrite;
    } dec;
};

/**
 * @short The plugin loader for the converter plugins
 * @author Daniel Faust <hessijames@gmail.com>
 * @version 0.3
 */
class ConvertPluginLoader : public PluginLoaderBase
{
    Q_OBJECT
  TQ_OBJECT
public:
    /**
     * Constructor
     */
    ConvertPluginLoader();

    /**
     * Destructor
     */
    virtual ~ConvertPluginLoader();

    /** is this file a converter plugin and loadable? */
    int verifyFile( TQString );
    /** load a given file */
    ConvertPlugin* loadFile( TQString );
};

#endif // CONVERTPLUGINLOADER_H