Olive
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
ExportDialog Class Reference

The ExportDialog class. More...

#include <exportdialog.h>

Inheritance diagram for ExportDialog:

Public Member Functions

 ExportDialog (QWidget *parent)
 ExportDialog Constructor. More...
 

Private Slots

void format_changed (int index)
 Slot for when the user changes the format. More...
 
void StartExport ()
 Slot for when the user clicks the Export button. More...
 
void update_progress_bar (int value, qint64 remaining_ms)
 Slot for the export thread to update the progress bar's value. More...
 
void export_thread_finished ()
 Slot for the export thread completing (both succeeding and failing) More...
 
void vcodec_changed (int index)
 Slot for when the video codec changes. More...
 
void comp_type_changed (int index)
 Slot for when the compression type changes. More...
 
void open_advanced_video_dialog ()
 Slot to open the Advanced Video Dialog. More...
 

Private Member Functions

void setup_ui ()
 Function to create UI objects. More...
 
void prep_ui_for_render (bool r)
 Enables/disables certain UI objects based on the exporting state. More...
 
void add_codec_to_combobox (QComboBox *box, enum AVCodecID codec)
 Retrieves the human-readable name of an AVCodecID and adds it to a QComboBox. More...
 

Private Attributes

QVector< QString > format_strings
 Internal array of human-readable names corresponding to enum ExportFormats. More...
 
ExportThreadexport_thread_
 Pointer to an ExportThread. More...
 
VideoCodecParams vcodec_params
 Struct for advanced video codec parameters. More...
 
QComboBox * rangeCombobox
 ComboBox for selecting the time range of the Sequence to export. More...
 
QSpinBox * widthSpinbox
 SpinBox for the exported video's width. More...
 
QDoubleSpinBox * videobitrateSpinbox
 SpinBox for the exported video's bitrate. More...
 
QLabel * videoBitrateLabel
 Label for the exported video's bitrate - changes depending on the compression type. More...
 
QDoubleSpinBox * framerateSpinbox
 SpinBox for the exported video's frame rate. More...
 
QComboBox * vcodecCombobox
 ComboBox for the exported video codec. More...
 
QComboBox * acodecCombobox
 ComboBox for the exported audio's codec. More...
 
QSpinBox * samplingRateSpinbox
 SpinBox for the exported audio's sample rate. More...
 
QSpinBox * audiobitrateSpinbox
 SpinBox for the exported audio's bitrate. More...
 
QProgressBar * progressBar
 Progress bar for visually showing the export progress. More...
 
QComboBox * formatCombobox
 ComboBox for the exported video's format. More...
 
QSpinBox * heightSpinbox
 SpinBox for the exported video's height. More...
 
QPushButton * export_button
 Export button to trigger the start of an export. More...
 
QPushButton * cancel_button
 Dialog cancel button to close this dialog. More...
 
QPushButton * renderCancel
 Cancel button to abort the export before completion. More...
 
QGroupBox * videoGroupbox
 GroupBox containing all video-related UI objects. More...
 
QGroupBox * audioGroupbox
 GroupBox containing all audio-related UI objects. More...
 
QComboBox * compressionTypeCombobox
 ComboBox for the exported video compression type. More...
 
qint64 total_export_time_start
 Time value set when exporting begins to determine the total duration of the export. More...
 

Detailed Description

The ExportDialog class.

The dialog to initiate an export. Requires a valid Sequence to be set in olive::ActiveSequence or the result is defined (most likely a crash), so you should always do a nullptr check on olive::ActiveSequence before constructing this dialog.

Constructor & Destructor Documentation

ExportDialog::ExportDialog ( QWidget *  parent)
explicit

ExportDialog Constructor.

Parameters
parentQWidget parent. Usually MainWindow.

Member Function Documentation

void ExportDialog::add_codec_to_combobox ( QComboBox *  box,
enum AVCodecID  codec 
)
private

Retrieves the human-readable name of an AVCodecID and adds it to a QComboBox.

Also sets that item's data to the AVCodecID so it can be retrieved directly from the QComboBox.

Parameters
boxThe QComboBox to add the item to.
codecThe codec to add to the QComboBox.
void ExportDialog::comp_type_changed ( int  index)
privateslot

Slot for when the compression type changes.

Different UI objects should be displayed for different compression types.

Parameters
indexUnused.
void ExportDialog::export_thread_finished ( )
privateslot

