Ardour  9.2-541-gc1841a13dd
session_dialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2014-2017 Robin Gareus <robin@gareus.org>
4  * Copyright (C) 2017 Ben Loftis <ben@harrisonconsoles.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef __gtk2_ardour_session_dialog_h__
22 #define __gtk2_ardour_session_dialog_h__
23 
24 #include <string>
25 
26 #include <ydkmm/pixbuf.h>
27 #include <ytkmm/label.h>
28 #include <ytkmm/drawingarea.h>
29 #include <ytkmm/expander.h>
30 #include <ytkmm/box.h>
31 #include <ytkmm/radiobutton.h>
34 #include <ytkmm/scrolledwindow.h>
35 #include <ytkmm/textview.h>
36 #include <ytkmm/treeview.h>
37 #include <ytkmm/treestore.h>
38 #include <ytkmm/checkbutton.h>
39 #include <ytkmm/table.h>
40 #include <ytkmm/frame.h>
41 #include <ytkmm/spinbutton.h>
42 #include <ytkmm/liststore.h>
43 #include <ytkmm/combobox.h>
44 #include <ytkmm/comboboxtext.h>
45 
47 
48 #include "ardour/utils.h"
49 
50 #include "ardour_dialog.h"
51 #include "option_editor.h"
52 
53 class EngineControl;
54 
55 namespace PBD {
56  class Downloader;
57 }
58 
59 namespace ARDOUR {
60  class RemoteResourceInfo;
61 }
62 
64 {
65 public:
66  enum DialogTab
67  {
68  New = 0,
71  Prefs
72  };
73 
74  SessionDialog (DialogTab initial_tab, const std::string& session_name, const std::string& session_path,
75  const std::string& template_name, bool cancel_not_quit);
77 
78  std::string session_name (bool& should_be_new);
79  std::string session_folder ();
80 
82 
83  bool use_session_template() const;
84  std::string session_template_name();
85 
87  void on_show ();
88 
89  void clear_name ();
90  bool was_new_name_edited() const { return new_name_was_edited; }
91 
93  void show_template_context_menu (int button, int time);
95 
96 private:
98 
102 
108 
110 
112 
117 
120 
122 
123  /* initial choice page */
124 
128 
130 
131 #ifdef MIXBUS
132  Gtk::Button _license_button;
133  Gtk::Label _license_label;
134  void license_button_clicked ();
135 #endif
136 
137  /* recent sessions */
138 
140 
142  {
143  bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
144  return ARDOUR::cmp_nocase(a.first, b.first) == -1;
145  }
146  };
147 
150  {
151  add (visible_name);
152  add (tip);
153  add (fullpath);
154  add (sample_rate);
155  add (disk_format);
156  add (modified_with);
157  add (time_modified);
159  }
168  };
169 
172  Glib::RefPtr<Gtk::TreeStore> recent_session_model;
183 
185 
188 
189  /* new sessions */
190 
195 
197 
199 
202  add (name);
203  add (path);
204  add (description);
207  add (removable);
208  }
209 
216  };
217 
219 
220  Glib::RefPtr<Gtk::TreeStore> template_model;
223 
225 
228 
231 
235 
236  void tab_page_switched(GtkNotebookPage*, guint page_number);
237 
238  /* --disable plugins UI */
241 
242  /* meta-template */
243  static uint32_t meta_master_bus_profile (std::string script);
244 
245  /* Demo sessions */
248  add (name);
249  add (size);
250  add (url);
251  add (file);
252  add (downloader);
253  add (downloading);
254  add (progress);
255  add (status);
256  add (description);
257  }
267  };
268 
272  Glib::RefPtr<Gtk::ListStore> demo_model;
281 
292  void set_downloading (bool);
293 
294  /* always there */
295 
296  Glib::RefPtr<Pango::Layout> layout;
297 
299  std::string::size_type info_scroller_count;
301  sigc::connection info_scroller_connection;
303 
305 
306  Glib::RefPtr<Gtk::ActionGroup> action_group;
307  Glib::RefPtr<Gtk::Action> new_session_action;
308  Glib::RefPtr<Gtk::Action> recent_session_action;
309  Glib::RefPtr<Gtk::Action> existing_session_action;
310  Glib::RefPtr<Gtk::Action> demo_session_action;
311 };
312 
313 #endif /* __gtk2_ardour_session_dialog_h__ */
void add(TreeModelColumnBase &column)
void path(Glib::ustring &path, Glib::ustring &path_reversed)
Compute a widget's path of the form "GtkWindow.MyLabel".
Gtk::ComboBoxText timebase_chooser
bool template_button_press(GdkEventButton *)
void set_downloading(bool)
void setup_existing_session_page()
bool new_name_was_edited
Glib::RefPtr< Gtk::ActionGroup > action_group
void recent_session_sort_changed()
void setup_new_session_page()
void add_demo_session(ARDOUR::RemoteResourceInfo const &)
Glib::RefPtr< Gtk::TreeStore > template_model
ArdourWidgets::ArdourButton new_button
void template_row_selected()
bool open_button_pressed(GdkEventButton *)
void clear_name()
sigc::connection info_scroller_connection
std::string session_template_name()
bool name_edited(GdkEventKey *)
void delete_selected_template()
Temporal::TimeDomain session_domain() const
void session_selected()
Gtk::VBox recent_vbox
void recent_row_activated(const Gtk::TreePath &path, Gtk::TreeViewColumn *col)
Glib::RefPtr< Pango::Layout > layout
Gtk::Button * open_button
Gtk::TreeView recent_session_display
void disable_plugins_clicked()
Glib::RefPtr< Gtk::Action > demo_session_action
void recent_context_mennu(GdkEventButton *)
void show_template_context_menu(int button, int time)
RecentSessionModelColumns recent_session_columns
DemoColumns demo_columns
void new_button_choice_action()
void demo_session_selected()
Gtk::TreeView demo_display
Gtk::FileChooserButton new_folder_chooser
std::string session_folder()
Gtk::VBox session_new_vbox
bool prefs_button_pressed(GdkEventButton *)
std::string load_template_override
Gtk::ScrolledWindow demo_scroller
bool deploy_demo_session()
bool demo_dl_timer_callback(PBD::Downloader *, Gtk::TreePath)
Gtk::Button * cancel_button
void tab_page_switched(GtkNotebookPage *, guint page_number)
Gtk::Notebook _tabs
Gtk::TreeView template_chooser
std::string session_name(bool &should_be_new)
Gtk::TextView template_desc
bool cancel_button_pressed(GdkEventButton *)
void demo_name_changed()
Gtk::Table _open_table
void recent_remove_selected()
void populate_session_templates()
Glib::RefPtr< Gtk::Action > recent_session_action
void query_demo_sessions()
bool use_session_template() const
void existing_file_activated()
Gtk::ScrolledWindow recent_scroller
ArdourWidgets::ArdourButton prefs_button
void new_name_activated()
ArdourWidgets::ArdourButton recent_button
void setup_demo_sessions()
Glib::RefPtr< Gtk::TreeStore > recent_session_model
void demo_name_activated()
PBD::ScopedConnection demo_download_connection
Gtk::Frame template_desc_frame
Gtk::TextView demo_description
uint32_t master_channel_count()
bool was_new_name_edited() const
Gtk::Label info_scroller_label
void recent_session_row_selected()
void setup_recent_sessions()
bool info_scroller_update()
void new_name_changed()
void demo_button_choice_action()
void existing_file_selected()
bool demo_button_press(GdkEventButton *)
void setup_existing_box()
ArdourWidgets::ArdourButton demo_button
static uint32_t meta_master_bus_profile(std::string script)
Glib::RefPtr< Gtk::Action > existing_session_action
std::string::size_type info_scroller_count
Gtk::ScrolledWindow template_scroller
Glib::RefPtr< Gtk::Action > new_session_action
Glib::RefPtr< Gtk::ListStore > demo_model
bool on_delete_event(GdkEventAny *)
This is a default handler for the signal signal_delete_event().
bool recent_button_press(GdkEventButton *)
void setup_untitled_session()
void updates_button_clicked()
SessionDialog(DialogTab initial_tab, const std::string &session_name, const std::string &session_path, const std::string &template_name, bool cancel_not_quit)
void on_show()
This is a default handler for the signal signal_show().
Gtk::FileChooserWidget existing_session_chooser
Gtk::FileChooserButton demo_folder_chooser
void existing_button_choice_action()
Gtk::CheckButton _disable_plugins
Gtk::Button * quit_button
bool demo_name_was_edited
void recent_button_choice_action()
Gtk::Entry new_name_entry
Gtk::Label recent_label
int redisplay_recent_sessions()
DialogTab _initial_tab
ArdourWidgets::ArdourButton existing_button
Gtk::VBox demo_vbox
SessionTemplateColumns session_template_columns
Gtk::Entry demo_name_entry
void demo_row_activated(const Gtk::TreePath &path, Gtk::TreeViewColumn *col)
struct _GtkNotebookPage GtkNotebookPage
Definition: gtknotebook.h:58
int cmp_nocase(const std::string &s, const std::string &s2)
Definition: axis_view.h:42
Base class for option editing dialog boxes.
Gtk::TreeModelColumn< std::string > name
Gtk::TreeModelColumn< std::string > size
Gtk::TreeModelColumn< std::string > file
Gtk::TreeModelColumn< std::string > description
Gtk::TreeModelColumn< int > progress
Gtk::TreeModelColumn< bool > downloading
Gtk::TreeModelColumn< int > status
Gtk::TreeModelColumn< PBD::Downloader * > downloader
Gtk::TreeModelColumn< std::string > url
Gtk::TreeModelColumn< std::string > fullpath
Gtk::TreeModelColumn< std::string > tip
Gtk::TreeModelColumn< std::string > sample_rate
Gtk::TreeModelColumn< std::string > disk_format
Gtk::TreeModelColumn< std::string > visible_name
Gtk::TreeModelColumn< int64_t > time_modified
Gtk::TreeModelColumn< std::string > time_formatted
Gtk::TreeModelColumn< std::string > modified_with
bool operator()(std::pair< std::string, std::string > a, std::pair< std::string, std::string > b) const
Gtk::TreeModelColumn< bool > removable
Gtk::TreeModelColumn< std::string > modified_with_short
Gtk::TreeModelColumn< std::string > description
Gtk::TreeModelColumn< std::string > name
Gtk::TreeModelColumn< std::string > path
Gtk::TreeModelColumn< std::string > modified_with_long