# memberdef

name: updateTitle
definition: void MainWindow::updateTitle
type: void
argsstring: ()
scope: MainWindow
kind: function
briefdescription: <para>Update window title. </para>
detaileddescription:
<para>Updates the window title to reflect the current project filename. Call if the project filename changes.</para>
<para>NOTE: It's recommended to use update_project_filename() from Olive::Global to update the filename completely instead of calling this function directly (update_project_filename() calls this function in the process). </para>


name: load_shortcuts
definition: void MainWindow::load_shortcuts
type: void
argsstring: (const QString &fn)
scope: MainWindow
kind: function
briefdescription: <para>Load shortcut file. </para>
detaileddescription:
<para>Loads a shortcut configuration from file and sets Olive to use them.</para>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>fn</parametername>
</parameternamelist>
<parameterdescription>
<para>URL of the shortcut file to be loaded </para>
</parameterdescription>
</parameteritem>
</parameterlist>
</para>


name: save_shortcuts
definition: void MainWindow::save_shortcuts
type: void
argsstring: (const QString &fn)
scope: MainWindow
kind: function
briefdescription: <para>Save shortcut file. </para>
detaileddescription:
<para>Saves the current shortcut configuration to file. Only saves shortcuts that have been changed from default.</para>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>fn</parametername>
</parameternamelist>
<parameterdescription>
<para>URL to save the shortcut file to. </para>
</parameterdescription>
</parameteritem>
</parameterlist>
</para>


name: load_css_from_file
definition: void MainWindow::load_css_from_file
type: void
argsstring: (const QString &fn)
scope: MainWindow
kind: function
briefdescription: <para>Load a CSS/QSS style from file to customize Olive's interface. </para>
detaileddescription:
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>fn</parametername>
</parameternamelist>
<parameterdescription>
<para>URL to load the CSS file from. </para>
</parameterdescription>
</parameteritem>
</parameterlist>
</para>


name: finished_first_paint
definition: void MainWindow::finished_first_paint
type: void
argsstring: ()
scope: MainWindow
kind: signal
briefdescription: <para>Signal emitted once when the main window has finished initializing. </para>
detaileddescription:
<para>Emitted the first time paintEvent runs. Connect this to functions that must be completed post-initialization. </para>


name: closeEvent
definition: void MainWindow::closeEvent
type: void
argsstring: (QCloseEvent *) override
scope: MainWindow
kind: function
briefdescription: <para>Close event. </para>
detaileddescription:
<para>Confirms whether the project can be closed, and if so performs various clean-up functions before the application exits. It's preferable to call clean-up functions here rather than in the destructor because this will get called first. </para>


name: paintEvent
definition: void MainWindow::paintEvent
type: void
argsstring: (QPaintEvent *) override
scope: MainWindow
kind: function
briefdescription: <para>Paint event. </para>
detaileddescription:
<para>Overridden to provide the <ref refid="class_main_window_1ad87af70df9998f4a30b5c5bba7eace41" kindref="member">finished_first_paint()</ref> signal. </para>


name: maximize_panel
definition: void MainWindow::maximize_panel
type: void
argsstring: ()
scope: MainWindow
kind: slot
briefdescription: <para>Maximizes the currently hovered panel. </para>
detaileddescription:
<para>Saves the current state of the panels/dock widgets and removes all except the currently hovered panel, effectively maximizing the panel to the entire window. </para>


name: editMenu_About_To_Be_Shown
definition: void MainWindow::editMenu_About_To_Be_Shown
type: void
argsstring: ()
scope: MainWindow
kind: slot
briefdescription: <para>Function to prepare Edit menu. </para>
detaileddescription:
<para>Primarily used to set the enabled state on Undo and Redo depending if there are undos/redos available. </para>


name: windowMenu_About_To_Be_Shown
definition: void MainWindow::windowMenu_About_To_Be_Shown
type: void
argsstring: ()
scope: MainWindow
kind: slot
briefdescription: <para>Function to prepare Window menu. </para>
detaileddescription:
<para>Primarily used to set the checked state of menu items corresponding to the panels that are currently visible. </para>


