Ardour  9.0-pre0-582-g084a23a80d
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 <gdkmm/pixbuf.h>
27 #include <gtkmm/label.h>
28 #include <gtkmm/drawingarea.h>
29 #include <gtkmm/expander.h>
30 #include <gtkmm/box.h>
31 #include <gtkmm/radiobutton.h>
33 #include <gtkmm/scrolledwindow.h>
34 #include <gtkmm/textview.h>
35 #include <gtkmm/treeview.h>
36 #include <gtkmm/treestore.h>
37 #include <gtkmm/checkbutton.h>
38 #include <gtkmm/table.h>
39 #include <gtkmm/frame.h>
40 #include <gtkmm/spinbutton.h>
41 #include <gtkmm/liststore.h>
42 #include <gtkmm/combobox.h>
43 #include <gtkmm/comboboxtext.h>
44 
46 
47 #include "ardour/utils.h"
48 
49 #include "ardour_dialog.h"
50 
51 class EngineControl;
52 
54 {
55 public:
56  SessionDialog (bool require_new, const std::string& session_name, const std::string& session_path,
57  const std::string& template_name, bool cancel_not_quit);
60 
61  std::string session_name (bool& should_be_new);
62  std::string session_folder ();
63 
65 
66  bool use_session_template() const;
67  std::string session_template_name();
68 
70 
71  void set_provided_session (std::string const & name, std::string const & path);
72  void clear_name ();
73  bool was_new_name_edited() const { return new_name_was_edited; }
74 
75 private:
76  bool new_only;
77 
79 
84 
86 
89 
91 
92  /* initial choice page */
93 
99 
100  /* recent sessions */
101 
103 
105  {
106  bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
107  return ARDOUR::cmp_nocase(a.first, b.first) == -1;
108  }
109  };
110 
113  {
114  add (visible_name);
115  add (tip);
116  add (fullpath);
117  add (sample_rate);
118  add (disk_format);
119  add (modified_with);
120  add (time_modified);
122  }
131  };
132 
135  Glib::RefPtr<Gtk::TreeStore> recent_session_model;
146 
149 
150  /* new sessions */
151 
156 
158 
160 
163  add (name);
164  add (path);
165  add (description);
168  }
169 
175  };
176 
178 
179  Glib::RefPtr<Gtk::TreeStore> template_model;
182 
184 
187 
191 
195 
196  /* --disable plugins UI */
199 
200  /* meta-template */
201  static uint32_t meta_master_bus_profile (std::string script);
202 
203  /* always there */
204 
205  Glib::RefPtr<Pango::Layout> layout;
206 
208 
210  std::string::size_type info_scroller_count;
212  sigc::connection info_scroller_connection;
214 
217 };
218 
219 #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
void setup_existing_session_page()
void new_session_button_clicked()
bool new_name_was_edited
void recent_session_sort_changed()
void setup_new_session_page()
Glib::RefPtr< Gtk::TreeStore > template_model
Gtk::Button ic_new_session_button
void template_row_selected()
bool open_button_pressed(GdkEventButton *)
void clear_name()
sigc::connection info_scroller_connection
std::string session_template_name()
Temporal::TimeDomain session_domain() const
void session_selected()
void recent_row_activated(const Gtk::TreePath &path, Gtk::TreeViewColumn *col)
Glib::RefPtr< Pango::Layout > layout
Gtk::VBox ic_vbox
Gtk::Button * open_button
Gtk::TreeView recent_session_display
void disable_plugins_clicked()
void recent_context_mennu(GdkEventButton *)
void setup_initial_choice_box()
RecentSessionModelColumns recent_session_columns
Gtk::VBox session_existing_vbox
void existing_session_selected()
Gtk::FileChooserButton new_folder_chooser
std::string session_folder()
Gtk::VBox session_new_vbox
std::string load_template_override
bool back_button_pressed(GdkEventButton *)
Gtk::Button * cancel_button
void set_provided_session(std::string const &name, std::string const &path)
Gtk::TreeView template_chooser
std::string session_name(bool &should_be_new)
Gtk::TextView template_desc
void recent_remove_selected()
void populate_session_templates()
Gtk::Frame info_frame
bool use_session_template() const
Gtk::ScrolledWindow recent_scroller
void new_name_activated()
Glib::RefPtr< Gtk::TreeStore > recent_session_model
Gtk::Frame template_desc_frame
uint32_t master_channel_count()
bool was_new_name_edited() const
Gtk::Label info_scroller_label
void recent_session_row_selected()
SessionDialog(bool require_new, const std::string &session_name, const std::string &session_path, const std::string &template_name, bool cancel_not_quit)
Gtk::FileChooserButton existing_session_chooser
void setup_recent_sessions()
bool _existing_session_chooser_used
set to true when the existing session chooser has been used
bool info_scroller_update()
void new_name_changed()
static uint32_t meta_master_bus_profile(std::string script)
std::string::size_type info_scroller_count
Gtk::ScrolledWindow template_scroller
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()
Gtk::Button * back_button
Gtk::CheckButton _disable_plugins
Gtk::Button * quit_button
Gtk::Entry new_name_entry
Gtk::Label recent_label
int redisplay_recent_sessions()
SessionTemplateColumns session_template_columns
bool new_name_edited(GdkEventKey *)
GtkImageIconNameData name
Definition: gtkimage.h:6
int cmp_nocase(const std::string &s, const std::string &s2)
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< 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