using namespace Editing;
void
-Editor::handle_audio_region_removed (boost::shared_ptr<AudioRegion> region)
+Editor::handle_audio_region_removed (boost::weak_ptr<AudioRegion> wregion)
{
- ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::handle_audio_region_removed), region));
+ ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::handle_audio_region_removed), wregion));
redisplay_regions ();
}
void
-Editor::handle_new_audio_region (boost::shared_ptr<AudioRegion> region)
+Editor::handle_new_audio_region (boost::weak_ptr<AudioRegion> wregion)
{
- ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::handle_new_audio_region), region));
+ ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::handle_new_audio_region), wregion));
/* don't copy region - the one we are being notified
about belongs to the session, and so it will
never be edited.
*/
- add_audio_region_to_region_display (region);
+
+ boost::shared_ptr<AudioRegion> region (wregion.lock());
+
+ if (region) {
+ add_audio_region_to_region_display (region);
+ }
}
void
for (list<boost::shared_ptr<AudioRegion> >::iterator r = tmp_audio_region_list.begin(); r != tmp_audio_region_list.end(); ++r) {
add_audio_region_to_region_display (*r);
}
+ tmp_audio_region_list.clear();
region_list_display.set_model (region_list_model);
}
vector<ustring> paths;
if (convert_drop_to_paths (paths, context, x, y, data, info, time) == 0) {
- jack_nframes_t pos = 0;
+ nframes_t pos = 0;
do_embed (paths, false, ImportAsRegion, 0, pos, true);
context->drag_finish (true, false, time);
}