Frame as in "picture frame", not sample

This commit is contained in:
Robin Gareus 2019-04-08 20:00:02 +02:00
parent 9f77a6f7fe
commit f9e12235c3
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
7 changed files with 68 additions and 68 deletions

View file

@ -708,7 +708,7 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar,
double const pwidth = floor(trackview.editor().sample_to_pixel (width)); double const pwidth = floor(trackview.editor().sample_to_pixel (width));
/* the right edge should be right on the region sample is the pixel /* the right edge should be right on the region frame is the pixel
* width is zero. Hence the additional + 1.0 at the end. * width is zero. Hence the additional + 1.0 at the end.
*/ */
@ -1339,7 +1339,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev, b
return; return;
} }
/*y is in item sample */ /* y is in item frame */
double const bx = gain_line->nth (before_p)->get_x(); double const bx = gain_line->nth (before_p)->get_x();
double const ax = gain_line->nth (after_p)->get_x(); double const ax = gain_line->nth (after_p)->get_x();
double const click_ratio = (ax - mx) / (ax - bx); double const click_ratio = (ax - mx) / (ax - bx);
@ -1591,13 +1591,13 @@ AudioRegionView::set_some_waveform_colors (vector<ArdourWaveView::WaveView*>& wa
} }
void void
AudioRegionView::set_sample_color () AudioRegionView::set_frame_color ()
{ {
if (!sample) { if (!frame) {
return; return;
} }
RegionView::set_sample_color (); RegionView::set_frame_color ();
set_waveform_colors (); set_waveform_colors ();
} }

View file

@ -197,7 +197,7 @@ protected:
void set_colors (); void set_colors ();
void set_waveform_colors (); void set_waveform_colors ();
void reset_width_dependent_items (double pixel_width); void reset_width_dependent_items (double pixel_width);
void set_sample_color (); void set_frame_color ();
void color_handler (); void color_handler ();

View file

@ -123,7 +123,7 @@ void
AutomationRegionView::mouse_mode_changed () AutomationRegionView::mouse_mode_changed ()
{ {
// Adjust sample colour (become more transparent for internal tools) // Adjust sample colour (become more transparent for internal tools)
set_sample_color(); set_frame_color();
} }
bool bool

View file

