X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftime_axis_view_item.cc;h=a008e2af1a97bf54ef254a1f8eff2eaaf7a23c0c;hb=eeae80e6d95b5abf5b682c92a3f41d20e4b15746;hp=c333a8acb3f97eb0a31e6fcfae9252f206712e90;hpb=be362ae53c1d191e23d8a084d0327044bce4544c;p=ardour.git diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index c333a8acb3..a008e2af1a 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -38,6 +38,7 @@ using namespace std; using namespace Editing; using namespace Glib; +using namespace PBD; //------------------------------------------------------------------------------ /** Initialize const static memeber data */ @@ -67,7 +68,7 @@ double TimeAxisViewItem::NAME_HIGHLIGHT_THRESH; * @param duration the duration of this item */ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color, - jack_nframes_t start, jack_nframes_t duration, + nframes_t start, nframes_t duration, Visibility vis) : trackview (tv) { @@ -101,7 +102,7 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& frame_position = start ; item_duration = duration ; name_connected = false; - fill_opacity = 50; + fill_opacity = 130; position_locked = false ; max_item_duration = ARDOUR::max_frames; min_item_duration = 0 ; @@ -136,8 +137,12 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& uint32_t outline_what = 0x1|0x2|0x4|0x8; - if (visibility & HideFrameLR) { - outline_what &= ~(0x1 | 0x2); + if (visibility & HideFrameLeft) { + outline_what &= ~(0x1); + } + + if (visibility & HideFrameRight) { + outline_what &= ~(0x2); } if (visibility & HideFrameTB) { @@ -237,7 +242,7 @@ TimeAxisViewItem::~TimeAxisViewItem() * @return true if the position change was a success, false otherwise */ bool -TimeAxisViewItem::set_position(jack_nframes_t pos, void* src, double* delta) +TimeAxisViewItem::set_position(nframes_t pos, void* src, double* delta) { if (position_locked) { return false; @@ -277,7 +282,7 @@ TimeAxisViewItem::set_position(jack_nframes_t pos, void* src, double* delta) * * @return the position of this item */ -jack_nframes_t +nframes_t TimeAxisViewItem::get_position() const { return frame_position; @@ -291,7 +296,7 @@ TimeAxisViewItem::get_position() const * @return true if the duration change was succesful, false otherwise */ bool -TimeAxisViewItem::set_duration (jack_nframes_t dur, void* src) +TimeAxisViewItem::set_duration (nframes_t dur, void* src) { if ((dur > max_item_duration) || (dur < min_item_duration)) { warning << string_compose (_("new duration %1 frames is out of bounds for %2"), get_item_name(), dur) @@ -305,9 +310,7 @@ TimeAxisViewItem::set_duration (jack_nframes_t dur, void* src) item_duration = dur; - double pixel_width = trackview.editor.frame_to_pixel (dur); - - reset_width_dependent_items (pixel_width); + reset_width_dependent_items (trackview.editor.frame_to_pixel (dur)); DurationChanged (dur, src) ; /* EMIT_SIGNAL */ return true; @@ -317,7 +320,7 @@ TimeAxisViewItem::set_duration (jack_nframes_t dur, void* src) * Returns the duration of this item * */ -jack_nframes_t +nframes_t TimeAxisViewItem::get_duration() const { return (item_duration); @@ -330,7 +333,7 @@ TimeAxisViewItem::get_duration() const * @param src the identity of the object that initiated the change */ void -TimeAxisViewItem::set_max_duration(jack_nframes_t dur, void* src) +TimeAxisViewItem::set_max_duration(nframes_t dur, void* src) { max_item_duration = dur ; MaxDurationChanged(max_item_duration, src) ; /* EMIT_SIGNAL */ @@ -341,7 +344,7 @@ TimeAxisViewItem::set_max_duration(jack_nframes_t dur, void* src) * * @return the maximum duration that this item may be set to */ -jack_nframes_t +nframes_t TimeAxisViewItem::get_max_duration() const { return (max_item_duration) ; @@ -354,7 +357,7 @@ TimeAxisViewItem::get_max_duration() const * @param src the identity of the object that initiated the change */ void -TimeAxisViewItem::set_min_duration(jack_nframes_t dur, void* src) +TimeAxisViewItem::set_min_duration(nframes_t dur, void* src) { min_item_duration = dur ; MinDurationChanged(max_item_duration, src) ; /* EMIT_SIGNAL */ @@ -365,7 +368,7 @@ TimeAxisViewItem::set_min_duration(jack_nframes_t dur, void* src) * * @return the nimum duration that this item mey be set to */ -jack_nframes_t +nframes_t TimeAxisViewItem::get_min_duration() const { return(min_item_duration) ; @@ -846,7 +849,7 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width) } } else { name_highlight->show(); - if (name_text) { + if (name_text && !get_item_name().empty()) { name_text->show(); reset_name_width (pixel_width); }