-
Notifications
You must be signed in to change notification settings - Fork 0
/
meta_track.hxx
69 lines (50 loc) · 1.41 KB
/
meta_track.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef QMC_H_TEMPO
# define QMC_H_TEMPO
# include "base.hxx"
namespace qmc
{
inline
tempo_t tick_len_microsec(uint32_t tempo , uint16_t resolution)
{
return (tempo_t)tempo / resolution;
}
class tempo_info
{
public:
tempo_t _tempo;
event_len_t _len;
};
/*
Return true if the current event is tempo-change event , in that case ,
`p_tempo` would be written.
*/
inline
bool scan_meta_track(byte_t* event_begin , tempo_info* p_tempo ,
resolution_t resolution)
{
tick_t base_tick = 0;
if((*event_begin == 0xFF) && (*(uint16_t*)(++event_begin) == 0x5103))
{
//p_tempo->_tempo =
}
return false;
}
/*
@tempo_count :
*/
void analyse_tempo_track(tempo_info* tempo_buf , longsize_t tempo_count ,
longsize_t& out_tempo_count , byte_t* track_buf ,
size_t track_size , m_realloc_func_t reallocator )
{
__QMC_ASSERT_NULLPTR__(tempo_buf);
__QMC_ASSERT__(tempo_count);
__QMC_ASSERT_NULLPTR__(track_buf);
__QMC_ASSERT_NULLPTR__(reallocator);
byte_t* end_of_track = track_buf + track_size;
while (track_buf <= end_of_track)
{
/* code */
}
}
} // namespace qmc
#endif // QMC_H_TEMPO