-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathTempoTrackAddOn.cpp
More file actions
45 lines (34 loc) · 1.43 KB
/
TempoTrackAddOn.cpp
File metadata and controls
45 lines (34 loc) · 1.43 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
#include "TempoTrackAddOn.h"
#include <QQmlComponent>
#include <CoreApi/runtimeinterface.h>
#include <QAKQuick/quickactioncontext.h>
#include <coreplugin/ProjectWindowInterface.h>
#include <visualeditor/ProjectViewModelContext.h>
namespace VisualEditor::Internal {
TempoTrackAddOn::TempoTrackAddOn(QObject *parent) : WindowInterfaceAddOn(parent) {
}
TempoTrackAddOn::~TempoTrackAddOn() = default;
void TempoTrackAddOn::initialize() {
auto windowInterface = windowHandle()->cast<Core::ProjectWindowInterface>();
{
QQmlComponent component(Core::RuntimeInterface::qmlEngine(), "DiffScope.VisualEditor", "TempoTrack", this);
if (component.isError()) {
qFatal() << component.errorString();
}
auto o = component.createWithInitialProperties({
{"addOn", QVariant::fromValue(this)}
});
if (component.isError()) {
qFatal() << component.errorString();
}
o->setParent(this);
windowInterface->actionContext()->addAction("org.diffscope.visualeditor.arrangementPanel.additionalTracks.tempo", o->property("tempoTrackComponent").value<QQmlComponent *>());
}
}
void TempoTrackAddOn::extensionsInitialized() {
}
bool TempoTrackAddOn::delayedInitialize() {
return WindowInterfaceAddOn::delayedInitialize();
}
}
#include "moc_TempoTrackAddOn.cpp"