|
Olive
|
The Olive Global class. More...
#include <oliveglobal.h>
Public Slots | |
| void | undo () |
| Undo user's last action. | |
| void | redo () |
| Redo user's last action. | |
| void | paste () |
| Paste contents of clipboard. More... | |
| void | paste_insert () |
| Paste contents of clipboard, making space for it when possible. More... | |
| void | new_project () |
| Create new project. More... | |
| void | open_project () |
| Open a project from file. More... | |
| void | open_recent (int index) |
| Open recent project from list. More... | |
| bool | save_project_as () |
| Shows a save file dialog and saves the project as the resulting filename. More... | |
| bool | save_project () |
| Saves the current project to file. More... | |
| bool | can_close_project () |
| Determine whether the current project can be closed. More... | |
| void | open_export_dialog () |
| Open the Export dialog to trigger an export of the current sequence. | |
| void | open_about_dialog () |
| Open the About Olive dialog. | |
| void | open_debug_log () |
| Open the Debug Log window. | |
| void | open_speed_dialog () |
| Open the Speed/Duration dialog. | |
| void | open_action_search () |
| Open the Action Search overlay. | |
| void | clear_undo_stack () |
| Clears the current undo stack. More... | |
| void | finished_initialize () |
| Function called when Olive has finished starting up. More... | |
| void | save_autorecovery_file () |
| Save an auto-recovery file of the current project. More... | |
| void | open_preferences () |
| Opens the Preferences dialog. | |
Public Member Functions | |
| OliveGlobal () | |
| OliveGlobal Constructor. More... | |
| const QString & | get_project_file_filter () |
| Returns the file dialog filter used when interfacing with Olive project files. More... | |
| void | update_project_filename (const QString &s) |
| Change the current active project filename. More... | |
| void | check_for_autorecovery_file () |
| Check whether an auto-recovery file exists and ask the user if they want to load it. More... | |
| void | set_rendering_state (bool rendering) |
| Set the application state depending on if the user is exporting a video. More... | |
| void | load_project_on_launch (const QString &s) |
| Set a project to load just after launching. More... | |
| QString | get_recent_project_list_file () |
| Retrieves the URL of the config file containing the autorecovery projects. More... | |
Private Member Functions | |
| void | open_project_worker (const QString &fn, bool autorecovery) |
| Internal function to handle loading a project from file. More... | |
Private Attributes | |
| QString | project_file_filter |
| File filter used for any file dialogs relating to Olive project files. | |
| QTimer | autorecovery_timer |
| Regular interval to save an auto-recovery project. | |
| bool | enable_load_project_on_init |
| Internal variable set to TRUE by main() if a project file was set as an argument. | |
The Olive Global class.
A resource for various global functions used throughout Olive.
| OliveGlobal::OliveGlobal | ( | ) |
OliveGlobal Constructor.
Creates Olive Global object. Also sets some default runtime settings and the application name.
|
slot |
Determine whether the current project can be closed.
Queried any time the current project is going to be closed (e.g. starting a new project, loading a project, exiting Olive, etc.) If the project has unsaved changes, this function asks the user whether they want to save or not. If the user does, calls save_project() (which may in turn call save_project_as() if the project has never been saved).
| void OliveGlobal::check_for_autorecovery_file | ( | ) |
Check whether an auto-recovery file exists and ask the user if they want to load it.
Usually called on initialization. Checks if an auto-recovery file exists (meaning the last session of Olive didn't close correctly). If it finds one, asks the user if they want to load it. If so, loads the auto-recovery project.
|
slot |
Clears the current undo stack.
Clears all current commands in the undo stack. Mostly used for debugging.
|
slot |
Function called when Olive has finished starting up.
Sets up some last things for Olive that must be run after Olive has completed initialization. If a project was loaded as a command line argument, it's loaded here.
| const QString & OliveGlobal::get_project_file_filter | ( | ) |
Returns the file dialog filter used when interfacing with Olive project files.
| QString OliveGlobal::get_recent_project_list_file | ( | ) |
Retrieves the URL of the config file containing the autorecovery projects.
| void OliveGlobal::load_project_on_launch | ( | const QString & | s | ) |
Set a project to load just after launching.
Called by main() if Olive was called with a project file as a running argument. Sets up Olive to load the specified project once its finished initializing.
| s | The URL of the project file to load. |
|
slot |
Create new project.
Confirms whether the current project can be closed, and if so, clears all current project data and resets program state. Standard File > New behavior.
|
slot |
Open a project from file.
Confirms whether the current project can be closed, and if so, shows an open file dialog to allow the user to select a project file and then triggers a project load with it.
|
private |
Internal function to handle loading a project from file.
Start loading a project. Doesn't check if the current project can be closed, doesn't check if the project exists. In most cases, you'll want open_project() to be end-user friendly.
| fn | The URL to the project to load. |
| autorecovery | Whether this file is an autorecovery file. If it is, after the load Olive will set the project URL to a new file beside the original project file so that it does not overwrite the original and so that the user is not working on the autorecovery project in Olive's application data directory. |
|
slot |
Open recent project from list.
Triggers a project load from the internal recent projects list.
| index | Index in the list of the project fille to load |
|
slot |
Paste contents of clipboard.
Pastes contents of clipboard. Seeing as several types of data can be copied into the clipboard, this function will automatically determine what type of data is in the clipboard and paste it in the correct location (e.g. clip data will go to the Timeline, effect data will go to Effect Controls).
|
slot |
Paste contents of clipboard, making space for it when possible.
Pastes contents of clipboard (same as paste()). If the clipboard contains clip data, the clips are cut at the current playhead and ripple forward to make space for the clips in the clipboard. Can be considered semi-non-destructive as a result (as opposed to paste() overwriting clips). If the clipboard contains effect data, the functionality is identical to paste().
|
slot |
Save an auto-recovery file of the current project.
Call this function to save the current state of the project as an auto-recovery project. Called regularly by autorecovery_timer.
|
slot |
Saves the current project to file.
If the project has been saved already, this function will overwrite the project file with the current project data. Calls save_project_as() if the file has not been saved before.
|
slot |
Shows a save file dialog and saves the project as the resulting filename.
Shows a save file dialog for the user to save their current project as a different filename from the current one. Also triggered by save_project() if the file hasn't been saved yet.
| void OliveGlobal::set_rendering_state | ( | bool | rendering | ) |
Set the application state depending on if the user is exporting a video.
Some background functions shouldn't run while Olive is exporting a video. This function will disable/enable them as necessary.
The current functions are as follows:
| rendering | TRUE if Olive is about to export a video. FALSE if Olive has finished exporting. |
| void OliveGlobal::update_project_filename | ( | const QString & | s | ) |
Change the current active project filename.
Triggered to change the current active project filename. Call this before calling any internal project saving or loading functions in order to set which file to work with (OliveGlobal::open_project() and OliveGlobal::save_project_as() do this automatically). Also updates the main window title to reflect the project filename.
| s | The URL of the project file to work with. Can be an empty string, in which case Olive will treat the project as an unsaved project. |
1.8.15