2 * Copyright (C) 2008-2009 Sakari Bergen <sakari.bergen@beatwaves.net>
3 * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
4 * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
5 * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef __session_import_dialog_h__
23 #define __session_import_dialog_h__
29 #include <boost/shared_ptr.hpp>
31 #include <gtkmm/box.h>
32 #include <gtkmm/button.h>
33 #include <gtkmm/entry.h>
34 #include <gtkmm/filechooserdialog.h>
35 #include <gtkmm/frame.h>
36 #include <gtkmm/scrolledwindow.h>
37 #include <gtkmm/treemodel.h>
38 #include <gtkmm/treestore.h>
39 #include <gtkmm/treeview.h>
41 #include "pbd/xml++.h"
43 #include "ardour_dialog.h"
45 class ElementImportHandler;
46 class ElementImporter;
50 class SessionImportDialog : public ArdourDialog
53 typedef boost::shared_ptr<ARDOUR::ElementImportHandler> HandlerPtr;
54 typedef std::list<HandlerPtr> HandlerList;
56 typedef boost::shared_ptr<ARDOUR::ElementImporter> ElementPtr;
57 typedef std::list<ElementPtr> ElementList;
60 SessionImportDialog (ARDOUR::Session* target);
62 virtual Gtk::FileChooserAction browse_action() const { return Gtk::FILE_CHOOSER_ACTION_OPEN; }
66 void load_session (const std::string& filename);
71 void update (std::string path);
72 void show_info(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column);
74 std::pair<bool, std::string> open_rename_dialog (std::string text, std::string name);
75 bool open_prompt_dialog (std::string text);
82 Gtk::Frame file_frame;
84 Gtk::Entry file_entry;
85 Gtk::Button file_browse_button;
87 struct SessionBrowserColumns : public Gtk::TreeModel::ColumnRecord
90 Gtk::TreeModelColumn<std::string> name;
91 Gtk::TreeModelColumn<bool> queued;
92 Gtk::TreeModelColumn<ElementPtr> element;
93 Gtk::TreeModelColumn<std::string> info;
95 SessionBrowserColumns() { add (name); add (queued); add (element); add (info); }
98 SessionBrowserColumns sb_cols;
99 Glib::RefPtr<Gtk::TreeStore> session_tree;
100 Gtk::TreeView session_browser;
101 Gtk::ScrolledWindow session_scroll;
103 Gtk::Button* ok_button;
104 Gtk::Button* cancel_button;
106 PBD::ScopedConnectionList connections;