ensure that non-drag track height changes cause a call to Editor::redisplay_track_views()

This commit is contained in:
Paul Davis 2022-04-05 20:50:44 -06:00
parent d01ad0b4d4
commit a3c5db5d51
12 changed files with 28 additions and 16 deletions

View file

@ -529,13 +529,13 @@ AutomationTimeAxisView::clear_clicked ()
} }
void void
AutomationTimeAxisView::set_height (uint32_t h, TrackHeightMode m) AutomationTimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle)
{ {
bool const changed = (height != (uint32_t) h) || first_call_to_set_height; bool const changed = (height != (uint32_t) h) || first_call_to_set_height;
uint32_t const normal = preset_height (HeightNormal); uint32_t const normal = preset_height (HeightNormal);
bool const changed_between_small_and_normal = ( (height < normal && h >= normal) || (height >= normal || h < normal) ); bool const changed_between_small_and_normal = ( (height < normal && h >= normal) || (height >= normal || h < normal) );
TimeAxisView::set_height (h, m); TimeAxisView::set_height (h, m, from_idle);
_base_rect->set_y1 (h); _base_rect->set_y1 (h);

View file

@ -78,7 +78,7 @@ public:
~AutomationTimeAxisView(); ~AutomationTimeAxisView();
virtual void set_height (uint32_t, TrackHeightMode m = OnlySelf); virtual void set_height (uint32_t, TrackHeightMode m = OnlySelf, bool from_idle = false);
void set_samples_per_pixel (double); void set_samples_per_pixel (double);
std::string name() const { return _name; } std::string name() const { return _name; }
Gdk::Color color () const; Gdk::Color color () const;

View file

@ -7929,6 +7929,12 @@ Editor::set_track_height (Height h)
for (TrackSelection::iterator x = ts.begin(); x != ts.end(); ++x) { for (TrackSelection::iterator x = ts.begin(); x != ts.end(); ++x) {
(*x)->set_height_enum (h); (*x)->set_height_enum (h);
} }
/* when not setting height from a drag, nothing will cause a redisplay
of the non-altered tracks. Do that explicitly.
*/
queue_redisplay_track_views ();
} }
void void

View file

@ -571,7 +571,7 @@ MidiTimeAxisView::update_midi_controls_visibility (uint32_t h)
} }
void void
MidiTimeAxisView::set_height (uint32_t h, TrackHeightMode m) MidiTimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle)
{ {
update_midi_controls_visibility (h); update_midi_controls_visibility (h);
@ -588,7 +588,7 @@ MidiTimeAxisView::set_height (uint32_t h, TrackHeightMode m)
* which needs to know if we have just shown or hidden a scroomer / * which needs to know if we have just shown or hidden a scroomer /
* piano roll. * piano roll.
*/ */
RouteTimeAxisView::set_height (h, m); RouteTimeAxisView::set_height (h, m, from_idle);
} }
void void

View file

@ -85,7 +85,7 @@ public:
MidiStreamView* midi_view(); MidiStreamView* midi_view();
void set_height (uint32_t, TrackHeightMode m = OnlySelf); void set_height (uint32_t, TrackHeightMode m = OnlySelf, bool from_idle = false);
void set_layer_display (LayerDisplay d); void set_layer_display (LayerDisplay d);
boost::shared_ptr<ARDOUR::MidiRegion> add_region (Temporal::timepos_t const &, Temporal::timecnt_t const &, bool); boost::shared_ptr<ARDOUR::MidiRegion> add_region (Temporal::timepos_t const &, Temporal::timecnt_t const &, bool);

View file

@ -550,6 +550,8 @@ public:
virtual bool should_ripple () const = 0; virtual bool should_ripple () const = 0;
virtual void queue_redisplay_track_views () = 0;
/// Singleton instance, set up by Editor::Editor() /// Singleton instance, set up by Editor::Editor()
static PublicEditor* _instance; static PublicEditor* _instance;

View file