name: viewMenu_About_To_Be_Shown
definition: void MainWindow::viewMenu_About_To_Be_Shown
type: void
argsstring: ()
scope: MainWindow
kind: slot
briefdescription: <para>Function to prepare View menu. </para>
detaileddescription:
<para>Primarily used to set the checked state of various options in the view menu (e.g. title safe area, timecode units, etc.) </para>


name: toolMenu_About_To_Be_Shown
definition: void MainWindow::toolMenu_About_To_Be_Shown
type: void
argsstring: ()
scope: MainWindow
kind: slot
briefdescription: <para>Function to prepare Tools menu. </para>
detaileddescription:
<para>Primarily used to set the checked state on various settings available from the Tools menu. </para>


name: toggle_panel_visibility
definition: void MainWindow::toggle_panel_visibility
type: void
argsstring: ()
scope: MainWindow
kind: slot
briefdescription: <para>Toggle whether a panel is visible or not. </para>
detaileddescription:
<para>Assumes the sender() QAction has a pointer to a QDockWidget in its data variable. Casts it and toggles its visibility. </para>


name: setup_layout
definition: void MainWindow::setup_layout
type: void
argsstring: (bool reset)
scope: MainWindow
kind: function
briefdescription: <para>Internal function for setting the panel layout to a predetermined preset. </para>
detaileddescription:
<para>Resets layout to default and optionally loads a layout from file. If loading from file, this function will always load from <computeroutput>get_config_path() + "/layout"</computeroutput>.</para>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>reset</parametername>
</parameternamelist>
<parameterdescription>
<para><bold>TRUE</bold> if this function should just reset the current layout. <bold>FALSE</bold> if it should load from the aforementioned layout file. </para>
</parameterdescription>
</parameteritem>
</parameterlist>
</para>


name: setup_menus
definition: void MainWindow::setup_menus
type: void
argsstring: ()
scope: MainWindow
kind: function
briefdescription: <para>Initialize menu bar menus and items. </para>
detaileddescription:
<para>Internal initialization function for all menus and menu items in the main window. Called once from the <ref refid="class_main_window" kindref="compound">MainWindow()</ref> constructor. </para>


name: enable_load_project_on_init
definition: bool OliveGlobal::enable_load_project_on_init
type: bool
scope: OliveGlobal
kind: variable
briefdescription:
<para>Internal variable set to <bold>TRUE</bold> by main() if a project file was set as an argument. </para>


name: OliveGlobal
definition: OliveGlobal::OliveGlobal
argsstring: ()
scope: OliveGlobal
kind: function
briefdescription: <para><ref refid="class_olive_global" kindref="compound">OliveGlobal</ref> Constructor. </para>
detaileddescription:
<para>Creates Olive Global object. Also sets some default runtime settings and the application name. </para>


name: get_project_file_filter
definition: const QString & OliveGlobal::get_project_file_filter
type: const QString &
argsstring: ()
scope: OliveGlobal
kind: function
briefdescription: <para>Returns the file dialog filter used when interfacing with Olive project files. </para>
detaileddescription:
<para><simplesect kind="return"><para>The file filter string used by QFileDialog to limit the files shown to Olive (*.ove) files. </para>
</simplesect>
</para>


name: update_project_filename
definition: void OliveGlobal::update_project_filename
type: void
argsstring: (const QString &s)
scope: OliveGlobal
kind: function
briefdescription: <para>Change the current active project filename. </para>
detaileddescription:
<para>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 (<ref refid="class_olive_global_1aaa945027c0f85fe2b65ad7be5997e02f" kindref="member">OliveGlobal::open_project()</ref> and <ref refid="class_olive_global_1ab3f5f0874214f7ecac66d7ab152a8141" kindref="member">OliveGlobal::save_project_as()</ref> do this automatically). Also updates the main window title to reflect the project filename.</para>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>s</parametername>
</parameternamelist>
<parameterdescription>
<para>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. </para>
</parameterdescription>
</parameteritem>
</parameterlist>
</para>


name: check_for_autorecovery_file
definition: void OliveGlobal::check_for_autorecovery_file
type: void
argsstring: ()
scope: OliveGlobal
kind: function
briefdescription: <para>Check whether an auto-recovery file exists and ask the user if they want to load it. </para>
detaileddescription:
<para>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. </para>


