From b56bb944f6b48e8071f7b54bb60c777f5a66907d Mon Sep 17 00:00:00 2001 From: Colin Fletcher Date: Tue, 16 Jun 2015 11:23:50 +0100 Subject: Rename 'Cut time' to 'Remove time' 'Cut time' implies that the cut timeline items might end up on the clipboard to be pasted somewhere: this isn't the case at present, so rename the functions, class, &c. to say 'remove' rather than 'cut'. Rename insert_time_dialog.{cc|h} to insert_remove_time_dialog while we're at it. --- gtk2_ardour/ardour.menus.in | 2 +- gtk2_ardour/editor.h | 4 +- gtk2_ardour/editor_actions.cc | 2 +- gtk2_ardour/editor_ops.cc | 13 +-- gtk2_ardour/insert_remove_time_dialog.cc | 167 +++++++++++++++++++++++++++++++ gtk2_ardour/insert_remove_time_dialog.h | 52 ++++++++++ gtk2_ardour/insert_time_dialog.cc | 167 ------------------------------- gtk2_ardour/insert_time_dialog.h | 52 ---------- gtk2_ardour/wscript | 2 +- 9 files changed, 231 insertions(+), 230 deletions(-) create mode 100644 gtk2_ardour/insert_remove_time_dialog.cc create mode 100644 gtk2_ardour/insert_remove_time_dialog.h delete mode 100644 gtk2_ardour/insert_time_dialog.cc delete mode 100644 gtk2_ardour/insert_time_dialog.h (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index 3fe9bb9ea5..086d2b88d7 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -375,7 +375,7 @@ - + diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 619523e8d9..d5645a1e82 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1262,8 +1262,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void do_insert_time (); void insert_time (framepos_t, framecnt_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool, bool); - void do_cut_time (); - void cut_time (framepos_t pos, framecnt_t distance, Editing::InsertTimeOption opt, bool ignore_music_glue, bool markers_too, + void do_remove_time (); + void remove_time (framepos_t pos, framecnt_t distance, Editing::InsertTimeOption opt, bool ignore_music_glue, bool markers_too, bool glued_markers_too, bool locked_markers_too, bool tempo_too); void tab_to_transient (bool forward); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 52e2210481..71ce59406a 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -405,7 +405,7 @@ Editor::register_actions () act = reg_sens (editor_actions, "insert-time", _("Insert Time"), (sigc::mem_fun(*this, &Editor::do_insert_time))); ActionManager::track_selection_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "cut-time", _("Cut Time"), (mem_fun(*this, &Editor::do_cut_time))); + act = ActionManager::register_action (editor_actions, "remove-time", _("Remove Time"), (mem_fun(*this, &Editor::do_remove_time))); ActionManager::session_sensitive_actions.push_back (act); ActionManager::track_selection_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index fe4cf7ecad..2c44508b12 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -76,7 +76,7 @@ #include "editor_regions.h" #include "editor_routes.h" #include "gui_thread.h" -#include "insert_time_dialog.h" +#include "insert_remove_time_dialog.h" #include "interthread_progress_window.h" #include "item_counts.h" #include "keyboard.h" @@ -6926,7 +6926,7 @@ Editor::do_insert_time () return; } - InsertTimeDialog d (*this); + InsertRemoveTimeDialog d (*this); int response = d.run (); if (response != RESPONSE_OK) { @@ -7065,15 +7065,16 @@ Editor::insert_time ( commit_reversible_command (); } } + void -Editor::do_cut_time () +Editor::do_remove_time () { if (selection->tracks.empty()) { return; } framepos_t pos = get_preferred_edit_position (EDIT_IGNORE_MOUSE); - InsertTimeDialog d (*this, true); + InsertRemoveTimeDialog d (*this, true); int response = d.run (); @@ -7087,7 +7088,7 @@ Editor::do_cut_time () return; } - cut_time ( + remove_time ( pos, distance, SplitIntersected, @@ -7100,7 +7101,7 @@ Editor::do_cut_time () } void -Editor::cut_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt, +Editor::remove_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt, bool ignore_music_glue, bool markers_too, bool glued_markers_too, bool locked_markers_too, bool tempo_too) { bool commit = false; diff --git a/gtk2_ardour/insert_remove_time_dialog.cc b/gtk2_ardour/insert_remove_time_dialog.cc new file mode 100644 index 0000000000..58345aed65 --- /dev/null +++ b/gtk2_ardour/insert_remove_time_dialog.cc @@ -0,0 +1,167 @@ +/* + Copyright (C) 2000-2010 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include +#include "insert_remove_time_dialog.h" +#include "audio_clock.h" +#include "i18n.h" + +using namespace Gtk; +using namespace Editing; + +InsertRemoveTimeDialog::InsertRemoveTimeDialog (PublicEditor& e, bool remove) + : ArdourDialog (remove ? _("Remove Time") : _("Insert Time")) + , _editor (e) + , _clock ("insertTimeClock", true, "", true, false, true, false) +{ + set_session (_editor.session ()); + + framepos_t const pos = _editor.get_preferred_edit_position (EDIT_IGNORE_MOUSE); + + get_vbox()->set_border_width (12); + get_vbox()->set_spacing (4); + + Table* table = manage (new Table (2, 2)); + table->set_spacings (4); + + Label* time_label = manage (new Label (remove ? _("Time to remove") : _("Time to insert:"))); + time_label->set_alignment (1, 0.5); + table->attach (*time_label, 0, 1, 0, 1, FILL | EXPAND); + _clock.set (0); + _clock.set_session (_session); + _clock.set_bbt_reference (pos); + table->attach (_clock, 1, 2, 0, 1); + + if (!remove) { + Label* intersected_label = manage (new Label (_("Intersected regions should:"))); + intersected_label->set_alignment (1, 0.5); + table->attach (*intersected_label, 0, 1, 1, 2, FILL | EXPAND); + _intersected_combo.append_text (_("stay in position")); + _intersected_combo.append_text (_("move")); + _intersected_combo.append_text (_("be split")); + _intersected_combo.set_active (0); + table->attach (_intersected_combo, 1, 2, 1, 2); + } + + get_vbox()->pack_start (*table); + + _all_playlists.set_label (_("Apply to all the track's playlists")); + get_vbox()->pack_start (_all_playlists); + + _move_glued.set_label (_("Move glued regions")); + get_vbox()->pack_start (_move_glued); + _move_markers.set_label (_("Move markers")); + get_vbox()->pack_start (_move_markers); + _move_markers.signal_toggled().connect (sigc::mem_fun (*this, &InsertRemoveTimeDialog::move_markers_toggled)); + _move_glued_markers.set_label (_("Move glued markers")); + Alignment* indent = manage (new Alignment); + indent->set_padding (0, 0, 12, 0); + indent->add (_move_glued_markers); + get_vbox()->pack_start (*indent); + _move_locked_markers.set_label (_("Move locked markers")); + indent = manage (new Alignment); + indent->set_padding (0, 0, 12, 0); + indent->add (_move_locked_markers); + get_vbox()->pack_start (*indent); + tempo_label.set_markup (_("Move tempo and meter changes\n(may cause oddities in the tempo map)")); + HBox* tempo_box = manage (new HBox); + tempo_box->set_spacing (6); + tempo_box->pack_start (_move_tempos, false, false); + tempo_box->pack_start (tempo_label, false, false); + get_vbox()->pack_start (*tempo_box); + + add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + add_button (remove ? _("Cut time") : _("Insert time"), Gtk::RESPONSE_OK); + show_all (); + + move_markers_toggled (); +} + +InsertTimeOption +InsertRemoveTimeDialog::intersected_region_action () +{ + /* only setting this to keep GCC quiet */ + InsertTimeOption opt = LeaveIntersected; + + switch (_intersected_combo.get_active_row_number ()) { + case 0: + opt = LeaveIntersected; + break; + case 1: + opt = MoveIntersected; + break; + case 2: + opt = SplitIntersected; + break; + } + + return opt; +} + +bool +InsertRemoveTimeDialog::all_playlists () const +{ + return _all_playlists.get_active (); +} + +bool +InsertRemoveTimeDialog::move_glued () const +{ + return _move_glued.get_active (); +} + +bool +InsertRemoveTimeDialog::move_tempos () const +{ + return _move_tempos.get_active (); +} + +bool +InsertRemoveTimeDialog::move_markers () const +{ + return _move_markers.get_active (); +} + +bool +InsertRemoveTimeDialog::move_glued_markers () const +{ + return _move_glued_markers.get_active (); +} + +bool +InsertRemoveTimeDialog::move_locked_markers () const +{ + return _move_locked_markers.get_active (); +} + +framepos_t +InsertRemoveTimeDialog::distance () const +{ + return _clock.current_duration (_editor.get_preferred_edit_position ()); +} + +void +InsertRemoveTimeDialog::move_markers_toggled () +{ + _move_glued_markers.set_sensitive (_move_markers.get_active ()); + _move_locked_markers.set_sensitive (_move_markers.get_active ()); +} diff --git a/gtk2_ardour/insert_remove_time_dialog.h b/gtk2_ardour/insert_remove_time_dialog.h new file mode 100644 index 0000000000..6fbb575513 --- /dev/null +++ b/gtk2_ardour/insert_remove_time_dialog.h @@ -0,0 +1,52 @@ +/* + Copyright (C) 2000-2010 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "ardour_dialog.h" +#include "public_editor.h" +#include "editing.h" +#include "audio_clock.h" + +class InsertRemoveTimeDialog : public ArdourDialog +{ +public: + InsertRemoveTimeDialog (PublicEditor &, bool remove = false); + + Editing::InsertTimeOption intersected_region_action (); + bool all_playlists () const; + bool move_glued () const; + bool move_markers () const; + bool move_glued_markers () const; + bool move_locked_markers () const; + bool move_tempos () const; + framepos_t distance () const; + +private: + void move_markers_toggled (); + + PublicEditor& _editor; + Gtk::ComboBoxText _intersected_combo; + Gtk::CheckButton _all_playlists; + Gtk::CheckButton _move_glued; + Gtk::CheckButton _move_markers; + Gtk::CheckButton _move_glued_markers; + Gtk::CheckButton _move_locked_markers; + Gtk::CheckButton _move_tempos; + Gtk::Label tempo_label; + AudioClock _clock; +}; diff --git a/gtk2_ardour/insert_time_dialog.cc b/gtk2_ardour/insert_time_dialog.cc deleted file mode 100644 index 731ef60966..0000000000 --- a/gtk2_ardour/insert_time_dialog.cc +++ /dev/null @@ -1,167 +0,0 @@ -/* - Copyright (C) 2000-2010 Paul Davis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include -#include -#include -#include -#include "insert_time_dialog.h" -#include "audio_clock.h" -#include "i18n.h" - -using namespace Gtk; -using namespace Editing; - -InsertTimeDialog::InsertTimeDialog (PublicEditor& e, bool cut) - : ArdourDialog (cut ? _("Cut time") : _("Insert Time")) - , _editor (e) - , _clock ("insertTimeClock", true, "", true, false, true, false) -{ - set_session (_editor.session ()); - - framepos_t const pos = _editor.get_preferred_edit_position (EDIT_IGNORE_MOUSE); - - get_vbox()->set_border_width (12); - get_vbox()->set_spacing (4); - - Table* table = manage (new Table (2, 2)); - table->set_spacings (4); - - Label* time_label = manage (new Label (cut ? _("Time to cut") : _("Time to insert:"))); - time_label->set_alignment (1, 0.5); - table->attach (*time_label, 0, 1, 0, 1, FILL | EXPAND); - _clock.set (0); - _clock.set_session (_session); - _clock.set_bbt_reference (pos); - table->attach (_clock, 1, 2, 0, 1); - - if (!cut) { - Label* intersected_label = manage (new Label (_("Intersected regions should:"))); - intersected_label->set_alignment (1, 0.5); - table->attach (*intersected_label, 0, 1, 1, 2, FILL | EXPAND); - _intersected_combo.append_text (_("stay in position")); - _intersected_combo.append_text (_("move")); - _intersected_combo.append_text (_("be split")); - _intersected_combo.set_active (0); - table->attach (_intersected_combo, 1, 2, 1, 2); - } - - get_vbox()->pack_start (*table); - - _all_playlists.set_label (_("Apply to all the track's playlists")); - get_vbox()->pack_start (_all_playlists); - - _move_glued.set_label (_("Move glued regions")); - get_vbox()->pack_start (_move_glued); - _move_markers.set_label (_("Move markers")); - get_vbox()->pack_start (_move_markers); - _move_markers.signal_toggled().connect (sigc::mem_fun (*this, &InsertTimeDialog::move_markers_toggled)); - _move_glued_markers.set_label (_("Move glued markers")); - Alignment* indent = manage (new Alignment); - indent->set_padding (0, 0, 12, 0); - indent->add (_move_glued_markers); - get_vbox()->pack_start (*indent); - _move_locked_markers.set_label (_("Move locked markers")); - indent = manage (new Alignment); - indent->set_padding (0, 0, 12, 0); - indent->add (_move_locked_markers); - get_vbox()->pack_start (*indent); - tempo_label.set_markup (_("Move tempo and meter changes\n(may cause oddities in the tempo map)")); - HBox* tempo_box = manage (new HBox); - tempo_box->set_spacing (6); - tempo_box->pack_start (_move_tempos, false, false); - tempo_box->pack_start (tempo_label, false, false); - get_vbox()->pack_start (*tempo_box); - - add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - add_button (cut ? _("Cut time") : _("Insert time"), Gtk::RESPONSE_OK); - show_all (); - - move_markers_toggled (); -} - -InsertTimeOption -InsertTimeDialog::intersected_region_action () -{ - /* only setting this to keep GCC quiet */ - InsertTimeOption opt = LeaveIntersected; - - switch (_intersected_combo.get_active_row_number ()) { - case 0: - opt = LeaveIntersected; - break; - case 1: - opt = MoveIntersected; - break; - case 2: - opt = SplitIntersected; - break; - } - - return opt; -} - -bool -InsertTimeDialog::all_playlists () const -{ - return _all_playlists.get_active (); -} - -bool -InsertTimeDialog::move_glued () const -{ - return _move_glued.get_active (); -} - -bool -InsertTimeDialog::move_tempos () const -{ - return _move_tempos.get_active (); -} - -bool -InsertTimeDialog::move_markers () const -{ - return _move_markers.get_active (); -} - -bool -InsertTimeDialog::move_glued_markers () const -{ - return _move_glued_markers.get_active (); -} - -bool -InsertTimeDialog::move_locked_markers () const -{ - return _move_locked_markers.get_active (); -} - -framepos_t -InsertTimeDialog::distance () const -{ - return _clock.current_duration (_editor.get_preferred_edit_position ()); -} - -void -InsertTimeDialog::move_markers_toggled () -{ - _move_glued_markers.set_sensitive (_move_markers.get_active ()); - _move_locked_markers.set_sensitive (_move_markers.get_active ()); -} diff --git a/gtk2_ardour/insert_time_dialog.h b/gtk2_ardour/insert_time_dialog.h deleted file mode 100644 index 9443691a92..0000000000 --- a/gtk2_ardour/insert_time_dialog.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2000-2010 Paul Davis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include "ardour_dialog.h" -#include "public_editor.h" -#include "editing.h" -#include "audio_clock.h" - -class InsertTimeDialog : public ArdourDialog -{ -public: - InsertTimeDialog (PublicEditor &, bool cut = false); - - Editing::InsertTimeOption intersected_region_action (); - bool all_playlists () const; - bool move_glued () const; - bool move_markers () const; - bool move_glued_markers () const; - bool move_locked_markers () const; - bool move_tempos () const; - framepos_t distance () const; - -private: - void move_markers_toggled (); - - PublicEditor& _editor; - Gtk::ComboBoxText _intersected_combo; - Gtk::CheckButton _all_playlists; - Gtk::CheckButton _move_glued; - Gtk::CheckButton _move_markers; - Gtk::CheckButton _move_glued_markers; - Gtk::CheckButton _move_locked_markers; - Gtk::CheckButton _move_tempos; - Gtk::Label tempo_label; - AudioClock _clock; -}; diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 84db23987f..60d99a648d 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -106,7 +106,7 @@ gtk2_ardour_sources = [ 'group_tabs.cc', 'gtk_pianokeyboard.c', 'gui_object.cc', - 'insert_time_dialog.cc', + 'insert_remove_time_dialog.cc', 'instrument_selector.cc', 'interthread_progress_window.cc', 'io_selector.cc', -- cgit v1.2.3