diff --git a/debug.cpp b/debug.cpp index 70b605938..f949f07ac 100644 --- a/debug.cpp +++ b/debug.cpp @@ -85,8 +85,8 @@ void debug_message_handler(QtMsgType type, const QMessageLogContext &context, co fflush(stderr); // abort(); } - if (Olive::DebugDialog != nullptr && Olive::DebugDialog->isVisible()) { - QMetaObject::invokeMethod(Olive::DebugDialog, "update_log", Qt::QueuedConnection); + if (olive::DebugDialog != nullptr && olive::DebugDialog->isVisible()) { + QMetaObject::invokeMethod(olive::DebugDialog, "update_log", Qt::QueuedConnection); } debug_mutex.unlock(); } diff --git a/dialogs/actionsearch.cpp b/dialogs/actionsearch.cpp index ffe85fc71..a21a2ef3d 100644 --- a/dialogs/actionsearch.cpp +++ b/dialogs/actionsearch.cpp @@ -63,7 +63,7 @@ ActionSearch::ActionSearch(QWidget *parent) : void ActionSearch::search_update(const QString &s, const QString &p, QMenu *parent) { if (parent == nullptr) { list_widget->clear(); - QList menus = Olive::MainWindow->menuBar()->actions(); + QList menus = olive::MainWindow->menuBar()->actions(); for (int i=0;imenu(); search_update(s, p, menu); diff --git a/dialogs/debugdialog.cpp b/dialogs/debugdialog.cpp index c15adcfea..b45fb66f7 100644 --- a/dialogs/debugdialog.cpp +++ b/dialogs/debugdialog.cpp @@ -26,7 +26,7 @@ #include "debug.h" -DebugDialog* Olive::DebugDialog = nullptr; +DebugDialog* olive::DebugDialog = nullptr; DebugDialog::DebugDialog(QWidget *parent) : QDialog(parent) { setWindowTitle(tr("Debug Log")); diff --git a/dialogs/debugdialog.h b/dialogs/debugdialog.h index b58c53833..9f9d146bb 100644 --- a/dialogs/debugdialog.h +++ b/dialogs/debugdialog.h @@ -36,7 +36,7 @@ private: QTextEdit* textEdit; }; -namespace Olive { +namespace olive { extern DebugDialog* DebugDialog; } diff --git a/dialogs/exportdialog.cpp b/dialogs/exportdialog.cpp index 7328e4b23..ee1d5d1e3 100644 --- a/dialogs/exportdialog.cpp +++ b/dialogs/exportdialog.cpp @@ -70,11 +70,11 @@ enum ExportFormats { ExportDialog::ExportDialog(QWidget *parent) : QDialog(parent) { - setWindowTitle(tr("Export \"%1\"").arg(Olive::ActiveSequence->name)); + setWindowTitle(tr("Export \"%1\"").arg(olive::ActiveSequence->name)); setup_ui(); rangeCombobox->setCurrentIndex(0); - if (Olive::ActiveSequence->using_workarea) { + if (olive::ActiveSequence->using_workarea) { rangeCombobox->setEnabled(true); rangeCombobox->setCurrentIndex(1); } @@ -107,10 +107,10 @@ ExportDialog::ExportDialog(QWidget *parent) : } formatCombobox->setCurrentIndex(FORMAT_MPEG4); - widthSpinbox->setValue(Olive::ActiveSequence->width); - heightSpinbox->setValue(Olive::ActiveSequence->height); - samplingRateSpinbox->setValue(Olive::ActiveSequence->audio_frequency); - framerateSpinbox->setValue(Olive::ActiveSequence->frame_rate); + widthSpinbox->setValue(olive::ActiveSequence->width); + heightSpinbox->setValue(olive::ActiveSequence->height); + samplingRateSpinbox->setValue(olive::ActiveSequence->audio_frequency); + framerateSpinbox->setValue(olive::ActiveSequence->frame_rate); } ExportDialog::~ExportDialog() @@ -524,10 +524,10 @@ void ExportDialog::export_action() { } params.start_frame = 0; - params.end_frame = Olive::ActiveSequence->getEndFrame(); // entire sequence + params.end_frame = olive::ActiveSequence->getEndFrame(); // entire sequence if (rangeCombobox->currentIndex() == 1) { - params.start_frame = qMax(Olive::ActiveSequence->workarea_in, params.start_frame); - params.end_frame = qMin(Olive::ActiveSequence->workarea_out, params.end_frame); + params.start_frame = qMax(olive::ActiveSequence->workarea_in, params.start_frame); + params.end_frame = qMin(olive::ActiveSequence->workarea_out, params.end_frame); } et = new ExportThread(params, vcodec_params, this); @@ -535,11 +535,11 @@ void ExportDialog::export_action() { connect(et, SIGNAL(finished()), this, SLOT(render_thread_finished())); connect(et, SIGNAL(progress_changed(int, qint64)), this, SLOT(update_progress_bar(int, qint64))); - closeActiveClips(Olive::ActiveSequence); + closeActiveClips(olive::ActiveSequence); - Olive::Global.data()->set_rendering_state(true); + olive::Global->set_rendering_state(true); - Olive::Global.data()->save_autorecovery_file(); + olive::Global->save_autorecovery_file(); prep_ui_for_render(true); @@ -605,7 +605,7 @@ void ExportDialog::comp_type_changed(int) { case COMPRESSION_TYPE_CBR: case COMPRESSION_TYPE_TARGETBR: videoBitrateLabel->setText(tr("Bitrate (Mbps):")); - videobitrateSpinbox->setValue(qMax(0.5, (double) qRound((0.01528 * Olive::ActiveSequence->height) - 4.5))); + videobitrateSpinbox->setValue(qMax(0.5, (double) qRound((0.01528 * olive::ActiveSequence->height) - 4.5))); break; case COMPRESSION_TYPE_CFR: videoBitrateLabel->setText(tr("Quality (CRF):")); diff --git a/dialogs/loaddialog.cpp b/dialogs/loaddialog.cpp index 35902a2a0..bd1d8ff6f 100644 --- a/dialogs/loaddialog.cpp +++ b/dialogs/loaddialog.cpp @@ -38,7 +38,7 @@ LoadDialog::LoadDialog(QWidget *parent, bool autorecovery) : QDialog(parent) { QVBoxLayout* layout = new QVBoxLayout(this); - layout->addWidget(new QLabel(tr("Loading '%1'...").arg(Olive::ActiveProjectFilename.mid(Olive::ActiveProjectFilename.lastIndexOf('/')+1)), this)); + layout->addWidget(new QLabel(tr("Loading '%1'...").arg(olive::ActiveProjectFilename.mid(olive::ActiveProjectFilename.lastIndexOf('/')+1)), this)); bar = new QProgressBar(this); bar->setValue(0); @@ -70,7 +70,7 @@ void LoadDialog::cancel() { } void LoadDialog::die() { - Olive::Global.data()->new_project(); + olive::Global->new_project(); reject(); } diff --git a/dialogs/mediapropertiesdialog.cpp b/dialogs/mediapropertiesdialog.cpp index d9be1c3a6..b004e3fdf 100644 --- a/dialogs/mediapropertiesdialog.cpp +++ b/dialogs/mediapropertiesdialog.cpp @@ -205,7 +205,7 @@ void MediaPropertiesDialog::accept() { } ca->appendPost(new UpdateViewer()); - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); QDialog::accept(); } diff --git a/dialogs/newsequencedialog.cpp b/dialogs/newsequencedialog.cpp index 7f13737a2..3b4e48457 100644 --- a/dialogs/newsequencedialog.cpp +++ b/dialogs/newsequencedialog.cpp @@ -96,7 +96,7 @@ void NewSequenceDialog::create() { ComboAction* ca = new ComboAction(); panel_project->create_sequence_internal(ca, s, true, nullptr); - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } else { ComboAction* ca = new ComboAction(); @@ -118,7 +118,7 @@ void NewSequenceDialog::create() { } } - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } accept(); diff --git a/dialogs/preferencesdialog.cpp b/dialogs/preferencesdialog.cpp index cf292e2b7..d2928032d 100644 --- a/dialogs/preferencesdialog.cpp +++ b/dialogs/preferencesdialog.cpp @@ -83,10 +83,10 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) : setWindowTitle(tr("Preferences")); setup_ui(); - accurateSeekButton->setChecked(!Olive::CurrentConfig.fast_seeking); - fastSeekButton->setChecked(Olive::CurrentConfig.fast_seeking); - recordingComboBox->setCurrentIndex(Olive::CurrentConfig.recording_mode - 1); - imgSeqFormatEdit->setText(Olive::CurrentConfig.img_seq_formats); + accurateSeekButton->setChecked(!olive::CurrentConfig.fast_seeking); + fastSeekButton->setChecked(olive::CurrentConfig.fast_seeking); + recordingComboBox->setCurrentIndex(olive::CurrentConfig.recording_mode - 1); + imgSeqFormatEdit->setText(olive::CurrentConfig.img_seq_formats); } PreferencesDialog::~PreferencesDialog() {} @@ -184,11 +184,11 @@ void PreferencesDialog::save() { } // Check if any settings will require a restart of Olive - if (Olive::CurrentConfig.effect_textbox_lines != effect_textbox_lines_field->value() - || Olive::CurrentConfig.use_software_fallback != use_software_fallbacks_checkbox->isChecked() - || Olive::CurrentConfig.language_file != language_combobox->currentData().toString() - || Olive::CurrentConfig.thumbnail_resolution != thumbnail_res_spinbox->value() - || Olive::CurrentConfig.waveform_resolution != waveform_res_spinbox->value()) { + if (olive::CurrentConfig.effect_textbox_lines != effect_textbox_lines_field->value() + || olive::CurrentConfig.use_software_fallback != use_software_fallbacks_checkbox->isChecked() + || olive::CurrentConfig.language_file != language_combobox->currentData().toString() + || olive::CurrentConfig.thumbnail_resolution != thumbnail_res_spinbox->value() + || olive::CurrentConfig.waveform_resolution != waveform_res_spinbox->value()) { // any changes to these settings will require a restart - ask the user if we should do one now or later @@ -204,7 +204,7 @@ void PreferencesDialog::save() { } else if (ret == QMessageBox::Yes) { // Check if we can close the current project. If not, we'll treat it as if the user clicked "Cancel". - if (Olive::Global->can_close_project()) { + if (olive::Global->can_close_project()) { restart_after_saving = true; } else { return; @@ -215,51 +215,51 @@ void PreferencesDialog::save() { } // Audio settings may require the audio device to be re-initiated. - if (Olive::CurrentConfig.preferred_audio_output != audio_output_devices->currentData().toString() - || Olive::CurrentConfig.preferred_audio_input != audio_input_devices->currentData().toString() - || Olive::CurrentConfig.audio_rate != audio_sample_rate->currentData().toInt()) { + if (olive::CurrentConfig.preferred_audio_output != audio_output_devices->currentData().toString() + || olive::CurrentConfig.preferred_audio_input != audio_input_devices->currentData().toString() + || olive::CurrentConfig.audio_rate != audio_sample_rate->currentData().toInt()) { reinit_audio = true; } // save settings from UI to backend - Olive::CurrentConfig.css_path = custom_css_fn->text(); - Olive::MainWindow->load_css_from_file(Olive::CurrentConfig.css_path); + olive::CurrentConfig.css_path = custom_css_fn->text(); + olive::MainWindow->load_css_from_file(olive::CurrentConfig.css_path); - Olive::CurrentConfig.recording_mode = recordingComboBox->currentIndex() + 1; - Olive::CurrentConfig.img_seq_formats = imgSeqFormatEdit->text(); - Olive::CurrentConfig.fast_seeking = fastSeekButton->isChecked(); - Olive::CurrentConfig.upcoming_queue_size = upcoming_queue_spinbox->value(); - Olive::CurrentConfig.upcoming_queue_type = upcoming_queue_type->currentIndex(); - Olive::CurrentConfig.previous_queue_size = previous_queue_spinbox->value(); - Olive::CurrentConfig.previous_queue_type = previous_queue_type->currentIndex(); - Olive::CurrentConfig.add_default_effects_to_clips = add_default_effects_to_clips->isChecked(); + olive::CurrentConfig.recording_mode = recordingComboBox->currentIndex() + 1; + olive::CurrentConfig.img_seq_formats = imgSeqFormatEdit->text(); + olive::CurrentConfig.fast_seeking = fastSeekButton->isChecked(); + olive::CurrentConfig.upcoming_queue_size = upcoming_queue_spinbox->value(); + olive::CurrentConfig.upcoming_queue_type = upcoming_queue_type->currentIndex(); + olive::CurrentConfig.previous_queue_size = previous_queue_spinbox->value(); + olive::CurrentConfig.previous_queue_type = previous_queue_type->currentIndex(); + olive::CurrentConfig.add_default_effects_to_clips = add_default_effects_to_clips->isChecked(); - Olive::CurrentConfig.preferred_audio_output = audio_output_devices->currentData().toString(); - Olive::CurrentConfig.preferred_audio_input = audio_input_devices->currentData().toString(); - Olive::CurrentConfig.audio_rate = audio_sample_rate->currentData().toInt(); + olive::CurrentConfig.preferred_audio_output = audio_output_devices->currentData().toString(); + olive::CurrentConfig.preferred_audio_input = audio_input_devices->currentData().toString(); + olive::CurrentConfig.audio_rate = audio_sample_rate->currentData().toInt(); - Olive::CurrentConfig.effect_textbox_lines = effect_textbox_lines_field->value(); - Olive::CurrentConfig.use_software_fallback = use_software_fallbacks_checkbox->isChecked(); - Olive::CurrentConfig.language_file = language_combobox->currentData().toString(); + olive::CurrentConfig.effect_textbox_lines = effect_textbox_lines_field->value(); + olive::CurrentConfig.use_software_fallback = use_software_fallbacks_checkbox->isChecked(); + olive::CurrentConfig.language_file = language_combobox->currentData().toString(); - if (Olive::CurrentConfig.thumbnail_resolution != thumbnail_res_spinbox->value() - || Olive::CurrentConfig.waveform_resolution != waveform_res_spinbox->value()) { + if (olive::CurrentConfig.thumbnail_resolution != thumbnail_res_spinbox->value() + || olive::CurrentConfig.waveform_resolution != waveform_res_spinbox->value()) { // we're changing the size of thumbnails and waveforms, so let's delete them and regenerate them next start // delete nothing char delete_match = 0; - if (Olive::CurrentConfig.thumbnail_resolution != thumbnail_res_spinbox->value()) { + if (olive::CurrentConfig.thumbnail_resolution != thumbnail_res_spinbox->value()) { // delete existing thumbnails - Olive::CurrentConfig.thumbnail_resolution = thumbnail_res_spinbox->value(); + olive::CurrentConfig.thumbnail_resolution = thumbnail_res_spinbox->value(); // delete only thumbnails delete_match = 't'; } - if (Olive::CurrentConfig.waveform_resolution != waveform_res_spinbox->value()) { + if (olive::CurrentConfig.waveform_resolution != waveform_res_spinbox->value()) { // delete existing waveforms - Olive::CurrentConfig.waveform_resolution = waveform_res_spinbox->value(); + olive::CurrentConfig.waveform_resolution = waveform_res_spinbox->value(); // if we're already deleting thumbnails if (delete_match == 't') { @@ -288,11 +288,11 @@ void PreferencesDialog::save() { if (restart_after_saving) { // since we already ran can_close_project(), bypass checking again by running setWindowModified(false) - Olive::MainWindow->setWindowModified(false); + olive::MainWindow->setWindowModified(false); - Olive::MainWindow->close(); + olive::MainWindow->close(); - QProcess::startDetached(QApplication::applicationFilePath(), { Olive::ActiveProjectFilename }); + QProcess::startDetached(QApplication::applicationFilePath(), { olive::ActiveProjectFilename }); } } @@ -468,7 +468,7 @@ void PreferencesDialog::setup_ui() { QString locale_str = locale_file_basename.mid(locale_file_basename.lastIndexOf('_')+1); language_combobox->addItem(QLocale(locale_str).nativeLanguageName(), locale_relative_path); - if (Olive::CurrentConfig.language_file == locale_relative_path) { + if (olive::CurrentConfig.language_file == locale_relative_path) { language_combobox->setCurrentIndex(language_combobox->count() - 1); } } @@ -483,7 +483,7 @@ void PreferencesDialog::setup_ui() { general_layout->addWidget(new QLabel(tr("Custom CSS:"), this), row, 0); custom_css_fn = new QLineEdit(general_tab); - custom_css_fn->setText(Olive::CurrentConfig.css_path); + custom_css_fn->setText(olive::CurrentConfig.css_path); general_layout->addWidget(custom_css_fn, row, 1, 1, 3); QPushButton* custom_css_browse = new QPushButton(tr("Browse"), general_tab); @@ -516,7 +516,7 @@ void PreferencesDialog::setup_ui() { effect_textbox_lines_field = new QSpinBox(general_tab); effect_textbox_lines_field->setMinimum(1); - effect_textbox_lines_field->setValue(Olive::CurrentConfig.effect_textbox_lines); + effect_textbox_lines_field->setValue(olive::CurrentConfig.effect_textbox_lines); general_layout->addWidget(effect_textbox_lines_field, row, 1, 1, 4); row++; @@ -527,7 +527,7 @@ void PreferencesDialog::setup_ui() { thumbnail_res_spinbox = new QSpinBox(this); thumbnail_res_spinbox->setMinimum(0); thumbnail_res_spinbox->setMaximum(INT_MAX); - thumbnail_res_spinbox->setValue(Olive::CurrentConfig.thumbnail_resolution); + thumbnail_res_spinbox->setValue(olive::CurrentConfig.thumbnail_resolution); general_layout->addWidget(thumbnail_res_spinbox, row, 1); general_layout->addWidget(new QLabel(tr("Waveform Resolution:"), this), row, 2); @@ -535,7 +535,7 @@ void PreferencesDialog::setup_ui() { waveform_res_spinbox = new QSpinBox(this); waveform_res_spinbox->setMinimum(0); waveform_res_spinbox->setMaximum(INT_MAX); - waveform_res_spinbox->setValue(Olive::CurrentConfig.waveform_resolution); + waveform_res_spinbox->setValue(olive::CurrentConfig.waveform_resolution); general_layout->addWidget(waveform_res_spinbox, row, 3); QPushButton* delete_preview_btn = new QPushButton(tr("Delete Previews")); @@ -547,7 +547,7 @@ void PreferencesDialog::setup_ui() { // General -> Use Software Fallbacks When Possible use_software_fallbacks_checkbox = new QCheckBox(general_tab); use_software_fallbacks_checkbox->setText(tr("Use Software Fallbacks When Possible")); - use_software_fallbacks_checkbox->setChecked(Olive::CurrentConfig.use_software_fallback); + use_software_fallbacks_checkbox->setChecked(olive::CurrentConfig.use_software_fallback); general_layout->addWidget(use_software_fallbacks_checkbox, row, 0, 1, 4); tabWidget->addTab(general_tab, tr("General")); @@ -559,7 +559,7 @@ void PreferencesDialog::setup_ui() { QVBoxLayout* behavior_tab_layout = new QVBoxLayout(behavior_tab); add_default_effects_to_clips = new QCheckBox("Add Default Effects to New Clips"); - add_default_effects_to_clips->setChecked(Olive::CurrentConfig.add_default_effects_to_clips); + add_default_effects_to_clips->setChecked(olive::CurrentConfig.add_default_effects_to_clips); behavior_tab_layout->addWidget(add_default_effects_to_clips); // Playback @@ -584,21 +584,21 @@ void PreferencesDialog::setup_ui() { QGridLayout* memory_usage_layout = new QGridLayout(memory_usage_group); memory_usage_layout->addWidget(new QLabel(tr("Upcoming Frame Queue:"), playback_tab), 0, 0); upcoming_queue_spinbox = new QDoubleSpinBox(playback_tab); - upcoming_queue_spinbox->setValue(Olive::CurrentConfig.upcoming_queue_size); + upcoming_queue_spinbox->setValue(olive::CurrentConfig.upcoming_queue_size); memory_usage_layout->addWidget(upcoming_queue_spinbox, 0, 1); upcoming_queue_type = new QComboBox(playback_tab); upcoming_queue_type->addItem(tr("frames")); upcoming_queue_type->addItem(tr("seconds")); - upcoming_queue_type->setCurrentIndex(Olive::CurrentConfig.upcoming_queue_type); + upcoming_queue_type->setCurrentIndex(olive::CurrentConfig.upcoming_queue_type); memory_usage_layout->addWidget(upcoming_queue_type, 0, 2); memory_usage_layout->addWidget(new QLabel(tr("Previous Frame Queue:"), playback_tab), 1, 0); previous_queue_spinbox = new QDoubleSpinBox(playback_tab); - previous_queue_spinbox->setValue(Olive::CurrentConfig.previous_queue_size); + previous_queue_spinbox->setValue(olive::CurrentConfig.previous_queue_size); memory_usage_layout->addWidget(previous_queue_spinbox, 1, 1); previous_queue_type = new QComboBox(playback_tab); previous_queue_type->addItem(tr("frames")); previous_queue_type->addItem(tr("seconds")); - previous_queue_type->setCurrentIndex(Olive::CurrentConfig.previous_queue_type); + previous_queue_type->setCurrentIndex(olive::CurrentConfig.previous_queue_type); memory_usage_layout->addWidget(previous_queue_type, 1, 2); playback_tab_layout->addWidget(memory_usage_group); @@ -620,7 +620,7 @@ void PreferencesDialog::setup_ui() { for (int i=0;iaddItem(devs.at(i).deviceName(), devs.at(i).deviceName()); if (!found_preferred_device - && devs.at(i).deviceName() == Olive::CurrentConfig.preferred_audio_output) { + && devs.at(i).deviceName() == olive::CurrentConfig.preferred_audio_output) { audio_output_devices->setCurrentIndex(audio_output_devices->count()-1); found_preferred_device = true; } @@ -639,7 +639,7 @@ void PreferencesDialog::setup_ui() { for (int i=0;iaddItem(devs.at(i).deviceName(), devs.at(i).deviceName()); if (!found_preferred_device - && devs.at(i).deviceName() == Olive::CurrentConfig.preferred_audio_input) { + && devs.at(i).deviceName() == olive::CurrentConfig.preferred_audio_input) { audio_input_devices->setCurrentIndex(audio_input_devices->count()-1); found_preferred_device = true; } @@ -652,7 +652,7 @@ void PreferencesDialog::setup_ui() { audio_sample_rate = new QComboBox(); combobox_audio_sample_rates(audio_sample_rate); for (int i=0;icount();i++) { - if (audio_sample_rate->itemData(i).toInt() == Olive::CurrentConfig.audio_rate) { + if (audio_sample_rate->itemData(i).toInt() == olive::CurrentConfig.audio_rate) { audio_sample_rate->setCurrentIndex(i); break; } diff --git a/dialogs/proxydialog.cpp b/dialogs/proxydialog.cpp index f73195670..4c989f466 100644 --- a/dialogs/proxydialog.cpp +++ b/dialogs/proxydialog.cpp @@ -152,7 +152,7 @@ void ProxyDialog::accept() { proxy_generator.queue(info_list.at(i)); } - Olive::MainWindow->setWindowModified(true); + olive::MainWindow->setWindowModified(true); QDialog::accept(); } diff --git a/dialogs/replaceclipmediadialog.cpp b/dialogs/replaceclipmediadialog.cpp index 1f42a910a..e9d5c2739 100644 --- a/dialogs/replaceclipmediadialog.cpp +++ b/dialogs/replaceclipmediadialog.cpp @@ -96,7 +96,7 @@ void ReplaceClipMediaDialog::replace() { QMessageBox::Ok ); } else { - if (new_item->get_type() == MEDIA_TYPE_SEQUENCE && Olive::ActiveSequence == new_item->to_sequence()) { + if (new_item->get_type() == MEDIA_TYPE_SEQUENCE && olive::ActiveSequence == new_item->to_sequence()) { QMessageBox::critical( this, tr("Active sequence selected"), @@ -110,14 +110,14 @@ void ReplaceClipMediaDialog::replace() { use_same_media_in_points->isChecked() ); - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && c->media == media) { rcmc->clips.append(c); } } - Olive::UndoStack.push(rcmc); + olive::UndoStack.push(rcmc); close(); } diff --git a/dialogs/speeddialog.cpp b/dialogs/speeddialog.cpp index 37c65c157..76dac52c8 100644 --- a/dialogs/speeddialog.cpp +++ b/dialogs/speeddialog.cpp @@ -58,7 +58,7 @@ SpeedDialog::SpeedDialog(QWidget *parent) : QDialog(parent) { grid->addWidget(new QLabel(tr("Duration:"), this), 2, 0); duration = new LabelSlider(this); duration->set_display_type(LABELSLIDER_FRAMENUMBER); - duration->set_frame_rate(Olive::ActiveSequence->frame_rate); + duration->set_frame_rate(olive::ActiveSequence->frame_rate); grid->addWidget(duration, 2, 1); main_layout->addLayout(grid); @@ -339,14 +339,14 @@ void set_speed(ComboAction* ca, Clip* c, double speed, bool ripple, long& ep, lo sel.in = c->timeline_in; sel.out = proposed_out; sel.track = c->track; - Olive::ActiveSequence->selections.append(sel); + olive::ActiveSequence->selections.append(sel); } void SpeedDialog::accept() { ComboAction* ca = new ComboAction(); - SetSelectionsCommand* sel_command = new SetSelectionsCommand(Olive::ActiveSequence); - sel_command->old_data = Olive::ActiveSequence->selections; + SetSelectionsCommand* sel_command = new SetSelectionsCommand(olive::ActiveSequence); + sel_command->old_data = olive::ActiveSequence->selections; long earliest_point = LONG_MAX; long longest_ripple = LONG_MIN; @@ -419,10 +419,10 @@ void SpeedDialog::accept() { ripple_clips(ca, clips.at(0)->sequence, earliest_point, longest_ripple); } - sel_command->new_data = Olive::ActiveSequence->selections; + sel_command->new_data = olive::ActiveSequence->selections; ca->append(sel_command); - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); update_ui(true); QDialog::accept(); diff --git a/effects/internal/texteffect.cpp b/effects/internal/texteffect.cpp index f64595e30..3c4a88504 100644 --- a/effects/internal/texteffect.cpp +++ b/effects/internal/texteffect.cpp @@ -330,7 +330,7 @@ void TextEffect::text_edit_menu() { } void TextEffect::open_text_edit() { - TextEditDialog ted(Olive::MainWindow, text_val->get_current_data().toString()); + TextEditDialog ted(olive::MainWindow, text_val->get_current_data().toString()); ted.exec(); QString result = ted.get_string(); if (!result.isEmpty()) { diff --git a/effects/internal/timecodeeffect.cpp b/effects/internal/timecodeeffect.cpp index 495ee5874..16e012741 100644 --- a/effects/internal/timecodeeffect.cpp +++ b/effects/internal/timecodeeffect.cpp @@ -82,10 +82,10 @@ TimecodeEffect::TimecodeEffect(Clip *c, const EffectMeta* em) : void TimecodeEffect::redraw(double timecode) { if (tc_select->get_combo_data(timecode).toBool()){ - display_timecode = prepend_text->get_string_value(timecode) + frame_to_timecode(Olive::ActiveSequence->playhead, Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate);} + display_timecode = prepend_text->get_string_value(timecode) + frame_to_timecode(olive::ActiveSequence->playhead, olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate);} else { double media_rate = parent_clip->getMediaFrameRate(); - display_timecode = prepend_text->get_string_value(timecode) + frame_to_timecode(timecode * media_rate, Olive::CurrentConfig.timecode_view, media_rate);} + display_timecode = prepend_text->get_string_value(timecode) + frame_to_timecode(timecode * media_rate, olive::CurrentConfig.timecode_view, media_rate);} img.fill(Qt::transparent); QPainter p(&img); diff --git a/effects/internal/vsthost.cpp b/effects/internal/vsthost.cpp index 3e74635e6..02ecd3fdd 100644 --- a/effects/internal/vsthost.cpp +++ b/effects/internal/vsthost.cpp @@ -85,7 +85,7 @@ extern "C" { // but we are aware of it break; case audioMasterEndEdit: // change made - Olive::MainWindow->setWindowModified(true); + olive::MainWindow->setWindowModified(true); break; default: qInfo() << "Plugin requested unhandled opcode" << opcode; @@ -200,7 +200,7 @@ bool VSTHost::configurePluginCallbacks() { // real VST plugin, or is otherwise corrupt. if(plugin->magic != kEffectMagic) { qCritical() << "Plugin's magic number is bad"; - QMessageBox::critical(Olive::MainWindow, tr("VST Error"), tr("Plugin's magic number is invalid")); + QMessageBox::critical(olive::MainWindow, tr("VST Error"), tr("Plugin's magic number is invalid")); return false; } @@ -272,7 +272,7 @@ VSTHost::VSTHost(Clip* c, const EffectMeta *em) : Effect(c, em) { connect(show_interface_btn, SIGNAL(toggled(bool)), this, SLOT(show_interface(bool))); interface_row->add_widget(show_interface_btn); - dialog = new QDialog(Olive::MainWindow); + dialog = new QDialog(olive::MainWindow); dialog->setWindowTitle(tr("VST Plugin")); dialog->setAttribute(Qt::WA_NativeWindow, true); dialog->setWindowFlags(dialog->windowFlags() | Qt::MSWindowsFixedSizeDialogHint); diff --git a/io/config.cpp b/io/config.cpp index ec273992e..133dad50a 100644 --- a/io/config.cpp +++ b/io/config.cpp @@ -29,8 +29,8 @@ #include "debug.h" -Config Olive::CurrentConfig; -RuntimeConfig Olive::CurrentRuntimeConfig; +Config olive::CurrentConfig; +RuntimeConfig olive::CurrentRuntimeConfig; Config::Config() : saved_layout(false), diff --git a/io/config.h b/io/config.h index da598fae3..23a6a86b9 100644 --- a/io/config.h +++ b/io/config.h @@ -103,7 +103,7 @@ struct RuntimeConfig { QString external_translation_file; }; -namespace Olive { +namespace olive { extern Config CurrentConfig; extern RuntimeConfig CurrentRuntimeConfig; } diff --git a/io/exportthread.cpp b/io/exportthread.cpp index 2330ca985..3a7dac959 100644 --- a/io/exportthread.cpp +++ b/io/exportthread.cpp @@ -183,15 +183,15 @@ bool ExportThread::setupVideo() { video_frame = av_frame_alloc(); av_frame_make_writable(video_frame); video_frame->format = AV_PIX_FMT_RGBA; - video_frame->width = Olive::ActiveSequence->width; - video_frame->height = Olive::ActiveSequence->height; + video_frame->width = olive::ActiveSequence->width; + video_frame->height = olive::ActiveSequence->height; av_frame_get_buffer(video_frame, 0); av_init_packet(&video_pkt); sws_ctx = sws_getContext( - Olive::ActiveSequence->width, - Olive::ActiveSequence->height, + olive::ActiveSequence->width, + olive::ActiveSequence->height, AV_PIX_FMT_RGBA, params.video_width, params.video_height, @@ -274,9 +274,9 @@ bool ExportThread::setupAudio() { acodec_ctx->channel_layout, acodec_ctx->sample_fmt, acodec_ctx->sample_rate, - Olive::ActiveSequence->audio_layout, + olive::ActiveSequence->audio_layout, AV_SAMPLE_FMT_S16, - Olive::ActiveSequence->audio_frequency, + olive::ActiveSequence->audio_frequency, 0, nullptr ); @@ -284,7 +284,7 @@ bool ExportThread::setupAudio() { // initialize raw audio frame audio_frame = av_frame_alloc(); - audio_frame->sample_rate = Olive::ActiveSequence->audio_frequency; + audio_frame->sample_rate = olive::ActiveSequence->audio_frequency; audio_frame->nb_samples = acodec_ctx->frame_size; if (audio_frame->nb_samples == 0) audio_frame->nb_samples = 256; // should possibly be smaller? audio_frame->format = AV_SAMPLE_FMT_S16; @@ -366,16 +366,16 @@ void ExportThread::run() { mutex.lock(); - while (Olive::ActiveSequence->playhead <= params.end_frame && continueEncode) { + while (olive::ActiveSequence->playhead <= params.end_frame && continueEncode) { start_time = QDateTime::currentMSecsSinceEpoch(); if (params.audio_enabled) { - compose_audio(nullptr, Olive::ActiveSequence, 1); + compose_audio(nullptr, olive::ActiveSequence, 1); } if (params.video_enabled) { do { // TODO optimize by rendering the next frame while encoding the last - renderer->start_render(nullptr, Olive::ActiveSequence, nullptr, video_frame->data[0], video_frame->linesize[0]/4); + renderer->start_render(nullptr, olive::ActiveSequence, nullptr, video_frame->data[0], video_frame->linesize[0]/4); waitCond.wait(&mutex); if (!continueEncode) break; } while (renderer->did_texture_fail()); @@ -383,7 +383,7 @@ void ExportThread::run() { } // encode last frame while rendering next frame - double timecode_secs = double(Olive::ActiveSequence->playhead - params.start_frame) / Olive::ActiveSequence->frame_rate; + double timecode_secs = double(olive::ActiveSequence->playhead - params.start_frame) / olive::ActiveSequence->frame_rate; if (params.video_enabled) { // create sws_frame for converting pixel format @@ -444,12 +444,12 @@ void ExportThread::run() { // generating encoding statistics (time it took to encode this frame/estimated remaining time) frame_time = (QDateTime::currentMSecsSinceEpoch()-start_time); total_time += frame_time; - remaining_frames = (params.end_frame - Olive::ActiveSequence->playhead); + remaining_frames = (params.end_frame - olive::ActiveSequence->playhead); avg_time = (total_time/frame_count); eta = (remaining_frames*avg_time); - emit progress_changed(qRound((double(Olive::ActiveSequence->playhead - params.start_frame) / double(params.end_frame - params.start_frame)) * 100.0), eta); - Olive::ActiveSequence->playhead++; + emit progress_changed(qRound((double(olive::ActiveSequence->playhead - params.start_frame) / double(params.end_frame - params.start_frame)) * 100.0), eta); + olive::ActiveSequence->playhead++; frame_count++; } @@ -463,7 +463,7 @@ void ExportThread::run() { if (params.audio_enabled) apkt_alloc = true; } - Olive::Global.data()->set_rendering_state(false); + olive::Global->set_rendering_state(false); if (params.audio_enabled && continueEncode) { // flush swresample diff --git a/io/loadthread.cpp b/io/loadthread.cpp index bde477567..906d8af41 100644 --- a/io/loadthread.cpp +++ b/io/loadthread.cpp @@ -584,7 +584,7 @@ Media* LoadThread::find_loaded_folder_by_id(int id) { void LoadThread::run() { mutex.lock(); - QFile file(Olive::ActiveProjectFilename); + QFile file(olive::ActiveProjectFilename); if (!file.open(QIODevice::ReadOnly)) { qCritical() << "Could not open file"; return; @@ -595,9 +595,9 @@ void LoadThread::run() { * case the project file has moved without the footage, * we check both */ - proj_dir = QFileInfo(Olive::ActiveProjectFilename).absoluteDir(); - internal_proj_dir = QFileInfo(Olive::ActiveProjectFilename).absoluteDir(); - internal_proj_url = Olive::ActiveProjectFilename; + proj_dir = QFileInfo(olive::ActiveProjectFilename).absoluteDir(); + internal_proj_dir = QFileInfo(olive::ActiveProjectFilename).absoluteDir(); + internal_proj_url = olive::ActiveProjectFilename; QXmlStreamReader stream(&file); @@ -709,7 +709,7 @@ void LoadThread::cancel() { void LoadThread::question_func(const QString &title, const QString &text, int buttons) { mutex.lock(); question_btn = QMessageBox::warning( - Olive::MainWindow, + olive::MainWindow, title, text, static_cast(buttons)); @@ -720,12 +720,12 @@ void LoadThread::question_func(const QString &title, const QString &text, int bu void LoadThread::error_func() { if (xml_error) { qCritical() << "Error parsing XML." << error_str; - QMessageBox::critical(Olive::MainWindow, + QMessageBox::critical(olive::MainWindow, tr("XML Parsing Error"), - tr("Couldn't load '%1'. %2").arg(Olive::ActiveProjectFilename, error_str), + tr("Couldn't load '%1'. %2").arg(olive::ActiveProjectFilename, error_str), QMessageBox::Ok); } else { - QMessageBox::critical(Olive::MainWindow, + QMessageBox::critical(olive::MainWindow, tr("Project Load Error"), tr("Error loading project: %1").arg(error_str), QMessageBox::Ok); @@ -748,12 +748,12 @@ void LoadThread::success_func() { counter++; } - Olive::Global.data()->update_project_filename(orig_filename); + olive::Global->update_project_filename(orig_filename); } else { - panel_project->add_recent_project(Olive::ActiveProjectFilename); + panel_project->add_recent_project(olive::ActiveProjectFilename); } - Olive::MainWindow->setWindowModified(autorecovery); + olive::MainWindow->setWindowModified(autorecovery); if (open_seq != nullptr) set_sequence(open_seq); update_ui(false); } diff --git a/io/previewgenerator.cpp b/io/previewgenerator.cpp index 20fb69fa0..8569af840 100644 --- a/io/previewgenerator.cpp +++ b/io/previewgenerator.cpp @@ -242,8 +242,8 @@ void PreviewGenerator::generate_waveform() { // we only generate previews for video and audio // and only if the thumbnail and waveform sizes are > 0 - if ((fmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && Olive::CurrentConfig.thumbnail_resolution > 0) - || (fmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && Olive::CurrentConfig.waveform_resolution > 0)) { + if ((fmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && olive::CurrentConfig.thumbnail_resolution > 0) + || (fmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && olive::CurrentConfig.waveform_resolution > 0)) { AVCodec* codec = avcodec_find_decoder(fmt_ctx->streams[i]->codecpar->codec_id); if (codec != nullptr) { @@ -318,7 +318,7 @@ void PreviewGenerator::generate_waveform() { if (s != nullptr) { if (fmt_ctx->streams[packet->stream_index]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { if (!s->preview_done) { - int dstH = Olive::CurrentConfig.thumbnail_resolution; + int dstH = olive::CurrentConfig.thumbnail_resolution; int dstW = qRound(dstH * (float(temp_frame->width)/float(temp_frame->height))); uint8_t* data = new uint8_t[size_t(dstW*dstH*4)]; @@ -381,7 +381,7 @@ void PreviewGenerator::generate_waveform() { // `config.waveform_resolution` determines how many samples per second are stored in waveform. // `sample_rate` is samples per second, so `interval` is how many samples are averaged in // each "point" of the waveform - int interval = qFloor((temp_frame->sample_rate/Olive::CurrentConfig.waveform_resolution)/4)*4; + int interval = qFloor((temp_frame->sample_rate/olive::CurrentConfig.waveform_resolution)/4)*4; // get the amount of bytes in an audio sample int sample_size = av_get_bytes_per_sample(static_cast(swr_frame->format)); diff --git a/io/proxygenerator.cpp b/io/proxygenerator.cpp index fb2dd74e1..640433e42 100644 --- a/io/proxygenerator.cpp +++ b/io/proxygenerator.cpp @@ -316,7 +316,7 @@ void ProxyGenerator::transcode(const ProxyInfo& info) { info.footage->proxy_path = info.path; qInfo() << "Finished creating proxy for" << info.footage->url; - QMetaObject::invokeMethod(Olive::MainWindow->statusBar(), + QMetaObject::invokeMethod(olive::MainWindow->statusBar(), "showMessage", Qt::QueuedConnection, Q_ARG(QString, tr("Finished generating proxy for \"%1\"").arg(info.footage->url))); diff --git a/main.cpp b/main.cpp index 34cbf88c6..3e2307b24 100644 --- a/main.cpp +++ b/main.cpp @@ -33,7 +33,7 @@ extern "C" { } int main(int argc, char *argv[]) { - Olive::Global = QSharedPointer(new OliveGlobal); + olive::Global = std::unique_ptr(new OliveGlobal); bool launch_fullscreen = false; QString load_proj; @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) { #ifndef GITHASH qWarning() << "No Git commit information found"; #endif - printf("%s\n", Olive::AppName.toUtf8().constData()); + printf("%s\n", olive::AppName.toUtf8().constData()); return 0; } else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) { printf("Usage: %s [options] [filename]\n\n" @@ -70,15 +70,15 @@ int main(int argc, char *argv[]) { } else if (!strcmp(argv[i], "--fullscreen") || !strcmp(argv[i], "-f")) { launch_fullscreen = true; } else if (!strcmp(argv[i], "--disable-shaders")) { - Olive::CurrentRuntimeConfig.shaders_are_enabled = false; + olive::CurrentRuntimeConfig.shaders_are_enabled = false; } else if (!strcmp(argv[i], "--no-debug")) { use_internal_logger = false; } else if (!strcmp(argv[i], "--disable-blend-modes")) { - Olive::CurrentRuntimeConfig.disable_blending = true; + olive::CurrentRuntimeConfig.disable_blending = true; } else if (!strcmp(argv[i], "--translation")) { if (i + 1 < argc && argv[i + 1][0] != '-') { // load translation file - Olive::CurrentRuntimeConfig.external_translation_file = argv[i + 1]; + olive::CurrentRuntimeConfig.external_translation_file = argv[i + 1]; i++; } else { @@ -117,10 +117,10 @@ int main(int argc, char *argv[]) { MainWindow w(nullptr); // connect main window's first paint to global's init finished function - QObject::connect(&w, SIGNAL(finished_first_paint()), Olive::Global.data(), SLOT(finished_initialize())); + QObject::connect(&w, SIGNAL(finished_first_paint()), olive::Global.get(), SLOT(finished_initialize())); if (!load_proj.isEmpty()) { - Olive::Global.data()->load_project_on_launch(load_proj); + olive::Global->load_project_on_launch(load_proj); } if (launch_fullscreen) { w.showFullScreen(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 9e3759825..c2d6124ee 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -64,7 +64,7 @@ #include #include -MainWindow* Olive::MainWindow; +MainWindow* olive::MainWindow; #define DEFAULT_CSS "QPushButton::checked { background: rgb(25, 25, 25); }" @@ -104,9 +104,9 @@ MainWindow::MainWindow(QWidget *parent) : open_debug_file(); - Olive::DebugDialog = new DebugDialog(this); + olive::DebugDialog = new DebugDialog(this); - Olive::MainWindow = this; + olive::MainWindow = this; // set up style? @@ -179,7 +179,7 @@ MainWindow::MainWindow(QWidget *parent) : } // search for open recents list - QFile f(Olive::Global.data()->get_recent_project_list_file()); + QFile f(olive::Global->get_recent_project_list_file()); if (f.exists() && f.open(QFile::ReadOnly | QFile::Text)) { QTextStream text_stream(&f); while (true) { @@ -200,18 +200,18 @@ MainWindow::MainWindow(QWidget *parent) : config_dir.mkpath("."); QString config_fn = config_dir.filePath("config.xml"); if (QFileInfo::exists(config_fn)) { - Olive::CurrentConfig.load(config_fn); + olive::CurrentConfig.load(config_fn); - if (!Olive::CurrentConfig.css_path.isEmpty()) { - load_css_from_file(Olive::CurrentConfig.css_path); + if (!olive::CurrentConfig.css_path.isEmpty()) { + load_css_from_file(olive::CurrentConfig.css_path); } } } // load preferred language from file - QString language_file = Olive::CurrentRuntimeConfig.external_translation_file.isEmpty() ? - Olive::CurrentConfig.language_file : - Olive::CurrentRuntimeConfig.external_translation_file; + QString language_file = olive::CurrentRuntimeConfig.external_translation_file.isEmpty() ? + olive::CurrentConfig.language_file : + olive::CurrentRuntimeConfig.external_translation_file; if (!language_file.isEmpty()) { @@ -230,13 +230,13 @@ MainWindow::MainWindow(QWidget *parent) : alloc_panels(this); QStatusBar* statusBar = new QStatusBar(this); - statusBar->showMessage(tr("Welcome to %1").arg(Olive::AppName)); + statusBar->showMessage(tr("Welcome to %1").arg(olive::AppName)); setStatusBar(statusBar); // populate menu bars setup_menus(); - Olive::Global.data()->check_for_autorecovery_file(); + olive::Global->check_for_autorecovery_file(); // set up panel layout setup_layout(false); @@ -349,8 +349,8 @@ void MainWindow::load_css_from_file(const QString &fn) { } void MainWindow::editMenu_About_To_Be_Shown() { - undo_action->setEnabled(Olive::UndoStack.canUndo()); - redo_action->setEnabled(Olive::UndoStack.canRedo()); + undo_action->setEnabled(olive::UndoStack.canUndo()); + redo_action->setEnabled(olive::UndoStack.canRedo()); } void MainWindow::setup_menus() { @@ -363,9 +363,9 @@ void MainWindow::setup_menus() { connect(file_menu, SIGNAL(aboutToShow()), this, SLOT(fileMenu_About_To_Be_Shown())); QMenu* new_menu = file_menu->addMenu(tr("&New")); - Olive::MenuHelper.make_new_menu(new_menu); + olive::MenuHelper.make_new_menu(new_menu); - file_menu->addAction(tr("&Open Project"), Olive::Global.data(), SLOT(open_project()), QKeySequence("Ctrl+O"))->setProperty("id", "openproj"); + file_menu->addAction(tr("&Open Project"), olive::Global.get(), SLOT(open_project()), QKeySequence("Ctrl+O"))->setProperty("id", "openproj"); clear_open_recent_action = new QAction(tr("Clear Recent List"), menuBar); clear_open_recent_action->setProperty("id", "clearopenrecent"); @@ -375,8 +375,8 @@ void MainWindow::setup_menus() { open_recent->addAction(clear_open_recent_action); - file_menu->addAction(tr("&Save Project"), Olive::Global.data(), SLOT(save_project()), QKeySequence("Ctrl+S"))->setProperty("id", "saveproj"); - file_menu->addAction(tr("Save Project &As"), Olive::Global.data(), SLOT(save_project_as()), QKeySequence("Ctrl+Shift+S"))->setProperty("id", "saveprojas"); + file_menu->addAction(tr("&Save Project"), olive::Global.get(), SLOT(save_project()), QKeySequence("Ctrl+S"))->setProperty("id", "saveproj"); + file_menu->addAction(tr("Save Project &As"), olive::Global.get(), SLOT(save_project_as()), QKeySequence("Ctrl+Shift+S"))->setProperty("id", "saveprojas"); file_menu->addSeparator(); @@ -384,7 +384,7 @@ void MainWindow::setup_menus() { file_menu->addSeparator(); - file_menu->addAction(tr("&Export..."), Olive::Global.data(), SLOT(open_export_dialog()), QKeySequence("Ctrl+M"))->setProperty("id", "export"); + file_menu->addAction(tr("&Export..."), olive::Global.get(), SLOT(open_export_dialog()), QKeySequence("Ctrl+M"))->setProperty("id", "export"); file_menu->addSeparator(); @@ -395,24 +395,24 @@ void MainWindow::setup_menus() { QMenu* edit_menu = menuBar->addMenu(tr("&Edit")); connect(edit_menu, SIGNAL(aboutToShow()), this, SLOT(editMenu_About_To_Be_Shown())); - undo_action = edit_menu->addAction(tr("&Undo"), Olive::Global.data(), SLOT(undo()), QKeySequence("Ctrl+Z")); + undo_action = edit_menu->addAction(tr("&Undo"), olive::Global.get(), SLOT(undo()), QKeySequence("Ctrl+Z")); undo_action->setProperty("id", "undo"); - redo_action = edit_menu->addAction(tr("Redo"), Olive::Global.data(), SLOT(redo()), QKeySequence("Ctrl+Shift+Z")); + redo_action = edit_menu->addAction(tr("Redo"), olive::Global.get(), SLOT(redo()), QKeySequence("Ctrl+Shift+Z")); redo_action->setProperty("id", "redo"); edit_menu->addSeparator(); - Olive::MenuHelper.make_edit_functions_menu(edit_menu); + olive::MenuHelper.make_edit_functions_menu(edit_menu); edit_menu->addSeparator(); - edit_menu->addAction(tr("Select &All"), &Olive::FocusFilter, SLOT(select_all()), QKeySequence("Ctrl+A"))->setProperty("id", "selectall"); + edit_menu->addAction(tr("Select &All"), &olive::FocusFilter, SLOT(select_all()), QKeySequence("Ctrl+A"))->setProperty("id", "selectall"); edit_menu->addAction(tr("Deselect All"), panel_timeline, SLOT(deselect()), QKeySequence("Ctrl+Shift+A"))->setProperty("id", "deselectall"); edit_menu->addSeparator(); - Olive::MenuHelper.make_clip_functions_menu(edit_menu); + olive::MenuHelper.make_clip_functions_menu(edit_menu); edit_menu->addSeparator(); @@ -423,21 +423,21 @@ void MainWindow::setup_menus() { edit_menu->addSeparator(); - Olive::MenuHelper.make_inout_menu(edit_menu); + olive::MenuHelper.make_inout_menu(edit_menu); edit_menu->addAction(tr("Delete In/Out Point"), panel_timeline, SLOT(delete_inout()), QKeySequence(";"))->setProperty("id", "deleteinout"); edit_menu->addAction(tr("Ripple Delete In/Out Point"), panel_timeline, SLOT(ripple_delete_inout()), QKeySequence("'"))->setProperty("id", "rippledeleteinout"); edit_menu->addSeparator(); - edit_menu->addAction(tr("Set/Edit Marker"), &Olive::FocusFilter, SLOT(set_marker()), QKeySequence("M"))->setProperty("id", "marker"); + edit_menu->addAction(tr("Set/Edit Marker"), &olive::FocusFilter, SLOT(set_marker()), QKeySequence("M"))->setProperty("id", "marker"); // INITIALIZE VIEW MENU QMenu* view_menu = menuBar->addMenu(tr("&View")); connect(view_menu, SIGNAL(aboutToShow()), this, SLOT(viewMenu_About_To_Be_Shown())); - view_menu->addAction(tr("Zoom In"), &Olive::FocusFilter, SLOT(zoom_in()), QKeySequence("="))->setProperty("id", "zoomin"); - view_menu->addAction(tr("Zoom Out"), &Olive::FocusFilter, SLOT(zoom_out()), QKeySequence("-"))->setProperty("id", "zoomout"); + view_menu->addAction(tr("Zoom In"), &olive::FocusFilter, SLOT(zoom_in()), QKeySequence("="))->setProperty("id", "zoomin"); + view_menu->addAction(tr("Zoom Out"), &olive::FocusFilter, SLOT(zoom_out()), QKeySequence("-"))->setProperty("id", "zoomout"); view_menu->addAction(tr("Increase Track Height"), panel_timeline, SLOT(increase_track_height()), QKeySequence("Ctrl+="))->setProperty("id", "vzoomin"); view_menu->addAction(tr("Decrease Track Height"), panel_timeline, SLOT(decrease_track_height()), QKeySequence("Ctrl+-"))->setProperty("id", "vzoomout"); @@ -447,31 +447,31 @@ void MainWindow::setup_menus() { view_menu->addSeparator(); - track_lines = view_menu->addAction(tr("Track Lines"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + track_lines = view_menu->addAction(tr("Track Lines"), &olive::MenuHelper, SLOT(toggle_bool_action())); track_lines->setProperty("id", "tracklines"); track_lines->setCheckable(true); - track_lines->setData(reinterpret_cast(&Olive::CurrentConfig.show_track_lines)); + track_lines->setData(reinterpret_cast(&olive::CurrentConfig.show_track_lines)); - rectified_waveforms = view_menu->addAction(tr("Rectified Waveforms"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + rectified_waveforms = view_menu->addAction(tr("Rectified Waveforms"), &olive::MenuHelper, SLOT(toggle_bool_action())); rectified_waveforms->setProperty("id", "rectifiedwaveforms"); rectified_waveforms->setCheckable(true); - rectified_waveforms->setData(reinterpret_cast(&Olive::CurrentConfig.rectified_waveforms)); + rectified_waveforms->setData(reinterpret_cast(&olive::CurrentConfig.rectified_waveforms)); view_menu->addSeparator(); - frames_action = view_menu->addAction(tr("Frames"), &Olive::MenuHelper, SLOT(set_timecode_view())); + frames_action = view_menu->addAction(tr("Frames"), &olive::MenuHelper, SLOT(set_timecode_view())); frames_action->setProperty("id", "modeframes"); frames_action->setData(TIMECODE_FRAMES); frames_action->setCheckable(true); - drop_frame_action = view_menu->addAction(tr("Drop Frame"), &Olive::MenuHelper, SLOT(set_timecode_view())); + drop_frame_action = view_menu->addAction(tr("Drop Frame"), &olive::MenuHelper, SLOT(set_timecode_view())); drop_frame_action->setProperty("id", "modedropframe"); drop_frame_action->setData(TIMECODE_DROP); drop_frame_action->setCheckable(true); - nondrop_frame_action = view_menu->addAction(tr("Non-Drop Frame"), &Olive::MenuHelper, SLOT(set_timecode_view())); + nondrop_frame_action = view_menu->addAction(tr("Non-Drop Frame"), &olive::MenuHelper, SLOT(set_timecode_view())); nondrop_frame_action->setProperty("id", "modenondropframe"); nondrop_frame_action->setData(TIMECODE_NONDROP); nondrop_frame_action->setCheckable(true); - milliseconds_action = view_menu->addAction(tr("Milliseconds"), &Olive::MenuHelper, SLOT(set_timecode_view())); + milliseconds_action = view_menu->addAction(tr("Milliseconds"), &olive::MenuHelper, SLOT(set_timecode_view())); milliseconds_action->setProperty("id", "milliseconds"); milliseconds_action->setData(TIMECODE_MILLISECONDS); milliseconds_action->setCheckable(true); @@ -484,31 +484,31 @@ void MainWindow::setup_menus() { title_safe_off->setProperty("id", "titlesafeoff"); title_safe_off->setCheckable(true); title_safe_off->setData(qSNaN()); - connect(title_safe_off, SIGNAL(triggered(bool)), &Olive::MenuHelper, SLOT(set_titlesafe_from_menu())); + connect(title_safe_off, SIGNAL(triggered(bool)), &olive::MenuHelper, SLOT(set_titlesafe_from_menu())); title_safe_default = title_safe_area_menu->addAction(tr("Default")); title_safe_default->setProperty("id", "titlesafedefault"); title_safe_default->setCheckable(true); title_safe_default->setData(0.0); - connect(title_safe_default, SIGNAL(triggered(bool)), &Olive::MenuHelper, SLOT(set_titlesafe_from_menu())); + connect(title_safe_default, SIGNAL(triggered(bool)), &olive::MenuHelper, SLOT(set_titlesafe_from_menu())); title_safe_43 = title_safe_area_menu->addAction(tr("4:3")); title_safe_43->setProperty("id", "titlesafe43"); title_safe_43->setCheckable(true); title_safe_43->setData(4.0/3.0); - connect(title_safe_43, SIGNAL(triggered(bool)), &Olive::MenuHelper, SLOT(set_titlesafe_from_menu())); + connect(title_safe_43, SIGNAL(triggered(bool)), &olive::MenuHelper, SLOT(set_titlesafe_from_menu())); title_safe_169 = title_safe_area_menu->addAction(tr("16:9")); title_safe_169->setProperty("id", "titlesafe169"); title_safe_169->setCheckable(true); title_safe_169->setData(16.0/9.0); - connect(title_safe_169, SIGNAL(triggered(bool)), &Olive::MenuHelper, SLOT(set_titlesafe_from_menu())); + connect(title_safe_169, SIGNAL(triggered(bool)), &olive::MenuHelper, SLOT(set_titlesafe_from_menu())); title_safe_custom = title_safe_area_menu->addAction(tr("Custom")); title_safe_custom->setProperty("id", "titlesafecustom"); title_safe_custom->setCheckable(true); title_safe_custom->setData(-1.0); - connect(title_safe_custom, SIGNAL(triggered(bool)), &Olive::MenuHelper, SLOT(set_titlesafe_from_menu())); + connect(title_safe_custom, SIGNAL(triggered(bool)), &olive::MenuHelper, SLOT(set_titlesafe_from_menu())); view_menu->addSeparator(); @@ -516,35 +516,35 @@ void MainWindow::setup_menus() { full_screen->setProperty("id", "fullscreen"); full_screen->setCheckable(true); - view_menu->addAction(tr("Full Screen Viewer"), &Olive::FocusFilter, SLOT(set_viewer_fullscreen()))->setProperty("id", "fullscreenviewer"); + view_menu->addAction(tr("Full Screen Viewer"), &olive::FocusFilter, SLOT(set_viewer_fullscreen()))->setProperty("id", "fullscreenviewer"); // INITIALIZE PLAYBACK MENU QMenu* playback_menu = menuBar->addMenu(tr("&Playback")); connect(playback_menu, SIGNAL(aboutToShow()), this, SLOT(playbackMenu_About_To_Be_Shown())); - playback_menu->addAction(tr("Go to Start"), &Olive::FocusFilter, SLOT(go_to_start()), QKeySequence("Home"))->setProperty("id", "gotostart"); - playback_menu->addAction(tr("Previous Frame"), &Olive::FocusFilter, SLOT(prev_frame()), QKeySequence("Left"))->setProperty("id", "prevframe"); - playback_menu->addAction(tr("Play/Pause"), &Olive::FocusFilter, SLOT(playpause()), QKeySequence("Space"))->setProperty("id", "playpause"); - playback_menu->addAction(tr("Play In to Out"), &Olive::FocusFilter, SLOT(play_in_to_out()), QKeySequence("Shift+Space"))->setProperty("id", "playintoout"); - playback_menu->addAction(tr("Next Frame"), &Olive::FocusFilter, SLOT(next_frame()), QKeySequence("Right"))->setProperty("id", "nextframe"); - playback_menu->addAction(tr("Go to End"), &Olive::FocusFilter, SLOT(go_to_end()), QKeySequence("End"))->setProperty("id", "gotoend"); + playback_menu->addAction(tr("Go to Start"), &olive::FocusFilter, SLOT(go_to_start()), QKeySequence("Home"))->setProperty("id", "gotostart"); + playback_menu->addAction(tr("Previous Frame"), &olive::FocusFilter, SLOT(prev_frame()), QKeySequence("Left"))->setProperty("id", "prevframe"); + playback_menu->addAction(tr("Play/Pause"), &olive::FocusFilter, SLOT(playpause()), QKeySequence("Space"))->setProperty("id", "playpause"); + playback_menu->addAction(tr("Play In to Out"), &olive::FocusFilter, SLOT(play_in_to_out()), QKeySequence("Shift+Space"))->setProperty("id", "playintoout"); + playback_menu->addAction(tr("Next Frame"), &olive::FocusFilter, SLOT(next_frame()), QKeySequence("Right"))->setProperty("id", "nextframe"); + playback_menu->addAction(tr("Go to End"), &olive::FocusFilter, SLOT(go_to_end()), QKeySequence("End"))->setProperty("id", "gotoend"); playback_menu->addSeparator(); playback_menu->addAction(tr("Go to Previous Cut"), panel_timeline, SLOT(previous_cut()), QKeySequence("Up"))->setProperty("id", "prevcut"); playback_menu->addAction(tr("Go to Next Cut"), panel_timeline, SLOT(next_cut()), QKeySequence("Down"))->setProperty("id", "nextcut"); playback_menu->addSeparator(); - playback_menu->addAction(tr("Go to In Point"), &Olive::FocusFilter, SLOT(go_to_in()), QKeySequence("Shift+I"))->setProperty("id", "gotoin"); - playback_menu->addAction(tr("Go to Out Point"), &Olive::FocusFilter, SLOT(go_to_out()), QKeySequence("Shift+O"))->setProperty("id", "gotoout"); + playback_menu->addAction(tr("Go to In Point"), &olive::FocusFilter, SLOT(go_to_in()), QKeySequence("Shift+I"))->setProperty("id", "gotoin"); + playback_menu->addAction(tr("Go to Out Point"), &olive::FocusFilter, SLOT(go_to_out()), QKeySequence("Shift+O"))->setProperty("id", "gotoout"); playback_menu->addSeparator(); - playback_menu->addAction(tr("Shuttle Left"), &Olive::FocusFilter, SLOT(decrease_speed()), QKeySequence("J"))->setProperty("id", "decspeed"); - playback_menu->addAction(tr("Shuttle Stop"), &Olive::FocusFilter, SLOT(pause()), QKeySequence("K"))->setProperty("id", "pause"); - playback_menu->addAction(tr("Shuttle Right"), &Olive::FocusFilter, SLOT(increase_speed()), QKeySequence("L"))->setProperty("id", "incspeed"); + playback_menu->addAction(tr("Shuttle Left"), &olive::FocusFilter, SLOT(decrease_speed()), QKeySequence("J"))->setProperty("id", "decspeed"); + playback_menu->addAction(tr("Shuttle Stop"), &olive::FocusFilter, SLOT(pause()), QKeySequence("K"))->setProperty("id", "pause"); + playback_menu->addAction(tr("Shuttle Right"), &olive::FocusFilter, SLOT(increase_speed()), QKeySequence("L"))->setProperty("id", "incspeed"); playback_menu->addSeparator(); - loop_action = playback_menu->addAction(tr("Loop"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + loop_action = playback_menu->addAction(tr("Loop"), &olive::MenuHelper, SLOT(toggle_bool_action())); loop_action->setProperty("id", "loop"); loop_action->setCheckable(true); - loop_action->setData(reinterpret_cast(&Olive::CurrentConfig.loop)); + loop_action->setData(reinterpret_cast(&olive::CurrentConfig.loop)); // INITIALIZE WINDOW MENU @@ -594,171 +594,171 @@ void MainWindow::setup_menus() { QMenu* tools_menu = menuBar->addMenu(tr("&Tools")); connect(tools_menu, SIGNAL(aboutToShow()), this, SLOT(toolMenu_About_To_Be_Shown())); - pointer_tool_action = tools_menu->addAction(tr("Pointer Tool"), &Olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("V")); + pointer_tool_action = tools_menu->addAction(tr("Pointer Tool"), &olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("V")); pointer_tool_action->setProperty("id", "pointertool"); pointer_tool_action->setCheckable(true); pointer_tool_action->setData(reinterpret_cast(panel_timeline->toolArrowButton)); - edit_tool_action = tools_menu->addAction(tr("Edit Tool"), &Olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("X")); + edit_tool_action = tools_menu->addAction(tr("Edit Tool"), &olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("X")); edit_tool_action->setProperty("id", "edittool"); edit_tool_action->setCheckable(true); edit_tool_action->setData(reinterpret_cast(panel_timeline->toolEditButton)); - ripple_tool_action = tools_menu->addAction(tr("Ripple Tool"), &Olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("B")); + ripple_tool_action = tools_menu->addAction(tr("Ripple Tool"), &olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("B")); ripple_tool_action->setProperty("id", "rippletool"); ripple_tool_action->setCheckable(true); ripple_tool_action->setData(reinterpret_cast(panel_timeline->toolRippleButton)); - razor_tool_action = tools_menu->addAction(tr("Razor Tool"), &Olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("C")); + razor_tool_action = tools_menu->addAction(tr("Razor Tool"), &olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("C")); razor_tool_action->setProperty("id", "razortool"); razor_tool_action->setCheckable(true); razor_tool_action->setData(reinterpret_cast(panel_timeline->toolRazorButton)); - slip_tool_action = tools_menu->addAction(tr("Slip Tool"), &Olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("Y")); + slip_tool_action = tools_menu->addAction(tr("Slip Tool"), &olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("Y")); slip_tool_action->setProperty("id", "sliptool"); slip_tool_action->setCheckable(true); slip_tool_action->setData(reinterpret_cast(panel_timeline->toolSlipButton)); - slide_tool_action = tools_menu->addAction(tr("Slide Tool"), &Olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("U")); + slide_tool_action = tools_menu->addAction(tr("Slide Tool"), &olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("U")); slide_tool_action->setProperty("id", "slidetool"); slide_tool_action->setCheckable(true); slide_tool_action->setData(reinterpret_cast(panel_timeline->toolSlideButton)); - hand_tool_action = tools_menu->addAction(tr("Hand Tool"), &Olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("H")); + hand_tool_action = tools_menu->addAction(tr("Hand Tool"), &olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("H")); hand_tool_action->setProperty("id", "handtool"); hand_tool_action->setCheckable(true); hand_tool_action->setData(reinterpret_cast(panel_timeline->toolHandButton)); - transition_tool_action = tools_menu->addAction(tr("Transition Tool"), &Olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("T")); + transition_tool_action = tools_menu->addAction(tr("Transition Tool"), &olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("T")); transition_tool_action->setProperty("id", "transitiontool"); transition_tool_action->setCheckable(true); transition_tool_action->setData(reinterpret_cast(panel_timeline->toolTransitionButton)); tools_menu->addSeparator(); - snap_toggle = tools_menu->addAction(tr("Enable Snapping"), &Olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("S")); + snap_toggle = tools_menu->addAction(tr("Enable Snapping"), &olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("S")); snap_toggle->setProperty("id", "snapping"); snap_toggle->setCheckable(true); snap_toggle->setData(reinterpret_cast(panel_timeline->snappingButton)); tools_menu->addSeparator(); - selecting_also_seeks = tools_menu->addAction(tr("Selecting Also Seeks"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + selecting_also_seeks = tools_menu->addAction(tr("Selecting Also Seeks"), &olive::MenuHelper, SLOT(toggle_bool_action())); selecting_also_seeks->setProperty("id", "selectingalsoseeks"); selecting_also_seeks->setCheckable(true); - selecting_also_seeks->setData(reinterpret_cast(&Olive::CurrentConfig.select_also_seeks)); + selecting_also_seeks->setData(reinterpret_cast(&olive::CurrentConfig.select_also_seeks)); - edit_tool_also_seeks = tools_menu->addAction(tr("Edit Tool Also Seeks"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + edit_tool_also_seeks = tools_menu->addAction(tr("Edit Tool Also Seeks"), &olive::MenuHelper, SLOT(toggle_bool_action())); edit_tool_also_seeks->setProperty("id", "editalsoseeks"); edit_tool_also_seeks->setCheckable(true); - edit_tool_also_seeks->setData(reinterpret_cast(&Olive::CurrentConfig.edit_tool_also_seeks)); + edit_tool_also_seeks->setData(reinterpret_cast(&olive::CurrentConfig.edit_tool_also_seeks)); - edit_tool_selects_links = tools_menu->addAction(tr("Edit Tool Selects Links"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + edit_tool_selects_links = tools_menu->addAction(tr("Edit Tool Selects Links"), &olive::MenuHelper, SLOT(toggle_bool_action())); edit_tool_selects_links->setProperty("id", "editselectslinks"); edit_tool_selects_links->setCheckable(true); - edit_tool_selects_links->setData(reinterpret_cast(&Olive::CurrentConfig.edit_tool_selects_links)); + edit_tool_selects_links->setData(reinterpret_cast(&olive::CurrentConfig.edit_tool_selects_links)); - seek_also_selects = tools_menu->addAction(tr("Seek Also Selects"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + seek_also_selects = tools_menu->addAction(tr("Seek Also Selects"), &olive::MenuHelper, SLOT(toggle_bool_action())); seek_also_selects->setProperty("id", "seekalsoselects"); seek_also_selects->setCheckable(true); - seek_also_selects->setData(reinterpret_cast(&Olive::CurrentConfig.seek_also_selects)); + seek_also_selects->setData(reinterpret_cast(&olive::CurrentConfig.seek_also_selects)); - seek_to_end_of_pastes = tools_menu->addAction(tr("Seek to the End of Pastes"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + seek_to_end_of_pastes = tools_menu->addAction(tr("Seek to the End of Pastes"), &olive::MenuHelper, SLOT(toggle_bool_action())); seek_to_end_of_pastes->setProperty("id", "seektoendofpastes"); seek_to_end_of_pastes->setCheckable(true); - seek_to_end_of_pastes->setData(reinterpret_cast(&Olive::CurrentConfig.paste_seeks)); + seek_to_end_of_pastes->setData(reinterpret_cast(&olive::CurrentConfig.paste_seeks)); - scroll_wheel_zooms = tools_menu->addAction(tr("Scroll Wheel Zooms"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + scroll_wheel_zooms = tools_menu->addAction(tr("Scroll Wheel Zooms"), &olive::MenuHelper, SLOT(toggle_bool_action())); scroll_wheel_zooms->setProperty("id", "scrollwheelzooms"); scroll_wheel_zooms->setCheckable(true); - scroll_wheel_zooms->setData(reinterpret_cast(&Olive::CurrentConfig.scroll_zooms)); + scroll_wheel_zooms->setData(reinterpret_cast(&olive::CurrentConfig.scroll_zooms)); - enable_drag_files_to_timeline = tools_menu->addAction(tr("Enable Drag Files to Timeline"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + enable_drag_files_to_timeline = tools_menu->addAction(tr("Enable Drag Files to Timeline"), &olive::MenuHelper, SLOT(toggle_bool_action())); enable_drag_files_to_timeline->setProperty("id", "enabledragfilestotimeline"); enable_drag_files_to_timeline->setCheckable(true); - enable_drag_files_to_timeline->setData(reinterpret_cast(&Olive::CurrentConfig.enable_drag_files_to_timeline)); + enable_drag_files_to_timeline->setData(reinterpret_cast(&olive::CurrentConfig.enable_drag_files_to_timeline)); - autoscale_by_default = tools_menu->addAction(tr("Auto-Scale By Default"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + autoscale_by_default = tools_menu->addAction(tr("Auto-Scale By Default"), &olive::MenuHelper, SLOT(toggle_bool_action())); autoscale_by_default->setProperty("id", "autoscalebydefault"); autoscale_by_default->setCheckable(true); - autoscale_by_default->setData(reinterpret_cast(&Olive::CurrentConfig.autoscale_by_default)); + autoscale_by_default->setData(reinterpret_cast(&olive::CurrentConfig.autoscale_by_default)); - enable_seek_to_import = tools_menu->addAction(tr("Enable Seek to Import"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + enable_seek_to_import = tools_menu->addAction(tr("Enable Seek to Import"), &olive::MenuHelper, SLOT(toggle_bool_action())); enable_seek_to_import->setProperty("id", "enableseektoimport"); enable_seek_to_import->setCheckable(true); - enable_seek_to_import->setData(reinterpret_cast(&Olive::CurrentConfig.enable_seek_to_import)); + enable_seek_to_import->setData(reinterpret_cast(&olive::CurrentConfig.enable_seek_to_import)); - enable_audio_scrubbing = tools_menu->addAction(tr("Audio Scrubbing"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + enable_audio_scrubbing = tools_menu->addAction(tr("Audio Scrubbing"), &olive::MenuHelper, SLOT(toggle_bool_action())); enable_audio_scrubbing->setProperty("id", "audioscrubbing"); enable_audio_scrubbing->setCheckable(true); - enable_audio_scrubbing->setData(reinterpret_cast(&Olive::CurrentConfig.enable_audio_scrubbing)); + enable_audio_scrubbing->setData(reinterpret_cast(&olive::CurrentConfig.enable_audio_scrubbing)); - enable_drop_on_media_to_replace = tools_menu->addAction(tr("Enable Drop on Media to Replace"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + enable_drop_on_media_to_replace = tools_menu->addAction(tr("Enable Drop on Media to Replace"), &olive::MenuHelper, SLOT(toggle_bool_action())); enable_drop_on_media_to_replace->setProperty("id", "enabledropmediareplace"); enable_drop_on_media_to_replace->setCheckable(true); - enable_drop_on_media_to_replace->setData(reinterpret_cast(&Olive::CurrentConfig.drop_on_media_to_replace)); + enable_drop_on_media_to_replace->setData(reinterpret_cast(&olive::CurrentConfig.drop_on_media_to_replace)); - enable_hover_focus = tools_menu->addAction(tr("Enable Hover Focus"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + enable_hover_focus = tools_menu->addAction(tr("Enable Hover Focus"), &olive::MenuHelper, SLOT(toggle_bool_action())); enable_hover_focus->setProperty("id", "hoverfocus"); enable_hover_focus->setCheckable(true); - enable_hover_focus->setData(reinterpret_cast(&Olive::CurrentConfig.hover_focus)); + enable_hover_focus->setData(reinterpret_cast(&olive::CurrentConfig.hover_focus)); - set_name_and_marker = tools_menu->addAction(tr("Ask For Name When Setting Marker"), &Olive::MenuHelper, SLOT(toggle_bool_action())); + set_name_and_marker = tools_menu->addAction(tr("Ask For Name When Setting Marker"), &olive::MenuHelper, SLOT(toggle_bool_action())); set_name_and_marker->setProperty("id", "asknamemarkerset"); set_name_and_marker->setCheckable(true); - set_name_and_marker->setData(reinterpret_cast(&Olive::CurrentConfig.set_name_with_marker)); + set_name_and_marker->setData(reinterpret_cast(&olive::CurrentConfig.set_name_with_marker)); tools_menu->addSeparator(); - no_autoscroll = tools_menu->addAction(tr("No Auto-Scroll"), &Olive::MenuHelper, SLOT(set_autoscroll())); + no_autoscroll = tools_menu->addAction(tr("No Auto-Scroll"), &olive::MenuHelper, SLOT(set_autoscroll())); no_autoscroll->setProperty("id", "autoscrollno"); no_autoscroll->setData(AUTOSCROLL_NO_SCROLL); no_autoscroll->setCheckable(true); - page_autoscroll = tools_menu->addAction(tr("Page Auto-Scroll"), &Olive::MenuHelper, SLOT(set_autoscroll())); + page_autoscroll = tools_menu->addAction(tr("Page Auto-Scroll"), &olive::MenuHelper, SLOT(set_autoscroll())); page_autoscroll->setProperty("id", "autoscrollpage"); page_autoscroll->setData(AUTOSCROLL_PAGE_SCROLL); page_autoscroll->setCheckable(true); - smooth_autoscroll = tools_menu->addAction(tr("Smooth Auto-Scroll"), &Olive::MenuHelper, SLOT(set_autoscroll())); + smooth_autoscroll = tools_menu->addAction(tr("Smooth Auto-Scroll"), &olive::MenuHelper, SLOT(set_autoscroll())); smooth_autoscroll->setProperty("id", "autoscrollsmooth"); smooth_autoscroll->setData(AUTOSCROLL_SMOOTH_SCROLL); smooth_autoscroll->setCheckable(true); tools_menu->addSeparator(); - tools_menu->addAction(tr("Preferences"), Olive::Global.data(), SLOT(open_preferences()), QKeySequence("Ctrl+,"))->setProperty("id", "prefs"); + tools_menu->addAction(tr("Preferences"), olive::Global.get(), SLOT(open_preferences()), QKeySequence("Ctrl+,"))->setProperty("id", "prefs"); #ifdef QT_DEBUG - tools_menu->addAction(tr("Clear Undo"), Olive::Global.data(), SLOT(clear_undo_stack()))->setProperty("id", "clearundo"); + tools_menu->addAction(tr("Clear Undo"), olive::Global.get(), SLOT(clear_undo_stack()))->setProperty("id", "clearundo"); #endif // INITIALIZE HELP MENU QMenu* help_menu = menuBar->addMenu(tr("&Help")); - help_menu->addAction(tr("A&ction Search"), Olive::Global.data(), SLOT(open_action_search()), QKeySequence("/"))->setProperty("id", "actionsearch"); + help_menu->addAction(tr("A&ction Search"), olive::Global.get(), SLOT(open_action_search()), QKeySequence("/"))->setProperty("id", "actionsearch"); help_menu->addSeparator(); - help_menu->addAction(tr("Debug Log"), Olive::Global.data(), SLOT(open_debug_log()))->setProperty("id", "debuglog"); + help_menu->addAction(tr("Debug Log"), olive::Global.get(), SLOT(open_debug_log()))->setProperty("id", "debuglog"); help_menu->addSeparator(); - help_menu->addAction(tr("&About..."), Olive::Global.data(), SLOT(open_about_dialog()))->setProperty("id", "about"); + help_menu->addAction(tr("&About..."), olive::Global.get(), SLOT(open_about_dialog()))->setProperty("id", "about"); load_shortcuts(get_config_path() + "/shortcuts"); } void MainWindow::updateTitle() { - setWindowTitle(QString("%1 - %2[*]").arg(Olive::AppName, - (Olive::ActiveProjectFilename.isEmpty()) ? - tr("") : Olive::ActiveProjectFilename) + setWindowTitle(QString("%1 - %2[*]").arg(olive::AppName, + (olive::ActiveProjectFilename.isEmpty()) ? + tr("") : olive::ActiveProjectFilename) ); } void MainWindow::closeEvent(QCloseEvent *e) { - if (Olive::Global.data()->can_close_project()) { + if (olive::Global->can_close_project()) { // stop proxy generator thread proxy_generator.cancel(); @@ -784,7 +784,7 @@ void MainWindow::closeEvent(QCloseEvent *e) { QString config_fn = config_dir.filePath("config.xml"); // save settings - Olive::CurrentConfig.save(config_fn); + olive::CurrentConfig.save(config_fn); // save panel layout QFile panel_config(config_path + "/layout"); @@ -860,28 +860,28 @@ void MainWindow::windowMenu_About_To_Be_Shown() { } void MainWindow::playbackMenu_About_To_Be_Shown() { - Olive::MenuHelper.set_bool_action_checked(loop_action); + olive::MenuHelper.set_bool_action_checked(loop_action); } void MainWindow::viewMenu_About_To_Be_Shown() { - Olive::MenuHelper.set_bool_action_checked(track_lines); + olive::MenuHelper.set_bool_action_checked(track_lines); - Olive::MenuHelper.set_int_action_checked(frames_action, Olive::CurrentConfig.timecode_view); - Olive::MenuHelper.set_int_action_checked(drop_frame_action, Olive::CurrentConfig.timecode_view); - Olive::MenuHelper.set_int_action_checked(nondrop_frame_action, Olive::CurrentConfig.timecode_view); - Olive::MenuHelper.set_int_action_checked(milliseconds_action, Olive::CurrentConfig.timecode_view); + olive::MenuHelper.set_int_action_checked(frames_action, olive::CurrentConfig.timecode_view); + olive::MenuHelper.set_int_action_checked(drop_frame_action, olive::CurrentConfig.timecode_view); + olive::MenuHelper.set_int_action_checked(nondrop_frame_action, olive::CurrentConfig.timecode_view); + olive::MenuHelper.set_int_action_checked(milliseconds_action, olive::CurrentConfig.timecode_view); - title_safe_off->setChecked(!Olive::CurrentConfig.show_title_safe_area); - title_safe_default->setChecked(Olive::CurrentConfig.show_title_safe_area - && !Olive::CurrentConfig.use_custom_title_safe_ratio); - title_safe_43->setChecked(Olive::CurrentConfig.show_title_safe_area - && Olive::CurrentConfig.use_custom_title_safe_ratio - && qFuzzyCompare(Olive::CurrentConfig.custom_title_safe_ratio, title_safe_43->data().toDouble())); - title_safe_169->setChecked(Olive::CurrentConfig.show_title_safe_area - && Olive::CurrentConfig.use_custom_title_safe_ratio - && qFuzzyCompare(Olive::CurrentConfig.custom_title_safe_ratio, title_safe_169->data().toDouble())); - title_safe_custom->setChecked(Olive::CurrentConfig.show_title_safe_area - && Olive::CurrentConfig.use_custom_title_safe_ratio + title_safe_off->setChecked(!olive::CurrentConfig.show_title_safe_area); + title_safe_default->setChecked(olive::CurrentConfig.show_title_safe_area + && !olive::CurrentConfig.use_custom_title_safe_ratio); + title_safe_43->setChecked(olive::CurrentConfig.show_title_safe_area + && olive::CurrentConfig.use_custom_title_safe_ratio + && qFuzzyCompare(olive::CurrentConfig.custom_title_safe_ratio, title_safe_43->data().toDouble())); + title_safe_169->setChecked(olive::CurrentConfig.show_title_safe_area + && olive::CurrentConfig.use_custom_title_safe_ratio + && qFuzzyCompare(olive::CurrentConfig.custom_title_safe_ratio, title_safe_169->data().toDouble())); + title_safe_custom->setChecked(olive::CurrentConfig.show_title_safe_area + && olive::CurrentConfig.use_custom_title_safe_ratio && !title_safe_43->isChecked() && !title_safe_169->isChecked()); @@ -891,34 +891,34 @@ void MainWindow::viewMenu_About_To_Be_Shown() { } void MainWindow::toolMenu_About_To_Be_Shown() { - Olive::MenuHelper.set_button_action_checked(pointer_tool_action); - Olive::MenuHelper.set_button_action_checked(edit_tool_action); - Olive::MenuHelper.set_button_action_checked(ripple_tool_action); - Olive::MenuHelper.set_button_action_checked(razor_tool_action); - Olive::MenuHelper.set_button_action_checked(slip_tool_action); - Olive::MenuHelper.set_button_action_checked(slide_tool_action); - Olive::MenuHelper.set_button_action_checked(hand_tool_action); - Olive::MenuHelper.set_button_action_checked(transition_tool_action); - Olive::MenuHelper.set_button_action_checked(snap_toggle); + olive::MenuHelper.set_button_action_checked(pointer_tool_action); + olive::MenuHelper.set_button_action_checked(edit_tool_action); + olive::MenuHelper.set_button_action_checked(ripple_tool_action); + olive::MenuHelper.set_button_action_checked(razor_tool_action); + olive::MenuHelper.set_button_action_checked(slip_tool_action); + olive::MenuHelper.set_button_action_checked(slide_tool_action); + olive::MenuHelper.set_button_action_checked(hand_tool_action); + olive::MenuHelper.set_button_action_checked(transition_tool_action); + olive::MenuHelper.set_button_action_checked(snap_toggle); - Olive::MenuHelper.set_bool_action_checked(selecting_also_seeks); - Olive::MenuHelper.set_bool_action_checked(edit_tool_also_seeks); - Olive::MenuHelper.set_bool_action_checked(edit_tool_selects_links); - Olive::MenuHelper.set_bool_action_checked(seek_to_end_of_pastes); - Olive::MenuHelper.set_bool_action_checked(scroll_wheel_zooms); - Olive::MenuHelper.set_bool_action_checked(rectified_waveforms); - Olive::MenuHelper.set_bool_action_checked(enable_drag_files_to_timeline); - Olive::MenuHelper.set_bool_action_checked(autoscale_by_default); - Olive::MenuHelper.set_bool_action_checked(enable_seek_to_import); - Olive::MenuHelper.set_bool_action_checked(enable_audio_scrubbing); - Olive::MenuHelper.set_bool_action_checked(enable_drop_on_media_to_replace); - Olive::MenuHelper.set_bool_action_checked(enable_hover_focus); - Olive::MenuHelper.set_bool_action_checked(set_name_and_marker); - Olive::MenuHelper.set_bool_action_checked(seek_also_selects); + olive::MenuHelper.set_bool_action_checked(selecting_also_seeks); + olive::MenuHelper.set_bool_action_checked(edit_tool_also_seeks); + olive::MenuHelper.set_bool_action_checked(edit_tool_selects_links); + olive::MenuHelper.set_bool_action_checked(seek_to_end_of_pastes); + olive::MenuHelper.set_bool_action_checked(scroll_wheel_zooms); + olive::MenuHelper.set_bool_action_checked(rectified_waveforms); + olive::MenuHelper.set_bool_action_checked(enable_drag_files_to_timeline); + olive::MenuHelper.set_bool_action_checked(autoscale_by_default); + olive::MenuHelper.set_bool_action_checked(enable_seek_to_import); + olive::MenuHelper.set_bool_action_checked(enable_audio_scrubbing); + olive::MenuHelper.set_bool_action_checked(enable_drop_on_media_to_replace); + olive::MenuHelper.set_bool_action_checked(enable_hover_focus); + olive::MenuHelper.set_bool_action_checked(set_name_and_marker); + olive::MenuHelper.set_bool_action_checked(seek_also_selects); - Olive::MenuHelper.set_int_action_checked(no_autoscroll, Olive::CurrentConfig.autoscroll); - Olive::MenuHelper.set_int_action_checked(page_autoscroll, Olive::CurrentConfig.autoscroll); - Olive::MenuHelper.set_int_action_checked(smooth_autoscroll, Olive::CurrentConfig.autoscroll); + olive::MenuHelper.set_int_action_checked(no_autoscroll, olive::CurrentConfig.autoscroll); + olive::MenuHelper.set_int_action_checked(page_autoscroll, olive::CurrentConfig.autoscroll); + olive::MenuHelper.set_int_action_checked(smooth_autoscroll, olive::CurrentConfig.autoscroll); } void MainWindow::toggle_panel_visibility() { @@ -939,7 +939,7 @@ void MainWindow::fileMenu_About_To_Be_Shown() { QAction* action = open_recent->addAction(recent_projects.at(i)); action->setProperty("keyignore", true); action->setData(i); - connect(action, SIGNAL(triggered()), &Olive::MenuHelper, SLOT(open_recent_from_menu())); + connect(action, SIGNAL(triggered()), &olive::MenuHelper, SLOT(open_recent_from_menu())); } open_recent->addSeparator(); diff --git a/mainwindow.h b/mainwindow.h index 566e3fdb9..2dc6c6dca 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -259,7 +259,7 @@ private: bool first_show; }; -namespace Olive { +namespace olive { extern MainWindow* MainWindow; } diff --git a/oliveglobal.cpp b/oliveglobal.cpp index 910c6c687..c49f26da2 100644 --- a/oliveglobal.cpp +++ b/oliveglobal.cpp @@ -43,9 +43,9 @@ #include #include -QSharedPointer Olive::Global; -QString Olive::ActiveProjectFilename; -QString Olive::AppName; +std::unique_ptr olive::Global; +QString olive::ActiveProjectFilename; +QString olive::AppName; OliveGlobal::OliveGlobal() { // sets current app name @@ -53,7 +53,7 @@ OliveGlobal::OliveGlobal() { #ifdef GITHASH version_id = QString(" | %1").arg(GITHASH); #endif - Olive::AppName = QString("Olive (February 2019 | Alpha%1)").arg(version_id); + olive::AppName = QString("Olive (February 2019 | Alpha%1)").arg(version_id); // set the file filter used in all file dialogs pertaining to Olive project files. project_file_filter = tr("Olive Project %1").arg("(*.ove)"); @@ -68,10 +68,10 @@ const QString &OliveGlobal::get_project_file_filter() { void OliveGlobal::update_project_filename(const QString &s) { // set filename to s - Olive::ActiveProjectFilename = s; + olive::ActiveProjectFilename = s; // update main window title to reflect new project filename - Olive::MainWindow->updateTitle(); + olive::MainWindow->updateTitle(); } void OliveGlobal::check_for_autorecovery_file() { @@ -101,7 +101,7 @@ void OliveGlobal::set_rendering_state(bool rendering) { } void OliveGlobal::load_project_on_launch(const QString& s) { - Olive::ActiveProjectFilename = s; + olive::ActiveProjectFilename = s; enable_load_project_on_init = true; } @@ -118,7 +118,7 @@ void OliveGlobal::new_project() { panel_project->new_project(); // clear undo stack - Olive::UndoStack.clear(); + olive::UndoStack.clear(); // empty current project filename update_project_filename(""); @@ -129,7 +129,7 @@ void OliveGlobal::new_project() { } void OliveGlobal::open_project() { - QString fn = QFileDialog::getOpenFileName(Olive::MainWindow, tr("Open Project..."), "", project_file_filter); + QString fn = QFileDialog::getOpenFileName(olive::MainWindow, tr("Open Project..."), "", project_file_filter); if (!fn.isEmpty() && can_close_project()) { open_project_worker(fn, false); } @@ -139,20 +139,20 @@ void OliveGlobal::open_recent(int index) { QString recent_url = recent_projects.at(index); if (!QFile::exists(recent_url)) { if (QMessageBox::question( - Olive::MainWindow, + olive::MainWindow, tr("Missing recent project"), tr("The project '%1' no longer exists. Would you like to remove it from the recent projects list?").arg(recent_url), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { recent_projects.removeAt(index); panel_project->save_recent_projects(); } - } else if (Olive::Global.data()->can_close_project()) { + } else if (can_close_project()) { open_project_worker(recent_url, false); } } bool OliveGlobal::save_project_as() { - QString fn = QFileDialog::getSaveFileName(Olive::MainWindow, tr("Save Project As..."), "", project_file_filter); + QString fn = QFileDialog::getSaveFileName(olive::MainWindow, tr("Save Project As..."), "", project_file_filter); if (!fn.isEmpty()) { if (!fn.endsWith(".ove", Qt::CaseInsensitive)) { fn += ".ove"; @@ -165,7 +165,7 @@ bool OliveGlobal::save_project_as() { } bool OliveGlobal::save_project() { - if (Olive::ActiveProjectFilename.isEmpty()) { + if (olive::ActiveProjectFilename.isEmpty()) { return save_project_as(); } else { panel_project->save_project(false); @@ -174,13 +174,13 @@ bool OliveGlobal::save_project() { } bool OliveGlobal::can_close_project() { - if (Olive::MainWindow->isWindowModified()) { + if (olive::MainWindow->isWindowModified()) { QMessageBox* m = new QMessageBox( QMessageBox::Question, tr("Unsaved Project"), tr("This project has changed since it was last saved. Would you like to save it before closing?"), QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel, - Olive::MainWindow + olive::MainWindow ); m->setWindowModality(Qt::WindowModal); int r = m->exec(); @@ -195,13 +195,13 @@ bool OliveGlobal::can_close_project() { } void OliveGlobal::open_export_dialog() { - if (Olive::ActiveSequence == nullptr) { - QMessageBox::information(Olive::MainWindow, + if (olive::ActiveSequence == nullptr) { + QMessageBox::information(olive::MainWindow, tr("No active sequence"), tr("Please open the sequence you wish to export."), QMessageBox::Ok); } else { - ExportDialog e(Olive::MainWindow); + ExportDialog e(olive::MainWindow); e.exec(); } } @@ -210,12 +210,12 @@ void OliveGlobal::finished_initialize() { if (enable_load_project_on_init) { // if a project was set as a command line argument, we load it here - if (QFileInfo::exists(Olive::ActiveProjectFilename)) { - open_project_worker(Olive::ActiveProjectFilename, false); + if (QFileInfo::exists(olive::ActiveProjectFilename)) { + open_project_worker(olive::ActiveProjectFilename, false); } else { - QMessageBox::critical(Olive::MainWindow, + QMessageBox::critical(olive::MainWindow, tr("Missing Project File"), - tr("Specified project '%1' does not exist.").arg(Olive::ActiveProjectFilename), + tr("Specified project '%1' does not exist.").arg(olive::ActiveProjectFilename), QMessageBox::Ok); update_project_filename(nullptr); } @@ -233,7 +233,7 @@ void OliveGlobal::finished_initialize() { } void OliveGlobal::save_autorecovery_file() { - if (Olive::MainWindow->isWindowModified()) { + if (olive::MainWindow->isWindowModified()) { panel_project->save_project(true); qInfo() << "Auto-recovery project saved"; } @@ -243,21 +243,21 @@ void OliveGlobal::open_preferences() { panel_sequence_viewer->pause(); panel_footage_viewer->pause(); - PreferencesDialog pd(Olive::MainWindow); - pd.setup_kbd_shortcuts(Olive::MainWindow->menuBar()); + PreferencesDialog pd(olive::MainWindow); + pd.setup_kbd_shortcuts(olive::MainWindow->menuBar()); pd.exec(); } void OliveGlobal::open_project_worker(const QString& fn, bool autorecovery) { update_project_filename(fn); panel_project->load_project(autorecovery); - Olive::UndoStack.clear(); + olive::UndoStack.clear(); } void OliveGlobal::undo() { // workaround to prevent crash (and also users should never need to do this) if (!panel_timeline->importing) { - Olive::UndoStack.undo(); + olive::UndoStack.undo(); update_ui(true); } } @@ -265,37 +265,37 @@ void OliveGlobal::undo() { void OliveGlobal::redo() { // workaround to prevent crash (and also users should never need to do this) if (!panel_timeline->importing) { - Olive::UndoStack.redo(); + olive::UndoStack.redo(); update_ui(true); } } void OliveGlobal::paste() { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { panel_timeline->paste(false); } } void OliveGlobal::paste_insert() { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { panel_timeline->paste(true); } } void OliveGlobal::open_about_dialog() { - AboutDialog a(Olive::MainWindow); + AboutDialog a(olive::MainWindow); a.exec(); } void OliveGlobal::open_debug_log() { - Olive::DebugDialog->show(); + olive::DebugDialog->show(); } void OliveGlobal::open_speed_dialog() { - if (Olive::ActiveSequence != nullptr) { - SpeedDialog s(Olive::MainWindow); - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + if (olive::ActiveSequence != nullptr) { + SpeedDialog s(olive::MainWindow); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && is_clip_selected(c, true)) { s.clips.append(c); } @@ -305,10 +305,10 @@ void OliveGlobal::open_speed_dialog() { } void OliveGlobal::clear_undo_stack() { - Olive::UndoStack.clear(); + olive::UndoStack.clear(); } void OliveGlobal::open_action_search() { - ActionSearch as(Olive::MainWindow); + ActionSearch as(olive::MainWindow); as.exec(); } diff --git a/oliveglobal.h b/oliveglobal.h index ca3de2520..7b3ffc2b1 100644 --- a/oliveglobal.h +++ b/oliveglobal.h @@ -295,11 +295,11 @@ private slots: }; -namespace Olive { +namespace olive { /** * @brief Object resource for various global functions used throughout Olive */ - extern QSharedPointer Global; + extern std::unique_ptr Global; /** * @brief Currently active project filename diff --git a/panels/effectcontrols.cpp b/panels/effectcontrols.cpp index 9339070fa..4c4e3875d 100644 --- a/panels/effectcontrols.cpp +++ b/panels/effectcontrols.cpp @@ -100,7 +100,7 @@ void EffectControls::set_zoom(bool in) { void EffectControls::menu_select(QAction* q) { ComboAction* ca = new ComboAction(); for (int i=0;iclips.at(selected_clips.at(i)); + Clip* c = olive::ActiveSequence->clips.at(selected_clips.at(i)); if ((c->track < 0) == (effect_menu_subtype == EFFECT_TYPE_VIDEO)) { const EffectMeta* meta = reinterpret_cast(q->data().value()); if (effect_menu_type == EFFECT_TYPE_TRANSITION) { @@ -115,7 +115,7 @@ void EffectControls::menu_select(QAction* q) { } } } - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); if (effect_menu_type == EFFECT_TYPE_TRANSITION) { update_ui(true); } else { @@ -140,7 +140,7 @@ void EffectControls::copy(bool del) { ComboAction* ca = new ComboAction(); EffectDeleteCommand* del_com = (del) ? new EffectDeleteCommand() : nullptr; for (int i=0;iclips.at(selected_clips.at(i)); + Clip* c = olive::ActiveSequence->clips.at(selected_clips.at(i)); for (int j=0;jeffects.size();j++) { Effect* effect = c->effects.at(j); if (effect->container->selected) { @@ -166,7 +166,7 @@ void EffectControls::copy(bool del) { delete del_com; } } - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } } @@ -282,7 +282,7 @@ void EffectControls::clear_effects(bool clear_cache) { void EffectControls::deselect_all_effects(QWidget* sender) { for (int i=0;iclips.at(selected_clips.at(i)); + Clip* c = olive::ActiveSequence->clips.at(selected_clips.at(i)); for (int j=0;jeffects.size();j++) { if (c->effects.at(j)->container != sender) { c->effects.at(j)->container->header_click(false, false); @@ -505,7 +505,7 @@ void EffectControls::load_effects() { if (!multiple) { // load in new clips for (int i=0;iclips.at(selected_clips.at(i)); + Clip* c = olive::ActiveSequence->clips.at(selected_clips.at(i)); QVBoxLayout* layout; if (c->track < 0) { vcontainer->setVisible(true); @@ -525,7 +525,7 @@ void EffectControls::load_effects() { } } if (selected_clips.size() > 0) { - setWindowTitle(panel_name + Olive::ActiveSequence->clips.at(selected_clips.at(0))->name); + setWindowTitle(panel_name + olive::ActiveSequence->clips.at(selected_clips.at(0))->name); keyframeView->setEnabled(true); headers->setVisible(true); @@ -539,7 +539,7 @@ void EffectControls::delete_effects() { if (mode == TA_NO_TRANSITION) { EffectDeleteCommand* command = new EffectDeleteCommand(); for (int i=0;iclips.at(selected_clips.at(i)); + Clip* c = olive::ActiveSequence->clips.at(selected_clips.at(i)); for (int j=0;jeffects.size();j++) { Effect* effect = c->effects.at(j); if (effect->container->selected) { @@ -549,7 +549,7 @@ void EffectControls::delete_effects() { } } if (command->clips.size() > 0) { - Olive::UndoStack.push(command); + olive::UndoStack.push(command); panel_sequence_viewer->viewer_widget->frame_update(); } else { delete command; @@ -595,7 +595,7 @@ void EffectControls::resizeEvent(QResizeEvent*) { bool EffectControls::is_focused() { if (this->hasFocus()) return true; for (int i=0;iclips.at(selected_clips.at(i)); + Clip* c = olive::ActiveSequence->clips.at(selected_clips.at(i)); if (c != nullptr) { for (int j=0;jeffects.size();j++) { if (c->effects.at(j)->container->is_focused()) { diff --git a/panels/panels.cpp b/panels/panels.cpp index 98f92c5d3..5b3d81059 100644 --- a/panels/panels.cpp +++ b/panels/panels.cpp @@ -48,12 +48,12 @@ void update_effect_controls() { int aclip = -1; QVector selected_clips; int mode = TA_NO_TRANSITION; - if (Olive::ActiveSequence != nullptr) { - for (int i=0;iclips.size();i++) { - Clip* clip = Olive::ActiveSequence->clips.at(i); + if (olive::ActiveSequence != nullptr) { + for (int i=0;iclips.size();i++) { + Clip* clip = olive::ActiveSequence->clips.at(i); if (clip != nullptr) { - for (int j=0;jselections.size();j++) { - const Selection& s = Olive::ActiveSequence->selections.at(j); + for (int j=0;jselections.size();j++) { + const Selection& s = olive::ActiveSequence->selections.at(j); bool add = true; if (clip->timeline_in >= s.in && clip->timeline_out <= s.out && clip->track == s.track) { mode = TA_NO_TRANSITION; @@ -88,7 +88,7 @@ void update_effect_controls() { if (aclip >= 0) selected_clips.append(aclip); if (vclip >= 0 && aclip >= 0) { bool found = false; - Clip* vclip_ref = Olive::ActiveSequence->clips.at(vclip); + Clip* vclip_ref = olive::ActiveSequence->clips.at(vclip); for (int i=0;ilinked.size();i++) { if (vclip_ref->linked.at(i) == aclip) { found = true; @@ -136,7 +136,7 @@ void update_ui(bool modified) { QDockWidget *get_focused_panel(bool force_hover) { QDockWidget* w = nullptr; - if (Olive::CurrentConfig.hover_focus || force_hover) { + if (olive::CurrentConfig.hover_focus || force_hover) { if (panel_project->underMouse()) { w = panel_project; } else if (panel_effect_controls->underMouse()) { diff --git a/panels/project.cpp b/panels/project.cpp index 0f3c543e7..7b7cc3f27 100644 --- a/panels/project.cpp +++ b/panels/project.cpp @@ -89,7 +89,7 @@ Project::Project(QWidget *parent) : // optional toolbar toolbar_widget = new QWidget(); - toolbar_widget->setVisible(Olive::CurrentConfig.show_project_toolbar); + toolbar_widget->setVisible(olive::CurrentConfig.show_project_toolbar); toolbar_widget->setObjectName("project_toolbar"); QHBoxLayout* toolbar = new QHBoxLayout(toolbar_widget); @@ -111,7 +111,7 @@ Project::Project(QWidget *parent) : icon2.addFile(QStringLiteral(":/icons/open-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); toolbar_open->setIcon(icon2); toolbar_open->setToolTip("Open Project"); - connect(toolbar_open, SIGNAL(clicked(bool)), Olive::Global.data(), SLOT(open_project())); + connect(toolbar_open, SIGNAL(clicked(bool)), olive::Global.get(), SLOT(open_project())); toolbar->addWidget(toolbar_open); QPushButton* toolbar_save = new QPushButton(); @@ -120,7 +120,7 @@ Project::Project(QWidget *parent) : icon3.addFile(QStringLiteral(":/icons/save-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); toolbar_save->setIcon(icon3); toolbar_save->setToolTip("Save Project"); - connect(toolbar_save, SIGNAL(clicked(bool)), Olive::Global.data(), SLOT(save_project())); + connect(toolbar_save, SIGNAL(clicked(bool)), olive::Global.get(), SLOT(save_project())); toolbar->addWidget(toolbar_save); QPushButton* toolbar_undo = new QPushButton(); @@ -129,7 +129,7 @@ Project::Project(QWidget *parent) : icon4.addFile(QStringLiteral(":/icons/undo-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); toolbar_undo->setIcon(icon4); toolbar_undo->setToolTip("Undo"); - connect(toolbar_undo, SIGNAL(clicked(bool)), Olive::Global.data(), SLOT(undo())); + connect(toolbar_undo, SIGNAL(clicked(bool)), olive::Global.get(), SLOT(undo())); toolbar->addWidget(toolbar_undo); QPushButton* toolbar_redo = new QPushButton(); @@ -138,7 +138,7 @@ Project::Project(QWidget *parent) : icon5.addFile(QStringLiteral(":/icons/redo-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); toolbar_redo->setIcon(icon5); toolbar_redo->setToolTip("Redo"); - connect(toolbar_redo, SIGNAL(clicked(bool)), Olive::Global.data(), SLOT(redo())); + connect(toolbar_redo, SIGNAL(clicked(bool)), olive::Global.get(), SLOT(redo())); toolbar->addWidget(toolbar_redo); QLineEdit* toolbar_search = new QLineEdit(); @@ -334,7 +334,7 @@ void Project::duplicate_selected() { } } if (duped) { - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } else { delete ca; } @@ -360,12 +360,12 @@ void Project::replace_media(Media* item, QString filename) { } if (!filename.isEmpty()) { ReplaceMediaCommand* rmc = new ReplaceMediaCommand(item, filename); - Olive::UndoStack.push(rmc); + olive::UndoStack.push(rmc); } } void Project::replace_clip_media() { - if (Olive::ActiveSequence == nullptr) { + if (olive::ActiveSequence == nullptr) { QMessageBox::critical(this, tr("No active sequence"), tr("No sequence is active, please open the sequence you want to replace clips from."), @@ -374,7 +374,7 @@ void Project::replace_clip_media() { QModelIndexList selected_items = get_current_selected(); if (selected_items.size() == 1) { Media* item = item_to_media(selected_items.at(0)); - if (item->get_type() == MEDIA_TYPE_SEQUENCE && Olive::ActiveSequence == item->to_sequence()) { + if (item->get_type() == MEDIA_TYPE_SEQUENCE && olive::ActiveSequence == item->to_sequence()) { QMessageBox::critical(this, tr("Active sequence selected"), tr("You cannot insert a sequence into itself, so no clips of this media would be in this sequence."), @@ -414,7 +414,7 @@ void Project::open_properties() { item->get_name()); if (!new_name.isEmpty()) { MediaRename* mr = new MediaRename(item, new_name); - Olive::UndoStack.push(mr); + olive::UndoStack.push(mr); } } } @@ -423,10 +423,10 @@ void Project::open_properties() { void Project::new_folder() { Media* m = create_folder_internal(nullptr); - Olive::UndoStack.push(new AddMediaCommand(m, get_selected_folder())); + olive::UndoStack.push(new AddMediaCommand(m, get_selected_folder())); QModelIndex index = project_model.create_index(m->row(), 0, m); - switch (Olive::CurrentConfig.project_view_type) { + switch (olive::CurrentConfig.project_view_type) { case PROJECT_VIEW_TREE: tree_view->edit(sorter->mapFromSource(index)); break; @@ -610,7 +610,7 @@ void Project::delete_selected_media() { // remove if (remove) { panel_effect_controls->clear_effects(true); - if (Olive::ActiveSequence != nullptr) Olive::ActiveSequence->selections.clear(); + if (olive::ActiveSequence != nullptr) olive::ActiveSequence->selections.clear(); // remove media and parents for (int m=0;mto_sequence(); - if (s == Olive::ActiveSequence) { + if (s == olive::ActiveSequence) { ca->append(new ChangeSequenceAction(nullptr)); } @@ -649,7 +649,7 @@ void Project::delete_selected_media() { } } } - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); // redraw clips if (redraw) { @@ -678,7 +678,7 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla QVector image_sequence_urls; QVector image_sequence_importassequence; - QStringList image_sequence_formats = Olive::CurrentConfig.img_seq_formats.split("|"); + QStringList image_sequence_formats = olive::CurrentConfig.img_seq_formats.split("|"); if (!recursive) last_imported_media.clear(); @@ -826,7 +826,7 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla } if (create_undo_action) { if (imported) { - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); for (int i=0;iselectionModel()->select(row_select, QItemSelectionModel::Select); - } else if (Olive::CurrentConfig.project_view_type == PROJECT_VIEW_ICON) { + } else if (olive::CurrentConfig.project_view_type == PROJECT_VIEW_ICON) { // if we're in icon view, we just "browse" to the parent folder icon_view->setRootIndex(hierarchy); @@ -913,7 +913,7 @@ void Project::import_dialog() { } void Project::delete_clips_using_selected_media() { - if (Olive::ActiveSequence == nullptr) { + if (olive::ActiveSequence == nullptr) { QMessageBox::critical(this, tr("No active sequence"), tr("No sequence is active, please open the sequence you want to delete clips from."), @@ -922,13 +922,13 @@ void Project::delete_clips_using_selected_media() { ComboAction* ca = new ComboAction(); bool deleted = false; QModelIndexList items = get_current_selected(); - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr) { for (int j=0;jmedia == m) { - ca->append(new DeleteClipAction(Olive::ActiveSequence, i)); + ca->append(new DeleteClipAction(olive::ActiveSequence, i)); deleted = true; } } @@ -939,7 +939,7 @@ void Project::delete_clips_using_selected_media() { if (delete_clips_in_clipboard_with_media(ca, m)) deleted = true; } if (deleted) { - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); update_ui(true); } else { delete ca; @@ -970,7 +970,7 @@ void Project::new_project() { set_sequence(nullptr); panel_footage_viewer->set_media(nullptr); clear(); - Olive::MainWindow->setWindowModified(false); + olive::MainWindow->setWindowModified(false); } void Project::load_project(bool autorecovery) { @@ -1075,7 +1075,7 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only, stream.writeAttribute("framerate", QString::number(s->frame_rate, 'f', 10)); stream.writeAttribute("afreq", QString::number(s->audio_frequency)); stream.writeAttribute("alayout", QString::number(s->audio_layout)); - if (s == Olive::ActiveSequence) { + if (s == olive::ActiveSequence) { stream.writeAttribute("open", "1"); } stream.writeAttribute("workarea", QString::number(s->using_workarea)); @@ -1175,7 +1175,7 @@ void Project::save_project(bool autorecovery) { media_id = 1; sequence_id = 1; - QFile file(autorecovery ? autorecovery_filename : Olive::ActiveProjectFilename); + QFile file(autorecovery ? autorecovery_filename : olive::ActiveProjectFilename); if (!file.open(QIODevice::WriteOnly/* | QIODevice::Text*/)) { qCritical() << "Could not open file"; return; @@ -1189,8 +1189,8 @@ void Project::save_project(bool autorecovery) { stream.writeTextElement("version", QString::number(SAVE_VERSION)); - stream.writeTextElement("url", Olive::ActiveProjectFilename); - proj_dir = QFileInfo(Olive::ActiveProjectFilename).absoluteDir(); + stream.writeTextElement("url", olive::ActiveProjectFilename); + proj_dir = QFileInfo(olive::ActiveProjectFilename).absoluteDir(); save_folder(stream, MEDIA_TYPE_FOLDER, true); @@ -1215,16 +1215,16 @@ void Project::save_project(bool autorecovery) { file.close(); if (!autorecovery) { - add_recent_project(Olive::ActiveProjectFilename); - Olive::MainWindow->setWindowModified(false); + add_recent_project(olive::ActiveProjectFilename); + olive::MainWindow->setWindowModified(false); } } void Project::update_view_type() { - tree_view->setVisible(Olive::CurrentConfig.project_view_type == PROJECT_VIEW_TREE); - icon_view_container->setVisible(Olive::CurrentConfig.project_view_type == PROJECT_VIEW_ICON); + tree_view->setVisible(olive::CurrentConfig.project_view_type == PROJECT_VIEW_TREE); + icon_view_container->setVisible(olive::CurrentConfig.project_view_type == PROJECT_VIEW_ICON); - switch (Olive::CurrentConfig.project_view_type) { + switch (olive::CurrentConfig.project_view_type) { case PROJECT_VIEW_TREE: sources_common->view = tree_view; break; @@ -1235,18 +1235,18 @@ void Project::update_view_type() { } void Project::set_icon_view() { - Olive::CurrentConfig.project_view_type = PROJECT_VIEW_ICON; + olive::CurrentConfig.project_view_type = PROJECT_VIEW_ICON; update_view_type(); } void Project::set_tree_view() { - Olive::CurrentConfig.project_view_type = PROJECT_VIEW_TREE; + olive::CurrentConfig.project_view_type = PROJECT_VIEW_TREE; update_view_type(); } void Project::save_recent_projects() { // save to file - QFile f(Olive::Global->get_recent_project_list_file()); + QFile f(olive::Global->get_recent_project_list_file()); if (f.open(QFile::WriteOnly | QFile::Truncate | QFile::Text)) { QTextStream out(&f); for (int i=0;i Project::list_all_project_sequences() { } QModelIndexList Project::get_current_selected() { - if (Olive::CurrentConfig.project_view_type == PROJECT_VIEW_TREE) { + if (olive::CurrentConfig.project_view_type == PROJECT_VIEW_TREE) { return panel_project->tree_view->selectionModel()->selectedRows(); } return panel_project->icon_view->selectionModel()->selectedIndexes(); diff --git a/panels/timeline.cpp b/panels/timeline.cpp index 058f92600..c1decbdd8 100644 --- a/panels/timeline.cpp +++ b/panels/timeline.cpp @@ -118,15 +118,15 @@ Timeline::Timeline(QWidget *parent) : Timeline::~Timeline() {} void Timeline::previous_cut() { - if (Olive::ActiveSequence != nullptr - && Olive::ActiveSequence->playhead > 0) { + if (olive::ActiveSequence != nullptr + && olive::ActiveSequence->playhead > 0) { long p_cut = 0; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr) { - if (c->timeline_out > p_cut && c->timeline_out < Olive::ActiveSequence->playhead) { + if (c->timeline_out > p_cut && c->timeline_out < olive::ActiveSequence->playhead) { p_cut = c->timeline_out; - } else if (c->timeline_in > p_cut && c->timeline_in < Olive::ActiveSequence->playhead) { + } else if (c->timeline_in > p_cut && c->timeline_in < olive::ActiveSequence->playhead) { p_cut = c->timeline_in; } } @@ -136,16 +136,16 @@ void Timeline::previous_cut() { } void Timeline::next_cut() { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { bool seek_enabled = false; long n_cut = LONG_MAX; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr) { - if (c->timeline_in < n_cut && c->timeline_in > Olive::ActiveSequence->playhead) { + if (c->timeline_in < n_cut && c->timeline_in > olive::ActiveSequence->playhead) { n_cut = c->timeline_in; seek_enabled = true; - } else if (c->timeline_out < n_cut && c->timeline_out > Olive::ActiveSequence->playhead) { + } else if (c->timeline_out < n_cut && c->timeline_out > olive::ActiveSequence->playhead) { n_cut = c->timeline_out; seek_enabled = true; } @@ -160,11 +160,11 @@ void ripple_clips(ComboAction* ca, Sequence *s, long point, long length, const Q } void Timeline::toggle_show_all() { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { showing_all = !showing_all; if (showing_all) { old_zoom = zoom; - set_zoom_value(double(timeline_area->width() - 200) / double(Olive::ActiveSequence->getEndFrame())); + set_zoom_value(double(timeline_area->width() - 200) / double(olive::ActiveSequence->getEndFrame())); } else { set_zoom_value(old_zoom); } @@ -335,7 +335,7 @@ void Timeline::add_clips_from_ghosts(ComboAction* ca, Sequence* s) { } } - if (Olive::CurrentConfig.add_default_effects_to_clips) { + if (olive::CurrentConfig.add_default_effects_to_clips) { if (c->track < 0) { // add default video effects c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_TRANSFORM, EFFECT_TYPE_EFFECT))); @@ -346,7 +346,7 @@ void Timeline::add_clips_from_ghosts(ComboAction* ca, Sequence* s) { } } } - if (Olive::CurrentConfig.enable_seek_to_import) { + if (olive::CurrentConfig.enable_seek_to_import) { panel_sequence_viewer->seek(earliest_point); } ghosts.clear(); @@ -366,8 +366,8 @@ void Timeline::add_transition() { ComboAction* ca = new ComboAction(); bool adding = false; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && is_clip_selected(c, true)) { int transition_to_add = (c->track < 0) ? TRANSITION_INTERNAL_CROSSDISSOLVE : TRANSITION_INTERNAL_LINEARFADE; if (c->get_opening_transition() == nullptr) { @@ -382,7 +382,7 @@ void Timeline::add_transition() { } if (adding) { - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } else { delete ca; } @@ -391,13 +391,13 @@ void Timeline::add_transition() { } void Timeline::nest() { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { QVector selected_clips; long earliest_point = LONG_MAX; // get selected clips - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && is_clip_selected(c, true)) { selected_clips.append(i); earliest_point = qMin(c->timeline_in, earliest_point); @@ -412,19 +412,19 @@ void Timeline::nest() { // create "nest" sequence s->name = panel_project->get_next_sequence_name(tr("Nested Sequence")); - s->width = Olive::ActiveSequence->width; - s->height = Olive::ActiveSequence->height; - s->frame_rate = Olive::ActiveSequence->frame_rate; - s->audio_frequency = Olive::ActiveSequence->audio_frequency; - s->audio_layout = Olive::ActiveSequence->audio_layout; + s->width = olive::ActiveSequence->width; + s->height = olive::ActiveSequence->height; + s->frame_rate = olive::ActiveSequence->frame_rate; + s->audio_frequency = olive::ActiveSequence->audio_frequency; + s->audio_layout = olive::ActiveSequence->audio_layout; // copy all selected clips to the nest for (int i=0;iappend(new DeleteClipAction(Olive::ActiveSequence, selected_clips.at(i))); + ca->append(new DeleteClipAction(olive::ActiveSequence, selected_clips.at(i))); // copy to new - Clip* copy = Olive::ActiveSequence->clips.at(selected_clips.at(i))->copy(s); + Clip* copy = olive::ActiveSequence->clips.at(selected_clips.at(i))->copy(s); copy->timeline_in -= earliest_point; copy->timeline_out -= earliest_point; s->clips.append(copy); @@ -439,13 +439,13 @@ void Timeline::nest() { // add nested sequence to active sequence QVector media_list; media_list.append(m); - create_ghosts_from_media(Olive::ActiveSequence, earliest_point, media_list); - add_clips_from_ghosts(ca, Olive::ActiveSequence); + create_ghosts_from_media(olive::ActiveSequence, earliest_point, media_list); + add_clips_from_ghosts(ca, olive::ActiveSequence); panel_effect_controls->clear_effects(true); - Olive::ActiveSequence->selections.clear(); + olive::ActiveSequence->selections.clear(); - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); update_ui(true); } @@ -465,7 +465,7 @@ int Timeline::calculate_track_height(int track, int value) { } void Timeline::update_sequence() { - bool null_sequence = (Olive::ActiveSequence == nullptr); + bool null_sequence = (olive::ActiveSequence == nullptr); for (int i=0;isetEnabled(!null_sequence); @@ -481,7 +481,7 @@ void Timeline::update_sequence() { if (null_sequence) { setWindowTitle(title + tr("")); } else { - setWindowTitle(title + Olive::ActiveSequence->name); + setWindowTitle(title + olive::ActiveSequence->name); update_ui(false); } } @@ -491,27 +491,27 @@ int Timeline::get_snap_range() { } bool Timeline::focused() { - return (Olive::ActiveSequence != nullptr && (headers->hasFocus() || video_area->hasFocus() || audio_area->hasFocus())); + return (olive::ActiveSequence != nullptr && (headers->hasFocus() || video_area->hasFocus() || audio_area->hasFocus())); } void Timeline::repaint_timeline() { if (!block_repaints) { bool draw = true; - if (Olive::ActiveSequence != nullptr + if (olive::ActiveSequence != nullptr && !horizontalScrollBar->isSliderDown() && !horizontalScrollBar->is_resizing() && panel_sequence_viewer->playing && !zoom_just_changed) { // auto scroll - if (Olive::CurrentConfig.autoscroll == AUTOSCROLL_PAGE_SCROLL) { - int playhead_x = getTimelineScreenPointFromFrame(Olive::ActiveSequence->playhead); + if (olive::CurrentConfig.autoscroll == AUTOSCROLL_PAGE_SCROLL) { + int playhead_x = getTimelineScreenPointFromFrame(olive::ActiveSequence->playhead); if (playhead_x < 0 || playhead_x > (editAreas->width() - videoScrollbar->width())) { - horizontalScrollBar->setValue(getScreenPointFromFrame(zoom, Olive::ActiveSequence->playhead)); + horizontalScrollBar->setValue(getScreenPointFromFrame(zoom, olive::ActiveSequence->playhead)); draw = false; } - } else if (Olive::CurrentConfig.autoscroll == AUTOSCROLL_SMOOTH_SCROLL) { - if (center_scroll_to_playhead(horizontalScrollBar, zoom, Olive::ActiveSequence->playhead)) { + } else if (olive::CurrentConfig.autoscroll == AUTOSCROLL_SMOOTH_SCROLL) { + if (center_scroll_to_playhead(horizontalScrollBar, zoom, olive::ActiveSequence->playhead)) { draw = false; } } @@ -522,7 +522,7 @@ void Timeline::repaint_timeline() { video_area->update(); audio_area->update(); - if (Olive::ActiveSequence != nullptr + if (olive::ActiveSequence != nullptr && !zoom_just_changed) { set_sb_max(); } @@ -533,16 +533,16 @@ void Timeline::repaint_timeline() { } void Timeline::select_all() { - if (Olive::ActiveSequence != nullptr) { - Olive::ActiveSequence->selections.clear(); - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + if (olive::ActiveSequence != nullptr) { + olive::ActiveSequence->selections.clear(); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr) { Selection s; s.in = c->timeline_in; s.out = c->timeline_out; s.track = c->track; - Olive::ActiveSequence->selections.append(s); + olive::ActiveSequence->selections.append(s); } } repaint_timeline(); @@ -554,17 +554,17 @@ void Timeline::scroll_to_frame(long frame) { } void Timeline::select_from_playhead() { - Olive::ActiveSequence->selections.clear(); - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + olive::ActiveSequence->selections.clear(); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr - && c->timeline_in <= Olive::ActiveSequence->playhead - && c->timeline_out > Olive::ActiveSequence->playhead) { + && c->timeline_in <= olive::ActiveSequence->playhead + && c->timeline_out > olive::ActiveSequence->playhead) { Selection s; s.in = c->timeline_in; s.out = c->timeline_out; s.track = c->track; - Olive::ActiveSequence->selections.append(s); + olive::ActiveSequence->selections.append(s); } } } @@ -575,8 +575,8 @@ bool Timeline::can_ripple_empty_space(long frame, int track) { rc_ripple_min = 0; rc_ripple_max = LONG_MAX; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr) { if (c->timeline_in > frame || c->timeline_out > frame) { at_end_of_sequence = false; @@ -612,7 +612,7 @@ void Timeline::ripple_delete_empty_space() { void Timeline::resizeEvent(QResizeEvent *) { // adjust maximum scrollbar - if (Olive::ActiveSequence != nullptr) set_sb_max(); + if (olive::ActiveSequence != nullptr) set_sb_max(); // resize tool button widget to its contents @@ -642,39 +642,39 @@ void Timeline::resizeEvent(QResizeEvent *) { } void Timeline::delete_in_out_internal(bool ripple) { - if (Olive::ActiveSequence != nullptr && Olive::ActiveSequence->using_workarea) { + if (olive::ActiveSequence != nullptr && olive::ActiveSequence->using_workarea) { QVector areas; int video_tracks = 0, audio_tracks = 0; - Olive::ActiveSequence->getTrackLimits(&video_tracks, &audio_tracks); + olive::ActiveSequence->getTrackLimits(&video_tracks, &audio_tracks); for (int i=video_tracks;i<=audio_tracks;i++) { Selection s; - s.in = Olive::ActiveSequence->workarea_in; - s.out = Olive::ActiveSequence->workarea_out; + s.in = olive::ActiveSequence->workarea_in; + s.out = olive::ActiveSequence->workarea_out; s.track = i; areas.append(s); } ComboAction* ca = new ComboAction(); delete_areas_and_relink(ca, areas, true); - if (ripple) ripple_clips(ca, Olive::ActiveSequence, Olive::ActiveSequence->workarea_in, Olive::ActiveSequence->workarea_in - Olive::ActiveSequence->workarea_out); - ca->append(new SetTimelineInOutCommand(Olive::ActiveSequence, false, 0, 0)); - Olive::UndoStack.push(ca); + if (ripple) ripple_clips(ca, olive::ActiveSequence, olive::ActiveSequence->workarea_in, olive::ActiveSequence->workarea_in - olive::ActiveSequence->workarea_out); + ca->append(new SetTimelineInOutCommand(olive::ActiveSequence, false, 0, 0)); + olive::UndoStack.push(ca); update_ui(true); } } void Timeline::toggle_enable_on_selected_clips() { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { ComboAction* ca = new ComboAction(); bool push_undo = false; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && is_clip_selected(c, true)) { ca->append(new SetBool(&c->enabled, !c->enabled)); push_undo = true; } } if (push_undo) { - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); update_ui(true); } else { delete ca; @@ -705,8 +705,8 @@ void Timeline::delete_selection(QVector& selections, bool ripple_dele ripple_point++; bool can_ripple = true; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && c->timeline_in < ripple_point && c->timeline_out > ripple_point) { // conflict detected, but this clip may be getting deleted so let's check bool deleted = false; @@ -720,8 +720,8 @@ void Timeline::delete_selection(QVector& selections, bool ripple_dele } } if (!deleted) { - for (int j=0;jclips.size();j++) { - Clip* cc = Olive::ActiveSequence->clips.at(j); + for (int j=0;jclips.size();j++) { + Clip* cc = olive::ActiveSequence->clips.at(j); if (cc != nullptr && cc->track == c->track && cc->timeline_in > c->timeline_out @@ -734,12 +734,12 @@ void Timeline::delete_selection(QVector& selections, bool ripple_dele } if (can_ripple) { - ripple_clips(ca, Olive::ActiveSequence, ripple_point, -ripple_length); + ripple_clips(ca, olive::ActiveSequence, ripple_point, -ripple_length); panel_sequence_viewer->seek(ripple_point-1); } } - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); update_ui(true); } @@ -756,12 +756,12 @@ void Timeline::set_zoom_value(double v) { zoom_just_changed = true; // set scrollbar to center the playhead - if (Olive::ActiveSequence != nullptr + if (olive::ActiveSequence != nullptr && !horizontalScrollBar->is_resizing()) { // update scrollbar maximum value for new zoom set_sb_max(); - center_scroll_to_playhead(horizontalScrollBar, zoom, Olive::ActiveSequence->playhead); + center_scroll_to_playhead(horizontalScrollBar, zoom, olive::ActiveSequence->playhead); } // repaint the timeline for the new zoom/location @@ -781,9 +781,9 @@ void Timeline::decheck_tool_buttons(QObject* sender) { QVector Timeline::get_tracks_of_linked_clips(int i) { QVector tracks; - Clip* clip = Olive::ActiveSequence->clips.at(i); + Clip* clip = olive::ActiveSequence->clips.at(i); for (int j=0;jlinked.size();j++) { - tracks.append(Olive::ActiveSequence->clips.at(clip->linked.at(j))->track); + tracks.append(olive::ActiveSequence->clips.at(clip->linked.at(j))->track); } return tracks; } @@ -816,7 +816,7 @@ Clip* Timeline::split_clip(ComboAction* ca, bool transitions, int p, long frame) } Clip* Timeline::split_clip(ComboAction* ca, bool transitions, int p, long frame, long post_in) { - Clip* pre = Olive::ActiveSequence->clips.at(p); + Clip* pre = olive::ActiveSequence->clips.at(p); if (pre != nullptr && pre->timeline_in < frame && pre->timeline_out > frame) { // guard against attempts to split at in/out points bool splitting_closing_dual_transition = false; @@ -826,7 +826,7 @@ Clip* Timeline::split_clip(ComboAction* ca, bool transitions, int p, long frame, splitting_closing_dual_transition = true; } - Clip* post = pre->copy(Olive::ActiveSequence, transitions && !splitting_closing_dual_transition); + Clip* post = pre->copy(olive::ActiveSequence, transitions && !splitting_closing_dual_transition); long new_clip_length = frame - pre->timeline_in; @@ -891,7 +891,7 @@ bool Timeline::split_clip_and_relink(ComboAction *ca, int clip, long frame, bool split_cache.append(clip); - Clip* c = Olive::ActiveSequence->clips.at(clip); + Clip* c = olive::ActiveSequence->clips.at(clip); if (c != nullptr) { QVector pre_clips; QVector post_clips; @@ -912,7 +912,7 @@ bool Timeline::split_clip_and_relink(ComboAction *ca, int clip, long frame, bool for (int i=0;ilinked.size();i++) { int l = c->linked.at(i); if (!has_clip_been_split(l)) { - Clip* link = Olive::ActiveSequence->clips.at(l); + Clip* link = olive::ActiveSequence->clips.at(l); if ((original_clip_is_selected && is_clip_selected(link, true)) || !original_clip_is_selected) { split_cache.append(l); Clip* s = split_clip(ca, true, l, frame); @@ -926,7 +926,7 @@ bool Timeline::split_clip_and_relink(ComboAction *ca, int clip, long frame, bool relink_clips_using_ids(pre_clips, post_clips); } - ca->append(new AddClipCommand(Olive::ActiveSequence, post_clips)); + ca->append(new AddClipCommand(olive::ActiveSequence, post_clips)); return true; } } @@ -986,8 +986,8 @@ void Timeline::delete_areas_and_relink(ComboAction* ca, QVector& area for (int i=0;iclips.size();j++) { - Clip* c = Olive::ActiveSequence->clips.at(j); + for (int j=0;jclips.size();j++) { + Clip* c = olive::ActiveSequence->clips.at(j); if (c != nullptr && c->track == s.track && !c->undeletable) { if (selection_contains_transition(s, c, TA_OPENING_TRANSITION)) { // delete opening transition @@ -997,7 +997,7 @@ void Timeline::delete_areas_and_relink(ComboAction* ca, QVector& area ca->append(new DeleteTransitionCommand(c->sequence, c->closing_transition)); } else if (c->timeline_in >= s.in && c->timeline_out <= s.out) { // clips falls entirely within deletion area - ca->append(new DeleteClipAction(Olive::ActiveSequence, j)); + ca->append(new DeleteClipAction(olive::ActiveSequence, j)); } else if (c->timeline_in < s.in && c->timeline_out > s.out) { // middle of clip is within deletion area @@ -1043,7 +1043,7 @@ void Timeline::delete_areas_and_relink(ComboAction* ca, QVector& area } relink_clips_using_ids(pre_clips, post_clips); - ca->append(new AddClipCommand(Olive::ActiveSequence, post_clips)); + ca->append(new AddClipCommand(olive::ActiveSequence, post_clips)); } void Timeline::copy(bool del) { @@ -1052,11 +1052,11 @@ void Timeline::copy(bool del) { long min_in = 0; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr) { - for (int j=0;jselections.size();j++) { - const Selection& s = Olive::ActiveSequence->selections.at(j); + for (int j=0;jselections.size();j++) { + const Selection& s = olive::ActiveSequence->selections.at(j); if (s.track == c->track && !((c->timeline_in <= s.in && c->timeline_out <= s.in) || (c->timeline_in >= s.out && c->timeline_out >= s.out))) { if (!cleared) { clear_clipboard(); @@ -1100,7 +1100,7 @@ void Timeline::copy(bool del) { } if (del && copied) { - delete_selection(Olive::ActiveSequence->selections, false); + delete_selection(olive::ActiveSequence->selections, false); } } @@ -1108,7 +1108,7 @@ void Timeline::relink_clips_using_ids(QVector& old_clips, QVector& n // relink pasted clips for (int i=0;iclips.at(old_clips.at(i)); + Clip* oc = olive::ActiveSequence->clips.at(old_clips.at(i)); for (int j=0;jlinked.size();j++) { for (int k=0;klinked.at(j) == old_clips.at(k)) { @@ -1135,15 +1135,15 @@ void Timeline::paste(bool insert) { Clip* c = static_cast(clipboard.at(i)); // create copy of clip and offset by playhead - Clip* cc = c->copy(Olive::ActiveSequence); + Clip* cc = c->copy(olive::ActiveSequence); // convert frame rates - cc->timeline_in = refactor_frame_number(cc->timeline_in, c->cached_fr, Olive::ActiveSequence->frame_rate); - cc->timeline_out = refactor_frame_number(cc->timeline_out, c->cached_fr, Olive::ActiveSequence->frame_rate); - cc->clip_in = refactor_frame_number(cc->clip_in, c->cached_fr, Olive::ActiveSequence->frame_rate); + cc->timeline_in = refactor_frame_number(cc->timeline_in, c->cached_fr, olive::ActiveSequence->frame_rate); + cc->timeline_out = refactor_frame_number(cc->timeline_out, c->cached_fr, olive::ActiveSequence->frame_rate); + cc->clip_in = refactor_frame_number(cc->clip_in, c->cached_fr, olive::ActiveSequence->frame_rate); - cc->timeline_in += Olive::ActiveSequence->playhead; - cc->timeline_out += Olive::ActiveSequence->playhead; + cc->timeline_in += olive::ActiveSequence->playhead; + cc->timeline_out += olive::ActiveSequence->playhead; cc->track = c->track; paste_start = qMin(paste_start, cc->timeline_in); @@ -1161,8 +1161,8 @@ void Timeline::paste(bool insert) { } if (insert) { split_cache.clear(); - split_all_clips_at_point(ca, Olive::ActiveSequence->playhead); - ripple_clips(ca, Olive::ActiveSequence, paste_start, paste_end - paste_start); + split_all_clips_at_point(ca, olive::ActiveSequence->playhead); + ripple_clips(ca, olive::ActiveSequence, paste_start, paste_end - paste_start); } else { delete_areas_and_relink(ca, delete_areas, false); } @@ -1182,13 +1182,13 @@ void Timeline::paste(bool insert) { } } - ca->append(new AddClipCommand(Olive::ActiveSequence, pasted_clips)); + ca->append(new AddClipCommand(olive::ActiveSequence, pasted_clips)); - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); update_ui(true); - if (Olive::CurrentConfig.paste_seeks) { + if (olive::CurrentConfig.paste_seeks) { panel_sequence_viewer->seek(paste_end); } } else if (clipboard_type == CLIPBOARD_TYPE_EFFECT) { @@ -1199,8 +1199,8 @@ void Timeline::paste(bool insert) { bool skip = false; bool ask_conflict = true; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && is_clip_selected(c, true)) { for (int j=0;j(clipboard.at(j)); @@ -1259,7 +1259,7 @@ void Timeline::paste(bool insert) { } if (push) { ca->appendPost(new ReloadEffectsCommand()); - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } else { delete ca; } @@ -1269,8 +1269,8 @@ void Timeline::paste(bool insert) { } void Timeline::edit_to_point_internal(bool in, bool ripple) { - if (Olive::ActiveSequence != nullptr) { - if (Olive::ActiveSequence->clips.size() > 0) { + if (olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence->clips.size() > 0) { // get track count int track_min = INT_MAX; int track_max = INT_MIN; @@ -1282,25 +1282,25 @@ void Timeline::edit_to_point_internal(bool in, bool ripple) { long prev_cut = 0; // find closest in point to playhead - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr) { track_min = qMin(track_min, c->track); track_max = qMax(track_max, c->track); sequence_end = qMax(c->timeline_out, sequence_end); - if (c->timeline_in == Olive::ActiveSequence->playhead) + if (c->timeline_in == olive::ActiveSequence->playhead) playhead_falls_on_in = true; - if (c->timeline_out == Olive::ActiveSequence->playhead) + if (c->timeline_out == olive::ActiveSequence->playhead) playhead_falls_on_out = true; - if (c->timeline_in > Olive::ActiveSequence->playhead) + if (c->timeline_in > olive::ActiveSequence->playhead) next_cut = qMin(c->timeline_in, next_cut); - if (c->timeline_out > Olive::ActiveSequence->playhead) + if (c->timeline_out > olive::ActiveSequence->playhead) next_cut = qMin(c->timeline_out, next_cut); - if (c->timeline_in < Olive::ActiveSequence->playhead) + if (c->timeline_in < olive::ActiveSequence->playhead) prev_cut = qMax(c->timeline_in, prev_cut); - if (c->timeline_out < Olive::ActiveSequence->playhead) + if (c->timeline_out < olive::ActiveSequence->playhead) prev_cut = qMax(c->timeline_out, prev_cut); } } @@ -1310,13 +1310,13 @@ void Timeline::edit_to_point_internal(bool in, bool ripple) { QVector areas; ComboAction* ca = new ComboAction(); bool push_undo = true; - long seek = Olive::ActiveSequence->playhead; + long seek = olive::ActiveSequence->playhead; - if ((in && (playhead_falls_on_out || (playhead_falls_on_in && Olive::ActiveSequence->playhead == 0))) - || (!in && (playhead_falls_on_in || (playhead_falls_on_out && Olive::ActiveSequence->playhead == sequence_end)))) { // one frame mode + if ((in && (playhead_falls_on_out || (playhead_falls_on_in && olive::ActiveSequence->playhead == 0))) + || (!in && (playhead_falls_on_in || (playhead_falls_on_out && olive::ActiveSequence->playhead == sequence_end)))) { // one frame mode if (ripple) { // set up deletion areas based on track count - long in_point = Olive::ActiveSequence->playhead; + long in_point = olive::ActiveSequence->playhead; if (!in) { in_point--; seek--; @@ -1334,7 +1334,7 @@ void Timeline::edit_to_point_internal(bool in, bool ripple) { // trim and move clips around the in point delete_areas_and_relink(ca, areas, true); - if (ripple) ripple_clips(ca, Olive::ActiveSequence, in_point, -1); + if (ripple) ripple_clips(ca, olive::ActiveSequence, in_point, -1); } else { push_undo = false; } @@ -1345,8 +1345,8 @@ void Timeline::edit_to_point_internal(bool in, bool ripple) { // set up deletion areas based on track count Selection s; if (in) seek = prev_cut; - s.in = in ? prev_cut : Olive::ActiveSequence->playhead; - s.out = in ? Olive::ActiveSequence->playhead : next_cut; + s.in = in ? prev_cut : olive::ActiveSequence->playhead; + s.out = in ? olive::ActiveSequence->playhead : next_cut; if (s.in == s.out) { push_undo = false; @@ -1358,16 +1358,16 @@ void Timeline::edit_to_point_internal(bool in, bool ripple) { // trim and move clips around the in point delete_areas_and_relink(ca, areas, true); - if (ripple) ripple_clips(ca, Olive::ActiveSequence, s.in, s.in - s.out); + if (ripple) ripple_clips(ca, olive::ActiveSequence, s.in, s.in - s.out); } } if (push_undo) { - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); update_ui(true); - if (seek != Olive::ActiveSequence->playhead && ripple) panel_sequence_viewer->seek(seek); + if (seek != olive::ActiveSequence->playhead && ripple) panel_sequence_viewer->seek(seek); } else { delete ca; } @@ -1386,11 +1386,11 @@ bool Timeline::split_selection(ComboAction* ca) { QVector secondary_post_splits; // find clips within selection and split - for (int j=0;jclips.size();j++) { - Clip* clip = Olive::ActiveSequence->clips.at(j); + for (int j=0;jclips.size();j++) { + Clip* clip = olive::ActiveSequence->clips.at(j); if (clip != nullptr) { - for (int i=0;iselections.size();i++) { - const Selection& s = Olive::ActiveSequence->selections.at(i); + for (int i=0;iselections.size();i++) { + const Selection& s = olive::ActiveSequence->selections.at(i); if (s.track == clip->track) { Clip* post_b = split_clip(ca, true, j, s.out); Clip* post_a = split_clip(ca, post_b == nullptr, j, s.in); @@ -1413,8 +1413,8 @@ bool Timeline::split_selection(ComboAction* ca) { relink_clips_using_ids(pre_splits, post_splits); relink_clips_using_ids(pre_splits, secondary_post_splits); - ca->append(new AddClipCommand(Olive::ActiveSequence, post_splits)); - ca->append(new AddClipCommand(Olive::ActiveSequence, secondary_post_splits)); + ca->append(new AddClipCommand(olive::ActiveSequence, post_splits)); + ca->append(new AddClipCommand(olive::ActiveSequence, secondary_post_splits)); return true; } @@ -1423,8 +1423,8 @@ bool Timeline::split_selection(ComboAction* ca) { bool Timeline::split_all_clips_at_point(ComboAction* ca, long point) { bool split = false; - for (int j=0;jclips.size();j++) { - Clip* c = Olive::ActiveSequence->clips.at(j); + for (int j=0;jclips.size();j++) { + Clip* c = olive::ActiveSequence->clips.at(j); if (c != nullptr) { // always relinks if (split_clip_and_relink(ca, j, point, true)) { @@ -1440,14 +1440,14 @@ void Timeline::split_at_playhead() { bool split_selected = false; split_cache.clear(); - if (Olive::ActiveSequence->selections.size() > 0) { + if (olive::ActiveSequence->selections.size() > 0) { // see if whole clips are selected QVector pre_clips; QVector post_clips; - for (int j=0;jclips.size();j++) { - Clip* clip = Olive::ActiveSequence->clips.at(j); + for (int j=0;jclips.size();j++) { + Clip* clip = olive::ActiveSequence->clips.at(j); if (clip != nullptr && is_clip_selected(clip, true)) { - Clip* s = split_clip(ca, true, j, Olive::ActiveSequence->playhead); + Clip* s = split_clip(ca, true, j, olive::ActiveSequence->playhead); if (s != nullptr) { pre_clips.append(j); post_clips.append(s); @@ -1459,7 +1459,7 @@ void Timeline::split_at_playhead() { if (split_selected) { // relink clips if we split relink_clips_using_ids(pre_clips, post_clips); - ca->append(new AddClipCommand(Olive::ActiveSequence, post_clips)); + ca->append(new AddClipCommand(olive::ActiveSequence, post_clips)); } else { // split a selection if not split_selected = split_selection(ca); @@ -1468,11 +1468,11 @@ void Timeline::split_at_playhead() { // if nothing was selected or no selections fell within playhead, simply split at playhead if (!split_selected) { - split_selected = split_all_clips_at_point(ca, Olive::ActiveSequence->playhead); + split_selected = split_all_clips_at_point(ca, olive::ActiveSequence->playhead); } if (split_selected) { - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); update_ui(true); } else { delete ca; @@ -1480,10 +1480,10 @@ void Timeline::split_at_playhead() { } void Timeline::ripple_delete() { - if (Olive::ActiveSequence != nullptr) { - if (Olive::ActiveSequence->selections.size() > 0) { - panel_timeline->delete_selection(Olive::ActiveSequence->selections, true); - } else if (Olive::CurrentConfig.hover_focus && get_focused_panel() == panel_timeline) { + if (olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence->selections.size() > 0) { + panel_timeline->delete_selection(olive::ActiveSequence->selections, true); + } else if (olive::CurrentConfig.hover_focus && get_focused_panel() == panel_timeline) { if (panel_timeline->can_ripple_empty_space(panel_timeline->cursor_frame, panel_timeline->cursor_track)) { panel_timeline->ripple_delete_empty_space(); } @@ -1492,13 +1492,13 @@ void Timeline::ripple_delete() { } void Timeline::deselect_area(long in, long out, int track) { - int len = Olive::ActiveSequence->selections.size(); + int len = olive::ActiveSequence->selections.size(); for (int i=0;iselections[i]; + Selection& s = olive::ActiveSequence->selections[i]; if (s.track == track) { if (s.in >= in && s.out <= out) { // whole selection is in deselect area - Olive::ActiveSequence->selections.removeAt(i); + olive::ActiveSequence->selections.removeAt(i); i--; len--; } else if (s.in < in && s.out > out) { @@ -1507,7 +1507,7 @@ void Timeline::deselect_area(long in, long out, int track) { new_sel.in = out; new_sel.out = s.out; new_sel.track = s.track; - Olive::ActiveSequence->selections.append(new_sel); + olive::ActiveSequence->selections.append(new_sel); s.out = in; } else if (s.in < in && s.out > in) { @@ -1537,25 +1537,25 @@ bool Timeline::snap_to_timeline(long* l, bool use_playhead, bool use_markers, bo if (snapping) { if (use_playhead && !panel_sequence_viewer->playing) { // snap to playhead - if (snap_to_point(Olive::ActiveSequence->playhead, l)) return true; + if (snap_to_point(olive::ActiveSequence->playhead, l)) return true; } // snap to marker if (use_markers) { - for (int i=0;imarkers.size();i++) { - if (snap_to_point(Olive::ActiveSequence->markers.at(i).frame, l)) return true; + for (int i=0;imarkers.size();i++) { + if (snap_to_point(olive::ActiveSequence->markers.at(i).frame, l)) return true; } } // snap to in/out - if (use_workarea && Olive::ActiveSequence->using_workarea) { - if (snap_to_point(Olive::ActiveSequence->workarea_in, l)) return true; - if (snap_to_point(Olive::ActiveSequence->workarea_out, l)) return true; + if (use_workarea && olive::ActiveSequence->using_workarea) { + if (snap_to_point(olive::ActiveSequence->workarea_in, l)) return true; + if (snap_to_point(olive::ActiveSequence->workarea_out, l)) return true; } // snap to clip/transition - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr) { if (snap_to_point(c->timeline_in, l)) { return true; @@ -1586,14 +1586,14 @@ void Timeline::set_marker() { QVector clips_selected; bool clip_mode = false; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && is_clip_selected(c, true)) { // only add markers if the playhead is inside the clip - if (Olive::ActiveSequence->playhead >= c->timeline_in - && Olive::ActiveSequence->playhead <= c->timeline_out) { + if (olive::ActiveSequence->playhead >= c->timeline_in + && olive::ActiveSequence->playhead <= c->timeline_out) { clips_selected.append(i); } @@ -1610,7 +1610,7 @@ void Timeline::set_marker() { } // pass off to internal set marker function - set_marker_internal(Olive::ActiveSequence, clips_selected); + set_marker_internal(olive::ActiveSequence, clips_selected); } @@ -1640,9 +1640,9 @@ void Timeline::edit_to_out_point() { void Timeline::toggle_links() { LinkCommand* command = new LinkCommand(); - command->s = Olive::ActiveSequence; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + command->s = olive::ActiveSequence; + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && is_clip_selected(c, true)) { if (!command->clips.contains(i)) command->clips.append(i); @@ -1656,7 +1656,7 @@ void Timeline::toggle_links() { } } if (command->clips.size() > 0) { - Olive::UndoStack.push(command); + olive::UndoStack.push(command); repaint_timeline(); } else { delete command; @@ -1686,7 +1686,7 @@ void Timeline::decrease_track_height() { } void Timeline::deselect() { - Olive::ActiveSequence->selections.clear(); + olive::ActiveSequence->selections.clear(); repaint_timeline(); } @@ -1757,7 +1757,7 @@ void Timeline::setScroll(int s) { } void Timeline::record_btn_click() { - if (Olive::ActiveProjectFilename.isEmpty()) { + if (olive::ActiveProjectFilename.isEmpty()) { QMessageBox::critical(this, tr("Unsaved Project"), tr("You must save this project before you can record audio in it."), @@ -1765,7 +1765,7 @@ void Timeline::record_btn_click() { } else { creating = true; creating_object = ADD_OBJ_AUDIO; - Olive::MainWindow->statusBar()->showMessage( + olive::MainWindow->statusBar()->showMessage( tr("Click on the timeline where you want to start recording (drag to limit the recording to a certain timeframe)"), 10000); } @@ -1823,7 +1823,7 @@ void Timeline::resize_move(double z) { } void Timeline::set_sb_max() { - headers->set_scrollbar_max(horizontalScrollBar, Olive::ActiveSequence->getEndFrame(), editAreas->width() - getScreenPointFromFrame(zoom, 200)); + headers->set_scrollbar_max(horizontalScrollBar, olive::ActiveSequence->getEndFrame(), editAreas->width() - getScreenPointFromFrame(zoom, 200)); } void Timeline::setup_ui() { diff --git a/panels/viewer.cpp b/panels/viewer.cpp index 5322d20f0..76c9103f5 100644 --- a/panels/viewer.cpp +++ b/panels/viewer.cpp @@ -115,7 +115,7 @@ bool Viewer::is_main_sequence() { void Viewer::set_main_sequence() { clean_created_seq(); - set_sequence(true, Olive::ActiveSequence); + set_sequence(true, olive::ActiveSequence); } void Viewer::reset_all_audio() { @@ -276,7 +276,7 @@ void Viewer::seek(long p) { if (main_sequence) { panel_timeline->scroll_to_frame(p); panel_effect_controls->scroll_to_frame(p); - if (Olive::CurrentConfig.seek_also_selects) { + if (olive::CurrentConfig.seek_also_selects) { panel_timeline->select_from_playhead(); update_fx = true; } @@ -386,7 +386,7 @@ void Viewer::play(bool in_to_out) { playback_speed = 1; } - bool seek_to_in = (seq->using_workarea && (Olive::CurrentConfig.loop || playing_in_to_out)); + bool seek_to_in = (seq->using_workarea && (olive::CurrentConfig.loop || playing_in_to_out)); if (!is_recording_cued() && playback_speed > 0 && (playing_in_to_out @@ -459,7 +459,7 @@ void Viewer::pause() { QVector add_clips; add_clips.append(c); - Olive::UndoStack.push(new AddClipCommand(seq, add_clips)); // add clip + olive::UndoStack.push(new AddClipCommand(seq, add_clips)); // add clip } } } @@ -469,7 +469,7 @@ void Viewer::update_playhead_timecode(long p) { } void Viewer::update_end_timecode() { - end_timecode->setText((seq == nullptr) ? frame_to_timecode(0, Olive::CurrentConfig.timecode_view, 30) : frame_to_timecode(seq->getEndFrame(), Olive::CurrentConfig.timecode_view, seq->frame_rate)); + end_timecode->setText((seq == nullptr) ? frame_to_timecode(0, olive::CurrentConfig.timecode_view, 30) : frame_to_timecode(seq->getEndFrame(), olive::CurrentConfig.timecode_view, seq->frame_rate)); } void Viewer::update_header_zoom() { @@ -523,7 +523,7 @@ void Viewer::update_viewer() { void Viewer::clear_in() { if (seq != nullptr && seq->using_workarea) { - Olive::UndoStack.push(new SetTimelineInOutCommand(seq, true, 0, seq->workarea_out)); + olive::UndoStack.push(new SetTimelineInOutCommand(seq, true, 0, seq->workarea_out)); update_parents(); } } @@ -531,7 +531,7 @@ void Viewer::clear_in() { void Viewer::clear_out() { if (seq != nullptr && seq->using_workarea) { - Olive::UndoStack.push(new SetTimelineInOutCommand(seq, true, seq->workarea_in, seq->getEndFrame())); + olive::UndoStack.push(new SetTimelineInOutCommand(seq, true, seq->workarea_in, seq->getEndFrame())); update_parents(); } } @@ -539,7 +539,7 @@ void Viewer::clear_out() { void Viewer::clear_inout_point() { if (seq != nullptr && seq->using_workarea) { - Olive::UndoStack.push(new SetTimelineInOutCommand(seq, false, 0, 0)); + olive::UndoStack.push(new SetTimelineInOutCommand(seq, false, 0, 0)); update_parents(); } } @@ -603,13 +603,13 @@ void Viewer::set_playback_speed(int s) { } long Viewer::get_seq_in() { - return ((Olive::CurrentConfig.loop || playing_in_to_out) && seq->using_workarea) + return ((olive::CurrentConfig.loop || playing_in_to_out) && seq->using_workarea) ? seq->workarea_in : 0; } long Viewer::get_seq_out() { - return ((Olive::CurrentConfig.loop || playing_in_to_out) && seq->using_workarea && previous_playhead < seq->workarea_out) + return ((olive::CurrentConfig.loop || playing_in_to_out) && seq->using_workarea && previous_playhead < seq->workarea_out) ? seq->workarea_out : seq->getEndFrame(); } @@ -801,8 +801,8 @@ void Viewer::timer_update() { previous_playhead = seq->playhead; seq->playhead = qMax(0, qRound(playhead_start + ((QDateTime::currentMSecsSinceEpoch()-start_msecs) * 0.001 * seq->frame_rate * playback_speed))); - if (Olive::CurrentConfig.seek_also_selects) panel_timeline->select_from_playhead(); - update_parents(Olive::CurrentConfig.seek_also_selects); + if (olive::CurrentConfig.seek_also_selects) panel_timeline->select_from_playhead(); + update_parents(olive::CurrentConfig.seek_also_selects); if (playing) { if (playback_speed < 0 && seq->playhead == 0) { @@ -816,7 +816,7 @@ void Viewer::timer_update() { pause(); } if (seq->using_workarea && seq->playhead >= seq->workarea_out) { - if (Olive::CurrentConfig.loop) { + if (olive::CurrentConfig.loop) { // loop play(); } else if (playing_in_to_out) { @@ -864,7 +864,7 @@ void Viewer::set_sequence(bool main, Sequence *s) { } main_sequence = main; - seq = (main) ? Olive::ActiveSequence : s; + seq = (main) ? olive::ActiveSequence : s; bool null_sequence = (seq == nullptr); diff --git a/playback/audio.cpp b/playback/audio.cpp index 1ac0b519d..84e981cc1 100644 --- a/playback/audio.cpp +++ b/playback/audio.cpp @@ -68,7 +68,7 @@ QAudioDeviceInfo get_audio_device(QAudio::Mode mode) { QList devs = QAudioDeviceInfo::availableDevices(mode); // try to retrieve preferred device from config - QString preferred_device = (mode == QAudio::AudioOutput) ? Olive::CurrentConfig.preferred_audio_output : Olive::CurrentConfig.preferred_audio_input; + QString preferred_device = (mode == QAudio::AudioOutput) ? olive::CurrentConfig.preferred_audio_output : olive::CurrentConfig.preferred_audio_input; if (!preferred_device.isEmpty()) { for (int i=0;iaudio_frequency : audio_output->format().sampleRate(); + return audio_rendering ? olive::ActiveSequence->audio_frequency : audio_output->format().sampleRate(); } qint64 get_buffer_offset_from_frame(double framerate, long frame) { @@ -323,12 +323,12 @@ void write_wave_trailer(QFile& f) { } bool start_recording() { - if (Olive::ActiveSequence == nullptr) { + if (olive::ActiveSequence == nullptr) { qCritical() << "No active sequence to record into"; return false; } - QString audio_path = QCoreApplication::translate("Audio", "%1 Audio").arg(Olive::ActiveProjectFilename); + QString audio_path = QCoreApplication::translate("Audio", "%1 Audio").arg(olive::ActiveProjectFilename); QDir audio_dir(audio_path); if (!audio_dir.exists() && !audio_dir.mkpath(".")) { qCritical() << "Failed to create audio directory"; @@ -354,8 +354,8 @@ bool start_recording() { } QAudioFormat audio_format = audio_output->format(); - if (Olive::CurrentConfig.recording_mode != audio_format.channelCount()) { - audio_format.setChannelCount(Olive::CurrentConfig.recording_mode); + if (olive::CurrentConfig.recording_mode != audio_format.channelCount()) { + audio_format.setChannelCount(olive::CurrentConfig.recording_mode); } QAudioDeviceInfo info = get_audio_device(QAudio::AudioInput); diff --git a/playback/cacher.cpp b/playback/cacher.cpp index c1f71985a..f05145bfa 100644 --- a/playback/cacher.cpp +++ b/playback/cacher.cpp @@ -137,7 +137,7 @@ void cache_audio_worker(Clip* c, bool scrubbing, QVector& nests, int play } if (temp_reverse) { - long seq_end = Olive::ActiveSequence->getEndFrame(); + long seq_end = olive::ActiveSequence->getEndFrame(); timeline_in = seq_end - timeline_in; timeline_out = seq_end - timeline_out; target_frame = seq_end - target_frame; @@ -743,15 +743,15 @@ void open_clip_worker(Clip* clip) { clip->max_queue_size = 1; } else { clip->max_queue_size = 0; - if (Olive::CurrentConfig.upcoming_queue_type == FRAME_QUEUE_TYPE_FRAMES) { - clip->max_queue_size += qCeil(Olive::CurrentConfig.upcoming_queue_size); + if (olive::CurrentConfig.upcoming_queue_type == FRAME_QUEUE_TYPE_FRAMES) { + clip->max_queue_size += qCeil(olive::CurrentConfig.upcoming_queue_size); } else { - clip->max_queue_size += qCeil(ms->video_frame_rate * m->speed * Olive::CurrentConfig.upcoming_queue_size); + clip->max_queue_size += qCeil(ms->video_frame_rate * m->speed * olive::CurrentConfig.upcoming_queue_size); } - if (Olive::CurrentConfig.previous_queue_type == FRAME_QUEUE_TYPE_FRAMES) { - clip->max_queue_size += qCeil(Olive::CurrentConfig.previous_queue_size); + if (olive::CurrentConfig.previous_queue_type == FRAME_QUEUE_TYPE_FRAMES) { + clip->max_queue_size += qCeil(olive::CurrentConfig.previous_queue_size); } else { - clip->max_queue_size += qCeil(ms->video_frame_rate * m->speed * Olive::CurrentConfig.previous_queue_size); + clip->max_queue_size += qCeil(ms->video_frame_rate * m->speed * olive::CurrentConfig.previous_queue_size); } } diff --git a/playback/playback.cpp b/playback/playback.cpp index d156d653b..7f8a95066 100644 --- a/playback/playback.cpp +++ b/playback/playback.cpp @@ -200,8 +200,8 @@ void get_clip_frame(Clip* c, long playhead, bool& texture_failed) { int64_t minimum_ts = target_frame->pts; int previous_frame_count = 0; - if (Olive::CurrentConfig.previous_queue_type == FRAME_QUEUE_TYPE_SECONDS) { - minimum_ts -= (second_pts*Olive::CurrentConfig.previous_queue_size); + if (olive::CurrentConfig.previous_queue_type == FRAME_QUEUE_TYPE_SECONDS) { + minimum_ts -= (second_pts*olive::CurrentConfig.previous_queue_size); } //dout << "closest frame was" << closest_frame << "with" << target_frame->pts << "/" << target_pts; @@ -210,7 +210,7 @@ void get_clip_frame(Clip* c, long playhead, bool& texture_failed) { next_pts = c->queue.at(i)->pts; } if (c->queue.at(i) != target_frame && ((c->queue.at(i)->pts > minimum_ts) == c->reverse)) { - if (Olive::CurrentConfig.previous_queue_type == FRAME_QUEUE_TYPE_SECONDS) { + if (olive::CurrentConfig.previous_queue_type == FRAME_QUEUE_TYPE_SECONDS) { //dout << "removed frame at" << i << "because its pts was" << c->queue.at(i)->pts << "compared to" << target_frame->pts; av_frame_free(&c->queue[i]); // may be a little heavy for the main thread? c->queue.removeAt(i); @@ -222,8 +222,8 @@ void get_clip_frame(Clip* c, long playhead, bool& texture_failed) { } } - if (Olive::CurrentConfig.previous_queue_type == FRAME_QUEUE_TYPE_FRAMES) { - while (previous_frame_count > qCeil(Olive::CurrentConfig.previous_queue_size)) { + if (olive::CurrentConfig.previous_queue_type == FRAME_QUEUE_TYPE_FRAMES) { + while (previous_frame_count > qCeil(olive::CurrentConfig.previous_queue_size)) { int smallest = 0; for (int i=1;iqueue.size();i++) { if (c->queue.at(i)->pts < c->queue.at(smallest)->pts) { @@ -257,7 +257,7 @@ void get_clip_frame(Clip* c, long playhead, bool& texture_failed) { #ifdef GCF_DEBUG dout << "GCF ==> RESET" << target_pts << "(" << target_frame->pts << "-" << target_frame->pts+target_frame->pkt_duration << ")"; #endif - if (!Olive::CurrentConfig.fast_seeking) target_frame = nullptr; + if (!olive::CurrentConfig.fast_seeking) target_frame = nullptr; reset = true; c->last_invalid_ts = target_pts; } else { @@ -453,7 +453,7 @@ bool is_clip_active(Clip* c, long playhead) { void set_sequence(Sequence* s) { panel_effect_controls->clear_effects(true); - Olive::ActiveSequence = s; + olive::ActiveSequence = s; panel_sequence_viewer->set_main_sequence(); panel_timeline->update_sequence(); panel_timeline->setFocus(); diff --git a/project/clip.cpp b/project/clip.cpp index 5ae72eb7f..53aefdaec 100644 --- a/project/clip.cpp +++ b/project/clip.cpp @@ -49,7 +49,7 @@ Clip::Clip(Sequence* s) : speed(1.0), reverse(false), maintain_audio_pitch(false), - autoscale(Olive::CurrentConfig.autoscale_by_default), + autoscale(olive::CurrentConfig.autoscale_by_default), opening_transition(-1), closing_transition(-1), undeletable(false), diff --git a/project/effect.cpp b/project/effect.cpp index d8d05e70a..cdafc379a 100644 --- a/project/effect.cpp +++ b/project/effect.cpp @@ -96,7 +96,7 @@ Effect* create_effect(Clip* c, const EffectMeta* em) { return new Effect(c, em); } else { qCritical() << "Invalid effect data"; - QMessageBox::critical(Olive::MainWindow, + QMessageBox::critical(olive::MainWindow, QCoreApplication::translate("Effect", "Invalid effect"), QCoreApplication::translate("Effect", "No candidate for effect '%1'. This effect may be corrupt. Try reinstalling it or Olive.").arg(em->name)); } @@ -395,7 +395,7 @@ void Effect::field_changed() { void Effect::show_context_menu(const QPoint& pos) { if (meta->type == EFFECT_TYPE_EFFECT) { - QMenu menu(Olive::MainWindow); + QMenu menu(olive::MainWindow); int index = get_index_in_clip(); @@ -432,7 +432,7 @@ void Effect::delete_self() { EffectDeleteCommand* command = new EffectDeleteCommand(); command->clips.append(parent_clip); command->fx.append(get_index_in_clip()); - Olive::UndoStack.push(command); + olive::UndoStack.push(command); update_ui(true); } @@ -441,7 +441,7 @@ void Effect::move_up() { command->clip = parent_clip; command->from = get_index_in_clip(); command->to = command->from - 1; - Olive::UndoStack.push(command); + olive::UndoStack.push(command); panel_effect_controls->reload_clips(); panel_sequence_viewer->viewer_widget->frame_update(); } @@ -451,14 +451,14 @@ void Effect::move_down() { command->clip = parent_clip; command->from = get_index_in_clip(); command->to = command->from + 1; - Olive::UndoStack.push(command); + olive::UndoStack.push(command); panel_effect_controls->reload_clips(); panel_sequence_viewer->viewer_widget->frame_update(); } void Effect::save_to_file() { // save effect settings to file - QString file = QFileDialog::getSaveFileName(Olive::MainWindow, + QString file = QFileDialog::getSaveFileName(olive::MainWindow, tr("Save Effect Settings"), QString(), tr("Effect XML Settings %1").arg("(*.xml)")); @@ -478,7 +478,7 @@ void Effect::save_to_file() { file_handle.close(); } else { - QMessageBox::critical(Olive::MainWindow, + QMessageBox::critical(olive::MainWindow, tr("Save Settings Failed"), tr("Failed to open \"%1\" for writing.").arg(file), QMessageBox::Ok); @@ -488,7 +488,7 @@ void Effect::save_to_file() { void Effect::load_from_file() { // load effect settings from file - QString file = QFileDialog::getOpenFileName(Olive::MainWindow, + QString file = QFileDialog::getOpenFileName(olive::MainWindow, tr("Load Effect Settings"), QString(), tr("Effect XML Settings %1").arg("(*.xml)")); @@ -498,13 +498,13 @@ void Effect::load_from_file() { QFile file_handle(file); if (file_handle.open(QFile::ReadOnly)) { - Olive::UndoStack.push(new SetEffectData(this, file_handle.readAll())); + olive::UndoStack.push(new SetEffectData(this, file_handle.readAll())); file_handle.close(); update_ui(false); } else { - QMessageBox::critical(Olive::MainWindow, + QMessageBox::critical(olive::MainWindow, tr("Load Settings Failed"), tr("Failed to open \"%1\" for reading.").arg(file), QMessageBox::Ok); @@ -713,7 +713,7 @@ void Effect::load_from_string(const QByteArray &s) { // pass off to standard loading function load(stream); } else { - QMessageBox::critical(Olive::MainWindow, + QMessageBox::critical(olive::MainWindow, tr("Load Settings Failed"), tr("This settings file doesn't match this effect."), QMessageBox::Ok); @@ -774,7 +774,7 @@ void Effect::open() { qWarning() << "Tried to open an effect that was already open"; close(); } - if (Olive::CurrentRuntimeConfig.shaders_are_enabled && enable_shader) { + if (olive::CurrentRuntimeConfig.shaders_are_enabled && enable_shader) { if (QOpenGLContext::currentContext() == nullptr) { qWarning() << "No current context to create a shader program for - will retry next repaint"; } else { @@ -832,7 +832,7 @@ void Effect::startEffect() { open(); qWarning() << "Tried to start a closed effect - opening"; } - if (Olive::CurrentRuntimeConfig.shaders_are_enabled + if (olive::CurrentRuntimeConfig.shaders_are_enabled && enable_shader && glslProgram->isLinked()) { bound = glslProgram->bind(); @@ -962,7 +962,7 @@ void Effect::gizmo_move(EffectGizmo* gizmo, int x_movement, int y_movement, doub gizmo->y_field2->set_double_value(gizmo->y_field2->get_double_value(timecode) + y_movement*gizmo->y_field_multi2); gizmo->y_field2->make_key_from_change(ca); } - if (done) Olive::UndoStack.push(ca); + if (done) olive::UndoStack.push(ca); break; } } diff --git a/project/effectfield.cpp b/project/effectfield.cpp index 5cea2015f..5758bd4c8 100644 --- a/project/effectfield.cpp +++ b/project/effectfield.cpp @@ -70,7 +70,7 @@ EffectField::EffectField(EffectRow *parent, int t, const QString &i) : TextEditEx* edit = new TextEditEx(); // TODO magic number 2 - i'm not sure how to make this work otherwise though - edit->setFixedHeight(qCeil(edit->fontMetrics().lineSpacing()*Olive::CurrentConfig.effect_textbox_lines + edit->document()->documentMargin() + edit->document()->documentMargin() + 2)); + edit->setFixedHeight(qCeil(edit->fontMetrics().lineSpacing()*olive::CurrentConfig.effect_textbox_lines + edit->document()->documentMargin() + edit->document()->documentMargin() + 2)); edit->setUndoRedoEnabled(true); ui_element = edit; @@ -349,7 +349,7 @@ void EffectField::ui_element_change() { ComboAction* ca = nullptr; if (!dragging_double) ca = new ComboAction(); make_key_from_change(ca); - if (!dragging_double) Olive::UndoStack.push(ca); + if (!dragging_double) olive::UndoStack.push(ca); emit changed(); } diff --git a/project/effectloaders.cpp b/project/effectloaders.cpp index eaa93fc5b..e2da64487 100644 --- a/project/effectloaders.cpp +++ b/project/effectloaders.cpp @@ -39,7 +39,7 @@ typedef void (*f0rGetPluginInfo)(f0r_plugin_info_t* info); #endif void load_internal_effects() { - if (!Olive::CurrentRuntimeConfig.shaders_are_enabled) qWarning() << "Shaders are disabled, some effects may be nonfunctional"; + if (!olive::CurrentRuntimeConfig.shaders_are_enabled) qWarning() << "Shaders are disabled, some effects may be nonfunctional"; EffectMeta em; diff --git a/project/effectrow.cpp b/project/effectrow.cpp index bef7fd363..9ad98d67f 100644 --- a/project/effectrow.cpp +++ b/project/effectrow.cpp @@ -91,7 +91,7 @@ void EffectRow::set_keyframe_enabled(bool enabled) { ComboAction* ca = new ComboAction(); ca->append(new SetKeyframing(this, true)); set_keyframe_now(ca); - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } else { if (QMessageBox::question(panel_effect_controls, tr("Disable Keyframes"), @@ -106,7 +106,7 @@ void EffectRow::set_keyframe_enabled(bool enabled) { } } ca->append(new SetKeyframing(this, false)); - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); panel_effect_controls->update_keyframes(); } else { setKeyframing(true); @@ -121,7 +121,7 @@ void EffectRow::goto_previous_key() { EffectField* f = field(i); for (int j=0;jkeyframes.size();j++) { long comp = f->keyframes.at(j).time - c->clip_in + c->timeline_in; - if (comp < Olive::ActiveSequence->playhead) { + if (comp < olive::ActiveSequence->playhead) { key = qMax(comp, key); } } @@ -137,7 +137,7 @@ void EffectRow::toggle_key() { EffectField* f = field(j); for (int i=0;ikeyframes.size();i++) { long comp = c->timeline_in - c->clip_in + f->keyframes.at(i).time; - if (comp == Olive::ActiveSequence->playhead) { + if (comp == olive::ActiveSequence->playhead) { key_fields.append(f); key_field_index.append(i); } @@ -153,7 +153,7 @@ void EffectRow::toggle_key() { ca->append(new KeyframeDelete(key_fields.at(i), key_field_index.at(i))); } } - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); update_ui(false); } @@ -164,7 +164,7 @@ void EffectRow::goto_next_key() { EffectField* f = field(i); for (int j=0;jkeyframes.size();j++) { long comp = f->keyframes.at(j).time - c->clip_in + c->timeline_in; - if (comp > Olive::ActiveSequence->playhead) { + if (comp > olive::ActiveSequence->playhead) { key = qMin(comp, key); } } @@ -194,7 +194,7 @@ void EffectRow::add_widget(QWidget* w) { } void EffectRow::set_keyframe_now(ComboAction* ca) { - long time = Olive::ActiveSequence->playhead-parent_effect->parent_clip->timeline_in+parent_effect->parent_clip->clip_in; + long time = olive::ActiveSequence->playhead-parent_effect->parent_clip->timeline_in+parent_effect->parent_clip->clip_in; if (!just_made_unsafe_keyframe) { EffectKeyframe key; diff --git a/project/keyframe.cpp b/project/keyframe.cpp index 08e6ba162..5811dc90c 100644 --- a/project/keyframe.cpp +++ b/project/keyframe.cpp @@ -58,7 +58,7 @@ void delete_keyframes(QVector& selected_key_fields, QVector for (int i=0;iappend(new KeyframeDelete(fields.at(i), key_indices.at(i))); } - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); selected_keys.clear(); selected_key_fields.clear(); update_ui(false); diff --git a/project/marker.cpp b/project/marker.cpp index 587f75acb..e6a4d3927 100644 --- a/project/marker.cpp +++ b/project/marker.cpp @@ -53,13 +53,13 @@ void set_marker_internal(Sequence* seq, const QVector& clips) { // add_marker is used to determine whether we're adding a marker, depending on whether the user input a marker name // however if (config.set_name_with_marker) is true, we don't need a marker name so we just add - bool add_marker = !Olive::CurrentConfig.set_name_with_marker; + bool add_marker = !olive::CurrentConfig.set_name_with_marker; QString marker_name; // if (config.set_name_with_marker) is false (set above), ask for a marker name if (!add_marker) { - QInputDialog d(Olive::MainWindow); + QInputDialog d(olive::MainWindow); d.setWindowTitle(QCoreApplication::translate("Marker", "Set Marker")); d.setLabelText(clips.size() > 0 ? QCoreApplication::translate("Marker", "Set clip marker name:") @@ -110,7 +110,7 @@ void set_marker_internal(Sequence* seq, const QVector& clips) { // push action - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); // redraw UI for new markers update_ui(false); diff --git a/project/media.cpp b/project/media.cpp index 5dc2d7833..f0de8274f 100644 --- a/project/media.cpp +++ b/project/media.cpp @@ -264,7 +264,7 @@ bool Media::setData(int col, const QVariant &value) { if (col == 0) { QString n = value.toString(); if (!n.isEmpty() && get_name() != n) { - Olive::UndoStack.push(new MediaRename(this, value.toString())); + olive::UndoStack.push(new MediaRename(this, value.toString())); return true; } } @@ -305,7 +305,7 @@ QVariant Media::data(int column, int role) { if (root) return QCoreApplication::translate("Media", "Duration"); if (get_type() == MEDIA_TYPE_SEQUENCE) { Sequence* s = to_sequence(); - return frame_to_timecode(s->getEndFrame(), Olive::CurrentConfig.timecode_view, s->frame_rate); + return frame_to_timecode(s->getEndFrame(), olive::CurrentConfig.timecode_view, s->frame_rate); } if (get_type() == MEDIA_TYPE_FOOTAGE) { Footage* f = to_footage(); @@ -315,7 +315,7 @@ QVariant Media::data(int column, int role) { r = f->video_tracks.at(0).video_frame_rate * f->speed; long len = f->get_length_in_frames(r); - if (len > 0) return frame_to_timecode(len, Olive::CurrentConfig.timecode_view, r); + if (len > 0) return frame_to_timecode(len, olive::CurrentConfig.timecode_view, r); } break; case 2: diff --git a/project/sequence.cpp b/project/sequence.cpp index d8d1f4fa5..b2b489b55 100644 --- a/project/sequence.cpp +++ b/project/sequence.cpp @@ -131,4 +131,4 @@ void Sequence::getTrackLimits(int* video_tracks, int* audio_tracks) { } // static variable for the currently active sequence -Sequence* Olive::ActiveSequence = nullptr; +Sequence* olive::ActiveSequence = nullptr; diff --git a/project/sequence.h b/project/sequence.h index faa899bce..0adbe9dc3 100644 --- a/project/sequence.h +++ b/project/sequence.h @@ -61,7 +61,7 @@ struct Sequence { }; // static variable for the currently active sequence -namespace Olive { +namespace olive { extern Sequence* ActiveSequence; } diff --git a/project/sourcescommon.cpp b/project/sourcescommon.cpp index 176600906..995d78855 100644 --- a/project/sourcescommon.cpp +++ b/project/sourcescommon.cpp @@ -69,7 +69,7 @@ void SourcesCommon::create_seq_from_selected() { panel_timeline->add_clips_from_ghosts(ca, s); project_parent->create_sequence_internal(ca, s, true, nullptr); - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } } @@ -82,7 +82,7 @@ void SourcesCommon::show_context_menu(QWidget* parent, const QModelIndexList& it QObject::connect(import_action, SIGNAL(triggered(bool)), project_parent, SLOT(import_dialog())); QMenu* new_menu = menu.addMenu(tr("New")); - Olive::MenuHelper.make_new_menu(new_menu); + olive::MenuHelper.make_new_menu(new_menu); QMenu* view_menu = menu.addMenu(tr("View")); @@ -247,7 +247,7 @@ void SourcesCommon::mouseDoubleClickEvent(QMouseEvent *, const QModelIndexList& panel_footage_viewer->setFocus(); break; case MEDIA_TYPE_SEQUENCE: - Olive::UndoStack.push(new ChangeSequenceAction(item->to_sequence())); + olive::UndoStack.push(new ChangeSequenceAction(item->to_sequence())); break; } } @@ -269,7 +269,7 @@ void SourcesCommon::dropEvent(QWidget* parent, QDropEvent *event, const QModelIn && drop_item.isValid() && m->get_type() == MEDIA_TYPE_FOOTAGE && !QFileInfo(paths.at(0)).isDir() - && Olive::CurrentConfig.drop_on_media_to_replace + && olive::CurrentConfig.drop_on_media_to_replace && QMessageBox::question( parent, tr("Replace Media"), @@ -326,7 +326,7 @@ void SourcesCommon::dropEvent(QWidget* parent, QDropEvent *event, const QModelIn MediaMove* mm = new MediaMove(); mm->to = m; mm->items = move_items; - Olive::UndoStack.push(mm); + olive::UndoStack.push(mm); } } } @@ -370,14 +370,14 @@ void SourcesCommon::rename_interval() { void SourcesCommon::item_renamed(Media* item) { if (editing_item == item) { MediaRename* mr = new MediaRename(item, "idk"); - Olive::UndoStack.push(mr); + olive::UndoStack.push(mr); editing_item = nullptr; } } void SourcesCommon::open_create_proxy_dialog() { // open the proxy dialog and send it a list of currently selected footage - ProxyDialog pd(Olive::MainWindow, cached_selected_footage); + ProxyDialog pd(olive::MainWindow, cached_selected_footage); pd.exec(); } @@ -389,7 +389,7 @@ void SourcesCommon::clear_proxies_from_selected() { if (f->proxy && !f->proxy_path.isEmpty()) { if (QFileInfo::exists(f->proxy_path)) { - if (QMessageBox::question(Olive::MainWindow, + if (QMessageBox::question(olive::MainWindow, tr("Delete proxy"), tr("Would you like to delete the proxy file \"%1\" as well?").arg(f->proxy_path), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { @@ -402,9 +402,9 @@ void SourcesCommon::clear_proxies_from_selected() { f->proxy_path.clear(); } - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { // close all clips so we can delete any proxies requested to be deleted - closeActiveClips(Olive::ActiveSequence); + closeActiveClips(olive::ActiveSequence); } // delete proxies requested to be deleted @@ -412,10 +412,10 @@ void SourcesCommon::clear_proxies_from_selected() { QFile::remove(delete_list.at(i)); } - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { // update viewer (will re-open active clips with original media) panel_sequence_viewer->viewer_widget->frame_update(); } - Olive::MainWindow->setWindowModified(true); + olive::MainWindow->setWindowModified(true); } diff --git a/project/transition.cpp b/project/transition.cpp index ec1536f8e..6c9cf6b15 100644 --- a/project/transition.cpp +++ b/project/transition.cpp @@ -95,7 +95,7 @@ Transition* get_transition_from_meta(Clip* c, Clip* s, const EffectMeta* em) { } } else { qCritical() << "Invalid transition data"; - QMessageBox::critical(Olive::MainWindow, + QMessageBox::critical(olive::MainWindow, QCoreApplication::translate("transition", "Invalid transition"), QCoreApplication::translate("transition", "No candidate for transition '%1'. This transition may be corrupt. Try reinstalling it or Olive.").arg(em->name) ); diff --git a/project/undo.cpp b/project/undo.cpp index bb72f281b..b87e248fa 100644 --- a/project/undo.cpp +++ b/project/undo.cpp @@ -46,7 +46,7 @@ #include "project/media.h" #include "debug.h" -QUndoStack Olive::UndoStack; +QUndoStack olive::UndoStack; ComboAction::ComboAction() {} @@ -209,7 +209,7 @@ void ChangeSequenceAction::doUndo() { } void ChangeSequenceAction::doRedo() { - old_sequence = Olive::ActiveSequence; + old_sequence = olive::ActiveSequence; set_sequence(new_sequence); } @@ -942,7 +942,7 @@ void EditSequenceCommand::update() { if (seq->clips.at(i) != nullptr) seq->clips.at(i)->refresh(); } - if (Olive::ActiveSequence == seq) { + if (olive::ActiveSequence == seq) { set_sequence(seq); } } @@ -982,7 +982,7 @@ void CloseAllClipsCommand::doUndo() { } void CloseAllClipsCommand::doRedo() { - closeActiveClips(Olive::ActiveSequence); + closeActiveClips(olive::ActiveSequence); } UpdateFootageTooltip::UpdateFootageTooltip(Media *i) { @@ -1230,7 +1230,7 @@ void OliveAction::undo() { doUndo(); if (set_window_modified) { - Olive::MainWindow->setWindowModified(old_window_modified); + olive::MainWindow->setWindowModified(old_window_modified); } } @@ -1240,10 +1240,10 @@ void OliveAction::redo() { if (set_window_modified) { // store current modified state - old_window_modified = Olive::MainWindow->isWindowModified(); + old_window_modified = olive::MainWindow->isWindowModified(); // set modified to true - Olive::MainWindow->setWindowModified(true); + olive::MainWindow->setWindowModified(true); } } diff --git a/project/undo.h b/project/undo.h index 0ae6d489c..1edf1b159 100644 --- a/project/undo.h +++ b/project/undo.h @@ -45,7 +45,7 @@ struct EffectMeta; #include #include -namespace Olive { +namespace olive { extern QUndoStack UndoStack; } diff --git a/ui/audiomonitor.cpp b/ui/audiomonitor.cpp index c1794e78a..ec27387e3 100644 --- a/ui/audiomonitor.cpp +++ b/ui/audiomonitor.cpp @@ -68,7 +68,7 @@ void AudioMonitor::resizeEvent(QResizeEvent *e) { } void AudioMonitor::paintEvent(QPaintEvent *) { - if (Olive::ActiveSequence != nullptr && values.size() > 0) { + if (olive::ActiveSequence != nullptr && values.size() > 0) { QPainter p(this); int channel_x = AUDIO_MONITOR_GAP; int channel_count = values.size(); diff --git a/ui/checkboxex.cpp b/ui/checkboxex.cpp index d98e4fecb..25d812253 100644 --- a/ui/checkboxex.cpp +++ b/ui/checkboxex.cpp @@ -28,5 +28,5 @@ CheckboxEx::CheckboxEx(QWidget* parent) : QCheckBox(parent) { void CheckboxEx::checkbox_command() { CheckboxCommand* c = new CheckboxCommand(this); - Olive::UndoStack.push(c); + olive::UndoStack.push(c); } diff --git a/ui/comboboxex.cpp b/ui/comboboxex.cpp index 9d689d916..254504eab 100644 --- a/ui/comboboxex.cpp +++ b/ui/comboboxex.cpp @@ -31,17 +31,17 @@ class ComboBoxExCommand : public QUndoCommand { public: ComboBoxExCommand(ComboBoxEx* obj, int old_index, int new_index) : - combobox(obj), old_val(old_index), new_val(new_index), done(true), old_project_changed(Olive::MainWindow->isWindowModified()) {} + combobox(obj), old_val(old_index), new_val(new_index), done(true), old_project_changed(olive::MainWindow->isWindowModified()) {} void undo() { combobox->setCurrentIndex(old_val); done = false; - Olive::MainWindow->setWindowModified(old_project_changed); + olive::MainWindow->setWindowModified(old_project_changed); } void redo() { if (!done) { combobox->setCurrentIndex(new_val); } - Olive::MainWindow->setWindowModified(true); + olive::MainWindow->setWindowModified(true); } private: ComboBoxEx* combobox; diff --git a/ui/cursors.cpp b/ui/cursors.cpp index 3eb0973a9..5dbf21655 100644 --- a/ui/cursors.cpp +++ b/ui/cursors.cpp @@ -25,8 +25,8 @@ #include -QCursor Olive::Cursor_LeftTrim; -QCursor Olive::Cursor_RightTrim; +QCursor olive::Cursor_LeftTrim; +QCursor olive::Cursor_RightTrim; QCursor load_cursor(const QString& file, int hotX, int hotY, const bool& right_aligned){ // load specified file into a pixmap @@ -43,7 +43,7 @@ QCursor load_cursor(const QString& file, int hotX, int hotY, const bool& right_a void init_custom_cursors(){ qInfo() << "Initializing custom cursors"; - Olive::Cursor_LeftTrim = load_cursor(":/cursors/left_side.png", 0, -1, false); - Olive::Cursor_RightTrim = load_cursor(":/cursors/right_side.png", 0, -1, true); + olive::Cursor_LeftTrim = load_cursor(":/cursors/left_side.png", 0, -1, false); + olive::Cursor_RightTrim = load_cursor(":/cursors/right_side.png", 0, -1, true); qInfo() << "Finished initializing custom cursors"; } diff --git a/ui/cursors.h b/ui/cursors.h index 3f9196fb6..737ba44f2 100644 --- a/ui/cursors.h +++ b/ui/cursors.h @@ -25,7 +25,7 @@ void init_custom_cursors(); -namespace Olive{ +namespace olive{ extern QCursor Cursor_LeftTrim; extern QCursor Cursor_RightTrim; } diff --git a/ui/focusfilter.cpp b/ui/focusfilter.cpp index 3fcb9f131..4dfed52a7 100644 --- a/ui/focusfilter.cpp +++ b/ui/focusfilter.cpp @@ -24,7 +24,7 @@ #include "project/sequence.h" #include "ui/timelineheader.h" -FocusFilter Olive::FocusFilter; +FocusFilter olive::FocusFilter; FocusFilter::FocusFilter() {} @@ -100,7 +100,7 @@ void FocusFilter::set_viewer_fullscreen() { } void FocusFilter::set_marker() { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { QDockWidget* focused_panel = get_focused_panel(); if (focused_panel == panel_footage_viewer) { @@ -205,7 +205,7 @@ void FocusFilter::delete_function() { } else if (panel_graph_editor->view_is_focused()) { panel_graph_editor->delete_selected_keys(); } else { - panel_timeline->delete_selection(Olive::ActiveSequence->selections, false); + panel_timeline->delete_selection(olive::ActiveSequence->selections, false); } } @@ -251,7 +251,7 @@ void FocusFilter::zoom_out() { } void FocusFilter::cut() { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { QDockWidget* focused_panel = get_focused_panel(); if (panel_effect_controls == focused_panel) { panel_effect_controls->copy(true); @@ -262,7 +262,7 @@ void FocusFilter::cut() { } void FocusFilter::copy() { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { QDockWidget* focused_panel = get_focused_panel(); if (panel_effect_controls == focused_panel) { panel_effect_controls->copy(false); diff --git a/ui/focusfilter.h b/ui/focusfilter.h index 37df333bc..c907532c4 100644 --- a/ui/focusfilter.h +++ b/ui/focusfilter.h @@ -224,7 +224,7 @@ public slots: void zoom_out(); }; -namespace Olive { +namespace olive { extern FocusFilter FocusFilter; } diff --git a/ui/graphview.cpp b/ui/graphview.cpp index b42eb9bf2..bd87a8de3 100644 --- a/ui/graphview.cpp +++ b/ui/graphview.cpp @@ -701,7 +701,7 @@ void GraphView::mouseMoveEvent(QMouseEvent *event) { void GraphView::mouseReleaseEvent(QMouseEvent *) { if (click_add_proc) { - Olive::UndoStack.push(new KeyframeFieldSet(click_add_field, click_add_key)); + olive::UndoStack.push(new KeyframeFieldSet(click_add_field, click_add_key)); } else if (moved_keys && selected_keys.size() > 0) { ComboAction* ca = new ComboAction(); switch (current_handle) { @@ -723,7 +723,7 @@ void GraphView::mouseReleaseEvent(QMouseEvent *) { } break; } - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } moved_keys = false; mousedown = false; @@ -812,7 +812,7 @@ void GraphView::set_selected_keyframe_type(int type) { EffectKeyframe& key = row->field(selected_keys_fields.at(i))->keyframes[selected_keys.at(i)]; ca->append(new SetInt(&key.type, type)); } - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); update_ui(false); } } diff --git a/ui/keyframeview.cpp b/ui/keyframeview.cpp index 93c3c50f3..eb448b9e2 100644 --- a/ui/keyframeview.cpp +++ b/ui/keyframeview.cpp @@ -90,7 +90,7 @@ void KeyframeView::menu_set_key_type(QAction* a) { EffectField* f = selected_fields.at(i); ca->append(new SetInt(&f->keyframes[selected_keyframes.at(i)].type, a->data().toInt())); } - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); update_ui(false); } } @@ -106,13 +106,13 @@ void KeyframeView::paintEvent(QPaintEvent*) { visible_out = 0; for (int j=0;jselected_clips.size();j++) { - Clip* c = Olive::ActiveSequence->clips.at(panel_effect_controls->selected_clips.at(j)); + Clip* c = olive::ActiveSequence->clips.at(panel_effect_controls->selected_clips.at(j)); visible_in = qMin(visible_in, c->timeline_in); visible_out = qMax(visible_out, c->timeline_out); } for (int j=0;jselected_clips.size();j++) { - Clip* c = Olive::ActiveSequence->clips.at(panel_effect_controls->selected_clips.at(j)); + Clip* c = olive::ActiveSequence->clips.at(panel_effect_controls->selected_clips.at(j)); for (int i=0;ieffects.size();i++) { Effect* e = c->effects.at(i); if (e->container->is_expanded()) { @@ -168,7 +168,7 @@ void KeyframeView::paintEvent(QPaintEvent*) { panel_effect_controls->horizontalScrollBar->setMaximum(qMax(max_width - width(), 0)); header->set_visible_in(visible_in); - int playhead_x = getScreenPointFromFrame(panel_effect_controls->zoom, Olive::ActiveSequence->playhead-visible_in) - x_scroll; + int playhead_x = getScreenPointFromFrame(panel_effect_controls->zoom, olive::ActiveSequence->playhead-visible_in) - x_scroll; if (dragging && panel_timeline->snapped) { p.setPen(Qt::white); } else { @@ -376,7 +376,7 @@ void KeyframeView::mouseMoveEvent(QMouseEvent* event) { Clip* c = field->parent_row->parent_effect->parent_clip; long key_time = old_key_vals.at(i) + frame_diff - c->clip_in + c->timeline_in; long key_eval = key_time; - if (panel_timeline->snap_to_point(Olive::ActiveSequence->playhead, &key_eval)) { + if (panel_timeline->snap_to_point(olive::ActiveSequence->playhead, &key_eval)) { frame_diff += (key_eval - key_time); break; } @@ -425,7 +425,7 @@ void KeyframeView::mouseReleaseEvent(QMouseEvent*) { selected_fields.at(i)->keyframes.at(selected_keyframes.at(i)).time )); } - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } select_rect = false; diff --git a/ui/labelslider.cpp b/ui/labelslider.cpp index 8d65c1bf2..eeba9c34b 100644 --- a/ui/labelslider.cpp +++ b/ui/labelslider.cpp @@ -88,7 +88,7 @@ QString LabelSlider::valueToString() { } else { switch (display_type) { case LABELSLIDER_FRAMENUMBER: - return frame_to_timecode(long(v), Olive::CurrentConfig.timecode_view, frame_rate); + return frame_to_timecode(long(v), olive::CurrentConfig.timecode_view, frame_rate); case LABELSLIDER_PERCENT: return QString::number((v*100), 'f', decimal_places).append("%"); case LABELSLIDER_DECIBEL: @@ -274,7 +274,7 @@ void LabelSlider::mouseReleaseEvent(QMouseEvent*) { if (s.isEmpty()) return; // parse string timecode to a frame number - d = timecode_to_frame(s, Olive::CurrentConfig.timecode_view, frame_rate); + d = timecode_to_frame(s, olive::CurrentConfig.timecode_view, frame_rate); } else { diff --git a/ui/menuhelper.cpp b/ui/menuhelper.cpp index 9a470fb66..f7f78ebe4 100644 --- a/ui/menuhelper.cpp +++ b/ui/menuhelper.cpp @@ -33,22 +33,22 @@ #include #include -MenuHelper Olive::MenuHelper; +MenuHelper olive::MenuHelper; void MenuHelper::make_new_menu(QMenu *parent) { - parent->addAction(tr("&Project"), Olive::Global.data(), SLOT(new_project()), QKeySequence("Ctrl+N"))->setProperty("id", "newproj"); + parent->addAction(tr("&Project"), olive::Global.get(), SLOT(new_project()), QKeySequence("Ctrl+N"))->setProperty("id", "newproj"); parent->addSeparator(); parent->addAction(tr("&Sequence"), panel_project, SLOT(new_sequence()), QKeySequence("Ctrl+Shift+N"))->setProperty("id", "newseq"); parent->addAction(tr("&Folder"), panel_project, SLOT(new_folder()))->setProperty("id", "newfolder"); } void MenuHelper::make_inout_menu(QMenu *parent) { - parent->addAction(tr("Set In Point"), &Olive::FocusFilter, SLOT(set_in_point()), QKeySequence("I"))->setProperty("id", "setinpoint"); - parent->addAction(tr("Set Out Point"), &Olive::FocusFilter, SLOT(set_out_point()), QKeySequence("O"))->setProperty("id", "setoutpoint"); + parent->addAction(tr("Set In Point"), &olive::FocusFilter, SLOT(set_in_point()), QKeySequence("I"))->setProperty("id", "setinpoint"); + parent->addAction(tr("Set Out Point"), &olive::FocusFilter, SLOT(set_out_point()), QKeySequence("O"))->setProperty("id", "setoutpoint"); parent->addSeparator(); - parent->addAction(tr("Reset In Point"), &Olive::FocusFilter, SLOT(clear_in()))->setProperty("id", "resetin"); - parent->addAction(tr("Reset Out Point"), &Olive::FocusFilter, SLOT(clear_out()))->setProperty("id", "resetout"); - parent->addAction(tr("Clear In/Out Point"), &Olive::FocusFilter, SLOT(clear_inout()), QKeySequence("G"))->setProperty("id", "clearinout"); + parent->addAction(tr("Reset In Point"), &olive::FocusFilter, SLOT(clear_in()))->setProperty("id", "resetin"); + parent->addAction(tr("Reset Out Point"), &olive::FocusFilter, SLOT(clear_out()))->setProperty("id", "resetout"); + parent->addAction(tr("Clear In/Out Point"), &olive::FocusFilter, SLOT(clear_inout()), QKeySequence("G"))->setProperty("id", "clearinout"); } void MenuHelper::make_clip_functions_menu(QMenu *parent) { @@ -59,12 +59,12 @@ void MenuHelper::make_clip_functions_menu(QMenu *parent) { } void MenuHelper::make_edit_functions_menu(QMenu *parent) { - parent->addAction(tr("Cu&t"), &Olive::FocusFilter, SLOT(cut()), QKeySequence("Ctrl+X"))->setProperty("id", "cut"); - parent->addAction(tr("Cop&y"), &Olive::FocusFilter, SLOT(copy()), QKeySequence("Ctrl+C"))->setProperty("id", "copy"); - parent->addAction(tr("&Paste"), Olive::Global.data(), SLOT(paste()), QKeySequence("Ctrl+V"))->setProperty("id", "paste"); - parent->addAction(tr("Paste Insert"), Olive::Global.data(), SLOT(paste_insert()), QKeySequence("Ctrl+Shift+V"))->setProperty("id", "pasteinsert"); - parent->addAction(tr("Duplicate"), &Olive::FocusFilter, SLOT(duplicate()), QKeySequence("Ctrl+D"))->setProperty("id", "duplicate"); - parent->addAction(tr("Delete"), &Olive::FocusFilter, SLOT(delete_function()), QKeySequence("Del"))->setProperty("id", "delete"); + parent->addAction(tr("Cu&t"), &olive::FocusFilter, SLOT(cut()), QKeySequence("Ctrl+X"))->setProperty("id", "cut"); + parent->addAction(tr("Cop&y"), &olive::FocusFilter, SLOT(copy()), QKeySequence("Ctrl+C"))->setProperty("id", "copy"); + parent->addAction(tr("&Paste"), olive::Global.get(), SLOT(paste()), QKeySequence("Ctrl+V"))->setProperty("id", "paste"); + parent->addAction(tr("Paste Insert"), olive::Global.get(), SLOT(paste_insert()), QKeySequence("Ctrl+Shift+V"))->setProperty("id", "pasteinsert"); + parent->addAction(tr("Duplicate"), &olive::FocusFilter, SLOT(duplicate()), QKeySequence("Ctrl+D"))->setProperty("id", "duplicate"); + parent->addAction(tr("Delete"), &olive::FocusFilter, SLOT(delete_function()), QKeySequence("Del"))->setProperty("id", "delete"); parent->addAction(tr("Ripple Delete"), panel_timeline, SLOT(ripple_delete()), QKeySequence("Shift+Del"))->setProperty("id", "rippledelete"); parent->addAction(tr("Split"), panel_timeline, SLOT(split_at_playhead()), QKeySequence("Ctrl+K"))->setProperty("id", "split"); } @@ -100,23 +100,23 @@ void MenuHelper::set_titlesafe_from_menu() { if (qIsNaN(tsa)) { // disable title safe area - Olive::CurrentConfig.show_title_safe_area = false; + olive::CurrentConfig.show_title_safe_area = false; } else { // using title safe area - Olive::CurrentConfig.show_title_safe_area = true; + olive::CurrentConfig.show_title_safe_area = true; // are we using the default area aspect ratio, or a specific one if (qIsNull(tsa)) { // default title safe area - Olive::CurrentConfig.use_custom_title_safe_ratio = false; + olive::CurrentConfig.use_custom_title_safe_ratio = false; } else { // using a specific aspect ratio - Olive::CurrentConfig.use_custom_title_safe_ratio = true; + olive::CurrentConfig.use_custom_title_safe_ratio = true; if (tsa < 0.0) { @@ -127,22 +127,22 @@ void MenuHelper::set_titlesafe_from_menu() { do { if (invalid) { - QMessageBox::critical(Olive::MainWindow, tr("Invalid aspect ratio"), tr("The aspect ratio '%1' is invalid. Please try again.").arg(input)); + QMessageBox::critical(olive::MainWindow, tr("Invalid aspect ratio"), tr("The aspect ratio '%1' is invalid. Please try again.").arg(input)); } - input = QInputDialog::getText(Olive::MainWindow, tr("Enter custom aspect ratio"), tr("Enter the aspect ratio to use for the title/action safe area (e.g. 16:9):")); + input = QInputDialog::getText(olive::MainWindow, tr("Enter custom aspect ratio"), tr("Enter the aspect ratio to use for the title/action safe area (e.g. 16:9):")); invalid = !arTest.exactMatch(input) && !input.isEmpty(); } while (invalid); if (!input.isEmpty()) { QStringList inputList = input.split(':'); - Olive::CurrentConfig.custom_title_safe_ratio = inputList.at(0).toDouble()/inputList.at(1).toDouble(); + olive::CurrentConfig.custom_title_safe_ratio = inputList.at(0).toDouble()/inputList.at(1).toDouble(); } } else { // specified tsa is a specific custom aspect ratio - Olive::CurrentConfig.custom_title_safe_ratio = tsa; + olive::CurrentConfig.custom_title_safe_ratio = tsa; } } @@ -154,7 +154,7 @@ void MenuHelper::set_titlesafe_from_menu() { void MenuHelper::set_autoscroll() { QAction* action = static_cast(sender()); - Olive::CurrentConfig.autoscroll = action->data().toInt(); + olive::CurrentConfig.autoscroll = action->data().toInt(); } void MenuHelper::menu_click_button() { @@ -163,11 +163,11 @@ void MenuHelper::menu_click_button() { void MenuHelper::set_timecode_view() { QAction* action = static_cast(sender()); - Olive::CurrentConfig.timecode_view = action->data().toInt(); + olive::CurrentConfig.timecode_view = action->data().toInt(); update_ui(false); } void MenuHelper::open_recent_from_menu() { int index = static_cast(sender())->data().toInt(); - Olive::Global.data()->open_recent(index); + olive::Global.get()->open_recent(index); } diff --git a/ui/menuhelper.h b/ui/menuhelper.h index 719746b57..eda2a6fbb 100644 --- a/ui/menuhelper.h +++ b/ui/menuhelper.h @@ -176,7 +176,7 @@ private slots: }; -namespace Olive { +namespace olive { /** * @brief A global MenuHelper object to assist menu creation throughout Olive. */ diff --git a/ui/renderfunctions.cpp b/ui/renderfunctions.cpp index 725b56708..a8a0adaf8 100644 --- a/ui/renderfunctions.cpp +++ b/ui/renderfunctions.cpp @@ -112,7 +112,7 @@ void process_effect(Clip* c, if (e->enable_coords) { e->process_coords(timecode, coords, data); } - bool can_process_shaders = (e->enable_shader && Olive::CurrentRuntimeConfig.shaders_are_enabled); + bool can_process_shaders = (e->enable_shader && olive::CurrentRuntimeConfig.shaders_are_enabled); if (can_process_shaders || e->enable_superimpose) { e->startEffect(); if (can_process_shaders && e->is_glsl_linked()) { @@ -506,7 +506,7 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) { // copy front buffer to back buffer (only if we're using blending modes - which we usually will be) - if (!Olive::CurrentRuntimeConfig.disable_blending) { + if (!olive::CurrentRuntimeConfig.disable_blending) { if (params.nests.size() > 0) { draw_clip(params.ctx, params.nests.last()->fbo[2]->handle(), params.nests.last()->fbo[0]->texture(), true); } else { @@ -523,7 +523,7 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) { // bind front buffer as draw buffer params.ctx->functions()->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, final_fbo); - if (Olive::CurrentRuntimeConfig.disable_blending) { + if (olive::CurrentRuntimeConfig.disable_blending) { // some GPUs don't like the blending shader, so we provide a pure GL fallback here params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, backend_tex_1); diff --git a/ui/scrollarea.cpp b/ui/scrollarea.cpp index 3e41fcba1..24d731545 100644 --- a/ui/scrollarea.cpp +++ b/ui/scrollarea.cpp @@ -30,7 +30,7 @@ ScrollArea::ScrollArea(QWidget* parent) : QScrollArea(parent) {} void ScrollArea::wheelEvent(QWheelEvent *e) { - if (Olive::CurrentConfig.scroll_zooms) { + if (olive::CurrentConfig.scroll_zooms) { e->ignore(); if (e->angleDelta().y() > 0) { diff --git a/ui/timelineheader.cpp b/ui/timelineheader.cpp index a6a9c9639..24ec538f5 100644 --- a/ui/timelineheader.cpp +++ b/ui/timelineheader.cpp @@ -115,7 +115,7 @@ void TimelineHeader::set_in_point(long new_in) { new_out = viewer->seq->getEndFrame(); } - Olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out)); + olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out)); update_parents(); } @@ -127,7 +127,7 @@ void TimelineHeader::set_out_point(long new_out) { new_in = 0; } - Olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out)); + olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out)); update_parents(); } @@ -280,7 +280,7 @@ void TimelineHeader::mouseReleaseEvent(QMouseEvent*) { if (viewer->seq != nullptr) { dragging = false; if (resizing_workarea) { - Olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, temp_workarea_in, temp_workarea_out)); + olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, temp_workarea_in, temp_workarea_out)); } else if (dragging_markers && selected_markers.size() > 0) { bool moved = false; ComboAction* ca = new ComboAction(); @@ -292,7 +292,7 @@ void TimelineHeader::mouseReleaseEvent(QMouseEvent*) { } } if (moved) { - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } else { delete ca; } @@ -330,7 +330,7 @@ void TimelineHeader::delete_markers() { for (int i=0;imarkers.append(selected_markers.at(i)); } - Olive::UndoStack.push(dma); + olive::UndoStack.push(dma); update_parents(); } } @@ -372,14 +372,14 @@ void TimelineHeader::paintEvent(QPaintEvent*) { // draw text bool draw_text = false; if (text_enabled && lineX-textWidth > lastTextBoundary) { - timecode = frame_to_timecode(frame + in_visible, Olive::CurrentConfig.timecode_view, viewer->seq->frame_rate); + timecode = frame_to_timecode(frame + in_visible, olive::CurrentConfig.timecode_view, viewer->seq->frame_rate); fullTextWidth = fm.width(timecode); textWidth = fullTextWidth>>1; text_x = lineX; // centers the text to that point on the timeline, LEFT aligns it if not - if (Olive::CurrentConfig.center_timeline_timecodes) { + if (olive::CurrentConfig.center_timeline_timecodes) { text_x -= textWidth; } else { text_x += TEXT_PADDING_FROM_LINE; @@ -399,7 +399,7 @@ void TimelineHeader::paintEvent(QPaintEvent*) { // draw line markers p.setPen(Qt::gray); - p.drawLine(lineX, (!Olive::CurrentConfig.center_timeline_timecodes && draw_text) ? 0 : yoff, lineX, height()); + p.drawLine(lineX, (!olive::CurrentConfig.center_timeline_timecodes && draw_text) ? 0 : yoff, lineX, height()); // draw sub-line markers for (int j=1;jsetCheckable(true); - center_timecodes->setChecked(Olive::CurrentConfig.center_timeline_timecodes); - center_timecodes->setData(reinterpret_cast(&Olive::CurrentConfig.center_timeline_timecodes)); + center_timecodes->setChecked(olive::CurrentConfig.center_timeline_timecodes); + center_timecodes->setData(reinterpret_cast(&olive::CurrentConfig.center_timeline_timecodes)); menu.exec(mapToGlobal(pos)); } diff --git a/ui/timelinewidget.cpp b/ui/timelinewidget.cpp index 6e3c8cfb7..e01a41fee 100644 --- a/ui/timelinewidget.cpp +++ b/ui/timelinewidget.cpp @@ -82,7 +82,7 @@ TimelineWidget::TimelineWidget(QWidget *parent) : QWidget(parent) { } void TimelineWidget::show_context_menu(const QPoint& pos) { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { // hack because sometimes right clicking doesn't trigger mouse release event panel_timeline->rect_select_init = false; panel_timeline->rect_select_proc = false; @@ -93,16 +93,16 @@ void TimelineWidget::show_context_menu(const QPoint& pos) { QAction* undoAction = menu.addAction(tr("&Undo")); QAction* redoAction = menu.addAction(tr("&Redo")); - connect(undoAction, SIGNAL(triggered(bool)), Olive::Global.data(), SLOT(undo())); - connect(redoAction, SIGNAL(triggered(bool)), Olive::Global.data(), SLOT(redo())); - undoAction->setEnabled(Olive::UndoStack.canUndo()); - redoAction->setEnabled(Olive::UndoStack.canRedo()); + connect(undoAction, SIGNAL(triggered(bool)), olive::Global.get(), SLOT(undo())); + connect(redoAction, SIGNAL(triggered(bool)), olive::Global.get(), SLOT(redo())); + undoAction->setEnabled(olive::UndoStack.canUndo()); + redoAction->setEnabled(olive::UndoStack.canRedo()); menu.addSeparator(); // collect all the selected clips QVector selected_clips; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && is_clip_selected(c, true)) { selected_clips.append(c); } @@ -110,11 +110,11 @@ void TimelineWidget::show_context_menu(const QPoint& pos) { if (!selected_clips.isEmpty()) { // clips are selected - menu.addAction(tr("C&ut"), &Olive::FocusFilter, SLOT(cut())); - menu.addAction(tr("Cop&y"), &Olive::FocusFilter, SLOT(copy())); + menu.addAction(tr("C&ut"), &olive::FocusFilter, SLOT(cut())); + menu.addAction(tr("Cop&y"), &olive::FocusFilter, SLOT(copy())); } - menu.addAction(tr("&Paste"), Olive::Global.data(), SLOT(paste())); + menu.addAction(tr("&Paste"), olive::Global.get(), SLOT(paste())); if (selected_clips.isEmpty()) { // no clips are selected @@ -134,14 +134,14 @@ void TimelineWidget::show_context_menu(const QPoint& pos) { if (!selected_clips.isEmpty()) { menu.addSeparator(); - menu.addAction(tr("&Speed/Duration"), Olive::Global.data(), SLOT(open_speed_dialog())); + menu.addAction(tr("&Speed/Duration"), olive::Global.get(), SLOT(open_speed_dialog())); QAction* autoscaleAction = menu.addAction(tr("Auto-s&cale"), this, SLOT(toggle_autoscale())); autoscaleAction->setCheckable(true); // set autoscale to the first selected clip autoscaleAction->setChecked(selected_clips.at(0)->autoscale); - Olive::MenuHelper.make_clip_functions_menu(&menu); + olive::MenuHelper.make_clip_functions_menu(&menu); // stabilizer option /*int video_clip_count = 0; @@ -185,30 +185,30 @@ void TimelineWidget::show_context_menu(const QPoint& pos) { void TimelineWidget::toggle_autoscale() { SetAutoscaleAction* action = new SetAutoscaleAction(); - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && is_clip_selected(c, true)) { action->clips.append(c); } } if (action->clips.size() > 0) { - Olive::UndoStack.push(action); + olive::UndoStack.push(action); } else { delete action; } } void TimelineWidget::tooltip_timer_timeout() { - if (Olive::ActiveSequence != nullptr) { - if (tooltip_clip < Olive::ActiveSequence->clips.size()) { - Clip* c = Olive::ActiveSequence->clips.at(tooltip_clip); + if (olive::ActiveSequence != nullptr) { + if (tooltip_clip < olive::ActiveSequence->clips.size()) { + Clip* c = olive::ActiveSequence->clips.at(tooltip_clip); if (c != nullptr) { QToolTip::showText(QCursor::pos(), tr("%1\nStart: %2\nEnd: %3\nDuration: %4").arg( c->name, - frame_to_timecode(c->timeline_in, Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate), - frame_to_timecode(c->timeline_out, Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate), - frame_to_timecode(c->getLength(), Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate) + frame_to_timecode(c->timeline_in, olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate), + frame_to_timecode(c->timeline_out, olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate), + frame_to_timecode(c->getLength(), olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate) )); } } @@ -218,8 +218,8 @@ void TimelineWidget::tooltip_timer_timeout() { void TimelineWidget::rename_clip() { QVector selected_clips; - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && is_clip_selected(c, true)) { selected_clips.append(c); } @@ -235,7 +235,7 @@ void TimelineWidget::rename_clip() { RenameClipCommand* rcc = new RenameClipCommand(); rcc->new_name = s; rcc->clips = selected_clips; - Olive::UndoStack.push(rcc); + olive::UndoStack.push(rcc); update_ui(true); } } @@ -249,7 +249,7 @@ void TimelineWidget::open_sequence_properties() { } panel_project->get_all_media_from_table(all_top_level_items, sequence_items, MEDIA_TYPE_SEQUENCE); // find all sequences in project for (int i=0;ito_sequence() == Olive::ActiveSequence) { + if (sequence_items.at(i)->to_sequence() == olive::ActiveSequence) { NewSequenceDialog nsd(this, sequence_items.at(i)); nsd.exec(); return; @@ -279,13 +279,13 @@ void TimelineWidget::dragEnterEvent(QDragEnterEvent *event) { if (event->source() == panel_footage_viewer->viewer_widget) { Sequence* proposed_seq = panel_footage_viewer->seq; - if (proposed_seq != Olive::ActiveSequence) { // don't allow nesting the same sequence + if (proposed_seq != olive::ActiveSequence) { // don't allow nesting the same sequence media_list.append(panel_footage_viewer->media); import_init = true; } } - if (Olive::CurrentConfig.enable_drag_files_to_timeline && event->mimeData()->hasUrls()) { + if (olive::CurrentConfig.enable_drag_files_to_timeline && event->mimeData()->hasUrls()) { QList urls = event->mimeData()->urls(); if (!urls.isEmpty()) { QStringList file_list; @@ -309,7 +309,7 @@ void TimelineWidget::dragEnterEvent(QDragEnterEvent *event) { } if (media_list.isEmpty()) { - Olive::UndoStack.undo(); + olive::UndoStack.undo(); } else { import_init = true; panel_timeline->importing_files = true; @@ -321,7 +321,7 @@ void TimelineWidget::dragEnterEvent(QDragEnterEvent *event) { event->acceptProposedAction(); long entry_point; - Sequence* seq = Olive::ActiveSequence; + Sequence* seq = olive::ActiveSequence; if (seq == nullptr) { // if no sequence, we're going to create a new one using the clips as a reference @@ -345,7 +345,7 @@ void TimelineWidget::dragMoveEvent(QDragMoveEvent *event) { if (panel_timeline->importing) { event->acceptProposedAction(); - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { QPoint pos = event->pos(); update_ghosts(pos, event->keyboardModifiers() & Qt::ShiftModifier); panel_timeline->move_insert = ((event->keyboardModifiers() & Qt::ControlModifier) && (panel_timeline->tool == TIMELINE_TOOL_POINTER || panel_timeline->importing)); @@ -379,7 +379,7 @@ void TimelineWidget::wheelEvent(QWheelEvent *event) { int scroll_amount = alt ? (event->angleDelta().x()) : (event->angleDelta().y()); bool in = (scroll_amount > 0); - if (Olive::CurrentConfig.scroll_zooms != shift) { + if (olive::CurrentConfig.scroll_zooms != shift) { // if config.scroll_zooms is enabled or shift is held, zoom instead of scrolling if (in) { @@ -405,7 +405,7 @@ void TimelineWidget::dragLeaveEvent(QDragLeaveEvent* event) { event->accept(); if (panel_timeline->importing) { if (panel_timeline->importing_files) { - Olive::UndoStack.undo(); + olive::UndoStack.undo(); } panel_timeline->importing_files = false; panel_timeline->ghosts.clear(); @@ -460,8 +460,8 @@ void insert_clips(ComboAction* ca) { panel_timeline->split_cache.clear(); - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr) { // don't split any clips that are moving bool found = false; @@ -488,13 +488,13 @@ void insert_clips(ComboAction* ca) { long ripple_length = (latest_new_point - earliest_new_point); - ripple_clips(ca, Olive::ActiveSequence, earliest_new_point, ripple_length, ignore_clips); + ripple_clips(ca, olive::ActiveSequence, earliest_new_point, ripple_length, ignore_clips); if (ripple_old_point) { // works for moving later clips earlier but not earlier to later long second_ripple_length = (earliest_old_point - latest_old_point); - ripple_clips(ca, Olive::ActiveSequence, latest_old_point, second_ripple_length, ignore_clips); + ripple_clips(ca, olive::ActiveSequence, latest_old_point, second_ripple_length, ignore_clips); if (earliest_old_point < earliest_new_point) { for (int i=0;ighosts.size();i++) { @@ -502,8 +502,8 @@ void insert_clips(ComboAction* ca) { g.in += second_ripple_length; g.out += second_ripple_length; } - for (int i=0;iselections.size();i++) { - Selection& s = Olive::ActiveSequence->selections[i]; + for (int i=0;iselections.size();i++) { + Selection& s = olive::ActiveSequence->selections[i]; s.in += second_ripple_length; s.out += second_ripple_length; } @@ -517,7 +517,7 @@ void TimelineWidget::dropEvent(QDropEvent* event) { ComboAction* ca = new ComboAction(); - Sequence* s = Olive::ActiveSequence; + Sequence* s = olive::ActiveSequence; // if we're dropping into nothing, create a new sequences based on the clip being dragged if (s == nullptr) { @@ -532,7 +532,7 @@ void TimelineWidget::dropEvent(QDropEvent* event) { panel_timeline->add_clips_from_ghosts(ca, s); - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); setFocus(); @@ -541,23 +541,23 @@ void TimelineWidget::dropEvent(QDropEvent* event) { } void TimelineWidget::mouseDoubleClickEvent(QMouseEvent *event) { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { if (panel_timeline->tool == TIMELINE_TOOL_EDIT) { int clip_index = getClipIndexFromCoords(panel_timeline->cursor_frame, panel_timeline->cursor_track); if (clip_index >= 0) { - Clip* clip = Olive::ActiveSequence->clips.at(clip_index); - if (!(event->modifiers() & Qt::ShiftModifier)) Olive::ActiveSequence->selections.clear(); + Clip* clip = olive::ActiveSequence->clips.at(clip_index); + if (!(event->modifiers() & Qt::ShiftModifier)) olive::ActiveSequence->selections.clear(); Selection s; s.in = clip->timeline_in; s.out = clip->timeline_out; s.track = clip->track; - Olive::ActiveSequence->selections.append(s); + olive::ActiveSequence->selections.append(s); update_ui(false); } } else if (panel_timeline->tool == TIMELINE_TOOL_POINTER) { int clip_index = getClipIndexFromCoords(panel_timeline->cursor_frame, panel_timeline->cursor_track); if (clip_index >= 0) { - Clip* c = Olive::ActiveSequence->clips.at(clip_index); + Clip* c = olive::ActiveSequence->clips.at(clip_index); if (c->media != nullptr && c->media->get_type() == MEDIA_TYPE_SEQUENCE) { set_sequence(c->media->to_sequence()); } @@ -571,7 +571,7 @@ bool isLiveEditing() { } void TimelineWidget::mousePressEvent(QMouseEvent *event) { - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { int tool = panel_timeline->tool; if (event->button() == Qt::MiddleButton) { tool = TIMELINE_TOOL_HAND; @@ -597,7 +597,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) { bool alt = (event->modifiers() & Qt::AltModifier); if (shift) { - panel_timeline->selection_offset = Olive::ActiveSequence->selections.size(); + panel_timeline->selection_offset = olive::ActiveSequence->selections.size(); } else { panel_timeline->selection_offset = 0; } @@ -644,7 +644,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) { panel_timeline->moving_init = true; } else { if (clip_index >= 0) { - Clip* clip = Olive::ActiveSequence->clips.at(clip_index); + Clip* clip = olive::ActiveSequence->clips.at(clip_index); if (clip != nullptr) { if (is_clip_selected(clip, true)) { if (shift) { @@ -652,7 +652,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) { if (!alt) { for (int i=0;ilinked.size();i++) { - Clip* link = Olive::ActiveSequence->clips.at(clip->linked.at(i)); + Clip* link = olive::ActiveSequence->clips.at(clip->linked.at(i)); panel_timeline->deselect_area(link->timeline_in, link->timeline_out, link->track); } } @@ -660,7 +660,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) { panel_timeline->deselect_area(clip->timeline_in, clip->timeline_out, clip->track); for (int i=0;ilinked.size();i++) { - Clip* link = Olive::ActiveSequence->clips.at(clip->linked.at(i)); + Clip* link = olive::ActiveSequence->clips.at(clip->linked.at(i)); panel_timeline->deselect_area(link->timeline_in, link->timeline_out, link->track); } @@ -676,12 +676,12 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) { s.out = clip->timeline_out; if (clip->get_closing_transition()->secondary_clip != nullptr) s.out += clip->get_closing_transition()->get_true_length(); } - Olive::ActiveSequence->selections.append(s); + olive::ActiveSequence->selections.append(s); } } else { // if "shift" is not down if (!shift) { - Olive::ActiveSequence->selections.clear(); + olive::ActiveSequence->selections.clear(); } Selection s; @@ -702,22 +702,22 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) { } s.track = clip->track; - Olive::ActiveSequence->selections.append(s); + olive::ActiveSequence->selections.append(s); - if (Olive::CurrentConfig.select_also_seeks) { + if (olive::CurrentConfig.select_also_seeks) { panel_sequence_viewer->seek(clip->timeline_in); } // if alt is not down, select links if (!alt && panel_timeline->transition_select == TA_NO_TRANSITION) { for (int i=0;ilinked.size();i++) { - Clip* link = Olive::ActiveSequence->clips.at(clip->linked.at(i)); + Clip* link = olive::ActiveSequence->clips.at(clip->linked.at(i)); if (!is_clip_selected(link, true)) { Selection ss; ss.in = link->timeline_in; ss.out = link->timeline_out; ss.track = link->track; - Olive::ActiveSequence->selections.append(ss); + olive::ActiveSequence->selections.append(ss); } } } @@ -728,7 +728,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) { } else { // if "shift" is not down if (!shift) { - Olive::ActiveSequence->selections.clear(); + olive::ActiveSequence->selections.clear(); } panel_timeline->rect_select_init = true; @@ -743,7 +743,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) { panel_timeline->drag_y_start = pos.y(); break; case TIMELINE_TOOL_EDIT: - if (Olive::CurrentConfig.edit_tool_also_seeks) panel_sequence_viewer->seek(panel_timeline->drag_frame_start); + if (olive::CurrentConfig.edit_tool_also_seeks) panel_sequence_viewer->seek(panel_timeline->drag_frame_start); panel_timeline->selecting = true; break; case TIMELINE_TOOL_RAZOR: @@ -794,7 +794,7 @@ void make_room_for_transition(ComboAction* ca, Clip* c, int type, long transitio void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { QToolTip::hideText(); - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { bool alt = (event->modifiers() & Qt::AltModifier); bool shift = (event->modifiers() & Qt::ShiftModifier); bool ctrl = (event->modifiers() & Qt::ControlModifier); @@ -808,11 +808,11 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { const Ghost& g = panel_timeline->ghosts.at(0); if (panel_timeline->creating_object == ADD_OBJ_AUDIO) { - Olive::MainWindow->statusBar()->clearMessage(); + olive::MainWindow->statusBar()->clearMessage(); panel_sequence_viewer->cue_recording(qMin(g.in, g.out), qMax(g.in, g.out), g.track); panel_timeline->creating = false; } else if (g.in != g.out) { - Clip* c = new Clip(Olive::ActiveSequence); + Clip* c = new Clip(olive::ActiveSequence); c->media = nullptr; c->timeline_in = qMin(g.in, g.out); c->timeline_out = qMax(g.in, g.out); @@ -836,9 +836,9 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { QVector add; add.append(c); - ca->append(new AddClipCommand(Olive::ActiveSequence, add)); + ca->append(new AddClipCommand(olive::ActiveSequence, add)); - if (c->track < 0 && Olive::CurrentConfig.add_default_effects_to_clips) { + if (c->track < 0 && olive::CurrentConfig.add_default_effects_to_clips) { // default video effects (before custom effects) c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_TRANSFORM, EFFECT_TYPE_EFFECT))); } @@ -870,7 +870,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { break; } - if (c->track >= 0 && Olive::CurrentConfig.add_default_effects_to_clips) { + if (c->track >= 0 && olive::CurrentConfig.add_default_effects_to_clips) { // default audio effects (after custom effects) c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_VOLUME, EFFECT_TYPE_EFFECT))); c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_PAN, EFFECT_TYPE_EFFECT))); @@ -910,9 +910,9 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { ripple_length = first_ghost.old_in - first_ghost.in; ripple_point = first_ghost.old_in; - for (int i=0;iselections.size();i++) { - Olive::ActiveSequence->selections[i].in += ripple_length; - Olive::ActiveSequence->selections[i].out += ripple_length; + for (int i=0;iselections.size();i++) { + olive::ActiveSequence->selections[i].in += ripple_length; + olive::ActiveSequence->selections[i].out += ripple_length; } } else { // if we're trimming an out-point @@ -935,7 +935,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { } if (!panel_timeline->trim_in_point) ripple_length = -ripple_length; - ripple_clips(ca, Olive::ActiveSequence, ripple_point, ripple_length, ignore_clips); + ripple_clips(ca, olive::ActiveSequence, ripple_point, ripple_length, ignore_clips); } if (panel_timeline->tool == TIMELINE_TOOL_POINTER @@ -949,7 +949,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { const Ghost& g = panel_timeline->ghosts.at(i); if (g.old_in != g.in || g.old_out != g.out || g.track != g.old_track || g.clip_in != g.old_clip_in) { // create copy of clip - Clip* c = Olive::ActiveSequence->clips.at(g.clip)->copy(Olive::ActiveSequence); + Clip* c = olive::ActiveSequence->clips.at(g.clip)->copy(olive::ActiveSequence); c->timeline_in = g.in; c->timeline_out = g.out; @@ -971,7 +971,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { // relink duplicated clips panel_timeline->relink_clips_using_ids(old_clips, new_clips); - ca->append(new AddClipCommand(Olive::ActiveSequence, new_clips)); + ca->append(new AddClipCommand(olive::ActiveSequence, new_clips)); } } else { // INSERT if holding ctrl @@ -984,7 +984,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { // step 1 - set clips that are moving to "undeletable" (to avoid step 2 deleting any part of them) const Ghost& g = panel_timeline->ghosts.at(i); - Olive::ActiveSequence->clips.at(g.clip)->undeletable = true; + olive::ActiveSequence->clips.at(g.clip)->undeletable = true; if (g.transition != nullptr) { g.transition->parent_clip->undeletable = true; if (g.transition->secondary_clip != nullptr) g.transition->secondary_clip->undeletable = true; @@ -999,7 +999,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { panel_timeline->delete_areas_and_relink(ca, delete_areas, false); for (int i=0;ighosts.size();i++) { const Ghost& g = panel_timeline->ghosts.at(i); - Olive::ActiveSequence->clips.at(g.clip)->undeletable = false; + olive::ActiveSequence->clips.at(g.clip)->undeletable = false; if (g.transition != nullptr) { g.transition->parent_clip->undeletable = false; if (g.transition->secondary_clip != nullptr) g.transition->secondary_clip->undeletable = false; @@ -1010,7 +1010,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { Ghost& g = panel_timeline->ghosts[i]; // step 3 - move clips - Clip* c = Olive::ActiveSequence->clips.at(g.clip); + Clip* c = olive::ActiveSequence->clips.at(g.clip); if (g.transition == nullptr) { move_clip(ca, c, (g.in - g.old_in), (g.out - g.old_out), (g.clip_in - g.old_clip_in), (g.track - g.old_track), true, true); @@ -1082,13 +1082,13 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { long transition_start = qMin(g.in, g.out); long transition_end = qMax(g.in, g.out); - Clip* pre = Olive::ActiveSequence->clips.at(g.clip); + Clip* pre = olive::ActiveSequence->clips.at(g.clip); Clip* post = pre; make_room_for_transition(ca, pre, panel_timeline->transition_tool_type, transition_start, transition_end, true); if (panel_timeline->transition_tool_post_clip > -1) { - post = Olive::ActiveSequence->clips.at(panel_timeline->transition_tool_post_clip); + post = olive::ActiveSequence->clips.at(panel_timeline->transition_tool_post_clip); int opposite_type = (panel_timeline->transition_tool_type == TA_OPENING_TRANSITION) ? TA_CLOSING_TRANSITION : TA_OPENING_TRANSITION; make_room_for_transition( ca, @@ -1158,17 +1158,17 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { } // remove duplicate selections - panel_timeline->clean_up_selections(Olive::ActiveSequence->selections); + panel_timeline->clean_up_selections(olive::ActiveSequence->selections); if (selection_command != nullptr) { - selection_command->new_data = Olive::ActiveSequence->selections; + selection_command->new_data = olive::ActiveSequence->selections; ca->append(selection_command); selection_command = nullptr; push_undo = true; } if (push_undo) { - Olive::UndoStack.push(ca); + olive::UndoStack.push(ca); } else { delete ca; } @@ -1200,7 +1200,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { void TimelineWidget::init_ghosts() { for (int i=0;ighosts.size();i++) { Ghost& g = panel_timeline->ghosts[i]; - Clip* c = Olive::ActiveSequence->clips.at(g.clip); + Clip* c = olive::ActiveSequence->clips.at(g.clip); g.track = g.old_track = c->track; g.clip_in = g.old_clip_in = c->clip_in; @@ -1230,8 +1230,8 @@ void TimelineWidget::init_ghosts() { c->recalculateMaxLength(); g.media_length = c->getMaximumLength(); } - for (int i=0;iselections.size();i++) { - Selection& s = Olive::ActiveSequence->selections[i]; + for (int i=0;iselections.size();i++) { + Selection& s = olive::ActiveSequence->selections[i]; s.old_in = s.in; s.old_out = s.out; s.old_track = s.track; @@ -1306,7 +1306,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) { // if the ghost is attached to a clip, snap its markers too if (panel_timeline->trim_target == -1 && g.clip >= 0) { - Clip* c = Olive::ActiveSequence->clips.at(g.clip); + Clip* c = olive::ActiveSequence->clips.at(g.clip); for (int j=0;jget_markers().size();j++) { long marker_real_time = c->get_markers().at(j).frame + c->timeline_in - c->clip_in; fm = marker_real_time + frame_diff; @@ -1326,7 +1326,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) { for (int i=0;ighosts.size();i++) { const Ghost& g = panel_timeline->ghosts.at(i); Clip* c = nullptr; - if (g.clip != -1) c = Olive::ActiveSequence->clips.at(g.clip); + if (g.clip != -1) c = olive::ActiveSequence->clips.at(g.clip); const FootageStream* ms = nullptr; if (g.clip != -1 && c->media != nullptr && c->media->get_type() == MEDIA_TYPE_FOOTAGE) { @@ -1482,7 +1482,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) { validate_transitions(c, panel_timeline->transition_tool_type, frame_diff); } else { Clip* otc = c; // open transition clip - Clip* ctc = Olive::ActiveSequence->clips.at(panel_timeline->transition_tool_post_clip); // close transition clip + Clip* ctc = olive::ActiveSequence->clips.at(panel_timeline->transition_tool_post_clip); // close transition clip if (panel_timeline->transition_tool_type == TA_CLOSING_TRANSITION) { // swap @@ -1545,7 +1545,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) { g.in = g.old_in + frame_diff; g.out = g.old_out + frame_diff; - if (g.transition != nullptr && g.transition == Olive::ActiveSequence->clips.at(g.clip)->get_opening_transition()) { + if (g.transition != nullptr && g.transition == olive::ActiveSequence->clips.at(g.clip)->get_opening_transition()) { g.clip_in = g.old_clip_in + frame_diff; } @@ -1578,8 +1578,8 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) { // apply changes to selections if (effective_tool != TIMELINE_TOOL_SLIP && !panel_timeline->importing && !panel_timeline->creating) { - for (int i=0;iselections.size();i++) { - Selection& s = Olive::ActiveSequence->selections[i]; + for (int i=0;iselections.size();i++) { + Selection& s = olive::ActiveSequence->selections[i]; if (panel_timeline->trim_target > -1) { if (panel_timeline->trim_in_point) { s.in = s.old_in + frame_diff; @@ -1587,8 +1587,8 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) { s.out = s.old_out + frame_diff; } } else if (clips_are_movable) { - for (int i=0;iselections.size();i++) { - Selection& s = Olive::ActiveSequence->selections[i]; + for (int i=0;iselections.size();i++) { + Selection& s = olive::ActiveSequence->selections[i]; s.in = s.old_in + frame_diff; s.out = s.old_out + frame_diff; s.track = s.old_track; @@ -1609,9 +1609,9 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) { } if (panel_timeline->importing) { - QToolTip::showText(mapToGlobal(mouse_pos), frame_to_timecode(earliest_in_point, Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate)); + QToolTip::showText(mapToGlobal(mouse_pos), frame_to_timecode(earliest_in_point, olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate)); } else { - QString tip = ((frame_diff < 0) ? "-" : "+") + frame_to_timecode(qAbs(frame_diff), Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate); + QString tip = ((frame_diff < 0) ? "-" : "+") + frame_to_timecode(qAbs(frame_diff), olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate); if (panel_timeline->trim_target > -1) { // find which clip is being moved const Ghost* g = nullptr; @@ -1630,7 +1630,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) { } else { len += frame_diff; } - tip += frame_to_timecode(len, Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate); + tip += frame_to_timecode(len, olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate); } } QToolTip::showText(mapToGlobal(mouse_pos), tip); @@ -1639,7 +1639,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) { void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { tooltip_timer.stop(); - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { bool alt = (event->modifiers() & Qt::AltModifier); panel_timeline->cursor_frame = panel_timeline->getTimelineFrameFromScreenPoint(event->pos().x()); @@ -1650,16 +1650,16 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { if (!panel_timeline->moving_init) track_resizing = false; if (isLiveEditing()) { - panel_timeline->snap_to_timeline(&panel_timeline->cursor_frame, !Olive::CurrentConfig.edit_tool_also_seeks || !panel_timeline->selecting, true, true); + panel_timeline->snap_to_timeline(&panel_timeline->cursor_frame, !olive::CurrentConfig.edit_tool_also_seeks || !panel_timeline->selecting, true, true); } if (panel_timeline->selecting) { int selection_count = 1 + qMax(panel_timeline->cursor_track, panel_timeline->drag_track_start) - qMin(panel_timeline->cursor_track, panel_timeline->drag_track_start) + panel_timeline->selection_offset; - if (Olive::ActiveSequence->selections.size() != selection_count) { - Olive::ActiveSequence->selections.resize(selection_count); + if (olive::ActiveSequence->selections.size() != selection_count) { + olive::ActiveSequence->selections.resize(selection_count); } int minimum_selection_track = qMin(panel_timeline->cursor_track, panel_timeline->drag_track_start); for (int i=panel_timeline->selection_offset;iselections[i]; + Selection& s = olive::ActiveSequence->selections[i]; s.track = minimum_selection_track + i - panel_timeline->selection_offset; long in = panel_timeline->drag_frame_start; long out = panel_timeline->cursor_frame; @@ -1668,11 +1668,11 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { } // select linked clips too - if (Olive::CurrentConfig.edit_tool_selects_links) { - for (int j=0;jclips.size();j++) { - Clip* c = Olive::ActiveSequence->clips.at(j); - for (int k=0;kselections.size();k++) { - const Selection& s = Olive::ActiveSequence->selections.at(k); + if (olive::CurrentConfig.edit_tool_selects_links) { + for (int j=0;jclips.size();j++) { + Clip* c = olive::ActiveSequence->clips.at(j); + for (int k=0;kselections.size();k++) { + const Selection& s = olive::ActiveSequence->selections.at(k); if (!(c->timeline_in < s.in && c->timeline_out < s.in) && !(c->timeline_in > s.out && c->timeline_out > s.out) && c->track == s.track) { @@ -1680,8 +1680,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { QVector linked_tracks = panel_timeline->get_tracks_of_linked_clips(j); for (int k=0;kselections.size();l++) { - const Selection& test_sel = Olive::ActiveSequence->selections.at(l); + for (int l=0;lselections.size();l++) { + const Selection& test_sel = olive::ActiveSequence->selections.at(l); if (test_sel.track == linked_tracks.at(k) && test_sel.in == s.in && test_sel.out == s.out) { @@ -1694,7 +1694,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { link_sel.in = s.in; link_sel.out = s.out; link_sel.track = linked_tracks.at(k); - Olive::ActiveSequence->selections.append(link_sel); + olive::ActiveSequence->selections.append(link_sel); } } @@ -1704,7 +1704,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { } } - if (Olive::CurrentConfig.edit_tool_also_seeks) { + if (olive::CurrentConfig.edit_tool_also_seeks) { panel_sequence_viewer->seek(qMin(panel_timeline->drag_frame_start, panel_timeline->cursor_frame)); } else { panel_timeline->repaint_timeline(); @@ -1736,8 +1736,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { } else { // set up movement // create ghosts - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr) { Ghost g; g.transition = nullptr; @@ -1747,8 +1747,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { // if a whole clip is not selected, maybe just a transition is if (panel_timeline->tool == TIMELINE_TOOL_POINTER && (c->get_opening_transition() != nullptr || c->get_closing_transition() != nullptr)) { // check if any selections contain the whole clip or transition - for (int j=0;jselections.size();j++) { - const Selection& s = Olive::ActiveSequence->selections.at(j); + for (int j=0;jselections.size();j++) { + const Selection& s = olive::ActiveSequence->selections.at(j); if (s.track == c->track) { if (selection_contains_transition(s, c, TA_OPENING_TRANSITION)) { g.transition = c->get_opening_transition(); @@ -1785,11 +1785,11 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { int size = panel_timeline->ghosts.size(); if (panel_timeline->tool == TIMELINE_TOOL_ROLLING) { for (int i=0;iclips.at(panel_timeline->ghosts.at(i).clip); + Clip* ghost_clip = olive::ActiveSequence->clips.at(panel_timeline->ghosts.at(i).clip); // see if any ghosts are touching, in which case flip them for (int k=0;kclips.at(panel_timeline->ghosts.at(k).clip); + Clip* comp_clip = olive::ActiveSequence->clips.at(panel_timeline->ghosts.at(k).clip); if ((panel_timeline->trim_in_point && comp_clip->timeline_out == ghost_clip->timeline_in) || (!panel_timeline->trim_in_point && comp_clip->timeline_in == ghost_clip->timeline_out)) { panel_timeline->ghosts[k].trim_in = !panel_timeline->trim_in_point; @@ -1800,9 +1800,9 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { // then look for other clips we're touching for (int i=0;ighosts.at(i); - Clip* ghost_clip = Olive::ActiveSequence->clips.at(g.clip); - for (int j=0;jclips.size();j++) { - Clip* comp_clip = Olive::ActiveSequence->clips.at(j); + Clip* ghost_clip = olive::ActiveSequence->clips.at(g.clip); + for (int j=0;jclips.size();j++) { + Clip* comp_clip = olive::ActiveSequence->clips.at(j); if (comp_clip->track == ghost_clip->track) { if ((panel_timeline->trim_in_point && comp_clip->timeline_out == ghost_clip->timeline_in) || (!panel_timeline->trim_in_point && comp_clip->timeline_in == ghost_clip->timeline_out)) { @@ -1839,10 +1839,10 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { } else if (panel_timeline->tool == TIMELINE_TOOL_SLIDE) { for (int i=0;ighosts.at(i); - Clip* ghost_clip = Olive::ActiveSequence->clips.at(g.clip); + Clip* ghost_clip = olive::ActiveSequence->clips.at(g.clip); panel_timeline->ghosts[i].trimming = false; - for (int j=0;jclips.size();j++) { - Clip* c = Olive::ActiveSequence->clips.at(j); + for (int j=0;jclips.size();j++) { + Clip* c = olive::ActiveSequence->clips.at(j); if (c != nullptr && c->track == ghost_clip->track) { bool found = false; for (int k=0;kghosts.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(panel_timeline->ghosts.at(i).clip); + Clip* c = olive::ActiveSequence->clips.at(panel_timeline->ghosts.at(i).clip); if (panel_timeline->trim_in_point) { axis = qMin(axis, c->timeline_in); } else { @@ -1882,8 +1882,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { } } - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && !is_clip_selected(c, true)) { bool clip_is_post = (c->timeline_in >= axis); @@ -1909,8 +1909,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { } // store selections - selection_command = new SetSelectionsCommand(Olive::ActiveSequence); - selection_command->old_data = Olive::ActiveSequence->selections; + selection_command = new SetSelectionsCommand(olive::ActiveSequence); + selection_command->old_data = olive::ActiveSequence->selections; panel_timeline->moving_proc = true; } @@ -1958,8 +1958,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { int track_max = qMax(track_start, track_end); QVector selected_clips; - for (int i=0;iclips.size();i++) { - Clip* clip = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* clip = olive::ActiveSequence->clips.at(i); if (clip != nullptr && clip->track >= track_min && clip->track <= track_max && @@ -1970,7 +1970,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { if (!alt) { for (int j=0;jlinked.size();j++) { - session_clips.append(Olive::ActiveSequence->clips.at(clip->linked.at(j))); + session_clips.append(olive::ActiveSequence->clips.at(clip->linked.at(j))); } } @@ -1991,9 +1991,9 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { } } - Olive::ActiveSequence->selections.resize(selected_clips.size() + panel_timeline->selection_offset); + olive::ActiveSequence->selections.resize(selected_clips.size() + panel_timeline->selection_offset); for (int i=0;iselections[i+panel_timeline->selection_offset]; + Selection& s = olive::ActiveSequence->selections[i+panel_timeline->selection_offset]; Clip* clip = selected_clips.at(i); s.old_in = s.in = clip->timeline_in; s.old_out = s.out = clip->timeline_out; @@ -2055,8 +2055,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { panel_timeline->trim_target = -1; // loop through current clips in the sequence - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr) { // cache track range @@ -2181,9 +2181,9 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { if (found) { if (panel_timeline->trim_in_point) { // if we're trimming an IN point - setCursor(Olive::Cursor_LeftTrim); + setCursor(olive::Cursor_LeftTrim); } else { // if we're trimming an OUT point - setCursor(Olive::Cursor_RightTrim); + setCursor(olive::Cursor_RightTrim); } } else { @@ -2202,7 +2202,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { int mouse_pos = pos.y() + scroll; if (mouse_pos > y_test_value-test_range && mouse_pos < y_test_value+test_range) { // if track lines are hidden, only resize track if a clip is already there - if (Olive::CurrentConfig.show_track_lines || cursor_contains_clip) { + if (olive::CurrentConfig.show_track_lines || cursor_contains_clip) { found = true; track_resizing = true; track_target = track; @@ -2230,7 +2230,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { if (panel_timeline->transition_tool_proc) { update_ghosts(event->pos(), event->modifiers() & Qt::ShiftModifier); } else { - Clip* c = Olive::ActiveSequence->clips.at(panel_timeline->transition_tool_pre_clip); + Clip* c = olive::ActiveSequence->clips.at(panel_timeline->transition_tool_pre_clip); Ghost g; @@ -2247,7 +2247,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { } else { int mouse_clip = getClipIndexFromCoords(panel_timeline->cursor_frame, panel_timeline->cursor_track); if (mouse_clip > -1) { - Clip* c = Olive::ActiveSequence->clips.at(mouse_clip); + Clip* c = olive::ActiveSequence->clips.at(mouse_clip); if (same_sign(c->track, panel_timeline->transition_tool_side)) { panel_timeline->transition_tool_pre_clip = mouse_clip; long halfway = c->timeline_in + (c->getLength()/2); @@ -2300,7 +2300,7 @@ void draw_waveform(Clip* clip, const FootageStream* ms, long media_length, QPain } for (int j=0;jaudio_channels;j++) { - int mid = (Olive::CurrentConfig.rectified_waveforms) ? clip_rect.top()+channel_height*(j+1) : clip_rect.top()+channel_height*j+(channel_height/2); + int mid = (olive::CurrentConfig.rectified_waveforms) ? clip_rect.top()+channel_height*(j+1) : clip_rect.top()+channel_height*j+(channel_height/2); int offset_range_start = last_waveform_index+(j*2); int offset_range_end = waveform_index+(j*2); @@ -2317,7 +2317,7 @@ void draw_waveform(Clip* clip, const FootageStream* ms, long media_length, QPain } // draw waveforms - if (Olive::CurrentConfig.rectified_waveforms) { + if (olive::CurrentConfig.rectified_waveforms) { // rectified waveforms start from the bottom and draw upwards p->drawLine(clip_rect.left()+i, mid, clip_rect.left()+i, mid - (max - min)); @@ -2385,14 +2385,14 @@ void draw_transition(QPainter& p, Clip* c, const QRect& clip_rect, QRect& text_r void TimelineWidget::paintEvent(QPaintEvent*) { // Draw clips - if (Olive::ActiveSequence != nullptr) { + if (olive::ActiveSequence != nullptr) { QPainter p(this); // get widget width and height int video_track_limit = 0; int audio_track_limit = 0; - for (int i=0;iclips.size();i++) { - Clip* clip = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* clip = olive::ActiveSequence->clips.at(i); if (clip != nullptr) { video_track_limit = qMin(video_track_limit, clip->track); audio_track_limit = qMax(audio_track_limit, clip->track); @@ -2415,8 +2415,8 @@ void TimelineWidget::paintEvent(QPaintEvent*) { scrollBar->setMaximum(qMax(0, panel_height - height())); } - for (int i=0;iclips.size();i++) { - Clip* clip = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* clip = olive::ActiveSequence->clips.at(i); if (clip != nullptr && is_track_visible(clip->track)) { QRect clip_rect(panel_timeline->getTimelineScreenPointFromFrame(clip->timeline_in), getScreenPointFromTrack(clip->track), getScreenPointFromFrame(panel_timeline->zoom, clip->getLength()), panel_timeline->calculate_track_height(clip->track, -1)); QRect text_rect(clip_rect.left() + CLIP_TEXT_PADDING, clip_rect.top() + CLIP_TEXT_PADDING, clip_rect.width() - CLIP_TEXT_PADDING - 1, clip_rect.height() - CLIP_TEXT_PADDING - 1); @@ -2689,7 +2689,7 @@ void TimelineWidget::paintEvent(QPaintEvent*) { } // Draw track lines - if (Olive::CurrentConfig.show_track_lines) { + if (olive::CurrentConfig.show_track_lines) { p.setPen(QColor(0, 0, 0, 96)); audio_track_limit++; if (video_track_limit == 0) video_track_limit--; @@ -2710,8 +2710,8 @@ void TimelineWidget::paintEvent(QPaintEvent*) { } // Draw selections - for (int i=0;iselections.size();i++) { - const Selection& s = Olive::ActiveSequence->selections.at(i); + for (int i=0;iselections.size();i++) { + const Selection& s = olive::ActiveSequence->selections.at(i); if (is_track_visible(s.track)) { int selection_y = getScreenPointFromTrack(s.track); int selection_x = panel_timeline->getTimelineScreenPointFromFrame(s.in); @@ -2788,7 +2788,7 @@ void TimelineWidget::paintEvent(QPaintEvent*) { // Draw playhead p.setPen(Qt::red); - int playhead_x = panel_timeline->getTimelineScreenPointFromFrame(Olive::ActiveSequence->playhead); + int playhead_x = panel_timeline->getTimelineScreenPointFromFrame(olive::ActiveSequence->playhead); p.drawLine(playhead_x, rect().top(), playhead_x, rect().bottom()); // draw border @@ -2836,7 +2836,7 @@ int TimelineWidget::getTrackFromScreenPoint(int y) { int counter = ((!bottom_align && y > 0) || (bottom_align && y < 0)) ? 0 : -1; int track_height = panel_timeline->calculate_track_height(counter, -1); while (qAbs(y) > height_measure+track_height) { - if (Olive::CurrentConfig.show_track_lines && counter != -1) y--; + if (olive::CurrentConfig.show_track_lines && counter != -1) y--; height_measure += track_height; if ((!bottom_align && y > 0) || (bottom_align && y < 0)) { counter++; @@ -2855,15 +2855,15 @@ int TimelineWidget::getScreenPointFromTrack(int track) { if (bottom_align) counter--; y += panel_timeline->calculate_track_height(counter, -1); if (!bottom_align) counter++; - if (Olive::CurrentConfig.show_track_lines && counter != -1) y++; + if (olive::CurrentConfig.show_track_lines && counter != -1) y++; } y++; return (bottom_align) ? height() - y - scroll : y - scroll; } int TimelineWidget::getClipIndexFromCoords(long frame, int track) { - for (int i=0;iclips.size();i++) { - Clip* c = Olive::ActiveSequence->clips.at(i); + for (int i=0;iclips.size();i++) { + Clip* c = olive::ActiveSequence->clips.at(i); if (c != nullptr && c->track == track && frame >= c->timeline_in && frame < c->timeline_out) { return i; } diff --git a/ui/viewerwidget.cpp b/ui/viewerwidget.cpp index 26bfeb345..3fc32f230 100644 --- a/ui/viewerwidget.cpp +++ b/ui/viewerwidget.cpp @@ -426,11 +426,11 @@ void ViewerWidget::draw_title_safe_area() { double viewportAr = (double) width() / (double) height(); double halfAr = viewportAr*0.5; - if (Olive::CurrentConfig.use_custom_title_safe_ratio && Olive::CurrentConfig.custom_title_safe_ratio > 0) { - if (Olive::CurrentConfig.custom_title_safe_ratio > viewportAr) { - halfHeight = (Olive::CurrentConfig.custom_title_safe_ratio/viewportAr)*0.5; + if (olive::CurrentConfig.use_custom_title_safe_ratio && olive::CurrentConfig.custom_title_safe_ratio > 0) { + if (olive::CurrentConfig.custom_title_safe_ratio > viewportAr) { + halfHeight = (olive::CurrentConfig.custom_title_safe_ratio/viewportAr)*0.5; } else { - halfWidth = (viewportAr/Olive::CurrentConfig.custom_title_safe_ratio)*0.5; + halfWidth = (viewportAr/olive::CurrentConfig.custom_title_safe_ratio)*0.5; } } @@ -609,7 +609,7 @@ void ViewerWidget::paintGL() { glBindTexture(GL_TEXTURE_2D, 0); // draw title/action safe area - if (Olive::CurrentConfig.show_title_safe_area) { + if (olive::CurrentConfig.show_title_safe_area) { draw_title_safe_area(); }