2 * Copyright (C) 2008-2010 Paul Davis <paul@linuxaudiosystems.com>
3 * Copyright (C) 2009 David Robillard <d@drobilla.net>
4 * Copyright (C) 2017-2018 Robin Gareus <robin@gareus.org>
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.
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.
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.
21 #ifndef __export_format_selector_h__
22 #define __export_format_selector_h__
25 #include <sigc++/signal.h>
26 #include <boost/shared_ptr.hpp>
28 #include <gtkmm/box.h>
29 #include <gtkmm/button.h>
30 #include <gtkmm/combobox.h>
31 #include <gtkmm/liststore.h>
32 #include <gtkmm/treemodel.h>
34 #include "ardour/export_profile_manager.h"
35 #include "ardour/session_handle.h"
38 class ExportFormatSpecification;
39 class ExportProfileManager;
42 class ExportFormatSelector : public Gtk::HBox, public ARDOUR::SessionHandlePtr
46 typedef boost::shared_ptr<ARDOUR::ExportFormatSpecification> FormatPtr;
47 typedef std::list<FormatPtr> FormatList;
51 ExportFormatSelector ();
52 ~ExportFormatSelector ();
54 void set_state (ARDOUR::ExportProfileManager::FormatStatePtr state_, ARDOUR::Session * session_);
55 void update_format_list ();
57 sigc::signal<void, FormatPtr> FormatEdited;
58 sigc::signal<void, FormatPtr> FormatRemoved;
59 sigc::signal<FormatPtr, FormatPtr> NewFormat;
60 sigc::signal<void, FormatPtr> FormatReverted;
62 /* Compatibility with other elements */
64 sigc::signal<void> CriticalSelectionChanged;
68 void select_format (FormatPtr f);
69 void add_new_format ();
70 void remove_format (bool called_from_button = false);
71 int open_edit_dialog (bool new_dialog = false);
72 void update_format_combo ();
73 void update_format_description ();
75 ARDOUR::ExportProfileManager::FormatStatePtr state;
77 /*** GUI componenets ***/
79 struct FormatCols : public Gtk::TreeModelColumnRecord
82 Gtk::TreeModelColumn<FormatPtr> format;
83 Gtk::TreeModelColumn<std::string> label;
85 FormatCols () { add (format); add (label); }
87 FormatCols format_cols;
88 Glib::RefPtr<Gtk::ListStore> format_list;
89 Gtk::ComboBox format_combo;
91 Gtk::Button edit_button;
92 Gtk::Button remove_button;
93 Gtk::Button new_button;
96 #endif /* __export_format_selector_h__ */