mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
use ArdourCanvas::TimeRectangle for regions, notes, markers
This commit is contained in:
parent
56994e785e
commit
f1e6b28ab7
9 changed files with 21 additions and 20 deletions
|
|
@ -262,7 +262,7 @@ AudioStreamView::setup_rec_box ()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArdourCanvas::Rectangle * rec_rect = new ArdourCanvas::Rectangle (_canvas_group);
|
ArdourCanvas::Rectangle * rec_rect = new ArdourCanvas::TimeRectangle (_canvas_group);
|
||||||
rec_rect->set_x0 (xstart);
|
rec_rect->set_x0 (xstart);
|
||||||
rec_rect->set_y0 (0);
|
rec_rect->set_y0 (0);
|
||||||
rec_rect->set_x1 (xend);
|
rec_rect->set_x1 (xend);
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ GhostRegion::GhostRegion (ArdourCanvas::Container* parent, TimeAxisView& tv, Tim
|
||||||
CANVAS_DEBUG_NAME (group, "ghost region");
|
CANVAS_DEBUG_NAME (group, "ghost region");
|
||||||
group->set_position (ArdourCanvas::Duple (initial_pos, 0));
|
group->set_position (ArdourCanvas::Duple (initial_pos, 0));
|
||||||
|
|
||||||
base_rect = new ArdourCanvas::Rectangle (group);
|
base_rect = new ArdourCanvas::TimeRectangle (group);
|
||||||
CANVAS_DEBUG_NAME (base_rect, "ghost region rect");
|
CANVAS_DEBUG_NAME (base_rect, "ghost region rect");
|
||||||
base_rect->set_x0 (0);
|
base_rect->set_x0 (0);
|
||||||
base_rect->set_y0 (0.0);
|
base_rect->set_y0 (0.0);
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,7 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Container& parent, guint32 rgba,
|
||||||
group->name = string_compose ("Marker::group for %1", annotation);
|
group->name = string_compose ("Marker::group for %1", annotation);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_name_background = new ArdourCanvas::Rectangle (group);
|
_name_background = new ArdourCanvas::TimeRectangle (group);
|
||||||
#ifdef CANVAS_DEBUG
|
#ifdef CANVAS_DEBUG
|
||||||
_name_background->name = string_compose ("Marker::_name_background for %1", annotation);
|
_name_background->name = string_compose ("Marker::_name_background for %1", annotation);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ using namespace ArdourCanvas;
|
||||||
Note::Note (
|
Note::Note (
|
||||||
MidiRegionView& region, Item* parent, const boost::shared_ptr<NoteType> note, bool with_events)
|
MidiRegionView& region, Item* parent, const boost::shared_ptr<NoteType> note, bool with_events)
|
||||||
: NoteBase (region, with_events, note)
|
: NoteBase (region, with_events, note)
|
||||||
, _rectangle (new ArdourCanvas::Rectangle (parent))
|
, _rectangle (new ArdourCanvas::TimeRectangle (parent))
|
||||||
{
|
{
|
||||||
CANVAS_DEBUG_NAME (_rectangle, "note");
|
CANVAS_DEBUG_NAME (_rectangle, "note");
|
||||||
set_item (_rectangle);
|
set_item (_rectangle);
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ RegionView::set_silent_frames (const AudioIntervalResult& silences, double /*thr
|
||||||
|
|
||||||
for (AudioIntervalResult::const_iterator i = silences.begin(); i != silences.end(); ++i) {
|
for (AudioIntervalResult::const_iterator i = silences.begin(); i != silences.end(); ++i) {
|
||||||
|
|
||||||
ArdourCanvas::Rectangle* cr = new ArdourCanvas::Rectangle (group);
|
ArdourCanvas::Rectangle* cr = new ArdourCanvas::TimeRectangle (group);
|
||||||
cr->set_ignore_events (true);
|
cr->set_ignore_events (true);
|
||||||
_silent_frames.push_back (cr);
|
_silent_frames.push_back (cr);
|
||||||
|
|
||||||
|
|
@ -808,7 +808,7 @@ RegionView::update_coverage_frames (LayerDisplay d)
|
||||||
|
|
||||||
/* start off any new rect, if required */
|
/* start off any new rect, if required */
|
||||||
if (cr == 0 || me != new_me) {
|
if (cr == 0 || me != new_me) {
|
||||||
cr = new ArdourCanvas::Rectangle (group);
|
cr = new ArdourCanvas::TimeRectangle (group);
|
||||||
_coverage_frames.push_back (cr);
|
_coverage_frames.push_back (cr);
|
||||||
cr->set_x0 (trackview.editor().sample_to_pixel (t - position));
|
cr->set_x0 (trackview.editor().sample_to_pixel (t - position));
|
||||||
cr->set_y0 (1);
|
cr->set_y0 (1);
|
||||||
|
|
|
||||||
|
|
@ -1018,7 +1018,7 @@ TimeAxisView::get_selection_rect (uint32_t id)
|
||||||
|
|
||||||
rect = new SelectionRect;
|
rect = new SelectionRect;
|
||||||
|
|
||||||
rect->rect = new ArdourCanvas::Rectangle (selection_group);
|
rect->rect = new ArdourCanvas::TimeRectangle (selection_group);
|
||||||
CANVAS_DEBUG_NAME (rect->rect, "selection rect");
|
CANVAS_DEBUG_NAME (rect->rect, "selection rect");
|
||||||
rect->rect->set_outline (false);
|
rect->rect->set_outline (false);
|
||||||
rect->rect->set_fill_color (ARDOUR_UI::config()->get_SelectionRect());
|
rect->rect->set_fill_color (ARDOUR_UI::config()->get_SelectionRect());
|
||||||
|
|
|
||||||
|
|
@ -188,14 +188,14 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
|
||||||
warning << "Time Axis Item Duration == 0" << endl;
|
warning << "Time Axis Item Duration == 0" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vestigial_frame = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, 1.0, 2.0, trackview.current_height()));
|
vestigial_frame = new ArdourCanvas::TimeRectangle (group, ArdourCanvas::Rect (0.0, 1.0, 2.0, trackview.current_height()));
|
||||||
CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
|
CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
|
||||||
vestigial_frame->hide ();
|
vestigial_frame->hide ();
|
||||||
vestigial_frame->set_outline_color (ARDOUR_UI::config()->get_VestigialFrame());
|
vestigial_frame->set_outline_color (ARDOUR_UI::config()->get_VestigialFrame());
|
||||||
vestigial_frame->set_fill_color (ARDOUR_UI::config()->get_VestigialFrame());
|
vestigial_frame->set_fill_color (ARDOUR_UI::config()->get_VestigialFrame());
|
||||||
|
|
||||||
if (visibility & ShowFrame) {
|
if (visibility & ShowFrame) {
|
||||||
frame = new ArdourCanvas::Rectangle (group,
|
frame = new ArdourCanvas::TimeRectangle (group,
|
||||||
ArdourCanvas::Rect (0.0, 0.0,
|
ArdourCanvas::Rect (0.0, 0.0,
|
||||||
trackview.editor().sample_to_pixel(duration) + RIGHT_EDGE_SHIFT,
|
trackview.editor().sample_to_pixel(duration) + RIGHT_EDGE_SHIFT,
|
||||||
trackview.current_height() - 1.0));
|
trackview.current_height() - 1.0));
|
||||||
|
|
|
||||||
|
|
@ -255,17 +255,18 @@ void
|
||||||
TimeRectangle::compute_bounding_box () const
|
TimeRectangle::compute_bounding_box () const
|
||||||
{
|
{
|
||||||
Rectangle::compute_bounding_box ();
|
Rectangle::compute_bounding_box ();
|
||||||
assert (_bounding_box);
|
|
||||||
|
|
||||||
Rect r = _bounding_box.get ();
|
if (_bounding_box) {
|
||||||
|
Rect r = _bounding_box.get ();
|
||||||
|
|
||||||
/* This is a TimeRectangle, so its right edge is drawn 1 pixel beyond
|
/* This is a TimeRectangle, so its right edge is drawn 1 pixel beyond
|
||||||
* (larger x-axis coordinates) than a normal Rectangle.
|
* (larger x-axis coordinates) than a normal Rectangle.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
r.x1 += 1.0; /* this should be using safe_add() */
|
r.x1 += 1.0; /* this should be using safe_add() */
|
||||||
|
|
||||||
_bounding_box = r;
|
_bounding_box = r;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -795,7 +795,7 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect self = item_to_window (Rect (0.5, 0.0, _region->length() / _samples_per_pixel, _height));
|
Rect self = item_to_window (Rect (0.0, 0.0, _region->length() / _samples_per_pixel, _height));
|
||||||
boost::optional<Rect> d = self.intersection (area);
|
boost::optional<Rect> d = self.intersection (area);
|
||||||
|
|
||||||
if (!d) {
|
if (!d) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue