2 Epichord - a midi sequencer
3 Copyright (C) 2008 Evan Rinehart
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
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.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to
18 The Free Software Foundation, Inc.
19 51 Franklin Street, Fifth Floor
20 Boston, MA 02110-1301, USA
26 #include <fltk/Group.h>
27 #include <fltk/Widget.h>
28 #include <fltk/events.h>
37 static std::vector
<TrackModule
*> modules
;
39 extern std::vector
<track
*> tracks
;
41 TrackInfo::TrackInfo(int x
, int y
, int w
, int h
, const char* label
= 0) : fltk::Group(x
, y
, w
, h
, label
)
46 for(int i
=0; i
<16; i
++){
47 mod
= new TrackModule(0,30*i
,255,30,i
);
48 mod
->box(fltk::UP_BOX
);
51 modules
.push_back(mod
);
58 int TrackInfo::handle(int event
){
63 return Group::handle(event
);
66 void TrackInfo::draw(){
67 fltk::push_clip(0,0,w(),h());
68 for(int i
=0; i
<children(); i
++){
69 child(i
)->y(i
*30 - scroll
);
75 void TrackInfo::layout(){
76 for(int i
=0; i
<children(); i
++){
81 void TrackInfo::toggle_controls(){
82 for(int i
=0; i
<modules
.size(); i
++){
85 //fltk::Group::redraw();
89 void TrackInfo::update(){
90 //for each child cast to TrackModule and call update
91 for(int i
=0; i
<children(); i
++){
92 ((TrackModule
*)child(i
))->update();
96 void TrackInfo::unset_solo(){
97 for(int i
=0; i
<children(); i
++){
98 ((TrackModule
*)child(i
))->unset_solo();
102 void TrackInfo::set_rec(int t
){
103 for(int i
=0; i
<children(); i
++){
105 ((TrackModule
*)child(i
))->set_rec();
108 ((TrackModule
*)child(i
))->unset_rec();