make autoscroll a bit easier to use, fix missing measure lines when moving the editor...
[ardour.git] / gtk2_ardour / route_time_axis.cc
index 82d5b53cbab3b6fa58d7face68748f92ac41f356..c94d3d2e719c8af2f115082446d61b215d142871 100644 (file)
@@ -61,8 +61,6 @@
 #include "gui_thread.h"
 #include "keyboard.h"
 #include "playlist_selector.h"
-#include "plugin_selector.h"
-#include "plugin_ui.h"
 #include "point_selection.h"
 #include "prompter.h"
 #include "public_editor.h"
@@ -120,6 +118,8 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
 
        hide_button.add (*(manage (new Image (get_xpm("small_x.xpm")))));
 
+       /* XXX is this incomplete? i don't think its very useful atm
+
        solo_button->signal_button_press_event().connect (mem_fun (*this, &RouteTimeAxisView::select_me), false);
        mute_button->signal_button_press_event().connect (mem_fun (*this, &RouteTimeAxisView::select_me), false);
        playlist_button.signal_button_press_event().connect (mem_fun (*this, &RouteTimeAxisView::select_me), false);
@@ -127,6 +127,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
        size_button.signal_button_press_event().connect (mem_fun (*this, &RouteTimeAxisView::select_me), false);
        visual_button.signal_button_press_event().connect (mem_fun (*this, &RouteTimeAxisView::select_me), false);
        hide_button.signal_button_press_event().connect (mem_fun (*this, &RouteTimeAxisView::select_me), false);
+       */
 
        solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press), false);
        solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release), false);
@@ -142,7 +143,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
        if (is_track()) {
                rec_enable_button->set_active (false);
                rec_enable_button->set_name ("TrackRecordEnableButton");
-               rec_enable_button->signal_button_press_event().connect (mem_fun (*this, &RouteTimeAxisView::select_me), false);
+               //rec_enable_button->signal_button_press_event().connect (mem_fun (*this, &RouteTimeAxisView::select_me), false);
                rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
                controls_table.attach (*rec_enable_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
                ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
@@ -730,7 +731,7 @@ RouteTimeAxisView::rename_current_playlist ()
        ArdourPrompter prompter (true);
        string name;
 
-       Diskstream *const ds = get_diskstream();
+       boost::shared_ptr<Diskstream> ds = get_diskstream();
        if (!ds || ds->destructive())
                return;
 
@@ -761,7 +762,7 @@ RouteTimeAxisView::use_copy_playlist (bool prompt)
 {
        string name;
        
-       Diskstream *const ds = get_diskstream();
+       boost::shared_ptr<Diskstream> ds = get_diskstream();
        if (!ds || ds->destructive())
                return;
 
@@ -802,7 +803,7 @@ RouteTimeAxisView::use_new_playlist (bool prompt)
 {
        string name;
        
-       Diskstream *const ds = get_diskstream();
+       boost::shared_ptr<Diskstream> ds = get_diskstream();
        if (!ds || ds->destructive())
                return;
 
@@ -840,7 +841,7 @@ RouteTimeAxisView::use_new_playlist (bool prompt)
 void
 RouteTimeAxisView::clear_playlist ()
 {
-       Diskstream *const ds = get_diskstream();
+       boost::shared_ptr<Diskstream> ds = get_diskstream();
        if (!ds || ds->destructive())
                return;
 
@@ -880,8 +881,7 @@ RouteTimeAxisView::selection_click (GdkEventButton* ev)
 
        switch (Keyboard::selection_type (ev->state)) {
        case Selection::Toggle:
-               /* XXX this is not right */
-               editor.get_selection().add (*tracks);
+               editor.get_selection().toggle (*tracks);
                break;
                
        case Selection::Set:
@@ -966,7 +966,7 @@ RouteTimeAxisView::name() const
 Playlist *
 RouteTimeAxisView::playlist () const 
 {
-       Diskstream *ds;
+       boost::shared_ptr<Diskstream> ds;
 
        if ((ds = get_diskstream()) != 0) {
                return ds->playlist(); 
@@ -1013,24 +1013,24 @@ RouteTimeAxisView::hide_click ()
        editor.hide_track_in_display (*this);
 }
 
-Region*
+boost::shared_ptr<Region>
 RouteTimeAxisView::find_next_region (jack_nframes_t pos, RegionPoint point, int32_t dir)
 {
-       Diskstream *stream;
+       boost::shared_ptr<Diskstream> stream;
        Playlist *playlist;
 
        if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
                return playlist->find_next_region (pos, point, dir);
        }
 
-       return 0;
+       return boost::shared_ptr<Region> ();
 }
 
 bool
 RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
 {
        Playlist* what_we_got;
-       Diskstream* ds = get_diskstream();
+       boost::shared_ptr<Diskstream> ds = get_diskstream();
        Playlist* playlist;
        bool ret = false;
 
@@ -1056,7 +1056,7 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
        case Cut:
                if ((what_we_got = playlist->cut (time)) != 0) {
                        editor.get_cut_buffer().add (what_we_got);
-                       _session.add_command( new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
+                       _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
                        ret = true;
                }
                break;
@@ -1068,7 +1068,7 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
 
        case Clear:
                if ((what_we_got = playlist->cut (time)) != 0) {
-                       _session.add_command( new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
+                       _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
                        what_we_got->unref ();
                        ret = true;
                }
@@ -1099,7 +1099,7 @@ RouteTimeAxisView::paste (jack_nframes_t pos, float times, Selection& selection,
        
        XMLNode &before = playlist->get_state();
        playlist->paste (**p, pos, times);
-       _session.add_command( new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
+       _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
 
        return true;
 }