diff --git a/gtk2_ardour/ambiguous_file_dialog.cc b/gtk2_ardour/ambiguous_file_dialog.cc index fe17cde5b1..0eae3617c5 100644 --- a/gtk2_ardour/ambiguous_file_dialog.cc +++ b/gtk2_ardour/ambiguous_file_dialog.cc @@ -41,7 +41,7 @@ AmbiguousFileDialog::AmbiguousFileDialog (const string& file, const vectorpack_start (*manage (new Label (_("\n\nPlease select the path that you want to get the file from.")))); - + add_button (_("Done"), RESPONSE_OK); show_all (); diff --git a/gtk2_ardour/ambiguous_file_dialog.h b/gtk2_ardour/ambiguous_file_dialog.h index ea20b42151..796f490e79 100644 --- a/gtk2_ardour/ambiguous_file_dialog.h +++ b/gtk2_ardour/ambiguous_file_dialog.h @@ -32,4 +32,4 @@ private: std::vector _radio_buttons; }; - + diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index d53e441fd2..1a22db660a 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -175,7 +175,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) auditioning_alert_button (_("AUDITION")), solo_alert_button (_("SOLO")), - + error_log_button (_("Errors")) { @@ -259,7 +259,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) ARDOUR::Session::AskAboutSampleRateMismatch.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::sr_mismatch_dialog, this, _1, _2)); /* handle requests to quit (coming from JACK session) */ - + ARDOUR::Session::Quit.connect (forever_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::finish, this), gui_context ()); /* handle requests to deal with missing files */ @@ -309,11 +309,11 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) TimeAxisViewItem::set_constant_heights (); /* The following must happen after ARDOUR::init() so that Config is set up */ - + location_ui = new ActionWindowProxy (X_("locations"), Config->extra_xml (X_("UI")), X_("ToggleLocations")); big_clock_window = new ActionWindowProxy (X_("bigclock"), Config->extra_xml (X_("UI")), X_("ToggleBigClock")); speaker_config_window = new ActionWindowProxy (X_("speakerconf"), Config->extra_xml (X_("UI")), X_("toggle-speaker-config")); - + for (ARDOUR::DataType::iterator i = ARDOUR::DataType::begin(); i != ARDOUR::DataType::end(); ++i) { _global_port_matrix[*i] = new ActionWindowProxy ( string_compose ("GlobalPortMatrix-%1", (*i).to_string()), @@ -327,7 +327,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) SpeakerDialog* s = new SpeakerDialog (); s->signal_unmap().connect (sigc::bind (sigc::ptr_fun (&ActionManager::uncheck_toggleaction), X_("/Common/toggle-speaker-config"))); speaker_config_window->set (s); - + starting.connect (sigc::mem_fun(*this, &ARDOUR_UI::startup)); stopping.connect (sigc::mem_fun(*this, &ARDOUR_UI::shutdown)); } @@ -340,7 +340,7 @@ ARDOUR_UI::run_startup (bool should_be_new, string load_template) _startup = new ArdourStartup (); XMLNode* audio_setup = Config->extra_xml ("AudioSetup"); - + if (audio_setup && _startup->engine_control()) { _startup->engine_control()->set_state (*audio_setup); } @@ -409,7 +409,7 @@ ARDOUR_UI::post_engine () if (setup_windows ()) { throw failed_constructor (); } - + check_memory_locking(); /* this is the first point at which all the keybindings are available */ @@ -712,7 +712,7 @@ ARDOUR_UI::startup () for (ARDOUR::DataType::iterator i = ARDOUR::DataType::begin(); i != ARDOUR::DataType::end(); ++i) { add_window_proxy (_global_port_matrix[*i]); } - + BootMessage (string_compose (_("%1 is ready for use"), PROGRAM_NAME)); } @@ -1588,7 +1588,7 @@ ARDOUR_UI::transport_record (bool roll) //cerr << "ARDOUR_UI::transport_record () called roll = " << roll << " _session->record_status() = " << _session->record_status() << endl; } -void +void ARDOUR_UI::transport_roll () { if (!_session) { @@ -1637,7 +1637,7 @@ ARDOUR_UI::transport_roll () void ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode) { - + if (!_session) { return; } @@ -1664,7 +1664,7 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode) /* drop out of loop/range playback but leave transport rolling */ if (_session->get_play_loop()) { if (Config->get_seamless_loop()) { - /* the disk buffers contain copies of the loop - we can't + /* the disk buffers contain copies of the loop - we can't just keep playing, so stop the transport. the user can restart as they wish. */ @@ -1677,8 +1677,8 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode) } else if (_session->get_play_range ()) { affect_transport = false; _session->request_play_range (0, true); - } - } + } + } if (affect_transport) { if (rolling) { @@ -1687,7 +1687,7 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode) if (join_play_range_button.get_active()) { _session->request_play_range (&editor->get_selection().time, true); } - + _session->request_transport_speed (1.0f); } } @@ -1699,25 +1699,25 @@ ARDOUR_UI::toggle_session_auto_loop () if (!_session) { return; } - + if (_session->get_play_loop()) { if (_session->transport_rolling()) { - + Location * looploc = _session->locations()->auto_loop_location(); - + if (looploc) { _session->request_locate (looploc->start(), true); _session->request_play_loop (false); } - + } else { _session->request_play_loop (false); } } else { - + Location * looploc = _session->locations()->auto_loop_location(); - + if (looploc) { _session->request_play_loop (true); } @@ -1837,13 +1837,13 @@ ARDOUR_UI::map_transport_state () auto_loop_button.set_visual_state (0); } else if (_session->get_play_loop ()) { - + auto_loop_button.set_visual_state (1); play_selection_button.set_visual_state (0); roll_button.set_visual_state (0); } else { - + roll_button.set_visual_state (1); play_selection_button.set_visual_state (0); auto_loop_button.set_visual_state (0); @@ -2081,7 +2081,7 @@ ARDOUR_UI::snapshot_session (bool switch_to_it) char timebuf[128]; time_t n; struct tm local_time; - + time (&n); localtime_r (&n, &local_time); strftime (timebuf, sizeof(timebuf), "%FT%T", &local_time); @@ -2151,7 +2151,7 @@ ARDOUR_UI::save_state (const string & name, bool switch_to_it) } _session->add_extra_xml (*node); - + save_state_canfail (name, switch_to_it); } @@ -2559,7 +2559,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri /* not connected to the AudioEngine, so quit to avoid an infinite loop */ exit (1); } - + if (!ARDOUR_COMMAND_LINE::immediate_save.empty()) { _session->save_state (ARDOUR_COMMAND_LINE::immediate_save, false); exit (1); @@ -2992,7 +2992,7 @@ ARDOUR_UI::cleanup () (Gtk::ButtonsType)(Gtk::BUTTONS_NONE)); checker.set_title (_("Clean-up")); - + checker.set_secondary_text(_("Clean-up is a destructive operation.\n\ ALL undo/redo information will be lost if you clean-up.\n\ Clean-up will move all unused files to a \"dead\" location.")); @@ -3183,7 +3183,7 @@ ARDOUR_UI::editor_settings () const } else { node = Config->instant_xml(X_("Editor")); } - + if (!node) { if (getenv("ARDOUR_INSTANT_XML_PATH")) { node = Config->instant_xml(getenv("ARDOUR_INSTANT_XML_PATH")); diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 283bcbe915..423189c3ed 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -214,7 +214,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr uint32_t how_many, std::string const & name_template ) { - + session_add_audio_route (true, input_channels, output_channels, mode, route_group, how_many, name_template); } @@ -225,7 +225,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr uint32_t how_many, std::string const & name_template ) { - + session_add_audio_route (false, input_channels, output_channels, ARDOUR::Normal, route_group, how_many, name_template); } @@ -234,7 +234,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr uint32_t how_many, std::string const & name_template ) { - + session_add_midi_route (true, route_group, how_many, name_template); } @@ -611,7 +611,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr /* Keyboard Handling */ ArdourKeyboard* keyboard; - + /* Keymap handling */ void install_actions (); diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index 3e3f8a1506..2cbd70ed37 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -195,7 +195,7 @@ XMLNode* ARDOUR_UI::tearoff_settings (const char* name) const { XMLNode* ui_node = Config->extra_xml(X_("UI")); - + if (ui_node) { XMLNode* tearoff_node = ui_node->child (X_("Tearoffs")); if (tearoff_node) { diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index f7e6a89eb0..3f819829b9 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -117,13 +117,13 @@ ARDOUR_UI::toggle_mixer_window () } Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); - + if (tact->get_active()) { goto_mixer_window (); } else { mixer->hide (); } -} +} void ARDOUR_UI::toggle_mixer_on_top () @@ -134,19 +134,19 @@ ARDOUR_UI::toggle_mixer_on_top () } Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); - + if (tact->get_active()) { /* Toggle the mixer to `visible' if required */ act = ActionManager::get_action (X_("Common"), X_("toggle-mixer")); if (act) { tact = Glib::RefPtr::cast_dynamic (act); - + if (!tact->get_active()) { tact->set_active (); } } - + goto_mixer_window (); } else { goto_editor_window (); diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 5b53b37a92..712c3da99b 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -97,7 +97,7 @@ ARDOUR_UI::set_session (Session *s) big_clock.set_session (s); preroll_clock.set_session (s); postroll_clock.set_session (s); - + /* sensitize menu bar options that are now valid */ ActionManager::set_sensitive (ActionManager::session_sensitive_actions, true); diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 9a9e2484bf..b762348f1d 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -161,7 +161,7 @@ ARDOUR_UI::install_actions () act = ActionManager::register_action (main_actions, X_("ExportAudio"), _("Export To Audio File(s)..."), sigc::mem_fun (*editor, &PublicEditor::export_audio)); ActionManager::session_sensitive_actions.push_back (act); - + act = ActionManager::register_action (main_actions, X_("StemExport"), _("Stem export..."), sigc::mem_fun (*editor, &PublicEditor::stem_export)); ActionManager::session_sensitive_actions.push_back (act); @@ -616,7 +616,7 @@ ARDOUR_UI::big_clock_realized () Pango::FontDescription fd (big_clock.get_style()->get_font()); original_big_clock_font_size = fd.get_size (); - + if (!fd.get_size_is_absolute ()) { original_big_clock_font_size /= PANGO_SCALE; } @@ -661,7 +661,7 @@ ARDOUR_UI::idle_big_clock_text_resizer (int, int) win->get_geometry (x, y, w, h, d); - double scale = min (((double) w / (double) original_big_clock_width), + double scale = min (((double) w / (double) original_big_clock_width), ((double) h / (double) original_big_clock_height)); int size = (int) lrintf (original_big_clock_font_size * scale); @@ -671,14 +671,14 @@ ARDOUR_UI::idle_big_clock_text_resizer (int, int) string family = fd.get_family(); char buf[family.length()+16]; snprintf (buf, family.length()+16, "%s %d", family.c_str(), size); - - try { + + try { Pango::FontDescription fd (buf); Glib::RefPtr rcstyle = big_clock.get_modifier_style (); rcstyle->set_font (fd); big_clock.modify_style (rcstyle); - } - + } + catch (...) { /* oh well, do nothing */ } @@ -709,7 +709,7 @@ ARDOUR_UI::save_ardour_state () window_node->add_child_nocopy (*((*i)->get_state ())); } } - + /* tearoffs */ XMLNode* tearoff_node = new XMLNode (X_("Tearoffs")); @@ -718,20 +718,20 @@ ARDOUR_UI::save_ardour_state () XMLNode* t = new XMLNode (X_("transport")); transport_tearoff->add_state (*t); tearoff_node->add_child_nocopy (*t); - } + } if (mixer && mixer->monitor_section()) { XMLNode* t = new XMLNode (X_("monitor-section")); mixer->monitor_section()->tearoff().add_state (*t); tearoff_node->add_child_nocopy (*t); - } + } if (editor && editor->mouse_mode_tearoff()) { XMLNode* t = new XMLNode (X_("mouse-mode")); editor->mouse_mode_tearoff ()->add_state (*t); tearoff_node->add_child_nocopy (*t); - } - + } + window_node->add_child_nocopy (*tearoff_node); Config->add_extra_xml (*window_node); @@ -760,7 +760,7 @@ void ARDOUR_UI::toggle_global_port_matrix (ARDOUR::DataType t) { std::string const action = string_compose ("toggle-%1-connection-manager", t.to_string ()); - + if (_global_port_matrix[t]->get() == 0) { _global_port_matrix[t]->set (new GlobalPortMatrixWindow (_session, t)); _global_port_matrix[t]->get()->signal_unmap().connect(sigc::bind (sigc::ptr_fun (&ActionManager::uncheck_toggleaction), string_compose (X_("/Common/%1"), action))); diff --git a/gtk2_ardour/ardour_ui_mixer.cc b/gtk2_ardour/ardour_ui_mixer.cc index c969afa33f..b6983cd8ac 100644 --- a/gtk2_ardour/ardour_ui_mixer.cc +++ b/gtk2_ardour/ardour_ui_mixer.cc @@ -45,7 +45,7 @@ ARDOUR_UI::create_mixer () mixer->signal_window_state_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::main_window_state_event_handler), false)); mixer->signal_unmap().connect (sigc::bind (sigc::ptr_fun (&ActionManager::uncheck_toggleaction), X_("/Common/toggle-mixer"))); mixer->signal_unmap().connect (sigc::bind (sigc::ptr_fun (&ActionManager::uncheck_toggleaction), X_("/Common/toggle-mixer-on-top"))); - + return 0; } diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc index a0d106fe35..5bcecfaef5 100644 --- a/gtk2_ardour/ardour_ui_options.cc +++ b/gtk2_ardour/ardour_ui_options.cc @@ -51,7 +51,7 @@ void ARDOUR_UI::toggle_keep_tearoffs () { ActionManager::toggle_config_state ("Common", "KeepTearoffs", &RCConfiguration::set_keep_tearoffs, &RCConfiguration::get_keep_tearoffs); - + ARDOUR_UI::toggle_editing_space (); } @@ -68,7 +68,7 @@ when the pull up/down setting is non-zero.")); return; } } - + ActionManager::toggle_config_state_foo ("Transport", "ToggleExternalSync", sigc::mem_fun (_session->config, &SessionConfiguration::set_external_sync), sigc::mem_fun (_session->config, &SessionConfiguration::get_external_sync)); } } @@ -240,12 +240,12 @@ ARDOUR_UI::show_loop_punch_ruler_and_disallow_hide () } act->set_sensitive (false); - + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); if (!tact) { return; } - + if (!tact->get_active()) { tact->set_active (); } @@ -336,7 +336,7 @@ ARDOUR_UI::parameter_changed (std::string p) ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (false); ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false); } - + } else if (p == "send-mtc") { ActionManager::map_some_state ("options", "SendMTC", &RCConfiguration::get_send_mtc); diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 6ab075b0ec..c8d17d5e8b 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -67,7 +67,7 @@ const uint32_t AudioClock::field_length[(int) AudioClock::AudioFrames+1] = { 10 /* Audio Frame */ }; -AudioClock::AudioClock (const string& clock_name, bool transient, const string& widget_name, +AudioClock::AudioClock (const string& clock_name, bool transient, const string& widget_name, bool allow_edit, bool follows_playhead, bool duration, bool with_info) : _name (clock_name), is_transient (transient), @@ -87,7 +87,7 @@ AudioClock::AudioClock (const string& clock_name, bool transient, const string& _canonical_time (0) { /* XXX: these are leaked, but I don't suppose it's the end of the world */ - + _eboxes[Timecode_Hours] = new EventBox; _eboxes[Timecode_Minutes] = new EventBox; _eboxes[Timecode_Seconds] = new EventBox; @@ -113,7 +113,7 @@ AudioClock::AudioClock (const string& clock_name, bool transient, const string& _labels[Beats] = new Label; _labels[Ticks] = new Label; _labels[AudioFrames] = new Label; - + last_when = 0; last_pdelta = 0; last_sdelta = 0; @@ -283,7 +283,7 @@ void AudioClock::setup_events () { clock_base.set_flags (CAN_FOCUS); - + for (std::map::iterator i = _eboxes.begin(); i != _eboxes.end(); ++i) { i->second->add_events ( Gdk::BUTTON_PRESS_MASK | @@ -293,7 +293,7 @@ AudioClock::setup_events () Gdk::FOCUS_CHANGE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::SCROLL_MASK); - + i->second->set_flags (CAN_FOCUS); i->second->signal_motion_notify_event().connect (sigc::bind (sigc::mem_fun (*this, &AudioClock::field_motion_notify_event), i->first)); i->second->signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &AudioClock::field_button_press_event), i->first)); @@ -393,7 +393,7 @@ AudioClock::session_configuration_changed (std::string p) if (p != "timecode-offset" && p != "timecode-offset-negative") { return; } - + framecnt_t current; switch (_mode) { @@ -1159,7 +1159,7 @@ AudioClock::current_time (framepos_t pos) const if (!_canonical_time_is_displayed) { return _canonical_time; } - + framepos_t ret = 0; switch (_mode) { @@ -1770,7 +1770,7 @@ AudioClock::locate () if (!_session || is_duration) { return; } - + _session->request_locate (current_time(), _session->transport_rolling ()); } @@ -1909,7 +1909,7 @@ AudioClock::set_is_duration (bool yn) if (yn == is_duration) { return; } - + is_duration = yn; set (last_when, true, 0, 's'); } diff --git a/gtk2_ardour/audio_clock.h b/gtk2_ardour/audio_clock.h index 87cb127dd6..f218154235 100644 --- a/gtk2_ardour/audio_clock.h +++ b/gtk2_ardour/audio_clock.h @@ -44,7 +44,7 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr Off }; - AudioClock (const std::string& clock_name, bool is_transient, const std::string& widget_name, + AudioClock (const std::string& clock_name, bool is_transient, const std::string& widget_name, bool editable, bool follows_playhead, bool duration = false, bool with_info = false); Mode mode() const { return _mode; } diff --git a/gtk2_ardour/audio_region_editor.cc b/gtk2_ardour/audio_region_editor.cc index 806659b52c..b0767604c9 100644 --- a/gtk2_ardour/audio_region_editor.cc +++ b/gtk2_ardour/audio_region_editor.cc @@ -74,14 +74,14 @@ AudioRegionEditor::AudioRegionEditor (Session* s, boost::shared_ptr b->set_spacing (6); b->pack_start (_peak_amplitude); b->pack_start (*Gtk::manage (new Gtk::Label (_("dBFS"))), false, false); - + _peak_amplitude_label.set_name ("AudioRegionEditorLabel"); _peak_amplitude_label.set_text (_("Peak amplitude:")); _peak_amplitude_label.set_alignment (1, 0.5); _table.attach (_peak_amplitude_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); _table.attach (*b, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); ++_table_row; - + gain_changed (); gain_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &AudioRegionEditor::gain_adjustment_changed)); @@ -106,7 +106,7 @@ void AudioRegionEditor::region_changed (const PBD::PropertyChange& what_changed) { RegionEditor::region_changed (what_changed); - + if (what_changed.contains (ARDOUR::Properties::scale_amplitude)) { gain_changed (); } diff --git a/gtk2_ardour/audio_region_editor.h b/gtk2_ardour/audio_region_editor.h index 5c9e56d923..dd65a3fb31 100644 --- a/gtk2_ardour/audio_region_editor.h +++ b/gtk2_ardour/audio_region_editor.h @@ -57,14 +57,14 @@ class AudioRegionEditor : public RegionEditor ~AudioRegionEditor (); void peak_amplitude_thread (); - + private: void region_changed (PBD::PropertyChange const &); - + void gain_changed (); void gain_adjustment_changed (); - + boost::shared_ptr _audio_region; Gtk::Label gain_label; diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 2a1b8d1e44..4729024159 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -168,7 +168,7 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd) fade_out_handle->property_outline_pixels() = 0; fade_out_handle->set_data ("regionview", this); - + fade_position_line = new ArdourCanvas::SimpleLine (*group); fade_position_line->property_color_rgba() = 0xBBBBBBAA; fade_position_line->property_y1() = 7; @@ -377,11 +377,11 @@ AudioRegionView::region_resized (const PropertyChange& what_changed) } } } - + /* hide transient lines that extend beyond the region end */ list >::iterator l; - + for (l = feature_lines.begin(); l != feature_lines.end(); ++l) { if (l->first > _region->length() - 1) { l->second->hide(); @@ -405,7 +405,7 @@ AudioRegionView::reset_width_dependent_items (double pixel_width) } else { fade_in_handle->show(); - fade_out_handle->show(); + fade_out_handle->show(); } } @@ -415,9 +415,9 @@ AudioRegionView::reset_width_dependent_items (double pixel_width) list >::iterator l; for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) { - + float x_pos = trackview.editor().frame_to_pixel (*i); - + ArdourCanvas::Points points; points.push_back(Gnome::Art::Point(x_pos, 2.0)); // first x-coord needs to be a non-normal value points.push_back(Gnome::Art::Point(x_pos, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1)); @@ -425,7 +425,7 @@ AudioRegionView::reset_width_dependent_items (double pixel_width) (*l).first = *i; (*l).second->property_points() = points; } - + reset_fade_shapes (); } @@ -498,16 +498,16 @@ AudioRegionView::set_height (gdouble height) } reset_fade_shapes (); - + /* Update hights for any active feature lines */ list >::iterator l; - + for (l = feature_lines.begin(); l != feature_lines.end(); ++l) { float pos_x = trackview.editor().frame_to_pixel((*l).first); ArdourCanvas::Points points; - + points.push_back(Gnome::Art::Point(pos_x, 2.0)); // first x-coord needs to be a non-normal value points.push_back(Gnome::Art::Point(pos_x, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1)); @@ -1007,7 +1007,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev) gain_line->view_to_model_coord (x, y); - /* XXX STATEFUL: can't convert to stateful diff until we + /* XXX STATEFUL: can't convert to stateful diff until we can represent automation data with it. */ @@ -1268,7 +1268,7 @@ AudioRegionView::set_frame_color () } TimeAxisViewItem::set_frame_color (); - + uint32_t wc; uint32_t fc; @@ -1387,9 +1387,9 @@ AudioRegionView::transients_changed () while (feature_lines.size() < analysis_features.size()) { ArdourCanvas::Line* canvas_item = new ArdourCanvas::Line(*group); - + ArdourCanvas::Points points; - + points.push_back(Gnome::Art::Point(-1.0, 2.0)); // first x-coord needs to be a non-normal value points.push_back(Gnome::Art::Point(1.0, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1)); @@ -1404,11 +1404,11 @@ AudioRegionView::transients_changed () canvas_item->raise_to_top (); canvas_item->show (); - + canvas_item->set_data ("regionview", this); canvas_item->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_feature_line_event), canvas_item, this)); - - feature_lines.push_back (make_pair(0, canvas_item)); + + feature_lines.push_back (make_pair(0, canvas_item)); } while (feature_lines.size() > analysis_features.size()) { @@ -1419,20 +1419,20 @@ AudioRegionView::transients_changed () AnalysisFeatureList::const_iterator i; list >::iterator l; - + for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) { ArdourCanvas::Points points; float *pos = new float; *pos = trackview.editor().frame_to_pixel (*i); - + points.push_back(Gnome::Art::Point(*pos, 2.0)); // first x-coord needs to be a non-normal value points.push_back(Gnome::Art::Point(*pos, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1)); (*l).second->property_points() = points; (*l).second->set_data ("position", pos); - + (*l).first = *i; } } @@ -1446,16 +1446,16 @@ AudioRegionView::update_transient(float /*old_pos*/, float new_pos) for (l = feature_lines.begin(); l != feature_lines.end(); ++l) { /* Line has been updated in drag so we compare to new_pos */ - + float* pos = (float*) (*l).second->get_data ("position"); - - if (rint(new_pos) == rint(*pos)) { - + + if (rint(new_pos) == rint(*pos)) { + framepos_t old_frame = (*l).first; framepos_t new_frame = trackview.editor().pixel_to_frame (new_pos); _region->update_transient (old_frame, new_frame); - + break; } } @@ -1473,7 +1473,7 @@ AudioRegionView::remove_transient(float pos) float *line_pos = (float*) (*l).second->get_data ("position"); if (rint(pos) == rint(*line_pos)) { - _region->remove_transient ((*l).first); + _region->remove_transient ((*l).first); break; } } diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h index ec1986ca65..cfd64b16a4 100644 --- a/gtk2_ardour/audio_region_view.h +++ b/gtk2_ardour/audio_region_view.h @@ -101,13 +101,13 @@ class AudioRegionView : public RegionView void reset_fade_in_shape_width (framecnt_t); void reset_fade_out_shape_width (framecnt_t); - + void show_fade_line(framepos_t pos); void hide_fade_line(); - + void set_fade_visibility (bool); void update_coverage_frames (LayerDisplay); - + void update_transient(float old_pos, float new_pos); void remove_transient(float pos); @@ -124,33 +124,33 @@ class AudioRegionView : public RegionView to specify their visibility requirements to the TimeAxisViewItem parent class */ - + enum Flags { EnvelopeVisible = 0x1, WaveformVisible = 0x4, WaveformRectified = 0x8, WaveformLogScaled = 0x10, }; - + std::vector waves; std::vector tmp_waves; ///< see ::create_waves() std::list > feature_lines; - + ArdourCanvas::Polygon* sync_mark; ///< polgyon for sync position ArdourCanvas::Polygon* fade_in_shape; ArdourCanvas::Polygon* fade_out_shape; ArdourCanvas::SimpleRect* fade_in_handle; ///< fade in handle, or 0 ArdourCanvas::SimpleRect* fade_out_handle; ///< fade out handle, or 0 ArdourCanvas::SimpleLine* fade_position_line; - + AudioRegionGainLine * gain_line; - + double _amplitude_above_axis; - + uint32_t _flags; uint32_t fade_color; - + void reset_fade_shapes (); void reset_fade_in_shape (); void reset_fade_out_shape (); @@ -158,33 +158,33 @@ class AudioRegionView : public RegionView void fade_out_changed (); void fade_in_active_changed (); void fade_out_active_changed (); - + void region_resized (const PBD::PropertyChange&); void region_muted (); void region_scale_amplitude_changed (); void region_renamed (); - + void create_one_wave (uint32_t, bool); void peaks_ready_handler (uint32_t); void set_flags (XMLNode *); void store_flags (); - + void set_colors (); void compute_colors (Gdk::Color const &); void reset_width_dependent_items (double pixel_width); void set_waveview_data_src(); void set_frame_color (); - + void color_handler (); - + std::vector wave_caches; - + void transients_changed(); - + private: - + void setup_fade_handle_positions (); - + /** A ScopedConnection for each PeaksReady callback (one per channel). Each member * may be 0 if no connection exists. */ diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index f1dda10516..1dda45fdce 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -121,7 +121,7 @@ AudioStreamView::create_region_view (boost::shared_ptr r, bool wait_for_ if (recording) { region_view = new AudioRegionView (_canvas_group, _trackview, region, _samples_per_unit, region_color, recording, TimeAxisViewItem::Visibility( - TimeAxisViewItem::ShowFrame | + TimeAxisViewItem::ShowFrame | TimeAxisViewItem::HideFrameRight | TimeAxisViewItem::HideFrameLeft | TimeAxisViewItem::HideFrameTB)); @@ -163,7 +163,7 @@ RegionView* AudioStreamView::add_region_view_internal (boost::shared_ptr r, bool wait_for_waves, bool recording) { RegionView *region_view = create_region_view (r, wait_for_waves, recording); - + if (region_view == 0) { return 0; } @@ -483,8 +483,8 @@ AudioStreamView::setup_rec_box () + _trackview.track()->get_captured_frames(rec_regions.size()-1); } - PropertyList plist; - + PropertyList plist; + plist.add (Properties::start, start); plist.add (Properties::length, 1); plist.add (Properties::name, string()); @@ -636,44 +636,44 @@ AudioStreamView::update_rec_regions (framepos_t start, framecnt_t cnt) if (!Config->get_show_waveforms_while_recording ()) { return; } - + uint32_t n = 0; - + for (list,RegionView*> >::iterator iter = rec_regions.begin(); iter != rec_regions.end(); n++) { - + list,RegionView*> >::iterator tmp = iter; ++tmp; assert (n < rec_rects.size()); - + if (!canvas_item_visible (rec_rects[n].rectangle)) { /* rect already hidden, this region is done */ iter = tmp; continue; } - + boost::shared_ptr region = boost::dynamic_pointer_cast(iter->first); - + if (!region) { iter = tmp; continue; } - + framecnt_t origlen = region->length(); if (region == rec_regions.back().first && rec_active) { - + if (last_rec_data_frame > region->start()) { - + framecnt_t nlen = last_rec_data_frame - region->start(); - + if (nlen != region->length()) { region->suspend_property_changes (); region->set_position (_trackview.track()->get_capture_start_frame(n)); region->set_length (nlen); region->resume_property_changes (); - + if (origlen == 1) { /* our special initial length */ add_region_view_internal (region, false, true); @@ -681,7 +681,7 @@ AudioStreamView::update_rec_regions (framepos_t start, framecnt_t cnt) } check_record_layers (region, (region->position() - region->start() + start + cnt)); - + /* also update rect */ ArdourCanvas::SimpleRect * rect = rec_rects[n].rectangle; gdouble xend = _trackview.editor().frame_to_pixel (region->position() + region->length()); @@ -689,11 +689,11 @@ AudioStreamView::update_rec_regions (framepos_t start, framecnt_t cnt) } } else { - + framecnt_t nlen = _trackview.track()->get_captured_frames(n); - + if (nlen != region->length()) { - + if (region->source_length(0) >= region->start() + nlen) { region->suspend_property_changes (); @@ -843,7 +843,7 @@ void AudioStreamView::horizontal_position_changed () { /* we only `draw' the bit of the curve that is visible, so we need to update here */ - + for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) { i->second->horizontal_position_changed (); } diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index 2480c87967..763c9a5575 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -109,7 +109,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session* sess, boost::sh } if (_route->panner()) { - _route->panner_shell()->Changed.connect (*this, invalidator (*this), + _route->panner_shell()->Changed.connect (*this, invalidator (*this), boost::bind (&AudioTimeAxisView::ensure_pan_views, this, false), gui_context()); } @@ -202,7 +202,7 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool ensure_pan_views (show); } else if (param.type() == PluginAutomation) { - + /* handled elsewhere */ } else { @@ -241,8 +241,8 @@ AudioTimeAxisView::ensure_pan_views (bool show) boost::shared_ptr t ( new AutomationTimeAxisView (_session, - _route, - _route->pannable(), + _route, + _route->pannable(), pan_control, pan_control->parameter (), _editor, @@ -301,7 +301,7 @@ AudioTimeAxisView::update_pan_track_visibility () (*i)->hide (); (*i)->get_state_node()->add_property ("shown", X_("no")); } - + /* now trigger a redisplay */ if (!no_redraw) { _route->gui_changed (X_("visible_tracks"), (void *) 0); /* EMIT_SIGNAL */ @@ -316,13 +316,13 @@ AudioTimeAxisView::show_all_automation (bool apply_to_selection) if (apply_to_selection) { _editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::show_all_automation, _1, false)); } else { - + no_redraw = true; - + RouteTimeAxisView::show_all_automation (); no_redraw = false; - + _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */ } } @@ -334,11 +334,11 @@ AudioTimeAxisView::show_existing_automation (bool apply_to_selection) _editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::show_existing_automation, _1, false)); } else { no_redraw = true; - + RouteTimeAxisView::show_existing_automation (); - + no_redraw = false; - + _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */ } } @@ -350,9 +350,9 @@ AudioTimeAxisView::hide_all_automation (bool apply_to_selection) _editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::hide_all_automation, _1, false)); } else { no_redraw = true; - + RouteTimeAxisView::hide_all_automation(); - + no_redraw = false; _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */ } @@ -479,7 +479,7 @@ AudioTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr w as its automation lane can be accessed using the special "Fader" menu option */ - + boost::shared_ptr p = wp.lock (); if (!p) { return; diff --git a/gtk2_ardour/audio_time_axis.h b/gtk2_ardour/audio_time_axis.h index 3688f49062..a13ac32f2a 100644 --- a/gtk2_ardour/audio_time_axis.h +++ b/gtk2_ardour/audio_time_axis.h @@ -111,7 +111,7 @@ class AudioTimeAxisView : public RouteTimeAxisView void update_pan_track_visibility (); void add_processor_to_subplugin_menu (boost::weak_ptr); - + Gtk::CheckMenuItem* gain_automation_item; std::list > pan_tracks; Gtk::CheckMenuItem* pan_automation_item; diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index a7474ca65b..79aec89f9c 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -122,7 +122,7 @@ AutomationController::end_touch () bool mark = false; double when = 0; - + if (_controllable->session().transport_rolling()) { mark = true; when = _controllable->session().transport_frame(); diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 655d958a1f..9a5a9098c7 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -249,7 +249,7 @@ AutomationLine::modify_point_y (ControlPoint& cp, double y) trackview.editor().session()->add_command ( new MementoCommand (memento_command_binder(), 0, &alist->get_state()) ); - + trackview.editor().session()->commit_reversible_command (); trackview.editor().session()->set_dirty (); } @@ -446,7 +446,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points) /* ok, we should display this point */ add_visible_control_point (view_index, pi, tx, ty, model, npoints); - + prev_rx = this_rx; prev_ry = this_ry; @@ -598,7 +598,7 @@ AutomationLine::start_drag_single (ControlPoint* cp, double x, float fraction) } } } - + start_drag_common (x, fraction); } @@ -689,7 +689,7 @@ AutomationLine::drag_motion (double x, float fraction, bool ignore_x, bool with_ copy (_push_points.begin(), _push_points.end(), back_inserter (points)); points.sort (ControlPointSorter ()); } - + double dx = ignore_x ? 0 : (x - _drag_x); double dy = fraction - _last_drag_fraction; @@ -793,7 +793,7 @@ AutomationLine::end_drag () copy (_push_points.begin(), _push_points.end(), back_inserter (points)); points.sort (ControlPointSorter ()); } - + sync_model_with_view_points (points, did_push, rint (_drag_distance * trackview.editor().get_current_zoom ())); alist->thaw (); @@ -803,7 +803,7 @@ AutomationLine::end_drag () trackview.editor().session()->add_command ( new MementoCommand(memento_command_binder (), 0, &alist->get_state()) ); - + trackview.editor().session()->set_dirty (); } @@ -950,7 +950,7 @@ AutomationLine::remove_point (ControlPoint& cp) trackview.editor().session()->add_command( new MementoCommand (memento_command_binder (), &before, &alist->get_state()) ); - + trackview.editor().session()->commit_reversible_command (); trackview.editor().session()->set_dirty (); } @@ -992,7 +992,7 @@ list AutomationLine::point_selection_to_control_points (PointSelection const & s) { list cp; - + for (PointSelection::const_iterator i = s.begin(); i != s.end(); ++i) { if (i->track != &trackview) { @@ -1284,7 +1284,7 @@ AutomationLine::add_visible_control_point (uint32_t view_index, uint32_t pi, dou control_points[view_index]->reset (tx, ty, model, view_index, shape); /* finally, control visibility */ - + if (_visible && points_visible) { control_points[view_index]->show (); control_points[view_index]->set_visible (true); @@ -1313,9 +1313,9 @@ void AutomationLine::connect_to_list () { _list_connections.drop_connections (); - + alist->StateChanged.connect (_list_connections, invalidator (*this), boost::bind (&AutomationLine::list_changed, this), gui_context()); - + alist->InterpolationChanged.connect ( _list_connections, invalidator (*this), boost::bind (&AutomationLine::interpolation_changed, this, _1), gui_context() ); @@ -1362,7 +1362,7 @@ AutomationLine::set_offset (framepos_t off) if (_offset == off) { return; } - + _offset = off; reset (); } diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h index a05a7b9180..095fa14c38 100644 --- a/gtk2_ardour/automation_line.h +++ b/gtk2_ardour/automation_line.h @@ -66,7 +66,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible void reset (); void clear (); - std::list point_selection_to_control_points (PointSelection const &); + std::list point_selection_to_control_points (PointSelection const &); void set_selected_points (PointSelection&); void get_selectables (ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list&); void get_inverted_selectables (Selection&, std::list& results); @@ -147,7 +147,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible void set_offset (ARDOUR::framecnt_t); void set_width (ARDOUR::framecnt_t); - + protected: std::string _name; @@ -234,7 +234,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible /** maximum time that a point on this line can be at, relative to the position of its region or start of its track */ ARDOUR::framecnt_t _maximum_time; - + friend class AudioRegionGainLine; }; diff --git a/gtk2_ardour/automation_range.h b/gtk2_ardour/automation_range.h index e13ad378a5..2baa515d8b 100644 --- a/gtk2_ardour/automation_range.h +++ b/gtk2_ardour/automation_range.h @@ -43,7 +43,7 @@ struct AutomationRange double low_fract; double high_fract; TimeAxisView* track; // ref would be better, but ARDOUR::SessionHandlePtr is non-assignable - + AutomationRange (double s, double e, double l, double h, TimeAxisView* atv) : start (s), end (e), low_fract (l), high_fract (h), track (atv) {} }; diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index 383c022bdb..18ce6cc646 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -98,23 +98,23 @@ AutomationRegionView::canvas_event (GdkEvent* ev) /* XXX: icky dcast to Editor */ e.drags()->set (new RubberbandSelectDrag (dynamic_cast (&e), group), ev); - + } else if (ev->type == GDK_BUTTON_RELEASE) { if (trackview.editor().drags()->active() && trackview.editor().drags()->end_grab (ev)) { return true; } - + double x = ev->button.x; double y = ev->button.y; - + /* convert to item coordinates in the time axis view */ automation_view()->canvas_display()->w2i (x, y); /* clamp y */ y = max (y, 0.0); y = min (y, _height - NAME_HIGHLIGHT_SIZE); - + add_automation_event (ev, trackview.editor().pixel_to_frame (x) - _region->position(), y); } @@ -137,7 +137,7 @@ AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double assert(_line); AutomationTimeAxisView* const view = automation_view (); - + /* compute vertical fractional position */ const double h = trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2; @@ -158,11 +158,11 @@ AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double /* XXX: hack! */ boost::shared_ptr mr = boost::dynamic_pointer_cast (_region); assert (mr); - + view->session()->commit_reversible_command ( new MementoCommand (new ARDOUR::MidiAutomationListBinder (mr->midi_source(), _parameter), &before, &after) ); - + view->session()->set_dirty (); } @@ -183,7 +183,7 @@ AutomationRegionView::set_position (framepos_t pos, void* src, double* ignored) if (_line) { _line->set_maximum_time (_region->length ()); } - + return RegionView::set_position(pos, src, ignored); } diff --git a/gtk2_ardour/automation_streamview.cc b/gtk2_ardour/automation_streamview.cc index 86388f527f..3e2046fd58 100644 --- a/gtk2_ardour/automation_streamview.cc +++ b/gtk2_ardour/automation_streamview.cc @@ -131,7 +131,7 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr region if (line && line->the_list()) { line->the_list()->set_automation_state (automation_state ()); } - + RegionViewAdded (region_view); return region_view; @@ -147,7 +147,7 @@ void AutomationStreamView::set_automation_state (AutoState state) { /* Setting the automation state for this view sets the state of all regions' lists to the same thing */ - + if (region_views.empty()) { _pending_automation_state = state; } else { @@ -218,7 +218,7 @@ bool AutomationStreamView::has_automation () const { list > lines = get_lines (); - + for (list >::iterator i = lines.begin(); i != lines.end(); ++i) { if ((*i)->npoints() > 0) { return true; @@ -235,7 +235,7 @@ void AutomationStreamView::set_interpolation (AutomationList::InterpolationStyle s) { list > lines = get_lines (); - + for (list >::iterator i = lines.begin(); i != lines.end(); ++i) { (*i)->the_list()->set_interpolation (s); } @@ -259,7 +259,7 @@ void AutomationStreamView::clear () { list > lines = get_lines (); - + for (list >::iterator i = lines.begin(); i != lines.end(); ++i) { (*i)->clear (); } @@ -286,7 +286,7 @@ void AutomationStreamView::set_selected_points (PointSelection& ps) { list > lines = get_lines (); - + for (list >::iterator i = lines.begin(); i != lines.end(); ++i) { (*i)->set_selected_points (ps); } @@ -296,7 +296,7 @@ list > AutomationStreamView::get_lines () const { list > lines; - + for (list::const_iterator i = region_views.begin(); i != region_views.end(); ++i) { AutomationRegionView* arv = dynamic_cast (*i); assert (arv); @@ -311,7 +311,7 @@ struct RegionPositionSorter { return a->region()->position() < b->region()->position(); } }; - + /** @param pos Position, in session frames. * @return AutomationLine to paste to for that position, or 0 if there is none appropriate. diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 9cf1598010..43eae4e031 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -226,7 +226,7 @@ AutomationTimeAxisView::AutomationTimeAxisView ( } else { /* no regions, just a single line for the entire track (e.g. bus gain) */ - + boost::shared_ptr line ( new AutomationLine ( ARDOUR::EventTypeMap::instance().to_symbol(_parameter), @@ -260,7 +260,7 @@ AutomationTimeAxisView::route_going_away () { _route.reset (); } - + void AutomationTimeAxisView::auto_clicked () { @@ -298,14 +298,14 @@ AutomationTimeAxisView::set_automation_state (AutoState state) if (_route == _automatable) { // This is a time axis for route (not region) automation _route->set_parameter_automation_state (_parameter, state); } - + if (_control->list()) { _control->alist()->set_automation_state(state); } #endif if (_view) { _view->set_automation_state (state); - + /* AutomationStreamViews don't signal when their automation state changes, so handle our updates `manually'. */ @@ -401,7 +401,7 @@ AutomationTimeAxisView::set_interpolation (AutomationList::InterpolationStyle st /* Tell our view's list, if we have one, otherwise tell our own. * Everything else will be signalled back from that. */ - + if (_view) { _view->set_interpolation (style); } else { @@ -413,9 +413,9 @@ void AutomationTimeAxisView::clear_clicked () { assert (_line || _view); - + _session->begin_reversible_command (_("clear automation")); - + if (_line) { _line->clear (); } else if (_view) { @@ -672,10 +672,10 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel const Evoral::TimeConverter& tc = line.time_converter (); double const start = tc.from (selection.time.front().start - tc.origin_b ()); double const end = tc.from (selection.time.front().end - tc.origin_b ()); - + switch (op) { case Cut: - + if ((what_we_got = alist->cut (start, end)) != 0) { _editor.get_cut_buffer().add (what_we_got); _session->add_command(new MementoCommand(*alist.get(), &before, &alist->get_state())); @@ -810,7 +810,7 @@ bool AutomationTimeAxisView::paste (framepos_t pos, float times, Selection& selection, size_t nth) { boost::shared_ptr line; - + if (_line) { line = _line; } else if (_view) { @@ -820,7 +820,7 @@ AutomationTimeAxisView::paste (framepos_t pos, float times, Selection& selection if (!line) { return false; } - + return paste_one (*line, pos, times, selection, nth); } @@ -940,7 +940,7 @@ AutomationTimeAxisView::add_line (boost::shared_ptr line) _control->alist()->automation_state_changed.connect ( _list_connections, invalidator (*this), boost::bind (&AutomationTimeAxisView::automation_state_changed, this), gui_context() ); - + _control->alist()->InterpolationChanged.connect ( _list_connections, invalidator (*this), boost::bind (&AutomationTimeAxisView::interpolation_changed, this, _1), gui_context() ); @@ -988,7 +988,7 @@ AutomationTimeAxisView::set_state (const XMLNode& node, int version) if (version < 3000) { return set_state_2X (node, version); } - + XMLProperty const * type = node.property ("automation-id"); if (type && type->value () == ARDOUR::EventTypeMap::instance().to_symbol (_parameter)) { XMLProperty const * shown = node.property ("shown"); @@ -1084,7 +1084,7 @@ list > AutomationTimeAxisView::lines () const { list > lines; - + if (_line) { lines.push_back (_line); } else if (_view) { diff --git a/gtk2_ardour/axis_view.cc b/gtk2_ardour/axis_view.cc index eb3ef23bc6..dcbaa35d37 100644 --- a/gtk2_ardour/axis_view.cc +++ b/gtk2_ardour/axis_view.cc @@ -45,7 +45,7 @@ using namespace ARDOUR; list AxisView::used_colors; -AxisView::AxisView (ARDOUR::Session* sess) +AxisView::AxisView (ARDOUR::Session* sess) : SessionHandlePtr (sess) { _selected = false; diff --git a/gtk2_ardour/axis_view.h b/gtk2_ardour/axis_view.h index 108d14c1f1..e3e90325d3 100644 --- a/gtk2_ardour/axis_view.h +++ b/gtk2_ardour/axis_view.h @@ -59,7 +59,7 @@ class AxisView : public virtual Selectable, public PBD::ScopedConnectionList, pu virtual void set_marked_for_display (bool yn) { _marked_for_display = yn; } - + sigc::signal Hiding; void set_old_order_key (uint32_t ok) { _old_order_key = ok; } diff --git a/gtk2_ardour/bundle_manager.cc b/gtk2_ardour/bundle_manager.cc index 9916f80581..2e85b6a030 100644 --- a/gtk2_ardour/bundle_manager.cc +++ b/gtk2_ardour/bundle_manager.cc @@ -59,7 +59,7 @@ BundleEditorMatrix::setup_ports (int dim) /* when we gather, allow the matrix to contain bundles with duplicate port sets, otherwise in some cases the basic system IO ports may be hidden, making the bundle editor useless */ - + _ports[OTHER].gather (_session, DataType::NIL, _bundle->ports_are_inputs(), true); _ports[OTHER].remove_bundle (_bundle); _ports[OTHER].resume_signals (); @@ -86,7 +86,7 @@ BundleEditorMatrix::get_state (BundleChannel c[2]) const if (pl.empty ()) { return PortMatrixNode::NOT_ASSOCIATED; } - + for (Bundle::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) { if (!c[OURS].bundle->port_attached_to_channel (c[OURS].channel, *i)) { return PortMatrixNode::NOT_ASSOCIATED; @@ -401,7 +401,7 @@ BundleManager::row_activated (Gtk::TreeModel::Path const & p, Gtk::TreeViewColum if (!i) { return; } - + boost::shared_ptr b = (*i)[_list_model_columns.bundle]; BundleEditor e (_session, b); e.run (); diff --git a/gtk2_ardour/canvas-hit.cc b/gtk2_ardour/canvas-hit.cc index f00e113462..d3bf1544be 100644 --- a/gtk2_ardour/canvas-hit.cc +++ b/gtk2_ardour/canvas-hit.cc @@ -13,7 +13,7 @@ CanvasHit::CanvasHit (MidiRegionView& region, Group& group, double size, const boost::shared_ptr note, - bool with_events) + bool with_events) : Diamond(group, size) , CanvasNoteEvent(region, this, note) { @@ -27,7 +27,7 @@ CanvasHit::on_event(GdkEvent* ev) { if (!CanvasNoteEvent::on_event (ev)) { return _region.get_time_axis_view().editor().canvas_note_event (ev, this); - } + } return true; } diff --git a/gtk2_ardour/canvas-noevent-text.h b/gtk2_ardour/canvas-noevent-text.h index f210354404..573e0d7a34 100644 --- a/gtk2_ardour/canvas-noevent-text.h +++ b/gtk2_ardour/canvas-noevent-text.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2009 Paul Davis * * This library is free software; you can redistribute it and/or @@ -29,7 +29,7 @@ namespace Gnome { namespace Canvas { class NoEventText : public Text { public: - NoEventText(Group& parent, double x, double y, const std::string& text) + NoEventText(Group& parent, double x, double y, const std::string& text) : Text (parent, x, y, text) {} NoEventText(Group& parent) : Text (parent) {} diff --git a/gtk2_ardour/canvas-note-event.cc b/gtk2_ardour/canvas-note-event.cc index 8ebd1239e4..8f5a9f5807 100644 --- a/gtk2_ardour/canvas-note-event.cc +++ b/gtk2_ardour/canvas-note-event.cc @@ -138,7 +138,7 @@ void CanvasNoteEvent::show_channel_selector(void) { if (_channel_selector_widget == 0) { - + if(_region.channel_selector_scoped_note() != 0){ _region.channel_selector_scoped_note()->hide_channel_selector(); _region.set_channel_selector_scoped_note(0); @@ -162,7 +162,7 @@ CanvasNoteEvent::show_channel_selector(void) _channel_selector_widget->property_width() = 100; _channel_selector_widget->raise_to_top(); _channel_selector_widget->show(); - + _region.set_channel_selector_scoped_note(this); } else { hide_channel_selector(); @@ -188,10 +188,10 @@ CanvasNoteEvent::set_selected(bool selected) _selected = selected; set_fill_color (base_color ()); - + if (_selected) { set_outline_color(calculate_outline(ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get())); - + if(_region.channel_selector_scoped_note() != 0){ _region.channel_selector_scoped_note()->hide_channel_selector(); _region.set_channel_selector_scoped_note(0); @@ -223,13 +223,13 @@ CanvasNoteEvent::base_color() SCALE_USHORT_TO_UINT8_T(color.get_red()), SCALE_USHORT_TO_UINT8_T(color.get_green()), SCALE_USHORT_TO_UINT8_T(color.get_blue()), - opacity), + opacity), ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get(), 0.5); } case ChannelColors: return UINT_INTERPOLATE (UINT_RGBA_CHANGE_A (CanvasNoteEvent::midi_channel_colors[_note->channel()], - opacity), + opacity), ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get(), 0.5); default: diff --git a/gtk2_ardour/canvas-note-event.h b/gtk2_ardour/canvas-note-event.h index 541cacf6a9..69b3e49076 100644 --- a/gtk2_ardour/canvas-note-event.h +++ b/gtk2_ardour/canvas-note-event.h @@ -159,7 +159,7 @@ class CanvasNoteEvent : virtual public sigc::trackable bool _valid; float _mouse_x_fraction; float _mouse_y_fraction; - + void set_mouse_fractions (GdkEvent*); }; diff --git a/gtk2_ardour/canvas-note.h b/gtk2_ardour/canvas-note.h index eb8b1eab02..46b0f1d600 100644 --- a/gtk2_ardour/canvas-note.h +++ b/gtk2_ardour/canvas-note.h @@ -29,7 +29,7 @@ namespace Gnome { namespace Canvas { -class CanvasNote : public SimpleRect, public CanvasNoteEvent +class CanvasNote : public SimpleRect, public CanvasNoteEvent { public: typedef Evoral::Note NoteType; @@ -61,7 +61,7 @@ class NoEventCanvasNote : public CanvasNote Group& group, const boost::shared_ptr note = boost::shared_ptr()) : CanvasNote (region, group, note, false) {} - + double point_vfunc(double, double, int, int, GnomeCanvasItem**) { /* return a huge value to tell the canvas that we're never the item for an event */ return 9999999999999.0; diff --git a/gtk2_ardour/canvas-simpleline.c b/gtk2_ardour/canvas-simpleline.c index 6d58312855..83beb598e7 100644 --- a/gtk2_ardour/canvas-simpleline.c +++ b/gtk2_ardour/canvas-simpleline.c @@ -223,7 +223,7 @@ gnome_canvas_simpleline_set_property (GObject *object, case PROP_Y1: d = g_value_get_double (value); if (simpleline->y1 != d) { - simpleline->y1 = d; + simpleline->y1 = d; bounds_changed = TRUE; } break; @@ -310,7 +310,7 @@ gnome_canvas_simpleline_update (GnomeCanvasItem *item, double *affine, ArtSVP *c /* get current bounding box in parent-relative world coordinates */ - gnome_canvas_simpleline_bounds (item, &x1, &y1, &x2, &y2); + gnome_canvas_simpleline_bounds (item, &x1, &y1, &x2, &y2); /* convert parent-relative item coordinates to world coordinates */ @@ -325,7 +325,7 @@ gnome_canvas_simpleline_update (GnomeCanvasItem *item, double *affine, ArtSVP *c y2 = ceil (y2); /* force non-zero dimensionality for both axes */ - + if (x1 == x2) { x2 += 1.0; } @@ -375,12 +375,12 @@ gnome_canvas_simpleline_render (GnomeCanvasItem *item, x1 = simpleline->cx1; x2 = simpleline->cx2; y1 = simpleline->cy1; - + if (buf->is_bg) { gnome_canvas_buf_ensure_buf (buf); buf->is_bg = FALSE; } - + if (simpleline->x1 != simpleline->x2) { PAINT_HORIZA(buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a, x1, x2, y1); @@ -388,7 +388,7 @@ gnome_canvas_simpleline_render (GnomeCanvasItem *item, y2 = simpleline->cy2; PAINT_VERTA (buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a, x1, y1, y2); - + } } diff --git a/gtk2_ardour/canvas-simplerect.c b/gtk2_ardour/canvas-simplerect.c index 028753ee20..e7cb522e82 100644 --- a/gtk2_ardour/canvas-simplerect.c +++ b/gtk2_ardour/canvas-simplerect.c @@ -628,23 +628,23 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item, if (simplerect->outline_a > 0) { for (i = 0; i < simplerect->outline_pixels; ++i) { - + if (simplerect->outline_what & 0x1) { if (begin == simplerect->bbox_ulx) { PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin + i, sy, ey); } } - + if (simplerect->outline_what & 0x2) { if (end == (simplerect->bbox_lrx - 1)) { PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, end - i, sy, ey + 1); } } - + if (simplerect->outline_what & 0x4) { PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end, sy+i); } - + if (simplerect->outline_what & 0x8) { PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end + 1, ey-i); } @@ -662,7 +662,7 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item, int end, begin; int ey, sy; int i; - + simplerect = GNOME_CANVAS_SIMPLERECT (item); if (parent_class->render) { @@ -707,23 +707,23 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item, if (simplerect->outline_a) { for (i = 0; i < (int) simplerect->outline_pixels; ++i) { - + if (simplerect->outline_what & 0x1) { if (begin == simplerect->bbox_ulx) { PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin + i, sy, ey); } } - + if (simplerect->outline_what & 0x2) { if (end == (simplerect->bbox_lrx - 1)) { PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, end - i, sy, ey + 1); } } - + if (simplerect->outline_what & 0x4) { PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end, sy+i); } - + if (simplerect->outline_what & 0x8) { PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end + 1, ey-i); } diff --git a/gtk2_ardour/canvas_patch_change.cc b/gtk2_ardour/canvas_patch_change.cc index 320f0c0d00..930226565d 100644 --- a/gtk2_ardour/canvas_patch_change.cc +++ b/gtk2_ardour/canvas_patch_change.cc @@ -141,7 +141,7 @@ CanvasPatchChange::on_event (GdkEvent* ev) _region.edit_patch_change (this); return true; - + } else if (ev->button.button == 1) { e->drags()->set (new PatchChangeDrag (e, this, &_region), ev); return true; diff --git a/gtk2_ardour/clock_group.cc b/gtk2_ardour/clock_group.cc index 5a03064e85..e304b4ce28 100644 --- a/gtk2_ardour/clock_group.cc +++ b/gtk2_ardour/clock_group.cc @@ -43,7 +43,7 @@ ClockGroup::remove (AudioClock& clock) { clocks.erase (&clock); } - + void ClockGroup::one_clock_changed (AudioClock* clock) { @@ -62,5 +62,5 @@ ClockGroup::set_clock_mode (AudioClock::Mode mode) (*c)->set_mode (mode); } ignore_changes = false; -} +} diff --git a/gtk2_ardour/control_point.cc b/gtk2_ardour/control_point.cc index 801bd5bb82..bc7301dc1c 100644 --- a/gtk2_ardour/control_point.cc +++ b/gtk2_ardour/control_point.cc @@ -121,11 +121,11 @@ ControlPoint::reset (double x, double y, AutomationList::iterator mi, uint32_t v /* If this is too big, libart will confuse itself and segfault after it casts the bounding box of this automation line to ints. Sigh. */ - + if (x > INT32_MAX) { x = INT32_MAX; } - + _model = mi; _view_index = vi; move_to (x, y, shape); diff --git a/gtk2_ardour/control_point.h b/gtk2_ardour/control_point.h index 2dbf225d86..40eb7b9179 100644 --- a/gtk2_ardour/control_point.h +++ b/gtk2_ardour/control_point.h @@ -68,7 +68,7 @@ class ControlPoint : public Selectable double size () const { return _size; } - + void set_size (double); void set_visible (bool); bool visible () const; diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc index 0c8daafb04..c3f561944f 100644 --- a/gtk2_ardour/crossfade_edit.cc +++ b/gtk2_ardour/crossfade_edit.cc @@ -97,7 +97,7 @@ CrossfadeEditor::CrossfadeEditor (Session* s, boost::shared_ptr xf, d select_out_button (_("Fade Out")), _peaks_ready_connection (0) - + { set_session (s); @@ -509,7 +509,7 @@ CrossfadeEditor::Point::move_to (double nx, double ny, double xfract, double yfr } else if ( xfract > 1.0 ) { xfract = 1.0; } - + if ( yfract < 0.0 ) { yfract = 0.0; } else if ( yfract > 1.0 ) { @@ -788,7 +788,7 @@ CrossfadeEditor::apply () _session->begin_reversible_command (_("Edit crossfade")); XMLNode& before = xfade->get_state (); - + _apply_to (xfade); _session->add_command (new MementoCommand (*xfade.get(), &before, &xfade->get_state ())); @@ -1154,7 +1154,7 @@ CrossfadeEditor::make_waves (boost::shared_ptr region, WhichFade wh delete _peaks_ready_connection; _peaks_ready_connection = 0; - + for (uint32_t n = 0; n < nchans; ++n) { gdouble yoff = n * ht; @@ -1207,7 +1207,7 @@ CrossfadeEditor::peaks_ready (boost::weak_ptr wr, WhichFade which) */ delete _peaks_ready_connection; _peaks_ready_connection = 0; - + make_waves (r, which); } @@ -1251,16 +1251,16 @@ CrossfadeEditor::audition (Audition which) right_length = xfade->in()->length(); } - PropertyList left_plist; - PropertyList right_plist; + PropertyList left_plist; + PropertyList right_plist; + - left_plist.add (ARDOUR::Properties::start, left_start_offset); left_plist.add (ARDOUR::Properties::length, left_length); left_plist.add (ARDOUR::Properties::name, string ("xfade out")); left_plist.add (ARDOUR::Properties::layer, 0); left_plist.add (ARDOUR::Properties::fade_in_active, true); - + right_plist.add (ARDOUR::Properties::start, 0); right_plist.add (ARDOUR::Properties::length, right_length); right_plist.add (ARDOUR::Properties::name, string("xfade in")); @@ -1273,9 +1273,9 @@ CrossfadeEditor::audition (Audition which) left_plist.add (ARDOUR::Properties::scale_amplitude, 0.0f); } - boost::shared_ptr left (boost::dynamic_pointer_cast + boost::shared_ptr left (boost::dynamic_pointer_cast (RegionFactory::create (xfade->out(), left_plist, false))); - boost::shared_ptr right (boost::dynamic_pointer_cast + boost::shared_ptr right (boost::dynamic_pointer_cast (RegionFactory::create (xfade->in(), right_plist, false))); // apply a 20ms declicking fade at the start and end of auditioning @@ -1302,14 +1302,14 @@ CrossfadeEditor::audition_both () void CrossfadeEditor::audition_left_dry () { - PropertyList plist; + PropertyList plist; plist.add (ARDOUR::Properties::start, xfade->out()->length() - xfade->length()); plist.add (ARDOUR::Properties::length, xfade->length()); plist.add (ARDOUR::Properties::name, string("xfade left")); plist.add (ARDOUR::Properties::layer, 0); - - boost::shared_ptr left (boost::dynamic_pointer_cast + + boost::shared_ptr left (boost::dynamic_pointer_cast (RegionFactory::create (xfade->out(), plist, false))); _session->audition_region (left); @@ -1324,14 +1324,14 @@ CrossfadeEditor::audition_left () void CrossfadeEditor::audition_right_dry () { - PropertyList plist; + PropertyList plist; plist.add (ARDOUR::Properties::start, 0); plist.add (ARDOUR::Properties::length, xfade->length()); plist.add (ARDOUR::Properties::name, string ("xfade right")); plist.add (ARDOUR::Properties::layer, 0); - boost::shared_ptr right (boost::dynamic_pointer_cast + boost::shared_ptr right (boost::dynamic_pointer_cast (RegionFactory::create (xfade->in(), plist, false))); _session->audition_region (right); diff --git a/gtk2_ardour/crossfade_view.cc b/gtk2_ardour/crossfade_view.cc index 0c420e74ad..d553514c81 100644 --- a/gtk2_ardour/crossfade_view.cc +++ b/gtk2_ardour/crossfade_view.cc @@ -179,7 +179,7 @@ CrossfadeView::redraw_curves () /* Hence the number of points that we will render */ int32_t const npoints = editor.frame_to_pixel (max_frames - min_frames); - + if (!_visible || !crossfade->active() || npoints < 3) { fade_in->hide(); fade_out->hide(); @@ -215,7 +215,7 @@ CrossfadeView::redraw_curves () p.set_x (xoff + i + 1); p.set_y (_height - ((_height - 2) * vec[i])); } - + fade_out->property_points() = *points; delete [] vec; @@ -298,7 +298,7 @@ CrossfadeView::horizontal_position_changed () the other case where the horizontal position change will uncover `undrawn' sections). */ - + if (!_all_in_view) { redraw_curves (); } diff --git a/gtk2_ardour/crossfade_view.h b/gtk2_ardour/crossfade_view.h index c283a92b62..75544f50a9 100644 --- a/gtk2_ardour/crossfade_view.h +++ b/gtk2_ardour/crossfade_view.h @@ -40,41 +40,41 @@ public: Gdk::Color& basic_color, AudioRegionView& leftview, AudioRegionView& rightview); - + ~CrossfadeView (); boost::shared_ptr crossfade; // ok, let 'em have it AudioRegionView& left_view; // and these too AudioRegionView& right_view; - + void set_height (double); - + bool valid() const { return _valid; } bool visible() const { return _visible; } void set_valid (bool yn); - + static PBD::Signal1 CatchDeletion; - + AudioRegionView& upper_regionview () const; - + void fake_hide (); void hide (); void show (); void horizontal_position_changed (); - + protected: void reset_width_dependent_items (double pixel_width); - + private: bool _valid; bool _visible; - bool _all_in_view; - + bool _all_in_view; + ArdourCanvas::Line *fade_in; ArdourCanvas::Line *fade_out; ArdourCanvas::Item *active_button; - + void crossfade_changed (const PBD::PropertyChange&); void crossfade_fades_changed (); void active_changed (); diff --git a/gtk2_ardour/edit_note_dialog.cc b/gtk2_ardour/edit_note_dialog.cc index 19e072cf4d..2894f95271 100644 --- a/gtk2_ardour/edit_note_dialog.cc +++ b/gtk2_ardour/edit_note_dialog.cc @@ -120,7 +120,7 @@ EditNoteDialog::run () _velocity.update (); _region_view->start_note_diff_command (_("edit note")); - + bool had_change = false; if (_channel.get_value_as_int() - 1 != _event->note()->channel()) { @@ -139,7 +139,7 @@ EditNoteDialog::run () } double const t = _region_view->time_converter().from (_time_clock.current_time ()); - + if (t != _event->note()->time()) { _region_view->change_note_time (_event, t); had_change = true; @@ -158,7 +158,7 @@ EditNoteDialog::run () _region_view->apply_diff (); - _event->set_selected (_event->selected()); // change color - + _event->set_selected (_event->selected()); // change color + return r; } diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index a0dc2ffb09..dcf97ffaa8 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -420,35 +420,35 @@ Editor::Editor () tempo_label.set_padding (5,0); tempo_label.hide(); tempo_label.set_no_show_all(); - + meter_label.set_name ("EditorTimeButton"); meter_label.set_size_request (-1, (int)timebar_height); meter_label.set_alignment (1.0, 0.5); meter_label.set_padding (5,0); meter_label.hide(); meter_label.set_no_show_all(); - + mark_label.set_name ("EditorTimeButton"); mark_label.set_size_request (-1, (int)timebar_height); mark_label.set_alignment (1.0, 0.5); mark_label.set_padding (5,0); mark_label.hide(); mark_label.set_no_show_all(); - + cd_mark_label.set_name ("EditorTimeButton"); cd_mark_label.set_size_request (-1, (int)timebar_height); cd_mark_label.set_alignment (1.0, 0.5); cd_mark_label.set_padding (5,0); cd_mark_label.hide(); cd_mark_label.set_no_show_all(); - + range_mark_label.set_name ("EditorTimeButton"); range_mark_label.set_size_request (-1, (int)timebar_height); range_mark_label.set_alignment (1.0, 0.5); range_mark_label.set_padding (5,0); range_mark_label.hide(); range_mark_label.set_no_show_all(); - + transport_mark_label.set_name ("EditorTimeButton"); transport_mark_label.set_size_request (-1, (int)timebar_height); transport_mark_label.set_alignment (1.0, 0.5); @@ -458,14 +458,14 @@ Editor::Editor () initialize_rulers (); initialize_canvas (); - + _summary = new EditorSummary (this); selection->TimeChanged.connect (sigc::mem_fun(*this, &Editor::time_selection_changed)); selection->TracksChanged.connect (sigc::mem_fun(*this, &Editor::track_selection_changed)); - + editor_regions_selection_changed_connection = selection->RegionsChanged.connect (sigc::mem_fun(*this, &Editor::region_selection_changed)); - + selection->PointsChanged.connect (sigc::mem_fun(*this, &Editor::point_selection_changed)); selection->MarkersChanged.connect (sigc::mem_fun(*this, &Editor::marker_selection_changed)); @@ -491,10 +491,10 @@ Editor::Editor () ArdourCanvas::Canvas* time_pad = manage(new ArdourCanvas::Canvas()); ArdourCanvas::SimpleLine* pad_line_1 = manage(new ArdourCanvas::SimpleLine(*time_pad->root(), 0.0, 1.0, 100.0, 1.0)); - + pad_line_1->property_color_rgba() = 0xFF0000FF; pad_line_1->show(); - + time_pad->show(); time_canvas_vbox.set_size_request (-1, (int)(timebar_height * visible_timebars) + 2); @@ -567,12 +567,12 @@ Editor::Editor () summary_arrows_left_left->add (*manage (new Arrow (ARROW_LEFT, SHADOW_NONE))); summary_arrows_left_left->signal_pressed().connect (sigc::hide_return (sigc::bind (sigc::mem_fun (*this, &Editor::scroll_press), LEFT))); summary_arrows_left_left->signal_released().connect (sigc::mem_fun (*this, &Editor::scroll_release)); - + Button* summary_arrows_left_right = manage (new Button); summary_arrows_left_right->add (*manage (new Arrow (ARROW_RIGHT, SHADOW_NONE))); summary_arrows_left_right->signal_pressed().connect (sigc::hide_return (sigc::bind (sigc::mem_fun (*this, &Editor::scroll_press), RIGHT))); summary_arrows_left_right->signal_released().connect (sigc::mem_fun (*this, &Editor::scroll_release)); - + VBox* summary_arrows_left = manage (new VBox); summary_arrows_left->pack_start (*summary_arrows_left_left); summary_arrows_left->pack_start (*summary_arrows_left_right); @@ -581,26 +581,26 @@ Editor::Editor () summary_arrows_right_up->add (*manage (new Arrow (ARROW_UP, SHADOW_NONE))); summary_arrows_right_up->signal_pressed().connect (sigc::hide_return (sigc::bind (sigc::mem_fun (*this, &Editor::scroll_press), UP))); summary_arrows_right_up->signal_released().connect (sigc::mem_fun (*this, &Editor::scroll_release)); - + Button* summary_arrows_right_down = manage (new Button); summary_arrows_right_down->add (*manage (new Arrow (ARROW_DOWN, SHADOW_NONE))); summary_arrows_right_down->signal_pressed().connect (sigc::hide_return (sigc::bind (sigc::mem_fun (*this, &Editor::scroll_press), DOWN))); summary_arrows_right_down->signal_released().connect (sigc::mem_fun (*this, &Editor::scroll_release)); - + VBox* summary_arrows_right = manage (new VBox); summary_arrows_right->pack_start (*summary_arrows_right_up); summary_arrows_right->pack_start (*summary_arrows_right_down); Frame* summary_frame = manage (new Frame); summary_frame->set_shadow_type (Gtk::SHADOW_ETCHED_IN); - + summary_frame->add (*_summary); summary_frame->show (); _summary_hbox.pack_start (*summary_arrows_left, false, false); _summary_hbox.pack_start (*summary_frame, true, true); _summary_hbox.pack_start (*summary_arrows_right, false, false); - + editor_summary_pane.pack2 (_summary_hbox); edit_pane.pack1 (editor_summary_pane, true, true); @@ -703,7 +703,7 @@ Editor::Editor () ControlProtocol::ZoomOut.connect (*this, invalidator (*this), boost::bind (&Editor::temporal_zoom_step, this, true), gui_context()); ControlProtocol::ScrollTimeline.connect (*this, invalidator (*this), ui_bind (&Editor::control_scroll, this, _1), gui_context()); BasicUI::AccessAction.connect (*this, invalidator (*this), ui_bind (&Editor::access_action, this, _1, _2), gui_context()); - + /* problematic: has to return a value and thus cannot be x-thread */ Session::AskAboutPlaylistDeletion.connect_same_thread (*this, boost::bind (&Editor::playlist_deletion_dialog, this, _1)); @@ -1157,11 +1157,11 @@ Editor::set_session (Session *t) Location* loc = _session->locations()->auto_loop_location(); if (loc == 0) { loc = new Location (*_session, 0, _session->current_end_frame(), _("Loop"),(Location::Flags) (Location::IsAutoLoop | Location::IsHidden)); - + if (loc->start() == loc->end()) { loc->set_end (loc->start() + 1); } - + _session->locations()->add (loc, false); _session->set_auto_loop_location (loc); } else { @@ -1170,14 +1170,14 @@ Editor::set_session (Session *t) } loc = _session->locations()->auto_punch_location(); - + if (loc == 0) { loc = new Location (*_session, 0, _session->current_end_frame(), _("Punch"), (Location::Flags) (Location::IsAutoPunch | Location::IsHidden)); - + if (loc->start() == loc->end()) { loc->set_end (loc->start() + 1); } - + _session->locations()->add (loc, false); _session->set_auto_punch_location (loc); } else { @@ -1202,7 +1202,7 @@ Editor::set_session (Session *t) super_rapid_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect ( sigc::mem_fun (*this, &Editor::super_rapid_screen_update) ); - + switch (_snap_type) { case SnapToRegionStart: case SnapToRegionEnd: @@ -1268,10 +1268,10 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i items.push_back (SeparatorElem()); if (Profile->get_sae()) { - + items.push_back (MenuElem (_("Linear"), sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeLinear))); items.push_back (MenuElem (_("Slowest"), sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeFast))); - + } else { items.push_back ( @@ -1290,34 +1290,34 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i *_fade_in_images[FadeFast], sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeFast) )); - + dynamic_cast(&items.back())->set_always_show_image (); - + items.push_back ( ImageMenuElem ( _("Slow"), *_fade_in_images[FadeLogB], sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeLogB) )); - + dynamic_cast(&items.back())->set_always_show_image (); - + items.push_back ( ImageMenuElem ( _("Fast"), *_fade_in_images[FadeLogA], sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeLogA) )); - + dynamic_cast(&items.back())->set_always_show_image (); - + items.push_back ( ImageMenuElem ( _("Fastest"), *_fade_in_images[FadeSlow], sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeSlow) )); - + dynamic_cast(&items.back())->set_always_show_image (); } @@ -1354,34 +1354,34 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i *_fade_out_images[FadeFast], sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeSlow) )); - + dynamic_cast(&items.back())->set_always_show_image (); - + items.push_back ( ImageMenuElem ( _("Slow"), *_fade_out_images[FadeLogB], sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeLogA) )); - + dynamic_cast(&items.back())->set_always_show_image (); - + items.push_back ( ImageMenuElem ( _("Fast"), *_fade_out_images[FadeLogA], sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeLogB) )); - + dynamic_cast(&items.back())->set_always_show_image (); - + items.push_back ( ImageMenuElem ( _("Fastest"), *_fade_out_images[FadeSlow], sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeFast) )); - + dynamic_cast(&items.back())->set_always_show_image (); } @@ -1744,13 +1744,13 @@ void Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items, boost::shared_ptr track) { using namespace Menu_Helpers; - + /* OK, stick the region submenu at the top of the list, and then add the standard items. */ RegionSelection rs = get_regions_from_selection_and_entered (); - + string::size_type pos = 0; string menu_item_name = (rs.size() == 1) ? rs.front()->region()->name() : _("Selected Regions"); @@ -1775,7 +1775,7 @@ Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items, boost::sha dialogue. If we use the edit point it gets a bit messy because the user still has to click over *some* region in order to get the region context menu stuff to be displayed at all. */ - + framepos_t mouse; bool ignored; mouse_frame (mouse, ignored); @@ -1816,7 +1816,7 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items) sigc::bind (sigc::mem_fun (*this, &Editor::move_range_selection_start_or_end_to_region_boundary), false, true) ) ); - + edit_items.push_back ( MenuElem ( _("Move Range End to Previous Region Boundary"), @@ -1830,7 +1830,7 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items) sigc::bind (sigc::mem_fun (*this, &Editor::move_range_selection_start_or_end_to_region_boundary), true, true) ) ); - + edit_items.push_back (SeparatorElem()); edit_items.push_back (MenuElem (_("Convert to Region In-Place"), mem_fun(*this, &Editor::separate_region_from_selection))); edit_items.push_back (MenuElem (_("Convert to Region in Region List"), sigc::mem_fun(*this, &Editor::new_region_from_selection))); @@ -2190,7 +2190,7 @@ Editor::set_state (const XMLNode& node, int /*version*/) set_default_size (g.base_width, g.base_height); move (x, y); - + if (_session && (prop = node.property ("playhead"))) { framepos_t pos; sscanf (prop->value().c_str(), "%" PRIi64, &pos); @@ -2198,7 +2198,7 @@ Editor::set_state (const XMLNode& node, int /*version*/) } else { playhead_cursor->set_position (0); } - + if ((prop = node.property ("mixer-width"))) { editor_mixer_strip_width = Width (string_2_enum (prop->value(), editor_mixer_strip_width)); } @@ -2292,7 +2292,7 @@ Editor::set_state (const XMLNode& node, int /*version*/) } } } - + if ((prop = node.property ("region-list-sort-type"))) { RegionListSortType st; _regions->reset_sort_type ((RegionListSortType) string_2_enum (prop->value(), st), true); @@ -2311,9 +2311,9 @@ Editor::set_state (const XMLNode& node, int /*version*/) Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); bool yn = string_is_affirmative (prop->value()); - + /* do it twice to force the change */ - + tact->set_active (!yn); tact->set_active (yn); } @@ -2325,9 +2325,9 @@ Editor::set_state (const XMLNode& node, int /*version*/) Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); bool yn = string_is_affirmative (prop->value()); - + /* do it twice to force the change */ - + tact->set_active (!yn); tact->set_active (yn); } @@ -2445,13 +2445,13 @@ Editor::get_state () XMLNode* bb = new XMLNode (X_("Buttons")); button_bindings->save (*bb); node->add_child_nocopy (*bb); - } + } node->add_property (X_("show-marker-lines"), _show_marker_lines ? "yes" : "no"); node->add_child_nocopy (selection->get_state ()); node->add_child_nocopy (_regions->get_state ()); - + return *node; } @@ -2849,7 +2849,7 @@ Editor::setup_toolbar () _zoom_box.pack_start (zoom_out_full_button, false, false); _zoom_box.pack_start (zoom_focus_selector); - + /* Track zoom buttons */ tav_expand_button.set_name ("TrackHeightButton"); tav_expand_button.set_size_request (-1, 20); @@ -2865,7 +2865,7 @@ Editor::setup_toolbar () _zoom_box.pack_start (tav_shrink_button); _zoom_box.pack_start (tav_expand_button); - + _zoom_tearoff = manage (new TearOff (_zoom_box)); _zoom_tearoff->Detach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast(&toolbar_hbox), @@ -2876,7 +2876,7 @@ Editor::setup_toolbar () &_zoom_tearoff->tearoff_window())); _zoom_tearoff->Visible.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast (&toolbar_hbox), &_zoom_tearoff->tearoff_window(), 0)); - + snap_box.set_spacing (1); snap_box.set_border_width (2); @@ -2918,7 +2918,7 @@ Editor::setup_toolbar () _tools_tearoff = manage (new TearOff (*hbox)); _tools_tearoff->set_name ("MouseModeBase"); _tools_tearoff->tearoff_window().signal_key_press_event().connect (sigc::bind (sigc::ptr_fun (relay_key_press), &_tools_tearoff->tearoff_window()), false); - + if (Profile->get_sae()) { _tools_tearoff->set_can_be_torn_off (false); } @@ -2959,7 +2959,7 @@ Editor::setup_toolbar () toolbar_frame.set_shadow_type (SHADOW_OUT); toolbar_frame.set_name ("BaseFrame"); toolbar_frame.add (_toolbar_viewport); - + DPIReset.connect (sigc::mem_fun (*this, &Editor::resize_text_widgets)); } @@ -3032,7 +3032,7 @@ Editor::convert_drop_to_paths ( if (_session == 0) { return -1; } - + vector uris = data.get_uris(); if (uris.empty()) { @@ -3478,7 +3478,7 @@ Editor::edit_controls_button_release (GdkEventButton* ev) } else if (ev->button == 1) { selection->clear_tracks (); } - + return true; } @@ -3534,7 +3534,7 @@ Editor::pane_allocation_handler (Allocation &alloc, Paned* which) }; static Pane done; - + XMLNode* geometry; width = default_width; @@ -3582,7 +3582,7 @@ Editor::pane_allocation_handler (Allocation &alloc, Paned* which) } done = (Pane) (done | Horizontal); - + } else if (which == static_cast (&editor_summary_pane)) { if (done & Vertical) { @@ -3941,7 +3941,7 @@ Editor::control_layout_scroll (GdkEventScroll* ev) void Editor::session_state_saved (string) { - update_title (); + update_title (); _snapshots->redisplay (); } @@ -3964,7 +3964,7 @@ Editor::maximise_editing_space () if (post_maximal_vertical_pane_position == 0) { post_maximal_vertical_pane_position = editor_summary_pane.get_height(); } - + fullscreen (); if (post_maximal_editor_width) { @@ -4003,7 +4003,7 @@ Editor::restore_editing_space () if (post_maximal_vertical_pane_position != editor_summary_pane.get_position()) { post_maximal_vertical_pane_position = editor_summary_pane.get_position(); } - + unfullscreen(); _mouse_mode_tearoff->set_visible (true); @@ -4612,7 +4612,7 @@ RegionSelection Editor::get_regions_from_selection_and_edit_point () { RegionSelection regions; - + if (_edit_point == EditAtMouse && entered_regionview && !selection->regions.contains (entered_regionview)) { regions.add (entered_regionview); } else { @@ -4629,14 +4629,14 @@ Editor::get_regions_from_selection_and_edit_point () edit-activated route group as one of our regions. */ for (RegionSelection::iterator i = regions.begin (); i != regions.end(); ++i) { - + RouteGroup* g = (*i)->get_time_axis_view().route_group (); - + if (g && g->is_active() && g->is_edit()) { tracks.add (axis_views_from_routes (g->route_list())); } } - + if (!tracks.empty()) { /* now find regions that are at the edit position on those tracks */ framepos_t const where = get_preferred_edit_position (); @@ -4655,7 +4655,7 @@ RegionSelection Editor::get_regions_from_selection_and_entered () { RegionSelection regions = selection->regions; - + if (regions.empty() && entered_regionview) { regions.add (entered_regionview); } @@ -4918,7 +4918,7 @@ Editor::timeaxisview_deleted (TimeAxisView *tv) ENSURE_GUI_THREAD (*this, &Editor::timeaxisview_deleted, tv); RouteTimeAxisView* rtav = dynamic_cast (tv); - + _routes->route_removed (tv); if (tv == entered_track) { @@ -4946,7 +4946,7 @@ Editor::timeaxisview_deleted (TimeAxisView *tv) if (rtav) { route = rtav->route (); - } + } if (current_mixer_strip && current_mixer_strip->route() == route) { @@ -4959,18 +4959,18 @@ Editor::timeaxisview_deleted (TimeAxisView *tv) } else { next_tv = (*i); } - - + + if (next_tv) { set_selected_mixer_strip (*next_tv); } else { /* make the editor mixer strip go away setting the * button to inactive (which also unticks the menu option) */ - + ActionManager::uncheck_toggleaction ("/Editor/show-editor-mixer"); } - } + } } void @@ -4981,19 +4981,19 @@ Editor::hide_track_in_display (TimeAxisView* tv, bool apply_to_selection) TrackSelection::iterator j = i; ++j; - + hide_track_in_display (*i, false); - + i = j; } } else { RouteTimeAxisView* rtv = dynamic_cast (tv); - + if (rtv && current_mixer_strip && (rtv->route() == current_mixer_strip->route())) { // this will hide the mixer strip set_selected_mixer_strip (*tv); } - + _routes->hide_track_in_display (*tv); } } @@ -5132,7 +5132,7 @@ bool Editor::scroll_press (Direction dir) { ++_scroll_callbacks; - + if (_scroll_connection.connected() && _scroll_callbacks < 5) { /* delay the first auto-repeat */ return true; @@ -5162,7 +5162,7 @@ Editor::scroll_press (Direction dir) _scroll_connection = Glib::signal_timeout().connect ( sigc::bind (sigc::mem_fun (*this, &Editor::scroll_press), dir), 100 ); - + _scroll_callbacks = 0; } @@ -5184,15 +5184,15 @@ Editor::reset_x_origin_to_follow_playhead () if (frame < leftmost_frame || frame > leftmost_frame + current_page_frames()) { if (_session->transport_speed() < 0) { - + if (frame > (current_page_frames() / 2)) { center_screen (frame-(current_page_frames()/2)); } else { center_screen (current_page_frames()/2); } - + } else { - + if (frame < leftmost_frame) { /* moving left */ framepos_t l = 0; @@ -5203,11 +5203,11 @@ Editor::reset_x_origin_to_follow_playhead () /* not rolling: end up with the playhead 3/4 of the way along the page */ l = frame - (3 * current_page_frames() / 4); } - + if (l < 0) { l = 0; } - + center_screen_internal (l + (current_page_frames() / 2), current_page_frames ()); } else { /* moving right */ @@ -5276,12 +5276,12 @@ Editor::super_rapid_screen_update () } } else { - + /* don't do continuous scroll till the new position is in the rightmost quarter of the editor canvas */ -#if 0 - // FIXME DO SOMETHING THAT WORKS HERE - this is 2.X code +#if 0 + // FIXME DO SOMETHING THAT WORKS HERE - this is 2.X code double target = ((double)frame - (double)current_page_frames()/2.0) / frames_per_unit; if (target <= 0.0) { target = 0.0; @@ -5291,12 +5291,12 @@ Editor::super_rapid_screen_update () } else { /* relax */ } - + current = target; set_horizontal_position (current); #endif } - + } } @@ -5309,7 +5309,7 @@ Editor::session_going_away () _session_connections.drop_connections (); super_rapid_screen_update_connection.disconnect (); - + selection->clear (); cut_buffer->clear (); @@ -5388,7 +5388,7 @@ void Editor::change_region_layering_order () { framepos_t const position = get_preferred_edit_position (); - + if (!clicked_routeview) { if (layering_order_editor) { layering_order_editor->hide (); @@ -5407,7 +5407,7 @@ Editor::change_region_layering_order () if (!pl) { return; } - + if (layering_order_editor == 0) { layering_order_editor = new RegionLayeringOrderEditor(*this); } @@ -5447,7 +5447,7 @@ Editor::action_menu_item (std::string const & name) { Glib::RefPtr a = editor_actions->get_action (name); assert (a); - + return *manage (a->create_menu_item ()); } @@ -5460,7 +5460,7 @@ Editor::resize_text_widgets () set_size_request_to_display_given_text (snap_mode_selector, snap_mode_strings, COMBO_FUDGE+10, 15); set_size_request_to_display_given_text (edit_point_selector, edit_point_strings, COMBO_FUDGE+10, 15); } - + void Editor::add_notebook_page (string const & name, Gtk::Widget& widget) { diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index d19bfe4fa1..f2709e38ec 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -206,7 +206,7 @@ Editor::register_actions () string const n = string_compose (_("Goto View %1"), i); reg_sens (editor_actions, a.c_str(), n.c_str(), sigc::bind (sigc::mem_fun (*this, &Editor::cancel_visual_state_op), i - 1)); } - + for (int i = 1; i <= 9; ++i) { string const a = string_compose (X_("goto-mark-%1"), i); string const n = string_compose (_("Locate to Mark %1"), i); @@ -284,18 +284,18 @@ Editor::register_actions () act = reg_sens (editor_actions, "editor-separate", _("Separate"), sigc::mem_fun(*this, &Editor::separate_region_from_selection)); ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); - + act = reg_sens (editor_actions, "separate-from-punch", _("Separate Using Punch Range"), sigc::mem_fun(*this, &Editor::separate_region_from_punch)); ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); - + act = reg_sens (editor_actions, "separate-from-loop", _("Separate Using Loop Range"), sigc::mem_fun(*this, &Editor::separate_region_from_loop)); ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); - + act = reg_sens (editor_actions, "editor-crop", _("Crop"), sigc::mem_fun(*this, &Editor::crop_region_to_selection)); ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); - + reg_sens (editor_actions, "editor-cut", _("Cut"), sigc::mem_fun(*this, &Editor::cut)); - + reg_sens (editor_actions, "editor-copy", _("Copy"), sigc::mem_fun(*this, &Editor::copy)); reg_sens (editor_actions, "editor-paste", _("Paste"), sigc::mem_fun(*this, &Editor::keyboard_paste)); @@ -319,28 +319,28 @@ Editor::register_actions () _("Move Range Start to Previous Region Boundary"), sigc::bind (sigc::mem_fun (*this, &Editor::move_range_selection_start_or_end_to_region_boundary), false, false) ); - + reg_sens ( editor_actions, "move-range-start-to-next-region-boundary", _("Move Range Start to Next Region Boundary"), sigc::bind (sigc::mem_fun (*this, &Editor::move_range_selection_start_or_end_to_region_boundary), false, true) ); - + reg_sens ( editor_actions, "move-range-end-to-previous-region-boundary", _("Move Range End to Previous Region Boundary"), sigc::bind (sigc::mem_fun (*this, &Editor::move_range_selection_start_or_end_to_region_boundary), true, false) ); - + reg_sens ( editor_actions, "move-range-end-to-next-region-boundary", _("Move Range End to Next Region Boundary"), sigc::bind (sigc::mem_fun (*this, &Editor::move_range_selection_start_or_end_to_region_boundary), true, true) ); - + toggle_reg_sens (editor_actions, "toggle-follow-playhead", _("Follow Playhead"), (sigc::mem_fun(*this, &Editor::toggle_follow_playhead))); act = reg_sens (editor_actions, "remove-last-capture", _("Remove Last Capture"), (sigc::mem_fun(*this, &Editor::remove_last_capture))); @@ -560,16 +560,16 @@ Editor::register_actions () act = ActionManager::register_action (rl_actions, X_("rlAudition"), _("Audition"), sigc::mem_fun(*this, &Editor::audition_region_from_region_list)); ActionManager::region_list_selection_sensitive_actions.push_back (act); - + act = ActionManager::register_action (rl_actions, X_("rlHide"), _("Hide"), sigc::mem_fun(*this, &Editor::hide_region_from_region_list)); ActionManager::region_list_selection_sensitive_actions.push_back (act); - + act = ActionManager::register_action (rl_actions, X_("rlShow"), _("Show"), sigc::mem_fun(*this, &Editor::show_region_in_region_list)); ActionManager::region_list_selection_sensitive_actions.push_back (act); - + ActionManager::register_toggle_action (rl_actions, X_("rlShowAll"), _("Show All"), sigc::mem_fun(*_regions, &EditorRegions::toggle_full)); ActionManager::register_toggle_action (rl_actions, X_("rlShowAuto"), _("Show Automatic Regions"), sigc::mem_fun (*_regions, &EditorRegions::toggle_show_auto_regions)); - + ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortAscending"), _("Ascending"), sigc::bind (sigc::mem_fun (*_regions, &EditorRegions::reset_sort_direction), true)); ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortDescending"), _("Descending"), @@ -678,7 +678,7 @@ Editor::toggle_ruler_visibility (RulerType rt) } Glib::RefPtr act = ActionManager::get_action (X_("Rulers"), action); - + if (act) { Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); update_ruler_visibility (); @@ -1218,30 +1218,30 @@ void Editor::register_region_actions () { _region_actions = ActionGroup::create (X_("Region")); - + /* PART 1: actions that operate on the selection, and for which the edit point type and location is irrelevant */ /* Remove selected regions */ reg_sens (_region_actions, "remove-region", _("Remove"), sigc::mem_fun (*this, &Editor::remove_selected_regions)); - + /* Offer dialogue box to rename the first selected region */ reg_sens (_region_actions, "rename-region", _("Rename..."), sigc::mem_fun (*this, &Editor::rename_region)); - + /* Raise all selected regions by 1 layer */ reg_sens (_region_actions, "raise-region", _("Raise"), sigc::mem_fun (*this, &Editor::raise_region)); /* Raise all selected regions to the top */ reg_sens (_region_actions, "raise-region-to-top", _("Raise to Top"), sigc::mem_fun (*this, &Editor::raise_region_to_top)); - + /* Lower all selected regions by 1 layer */ reg_sens (_region_actions, "lower-region", _("Lower"), sigc::mem_fun (*this, &Editor::lower_region)); /* Lower all selected regions to the bottom */ reg_sens (_region_actions, "lower-region-to-bottom", _("Lower to Bottom"), sigc::mem_fun (*this, &Editor::lower_region_to_bottom)); - + /* Move selected regions to their original (`natural') position */ reg_sens (_region_actions, "naturalize-region", _("Move to Original Position"), sigc::mem_fun (*this, &Editor::naturalize_region)); - + /* Toggle `locked' status of selected regions */ toggle_reg_sens (_region_actions, "toggle-region-lock", _("Lock"), sigc::mem_fun(*this, &Editor::toggle_region_lock)); @@ -1251,55 +1251,55 @@ Editor::register_region_actions () _("Glue to Bars and Beats"), sigc::mem_fun (*this, &Editor::toggle_region_lock_style) ); - + /* Remove sync points from selected regions */ reg_sens (_region_actions, "remove-region-sync", _("Remove Sync"), sigc::mem_fun(*this, &Editor::remove_region_sync)); - + /* Mute or unmute selected regions */ toggle_reg_sens (_region_actions, "toggle-region-mute", _("Mute"), sigc::mem_fun(*this, &Editor::toggle_region_mute)); - + /* Open the normalize dialogue to operate on the selected regions */ reg_sens (_region_actions, "normalize-region", _("Normalize..."), sigc::mem_fun(*this, &Editor::normalize_region)); - + /* Reverse selected regions */ reg_sens (_region_actions, "reverse-region", _("Reverse"), sigc::mem_fun (*this, &Editor::reverse_region)); - + /* Split selected multi-channel regions into mono regions */ reg_sens (_region_actions, "split-multichannel-region", _("Make Mono Regions"), sigc::mem_fun (*this, &Editor::split_multichannel_region)); - + /* Boost selected region gain */ reg_sens (_region_actions, "boost-region-gain", _("Boost Gain"), sigc::bind (sigc::mem_fun(*this, &Editor::adjust_region_gain), true)); - + /* Cut selected region gain */ reg_sens (_region_actions, "cut-region-gain", _("Cut Gain"), sigc::bind (sigc::mem_fun(*this, &Editor::adjust_region_gain), false)); - + /* Open the pitch shift dialogue for any selected audio regions */ reg_sens (_region_actions, "pitch-shift-region", _("Pitch Shift..."), sigc::mem_fun (*this, &Editor::pitch_shift_region)); /* Open the transpose dialogue for any selected MIDI regions */ reg_sens (_region_actions, "transpose-region", _("Transpose..."), sigc::mem_fun (*this, &Editor::transpose_region)); - + /* Toggle selected region opacity */ toggle_reg_sens (_region_actions, "toggle-opaque-region", _("Opaque"), sigc::mem_fun (*this, &Editor::toggle_opaque_region)); - + /* Toggle active status of selected regions' fade in */ toggle_reg_sens ( _region_actions, "toggle-region-fade-in", _("Fade In"), sigc::bind (sigc::mem_fun (*this, &Editor::toggle_region_fades), 1) ); - + /* Toggle active status of selected regions' fade out */ toggle_reg_sens ( _region_actions, "toggle-region-fade-out", _("Fade Out"), sigc::bind (sigc::mem_fun(*this, &Editor::toggle_region_fades), -1) ); - + /* Toggle active status of selected regions' fade in and out */ toggle_reg_sens ( _region_actions, "toggle-region-fades", _("Fades"), sigc::bind (sigc::mem_fun(*this, &Editor::toggle_region_fades), 0) ); - + /* Open the dialogue to duplicate selected regions */ reg_sens (_region_actions, "duplicate-region", _("Duplicate"), sigc::bind (sigc::mem_fun (*this, &Editor::duplicate_dialog), false)); - + /* Open the dialogue to duplicate selected regions multiple times */ reg_sens ( _region_actions, @@ -1307,26 +1307,26 @@ Editor::register_region_actions () _("Multi-Duplicate..."), sigc::bind (sigc::mem_fun(*this, &Editor::duplicate_dialog), true) ); - + /* Fill tracks with selected regions */ reg_sens (_region_actions, "region-fill-track", _("Fill Track"), sigc::mem_fun (*this, &Editor::region_fill_track)); - + /* Set up the loop range from the selected regions */ reg_sens ( _region_actions, "set-loop-from-region", _("Set Loop Range"), sigc::bind (sigc::mem_fun (*this, &Editor::set_loop_from_region), false) ); - + /* Set up the loop range from the selected regions, and start playback of it */ reg_sens (_region_actions, "loop-region", _("Loop"), sigc::bind (sigc::mem_fun(*this, &Editor::set_loop_from_region), true)); - + /* Set the punch range from the selected regions */ reg_sens (_region_actions, "set-punch-from-region", _("Set Punch"), sigc::mem_fun (*this, &Editor::set_punch_from_region)); - + /* Add a single range marker around all selected regions */ reg_sens ( _region_actions, "add-range-marker-from-region", _("Add 1 Range Marker"), sigc::mem_fun (*this, &Editor::add_location_from_region) ); - + /* Add a range marker around each selected region */ reg_sens ( _region_actions, "add-range-markers-from-region", _("Add Range Marker(s)"), sigc::mem_fun (*this, &Editor::add_locations_from_region) @@ -1411,7 +1411,7 @@ Editor::register_region_actions () _("Nudge Forward by Capture Offset"), sigc::mem_fun (*this, &Editor::nudge_forward_capture_offset) ); - + reg_sens ( _region_actions, "nudge-backward-by-capture-offset", @@ -1421,7 +1421,7 @@ Editor::register_region_actions () reg_sens (_region_actions, "trim-region-to-loop", _("Trim to Loop"), sigc::mem_fun (*this, &Editor::trim_region_to_loop)); reg_sens (_region_actions, "trim-region-to-punch", _("Trim to Punch"), sigc::mem_fun (*this, &Editor::trim_region_to_punch)); - + reg_sens (_region_actions, "trim-to-previous-region", _("Trim to Previous"), sigc::mem_fun(*this, &Editor::trim_region_to_previous_region_end)); reg_sens (_region_actions, "trim-to-next-region", _("Trim to Next"), sigc::mem_fun(*this, &Editor::trim_region_to_next_region_start)); @@ -1448,14 +1448,14 @@ Editor::register_region_actions () _("Align Start"), sigc::bind (sigc::mem_fun(*this, &Editor::align_regions), ARDOUR::Start) ); - + reg_sens ( _region_actions, "align-regions-start-relative", _("Align Start Relative"), sigc::bind (sigc::mem_fun (*this, &Editor::align_regions_relative), ARDOUR::Start) ); - + reg_sens (_region_actions, "align-regions-end", _("Align End"), sigc::bind (sigc::mem_fun (*this, &Editor::align_regions), ARDOUR::End)); reg_sens ( @@ -1471,7 +1471,7 @@ Editor::register_region_actions () _("Align Sync"), sigc::bind (sigc::mem_fun(*this, &Editor::align_regions), ARDOUR::SyncPoint) ); - + reg_sens ( _region_actions, "align-regions-sync-relative", @@ -1485,4 +1485,4 @@ Editor::register_region_actions () _all_region_actions_sensitized = true; ActionManager::add_action_group (_region_actions); -} +} diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc index 902e3fe6e6..e21d2efe3e 100644 --- a/gtk2_ardour/editor_audio_import.cc +++ b/gtk2_ardour/editor_audio_import.cc @@ -84,7 +84,7 @@ Editor::add_external_audio_action (ImportMode mode_hint) msg.run (); return; } - + if (sfbrowser == 0) { sfbrowser = new SoundFileOmega (*this, _("Add Existing Media"), _session, 0, true, mode_hint); } else { @@ -155,7 +155,7 @@ Editor::external_audio_dialog () for (vector::iterator x = upaths.begin(); x != upaths.end(); ++x) { paths.push_back (*x); } - + ImportPosition pos = sfbrowser->get_position (); ImportMode mode = sfbrowser->get_mode (); ImportDisposition chns = sfbrowser->get_channel_disposition (); @@ -370,7 +370,7 @@ Editor::do_import (vector paths, ImportDisposition chns, ImportMode mode for (vector::iterator a = paths.begin(); a != paths.end(); ++a) { const int check = check_whether_and_how_to_import (*a, true); - + switch (check) { case 2: // user said skip @@ -388,36 +388,36 @@ Editor::do_import (vector paths, ImportDisposition chns, ImportMode mode } /* have to reset this for every file we handle */ - + if (use_timestamp) { pos = -1; } ipw.show (); - + switch (chns) { case Editing::ImportDistinctFiles: - + to_import.clear (); to_import.push_back (*a); - + if (mode == Editing::ImportToTrack) { track = get_nth_selected_audio_track (nth++); } - + ok = (import_sndfiles (to_import, mode, quality, pos, 1, -1, track, replace) == 0); break; - + case Editing::ImportDistinctChannels: - + to_import.clear (); to_import.push_back (*a); - + ok = (import_sndfiles (to_import, mode, quality, pos, -1, -1, track, replace) == 0); break; - + case Editing::ImportSerializeFiles: - + to_import.clear (); to_import.push_back (*a); @@ -521,7 +521,7 @@ Editor::import_sndfiles (vector paths, ImportMode mode, SrcQuality quali import_status.target_regions = target_regions; import_status.track = track; import_status.replace = replace; - + set_canvas_cursor (_cursors->wait); gdk_flush (); @@ -719,8 +719,8 @@ Editor::add_sources (vector paths, SourceList& sources, framepos_t& pos, region_name = bump_name_once (region_name, '.'); } - PropertyList plist; - + PropertyList plist; + plist.add (ARDOUR::Properties::start, 0); plist.add (ARDOUR::Properties::length, sources[0]->length (pos)); plist.add (ARDOUR::Properties::name, region_name); @@ -769,7 +769,7 @@ Editor::add_sources (vector paths, SourceList& sources, framepos_t& pos, if (len == 0) { len = (60 / 120) * _session->frame_rate (); } - + plist.add (ARDOUR::Properties::start, 0); plist.add (ARDOUR::Properties::length, len); plist.add (ARDOUR::Properties::name, region_name); @@ -806,19 +806,19 @@ Editor::add_sources (vector paths, SourceList& sources, framepos_t& pos, int n = 0; framepos_t rlen = 0; - for (vector >::iterator r = regions.begin(); r != regions.end(); ++r, ++n) { + for (vector >::iterator r = regions.begin(); r != regions.end(); ++r, ++n) { boost::shared_ptr ar = boost::dynamic_pointer_cast (*r); - + if (use_timestamp) { if (ar) { - + /* get timestamp for this region */ - + const boost::shared_ptr s (ar->sources().front()); const boost::shared_ptr as = boost::dynamic_pointer_cast (s); - + assert (as); - + if (as->natural_position() != 0) { pos = as->natural_position(); } else if (target_tracks == 1) { @@ -837,15 +837,15 @@ Editor::add_sources (vector paths, SourceList& sources, framepos_t& pos, pos = get_preferred_edit_position (); } } - + finish_bringing_in_material (*r, input_chan, output_chan, pos, mode, track); rlen = (*r)->length(); - + if (target_tracks != 1) { track.reset (); - } else { + } else { if (!use_timestamp || !ar) { /* line each one up right after the other */ pos += (*r)->length(); @@ -919,7 +919,7 @@ Editor::finish_bringing_in_material (boost::shared_ptr region, uint32_t existing_track = mt.front(); } - + existing_track->set_name (region->name()); } diff --git a/gtk2_ardour/editor_audiotrack.cc b/gtk2_ardour/editor_audiotrack.cc index df0b50cbbd..5eadac1ca5 100644 --- a/gtk2_ardour/editor_audiotrack.cc +++ b/gtk2_ardour/editor_audiotrack.cc @@ -74,7 +74,7 @@ Editor::toggle_meter_updating() } else { stop_updating_meters (); } - + track_canvas_allocate (track_canvas->get_allocation()); } diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 816f551fcf..1066023e0d 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -118,7 +118,7 @@ Editor::initialize_canvas () gint phys_height = physical_screen_height (Glib::RefPtr()); _verbose_cursor = new VerboseCursor (this); - + /* on the bottom, an image */ if (Profile->get_sae()) { @@ -341,7 +341,7 @@ Editor::reset_controls_layout_width () } /* the controls layout has no horizontal scrolling, its visible - width is always equal to the total width of its contents. + width is always equal to the total width of its contents. */ controls_layout.property_width() = w; @@ -355,10 +355,10 @@ Editor::reset_controls_layout_height (int32_t h) */ controls_layout.property_height() = h; - + /* size request is set elsewhere, see ::track_canvas_allocate() */ } - + bool Editor::track_canvas_map_handler (GdkEventAny* /*ev*/) { diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index 5b527d57de..5dbc94a897 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -294,7 +294,7 @@ Editor::canvas_stream_view_event (GdkEvent *event, ArdourCanvas::Item* item, Rou case GDK_LEAVE_NOTIFY: set_entered_track (0); break; - + default: break; } diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 76b297a08c..ee6332e065 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -86,7 +86,7 @@ void DragManager::abort () { _ending = true; - + for (list::const_iterator i = _drags.begin(); i != _drags.end(); ++i) { (*i)->abort (); delete *i; @@ -97,7 +97,7 @@ DragManager::abort () } _drags.clear (); - + _ending = false; } @@ -122,9 +122,9 @@ DragManager::start_grab (GdkEvent* e, Gdk::Cursor* c) /* Prevent follow playhead during the drag to be nice to the user */ _old_follow_playhead = _editor->follow_playhead (); _editor->set_follow_playhead (false); - + _current_pointer_frame = _editor->event_frame (e, &_current_pointer_x, &_current_pointer_y); - + for (list::const_iterator i = _drags.begin(); i != _drags.end(); ++i) { (*i)->start_grab (e, c); } @@ -137,7 +137,7 @@ bool DragManager::end_grab (GdkEvent* e) { _ending = true; - + bool r = false; for (list::iterator i = _drags.begin(); i != _drags.end(); ++i) { bool const t = (*i)->end_grab (e); @@ -152,7 +152,7 @@ DragManager::end_grab (GdkEvent* e) _ending = false; _editor->set_follow_playhead (_old_follow_playhead, false); - + return r; } @@ -162,13 +162,13 @@ DragManager::motion_handler (GdkEvent* e, bool from_autoscroll) bool r = false; _current_pointer_frame = _editor->event_frame (e, &_current_pointer_x, &_current_pointer_y); - + for (list::iterator i = _drags.begin(); i != _drags.end(); ++i) { bool const t = (*i)->motion_handler (e, from_autoscroll); if (t) { r = true; } - + } return r; @@ -185,7 +185,7 @@ DragManager::have_item (ArdourCanvas::Item* i) const return j != _drags.end (); } -Drag::Drag (Editor* e, ArdourCanvas::Item* i) +Drag::Drag (Editor* e, ArdourCanvas::Item* i) : _editor (e) , _item (i) , _pointer_frame_offset (0) @@ -337,7 +337,7 @@ Drag::motion_handler (GdkEvent* event, bool from_autoscroll) _last_pointer_x = _drags->current_pointer_x (); _last_pointer_y = _drags->current_pointer_y (); _last_pointer_frame = adjusted_current_frame (event); - + return true; } } @@ -374,7 +374,7 @@ void Drag::show_verbose_cursor_duration (framepos_t start, framepos_t end, double xoffset) { _editor->verbose_cursor()->show (xoffset); - + _editor->verbose_cursor()->set_duration ( start, end, _drags->current_pointer_x() + 10 - _editor->horizontal_position(), @@ -386,7 +386,7 @@ void Drag::show_verbose_cursor_text (string const & text) { _editor->verbose_cursor()->show (); - + _editor->verbose_cursor()->set ( text, _drags->current_pointer_x() + 10 - _editor->horizontal_position(), @@ -417,7 +417,7 @@ RegionDrag::RegionDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, listhidden()) { - + _time_axis_views.push_back (*i); TimeAxisView::Children children_list = (*i)->get_child_list (); @@ -429,11 +429,11 @@ RegionDrag::RegionDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list::const_iterator i = v.begin(); i != v.end(); ++i) { _views.push_back (DraggingView (*i, this)); } - + RegionView::RegionViewGoingAway.connect (death_connection, invalidator (*this), ui_bind (&RegionDrag::region_going_away, this, _1), gui_context()); } @@ -463,7 +463,7 @@ RegionDrag::find_time_axis_view (TimeAxisView* t) const if (i == N) { return -1; } - + return i; } @@ -499,19 +499,19 @@ RegionMotionDrag::compute_x_delta (GdkEvent const * event, framepos_t* pending_r framepos_t sync_frame; framecnt_t sync_offset; int32_t sync_dir; - + sync_offset = _primary->region()->sync_offset (sync_dir); - + /* we don't handle a sync point that lies before zero. */ if (sync_dir >= 0 || (sync_dir < 0 && *pending_region_position >= sync_offset)) { - + sync_frame = *pending_region_position + (sync_dir*sync_offset); - + _editor->snap_to_with_modifier (sync_frame, event); - + *pending_region_position = _primary->region()->adjust_to_sync (sync_frame); - + } else { *pending_region_position = _last_frame_position; } @@ -566,7 +566,7 @@ RegionMotionDrag::y_movement_allowed (int delta_track, layer_t delta_layer) cons /* not a track, or the wrong type */ return false; } - + int const l = i->layer + delta_layer; if (delta_track == 0 && (l < 0 || l >= int (to->view()->layers()))) { /* Off the top or bottom layer; note that we only refuse if the track hasn't changed. @@ -637,39 +637,39 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move) /* here we are calculating the y distance from the top of the first track view to the top of the region area of the track view that we're working on */ - + /* this x value is just a dummy value so that we have something to pass to i2w () */ - + double ix1 = 0; - + /* distance from the top of this track view to the region area of our track view is always 1 */ - + double iy1 = 1; - + /* convert to world coordinates, ie distance from the top of the ruler section */ - + rv->get_canvas_frame()->i2w (ix1, iy1); - + /* compensate for the ruler section and the vertical scrollbar position */ iy1 += _editor->get_trackview_group_vertical_offset (); - + // hide any dependent views - + rv->get_time_axis_view().hide_dependent_views (*rv); - + /* reparent to a non scrolling group so that we can keep the region selection above all time axis views. reparenting means we have to move the rv as the two parent groups have different coordinates. */ - + rv->get_canvas_group()->property_y() = iy1 - 1; rv->get_canvas_group()->reparent (*(_editor->_region_motion_group)); - + rv->fake_set_opaque (true); } @@ -727,7 +727,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move) } /* foreach region */ _total_x_delta += x_delta; - + if (first_move) { _editor->cursor_group->raise_to_top(); } @@ -750,7 +750,7 @@ RegionMoveDrag::motion (GdkEvent* event, bool first_move) list new_regionviews; for (list::const_iterator i = _views.begin(); i != _views.end(); ++i) { - + RegionView* rv = i->view; AudioRegionView* arv = dynamic_cast(rv); MidiRegionView* mrv = dynamic_cast(rv); @@ -758,12 +758,12 @@ RegionMoveDrag::motion (GdkEvent* event, bool first_move) const boost::shared_ptr original = rv->region(); boost::shared_ptr region_copy = RegionFactory::create (original, true); region_copy->set_position (original->position()); - + RegionView* nrv; if (arv) { boost::shared_ptr audioregion_copy = boost::dynamic_pointer_cast(region_copy); - + nrv = new AudioRegionView (*arv, audioregion_copy); } else if (mrv) { boost::shared_ptr midiregion_copy @@ -772,29 +772,29 @@ RegionMoveDrag::motion (GdkEvent* event, bool first_move) } else { continue; } - + nrv->get_canvas_group()->show (); new_regionviews.push_back (DraggingView (nrv, this)); - + /* swap _primary to the copy */ - + if (rv == _primary) { _primary = nrv; } - + /* ..and deselect the one we copied */ - + rv->set_selected (false); } - + if (!new_regionviews.empty()) { - + /* reflect the fact that we are dragging the copies */ - + _views = new_regionviews; - + swap_grab (new_regionviews.front().view->get_canvas_group (), 0, event ? event->motion.time : 0); - + /* sync the canvas to what we think is its current state without it, the canvas seems to @@ -832,23 +832,23 @@ RegionMoveDrag::finished (GdkEvent *, bool movement_occurred) framecnt_t const drag_delta = _primary->region()->position() - _last_frame_position; _editor->update_canvas_now (); - + if (_copy) { - + finished_copy ( changed_position, changed_tracks, drag_delta ); - + } else { - + finished_no_copy ( changed_position, changed_tracks, drag_delta ); - + } } @@ -894,13 +894,13 @@ RegionMoveDrag::finished_copy (bool const changed_position, bool const /*changed RegionView* new_view = insert_region_into_playlist ( i->view->region(), dynamic_cast (_time_axis_views[i->time_axis_view]), i->layer, where, modified_playlists ); - + if (new_view == 0) { continue; } new_views.push_back (new_view); - + /* we don't need the copied RegionView any more */ views_to_delete.push_back (i->view); } @@ -913,8 +913,8 @@ RegionMoveDrag::finished_copy (bool const changed_position, bool const /*changed delete *i; } - /* If we've created new regions either by copying or moving - to a new track, we want to replace the old selection with the new ones + /* If we've created new regions either by copying or moving + to a new track, we want to replace the old selection with the new ones */ if (new_views.size() > 0) { @@ -998,7 +998,7 @@ RegionMoveDrag::finished_no_copy ( remove_region_from_playlist (rv->region(), i->initial_playlist, modified_playlists); } else { - + rv->region()->clear_changes (); /* @@ -1014,12 +1014,12 @@ RegionMoveDrag::finished_no_copy ( /* just change the model */ boost::shared_ptr playlist = dest_rtv->playlist(); - + if (dest_rtv->view()->layer_display() == Stacked) { rv->region()->set_layer (dest_layer); rv->region()->set_pending_explicit_relayer (true); } - + /* freeze playlist to avoid lots of relayering in the case of a multi-region drag */ pair r = frozen_playlists.insert (playlist); @@ -1031,7 +1031,7 @@ RegionMoveDrag::finished_no_copy ( /* this movement may result in a crossfade being modified, so we need to get undo data from the playlist as well as the region. */ - + r = modified_playlists.insert (playlist); if (r.second) { playlist->clear_changes (); @@ -1043,7 +1043,7 @@ RegionMoveDrag::finished_no_copy ( } if (changed_tracks) { - + /* OK, this is where it gets tricky. If the playlist was being used by >1 tracks, and the region was selected in all of them, then removing it from a playlist will have removed all trace of it from _views (i.e. there were N regions selected, we removed 1, @@ -1061,7 +1061,7 @@ RegionMoveDrag::finished_no_copy ( we can just iterate. */ - + if (_views.empty()) { break; } else { @@ -1073,8 +1073,8 @@ RegionMoveDrag::finished_no_copy ( } } - /* If we've created new regions either by copying or moving - to a new track, we want to replace the old selection with the new ones + /* If we've created new regions either by copying or moving + to a new track, we want to replace the old selection with the new ones */ if (new_views.size() > 0) { @@ -1112,7 +1112,7 @@ RegionMoveDrag::remove_region_from_playlist ( playlist->remove_region (region); } - + /** Insert a region into a playlist, handling the recovery of the resulting new RegionView, and * clearing the playlist's diff history first if necessary. @@ -1121,7 +1121,7 @@ RegionMoveDrag::remove_region_from_playlist ( * @param dest_layer Destination layer. * @param where Destination position. * @param modified_playlists The playlist will be added to this if it is not there already; used to ensure - * that clear_changes () is only called once per playlist. + * that clear_changes () is only called once per playlist. * @return New RegionView, or 0 if no insert was performed. */ RegionView * @@ -1142,7 +1142,7 @@ RegionMoveDrag::insert_region_into_playlist ( _new_region_view = 0; sigc::connection c = dest_rtv->view()->RegionViewAdded.connect (sigc::mem_fun (*this, &RegionMoveDrag::collect_new_region_view)); - /* clear history for the playlist we are about to insert to, provided we haven't already done so */ + /* clear history for the playlist we are about to insert to, provided we haven't already done so */ pair r = modified_playlists.insert (dest_playlist); if (r.second) { dest_playlist->clear_changes (); @@ -1225,7 +1225,7 @@ RegionMoveDrag::RegionMoveDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, _copy (c) { DEBUG_TRACE (DEBUG::Drags, "New RegionMoveDrag\n"); - + double speed = 1; RouteTimeAxisView* rtv = dynamic_cast (&_primary->get_time_axis_view ()); if (rtv && rtv->is_track()) { @@ -1245,7 +1245,7 @@ RegionInsertDrag::RegionInsertDrag (Editor* e, boost::shared_ptr r, Rout : RegionMotionDrag (e, 0, 0, list (), false) { DEBUG_TRACE (DEBUG::Drags, "New RegionInsertDrag\n"); - + assert ((boost::dynamic_pointer_cast (r) && dynamic_cast (v)) || (boost::dynamic_pointer_cast (r) && dynamic_cast (v))); @@ -1393,7 +1393,7 @@ RegionCreateDrag::RegionCreateDrag (Editor* e, ArdourCanvas::Item* i, TimeAxisVi _view (dynamic_cast (v)) { DEBUG_TRACE (DEBUG::Drags, "New RegionCreateDrag\n"); - + assert (_view); } @@ -1409,14 +1409,14 @@ RegionCreateDrag::motion (GdkEvent* event, bool first_move) if (f < grab_frame()) { _region->set_position (f); } - + /* Don't use a zero-length region, and subtract 1 frame from the snapped length so that if this region is duplicated, its duplicate starts on a snap point rather than 1 frame after a snap point. Otherwise things get a bit confusing as if a region starts 1 frame after a snap point, one cannot place snapped notes at the start of the region. */ - + framecnt_t const len = abs (f - grab_frame () - 1); _region->set_length (len < 1 ? 1 : len); } @@ -1717,7 +1717,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move) } framecnt_t frame_delta = 0; - + bool left_direction = false; if (last_pointer_frame() > adjusted_current_frame(event)) { left_direction = true; @@ -1765,7 +1765,7 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred) i->view->trim_front_ending (); } } - + if (!_editor->selection->selected (_primary)) { _primary->thaw_after_trim (); } else { @@ -1807,7 +1807,7 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred) if (_operation == StartTrim) { i->view->trim_front_ending (); } - + i->view->region()->resume_property_changes (); } } @@ -1821,7 +1821,7 @@ TrimDrag::aborted (bool movement_occurred) */ finished (0, true); - + if (movement_occurred) { _editor->undo (); } @@ -1860,7 +1860,7 @@ MeterMarkerDrag::MeterMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c) _copy (c) { DEBUG_TRACE (DEBUG::Drags, "New MeterMarkerDrag\n"); - + _marker = reinterpret_cast (_item->get_data ("marker")); assert (_marker); } @@ -1912,7 +1912,7 @@ MeterMarkerDrag::motion (GdkEvent* event, bool) framepos_t const pf = adjusted_current_frame (event); _marker->set_position (pf); - + show_verbose_cursor_time (pf); } @@ -1962,7 +1962,7 @@ TempoMarkerDrag::TempoMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c) _copy (c) { DEBUG_TRACE (DEBUG::Drags, "New TempoMarkerDrag\n"); - + _marker = reinterpret_cast (_item->get_data ("marker")); assert (_marker); } @@ -1999,7 +1999,7 @@ void TempoMarkerDrag::setup_pointer_frame_offset () { _pointer_frame_offset = raw_grab_frame() - _marker->tempo().frame(); -} +} void TempoMarkerDrag::motion (GdkEvent* event, bool) @@ -2065,7 +2065,7 @@ void CursorDrag::fake_locate (framepos_t t) { _editor->playhead_cursor->set_position (t); - + Session* s = _editor->session (); if (s->timecode_transmission_suspended ()) { framepos_t const f = _editor->playhead_cursor->current_frame; @@ -2088,24 +2088,24 @@ CursorDrag::start_grab (GdkEvent* event, Gdk::Cursor* c) _editor->snap_to_with_modifier (where, event); _editor->_dragging_playhead = true; - + Session* s = _editor->session (); - + if (s) { if (_was_rolling && _stop) { s->request_stop (); } - + if (s->is_auditioning()) { s->cancel_audition (); } - + s->request_suspend_timecode_transmission (); while (!s->timecode_transmission_suspended ()) { /* twiddle our thumbs */ } } - + fake_locate (where); } @@ -2122,7 +2122,7 @@ CursorDrag::motion (GdkEvent* event, bool) double const scale_range = 4; /* dead zone around the grab point in which to do no zooming (pixels) */ double const dead_zone = 16; - + /* current dy */ double dy = _drags->current_pointer_y() - grab_y(); @@ -2133,7 +2133,7 @@ CursorDrag::motion (GdkEvent* event, bool) } else { dy -= dead_zone; } - + /* get a number from -1 to 1 as dy ranges from -y_range to y_range */ double udy = max (min (dy / y_range, 1.0), -1.0); @@ -2144,7 +2144,7 @@ CursorDrag::motion (GdkEvent* event, bool) _editor->set_zoom_focus (zf); } } - + framepos_t const adjusted_frame = adjusted_current_frame (event); if (adjusted_frame != last_pointer_frame()) { fake_locate (adjusted_frame); @@ -2180,7 +2180,7 @@ CursorDrag::aborted (bool) _editor->session()->request_resume_timecode_transmission (); _editor->_dragging_playhead = false; } - + _editor->playhead_cursor->set_position (adjusted_frame (grab_frame (), 0, false)); } @@ -2199,7 +2199,7 @@ FadeInDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) boost::shared_ptr const r = arv->audio_region (); show_verbose_cursor_duration (r->position(), r->position() + r->fade_in()->back()->when, 32); - + arv->show_fade_line((framepos_t) r->fade_in()->back()->when); } @@ -2318,7 +2318,7 @@ FadeOutDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) boost::shared_ptr r = arv->audio_region (); show_verbose_cursor_duration (r->last_frame() - r->fade_out()->back()->when, r->last_frame()); - + arv->show_fade_line(r->length() - r->fade_out()->back()->when); } @@ -2328,7 +2328,7 @@ FadeOutDrag::setup_pointer_frame_offset () AudioRegionView* arv = dynamic_cast (_primary); boost::shared_ptr r = arv->audio_region (); _pointer_frame_offset = raw_grab_frame() - (r->length() - (framecnt_t) r->fade_out()->back()->when + r->position()); -} +} void FadeOutDrag::motion (GdkEvent* event, bool) @@ -2430,7 +2430,7 @@ MarkerDrag::MarkerDrag (Editor* e, ArdourCanvas::Item* i) : Drag (e, i) { DEBUG_TRACE (DEBUG::Drags, "New MarkerDrag\n"); - + _marker = reinterpret_cast (_item->get_data ("marker")); assert (_marker); @@ -2753,7 +2753,7 @@ ControlPointDrag::ControlPointDrag (Editor* e, ArdourCanvas::Item* i) _cumulative_y_drag (0) { DEBUG_TRACE (DEBUG::Drags, "New ControlPointDrag\n"); - + _point = reinterpret_cast (_item->get_data ("control_point")); assert (_point); } @@ -2819,7 +2819,7 @@ ControlPointDrag::motion (GdkEvent* event, bool) cy = min ((double) _point->line().height(), cy); framepos_t cx_frames = _editor->unit_to_frame (cx); - + if (!_x_constrained) { _editor->snap_to_with_modifier (cx_frames, event); } @@ -2849,7 +2849,7 @@ ControlPointDrag::finished (GdkEvent* event, bool movement_occurred) } else { motion (event, false); } - + _point->line().end_drag (); _editor->session()->commit_reversible_command (); } @@ -2901,7 +2901,7 @@ LineDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*cursor*/) uint32_t before; uint32_t after; - + if (!_line->control_points_adjacent (frame_within_region, before, after)) { /* no adjacent points */ return; @@ -2982,7 +2982,7 @@ void FeatureLineDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*cursor*/) { Drag::start_grab (event); - + _line = reinterpret_cast (_item); assert (_line); @@ -2995,9 +2995,9 @@ FeatureLineDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*cursor*/) /* store grab start in parent frame */ _region_view_grab_x = cx; - + _before = *(float*) _item->get_data ("position"); - + _arv = reinterpret_cast (_item->get_data ("regionview")); _max_x = _editor->frame_to_pixel(_arv->get_duration()); @@ -3007,34 +3007,34 @@ void FeatureLineDrag::motion (GdkEvent*, bool) { double dx = _drags->current_pointer_x() - last_pointer_x(); - + double cx = _region_view_grab_x + _cumulative_x_drag + dx; - + _cumulative_x_drag += dx; - + /* Clamp the min and max extent of the drag to keep it within the region view bounds */ - + if (cx > _max_x){ cx = _max_x; } else if(cx < 0){ cx = 0; } - + ArdourCanvas::Points points; - + double x1 = 0, x2 = 0, y1 = 0, y2 = 0; _line->get_bounds(x1, y2, x2, y2); - + points.push_back(Gnome::Art::Point(cx, 2.0)); // first x-coord needs to be a non-normal value points.push_back(Gnome::Art::Point(cx, y2 - y1)); _line->property_points() = points; - + float *pos = new float; *pos = cx; - + _line->set_data ("position", pos); _before = cx; @@ -3354,7 +3354,7 @@ SelectionDrag::motion (GdkEvent* event, bool first_move) if (pending_time_axis.first == 0) { return; } - + framepos_t const pending_position = adjusted_current_frame (event); /* only alter selection if things have changed */ @@ -3399,7 +3399,7 @@ SelectionDrag::motion (GdkEvent* event, bool first_move) //_editor->selection->set (_editor->clicked_axisview); _editor->set_selected_track_as_side_effect (Selection::Set); } - + _editor->clicked_selection = _editor->selection->set (start, end); } } @@ -3414,7 +3414,7 @@ SelectionDrag::motion (GdkEvent* event, bool first_move) /* deselect any tracks that this drag no longer includes, being careful to only deselect tracks that we selected in the first place. */ - + int min_order = min (_original_pointer_time_axis, pending_time_axis.first->order()); int max_order = max (_original_pointer_time_axis, pending_time_axis.first->order()); @@ -3423,7 +3423,7 @@ SelectionDrag::motion (GdkEvent* event, bool first_move) list::iterator tmp = i; ++tmp; - + if ((*i)->order() < min_order || (*i)->order() > max_order) { _editor->selection->remove (*i); _added_time_axes.remove (*i); @@ -3518,7 +3518,7 @@ SelectionDrag::finished (GdkEvent* event, bool movement_occurred) if (_editor->clicked_axisview && !_editor->selection->selected (_editor->clicked_axisview)) { _editor->selection->set (_editor->clicked_axisview); } - + if (s && s->get_play_range () && s->transport_rolling()) { s->request_stop (false, false); } @@ -3540,8 +3540,8 @@ RangeMarkerBarDrag::RangeMarkerBarDrag (Editor* e, ArdourCanvas::Item* i, Operat _copy (false) { DEBUG_TRACE (DEBUG::Drags, "New RangeMarkerBarDrag\n"); - - _drag_rect = new ArdourCanvas::SimpleRect (*_editor->time_line_group, 0.0, 0.0, 0.0, + + _drag_rect = new ArdourCanvas::SimpleRect (*_editor->time_line_group, 0.0, 0.0, 0.0, physical_screen_height (_editor->get_window())); _drag_rect->hide (); @@ -3609,7 +3609,7 @@ RangeMarkerBarDrag::motion (GdkEvent* event, bool first_move) if (_operation == CreateRangeMarker || _operation == CreateTransportMarker || _operation == CreateCDMarker) { framepos_t grab = grab_frame (); _editor->snap_to (grab); - + if (pf < grab_frame()) { start = pf; end = grab; @@ -3683,7 +3683,7 @@ RangeMarkerBarDrag::finished (GdkEvent* event, bool movement_occurred) newloc = new Location ( *_editor->session(), _editor->temp_location->start(), _editor->temp_location->end(), rangename, (Location::Flags) flags ); - + _editor->session()->locations()->add (newloc, true); XMLNode &after = _editor->session()->locations()->get_state(); _editor->session()->add_command(new MementoCommand(*(_editor->session()->locations()), &before, &after)); @@ -3767,7 +3767,7 @@ MouseZoomDrag::start_grab (GdkEvent* event, Gdk::Cursor *) Drag::start_grab (event, _editor->cursors()->zoom_in); _zoom_out = false; } - + show_verbose_cursor_time (adjusted_current_frame (event)); } @@ -3879,7 +3879,7 @@ NoteDrag::total_dx () const /* primary note time */ frameoffset_t const n = _region->beats_to_frames (_primary->note()->time ()); - + /* new time of the primary note relative to the region position */ frameoffset_t st = n + dx; @@ -3911,11 +3911,11 @@ NoteDrag::total_dy () const } /* more positive value = higher pitch and higher y-axis position on track, - which is the inverse of the X-centric geometric universe + which is the inverse of the X-centric geometric universe */ - return -ndy; -} + return -ndy; +} void NoteDrag::motion (GdkEvent *, bool) @@ -3939,7 +3939,7 @@ NoteDrag::motion (GdkEvent *, bool) char buf[12]; snprintf (buf, sizeof (buf), "%s (%d)", Evoral::midi_note_name (_primary->note()->note() + note_delta).c_str(), (int) floor (_primary->note()->note() + note_delta)); - + show_verbose_cursor_text (buf); } } @@ -3985,7 +3985,7 @@ AutomationRangeDrag::AutomationRangeDrag (Editor* editor, ArdourCanvas::Item* it , _nothing_to_drag (false) { DEBUG_TRACE (DEBUG::Drags, "New AutomationRangeDrag\n"); - + _atav = reinterpret_cast (_item->get_data ("trackview")); assert (_atav); @@ -4043,13 +4043,13 @@ AutomationRangeDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) i->points.push_back (i->line->nth (j)); } } - + } else { for (list::const_iterator i = _ranges.begin(); i != _ranges.end(); ++i) { framecnt_t const half = (i->start + i->end) / 2; - + /* find the line that this audio range starts in */ list::iterator j = _lines.begin(); while (j != _lines.end() && (j->range.first > i->start || j->range.second < i->start)) { @@ -4058,7 +4058,7 @@ AutomationRangeDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) if (j != _lines.end()) { boost::shared_ptr the_list = j->line->the_list (); - + /* j is the line that this audio range starts in; fade into it; 64 samples length plucked out of thin air. */ @@ -4078,7 +4078,7 @@ AutomationRangeDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) } /* same thing for the end */ - + j = _lines.begin(); while (j != _lines.end() && (j->range.first > i->end || j->range.second < i->end)) { ++j; @@ -4086,11 +4086,11 @@ AutomationRangeDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) if (j != _lines.end()) { boost::shared_ptr the_list = j->line->the_list (); - + /* j is the line that this audio range starts in; fade out of it; 64 samples length plucked out of thin air. */ - + framepos_t b = i->end - 64; if (b < half) { b = half; @@ -4098,7 +4098,7 @@ AutomationRangeDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) double const p = j->line->time_converter().from (b - j->line->time_converter().origin_b ()); double const q = j->line->time_converter().from (i->end - j->line->time_converter().origin_b ()); - + the_list->add (p, the_list->eval (p)); j->line->add_always_in_view (p); the_list->add (q, the_list->eval (q)); @@ -4166,7 +4166,7 @@ AutomationRangeDrag::finished (GdkEvent* event, bool) if (_nothing_to_drag) { return; } - + motion (event, false); for (list::iterator i = _lines.begin(); i != _lines.end(); ++i) { i->line->end_drag (); @@ -4212,7 +4212,7 @@ PatchChangeDrag::motion (GdkEvent* ev, bool) boost::shared_ptr r = _region_view->region (); f = max (f, r->position ()); f = min (f, r->last_frame ()); - + framecnt_t const dxf = f - grab_frame(); double const dxu = _editor->frame_to_unit (dxf); _patch_change->move (dxu - _cumulative_dx, 0); @@ -4227,11 +4227,11 @@ PatchChangeDrag::finished (GdkEvent* ev, bool movement_occurred) } boost::shared_ptr r (_region_view->region ()); - + framepos_t f = adjusted_current_frame (ev); f = max (f, r->position ()); f = min (f, r->last_frame ()); - + _region_view->move_patch_change ( *_patch_change, _region_view->frames_to_beats (f - r->position() - r->start()) diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index 3277f0334c..113e54c88e 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -124,7 +124,7 @@ public: ARDOUR::framepos_t adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap = true) const; ARDOUR::framepos_t adjusted_current_frame (GdkEvent const *, bool snap = true) const; - + /** Called to start a grab of an item. * @param e Event that caused the grab to start. * @param c Cursor to use, or 0. @@ -275,9 +275,9 @@ protected: int _visible_y_high; friend class DraggingView; - + private: - + void region_going_away (RegionView *); PBD::ScopedConnection death_connection; }; @@ -369,7 +369,7 @@ private: void add_stateful_diff_commands_for_playlists (PlaylistSet const &); void collect_new_region_view (RegionView *); - + bool _copy; RegionView* _new_region_view; }; @@ -447,7 +447,7 @@ class NoteDrag : public Drag ARDOUR::frameoffset_t total_dx () const; int8_t total_dy () const; - + MidiRegionView* _region; Gnome::Canvas::CanvasNoteEvent* _primary; double _cumulative_dx; @@ -515,7 +515,7 @@ public: } void setup_pointer_frame_offset (); - + private: Operation _operation; @@ -541,7 +541,7 @@ public: } void setup_pointer_frame_offset (); - + private: MeterMarker* _marker; bool _copy; @@ -567,7 +567,7 @@ public: } void setup_pointer_frame_offset (); - + private: TempoMarker* _marker; bool _copy; @@ -596,10 +596,10 @@ public: bool y_movement_matters () const { return true; } - + private: void fake_locate (framepos_t); - + bool _stop; ///< true to stop the transport on starting the drag, otherwise false double _grab_zoom; ///< editor frames per unit when our grab started }; @@ -661,7 +661,7 @@ public: } void setup_pointer_frame_offset (); - + private: void update_item (ARDOUR::Location *); @@ -737,10 +737,10 @@ private: ArdourCanvas::Line* _line; AudioRegionView* _arv; - + double _region_view_grab_x; double _cumulative_x_drag; - + float _before; uint32_t _max_x; }; @@ -891,9 +891,9 @@ private: std::pair range; ///< the range of all points on the line, in session frames XMLNode* state; ///< the XML state node before the drag }; - + std::list _lines; - + bool _nothing_to_drag; }; diff --git a/gtk2_ardour/editor_group_tabs.cc b/gtk2_ardour/editor_group_tabs.cc index 8839748110..d98c064bff 100644 --- a/gtk2_ardour/editor_group_tabs.cc +++ b/gtk2_ardour/editor_group_tabs.cc @@ -85,7 +85,7 @@ EditorGroupTabs::draw_tab (cairo_t* cr, Tab const & tab) const } else { cairo_set_source_rgba (cr, 1, 1, 1, 0.2); } - + cairo_move_to (cr, 0, tab.from + arc_radius); cairo_arc (cr, _width, tab.from + arc_radius, arc_radius, M_PI, 3 * M_PI / 2); cairo_line_to (cr, _width, tab.to); @@ -95,10 +95,10 @@ EditorGroupTabs::draw_tab (cairo_t* cr, Tab const & tab) const if (tab.group) { pair const f = fit_to_pixels (cr, tab.group->name(), tab.to - tab.from - arc_radius * 2); - + cairo_text_extents_t ext; cairo_text_extents (cr, tab.group->name().c_str(), &ext); - + cairo_set_source_rgb (cr, 1, 1, 1); cairo_move_to (cr, _width - ext.height / 2, tab.from + (f.second + tab.to - tab.from) / 2); cairo_save (cr); @@ -119,7 +119,7 @@ EditorGroupTabs::routes_for_tab (Tab const * t) const { RouteList routes; int32_t y = 0; - + for (TrackViewList::iterator i = _editor->track_views.begin(); i != _editor->track_views.end(); ++i) { if ((*i)->marked_for_display() == false) { @@ -152,7 +152,7 @@ void EditorGroupTabs::add_menu_items (Gtk::Menu* m, RouteGroup* g) { using namespace Gtk::Menu_Helpers; - + if (g) { MenuList& items = m->items (); items.push_back (MenuElem (_("Fit to Window"), sigc::bind (sigc::mem_fun (*_editor, &Editor::fit_route_group), g))); @@ -163,7 +163,7 @@ PBD::PropertyList EditorGroupTabs::default_properties () const { PBD::PropertyList plist; - + plist.add (Properties::active, true); plist.add (Properties::mute, true); plist.add (Properties::solo, true); @@ -172,7 +172,7 @@ EditorGroupTabs::default_properties () const return plist; } - + string EditorGroupTabs::order_key () const { diff --git a/gtk2_ardour/editor_locations.cc b/gtk2_ardour/editor_locations.cc index ea96f5f514..bbaf0daf75 100644 --- a/gtk2_ardour/editor_locations.cc +++ b/gtk2_ardour/editor_locations.cc @@ -41,7 +41,7 @@ EditorLocations::set_session (ARDOUR::Session* s) } Widget& -EditorLocations::widget() +EditorLocations::widget() { return _scroller; } diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index b060b11a63..c1f06a18c1 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -103,11 +103,11 @@ Editor::add_new_location_internal (Location* location) lam->start = new Marker (*this, *marker_group, color, location->name(), Marker::Mark, location->start()); group = marker_group; } - + lam->end = 0; } else if (location->is_auto_loop()) { - + // transport marker lam->start = new Marker (*this, *transport_marker_group, color, location->name(), Marker::LoopStart, location->start()); @@ -116,21 +116,21 @@ Editor::add_new_location_internal (Location* location) group = transport_marker_group; } else if (location->is_auto_punch()) { - + // transport marker lam->start = new Marker (*this, *transport_marker_group, color, location->name(), Marker::PunchIn, location->start()); lam->end = new Marker (*this, *transport_marker_group, color, location->name(), Marker::PunchOut, location->end()); group = transport_marker_group; - + } else if (location->is_session_range()) { // session range lam->start = new Marker (*this, *marker_group, color, _("start"), Marker::SessionStart, location->start()); lam->end = new Marker (*this, *marker_group, color, _("end"), Marker::SessionEnd, location->end()); group = marker_group; - + } else { // range marker if (location->is_cd_marker() && ruler_cd_marker_action->get_active()) { @@ -222,7 +222,7 @@ Editor::check_marker_label (Marker* m) { /* Get a time-ordered list of markers from the last time anything changed */ std::list& sorted = _sorted_marker_lists[m->get_parent()]; - + list::iterator i = find (sorted.begin(), sorted.end(), m); list::iterator prev = sorted.end (); @@ -256,7 +256,7 @@ Editor::check_marker_label (Marker* m) if (prev != sorted.end()) { /* Update just the available space between the previous marker and this one */ - + double const p = frame_to_pixel (m->position() - (*prev)->position()); if (m->label_on_left()) { @@ -264,7 +264,7 @@ Editor::check_marker_label (Marker* m) } else { (*prev)->set_right_label_limit (p); } - + if ((*prev)->label_on_left ()) { m->set_left_label_limit (p); } else { @@ -275,7 +275,7 @@ Editor::check_marker_label (Marker* m) if (next != sorted.end()) { /* Update just the available space between this marker and the next */ - + double const p = frame_to_pixel ((*next)->position() - m->position()); if ((*next)->label_on_left()) { @@ -318,7 +318,7 @@ Editor::update_marker_labels (ArdourCanvas::Group* group) } /* We sort the list of markers and then set up the space available between each one */ - + sorted.sort (MarkerComparator ()); list::iterator i = sorted.begin (); @@ -326,18 +326,18 @@ Editor::update_marker_labels (ArdourCanvas::Group* group) list::iterator prev = sorted.end (); list::iterator next = i; ++next; - + while (i != sorted.end()) { if (prev != sorted.end()) { double const p = frame_to_pixel ((*i)->position() - (*prev)->position()); - + if ((*prev)->label_on_left()) { (*i)->set_left_label_limit (p); } else { (*i)->set_left_label_limit (p / 2); } - + } if (next != sorted.end()) { @@ -573,7 +573,7 @@ Editor::LocationMarkers::set_name (const string& str) if (start->type() != Marker::SessionStart) { start->set_name (str); } - + if (end && end->type() != Marker::SessionEnd) { end->set_name (str); } @@ -730,7 +730,7 @@ void Editor::tempo_or_meter_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item) { marker_menu_item = item; - + MeterMarker* mm; TempoMarker* tm; dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm); @@ -744,7 +744,7 @@ Editor::tempo_or_meter_marker_context_menu (GdkEventButton* ev, ArdourCanvas::It } else { return; } - + delete tempo_or_meter_marker_menu; build_tempo_or_meter_marker_menu (can_remove); tempo_or_meter_marker_menu->popup (1, ev->time); @@ -767,12 +767,12 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item) if (transport_marker_menu == 0) { build_range_marker_menu (true); } - + marker_menu_item = item; transport_marker_menu->popup (1, ev->time); } else if (loc->is_mark()) { - + delete marker_menu; build_marker_menu (loc); @@ -792,7 +792,7 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item) #endif marker_menu_item = item; marker_menu->popup (1, ev->time); - + } else if (loc->is_range_marker()) { if (range_marker_menu == 0) { build_range_marker_menu (false); @@ -856,7 +856,7 @@ Editor::build_marker_menu (Location* loc) glue_item->set_active (); } glue_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_glue)); - + items.push_back (SeparatorElem()); items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &Editor::marker_menu_remove))); @@ -1494,7 +1494,7 @@ void Editor::toggle_marker_lines () { _show_marker_lines = !_show_marker_lines; - + for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) { i->second->set_show_lines (_show_marker_lines); } diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index ae045d7a45..09e3764483 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -191,7 +191,7 @@ Editor::set_selected_mixer_strip (TimeAxisView& view) boost::shared_ptr route; AutomationTimeAxisView* atv; - + if ((atv = dynamic_cast(&view)) != 0) { AudioTimeAxisView *parent = dynamic_cast(view.get_parent()); @@ -213,7 +213,7 @@ Editor::set_selected_mixer_strip (TimeAxisView& view) } } } - + if (current_mixer_strip->route() == route) { return; } diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 6bf5d92f99..0d5f75f60d 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -207,7 +207,7 @@ Editor::which_grabber_cursor () boost::shared_ptr m = _movable.lock(); if (m && m->locked()) { c = _cursors->speaker; - } + } break; } } @@ -373,24 +373,24 @@ Editor::mouse_mode_toggled (MouseMode m) mouse_mode = m; instant_save (); - + if (!internal_editing()) { if (mouse_mode != MouseRange && _join_object_range_state == JOIN_OBJECT_RANGE_NONE) { - + /* in all modes except range and joined object/range, hide the range selection, show the object (region) selection. */ - + for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { (*i)->hide_selection (); } - + } else { - + /* in range or object/range mode, show the range selection. */ - + for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) { (*i)->show_selection (selection->time); } @@ -770,7 +770,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT return true; } break; - + default: break; } @@ -798,12 +798,12 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT } case FeatureLineItem: - { + { if (Keyboard::modifier_state_contains (event->button.state, Keyboard::TertiaryModifier)) { remove_transient(item); return true; } - + _drags->set (new FeatureLineDrag (this, item), event); return true; break; @@ -821,7 +821,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT /* no region drags in internal edit mode */ break; } - + /* click on a normal region view */ if (Keyboard::modifier_state_contains (event->button.state, Keyboard::CopyModifier)) { add_region_copy_drag (item, event, clicked_regionview); @@ -830,7 +830,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT } else { add_region_drag (item, event, clicked_regionview); } - + if (_join_object_range_state == JOIN_OBJECT_RANGE_OBJECT && !selection->regions.empty()) { _drags->add (new SelectionDrag (this, clicked_axisview->get_selection_rect (clicked_selection)->rect, SelectionDrag::SelectionMove)); } @@ -877,7 +877,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT _drags->set (new RubberbandSelectDrag (this, item), event); } break; - + case AutomationTrackItem: /* rubberband drag to select automation points */ _drags->set (new RubberbandSelectDrag (this, item), event); @@ -905,7 +905,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT if (t) { boost::shared_ptr pl = t->playlist (); if (pl) { - + boost::shared_ptr r = pl->top_region_at (event_frame (event)); if (r) { RegionView* rv = rtv->view()->find_view (r); @@ -1054,7 +1054,7 @@ Editor::button_press_handler_2 (ArdourCanvas::Item* item, GdkEvent* event, ItemT /* no region drags in internal edit mode */ return false; } - + if (Keyboard::modifier_state_contains (event->button.state, Keyboard::CopyModifier)) { add_region_copy_drag (item, event, clicked_regionview); } else { @@ -1505,7 +1505,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT default: break; - + } /* do any (de)selection operations that should occur on button release */ @@ -1751,7 +1751,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_ set_canvas_cursor (); } break; - + default: break; } @@ -1821,7 +1821,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_ #endif _over_region_trim_target = false; - + if (is_drawable()) { set_canvas_cursor (current_canvas_cursor); } @@ -1843,7 +1843,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_ case RegionViewName: /* see enter_handler() for notes */ _over_region_trim_target = false; - + if (!reinterpret_cast (item->get_data ("regionview"))->name_active()) { if (is_drawable() && mouse_mode == MouseObject) { set_canvas_cursor (current_canvas_cursor); @@ -2007,7 +2007,7 @@ bool Editor::motion_handler (ArdourCanvas::Item* /*item*/, GdkEvent* event, bool from_autoscroll) { _last_motion_y = event->motion.y; - + if (event->motion.is_hint) { gint x, y; @@ -2048,7 +2048,7 @@ Editor::motion_handler (ArdourCanvas::Item* /*item*/, GdkEvent* event, bool from if (_drags->active ()) { handled = _drags->motion_handler (event, from_autoscroll); } - + if (!handled) { return false; } @@ -2122,7 +2122,7 @@ Editor::edit_note (ArdourCanvas::Item* item) d.run (); } - + void Editor::visible_order_range (int* low, int* high) const @@ -2429,7 +2429,7 @@ Editor::add_region_brush_drag (ArdourCanvas::Item* item, GdkEvent* event, Region if (!region_view->region()->playlist()) { return; } - + if (Config->get_edit_mode() == Splice) { return; } @@ -2558,12 +2558,12 @@ Editor::update_join_object_range_location (double x, double y) entered_{track,regionview} is not always setup (e.g. if the mouse is over a TimeSelection), and to get a Region that we're over requires searching the playlist. */ - + if (join_object_range_button.get_active() == false || (mouse_mode != MouseRange && mouse_mode != MouseObject)) { _join_object_range_state = JOIN_OBJECT_RANGE_NONE; return; } - + if (mouse_mode == MouseObject) { _join_object_range_state = JOIN_OBJECT_RANGE_OBJECT; } else if (mouse_mode == MouseRange) { @@ -2572,7 +2572,7 @@ Editor::update_join_object_range_location (double x, double y) /* XXX: maybe we should make entered_track work in all cases, rather than resorting to this */ pair tvp = trackview_by_y_position (y + vertical_adjustment.get_value() - canvas_timebars_vsize); - + if (tvp.first) { RouteTimeAxisView* rtv = dynamic_cast (tvp.first); @@ -2616,7 +2616,7 @@ void Editor::set_canvas_cursor_for_region_view (double x, RegionView* rv) { assert (rv); - + ArdourCanvas::Group* g = rv->get_canvas_group (); ArdourCanvas::Group* p = g->get_parent_group (); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index bccad1d72f..622b102de8 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -146,7 +146,7 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions) } } else { snap_to (where); - + frozen = true; EditorFreeze(); /* Emit Signal */ } @@ -198,7 +198,7 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions) } commit_reversible_command (); - + if (frozen){ EditorThaw(); /* Emit Signal */ } @@ -245,7 +245,7 @@ Editor::move_range_selection_start_or_end_to_region_boundary (bool move_end, boo if (end < start) { return; } - + begin_reversible_command (_("alter selection")); selection->set_preserving_all_ranges (start, end); commit_reversible_command (); @@ -379,7 +379,7 @@ Editor::nudge_backward (bool next, bool force_playhead) if (next) { distance = next_distance; } - + r->clear_changes (); if (r->position() > distance) { @@ -453,23 +453,23 @@ void Editor::nudge_forward_capture_offset () { RegionSelection rs = get_regions_from_selection_and_entered (); - + if (!_session || rs.empty()) { return; } begin_reversible_command (_("nudge forward")); - + framepos_t const distance = _session->worst_output_latency(); - + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { boost::shared_ptr r ((*i)->region()); - + r->clear_changes (); r->set_position (r->position() + distance); _session->add_command(new StatefulDiffCommand (r)); } - + commit_reversible_command (); } @@ -483,14 +483,14 @@ Editor::nudge_backward_capture_offset () } begin_reversible_command (_("nudge forward")); - + framepos_t const distance = _session->worst_output_latency(); for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { boost::shared_ptr r ((*i)->region()); - + r->clear_changes (); - + if (r->position() > distance) { r->set_position (r->position() - distance); } else { @@ -498,7 +498,7 @@ Editor::nudge_backward_capture_offset () } _session->add_command(new StatefulDiffCommand (r)); } - + commit_reversible_command (); } @@ -705,7 +705,7 @@ Editor::find_next_region_boundary (framepos_t pos, int32_t dir, const TrackViewL for (TrackViewList::const_iterator i = tracks.begin(); i != tracks.end(); ++i) { framepos_t contender; framecnt_t d; - + RouteTimeAxisView* rtv = dynamic_cast (*i); if (!rtv) { @@ -1238,7 +1238,7 @@ Editor::scroll_tracks_down () if (vert_value > vertical_adjustment.get_upper() - _canvas_height) { vert_value = vertical_adjustment.get_upper() - _canvas_height; } - + vertical_adjustment.set_value (vert_value); } @@ -1256,7 +1256,7 @@ Editor::scroll_tracks_down_line () if (vert_value > vertical_adjustment.get_upper() - _canvas_height) { vert_value = vertical_adjustment.get_upper() - _canvas_height; } - + vertical_adjustment.set_value (vert_value); } @@ -1709,7 +1709,7 @@ void Editor::add_locations_from_region () { RegionSelection rs = get_regions_from_selection_and_entered (); - + if (rs.empty()) { return; } @@ -1736,7 +1736,7 @@ void Editor::add_location_from_region () { RegionSelection rs = get_regions_from_selection_and_entered (); - + if (rs.empty()) { return; } @@ -1808,11 +1808,11 @@ Editor::set_mark () string markername; _session->locations()->next_available_name (markername, "mark"); - + if (!choose_new_marker_name (markername)) { return; } - + _session->locations()->add (new Location (*_session, pos, 0, markername, Location::IsMark), true); } @@ -2168,7 +2168,7 @@ void Editor::rename_region () { RegionSelection rs = get_regions_from_selection_and_entered (); - + if (rs.empty()) { return; } @@ -2207,7 +2207,7 @@ Editor::rename_region () if (ret != RESPONSE_OK) { return; } - + std::string str = entry.get_text(); strip_whitespace_edges (str); if (!str.empty()) { @@ -2253,7 +2253,7 @@ Editor::play_selected_region () framepos_t end = 0; RegionSelection rs = get_regions_from_selection_and_entered (); - + if (rs.empty()) { return; } @@ -2311,8 +2311,8 @@ Editor::region_from_selection () internal_start = start - current->position(); RegionFactory::region_name (new_name, current->name(), true); - PropertyList plist; - + PropertyList plist; + plist.add (ARDOUR::Properties::start, current->start() + internal_start); plist.add (ARDOUR::Properties::length, selection_cnt); plist.add (ARDOUR::Properties::name, new_name); @@ -2351,8 +2351,8 @@ Editor::create_region_from_selection (vector >& new_re internal_start = start - current->position(); RegionFactory::region_name (new_name, current->name(), true); - PropertyList plist; - + PropertyList plist; + plist.add (ARDOUR::Properties::start, current->start() + internal_start); plist.add (ARDOUR::Properties::length, end - start + 1); plist.add (ARDOUR::Properties::name, new_name); @@ -2365,7 +2365,7 @@ void Editor::split_multichannel_region () { RegionSelection rs = get_regions_from_selection_and_entered (); - + if (rs.empty()) { return; } @@ -2483,12 +2483,12 @@ Editor::separate_regions_between (const TimeSelection& ts) rtv->view()->foreach_regionview (sigc::bind ( sigc::ptr_fun (add_if_covered), &(*t), &new_selection)); - + if (!in_command) { begin_reversible_command (_("separate")); in_command = true; } - + /* pick up changes to existing regions */ vector cmds; @@ -2591,7 +2591,7 @@ Editor::separate_under_selected_regions () vector playlists; RegionSelection rs; - + rs = get_regions_from_selection_and_entered(); if (!_session || rs.empty()) { @@ -2645,7 +2645,7 @@ Editor::separate_under_selected_regions () //Partition on the region bounds playlist->partition ((*rl)->first_frame() - 1, (*rl)->last_frame() + 1, true); - + //Re-add region that was just removed due to the partition operation playlist->add_region( (*rl), (*rl)->first_frame() ); } @@ -2871,20 +2871,20 @@ void Editor::remove_region_sync () { RegionSelection rs = get_regions_from_selection_and_entered (); - + if (rs.empty()) { return; } begin_reversible_command (_("remove region sync")); - + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { (*i)->region()->clear_changes (); (*i)->region()->clear_sync_position (); _session->add_command(new StatefulDiffCommand ((*i)->region())); } - + commit_reversible_command (); } @@ -2902,13 +2902,13 @@ Editor::naturalize_region () } else { begin_reversible_command (_("move region to original position")); } - + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { (*i)->region()->clear_changes (); (*i)->region()->move_to_natural_position (); _session->add_command (new StatefulDiffCommand ((*i)->region())); } - + commit_reversible_command (); } @@ -2916,7 +2916,7 @@ void Editor::align_regions (RegionPoint what) { RegionSelection const rs = get_regions_from_selection_and_edit_point (); - + if (rs.empty()) { return; } @@ -2942,7 +2942,7 @@ void Editor::align_regions_relative (RegionPoint point) { RegionSelection const rs = get_regions_from_selection_and_edit_point (); - + if (rs.empty()) { return; } @@ -3018,7 +3018,7 @@ Editor::align_regions_relative (RegionPoint point) } else { region->set_position (region->position() - distance); } - + _session->add_command(new StatefulDiffCommand (region)); } @@ -3089,15 +3089,15 @@ Editor::trim_region (bool front) for (list::const_iterator i = rs.by_layer().begin(); i != rs.by_layer().end(); ++i) { if (!(*i)->region()->locked()) { - + (*i)->region()->clear_changes (); - + if (front) { (*i)->region()->trim_front (where); } else { (*i)->region()->trim_end (where); } - + _session->add_command (new StatefulDiffCommand ((*i)->region())); } } @@ -3159,7 +3159,7 @@ Editor::trim_region_to_location (const Location& loc, const char* str) start = session_frame_to_track_frame (loc.start(), speed); end = session_frame_to_track_frame (loc.end(), speed); - + rv->region()->clear_changes (); rv->region()->trim_to (start, (end - start)); _session->add_command(new StatefulDiffCommand (rv->region())); @@ -3355,7 +3355,7 @@ Editor::bounce_range_selection (bool replace, bool enable_processing) playlist->clear_changes (); playlist->clear_owned_changes (); - + boost::shared_ptr r = rtv->track()->bounce_range (start, start+cnt, itt, enable_processing); if (replace) { @@ -3820,7 +3820,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) } else { _last_cut_copy_source_track = pmap.front().tv; } - + for (FreezeList::iterator pl = freezelist.begin(); pl != freezelist.end(); ++pl) { (*pl)->thaw (); _session->add_command (new StatefulDiffCommand (*pl)); @@ -3916,15 +3916,15 @@ Editor::paste_internal (framepos_t position, float times) if (internal_editing ()) { /* undo/redo is handled by individual tracks/regions */ - + for (nth = 0, i = ts.begin(); i != ts.end(); ++i, ++nth) { - + RegionSelection rs; RegionSelection::iterator r; MidiNoteSelection::iterator cb; - + get_regions_at (rs, position, ts); - + for (cb = cut_buffer->midi_notes.begin(), r = rs.begin(); cb != cut_buffer->midi_notes.end() && r != rs.end(); ++r) { MidiRegionView* mrv = dynamic_cast (*r); @@ -3934,17 +3934,17 @@ Editor::paste_internal (framepos_t position, float times) } } } - + } else { /* we do redo (do you do voodoo?) */ begin_reversible_command (Operations::paste); - + for (nth = 0, i = ts.begin(); i != ts.end(); ++i, ++nth) { (*i)->paste (position, times, *cut_buffer, nth); } - + commit_reversible_command (); } } @@ -4099,12 +4099,12 @@ Editor::nudge_track (bool use_edit, bool forwards) playlist->clear_owned_changes (); playlist->nudge_after (start, distance, forwards); - + vector cmds; - + playlist->rdiff (cmds); _session->add_commands (cmds); - + _session->add_command (new StatefulDiffCommand (playlist)); } @@ -4149,7 +4149,7 @@ Editor::normalize_region () } RegionSelection rs = get_regions_from_selection_and_entered (); - + if (rs.empty()) { return; } @@ -4182,7 +4182,7 @@ Editor::normalize_region () set_canvas_cursor (current_canvas_cursor); return; } - + max_amps.push_back (a); max_amp = max (max_amp, a); dialog.ascend (); @@ -4192,7 +4192,7 @@ Editor::normalize_region () begin_reversible_command (_("normalize")); list::const_iterator a = max_amps.begin (); - + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { AudioRegionView* const arv = dynamic_cast (*r); if (!arv) { @@ -4202,7 +4202,7 @@ Editor::normalize_region () arv->region()->clear_changes (); double const amp = dialog.normalize_individually() ? *a : max_amp; - + arv->audio_region()->normalize (amp, dialog.target ()); _session->add_command (new StatefulDiffCommand (arv->region())); @@ -4313,13 +4313,13 @@ Editor::strip_region_silence () int const r = d.run (); d.drop_rects (); - + if (r == Gtk::RESPONSE_OK) { ARDOUR::AudioIntervalMap silences; d.silences (silences); StripSilence s (*_session, silences, d.fade_length()); apply_filter (s, _("strip silence"), &d); - } + } } Command* @@ -4393,7 +4393,7 @@ Editor::fork_region () if (mrv) { boost::shared_ptr playlist = mrv->region()->playlist(); boost::shared_ptr newregion = mrv->midi_region()->clone (); - + playlist->clear_changes (); playlist->replace_region (mrv->region(), newregion, mrv->region()->position()); _session->add_command(new StatefulDiffCommand (playlist)); @@ -4461,7 +4461,7 @@ Editor::insert_patch_change () Evoral::PatchChange empty (0, 0, 0, 0); PatchChangeDialog d (0, _session, empty, Gtk::Stock::ADD); - + if (d.run() == RESPONSE_CANCEL) { return; } @@ -4492,7 +4492,7 @@ Editor::apply_filter (Filter& filter, string command, ProgressReporter* progress int n = 0; int const N = rs.size (); - + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ) { RegionSelection::iterator tmp = r; ++tmp; @@ -4587,7 +4587,7 @@ Editor::toggle_gain_envelope_visibility () if (_ignore_region_action) { return; } - + RegionSelection rs = get_regions_from_selection_and_entered (); if (!_session || rs.empty()) { @@ -4614,7 +4614,7 @@ Editor::toggle_gain_envelope_active () if (_ignore_region_action) { return; } - + RegionSelection rs = get_regions_from_selection_and_entered (); if (!_session || rs.empty()) { @@ -4665,7 +4665,7 @@ Editor::toggle_region_lock_style () if (_ignore_region_action) { return; } - + RegionSelection rs = get_regions_from_selection_and_entered (); if (!_session || rs.empty()) { @@ -4690,7 +4690,7 @@ Editor::toggle_opaque_region () if (_ignore_region_action) { return; } - + RegionSelection rs = get_regions_from_selection_and_entered (); if (!_session || rs.empty()) { @@ -4882,7 +4882,7 @@ Editor::set_fade_in_active (bool yn) boost::shared_ptr ar (tmp->audio_region()); - + ar->clear_changes (); ar->set_fade_in_active (yn); _session->add_command (new StatefulDiffCommand (ar)); @@ -4931,7 +4931,7 @@ Editor::toggle_region_fades (int dir) return; } - RegionSelection::iterator i; + RegionSelection::iterator i; for (i = rs.begin(); i != rs.end(); ++i) { if ((ar = boost::dynamic_pointer_cast((*i)->region())) != 0) { if (dir == -1) { @@ -5051,12 +5051,12 @@ Editor::set_playhead_cursor () void Editor::split_region () { - if (((mouse_mode == MouseRange) || - (mouse_mode != MouseObject && _join_object_range_state == JOIN_OBJECT_RANGE_RANGE)) && + if (((mouse_mode == MouseRange) || + (mouse_mode != MouseObject && _join_object_range_state == JOIN_OBJECT_RANGE_RANGE)) && !selection->time.empty()) { separate_regions_between (selection->time); return; - } + } RegionSelection rs = get_regions_from_selection_and_edit_point (); @@ -5422,7 +5422,7 @@ Editor::define_one_bar (framepos_t start, framepos_t end) _("Do you want to set the global tempo or add a new tempo marker?"), options ); - + c.set_default_response (2); switch (c.run()) { @@ -5500,9 +5500,9 @@ void Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList& positions, bool can_ferret, bool select_new) { bool use_rhythmic_rodent = false; - + boost::shared_ptr pl = r->playlist(); - + list > new_regions; if (!pl) { @@ -5533,7 +5533,7 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList int response = msg.run(); msg.hide (); - + switch (response) { case RESPONSE_OK: break; @@ -5566,7 +5566,7 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList framepos_t pos = 0; while (x != positions.end()) { - + /* deal with positons that are out of scope of present region bounds */ if (*x <= 0 || *x > r->length()) { ++x; @@ -5582,7 +5582,7 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList */ framepos_t len = (*x) - pos; - + /* XXX we do we really want to allow even single-sample regions? shouldn't we have some kind of lower limit on region size? */ @@ -5599,8 +5599,8 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList /* do NOT announce new regions 1 by one, just wait till they are all done */ - PropertyList plist; - + PropertyList plist; + plist.add (ARDOUR::Properties::start, file_start); plist.add (ARDOUR::Properties::length, len); plist.add (ARDOUR::Properties::name, new_name); @@ -5621,10 +5621,10 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList string new_name; RegionFactory::region_name (new_name, r->name()); - + /* Add the final region */ - PropertyList plist; - + PropertyList plist; + plist.add (ARDOUR::Properties::start, r->start() + pos); plist.add (ARDOUR::Properties::length, r->last_frame() - (r->position() + pos) + 1); plist.add (ARDOUR::Properties::name, new_name); @@ -5632,7 +5632,7 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList boost::shared_ptr nr = RegionFactory::create (r->sources(), plist, false); pl->add_region (nr, r->position() + pos); - + if (select_new) { new_regions.push_front(nr); } @@ -5640,7 +5640,7 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList pl->thaw (); _session->add_command (new StatefulDiffCommand (pl)); - + if (select_new) { for (list >::iterator i = new_regions.begin(); i != new_regions.end(); ++i){ @@ -5661,16 +5661,16 @@ Editor::place_transient() if (rs.empty()) { return; } - + framepos_t where = get_preferred_edit_position(); _session->begin_reversible_command (_("place transient")); - + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { framepos_t position = (*r)->region()->position(); (*r)->region()->add_transient(where - position); } - + _session->commit_reversible_command (); } @@ -5692,19 +5692,19 @@ void Editor::snap_regions_to_grid () { list > used_playlists; - + RegionSelection rs = get_regions_from_selection_and_entered (); if (!_session || rs.empty()) { return; } - + _session->begin_reversible_command (_("snap regions to grid")); - + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { - + boost::shared_ptr pl = (*r)->region()->playlist(); - + if (!pl->frozen()) { /* we haven't seen this playlist before */ @@ -5717,7 +5717,7 @@ Editor::snap_regions_to_grid () snap_to (start_frame); (*r)->region()->set_position (start_frame); } - + while (used_playlists.size() > 0) { list >::iterator i = used_playlists.begin(); (*i)->thaw(); @@ -5731,7 +5731,7 @@ void Editor::close_region_gaps () { list > used_playlists; - + RegionSelection rs = get_regions_from_selection_and_entered (); if (!_session || rs.empty()) { @@ -5746,7 +5746,7 @@ Editor::close_region_gaps () Label* l = manage (new Label (_("Crossfade length"))); l->set_alignment (0, 0.5); table.attach (*l, 0, 1, 0, 1); - + SpinButton spin_crossfade (1, 0); spin_crossfade.set_range (0, 15); spin_crossfade.set_increments (1, 1); @@ -5758,7 +5758,7 @@ Editor::close_region_gaps () l = manage (new Label (_("Pull-back length"))); l->set_alignment (0, 0.5); table.attach (*l, 0, 1, 1, 2); - + SpinButton spin_pullback (1, 0); spin_pullback.set_range (0, 100); spin_pullback.set_increments (1, 1); @@ -5766,7 +5766,7 @@ Editor::close_region_gaps () table.attach (spin_pullback, 1, 2, 1, 2); table.attach (*manage (new Label (_("ms"))), 2, 3, 1, 2); - + dialog.get_vbox()->pack_start (table); dialog.add_button (Stock::CANCEL, RESPONSE_CANCEL); dialog.add_button (_("Ok"), RESPONSE_ACCEPT); @@ -5776,25 +5776,25 @@ Editor::close_region_gaps () return; } - framepos_t crossfade_len = spin_crossfade.get_value(); + framepos_t crossfade_len = spin_crossfade.get_value(); framepos_t pull_back_frames = spin_pullback.get_value(); crossfade_len = lrintf (crossfade_len * _session->frame_rate()/1000); pull_back_frames = lrintf (pull_back_frames * _session->frame_rate()/1000); /* Iterate over the region list and make adjacent regions overlap by crossfade_len_ms */ - + _session->begin_reversible_command (_("close region gaps")); int idx = 0; boost::shared_ptr last_region; - + rs.sort_by_position_and_track(); - + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { - + boost::shared_ptr pl = (*r)->region()->playlist(); - + if (!pl->frozen()) { /* we haven't seen this playlist before */ @@ -5804,21 +5804,21 @@ Editor::close_region_gaps () } framepos_t position = (*r)->region()->position(); - + if (idx == 0 || position < last_region->position()){ last_region = (*r)->region(); idx++; continue; } - + (*r)->region()->trim_front( (position - pull_back_frames)); last_region->trim_end( (position - pull_back_frames + crossfade_len)); - + last_region = (*r)->region(); - + idx++; } - + while (used_playlists.size() > 0) { list >::iterator i = used_playlists.begin(); (*i)->thaw(); @@ -6135,7 +6135,7 @@ Editor::insert_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt, vector cmds; pl->rdiff (cmds); _session->add_commands (cmds); - + _session->add_command (new StatefulDiffCommand (pl)); commit = true; } @@ -6172,7 +6172,7 @@ Editor::insert_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt, } moved = true; } - + } if (was_locked) { @@ -6209,7 +6209,7 @@ Editor::fit_selected_tracks () for (RegionSelection::iterator r = selection->regions.begin(); r != selection->regions.end(); ++r) { tvl.push_back (&(*r)->get_time_axis_view ()); } - + if (!tvl.empty()) { fit_tracks (tvl); } @@ -6382,7 +6382,7 @@ Editor::toggle_region_mute () if (_ignore_region_action) { return; } - + RegionSelection rs = get_regions_from_selection_and_entered (); if (rs.empty ()) { @@ -6394,15 +6394,15 @@ Editor::toggle_region_mute () } else { begin_reversible_command (_("mute region")); } - + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { - + (*i)->region()->playlist()->clear_changes (); (*i)->region()->set_muted (!(*i)->region()->muted ()); _session->add_command (new StatefulDiffCommand ((*i)->region()->playlist())); - + } - + commit_reversible_command (); } @@ -6430,7 +6430,7 @@ Editor::combine_regions () } begin_reversible_command (_("combine regions")); - + vector new_selection; for (RTVS::iterator i = tracks.begin(); i != tracks.end(); ++i) { diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 3edcb6bce1..7f3e8142dc 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -66,14 +66,14 @@ EditorRegions::EditorRegions (Editor* e) , _show_automatic_regions (true) , ignore_region_list_selection_change (false) , ignore_selected_region_change (false) - , _no_redisplay (false) + , _no_redisplay (false) , _sort_type ((Editing::RegionListSortType) 0) , expanded (false) { _display.set_size_request (100, -1); _display.set_name ("RegionListDisplay"); _display.set_rules_hint (true); - + /* Try to prevent single mouse presses from initiating edits. This relies on a hack in gtktreeview.c:gtk_treeview_button_press() */ @@ -119,31 +119,31 @@ EditorRegions::EditorRegions (Editor* e) CellRendererToggle* locked_cell = dynamic_cast (_display.get_column_cell_renderer (7)); locked_cell->property_activatable() = true; locked_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::locked_changed)); - + TreeViewColumn* locked_col = _display.get_column (7); locked_col->add_attribute (locked_cell->property_visible(), _columns.property_toggles_visible); CellRendererToggle* glued_cell = dynamic_cast (_display.get_column_cell_renderer (8)); glued_cell->property_activatable() = true; glued_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::glued_changed)); - + TreeViewColumn* glued_col = _display.get_column (8); glued_col->add_attribute (glued_cell->property_visible(), _columns.property_toggles_visible); CellRendererToggle* muted_cell = dynamic_cast (_display.get_column_cell_renderer (9)); muted_cell->property_activatable() = true; muted_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::muted_changed)); - + TreeViewColumn* muted_col = _display.get_column (9); muted_col->add_attribute (muted_cell->property_visible(), _columns.property_toggles_visible); CellRendererToggle* opaque_cell = dynamic_cast (_display.get_column_cell_renderer (10)); opaque_cell->property_activatable() = true; opaque_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::opaque_changed)); - + TreeViewColumn* opaque_col = _display.get_column (10); opaque_col->add_attribute (opaque_cell->property_visible(), _columns.property_toggles_visible); - + _display.get_selection()->set_mode (SELECTION_MULTIPLE); _display.add_object_drag (_columns.region.index(), "regions"); @@ -177,7 +177,7 @@ EditorRegions::EditorRegions (Editor* e) ARDOUR_UI::instance()->secondary_clock.mode_changed.connect (sigc::mem_fun(*this, &EditorRegions::update_all_rows)); ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, MISSING_INVALIDATOR, ui_bind (&EditorRegions::region_changed, this, _1, _2), gui_context()); ARDOUR::RegionFactory::CheckNewRegion.connect (check_new_region_connection, MISSING_INVALIDATOR, ui_bind (&EditorRegions::add_region, this, _1), gui_context()); - + e->EditorFreeze.connect (editor_freeze_connection, MISSING_INVALIDATOR, ui_bind (&EditorRegions::freeze_tree_model, this), gui_context()); e->EditorThaw.connect (editor_thaw_connection, MISSING_INVALIDATOR, ui_bind (&EditorRegions::thaw_tree_model, this), gui_context()); } @@ -218,8 +218,8 @@ EditorRegions::enter_notify (GdkEventCrossing* ev) if (name_editable) { return true; } - - /* arm counter so that ::selection_filter() will deny selecting anything for the + + /* arm counter so that ::selection_filter() will deny selecting anything for the next two attempts to change selection status. */ _scroller.grab_focus (); @@ -369,15 +369,15 @@ EditorRegions::add_region (boost::shared_ptr region) // find parent node, add as new child TreeModel::iterator i; TreeModel::Children rows = _model->children(); - + boost::unordered_map::iterator it; - + it = parent_regions_sources_map.find (region->source_string()); - + if (it != parent_regions_sources_map.end()){ TreeModel::iterator j = _model->get_iter ((*it).second.get_path()); - + TreeModel::iterator ii; TreeModel::Children subrows = (*j).children(); @@ -391,7 +391,7 @@ EditorRegions::add_region (boost::shared_ptr region) } } */ - + row = *(_model->insert (subrows.end())); } else { @@ -449,7 +449,7 @@ EditorRegions::region_changed (boost::shared_ptr r, const PropertyChange our_interests.add (ARDOUR::Properties::opaque); our_interests.add (ARDOUR::Properties::fade_in); our_interests.add (ARDOUR::Properties::fade_out); - + if (what_changed.contains (our_interests)) { if (last_row != 0) { @@ -459,19 +459,19 @@ EditorRegions::region_changed (boost::shared_ptr r, const PropertyChange if (c == r) { populate_row (r, (*j)); - + if (what_changed.contains (ARDOUR::Properties::hidden)) { redisplay (); } - + return; } } - + RegionRowMap::iterator it; - + it = region_row_map.find (r); - + if (it != region_row_map.end()){ TreeModel::iterator j = _model->get_iter ((*it).second.get_path()); @@ -479,13 +479,13 @@ EditorRegions::region_changed (boost::shared_ptr r, const PropertyChange if (c == r) { populate_row (r, (*j)); - + if (what_changed.contains (ARDOUR::Properties::hidden)) { redisplay (); } - + return; - } + } } /* find the region in our model and update its row */ @@ -517,7 +517,7 @@ EditorRegions::selection_changed () for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) { - if (iter = _model->get_iter (*i)) { + if (iter = _model->get_iter (*i)) { boost::shared_ptr region = (*iter)[_columns.region]; // they could have clicked on a row that is just a placeholder, like "Hidden" @@ -525,7 +525,7 @@ EditorRegions::selection_changed () // since we need a region ptr. if (region) { - + if (region->automatic()) { _display.get_selection()->unselect(*i); @@ -552,9 +552,9 @@ EditorRegions::set_selected (RegionSelection& regions) for (RegionSelection::iterator i = regions.begin(); i != regions.end(); ++i) { boost::shared_ptr r ((*i)->region()); - + RegionRowMap::iterator it; - + it = region_row_map.find (r); if (it != region_row_map.end()){ @@ -581,17 +581,17 @@ EditorRegions::redisplay () _display.set_model (Glib::RefPtr(0)); _model->clear (); _model->set_sort_column (-2, SORT_ASCENDING); //Disable sorting to gain performance - + region_row_map.clear(); parent_regions_sources_map.clear(); - + /* now add everything we have, via a temporary list used to help with sorting */ const RegionFactory::RegionMap& regions (RegionFactory::regions()); for (RegionFactory::RegionMap::const_iterator i = regions.begin(); i != regions.end(); ++i) { - + if ( i->second->whole_file()) { /* add automatic regions first so that children can find their parents as we add them */ add_region (i->second); @@ -604,7 +604,7 @@ EditorRegions::redisplay () for (list >::iterator r = tmp_region_list.begin(); r != tmp_region_list.end(); ++r) { add_region (*r); } - + _model->set_sort_column (0, SORT_ASCENDING); // renabale sorting _display.set_model (_model); @@ -623,7 +623,7 @@ EditorRegions::update_row (boost::shared_ptr region) } RegionRowMap::iterator it; - + it = region_row_map.find (region); if (it != region_row_map.end()){ @@ -645,9 +645,9 @@ EditorRegions::update_all_rows () for (i = region_row_map.begin(); i != region_row_map.end(); ++i) { TreeModel::iterator j = _model->get_iter ((*i).second.get_path()); - + boost::shared_ptr region = (*j)[_columns.region]; - + if (!region->automatic()) { populate_row(region, (*j)); } @@ -701,7 +701,7 @@ EditorRegions::populate_row (boost::shared_ptr region, TreeModel::Row co //uint32_t used = _session->playlists->region_use_count (region); /* Presently a region is only used once so let's save on the sequential scan to determine use count */ uint32_t used = 1; - + populate_row_position (region, row, used); populate_row_end (region, row, used); populate_row_sync (region, row, used); @@ -825,7 +825,7 @@ EditorRegions::populate_row_fade_in (boost::shared_ptr region, TreeModel char buf[16]; format_position (audioregion->fade_in()->back()->when, buf, sizeof (buf)); row[_columns.fadein] = buf; - + if (audioregion->fade_in_active()) { row[_columns.fadein] = string_compose("%1%2%3", " ", buf, " "); } else { @@ -846,16 +846,16 @@ EditorRegions::populate_row_fade_out (boost::shared_ptr region, TreeMode } else { char buf[16]; format_position (audioregion->fade_out()->back()->when, buf, sizeof (buf)); - + if (audioregion->fade_out_active()) { row[_columns.fadeout] = string_compose("%1%2%3", " ", buf, " "); } else { row[_columns.fadeout] = string_compose("%1%2%3", "(", buf, ")"); } - } + } } } - + void EditorRegions::populate_row_locked (boost::shared_ptr region, TreeModel::Row const &row, uint32_t used) { @@ -910,7 +910,7 @@ EditorRegions::populate_row_name (boost::shared_ptr region, TreeModel::R } else { row[_columns.name] = region->name(); } -} +} void EditorRegions::populate_row_source (boost::shared_ptr region, TreeModel::Row const &row) @@ -964,7 +964,7 @@ EditorRegions::show_context_menu (int button, int time) bool have_shown = false; bool have_hidden = false; - + TreeView::Selection::ListHandle_Path rows = _display.get_selection()->get_selected_rows (); for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) { TreeIter t = _model->get_iter (*i); @@ -992,7 +992,7 @@ EditorRegions::key_press (GdkEventKey* ev) switch (ev->keyval) { case GDK_Tab: case GDK_ISO_Left_Tab: - + if (name_editable) { name_editable->editing_done (); name_editable = 0; @@ -1237,7 +1237,7 @@ void EditorRegions::name_editing_started (CellEditable* ce, const Glib::ustring&) { name_editable = ce; - + /* give it a special name */ Gtk::Entry *e = dynamic_cast (ce); @@ -1246,7 +1246,7 @@ EditorRegions::name_editing_started (CellEditable* ce, const Glib::ustring&) e->set_name (X_("RegionNameEditorEntry")); } } - + void EditorRegions::name_edit (const std::string& path, const std::string& new_text) { @@ -1286,7 +1286,7 @@ EditorRegions::get_dragged_region () if (regions.empty()) { return boost::shared_ptr (); } - + assert (regions.size() == 1); return regions.front (); } @@ -1297,7 +1297,7 @@ EditorRegions::clear () _display.set_model (Glib::RefPtr (0)); _model->clear (); _display.set_model (_model); - + /* Clean up the maps */ region_row_map.clear(); parent_regions_sources_map.clear(); @@ -1325,15 +1325,15 @@ EditorRegions::get_single_selection () return (*iter)[_columns.region]; } -void +void EditorRegions::freeze_tree_model (){ - + _display.set_model (Glib::RefPtr(0)); _model->set_sort_column (-2, SORT_ASCENDING); //Disable sorting to gain performance } -void +void EditorRegions::thaw_tree_model (){ _model->set_sort_column (0, SORT_ASCENDING); // renabale sorting @@ -1422,7 +1422,7 @@ EditorRegions::set_state (const XMLNode & node) } XMLProperty const * p = node.property (X_("sort-type")); - + if (p) { Editing::RegionListSortType const t = static_cast (string_2_enum (p->value(), _sort_type)); @@ -1436,21 +1436,21 @@ EditorRegions::set_state (const XMLNode & node) } p = node.property (X_("sort-ascending")); - + if (p) { bool const yn = string_is_affirmative (p->value ()); SortType old_sort_type; int old_sort_column; _model->get_sort_column_id (old_sort_column, old_sort_type); - + if (old_sort_type != (yn ? SORT_ASCENDING : SORT_DESCENDING)) { changed = true; } reset_sort_direction (yn); RefPtr act; - + if (yn) { act = ActionManager::get_action (X_("RegionList"), X_("SortAscending")); } else { @@ -1467,7 +1467,7 @@ EditorRegions::set_state (const XMLNode & node) if (expanded != yn) { changed = true; } - + set_full (yn); toggle_full_action()->set_active (yn); } @@ -1482,7 +1482,7 @@ EditorRegions::set_state (const XMLNode & node) changed = true; } } - + if (changed) { redisplay (); } @@ -1539,7 +1539,7 @@ RefPtr EditorRegions::hide_action () const { return ActionManager::get_action (X_("RegionList"), X_("rlHide")); - + } RefPtr diff --git a/gtk2_ardour/editor_regions.h b/gtk2_ardour/editor_regions.h index c9d2f8714e..6a37595bd3 100644 --- a/gtk2_ardour/editor_regions.h +++ b/gtk2_ardour/editor_regions.h @@ -41,20 +41,20 @@ public: void reset_sort_type (Editing::RegionListSortType, bool); void set_selected (RegionSelection &); void selection_mapover (sigc::slot >); - + boost::shared_ptr get_dragged_region (); boost::shared_ptr get_single_selection (); - + Editing::RegionListSortType sort_type () const { return _sort_type; } - + void redisplay (); void suspend_redisplay () { _no_redisplay = true; } - + void resume_redisplay () { _no_redisplay = false; redisplay (); @@ -67,7 +67,7 @@ public: void unselect_all () { _display.get_selection()->unselect_all (); } - + void delete_unused_regions(); XMLNode& get_state () const; @@ -115,14 +115,14 @@ private: }; Columns _columns; - + Gtk::TreeModel::RowReference last_row; void freeze_tree_model (); void thaw_tree_model (); void region_changed (boost::shared_ptr, PBD::PropertyChange const &); void selection_changed (); - + sigc::connection _change_connection; bool selection_filter (const Glib::RefPtr& model, const Gtk::TreeModel::Path& path, bool yn); @@ -130,7 +130,7 @@ private: Gtk::Widget* old_focus; Gtk::CellEditable* name_editable; void name_editing_started (Gtk::CellEditable*, const Glib::ustring&); - + void name_edit (const std::string&, const std::string&); void locked_changed (std::string const &); void glued_changed (std::string const &); @@ -168,7 +168,7 @@ private: void populate_row_name (boost::shared_ptr region, Gtk::TreeModel::Row const& row); void populate_row_source (boost::shared_ptr region, Gtk::TreeModel::Row const& row); - void update_row (boost::shared_ptr); + void update_row (boost::shared_ptr); void update_all_rows (); void insert_into_tmp_regionlist (boost::shared_ptr); @@ -185,36 +185,36 @@ private: Glib::RefPtr delete_unused_regions_action() const; Glib::RefPtr toggle_full_action () const; Glib::RefPtr toggle_show_auto_regions_action () const; - + Gtk::Menu* _menu; Gtk::ScrolledWindow _scroller; Gtk::Frame _frame; - + Gtkmm2ext::DnDTreeView > _display; - + Glib::RefPtr _model; - + bool _show_automatic_regions; bool ignore_region_list_selection_change; bool ignore_selected_region_change; bool _no_redisplay; - + Editing::RegionListSortType _sort_type; std::list > tmp_region_list; - + typedef boost::unordered_map, Gtk::TreeModel::RowReference> RegionRowMap; typedef boost::unordered_map RegionSourceMap; - + RegionRowMap region_row_map; RegionSourceMap parent_regions_sources_map; - + PBD::ScopedConnection region_property_connection; PBD::ScopedConnection check_new_region_connection; - + PBD::ScopedConnection editor_freeze_connection; PBD::ScopedConnection editor_thaw_connection; - + bool expanded; }; diff --git a/gtk2_ardour/editor_route_groups.cc b/gtk2_ardour/editor_route_groups.cc index 2d77eb5bd9..a653644bdc 100644 --- a/gtk2_ardour/editor_route_groups.cc +++ b/gtk2_ardour/editor_route_groups.cc @@ -363,9 +363,9 @@ EditorRouteGroups::row_change (const Gtk::TreeModel::Path&, const Gtk::TreeModel val = (*iter)[_columns.edits]; plist.add (Properties::edit, val); plist.add (Properties::name, string ((*iter)[_columns.text])); - + group->set_hidden (!(*iter)[_columns.is_visible], this); - + group->apply_changes (plist); } @@ -498,7 +498,7 @@ EditorRouteGroups::set_session (Session* s) if (_session) { RouteGroup& arg (_session->all_route_group()); - + arg.PropertyChanged.connect (all_route_groups_changed_connection, MISSING_INVALIDATOR, ui_bind (&EditorRouteGroups::all_group_changed, this, _1), gui_context()); _session->route_group_added.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&EditorRouteGroups::add, this, _1), gui_context()); @@ -522,7 +522,7 @@ void EditorRouteGroups::run_new_group_dialog () { RouteList rl; - + return _editor->_group_tabs->run_new_group_dialog (rl); } @@ -544,7 +544,7 @@ EditorRouteGroups::all_group_changed (const PropertyChange&) _all_group_active_button.set_active (false); } } - + /** Called when a model row is deleted, but also when the model is * reordered by a user drag-and-drop; the latter is what we are * interested in here. @@ -558,7 +558,7 @@ EditorRouteGroups::row_deleted (Gtk::TreeModel::Path const &) */ return; } - + /* Re-write the session's route group list so that the new order is preserved */ list new_list; diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index 8368bff66a..0aae18d793 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -158,12 +158,12 @@ EditorRoutes::EditorRoutes (Editor* e) _display.append_column (*solo_state_column); _display.append_column (*solo_isolate_state_column); _display.append_column (*solo_safe_state_column); - + int colnum = _display.append_column (_("Name"), _columns.text); TreeViewColumn* c = _display.get_column (colnum-1); c->set_data ("i_am_the_tab_column", (void*) 0xfeedface); _display.append_column (_("V"), _columns.visible); - + _display.set_headers_visible (true); _display.set_name ("TrackListDisplay"); _display.get_selection()->set_mode (SELECTION_SINGLE); @@ -196,16 +196,16 @@ EditorRoutes::EditorRoutes (Editor* e) visible_cell->property_activatable() = true; visible_cell->property_radio() = false; visible_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRoutes::visible_changed)); - + TreeViewColumn* visible_col = dynamic_cast (_display.get_column (6)); visible_col->set_expand(false); visible_col->set_sizing(TREE_VIEW_COLUMN_FIXED); visible_col->set_fixed_width(30); visible_col->set_alignment(ALIGN_CENTER); - + _model->signal_row_deleted().connect (sigc::mem_fun (*this, &EditorRoutes::route_deleted)); _model->signal_rows_reordered().connect (sigc::mem_fun (*this, &EditorRoutes::reordered)); - + _display.signal_button_press_event().connect (sigc::mem_fun (*this, &EditorRoutes::button_press), false); _scroller.signal_key_press_event().connect (sigc::mem_fun(*this, &EditorRoutes::key_press), false); @@ -254,8 +254,8 @@ EditorRoutes::enter_notify (GdkEventCrossing*) if (name_editable) { return true; } - - /* arm counter so that ::selection_filter() will deny selecting anything for the + + /* arm counter so that ::selection_filter() will deny selecting anything for the next two attempts to change selection status. */ selection_countdown = 2; @@ -315,7 +315,7 @@ EditorRoutes::on_tv_mute_enable_toggled (std::string const & path_string) TimeAxisView *tv = row[_columns.tv]; RouteTimeAxisView *rtv = dynamic_cast (tv); - + if (rtv != 0) { boost::shared_ptr rl (new RouteList); rl->push_back (rtv->route()); @@ -477,7 +477,7 @@ EditorRoutes::route_deleted (Gtk::TreeModel::Path const &) if (!_session || _session->deletion_in_progress()) { return; } - + /* this could require an order reset & sync */ _session->set_remote_control_ids(); _ignore_reorder = true; @@ -733,7 +733,7 @@ EditorRoutes::sync_order_keys (string const & src) for (map::const_iterator i = new_order.begin(); i != new_order.end(); ++i) { co.push_back (i->second); } - + _model->reorder (co); _redisplay_does_not_reset_order_keys = false; } @@ -801,13 +801,13 @@ EditorRoutes::set_all_audio_midi_visibility (int tracks, bool yn) suspend_redisplay (); for (i = rows.begin(); i != rows.end(); ++i) { - + TreeModel::Row row = (*i); TimeAxisView* tv = row[_columns.tv]; - + AudioTimeAxisView* atv; MidiTimeAxisView* mtv; - + if (tv == 0) { continue; } @@ -910,7 +910,7 @@ EditorRoutes::key_press (GdkEventKey* ev) if (name_editable) { name_editable->editing_done (); name_editable = 0; - } + } col = _display.get_column (5); // select&focus on name column @@ -1002,35 +1002,35 @@ EditorRoutes::button_press (GdkEventButton* ev) show_menu (); return true; } - + //Scroll editor canvas to selected track if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { - + TreeModel::Path path; TreeViewColumn *tvc; int cell_x; int cell_y; - + _display.get_path_at_pos ((int) ev->x, (int) ev->y, path, tvc, cell_x, cell_y); // Get the model row. Gtk::TreeModel::Row row = *_model->get_iter (path); - + TimeAxisView *tv = row[_columns.tv]; - + int y_pos = tv->y_position(); - + //Clamp the y pos so that we do not extend beyond the canvas full height. if (_editor->full_canvas_height - y_pos < _editor->_canvas_height){ y_pos = _editor->full_canvas_height - _editor->_canvas_height; } - + //Only scroll to if the track is visible if(y_pos != -1){ _editor->reset_y_origin (y_pos); } } - + return false; } @@ -1259,7 +1259,7 @@ EditorRoutes::update_rec_display () } else { (*i)[_columns.rec_state] = 0; } - + (*i)[_columns.name_editable] = !route->record_enabled (); } } @@ -1384,7 +1384,7 @@ EditorRoutes::show_tracks_with_regions_at_playhead () } suspend_redisplay (); - + TreeModel::Children rows = _model->children (); for (TreeModel::Children::iterator i = rows.begin(); i != rows.end(); ++i) { TimeAxisView* tv = (*i)[_columns.tv]; diff --git a/gtk2_ardour/editor_routes.h b/gtk2_ardour/editor_routes.h index 6297f906bb..c6105bb7be 100644 --- a/gtk2_ardour/editor_routes.h +++ b/gtk2_ardour/editor_routes.h @@ -36,16 +36,16 @@ public: void move_selected_tracks (bool); void show_track_in_display (TimeAxisView &); - + void suspend_redisplay () { _no_redisplay = true; } - + void resume_redisplay () { _no_redisplay = false; redisplay (); } - + void redisplay (); void update_visibility (); void routes_added (std::list routes); @@ -88,11 +88,11 @@ private: void show_all_miditracks (); void hide_all_miditracks (); void show_tracks_with_regions_at_playhead (); - + void display_drag_data_received ( Glib::RefPtr const &, gint, gint, Gtk::SelectionData const &, guint, guint ); - + void track_list_reorder (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const & iter, int* new_order); bool selection_filter (Glib::RefPtr const &, Gtk::TreeModel::Path const &, bool); void name_edit (std::string const &, std::string const &); @@ -112,7 +112,7 @@ private: add (route); add (name_editable); } - + Gtk::TreeModelColumn text; Gtk::TreeModelColumn visible; Gtk::TreeModelColumn rec_state; @@ -130,14 +130,14 @@ private: Gtkmm2ext::DnDTreeView > _display; Glib::RefPtr _model; ModelColumns _columns; - + bool _ignore_reorder; bool _no_redisplay; bool _redisplay_does_not_sync_order_keys; bool _redisplay_does_not_reset_order_keys; - + Gtk::Menu* _menu; - Gtk::Widget* old_focus; + Gtk::Widget* old_focus; uint32_t selection_countdown; Gtk::CellEditable* name_editable; diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index d81b8a4351..c2338347d2 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -191,9 +191,9 @@ Editor::set_selected_track_as_side_effect (Selection::Operation op, bool /*force bool had_tracks = !selection->tracks.empty(); RouteGroup* group = clicked_routeview->route()->route_group(); RouteGroup& arg (_session->all_route_group()); - + switch (op) { - case Selection::Toggle: + case Selection::Toggle: if (selection->selected (clicked_axisview)) { if (arg.is_select() && arg.is_active()) { for (TrackViewList::iterator i = track_views.begin(); i != track_views.end (); ++i) { @@ -222,8 +222,8 @@ Editor::set_selected_track_as_side_effect (Selection::Operation op, bool /*force } } break; - - case Selection::Add: + + case Selection::Add: if (!had_tracks && arg.is_select() && arg.is_active()) { /* nothing was selected already, and all group is active etc. so use all tracks. @@ -240,7 +240,7 @@ Editor::set_selected_track_as_side_effect (Selection::Operation op, bool /*force selection->add (clicked_axisview); } break; - + case Selection::Set: selection->clear(); if (!had_tracks && arg.is_select() && arg.is_active()) { @@ -259,8 +259,8 @@ Editor::set_selected_track_as_side_effect (Selection::Operation op, bool /*force selection->set (clicked_axisview); } break; - - case Selection::Extend: + + case Selection::Extend: selection->clear(); cerr << ("Editor::set_selected_track_as_side_effect case Selection::Add not yet implemented\n"); break; @@ -329,7 +329,7 @@ Editor::set_selected_control_point_from_click (Selection::Operation op, bool /*n if (!clicked_control_point) { return false; } - + switch (op) { case Selection::Set: selection->set (clicked_control_point); @@ -395,7 +395,7 @@ Editor::mapover_tracks (sigc::slot sl, TimeA /* call the slots */ uint32_t const sz = tracks.size (); - + for (set::iterator i = tracks.begin(); i != tracks.end(); ++i) { sl (**i, sz); } @@ -535,7 +535,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op, if (button_release_can_deselect) { /* just remove this one region, but only on a permitted button release */ - + selection->remove (clicked_regionview); commit = true; @@ -685,7 +685,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op, relevant_tracks.insert (r); } } - + set already_in_selection; if (relevant_tracks.empty()) { @@ -886,16 +886,16 @@ Editor::track_selection_changed () for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { bool yn = (find (selection->tracks.begin(), selection->tracks.end(), *i) != selection->tracks.end()); - + (*i)->set_selected (yn); - + TimeAxisView::Children c = (*i)->get_child_list (); for (TimeAxisView::Children::iterator j = c.begin(); j != c.end(); ++j) { (*j)->set_selected (find (selection->tracks.begin(), selection->tracks.end(), j->get()) != selection->tracks.end()); } - if (yn && - ((mouse_mode == MouseRange) || + if (yn && + ((mouse_mode == MouseRange) || ((mouse_mode == MouseObject) && (_join_object_range_state == JOIN_OBJECT_RANGE_OBJECT)))) { (*i)->reshow_selection (selection->time); } else { @@ -965,14 +965,14 @@ Editor::sensitize_the_right_region_actions () } /* We get here if we are in Object mode */ - + RegionSelection rs = get_regions_from_selection_and_entered (); sensitize_all_region_actions (!rs.empty ()); _ignore_region_action = true; - + /* Look through the regions that are selected and make notes about what we have got */ - + bool have_audio = false; bool have_midi = false; bool have_locked = false; @@ -995,11 +995,11 @@ Editor::sensitize_the_right_region_actions () boost::shared_ptr r = (*i)->region (); boost::shared_ptr ar = boost::dynamic_pointer_cast (r); - + if (ar) { have_audio = true; } - + if (boost::dynamic_pointer_cast (r)) { have_midi = true; } @@ -1076,7 +1076,7 @@ Editor::sensitize_the_right_region_actions () _region_actions->get_action("add-range-markers-from-region")->set_sensitive (false); _region_actions->get_action("close-region-gaps")->set_sensitive (false); _region_actions->get_action("combine-regions")->set_sensitive (false); - } + } if (!have_midi) { _region_actions->get_action("show-region-list-editor")->set_sensitive (false); @@ -1100,40 +1100,40 @@ Editor::sensitize_the_right_region_actions () } if (have_audio) { - + if (have_envelope_visible && !have_envelope_invisible) { Glib::RefPtr::cast_dynamic (_region_actions->get_action("toggle-region-gain-envelope-visible"))->set_active (); } else if (have_envelope_visible && have_envelope_invisible) { // _region_actions->get_action("toggle-region-gain-envelope-visible")->set_inconsistent (); } - + if (have_envelope_active && !have_envelope_inactive) { Glib::RefPtr::cast_dynamic (_region_actions->get_action("toggle-region-gain-envelope-active"))->set_active (); } else if (have_envelope_active && have_envelope_inactive) { // _region_actions->get_action("toggle-region-gain-envelope-active")->set_inconsistent (); } - + } else { - + _region_actions->get_action("analyze-region")->set_sensitive (false); _region_actions->get_action("reset-region-gain-envelopes")->set_sensitive (false); _region_actions->get_action("toggle-region-gain-envelope-visible")->set_sensitive (false); _region_actions->get_action("toggle-region-gain-envelope-active")->set_sensitive (false); _region_actions->get_action("pitch-shift-region")->set_sensitive (false); - + } if (!have_non_unity_scale_amplitude || !have_audio) { _region_actions->get_action("reset-region-scale-amplitude")->set_sensitive (false); } - + Glib::RefPtr::cast_dynamic (_region_actions->get_action("toggle-region-lock"))->set_active (have_locked && !have_unlocked); if (have_locked && have_unlocked) { // _region_actions->get_action("toggle-region-lock")->set_inconsistent (); } Glib::RefPtr::cast_dynamic (_region_actions->get_action("toggle-region-lock-style"))->set_active (have_position_lock_style_music && !have_position_lock_style_audio); - + if (have_position_lock_style_music && have_position_lock_style_audio) { // _region_actions->get_action("toggle-region-lock-style")->set_inconsistent (); } @@ -1142,7 +1142,7 @@ Editor::sensitize_the_right_region_actions () if (have_muted && have_unmuted) { // _region_actions->get_action("toggle-region-mute")->set_inconsistent (); } - + Glib::RefPtr::cast_dynamic (_region_actions->get_action("toggle-opaque-region"))->set_active (have_opaque && !have_non_opaque); if (have_opaque && have_non_opaque) { // _region_actions->get_action("toggle-opaque-region")->set_inconsistent (); @@ -1160,7 +1160,7 @@ Editor::sensitize_the_right_region_actions () } _ignore_region_action = false; - + _all_region_actions_sensitized = false; } @@ -1318,7 +1318,7 @@ Editor::select_all_within ( list found; for (TrackViewList::const_iterator iter = tracklist.begin(); iter != tracklist.end(); ++iter) { - + if ((*iter)->hidden()) { continue; } @@ -1741,9 +1741,9 @@ long Editor::select_range_around_region (RegionView* rv) { assert (rv); - + selection->set (&rv->get_time_axis_view()); - + selection->time.clear (); boost::shared_ptr r = rv->region (); return selection->set (r->position(), r->position() + r->length()); diff --git a/gtk2_ardour/editor_selection_list.cc b/gtk2_ardour/editor_selection_list.cc index 73ceb59c37..3991dc5aae 100644 --- a/gtk2_ardour/editor_selection_list.cc +++ b/gtk2_ardour/editor_selection_list.cc @@ -194,7 +194,7 @@ Editor::create_named_selection () } boost::shared_ptr ns (new NamedSelection (name, thelist)); - + /* make the one we just added be selected */ TreeModel::Children::iterator added = named_selection_model->children().end(); diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 4efb57ffc4..1c9ca94021 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -56,7 +56,7 @@ EditorSummary::EditorSummary (Editor* e) Region::RegionPropertyChanged.connect (region_property_connection, invalidator (*this), boost::bind (&CairoWidget::set_dirty, this), gui_context()); _editor->playhead_cursor->PositionChanged.connect (position_connection, invalidator (*this), ui_bind (&EditorSummary::playhead_position_changed, this, _1), gui_context()); - add_events (Gdk::POINTER_MOTION_MASK); + add_events (Gdk::POINTER_MOTION_MASK); } /** Connect to a session. @@ -148,7 +148,7 @@ EditorSummary::render (cairo_t* cr) } /* compute start and end points for the summary */ - + framecnt_t const session_length = _session->current_end_frame() - _session->current_start_frame (); double const theoretical_start = _session->current_start_frame() - session_length * _overhang_fraction; _start = theoretical_start > 0 ? theoretical_start : 0; @@ -161,7 +161,7 @@ EditorSummary::render (cairo_t* cr) ++N; } } - + if (N == 0) { _track_height = 16; } else { @@ -189,7 +189,7 @@ EditorSummary::render (cairo_t* cr) cairo_move_to (cr, 0, y + _track_height / 2); cairo_line_to (cr, _width, y + _track_height / 2); cairo_stroke (cr); - + StreamView* s = (*i)->view (); if (s) { @@ -201,7 +201,7 @@ EditorSummary::render (cairo_t* cr) y + _track_height / 2 )); } - + y += _track_height; } @@ -355,7 +355,7 @@ EditorSummary::get_editor (pair* x, pair* y) con { assert (x); assert (y); - + x->first = (_editor->leftmost_position () - _start) * _x_scale; x->second = x->first + _editor->current_page_frames() * _x_scale; @@ -377,7 +377,7 @@ EditorSummary::get_position (double x, double y) const int y_edge_size = (_view_rectangle_y.second - _view_rectangle_y.first) / 4; y_edge_size = min (y_edge_size, 8); y_edge_size = max (y_edge_size, 1); - + bool const near_left = (std::abs (x - _view_rectangle_x.first) < x_edge_size); bool const near_right = (std::abs (x - _view_rectangle_x.second) < x_edge_size); bool const near_top = (std::abs (y - _view_rectangle_y.first) < y_edge_size); @@ -525,7 +525,7 @@ EditorSummary::on_button_release_event (GdkEventButton*) _zoom_dragging = false; _editor->_dragging_playhead = false; _editor->set_follow_playhead (_old_follow_playhead, false); - + return true; } @@ -598,7 +598,7 @@ EditorSummary::set_editor (double const x, double const y) return; } - + set_editor_x (x); set_editor_y (y); } @@ -614,7 +614,7 @@ EditorSummary::set_editor (pair const & x, double const y) /* see comment in other set_editor () */ return; } - + set_editor_x (x); set_editor_y (y); } @@ -658,10 +658,10 @@ EditorSummary::set_editor_x (pair const & x) ((x.second - x.first) / _x_scale) / _editor->frame_to_unit (_editor->current_page_frames()) ); - + if (nx != _editor->get_current_zoom ()) { _editor->reset_zoom (nx); - } + } } /** Set the top of the y range visible in the editor. @@ -674,13 +674,13 @@ EditorSummary::set_editor_y (double const y) double y1 = summary_y_to_editor (y); double const eh = _editor->canvas_height() - _editor->get_canvas_timebars_vsize (); double y2 = y1 + eh; - + double const full_editor_height = _editor->full_canvas_height - _editor->get_canvas_timebars_vsize(); if (y2 > full_editor_height) { y1 -= y2 - full_editor_height; } - + if (y1 < 0) { y1 = 0; } @@ -709,7 +709,7 @@ EditorSummary::set_editor_y (pair const & y) double partial_height = 0; /* Height of any tracks that are fully in the desired range */ double scale_height = 0; - + _editor->_routes->suspend_redisplay (); for (TrackViewList::const_iterator i = _editor->track_views.begin(); i != _editor->track_views.end(); ++i) { @@ -717,7 +717,7 @@ EditorSummary::set_editor_y (pair const & y) if ((*i)->hidden()) { continue; } - + double const h = (*i)->effective_height (); total_height += h; @@ -738,7 +738,7 @@ EditorSummary::set_editor_y (pair const & y) enough tracks to fill it. */ double const ch = min (total_height, _editor->canvas_height() - _editor->get_canvas_timebars_vsize()); - + /* hence required scale factor of the complete tracks to fit the required y range; the amount of space they should take up divided by the amount they currently take up. */ @@ -747,7 +747,7 @@ EditorSummary::set_editor_y (pair const & y) yc = y; /* Scale complete tracks within the range to make it fit */ - + for (TrackViewList::const_iterator i = _editor->track_views.begin(); i != _editor->track_views.end(); ++i) { if ((*i)->hidden()) { @@ -763,7 +763,7 @@ EditorSummary::set_editor_y (pair const & y) } _editor->_routes->resume_redisplay (); - + set_editor_y (y.first); } @@ -780,11 +780,11 @@ EditorSummary::summary_y_to_editor (double y) const { double ey = 0; for (TrackViewList::const_iterator i = _editor->track_views.begin (); i != _editor->track_views.end(); ++i) { - + if ((*i)->hidden()) { continue; } - + double const h = (*i)->effective_height (); if (y < _track_height) { /* in this track */ @@ -803,7 +803,7 @@ EditorSummary::editor_y_to_summary (double y) const { double sy = 0; for (TrackViewList::const_iterator i = _editor->track_views.begin (); i != _editor->track_views.end(); ++i) { - + if ((*i)->hidden()) { continue; } diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc index 0a1d3cb495..1c4162eda2 100644 --- a/gtk2_ardour/editor_timefx.cc +++ b/gtk2_ardour/editor_timefx.cc @@ -75,7 +75,7 @@ Editor::time_stretch (RegionSelection& regions, float fraction) return -1; boost::shared_ptr playlist = rtv->track()->playlist(); - + ARDOUR::TimeFXRequest request; request.time_fraction = fraction; MidiStretch stretch(*_session, request); @@ -179,22 +179,22 @@ Editor::time_fx (RegionSelection& regions, float val, bool pitching) break; } } - + switch (rb_current_opt) { case 0: - transients = NoTransients; peaklock = false; longwin = true; shortwin = false; + transients = NoTransients; peaklock = false; longwin = true; shortwin = false; break; case 1: - transients = NoTransients; peaklock = false; longwin = false; shortwin = false; + transients = NoTransients; peaklock = false; longwin = false; shortwin = false; break; case 2: - transients = NoTransients; peaklock = true; longwin = false; shortwin = false; + transients = NoTransients; peaklock = true; longwin = false; shortwin = false; break; case 3: - transients = BandLimitedTransients; peaklock = true; longwin = false; shortwin = false; + transients = BandLimitedTransients; peaklock = true; longwin = false; shortwin = false; break; case 5: - transients = Transients; peaklock = false; longwin = false; shortwin = true; + transients = Transients; peaklock = false; longwin = false; shortwin = true; break; case 6: transients = NoTransients; @@ -205,8 +205,8 @@ Editor::time_fx (RegionSelection& regions, float val, bool pitching) // peaklock = false; break; default: - /* default/4 */ - transients = Transients; peaklock = true; longwin = false; shortwin = false; + /* default/4 */ + transients = Transients; peaklock = true; longwin = false; shortwin = false; break; }; diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index d54f6100a9..a558d36fce 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -427,14 +427,14 @@ EngineControl::build_command_line (vector& cmd) /* now jackd arguments */ str = timeout_combo.get_active_text (); - + if (str != _("Ignore")) { double secs = 0; uint32_t msecs; secs = atof (str); msecs = (uint32_t) floor (secs * 1000.0); - + if (msecs > 0) { cmd.push_back ("-t"); cmd.push_back (to_string (msecs, std::dec)); @@ -473,7 +473,7 @@ EngineControl::build_command_line (vector& cmd) cmd.push_back ("-d"); driver = driver_combo.get_active_text (); - + if (driver == X_("ALSA")) { using_alsa = true; cmd.push_back ("alsa"); @@ -515,7 +515,7 @@ EngineControl::build_command_line (vector& cmd) cmd.push_back ("-C"); cmd.push_back (input_device); - + cmd.push_back ("-P"); cmd.push_back (output_device); @@ -536,7 +536,7 @@ EngineControl::build_command_line (vector& cmd) cmd.push_back ("-p"); cmd.push_back (period_size_combo.get_active_text()); - + if (using_alsa || using_ffado || using_coreaudio) { double val = input_latency_adjustment.get_value(); @@ -547,7 +547,7 @@ EngineControl::build_command_line (vector& cmd) } val = output_latency_adjustment.get_value(); - + if (val) { cmd.push_back ("-O"); cmd.push_back (to_string ((uint32_t) val, std::dec)); @@ -1243,7 +1243,7 @@ EngineControl::set_state (const XMLNode& root) if ( (child = root.child ("driver"))){ prop = child->property("val"); - + if (prop && (prop->value() == "Dummy") ) { using_dummy = true; } @@ -1263,15 +1263,15 @@ EngineControl::set_state (const XMLNode& root) if (!prop || prop->value().empty()) { - if (((using_dummy || using_ffado) - && ( child->name() == "interface" - || child->name() == "inputdevice" - || child->name() == "outputdevice")) + if (((using_dummy || using_ffado) + && ( child->name() == "interface" + || child->name() == "inputdevice" + || child->name() == "outputdevice")) || child->name() == "timeout") { continue; } - + error << string_compose (_("AudioSetup value for %1 is missing data"), child->name()) << endmsg; continue; } @@ -1338,13 +1338,13 @@ EngineControl::set_state (const XMLNode& root) } else if (child->name() == "periodsize") { period_size_combo.set_active_text(strval); } else if (child->name() == "serverpath") { - + /* only attempt to set this if we have bothered to look up server names already. otherwise this is all redundant (actually, all of this dialog/widget is redundant in that case ...) */ - + if (!server_strings.empty()) { /* do not allow us to use a server path that doesn't exist on this system. this handles cases where @@ -1365,7 +1365,7 @@ EngineControl::set_state (const XMLNode& root) << endmsg; } } - + } else if (child->name() == "driver") { driver_combo.set_active_text(strval); } else if (child->name() == "interface") { diff --git a/gtk2_ardour/export_channel_selector.cc b/gtk2_ardour/export_channel_selector.cc index 019bb161e7..5d45ca5fa1 100644 --- a/gtk2_ardour/export_channel_selector.cc +++ b/gtk2_ardour/export_channel_selector.cc @@ -510,12 +510,12 @@ TrackExportChannelSelector::TrackExportChannelSelector (ARDOUR::Session * sessio track_scroller.set_size_request (-1, 130); track_scroller.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); pack_start(track_scroller); - + // Track list track_list = Gtk::ListStore::create (track_cols); track_view.set_model (track_list); track_view.set_headers_visible (true); - + track_view.append_column_editable (_("Track"), track_cols.selected); Gtk::CellRendererToggle *toggle = dynamic_cast(track_view.get_column_cell_renderer (0)); toggle->signal_toggled().connect (sigc::hide (sigc::mem_fun (*this, &TrackExportChannelSelector::update_config))); @@ -526,9 +526,9 @@ TrackExportChannelSelector::TrackExportChannelSelector (ARDOUR::Session * sessio Gtk::TreeView::Column* column = track_view.get_column (0); column->pack_start (*text_renderer); column->add_attribute (text_renderer->property_text(), track_cols.label); - + fill_list(); - + show_all_children (); } @@ -575,7 +575,7 @@ TrackExportChannelSelector::update_config() if (!row[track_cols.selected]) { continue; } - + ExportProfileManager::ChannelConfigStatePtr state = manager->add_channel_config(); Route * track = row[track_cols.track]; diff --git a/gtk2_ardour/export_channel_selector.h b/gtk2_ardour/export_channel_selector.h index e7b2dc11ee..dda449d931 100644 --- a/gtk2_ardour/export_channel_selector.h +++ b/gtk2_ardour/export_channel_selector.h @@ -256,7 +256,7 @@ class TrackExportChannelSelector : public ExportChannelSelector Gtk::TreeView track_view; Gtk::ScrolledWindow track_scroller; - + }; #endif /* __export_channel_selector_h__ */ diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc index 83e58d3726..e51f5771d3 100644 --- a/gtk2_ardour/export_dialog.cc +++ b/gtk2_ardour/export_dialog.cc @@ -319,7 +319,7 @@ ExportDialog::show_progress () usleep (10000); } } - + if (!status->aborted()) { status->finish (); } @@ -437,7 +437,7 @@ ExportRegionDialog::init_components () StemExportDialog::StemExportDialog (PublicEditor & editor) : ExportDialog(editor, _("Stem Export"), X_("StemExportProfile")) { - + } void diff --git a/gtk2_ardour/export_dialog.h b/gtk2_ardour/export_dialog.h index 5c9e346f50..5928c67e9f 100644 --- a/gtk2_ardour/export_dialog.h +++ b/gtk2_ardour/export_dialog.h @@ -146,7 +146,7 @@ class ExportRangeDialog : public ExportDialog private: void init_components (); - + std::string range_id; }; @@ -176,7 +176,7 @@ class StemExportDialog : public ExportDialog { public: StemExportDialog (PublicEditor & editor); - + private: void init_components (); }; diff --git a/gtk2_ardour/export_filename_selector.cc b/gtk2_ardour/export_filename_selector.cc index 298b56e853..2912ce75e6 100644 --- a/gtk2_ardour/export_filename_selector.cc +++ b/gtk2_ardour/export_filename_selector.cc @@ -30,11 +30,11 @@ using namespace ARDOUR; ExportFilenameSelector::ExportFilenameSelector () : include_label (_("Include in Filename(s):"), Gtk::ALIGN_LEFT), - + label_label (_("Label:"), Gtk::ALIGN_LEFT), session_checkbox (_("Session Name")), revision_checkbox (_("Revision:")), - + path_label (_("Folder:"), Gtk::ALIGN_LEFT), browse_button (_("Browse")) { diff --git a/gtk2_ardour/export_filename_selector.h b/gtk2_ardour/export_filename_selector.h index d2b77a16f5..4db87d943b 100644 --- a/gtk2_ardour/export_filename_selector.h +++ b/gtk2_ardour/export_filename_selector.h @@ -28,7 +28,7 @@ #include "ardour/session_handle.h" /// -class ExportFilenameSelector : public Gtk::VBox, public ARDOUR::SessionHandlePtr +class ExportFilenameSelector : public Gtk::VBox, public ARDOUR::SessionHandlePtr { public: typedef boost::shared_ptr FilenamePtr; diff --git a/gtk2_ardour/export_format_dialog.cc b/gtk2_ardour/export_format_dialog.cc index 89762be583..0986934661 100644 --- a/gtk2_ardour/export_format_dialog.cc +++ b/gtk2_ardour/export_format_dialog.cc @@ -405,7 +405,7 @@ ExportFormatDialog::init_format_table () row[sample_rate_cols.ptr] = *it; row[sample_rate_cols.color] = "white"; row[sample_rate_cols.label] = (*it)->name(); - + WeakSampleRatePtr ptr (*it); (*it)->SelectChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_sample_rate_selection, this, _1, ptr), gui_context()); (*it)->CompatibleChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_sample_rate_compatibility, this, _1, ptr), gui_context()); diff --git a/gtk2_ardour/export_timespan_selector.cc b/gtk2_ardour/export_timespan_selector.cc index cea01ff4c8..8cbe92b5e2 100644 --- a/gtk2_ardour/export_timespan_selector.cc +++ b/gtk2_ardour/export_timespan_selector.cc @@ -208,7 +208,7 @@ ExportTimespanSelector::construct_length (ARDOUR::Location const * location) con } std::stringstream s; - + switch (state->time_format) { case AudioClock::BBT: s << bbt_str (location->length ()); @@ -225,11 +225,11 @@ ExportTimespanSelector::construct_length (ARDOUR::Location const * location) con case AudioClock::MinSec: s << ms_str (location->length ()); break; - + case AudioClock::Frames: s << location->length (); break; - + case AudioClock::Off: break; } diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index 3b8830b85c..f0a8ceb548 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -97,7 +97,7 @@ GainMeterBase::GainMeterBase (Session* s, _width = Wide; if (horizontal) { - gain_slider = manage (new HSliderController (pix, + gain_slider = manage (new HSliderController (pix, &gain_adjustment, fader_length, false)); @@ -223,13 +223,13 @@ GainMeterBase::set_controls (boost::shared_ptr r, connections.push_back (gain_automation_state_button.signal_button_press_event().connect (sigc::mem_fun(*this, &GainMeterBase::gain_automation_state_button_event), false)); boost::shared_ptr gc = amp->gain_control(); - + gc->alist()->automation_state_changed.connect (model_connections, invalidator (*this), boost::bind (&GainMeter::gain_automation_state_changed, this), gui_context()); gc->alist()->automation_style_changed.connect (model_connections, invalidator (*this), boost::bind (&GainMeter::gain_automation_style_changed, this), gui_context()); - + gain_automation_state_changed (); } - + amp->gain_control()->Changed.connect (model_connections, invalidator (*this), boost::bind (&GainMeterBase::gain_changed, this), gui_context()); gain_changed (); @@ -480,7 +480,7 @@ next_meter_point (MeterPoint mp) break; case MeterCustom: - return MeterInput; + return MeterInput; break; } @@ -864,11 +864,11 @@ GainMeter::set_controls (boost::shared_ptr r, _meter->ConfigurationChanged.connect ( model_connections, invalidator (*this), ui_bind (&GainMeter::meter_configuration_changed, this, _1), gui_context() ); - + meter_configuration_changed (_meter->input_streams ()); } - + /* if we have a non-hidden route (ie. we're not the click or the auditioner), pack some route-dependent stuff. @@ -913,7 +913,7 @@ GainMeter::render_metrics (Gtk::Widget& w, vector types) for (vector::const_iterator i = types.begin(); i != types.end(); ++i) { Glib::RefPtr fg_gc (w.get_style()->get_fg_gc (Gtk::STATE_NORMAL)); - + if (types.size() > 1) { /* we're overlaying more than 1 set of marks, so use different colours */ Gdk::Color c; @@ -925,12 +925,12 @@ GainMeter::render_metrics (Gtk::Widget& w, vector types) c.set_rgb_p (0.2, 0.2, 0.5); break; } - + fg_gc->set_rgb_fg_color (c); } vector points; - + switch (*i) { case DataType::AUDIO: points.push_back (-50); @@ -942,13 +942,13 @@ GainMeter::render_metrics (Gtk::Widget& w, vector types) points.push_back (0); points.push_back (4); break; - + case DataType::MIDI: points.push_back (0); if (types.size() == 1) { points.push_back (32); } else { - /* tweak so as not to overlay the -30dB mark */ + /* tweak so as not to overlay the -30dB mark */ points.push_back (48); } points.push_back (64); @@ -956,11 +956,11 @@ GainMeter::render_metrics (Gtk::Widget& w, vector types) points.push_back (127); break; } - + char buf[32]; - + for (vector::const_iterator j = points.begin(); j != points.end(); ++j) { - + float fraction = 0; switch (*i) { case DataType::AUDIO: @@ -970,24 +970,24 @@ GainMeter::render_metrics (Gtk::Widget& w, vector types) fraction = *j / 127.0; break; } - + gint const pos = height - (gint) floor (height * fraction); - + snprintf (buf, sizeof (buf), "%d", abs (*j)); - + layout->set_text (buf); - + /* we want logical extents, not ink extents here */ - + int tw, th; layout->get_pixel_size (tw, th); - + pixmap->draw_line (fg_gc, 0, pos, 4, pos); - + int p = pos - (th / 2); p = min (p, height - th); p = max (p, 0); - + pixmap->draw_layout (fg_gc, 6, p, layout); } } diff --git a/gtk2_ardour/gain_meter.h b/gtk2_ardour/gain_meter.h index d05ddc15ac..e50bf9b465 100644 --- a/gtk2_ardour/gain_meter.h +++ b/gtk2_ardour/gain_meter.h @@ -207,7 +207,7 @@ class GainMeter : public GainMeterBase, public Gtk::VBox private: void meter_configuration_changed (ARDOUR::ChanCount); - + Gtk::HBox gain_display_box; Gtk::HBox fader_box; Gtk::VBox* fader_vbox; diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index e7ba8d70bd..a44b54c9b0 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -447,7 +447,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptrChanged.connect (control_connections, invalidator (*this), boost::bind (&GenericPluginUI::toggle_parameter_changed, this, control_ui), gui_context()); mcontrol->alist()->automation_state_changed.connect (control_connections, invalidator (*this), boost::bind (&GenericPluginUI::automation_state_changed, this, control_ui), gui_context()); - + if (plugin->get_parameter (port_index) > 0.5){ control_ui->button->set_active(true); } @@ -727,11 +727,11 @@ GenericPluginUI::stop_updating (GdkEventAny*) for (vector::iterator i = input_controls.begin(); i != input_controls.end(); ++i) { (*i)->controller->stop_updating (); } - + if (output_controls.size() > 0 ) { screen_update_connection.disconnect(); } - + return false; } diff --git a/gtk2_ardour/ghostregion.cc b/gtk2_ardour/ghostregion.cc index 27ab4334a9..cb4a0d95d3 100644 --- a/gtk2_ardour/ghostregion.cc +++ b/gtk2_ardour/ghostregion.cc @@ -104,7 +104,7 @@ GhostRegion::is_automation_ghost() AudioGhostRegion::AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos) : GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos) { - + } void @@ -192,7 +192,7 @@ MidiGhostRegion::~MidiGhostRegion() MidiGhostRegion::Event::Event(ArdourCanvas::CanvasNoteEvent* e) : event(e) { - + } MidiGhostRegion::Note::Note(ArdourCanvas::CanvasNote* n, ArdourCanvas::Group* g) @@ -339,7 +339,7 @@ MidiGhostRegion::find_event (ArdourCanvas::CanvasNote* parent) /* we are using _optimization_iterator to speed up the common case where a caller is going through our notes in order. */ - + if (_optimization_iterator != events.end()) { ++_optimization_iterator; } diff --git a/gtk2_ardour/global_port_matrix.cc b/gtk2_ardour/global_port_matrix.cc index 318263a9cd..df22424520 100644 --- a/gtk2_ardour/global_port_matrix.cc +++ b/gtk2_ardour/global_port_matrix.cc @@ -89,7 +89,7 @@ GlobalPortMatrix::get_state (BundleChannel c[2]) const if (_session == 0) { return PortMatrixNode::NOT_ASSOCIATED; } - + Bundle::PortList const & in_ports = c[IN].bundle->channel_ports (c[IN].channel); Bundle::PortList const & out_ports = c[OUT].bundle->channel_ports (c[OUT].channel); if (in_ports.empty() || out_ports.empty()) { @@ -114,11 +114,11 @@ GlobalPortMatrix::get_state (BundleChannel c[2]) const if (jp == 0) { return PortMatrixNode::NOT_ASSOCIATED; } - + char const ** c = jack_port_get_all_connections (jack, jp); char const ** p = c; - + while (p && *p != 0) { if (strcmp (*p, j->c_str()) == 0) { free (c); @@ -185,4 +185,4 @@ GlobalPortMatrix::channel_noun () const { return _("port"); } - + diff --git a/gtk2_ardour/group_tabs.cc b/gtk2_ardour/group_tabs.cc index 297698e85c..faf5ab8edc 100644 --- a/gtk2_ardour/group_tabs.cc +++ b/gtk2_ardour/group_tabs.cc @@ -97,7 +97,7 @@ GroupTabs::on_button_press_event (GdkEventButton* ev) list::iterator j = _tabs.insert (next, n); t = &(*j); } - + } else { _dragging_new_tab = false; } @@ -169,18 +169,18 @@ GroupTabs::on_button_release_event (GdkEventButton* ev) if (!_drag_moved) { if (_dragging->group) { - + if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { - + /* edit */ RouteGroupDialog d (_dragging->group, false); d.do_run (); - + } else { - + /* toggle active state */ _dragging->group->set_active (!_dragging->group->is_active (), this); - + } } @@ -305,7 +305,7 @@ GroupTabs::get_menu (RouteGroup* g) items.push_back (MenuElem (_("New..."), hide_return (sigc::mem_fun(*this, &GroupTabs::create_and_add_group)))); items.push_back (MenuElem (_("New From"), *new_from)); - + if (g) { items.push_back (MenuElem (_("Edit..."), sigc::bind (sigc::mem_fun (*this, &GroupTabs::edit_group), g))); items.push_back (MenuElem (_("Add New Subgroup Bus"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::subgroup), g, false, PreFader))); @@ -316,13 +316,13 @@ GroupTabs::get_menu (RouteGroup* g) } add_menu_items (_menu, g); - + items.push_back (SeparatorElem()); items.push_back (MenuElem (_("Activate All"), sigc::mem_fun(*this, &GroupTabs::activate_all))); items.push_back (MenuElem (_("Disable All"), sigc::mem_fun(*this, &GroupTabs::disable_all))); return _menu; - + } void @@ -407,7 +407,7 @@ GroupTabs::create_and_add_group () const delete g; return 0; } - + _session->add_route_group (g); return g; } @@ -427,7 +427,7 @@ GroupTabs::subgroup (RouteGroup* g, bool aux, Placement placement) struct CollectSorter { CollectSorter (std::string const & key) : _key (key) {} - + bool operator () (boost::shared_ptr a, boost::shared_ptr b) { return a->order_key (_key) < b->order_key (_key); } @@ -470,9 +470,9 @@ GroupTabs::collect (RouteGroup* g) ++i; } else { - + (*j)->set_order_key (order_key (), k + diff); - + } ++j; @@ -502,7 +502,7 @@ GroupTabs::set_activation (RouteGroup* g, bool a) { g->set_active (a, this); } - + void GroupTabs::remove_group (RouteGroup* g) { diff --git a/gtk2_ardour/group_tabs.h b/gtk2_ardour/group_tabs.h index da9523d50d..7362067251 100644 --- a/gtk2_ardour/group_tabs.h +++ b/gtk2_ardour/group_tabs.h @@ -50,7 +50,7 @@ protected: struct Tab { Tab () : group (0) {} - + double from; double to; Gdk::Color colour; ///< colour @@ -97,7 +97,7 @@ private: void activate_all (); void disable_all (); void remove_group (ARDOUR::RouteGroup *); - + void render (cairo_t *); void on_size_request (Gtk::Requisition *); bool on_button_press_event (GdkEventButton *); diff --git a/gtk2_ardour/gtk_pianokeyboard.c b/gtk2_ardour/gtk_pianokeyboard.c index 361e6685e9..90405a6c31 100644 --- a/gtk2_ardour/gtk_pianokeyboard.c +++ b/gtk2_ardour/gtk_pianokeyboard.c @@ -92,7 +92,7 @@ queue_note_draw (PianoKeyboard* pk, int note) } } -static void +static void draw_note(PianoKeyboard *pk, cairo_t* cr, int note) { int is_white = pk->notes[note].white; @@ -138,7 +138,7 @@ draw_note(PianoKeyboard *pk, cairo_t* cr, int note) } } -static int +static int press_key(PianoKeyboard *pk, int key) { assert(key >= 0); @@ -163,7 +163,7 @@ press_key(PianoKeyboard *pk, int key) return 1; } -static int +static int release_key(PianoKeyboard *pk, int key) { assert(key >= 0); @@ -192,9 +192,9 @@ static void rest (PianoKeyboard* pk) { g_signal_emit_by_name(GTK_WIDGET(pk), "rest"); -} +} -static void +static void stop_unsustained_notes(PianoKeyboard *pk) { int i; @@ -208,7 +208,7 @@ stop_unsustained_notes(PianoKeyboard *pk) } } -static void +static void stop_sustained_notes(PianoKeyboard *pk) { int i; @@ -255,7 +255,7 @@ clear_notes(PianoKeyboard *pk) g_hash_table_remove_all(pk->key_bindings); } -static void +static void bind_keys_qwerty(PianoKeyboard *pk) { clear_notes(pk); @@ -298,7 +298,7 @@ bind_keys_qwerty(PianoKeyboard *pk) bind_key(pk, "p", 40); } -static void +static void bind_keys_qwertz(PianoKeyboard *pk) { bind_keys_qwerty(pk); @@ -351,7 +351,7 @@ bind_keys_azerty(PianoKeyboard *pk) bind_key(pk, "p", 40); } -static gint +static gint keyboard_event_handler(GtkWidget *mk, GdkEventKey *event, gpointer notused) { int note; @@ -386,7 +386,7 @@ keyboard_event_handler(GtkWidget *mk, GdkEventKey *event, gpointer notused) if (event->type == GDK_KEY_RELEASE) { rest (pk); } - + return TRUE; } @@ -405,7 +405,7 @@ keyboard_event_handler(GtkWidget *mk, GdkEventKey *event, gpointer notused) return TRUE; } -static int +static int get_note_for_xy(PianoKeyboard *pk, int x, int y) { int height = GTK_WIDGET(pk)->allocation.height; @@ -432,7 +432,7 @@ get_note_for_xy(PianoKeyboard *pk, int x, int y) return -1; } -static gboolean +static gboolean mouse_button_event_handler(PianoKeyboard *pk, GdkEventButton *event, gpointer notused) { int x = event->x; @@ -472,7 +472,7 @@ mouse_button_event_handler(PianoKeyboard *pk, GdkEventButton *event, gpointer no return TRUE; } -static gboolean +static gboolean mouse_motion_event_handler(PianoKeyboard *pk, GdkEventMotion *event, gpointer notused) { int note; @@ -483,7 +483,7 @@ mouse_motion_event_handler(PianoKeyboard *pk, GdkEventMotion *event, gpointer no note = get_note_for_xy(pk, event->x, event->y); if (note != pk->note_being_pressed_using_mouse && note >= 0) { - + if (pk->note_being_pressed_using_mouse >= 0) release_key(pk, pk->note_being_pressed_using_mouse); press_key(pk, note); @@ -499,7 +499,7 @@ piano_keyboard_expose(GtkWidget *widget, GdkEventExpose *event) int i; PianoKeyboard *pk = PIANO_KEYBOARD(widget); cairo_t* cr = gdk_cairo_create (GDK_DRAWABLE (GTK_WIDGET(pk)->window)); - + gdk_cairo_region (cr, event->region); cairo_clip (cr); @@ -526,7 +526,7 @@ piano_keyboard_expose(GtkWidget *widget, GdkEventExpose *event) return TRUE; } -static void +static void piano_keyboard_size_request(GtkWidget* widget, GtkRequisition *requisition) { requisition->width = PIANO_KEYBOARD_DEFAULT_WIDTH; @@ -613,7 +613,7 @@ piano_keyboard_class_init(PianoKeyboardClass *klass) G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - widget_klass = (GtkWidgetClass*) klass; + widget_klass = (GtkWidgetClass*) klass; widget_klass->expose_event = piano_keyboard_expose; widget_klass->size_request = piano_keyboard_size_request; @@ -691,7 +691,7 @@ piano_keyboard_sustain_press(PianoKeyboard *pk) } } -void +void piano_keyboard_sustain_release(PianoKeyboard *pk) { if (pk->maybe_stop_sustained_notes) diff --git a/gtk2_ardour/insert_time_dialog.cc b/gtk2_ardour/insert_time_dialog.cc index 78be9c1826..bc17a6a7c8 100644 --- a/gtk2_ardour/insert_time_dialog.cc +++ b/gtk2_ardour/insert_time_dialog.cc @@ -34,7 +34,7 @@ InsertTimeDialog::InsertTimeDialog (PublicEditor& e) , _clock ("insertTimeClock", true, X_("InsertTimeClock"), true, false, true, true) { set_session (_editor.session ()); - + framepos_t const pos = _editor.get_preferred_edit_position (); get_vbox()->set_border_width (12); diff --git a/gtk2_ardour/insert_time_dialog.h b/gtk2_ardour/insert_time_dialog.h index 34630fa908..15ae77515c 100644 --- a/gtk2_ardour/insert_time_dialog.h +++ b/gtk2_ardour/insert_time_dialog.h @@ -37,7 +37,7 @@ public: private: void move_markers_toggled (); - + PublicEditor& _editor; Gtk::ComboBoxText _intersected_combo; Gtk::CheckButton _move_glued; diff --git a/gtk2_ardour/interthread_progress_window.cc b/gtk2_ardour/interthread_progress_window.cc index 8d446830f3..e81ea26872 100644 --- a/gtk2_ardour/interthread_progress_window.cc +++ b/gtk2_ardour/interthread_progress_window.cc @@ -99,7 +99,7 @@ ImportProgressWindow::update () if (c > _import_status->total) { c = _import_status->total; } - + _bar.set_text (string_compose (_("Importing file: %1 of %2"), c, _import_status->total)); return !(_import_status->all_done || _import_status->cancel); diff --git a/gtk2_ardour/interthread_progress_window.h b/gtk2_ardour/interthread_progress_window.h index 6c7f0f5bd5..653ec46420 100644 --- a/gtk2_ardour/interthread_progress_window.h +++ b/gtk2_ardour/interthread_progress_window.h @@ -42,11 +42,11 @@ public: protected: virtual bool update (); - + Gtk::Button _cancel_button; Gtk::Label _cancel_label; Gtk::ProgressBar _bar; - + private: void cancel_clicked (); diff --git a/gtk2_ardour/io_selector.cc b/gtk2_ardour/io_selector.cc index 61895896d2..8b47c46f39 100644 --- a/gtk2_ardour/io_selector.cc +++ b/gtk2_ardour/io_selector.cc @@ -47,7 +47,7 @@ IOSelector::IOSelector (Gtk::Window* p, ARDOUR::Session* session, boost::shared_ , _io (io) { setup_type (); - + /* signal flow from 0 to 1 */ _find_inputs_for_io_outputs = (_io->direction() == IO::Output); @@ -97,7 +97,7 @@ IOSelector::io_changed_proxy () so we can't call setup_all_ports (which results in a call to Route::foreach_processor) without a deadlock unless we break things up with this idle handler. */ - + Glib::signal_idle().connect_once (sigc::mem_fun (*this, &IOSelector::io_changed)); } @@ -143,7 +143,7 @@ IOSelector::set_state (ARDOUR::BundleChannel c[2], bool s) if (!f) { return; } - + if (s) { _io->connect (f, *j, 0); } else { @@ -219,7 +219,7 @@ IOSelectorWindow::IOSelectorWindow (ARDOUR::Session* session, boost::shared_ptr< set_name ("IOSelectorWindow2"); get_vbox()->pack_start (_selector); - + set_position (Gtk::WIN_POS_MOUSE); io_name_changed (this); diff --git a/gtk2_ardour/io_selector.h b/gtk2_ardour/io_selector.h index bb103d0d5d..e44fd8aa83 100644 --- a/gtk2_ardour/io_selector.h +++ b/gtk2_ardour/io_selector.h @@ -58,7 +58,7 @@ class IOSelector : public PortMatrix void setup_type (); void io_changed (); void io_changed_proxy (); - + int _other; int _ours; boost::shared_ptr _io; diff --git a/gtk2_ardour/led.cc b/gtk2_ardour/led.cc index 76d71bc35e..9a93e048d1 100644 --- a/gtk2_ardour/led.cc +++ b/gtk2_ardour/led.cc @@ -161,7 +161,7 @@ LED::set_colors_from_style () { RefPtr