void set_show_lines (bool);
void set_selected (bool);
void canvas_height_set (double);
void set_show_lines (bool);
void set_selected (bool);
void canvas_height_set (double);
void set_name (const std::string&);
void set_position (framepos_t start, framepos_t end = 0);
void set_name (const std::string&);
void set_position (framepos_t start, framepos_t end = 0);
+void
+Editor::LocationMarkers::setup_lines ()
+{
+ start->setup_line ();
+ if (end) {
+ end->setup_line ();
+ }
+}
+
void
Editor::mouse_add_new_marker (framepos_t where, bool is_cd, bool is_xrun)
{
void
Editor::mouse_add_new_marker (framepos_t where, bool is_cd, bool is_xrun)
{
update_fixed_rulers();
redisplay_tempo (false);
update_fixed_rulers();
redisplay_tempo (false);
+
+ /* Changing ruler visibility means that any lines on markers might need updating */
+ for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
+ i->second->setup_lines ();
+ }
, _type (type)
, _selected (false)
, _shown (false)
, _type (type)
, _selected (false)
, _shown (false)
, _canvas_height (0)
, _color (rgba)
{
, _canvas_height (0)
, _color (rgba)
{
-
- TransportStart:
-
- 0,0
- | \
- | \
- | \
- | \
- | \
- 0,13 --- 13,13
-
- TransportEnd:
-
- /13,0
- / |
- / |
- / |
- / |
- / |
- 0,13 ------ 13,13
-
-
- PunchIn:
points->push_back (Gnome::Art::Point (0.0, 5.0));
points->push_back (Gnome::Art::Point (0.0, 0.0));
points->push_back (Gnome::Art::Point (0.0, 5.0));
points->push_back (Gnome::Art::Point (0.0, 0.0));
label_offset = 8.0;
break;
label_offset = 8.0;
break;
points->push_back (Gnome::Art::Point (0.0, 5.0));
points->push_back (Gnome::Art::Point (3.0, 0.0));
points->push_back (Gnome::Art::Point (0.0, 5.0));
points->push_back (Gnome::Art::Point (3.0, 0.0));
label_offset = 8.0;
break;
label_offset = 8.0;
break;
points->push_back (Gnome::Art::Point (0.0, 13.0));
points->push_back (Gnome::Art::Point (0.0, 0.0));
points->push_back (Gnome::Art::Point (0.0, 13.0));
points->push_back (Gnome::Art::Point (0.0, 0.0));
label_offset = 13.0;
break;
label_offset = 13.0;
break;
points->push_back (Gnome::Art::Point (13.0, 13.0));
points->push_back (Gnome::Art::Point (6.5, 6.5));
points->push_back (Gnome::Art::Point (13.0, 13.0));
points->push_back (Gnome::Art::Point (6.5, 6.5));
label_offset = 6.0;
break;
label_offset = 6.0;
break;
points->push_back (Gnome::Art::Point (0.0, 13.0));
points->push_back (Gnome::Art::Point (0.0, 0.0));
points->push_back (Gnome::Art::Point (0.0, 13.0));
points->push_back (Gnome::Art::Point (0.0, 0.0));
label_offset = 12.0;
break;
label_offset = 12.0;
break;
points->push_back (Gnome::Art::Point (0.0, 13.0));
points->push_back (Gnome::Art::Point (13.0, 0.0));
points->push_back (Gnome::Art::Point (0.0, 13.0));
points->push_back (Gnome::Art::Point (13.0, 0.0));
label_offset = 0.0;
break;
label_offset = 0.0;
break;
points->push_back (Gnome::Art::Point (0.0, 13.0));
points->push_back (Gnome::Art::Point (0.0, 0.0));
points->push_back (Gnome::Art::Point (0.0, 13.0));
points->push_back (Gnome::Art::Point (0.0, 0.0));
label_offset = 13.0;
break;
label_offset = 13.0;
break;
points->push_back (Gnome::Art::Point (12.0, 12.0));
points->push_back (Gnome::Art::Point (0.0, 0.0));
points->push_back (Gnome::Art::Point (12.0, 12.0));
points->push_back (Gnome::Art::Point (0.0, 0.0));
label_offset = 0.0;
break;
label_offset = 0.0;
break;
/* adjust to properly locate the tip */
/* adjust to properly locate the tip */
- unit_position -= shift;
+ unit_position -= _shift;
group = new Group (parent, unit_position, 1.0);
group = new Group (parent, unit_position, 1.0);
void
Marker::set_show_line (bool s)
{
void
Marker::set_show_line (bool s)
{
setup_line ();
}
void
Marker::setup_line ()
{
setup_line ();
}
void
Marker::setup_line ()
{
- if (_selected || _shown) {
+ if (_shown && (_selected || _line_shown)) {
if (_line == 0) {
_line = new ArdourCanvas::SimpleLine (*_line_parent);
_line->property_color_rgba() = ARDOUR_UI::config()->canvasvar_EditPoint.get();
if (_line == 0) {
_line = new ArdourCanvas::SimpleLine (*_line_parent);
_line->property_color_rgba() = ARDOUR_UI::config()->canvasvar_EditPoint.get();
- _line->property_x1() = unit_position + shift;
- _line->property_x2() = unit_position + shift;
_line->signal_event().connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_marker_event), mark, this));
}
_line->signal_event().connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_marker_event), mark, this));
}
_line_parent->w2i (x, yo);
}
_line_parent->w2i (x, yo);
}
- _line->property_y1() = yo;
- _line->property_y2() = yo + _canvas_height;
+ _line->property_y1() = yo + 10;
+ _line->property_y2() = yo + 10 + _canvas_height;
_line->property_color_rgba() = _selected ? ARDOUR_UI::config()->canvasvar_EditPoint.get() : _color;
_line->raise_to_top ();
_line->property_color_rgba() = _selected ? ARDOUR_UI::config()->canvasvar_EditPoint.get() : _color;
_line->raise_to_top ();
+void
+Marker::setup_line_x ()
+{
+ if (_line) {
+ _line->property_x1() = unit_position + _shift - 0.5;
+ _line->property_x2() = unit_position + _shift - 0.5;
+ }
+}
+
void
Marker::set_position (framepos_t frame)
{
double new_unit_position = editor.frame_to_unit (frame);
void
Marker::set_position (framepos_t frame)
{
double new_unit_position = editor.frame_to_unit (frame);
- new_unit_position -= shift;
+ new_unit_position -= _shift;
group->move (new_unit_position - unit_position, 0.0);
frame_position = frame;
unit_position = new_unit_position;
group->move (new_unit_position - unit_position, 0.0);
frame_position = frame;
unit_position = new_unit_position;
- if (_line) {
- _line->property_x1() = unit_position + shift;
- _line->property_x2() = unit_position + shift;
- }
+ _shown = true;
+
+ group->show ();
+ setup_line ();
+ _shown = false;
+
+ group->hide ();
+ setup_line ();
void set_position (framepos_t);
void set_name (const std::string&);
void set_color_rgba (uint32_t rgba);
void set_position (framepos_t);
void set_name (const std::string&);
void set_color_rgba (uint32_t rgba);
framepos_t position() const { return frame_position; }
framepos_t position() const { return frame_position; }
double unit_position;
framepos_t frame_position;
double unit_position;
framepos_t frame_position;
- unsigned char shift; /* should be double, but its always small and integral */
Type _type;
int name_height;
bool _selected;
bool _shown;
Type _type;
int name_height;
bool _selected;
bool _shown;
double _canvas_height;
uint32_t _color;
void reposition ();
double _canvas_height;
uint32_t _color;
void reposition ();
};
class TempoMarker : public Marker
};
class TempoMarker : public Marker