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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
#include "stream.h"
#include "common.h"
#ifdef AUDIO_OAL
void CStream::Initialise()
{
//mpg123_init();
}
void CStream::Terminate()
{
//mpg123_exit();
}
CStream::CStream(char *filename, ALuint &source, ALuint (&buffers)[NUM_STREAMBUFFERS]) :
m_alSource(source),
m_alBuffers(buffers),
m_nBitRate(0),
m_nFormat(0),
m_nFreq(0),
m_nLength(0),
m_nLengthMS(0),
m_nBufferSize(0),
m_pBuffer(NULL),
m_bIsOpened(false),
m_bPaused(true)
{
strcpy(m_aFilename, filename);
//DEV("Stream %s\n", m_aFilename);
/*
if ( true )
{
m_nBitRate = (wBitsPerSample * nChannels * wfex.nSamplesPerSec)/1000;
m_nLength = ulDataSize;
m_nLengthMS = m_nLength*8 / m_nBitRate;
m_nBufferSize = nAvgBytesPerSec >> 2;
m_nBufferSize -= (m_nLength % wfex.nBlockAlign);
m_pBuffer = malloc(m_nBufferSize);
m_bIsOpened = true;
return;
}*/
}
CStream::~CStream()
{
Delete();
}
void CStream::Delete()
{
if ( m_pBuffer )
{
free(m_pBuffer);
m_pBuffer = NULL;
}
}
bool CStream::IsOpened()
{
return m_bIsOpened;
}
bool CStream::IsPlaying()
{
return false;
}
void CStream::SetPause(bool bPause)
{
}
void CStream::SetVolume(uint32 nVol)
{
}
void CStream::SetPan(uint8 nPan)
{
}
void CStream::SetPos(uint32 nPos)
{
}
uint32 CStream::GetPos()
{
return 0;
}
uint32 CStream::GetLength()
{
return m_nLengthMS;
}
bool CStream::Setup()
{
if ( !IsOpened() )
return false;
return IsOpened();
}
void CStream::Start()
{
}
void CStream::Update()
{
if ( !IsOpened() )
return;
}
#endif
|