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
Signed by: rgareus
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));
/* 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.
*/
@ -1339,7 +1339,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev, b
return;
}
/*y is in item sample */
/* y is in item frame */
double const bx = gain_line->nth (before_p)->get_x();
double const ax = gain_line->nth (after_p)->get_x();
double const click_ratio = (ax - mx) / (ax - bx);
@ -1591,13 +1591,13 @@ AudioRegionView::set_some_waveform_colors (vector<ArdourWaveView::WaveView*>& wa
}
void
AudioRegionView::set_sample_color ()
AudioRegionView::set_frame_color ()
{
if (!sample) {
if (!frame) {
return;
}
RegionView::set_sample_color ();
RegionView::set_frame_color ();
set_waveform_colors ();
}

View File

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

View File

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

View File

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

View File

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

View File

@ -119,7 +119,7 @@ TimeAxisViewItem::TimeAxisViewItem(
: trackview (tv)
, sample_position (-1)
, item_name (it_name)
, selection_sample (0)
, selection_frame (0)
, _height (1.0)
, _recregion (recording)
, _automation (automation)
@ -136,7 +136,7 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
, trackview (other.trackview)
, sample_position (-1)
, item_name (other.item_name)
, selection_sample (0)
, selection_frame (0)
, _height (1.0)
, _recregion (other._recregion)
, _automation (other._automation)
@ -182,20 +182,20 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
}
if (visibility & ShowFrame) {
sample = new ArdourCanvas::Rectangle (group,
ArdourCanvas::Rect (0.0, 0.0,
trackview.editor().sample_to_pixel(duration),
trackview.current_height()));
frame = new ArdourCanvas::Rectangle (group,
ArdourCanvas::Rect (0.0, 0.0,
trackview.editor().sample_to_pixel(duration),
trackview.current_height()));
sample->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
sample->show ();
frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
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) {
sample->set_outline_color (UIConfiguration::instance().color ("recording rect"));
frame->set_outline_color (UIConfiguration::instance().color ("recording rect"));
} 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;
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_fill (false);
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()));
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_fill (false);
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)) {
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)
<< endmsg;
return false;
@ -489,21 +489,21 @@ TimeAxisViewItem::set_selected(bool yn)
}
Selectable::set_selected (yn);
set_sample_color ();
set_frame_color ();
set_name_text_color ();
if (_selected && sample) {
if (!selection_sample) {
selection_sample = new ArdourCanvas::Rectangle (group);
selection_sample->set_fill (false);
selection_sample->set_outline_color (UIConfiguration::instance().color ("selected time axis frame"));
selection_sample->set_ignore_events (true);
if (_selected && frame) {
if (!selection_frame) {
selection_frame = new ArdourCanvas::Rectangle (group);
selection_frame->set_fill (false);
selection_frame->set_outline_color (UIConfiguration::instance().color ("selected time axis frame"));
selection_frame->set_ignore_events (true);
}
selection_sample->set (sample->get().shrink (1.0));
selection_sample->show ();
selection_frame->set (frame->get().shrink (1.0));
selection_frame->show ();
} else {
if (selection_sample) {
selection_sample->hide ();
if (selection_frame) {
selection_frame->hide ();
}
}
}
@ -555,18 +555,18 @@ TimeAxisViewItem::set_height (double height)
}
}
if (sample) {
if (frame) {
sample->set_y0 (0.0);
sample->set_y1 (height);
frame->set_y0 (0.0);
frame->set_y1 (height);
if (sample_handle_start) {
sample_handle_start->set_y1 (height);
sample_handle_end->set_y1 (height);
}
if (selection_sample) {
selection_sample->set (sample->get().shrink (1.0));
if (selection_frame) {
selection_frame->set (frame->get().shrink (1.0));
}
}
}
@ -613,7 +613,7 @@ TimeAxisViewItem::set_color (uint32_t base_color)
ArdourCanvas::Item*
TimeAxisViewItem::get_canvas_sample()
{
return sample;
return frame;
}
ArdourCanvas::Item*
@ -634,7 +634,7 @@ TimeAxisViewItem::get_name_highlight()
void
TimeAxisViewItem::set_colors()
{
set_sample_color ();
set_frame_color ();
if (name_highlight) {
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
TimeAxisViewItem::set_sample_color()
TimeAxisViewItem::set_frame_color()
{
if (!sample) {
if (!frame) {
return;
}
sample->set_fill_color (get_fill_color());
set_sample_gradient ();
frame->set_fill_color (get_fill_color());
set_frame_gradient ();
if (!_recregion) {
sample->set_outline_color (UIConfiguration::instance().color ("time axis frame"));
frame->set_outline_color (UIConfiguration::instance().color ("time axis frame"));
}
}
void
TimeAxisViewItem::set_sample_gradient ()
TimeAxisViewItem::set_frame_gradient ()
{
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;
}
@ -730,7 +730,7 @@ TimeAxisViewItem::set_sample_gradient ()
Color darker = hsva_to_color (h, s, v, a);
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 (sample) {
sample->set_outline (false);
sample->set_x1 (std::max(1.0, pixel_width));
if (frame) {
frame->set_outline (false);
frame->set_x1 (std::max(1.0, pixel_width));
}
if (sample_handle_start) {
@ -826,15 +826,15 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
}
} else {
if (sample) {
sample->set_outline (true);
if (frame) {
frame->set_outline (true);
/* 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) {
selection_sample->set (sample->get().shrink (1.0));
if (selection_frame) {
selection_frame->set (frame->get().shrink (1.0));
}
}
@ -922,7 +922,7 @@ TimeAxisViewItem::parameter_changed (string p)
if (p == "color-regions-using-track-color") {
set_colors ();
} else if (p == "timeline-item-gradient-depth") {
set_sample_gradient ();
set_frame_gradient ();
}
}
@ -930,12 +930,12 @@ void
TimeAxisViewItem::drag_start ()
{
_dragging = true;
set_sample_color ();
set_frame_color ();
}
void
TimeAxisViewItem::drag_end ()
{
_dragging = false;
set_sample_color ();
set_frame_color ();
}

View File

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