-
Notifications
You must be signed in to change notification settings - Fork 14
/
SpecDSound.h
83 lines (63 loc) · 2.94 KB
/
SpecDSound.h
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
/*****************************************************************************/
/* SpecDSound.h: interface for the CSpecDSoundInDevice class. */
/*****************************************************************************/
/******************************************************************************
Copyright (C) 2006 Hermann Seib
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
#if !defined(AFX_SPECDSOUND_H__8FAFD4E4_9754_11D8_8223_4000001054B2__INCLUDED_)
#define AFX_SPECDSOUND_H__8FAFD4E4_9754_11D8_8223_4000001054B2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "DSoundDev.h"
#include "mfcwave.h"
/*****************************************************************************/
/* CSpecDSoundInDevice : DirectSound input device for VSTHost */
/*****************************************************************************/
class CWorkThread;
class CSpecDSoundInDevice : public CDSoundInDevice
{
public:
CSpecDSoundInDevice();
virtual ~CSpecDSoundInDevice();
virtual void OnSwitch(int nBuffer);
public:
void SetWorkThread(CWorkThread * pThd) { pWorkThread = pThd; }
protected:
CWorkThread * pWorkThread;
float * pBuffers[2];
int nCurBuf;
};
/*****************************************************************************/
/* CSpecDSoundOutDevice : DirectSound output device for VSTHost */
/*****************************************************************************/
class CSpecDSoundOutDevice : public CDSoundOutDevice
{
public:
CSpecDSoundOutDevice();
virtual ~CSpecDSoundOutDevice();
virtual void OnOpen();
virtual void OnSwitch(int nBuffer);
public:
void SendData(float **pVstData, int nLength);
protected:
short *pwb;
int nCurBuf;
};
/*****************************************************************************/
/* Global Data */
/*****************************************************************************/
extern CSpecDSoundInDevice DSoundIn; /* DirectSound Input Device */
extern CSpecDSoundOutDevice DSoundOut; /* DirectSound Output Device */
#endif // !defined(AFX_SPECDSOUND_H__8FAFD4E4_9754_11D8_8223_4000001054B2__INCLUDED_)