@ -424,7 +424,7 @@ void
MidiRegionView::mouse_mode_changed () MidiRegionView::mouse_mode_changed ()
{ {
// Adjust sample colour (become more transparent for internal tools) // Adjust sample colour (become more transparent for internal tools)
set_sample_color(); set_frame_color();
if (_entered) { if (_entered) {
if (!trackview.editor().internal_editing()) { if (!trackview.editor().internal_editing()) {

View file

@ -432,14 +432,14 @@ RegionView::reset_width_dependent_items (double pixel_width)
void void
RegionView::region_muted () RegionView::region_muted ()
{ {
set_sample_color (); set_frame_color ();
region_renamed (); region_renamed ();
} }
void void
RegionView::region_opacity () RegionView::region_opacity ()
{ {
set_sample_color (); set_frame_color ();
} }
void void

View file

@ -119,7 +119,7 @@ TimeAxisViewItem::TimeAxisViewItem(
: trackview (tv) : trackview (tv)
, sample_position (-1) , sample_position (-1)
, item_name (it_name) , item_name (it_name)
, selection_sample (0) , selection_frame (0)
, _height (1.0) , _height (1.0)
, _recregion (recording) , _recregion (recording)
, _automation (automation) , _automation (automation)
@ -136,7 +136,7 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
, trackview (other.trackview) , trackview (other.trackview)
, sample_position (-1) , sample_position (-1)
, item_name (other.item_name) , item_name (other.item_name)
, selection_sample (0) , selection_frame (0)
, _height (1.0) , _height (1.0)
, _recregion (other._recregion) , _recregion (other._recregion)
, _automation (other._automation) , _automation (other._automation)
@ -182,20 +182,20 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
} }
if (visibility & ShowFrame) { if (visibility & ShowFrame) {
sample = new ArdourCanvas::Rectangle (group, frame = new ArdourCanvas::Rectangle (group,
ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::Rect (0.0, 0.0,
trackview.editor().sample_to_pixel(duration), trackview.editor().sample_to_pixel(duration),
trackview.current_height())); trackview.current_height()));
sample->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT)); frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
sample->show (); frame->show ();
CANVAS_DEBUG_NAME (sample, string_compose ("sample for %1", get_item_name())); CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name()));
if (_recregion) { if (_recregion) {
sample->set_outline_color (UIConfiguration::instance().color ("recording rect")); frame->set_outline_color (UIConfiguration::instance().color ("recording rect"));
} else { } else {
sample->set_outline_color (UIConfiguration::instance().color ("time axis frame")); frame->set_outline_color (UIConfiguration::instance().color ("time axis frame"));
} }
} }
@ -232,13 +232,13 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
double width = TimeAxisViewItem::GRAB_HANDLE_WIDTH; double width = TimeAxisViewItem::GRAB_HANDLE_WIDTH;
sample_handle_start = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height())); sample_handle_start = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()));
CANVAS_DEBUG_NAME (sample_handle_start, "TAVI sample handle start"); CANVAS_DEBUG_NAME (sample_handle_start, "TAVI frame handle start");
sample_handle_start->set_outline (false); sample_handle_start->set_outline (false);
sample_handle_start->set_fill (false); sample_handle_start->set_fill (false);
sample_handle_start->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::sample_handle_crossing), sample_handle_start)); sample_handle_start->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::sample_handle_crossing), sample_handle_start));
sample_handle_end = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height())); sample_handle_end = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()));
CANVAS_DEBUG_NAME (sample_handle_end, "TAVI sample handle end"); CANVAS_DEBUG_NAME (sample_handle_end, "TAVI frame handle end");
sample_handle_end->set_outline (false); sample_handle_end->set_outline (false);
sample_handle_end->set_fill (false); sample_handle_end->set_fill (false);
sample_handle_end->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::sample_handle_crossing), sample_handle_end)); sample_handle_end->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::sample_handle_crossing), sample_handle_end));
@ -323,7 +323,7 @@ TimeAxisViewItem::set_duration (samplecnt_t dur, void* src)
{ {
if ((dur > max_item_duration) || (dur < min_item_duration)) { if ((dur > max_item_duration) || (dur < min_item_duration)) {
warning << string_compose ( warning << string_compose (
P_("new duration %1 sample is out of bounds for %2", "new duration of %1 samples is out of bounds for %2", dur), P_("new duration %1 frame is out of bounds for %2", "new duration of %1 samples is out of bounds for %2", dur),
get_item_name(), dur) get_item_name(), dur)
<< endmsg; << endmsg;
return false; return false;
@ -489,21 +489,21 @@ TimeAxisViewItem::set_selected(bool yn)
} }
Selectable::set_selected (yn); Selectable::set_selected (yn);
set_sample_color (); set_frame_color ();
set_name_text_color (); set_name_text_color ();
if (_selected && sample) { if (_selected && frame) {
if (!selection_sample) { if (!selection_frame) {
selection_sample = new ArdourCanvas::Rectangle (group); selection_frame = new ArdourCanvas::Rectangle (group);
selection_sample->set_fill (false); selection_frame->set_fill (false);
selection_sample->set_outline_color (UIConfiguration::instance().color ("selected time axis frame")); selection_frame->set_outline_color (UIConfiguration::instance().color ("selected time axis frame"));
selection_sample->set_ignore_events (true); selection_frame->set_ignore_events (true);
} }
selection_sample->set (sample->get().shrink (1.0)); selection_frame->set (frame->get().shrink (1.0));
selection_sample->show (); selection_frame->show ();
} else { } else {
if (selection_sample) { if (selection_frame) {
selection_sample->hide (); selection_frame->hide ();
} }
} }
} }
@ -555,18 +555,18 @@ TimeAxisViewItem::set_height (double height)
} }
} }
if (sample) { if (frame) {
sample->set_y0 (0.0); frame->set_y0 (0.0);
sample->set_y1 (height); frame->set_y1 (height);
if (sample_handle_start) { if (sample_handle_start) {
sample_handle_start->set_y1 (height); sample_handle_start->set_y1 (height);
sample_handle_end->set_y1 (height); sample_handle_end->set_y1 (height);
} }
if (selection_sample) { if (selection_frame) {
selection_sample->set (sample->get().shrink (1.0)); selection_frame->set (frame->get().shrink (1.0));
} }
} }
} }
@ -613,7 +613,7 @@ TimeAxisViewItem::set_color (uint32_t base_color)
ArdourCanvas::Item* ArdourCanvas::Item*
TimeAxisViewItem::get_canvas_sample() TimeAxisViewItem::get_canvas_sample()
{ {
return sample; return frame;
} }
ArdourCanvas::Item* ArdourCanvas::Item*
@ -634,7 +634,7 @@ TimeAxisViewItem::get_name_highlight()
void void
TimeAxisViewItem::set_colors() TimeAxisViewItem::set_colors()
{ {
set_sample_color (); set_frame_color ();
if (name_highlight) { if (name_highlight) {
name_highlight->set_fill_color (fill_color); name_highlight->set_fill_color (fill_color);
@ -686,28 +686,28 @@ TimeAxisViewItem::get_fill_color () const
} }
/** /**
* Sets the sample color depending on whether this item is selected * Sets the frame color depending on whether this item is selected
*/ */
void void
TimeAxisViewItem::set_sample_color() TimeAxisViewItem::set_frame_color()
{ {
if (!sample) { if (!frame) {
return; return;
} }
sample->set_fill_color (get_fill_color()); frame->set_fill_color (get_fill_color());
set_sample_gradient (); set_frame_gradient ();
if (!_recregion) { if (!_recregion) {
sample->set_outline_color (UIConfiguration::instance().color ("time axis frame")); frame->set_outline_color (UIConfiguration::instance().color ("time axis frame"));
} }
} }
void void
TimeAxisViewItem::set_sample_gradient () TimeAxisViewItem::set_frame_gradient ()
{ {
if (UIConfiguration::instance().get_timeline_item_gradient_depth() == 0.0) { if (UIConfiguration::instance().get_timeline_item_gradient_depth() == 0.0) {
sample->set_gradient (ArdourCanvas::Fill::StopList (), 0); frame->set_gradient (ArdourCanvas::Fill::StopList (), 0);
return; return;
} }
@ -730,7 +730,7 @@ TimeAxisViewItem::set_sample_gradient ()
Color darker = hsva_to_color (h, s, v, a); Color darker = hsva_to_color (h, s, v, a);
stops.push_back (std::make_pair (1.0, darker)); stops.push_back (std::make_pair (1.0, darker));
sample->set_gradient (stops, true); frame->set_gradient (stops, true);
} }
/** /**
@ -815,9 +815,9 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
if (pixel_width < 2.0) { if (pixel_width < 2.0) {
if (sample) { if (frame) {
sample->set_outline (false); frame->set_outline (false);
sample->set_x1 (std::max(1.0, pixel_width)); frame->set_x1 (std::max(1.0, pixel_width));
} }
if (sample_handle_start) { if (sample_handle_start) {
@ -826,15 +826,15 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
} }
} else { } else {
if (sample) { if (frame) {
sample->set_outline (true); frame->set_outline (true);
/* Note: x0 is always zero - the position is defined by /* Note: x0 is always zero - the position is defined by
* the position of the group, not the sample. * the position of the group, not the frame.
*/ */
sample->set_x1 (pixel_width); frame->set_x1 (pixel_width);
if (selection_sample) { if (selection_frame) {
selection_sample->set (sample->get().shrink (1.0)); selection_frame->set (frame->get().shrink (1.0));
} }
} }
@ -922,7 +922,7 @@ TimeAxisViewItem::parameter_changed (string p)
if (p == "color-regions-using-track-color") { if (p == "color-regions-using-track-color") {
set_colors (); set_colors ();
} else if (p == "timeline-item-gradient-depth") { } else if (p == "timeline-item-gradient-depth") {
set_sample_gradient (); set_frame_gradient ();
} }
} }
@ -930,12 +930,12 @@ void
TimeAxisViewItem::drag_start () TimeAxisViewItem::drag_start ()
{ {
_dragging = true; _dragging = true;
set_sample_color (); set_frame_color ();
} }
void void
TimeAxisViewItem::drag_end () TimeAxisViewItem::drag_end ()
{ {
_dragging = false; _dragging = false;
set_sample_color (); set_frame_color ();
} }

View file

@ -163,8 +163,8 @@ protected:
virtual bool canvas_group_event (GdkEvent*); virtual bool canvas_group_event (GdkEvent*);
virtual void set_colors(); virtual void set_colors();
virtual void set_sample_color(); virtual void set_frame_color();
virtual void set_sample_gradient (); virtual void set_frame_gradient ();
void set_trim_handle_colors(); void set_trim_handle_colors();
virtual void reset_width_dependent_items (double); virtual void reset_width_dependent_items (double);
@ -217,9 +217,9 @@ protected:
bool wide_enough_for_name; bool wide_enough_for_name;
bool high_enough_for_name; bool high_enough_for_name;
ArdourCanvas::Container* group; ArdourCanvas::Container* group;
ArdourCanvas::Rectangle* sample; ArdourCanvas::Rectangle* frame;
ArdourCanvas::Rectangle* selection_sample; ArdourCanvas::Rectangle* selection_frame;
ArdourCanvas::Text* name_text; ArdourCanvas::Text* name_text;
ArdourCanvas::Rectangle* name_highlight; ArdourCanvas::Rectangle* name_highlight;