various fixes to MidiRegionView selection handling, key handling, drawing of ghost...
[ardour2.git] / gtk2_ardour / export_file_notebook.h
blob9f357ab1d548f01537acef0aa231509184f7c08c
1 /*
2 Copyright (C) 2008 Paul Davis
3 Author: Sakari Bergen
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.
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.
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.
21 #ifndef __export_file_notebook_h__
22 #define __export_file_notebook_h__
24 #include <sigc++/signal.h>
25 #include <gtkmm.h>
27 #include "ardour/export_profile_manager.h"
28 #include "ardour/session_handle.h"
30 #include "export_format_selector.h"
31 #include "export_filename_selector.h"
33 class ExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHandlePtr
35 public:
37 ExportFileNotebook ();
39 void set_session_and_manager (ARDOUR::Session * s, boost::shared_ptr<ARDOUR::ExportProfileManager> manager);
40 void sync_with_manager ();
42 std::string get_nth_format_name (uint32_t n);
44 sigc::signal<void> CriticalSelectionChanged;
46 private:
48 typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
49 typedef boost::shared_ptr<ARDOUR::ExportFormatSpecification> FormatPtr;
50 typedef boost::shared_ptr<ARDOUR::ExportFilename> FilenamePtr;
51 class FilePage;
53 ManagerPtr profile_manager;
55 void add_new_file_page ();
56 void add_file_page (ARDOUR::ExportProfileManager::FormatStatePtr format_state, ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
57 void remove_file_page (FilePage * page);
58 void update_remove_file_page_sensitivity ();
60 sigc::connection page_change_connection;
61 void handle_page_change (GtkNotebookPage*, uint32_t page);
63 Gtk::HBox new_file_hbox;
64 Gtk::Button new_file_button;
65 Gtk::VBox new_file_dummy;
67 uint32_t last_visible_page;
68 uint32_t page_counter;
70 class FilePage : public Gtk::VBox {
71 public:
72 FilePage (ARDOUR::Session * s, ManagerPtr profile_manager, ExportFileNotebook * parent, uint32_t number,
73 ARDOUR::ExportProfileManager::FormatStatePtr format_state,
74 ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
76 virtual ~FilePage ();
78 Gtk::Widget & get_tab_widget () { return tab_widget; }
79 void set_remove_sensitive (bool value);
80 std::string get_format_name () const;
82 ARDOUR::ExportProfileManager::FormatStatePtr get_format_state () const { return format_state; }
83 ARDOUR::ExportProfileManager::FilenameStatePtr get_filename_state () const { return filename_state; }
85 sigc::signal<void> CriticalSelectionChanged;
87 private:
88 void save_format_to_manager (FormatPtr format);
89 void update_tab_label ();
91 ARDOUR::ExportProfileManager::FormatStatePtr format_state;
92 ARDOUR::ExportProfileManager::FilenameStatePtr filename_state;
93 ManagerPtr profile_manager;
95 /* GUI components */
97 Gtk::Label format_label;
98 Gtk::Alignment format_align;
99 ExportFormatSelector format_selector;
100 PBD::ScopedConnection format_connection;
102 Gtk::Label filename_label;
103 Gtk::Alignment filename_align;
104 ExportFilenameSelector filename_selector;
106 Gtk::HBox tab_widget;
107 Gtk::Label tab_label;
108 Gtk::Alignment tab_close_alignment;
109 Gtk::Button tab_close_button;
110 uint32_t tab_number;
114 #endif