Loading...
Searching...
No Matches
PortAddressComboBox.hpp
1#pragma once
2#include <State/Address.hpp>
3
4#include <Device/Protocol/DeviceInterface.hpp>
5
6#include <Process/Dataflow/PortType.hpp>
7
8#include <score/document/DocumentContext.hpp>
9
10#include <QComboBox>
11
12#include <score_lib_process_export.h>
13
14#include <verdigris>
15
16namespace Device
17{
18class DeviceList;
19}
20namespace Process
21{
22class Port;
23
29SCORE_LIB_PROCESS_EXPORT
30Device::NodeKind nodeKindOf(PortType type, bool inlet) noexcept;
31
41SCORE_LIB_PROCESS_EXPORT
42std::vector<State::Address>
43listPortAddresses(Device::DeviceInterface& device, PortType type, bool inlet);
44
45SCORE_LIB_PROCESS_EXPORT
46std::vector<State::Address>
47listPortAddresses(Device::DeviceList& devices, PortType type, bool inlet);
48
57class SCORE_LIB_PROCESS_EXPORT PortAddressComboBox final : public QComboBox
58{
59 W_OBJECT(PortAddressComboBox)
60public:
62 Device::DeviceList& devices, PortType type, bool inlet, QWidget* parent);
63 ~PortAddressComboBox() override;
64
65 void setAddress(const State::AddressAccessor& addr);
66 const State::AddressAccessor& address() const noexcept { return m_address; }
67
69 void reload();
70
71 void addressChanged(const State::AddressAccessor& arg_1)
72 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, addressChanged, arg_1)
73
74private:
75 void dragEnterEvent(QDragEnterEvent* event) override;
76 void dropEvent(QDropEvent* event) override;
77
78 void watch(Device::DeviceInterface& dev);
79 void scheduleReload();
80 void showAddress();
81 void commitText();
82 void commit(State::AddressAccessor addr);
83
84 Device::DeviceList& m_devices;
85 State::AddressAccessor m_address;
86 PortType m_type{};
87 bool m_inlet{};
88 bool m_reloadPending{};
89};
90
95SCORE_LIB_PROCESS_EXPORT
96QComboBox* makePortAddressCombo(
97 const Process::Port& port, const score::DocumentContext& ctx, QWidget* parent);
98}
Definition DeviceInterface.hpp:107
The DeviceList class.
Definition DeviceList.hpp:26
Address picker for the audio / midi / texture / geometry ports.
Definition PortAddressComboBox.hpp:58
Definition Port.hpp:104
Manipulation of Devices from Qt.
Definition AddressSettings.cpp:14
NodeKind
The kinds of nodes a device can carry.
Definition DeviceInterface.hpp:52
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1115
std::vector< State::Address > listPortAddresses(Device::DeviceInterface &dev, PortType type, bool inlet)
The addresses of a device that a port of that type can bind to.
Definition PortAddressComboBox.cpp:124
QComboBox * makePortAddressCombo(const Process::Port &port, const score::DocumentContext &ctx, QWidget *parent)
A PortAddressComboBox bound to a port: follows the port's address and submits a ChangePortAddress com...
Definition PortAddressComboBox.cpp:312
Device::NodeKind nodeKindOf(PortType type, bool inlet) noexcept
The kind of device node a port of that type binds to.
Definition PortAddressComboBox.cpp:34
Definition Address.hpp:108
Definition DocumentContext.hpp:18