summaryrefslogtreecommitdiffstats
path: root/src/soundkonverter.h
blob: 3ba52aae215755748006537c3ceb4fa72093e950 (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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207


#ifndef SOUNDKONVERTER_H
#define SOUNDKONVERTER_H

#include "dcopinterface.h"

#include <kmainwindow.h>

class Config;
class Options;
class FileList;
class ProgressIndicator;
class ComboButton;
class CDManager;
class TagEngine;
class Convert;
class ReplayGainScanner;
class CuesheetEditor;
class Logger;
class LogViewer;

class TQProgressBar;
class KPushButton;
class KAction;
class KToggleAction;
class KActionMenu;
class KSystemTray;

/**
 * @short The main window and connections to all other classes
 * @author Daniel Faust <hessijames@gmail.com>
 * @version 0.3
 */
class soundKonverter : public KMainWindow, virtual public DCOPInterface
{
    Q_OBJECT
  TQ_OBJECT
public:
    /**
     * Constructor
     */
    soundKonverter();

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

    /**
     * When a new instance of soundKonverter should be created,
     * this function is called and all @p files are passed, that should be opened (for conversion).
     */
    void openArgFiles( const TQStringList &files );

    /**
     * When a new instance of soundKonverter should be created,
     * this function is called and all @p files are passed, that should be opened for editing the replaygain tag.
     */
    void openArgReplayGainFiles( const TQStringList &files );

    /*
     * When a new instance of soundKonverter should be created,
     * this function is called and all @p files are passed, that should be opened for repair.
     */
//     void openArgRepairFiles( const TQStringList &files );

    /**
     * When a new instance of soundKonverter should be created,
     * this function is called and instances is increased.
     */
    void increaseInstances();

    /**
     * Returns the number of 'started' instances
     */
    int getInstances() { return instances; }

    TQString device;
    TQString format;
    TQString profile;
    TQString directory;
    bool visible;
    bool autoclose;
    void setNotify( const TQString& cmd );

    /** A system tray icon that is shown, when the main window is hidden */
    KSystemTray* systemTray;

    //virtual void moveEvent( TQMoveEvent* );

protected:
    virtual bool queryClose();

private:
    /** Saves the amount of calls to create a new instance (only one instance is running at the same time) */
    int instances;

    /** All configuration information */
    Config* config;

    /** Log everything */
    Logger* logger;

    /** Show the logs */
    LogViewer* logViewer;

    /** The widget, where we can set our output options */
    Options* options;

    /** The list view with all files (for conversion) */
    FileList* fileList;

    /** Displays the current progress */
    ProgressIndicator* progressIndicator;

    /** The CD manager */
    CDManager* cdManager;

    /** The tag engine */
    TagEngine* tagEngine;

    /** The conversion engine */
    Convert* convert;

    /** The Replay Gain tool */
    ReplayGainScanner* replayGainScanner;

    /** The cuesheet editor */
    CuesheetEditor* cuesheetEditor;

    /** The combobutton for adding files */
    ComboButton* cAdd;

    /** The button to start the conversion */
    KPushButton* pStart;

    /** The button to stop the conversion */
    KPushButton* pStop;

    KAction* startAction;
    KAction* stopAction;
    KAction* continueAction;
    KAction* killAction;
    KActionMenu* stopActionMenu;
    KToggleAction* showToolBarAction;
//     KToggleAction* veryHighPriorityAction;
//     KToggleAction* highPriorityAction;
//     KToggleAction* normalPriorityAction;
//     KToggleAction* lowPriorityAction;
//     KToggleAction* veryLowPriorityAction;
//     KActionMenu* priorityActionMenu;

    int configStartPage;

private slots:
    /**
     * The conversion has started
     */
    void startedConversion();

    /**
     * The user clicked on stop/continue conversion
     */
    void stopClicked();
    void continueClicked();

    /**
     * The conversion has stopped
     */
    void stoppedConversion();
//     void priorityChanged();

    /**
     * The combobutton for adding files was clicked and the item @p index was selected
     */
    void addClicked( int index );

    void showReplayGainScanner();
    void showRepairTool();
    void showCuesheetEditor();
    void showLogViewer();
    void showConfigDialog();
    void showConfigPluginsPage();
    void showConfigEnvironmentPage();
//     void showAboutPlugins();
    void showToolbar();
    void editToolbar();
    void newToolbarConfig();
    void fileCountChanged( int );
    void setTitle( const TQString& );

    //void openCuesheetEditor( const TQString& content );

public slots:
    void showFileDialog();
    void showDirDialog();
    void showCdDialog( bool intern = true );
    void showUrlDialog();

signals:
    //void windowMoved( int x, int y );
//     void setPriority( int );
//     void addFilesToReplayGainScanner( TQStringList );
};

#endif // SOUNDKONVERTER_H