2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2003 Paul Davis
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2013-04-16 23:46:22 -04:00
|
|
|
#include <utility>
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/error.h"
|
|
|
|
#include "pbd/stacktrace.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/types.h"
|
|
|
|
#include "ardour/ardour.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2011-02-08 15:01:55 -05:00
|
|
|
#include "gtkmm2ext/utils.h"
|
|
|
|
#include "gtkmm2ext/gui_thread.h"
|
2006-04-27 05:04:24 -04:00
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
#include "canvas/group.h"
|
|
|
|
#include "canvas/rectangle.h"
|
|
|
|
#include "canvas/debug.h"
|
2014-01-02 16:50:00 -05:00
|
|
|
#include "canvas/drag_handle.h"
|
2013-04-15 13:50:05 -04:00
|
|
|
#include "canvas/text.h"
|
2013-04-16 23:46:22 -04:00
|
|
|
#include "canvas/utils.h"
|
2013-04-04 00:32:52 -04:00
|
|
|
|
2014-04-16 06:35:24 -04:00
|
|
|
#include "ardour/profile.h"
|
|
|
|
|
2009-08-08 18:36:32 -04:00
|
|
|
#include "ardour_ui.h"
|
|
|
|
/*
|
|
|
|
* ardour_ui.h was moved up in the include list
|
|
|
|
* due to a conflicting definition of 'Rect' between
|
|
|
|
* Apple's MacTypes.h file and GTK
|
|
|
|
*/
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "public_editor.h"
|
|
|
|
#include "time_axis_view_item.h"
|
|
|
|
#include "time_axis_view.h"
|
|
|
|
#include "utils.h"
|
|
|
|
#include "rgb_macros.h"
|
|
|
|
|
|
|
|
#include "i18n.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace Editing;
|
2005-11-13 13:13:50 -05:00
|
|
|
using namespace Glib;
|
2006-06-21 19:01:03 -04:00
|
|
|
using namespace PBD;
|
2007-06-15 18:08:27 -04:00
|
|
|
using namespace ARDOUR;
|
2010-09-26 09:33:39 -04:00
|
|
|
using namespace Gtkmm2ext;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2011-06-02 13:50:37 -04:00
|
|
|
Pango::FontDescription TimeAxisViewItem::NAME_FONT;
|
2005-09-25 14:42:24 -04:00
|
|
|
const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
|
2014-02-25 13:37:57 -05:00
|
|
|
const double TimeAxisViewItem::GRAB_HANDLE_TOP = 0.0;
|
|
|
|
const double TimeAxisViewItem::GRAB_HANDLE_WIDTH = 10.0;
|
2014-02-13 18:16:10 -05:00
|
|
|
const double TimeAxisViewItem::RIGHT_EDGE_SHIFT = 1.0;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-11-12 15:39:53 -05:00
|
|
|
int TimeAxisViewItem::NAME_HEIGHT;
|
2006-04-27 05:04:24 -04:00
|
|
|
double TimeAxisViewItem::NAME_Y_OFFSET;
|
|
|
|
double TimeAxisViewItem::NAME_HIGHLIGHT_SIZE;
|
|
|
|
double TimeAxisViewItem::NAME_HIGHLIGHT_THRESH;
|
|
|
|
|
2010-06-03 11:57:31 -04:00
|
|
|
void
|
|
|
|
TimeAxisViewItem::set_constant_heights ()
|
|
|
|
{
|
|
|
|
NAME_FONT = get_font_for_style (X_("TimeAxisViewItemName"));
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2010-06-03 11:57:31 -04:00
|
|
|
Gtk::Window win;
|
|
|
|
Gtk::Label foo;
|
|
|
|
win.add (foo);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2010-06-03 11:57:31 -04:00
|
|
|
Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout (X_("Hg")); /* ascender + descender */
|
|
|
|
int width = 0;
|
|
|
|
int height = 0;
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-06-02 13:50:37 -04:00
|
|
|
layout->set_font_description (NAME_FONT);
|
2014-01-02 14:29:07 -05:00
|
|
|
get_pixel_size (layout, width, height);
|
|
|
|
|
|
|
|
layout = foo.create_pango_layout (X_("H")); /* just the ascender */
|
|
|
|
|
2010-06-03 11:57:31 -04:00
|
|
|
NAME_HEIGHT = height;
|
2014-04-16 07:35:20 -04:00
|
|
|
|
|
|
|
/* Config->get_show_name_highlight) == true:
|
|
|
|
Y_OFFSET is measured from bottom of the time axis view item.
|
|
|
|
Config->get_show_name_highlight) == false:
|
|
|
|
Y_OFFSET is measured from the top of the time axis view item.
|
2014-04-16 06:35:24 -04:00
|
|
|
*/
|
2014-04-16 07:35:20 -04:00
|
|
|
|
2014-04-16 06:35:24 -04:00
|
|
|
if (Config->get_show_name_highlight()) {
|
|
|
|
NAME_Y_OFFSET = height + 1;
|
|
|
|
NAME_HIGHLIGHT_SIZE = height + 2;
|
2014-04-16 07:30:09 -04:00
|
|
|
} else {
|
|
|
|
NAME_Y_OFFSET = 3;
|
|
|
|
NAME_HIGHLIGHT_SIZE = 0;
|
2014-04-16 06:35:24 -04:00
|
|
|
}
|
2010-06-03 11:57:31 -04:00
|
|
|
NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 3;
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Construct a new TimeAxisViewItem.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
2010-04-07 07:03:00 -04:00
|
|
|
* @param it_name the unique name of this item
|
2010-09-01 18:35:46 -04:00
|
|
|
* @param parent the parent canvas group
|
2005-09-25 14:42:24 -04:00
|
|
|
* @param tv the TimeAxisView we are going to be added to
|
|
|
|
* @param spu samples per unit
|
|
|
|
* @param base_color
|
|
|
|
* @param start the start point of this item
|
|
|
|
* @param duration the duration of this item
|
2010-09-01 18:35:46 -04:00
|
|
|
* @param recording true if this is a recording region view
|
|
|
|
* @param automation true if this is an automation region view
|
2005-09-25 14:42:24 -04:00
|
|
|
*/
|
2010-09-01 18:35:46 -04:00
|
|
|
TimeAxisViewItem::TimeAxisViewItem(
|
|
|
|
const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color,
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t start, framecnt_t duration, bool recording, bool automation, Visibility vis
|
2010-09-01 18:35:46 -04:00
|
|
|
)
|
2010-04-07 07:03:00 -04:00
|
|
|
: trackview (tv)
|
2014-02-13 18:16:10 -05:00
|
|
|
, frame_position (-1)
|
2013-10-25 13:30:01 -04:00
|
|
|
, item_name (it_name)
|
2010-04-07 07:03:00 -04:00
|
|
|
, _height (1.0)
|
|
|
|
, _recregion (recording)
|
2010-09-01 18:35:46 -04:00
|
|
|
, _automation (automation)
|
2012-05-07 18:02:17 -04:00
|
|
|
, _dragging (false)
|
2013-12-29 23:10:54 -05:00
|
|
|
, _width (0.0)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2013-10-25 13:30:01 -04:00
|
|
|
init (&parent, spu, base_color, start, duration, vis, true, true);
|
2007-04-11 09:07:51 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
|
2011-10-18 09:18:47 -04:00
|
|
|
: trackable (other)
|
|
|
|
, Selectable (other)
|
2009-12-20 11:50:41 -05:00
|
|
|
, PBD::ScopedConnectionList()
|
2009-02-25 19:58:35 -05:00
|
|
|
, trackview (other.trackview)
|
2014-02-13 18:16:10 -05:00
|
|
|
, frame_position (-1)
|
2013-10-25 13:30:01 -04:00
|
|
|
, item_name (other.item_name)
|
2013-12-29 23:10:54 -05:00
|
|
|
, _height (1.0)
|
2010-01-07 20:28:15 -05:00
|
|
|
, _recregion (other._recregion)
|
2010-09-01 18:35:46 -04:00
|
|
|
, _automation (other._automation)
|
2012-05-07 18:02:17 -04:00
|
|
|
, _dragging (other._dragging)
|
2013-12-29 23:10:54 -05:00
|
|
|
, _width (0.0)
|
2007-04-11 09:07:51 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
Gdk::Color c;
|
|
|
|
int r,g,b,a;
|
|
|
|
|
|
|
|
UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a);
|
|
|
|
c.set_rgb_p (r/255.0, g/255.0, b/255.0);
|
|
|
|
|
|
|
|
/* share the other's parent, but still create a new group */
|
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
ArdourCanvas::Group* parent = other.group->parent();
|
2013-04-25 16:06:12 -04:00
|
|
|
|
2009-12-11 07:13:59 -05:00
|
|
|
_selected = other._selected;
|
2013-04-25 16:06:12 -04:00
|
|
|
|
2013-10-25 13:30:01 -04:00
|
|
|
init (parent, other.samples_per_pixel, c, other.frame_position,
|
2012-05-07 18:02:17 -04:00
|
|
|
other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name);
|
2007-04-11 09:07:51 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-10-25 13:30:01 -04:00
|
|
|
TimeAxisViewItem::init (ArdourCanvas::Group* parent, double fpp, Gdk::Color const & base_color,
|
2013-04-24 18:31:00 -04:00
|
|
|
framepos_t start, framepos_t duration, Visibility vis,
|
|
|
|
bool wide, bool high)
|
2007-04-11 09:07:51 -04:00
|
|
|
{
|
2013-04-25 16:06:12 -04:00
|
|
|
group = new ArdourCanvas::Group (parent);
|
|
|
|
CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
|
|
|
|
group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
|
|
|
|
|
2013-04-12 11:31:50 -04:00
|
|
|
samples_per_pixel = fpp;
|
2010-04-07 07:03:00 -04:00
|
|
|
frame_position = start;
|
|
|
|
item_duration = duration;
|
2005-09-25 14:42:24 -04:00
|
|
|
name_connected = false;
|
2009-05-01 16:30:57 -04:00
|
|
|
fill_opacity = 60;
|
2010-04-07 07:03:00 -04:00
|
|
|
position_locked = false;
|
2010-09-17 12:24:22 -04:00
|
|
|
max_item_duration = ARDOUR::max_framepos;
|
2010-04-07 07:03:00 -04:00
|
|
|
min_item_duration = 0;
|
2005-09-25 14:42:24 -04:00
|
|
|
show_vestigial = true;
|
2006-02-10 21:34:03 -05:00
|
|
|
visibility = vis;
|
2007-04-11 09:07:51 -04:00
|
|
|
_sensitive = true;
|
2013-04-15 13:50:05 -04:00
|
|
|
name_text_width = 0;
|
2009-11-12 15:39:53 -05:00
|
|
|
last_item_width = 0;
|
2009-12-02 19:14:24 -05:00
|
|
|
wide_enough_for_name = wide;
|
2009-12-02 21:22:36 -05:00
|
|
|
high_enough_for_name = high;
|
2011-03-03 09:51:02 -05:00
|
|
|
rect_visible = true;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if (duration == 0) {
|
2010-04-07 07:03:00 -04:00
|
|
|
warning << "Time Axis Item Duration == 0" << endl;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
vestigial_frame = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, 1.0, 2.0, trackview.current_height()));
|
2013-04-24 15:42:14 -04:00
|
|
|
CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
|
2009-05-13 11:33:41 -04:00
|
|
|
vestigial_frame->hide ();
|
2013-04-16 23:46:22 -04:00
|
|
|
vestigial_frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_VestigialFrame());
|
|
|
|
vestigial_frame->set_fill_color (ARDOUR_UI::config()->get_canvasvar_VestigialFrame());
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if (visibility & ShowFrame) {
|
2013-04-04 18:45:27 -04:00
|
|
|
frame = new ArdourCanvas::Rectangle (group,
|
2014-02-25 11:35:55 -05:00
|
|
|
ArdourCanvas::Rect (0.0, 0.0,
|
2014-02-13 18:16:10 -05:00
|
|
|
trackview.editor().sample_to_pixel(duration) + RIGHT_EDGE_SHIFT,
|
|
|
|
trackview.current_height() - 1.0));
|
2013-10-30 23:36:30 -04:00
|
|
|
|
2013-04-24 15:42:14 -04:00
|
|
|
CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name()));
|
2014-02-13 18:16:10 -05:00
|
|
|
|
2014-04-18 05:07:20 -04:00
|
|
|
if (Config->get_show_name_highlight()) {
|
|
|
|
frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
|
|
|
|
} else {
|
|
|
|
frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::BOTTOM));
|
|
|
|
}
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2010-09-01 18:35:46 -04:00
|
|
|
if (_recregion) {
|
2013-04-16 23:46:22 -04:00
|
|
|
frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_RecordingRect());
|
2010-09-01 18:35:46 -04:00
|
|
|
} else {
|
2013-04-16 23:46:22 -04:00
|
|
|
frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame());
|
2006-02-10 21:34:03 -05:00
|
|
|
}
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2013-04-15 13:50:05 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
frame = 0;
|
|
|
|
}
|
2014-02-25 11:35:55 -05:00
|
|
|
|
2014-04-16 06:35:24 -04:00
|
|
|
if (Config->get_show_name_highlight() && (visibility & ShowNameHighlight)) {
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2014-01-10 11:56:55 -05:00
|
|
|
double width;
|
|
|
|
double start;
|
|
|
|
|
2006-02-10 21:34:03 -05:00
|
|
|
if (visibility & FullWidthNameHighlight) {
|
2014-01-10 11:56:55 -05:00
|
|
|
start = 0.0;
|
2014-02-13 18:16:10 -05:00
|
|
|
width = trackview.editor().sample_to_pixel(item_duration) + RIGHT_EDGE_SHIFT;
|
2006-02-10 21:34:03 -05:00
|
|
|
} else {
|
2014-01-10 11:56:55 -05:00
|
|
|
start = 1.0;
|
2014-02-13 18:16:10 -05:00
|
|
|
width = trackview.editor().sample_to_pixel(item_duration) - 2.0 + RIGHT_EDGE_SHIFT;
|
2006-02-10 21:34:03 -05:00
|
|
|
}
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2014-01-10 11:56:55 -05:00
|
|
|
name_highlight = new ArdourCanvas::Rectangle (group,
|
|
|
|
ArdourCanvas::Rect (start,
|
|
|
|
trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE,
|
2014-02-13 18:16:10 -05:00
|
|
|
width - 2.0 + RIGHT_EDGE_SHIFT,
|
2014-02-25 11:35:55 -05:00
|
|
|
trackview.current_height() - 1.0));
|
2014-01-10 11:56:55 -05:00
|
|
|
CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
|
2005-11-12 17:07:07 -05:00
|
|
|
name_highlight->set_data ("timeaxisviewitem", this);
|
2013-04-15 13:50:05 -04:00
|
|
|
name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
|
2013-04-04 00:32:52 -04:00
|
|
|
name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255));
|
2005-11-12 17:07:07 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
|
|
|
name_highlight = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (visibility & ShowNameText) {
|
2013-04-15 13:50:05 -04:00
|
|
|
name_text = new ArdourCanvas::Text (group);
|
2013-04-24 15:42:14 -04:00
|
|
|
CANVAS_DEBUG_NAME (name_text, string_compose ("name text for %1", get_item_name()));
|
2014-04-16 06:35:24 -04:00
|
|
|
if (Config->get_show_name_highlight()) {
|
|
|
|
name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, trackview.current_height() - NAME_Y_OFFSET));
|
2014-04-16 07:30:09 -04:00
|
|
|
} else {
|
|
|
|
name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, NAME_Y_OFFSET));
|
2014-04-16 06:35:24 -04:00
|
|
|
}
|
2013-04-15 13:50:05 -04:00
|
|
|
name_text->set_font_description (NAME_FONT);
|
2009-05-22 07:58:46 -04:00
|
|
|
} else {
|
2013-04-15 13:50:05 -04:00
|
|
|
name_text = 0;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2009-10-14 12:10:01 -04:00
|
|
|
/* create our grab handles used for trimming/duration etc */
|
2010-09-01 18:35:46 -04:00
|
|
|
if (!_recregion && !_automation) {
|
2012-04-30 19:00:15 -04:00
|
|
|
double top = TimeAxisViewItem::GRAB_HANDLE_TOP;
|
|
|
|
double width = TimeAxisViewItem::GRAB_HANDLE_WIDTH;
|
|
|
|
|
2014-01-02 16:50:00 -05:00
|
|
|
frame_handle_start = new ArdourCanvas::DragHandle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()), true);
|
2013-04-24 15:42:14 -04:00
|
|
|
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::frame_handle_crossing), frame_handle_start));
|
|
|
|
|
2014-01-02 16:50:00 -05:00
|
|
|
frame_handle_end = new ArdourCanvas::DragHandle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()), false);
|
2013-04-24 15:42:14 -04:00
|
|
|
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::frame_handle_crossing), frame_handle_end));
|
2010-07-19 19:26:10 -04:00
|
|
|
} else {
|
|
|
|
frame_handle_start = frame_handle_end = 0;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
set_color (base_color);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
set_duration (item_duration, this);
|
|
|
|
set_position (start, this);
|
2011-02-08 15:01:55 -05:00
|
|
|
|
2012-04-25 08:58:19 -04:00
|
|
|
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&TimeAxisViewItem::parameter_changed, this, _1), gui_context ());
|
2013-04-16 23:46:22 -04:00
|
|
|
ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &TimeAxisViewItem::parameter_changed));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
TimeAxisViewItem::~TimeAxisViewItem()
|
|
|
|
{
|
2005-11-12 17:07:07 -05:00
|
|
|
delete group;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2013-04-25 16:06:12 -04:00
|
|
|
bool
|
2013-05-08 14:48:28 -04:00
|
|
|
TimeAxisViewItem::canvas_group_event (GdkEvent* /*ev*/)
|
2013-04-25 16:06:12 -04:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-03-03 09:51:02 -05:00
|
|
|
void
|
|
|
|
TimeAxisViewItem::hide_rect ()
|
|
|
|
{
|
|
|
|
rect_visible = false;
|
|
|
|
set_frame_color ();
|
|
|
|
|
|
|
|
if (name_highlight) {
|
2013-04-15 13:50:05 -04:00
|
|
|
name_highlight->set_outline_what (ArdourCanvas::Rectangle::What (0));
|
2013-04-04 00:32:52 -04:00
|
|
|
name_highlight->set_fill_color (UINT_RGBA_CHANGE_A (fill_color, 64));
|
2011-03-03 09:51:02 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
TimeAxisViewItem::show_rect ()
|
|
|
|
{
|
|
|
|
rect_visible = true;
|
|
|
|
set_frame_color ();
|
|
|
|
|
|
|
|
if (name_highlight) {
|
2013-04-15 13:50:05 -04:00
|
|
|
name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
|
2013-04-04 00:32:52 -04:00
|
|
|
name_highlight->set_fill_color (fill_color);
|
2011-03-03 09:51:02 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set the position of this item on the timeline.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
|
|
|
* @param pos the new position
|
|
|
|
* @param src the identity of the object that initiated the change
|
2010-04-07 07:03:00 -04:00
|
|
|
* @return true on success
|
2005-09-25 14:42:24 -04:00
|
|
|
*/
|
2010-04-07 07:03:00 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
bool
|
2010-09-17 14:20:37 -04:00
|
|
|
TimeAxisViewItem::set_position(framepos_t pos, void* src, double* delta)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
if (position_locked) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
frame_position = pos;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2014-02-13 18:16:10 -05:00
|
|
|
double new_unit_pos = trackview.editor().sample_to_pixel (pos);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
if (delta) {
|
2014-02-13 18:16:10 -05:00
|
|
|
(*delta) = new_unit_pos - group->position().x;
|
|
|
|
if (*delta == 0.0) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (new_unit_pos == group->position().x) {
|
|
|
|
return true;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2014-02-13 18:16:10 -05:00
|
|
|
group->set_x_position (new_unit_pos);
|
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
PositionChanged (frame_position, src); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
/** @return position of this item on the timeline */
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t
|
2005-09-25 14:42:24 -04:00
|
|
|
TimeAxisViewItem::get_position() const
|
|
|
|
{
|
|
|
|
return frame_position;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set the duration of this item.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
|
|
|
* @param dur the new duration of this item
|
|
|
|
* @param src the identity of the object that initiated the change
|
2010-04-07 07:03:00 -04:00
|
|
|
* @return true on success
|
2005-09-25 14:42:24 -04:00
|
|
|
*/
|
2010-04-07 07:03:00 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
bool
|
2012-04-14 18:04:51 -04:00
|
|
|
TimeAxisViewItem::set_duration (framecnt_t dur, void* src)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
if ((dur > max_item_duration) || (dur < min_item_duration)) {
|
2013-01-05 08:07:57 -05:00
|
|
|
warning << string_compose (
|
2013-01-05 08:29:55 -05:00
|
|
|
P_("new duration %1 frame is out of bounds for %2", "new duration of %1 frames is out of bounds for %2", dur),
|
2013-01-05 08:07:57 -05:00
|
|
|
get_item_name(), dur)
|
2005-09-25 14:42:24 -04:00
|
|
|
<< endmsg;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dur == 0) {
|
2005-11-12 17:07:07 -05:00
|
|
|
group->hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
item_duration = dur;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2013-04-12 11:15:45 -04:00
|
|
|
reset_width_dependent_items (trackview.editor().sample_to_pixel (dur));
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
DurationChanged (dur, src); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
/** @return duration of this item */
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t
|
2005-09-25 14:42:24 -04:00
|
|
|
TimeAxisViewItem::get_duration() const
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
return item_duration;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set the maximum duration that this item can have.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
|
|
|
* @param dur the new maximum duration
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
|
|
|
void
|
2010-09-17 14:20:37 -04:00
|
|
|
TimeAxisViewItem::set_max_duration(framecnt_t dur, void* src)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
max_item_duration = dur;
|
|
|
|
MaxDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
/** @return the maximum duration that this item may have */
|
2010-09-17 14:20:37 -04:00
|
|
|
framecnt_t
|
2005-09-25 14:42:24 -04:00
|
|
|
TimeAxisViewItem::get_max_duration() const
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
return max_item_duration;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set the minimum duration that this item may have.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
|
|
|
* @param the minimum duration that this item may be set to
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
|
|
|
void
|
2010-09-17 14:20:37 -04:00
|
|
|
TimeAxisViewItem::set_min_duration(framecnt_t dur, void* src)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
min_item_duration = dur;
|
|
|
|
MinDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
/** @return the minimum duration that this item mey have */
|
2010-09-17 14:20:37 -04:00
|
|
|
framecnt_t
|
2005-09-25 14:42:24 -04:00
|
|
|
TimeAxisViewItem::get_min_duration() const
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
return min_item_duration;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set whether this item is locked to its current position.
|
2005-09-25 14:42:24 -04:00
|
|
|
* Locked items cannot be moved until the item is unlocked again.
|
|
|
|
*
|
2010-04-07 07:03:00 -04:00
|
|
|
* @param yn true to lock this item to its current position
|
2005-09-25 14:42:24 -04:00
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
TimeAxisViewItem::set_position_locked(bool yn, void* src)
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
position_locked = yn;
|
|
|
|
set_trim_handle_colors();
|
2005-09-25 14:42:24 -04:00
|
|
|
PositionLockChanged (position_locked, src); /* EMIT_SIGNAL */
|
|
|
|
}
|
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
/** @return true if this item is locked to its current position */
|
2005-09-25 14:42:24 -04:00
|
|
|
bool
|
|
|
|
TimeAxisViewItem::get_position_locked() const
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
return position_locked;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set whether the maximum duration constraint is active.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
|
|
|
* @param active set true to enforce the max duration constraint
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
|
|
|
void
|
2009-07-21 11:55:17 -04:00
|
|
|
TimeAxisViewItem::set_max_duration_active (bool active, void* /*src*/)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2009-07-21 11:55:17 -04:00
|
|
|
max_duration_active = active;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
/** @return true if the maximum duration constraint is active */
|
2005-09-25 14:42:24 -04:00
|
|
|
bool
|
|
|
|
TimeAxisViewItem::get_max_duration_active() const
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
return max_duration_active;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set whether the minimum duration constraint is active.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
|
|
|
* @param active set true to enforce the min duration constraint
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
2010-04-07 07:03:00 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2009-07-21 11:55:17 -04:00
|
|
|
TimeAxisViewItem::set_min_duration_active (bool active, void* /*src*/)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
min_duration_active = active;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
/** @return true if the maximum duration constraint is active */
|
2005-09-25 14:42:24 -04:00
|
|
|
bool
|
|
|
|
TimeAxisViewItem::get_min_duration_active() const
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
return min_duration_active;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set the name of this item.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
|
|
|
* @param new_name the new name of this item
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
2010-04-07 07:03:00 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
|
|
|
TimeAxisViewItem::set_item_name(std::string new_name, void* src)
|
|
|
|
{
|
|
|
|
if (new_name != item_name) {
|
2010-04-07 07:03:00 -04:00
|
|
|
std::string temp_name = item_name;
|
|
|
|
item_name = new_name;
|
|
|
|
NameChanged (item_name, temp_name, src); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
/** @return the name of this item */
|
2005-09-25 14:42:24 -04:00
|
|
|
std::string
|
|
|
|
TimeAxisViewItem::get_item_name() const
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
return item_name;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set selection status.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
|
|
|
* @param yn true if this item is currently selected
|
|
|
|
*/
|
|
|
|
void
|
2006-06-20 14:50:38 -04:00
|
|
|
TimeAxisViewItem::set_selected(bool yn)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
if (_selected != yn) {
|
2006-06-20 14:50:38 -04:00
|
|
|
Selectable::set_selected (yn);
|
2005-09-25 14:42:24 -04:00
|
|
|
set_frame_color ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
/** @return the TimeAxisView that this item is on */
|
2009-07-09 13:58:13 -04:00
|
|
|
TimeAxisView&
|
2010-09-06 08:34:11 -04:00
|
|
|
TimeAxisViewItem::get_time_axis_view () const
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
return trackview;
|
2009-10-14 12:10:01 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set the displayed item text.
|
|
|
|
* This item is the visual text name displayed on the canvas item, this can be different to the name of the item.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
|
|
|
* @param new_name the new name text to display
|
|
|
|
*/
|
2010-04-07 07:03:00 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2010-09-14 12:51:02 -04:00
|
|
|
TimeAxisViewItem::set_name_text(const string& new_name)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2013-04-15 13:50:05 -04:00
|
|
|
if (!name_text) {
|
2009-05-13 11:33:41 -04:00
|
|
|
return;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-05-13 11:33:41 -04:00
|
|
|
|
2013-04-15 13:50:05 -04:00
|
|
|
name_text_width = pixel_width (new_name, NAME_FONT) + 2;
|
|
|
|
name_text->set (new_name);
|
2013-04-15 14:45:22 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set the height of this item.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
2010-04-07 07:03:00 -04:00
|
|
|
* @param h new height
|
2009-10-14 12:10:01 -04:00
|
|
|
*/
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2008-09-19 15:32:10 -04:00
|
|
|
TimeAxisViewItem::set_height (double height)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-03-16 11:33:04 -04:00
|
|
|
_height = height;
|
|
|
|
|
2013-12-29 23:10:54 -05:00
|
|
|
manage_name_highlight ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-05-13 11:33:41 -04:00
|
|
|
if (visibility & ShowNameText) {
|
2014-04-16 06:35:24 -04:00
|
|
|
if (Config->get_show_name_highlight()) {
|
|
|
|
name_text->set_y_position (height - NAME_Y_OFFSET);
|
2014-04-16 07:30:09 -04:00
|
|
|
} else {
|
|
|
|
name_text->set_y_position (NAME_Y_OFFSET);
|
2014-04-16 06:35:24 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (frame) {
|
2014-01-10 11:56:55 -05:00
|
|
|
frame->set_y1 (height);
|
2010-07-19 19:26:10 -04:00
|
|
|
if (frame_handle_start) {
|
2014-01-10 11:56:55 -05:00
|
|
|
frame_handle_start->set_y1 (height);
|
|
|
|
frame_handle_end->set_y1 (height);
|
2010-07-19 19:26:10 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2014-02-13 18:16:10 -05:00
|
|
|
vestigial_frame->set_y1 (height - 1.0);
|
2009-12-02 21:22:36 -05:00
|
|
|
|
2011-02-08 09:09:42 -05:00
|
|
|
set_colors ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2013-12-29 23:10:54 -05:00
|
|
|
void
|
|
|
|
TimeAxisViewItem::manage_name_highlight ()
|
|
|
|
{
|
2014-01-10 11:56:55 -05:00
|
|
|
if (!name_highlight) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-12-29 23:10:54 -05:00
|
|
|
if (_height < NAME_HIGHLIGHT_THRESH) {
|
|
|
|
high_enough_for_name = false;
|
|
|
|
} else {
|
|
|
|
high_enough_for_name = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_width < 2.0) {
|
|
|
|
wide_enough_for_name = false;
|
|
|
|
} else {
|
|
|
|
wide_enough_for_name = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (name_highlight && wide_enough_for_name && high_enough_for_name) {
|
|
|
|
|
|
|
|
name_highlight->show();
|
2014-03-11 07:37:20 -04:00
|
|
|
name_highlight->set (ArdourCanvas::Rect (0.0, (double) _height - NAME_HIGHLIGHT_SIZE, _width+RIGHT_EDGE_SHIFT, (double) _height - 1.0));
|
2013-12-29 23:10:54 -05:00
|
|
|
|
|
|
|
} else {
|
|
|
|
name_highlight->hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
manage_name_text ();
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2009-06-08 15:28:51 -04:00
|
|
|
TimeAxisViewItem::set_color (Gdk::Color const & base_color)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
compute_colors (base_color);
|
|
|
|
set_colors ();
|
|
|
|
}
|
|
|
|
|
2005-11-23 12:21:12 -05:00
|
|
|
ArdourCanvas::Item*
|
2005-09-25 14:42:24 -04:00
|
|
|
TimeAxisViewItem::get_canvas_frame()
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
return frame;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-09-10 17:27:39 -04:00
|
|
|
ArdourCanvas::Group*
|
2005-09-25 14:42:24 -04:00
|
|
|
TimeAxisViewItem::get_canvas_group()
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
return group;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2005-11-23 12:21:12 -05:00
|
|
|
ArdourCanvas::Item*
|
2005-09-25 14:42:24 -04:00
|
|
|
TimeAxisViewItem::get_name_highlight()
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
return name_highlight;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Calculate some contrasting color for displaying various parts of this item, based upon the base color.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
|
|
|
* @param color the base color of the item
|
|
|
|
*/
|
|
|
|
void
|
2009-06-08 15:28:51 -04:00
|
|
|
TimeAxisViewItem::compute_colors (Gdk::Color const & base_color)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
unsigned char radius;
|
|
|
|
char minor_shift;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
unsigned char r,g,b;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
/* FILL: this is simple */
|
2010-04-07 07:03:00 -04:00
|
|
|
r = base_color.get_red()/256;
|
|
|
|
g = base_color.get_green()/256;
|
|
|
|
b = base_color.get_blue()/256;
|
|
|
|
fill_color = RGBA_TO_UINT(r,g,b,160);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
/* for minor colors:
|
|
|
|
if the overall saturation is strong, make the minor colors light.
|
|
|
|
if its weak, make them dark.
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
we do this by moving an equal distance to the other side of the
|
|
|
|
central circle in the color wheel from where we started.
|
|
|
|
*/
|
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
radius = (unsigned char) rint (floor (sqrt (static_cast<double>(r*r + g*g + b+b))/3.0f));
|
|
|
|
minor_shift = 125 - radius;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
/* LABEL: rotate around color wheel by 120 degrees anti-clockwise */
|
|
|
|
|
2005-10-10 16:38:53 -04:00
|
|
|
r = base_color.get_red()/256;
|
|
|
|
g = base_color.get_green()/256;
|
|
|
|
b = base_color.get_blue()/256;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
if (r > b)
|
|
|
|
{
|
|
|
|
if (r > g)
|
|
|
|
{
|
|
|
|
/* red sector => green */
|
|
|
|
swap (r,g);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* green sector => blue */
|
|
|
|
swap (g,b);
|
2009-10-14 12:10:01 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (b > g)
|
|
|
|
{
|
|
|
|
/* blue sector => red */
|
|
|
|
swap (b,r);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* green sector => blue */
|
|
|
|
swap (g,b);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
r += minor_shift;
|
|
|
|
b += minor_shift;
|
|
|
|
g += minor_shift;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
label_color = RGBA_TO_UINT(r,g,b,255);
|
2010-04-07 07:03:00 -04:00
|
|
|
r = (base_color.get_red()/256) + 127;
|
|
|
|
g = (base_color.get_green()/256) + 127;
|
|
|
|
b = (base_color.get_blue()/256) + 127;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
label_color = RGBA_TO_UINT(r,g,b,255);
|
|
|
|
|
|
|
|
/* XXX can we do better than this ? */
|
2010-04-07 07:03:00 -04:00
|
|
|
/* We're trying;) */
|
2005-09-25 14:42:24 -04:00
|
|
|
/* NUKECOLORS */
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//frame_color_r = 192;
|
|
|
|
//frame_color_g = 192;
|
|
|
|
//frame_color_b = 194;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//selected_frame_color_r = 182;
|
|
|
|
//selected_frame_color_g = 145;
|
|
|
|
//selected_frame_color_b = 168;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
//handle_color_r = 25;
|
|
|
|
//handle_color_g = 0;
|
|
|
|
//handle_color_b = 255;
|
|
|
|
//lock_handle_color_r = 235;
|
2005-09-25 14:42:24 -04:00
|
|
|
//lock_handle_color_g = 16;
|
|
|
|
//lock_handle_color_b = 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Convenience method to set the various canvas item colors
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
TimeAxisViewItem::set_colors()
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
set_frame_color();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if (name_highlight) {
|
2014-02-25 11:35:55 -05:00
|
|
|
name_highlight->set_fill_color (fill_color);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2013-06-26 17:40:10 -04:00
|
|
|
|
|
|
|
if (name_text) {
|
|
|
|
double r, g, b, a;
|
|
|
|
|
|
|
|
const double black_r = 0.0;
|
|
|
|
const double black_g = 0.0;
|
|
|
|
const double black_b = 0.0;
|
|
|
|
|
|
|
|
const double white_r = 1.0;
|
|
|
|
const double white_g = 1.0;
|
|
|
|
const double white_b = 1.0;
|
|
|
|
|
|
|
|
ArdourCanvas::color_to_rgba (fill_color, r, g, b, a);
|
|
|
|
|
|
|
|
/* Use W3C contrast guideline calculation */
|
|
|
|
|
|
|
|
double white_contrast = (max (r, white_r) - min (r, white_r)) +
|
|
|
|
(max (g, white_g) - min (g, white_g)) +
|
|
|
|
(max (b, white_b) - min (b, white_b));
|
|
|
|
|
|
|
|
double black_contrast = (max (r, black_r) - min (r, black_r)) +
|
|
|
|
(max (g, black_g) - min (g, black_g)) +
|
|
|
|
(max (b, black_b) - min (b, black_b));
|
|
|
|
|
|
|
|
if (white_contrast > black_contrast) {
|
|
|
|
/* use white */
|
|
|
|
name_text->set_color (ArdourCanvas::rgba_to_color (1.0, 1.0, 1.0, 1.0));
|
|
|
|
} else {
|
|
|
|
/* use black */
|
|
|
|
name_text->set_color (ArdourCanvas::rgba_to_color (0.0, 0.0, 0.0, 1.0));
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
double h, s, v;
|
|
|
|
|
|
|
|
ArdourCanvas::color_to_hsv (fill_color, h, s, v);
|
|
|
|
|
|
|
|
if (v == 0.0) {
|
|
|
|
/* fill is black, set text to white */
|
|
|
|
name_text->set_color (ArdourCanvas::rgba_to_color (1.0, 1.0, 1.0, 1.0));
|
|
|
|
} else if (v == 1.0) {
|
|
|
|
/* fill is white, set text to black */
|
|
|
|
name_text->set_color (ArdourCanvas::rgba_to_color (0.0, 0.0, 0.0, 1.0));
|
|
|
|
} else {
|
|
|
|
|
|
|
|
h = fabs (fmod ((h - 180), 360.0)); /* complementary color */
|
|
|
|
s = 1.0; /* fully saturate */
|
|
|
|
v = 0.9; /* increase lightness/brightness/value */
|
|
|
|
|
|
|
|
name_text->set_color (ArdourCanvas::hsv_to_color (h, s, v, 1.0));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-04-07 07:03:00 -04:00
|
|
|
set_trim_handle_colors();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2013-06-24 16:28:53 -04:00
|
|
|
uint32_t
|
|
|
|
TimeAxisViewItem::get_fill_color () const
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2011-03-03 09:51:02 -05:00
|
|
|
uint32_t f = 0;
|
|
|
|
|
2011-02-08 09:08:05 -05:00
|
|
|
if (_selected) {
|
2011-03-03 09:51:02 -05:00
|
|
|
|
2013-04-16 23:46:22 -04:00
|
|
|
f = ARDOUR_UI::config()->get_canvasvar_SelectedFrameBase();
|
2011-03-03 09:51:02 -05:00
|
|
|
|
2011-02-08 09:06:58 -05:00
|
|
|
} else {
|
2011-03-03 09:51:02 -05:00
|
|
|
|
2011-02-08 09:06:58 -05:00
|
|
|
if (_recregion) {
|
2013-04-16 23:46:22 -04:00
|
|
|
f = ARDOUR_UI::config()->get_canvasvar_RecordingRect();
|
2011-02-08 15:01:55 -05:00
|
|
|
} else {
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2013-06-28 11:31:26 -04:00
|
|
|
if (high_enough_for_name && !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
|
2013-04-16 23:46:22 -04:00
|
|
|
f = ARDOUR_UI::config()->get_canvasvar_FrameBase();
|
2008-09-10 11:03:30 -04:00
|
|
|
} else {
|
2011-02-08 15:01:55 -05:00
|
|
|
f = fill_color;
|
2008-09-10 11:03:30 -04:00
|
|
|
}
|
2013-06-24 16:28:53 -04:00
|
|
|
}
|
|
|
|
}
|
2011-02-08 15:01:55 -05:00
|
|
|
|
2013-06-24 16:28:53 -04:00
|
|
|
return f;
|
|
|
|
}
|
2011-02-08 15:01:55 -05:00
|
|
|
|
2013-06-24 16:28:53 -04:00
|
|
|
/**
|
|
|
|
* Sets the frame color depending on whether this item is selected
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
TimeAxisViewItem::set_frame_color()
|
|
|
|
{
|
|
|
|
uint32_t f = 0;
|
|
|
|
|
|
|
|
if (!frame) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
f = get_fill_color ();
|
|
|
|
|
|
|
|
if (fill_opacity) {
|
|
|
|
f = UINT_RGBA_CHANGE_A (f, fill_opacity);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!rect_visible) {
|
|
|
|
f = UINT_RGBA_CHANGE_A (f, 0);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2011-03-03 09:51:02 -05:00
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
frame->set_fill_color (f);
|
2013-04-16 23:46:22 -04:00
|
|
|
set_frame_gradient ();
|
2011-03-03 13:32:06 -05:00
|
|
|
|
|
|
|
if (!_recregion) {
|
2011-03-14 15:36:41 -04:00
|
|
|
if (_selected) {
|
2013-04-16 23:46:22 -04:00
|
|
|
f = ARDOUR_UI::config()->get_canvasvar_SelectedTimeAxisFrame();
|
2011-03-14 15:36:41 -04:00
|
|
|
} else {
|
2013-04-16 23:46:22 -04:00
|
|
|
f = ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame();
|
2011-03-14 15:36:41 -04:00
|
|
|
}
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-03-03 13:32:06 -05:00
|
|
|
if (!rect_visible) {
|
|
|
|
f = UINT_RGBA_CHANGE_A (f, 64);
|
|
|
|
}
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
frame->set_outline_color (f);
|
2011-03-03 13:32:06 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2013-04-16 23:46:22 -04:00
|
|
|
void
|
|
|
|
TimeAxisViewItem::set_frame_gradient ()
|
|
|
|
{
|
|
|
|
if (ARDOUR_UI::config()->get_timeline_item_gradient_depth() == 0.0) {
|
|
|
|
frame->set_gradient (ArdourCanvas::Fill::StopList (), 0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ArdourCanvas::Fill::StopList stops;
|
|
|
|
double r, g, b, a;
|
|
|
|
double h, s, v;
|
2013-06-24 16:28:53 -04:00
|
|
|
ArdourCanvas::Color f (get_fill_color());
|
2013-04-16 23:46:22 -04:00
|
|
|
|
|
|
|
/* need to get alpha value */
|
|
|
|
ArdourCanvas::color_to_rgba (f, r, g, b, a);
|
|
|
|
|
|
|
|
stops.push_back (std::make_pair (0.0, f));
|
|
|
|
|
|
|
|
/* now a darker version */
|
|
|
|
|
|
|
|
ArdourCanvas::color_to_hsv (f, h, s, v);
|
2013-06-24 16:28:53 -04:00
|
|
|
|
|
|
|
v = min (1.0, v * (1.0 - ARDOUR_UI::config()->get_timeline_item_gradient_depth()));
|
2013-04-16 23:46:22 -04:00
|
|
|
|
|
|
|
ArdourCanvas::Color darker = ArdourCanvas::hsv_to_color (h, s, v, a);
|
|
|
|
stops.push_back (std::make_pair (1.0, darker));
|
|
|
|
|
2013-06-27 10:41:00 -04:00
|
|
|
frame->set_gradient (stops, true);
|
2013-04-16 23:46:22 -04:00
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Set the colors of the start and end trim handle depending on object state
|
2005-09-25 14:42:24 -04:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
TimeAxisViewItem::set_trim_handle_colors()
|
|
|
|
{
|
2014-04-14 04:46:24 -04:00
|
|
|
#if 1
|
|
|
|
/* Leave them transparent for now */
|
|
|
|
if (frame_handle_start) {
|
|
|
|
frame_handle_start->set_fill_color (0x00000000);
|
|
|
|
frame_handle_end->set_fill_color (0x00000000);
|
|
|
|
}
|
|
|
|
#else
|
2005-09-25 14:42:24 -04:00
|
|
|
if (frame_handle_start) {
|
|
|
|
if (position_locked) {
|
2013-04-16 23:46:22 -04:00
|
|
|
frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandleLocked());
|
|
|
|
frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandleLocked());
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2013-04-24 15:42:14 -04:00
|
|
|
frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandle());
|
|
|
|
frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandle());
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
2014-04-14 04:46:24 -04:00
|
|
|
#endif
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2013-04-24 15:42:14 -04:00
|
|
|
bool
|
|
|
|
TimeAxisViewItem::frame_handle_crossing (GdkEvent* ev, ArdourCanvas::Rectangle* item)
|
|
|
|
{
|
2014-03-10 12:14:37 -04:00
|
|
|
switch (ev->type) {
|
|
|
|
case GDK_LEAVE_NOTIFY:
|
|
|
|
/* always hide the handle whenever we leave, no matter what mode */
|
|
|
|
item->set_fill (false);
|
|
|
|
break;
|
|
|
|
case GDK_ENTER_NOTIFY:
|
|
|
|
if (trackview.editor().effective_mouse_mode() == Editing::MouseObject &&
|
|
|
|
!trackview.editor().internal_editing()) {
|
|
|
|
/* never set this to be visible in internal
|
|
|
|
edit mode. Note, however, that we do need to
|
|
|
|
undo visibility (LEAVE_NOTIFY case above) no
|
|
|
|
matter what the mode is.
|
|
|
|
*/
|
2014-03-05 14:33:27 -05:00
|
|
|
item->set_fill (true);
|
|
|
|
}
|
2014-03-10 12:14:37 -04:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2013-04-24 15:42:14 -04:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
/** @return the frames per pixel */
|
2005-09-25 14:42:24 -04:00
|
|
|
double
|
2013-04-12 11:31:50 -04:00
|
|
|
TimeAxisViewItem::get_samples_per_pixel () const
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2013-04-12 11:31:50 -04:00
|
|
|
return samples_per_pixel;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
/** Set the frames per pixel of this item.
|
|
|
|
* This item is used to determine the relative visual size and position of this item
|
|
|
|
* based upon its duration and start value.
|
2010-04-07 07:03:00 -04:00
|
|
|
*
|
2013-04-04 00:32:52 -04:00
|
|
|
* @param fpp the new frames per pixel
|
2010-04-07 07:03:00 -04:00
|
|
|
*/
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2013-04-12 11:31:50 -04:00
|
|
|
TimeAxisViewItem::set_samples_per_pixel (double fpp)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2013-04-12 11:31:50 -04:00
|
|
|
samples_per_pixel = fpp;
|
2005-09-25 14:42:24 -04:00
|
|
|
set_position (this->get_position(), this);
|
2013-04-12 11:31:50 -04:00
|
|
|
reset_width_dependent_items ((double) get_duration() / samples_per_pixel);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
|
|
|
|
{
|
2013-12-29 23:10:54 -05:00
|
|
|
_width = pixel_width;
|
|
|
|
|
|
|
|
manage_name_highlight ();
|
|
|
|
|
2010-07-16 20:56:27 -04:00
|
|
|
if (pixel_width < 2.0) {
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if (show_vestigial) {
|
2005-11-12 22:53:51 -05:00
|
|
|
vestigial_frame->show();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (frame) {
|
2005-11-12 22:53:51 -05:00
|
|
|
frame->hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (frame_handle_start) {
|
2005-11-12 17:07:07 -05:00
|
|
|
frame_handle_start->hide();
|
|
|
|
frame_handle_end->hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2005-11-12 17:07:07 -05:00
|
|
|
vestigial_frame->hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if (frame) {
|
2005-11-12 17:07:07 -05:00
|
|
|
frame->show();
|
2014-02-13 18:16:10 -05:00
|
|
|
frame->set_x1 (pixel_width + RIGHT_EDGE_SHIFT);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (frame_handle_start) {
|
2012-04-30 19:00:15 -04:00
|
|
|
if (pixel_width < (3 * TimeAxisViewItem::GRAB_HANDLE_WIDTH)) {
|
|
|
|
/*
|
|
|
|
* there's less than GRAB_HANDLE_WIDTH of the region between
|
|
|
|
* the right-hand end of frame_handle_start and the left-hand
|
|
|
|
* end of frame_handle_end, so disable the handles
|
|
|
|
*/
|
2013-04-24 15:42:14 -04:00
|
|
|
|
2005-11-12 17:07:07 -05:00
|
|
|
frame_handle_start->hide();
|
|
|
|
frame_handle_end->hide();
|
2012-04-30 19:00:15 -04:00
|
|
|
} else {
|
|
|
|
frame_handle_start->show();
|
2014-02-13 18:16:10 -05:00
|
|
|
frame_handle_end->set_x0 (pixel_width + RIGHT_EDGE_SHIFT - (TimeAxisViewItem::GRAB_HANDLE_WIDTH));
|
|
|
|
frame_handle_end->set_x1 (pixel_width + RIGHT_EDGE_SHIFT);
|
2012-04-30 19:00:15 -04:00
|
|
|
frame_handle_end->show();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-12-29 23:10:54 -05:00
|
|
|
TimeAxisViewItem::manage_name_text ()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2013-12-29 23:10:54 -05:00
|
|
|
int visible_name_width;
|
2009-11-12 15:39:53 -05:00
|
|
|
|
2013-04-15 13:50:05 -04:00
|
|
|
if (!name_text) {
|
2009-11-12 15:39:53 -05:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-12-29 23:10:54 -05:00
|
|
|
if (!wide_enough_for_name || !high_enough_for_name) {
|
|
|
|
name_text->hide ();
|
2009-11-12 15:39:53 -05:00
|
|
|
return;
|
|
|
|
}
|
2013-12-29 23:10:54 -05:00
|
|
|
|
|
|
|
if (name_text->text().empty()) {
|
|
|
|
name_text->hide ();
|
2009-11-12 15:39:53 -05:00
|
|
|
}
|
|
|
|
|
2013-12-29 23:10:54 -05:00
|
|
|
visible_name_width = name_text_width;
|
2012-05-23 19:39:36 -04:00
|
|
|
|
2013-12-29 23:10:54 -05:00
|
|
|
if (visible_name_width > _width - NAME_X_OFFSET) {
|
|
|
|
visible_name_width = _width - NAME_X_OFFSET;
|
2009-12-02 21:22:36 -05:00
|
|
|
}
|
2012-05-23 19:39:36 -04:00
|
|
|
|
2013-12-29 23:10:54 -05:00
|
|
|
if (visible_name_width < 1) {
|
|
|
|
name_text->hide ();
|
|
|
|
} else {
|
|
|
|
name_text->clamp_width (visible_name_width);
|
|
|
|
name_text->show ();
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-04-07 07:03:00 -04:00
|
|
|
* Callback used to remove this time axis item during the gtk idle loop.
|
2005-09-25 14:42:24 -04:00
|
|
|
* This is used to avoid deleting the obejct while inside the remove_this_item
|
2010-04-07 07:03:00 -04:00
|
|
|
* method.
|
2005-09-25 14:42:24 -04:00
|
|
|
*
|
2010-04-07 07:03:00 -04:00
|
|
|
* @param item the TimeAxisViewItem to remove.
|
|
|
|
* @param src the identity of the object that initiated the change.
|
2005-09-25 14:42:24 -04:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
TimeAxisViewItem::idle_remove_this_item(TimeAxisViewItem* item, void* src)
|
|
|
|
{
|
2010-04-07 07:03:00 -04:00
|
|
|
item->ItemRemoved (item->get_item_name(), src); /* EMIT_SIGNAL */
|
2006-04-27 05:04:24 -04:00
|
|
|
delete item;
|
|
|
|
item = 0;
|
|
|
|
return false;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2008-09-10 11:03:30 -04:00
|
|
|
|
2008-12-22 23:11:24 -05:00
|
|
|
void
|
|
|
|
TimeAxisViewItem::set_y (double y)
|
|
|
|
{
|
2013-04-04 00:32:52 -04:00
|
|
|
group->set_y_position (y);
|
2008-12-22 23:11:24 -05:00
|
|
|
}
|
|
|
|
|
2011-02-08 15:01:55 -05:00
|
|
|
void
|
|
|
|
TimeAxisViewItem::parameter_changed (string p)
|
|
|
|
{
|
|
|
|
if (p == "color-regions-using-track-color") {
|
2013-06-28 11:31:26 -04:00
|
|
|
set_colors ();
|
2013-04-16 23:46:22 -04:00
|
|
|
} else if (p == "timeline-item-gradient-depth") {
|
|
|
|
set_frame_gradient ();
|
2011-02-08 15:01:55 -05:00
|
|
|
}
|
|
|
|
}
|