@ -959,7 +959,7 @@ RouteTimeAxisView::show_selection (TimeSelection& ts)
} }
void void
RouteTimeAxisView::set_height (uint32_t h, TrackHeightMode m) RouteTimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle)
{ {
int gmlen = h - 9; int gmlen = h - 9;
bool height_changed = (height == 0) || (h != height); bool height_changed = (height == 0) || (h != height);
@ -970,7 +970,7 @@ RouteTimeAxisView::set_height (uint32_t h, TrackHeightMode m)
} }
gm.get_level_meter().setup_meters (gmlen, meter_width); gm.get_level_meter().setup_meters (gmlen, meter_width);
TimeAxisView::set_height (h, m); TimeAxisView::set_height (h, m, from_idle);
if (_view) { if (_view) {
_view->set_height ((double) current_height()); _view->set_height ((double) current_height());

View file

@ -94,7 +94,7 @@ public:
void set_button_names (); void set_button_names ();
void set_samples_per_pixel (double); void set_samples_per_pixel (double);
void set_height (uint32_t h, TrackHeightMode m = OnlySelf); void set_height (uint32_t h, TrackHeightMode m = OnlySelf, bool from_idle = false);
void show_timestretch (Temporal::timepos_t const & start, Temporal::timepos_t const & end, int layers, int layer); void show_timestretch (Temporal::timepos_t const & start, Temporal::timepos_t const & end, int layers, int layer);
void hide_timestretch (); void hide_timestretch ();
void selection_click (GdkEventButton*); void selection_click (GdkEventButton*);

View file

@ -446,10 +446,9 @@ TimeAxisView::controls_ebox_button_press (GdkEventButton* event)
void void
TimeAxisView::idle_resize (int32_t h) TimeAxisView::idle_resize (int32_t h)
{ {
set_height (std::max(0, h)); set_height (std::max(0, h), OnlySelf, true);
} }
bool bool
TimeAxisView::controls_ebox_motion (GdkEventMotion* ev) TimeAxisView::controls_ebox_motion (GdkEventMotion* ev)
{ {
@ -600,7 +599,7 @@ TimeAxisView::set_height_enum (Height h, bool apply_to_selection)
} }
void void
TimeAxisView::set_height (uint32_t h, TrackHeightMode m) TimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle)
{ {
uint32_t lanes = 0; uint32_t lanes = 0;
if (m == TotalHeight) { if (m == TotalHeight) {
@ -637,6 +636,10 @@ TimeAxisView::set_height (uint32_t h, TrackHeightMode m)
} }
_editor.override_visible_track_count (); _editor.override_visible_track_count ();
if (!from_idle) {
_editor.queue_redisplay_track_views ();
}
} }
void void

View file

@ -159,7 +159,7 @@ public:
HeightPerLane HeightPerLane
}; };
virtual void set_height (uint32_t h, TrackHeightMode m = OnlySelf); virtual void set_height (uint32_t h, TrackHeightMode m = OnlySelf, bool from_idle = false);
void set_height_enum (Height, bool apply_to_selection = false); void set_height_enum (Height, bool apply_to_selection = false);
void reset_height(); void reset_height();

View file

@ -354,9 +354,10 @@ VCATimeAxisView::color () const
} }
void void
VCATimeAxisView::set_height (uint32_t h, TrackHeightMode m) VCATimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle)
{ {
TimeAxisView::set_height (h, m); TimeAxisView::set_height (h, m, from_idle);
if (height >= preset_height (HeightNormal)) { if (height >= preset_height (HeightNormal)) {
drop_button.show (); drop_button.show ();
automation_button.show (); automation_button.show ();

View file

@ -51,7 +51,7 @@ public:
Gdk::Color color () const; Gdk::Color color () const;
std::string state_id() const; std::string state_id() const;
void set_height (uint32_t h, TrackHeightMode m = OnlySelf); void set_height (uint32_t h, TrackHeightMode m = OnlySelf, bool from_idle = false);
bool marked_for_display () const; bool marked_for_display () const;
bool set_marked_for_display (bool); bool set_marked_for_display (bool);