<Option name="tempo bar" value="72727fff"/>
<Option name="TempoMarker" value="f2425bff"/>
<Option name="TimeAxisFrame" value="000000cb"/>
+ <Option name="time axis item name" value="000000ff"/>
<Option name="time-stretch-fill" value="e2b5b596"/>
<Option name="time-stretch-outline" value="63636396"/>
<Option name="TransportDragRect" value="969696c6"/>
CANVAS_VARIABLE(canvasvar_TempoBar, "tempo bar")
CANVAS_VARIABLE(canvasvar_TempoMarker, "TempoMarker")
CANVAS_VARIABLE(canvasvar_TimeAxisFrame, "TimeAxisFrame")
+CANVAS_VARIABLE(canvasvar_TimeAxisViewItemName, "time axis item name")
CANVAS_VARIABLE(canvasvar_TimeStretchFill, "time-stretch-fill")
CANVAS_VARIABLE(canvasvar_TimeStretchOutline, "time-stretch-outline")
CANVAS_VARIABLE(canvasvar_TransportDragRect, "TransportDragRect")
name_pixbuf->property_x() = label_offset;
name_pixbuf->property_y() = (13 / 2) - (name_height / 2);
- set_name (annotation.c_str());
+ set_name (annotation);
editor.ZoomChanged.connect (mem_fun (*this, &Marker::reposition));
+ ColorsChanged.connect (mem_fun (*this, &Marker::color_handler));
mark->set_data ("marker", this);
return *mark;
}
+void
+Marker::color_handler ()
+{
+ set_name (_annotation);
+}
+
void
Marker::set_name (const string& new_name)
{
int name_width = pixel_width (new_name, *name_font) + 2;
- name_pixbuf->property_pixbuf() = pixbuf_from_ustring(new_name, name_font, name_width, name_height);
+ _annotation = new_name;
+ name_pixbuf->property_pixbuf() = pixbuf_from_ustring(new_name, name_font,
+ ARDOUR_UI::config()->canvasvar_MarkerLabel.get(),
+ name_width, name_height);
if (_type == End || _type == LoopEnd || _type == PunchOut) {
name_pixbuf->property_x() = - (name_width);
unsigned char shift; /* should be double, but its always small and integral */
Type _type;
int name_height;
+ std::string _annotation;
void reposition ();
+ void color_handler ();
};
class TempoMarker : public Marker
controls_frame.set_name ("TimeAxisViewControlsBaseUnselected");
controls_vbox.set_name ("TimeAxisViewControlsBaseUnselected");
controls_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
-
- ColorsChanged.connect (mem_fun (*this, &TimeAxisView::color_handler));
}
TimeAxisView::~TimeAxisView()
set_duration (item_duration, this) ;
set_position (start, this) ;
+
+ ColorsChanged.connect (mem_fun (*this, &TimeAxisViewItem::color_handler));
}
/**
return;
}
+ _name = new_name;
+
last_item_width = trackview.editor.frame_to_pixel(item_duration);
name_pixbuf_width = pixel_width (new_name, *NAME_FONT) + 2;
- name_pixbuf->property_pixbuf() = pixbuf_from_ustring(new_name, NAME_FONT, name_pixbuf_width, NAME_HEIGHT);
+ name_pixbuf->property_pixbuf() = pixbuf_from_ustring(new_name, NAME_FONT,
+ ARDOUR_UI::config()->canvasvar_TimeAxisViewItemName.get(),
+ name_pixbuf_width, NAME_HEIGHT);
+}
+
+void
+TimeAxisViewItem::color_handler ()
+{
+ set_name_text (_name);
}
/**
name_pixbuf->show();
}
- name_pixbuf->property_pixbuf() = pixbuf_from_ustring(item_name, NAME_FONT, pb_width, NAME_HEIGHT);
+ name_pixbuf->property_pixbuf() = pixbuf_from_ustring(item_name, NAME_FONT,
+ ARDOUR_UI::config()->canvasvar_TimeAxisViewItemName.get(),
+ pb_width, NAME_HEIGHT);
}
virtual void reset_width_dependent_items (double pixel_width);
void reset_name_width (double pixel_width);
+ void color_handler ();
+
/**
* Callback used to remove this item during the gtk idle loop
* This is used to avoid deleting the obejct while inside the remove_this_group
double _height;
Visibility visibility;
bool _recregion;
-
+ std::string _name;
}; /* class TimeAxisViewItem */
}
Glib::RefPtr<Gdk::Pixbuf>
-pixbuf_from_ustring(const ustring& name, Pango::FontDescription* font, int clip_width, int clip_height)
+pixbuf_from_ustring(const ustring& name, Pango::FontDescription* font, uint32_t rgba, int clip_width, int clip_height)
{
Glib::RefPtr<Gdk::Pixbuf> buf = Gdk::Pixbuf::create(Gdk::COLORSPACE_RGB, true, 8, clip_width, clip_height);
cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, clip_width, clip_height);
cairo_t* cr = cairo_create (surface);
cairo_text_extents_t te;
- cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
+ float fr, fg, fb, fa;
+
+ fr = ((rgba & 0xff000000) >> 24) / 255.0f;
+ fg = ((rgba & 0xff0000) >> 16) / 255.0f;
+ fb = ((rgba & 0xff00) >> 8) / 255.0f;
+ fa = (rgba & 0xff) / 255.0f;
+
+ cairo_set_source_rgba (cr, fr, fg, fb, fa);
cairo_select_font_face (cr, font->get_family().c_str(),
CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, font->get_size() / Pango::SCALE);
int height);
Glib::RefPtr<Gdk::Pixbuf> pixbuf_from_ustring (const Glib::ustring& name,
Pango::FontDescription* font,
+ uint32_t rgba,
int clip_width,
int clip_height);