Ardour  9.0-18-g01809b426c
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/progressbar.h>
27 #include <ytkmm/scrolledwindow.h>
28 #include <ytkmm/table.h>
29 #include <ytkmm/treestore.h>
30 #include <ytkmm/treeview.h>
31 
32 #include "pbd/id.h"
33 
34 #include "ardour/search_paths.h"
35 #include "ardour/session.h"
36 
37 #include "ardour/template_utils.h"
38 #include "ardour_dialog.h"
39 #include "progress_reporter.h"
40 
41 namespace ArdourWidgets
42 {
43  class ArdourButton;
44  class ArdourDropdown;
45 }
46 
48 {
49 public:
52 
53  void do_import ();
54 
55 protected:
56  void on_response (int);
57 
58 private:
62  Snapshot
63  };
64 
65  void page_changed (GtkNotebookPage*, guint);
66  void setup_file_page ();
69  void parse_route_state (std::string const&);
70  void setup_model (Glib::RefPtr<Gtk::ListStore>, std::vector<ARDOUR::TemplateInfo> const&);
71  void find_presets (PBD::Searchpath const&, std::vector<ARDOUR::TemplateInfo>&);
72 
77  void add_mapping ();
78  void change_mapping (ArdourWidgets::ArdourDropdown*, PBD::ID const&, PBD::ID const&, std::string const&);
79  void prepare_mapping (bool, PBD::ID const&, std::string const&);
80  void remove_mapping (PBD::ID const&);
81  void clear_mapping ();
82  void import_all_strips (bool only_visible);
83  void set_default_mapping (bool and_idle_update);
85  void ok_activated ();
86  void update_progress_gui (float);
87 
90  {
91  add (name);
92  add (path);
93  }
94 
97  };
98 
100  Glib::RefPtr<Gtk::TreeStore> _recent_model;
101  Glib::RefPtr<Gtk::ListStore> _template_model;
102  Glib::RefPtr<Gtk::ListStore> _local_pset_model;
103  Glib::RefPtr<Gtk::ListStore> _global_pset_model;
104 
105  std::map<guint, Gtk::TreeView*> _notebook_content;
106  std::map<guint, SelectionType> _notebook_type;
107 
110 
125 
133 
136 
138  std::string _path;
139  std::map<PBD::ID, PBD::ID> _import_map;
140 
141  std::map<PBD::ID, ARDOUR::Session::RouteImportInfo> _extern_map;
142  std::map<PBD::ID, ARDOUR::Session::RouteImportInfo> _route_map;
143 
146 
147  sigc::connection _notebook_connection;
148  sigc::connection _chooser_connection;
149 };
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()
void update_progress_gui(float)
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::Button * _cancel_button
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()
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
void on_response(int)
This is a default handler for the signal signal_response().
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
Gtk::ProgressBar _progress_bar
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
void import_all_strips(bool only_visible)
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