30 #include "canvas/polygon.h"
31 #include "canvas/debug.h"
32 #include "canvas/pixbuf.h"
33 #include "canvas/text.h"
34 #include "canvas/line.h"
35 #include "canvas/utils.h"
36 #include "canvas/colors.h"
81 , current_visible_sync_position(0.0)
83 , _enable_display(false)
85 , in_destructor(false)
86 , wait_for_data(false)
93 :
sigc::trackable(other)
108 :
sigc::trackable(other)
130 uint32_t basic_color,
138 , current_visible_sync_position(0.0)
140 , _enable_display(false)
142 , in_destructor(false)
143 , wait_for_data(false)
180 name_text->set_data (
"regionview",
this);
203 for (vector<GhostRegion*>::iterator g =
ghosts.begin(); g !=
ghosts.end(); ++g) {
233 if (silences.empty()) {
239 for (AudioIntervalResult::const_iterator i = silences.begin(); i != silences.end(); ++i) {
241 ArdourCanvas::Rectangle* cr =
new ArdourCanvas::Rectangle (
group);
242 cr->set_ignore_events (
true);
251 cr->set_outline (
false);
252 cr->set_fill_color (color);
254 shortest = min (shortest, i->second - i->first);
261 for (AudioIntervalResult::const_iterator i = silences.begin(); i != silences.end(); ++i) {
264 shortest_audible = min (shortest_audible, dur);
272 shortest_audible = min (shortest_audible, dur);
292 sunits =
_(
"minutes");
294 }
else if (ms < 1.0) {
301 string text =
string_compose (
ngettext (
"%1 silent segment",
"%1 silent segments", silences.size()), silences.size())
311 aunits =
_(
"minutes");
313 }
else if (ma < 1.0) {
320 text +=
string_compose (
_(
"\n (shortest audible segment = %1 %2)"), ma, aunits);
351 case GDK_BUTTON_RELEASE:
417 if (what_changed.
contains (s_and_l)) {
423 for (vector<GhostRegion*>::iterator i =
ghosts.begin(); i !=
ghosts.end(); ++i) {
425 (*i)->set_duration (unit_length);
478 for (vector<GhostRegion*>::iterator i =
ghosts.begin(); i !=
ghosts.end(); ++i) {
479 (*i)->group->move (ArdourCanvas::Duple (delta, 0.0));
491 for (vector<GhostRegion*>::iterator i =
ghosts.begin(); i !=
ghosts.end(); ++i) {
492 (*i)->set_samples_per_pixel (fpp);
506 for (vector<GhostRegion*>::iterator i =
ghosts.begin(); i !=
ghosts.end(); ++i) {
538 modname =
"opaque region base";
540 modname =
"transparent region base";
589 str = string (
"!") + str;
613 if (sync_offset == 0) {
638 if (sync_offset == 0) {
647 if ((sync_dir < 0) || ((sync_dir > 0) && (sync_offset >
_region->
length()))) {
663 points.push_back (ArdourCanvas::Duple (offset - ((
sync_mark_width-1)/2), 1));
664 points.push_back (ArdourCanvas::Duple (offset + ((
sync_mark_width-1)/2), 1));
666 points.push_back (ArdourCanvas::Duple (offset - ((
sync_mark_width-1)/2), 1));
690 if (item->position().x + x_delta < 0) {
691 x_delta = -item->position().x;
694 item->move (ArdourCanvas::Duple (x_delta, y_delta));
698 for (vector<GhostRegion*>::iterator i =
ghosts.begin(); i !=
ghosts.end(); ++i) {
699 (*i)->group->move (ArdourCanvas::Duple (x_delta, 0.0));
706 for (vector<GhostRegion*>::iterator i =
ghosts.begin(); i !=
ghosts.end(); ++i) {
707 if (&(*i)->trackview == &tv) {
721 for (vector<GhostRegion*>::iterator i =
ghosts.begin(); i !=
ghosts.end(); ++i) {
742 ArdourCanvas::Duple (offset, 0),
748 (*i)->set_y1 (h + 1);
752 (*i)->set_y1 (h + 1);
783 ArdourCanvas::Rectangle* cr = 0;
794 bool const new_me = (pl->top_unmuted_region_at (t) ==
_region);
797 if (cr && me != new_me) {
802 if (cr == 0 || me != new_me) {
803 cr =
new ArdourCanvas::Rectangle (
group);
808 cr->set_outline (
false);
809 cr->set_ignore_events (
true);
813 cr->set_fill_color (non_playing_color);
817 t = pl->find_next_region_boundary (t, 1);
862 bool regions_touching =
false;
864 if (region_left != 0 && (pre_trim_first_frame == region_left->last_frame() + 1)) {
865 regions_touching =
true;
869 if (region_left != 0 && (region_left->last_frame() >
_region->
first_frame() || regions_touching)) {
898 bool regions_touching =
false;
900 if (region_right != 0 && (pre_trim_last_frame == region_right->first_frame() - 1)) {
901 regions_touching =
true;
905 if (region_right != 0 && (region_right->first_frame() <
_region->
last_frame() || regions_touching)) {
958 frame = session_frame;
virtual void resume_property_changes()
ArdourCanvas::Item * get_canvas_group()
ArdourCanvas::Color color(const std::string &, bool *failed=0) const
void set_silent_frames(const ARDOUR::AudioIntervalResult &, double threshold)
virtual void set_height(double h)
static PBD::Signal1< void, RegionView * > RegionViewGoingAway
void trim_front(framepos_t new_position)
void remove_ghost_in(TimeAxisView &)
virtual bool canvas_region_view_name_event(GdkEvent *event, ArdourCanvas::Item *, RegionView *)=0
virtual void region_resized(const PBD::PropertyChange &)
PublicEditor & editor() const
PBD::Signal1< void, const PropertyChange & > PropertyChanged
boost::shared_ptr< ARDOUR::Region > _region
virtual bool canvas_region_view_name_highlight_event(GdkEvent *event, ArdourCanvas::Item *, RegionView *)=0
#define ngettext(Msgid1, Msgid2, N)
virtual bool canvas_frame_handle_event(GdkEvent *event, ArdourCanvas::Item *, RegionView *)=0
Session & session() const
LIBARDOUR_API PBD::PropertyDescriptor< std::string > name
Pango::FontDescription get_font_for_style(std::string widgetname)
ArdourCanvas::Polygon * sync_mark
polgyon for sync position
virtual void color_handler()
void move_start(frameoffset_t distance)
bool _enable_display
see StreamView::redisplay_diskstream()
bool trim_end(framepos_t, bool)
std::list< std::pair< frameoffset_t, frameoffset_t > > AudioIntervalResult
Always round up, even if on a division.
virtual uint32_t get_fill_color() const
Representation of the interface of the Editor class.
void drop_silent_frames()
virtual std::string get_item_name() const
virtual double sample_to_pixel(framepos_t frame) const =0
ArdourCanvas::Text * name_text
ArdourCanvas::Rectangle * name_highlight
std::string make_name() const
virtual void set_samples_per_pixel(double)
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
uint32_t current_height() const
framecnt_t frame_rate() const
#define ENSURE_GUI_THREAD(obj, method,...)
#define UINT_RGBA_CHANGE_A(x, a)
virtual void update_coverage_frames(LayerDisplay)
std::list< ArdourCanvas::Rectangle * > _coverage_frames
bool set_position(framepos_t pos, void *src, double *delta=0)
void trim_end(framepos_t new_position)
void move(double xdelta, double ydelta)
virtual void snap_to(framepos_t &first, ARDOUR::RoundMode direction=ARDOUR::RoundNearest, bool for_mark=false)=0
double current_visible_sync_position
static const int32_t sync_mark_width
bool canvas_group_event(GdkEvent *)
void set_item_name(std::string, void *)
bool video_locked() const
boost::shared_ptr< ARDOUR::Region > region() const
virtual void init(bool wait_for_data)
bool valid
see StreamView::redisplay_diskstream()
virtual bool set_duration(framecnt_t, void *)
ARDOUR::frameoffset_t snap_frame_to_frame(ARDOUR::frameoffset_t) const
bool position_locked() const
ARDOUR::Session * session() const
LIBARDOUR_API PBD::PropertyDescriptor< bool > locked
boost::shared_ptr< ARDOUR::Track > track() const
virtual bool canvas_region_view_event(GdkEvent *event, ArdourCanvas::Item *, RegionView *)=0
virtual void set_frame_color()
virtual void region_renamed()
LIBARDOUR_API PBD::PropertyDescriptor< bool > opaque
virtual void thaw_after_trim()
frameoffset_t sync_offset(int &dir) const
ArdourCanvas::Rectangle * frame_handle_start
`frame' (fade) handle for the start of the item, or 0
static gint _lock_toggle(ArdourCanvas::Item *, GdkEvent *, void *)
uint32_t get_fill_color() const
virtual void region_muted()
virtual void set_sync_mark_color()
void move_contents(ARDOUR::frameoffset_t)
RegionView(ArdourCanvas::Container *parent, TimeAxisView &time_view, boost::shared_ptr< ARDOUR::Region > region, double samples_per_pixel, uint32_t base_color, bool automation=false)
virtual void show_region_editor()
virtual bool set_position(framepos_t, void *, double *delta=0)
virtual void reset_width_dependent_items(double pixel_width)
void set_name_text(const std::string &)
void hide_silent_frames()
framepos_t position() const
void remove_ghost(GhostRegion *)
bool trim_front(framepos_t, bool)
static PublicEditor & instance()
virtual void reset_width_dependent_items(double)
virtual bool set_duration(framecnt_t, void *)
ArdourCanvas::Rectangle * frame
virtual void set_height(double)
ArdourCanvas::Color color_mod(std::string const &color, std::string const &modifier) const
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > position
static UIConfiguration * config()
virtual void set_colors()
LIBARDOUR_API PBD::PropertyDescriptor< framecnt_t > sync_position
std::list< ArdourCanvas::Rectangle * > _silent_frames
std::vector< GhostRegion * > ghosts
virtual void set_samples_per_pixel(double)
sigc::signal< void > ColorsChanged
virtual void region_changed(const PBD::PropertyChange &)
ArdourCanvas::Rectangle * frame_handle_end
`frame' (fade) handle for the end of the item, or 0
ArdourCanvas::Container * group
bool contains(PropertyDescriptor< T > p) const
framecnt_t length() const
static const framepos_t max_framepos
void region_sync_changed()
framepos_t first_frame() const
static const framecnt_t max_framecnt
LIBGTKMM2EXT_API int pixel_width(const std::string &str, Pango::FontDescription &font)
void hide_region_editor()
static PBD::Signal1< void, GhostRegion * > CatchDeletion
ArdourCanvas::Text * _silence_text
LIBARDOUR_API PBD::PropertyDescriptor< bool > muted
ArdourCanvas::Line * sync_line
polgyon for sync position
virtual void set_colors()
LIBARDOUR_API PBD::PropertyChange bounds_change
std::string string_compose(const std::string &fmt, const T1 &o1)
boost::shared_ptr< ARDOUR::Playlist > playlist() const
static double NAME_HIGHLIGHT_SIZE
framepos_t last_frame() const
LIBARDOUR_API PBD::PropertyDescriptor< framecnt_t > length
LIBARDOUR_API PBD::PropertyDescriptor< bool > color