Ardour  9.0-rc1-21-gd5464b39db
strip_import_dialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2025 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #pragma once
20 #include <string>
21 
22 #include <ytkmm/box.h>
24 #include <ytkmm/liststore.h>
25 #include <ytkmm/notebook.h>
26 #include <ytkmm/scrolledwindow.h>
27 #include <ytkmm/table.h>
28 #include <ytkmm/treestore.h>
29 #include <ytkmm/treeview.h>
30 
31 #include "pbd/id.h"
32 
33 #include "ardour/search_paths.h"
34 #include "ardour/session.h"
35 
36 #include "ardour/template_utils.h"
37 #include "ardour_dialog.h"
38 
39 namespace ArdourWidgets
40 {
41  class ArdourButton;
42  class ArdourDropdown;
43 }
44 
46 {
47 public:
50 
51 private:
55  Snapshot
56  };
57 
58  void page_changed (GtkNotebookPage*, guint);
59  void setup_file_page ();
62  void parse_route_state (std::string const&);
63  void setup_model (Glib::RefPtr<Gtk::ListStore>, std::vector<ARDOUR::TemplateInfo> const&);
64  void find_presets (PBD::Searchpath const&, std::vector<ARDOUR::TemplateInfo>&);
65 
70  void add_mapping ();
71  void change_mapping (ArdourWidgets::ArdourDropdown*, PBD::ID const&, PBD::ID const&, std::string const&);
72  void prepare_mapping (bool, PBD::ID const&, std::string const&);
73  void remove_mapping (PBD::ID const&);
74  void clear_mapping ();
76  void set_default_mapping (bool and_idle_update);
78  void ok_activated ();
79 
82  {
83  add (name);
84  add (path);
85  }
86 
89  };
90 
92  Glib::RefPtr<Gtk::TreeStore> _recent_model;
93  Glib::RefPtr<Gtk::ListStore> _template_model;
94  Glib::RefPtr<Gtk::ListStore> _local_pset_model;
95  Glib::RefPtr<Gtk::ListStore> _global_pset_model;
96 
97  std::map<guint, Gtk::TreeView*> _notebook_content;
98  std::map<guint, SelectionType> _notebook_type;
99 
102 
116 
124 
126  std::string _path;
127  std::map<PBD::ID, PBD::ID> _import_map;
128 
129  std::map<PBD::ID, ARDOUR::Session::RouteImportInfo> _extern_map;
130  std::map<PBD::ID, ARDOUR::Session::RouteImportInfo> _route_map;
131 
134 
135  sigc::connection _notebook_connection;
136  sigc::connection _chooser_connection;
137 };
void add(TreeModelColumnBase &column)
Definition: id.h:34
void refill_import_table()
Gtk::ScrolledWindow _strip_scroller
void setup_strip_import_page()
void idle_refill_import_table()
Gtk::TreeView _recent_treeview
Glib::RefPtr< Gtk::ListStore > _template_model
std::map< PBD::ID, PBD::ID > _import_map
void remove_mapping(PBD::ID const &)
sigc::connection _notebook_connection
Gtk::ScrolledWindow _global_pset_scroller
Gtk::ScrolledWindow _recent_scroller
Gtk::Button * _open_button
Glib::RefPtr< Gtk::ListStore > _local_pset_model
Glib::RefPtr< Gtk::ListStore > _global_pset_model
std::map< PBD::ID, ARDOUR::Session::RouteImportInfo > _route_map
void file_selection_changed()
void import_all_strips()
ArdourWidgets::ArdourDropdown * _action
StripImportDialog(ARDOUR::Session *)
std::map< guint, SelectionType > _notebook_type
Gtk::TreeView _global_pset_treeview
void prepare_mapping(bool, PBD::ID const &, std::string const &)
std::map< guint, Gtk::TreeView * > _notebook_content
ArdourWidgets::ArdourDropdown * _add_eid_dropdown
void setup_model(Glib::RefPtr< Gtk::ListStore >, std::vector< ARDOUR::TemplateInfo > const &)
std::map< PBD::ID, ARDOUR::Session::RouteImportInfo > _extern_map
void page_changed(GtkNotebookPage *, guint)
Gtk::TreeView _template_treeview
Gtk::ScrolledWindow _template_scroller
ArdourWidgets::ArdourDropdown * _add_rid_dropdown
ArdourWidgets::ArdourButton * _show_all_toggle
void set_default_mapping(bool and_idle_update)
void change_mapping(ArdourWidgets::ArdourDropdown *, PBD::ID const &, PBD::ID const &, std::string const &)
void maybe_switch_to_import_page()
Gtk::TreeView _local_pset_treeview
void update_sensitivity_ok()
Gtk::ScrolledWindow _local_pset_scroller
SessionTemplateColumns _columns
sigc::connection _chooser_connection
void parse_route_state(std::string const &)
ArdourWidgets::ArdourButton * _add_new_mapping
Glib::RefPtr< Gtk::TreeStore > _recent_model
Gtk::Button * _ok_button
Gtk::FileChooserWidget _chooser
void find_presets(PBD::Searchpath const &, std::vector< ARDOUR::TemplateInfo > &)
void treeview_selection_changed(Gtk::TreeView *, SelectionType)
struct _GtkNotebookPage GtkNotebookPage
Definition: gtknotebook.h:58
Gtk::TreeModelColumn< std::string > name
Gtk::TreeModelColumn< std::string > path