-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathplugin.cpp
More file actions
executable file
·74 lines (57 loc) · 1.87 KB
/
Copy pathplugin.cpp
File metadata and controls
executable file
·74 lines (57 loc) · 1.87 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
65
66
67
68
69
70
71
72
73
74
#include "plugin.h"
#include <assert.h>
#include <cstring>
#include "audio_encoder.h"
// NOTE: When creating a plugin for release, please generate a new Plugin UUID in order to prevent conflicts with other third-party plugins.
static const uint8_t pMyUUID[] = { 0x5d, 0x43, 0xce, 0x60, 0x45, 0x11, 0x4f, 0x58, 0x87, 0xde, 0xf3, 0x02, 0x80, 0x1e, 0x7b, 0xbc };
using namespace IOPlugin;
StatusCode g_HandleGetInfo(HostPropertyCollectionRef* p_pProps)
{
StatusCode err = p_pProps->SetProperty(pIOPropUUID, propTypeUInt8, pMyUUID, 16);
if (err == errNone)
{
err = p_pProps->SetProperty(pIOPropName, propTypeString, "Sample Plugin", strlen("Sample Plugin"));
}
return err;
}
StatusCode g_HandleCreateObj(unsigned char* p_pUUID, ObjectRef* p_ppObj)
{
if (memcmp(p_pUUID, AudioEncoder::s_UUID, 16) == 0)
{
*p_ppObj = new AudioEncoder();
return errNone;
}
return errUnsupported;
}
StatusCode g_HandlePluginStart()
{
// perform libs initialization if needed
return errNone;
}
StatusCode g_HandlePluginTerminate()
{
return errNone;
}
StatusCode g_ListCodecs(HostListRef* p_pList)
{
// For any optional/new features, please check Host version before using it
if (GetHostAPI()->version >= 0x00000001)
{
return AudioEncoder::s_RegisterCodecs(p_pList);
}
return errNone;
}
StatusCode g_ListContainers(HostListRef* p_pList)
{
return errNone;
// Register dummy container if you want to try it, which only prints to the log without exporting any real file
// return DummyContainer::s_Register(p_pList);
}
StatusCode g_GetEncoderSettings(unsigned char* p_pUUID, HostPropertyCollectionRef* p_pValues, HostListRef* p_pSettingsList)
{
if (memcmp(p_pUUID, AudioEncoder::s_UUID, 16) == 0)
{
return AudioEncoder::s_GetEncoderSettings(p_pValues, p_pSettingsList);
}
return errNoCodec;
}