Loading...
Searching...
No Matches
ExplorerModel.hpp
1#pragma once
2#include <score/plugins/ProjectSettings/ProjectSettingsModel.hpp>
3#include <score/plugins/settingsdelegate/SettingsDelegateModel.hpp>
4
5#include <score_plugin_deviceexplorer_export.h>
6
7#include <verdigris>
8namespace Explorer::Settings
9{
11{
12 QString logNothing{"Nothing"};
13 QString logUnfolded{"Unfolded"};
14 QString logEverything{"Everything"};
15 operator QStringList() const { return {logNothing, logUnfolded, logEverything}; }
16};
17
18class SCORE_PLUGIN_DEVICEEXPLORER_EXPORT Model : public score::SettingsDelegateModel
19{
20 W_OBJECT(Model)
21
22 bool m_LocalTree = false;
23 QString m_LogLevel;
24
25public:
26 Model(
27 const UuidKey<score::SettingsDelegateFactory>& k, QSettings& set,
28 const score::ApplicationContext& ctx);
29
30 SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_DEVICEEXPLORER_EXPORT, bool, LocalTree)
31 SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_DEVICEEXPLORER_EXPORT, QString, LogLevel)
32};
33
34SCORE_SETTINGS_PARAMETER(Model, LogLevel)
35SCORE_SETTINGS_DEFERRED_PARAMETER(Model, LocalTree)
36}
37
38namespace Explorer::ProjectSettings
39{
40class Model;
41}
42
43UUID_METADATA(
44 , score::DocumentPluginFactory, Explorer::ProjectSettings::Model,
45 "1f923578-08c3-49be-9ba9-69c144ee2e32")
46
47namespace Explorer::ProjectSettings
48{
49class SCORE_PLUGIN_DEVICEEXPLORER_EXPORT Model final : public score::ProjectSettingsModel
50{
51 W_OBJECT(Model)
52 SCORE_SERIALIZE_FRIENDS
53 MODEL_METADATA_IMPL(Model)
54
55 qreal m_MidiImportRatio = 1.;
56 bool m_RefreshOnStart = false;
57 bool m_ReconnectOnStart = false;
58
59public:
60 Model(const score::DocumentContext&, QObject* parent);
61 ~Model() override;
62
63 template <typename Impl>
64 Model(const score::DocumentContext& ctx, Impl& vis, QObject* parent)
65 : score::ProjectSettingsModel{ctx, vis, parent}
66 {
67 vis.writeTo(*this);
68 }
69
70 SCORE_SETTINGS_PARAMETER_HPP(
71 SCORE_PLUGIN_DEVICEEXPLORER_EXPORT, qreal, MidiImportRatio)
72 SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_DEVICEEXPLORER_EXPORT, bool, RefreshOnStart)
73 SCORE_SETTINGS_PARAMETER_HPP(
74 SCORE_PLUGIN_DEVICEEXPLORER_EXPORT, bool, ReconnectOnStart)
75};
76
77SCORE_SETTINGS_PARAMETER(Model, MidiImportRatio)
78SCORE_SETTINGS_PARAMETER(Model, RefreshOnStart)
79SCORE_SETTINGS_PARAMETER(Model, ReconnectOnStart)
80}
Definition ExplorerModel.hpp:19
Definition UuidKey.hpp:345
Reimplement to instantiate document plug-ins.
Definition DocumentPluginCreator.hpp:25
Definition ProjectSettingsModel.hpp:9
Definition SettingsDelegateModel.hpp:18
Local tree provides a way to extend the tree given through the Engine::Network::LocalDevice.
Definition BaseCallbackWrapper.hpp:9
Base toolkit upon which the software is built.
Definition Application.cpp:112
Definition ExplorerModel.hpp:11
Used to access all the application-wide state and structures.
Definition ApplicationContext.hpp:25
Definition DocumentContext.hpp:18