Loading...
Searching...
No Matches
PortListWidget.hpp
1#pragma once
2#include <QString>
3#include <QWidget>
4
5#include <score_lib_process_export.h>
6
7class QLabel;
8namespace score
9{
10class ArrowButton;
11}
12
13namespace Inspector
14{
15class Layout;
16}
17namespace Process
18{
19class Port;
20class Inlet;
21class Outlet;
22class ControlInlet;
23class ControlOutlet;
24}
25namespace score
26{
27struct DocumentContext;
28}
29namespace Process
30{
31class ProcessModel;
32
43struct SCORE_LIB_PROCESS_EXPORT AddressStatus
44{
45 enum Kind
46 {
52 Unused
53 } kind{Used};
54
56 QString reason;
57
58 static AddressStatus of(const Process::Port& port, const score::DocumentContext& ctx);
59};
60
61class SCORE_LIB_PROCESS_EXPORT PortWidgetSetup final
62{
63public:
65 struct Drawer
66 {
67 QWidget* widget{};
68 Inspector::Layout* layout{};
69 score::ArrowButton* button{};
70
71 void setOpen(bool open) const;
72 };
73
82 static Drawer setupWithDrawer(
83 const Process::Port& port, QWidget* main, const score::DocumentContext& ctx,
84 Inspector::Layout& lay, QWidget* parent);
85
87 static void setupAddressPort(
88 const Process::Port& port, const score::DocumentContext& ctx,
89 Inspector::Layout& lay, QWidget* parent);
90
92 static QWidget* makeCablesWidget(
93 const Process::Port& port, const score::DocumentContext& ctx, QWidget* parent);
94
97 static QWidget* withAddressStatus(
98 const Process::Port& port, QWidget* address_widget,
99 const score::DocumentContext& ctx, QWidget* parent);
100
101 static void setupAlone(
102 const Process::Port& port, const score::DocumentContext& ctx,
103 Inspector::Layout& lay, QWidget* parent);
104
110 static void setupInInspector(
111 const Process::Port& port, const score::DocumentContext& ctx,
112 Inspector::Layout& lay, QWidget* parent);
113 static void setupInLayout(
114 const Process::Port& port, const score::DocumentContext& ctx,
115 Inspector::Layout& lay, QWidget* parent);
116 static void setupControl(
117 const Process::ControlInlet& inlet, QWidget* inlet_widget,
118 const score::DocumentContext& ctx, Inspector::Layout& lay, QWidget* parent);
119 static void setupControl(
120 const Process::ControlOutlet& inlet, QWidget* inlet_widget,
121 const score::DocumentContext& ctx, Inspector::Layout& lay, QWidget* parent);
122
123 static QWidget* makeAddressWidget(
124 const Process::Port& port, const score::DocumentContext& ctx, QWidget* parent);
125
127 static QWidget* makeScriptableWidget(
128 const Process::Port& port, const score::DocumentContext& ctx, QWidget* parent);
129
130private:
131 static QLabel* setupImpl(
132 const QString& txt, const Port& port, const score::DocumentContext& ctx,
133 Inspector::Layout& lay, QWidget* parent, bool withCables);
134 static void setupControlImpl(
135 const Process::Port& port, QWidget* inlet_widget,
136 const score::DocumentContext& ctx, Inspector::Layout& lay, QWidget* parent);
137};
143class SCORE_LIB_PROCESS_EXPORT PortListWidget final : public QWidget
144{
145public:
147 const Process::ProcessModel& proc, const score::DocumentContext& ctx,
148 QWidget* parent);
149
150 void reload();
151
152private:
153 const Process::ProcessModel& m_process;
154 const score::DocumentContext& m_ctx;
155 std::vector<QWidget*> m_inlets;
156 std::vector<QWidget*> m_outlets;
157};
158}
Definition lib/score/widgets/Layout.hpp:53
Definition Port.hpp:247
Definition Port.hpp:481
Definition Port.hpp:106
Show the list of ports / addresses.
Definition PortListWidget.hpp:144
Definition PortListWidget.hpp:62
The Process class.
Definition score-lib-process/Process/Process.hpp:82
Definition ArrowButton.hpp:11
Classes used for making and extending the inspector (default right panel).
Definition lib/score/widgets/Layout.hpp:27
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1115
@ Unused
Sitting in the project folder with nothing pointing at it.
Base toolkit upon which the software is built.
Definition Application.cpp:85
Whether the cables of a port keep its address from taking effect.
Definition PortListWidget.hpp:44
QString reason
Explanation for the user, empty when kind is Used.
Definition PortListWidget.hpp:56
Kind
Definition PortListWidget.hpp:46
@ Used
No address, or the address is used.
Definition PortListWidget.hpp:48
@ WhileCablesIdle
Used only while a process at the other end of a cable is not playing.
Definition PortListWidget.hpp:50
A collapsible group of rows shown under a port.
Definition PortListWidget.hpp:66
Definition DocumentContext.hpp:18