Fixed bug that crashed on saving after importing.
[epichord.git] / src / backend.h
blob8e01f0bd860d47b6b5a8f229875a515923eca3d5
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 int reset_backend(int tick);
37 void toggle_backend_recording();
39 int is_backend_playing();
40 int is_backend_recording();
42 void set_loop_start(int tick);
43 void set_loop_end(int tick);
44 int get_loop_start();
45 int get_loop_end();
46 void toggle_loop();
48 void set_solo(int s);
49 int get_solo();
51 void backend_set_passthru(int v);
53 void set_bpm(int new_bpm);
55 int get_play_position();
57 void send_midi(char* raw, uint16_t n, uint8_t p);
58 void send_midi_local(char* raw, uint16_t n);
59 int recv_midi(int* chan, int* tick, int* type, int* val1, int* val2);
60 const char* getsysexbuf();
61 void all_notes_off();
63 void program_change(int track, int prog);
64 void midi_bank_controller(int track, int bank);
65 void midi_volume_controller(int track, int vol);
66 void midi_pan_controller(int track, int pan);
67 void midi_expression_controller(int track, int expr);
69 void midi_note_off(int note, int chan, int port);
70 void midi_channel_off(int chan, int port);
71 void midi_track_off(int track);
75 enum {SESSION_NOMORE,SESSION_LOAD,SESSION_SAVE,SESSION_QUIT,SESSION_UNHANDLED};
76 int backend_session_process();
77 char* get_session_string();
79 #endif