2 Copyright (C) 2008 Paul Davis
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __session_import_dialog_h__
22 #define __session_import_dialog_h__
28 #include <boost/shared_ptr.hpp>
31 #include "pbd/xml++.h"
33 #include "ardour_dialog.h"
35 class ElementImportHandler;
36 class ElementImporter;
40 class SessionImportDialog : public ArdourDialog
43 typedef boost::shared_ptr<ARDOUR::ElementImportHandler> HandlerPtr;
44 typedef std::list<HandlerPtr> HandlerList;
46 typedef boost::shared_ptr<ARDOUR::ElementImporter> ElementPtr;
47 typedef std::list<ElementPtr> ElementList;
50 SessionImportDialog (ARDOUR::Session* target);
52 virtual Gtk::FileChooserAction browse_action() const { return Gtk::FILE_CHOOSER_ACTION_OPEN; }
56 void load_session (const std::string& filename);
61 void update (std::string path);
62 void show_info(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column);
64 std::pair<bool, std::string> open_rename_dialog (std::string text, std::string name);
65 bool open_prompt_dialog (std::string text);
72 Gtk::Frame file_frame;
74 Gtk::Entry file_entry;
75 Gtk::Button file_browse_button;
77 struct SessionBrowserColumns : public Gtk::TreeModel::ColumnRecord
80 Gtk::TreeModelColumn<std::string> name;
81 Gtk::TreeModelColumn<bool> queued;
82 Gtk::TreeModelColumn<ElementPtr> element;
83 Gtk::TreeModelColumn<std::string> info;
85 SessionBrowserColumns() { add (name); add (queued); add (element); add (info); }
88 SessionBrowserColumns sb_cols;
89 Glib::RefPtr<Gtk::TreeStore> session_tree;
90 Gtk::TreeView session_browser;
91 Gtk::ScrolledWindow session_scroll;
93 Gtk::Button* ok_button;
94 Gtk::Button* cancel_button;
96 PBD::ScopedConnectionList connections;