ardour
export_dialog.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 Paul Davis
3  Author: Sakari Bergen
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 
19 */
20 
21 #ifndef __export_dialog_h__
22 #define __export_dialog_h__
23 
24 #include <boost/scoped_ptr.hpp>
25 #include <string>
26 
28 
29 #include "public_editor.h"
32 #include "export_file_notebook.h"
33 #include "export_preset_selector.h"
34 #include "ardour_dialog.h"
36 
37 #include <gtkmm.h>
38 
39 namespace ARDOUR {
40  class ExportStatus;
41  class ExportHandler;
42 }
43 
46 
48 {
49 
50  public:
51 
53  ~ExportDialog ();
54 
55  void set_session (ARDOUR::Session* s);
56 
57  /* Responses */
58 
59  enum Responses {
63  };
64 
65  protected:
66 
69 
71  HandlerPtr handler;
72  ManagerPtr profile_manager;
73 
74  // initializes GUI layout
75  virtual void init_gui ();
76 
77  // Must initialize all the shared_ptrs below
78  virtual void init_components ();
79 
80  boost::scoped_ptr<ExportPresetSelector> preset_selector;
81  boost::scoped_ptr<ExportTimespanSelector> timespan_selector;
82  boost::scoped_ptr<ExportChannelSelector> channel_selector;
83  boost::scoped_ptr<ExportFileNotebook> file_notebook;
84 
86 
87  Gtk::VBox warning_widget;
88  Gtk::VBox progress_widget;
89 
90  /*** GUI components ***/
91  Gtk::Notebook export_notebook;
92 
93  private:
94 
95  void init ();
96 
97  void notify_errors (bool force = false);
98  void close_dialog ();
99 
100  void sync_with_manager ();
102  void show_conflicting_files ();
103 
104  void do_export ();
105 
106  void show_progress ();
107  gint progress_timeout ();
108 
110 
112  StatusPtr status;
113 
114 
115 
116  /* Warning area */
117 
118  Gtk::HBox warn_hbox;
119  Gtk::Label warn_label;
120  std::string warn_string;
121 
122  Gtk::HBox list_files_hbox;
123  Gtk::Label list_files_label;
124  Gtk::Button list_files_button;
125  std::string list_files_string;
126 
127  void add_error (std::string const & text);
128  void add_warning (std::string const & text);
129 
130  /* Progress bar */
131 
132  Gtk::ProgressBar progress_bar;
133  sigc::connection progress_connection;
134 
135  float previous_progress; // Needed for gtk bug workaround
136 
137  void soundcloud_upload_progress(double total, double now, std::string title);
138 
139  /* Buttons */
140 
141  Gtk::Button * cancel_button;
142  Gtk::Button * export_button;
143 
144 };
145 
147 {
148  public:
150 
151  private:
152  void init_components ();
153 
154  std::string range_id;
155 };
156 
158 {
159  public:
161 
162  private:
163  void init_components ();
164 };
165 
167 {
168  public:
170 
171  private:
172  void init_gui ();
173  void init_components ();
174 
177 };
178 
180 {
181  public:
183 
184  private:
185  void init_components ();
186 };
187 
188 #endif /* __ardour_export_dialog_h__ */
gint progress_timeout()
void add_warning(std::string const &text)
virtual void init_gui()
Gtk::Button * export_button
ARDOUR::AudioRegion const & region
void close_dialog()
sigc::connection progress_connection
boost::scoped_ptr< ExportTimespanSelector > timespan_selector
Definition: export_dialog.h:81
ARDOUR::AudioTrack & track
Gtk::VBox warning_widget
Definition: export_dialog.h:87
void sync_with_manager()
HandlerPtr handler
Definition: export_dialog.h:71
Gtk::HBox list_files_hbox
Representation of the interface of the Editor class.
void set_session(ARDOUR::Session *s)
boost::shared_ptr< ARDOUR::ExportHandler > HandlerPtr
Definition: export_dialog.h:67
StatusPtr status
StemExportDialog(PublicEditor &editor)
ExportDialog(PublicEditor &editor, std::string title, ARDOUR::ExportProfileManager::ExportType type)
void add_error(std::string const &text)
void notify_errors(bool force=false)
Gtk::VBox progress_widget
Definition: export_dialog.h:88
void soundcloud_upload_progress(double total, double now, std::string title)
Definition: amp.h:29
std::string list_files_string
float previous_progress
Gtk::Button * cancel_button
ExportRangeDialog(PublicEditor &editor, std::string range_id)
Gtk::Label list_files_label
virtual void init_components()
ExportSelectionDialog(PublicEditor &editor)
boost::scoped_ptr< ExportFileNotebook > file_notebook
Definition: export_dialog.h:83
std::string warn_string
boost::shared_ptr< ARDOUR::ExportStatus > StatusPtr
Timespan Selector base.
Gtk::Button list_files_button
void show_conflicting_files()
Gtk::Notebook export_notebook
Definition: export_dialog.h:91
Gtk::HBox warn_hbox
boost::shared_ptr< SoundcloudExportSelector > soundcloud_selector
Definition: export_dialog.h:85
Gtk::ProgressBar progress_bar
void show_progress()
boost::shared_ptr< ARDOUR::ExportProfileManager > ManagerPtr
Definition: export_dialog.h:68
PublicEditor & editor
boost::scoped_ptr< ExportPresetSelector > preset_selector
Definition: export_dialog.h:80
ManagerPtr profile_manager
Definition: export_dialog.h:72
boost::scoped_ptr< ExportChannelSelector > channel_selector
Definition: export_dialog.h:82
ExportRegionDialog(PublicEditor &editor, ARDOUR::AudioRegion const &region, ARDOUR::AudioTrack &track)
ARDOUR::ExportProfileManager::ExportType type
Definition: export_dialog.h:70
void update_warnings_and_example_filename()
Gtk::Label warn_label
std::string range_id