2 Calf Box, an open source musical instrument.
3 Copyright (C) 2010-2011 Krzysztof Foltman
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (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, see <http://www.gnu.org/licenses/>.
19 #ifndef CBOX_PATTERN_H
20 #define CBOX_PATTERN_H
26 CBOX_EXTERN_CLASS(cbox_midi_pattern
)
31 struct cbox_midi_pattern
34 struct cbox_command_target cmd_target
;
35 struct cbox_song
*owner
;
37 struct cbox_midi_event
*events
;
42 struct cbox_blob_serialized_event
45 unsigned char len
, cmd
, byte1
, byte2
;
48 extern struct cbox_midi_pattern
*cbox_midi_pattern_new_metronome(struct cbox_song
*song
, int ts
);
49 extern struct cbox_midi_pattern
*cbox_midi_pattern_load(struct cbox_song
*song
, const char *name
, int is_drum
);
50 extern struct cbox_midi_pattern
*cbox_midi_pattern_load_track(struct cbox_song
*song
, const char *name
, int is_drum
);
51 extern struct cbox_midi_pattern
*cbox_midi_pattern_new_from_blob(struct cbox_song
*song
, const struct cbox_blob
*blob
, int length
);
53 extern struct cbox_blob
*cbox_midi_pattern_to_blob(struct cbox_midi_pattern
*pat
, int *length
);
55 extern gboolean
cbox_midi_pattern_process_cmd(struct cbox_command_target
*ct
, struct cbox_command_target
*fb
, struct cbox_osc_command
*cmd
, GError
**error
);