Merged with trunk R1612.
[ardour.git] / libs / surfaces / mackie / scripts / generate-button-handlers-h.erb
1 <%#
2         Copyright (C) 2006,2007 John Anderson
3
4         This program is free software; you can redistribute it and/or modify
5         it under the terms of the GNU General Public License as published by
6         the Free Software Foundation; either version 2 of the License, or
7         (at your option) any later version.
8
9         This program is distributed in the hope that it will be useful,
10         but WITHOUT ANY WARRANTY; without even the implied warranty of
11         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12         GNU General Public License for more details.
13
14         You should have received a copy of the GNU General Public License
15         along with this program; if not, write to the Free Software
16         Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 -%>
18 <%-
19 require 'controls.rb'
20
21 sf = Surface.new
22 sf.parse( File.open "mackie-controls.csv" )
23 buttons = sf.controls.find_all{|x| x.class == Button && x.group.class != Strip}
24 -%>
25 #ifndef mackie_button_handler_h
26 #define mackie_button_handler_h
27 /*
28         Generated by scripts/generate-button-handlers.erb
29 */
30
31 #include "types.h"
32
33 namespace Mackie
34 {
35
36 class MackieButtonHandler
37 {
38 public:
39         virtual ~MackieButtonHandler() {}
40         
41         virtual LedState default_button_press( Button & button );
42         virtual LedState default_button_release( Button & button );
43         
44         virtual void update_led( Button & button, LedState ls ) = 0;
45         
46 <%- buttons.each do |button| %>
47         virtual LedState <%=button.name%>_press( Button & );
48         virtual LedState <%=button.name%>_release( Button & );
49 <% end %>
50 };
51
52 }
53
54 #endif