MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / CardinalRemoteUI

Method CardinalRemoteUI

src/CardinalRemote/RemoteUI.cpp:33–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31// --------------------------------------------------------------------------------------------------------------------
32
33CardinalRemoteUI::CardinalRemoteUI(Window& window, const std::string& templatePath)
34 : NanoTopLevelWidget(window)
35{
36 CardinalPluginContext* const context = static_cast<CardinalPluginContext*>(rack::contextGet());
37 context->nativeWindowId = window.getNativeWindowHandle();
38 context->tlw = this;
39
40 // --------------------------------------------------------------------------
41
42 rack::window::WindowSetPluginRemote(context->window, this);
43
44 // hide "Browse VCV Library" button
45 rack::widget::Widget* const browser = context->scene->browser->children.back();
46 rack::widget::Widget* const headerLayout = browser->children.front();
47 rack::widget::Widget* const libraryButton = headerLayout->children.back();
48 libraryButton->hide();
49
50 // Report to user if something is wrong with the installation
51 std::string errorMessage;
52
53 if (rack::asset::systemDir.empty())
54 {
55 errorMessage = "Failed to locate Cardinal plugin bundle.\n"
56 "Install Cardinal with its plugin bundle folder intact and try again.";
57 }
58 else if (! rack::system::exists(rack::asset::systemDir))
59 {
60 errorMessage = rack::string::f("System directory \"%s\" does not exist. "
61 "Make sure Cardinal was downloaded and installed correctly.",
62 rack::asset::systemDir.c_str());
63 }
64
65 if (! errorMessage.empty())
66 asyncDialog::create(errorMessage.c_str());
67
68 context->window->step();
69
70 WindowParametersSetCallback(context->window, this);
71
72 // --------------------------------------------------------------------------
73
74 addIdleCallback(this);
75}
76
77CardinalRemoteUI::~CardinalRemoteUI()
78{

Callers

nothing calls this directly

Calls 11

fFunction · 0.85
createFunction · 0.85
backMethod · 0.80
frontMethod · 0.80
c_strMethod · 0.80
WindowSetPluginRemoteFunction · 0.70
contextGetFunction · 0.50
hideMethod · 0.45
emptyMethod · 0.45
stepMethod · 0.45

Tested by

no test coverage detected