- audition_button.unset_flags (Gtk::CAN_FOCUS);
-
- audition_button.set_events (audition_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
-
- top_row_button_hbox.set_border_width (5);
- top_row_button_hbox.set_spacing (5);
- top_row_button_hbox.set_homogeneous (false);
- top_row_button_hbox.pack_end (audition_button, false, false);
-
- top_row_hbox.pack_start (name_hbox, true, true);
- top_row_hbox.pack_end (top_row_button_hbox, true, true);
-
- position_label.set_name ("AudioRegionEditorLabel");
- position_label.set_text (_("Position"));
- end_label.set_name ("AudioRegionEditorLabel");
- end_label.set_text (_("End"));
- length_label.set_name ("AudioRegionEditorLabel");
- length_label.set_text (_("Length"));
- sync_relative_label.set_name ("AudioRegionEditorLabel");
- sync_relative_label.set_text (_("Sync point (relative to region position)"));
- sync_absolute_label.set_name ("AudioRegionEditorLabel");
- sync_absolute_label.set_text (_("Sync point (absolute)"));
- start_label.set_name ("AudioRegionEditorLabel");
- start_label.set_text (_("File start"));
-
- time_table.set_col_spacings (2);
- time_table.set_row_spacings (5);
- time_table.set_border_width (5);
-
- position_label.set_alignment (1, 0.5);
- time_table.attach (position_label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL);
- time_table.attach (position_clock, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL);
-
- end_label.set_alignment (1, 0.5);
- time_table.attach (end_label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL);
- time_table.attach (end_clock, 1, 2, 1, 2, Gtk::FILL, Gtk::FILL);
-
- length_label.set_alignment (1, 0.5);
- time_table.attach (length_label, 0, 1, 2, 3, Gtk::FILL, Gtk::FILL);
- time_table.attach (length_clock, 1, 2, 2, 3, Gtk::FILL, Gtk::FILL);
-
- sync_relative_label.set_alignment (1, 0.5);
- time_table.attach (sync_relative_label, 0, 1, 3, 4, Gtk::FILL, Gtk::FILL);
- time_table.attach (sync_offset_relative_clock, 1, 2, 3, 4, Gtk::FILL, Gtk::FILL);
-
- sync_absolute_label.set_alignment (1, 0.5);
- time_table.attach (sync_absolute_label, 0, 1, 4, 5, Gtk::FILL, Gtk::FILL);
- time_table.attach (sync_offset_absolute_clock, 1, 2, 4, 5, Gtk::FILL, Gtk::FILL);
-
- start_label.set_alignment (1, 0.5);
- time_table.attach (start_label, 0, 1, 5, 6, Gtk::FILL, Gtk::FILL);
- time_table.attach (start_clock, 1, 2, 5, 6, Gtk::FILL, Gtk::FILL);
-
- lower_hbox.pack_start (time_table, true, true);
- lower_hbox.pack_start (sep1, false, false);
- lower_hbox.pack_start (sep2, false, false);
-
- get_vbox()->pack_start (top_row_hbox, true, true);
- get_vbox()->pack_start (sep3, false, false);
- get_vbox()->pack_start (lower_hbox, true, true);
-
- set_name ("AudioRegionEditorWindow");
- add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
-
- signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), static_cast<Window *> (this)));
-
- set_title (string_compose (_("Region %1"), _region->name()));
-
- show_all();
-
- name_changed ();
- bounds_changed (Change (StartChanged|LengthChanged|PositionChanged|StartChanged|Region::SyncOffsetChanged));
-
- _region->StateChanged.connect (mem_fun(*this, &AudioRegionEditor::region_changed));
-
- spin_arrow_grab = false;
-
- connect_editor_events ();
-}
-
-AudioRegionEditor::~AudioRegionEditor ()
-{
-}
-
-void
-AudioRegionEditor::region_changed (Change what_changed)
-{
- if (what_changed & NameChanged) {
- name_changed ();
- }
-
- if (what_changed & Change (BoundsChanged|StartChanged|Region::SyncOffsetChanged)) {
- bounds_changed (what_changed);
- }
-}
-
-gint
-AudioRegionEditor::bpressed (GdkEventButton* ev, Gtk::SpinButton* /*but*/, void (AudioRegionEditor::*/*pmf*/)())
-{
- switch (ev->button) {
- case 1:
- case 2:
- case 3:
- if (ev->type == GDK_BUTTON_PRESS) { /* no double clicks here */
- if (!spin_arrow_grab) {
- // GTK2FIX probably nuke the region editor
- // if ((ev->window == but->gobj()->panel)) {
- // spin_arrow_grab = true;
- // (this->*pmf)();
- // }
- }
- }
- break;
- default:
- break;
- }
- return FALSE;
-}
-
-gint
-AudioRegionEditor::breleased (GdkEventButton* /*ev*/, Gtk::SpinButton* /*but*/, void (AudioRegionEditor::*pmf)())
-{
- if (spin_arrow_grab) {
- (this->*pmf)();
- spin_arrow_grab = false;
- }
- return FALSE;