Ardour  9.0-pre0-582-g084a23a80d
session_import_dialog.h
Go to the documentation of this file.
1 /*
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>
6  *
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.
11  *
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.
16  *
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.
20  */
21 
22 #pragma once
23 
24 #include <string>
25 #include <list>
26 #include <memory>
27 #include <utility>
28 
29 
30 #include <gtkmm/box.h>
31 #include <gtkmm/button.h>
32 #include <gtkmm/entry.h>
34 #include <gtkmm/frame.h>
35 #include <gtkmm/scrolledwindow.h>
36 #include <gtkmm/treemodel.h>
37 #include <gtkmm/treestore.h>
38 #include <gtkmm/treeview.h>
39 
40 #include "pbd/xml++.h"
41 
42 #include "ardour_dialog.h"
43 namespace ARDOUR {
44  class ElementImportHandler;
45  class ElementImporter;
46  class Session;
47 }
48 
50 {
51 private:
52  typedef std::shared_ptr<ARDOUR::ElementImportHandler> HandlerPtr;
53  typedef std::list<HandlerPtr> HandlerList;
54 
55  typedef std::shared_ptr<ARDOUR::ElementImporter> ElementPtr;
56  typedef std::list<ElementPtr> ElementList;
57 
58 public:
60 
62 
63 private:
64 
65  void load_session (const std::string& filename);
66  void fill_list ();
67  void browse ();
68  void do_merge ();
69  void end_dialog ();
70  void update (std::string path);
72 
73  std::pair<bool, std::string> open_rename_dialog (std::string text, std::string name);
74  bool open_prompt_dialog (std::string text);
75 
76  // Data
79 
80  // GUI
85 
87  {
88  public:
93 
95  };
96 
98  Glib::RefPtr<Gtk::TreeStore> session_tree;
101 
104 
106 };
107 
void add(TreeModelColumnBase &column)
void path(Glib::ustring &path, Glib::ustring &path_reversed)
Compute a widget's path of the form "GtkWindow.MyLabel".
Gtk::ScrolledWindow session_scroll
std::list< HandlerPtr > HandlerList
Glib::RefPtr< Gtk::TreeStore > session_tree
bool open_prompt_dialog(std::string text)
void load_session(const std::string &filename)
virtual Gtk::FileChooserAction browse_action() const
void update(std::string path)
SessionBrowserColumns sb_cols
void show_info(const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *column)
std::list< ElementPtr > ElementList
PBD::ScopedConnectionList connections
std::shared_ptr< ARDOUR::ElementImportHandler > HandlerPtr
std::shared_ptr< ARDOUR::ElementImporter > ElementPtr
SessionImportDialog(ARDOUR::Session *target)
std::pair< bool, std::string > open_rename_dialog(std::string text, std::string name)
Definition: xml++.h:74
FileChooserAction
Definition: filechooser.h:56
@ FILE_CHOOSER_ACTION_OPEN
Definition: filechooser.h:57
GtkImageIconNameData name
Definition: gtkimage.h:6
Gtk::TreeModelColumn< ElementPtr > element
Gtk::TreeModelColumn< std::string > info
Gtk::TreeModelColumn< std::string > name