sfdb append optimization.
[ardour.git] / gtk2_ardour / time_axis_view_item.cc
index f47f8c81d93073e9ff01e17907bc24b43cb7b7e9..62a1e7d9e68afba15f41085b61c94615cac29bbf 100644 (file)
@@ -38,7 +38,8 @@ using namespace Editing;
 
 //------------------------------------------------------------------------------
 /** Initialize static memeber data */
-std::string TimeAxisViewItem::NAME_FONT;
+Pango::FontDescription TimeAxisViewItem::NAME_FONT;
+bool TimeAxisViewItem::have_name_font = false;
 const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
 const double TimeAxisViewItem::NAME_Y_OFFSET = 15.0 ;           /* XXX depends a lot on the font size, sigh. */
 const double TimeAxisViewItem::NAME_HIGHLIGHT_SIZE = 15.0 ;     /* ditto */
@@ -60,13 +61,14 @@ const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6 ;
  * @param start the start point of this item
  * @param duration the duration of this item
  */
-TimeAxisViewItem::TimeAxisViewItem(std::string it_name, GnomeCanvasGroup* parent, TimeAxisView& tv, double spu, GdkColor& base_color, 
+TimeAxisViewItem::TimeAxisViewItem(std::string it_name, GnomeCanvasGroup* parent, TimeAxisView& tv, double spu, Gdk::Color& base_color, 
                                   jack_nframes_t start, jack_nframes_t duration,
                                   Visibility visibility)
        : trackview (tv)
 {
-       if (NAME_FONT.empty()) {
+       if (!have_name_font) {
                NAME_FONT = get_font_for_style (N_("TimeAxisViewItemName"));
+               have_name_font = true;
        }
 
        item_name = it_name ;
@@ -255,7 +257,7 @@ bool
 TimeAxisViewItem::set_duration (jack_nframes_t dur, void* src)
 {
        if ((dur > max_item_duration) || (dur < min_item_duration)) {
-               warning << compose (_("new duration %1 frames is out of bounds for %2"), get_item_name(), dur)
+               warning << string_compose (_("new duration %1 frames is out of bounds for %2"), get_item_name(), dur)
                        << endmsg;
                return false;
        }
@@ -557,7 +559,7 @@ TimeAxisViewItem::set_height(double height)
  * 
  */
 void
-TimeAxisViewItem::set_color(GdkColor& base_color)
+TimeAxisViewItem::set_color(Gdk::Color& base_color)
 {
        compute_colors (base_color);
        set_colors ();
@@ -929,7 +931,7 @@ TimeAxisViewItem::remove_this_item(void* src)
           defer to idle loop, otherwise we'll delete this object
           while we're still inside this function ...
        */
-       Gtk::Main::idle.connect(bind(mem_fun(&TimeAxisViewItem::idle_remove_this_item), this, src));
+        Glib::signal_idle().connect(bind (sigc::ptr_fun (&TimeAxisViewItem::idle_remove_this_item), this, src));
 }
 
 /**