name: set_rendering_state
definition: void OliveGlobal::set_rendering_state
type: void
argsstring: (bool rendering)
scope: OliveGlobal
kind: function
briefdescription: <para>Set the application state depending on if the user is exporting a video. </para>
detaileddescription:
<para>Some background functions shouldn't run while Olive is exporting a video. This function will disable/enable them as necessary.</para>
<para>The current functions are as follows:<itemizedlist>
<listitem><para>Auto-recovery interval. Olive saves an auto-recovery just before exporting anyway and seeing as the user cannot make changes while rendering, there's no reason to continue saving auto-recovery files.</para>
</listitem><listitem><para>Audio device playback. Olive uses the same internal audio buffer for exporting as it does for playback, but this buffer does not need to be forwarded to the output device when exporting.</para>
</listitem></itemizedlist>
</para>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>rendering</parametername>
</parameternamelist>
<parameterdescription>
<para><bold>TRUE</bold> if Olive is about to export a video. <bold>FALSE</bold> if Olive has finished exporting. </para>
</parameterdescription>
</parameteritem>
</parameterlist>
</para>


name: load_project_on_launch
definition: void OliveGlobal::load_project_on_launch
type: void
argsstring: (const QString &s)
scope: OliveGlobal
kind: function
briefdescription: <para>Set a project to load just after launching. </para>
detaileddescription:
<para>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.</para>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>s</parametername>
</parameternamelist>
<parameterdescription>
<para>The URL of the project file to load. </para>
</parameterdescription>
</parameteritem>
</parameterlist>
</para>


name: paste
definition: void OliveGlobal::paste
type: void
argsstring: ()
scope: OliveGlobal
kind: slot
briefdescription: <para>Paste contents of clipboard. </para>
detaileddescription:
<para>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). </para>


name: paste_insert
definition: void OliveGlobal::paste_insert
type: void
argsstring: ()
scope: OliveGlobal
kind: slot
briefdescription: <para>Paste contents of clipboard, making space for it when possible. </para>
detaileddescription:
<para>Pastes contents of clipboard (same as <ref refid="class_olive_global_1a8574a0c2c68978756671d0289ca9e8ff" kindref="member">paste()</ref>). 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 <ref refid="class_olive_global_1a8574a0c2c68978756671d0289ca9e8ff" kindref="member">paste()</ref> overwriting clips). If the clipboard contains effect data, the functionality is identical to <ref refid="class_olive_global_1a8574a0c2c68978756671d0289ca9e8ff" kindref="member">paste()</ref>. </para>


name: new_project
definition: void OliveGlobal::new_project
type: void
argsstring: ()
scope: OliveGlobal
kind: slot
briefdescription: <para>Create new project. </para>
detaileddescription:
<para>Confirms whether the current project can be closed, and if so, clears all current project data and resets program state. Standard <computeroutput>File > New</computeroutput> behavior. </para>


name: open_project
definition: void OliveGlobal::open_project
type: void
argsstring: ()
scope: OliveGlobal
kind: slot
briefdescription: <para>Open a project from file. </para>
detaileddescription:
<para>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. </para>


name: open_recent
definition: void OliveGlobal::open_recent
type: void
argsstring: (int index)
scope: OliveGlobal
kind: slot
briefdescription: <para>Open recent project from list. </para>
detaileddescription:
<para>Triggers a project load from the internal recent projects list.</para>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>index</parametername>
</parameternamelist>
<parameterdescription>
<para>Index in the list of the project fille to load </para>
</parameterdescription>
</parameteritem>
</parameterlist>
</para>


name: save_project_as
definition: bool OliveGlobal::save_project_as
type: bool
argsstring: ()
scope: OliveGlobal
kind: slot
briefdescription: <para>Shows a save file dialog and saves the project as the resulting filename. </para>
detaileddescription:
<para>Shows a save file dialog for the user to save their current project as a different filename from the current one. Also triggered by <ref refid="class_olive_global_1a465ffe390d9b615ed8216d2335039197" kindref="member">save_project()</ref> if the file hasn't been saved yet.</para>
<para><simplesect kind="return"><para><bold>TRUE</bold> if the user saved the project. <bold>FALSE</bold> if they cancelled out of the save file dialog. Useful if a user is closing an unsaved project, clicks "Yes" to save, we know if they actually saved or not and won't continue closing the project if they didn't. </para>
</simplesect>
</para>


