Revert more "frame/sample" replacements

- Coverage concerns rectangles (frames, not sample)
- frame-handles are rectangles
- layout container boxes are frames
- inline display boxes are display_frame
This commit is contained in:
Robin Gareus 2019-04-08 21:40:33 +02:00
parent 37aaa2d11b
commit a0b032efe2
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
15 changed files with 40 additions and 43 deletions

View File

@ -399,7 +399,7 @@ ARDOUR_UI::setup_transport ()
/* An event box to hold the table. We use this because we want specific
control over the background color, and without this event box,
nothing inside the transport_sample actually draws a background. We
nothing inside the transport_frame actually draws a background. We
would therefore end up seeing the background of the parent widget,
which is probably some default color. Adding the EventBox adds a
widget that will draw the background, using a style based on

View File

@ -1233,10 +1233,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
ht = (_height - NAME_HIGHLIGHT_SIZE) / (double) nchans;
}
/* first waveview starts at 1.0, not 0.0 since that will overlap the
* sample
*/
/* first waveview starts at 1.0, not 0.0 since that will overlap the frame */
gdouble yoff = which * ht;
ArdourWaveView::WaveView *wave = new ArdourWaveView::WaveView (group, audio_region ());
@ -1303,7 +1300,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
/* Restore stacked coverage */
LayerDisplay layer_display;
if (trackview.get_gui_property ("layer-display", layer_display)) {
update_coverage_samples (layer_display);
update_coverage_frame (layer_display);
}
}
@ -1625,9 +1622,9 @@ AudioRegionView::set_fade_visibility (bool yn)
}
void
AudioRegionView::update_coverage_samples (LayerDisplay d)
AudioRegionView::update_coverage_frame (LayerDisplay d)
{
RegionView::update_coverage_samples (d);
RegionView::update_coverage_frame (d);
if (d == Stacked) {
if (fade_in_handle) { fade_in_handle->raise_to_top (); }

View File

@ -104,7 +104,7 @@ public:
samplepos_t get_fade_out_shape_width ();
void set_fade_visibility (bool);
void update_coverage_samples (LayerDisplay);
void update_coverage_frame (LayerDisplay);
void update_transient(float old_pos, float new_pos);
void remove_transient(float pos);

View File

@ -423,7 +423,7 @@ MidiRegionView::leave_notify (GdkEventCrossing*)
void
MidiRegionView::mouse_mode_changed ()
{
// Adjust sample colour (become more transparent for internal tools)
// Adjust frame colour (become more transparent for internal tools)
set_frame_color();
if (_entered) {
@ -464,7 +464,7 @@ MidiRegionView::enter_internal (uint32_t state)
_grabbed_keyboard = true;
}
// Lower sample handles below notes so they don't steal events
// Lower frame handles below notes so they don't steal events
if (frame_handle_start) {
frame_handle_start->lower_to_bottom();
}

View File

@ -308,7 +308,7 @@ PannerUI::setup_pan ()
twod_panner->set_size_request (-1, rintf(61.f * scale));
twod_panner->set_send_drawing_mode (_send_mode);
/* and finally, add it to the panner sample */
/* and finally, add it to the panner frame */
pan_vbox.pack_start (*twod_panner, false, false);
}

View File

@ -145,7 +145,7 @@ PluginDisplay::on_expose_event (GdkEventExpose* ev)
cairo_save (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
display_sample(cr, width, height);
display_frame(cr, width, height);
cairo_clip (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
@ -168,7 +168,7 @@ PluginDisplay::on_expose_event (GdkEventExpose* ev)
std::string name = get_name();
Gtkmm2ext::Color fill_color = UIConfiguration::instance().color (string_compose ("%1: fill active", name), &failed);
display_sample(cr, width, height);
display_frame(cr, width, height);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_set_line_width(cr, 1.0);
if (failed) {
@ -183,7 +183,7 @@ PluginDisplay::on_expose_event (GdkEventExpose* ev)
}
void
PluginDisplay::display_sample (cairo_t* cr, double w, double h)
PluginDisplay::display_frame (cairo_t* cr, double w, double h)
{
cairo_rectangle (cr, 0.0, 0.0, w, h);
}

View File

@ -43,7 +43,7 @@ protected:
virtual void update_height_alloc (uint32_t inline_height);
virtual uint32_t render_inline (cairo_t *, uint32_t width);
virtual void display_sample (cairo_t* cr, double w, double h);
virtual void display_frame (cairo_t* cr, double w, double h);
boost::shared_ptr<ARDOUR::Plugin> _plug;
PBD::ScopedConnection _qdraw_connection;

View File

@ -1673,7 +1673,7 @@ ProcessorEntry::PluginInlineDisplay::update_height_alloc (uint32_t inline_height
}
void
ProcessorEntry::PluginInlineDisplay::display_sample (cairo_t* cr, double w, double h)
ProcessorEntry::PluginInlineDisplay::display_frame (cairo_t* cr, double w, double h)
{
Gtkmm2ext::rounded_rectangle (cr, .5, -1.5, w - 1, h + 1, 7);
}

View File

@ -254,7 +254,7 @@ private:
bool on_button_press_event (GdkEventButton *ev);
void update_height_alloc (uint32_t inline_height);
void display_sample (cairo_t* cr, double w, double h);
void display_frame (cairo_t* cr, double w, double h);
ProcessorEntry& _entry;
bool _scroll;

View File

@ -199,7 +199,7 @@ RegionView::~RegionView ()
delete *g;
}
for (list<ArdourCanvas::Rectangle*>::iterator i = _coverage_samples.begin (); i != _coverage_samples.end (); ++i) {
for (list<ArdourCanvas::Rectangle*>::iterator i = _coverage_frame.begin (); i != _coverage_frame.end (); ++i) {
delete *i;
}
@ -738,7 +738,7 @@ RegionView::set_height (double h)
);
}
for (list<ArdourCanvas::Rectangle*>::iterator i = _coverage_samples.begin(); i != _coverage_samples.end(); ++i) {
for (list<ArdourCanvas::Rectangle*>::iterator i = _coverage_frame.begin(); i != _coverage_frame.end(); ++i) {
(*i)->set_y1 (h + 1);
}
@ -748,20 +748,20 @@ RegionView::set_height (double h)
}
/** Remove old coverage samples and make new ones, if we're in a LayerDisplay mode
/** Remove old coverage frame and make new ones, if we're in a LayerDisplay mode
* which uses them. */
void
RegionView::update_coverage_samples (LayerDisplay d)
RegionView::update_coverage_frame (LayerDisplay d)
{
/* remove old coverage samples */
for (list<ArdourCanvas::Rectangle*>::iterator i = _coverage_samples.begin (); i != _coverage_samples.end (); ++i) {
/* remove old coverage frame */
for (list<ArdourCanvas::Rectangle*>::iterator i = _coverage_frame.begin (); i != _coverage_frame.end (); ++i) {
delete *i;
}
_coverage_samples.clear ();
_coverage_frame.clear ();
if (d != Stacked) {
/* don't do coverage samples unless we're in stacked mode */
/* don't do coverage frame unless we're in stacked mode */
return;
}
@ -795,7 +795,7 @@ RegionView::update_coverage_samples (LayerDisplay d)
/* start off any new rect, if required */
if (cr == 0 || me != new_me) {
cr = new ArdourCanvas::Rectangle (group);
_coverage_samples.push_back (cr);
_coverage_frame.push_back (cr);
cr->set_x0 (trackview.editor().sample_to_pixel (t - position));
cr->set_y0 (1);
cr->set_y1 (_height + 1);

View File

@ -100,7 +100,7 @@ public:
virtual void exited () {}
virtual void enable_display(bool yn) { _enable_display = yn; }
virtual void update_coverage_samples (LayerDisplay);
virtual void update_coverage_frame (LayerDisplay);
static PBD::Signal1<void,RegionView*> RegionViewGoingAway;
@ -184,7 +184,7 @@ protected:
* different bits of regions according to whether or not they are the one
* that will be played at any given time.
*/
std::list<ArdourCanvas::Rectangle*> _coverage_samples;
std::list<ArdourCanvas::Rectangle*> _coverage_frame;
/** a list of rectangles used to show silent segments
*/

View File

@ -158,7 +158,7 @@ StreamView::set_samples_per_pixel (double fpp)
recbox.rectangle->set_x1 (xend);
}
update_coverage_samples ();
update_coverage_frame ();
return 0;
}
@ -296,7 +296,7 @@ StreamView::playlist_layered (boost::weak_ptr<Track> wtr)
if (_layer_display == Stacked) {
update_contents_height ();
/* tricky. playlist_changed() does this as well, and its really inefficient. */
update_coverage_samples ();
update_coverage_frame ();
} else {
/* layering has probably been modified. reflect this in the canvas. */
layer_regions();
@ -324,14 +324,14 @@ StreamView::playlist_switched (boost::weak_ptr<Track> wtr)
/* update layers count and the y positions and heights of our regions */
_layers = tr->playlist()->top_layer() + 1;
update_contents_height ();
update_coverage_samples ();
update_coverage_frame ();
/* catch changes */
tr->playlist()->LayeringChanged.connect (playlist_connections, invalidator (*this), boost::bind (&StreamView::playlist_layered, this, boost::weak_ptr<Track> (tr)), gui_context());
tr->playlist()->RegionAdded.connect (playlist_connections, invalidator (*this), boost::bind (&StreamView::add_region_view, this, _1), gui_context());
tr->playlist()->RegionRemoved.connect (playlist_connections, invalidator (*this), boost::bind (&StreamView::remove_region_view, this, _1), gui_context());
tr->playlist()->ContentsChanged.connect (playlist_connections, invalidator (*this), boost::bind (&StreamView::update_coverage_samples, this), gui_context());
tr->playlist()->ContentsChanged.connect (playlist_connections, invalidator (*this), boost::bind (&StreamView::update_coverage_frame, this), gui_context());
}
@ -676,14 +676,14 @@ StreamView::set_layer_display (LayerDisplay d)
}
update_contents_height ();
update_coverage_samples ();
update_coverage_frame ();
}
void
StreamView::update_coverage_samples ()
StreamView::update_coverage_frame ()
{
for (RegionViewList::iterator i = region_views.begin (); i != region_views.end (); ++i) {
(*i)->update_coverage_samples (_layer_display);
(*i)->update_coverage_frame (_layer_display);
}
}

View File

@ -185,7 +185,7 @@ protected:
void setup_new_rec_layer_time (boost::shared_ptr<ARDOUR::Region>);
private:
void update_coverage_samples ();
void update_coverage_frame ();
};
#endif /* __ardour_streamview_h__ */

