enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h
[ardour.git] / gtk2_ardour / editor_drag.cc
index cb4de0cf7ca4491ecd4b247ac2a7c8e6186f3777..a3b6664e57f4aeb5af57e62e6818861ef3dd4334 100644 (file)
@@ -44,7 +44,7 @@
 #include "canvas/scroll_group.h"
 
 #include "editor.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
 #include "keyboard.h"
 #include "audio_region_view.h"
 #include "automation_region_view.h"
@@ -510,7 +510,7 @@ Drag::show_verbose_cursor_text (string const & text)
 }
 
 boost::shared_ptr<Region>
-Drag::add_midi_region (MidiTimeAxisView* view, bool commit, const int32_t& sub_num)
+Drag::add_midi_region (MidiTimeAxisView* view, bool commit, const int32_t sub_num)
 {
        if (_editor->session()) {
                const TempoMap& map (_editor->session()->tempo_map());
@@ -1741,7 +1741,7 @@ RegionMoveDrag::insert_region_into_playlist (
        layer_t dest_layer,
        framecnt_t where,
        PlaylistSet& modified_playlists,
-       const int32_t& sub_num
+       const int32_t sub_num
        )
 {
        boost::shared_ptr<Playlist> dest_playlist = dest_rtv->playlist ();
@@ -3324,14 +3324,16 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
                        _editor->begin_reversible_command (_("move tempo mark"));
 
                } else {
+                       const Tempo tempo (_marker->tempo());
                        const framepos_t frame = adjusted_current_frame (event) + 1;
+                       const TempoSection::Type type = _real_section->type();
 
                        _editor->begin_reversible_command (_("copy tempo mark"));
 
                        if (_real_section->position_lock_style() == MusicTime) {
-                               _real_section = map.add_tempo (_marker->tempo(), map.pulse_at_frame (frame), 0, _real_section->type(), MusicTime);
+                               _real_section = map.add_tempo (tempo, map.pulse_at_frame (frame), 0, type, MusicTime);
                        } else {
-                               _real_section = map.add_tempo (_marker->tempo(), 0.0, frame, _real_section->type(), AudioTime);
+                               _real_section = map.add_tempo (tempo, 0.0, frame, type, AudioTime);
                        }
 
                        if (!_real_section) {
@@ -4242,6 +4244,10 @@ MarkerDrag::finished (GdkEvent* event, bool movement_occurred)
                        } else {
                                location->set (((*x).location)->start(), ((*x).location)->end());
                        }
+
+                       if (location->is_session_range()) {
+                               _editor->session()->set_end_is_free (false);
+                       }
                }
        }