forked from cgestes/multifxvst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultifxVSTmain.cpp
76 lines (59 loc) · 1.7 KB
/
multifxVSTmain.cpp
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
#include "stdafx.h"
#ifndef __multifxVST__
#include "multifxVST.h"
#endif
#include "stockeffet.h"
#include "Chaindlg.h"
#include "multifxVSTmain.h"
bool oome = false;
//------------------------------------------------------------------------
// Prototype of the export function main
//------------------------------------------------------------------------
/*AEffect **/long main (audioMasterCallback audioMaster);
//------------------------------------------------------------------------
/*AEffect **/long main (audioMasterCallback audioMaster)
{
TRACE("main\n");
// Get VST Version
if (!audioMaster (0, audioMasterVersion, 0, 0, 0, 0))
return 0; // old version
// Create the AudioEffect
multifxVST* effect = new multifxVST (audioMaster);
if (!effect)
return 0;
TRACE("main2\n");
// Check if no problem in constructor of AGain
if (oome)
{
delete effect;
return 0;
}
return (long)effect->getAeffect ();
}
CChainApp theApp;
void* hInstance = NULL;
//#define _WIN32_DCOM
BOOL CChainApp::InitInstance()
{
CWinApp::InitInstance();
//Enable3dControls();
HRESULT result = 0;;
result=CoInitialize(NULL);//Ex(NULL,COINIT_MULTITHREADED | COINIT_SPEED_OVER_MEMORY);
if(result != S_OK)
{//RPC_E_CHANGED_MODE
TRACE("Ole init error\n");
}
//AfxEnableControlContainer();
//CoInitialize(NULL);//ole init
//OleInitialize(NULL);
TRACE("CChainApp::InitInstance()\n");
hInstance = m_hInstance;
return TRUE;//continue running
}
int CChainApp::ExitInstance()
{
//on uninitialse OLE
CoUninitialize();
TRACE("CChainApp::ExitInstance()\n");
return CWinApp::ExitInstance();
}