21 #include <QMainWindow> 25 #include <QNetworkAccessManager> 26 #include <QScopedPointer> 27 #include <QSharedPointer> 29 #include "mltcontroller.h" 30 #include "mltxmlchecker.h" 32 #define EXIT_RESTART (42) 44 class FilterController;
45 class ScopeController;
53 class AppendTask :
public QObject,
public QRunnable
57 AppendTask(
const QStringList& filenames)
59 , filenames(filenames)
64 void appendToPlaylist(QString);
68 const QStringList filenames;
71 class MainWindow :
public QMainWindow
76 static MainWindow& singleton();
78 void open(Mlt::Producer* producer);
79 bool continueModified();
80 bool continueJobsRunning();
81 QUndoStack* undoStack()
const;
82 bool saveXML(
const QString& filename,
bool withRelativePaths =
true);
83 static void changeTheme(
const QString& theme);
84 PlaylistDock* playlistDock()
const {
return m_playlistDock; }
85 FilterController* filterController()
const {
return m_filterController; }
86 HtmlEditor* htmlEditor()
const {
return m_htmlEditor.data(); }
87 Mlt::Playlist* playlist()
const;
88 Mlt::Producer* multitrack()
const;
89 bool isMultitrackValid()
const;
91 void setFullScreen(
bool isFullScreen);
92 QString removeFileScheme(QUrl& url);
93 QString untitledFileName()
const;
94 QString getFileHash(
const QString& path)
const;
95 QString getHash(Mlt::Properties& properties)
const;
96 void setProfile(
const QString& profile_name);
97 QString fileName()
const {
return m_currentFile; }
98 bool isSourceClipMyProject(QString resource = MLT.resource());
99 bool keyframesDockIsVisible()
const;
101 void keyPressEvent(QKeyEvent*);
102 void keyReleaseEvent(QKeyEvent *);
103 void hideSetDataDirectory();
104 QMenu* customProfileMenu()
const {
return m_customProfileMenu; }
105 QAction* actionAddCustomProfile()
const;
106 QAction* actionProfileRemove()
const;
107 QActionGroup* profileGroup()
const {
return m_profileGroup; }
108 void buildVideoModeMenu(QMenu *topMenu, QMenu *&customMenu, QActionGroup* group, QAction *addAction, QAction *removeAction);
109 void newProject(
const QString& filename,
bool isProjectFolder =
false);
110 void addCustomProfile(
const QString& name, QMenu* menu, QAction* action, QActionGroup* group);
111 void removeCustomProfiles(
const QStringList& profiles, QDir &dir, QMenu* menu, QAction* action);
114 void audioChannelsChanged();
115 void producerOpened();
116 void profileChanged();
117 void openFailed(QString);
118 void aboutToShutDown();
122 bool eventFilter(QObject* target, QEvent* event);
123 void dragEnterEvent(QDragEnterEvent*);
124 void dropEvent(QDropEvent*);
125 void closeEvent(QCloseEvent*);
126 void showEvent(QShowEvent*);
129 void setupSettingsMenu();
130 void setupOpenOtherMenu();
131 QAction *addProfile(QActionGroup* actionGroup,
const QString& desc,
const QString& name);
132 QAction *addLayout(QActionGroup* actionGroup,
const QString& name);
133 void readPlayerSettings();
134 void readWindowSettings();
135 void writeSettings();
136 void configureVideoWidget();
137 void setCurrentFile(
const QString &filename);
138 void changeAudioChannels(
bool checked,
int channels);
139 void changeDeinterlacer(
bool checked,
const char* method);
140 void changeInterpolation(
bool checked,
const char* method);
141 bool checkAutoSave(QString &url);
142 void stepLeftBySeconds(
int sec);
143 bool saveRepairedXmlFile(MltXmlChecker& checker, QString& fileName);
144 void setAudioChannels(
int channels);
145 void showSaveError();
149 QDockWidget* m_propertiesDock;
150 RecentDock* m_recentDock;
151 EncodeDock* m_encodeDock;
152 JobsDock* m_jobsDock;
153 PlaylistDock* m_playlistDock;
154 TimelineDock* m_timelineDock;
155 QString m_currentFile;
156 bool m_isKKeyPressed;
157 QUndoStack* m_undoStack;
158 QDockWidget* m_historyDock;
159 QActionGroup* m_profileGroup;
160 QActionGroup* m_externalGroup;
161 QActionGroup* m_keyerGroup;
162 QActionGroup* m_layoutGroup;
163 FiltersDock* m_filtersDock;
164 FilterController* m_filterController;
165 ScopeController* m_scopeController;
166 QMenu* m_customProfileMenu;
168 QStringList m_multipleFiles;
169 bool m_isPlaylistLoaded;
170 QActionGroup* m_languagesGroup;
171 QScopedPointer<HtmlEditor> m_htmlEditor;
172 QSharedPointer<AutoSaveFile> m_autosaveFile;
173 QMutex m_autosaveMutex;
174 QTimer m_autosaveTimer;
176 int m_navigationPosition;
177 QScopedPointer<QAction> m_statusBarAction;
178 QNetworkAccessManager m_network;
179 QString m_upgradeUrl;
180 KeyframesDock* m_keyframesDock;
183 LeapListener m_leapListener;
187 bool isCompatibleWithGpuMode(MltXmlChecker& checker);
188 bool isXmlRepaired(MltXmlChecker& checker, QString& fileName);
189 void updateAutoSave();
190 void open(QString url,
const Mlt::Properties* = 0);
191 void openMultiple(
const QStringList& paths);
192 void openMultiple(
const QList<QUrl>& urls);
194 void openCut(Mlt::Producer* producer,
bool play =
false);
196 void closeProducer();
197 void showStatusMessage(QAction* action,
int timeoutSeconds = 5);
198 void showStatusMessage(
const QString& message,
int timeoutSeconds = 5);
199 void seekPlaylist(
int start);
200 void seekTimeline(
int position);
201 void seekKeyframes(
int position);
202 QWidget* loadProducerWidget(Mlt::Producer* producer);
203 void onProducerOpened(
bool withReopen =
true);
204 void onGpuNotSupported();
205 void editHTML(
const QString& fileName);
206 void stepLeftOneFrame();
207 void stepRightOneFrame();
208 void stepLeftOneSecond();
209 void stepRightOneSecond();
210 void setInToCurrent(
bool ripple);
211 void setOutToCurrent(
bool ripple);
212 void onShuttle(
float x);
213 void onPropertiesDockTriggered(
bool checked =
true);
214 bool on_actionSave_triggered();
217 void showUpgradePrompt();
218 void on_actionAbout_Shotcut_triggered();
219 void on_actionOpenOther_triggered();
220 void onProducerChanged();
221 bool on_actionSave_As_triggered();
222 void onEncodeTriggered(
bool checked =
true);
223 void onCaptureStateChanged(
bool started);
224 void onJobsDockTriggered(
bool =
true);
225 void onRecentDockTriggered(
bool checked =
true);
226 void onPlaylistDockTriggered(
bool checked =
true);
227 void onTimelineDockTriggered(
bool checked =
true);
228 void onHistoryDockTriggered(
bool checked =
true);
229 void onFiltersDockTriggered(
bool checked =
true);
230 void onKeyframesDockTriggered(
bool checked =
true);
231 void onPlaylistCreated();
232 void onPlaylistLoaded();
233 void onPlaylistCleared();
234 void onPlaylistClosed();
235 void onPlaylistModified();
236 void onMultitrackCreated();
237 void onMultitrackClosed();
238 void onMultitrackModified();
239 void onMultitrackDurationChanged();
240 void onCutModified();
241 void onProducerModified();
242 void onFilterModelChanged();
243 void updateMarkers();
244 void updateThumbnails();
245 void on_actionUndo_triggered();
246 void on_actionRedo_triggered();
247 void on_actionFAQ_triggered();
248 void on_actionForum_triggered();
249 void on_actionEnter_Full_Screen_triggered();
250 void on_actionRealtime_triggered(
bool checked);
251 void on_actionProgressive_triggered(
bool checked);
252 void on_actionChannels1_triggered(
bool checked);
253 void on_actionChannels2_triggered(
bool checked);
254 void on_actionChannels6_triggered(
bool checked);
255 void on_actionOneField_triggered(
bool checked);
256 void on_actionLinearBlend_triggered(
bool checked);
257 void on_actionYadifTemporal_triggered(
bool checked);
258 void on_actionYadifSpatial_triggered(
bool checked);
259 void on_actionNearest_triggered(
bool checked);
260 void on_actionBilinear_triggered(
bool checked);
261 void on_actionBicubic_triggered(
bool checked);
262 void on_actionHyper_triggered(
bool checked);
263 void on_actionJack_triggered(
bool checked);
264 void on_actionGPU_triggered(
bool checked);
265 void onExternalTriggered(QAction*);
266 void onKeyerTriggered(QAction*);
267 void onProfileTriggered(QAction*);
268 void onProfileChanged();
269 void on_actionAddCustomProfile_triggered();
270 void processMultipleFiles();
271 void onLanguageTriggered(QAction*);
272 void on_actionSystemTheme_triggered();
273 void on_actionFusionDark_triggered();
274 void on_actionFusionLight_triggered();
275 void on_actionTutorials_triggered();
276 void on_actionRestoreLayout_triggered();
277 void on_actionShowTitleBars_triggered(
bool checked);
278 void on_actionShowToolbar_triggered(
bool checked);
279 void onToolbarVisibilityChanged(
bool visible);
280 void on_menuExternal_aboutToShow();
281 void on_actionUpgrade_triggered();
282 void on_actionOpenXML_triggered();
283 void onAutosaveTimeout();
284 void on_actionGammaSRGB_triggered(
bool checked);
285 void on_actionGammaRec709_triggered(
bool checked);
286 void onFocusChanged(QWidget *old, QWidget * now)
const;
287 void onFocusObjectChanged(QObject *obj)
const;
288 void onFocusWindowChanged(QWindow *window)
const;
289 void onTimelineClipSelected();
290 void onAddAllToTimeline(Mlt::Playlist* playlist);
291 void on_actionScrubAudio_triggered(
bool checked);
292 #if !defined(Q_OS_MAC) 293 void onDrawingMethodTriggered(QAction*);
295 void on_actionApplicationLog_triggered();
296 void on_actionClose_triggered();
297 void onPlayerTabIndexChanged(
int index);
298 void onUpgradeCheckFinished(QNetworkReply* reply);
299 void onUpgradeTriggered();
300 void onTimelineSelectionChanged();
301 void on_actionCut_triggered();
302 void on_actionCopy_triggered();
303 void on_actionPaste_triggered();
305 void on_actionExportEDL_triggered();
306 void on_actionExportFrame_triggered();
307 void onGLWidgetImageReady();
308 void on_actionAppDataSet_triggered();
309 void on_actionAppDataShow_triggered();
310 void on_actionNew_triggered();
311 void on_actionKeyboardShortcuts_triggered();
312 void on_actionLayoutPlayer_triggered();
313 void on_actionLayoutPlaylist_triggered();
314 void on_actionLayoutTimeline_triggered();
315 void on_actionLayoutClip_triggered();
316 void on_actionLayoutAdd_triggered();
317 void onLayoutTriggered(QAction*);
318 void on_actionProfileRemove_triggered();
319 void on_actionLayoutRemove_triggered();
320 void onAppendToPlaylist(
const QString& xml);
321 void onAppendTaskDone();
322 void on_actionOpenOther2_triggered();
323 void onOpenOtherTriggered(QWidget* widget);
324 void onOpenOtherTriggered();
325 void on_actionClearRecentOnExit_toggled(
bool arg1);
326 void onSceneGraphInitialized();
327 void on_actionShowTextUnderIcons_toggled(
bool b);
328 void on_actionShowSmallIcons_toggled(
bool b);
329 void onPlaylistInChanged(
int in);
330 void onPlaylistOutChanged(
int out);
333 #define MAIN MainWindow::singleton() 335 #endif // MAINWINDOW_H