Optimize automation-event process splitting
[ardour.git] / gtk2_ardour / export_preset_selector.h
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_preset_selector_h__
22 #define __export_preset_selector_h__
23
24 #include <sigc++/signal.h>
25
26 #include <gtkmm/box.h>
27 #include <gtkmm/button.h>
28 #include <gtkmm/comboboxentry.h>
29 #include <gtkmm/label.h>
30 #include <gtkmm/liststore.h>
31 #include <gtkmm/treemodel.h>
32
33 #include "ardour/export_profile_manager.h"
34
35 class ExportPresetSelector : public Gtk::HBox
36 {
37 public:
38
39         ExportPresetSelector ();
40
41         void set_manager (boost::shared_ptr<ARDOUR::ExportProfileManager> manager);
42
43         sigc::signal<void> CriticalSelectionChanged;
44
45 private:
46
47         typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
48         typedef ARDOUR::ExportPresetPtr PresetPtr;
49         typedef ARDOUR::ExportProfileManager::PresetList PresetList;
50
51         ManagerPtr       profile_manager;
52         sigc::connection select_connection;
53
54         void sync_with_manager ();
55         void update_selection ();
56         void create_new ();
57         void save_current ();
58         void remove_current ();
59
60         struct PresetCols : public Gtk::TreeModelColumnRecord
61         {
62         public:
63                 Gtk::TreeModelColumn<PresetPtr>      preset;
64                 Gtk::TreeModelColumn<std::string>  label;
65
66                 PresetCols () { add (preset); add (label); }
67         };
68         PresetCols                   cols;
69         Glib::RefPtr<Gtk::ListStore> list;
70         PresetPtr                    current;
71         PresetPtr                    previous;
72
73         Gtk::Label          label;
74         Gtk::ComboBoxEntry  entry;
75
76         Gtk::Button         save_button;
77         Gtk::Button         remove_button;
78         Gtk::Button         new_button;
79 };
80
81 #endif