ardour
export_format_selector.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_format_selector_h__
22 #define __export_format_selector_h__
23 
24 #include <string>
25 #include <gtkmm.h>
26 #include <sigc++/signal.h>
27 #include <boost/shared_ptr.hpp>
28 
30 #include "ardour/session_handle.h"
31 
32 namespace ARDOUR {
33  class ExportFormatSpecification;
34  class ExportProfileManager;
35 }
36 
38 class ExportFormatSelector : public Gtk::HBox, public ARDOUR::SessionHandlePtr
39 {
40 
41  private:
42 
44  typedef std::list<FormatPtr> FormatList;
45 
46  public:
47 
50 
52  void update_format_list ();
53 
54  sigc::signal<void, FormatPtr> FormatEdited;
55  sigc::signal<void, FormatPtr> FormatRemoved;
56  sigc::signal<FormatPtr, FormatPtr> NewFormat;
57 
58  /* Compatibility with other elements */
59 
60  sigc::signal<void> CriticalSelectionChanged;
61 
62  private:
63 
64  void select_format (FormatPtr f);
65  void add_new_format ();
66  void remove_format (bool called_from_button = false);
67  int open_edit_dialog (bool new_dialog = false);
68  void update_format_combo ();
70 
72 
73  /*** GUI componenets ***/
74 
75  struct FormatCols : public Gtk::TreeModelColumnRecord
76  {
77  public:
78  Gtk::TreeModelColumn<FormatPtr> format;
79  Gtk::TreeModelColumn<std::string> label;
80 
81  FormatCols () { add (format); add (label); }
82  };
84  Glib::RefPtr<Gtk::ListStore> format_list;
85  Gtk::ComboBox format_combo;
86 
87  Gtk::Button edit_button;
88  Gtk::Button remove_button;
89  Gtk::Button new_button;
90 };
91 
92 #endif /* __export_format_selector_h__ */
void remove_format(bool called_from_button=false)
sigc::signal< void, FormatPtr > FormatRemoved
Gtk::TreeModelColumn< FormatPtr > format
std::list< FormatPtr > FormatList
tuple f
Definition: signals.py:35
int open_edit_dialog(bool new_dialog=false)
Glib::RefPtr< Gtk::ListStore > format_list
sigc::signal< void, FormatPtr > FormatEdited
sigc::signal< void > CriticalSelectionChanged
ARDOUR::ExportProfileManager::FormatStatePtr state
Definition: amp.h:29
boost::shared_ptr< ARDOUR::ExportFormatSpecification > FormatPtr
sigc::signal< FormatPtr, FormatPtr > NewFormat
void select_format(FormatPtr f)
void set_state(ARDOUR::ExportProfileManager::FormatStatePtr state_, ARDOUR::Session *session_)
Gtk::TreeModelColumn< std::string > label