enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h
[ardour.git] / gtk2_ardour / editor_ops.cc
index b7809f0394e0e283a6be211ae19c644806ea296c..c83e96d67f15a269d77d3d561e7227c30e31d830 100644 (file)
 #include "transform_dialog.h"
 #include "ui_config.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace ARDOUR;
@@ -151,7 +151,7 @@ Editor::redo (uint32_t n)
 }
 
 void
-Editor::split_regions_at (framepos_t where, RegionSelection& regions, const int32_t& sub_num)
+Editor::split_regions_at (framepos_t where, RegionSelection& regions, const int32_t sub_num)
 {
        bool frozen = false;
 
@@ -433,6 +433,9 @@ Editor::nudge_forward (bool next, bool force_playhead)
                                        } else {
                                                loc->set_end (max_framepos);
                                        }
+                                       if (loc->is_session_range()) {
+                                               _session->set_end_is_free (false);
+                                       }
                                }
                                if (!in_command) {
                                        begin_reversible_command (_("nudge location forward"));
@@ -524,6 +527,9 @@ Editor::nudge_backward (bool next, bool force_playhead)
                                        } else {
                                                loc->set_end (loc->length());
                                        }
+                                       if (loc->is_session_range()) {
+                                               _session->set_end_is_free (false);
+                                       }
                                }
                                if (!in_command) {
                                        begin_reversible_command (_("nudge location forward"));
@@ -2233,6 +2239,8 @@ Editor::set_session_end_from_playhead ()
 
                commit_reversible_command ();
        }
+
+       _session->set_end_is_free (false);
 }
 
 void
@@ -4653,7 +4661,7 @@ Editor::mouse_paste ()
 }
 
 void
-Editor::paste_internal (framepos_t position, float times, const int32_t& sub_num)
+Editor::paste_internal (framepos_t position, float times, const int32_t sub_num)
 {
         DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("apparent paste position is %1\n", position));
 
@@ -6287,11 +6295,11 @@ Editor::set_session_extents_from_selection ()
 
        Location* loc;
        if ((loc = _session->locations()->session_range_location()) == 0) {
-               _session->set_session_extents ( start, end );  // this will create a new session range;  no need for UNDO
+               _session->set_session_extents (start, end);  // this will create a new session range;  no need for UNDO
        } else {
                XMLNode &before = loc->get_state();
 
-               _session->set_session_extents ( start, end );
+               _session->set_session_extents (start, end);
 
                XMLNode &after = loc->get_state();
 
@@ -6301,6 +6309,8 @@ Editor::set_session_extents_from_selection ()
 
                commit_reversible_command ();
        }
+
+       _session->set_end_is_free (false);
 }
 
 void
@@ -6557,7 +6567,8 @@ Editor::define_one_bar (framepos_t start, framepos_t end)
        } else if (t.frame() == start) {
                _session->tempo_map().change_existing_tempo_at (start, beats_per_minute, t.note_type());
        } else {
-               _session->tempo_map().add_tempo (Tempo (beats_per_minute, t.note_type()), 0.0, start, TempoSection::Constant, AudioTime);
+               const Tempo tempo (beats_per_minute, t.note_type());
+               _session->tempo_map().add_tempo (tempo, 0.0, start, TempoSection::Constant, AudioTime);
        }
 
        XMLNode& after (_session->tempo_map().get_state());