Loading...
Searching...
No Matches
score-plugin-ui/Ui/PortProbe.hpp
1#pragma once
2#include <Process/Dataflow/PortProbe.hpp>
3
4#include <Gfx/Widgets/TexturePreview.hpp>
5
6#include <ossia/network/dataspace/dataspace.hpp>
7#include <ossia/network/value/value.hpp>
8
9#include <QPointer>
10
11#include <boost/circular_buffer.hpp>
12#include <memory>
13#include <vector>
14
15namespace Execution
16{
17class PortTap;
18}
19namespace Ui
20{
28{
29public:
30 ProbeItem(const Process::Port& port, const Process::Context& ctx);
31 ~ProbeItem() override;
32
33 QRectF boundingRect() const override;
34 void paint(QPainter* p, const QStyleOptionGraphicsItem*, QWidget*) override;
35
36protected:
37 void hoverEnterEvent(QGraphicsSceneHoverEvent* ev) override;
38 void hoverLeaveEvent(QGraphicsSceneHoverEvent* ev) override;
39 void timerEvent(QTimerEvent* ev) override;
40
41private:
43 void attach();
45 bool drain();
47 bool paintUnit(QPainter& p, const QRectF& r) const;
48
49 QPointer<const Process::Port> m_port;
50 const Process::Context& m_context;
51 QString m_title;
52 std::unique_ptr<Execution::PortTap> m_tap;
53 Gfx::TexturePreview m_texture;
54
55 // Audio: per channel, and the first channels' latest samples
56 std::vector<float> m_peak, m_rms;
57 std::vector<std::vector<float>> m_trace;
58 std::vector<float> m_buffer;
59 uint64_t m_audioFirst{};
60 // MIDI and values: the latest, newest last
61 boost::circular_buffer<QString> m_lines;
62 boost::circular_buffer<float> m_trail;
63 // Values with a unit: the latest one, and where positions went
64 ossia::unit_t m_unit;
65 ossia::value m_last;
66 boost::circular_buffer<QPointF> m_path;
67 int m_sinceAttach{};
69 bool m_executionUpdates{true};
70};
71
73{
74 SCORE_CONCRETE("4a1e7f2c-9d36-4b58-a0c1-7e3f5b2d8c91")
75public:
77 make(const Process::Port& port, const Process::Context& ctx) override;
78};
79}
What a texture outlet produces, as an image any view can paint: an inspector widget,...
Definition TexturePreview.hpp:33
Definition Port.hpp:106
Definition score-lib-process/Process/Dataflow/PortProbe.hpp:29
Definition score-lib-process/Process/Dataflow/PortProbe.hpp:22
Definition score-plugin-ui/Ui/PortProbe.hpp:73
Process::PortProbeItem * make(const Process::Port &port, const Process::Context &ctx) override
A probe for port, or null when there is nothing to show.
Definition score-plugin-ui/Ui/PortProbe.cpp:475
Definition score-plugin-ui/Ui/PortProbe.hpp:28
Components used for the execution of a score.
Definition PortTap.cpp:24
Definition ProcessContext.hpp:12