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/>.
30 #define GET_RT_FROM_cbox_master(ptr) ((ptr)->engine->rt)
32 enum cbox_master_transport_state
42 float tempo
, new_tempo
;
44 int timesig_denom
; // must be 4 for now
46 enum cbox_master_transport_state state
;
47 struct cbox_engine
*engine
;
48 struct cbox_song
*song
;
49 struct cbox_song_playback
*spb
;
50 struct cbox_command_target cmd_target
;
60 extern struct cbox_master
*cbox_master_new(struct cbox_engine
*engine
);
61 extern void cbox_master_set_sample_rate(struct cbox_master
*master
, int srate
);
62 extern void cbox_master_set_tempo(struct cbox_master
*master
, float tempo
);
63 extern void cbox_master_set_timesig(struct cbox_master
*master
, int beats
, int unit
);
64 //extern void cbox_master_to_bbt(const struct cbox_master *master, struct cbox_bbt *bbt, int time_samples);
65 //extern uint32_t cbox_master_song_pos_from_bbt(struct cbox_master *master, const struct cbox_bbt *bbt);
66 extern void cbox_master_play(struct cbox_master
*master
);
67 extern void cbox_master_stop(struct cbox_master
*master
);
68 extern void cbox_master_panic(struct cbox_master
*master
);
69 extern void cbox_master_seek_ppqn(struct cbox_master
*master
, uint32_t pos_ppqn
);
70 extern void cbox_master_seek_samples(struct cbox_master
*master
, uint32_t pos_samples
);
71 extern void cbox_master_destroy(struct cbox_master
*master
);
73 int cbox_master_ppqn_to_samples(struct cbox_master
*master
, int time_ppqn
);
74 int cbox_master_samples_to_ppqn(struct cbox_master
*master
, int time_samples
);