-
-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathcontroller.cpp
More file actions
40 lines (33 loc) · 928 Bytes
/
controller.cpp
File metadata and controls
40 lines (33 loc) · 928 Bytes
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
// Copyright 2018-2023 Kushview, LLC <info@kushview.net>
// SPDX-License-Identifier: GPL-3.0-or-later
#include <element/controller.hpp>
namespace element {
using namespace juce;
Controller::Controller (const ValueTree& data)
: Model (data)
{
if (data.isValid())
{
jassert (data.hasType (types::Controller));
jassert (data.hasProperty (tags::uuid));
setMissingProperties();
}
}
Controller::Controller (const String& name)
: Model (types::Controller, EL_CONTROLLER_VERSION)
{
setName (name);
setMissingProperties();
}
void Controller::setMissingProperties()
{
stabilizePropertyString (tags::uuid, Uuid().toString());
stabilizePropertyString (tags::name, "New Device");
stabilizePropertyString (tags::inputDevice, "");
}
Controller Control::controller() const
{
const Controller device (objectData.getParent());
return device;
}
} // namespace element