various fixes to MidiRegionView selection handling, key handling, drawing of ghost...
[ardour2.git] / gtk2_ardour / export_multiplicator.h
blob1e204e1a1de143dda9d19d65cacaa8987a25dfa0
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 */
7 /*
8 Copyright (C) 2008 Paul Davis
9 Author: Sakari Bergen
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.
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.
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.
27 #ifndef __export_multiplicator_h__
28 #define __export_multiplicator_h__
30 #include <utility>
31 #include <map>
33 #include "ardour/export_profile_manager.h"
35 #include <gtkmm.h>
36 #include <boost/shared_ptr.hpp>
38 using ARDOUR::ExportProfileManager;
40 class ExportMultiplicator : public Gtk::EventBox {
41 public:
43 ExportMultiplicator ();
44 ~ExportMultiplicator ();
46 void set_manager (boost::shared_ptr<ExportProfileManager> _manager);
48 private:
50 boost::shared_ptr<ExportProfileManager> manager;
51 ExportProfileManager::MultiplicationGraph const * graph;
53 /* Drawing stuff */
55 Gtk::Table table;
57 void redraw ();
59 enum GraphLevel {
60 NoLevel = 0,
61 Timespans = 1,
62 ChannelConfigs = 2,
63 Formats = 3,
64 Filenames = 4
67 std::pair<uint32_t, uint32_t> get_bounds (ExportProfileManager::GraphNode * node, GraphLevel current_level, GraphLevel max_level) const;
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);
74 struct TablePosition {
75 uint32_t left;
76 uint32_t right;
77 uint32_t row;
79 TablePosition (uint32_t left, uint32_t right, uint32_t row) :
80 left (left), right (right), row (row) {}
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); }
86 typedef std::map<TablePosition, boost::shared_ptr<Gtk::HBox> > WidgetMap;
87 typedef std::pair<TablePosition, boost::shared_ptr<Gtk::HBox> > WidgetPair;
89 boost::shared_ptr<Gtk::HBox> get_hbox (TablePosition position);
90 WidgetMap widget_map;
92 /* Button Widget */
94 class ButtonWidget : public Gtk::EventBox {
95 public:
96 ButtonWidget (std::string name, boost::shared_ptr<ExportProfileManager> m, ExportProfileManager::GraphNode * node);
98 private:
100 Gtk::Label label;
101 Gtk::VBox vbox;
103 bool on_button_press_event (GdkEventButton* event);
105 void split ();
106 void remove ();
108 boost::shared_ptr<ExportProfileManager> manager;
109 ExportProfileManager::GraphNode * node;
110 float split_position;
112 /* Context menu */
114 Glib::RefPtr<Gtk::ActionGroup> menu_actions;
115 Glib::RefPtr<Gtk::UIManager> ui_manager;
116 Gtk::Menu * menu;
120 #endif /* __export_multiplicator_h__ */