mainwindow.h 21.7 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/***************************************************************************
 *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
 ***************************************************************************/

Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
20
21
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
22

23
#include <QComboBox>
Nicolas Carion's avatar
Nicolas Carion committed
24
#include <QDBusAbstractAdaptor>
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
25
#include <QDockWidget>
26
#include <QEvent>
Nicolas Carion's avatar
Nicolas Carion committed
27
#include <QImage>
28
#include <QMap>
Nicolas Carion's avatar
Nicolas Carion committed
29
#include <QShortcut>
30
#include <QString>
Nicolas Carion's avatar
Nicolas Carion committed
31
#include <QUndoView>
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
32

Nicolas Carion's avatar
Nicolas Carion committed
33
34
35
#include <KActionCategory>
#include <KColorSchemeManager>
#include <KSelectAction>
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
36
#include <KXmlGuiWindow>
37
#include <kautosavefile.h>
Nicolas Carion's avatar
Nicolas Carion committed
38
#include <utility>
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
39

40
#include "bin/bin.h"
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
41
#include "definitions.h"
42
#include "dvdwizard/dvdwizard.h"
Nicolas Carion's avatar
Nicolas Carion committed
43
44
45
46
#include "gentime.h"
#include "kdenlive_debug.h"
#include "kdenlivecore_export.h"
#include "statusbarmessagelabel.h"
Vincent Pinon's avatar
Vincent Pinon committed
47
#include "utils/otioconvertions.h"
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
48

49
class AssetPanel;
50
class AudioGraphSpectrum;
51
class EffectBasket;
52
53
class EffectListWidget;
class TransitionListWidget;
54
55
class KIconLoader;
class KdenliveDoc;
56
class Monitor;
57
class Render;
58
class RenderWidget;
59
60
class TimelineTabs;
class TimelineWidget;
61
class TimelineContainer;
62
class Transition;
63

Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
64
65
66
class MltErrorEvent : public QEvent
{
public:
Nicolas Carion's avatar
Nicolas Carion committed
67
    explicit MltErrorEvent(QString message)
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
68
        : QEvent(QEvent::User)
Nicolas Carion's avatar
Nicolas Carion committed
69
        , m_message(std::move(message))
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
70
71
72
73
74
75
76
77
78
    {
    }

    QString message() const { return m_message; }

private:
    QString m_message;
};