Slot for the export thread completing (both succeeding and failing)

Runs whenever the thread has finished. Determines whether the thread succeeded or not (and shows an error message if not), cleans up the ExportThread object, sets the UI state back to normal.

Connect to ExportThread::finished().

void ExportDialog::format_changed ( int  index)
privateslot

Slot for when the user changes the format.

Used to populate the available codecs list for this format.

Parameters
indexCurrent format index (corresponding to enum ExportFormats)
void ExportDialog::open_advanced_video_dialog ( )
privateslot

Slot to open the Advanced Video Dialog.

Opens a dialog for setting more advanced video settings and passes a reference to vcodec_params to it.

void ExportDialog::prep_ui_for_render ( bool  r)
private

Enables/disables certain UI objects based on the exporting state.

Some UI controls don't need to be set while exporting. This function enables/disables them appropriately.

Parameters
rTRUE if we're exporting, FALSE if we finished.
void ExportDialog::setup_ui ( )
private

Function to create UI objects.

void ExportDialog::StartExport ( )
privateslot

Slot for when the user clicks the Export button.

Asks the user for the file to save to.

void ExportDialog::update_progress_bar ( int  value,
qint64  remaining_ms 
)
privateslot

Slot for the export thread to update the progress bar's value.

Parameters
valueAn value between 0 - 100. A percentage of the Sequence that has been exported so far.
remaining_msThe estimated time in milliseconds that it will take to complete the rest of the Sequence.
void ExportDialog::vcodec_changed ( int  index)
privateslot

Slot for when the video codec changes.

Some video codecs require different settings. In the case of that, this function sorts through those.

Parameters
indexCurrent vcodecCombobox index - its item data contains the AVCodecID.

Member Data Documentation

QComboBox* ExportDialog::acodecCombobox
private

ComboBox for the exported audio's codec.

QSpinBox* ExportDialog::audiobitrateSpinbox
private

SpinBox for the exported audio's bitrate.

QGroupBox* ExportDialog::audioGroupbox
private

GroupBox containing all audio-related UI objects.

QPushButton* ExportDialog::cancel_button
private

Dialog cancel button to close this dialog.

QComboBox* ExportDialog::compressionTypeCombobox
private

ComboBox for the exported video compression type.

QPushButton* ExportDialog::export_button
private

Export button to trigger the start of an export.

ExportThread* ExportDialog::export_thread_
private

Pointer to an ExportThread.

Set when exporting starts, and deleted by export_thread_finished() when the thread is complete.

QVector<QString> ExportDialog::format_strings
private

Internal array of human-readable names corresponding to enum ExportFormats.

QComboBox* ExportDialog::formatCombobox
private

ComboBox for the exported video's format.

QDoubleSpinBox* ExportDialog::framerateSpinbox
private

SpinBox for the exported video's frame rate.

QSpinBox* ExportDialog::heightSpinbox
private

SpinBox for the exported video's height.

QProgressBar* ExportDialog::progressBar
private

Progress bar for visually showing the export progress.

QComboBox* ExportDialog::rangeCombobox
private

ComboBox for selecting the time range of the Sequence to export.

QPushButton* ExportDialog::renderCancel
private

Cancel button to abort the export before completion.

QSpinBox* ExportDialog::samplingRateSpinbox
private

SpinBox for the exported audio's sample rate.

qint64 ExportDialog::total_export_time_start
private

Time value set when exporting begins to determine the total duration of the export.

VideoCodecParams ExportDialog::vcodec_params
private

Struct for advanced video codec parameters.

More advanced video encoding parameters to be sent to the ExportThread. These variables are not directly editable in this dialog, instead calling open_advanced_video_dialog() will open an AdvancedVideoDialog for setting these values directly. vcodec_changed() should also set these to the defaults for that codec where appropriate.

QComboBox* ExportDialog::vcodecCombobox
private

ComboBox for the exported video codec.

QLabel* ExportDialog::videoBitrateLabel
private

Label for the exported video's bitrate - changes depending on the compression type.

QDoubleSpinBox* ExportDialog::videobitrateSpinbox
private

SpinBox for the exported video's bitrate.

QGroupBox* ExportDialog::videoGroupbox
private

GroupBox containing all video-related UI objects.

QSpinBox* ExportDialog::widthSpinbox
private

SpinBox for the exported video's width.


The documentation for this class was generated from the following files: