Olive
oliveglobal.h
1 /***
2 
3  Olive - Non-Linear Video Editor
4  Copyright (C) 2019 Olive Team
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 ***/
20 
21 #ifndef OLIVEGLOBAL_H
22 #define OLIVEGLOBAL_H
23 
24 #include "project/undo.h"
25 
26 #include <QTimer>
27 #include <QFile>
28 
34 class OliveGlobal : public QObject {
35  Q_OBJECT
36 public:
42  OliveGlobal();
43 
49  const QString& get_project_file_filter();
50 
64  void update_project_filename(const QString& s);
65 
74 
91  void set_rendering_state(bool rendering);
92 
103  void load_project_on_launch(const QString& s);
104 
110 
111 public slots:
115  void undo();
116 
120  void redo();
121 
129  void paste();
130 
139  void paste_insert();
140 
147  void new_project();
148 
155  void open_project();
156 
166  void open_recent(int index);
167 
178  bool save_project_as();
179 
190  bool save_project();
191 
204  bool can_close_project();
205 
209  void open_export_dialog();
210 
214  void open_about_dialog();
215 
219  void open_debug_log();
220 
224  void open_speed_dialog();
225 
229  void open_action_search();
230 
236  void clear_undo_stack();
237 
244  void finished_initialize();
245 
252  void save_autorecovery_file();
253 
257  void open_preferences();
258 
259 private:
276  void open_project_worker(const QString& fn, bool autorecovery);
277 
282 
287 
292 
293 
294 private slots:
295 
296 };
297 
298 namespace Olive {
302  extern QSharedPointer<OliveGlobal> Global;
303 
310  extern QString ActiveProjectFilename;
311 
315  extern QString AppName;
316 }
317 
318 #endif // OLIVEGLOBAL_H
void open_debug_log()
Open the Debug Log window.
Definition: oliveglobal.cpp:290
bool save_project_as()
Shows a save file dialog and saves the project as the resulting filename.
Definition: oliveglobal.cpp:154
void check_for_autorecovery_file()
Check whether an auto-recovery file exists and ask the user if they want to load it.
Definition: oliveglobal.cpp:77
QTimer autorecovery_timer
Regular interval to save an auto-recovery project.
Definition: oliveglobal.h:286
void load_project_on_launch(const QString &s)
Set a project to load just after launching.
Definition: oliveglobal.cpp:103
void set_rendering_state(bool rendering)
Set the application state depending on if the user is exporting a video.
Definition: oliveglobal.cpp:94
void redo()
Redo user's last action.
Definition: oliveglobal.cpp:265
void save_autorecovery_file()
Save an auto-recovery file of the current project.
Definition: oliveglobal.cpp:235
void clear_undo_stack()
Clears the current undo stack.
Definition: oliveglobal.cpp:307
OliveGlobal()
OliveGlobal Constructor.
Definition: oliveglobal.cpp:50
void open_recent(int index)
Open recent project from list.
Definition: oliveglobal.cpp:138
void open_preferences()
Opens the Preferences dialog.
Definition: oliveglobal.cpp:242
void finished_initialize()
Function called when Olive has finished starting up.
Definition: oliveglobal.cpp:209
void paste_insert()
Paste contents of clipboard, making space for it when possible.
Definition: oliveglobal.cpp:279
QString get_recent_project_list_file()
Retrieves the URL of the config file containing the autorecovery projects.
Definition: oliveglobal.cpp:108
void open_action_search()
Open the Action Search overlay.
Definition: oliveglobal.cpp:311
void open_project()
Open a project from file.
Definition: oliveglobal.cpp:131
const QString & get_project_file_filter()
Returns the file dialog filter used when interfacing with Olive project files.
Definition: oliveglobal.cpp:65
void paste()
Paste contents of clipboard.
Definition: oliveglobal.cpp:273
bool can_close_project()
Determine whether the current project can be closed.
Definition: oliveglobal.cpp:176
void update_project_filename(const QString &s)
Change the current active project filename.
Definition: oliveglobal.cpp:69
bool save_project()
Saves the current project to file.
Definition: oliveglobal.cpp:167
bool enable_load_project_on_init
Internal variable set to TRUE by main() if a project file was set as an argument.
Definition: oliveglobal.h:291
The Olive Global class.
Definition: oliveglobal.h:34
void open_export_dialog()
Open the Export dialog to trigger an export of the current sequence.
Definition: oliveglobal.cpp:197
void open_project_worker(const QString &fn, bool autorecovery)
Internal function to handle loading a project from file.
Definition: oliveglobal.cpp:251
void open_speed_dialog()
Open the Speed/Duration dialog.
Definition: oliveglobal.cpp:294
void new_project()
Create new project.
Definition: oliveglobal.cpp:112
QString project_file_filter
File filter used for any file dialogs relating to Olive project files.
Definition: oliveglobal.h:281
void undo()
Undo user's last action.
Definition: oliveglobal.cpp:257
void open_about_dialog()
Open the About Olive dialog.
Definition: oliveglobal.cpp:285