79
class /*KDENLIVECORE_EXPORT*/ MainWindow : public KXmlGuiWindow
80
{
81
82
83
    Q_OBJECT

public:
84
    explicit MainWindow(QWidget *parent = nullptr);
85
86
87
    /** @brief Initialises the main window.
     * @param MltPath (optional) path to MLT environment
     * @param Url (optional) file to open
88
     * @param clipsToLoad (optional) a comma separated list of clips to import in project
89
     *
90
     * If Url is present, it will be opened, otherwise, if openlastproject is
91
92
     * set, latest project will be opened. If no file is open after trying this,
     * a default new file will be created. */
93
    void init(const QString &mltPath);
Nicolas Carion's avatar
Nicolas Carion committed
94
    ~MainWindow() override;
95

96
    /** @brief Cache for luma files thumbnails. */
Laurent Montel's avatar
Laurent Montel committed
97
98
    static QMap<QString, QImage> m_lumacache;
    static QMap<QString, QStringList> m_lumaFiles;
99

100
    /** @brief Adds an action to the action collection and stores the name. */
101
    void addAction(const QString &name, QAction *action, const QKeySequence &shortcut = QKeySequence(), KActionCategory *category = nullptr);
Till Theato's avatar
Till Theato committed
102
    /** @brief Adds an action to the action collection and stores the name. */
Nicolas Carion's avatar
Nicolas Carion committed
103
    QAction *addAction(const QString &name, const QString &text, const QObject *receiver, const char *member, const QIcon &icon = QIcon(),
104
                       const QKeySequence &shortcut = QKeySequence(), KActionCategory *category = nullptr);
105

106
107
108
109
110
111
112
113
114
115
    /**
     * @brief Adds a new dock widget to this window.
     * @param title title of the dock widget
     * @param objectName objectName of the dock widget (required for storing layouts)
     * @param widget widget to use in the dock
     * @param area area to which the dock should be added to
     * @returns the created dock widget
     */
    QDockWidget *addDock(const QString &title, const QString &objectName, QWidget *widget, Qt::DockWidgetArea area = Qt::TopDockWidgetArea);

Till Theato's avatar
Till Theato committed
116
117
    QUndoGroup *m_commandStack;
    QUndoView *m_undoView;
118
119
    /** @brief holds info about whether movit is available on this system */
    bool m_gpuAllowed;
Nicolas Carion's avatar
Nicolas Carion committed
120
    int m_exitCode{EXIT_SUCCESS};
Laurent Montel's avatar
Laurent Montel committed
121
    QMap<QString, KActionCategory *> kdenliveCategoryMap;
Laurent Montel's avatar
Laurent Montel committed
122
    QList<QAction *> getExtraActions(const QString &name);
123
    /** @brief Returns true if docked widget is tabbed with another widget from its object name */
Laurent Montel's avatar
Laurent Montel committed
124
    bool isTabbedWith(QDockWidget *widget, const QString &otherWidget);
125
126
127
    
    /** @brief Returns true if mixer widget is tabbed */
    bool isMixedTabbed() const;
Till Theato's avatar
Till Theato committed
128

129
130
131
    /** @brief Returns a ptr to the main timeline widget of the project */
    TimelineWidget *getMainTimeline() const;

Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
132
    /** @brief Returns a pointer to the current timeline */
133
    TimelineWidget *getCurrentTimeline() const;
134
135
136

    /** @brief Returns true if a timeline widget is available */
    bool hasTimeline() const;
137
138
139
    
    /** @brief Returns true if the timeline widget is visible */
    bool timelineVisible() const;
140
141
142
    
    /** @brief Raise (show) the clip or project monitor */
    void raiseMonitor(bool clipMonitor);
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
143

144
145
    /** @brief Raise (show) the project bin*/
    void raiseBin();
146

147
148
    /** @brief Hide subtitle track */
    void resetSubtitles();
149
150
151
    
    /** @brief Restart the application and delete config files if clean is true */
    void cleanRestart(bool clean);
152

153
154
    /** @brief Show current tool key combination in status bar */
    void showToolMessage();
155
156
    /** @brief Show the widget's default key binding message */
    void setWidgetKeyBinding(const QString &text = QString());
157
    /** @brief Show a key binding in status bar */
158
    void showKeyBinding(const QString &text = QString());
159

160
protected:
161
162
163
164
    /** @brief Closes the window.
     * @return false if the user presses "Cancel" on a confirmation dialog or
     *     the operation requested (starting waiting jobs or saving file) fails,
     *     true otherwise */
165
166
    bool queryClose() override;
    void closeEvent(QCloseEvent *) override;
167
168

    /** @brief Reports a message in the status bar when an error occurs. */
169
    void customEvent(QEvent *e) override;
170
171

    /** @brief Stops the active monitor when the window gets hidden. */
172
    void hideEvent(QHideEvent *e) override;
173
174

    /** @brief Saves the file and the window properties when saving the session. */
175
    void saveProperties(KConfigGroup &config) override;
176

177
    void saveNewToolbarConfig() override;
178
179

private:
180
    /** @brief Sets up all the actions and attaches them to the collection. */
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
181
    void setupActions();
182

Vincent Pinon's avatar
Vincent Pinon committed
183
    OtioConvertions m_otioConvertions;
184
    KColorSchemeManager *m_colorschemes;
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
185

186
    QDockWidget *m_projectBinDock;
187
    QDockWidget *m_effectListDock;
188
    QDockWidget *m_transitionListDock;
189
190
    TransitionListWidget *m_transitionList2;
    EffectListWidget *m_effectList2;
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
191

Nicolas Carion's avatar
Nicolas Carion committed
192
    AssetPanel *m_assetPanel{nullptr};
193
    QDockWidget *m_effectStackDock;
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
194

195
    QDockWidget *m_clipMonitorDock;
Nicolas Carion's avatar
Nicolas Carion committed
196
    Monitor *m_clipMonitor{nullptr};
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
197

198
    QDockWidget *m_projectMonitorDock;
Nicolas Carion's avatar
Nicolas Carion committed
199
    Monitor *m_projectMonitor{nullptr};
200

201
    AudioGraphSpectrum *m_audioSpectrum;
202

203
    QDockWidget *m_undoViewDock;
204
    QDockWidget *m_mixerDock;
205
    QDockWidget *m_onlineResourcesDock;
206

207
    KSelectAction *m_timeFormatButton;
208
    KSelectAction *m_compositeAction;
209

Nicolas Carion's avatar
Nicolas Carion committed
210
    TimelineTabs *m_timelineTabs{nullptr};
211

212
    /** This list holds all the scopes used in Kdenlive, allowing to manage some global settings */
Laurent Montel's avatar
Laurent Montel committed
213
    QList<QDockWidget *> m_gfxScopesList;
214

215
    KActionCategory *m_effectActions;
216
    KActionCategory *m_transitionActions;
217
    QMenu *m_effectsMenu;
218
    QMenu *m_transitionsMenu;
219
    QMenu *m_timelineContextMenu;
220
    QList<QAction *> m_timelineClipActions;
221
    KDualAction *m_useTimelineZone;
222

223
    /** Action names that can be used in the slotDoAction() slot, with their i18n() names */
224
    QStringList m_actionNames;
225

226
227
    /** @brief Shortcut to remove the focus from any element.
     *
228
     * It allows one to get out of e.g. text input fields and to press another
229
     * shortcut. */
Laurent Montel's avatar
Laurent Montel committed
230
    QShortcut *m_shortcutRemoveFocus;
231

Nicolas Carion's avatar
Nicolas Carion committed
232
233
    RenderWidget *m_renderWidget{nullptr};
    StatusBarMessageLabel *m_messageLabel{nullptr};
Nicolas Carion's avatar
Nicolas Carion committed
234
    QList<QAction *> m_transitions;
235
236
237
238
    QAction *m_buttonAudioThumbs;
    QAction *m_buttonVideoThumbs;
    QAction *m_buttonShowMarkers;
    QAction *m_buttonFitZoom;
239
    QAction *m_buttonTimelineTags;
240
241
242
243
244
245
246
247
    QAction *m_normalEditTool;
    QAction *m_overwriteEditTool;
    QAction *m_insertEditTool;
    QAction *m_buttonSelectTool;
    QAction *m_buttonRazorTool;
    QAction *m_buttonSpacerTool;
    QAction *m_buttonSnap;
    QAction *m_saveAction;
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
248
    QSlider *m_zoomSlider;
249
250
251
252
253
    QAction *m_zoomIn;
    QAction *m_zoomOut;
    QAction *m_loopZone;
    QAction *m_playZone;
    QAction *m_loopClip;
254
    QAction *m_proxyClip;
255
    QAction *m_buttonSubtitleEditTool;
256
    QString m_theme;
257
    KIconLoader *m_iconLoader;
258
    KToolBar *m_timelineToolBar;
259
    TimelineContainer *m_timelineToolBarContainer;
260
    QLabel *m_trimLabel;
261
    QActionGroup *m_scaleGroup;
262

263
264
    /** @brief initialize startup values, return true if first run. */
    bool readOptions();
265
    void saveOptions();
266

267
    void loadGenerators();
268
269
270
    /** @brief Instantiates a "Get Hot New Stuff" dialog.
     * @param configFile configuration file for KNewStuff
     * @return number of installed items */
Alberto Villa's avatar
Alberto Villa committed
271
    int getNewStuff(const QString &configFile = QString());
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
272
    QStringList m_pluginFileNames;
273
    QByteArray m_timelineState;
274
    void buildDynamicActions();
275
    void loadClipActions();
276

277
    QTime m_timer;
278
    KXMLGUIClient *m_extraFactory;
Nicolas Carion's avatar
Nicolas Carion committed
279
280
    bool m_themeInitialized{false};
    bool m_isDarkTheme{false};
281
    EffectBasket *m_effectBasket;
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
282
283
    /** @brief Update widget style. */
    void doChangeStyle();
284
    void updateActionsToolTip();
285

286
public slots:
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
287
    void slotReloadEffects(const QStringList &paths);
288
    Q_SCRIPTABLE void setRenderingProgress(const QString &url, int progress, int frame);
289
    Q_SCRIPTABLE void setRenderingFinished(const QString &url, int status, const QString &error);
290
291
    Q_SCRIPTABLE void addProjectClip(const QString &url);
    Q_SCRIPTABLE void addTimelineClip(const QString &url);
292
    Q_SCRIPTABLE void addEffect(const QString &effectId);
293
294
    Q_SCRIPTABLE void scriptRender(const QString &url);
    Q_NOREPLY void exitApp();
295

Till Theato's avatar
Till Theato committed
296
297
    void slotSwitchVideoThumbs();
    void slotSwitchAudioThumbs();
298

Till Theato's avatar
Till Theato committed
299
    void slotPreferences(int page = -1, int option = -1);
300
    void connectDocument();
301
302
    /** @brief Reload project profile in config dialog if changed. */
    void slotRefreshProfiles();
303
    void updateDockTitleBars(bool isTopLevel = true);
304
305
    /** @brief Add/remove Dock tile bar depending on state (tabbed, floating, ...) */
    void slotUpdateDockLocation(Qt::DockWidgetArea dockLocationArea);
306
    void configureToolbars() override;
307
308
309
310
    /** @brief Decreases the timeline zoom level by 1. */
    void slotZoomIn(bool zoomOnMouse = false);
    /** @brief Increases the timeline zoom level by 1. */
    void slotZoomOut(bool zoomOnMouse = false);
311
312
    /** @brief Enable or disable the use of timeline zone for edits. */
    void slotSwitchTimelineZone(bool toggled);
313
314
    /** @brief Open the online services search dialog. */
    void slotDownloadResources();
315
    void slotEditSubtitle(QMap<QString, QString> subProperties = {});
316
    void slotTranscode(const QStringList &urls = QStringList());
317

Till Theato's avatar
Till Theato committed
318
private slots:
319
320
    /** @brief Shows the shortcut dialog. */
    void slotEditKeys();
321
    void loadDockActions();
322
    /** @brief Reflects setting changes to the GUI. */
323
    void updateConfiguration();
324
    void slotConnectMonitors();
325
    void slotUpdateMousePosition(int pos);
326
    void slotUpdateProjectDuration(int pos);
327
    void slotEditProjectSettings();
328
    void slotSwitchMarkersComments();
329
    void slotSwitchSnap();
330
    void slotShowTimelineTags();
331
    void slotRenderProject();
332
    void slotStopRenderProject();
333
    void slotFullScreen();
334
    /** @brief if modified is true adds "modified" to the caption and enables the save button.
Nicolas Carion's avatar
Nicolas Carion committed
335
     * (triggered by KdenliveDoc::setModified()) */
336
    void slotUpdateDocumentState(bool modified);
337
338

    /** @brief Sets the timeline zoom slider to @param value.
Nicolas Carion's avatar
Nicolas Carion committed
339
340
     *
     * Also disables zoomIn and zoomOut actions if they cannot be used at the moment. */
341
    void slotSetZoom(int value, bool zoomOnMouse = false);
342
    /** @brief Makes the timeline zoom level fit the timeline content. */
343
    void slotFitZoom();
344
345
    /** @brief Updates the zoom slider tooltip to fit @param zoomlevel. */
    void slotUpdateZoomSliderToolTip(int zoomlevel);
346
347
    /** @brief Timeline was zoom, update slider to reflect that */
    void updateZoomSlider(int value);
348

349
    /** @brief Displays the zoom slider tooltip.
Nicolas Carion's avatar
Nicolas Carion committed
350
351
352
     * @param zoomlevel (optional) The zoom level to show in the tooltip.
     *
     * Adopted from Dolphin (src/statusbar/dolphinstatusbar.cpp) */
353
354
    void slotShowZoomSliderToolTip(int zoomlevel = -1);
    /** @brief Deletes item in timeline, project tree or effect stack depending on focus. */
355
    void slotDeleteItem();
356
    void slotAddClipMarker();
357
    void slotDeleteClipMarker(bool allowGuideDeletion = false);
358
    void slotDeleteAllClipMarkers();
359
    void slotEditClipMarker();
360

361
    /** @brief Adds marker or guide at the current position without showing the marker dialog.
362
     *
363
364
365
366
     * Adds a marker if clip monitor is active, otherwise a guide.
     * The comment is set to the current position (therefore not dialog).
     * This can be useful to mark something during playback. */
    void slotAddMarkerGuideQuickly();
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
367
    void slotCutTimelineClip();
368
    void slotCutTimelineAllClips();
369
    void slotInsertClipOverwrite();
370
    void slotInsertClipInsert();
371
372
    void slotExtractZone();
    void slotLiftZone();
373
    void slotPreviewRender();
374
    void slotStopPreviewRender();
375
376
    void slotDefinePreviewRender();
    void slotRemovePreviewRender();
377
    void slotClearPreviewRender(bool resetZones = true);
378
379
380
381
382
383
    void slotSelectTimelineClip();
    void slotSelectTimelineTransition();
    void slotDeselectTimelineClip();
    void slotDeselectTimelineTransition();
    void slotSelectAddTimelineClip();
    void slotSelectAddTimelineTransition();
384
    void slotAddEffect(QAction *result);
385
    void slotAddTransition(QAction *result);
386
    void slotAddProjectClip(const QUrl &url, const QString &folderInfo);
387
    void slotAddTextNote(const QString &text);
388
    void slotAddProjectClipList(const QList<QUrl> &urls);
Laurent Montel's avatar
Laurent Montel committed
389
390
    void slotChangeTool(QAction *action);
    void slotChangeEdit(QAction *action);
391
    void slotSetTool(ProjectTool tool);
392
393
    void slotSnapForward();
    void slotSnapRewind();
394
395
    void slotGuideForward();
    void slotGuideRewind();
396
397
    void slotClipStart();
    void slotClipEnd();
398
    void slotSelectClipInTimeline();
Nicolas Carion's avatar
Nicolas Carion committed
399
    void slotClipInTimeline(const QString &clipId, const QList<int> &ids);
400

401
    void slotInsertSpace();
402
    void slotRemoveSpace();
403
    void slotRemoveAllSpace();
404
    void slotAddGuide();
405
    void slotEditGuide();
406
407
    void slotDeleteGuide();
    void slotDeleteAllGuides();
408
    void slotGuidesUpdated();
409
410
411

    void slotCopy();
    void slotPaste();
412
    void slotPasteEffects();
413
414
    void slotResizeItemStart();
    void slotResizeItemEnd();
415
    void configureNotifications();
416
    void slotSeparateAudioChannel();
417
418
    /** @brief Normalize audio channels before displaying them */
    void slotNormalizeAudioChannel();
419
420
    void slotInsertTrack();
    void slotDeleteTrack();
421
422
    /** @brief Show context menu to switch current track target audio stream. */
    void slotSwitchTrackAudioStream();
423
    void slotShowTrackRec();
424
425
426
427
    /** @brief Select all clips in active track. */
    void slotSelectTrack();
    /** @brief Select all clips in timeline. */
    void slotSelectAllTracks();
428
    void slotUnselectAllTracks();
429
    void slotGetNewKeyboardStuff(QComboBox *schemesList);
430
    void slotAutoTransition();
431
    void slotRunWizard();
432
    void slotDvdWizard(const QString &url = QString());
433
434
    void slotGroupClips();
    void slotUnGroupClips();
435
    void slotEditItemDuration();
436
    void slotClipInProjectTree();
Nicolas Carion's avatar
Nicolas Carion committed
437
    // void slotClipToProjectTree();
438
    void slotSplitAV();
439
    void slotSwitchClip();
Simon Eugster's avatar
Simon Eugster committed
440
441
    void slotSetAudioAlignReference();
    void slotAlignAudio();
442
    void slotUpdateClipType(QAction *action);
443
    void slotUpdateTimelineView(QAction *action);
444
    void slotShowTimeline(bool show);
445
    void slotTranscodeClip();
446
447
    /** @brief Archive project: creates a copy of the project file with all clips in a new folder. */
    void slotArchiveProject();
Laurent Montel's avatar
Laurent Montel committed
448
    void slotSetDocumentRenderProfile(const QMap<QString, QString> &props);
449

450
    /** @brief Switches between displaying frames or timecode.
Nicolas Carion's avatar
Nicolas Carion committed
451
     * @param ix 0 = display timecode, 1 = display frames. */
452
    void slotUpdateTimecodeFormat(int ix);
453

454
    /** @brief Removes the focus of anything. */
455
    void slotRemoveFocus();
456
    void slotCleanProject();
457
    void slotShutdown();
458

459
    void slotSwitchMonitors();
460
    void slotSwitchMonitorOverlay(QAction *);
461
462
    void slotSwitchDropFrames(bool drop);
    void slotSetMonitorGamma(int gamma);
463
    void slotCheckRenderStatus();
464
    void slotInsertZoneToTree();
465

466
467
    /** @brief The monitor informs that it needs (or not) to have frames sent by the renderer. */
    void slotMonitorRequestRenderFrame(bool request);
468
469
    /** @brief Update project because the use of proxy clips was enabled / disabled. */
    void slotUpdateProxySettings();
470
471
    /** @brief Disable proxies for this project. */
    void slotDisableProxies();
472

473
    /** @brief Process keyframe data sent from a clip to effect / transition stack. */
Nicolas Carion's avatar
Nicolas Carion committed
474
    void slotProcessImportKeyframes(GraphicsRectItem type, const QString &tag, const QString &keyframes);
475
    /** @brief Move playhead to mouse cursor position if defined key is pressed */
476
    void slotAlignPlayheadToMousePos();
477

478
    void slotThemeChanged(const QString &name);
479
    /** @brief Close Kdenlive and try to restart it */
480
    void slotRestart(bool clean = false);
Laurent Montel's avatar
Laurent Montel committed
481
    void triggerKey(QKeyEvent *ev);
482
483
    /** @brief Update monitor overlay actions on monitor switch */
    void slotUpdateMonitorOverlays(int id, int code);
484
    /** @brief Update widget style */
485
    void slotChangeStyle(QAction *a);
486
    /** @brief Create temporary top track to preview an effect */
487
    void createSplitOverlay(std::shared_ptr<Mlt::Filter> filter);
488
    void removeSplitOverlay();
489
490
    /** @brief Create a generator's setup dialog */
    void buildGenerator(QAction *action);
491
    void slotCheckTabPosition();
492
493
    /** @brief Toggle automatic timeline preview on/off */
    void slotToggleAutoPreview(bool enable);
494
495
496
    /** @brief Rebuild/reload timeline toolbar. */
    void rebuildTimlineToolBar();
    void showTimelineToolbarMenu(const QPoint &pos);
497
498
    /** @brief Open Cached Data management dialog. */
    void slotManageCache();
499
    void showMenuBar(bool show);
500
501
    /** @brief Change forced icon theme setting (asks for app restart). */
    void forceIconSet(bool force);
502
    /** @brief Toggle current project's compositing mode. */
503
    void slotUpdateCompositing(QAction *compose);
504
505
    /** @brief Update compositing action to display current project setting. */
    void slotUpdateCompositeAction(int mode);
506
507
    /** @brief Cycle through the different timeline trim modes. */
    void slotSwitchTrimMode();
Laurent Montel's avatar
Laurent Montel committed
508
    void setTrimMode(const QString &mode);
509
510
    /** @brief Set timeline toolbar icon size. */
    void setTimelineToolbarIconSize(QAction *a);
511
    void slotEditItemSpeed();
512
513
    /** @brief Request adjust of timeline track height */
    void resetTimelineTracks();
514
515
    /** @brief Set keyboard grabbing on current timeline item */
    void slotGrabItem();
516
517
    /** @brief Collapse or expand current item (depending on focused widget: effet, track)*/
    void slotCollapse();
518
519
520
521
    /** @brief Save currently selected timeline clip as bin subclip*/
    void slotExtractClip();
    /** @brief Save currently selected timeline clip as bin subclip*/
    void slotSaveZoneToBin();
522
523
    /** @brief Expand current timeline clip (recover clips and tracks from an MLT playlist) */
    void slotExpandClip();
524
525
526
527
528
529
    /** @brief Focus and activate an audio track from a shortcut sequence */
    void slotActivateAudioTrackSequence();
    /** @brief Focus and activate a video track from a shortcut sequence */
    void slotActivateVideoTrackSequence();
    /** @brief Select target for current track */
    void slotActivateTarget();
Sashmita Raghav's avatar
Sashmita Raghav committed
530
    /** @brief Add subtitle clip to timeline */
531
    void slotAddSubtitle();
532
533
534
535
    /** @brief Enable/disable subtitle track */
    void slotDisableSubtitle();
    /** @brief Lock / unlock subtitle track */
    void slotLockSubtitle();
536
537
    /** @brief Import a subtitle file */
    void slotImportSubtitle();
538
539
    /** @brief Export a subtitle file */
    void slotExportSubtitle();
540
541
    /** @brief Start a speech recognition on timeline zone */
    void slotSpeechRecognition();
542

543
544
signals:
    Q_SCRIPTABLE void abortRenderJob(const QString &url);
545
    void configurationChanged();
546
    void GUISetupDone();
547
    void setPreviewProgress(int);
548
    void setRenderProgress(int);
Laurent Montel's avatar
Laurent Montel committed
549
    void displayMessage(const QString &, MessageType, int);
550
    void displayProgressMessage(const QString &, MessageType, int);
551
552
    /** @brief Project profile changed, update render widget accordingly. */
    void updateRenderWidgetProfile();
553
554
    /** @brief Clear asset view if itemId is displayed. */
    void clearAssetPanel(int itemId = -1);
555
    void assetPanelWarning(const QString service, const QString id, const QString message);
556
    void adjustAssetPanelRange(int itemId, int in, int out);
557
558
    /** @brief Enable or disable the undo stack. For example undo/redo should not be enabled when dragging a clip in timeline or we risk corruption. */
    void enableUndo(bool enable);
559
    bool focusTimeline(bool focus, bool highlight);
560
    void updateProjectPath(const QString &path);
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
561
};
562

Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
563
#endif