X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fvisual_time_axis.cc;h=10c8513ec8741753c4601e3a4e9f0b15038dd5a5;hb=19e97d1d64e8aa6d87d79d1f6332065992e5e027;hp=9574a83c26436caad4dddcf243bbf2b7852997aa;hpb=bb9cc45cd22af67ac275a5e73accbe14fee664d8;p=ardour.git diff --git a/gtk2_ardour/visual_time_axis.cc b/gtk2_ardour/visual_time_axis.cc index 9574a83c26..10c8513ec8 100644 --- a/gtk2_ardour/visual_time_axis.cc +++ b/gtk2_ardour/visual_time_axis.cc @@ -30,7 +30,6 @@ #include #include #include -#include #include #include "ardour/session.h" @@ -55,7 +54,6 @@ using namespace ARDOUR; using namespace PBD; -using namespace sigc; using namespace Gtk; /** @@ -66,7 +64,7 @@ using namespace Gtk; * @param sess the current session * @param canvas the parent canvas object */ -VisualTimeAxis::VisualTimeAxis(const string & name, PublicEditor& ed, ARDOUR::Session& sess, Canvas& canvas) +VisualTimeAxis::VisualTimeAxis(const string & name, PublicEditor& ed, ARDOUR::Session* sess, Canvas& canvas) : AxisView(sess), TimeAxisView(sess,ed,(TimeAxisView*) 0, canvas), visual_button (_("v")), @@ -75,21 +73,21 @@ VisualTimeAxis::VisualTimeAxis(const string & name, PublicEditor& ed, ARDOUR::Se time_axis_name = name ; _color = unique_random_color() ; - name_entry.signal_activate().connect(mem_fun(*this, &VisualTimeAxis::name_entry_changed)) ; - name_entry.signal_button_press_event().connect(mem_fun(*this, &VisualTimeAxis::name_entry_button_press_handler)) ; - name_entry.signal_button_release_event().connect(mem_fun(*this, &VisualTimeAxis::name_entry_button_release_handler)) ; - name_entry.signal_key_release_event().connect(mem_fun(*this, &VisualTimeAxis::name_entry_key_release_handler)) ; + name_entry.signal_activate().connect(sigc::mem_fun(*this, &VisualTimeAxis::name_entry_changed)) ; + name_entry.signal_button_press_event().connect(sigc::mem_fun(*this, &VisualTimeAxis::name_entry_button_press_handler)) ; + name_entry.signal_button_release_event().connect(sigc::mem_fun(*this, &VisualTimeAxis::name_entry_button_release_handler)) ; + name_entry.signal_key_release_event().connect(sigc::mem_fun(*this, &VisualTimeAxis::name_entry_key_release_handler)) ; size_button.set_name("TrackSizeButton") ; visual_button.set_name("TrackVisualButton") ; hide_button.set_name("TrackRemoveButton") ; hide_button.add(*(Gtk::manage(new Gtk::Image(get_xpm("small_x.xpm"))))); - size_button.signal_button_release_event().connect (mem_fun (*this, &VisualTimeAxis::size_click)) ; - visual_button.signal_clicked().connect (mem_fun (*this, &VisualTimeAxis::visual_click)) ; - hide_button.signal_clicked().connect (mem_fun (*this, &VisualTimeAxis::hide_click)) ; - ARDOUR_UI::instance()->tooltips().set_tip(size_button,_("Display Height")) ; - ARDOUR_UI::instance()->tooltips().set_tip(visual_button, _("Visual options")) ; - ARDOUR_UI::instance()->tooltips().set_tip(hide_button, _("Hide this track")) ; + size_button.signal_button_release_event().connect (sigc::mem_fun (*this, &VisualTimeAxis::size_click)) ; + visual_button.signal_clicked().connect (sigc::mem_fun (*this, &VisualTimeAxis::visual_click)) ; + hide_button.signal_clicked().connect (sigc::mem_fun (*this, &VisualTimeAxis::hide_click)) ; + ARDOUR_UI::instance()->set_tip(size_button,_("Display Height")) ; + ARDOUR_UI::instance()->set_tip(visual_button, _("Visual options")) ; + ARDOUR_UI::instance()->set_tip(hide_button, _("Hide this track")) ; controls_table.attach (hide_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND); controls_table.attach (visual_button, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND); @@ -223,7 +221,7 @@ VisualTimeAxis::choose_time_axis_color() current[3] = 1.0 ; current_color.set_rgb_p (current[0],current[1],current[2]); - color = Gtkmm2ext::UI::instance()->get_color(_("ardour: color selection"),picked, ¤t_color) ; + color = Gtkmm2ext::UI::instance()->get_color(_("Color Selection"),picked, ¤t_color) ; if (picked) { @@ -262,7 +260,7 @@ VisualTimeAxis::remove_this_time_axis(void* src) { vector choices; - std::string prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n(cannot be undone)"), time_axis_name); + std::string prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n\nYou may also lose the playlist used by this track.\n\n(This action cannot be undone, and the session file will be overwritten)"), time_axis_name); choices.push_back (_("No, do nothing.")); choices.push_back (_("Yes, remove it.")); @@ -274,7 +272,7 @@ VisualTimeAxis::remove_this_time_axis(void* src) defer to idle loop, otherwise we'll delete this object while we're still inside this function ... */ - Glib::signal_idle().connect(bind(sigc::ptr_fun(&VisualTimeAxis::idle_remove_this_time_axis), this, src)); + Glib::signal_idle().connect(sigc::bind(sigc::ptr_fun(&VisualTimeAxis::idle_remove_this_time_axis), this, src)); } } @@ -343,7 +341,7 @@ VisualTimeAxis::label_view() { name_label.set_text(time_axis_name) ; name_entry.set_text(time_axis_name) ; - ARDOUR_UI::instance()->tooltips().set_tip(name_entry, time_axis_name) ; + ARDOUR_UI::instance()->set_tip(name_entry, time_axis_name) ; } @@ -374,22 +372,22 @@ VisualTimeAxis::name_entry_changed() } } -gint +bool VisualTimeAxis::name_entry_button_press_handler(GdkEventButton *ev) { if (ev->button == 3) { - return stop_signal (name_entry, "button_press_event"); + return true; } - return FALSE; + return false } -gint +bool VisualTimeAxis::name_entry_button_release_handler(GdkEventButton *ev) { - return FALSE; + return false; } -gint +bool VisualTimeAxis::name_entry_key_release_handler(GdkEventKey* ev) { switch (ev->keyval) { @@ -397,11 +395,13 @@ VisualTimeAxis::name_entry_key_release_handler(GdkEventKey* ev) case GDK_Up: case GDK_Down: name_entry_changed (); - return TRUE; + return true; default: - return FALSE; + break; } + + return false; } @@ -409,15 +409,15 @@ VisualTimeAxis::name_entry_key_release_handler(GdkEventKey* ev) // Super class methods not handled by VisualTimeAxis void -VisualTimeAxis::show_timestretch (nframes_t start, nframes_t end) +VisualTimeAxis::show_timestretch (framepos_t start, framepos_t end) { - // Not handled by purely visual TimeAxis + // Not handled by purely visual TimeAxis } void VisualTimeAxis::hide_timestretch() { - // Not handled by purely visual TimeAxis + // Not handled by purely visual TimeAxis }