Subversion Repositories svn.mios32

Rev

Rev 1327 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
159 tk 1
// $Id: seq_bpm.h 1421 2012-02-11 23:44:23Z tk $
2
/*
3
 * Header file for BPM generator routines
4
 *
5
 * ==========================================================================
6
 *
7
 *  Copyright (C) 2008 Thorsten Klose (tk@midibox.org)
8
 *  Licensed for personal non-commercial use only.
9
 *  All other rights reserved.
10
 *
11
 * ==========================================================================
12
 */
13
 
14
#ifndef _SEQ_BPM_H
15
#define _SEQ_BPM_H
16
 
1327 tk 17
#ifdef __cplusplus
18
extern "C" {
19
#endif
20
 
159 tk 21
/////////////////////////////////////////////////////////////////////////////
22
// Global definitions
23
/////////////////////////////////////////////////////////////////////////////
24
 
25
// MIOS32 timer used by BPM generator (0..2)
26
#ifndef SEQ_BPM_MIOS32_TIMER_NUM
27
#define SEQ_BPM_MIOS32_TIMER_NUM 0
28
#endif
29
 
30
 
31
/////////////////////////////////////////////////////////////////////////////
32
// Global Types
33
/////////////////////////////////////////////////////////////////////////////
34
 
35
typedef enum {
36
  SEQ_BPM_MODE_Auto,
37
  SEQ_BPM_MODE_Master,
38
  SEQ_BPM_MODE_Slave
39
} seq_bpm_mode_t;
40
 
1207 tk 41
typedef enum {
42
  SEQ_BPM_RUN_MODE_Off,
43
  SEQ_BPM_RUN_MODE_Armed,
44
  SEQ_BPM_RUN_MODE_Clocked
45
} seq_bpm_run_mode_t;
159 tk 46
 
1207 tk 47
 
159 tk 48
/////////////////////////////////////////////////////////////////////////////
49
// Prototypes
50
/////////////////////////////////////////////////////////////////////////////
51
 
52
extern s32 SEQ_BPM_Init(u32 mode);
53
 
54
extern seq_bpm_mode_t SEQ_BPM_ModeGet(void);
55
extern s32 SEQ_BPM_ModeSet(seq_bpm_mode_t mode);
56
 
195 tk 57
extern float SEQ_BPM_Get(void);
58
extern s32 SEQ_BPM_Set(float bpm);
159 tk 59
 
1421 tk 60
extern float SEQ_BPM_EffectiveGet(void);
61
 
186 tk 62
extern s32 SEQ_BPM_PPQN_Get(void);
63
extern s32 SEQ_BPM_PPQN_Set(u16 ppqn);
64
 
159 tk 65
extern u32 SEQ_BPM_TickGet(void);
66
extern s32 SEQ_BPM_TickSet(u32 tick);
186 tk 67
 
192 tk 68
extern s32 SEQ_BPM_IsRunning(void);
1207 tk 69
extern seq_bpm_run_mode_t SEQ_BPM_RunModeGet(void);
166 tk 70
extern s32 SEQ_BPM_IsMaster(void);
186 tk 71
extern s32 SEQ_BPM_CheckAutoMaster(void);
159 tk 72
 
73
extern s32 SEQ_BPM_NotifyMIDIRx(u8 midi_byte);
74
 
75
extern s32 SEQ_BPM_Start(void);
192 tk 76
extern s32 SEQ_BPM_Cont(void);
159 tk 77
extern s32 SEQ_BPM_Stop(void);
78
 
79
extern s32 SEQ_BPM_ChkReqStop(void);
80
extern s32 SEQ_BPM_ChkReqStart(void);
81
extern s32 SEQ_BPM_ChkReqCont(void);
82
extern s32 SEQ_BPM_ChkReqClk(u32 *bpm_tick_ptr);
186 tk 83
extern s32 SEQ_BPM_ChkReqSongPos(u16 *song_pos);
159 tk 84
 
184 tk 85
extern u32 SEQ_BPM_TicksFor_mS(u16 time_ms);
159 tk 86
 
184 tk 87
 
159 tk 88
/////////////////////////////////////////////////////////////////////////////
89
// Export global variables
90
/////////////////////////////////////////////////////////////////////////////
91
 
1327 tk 92
#ifdef __cplusplus
93
}
94
#endif
159 tk 95
 
96
#endif /* _SEQ_BPM_H */