View File

@ -235,13 +235,13 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
CANVAS_DEBUG_NAME (frame_handle_start, "TAVI frame handle start");
frame_handle_start->set_outline (false);
frame_handle_start->set_fill (false);
frame_handle_start->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::sample_handle_crossing), frame_handle_start));
frame_handle_start->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_start));
frame_handle_end = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()));
CANVAS_DEBUG_NAME (frame_handle_end, "TAVI frame handle end");
frame_handle_end->set_outline (false);
frame_handle_end->set_fill (false);
frame_handle_end->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::sample_handle_crossing), frame_handle_end));
frame_handle_end->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_end));
} else {
frame_handle_start = frame_handle_end = 0;
}
@ -611,7 +611,7 @@ TimeAxisViewItem::set_color (uint32_t base_color)
}
ArdourCanvas::Item*
TimeAxisViewItem::get_canvas_sample()
TimeAxisViewItem::get_canvas_frame()
{
return frame;
}
@ -759,7 +759,7 @@ TimeAxisViewItem::set_trim_handle_colors()
}
bool
TimeAxisViewItem::sample_handle_crossing (GdkEvent* ev, ArdourCanvas::Rectangle* item)
TimeAxisViewItem::frame_handle_crossing (GdkEvent* ev, ArdourCanvas::Rectangle* item)
{
switch (ev->type) {
case GDK_LEAVE_NOTIFY:

View File

@ -78,7 +78,7 @@ public:
virtual uint32_t get_fill_color () const;
ArdourCanvas::Item* get_canvas_sample();
ArdourCanvas::Item* get_canvas_frame();
ArdourCanvas::Item* get_canvas_group();
ArdourCanvas::Item* get_name_highlight();
@ -227,7 +227,7 @@ protected:
ArdourCanvas::Rectangle* frame_handle_start; ///< `sample' (fade) handle for the start of the item, or 0
ArdourCanvas::Rectangle* frame_handle_end; ///< `sample' (fade) handle for the end of the item, or 0
bool sample_handle_crossing (GdkEvent*, ArdourCanvas::Rectangle*);
bool frame_handle_crossing (GdkEvent*, ArdourCanvas::Rectangle*);
double _height;
Visibility visibility;