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
{
45 Keyboard(int x
, int y
, int w
, int h
, const char* label
);
47 void play_note(int note
, int rec
);
48 void release_note(int note
, int rec
);
49 void cut_notes(int rec
);
50 void set_sustain(int state
);
52 void kb_play_note(int note
);
53 void kb_release_note(int note
);
57 int handle(int event
);
60 void highlight_note(int note
);
61 void highlight_clear();
65 int keyboard_handler(int e
, fltk::Window
* w
);
71 combo(unsigned zkey
, unsigned zmod
){key
=zkey
; mod
=zmod
;}
72 combo(){key
=' '; mod
=0;}
73 int operator==(combo c
){
74 return (c
.key
==key
&& c
.mod
==mod
) ? 1 : 0;
78 class KeyGrabber
: public fltk::Widget
{
87 KeyGrabber(int x
, int y
, int w
, int h
, const char* label
);
89 int handle(int event
);
92 int set_key(int key
, int mod
);
96 void save(std::fstream
& f
);
97 void load(std::fstream
& f
);
100 void set_keymap(int which
, int index
, int key
, int mod
);
101 char* get_keystring(int key
, int mod
);
103 void load_keymap(std::fstream
& f
);
104 void save_keymap(std::fstream
& f
);
105 void load_default_keymap();
107 int zoom_out_key(unsigned,unsigned);
108 int zoom_in_key(unsigned,unsigned);