-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNrDll.cpp
More file actions
64 lines (48 loc) · 1.3 KB
/
Copy pathNrDll.cpp
File metadata and controls
64 lines (48 loc) · 1.3 KB
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
/*
* file: NrDll.cpp
*
* This file is part of the NetStreamer software. This file is distributed
* under the GNU GENERAL PUBLIC LICENSE, see the accompanying COPYING file.
*
* Copyright (C) 1997 Rolf Fokkens
*
*/
#include "NrDll.h"
#include "NrNetRadio.h"
#include "NrRecPump.h"
static NrRecPump Pump (50000, "Pump", Rate16kHz);
void PutData (const char *pData, int Size)
{
Pump.PutData (EzString (pData, Size));
};
int GetMessage (int MsCurTime, int *pMsgCode, char *pData, int *pSize)
{
int RetVal;
EzString Data;
NrMsgCode MsgCode;
RetVal = Pump.GetMessage (MsgCode, Data, MsCurTime);
if (RetVal) {
memcpy (pData, Data.Text (), Data.Length ());
*pSize = Data.Length ();
*pMsgCode = MsgCode;
};
return RetVal;
};
int PutMessage (int MsgCode, const char *pData, int Size, char *pRetVal)
{
EzString RetVal;
RetVal = Pump.PutMessage (NrMsgCode (MsgCode), EzString (pData, Size));
memcpy (pRetVal, RetVal.Text (), RetVal.Length ());
return RetVal.Length ();
};
int GetPCM (int MsCurTime, int Amount, char *pData)
{
EzString RetVal;
RetVal = Pump.GetPCM (Amount, MsCurTime);
memcpy (pData, RetVal.Text (), RetVal.Length ());
return RetVal.Length ();
};
int GetBufSize (void)
{
return Pump.GetBufRate ();
};