name: save_project
definition: bool OliveGlobal::save_project
type: bool
argsstring: ()
scope: OliveGlobal
kind: slot
briefdescription: <para>Saves the current project to file. </para>
detaileddescription:
<para>If the project has been saved already, this function will overwrite the project file with the current project data. Calls <ref refid="class_olive_global_1ab3f5f0874214f7ecac66d7ab152a8141" kindref="member">save_project_as()</ref> if the file has not been saved before.</para>
<para><simplesect kind="return"><para><bold>TRUE</bold> if the project has been saved before and was successfully overwritten. Otherwise returns the value of <ref refid="class_olive_global_1ab3f5f0874214f7ecac66d7ab152a8141" kindref="member">save_project_as()</ref>. Useful if the user closing an unsaved project, clicks "Yes" to save, we know if they actually saved or not and won't continue closing the project if they didn't. </para>
</simplesect>
</para>


name: can_close_project
definition: bool OliveGlobal::can_close_project
type: bool
argsstring: ()
scope: OliveGlobal
kind: slot
briefdescription: <para>Determine whether the current project can be closed. </para>
detaileddescription:
<para>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 <ref refid="class_olive_global_1a465ffe390d9b615ed8216d2335039197" kindref="member">save_project()</ref> (which may in turn call <ref refid="class_olive_global_1ab3f5f0874214f7ecac66d7ab152a8141" kindref="member">save_project_as()</ref> if the project has never been saved).</para>
<para><simplesect kind="return"><para><bold>TRUE</bold> if the project can be closed. FALSE if not. If the project does NOT have unsaved changes, always returns <bold>TRUE</bold>. If it does and the user clicks YES, this returns the result of <ref refid="class_olive_global_1a465ffe390d9b615ed8216d2335039197" kindref="member">save_project()</ref>. If the user clicks NO, this returns <bold>TRUE</bold>. If the user clicks CANCEL, this returns <bold>FALSE</bold>. </para>
</simplesect>
</para>


name: finished_initialize
definition: void OliveGlobal::finished_initialize
type: void
argsstring: ()
scope: OliveGlobal
kind: slot
briefdescription: <para>Function called when Olive has finished starting up. </para>
detaileddescription:
<para>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. </para>


name: save_autorecovery_file
definition: void OliveGlobal::save_autorecovery_file
type: void
argsstring: ()
scope: OliveGlobal
kind: slot
briefdescription: <para>Save an auto-recovery file of the current project. </para>
detaileddescription:
<para>Call this function to save the current state of the project as an auto-recovery project. Called regularly by <computeroutput>autorecovery_timer</computeroutput>. </para>


name: open_project_worker
definition: void OliveGlobal::open_project_worker
type: void
argsstring: (const QString &fn, bool autorecovery)
scope: OliveGlobal
kind: function
briefdescription: <para>Internal function to handle loading a project from file. </para>
detaileddescription:
<para>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 <ref refid="class_olive_global_1aaa945027c0f85fe2b65ad7be5997e02f" kindref="member">open_project()</ref> to be end-user friendly.</para>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>fn</parametername>
</parameternamelist>
<parameterdescription>
<para>The URL to the project to load.</para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>autorecovery</parametername>
</parameternamelist>
<parameterdescription>
<para>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. </para>
</parameterdescription>
</parameteritem>
</parameterlist>
</para>


name: ActiveProjectFilename
definition: QString Olive::ActiveProjectFilename
type: QString
scope: Olive
kind: variable
briefdescription: <para>Currently active project filename. </para>
detaileddescription:
<para>Filename for the currently active project. Empty means the file has not been saved yet. </para>


# compounddef

name: md_README
title: Olive Video Editor
kind: page
detaileddescription:
<para>Olive is a free non-linear video editor for Windows, macOS, and Linux.</para>
<para>Discover more and download binaries at: <ulink url="https://www.olivevideoeditor.org/">https://www.olivevideoeditor.org/</ulink></para>
<para>Please consider supporting Olive:</para>
<para><ulink url="https://www.patreon.com/olivevideoeditor"><image type="html" name="become_a_patron_button.png" inline="yes">></image>
</ulink></para>
<para>Compiling instructions for Windows, macOS, and Linux can be found <ulink url="https://olivevideoeditor.org/compile.php">on the main site</ulink>. </para>


