MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / initEmbeddedInstance

Method initEmbeddedInstance

Source/Core/CtrlrManager/CtrlrManagerInstance.cpp:37–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37Result CtrlrManager::initEmbeddedInstance()
38{
39 ctrlrNativeObject.reset(CtrlrNative::getNativeObject(*this));
40
41 if (ctrlrNativeObject)
42 {
43 MemoryBlock defaultPanelData;
44
45 if (ctrlrNativeObject->getDefaultPanel (defaultPanelData))
46 {
47 ctrlrPlayerInstanceTree = ValueTree::readFromGZIPData (defaultPanelData.getData(), defaultPanelData.getSize());
48
49 if (ctrlrPlayerInstanceTree.isValid())
50 {
51 /* Set any defaults we need **/
52 setEmbeddedDefaults();
53
54 /* Look at the resources, see if
55 we need to import them **/
56 Result result = importInstanceResources(ctrlrNativeObject.get());
57
58 if (result.wasOk())
59 {
60 /** We need to load the panel here
61 but make sure the VST manager is
62 done and that the restore state
63 will give us only the program for
64 the panel **/
65
66 return (addInstancePanel());
67 }
68 else
69 {
70 return (result);
71 }
72 }
73 else
74 {
75 return (Result::fail("InitEmbeddedInstance instance data is invalid"));
76 }
77 }
78 }
79
80 return (Result::fail("InitEmbeddedInstance failed to initialize the OS Native object"));
81}
82
83const String CtrlrManager::getInstanceNameForHost() const
84{

Callers

nothing calls this directly

Calls 7

wasOkMethod · 0.80
resetMethod · 0.45
getDefaultPanelMethod · 0.45
getDataMethod · 0.45
getSizeMethod · 0.45
isValidMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected