2 * Copyright (C) 2008-2012 Sakari Bergen <sakari.bergen@beatwaves.net>
3 * Copyright (C) 2009-2010 Paul Davis <paul@linuxaudiosystems.com>
4 * Copyright (C) 2009 David Robillard <d@drobilla.net>
5 * Copyright (C) 2014 Colin Fletcher <colin.m.fletcher@googlemail.com>
6 * Copyright (C) 2016-2019 Robin Gareus <robin@gareus.org>
7 * Copyright (C) 2016 Tim Mayberry <mojofunk@gmail.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #ifndef __export_file_notebook_h__
25 #define __export_file_notebook_h__
27 #include <sigc++/signal.h>
29 #include <gtkmm/alignment.h>
30 #include <gtkmm/box.h>
31 #include <gtkmm/button.h>
32 #include <gtkmm/checkbutton.h>
33 #include <gtkmm/label.h>
34 #include <gtkmm/notebook.h>
36 #include "ardour/export_profile_manager.h"
37 #include "ardour/session_handle.h"
39 #include "export_format_selector.h"
40 #include "export_filename_selector.h"
41 #include "soundcloud_export_selector.h"
43 class ExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHandlePtr
47 ExportFileNotebook ();
49 void set_session_and_manager (ARDOUR::Session * s, boost::shared_ptr<ARDOUR::ExportProfileManager> manager);
50 void sync_with_manager ();
51 void update_example_filenames();
53 boost::shared_ptr<SoundcloudExportSelector> soundcloud_export_selector;
55 sigc::signal<void> CriticalSelectionChanged;
59 typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
60 typedef boost::shared_ptr<ARDOUR::ExportFormatSpecification> FormatPtr;
61 typedef boost::shared_ptr<ARDOUR::ExportFilename> FilenamePtr;
64 ManagerPtr profile_manager;
66 void add_new_file_page ();
67 void add_file_page (ARDOUR::ExportProfileManager::FormatStatePtr format_state, ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
68 void remove_file_page (FilePage * page);
69 void update_remove_file_page_sensitivity ();
70 void update_soundcloud_upload ();
72 sigc::connection page_change_connection;
73 void handle_page_change (GtkNotebookPage*, uint32_t page);
75 Gtk::HBox new_file_hbox;
76 Gtk::Button new_file_button;
77 Gtk::VBox new_file_dummy;
79 uint32_t last_visible_page;
80 uint32_t page_counter;
82 class FilePage : public Gtk::VBox
85 FilePage (ARDOUR::Session * s, ManagerPtr profile_manager, ExportFileNotebook * parent, uint32_t number,
86 ARDOUR::ExportProfileManager::FormatStatePtr format_state,
87 ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
91 Gtk::Widget & get_tab_widget () { return tab_widget; }
92 void set_remove_sensitive (bool value);
93 std::string get_format_name () const;
94 bool get_soundcloud_upload () const;
96 void update_example_filename();
98 void update_analysis_button ();
99 void update_soundcloud_upload_button ();
101 ARDOUR::ExportProfileManager::FormatStatePtr get_format_state () const { return format_state; }
102 ARDOUR::ExportProfileManager::FilenameStatePtr get_filename_state () const { return filename_state; }
104 sigc::signal<void> CriticalSelectionChanged;
107 void save_format_to_manager (FormatPtr format);
108 void update_tab_label ();
109 void critical_selection_changed ();
110 void analysis_changed ();
111 void soundcloud_upload_changed ();
113 ARDOUR::ExportProfileManager::FormatStatePtr format_state;
114 ARDOUR::ExportProfileManager::FilenameStatePtr filename_state;
115 ManagerPtr profile_manager;
119 Gtk::Label format_label;
120 Gtk::Alignment format_align;
121 ExportFormatSelector format_selector;
122 PBD::ScopedConnection format_connection;
124 Gtk::Label filename_label;
125 Gtk::Alignment filename_align;
126 ExportFilenameSelector filename_selector;
128 Gtk::CheckButton soundcloud_upload_button;
129 Gtk::CheckButton analysis_button;
130 Gtk::HBox tab_widget;
131 Gtk::Label tab_label;
132 Gtk::Alignment tab_close_alignment;
133 Gtk::Button tab_close_button;
137 sigc::connection soundcloud_button_connection;
138 sigc::connection analysis_button_connection;