Loading...
Searching...
No Matches
Process::Monitor Struct Reference
Inheritance diagram for Process::Monitor:
Execution::TapMonitor Gfx::GeometryViewer::SceneMonitor Ui::AudioScope::ScopeMonitor Ui::BufferView::BufferMonitor Ui::Loudness::LoudnessMonitor Ui::MidiDisplay::MidiMonitor Ui::Monitor::TextureShapeMonitor Ui::SignalDisplay::SignalMonitor Ui::Spectrum::SpectrumMonitor Ui::Tuner::TunerMonitor Ui::VUMeter::MeterMonitor

Detailed Description

State shared between a running process and the views that display it.

The process writes it from its execution thread, the views read it on the GUI thread; whatever a subclass adds must be safe for exactly that: no locks, no allocation on the writing side. Both sides hold it through a shared_ptr, so it outlives whichever of the two goes away first.

Several views may show the same process at once (a looping process is drawn once per loop). What a view takes out of the monitor, events or the latest frame, must then reach every one of them: use EventRing and LatestValue, which give all the views refreshed in the same tick of the monitor clock (see monitorFrame()) the same content.

Public Member Functions

 Monitor (const Monitor &)=delete
 
Monitor & operator= (const Monitor &)=delete
 
bool watched () const noexcept
 

Public Attributes

std::atomic< int > viewers {0}
 

Member Data Documentation

◆ viewers

std::atomic<int> Process::Monitor::viewers {0}

How many views are showing the process right now. With none, the process skips what only serves display; measurements that feed its outlets go on.


The documentation for this struct was generated from the following files: