Changed the backend api somewhat. Added bpm==0 check.
[epichord.git] / src / backend.h
blobe19236c62ad36aad3797753f8528d11de3d0544e
1 /*
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
23 #ifndef backend_h
24 #define backend_h
26 #include <inttypes.h>
28 #define TICKS_PER_BEAT 128
30 int init_backend(int* argc, char*** argv);
31 int shutdown_backend();
32 int start_backend();
33 int pause_backend();
36 void dispatch_event(mevent* e, int track, int tick_base);
39 int reset_backend(int tick);
40 void toggle_backend_recording();
42 int is_backend_playing();
43 int is_backend_recording();
45 void set_loop_start(int tick);
46 void set_loop_end(int tick);
47 int get_loop_start();
48 int get_loop_end();
49 void toggle_loop();
51 void set_solo(int s);
52 int get_solo();
54 void backend_set_passthru(int v);
56 void set_bpm(int new_bpm);
58 int get_play_position();
60 void send_midi(char* raw, uint16_t n, uint8_t p);
61 void send_midi_local(char* raw, uint16_t n);
62 int recv_midi(int* chan, int* tick, int* type, int* val1, int* val2);
63 const char* getsysexbuf();
64 void all_notes_off();
66 void program_change(int track, int prog);
67 void midi_bank_controller(int track, int bank);
68 void midi_volume_controller(int track, int vol);
69 void midi_pan_controller(int track, int pan);
70 void midi_expression_controller(int track, int expr);
72 void midi_note_off(int note, int chan, int port);
73 void midi_channel_off(int chan, int port);
74 void midi_track_off(int track);
78 enum {SESSION_NOMORE,SESSION_LOAD,SESSION_SAVE,SESSION_QUIT,SESSION_UNHANDLED};
79 int backend_session_process();
80 char* get_session_string();
82 #endif