From f6fdd8dcbf41f864e9f0cc32dabe81fe3533ddfe Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 17 Dec 2009 18:24:23 +0000 Subject: switch to using boost::signals2 instead of sigc++, at least for libardour. not finished yet, but compiles, loads sessions, records and can close a session without a crash git-svn-id: svn://localhost/ardour2/branches/3.0@6372 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/session_import_dialog.cc | 43 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'gtk2_ardour/session_import_dialog.cc') diff --git a/gtk2_ardour/session_import_dialog.cc b/gtk2_ardour/session_import_dialog.cc index 5511a0d68f..4b5793271b 100644 --- a/gtk2_ardour/session_import_dialog.cc +++ b/gtk2_ardour/session_import_dialog.cc @@ -36,11 +36,12 @@ using namespace std; using namespace ARDOUR; -SessionImportDialog::SessionImportDialog (ARDOUR::Session & target) : +SessionImportDialog::SessionImportDialog (ARDOUR::Session* target) : ArdourDialog (_("Import from session")), - target (target), file_browse_button (_("Browse")) { + set_session (target); + // File entry file_entry.set_name ("ImportFileNameEntry"); file_entry.set_text ("/"); @@ -101,24 +102,26 @@ SessionImportDialog::SessionImportDialog (ARDOUR::Session & target) : void SessionImportDialog::load_session (const string& filename) { - tree.read (filename); - boost::shared_ptr region_handler (new AudioRegionImportHandler (tree, target)); - boost::shared_ptr pl_handler (new AudioPlaylistImportHandler (tree, target, *region_handler)); - - handlers.push_back (boost::static_pointer_cast (region_handler)); - handlers.push_back (boost::static_pointer_cast (pl_handler)); - handlers.push_back (HandlerPtr(new UnusedAudioPlaylistImportHandler (tree, target, *region_handler))); - handlers.push_back (HandlerPtr(new AudioTrackImportHandler (tree, target, *pl_handler))); - handlers.push_back (HandlerPtr(new LocationImportHandler (tree, target))); - handlers.push_back (HandlerPtr(new TempoMapImportHandler (tree, target))); - - fill_list(); - - if (ElementImportHandler::dirty()) { - // Warn user - string txt = _("Some elements had errors in them. Please see the log for details"); - Gtk::MessageDialog msg (txt, false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, true); - msg.run(); + if (_session) { + tree.read (filename); + boost::shared_ptr region_handler (new AudioRegionImportHandler (tree, *_session)); + boost::shared_ptr pl_handler (new AudioPlaylistImportHandler (tree, *_session, *region_handler)); + + handlers.push_back (boost::static_pointer_cast (region_handler)); + handlers.push_back (boost::static_pointer_cast (pl_handler)); + handlers.push_back (HandlerPtr(new UnusedAudioPlaylistImportHandler (tree, *_session, *region_handler))); + handlers.push_back (HandlerPtr(new AudioTrackImportHandler (tree, *_session, *pl_handler))); + handlers.push_back (HandlerPtr(new LocationImportHandler (tree, *_session))); + handlers.push_back (HandlerPtr(new TempoMapImportHandler (tree, *_session))); + + fill_list(); + + if (ElementImportHandler::dirty()) { + // Warn user + string txt = _("Some elements had errors in them. Please see the log for details"); + Gtk::MessageDialog msg (txt, false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, true); + msg.run(); + } } } -- cgit v1.2.3