Ardour  9.0-pre0-582-g084a23a80d
export_dialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2015 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
4  * Copyright (C) 2007-2011 David Robillard <d@drobilla.net>
5  * Copyright (C) 2008-2013 Sakari Bergen <sakari.bergen@beatwaves.net>
6  * Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
7  * Copyright (C) 2013-2014 Colin Fletcher <colin.m.fletcher@googlemail.com>
8  * Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24 
25 #pragma once
26 
27 #include <string>
28 #include <gtkmm/box.h>
29 #include <gtkmm/button.h>
30 #include <gtkmm/label.h>
31 #include <gtkmm/notebook.h>
32 #include <gtkmm/progressbar.h>
33 
35 
36 #include "public_editor.h"
39 #include "export_file_notebook.h"
40 #include "export_preset_selector.h"
41 #include "ardour_dialog.h"
43 
44 namespace ARDOUR {
45  class ExportStatus;
46  class ExportHandler;
47 }
48 
51 
53 {
54 public:
55 
58 
60 
61  /* Responses */
62 
63  enum Responses {
68  };
69 
70 protected:
71 
72  void on_response (int response_id) {
73  Gtk::Dialog::on_response (response_id);
74  }
75 
76  typedef std::shared_ptr<ARDOUR::ExportHandler> HandlerPtr;
77  typedef std::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
78 
82 
83  // initializes GUI layout
84  virtual void init_gui ();
85 
86  // Must initialize all the shared_ptrs below
87  virtual void init_components ();
88 
89  std::unique_ptr<ExportPresetSelector> preset_selector;
90  std::unique_ptr<ExportTimespanSelector> timespan_selector;
91  std::unique_ptr<ExportChannelSelector> channel_selector;
92  std::unique_ptr<ExportFileNotebook> file_notebook;
93 
94  std::shared_ptr<SoundcloudExportSelector> soundcloud_selector;
95 
98 
99  /*** GUI components ***/
101 
102 private:
103 
104  void init ();
105 
106  void notify_errors (bool force = false);
107  void close_dialog ();
108 
112 
113  void do_export (bool analysis_only);
114 
116 
118  void parameter_changed (std::string const&);
119 
120  void show_progress ();
122 
123  typedef std::shared_ptr<ARDOUR::ExportStatus> StatusPtr;
124 
127 
128  typedef std::map<samplepos_t, std::vector<std::string>> ReImportMap;
130 
131  /* Warning area */
132 
135  std::string warn_string;
136 
140  std::string list_files_string;
141 
142  void add_error (std::string const & text);
143  void add_warning (std::string const & text);
144 
145  /* Progress bar */
146 
148  sigc::connection progress_connection;
149 
150  float previous_progress; // Needed for gtk bug workaround
151 
154 
155  void soundcloud_upload_progress(double total, double now, std::string title);
156 
157  /* Buttons */
158 
162 
163 };
164 
166 {
167  public:
169 
170  private:
172 
173  std::string range_id;
174 };
175 
177 {
178  public:
180 
181  private:
183 };
184 
186 {
187  public:
189 
190  private:
191  void init_gui ();
193 
196 };
197 
199 {
200  public:
202 
203  private:
205 };
206 
Gtk::Label list_files_label
void do_export(bool analysis_only)
sigc::connection progress_connection
std::string list_files_string
void on_response(int response_id)
This is a default handler for the signal signal_response().
Definition: export_dialog.h:72
Gtk::VBox warning_widget
Definition: export_dialog.h:96
std::string warn_string
std::unique_ptr< ExportFileNotebook > file_notebook
Definition: export_dialog.h:92
ARDOUR::ExportProfileManager::ExportType type
Definition: export_dialog.h:79
Gtk::Button * cancel_button
Gtk::Notebook export_notebook
ReImportMap _files_to_reimport
gint progress_timeout()
void notify_errors(bool force=false)
HandlerPtr handler
Definition: export_dialog.h:80
void show_conflicting_files()
void show_progress()
void update_warnings_and_example_filename()
Gtk::Label warn_label
std::unique_ptr< ExportPresetSelector > preset_selector
Definition: export_dialog.h:89
Gtk::Button list_files_button
void set_session(ARDOUR::Session *s)
float previous_progress
void close_dialog()
PublicEditor & editor
void parameter_changed(std::string const &)
void add_error(std::string const &text)
Gtk::ProgressBar progress_bar
virtual void init_gui()
Gtk::Button * export_button
std::shared_ptr< ARDOUR::ExportHandler > HandlerPtr
Definition: export_dialog.h:76
Gtk::VBox progress_widget
Definition: export_dialog.h:97
ManagerPtr profile_manager
Definition: export_dialog.h:81
void sync_with_manager()
StatusPtr status
void add_warning(std::string const &text)
Gtk::HBox warn_hbox
ExportDialog(PublicEditor &editor, std::string title, ARDOUR::ExportProfileManager::ExportType type)
void update_realtime_selection()
std::unique_ptr< ExportChannelSelector > channel_selector
Definition: export_dialog.h:91
void soundcloud_upload_progress(double total, double now, std::string title)
Gtk::Button * analyze_button
std::map< samplepos_t, std::vector< std::string > > ReImportMap
std::unique_ptr< ExportTimespanSelector > timespan_selector
Definition: export_dialog.h:90
virtual void init_components()
void maybe_set_session_dirty()
std::shared_ptr< ARDOUR::ExportProfileManager > ManagerPtr
Definition: export_dialog.h:77
std::shared_ptr< SoundcloudExportSelector > soundcloud_selector
Definition: export_dialog.h:94
Gtk::HBox list_files_hbox
std::shared_ptr< ARDOUR::ExportStatus > StatusPtr
ExportRangeDialog(PublicEditor &editor, std::string range_id)
std::string range_id
ARDOUR::AudioTrack & track
ExportRegionDialog(PublicEditor &editor, ARDOUR::AudioRegion const &region, ARDOUR::AudioTrack &track)
ARDOUR::AudioRegion const & region
ExportSelectionDialog(PublicEditor &editor)
Timespan Selector base.
virtual void on_response(int response_id)
This is a default handler for the signal signal_response().
Representation of the interface of the Editor class.
void init_components()
StemExportDialog(PublicEditor &editor)