| 35 | } |
| 36 | |
| 37 | Result 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 | |
| 83 | const String CtrlrManager::getInstanceNameForHost() const |
| 84 | { |