very important fix to avoid double delete of waveview caches, since regionviews own...
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 22 Dec 2005 19:37:03 +0000 (19:37 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 22 Dec 2005 19:37:03 +0000 (19:37 +0000)
git-svn-id: svn://localhost/trunk/ardour2@203 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/canvas-waveview.c
gtk2_ardour/editor.cc
gtk2_ardour/editor_imageframe.cc
gtk2_ardour/editor_mouse.cc
gtk2_ardour/regionview.cc

index f47529973ec828e34d9a9f5d615be83199bb0ada..37c13cf4e2c49aafc8f15536ecc723e080c57296 100644 (file)
@@ -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);
 }
index c8fff1e348d0b452016d957ac96fe8736cdce44a..8bb7dd8cc4dbb1752a6f45b09ab934181c107595 100644 (file)
@@ -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)
 {
index e9021a7a1c2ce09d61c6412d5e47bf7224f096cf..e922a1e353175b86a2651ca67a913e1c2ed9430f 100644 (file)
@@ -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() ;
 }
 
 
index c9c452ed443e2cf93c98700d2879a674b90a2554..4f93ba65e5b05d36d737ddd93ef79eb45f117903 100644 (file)
@@ -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
index 7e6caad71d8de12179fea3a8e62817c5ed165c40..fc211825041f61cba352831230819b1463ac87bd 100644 (file)
@@ -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) &region,
-//                                                "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) &region,
-               //                                                         "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);
        }