}
void
-Drag::show_verbose_cursor_duration (framepos_t start, framepos_t end)
+Drag::show_verbose_cursor_duration (framepos_t start, framepos_t end, double xoffset)
{
+ _editor->verbose_cursor()->show (xoffset);
+
_editor->verbose_cursor()->set_duration (
start, end,
_drags->current_pointer_x() + 10 - _editor->horizontal_position(),
_drags->current_pointer_y() + 10 - _editor->vertical_adjustment.get_value() + _editor->canvas_timebars_vsize
);
-
- _editor->verbose_cursor()->show ();
}
void
Drag::show_verbose_cursor_text (string const & text)
{
+ _editor->verbose_cursor()->show ();
+
_editor->verbose_cursor()->set (
text,
_drags->current_pointer_x() + 10 - _editor->horizontal_position(),
_drags->current_pointer_y() + 10 - _editor->vertical_adjustment.get_value() + _editor->canvas_timebars_vsize
);
-
- _editor->verbose_cursor()->show ();
}
AudioRegionView* arv = dynamic_cast<AudioRegionView*> (_primary);
boost::shared_ptr<AudioRegion> const r = arv->audio_region ();
- show_verbose_cursor_duration (r->position(), r->position() + r->fade_in()->back()->when);
+ show_verbose_cursor_duration (r->position(), r->position() + r->fade_in()->back()->when, 32);
arv->show_fade_line((framepos_t) r->fade_in()->back()->when);
}
tmp->show_fade_line((framecnt_t) fade_length);
}
- show_verbose_cursor_duration (region->position(), region->position() + fade_length);
+ show_verbose_cursor_duration (region->position(), region->position() + fade_length, 32);
}
void
}
void show_verbose_cursor_time (framepos_t);
- void show_verbose_cursor_duration (framepos_t, framepos_t);
+ void show_verbose_cursor_duration (framepos_t, framepos_t, double xoffset = 0);
void show_verbose_cursor_text (std::string const &);
Editor* _editor; ///< our editor
#include <string>
#include <gtkmm/enums.h>
+#include "pbd/stacktrace.h"
#include "ardour/profile.h"
#include "editor.h"
#include "ardour_ui.h"
VerboseCursor::VerboseCursor (Editor* editor)
: _editor (editor)
, _visible (false)
+ , _xoffset (0)
+ , _yoffset (0)
{
Pango::FontDescription* font = get_font_for_style (N_("VerboseCanvasCursor"));
_canvas_item->property_text() = text.c_str();
}
+/** @param xoffset x offset to be applied on top of any set_position() call
+ * before the next show ().
+ * @param yoffset y offset as above.
+ */
void
-VerboseCursor::show ()
+VerboseCursor::show (double xoffset, double yoffset)
{
+ _xoffset = xoffset;
+ _yoffset = yoffset;
+
+ if (_visible) {
+ return;
+ }
+
_canvas_item->raise_to_top ();
_canvas_item->show ();
_visible = true;
_canvas_item->property_fill_color_rgba() = color;
}
+/** Set the position of the verbose cursor. Any x/y offsets
+ * passed to the last call to show() will be applied to the
+ * coordinates passed in here.
+ */
void
VerboseCursor::set_position (double x, double y)
{
- _canvas_item->property_x() = clamp_x (x);
- _canvas_item->property_y() = clamp_y (y);
+ _canvas_item->property_x() = clamp_x (x + _xoffset);
+ _canvas_item->property_y() = clamp_y (y + _yoffset);
}
bool
void set_time (framepos_t, double, double);
void set_duration (framepos_t, framepos_t, double, double);
- void show ();
+ void show (double xoffset = 0, double yoffset = 0);
void hide ();
private:
Editor* _editor;
ArdourCanvas::NoEventText* _canvas_item;
bool _visible;
+ double _xoffset;
+ double _yoffset;
};