Ardour  9.0-pre0-822-g12e3bc5c20
export_filename_selector.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2011 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2009-2011 David Robillard <d@drobilla.net>
4  * Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
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 #pragma once
22 
23 #include <ytkmm/box.h>
24 #include <ytkmm/button.h>
25 #include <ytkmm/checkbutton.h>
26 #include <ytkmm/combobox.h>
27 #include <ytkmm/comboboxtext.h>
28 #include <ytkmm/entry.h>
29 #include <ytkmm/label.h>
30 #include <ytkmm/liststore.h>
31 #include <ytkmm/sizegroup.h>
32 #include <ytkmm/spinbutton.h>
33 #include <ytkmm/treemodel.h>
34 
35 #include "ardour/export_filename.h"
37 #include "ardour/session_handle.h"
38 
39 class ExportFilenameSelector : public Gtk::VBox, public ARDOUR::SessionHandlePtr
40 {
41 public:
42  typedef std::shared_ptr<ARDOUR::ExportFilename> FilenamePtr;
43 
46 
48  void set_example_filename (std::string filename);
49  void require_timespan (bool);
50 
51  /* Compatibility with other elements */
52 
53  sigc::signal<void> CriticalSelectionChanged;
54 
55 private:
56  void load_state ();
57 
58  void update_label ();
59  void update_folder ();
60  void check_folder ();
61 
64 
69 
71  void open_folder ();
72 
73  std::shared_ptr<ARDOUR::ExportFilename> filename;
74 
75  Glib::RefPtr<Gtk::SizeGroup> label_sizegroup;
76 
77  Gtk::Label include_label;
78 
79  Gtk::HBox include_hbox;
80 
81  Gtk::Label label_label;
82  Gtk::Entry label_entry;
83 
84  Gtk::ComboBoxText session_snap_name;
85  Gtk::CheckButton timespan_checkbox;
86 
87  Gtk::CheckButton revision_checkbox;
88  Gtk::SpinButton revision_spinbutton;
89 
90  Gtk::HBox path_hbox;
91 
92  Gtk::Label path_label;
93  Gtk::Entry path_entry;
94  Gtk::Button browse_button;
95  Gtk::Button open_button;
97 
98  /* Date combo */
99 
101 
102  struct DateFormatCols : public Gtk::TreeModelColumnRecord {
103  public:
104  Gtk::TreeModelColumn<DateFormat> format;
105  Gtk::TreeModelColumn<std::string> label;
106 
108  {
109  add (format);
110  add (label);
111  }
112  };
114  Glib::RefPtr<Gtk::ListStore> date_format_list;
115  Gtk::ComboBox date_format_combo;
116 
117  /* Time combo */
118 
120 
121  struct TimeFormatCols : public Gtk::TreeModelColumnRecord {
122  public:
123  Gtk::TreeModelColumn<TimeFormat> format;
124  Gtk::TreeModelColumn<std::string> label;
125 
127  {
128  add (format);
129  add (label);
130  }
131  };
133  Glib::RefPtr<Gtk::ListStore> time_format_list;
134  Gtk::ComboBox time_format_combo;
135 
136  /* timespan logic */
139 };
140 
std::shared_ptr< FilenameState > FilenameStatePtr
Glib::RefPtr< Gtk::ListStore > date_format_list
ARDOUR::ExportFilename::TimeFormat TimeFormat
ARDOUR::ExportFilename::DateFormat DateFormat
Gtk::ComboBoxText session_snap_name
std::shared_ptr< ARDOUR::ExportFilename > filename
void set_state(ARDOUR::ExportProfileManager::FilenameStatePtr state_, ARDOUR::Session *session_)
Glib::RefPtr< Gtk::SizeGroup > label_sizegroup
Glib::RefPtr< Gtk::ListStore > time_format_list
sigc::signal< void > CriticalSelectionChanged
void require_timespan(bool)
void set_example_filename(std::string filename)
std::shared_ptr< ARDOUR::ExportFilename > FilenamePtr
void update_timespan_sensitivity()
Gtk::TreeModelColumn< DateFormat > format
Gtk::TreeModelColumn< std::string > label
Gtk::TreeModelColumn< std::string > label
Gtk::TreeModelColumn< TimeFormat > format