Remove most using declarations from header files.
[ardour.git] / gtk2_ardour / export_multiplicator.h
1 /* This file is not used at the moment. It includes code related to export a
2  * multiplication graph system that can be used together with the code in
3  * libs/ardour/export_multiplication.cc and libs/ardour/ardour/export_multiplication.h
4  * - Sakari Bergen 6.8.2008 -
5  */
6
7 /*
8     Copyright (C) 2008 Paul Davis
9     Author: Sakari Bergen
10
11     This program is free software; you can redistribute it and/or modify
12     it under the terms of the GNU General Public License as published by
13     the Free Software Foundation; either version 2 of the License, or
14     (at your option) any later version.
15
16     This program is distributed in the hope that it will be useful,
17     but WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19     GNU General Public License for more details.
20
21     You should have received a copy of the GNU General Public License
22     along with this program; if not, write to the Free Software
23     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
25 */
26
27 #ifndef __export_multiplicator_h__
28 #define __export_multiplicator_h__
29
30 #include <utility>
31 #include <map>
32
33 #include "ardour/export_profile_manager.h"
34
35 #include <gtkmm.h>
36 #include <boost/shared_ptr.hpp>
37
38 using ARDOUR::ExportProfileManager;
39
40 class ExportMultiplicator : public Gtk::EventBox {
41   public:
42
43         ExportMultiplicator ();
44         ~ExportMultiplicator ();
45         
46         void set_manager (boost::shared_ptr<ExportProfileManager> _manager);
47
48   private:
49
50         boost::shared_ptr<ExportProfileManager>  manager;
51         ExportProfileManager::MultiplicationGraph const * graph;
52
53         /* Drawing stuff */
54
55         Gtk::Table table;
56
57         void redraw ();
58         
59         enum GraphLevel {
60                 NoLevel = 0,
61                 Timespans = 1,
62                 ChannelConfigs = 2,
63                 Formats = 3,
64                 Filenames = 4
65         };
66         
67         std::pair<uint32_t, uint32_t> get_bounds (ExportProfileManager::GraphNode * node, GraphLevel current_level, GraphLevel max_level) const;
68         
69         void draw_timespan (ExportProfileManager::TimespanNodePtr node, std::pair<uint32_t, uint32_t> bounds);
70         void draw_channel_config (ExportProfileManager::ChannelConfigNodePtr node, std::pair<uint32_t, uint32_t> bounds);
71         void draw_format (ExportProfileManager::FormatNodePtr node, std::pair<uint32_t, uint32_t> bounds);
72         void draw_filename (ExportProfileManager::FilenameNodePtr node, std::pair<uint32_t, uint32_t> bounds);
73
74         struct TablePosition {
75                 uint32_t left;
76                 uint32_t right;
77                 uint32_t row;
78                 
79                 TablePosition (uint32_t left, uint32_t right, uint32_t row) :
80                   left (left), right (right), row (row) {}
81                 
82                 bool operator== (TablePosition const & other) const { return (row == other.row && left == other.left && right == other.right); }
83                 bool operator< (TablePosition const & other) const { return (row < other.row || left < other.left || right < other.right); }
84         };
85         
86         typedef std::map<TablePosition, boost::shared_ptr<Gtk::HBox> > WidgetMap;
87         typedef std::pair<TablePosition, boost::shared_ptr<Gtk::HBox> > WidgetPair;
88         
89         boost::shared_ptr<Gtk::HBox> get_hbox (TablePosition position);
90         WidgetMap widget_map;
91         
92         /* Button Widget */
93         
94         class ButtonWidget : public Gtk::EventBox {
95           public:
96                 ButtonWidget (Glib::ustring name, boost::shared_ptr<ExportProfileManager> m, ExportProfileManager::GraphNode * node);
97         
98           private:
99         
100                 Gtk::Label label;
101                 Gtk::VBox  vbox;
102         
103                 bool on_button_press_event (GdkEventButton* event);
104                 
105                 void split ();
106                 void remove ();
107                 
108                 boost::shared_ptr<ExportProfileManager> manager;
109                 ExportProfileManager::GraphNode * node;
110                 float split_position;
111                 
112                 /* Context menu */
113         
114                 Glib::RefPtr<Gtk::ActionGroup> menu_actions;
115                 Glib::RefPtr<Gtk::UIManager>   ui_manager;
116                 Gtk::Menu *                    menu;
117         };
118 };
119
120 #endif /* __export_multiplicator_h__ */