From d3917786501d9142f8c1454c62b3eac7c0bd9f88 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 22 Dec 2005 19:37:03 +0000 Subject: very important fix to avoid double delete of waveview caches, since regionviews own the cache, not the waveview git-svn-id: svn://localhost/trunk/ardour2@203 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/canvas-waveview.c | 2 -- gtk2_ardour/editor.cc | 17 +---------------- gtk2_ardour/editor_imageframe.cc | 16 ---------------- gtk2_ardour/editor_mouse.cc | 4 ---- gtk2_ardour/regionview.cc | 38 +++----------------------------------- 5 files changed, 4 insertions(+), 73 deletions(-) diff --git a/gtk2_ardour/canvas-waveview.c b/gtk2_ardour/canvas-waveview.c index f47529973e..37c13cf4e2 100644 --- a/gtk2_ardour/canvas-waveview.c +++ b/gtk2_ardour/canvas-waveview.c @@ -329,8 +329,6 @@ gnome_canvas_waveview_destroy (GtkObject *object) waveview = GNOME_CANVAS_WAVEVIEW (object); - gnome_canvas_waveview_cache_destroy (waveview->cache); - if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index c8fff1e348..8bb7dd8cc4 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000 Paul Davis + Copyright (C) 2000-2006 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1153,8 +1153,6 @@ Editor::connect_to_session (Session *t) first_action_message->hide(); } - flush_track_canvas(); - update_title (); session->going_away.connect (mem_fun(*this, &Editor::session_going_away)); @@ -2978,19 +2976,6 @@ Editor::commit_reversible_command () } } -void -Editor::flush_track_canvas () -{ - /* I don't think this is necessary, and only causes more problems. - I'm commenting it out - and if the imageframe folks don't have any issues, we can take - out this method entirely - */ - - //gnome_canvas_update_now (GNOME_CANVAS(track_canvas)); - //gtk_main_iteration (); -} - void Editor::set_selected_track_from_click (bool add, bool with_undo, bool no_remove) { diff --git a/gtk2_ardour/editor_imageframe.cc b/gtk2_ardour/editor_imageframe.cc index e9021a7a1c..e922a1e353 100644 --- a/gtk2_ardour/editor_imageframe.cc +++ b/gtk2_ardour/editor_imageframe.cc @@ -633,8 +633,6 @@ Editor::imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) drag_info.motion_callback = &Editor::imageframe_start_handle_trim_motion ; drag_info.finished_callback = &Editor::imageframe_start_handle_end_trim ; - flush_track_canvas() ; - start_grab(event) ; show_verbose_time_cursor(ifv->get_position(), 10) ; @@ -665,8 +663,6 @@ Editor::imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) drag_info.motion_callback = &Editor::imageframe_end_handle_trim_motion ; drag_info.finished_callback = &Editor::imageframe_end_handle_end_trim ; - flush_track_canvas() ; - start_grab(event, trimmer_cursor) ; show_verbose_time_cursor(ifv->get_position() + ifv->get_duration(), 10) ; @@ -760,8 +756,6 @@ Editor::imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* eve ifv->set_position((jack_nframes_t) (temp - drag_info.cumulative_x_drag), this) ; ifv->set_duration((jack_nframes_t) drag_info.cumulative_x_drag, this) ; } - - flush_track_canvas() ; } void @@ -840,8 +834,6 @@ Editor::imageframe_end_handle_end_trim (ArdourCanvas::Item* item, GdkEvent* even ifv->set_duration(new_duration, this) ; } } - - flush_track_canvas (); } @@ -865,8 +857,6 @@ Editor::markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* even drag_info.motion_callback = &Editor::markerview_start_handle_trim_motion ; drag_info.finished_callback = &Editor::markerview_start_handle_end_trim ; - flush_track_canvas() ; - start_grab(event, trimmer_cursor) ; } @@ -889,8 +879,6 @@ Editor::markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) drag_info.motion_callback = &Editor::markerview_end_handle_trim_motion ; drag_info.finished_callback = &Editor::markerview_end_handle_end_trim ; - flush_track_canvas () ; - start_grab(event, trimmer_cursor) ; } @@ -985,8 +973,6 @@ Editor::markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* eve mv->set_position((jack_nframes_t) (temp - drag_info.cumulative_x_drag), this) ; mv->set_duration((jack_nframes_t) drag_info.cumulative_x_drag, this) ; } - - flush_track_canvas() ; } void @@ -1079,8 +1065,6 @@ Editor::markerview_end_handle_end_trim (ArdourCanvas::Item* item, GdkEvent* even jack_nframes_t new_duration = (jack_nframes_t)drag_info.cumulative_x_drag ; mv->set_duration(new_duration, this) ; } - - flush_track_canvas() ; } diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index c9c452ed44..4f93ba65e5 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -3740,8 +3740,6 @@ Editor::start_trim (ArdourCanvas::Item* item, GdkEvent* event) show_verbose_time_cursor(drag_info.current_pointer_frame, 10); break; } - - flush_track_canvas (); } void @@ -3991,8 +3989,6 @@ Editor::trim_finished_callback (ArdourCanvas::Item* item, GdkEvent* event) /* no mouse movement */ point_trim (event); } - - flush_track_canvas (); } void diff --git a/gtk2_ardour/regionview.cc b/gtk2_ardour/regionview.cc index 7e6caad71d..fc21182504 100644 --- a/gtk2_ardour/regionview.cc +++ b/gtk2_ardour/regionview.cc @@ -1001,13 +1001,14 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct) uint32_t nchans = atv.get_diskstream()->n_channels(); uint32_t n; uint32_t nwaves = std::min (nchans, region.n_channels()); - gdouble ht; + if (trackview.height < NAME_HIGHLIGHT_SIZE) { ht = ((trackview.height) / (double) nchans); } else { ht = ((trackview.height - NAME_HIGHLIGHT_SIZE) / (double) nchans); } + gdouble yoff = which * ht; WaveView *wave = new WaveView(*group); @@ -1026,24 +1027,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct) wave->property_amplitude_above_axis() = _amplitude_above_axis; wave->property_wave_color() = region.muted() ? color_map[cMutedWaveForm] : color_map[cWaveForm]; wave->property_region_start() = region.start(); -// WaveView *wave = gnome_canvas_item_new (GNOME_CANVAS_GROUP(group), -// gnome_canvas_waveview_get_type (), -// "data_src", (gpointer) ®ion, -// "cache", wave_caches[which], -// "cache_updater", (gboolean) true, -// "channel", (guint32) which, -// "length_function", (gpointer) region_length_from_c, -// "sourcefile_length_function",(gpointer) sourcefile_length_from_c, -// "peak_function", (gpointer) region_read_peaks_from_c, -// "x", 0.0, -// "y", yoff, -// "height", (double) ht, -// "samples_per_unit", samples_per_unit, -// "amplitude_above_axis", _amplitude_above_axis, -// "wave_color", (guint32) (region.muted() ? color_map[cMutedWaveForm] : color_map[cWaveForm]), -// "region_start",(guint32) region.start(), -// NULL); - + if (!(_flags & WaveformVisible)) { wave->hide(); } @@ -1262,23 +1246,7 @@ AudioRegionView::add_ghost (AutomationTimeAxisView& atv) wave->property_amplitude_above_axis() = _amplitude_above_axis; wave->property_wave_color() = color_map[cGhostTrackWave]; wave->property_region_start() = region.start(); - // WaveView *wave = gnome_canvas_item_new (GNOME_CANVAS_GROUP(ghost->group), - // gnome_canvas_waveview_get_type (), - // "data_src", (gpointer) ®ion, - // "cache", wave_caches[n], - // "cache_updater", (gboolean) false, - // "channel", (guint32) n, - // "length_function", (gpointer) region_length_from_c, - // "sourcefile_length_function",(gpointer) sourcefile_length_from_c, - // "peak_function", (gpointer) region_read_peaks_from_c, - // "x", 0.0, - // "samples_per_unit", samples_per_unit, - // "amplitude_above_axis", _amplitude_above_axis, - // "wave_color", color_map[cGhostTrackWave], - // "region_start", (guint32) region.start(), - // NULL); - ghost->waves.push_back(wave); } -- cgit v1.2.3