#include "ardour/audioregion.h"
#include "ardour/audiosource.h"
#include "ardour/audio_diskstream.h"
+#include "ardour/session.h"
#include "ardour_ui.h"
#include "streamview.h"
#include "i18n.h"
using namespace std;
-using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Editing;
static const int32_t sync_mark_width = 9;
-sigc::signal<void,RegionView*> RegionView::RegionViewGoingAway;
+PBD::Signal1<void,RegionView*> RegionView::RegionViewGoingAway;
RegionView::RegionView (ArdourCanvas::Group* parent,
TimeAxisView& tv,
, wait_for_data(false)
, _time_converter(r->session().tempo_map(), r->position())
{
+ GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
}
RegionView::RegionView (const RegionView& other)
current_visible_sync_position = other.current_visible_sync_position;
valid = false;
_pixel_width = other._pixel_width;
- _height = other._height;
+
+ GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
}
RegionView::RegionView (const RegionView& other, boost::shared_ptr<Region> other_region)
current_visible_sync_position = other.current_visible_sync_position;
valid = false;
_pixel_width = other._pixel_width;
- _height = other._height;
+
+ GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
}
RegionView::RegionView (ArdourCanvas::Group* parent,
editor = 0;
valid = true;
in_destructor = false;
- _height = 0;
wait_for_data = wfd;
sync_mark = 0;
sync_line = 0;
if (name_highlight) {
name_highlight->set_data ("regionview", this);
- name_highlight->signal_event().connect (bind (mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_name_highlight_event), name_highlight, this));
+ name_highlight->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_name_highlight_event), name_highlight, this));
frame_handle_start->set_data ("regionview", this);
- frame_handle_start->signal_event().connect (bind (mem_fun (PublicEditor::instance(), &PublicEditor::canvas_frame_handle_event), frame_handle_start, this));
+ frame_handle_start->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_frame_handle_event), frame_handle_start, this));
frame_handle_end->set_data ("regionview", this);
- frame_handle_end->signal_event().connect (bind (mem_fun (PublicEditor::instance(), &PublicEditor::canvas_frame_handle_event), frame_handle_end, this));
+ frame_handle_end->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_frame_handle_event), frame_handle_end, this));
frame_handle_start->raise_to_top();
frame_handle_end->raise_to_top();
if (name_pixbuf) {
name_pixbuf->set_data ("regionview", this);
+ name_pixbuf->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_name_event), name_pixbuf, this));
}
- if (wfd)
+ if (wfd) {
_enable_display = true;
+ }
set_height (trackview.current_height());
- _region->StateChanged.connect (mem_fun(*this, &RegionView::region_changed));
-
- group->signal_event().connect (bind (mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_event), group, this));
+ _region->PropertyChanged.connect (*this, invalidator (*this), ui_bind (&RegionView::region_changed, this, _1), gui_context());
+
+ group->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_event), group, this));
set_colors ();
- ColorsChanged.connect (mem_fun (*this, &RegionView::color_handler));
+ ColorsChanged.connect (sigc::mem_fun (*this, &RegionView::color_handler));
/* XXX sync mark drag? */
}
}
void
-RegionView::region_changed (Change what_changed)
+RegionView::region_changed (const PropertyChange& what_changed)
{
- ENSURE_GUI_THREAD (bind (mem_fun(*this, &RegionView::region_changed), what_changed));
+ ENSURE_GUI_THREAD (*this, &RegionView::region_changed, what_changed);
- if (what_changed & BoundsChanged) {
+ if (what_changed.contains (ARDOUR::bounds_change)) {
region_resized (what_changed);
region_sync_changed ();
}
- if (what_changed & Region::MuteChanged) {
+ if (what_changed.contains (ARDOUR::Properties::muted)) {
region_muted ();
}
- if (what_changed & Region::OpacityChanged) {
+ if (what_changed.contains (ARDOUR::Properties::opaque)) {
region_opacity ();
}
- if (what_changed & ARDOUR::NameChanged) {
+ if (what_changed.contains (ARDOUR::Properties::name)) {
region_renamed ();
}
- if (what_changed & Region::SyncOffsetChanged) {
+ if (what_changed.contains (ARDOUR::Properties::sync_position)) {
region_sync_changed ();
}
- if (what_changed & Region::LockChanged) {
+ if (what_changed.contains (ARDOUR::Properties::locked)) {
region_locked ();
}
}
}
void
-RegionView::region_resized (Change what_changed)
+RegionView::region_resized (const PropertyChange& what_changed)
{
double unit_length;
- if (what_changed & ARDOUR::PositionChanged) {
+ if (what_changed.contains (ARDOUR::Properties::position)) {
set_position (_region->position(), 0);
_time_converter.set_origin(_region->position());
}
- if (what_changed & Change (StartChanged|LengthChanged)) {
+ PropertyChange s_and_l;
+ s_and_l.add (ARDOUR::Properties::start);
+ s_and_l.add (ARDOUR::Properties::length);
+
+ if (what_changed.contains (s_and_l)) {
set_duration (_region->length(), 0);
set_frame_color ();
}
+void
+RegionView::show_region_editor ()
+{
+ if (editor == 0) {
+ editor = new RegionEditor (trackview.session(), region());
+ }
+
+ editor->present ();
+ editor->show_all();
+}
+
void
RegionView::hide_region_editor()
{