added focus filter
This commit is contained in:
@@ -75,7 +75,7 @@ void NewSequenceDialog::create() {
|
||||
s->audio_layout = AV_CH_LAYOUT_STEREO;
|
||||
|
||||
ComboAction* ca = new ComboAction();
|
||||
panel_project->new_sequence(ca, s, true, nullptr);
|
||||
panel_project->create_sequence_internal(ca, s, true, nullptr);
|
||||
Olive::UndoStack.push(ca);
|
||||
} else {
|
||||
ComboAction* ca = new ComboAction();
|
||||
|
||||
+2
-2
@@ -163,7 +163,7 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
switch (type) {
|
||||
case MEDIA_TYPE_FOLDER:
|
||||
{
|
||||
Media* folder = panel_project->new_folder(nullptr);
|
||||
Media* folder = panel_project->create_folder_internal(nullptr);
|
||||
folder->temp_id2 = 0;
|
||||
for (int j=0;j<stream.attributes().size();j++) {
|
||||
const QXmlStreamAttribute& attr = stream.attributes().at(j);
|
||||
@@ -543,7 +543,7 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
}
|
||||
}
|
||||
|
||||
Media* m = panel_project->new_sequence(nullptr, s, false, parent);
|
||||
Media* m = panel_project->create_sequence_internal(nullptr, s, false, parent);
|
||||
|
||||
loaded_sequences.append(m);
|
||||
}
|
||||
|
||||
+47
-332
@@ -29,8 +29,6 @@
|
||||
#include "dialogs/aboutdialog.h"
|
||||
#include "dialogs/newsequencedialog.h"
|
||||
#include "dialogs/exportdialog.h"
|
||||
#include "dialogs/preferencesdialog.h"
|
||||
#include "dialogs/demonotice.h"
|
||||
#include "dialogs/speeddialog.h"
|
||||
#include "dialogs/actionsearch.h"
|
||||
#include "dialogs/debugdialog.h"
|
||||
@@ -350,67 +348,6 @@ void MainWindow::show_debug_log() {
|
||||
debug_dialog->show();
|
||||
}
|
||||
|
||||
void MainWindow::delete_slot() {
|
||||
if (panel_timeline->headers->hasFocus()) {
|
||||
panel_timeline->headers->delete_markers();
|
||||
} else if (panel_footage_viewer->headers->hasFocus()) {
|
||||
panel_footage_viewer->headers->delete_markers();
|
||||
} else if (panel_sequence_viewer->headers->hasFocus()) {
|
||||
panel_sequence_viewer->headers->delete_markers();
|
||||
} else if (panel_timeline->focused()) {
|
||||
panel_timeline->delete_selection(Olive::ActiveSequence->selections, false);
|
||||
} else if (panel_effect_controls->is_focused()) {
|
||||
panel_effect_controls->delete_effects();
|
||||
} else if (panel_project->is_focused()) {
|
||||
panel_project->delete_selected_media();
|
||||
} else if (panel_effect_controls->keyframe_focus()) {
|
||||
panel_effect_controls->delete_selected_keyframes();
|
||||
} else if (panel_graph_editor->view_is_focused()) {
|
||||
panel_graph_editor->delete_selected_keys();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::select_all() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (focused_panel == panel_timeline) {
|
||||
panel_timeline->select_all();
|
||||
} else if (focused_panel == panel_graph_editor) {
|
||||
panel_graph_editor->select_all();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::new_sequence() {
|
||||
NewSequenceDialog nsd(this);
|
||||
nsd.set_sequence_name(panel_project->get_next_sequence_name());
|
||||
nsd.exec();
|
||||
}
|
||||
|
||||
void MainWindow::zoom_in() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (focused_panel == panel_timeline) {
|
||||
panel_timeline->set_zoom(true);
|
||||
} else if (focused_panel == panel_effect_controls) {
|
||||
panel_effect_controls->set_zoom(true);
|
||||
} else if (focused_panel == panel_footage_viewer) {
|
||||
panel_footage_viewer->set_zoom(true);
|
||||
} else if (focused_panel == panel_sequence_viewer) {
|
||||
panel_sequence_viewer->set_zoom(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::zoom_out() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (focused_panel == panel_timeline) {
|
||||
panel_timeline->set_zoom(false);
|
||||
} else if (focused_panel == panel_effect_controls) {
|
||||
panel_effect_controls->set_zoom(false);
|
||||
} else if (focused_panel == panel_footage_viewer) {
|
||||
panel_footage_viewer->set_zoom(false);
|
||||
} else if (focused_panel == panel_sequence_viewer) {
|
||||
panel_sequence_viewer->set_zoom(false);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::export_dialog() {
|
||||
if (Olive::ActiveSequence == nullptr) {
|
||||
QMessageBox::information(this, tr("No active sequence"), tr("Please open the sequence you wish to export."), QMessageBox::Ok);
|
||||
@@ -437,22 +374,6 @@ void MainWindow::editMenu_About_To_Be_Shown() {
|
||||
redo_action->setEnabled(Olive::UndoStack.canRedo());
|
||||
}
|
||||
|
||||
void MainWindow::undo() {
|
||||
// workaround to prevent crash (and also users should never need to do this)
|
||||
if (!panel_timeline->importing) {
|
||||
Olive::UndoStack.undo();
|
||||
update_ui(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::redo() {
|
||||
// workaround to prevent crash (and also users should never need to do this)
|
||||
if (!panel_timeline->importing) {
|
||||
Olive::UndoStack.redo();
|
||||
update_ui(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::open_speed_dialog() {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
SpeedDialog s(this);
|
||||
@@ -466,35 +387,6 @@ void MainWindow::open_speed_dialog() {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::cut() {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (panel_timeline == focused_panel) {
|
||||
panel_timeline->copy(true);
|
||||
} else if (panel_effect_controls == focused_panel) {
|
||||
panel_effect_controls->copy(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::copy() {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (panel_timeline == focused_panel) {
|
||||
panel_timeline->copy(false);
|
||||
} else if (panel_effect_controls == focused_panel) {
|
||||
panel_effect_controls->copy(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::paste() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if ((panel_timeline == focused_panel || panel_effect_controls == focused_panel) && Olive::ActiveSequence != nullptr) {
|
||||
panel_timeline->paste(false);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setup_menus() {
|
||||
QMenuBar* menuBar = new QMenuBar(this);
|
||||
setMenuBar(menuBar);
|
||||
@@ -537,34 +429,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"), this, SLOT(undo()), QKeySequence("Ctrl+Z"));
|
||||
undo_action = edit_menu->addAction(tr("&Undo"), Olive::Global.data(), SLOT(undo()), QKeySequence("Ctrl+Z"));
|
||||
undo_action->setProperty("id", "undo");
|
||||
redo_action = edit_menu->addAction(tr("Redo"), this, SLOT(redo()), QKeySequence("Ctrl+Shift+Z"));
|
||||
redo_action = edit_menu->addAction(tr("Redo"), Olive::Global.data(), SLOT(redo()), QKeySequence("Ctrl+Shift+Z"));
|
||||
redo_action->setProperty("id", "redo");
|
||||
|
||||
edit_menu->addSeparator();
|
||||
|
||||
edit_menu->addAction(tr("Cu&t"), this, SLOT(cut()), QKeySequence("Ctrl+X"))->setProperty("id", "cut");
|
||||
edit_menu->addAction(tr("Cop&y"), this, SLOT(copy()), QKeySequence("Ctrl+C"))->setProperty("id", "copy");
|
||||
edit_menu->addAction(tr("&Paste"), this, SLOT(paste()), QKeySequence("Ctrl+V"))->setProperty("id", "paste");
|
||||
edit_menu->addAction(tr("Paste Insert"), this, SLOT(paste_insert()), QKeySequence("Ctrl+Shift+V"))->setProperty("id", "pasteinsert");
|
||||
edit_menu->addAction(tr("Duplicate"), this, SLOT(duplicate()), QKeySequence("Ctrl+D"))->setProperty("id", "duplicate");
|
||||
edit_menu->addAction(tr("Delete"), this, SLOT(delete_slot()), QKeySequence("Del"))->setProperty("id", "delete");
|
||||
edit_menu->addAction(tr("Ripple Delete"), this, SLOT(ripple_delete()), QKeySequence("Shift+Del"))->setProperty("id", "rippledelete");
|
||||
edit_menu->addAction(tr("Split"), panel_timeline, SLOT(split_at_playhead()), QKeySequence("Ctrl+K"))->setProperty("id", "split");
|
||||
Olive::MenuHelper.make_edit_functions_menu(edit_menu);
|
||||
|
||||
edit_menu->addSeparator();
|
||||
|
||||
edit_menu->addAction(tr("Select &All"), this, 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();
|
||||
|
||||
edit_menu->addAction(tr("Add Default Transition"), this, SLOT(add_default_transition()), QKeySequence("Ctrl+Shift+D"))->setProperty("id", "deftransition");
|
||||
edit_menu->addAction(tr("Link/Unlink"), panel_timeline, SLOT(toggle_links()), QKeySequence("Ctrl+L"))->setProperty("id", "linkunlink");
|
||||
edit_menu->addAction(tr("Enable/Disable"), panel_timeline, SLOT(toggle_enable_on_selected_clips()), QKeySequence("Shift+E"))->setProperty("id", "enabledisable");
|
||||
edit_menu->addAction(tr("Nest"), this, SLOT(nest()))->setProperty("id", "nest");
|
||||
Olive::MenuHelper.make_clip_functions_menu(edit_menu);
|
||||
|
||||
edit_menu->addSeparator();
|
||||
|
||||
@@ -588,8 +470,8 @@ void MainWindow::setup_menus() {
|
||||
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"), this, SLOT(zoom_in()), QKeySequence("="))->setProperty("id", "zoomin");
|
||||
view_menu->addAction(tr("Zoom Out"), this, 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");
|
||||
|
||||
@@ -874,7 +756,7 @@ void MainWindow::setup_menus() {
|
||||
|
||||
tools_menu->addSeparator();
|
||||
|
||||
tools_menu->addAction(tr("Preferences"), this, SLOT(preferences()), QKeySequence("Ctrl+,"))->setProperty("id", "prefs");
|
||||
tools_menu->addAction(tr("Preferences"), Olive::Global.data(), SLOT(open_preferences()), QKeySequence("Ctrl+,"))->setProperty("id", "prefs");
|
||||
|
||||
#ifdef QT_DEBUG
|
||||
tools_menu->addAction(tr("Clear Undo"), this, SLOT(clear_undo_stack()))->setProperty("id", "clearundo");
|
||||
@@ -897,23 +779,6 @@ void MainWindow::setup_menus() {
|
||||
load_shortcuts(get_config_path() + "/shortcuts", true);
|
||||
}
|
||||
|
||||
void MainWindow::set_bool_action_checked(QAction *a) {
|
||||
if (!a->data().isNull()) {
|
||||
bool* variable = reinterpret_cast<bool*>(a->data().value<quintptr>());
|
||||
a->setChecked(*variable);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::set_int_action_checked(QAction *a, const int& i) {
|
||||
if (!a->data().isNull()) {
|
||||
a->setChecked(a->data() == i);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::set_button_action_checked(QAction *a) {
|
||||
a->setChecked(reinterpret_cast<QPushButton*>(a->data().value<quintptr>())->isChecked());
|
||||
}
|
||||
|
||||
void MainWindow::updateTitle() {
|
||||
setWindowTitle(QString("%1 - %2[*]").arg(Olive::AppName,
|
||||
(Olive::ActiveProjectFilename.isEmpty()) ?
|
||||
@@ -1022,15 +887,6 @@ void MainWindow::maximize_panel() {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::preferences() {
|
||||
panel_sequence_viewer->pause();
|
||||
panel_footage_viewer->pause();
|
||||
|
||||
PreferencesDialog pd(this);
|
||||
pd.setup_kbd_shortcuts(menuBar());
|
||||
pd.exec();
|
||||
}
|
||||
|
||||
void MainWindow::full_screen_viewer() {
|
||||
if (get_focused_panel() == panel_footage_viewer) {
|
||||
panel_footage_viewer->viewer_widget->set_fullscreen();
|
||||
@@ -1050,16 +906,16 @@ void MainWindow::windowMenu_About_To_Be_Shown() {
|
||||
}
|
||||
|
||||
void MainWindow::playbackMenu_About_To_Be_Shown() {
|
||||
set_bool_action_checked(loop_action);
|
||||
Olive::MenuHelper.set_bool_action_checked(loop_action);
|
||||
}
|
||||
|
||||
void MainWindow::viewMenu_About_To_Be_Shown() {
|
||||
set_bool_action_checked(track_lines);
|
||||
Olive::MenuHelper.set_bool_action_checked(track_lines);
|
||||
|
||||
set_int_action_checked(frames_action, config.timecode_view);
|
||||
set_int_action_checked(drop_frame_action, config.timecode_view);
|
||||
set_int_action_checked(nondrop_frame_action, config.timecode_view);
|
||||
set_int_action_checked(milliseconds_action, config.timecode_view);
|
||||
Olive::MenuHelper.set_int_action_checked(frames_action, config.timecode_view);
|
||||
Olive::MenuHelper.set_int_action_checked(drop_frame_action, config.timecode_view);
|
||||
Olive::MenuHelper.set_int_action_checked(nondrop_frame_action, config.timecode_view);
|
||||
Olive::MenuHelper.set_int_action_checked(milliseconds_action, config.timecode_view);
|
||||
|
||||
title_safe_off->setChecked(!config.show_title_safe_area);
|
||||
title_safe_default->setChecked(config.show_title_safe_area && !config.use_custom_title_safe_ratio);
|
||||
@@ -1073,59 +929,34 @@ void MainWindow::viewMenu_About_To_Be_Shown() {
|
||||
}
|
||||
|
||||
void MainWindow::toolMenu_About_To_Be_Shown() {
|
||||
set_button_action_checked(pointer_tool_action);
|
||||
set_button_action_checked(edit_tool_action);
|
||||
set_button_action_checked(ripple_tool_action);
|
||||
set_button_action_checked(razor_tool_action);
|
||||
set_button_action_checked(slip_tool_action);
|
||||
set_button_action_checked(slide_tool_action);
|
||||
set_button_action_checked(hand_tool_action);
|
||||
set_button_action_checked(transition_tool_action);
|
||||
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);
|
||||
|
||||
set_bool_action_checked(selecting_also_seeks);
|
||||
set_bool_action_checked(edit_tool_also_seeks);
|
||||
set_bool_action_checked(edit_tool_selects_links);
|
||||
set_bool_action_checked(seek_to_end_of_pastes);
|
||||
set_bool_action_checked(scroll_wheel_zooms);
|
||||
set_bool_action_checked(rectified_waveforms);
|
||||
set_bool_action_checked(enable_drag_files_to_timeline);
|
||||
set_bool_action_checked(autoscale_by_default);
|
||||
set_bool_action_checked(enable_seek_to_import);
|
||||
set_bool_action_checked(enable_audio_scrubbing);
|
||||
set_bool_action_checked(enable_drop_on_media_to_replace);
|
||||
set_bool_action_checked(enable_hover_focus);
|
||||
set_bool_action_checked(set_name_and_marker);
|
||||
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);
|
||||
|
||||
set_int_action_checked(no_autoscroll, config.autoscroll);
|
||||
set_int_action_checked(page_autoscroll, config.autoscroll);
|
||||
set_int_action_checked(smooth_autoscroll, config.autoscroll);
|
||||
}
|
||||
|
||||
void MainWindow::duplicate() {
|
||||
if (panel_project->is_focused()) {
|
||||
panel_project->duplicate_selected();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::add_default_transition() {
|
||||
if (panel_timeline->focused()) panel_timeline->add_transition();
|
||||
}
|
||||
|
||||
void MainWindow::new_folder() {
|
||||
Media* m = panel_project->new_folder(nullptr);
|
||||
Olive::UndoStack.push(new AddMediaCommand(m, panel_project->get_selected_folder()));
|
||||
|
||||
QModelIndex index = project_model.create_index(m->row(), 0, m);
|
||||
switch (config.project_view_type) {
|
||||
case PROJECT_VIEW_TREE:
|
||||
panel_project->tree_view->edit(panel_project->sorter->mapFromSource(index));
|
||||
break;
|
||||
case PROJECT_VIEW_ICON:
|
||||
panel_project->icon_view->edit(panel_project->sorter->mapFromSource(index));
|
||||
break;
|
||||
}
|
||||
Olive::MenuHelper.set_int_action_checked(no_autoscroll, config.autoscroll);
|
||||
Olive::MenuHelper.set_int_action_checked(page_autoscroll, config.autoscroll);
|
||||
Olive::MenuHelper.set_int_action_checked(smooth_autoscroll, config.autoscroll);
|
||||
}
|
||||
|
||||
void MainWindow::fileMenu_About_To_Be_Shown() {
|
||||
@@ -1147,51 +978,11 @@ void MainWindow::fileMenu_About_To_Be_Shown() {
|
||||
}
|
||||
|
||||
void MainWindow::ripple_to_in_point() {
|
||||
if (panel_timeline->focused()) panel_timeline->ripple_to_in_point(true, true);
|
||||
panel_timeline->ripple_to_in_point(true, true);
|
||||
}
|
||||
|
||||
void MainWindow::ripple_to_out_point() {
|
||||
if (panel_timeline->focused()) panel_timeline->ripple_to_in_point(false, true);
|
||||
}
|
||||
|
||||
void MainWindow::set_in_point() {
|
||||
if (panel_timeline->focused() || panel_sequence_viewer->is_focused()) {
|
||||
panel_sequence_viewer->set_in_point();
|
||||
} else if (panel_footage_viewer->is_focused()) {
|
||||
panel_footage_viewer->set_in_point();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::set_out_point() {
|
||||
if (panel_timeline->focused() || panel_sequence_viewer->is_focused()) {
|
||||
panel_sequence_viewer->set_out_point();
|
||||
} else if (panel_footage_viewer->is_focused()) {
|
||||
panel_footage_viewer->set_out_point();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::clear_in() {
|
||||
if (panel_timeline->focused() || panel_sequence_viewer->is_focused()) {
|
||||
panel_sequence_viewer->clear_in();
|
||||
} else if (panel_footage_viewer->is_focused()) {
|
||||
panel_footage_viewer->clear_in();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::clear_out() {
|
||||
if (panel_timeline->focused() || panel_sequence_viewer->is_focused()) {
|
||||
panel_sequence_viewer->clear_out();
|
||||
} else if (panel_footage_viewer->is_focused()) {
|
||||
panel_footage_viewer->clear_out();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::clear_inout() {
|
||||
if (panel_timeline->focused() || panel_sequence_viewer->is_focused()) {
|
||||
panel_sequence_viewer->clear_inout_point();
|
||||
} else if (panel_footage_viewer->is_focused()) {
|
||||
panel_footage_viewer->clear_inout_point();
|
||||
}
|
||||
panel_timeline->ripple_to_in_point(false, true);
|
||||
}
|
||||
|
||||
void MainWindow::toggle_full_screen() {
|
||||
@@ -1204,16 +995,11 @@ void MainWindow::toggle_full_screen() {
|
||||
}
|
||||
|
||||
void MainWindow::delete_inout() {
|
||||
if (panel_timeline->focused()) {
|
||||
panel_timeline->delete_in_out(false);
|
||||
}
|
||||
panel_timeline->delete_in_out(false);
|
||||
}
|
||||
|
||||
void MainWindow::ripple_delete_inout()
|
||||
{
|
||||
if (panel_timeline->focused()) {
|
||||
panel_timeline->delete_in_out(true);
|
||||
}
|
||||
void MainWindow::ripple_delete_inout() {
|
||||
panel_timeline->delete_in_out(true);
|
||||
}
|
||||
|
||||
void MainWindow::set_tsa_default() {
|
||||
@@ -1280,82 +1066,11 @@ void MainWindow::set_marker() {
|
||||
}
|
||||
|
||||
void MainWindow::edit_to_in_point() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (focused_panel == panel_timeline) panel_timeline->ripple_to_in_point(true, false);
|
||||
panel_timeline->ripple_to_in_point(true, false);
|
||||
}
|
||||
|
||||
void MainWindow::edit_to_out_point() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (focused_panel == panel_timeline) panel_timeline->ripple_to_in_point(false, false);
|
||||
}
|
||||
|
||||
void MainWindow::nest() {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
QVector<int> selected_clips;
|
||||
long earliest_point = LONG_MAX;
|
||||
|
||||
// get selected clips
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.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);
|
||||
}
|
||||
}
|
||||
|
||||
// nest them
|
||||
if (!selected_clips.isEmpty()) {
|
||||
ComboAction* ca = new ComboAction();
|
||||
|
||||
Sequence* s = new Sequence();
|
||||
|
||||
// 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;
|
||||
|
||||
// copy all selected clips to the nest
|
||||
for (int i=0;i<selected_clips.size();i++) {
|
||||
// delete clip from old sequence
|
||||
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);
|
||||
copy->timeline_in -= earliest_point;
|
||||
copy->timeline_out -= earliest_point;
|
||||
s->clips.append(copy);
|
||||
}
|
||||
|
||||
// relink clips in new nested sequences
|
||||
panel_timeline->relink_clips_using_ids(selected_clips, s->clips);
|
||||
|
||||
// add sequence to project
|
||||
Media* m = panel_project->new_sequence(ca, s, false, nullptr);
|
||||
|
||||
// add nested sequence to active sequence
|
||||
QVector<Media*> media_list;
|
||||
media_list.append(m);
|
||||
panel_timeline->create_ghosts_from_media(Olive::ActiveSequence, earliest_point, media_list);
|
||||
panel_timeline->add_clips_from_ghosts(ca, Olive::ActiveSequence);
|
||||
|
||||
panel_effect_controls->clear_effects(true);
|
||||
Olive::ActiveSequence->selections.clear();
|
||||
|
||||
Olive::UndoStack.push(ca);
|
||||
|
||||
update_ui(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::paste_insert() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (focused_panel == panel_timeline && Olive::ActiveSequence != nullptr) {
|
||||
panel_timeline->paste(true);
|
||||
}
|
||||
panel_timeline->ripple_to_in_point(false, false);
|
||||
}
|
||||
|
||||
void MainWindow::toggle_bool_action() {
|
||||
|
||||
+4
-34
@@ -22,14 +22,9 @@ public:
|
||||
void load_css_from_file(const QString& fn);
|
||||
|
||||
public slots:
|
||||
void undo();
|
||||
void redo();
|
||||
void open_speed_dialog();
|
||||
void cut();
|
||||
void copy();
|
||||
void paste();
|
||||
void nest();
|
||||
void toggle_full_screen();
|
||||
void open_speed_dialog();
|
||||
|
||||
void toggle_full_screen();
|
||||
|
||||
void toggle_bool_action();
|
||||
|
||||
@@ -45,21 +40,13 @@ private slots:
|
||||
|
||||
void show_about();
|
||||
void show_debug_log();
|
||||
void delete_slot();
|
||||
void select_all();
|
||||
|
||||
void new_sequence();
|
||||
|
||||
void zoom_in();
|
||||
void zoom_out();
|
||||
void export_dialog();
|
||||
void ripple_delete();
|
||||
|
||||
void maximize_panel();
|
||||
void reset_layout();
|
||||
|
||||
void preferences();
|
||||
|
||||
void full_screen_viewer();
|
||||
|
||||
void fileMenu_About_To_Be_Shown();
|
||||
@@ -67,23 +54,11 @@ private slots:
|
||||
void windowMenu_About_To_Be_Shown();
|
||||
void playbackMenu_About_To_Be_Shown();
|
||||
void viewMenu_About_To_Be_Shown();
|
||||
void toolMenu_About_To_Be_Shown();
|
||||
|
||||
void duplicate();
|
||||
|
||||
void add_default_transition();
|
||||
|
||||
void new_folder();
|
||||
void toolMenu_About_To_Be_Shown();
|
||||
|
||||
void ripple_to_in_point();
|
||||
void ripple_to_out_point();
|
||||
|
||||
void set_in_point();
|
||||
void set_out_point();
|
||||
|
||||
void clear_in();
|
||||
void clear_out();
|
||||
void clear_inout();
|
||||
void delete_inout();
|
||||
void ripple_delete_inout();
|
||||
|
||||
@@ -98,7 +73,6 @@ private slots:
|
||||
|
||||
void edit_to_in_point();
|
||||
void edit_to_out_point();
|
||||
void paste_insert();
|
||||
void set_autoscroll();
|
||||
void menu_click_button();
|
||||
void toggle_panel_visibility();
|
||||
@@ -110,10 +84,6 @@ private:
|
||||
void setup_layout(bool reset);
|
||||
void setup_menus();
|
||||
|
||||
void set_bool_action_checked(QAction* a);
|
||||
void set_int_action_checked(QAction* a, const int& i);
|
||||
void set_button_action_checked(QAction* a);
|
||||
|
||||
// menu bar menus
|
||||
QMenu* window_menu;
|
||||
|
||||
|
||||
@@ -30,6 +30,13 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
||||
# Tries to get the current Git short hash
|
||||
system("which git") {
|
||||
GITHASHVAR = $$system(git --git-dir $$PWD/.git --work-tree $$PWD log -1 --format=%h)
|
||||
|
||||
# Fallback for Ubuntu/Launchpad (extracts Git hash from debian/changelog rather than Git repo)
|
||||
# (see https://answers.launchpad.net/launchpad/+question/678556)
|
||||
isEmpty(GITHASHVAR) {
|
||||
GITHASHVAR = $$system(grep -Po '(?<=-)(([a-z0-9])\w+)(?=\+)' debian/changelog)
|
||||
}
|
||||
|
||||
DEFINES += GITHASH=\\"\"$$GITHASHVAR\\"\"
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#include "playback/audio.h"
|
||||
|
||||
#include "dialogs/demonotice.h"
|
||||
#include "dialogs/preferencesdialog.h"
|
||||
|
||||
#include "project/sequence.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
@@ -185,8 +188,45 @@ void OliveGlobal::save_autorecovery_file() {
|
||||
}
|
||||
}
|
||||
|
||||
void OliveGlobal::open_preferences() {
|
||||
panel_sequence_viewer->pause();
|
||||
panel_footage_viewer->pause();
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
void OliveGlobal::undo() {
|
||||
// workaround to prevent crash (and also users should never need to do this)
|
||||
if (!panel_timeline->importing) {
|
||||
Olive::UndoStack.undo();
|
||||
update_ui(true);
|
||||
}
|
||||
}
|
||||
|
||||
void OliveGlobal::redo() {
|
||||
// workaround to prevent crash (and also users should never need to do this)
|
||||
if (!panel_timeline->importing) {
|
||||
Olive::UndoStack.redo();
|
||||
update_ui(true);
|
||||
}
|
||||
}
|
||||
|
||||
void OliveGlobal::paste() {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
panel_timeline->paste(false);
|
||||
}
|
||||
}
|
||||
|
||||
void OliveGlobal::paste_insert() {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
panel_timeline->paste(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,12 @@ public:
|
||||
void load_project_on_launch(const QString& s);
|
||||
|
||||
public slots:
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
void paste();
|
||||
void paste_insert();
|
||||
|
||||
void new_project();
|
||||
void open_project();
|
||||
void open_recent();
|
||||
@@ -45,6 +51,11 @@ public slots:
|
||||
*/
|
||||
void save_autorecovery_file();
|
||||
|
||||
/**
|
||||
* @brief Opens the Preferences dialog
|
||||
*/
|
||||
void open_preferences();
|
||||
|
||||
private:
|
||||
void open_project_worker(const QString& fn, bool autorecovery);
|
||||
|
||||
|
||||
+28
-7
@@ -114,7 +114,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::MainWindow, SLOT(undo()));
|
||||
connect(toolbar_undo, SIGNAL(clicked(bool)), Olive::Global.data(), SLOT(undo()));
|
||||
toolbar->addWidget(toolbar_undo);
|
||||
|
||||
QPushButton* toolbar_redo = new QPushButton();
|
||||
@@ -123,7 +123,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::MainWindow, SLOT(redo()));
|
||||
connect(toolbar_redo, SIGNAL(clicked(bool)), Olive::Global.data(), SLOT(redo()));
|
||||
toolbar->addWidget(toolbar_redo);
|
||||
|
||||
QLineEdit* toolbar_search = new QLineEdit();
|
||||
@@ -309,7 +309,7 @@ void Project::duplicate_selected() {
|
||||
for (int j=0;j<items.size();j++) {
|
||||
Media* i = item_to_media(items.at(j));
|
||||
if (i->get_type() == MEDIA_TYPE_SEQUENCE) {
|
||||
new_sequence(ca, i->to_sequence()->copy(), false, item_to_media(items.at(j).parent()));
|
||||
create_sequence_internal(ca, i->to_sequence()->copy(), false, item_to_media(items.at(j).parent()));
|
||||
duped = true;
|
||||
}
|
||||
}
|
||||
@@ -398,10 +398,31 @@ void Project::open_properties() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Media* Project::new_sequence(ComboAction *ca, Sequence *s, bool open, Media* parent) {
|
||||
void Project::new_folder() {
|
||||
Media* m = create_folder_internal(nullptr);
|
||||
Olive::UndoStack.push(new AddMediaCommand(m, get_selected_folder()));
|
||||
|
||||
QModelIndex index = project_model.create_index(m->row(), 0, m);
|
||||
switch (config.project_view_type) {
|
||||
case PROJECT_VIEW_TREE:
|
||||
tree_view->edit(sorter->mapFromSource(index));
|
||||
break;
|
||||
case PROJECT_VIEW_ICON:
|
||||
icon_view->edit(sorter->mapFromSource(index));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Project::new_sequence() {
|
||||
NewSequenceDialog nsd(this);
|
||||
nsd.set_sequence_name(panel_project->get_next_sequence_name());
|
||||
nsd.exec();
|
||||
}
|
||||
|
||||
Media* Project::create_sequence_internal(ComboAction *ca, Sequence *s, bool open, Media* parent) {
|
||||
if (parent == nullptr) parent = project_model.get_root();
|
||||
Media* item = new Media(parent);
|
||||
item->set_sequence(s);
|
||||
@@ -434,7 +455,7 @@ bool Project::is_focused() {
|
||||
return tree_view->hasFocus() || icon_view->hasFocus();
|
||||
}
|
||||
|
||||
Media* Project::new_folder(QString name) {
|
||||
Media* Project::create_folder_internal(QString name) {
|
||||
Media* item = new Media(nullptr);
|
||||
item->set_folder();
|
||||
item->set_name(name);
|
||||
@@ -648,7 +669,7 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla
|
||||
for (int i=0;i<files.size();i++) {
|
||||
if (QFileInfo(files.at(i)).isDir()) {
|
||||
QString folder_name = get_file_name_from_path(files.at(i));
|
||||
Media* folder = new_folder(folder_name);
|
||||
Media* folder = create_folder_internal(folder_name);
|
||||
|
||||
QDir directory(files.at(i));
|
||||
directory.setFilter(QDir::NoDotAndDotDot | QDir::AllEntries);
|
||||
|
||||
+4
-2
@@ -46,7 +46,7 @@ public:
|
||||
~Project();
|
||||
bool is_focused();
|
||||
void clear();
|
||||
Media* new_sequence(ComboAction *ca, Sequence* s, bool open, Media* parent);
|
||||
Media* create_sequence_internal(ComboAction *ca, Sequence* s, bool open, Media* parent);
|
||||
QString get_next_sequence_name(QString start = 0);
|
||||
void process_file_list(QStringList& files, bool recursive = false, Media* replace = nullptr, Media *parent = nullptr);
|
||||
void replace_media(Media* item, QString filename);
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
void load_project(bool autorecovery);
|
||||
void save_project(bool autorecovery);
|
||||
|
||||
Media* new_folder(QString name);
|
||||
Media* create_folder_internal(QString name);
|
||||
Media* item_to_media(const QModelIndex& index);
|
||||
|
||||
void save_recent_projects();
|
||||
@@ -87,6 +87,8 @@ public slots:
|
||||
void replace_selected_file();
|
||||
void replace_clip_media();
|
||||
void open_properties();
|
||||
void new_folder();
|
||||
void new_sequence();
|
||||
private:
|
||||
void save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only, const QModelIndex &parent = QModelIndex());
|
||||
int folder_id;
|
||||
|
||||
+69
-7
@@ -324,9 +324,9 @@ void Timeline::add_clips_from_ghosts(ComboAction* ca, Sequence* s) {
|
||||
if (config.enable_seek_to_import) {
|
||||
panel_sequence_viewer->seek(earliest_point);
|
||||
}
|
||||
panel_timeline->ghosts.clear();
|
||||
panel_timeline->importing = false;
|
||||
panel_timeline->snapped = false;
|
||||
ghosts.clear();
|
||||
importing = false;
|
||||
snapped = false;
|
||||
}
|
||||
|
||||
int Timeline::get_track_height_size(bool video) {
|
||||
@@ -362,7 +362,69 @@ void Timeline::add_transition() {
|
||||
delete ca;
|
||||
}
|
||||
|
||||
update_ui(true);
|
||||
update_ui(true);
|
||||
}
|
||||
|
||||
void Timeline::nest() {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
QVector<int> selected_clips;
|
||||
long earliest_point = LONG_MAX;
|
||||
|
||||
// get selected clips
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.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);
|
||||
}
|
||||
}
|
||||
|
||||
// nest them
|
||||
if (!selected_clips.isEmpty()) {
|
||||
ComboAction* ca = new ComboAction();
|
||||
|
||||
Sequence* s = new Sequence();
|
||||
|
||||
// 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;
|
||||
|
||||
// copy all selected clips to the nest
|
||||
for (int i=0;i<selected_clips.size();i++) {
|
||||
// delete clip from old sequence
|
||||
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);
|
||||
copy->timeline_in -= earliest_point;
|
||||
copy->timeline_out -= earliest_point;
|
||||
s->clips.append(copy);
|
||||
}
|
||||
|
||||
// relink clips in new nested sequences
|
||||
relink_clips_using_ids(selected_clips, s->clips);
|
||||
|
||||
// add sequence to project
|
||||
Media* m = panel_project->create_sequence_internal(ca, s, false, nullptr);
|
||||
|
||||
// add nested sequence to active sequence
|
||||
QVector<Media*> media_list;
|
||||
media_list.append(m);
|
||||
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::UndoStack.push(ca);
|
||||
|
||||
update_ui(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int Timeline::calculate_track_height(int track, int value) {
|
||||
@@ -418,7 +480,7 @@ void Timeline::repaint_timeline() {
|
||||
&& !zoom_just_changed) {
|
||||
// auto scroll
|
||||
if (config.autoscroll == AUTOSCROLL_PAGE_SCROLL) {
|
||||
int playhead_x = panel_timeline->getTimelineScreenPointFromFrame(Olive::ActiveSequence->playhead);
|
||||
int playhead_x = getTimelineScreenPointFromFrame(Olive::ActiveSequence->playhead);
|
||||
if (playhead_x < 0 || playhead_x > (editAreas->width() - videoScrollbar->width())) {
|
||||
horizontalScrollBar->setValue(getScreenPointFromFrame(zoom, Olive::ActiveSequence->playhead));
|
||||
draw = false;
|
||||
@@ -515,11 +577,11 @@ void Timeline::ripple_delete_empty_space() {
|
||||
Selection s;
|
||||
s.in = rc_ripple_min;
|
||||
s.out = rc_ripple_max;
|
||||
s.track = panel_timeline->cursor_track;
|
||||
s.track = cursor_track;
|
||||
|
||||
sels.append(s);
|
||||
|
||||
panel_timeline->delete_selection(sels, true);
|
||||
delete_selection(sels, true);
|
||||
}
|
||||
|
||||
void Timeline::resizeEvent(QResizeEvent *) {
|
||||
|
||||
+4
-1
@@ -89,7 +89,6 @@ public:
|
||||
void relink_clips_using_ids(QVector<int>& old_clips, QVector<Clip*>& new_clips);
|
||||
void update_sequence();
|
||||
|
||||
void add_transition();
|
||||
QVector<int> get_tracks_of_linked_clips(int i);
|
||||
bool has_clip_been_split(int c);
|
||||
void ripple_to_in_point(bool in, bool ripple);
|
||||
@@ -220,6 +219,10 @@ public slots:
|
||||
void previous_cut();
|
||||
void next_cut();
|
||||
|
||||
void add_transition();
|
||||
|
||||
void nest();
|
||||
|
||||
private slots:
|
||||
void zoom_in();
|
||||
void zoom_out();
|
||||
|
||||
@@ -48,7 +48,7 @@ void SourcesCommon::create_seq_from_selected() {
|
||||
panel_timeline->create_ghosts_from_media(s, 0, media_list);
|
||||
panel_timeline->add_clips_from_ghosts(ca, s);
|
||||
|
||||
project_parent->new_sequence(ca, s, true, nullptr);
|
||||
project_parent->create_sequence_internal(ca, s, true, nullptr);
|
||||
Olive::UndoStack.push(ca);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "focusfilter.h"
|
||||
|
||||
#include "panels/panels.h"
|
||||
#include "project/sequence.h"
|
||||
#include "ui/timelineheader.h"
|
||||
|
||||
FocusFilter Olive::FocusFilter;
|
||||
|
||||
@@ -107,3 +109,126 @@ void FocusFilter::decrease_speed() {
|
||||
panel_sequence_viewer->decrease_speed();
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::set_in_point() {
|
||||
if (get_focused_panel() == panel_footage_viewer) {
|
||||
panel_footage_viewer->set_in_point();
|
||||
} else {
|
||||
panel_sequence_viewer->set_in_point();
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::set_out_point() {
|
||||
if (get_focused_panel() == panel_footage_viewer) {
|
||||
panel_footage_viewer->set_out_point();
|
||||
} else {
|
||||
panel_sequence_viewer->set_out_point();
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::clear_in() {
|
||||
if (get_focused_panel() == panel_footage_viewer) {
|
||||
panel_footage_viewer->clear_in();
|
||||
} else {
|
||||
panel_sequence_viewer->clear_in();
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::clear_out() {
|
||||
if (get_focused_panel() == panel_footage_viewer) {
|
||||
panel_footage_viewer->clear_out();
|
||||
} else {
|
||||
panel_sequence_viewer->clear_out();
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::clear_inout() {
|
||||
if (get_focused_panel() == panel_footage_viewer) {
|
||||
panel_footage_viewer->clear_inout_point();
|
||||
} else {
|
||||
panel_sequence_viewer->clear_inout_point();
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::delete_function() {
|
||||
if (panel_timeline->headers->hasFocus()) {
|
||||
panel_timeline->headers->delete_markers();
|
||||
} else if (panel_footage_viewer->headers->hasFocus()) {
|
||||
panel_footage_viewer->headers->delete_markers();
|
||||
} else if (panel_sequence_viewer->headers->hasFocus()) {
|
||||
panel_sequence_viewer->headers->delete_markers();
|
||||
} else if (panel_effect_controls->is_focused()) {
|
||||
panel_effect_controls->delete_effects();
|
||||
} else if (panel_project->is_focused()) {
|
||||
panel_project->delete_selected_media();
|
||||
} else if (panel_effect_controls->keyframe_focus()) {
|
||||
panel_effect_controls->delete_selected_keyframes();
|
||||
} else if (panel_graph_editor->view_is_focused()) {
|
||||
panel_graph_editor->delete_selected_keys();
|
||||
} else {
|
||||
panel_timeline->delete_selection(Olive::ActiveSequence->selections, false);
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::duplicate() {
|
||||
if (panel_project->is_focused()) {
|
||||
panel_project->duplicate_selected();
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::select_all() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (focused_panel == panel_graph_editor) {
|
||||
panel_graph_editor->select_all();
|
||||
} else {
|
||||
panel_timeline->select_all();
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::zoom_in() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (focused_panel == panel_effect_controls) {
|
||||
panel_effect_controls->set_zoom(true);
|
||||
} else if (focused_panel == panel_footage_viewer) {
|
||||
panel_footage_viewer->set_zoom(true);
|
||||
} else if (focused_panel == panel_sequence_viewer) {
|
||||
panel_sequence_viewer->set_zoom(true);
|
||||
} else {
|
||||
panel_timeline->set_zoom(true);
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::zoom_out() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (focused_panel == panel_effect_controls) {
|
||||
panel_effect_controls->set_zoom(false);
|
||||
} else if (focused_panel == panel_footage_viewer) {
|
||||
panel_footage_viewer->set_zoom(false);
|
||||
} else if (focused_panel == panel_sequence_viewer) {
|
||||
panel_sequence_viewer->set_zoom(false);
|
||||
} else {
|
||||
panel_timeline->set_zoom(false);
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::cut() {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (panel_effect_controls == focused_panel) {
|
||||
panel_effect_controls->copy(true);
|
||||
} else {
|
||||
panel_timeline->copy(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FocusFilter::copy() {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (panel_effect_controls == focused_panel) {
|
||||
panel_effect_controls->copy(false);
|
||||
} else {
|
||||
panel_timeline->copy(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,11 @@ public:
|
||||
FocusFilter();
|
||||
|
||||
public slots:
|
||||
void cut();
|
||||
void copy();
|
||||
|
||||
void duplicate();
|
||||
|
||||
void go_to_in();
|
||||
void go_to_out();
|
||||
void go_to_start();
|
||||
@@ -20,6 +25,18 @@ public slots:
|
||||
void decrease_speed();
|
||||
void next_frame();
|
||||
void go_to_end();
|
||||
|
||||
void set_in_point();
|
||||
void set_out_point();
|
||||
void clear_in();
|
||||
void clear_out();
|
||||
void clear_inout();
|
||||
|
||||
void delete_function();
|
||||
void select_all();
|
||||
|
||||
void zoom_in();
|
||||
void zoom_out();
|
||||
};
|
||||
|
||||
namespace Olive {
|
||||
|
||||
+47
-7
@@ -2,6 +2,10 @@
|
||||
|
||||
#include "oliveglobal.h"
|
||||
|
||||
#include "ui/focusfilter.h"
|
||||
|
||||
#include "panels/panels.h"
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
MenuHelper Olive::MenuHelper;
|
||||
@@ -9,15 +13,51 @@ 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->addSeparator();
|
||||
parent->addAction(tr("&Sequence"), Olive::MainWindow, SLOT(new_sequence()), QKeySequence("Ctrl+Shift+N"))->setProperty("id", "newseq");
|
||||
parent->addAction(tr("&Folder"), Olive::MainWindow, SLOT(new_folder()))->setProperty("id", "newfolder");
|
||||
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::MainWindow, SLOT(set_in_point()), QKeySequence("I"))->setProperty("id", "setinpoint");
|
||||
parent->addAction(tr("Set Out Point"), Olive::MainWindow, 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::MainWindow, SLOT(clear_in()))->setProperty("id", "resetin");
|
||||
parent->addAction(tr("Reset Out Point"), Olive::MainWindow, SLOT(clear_out()))->setProperty("id", "resetout");
|
||||
parent->addAction(tr("Clear In/Out Point"), Olive::MainWindow, 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) {
|
||||
parent->addAction(tr("Add Default Transition"), panel_timeline, SLOT(add_transition()), QKeySequence("Ctrl+Shift+D"))->setProperty("id", "deftransition");
|
||||
parent->addAction(tr("Link/Unlink"), panel_timeline, SLOT(toggle_links()), QKeySequence("Ctrl+L"))->setProperty("id", "linkunlink");
|
||||
parent->addAction(tr("Enable/Disable"), panel_timeline, SLOT(toggle_enable_on_selected_clips()), QKeySequence("Shift+E"))->setProperty("id", "enabledisable");
|
||||
parent->addAction(tr("Nest"), panel_timeline, SLOT(nest()))->setProperty("id", "nest");
|
||||
}
|
||||
|
||||
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("Ripple Delete"), this, 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");
|
||||
}
|
||||
|
||||
void MenuHelper::set_bool_action_checked(QAction *a) {
|
||||
if (!a->data().isNull()) {
|
||||
bool* variable = reinterpret_cast<bool*>(a->data().value<quintptr>());
|
||||
a->setChecked(*variable);
|
||||
}
|
||||
}
|
||||
|
||||
void MenuHelper::set_int_action_checked(QAction *a, const int& i) {
|
||||
if (!a->data().isNull()) {
|
||||
a->setChecked(a->data() == i);
|
||||
}
|
||||
}
|
||||
|
||||
#include <QPushButton>
|
||||
void MenuHelper::set_button_action_checked(QAction *a) {
|
||||
a->setChecked(reinterpret_cast<QPushButton*>(a->data().value<quintptr>())->isChecked());
|
||||
}
|
||||
|
||||
@@ -30,6 +30,34 @@ public:
|
||||
* The menu to add items to.
|
||||
*/
|
||||
void make_inout_menu(QMenu* parent);
|
||||
|
||||
/**
|
||||
* @brief Creates a menu of clip functions
|
||||
*
|
||||
* Adds a set of clip functions including:
|
||||
* * Add Default Transition
|
||||
* * Link/Unlink
|
||||
* * Enable/Disable
|
||||
* * Nest
|
||||
*
|
||||
* @param parent
|
||||
*
|
||||
* The menu to add items to.
|
||||
*/
|
||||
void make_clip_functions_menu(QMenu* parent);
|
||||
|
||||
/**
|
||||
* @brief Creates standard edit menu (cut, copy, paste, etc.)
|
||||
*
|
||||
* @param parent
|
||||
*
|
||||
* The menu to add items to.
|
||||
*/
|
||||
void make_edit_functions_menu(QMenu* parent);
|
||||
|
||||
void set_bool_action_checked(QAction* a);
|
||||
void set_int_action_checked(QAction* a, const int& i);
|
||||
void set_button_action_checked(QAction* a);
|
||||
private slots:
|
||||
|
||||
|
||||
|
||||
+7
-18
@@ -1,29 +1,22 @@
|
||||
#include "timelinewidget.h"
|
||||
|
||||
#include "playback/audio.h"
|
||||
#include "panels/panels.h"
|
||||
#include "project/projectelements.h"
|
||||
|
||||
#include "playback/audio.h"
|
||||
#include "io/config.h"
|
||||
#include "project/sequence.h"
|
||||
#include "project/transition.h"
|
||||
#include "project/clip.h"
|
||||
#include "panels/project.h"
|
||||
#include "panels/timeline.h"
|
||||
#include "project/footage.h"
|
||||
#include "ui/sourcetable.h"
|
||||
#include "ui/sourceiconview.h"
|
||||
#include "panels/effectcontrols.h"
|
||||
#include "panels/viewer.h"
|
||||
#include "project/undo.h"
|
||||
#include "mainwindow.h"
|
||||
#include "ui/viewerwidget.h"
|
||||
#include "dialogs/stabilizerdialog.h"
|
||||
#include "project/media.h"
|
||||
#include "ui/resizablescrollbar.h"
|
||||
#include "dialogs/newsequencedialog.h"
|
||||
#include "mainwindow.h"
|
||||
#include "ui/rectangleselect.h"
|
||||
#include "playback/playback.h"
|
||||
#include "ui/cursors.h"
|
||||
#include "ui/menuhelper.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include "project/effect.h"
|
||||
@@ -123,13 +116,9 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
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);
|
||||
autoscaleAction->setChecked(selected_clips.at(0)->autoscale);
|
||||
|
||||
menu.addAction(tr("Enable/Disable"), Olive::MainWindow, SLOT(toggle_enable_clips()));
|
||||
|
||||
menu.addAction(tr("Link/Unlink"), panel_timeline, SLOT(toggle_links()));
|
||||
|
||||
menu.addAction(tr("&Nest"), Olive::MainWindow, SLOT(nest()));
|
||||
Olive::MenuHelper.make_clip_functions_menu(&menu);
|
||||
|
||||
// stabilizer option
|
||||
/*int video_clip_count = 0;
|
||||
@@ -486,7 +475,7 @@ void TimelineWidget::dropEvent(QDropEvent* event) {
|
||||
// if we're dropping into nothing, create a new sequences based on the clip being dragged
|
||||
if (s == nullptr) {
|
||||
s = self_created_sequence;
|
||||
panel_project->new_sequence(ca, self_created_sequence, true, nullptr);
|
||||
panel_project->create_sequence_internal(ca, self_created_sequence, true, nullptr);
|
||||
self_created_sequence = nullptr;
|
||||
} else if (event->keyboardModifiers() & Qt::ControlModifier) {
|
||||
insert_clips(ca);
|
||||
|
||||
Reference in New Issue
Block a user