a) moved metering and meter falloff code into libardour
[ardour.git] / gtk2_ardour / location_ui.cc
index a6957a90175202023dbe281d1ca722d181e2c549..21d0fb5b15558ff06313be704558cd319f15282f 100644 (file)
@@ -108,17 +108,8 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
        cd_track_details_hbox.pack_start (composer_entry, true, true);
 
        isrc_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::isrc_entry_changed)); 
-       isrc_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
-       isrc_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
-
        performer_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::performer_entry_changed));
-       performer_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
-       performer_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
-
        composer_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::composer_entry_changed));
-       composer_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
-       composer_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
-
        scms_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::scms_toggled));
        preemph_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::preemph_toggled));
 
@@ -240,8 +231,6 @@ LocationEditRow::set_location (Location *loc)
                name_entry.set_size_request (100, -1);
                name_entry.set_editable (true);
                name_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::name_entry_changed));  
-               name_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
-               name_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
 
                if (!name_entry.get_parent()) {
                        item_table.attach (name_entry, 1, 2, 0, 1, FILL | EXPAND, FILL, 4, 0);
@@ -302,18 +291,6 @@ LocationEditRow::set_location (Location *loc)
        
 }
 
-gint
-LocationEditRow::entry_focus_event (GdkEventFocus* ev)
-{
-       if (ev->in) {
-               ARDOUR_UI::instance()->allow_focus (true);
-       } else {
-               ARDOUR_UI::instance()->allow_focus (false);
-       }
-       return TRUE;
-}
-
-
 void
 LocationEditRow::name_entry_changed ()
 {
@@ -598,15 +575,12 @@ LocationUI::LocationUI ()
        set_wmclass(_("ardour_locations"), "Ardour");
 
        set_name ("LocationWindow");
-       signal_delete_event().connect (bind (ptr_fun (just_hide_it), static_cast<Window*>(this)));
-
-       add (location_hpacker);
 
+       get_vbox()->pack_start (location_hpacker);
 
        location_vpacker.set_border_width (10);
        location_vpacker.set_spacing (5);
 
-
        location_vpacker.pack_start (loop_edit_row, false, false);
        location_vpacker.pack_start (punch_edit_row, false, false);
 
@@ -810,7 +784,8 @@ LocationUI::add_new_range()
 {
        if (session) {
                jack_nframes_t where = session->audible_frame();
-               Location *location = new Location (where, where, "unnamed");
+               Location *location = new Location (where, where, "unnamed", 
+                                                                                       Location::IsRangeMarker);
                session->begin_reversible_command (_("add range marker"));
                session->add_undo (session->locations()->get_memento());
                session->locations()->add (location, true);
@@ -880,7 +855,13 @@ LocationUI::session_gone()
 
        punch_edit_row.set_session (0);
        punch_edit_row.set_location (0);
-       
-       ArdourDialog::session_gone();
+
+       ArdourDialog::session_gone ();
 }
 
+bool
+LocationUI::on_delete_event (GdkEventAny* ev)
+{
+       hide ();
+       return true;
+}