Uploaded start of CoreAudioSource. More sfdb work.
[ardour.git] / gtk2_ardour / location_ui.cc
index b328d6581e791c55502c4d370361e2ead390544a..564cc4dca29296d3cdaf8a37c63ca071569491b0 100644 (file)
@@ -77,16 +77,16 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
        preemph_check_button.set_name ("LocationEditCdButton");
        performer_label.set_name ("LocationEditNumberLabel");
        performer_entry.set_name ("LocationEditNameEntry");
-       string_composer_label.set_name ("LocationEditNumberLabel");
-       string_composer_entry.set_name ("LocationEditNameEntry");
+       composer_label.set_name ("LocationEditNumberLabel");
+       composer_entry.set_name ("LocationEditNameEntry");
 
 
        isrc_label.set_text ("ISRC: ");
        isrc_label.set_size_request (30, -1);
        performer_label.set_text ("Performer: ");
        performer_label.set_size_request (60, -1);
-       string_composer_label.set_text ("Composer: ");
-       string_composer_label.set_size_request (60, -1);
+       composer_label.set_text ("Composer: ");
+       composer_label.set_size_request (60, -1);
 
        isrc_entry.set_size_request (112, -1);
        isrc_entry.set_max_length(12);
@@ -95,8 +95,8 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
        performer_entry.set_size_request (100, -1);
        performer_entry.set_editable (true);
 
-       string_composer_entry.set_size_request (100, -1);
-       string_composer_entry.set_editable (true);
+       composer_entry.set_size_request (100, -1);
+       composer_entry.set_editable (true);
 
        cd_track_details_hbox.pack_start (isrc_label, false, false);
        cd_track_details_hbox.pack_start (isrc_entry, false, false);
@@ -104,21 +104,12 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
        cd_track_details_hbox.pack_start (preemph_check_button, false, false);
        cd_track_details_hbox.pack_start (performer_label, false, false);
        cd_track_details_hbox.pack_start (performer_entry, true, true);
-       cd_track_details_hbox.pack_start (string_composer_label, false, false);
-       cd_track_details_hbox.pack_start (string_composer_entry, true, true);
+       cd_track_details_hbox.pack_start (composer_label, false, false);
+       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));
-
-       string_composer_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::composer_entry_changed));
-       string_composer_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
-       string_composer_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));
        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 ()
 {
@@ -361,10 +338,10 @@ LocationEditRow::composer_entry_changed ()
        
        if (i_am_the_modifier || !location) return;
 
-       if (string_composer_entry.get_text() != "") {
-       location->cd_info["string_composer"] = string_composer_entry.get_text();
+       if (composer_entry.get_text() != "") {
+       location->cd_info["composer"] = composer_entry.get_text();
        } else {
-         location->cd_info.erase("string_composer");
+         location->cd_info.erase("composer");
        }
 }
 
@@ -438,8 +415,8 @@ LocationEditRow::cd_toggled ()
          if (location->cd_info.find("performer") != location->cd_info.end()) {
            performer_entry.set_text(location->cd_info["performer"]);
          }
-         if (location->cd_info.find("string_composer") != location->cd_info.end()) {
-           string_composer_entry.set_text(location->cd_info["string_composer"]);
+         if (location->cd_info.find("composer") != location->cd_info.end()) {
+           composer_entry.set_text(location->cd_info["composer"]);
          }
          if (location->cd_info.find("scms") != location->cd_info.end()) {
            scms_check_button.set_active(true);
@@ -611,7 +588,7 @@ LocationUI::LocationUI ()
        location_vpacker.pack_start (punch_edit_row, false, false);
 
        location_rows.set_name("LocationLocRows");
-       location_rows_scroller.add_with_viewport (location_rows);
+       location_rows_scroller.add (location_rows);
        location_rows_scroller.set_name ("LocationLocRowsScroller");
        location_rows_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
        location_rows_scroller.set_size_request (-1, 130);
@@ -632,7 +609,7 @@ LocationUI::LocationUI ()
 
        
        range_rows.set_name("LocationRangeRows");
-       range_rows_scroller.add_with_viewport (range_rows);
+       range_rows_scroller.add (range_rows);
        range_rows_scroller.set_name ("LocationRangeRowsScroller");
        range_rows_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
        range_rows_scroller.set_size_request (-1, 130);