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
28 class Keyboard
: public fltk::Widget
{
43 Keyboard(int x
, int y
, int w
, int h
, const char* label
);
45 void play_note(int note
, int rec
);
46 void release_note(int note
, int rec
);
47 void cut_notes(int rec
);
48 void set_sustain(int state
);
50 void kb_play_note(int note
);
51 void kb_release_note(int note
);
55 int handle(int event
);
61 int keyboard_handler(int e
, fltk::Window
* w
);
67 combo(unsigned zkey
, unsigned zmod
){key
=zkey
; mod
=zmod
;}
68 combo(){key
=' '; mod
=0;}
69 int operator==(combo c
){
70 return (c
.key
==key
&& c
.mod
==mod
) ? 1 : 0;
74 class KeyGrabber
: public fltk::Widget
{
83 KeyGrabber(int x
, int y
, int w
, int h
, const char* label
);
85 int handle(int event
);
88 int set_key(int key
, int mod
);
92 void save(std::fstream
& f
);
93 void load(std::fstream
& f
);
96 void set_keymap(int which
, int index
, int key
, int mod
);
97 char* get_keystring(int key
, int mod
);
99 void load_keymap(std::fstream
& f
);
100 void save_keymap(std::fstream
& f
);
101 void load_default_keymap();
103 int zoom_out_key(unsigned,unsigned);
104 int zoom_in_key(unsigned,unsigned);