diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2005-12-06 16:21:06 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2005-12-06 16:21:06 +0000 |
commit | dd455c894aed80a4aa73e4fa186d0b8419c105c8 (patch) | |
tree | a7bf0d965f53c921026a8b682b3aa43a5cf592b3 /gtk2_ardour | |
parent | f04aa5e49a1633f6cf39b8bb1872725332370b52 (diff) |
un-triple-buffer fastmeter (not finished), fix mixer strip name button, comment editor, +++
git-svn-id: svn://localhost/trunk/ardour2@175 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 77 | ||||
-rw-r--r-- | gtk2_ardour/mixer_strip.h | 7 | ||||
-rw-r--r-- | gtk2_ardour/route_ui.cc | 5 |
3 files changed, 44 insertions, 45 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 0329c6e800..a005d3637e 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -144,6 +144,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer) ignore_toggle = false; ignore_speed_adjustment = false; comment_window = 0; + comment_area = 0; width_button.add (*(manage (new Gtk::Image (Gdk::Pixbuf::create_from_xpm_data(lr_xpm))))); hide_button.add (*(manage (new Gtk::Image (Gdk::Pixbuf::create_from_xpm_data(small_x_xpm))))); @@ -1113,32 +1114,48 @@ MixerStrip::comment_button_clicked () if (comment_window->is_visible()) { comment_window->hide (); - } else { - comment_window->set_position (Gtk::WIN_POS_MOUSE); - comment_window->show_all (); + return; + } + + comment_window->set_position (Gtk::WIN_POS_MOUSE); + comment_window->show_all (); + comment_window->present(); + + ResponseType response = (ResponseType) comment_window->run(); + comment_window->hide (); + + switch (response) { + case RESPONSE_ACCEPT: + break; + default: + return; } + + string str = comment_area->get_buffer()->get_text(); + _route.set_comment (str, this); + ARDOUR_UI::instance()->tooltips().set_tip (comment_button, + str.empty() ? _("click to add/edit comments") : str); } void MixerStrip::setup_comment_editor () { - comment_window = new Window (WINDOW_TOPLEVEL); + string title; + title = _route.name(); + title += _(": comment editor"); - string str; - str = _route.name(); - str += _(": comment editor"); - comment_window->set_title (str); + comment_window = new ArdourDialog (title, false); + comment_area = manage (new TextView()); - comment_area.set_name ("MixerTrackCommentArea"); - comment_area.set_editable (true); - // GTK2FIX - // comment_area.changed.connect (mem_fun(*this, &MixerStrip::comment_edited)); - // GTK2FIX - // comment_area.signal_button_release_event().connect_after (ptr_fun (do_not_propagate)); - comment_area.show (); + comment_area->set_name ("MixerTrackCommentArea"); + comment_area->set_editable (true); + comment_area->get_buffer()->set_text (_route.comment()); + comment_area->set_size_request (200,100); + comment_area->show (); - comment_window->add (comment_area); - comment_window->signal_delete_event().connect (bind (ptr_fun (just_hide_it), comment_window)); + comment_window->get_vbox()->pack_start (*comment_area); + comment_window->add_button (Stock::CANCEL, RESPONSE_CANCEL); + comment_window->add_button (Stock::OK, RESPONSE_ACCEPT); } void @@ -1148,29 +1165,14 @@ MixerStrip::comment_changed (void *src) if (src != this) { ignore_comment_edit = true; - // comment_area.freeze (); - //comment_area.get_buffer()->delete_text (0, -1); - //comment_area.set_point (0); - comment_area.get_buffer()->set_text (_route.comment()); - // comment_area.thaw (); + if (comment_area) { + comment_area->get_buffer()->set_text (_route.comment()); + } ignore_comment_edit = false; } } void -MixerStrip::comment_edited () -{ - ENSURE_GUI_THREAD(mem_fun(*this, &MixerStrip::comment_edited)); - - if (!ignore_comment_edit) { - string str = comment_area.get_buffer()->get_text(); - _route.set_comment (str, this); - ARDOUR_UI::instance()->tooltips().set_tip (comment_button, - str.empty() ? _("click to add/edit comments") : str); - } -} - -void MixerStrip::set_mix_group (RouteGroup *rg) { @@ -1251,13 +1253,10 @@ MixerStrip::route_gui_changed (string what_changed, void* ignored) void MixerStrip::show_route_color () { - Glib::RefPtr<Gtk::Style> style; - name_button.ensure_style (); - style = name_button.get_style()->copy(); + Glib::RefPtr<Gtk::Style> style = name_button.get_style()->copy(); style->set_bg (Gtk::STATE_NORMAL, color()); name_button.set_style (style); - style->unreference(); route_active_changed (); } diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index e5ea5b6cf3..8b69e26379 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -55,6 +55,7 @@ #include "panner_ui.h" #include "enums.h" #include "redirect_box.h" +#include "ardour_dialog.h" class MotionController; @@ -152,9 +153,9 @@ class MixerStrip : public RouteUI, public Gtk::EventBox Gtk::Button name_button; - Gtk::Window* comment_window; - Gtk::TextView comment_area; - Gtk::Button comment_button; + ArdourDialog* comment_window; + Gtk::TextView* comment_area; + Gtk::Button comment_button; void setup_comment_editor (); void comment_button_clicked (); diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 68f6622e35..daf5fcba69 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -157,7 +157,7 @@ RouteUI::mute_press(GdkEventButton* ev) } - return stop_signal (*mute_button, "button-press-event"); + return true; } gint @@ -169,10 +169,9 @@ RouteUI::mute_release(GdkEventButton* ev) // undo the last op // because the press was the last undoable thing we did _session.undo (1U); - stop_signal (*mute_button, "button-release-event"); } } - return TRUE; + return true; } gint |