score-plugin-gfx/Gfx/Settings/Model.hpp
1 #pragma once
2 #include <Gfx/Graph/RenderState.hpp>
3 
4 #include <score/plugins/ProjectSettings/ProjectSettingsModel.hpp>
5 #include <score/plugins/settingsdelegate/SettingsDelegateModel.hpp>
6 
7 #include <score_plugin_gfx_export.h>
8 
9 #include <verdigris>
10 namespace Gfx::Settings
11 {
12 
14 {
15  const QString OpenGL{"OpenGL"};
16  const QString Vulkan{"Vulkan"};
17  const QString Metal{"Metal"};
18  const QString D3D11{"Direct3D 11"};
19  operator QStringList() const noexcept;
20 };
21 
23 {
24  const QString None{"None"};
25  const QString CUDA{"CUDA"};
26  const QString QSV{"Intel QuickSync"};
27  const QString VDPAU{"VDPAU"};
28  const QString VAAPI{"VA-API"};
29  const QString D3D{"Direct3D 11"};
30  const QString DXVA{"DXVA2"};
31  const QString VideoToolbox{"Video Toolbox"};
32  const QString V4L2{"V4L2-M2M"};
33  operator QStringList() const noexcept;
34 };
35 
37 {
38  W_OBJECT(Model)
39 
40  QString m_GraphicsApi{};
41  QString m_HardwareDecode{};
42  int m_DecodingThreads{1};
43  double m_Rate{};
44  int m_Samples{1};
45  bool m_VSync{};
46 
47 public:
48  Model(QSettings& set, const score::ApplicationContext& ctx);
49 
50  SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_GFX_EXPORT, QString, HardwareDecode)
51  SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_GFX_EXPORT, int, DecodingThreads)
52  SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_GFX_EXPORT, double, Rate)
53  SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_GFX_EXPORT, int, Samples)
54  SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_GFX_EXPORT, bool, VSync)
55 
56 public:
57  score::gfx::GraphicsApi graphicsApiEnum() const noexcept;
58  QString getGraphicsApi() const;
59  void initGraphicsApi(QString);
60  void setGraphicsApi(QString);
61  void GraphicsApiChanged(QString arg)
62  E_SIGNAL(SCORE_PLUGIN_GFX_EXPORT, GraphicsApiChanged, arg)
63  SCORE_SETTINGS_PROPERTY(QString, GraphicsApi)
64 };
65 
66 SCORE_SETTINGS_PARAMETER(Model, GraphicsApi)
67 SCORE_SETTINGS_PARAMETER(Model, HardwareDecode)
68 SCORE_SETTINGS_PARAMETER(Model, DecodingThreads)
69 SCORE_SETTINGS_PARAMETER(Model, Rate)
70 SCORE_SETTINGS_PARAMETER(Model, Samples)
71 SCORE_SETTINGS_PARAMETER(Model, VSync)
72 }
Definition: score-plugin-gfx/Gfx/Settings/Model.hpp:37
Definition: SettingsDelegateModel.hpp:16
GraphicsApi
Available graphics APIs to use.
Definition: RenderState.hpp:17
Definition: score-plugin-gfx/Gfx/Settings/Model.hpp:14
Definition: score-plugin-gfx/Gfx/Settings/Model.hpp:23
Used to access all the application-wide state and structures.
Definition: ApplicationContext.hpp:24