fade_out_shape->set_data ("regionview", this);
if (!_recregion) {
- uint32_t r,g,b,a;
- UINT_TO_RGBA(fill_color,&r,&g,&b,&a);
-
fade_in_handle = new ArdourCanvas::SimpleRect (*group);
- fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,0);
+ fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, 0);
fade_in_handle->property_outline_pixels() = 0;
fade_in_handle->set_data ("regionview", this);
fade_out_handle = new ArdourCanvas::SimpleRect (*group);
- fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,0);
+ fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, 0);
fade_out_handle->property_outline_pixels() = 0;
fade_out_handle->set_data ("regionview", this);
AudioRegionView::region_changed (const PropertyChange& what_changed)
{
ENSURE_GUI_THREAD (*this, &AudioRegionView::region_changed, what_changed);
- // cerr << "AudioRegionView::region_changed() called" << endl;
+ // cerr << "AudioRegionView::region_changed() called" << endl;
RegionView::region_changed (what_changed);
region_scale_amplitude_changed ();
}
if (what_changed.contains (ARDOUR::Properties::fade_in)) {
- fade_in_changed ();
+ fade_in_changed ();
}
if (what_changed.contains (ARDOUR::Properties::fade_out)) {
fade_out_changed ();
void
AudioRegionView::reset_fade_in_shape ()
{
- reset_fade_in_shape_width ((nframes_t) audio_region()->fade_in()->back()->when);
+ reset_fade_in_shape_width ((framecnt_t) audio_region()->fade_in()->back()->when);
}
void
-AudioRegionView::reset_fade_in_shape_width (nframes_t width)
+AudioRegionView::reset_fade_in_shape_width (framecnt_t width)
{
if (fade_in_handle == 0) {
return;
/* smallest size for a fade is 64 frames */
- width = std::max ((nframes_t) 64, width);
+ width = std::max ((framecnt_t) 64, width);
Points* points;
void
AudioRegionView::reset_fade_out_shape ()
{
- reset_fade_out_shape_width ((nframes_t) audio_region()->fade_out()->back()->when);
+ reset_fade_out_shape_width ((framecnt_t) audio_region()->fade_out()->back()->when);
}
void
-AudioRegionView::reset_fade_out_shape_width (nframes_t width)
+AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
{
if (fade_out_handle == 0) {
return;
/* smallest size for a fade is 64 frames */
- width = std::max ((nframes_t) 64, width);
+ width = std::max ((framecnt_t) 64, width);
Points* points;
double pwidth = width / samples_per_unit;
{
RegionView::compute_colors (basic_color);
- uint32_t r, g, b, a;
-
/* gain color computed in envelope_active_changed() */
- UINT_TO_RGBA (fill_color, &r, &g, &b, &a);
- fade_color = RGBA_TO_UINT(r,g,b,120);
+ fade_color = UINT_RGBA_CHANGE_A (fill_color, 120);
}
void
item->w2i (x, y);
- nframes_t fx = trackview.editor().pixel_to_frame (x);
+ framepos_t fx = trackview.editor().pixel_to_frame (x);
if (fx > _region->length()) {
return;
gain_line->view_to_model_coord (x, y);
- /* XXX STATEFUL: can't convert to stateful diff until we
- can represent automation data with it.
- */
+ /* XXX STATEFUL: can't convert to stateful diff until we
+ can represent automation data with it.
+ */
trackview.session()->begin_reversible_command (_("add gain control point"));
XMLNode &before = audio_region()->envelope()->get_state();
void
AudioRegionView::entered (bool internal_editing)
{
- trackview.editor().set_current_trimmable (_region);
- trackview.editor().set_current_movable (_region);
+ trackview.editor().set_current_trimmable (_region);
+ trackview.editor().set_current_movable (_region);
if (gain_line && _flags & EnvelopeVisible) {
gain_line->show_all_control_points ();
}
- uint32_t r,g,b,a;
- UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
- a=255;
-
if (fade_in_handle && !internal_editing) {
- fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
- fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
+ fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 255);
+ fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 255);
}
}
void
AudioRegionView::exited ()
{
- trackview.editor().set_current_trimmable (boost::shared_ptr<Trimmable>());
- trackview.editor().set_current_movable (boost::shared_ptr<Movable>());
+ trackview.editor().set_current_trimmable (boost::shared_ptr<Trimmable>());
+ trackview.editor().set_current_movable (boost::shared_ptr<Movable>());
if (gain_line) {
gain_line->hide_all_but_selected_control_points ();
}
- uint32_t r,g,b,a;
- UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
- a=0;
-
if (fade_in_handle) {
- fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
- fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
+ fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 0);
+ fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 0);
}
}
fill_opacity = 0;
}
- uint32_t r,g,b,a;
-
if (_selected && should_show_selection) {
- UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get(), &r, &g, &b, &a);
- frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, fill_opacity ? fill_opacity : a);
+ if (fill_opacity) {
+ frame->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get(), fill_opacity);
+ } else {
+ frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get();
+ }
for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
if (_region->muted()) {
}
} else {
if (_recregion) {
- UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_RecordingRect.get(), &r, &g, &b, &a);
- frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, a);
+ frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
if (_region->muted()) {
}
}
} else {
- UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_FrameBase.get(), &r, &g, &b, &a);
- frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, fill_opacity ? fill_opacity : a);
+ if (fill_opacity) {
+ frame->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_FrameBase.get(), fill_opacity);
+ } else {
+ frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameBase.get();
+ }
for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
if (_region->muted()) {
}
}
}
+
+void
+AudioRegionView::thaw_after_trim ()
+{
+ RegionView::thaw_after_trim ();
+
+ unhide_envelope ();
+}