diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-11-25 00:03:21 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-11-25 00:03:21 +0000 |
commit | 093e12ac9f35a38764e221b3ecf85a45d5cf20ac (patch) | |
tree | f42d5cf00f662147fbc079a8f90f615ee561298f /gtk2_ardour | |
parent | 1f6f5da0032fb39238ad96436e7fd32840010954 (diff) |
enough mind-blowing crazy code, lets do intra-ardour DnD the right way
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4245 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/redirect_box.cc | 23 | ||||
-rw-r--r-- | gtk2_ardour/redirect_box.h | 4 |
2 files changed, 6 insertions, 21 deletions
diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc index f0f06d12d6..25fa0191ad 100644 --- a/gtk2_ardour/redirect_box.cc +++ b/gtk2_ardour/redirect_box.cc @@ -121,7 +121,7 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, PluginSelector &plugse redirect_display.get_column(0)->set_sizing(TREE_VIEW_COLUMN_FIXED); redirect_display.get_column(0)->set_fixed_width(48); redirect_display.add_object_drag (columns.redirect.index(), "redirects"); - redirect_display.signal_object_drop.connect (mem_fun (*this, &RedirectBox::object_drop)); + redirect_display.signal_drop.connect (mem_fun (*this, &RedirectBox::object_drop)); TreeViewColumn* name_col = redirect_display.get_column(0); CellRendererText* renderer = dynamic_cast<CellRendererText*>(redirect_display.get_column_cell_renderer (0)); @@ -169,22 +169,8 @@ RedirectBox::route_going_away () } void -RedirectBox::object_drop (string type, uint32_t cnt, const boost::shared_ptr<Redirect>* ptr) +RedirectBox::object_drop (const list<boost::shared_ptr<Redirect> >& redirects) { - cerr << "Object drop, type = " << type << " cnt = " << cnt << endl; - - if (type != "redirects" || cnt == 0 || !ptr) { - return; - } - - /* do something with the dropped redirects */ - - list<boost::shared_ptr<Redirect> > redirects; - - for (uint32_t n = 0; n < cnt; ++n) { - redirects.push_back (ptr[n]); - } - paste_redirect_list (redirects); } @@ -194,7 +180,6 @@ RedirectBox::update() redisplay_redirects (0); } - void RedirectBox::set_width (Width w) { @@ -953,11 +938,11 @@ RedirectBox::paste_redirects () } void -RedirectBox::paste_redirect_list (list<boost::shared_ptr<Redirect> >& redirects) +RedirectBox::paste_redirect_list (const list<boost::shared_ptr<Redirect> >& redirects) { list<boost::shared_ptr<Redirect> > copies; - for (list<boost::shared_ptr<Redirect> >::iterator i = redirects.begin(); i != redirects.end(); ++i) { + for (list<boost::shared_ptr<Redirect> >::const_iterator i = redirects.begin(); i != redirects.end(); ++i) { boost::shared_ptr<Redirect> copy = Redirect::clone (*i); diff --git a/gtk2_ardour/redirect_box.h b/gtk2_ardour/redirect_box.h index 0d0ce84bd2..bb00d820c3 100644 --- a/gtk2_ardour/redirect_box.h +++ b/gtk2_ardour/redirect_box.h @@ -125,7 +125,7 @@ class RedirectBox : public Gtk::HBox, public PluginInterestedObject Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Redirect> > redirect_display; Gtk::ScrolledWindow redirect_scroller; - void object_drop (std::string type, uint32_t cnt, const boost::shared_ptr<ARDOUR::Redirect>*); + void object_drop (const std::list<boost::shared_ptr<ARDOUR::Redirect> >&); Width _width; @@ -184,7 +184,7 @@ class RedirectBox : public Gtk::HBox, public PluginInterestedObject void get_selected_redirects (vector<boost::shared_ptr<ARDOUR::Redirect> >&); static Glib::RefPtr<Gtk::Action> paste_action; - void paste_redirect_list (std::list<boost::shared_ptr<ARDOUR::Redirect> >& redirects); + void paste_redirect_list (const std::list<boost::shared_ptr<ARDOUR::Redirect> >& redirects); void activate_redirect (boost::shared_ptr<ARDOUR::Redirect>); void deactivate_redirect (boost::shared_ptr<ARDOUR::Redirect>); |