From 989d6b3d2a2c1d1132ef3e77f1acfac3593ee701 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 22 Feb 2007 18:26:44 +0000 Subject: [PATCH] don't change waveform zoom level when waveform is hidden, to save peak reloads, remove unused Editor signal git-svn-id: svn://localhost/ardour2/trunk@1487 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/audio_region_view.cc | 11 +++++++++-- gtk2_ardour/automation_line.cc | 1 + gtk2_ardour/canvas-waveview.c | 5 +++-- gtk2_ardour/editor.cc | 2 -- gtk2_ardour/editor_audiotrack.cc | 2 -- gtk2_ardour/editor_canvas.cc | 1 + gtk2_ardour/public_editor.h | 1 - 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index ba5b9a1ce1..270373a26f 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -607,13 +607,16 @@ AudioRegionView::set_samples_per_unit (gdouble spu) { RegionView::set_samples_per_unit (spu); - for (uint32_t n=0; n < waves.size(); ++n) { - waves[n]->property_samples_per_unit() = spu; + if (_flags & WaveformVisible) { + for (uint32_t n=0; n < waves.size(); ++n) { + waves[n]->property_samples_per_unit() = spu; + } } if (gain_line) { gain_line->reset (); } + reset_fade_shapes (); } @@ -676,6 +679,10 @@ AudioRegionView::set_waveform_visible (bool yn) if (((_flags & WaveformVisible) != yn)) { if (yn) { for (uint32_t n=0; n < waves.size(); ++n) { + /* make sure the zoom level is correct, since we don't update + this when waveforms are hidden. + */ + waves[n]->property_samples_per_unit() = samples_per_unit; waves[n]->show(); } _flags |= WaveformVisible; diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 5598689855..2a9753508a 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -25,6 +25,7 @@ #include #include +#include #include #include diff --git a/gtk2_ardour/canvas-waveview.c b/gtk2_ardour/canvas-waveview.c index 747761ea9a..c8e9f61332 100644 --- a/gtk2_ardour/canvas-waveview.c +++ b/gtk2_ardour/canvas-waveview.c @@ -369,7 +369,8 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_ end_sample = end_sample + waveview->region_start; #if DEBUG_CACHE // printf("waveview->region_start == %lu\n",waveview->region_start); - printf ("=> 0x%x cache @ 0x%x range: %lu - %lu request: %lu - %lu (%lu frames)\n", + // c_stacktrace (); + printf ("\n\n=> 0x%x cache @ 0x%x range: %lu - %lu request: %lu - %lu (%lu frames)\n", waveview, cache, cache->start, cache->end, start_sample, end_sample, end_sample - start_sample); @@ -413,7 +414,7 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_ } #if DEBUG_CACHE - fprintf (stderr, "\n\nAVAILABLE FRAMES = %lu of %lu, start = %lu, sstart = %lu, cstart = %lu\n", + fprintf (stderr, "AVAILABLE FRAMES = %lu of %lu, start = %lu, sstart = %lu, cstart = %lu\n", rf3, waveview->sourcefile_length_function (waveview->data_src, waveview->samples_per_unit), waveview->region_start, start_sample, new_cache_start); #endif diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index cf0a5baabf..1e01e3e243 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -3181,7 +3181,6 @@ Editor::set_show_measures (bool yn) if ((_show_measures = yn) == true) { draw_measures (); } - DisplayControlChanged (ShowMeasures); instant_save (); } } @@ -3204,7 +3203,6 @@ Editor::set_follow_playhead (bool yn) /* catch up */ update_current_screen (); } - DisplayControlChanged (FollowPlayhead); instant_save (); } } diff --git a/gtk2_ardour/editor_audiotrack.cc b/gtk2_ardour/editor_audiotrack.cc index af442dc435..eebf1c61bc 100644 --- a/gtk2_ardour/editor_audiotrack.cc +++ b/gtk2_ardour/editor_audiotrack.cc @@ -45,7 +45,6 @@ Editor::set_show_waveforms (bool yn) atv->set_show_waveforms (yn); } } - DisplayControlChanged (Editing::ShowWaveforms); } } @@ -61,6 +60,5 @@ Editor::set_show_waveforms_recording (bool yn) atv->set_show_waveforms_recording (yn); } } - DisplayControlChanged (Editing::ShowWaveformsRecording); } } diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 6c3ab9e217..5da90cf37c 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -713,6 +713,7 @@ Editor::canvas_horizontally_scrolled () nframes_t rightmost_frame = leftmost_frame + current_page_frames (); if (rightmost_frame > last_canvas_frame) { + cerr << "right most = " << rightmost_frame << " last = " << last_canvas_frame << endl; last_canvas_frame = rightmost_frame; reset_scrolling_region (); } diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 0c3ae76502..ae87290c73 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -135,7 +135,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway virtual void maximise_editing_space() = 0; virtual void restore_editing_space() = 0; - sigc::signal DisplayControlChanged; sigc::signal ZoomFocusChanged; sigc::signal ZoomChanged; sigc::signal Resized;