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 extern std::vector
<track
*> tracks
;
39 TrackInfo::TrackInfo(int x
, int y
, int w
, int h
, const char* label
= 0) : fltk::Group(x
, y
, w
, h
, label
)
44 //for(int i=0; i<16; i++){
45 //mod = new TrackModule(0,30*i,255,30,i);
46 //mod->box(fltk::UP_BOX);
48 //mod->set_channel(i);
55 int TrackInfo::handle(int event
){
60 return Group::handle(event
);
63 void TrackInfo::draw(){
64 fltk::push_clip(0,0,w(),h());
65 for(int i
=0; i
<children(); i
++){
66 child(i
)->y(i
*30 - scroll
);
72 void TrackInfo::layout(){
73 for(int i
=0; i
<children(); i
++){
78 void TrackInfo::toggle_controls(){
79 for(int i
=0; i
<children(); i
++){
80 ((TrackModule
*)child(i
))->toggle();
85 void TrackInfo::update(){
86 //for each child cast to TrackModule and call update
87 for(int i
=0; i
<children(); i
++){
88 ((TrackModule
*)child(i
))->update();
92 void TrackInfo::unset_solo(){
93 for(int i
=0; i
<children(); i
++){
94 ((TrackModule
*)child(i
))->unset_solo();
98 void TrackInfo::set_rec(int t
){
99 for(int i
=0; i
<children(); i
++){
101 ((TrackModule
*)child(i
))->set_rec();
104 ((TrackModule
*)child(i
))->unset_rec();
111 void TrackInfo::clear_tracks(){
115 void TrackInfo::add_track(){
116 int i
= tracks
.size()-1;
117 TrackModule
* mod
= new TrackModule(0,30*i
,255,30,i
);
119 mod
->box(fltk::UP_BOX
);
121 mod
->set_channel(i
%16);
126 void TrackInfo::del_track(int n
){