Loading...
Searching...
No Matches
Ui::Monitor Namespace Reference

Detailed Description

Speaker layouts: the name and position of each channel, for labels, the surround views, and loudness channel weighting (ITU-R BS.1770).

What the views of monitoring processes share: reading their settings from the model, and showing the inlet they draw.

MIDI messages as the monitoring views name them: note names, what a status byte is, and one line of text per message.

What every monitor draws with: the same background, grid, text and colour maps, so that meters, scopes and spectra read as one family.

Power spectra calibrated in dBFS: a full-scale sine reads 0 dB at its frequency whatever the FFT size and window, and a band sums the energy of its bins so that broadband noise reads its true band level.

How the views of textures show one that holds several images, a 3D texture, an array or a cube map: the controls that pick it, and what the node tells the views of the texture it got.

Namespaces

namespace  Buffer
 
namespace  Color
 

Classes

struct  DensityImage
 
class  DoubleClick
 
struct  LayerControl
 
struct  LayoutControl
 
class  PitchTracker
 
struct  Ring
 
struct  SliceControl
 
struct  Speaker
 
struct  SpectrumAnalysis
 
struct  TextureShapeMonitor
 
struct  ThirdOctave
 
struct  Tick
 

Enumerations

enum class  ChannelLayout {
  Auto , Numbered , Stereo , Surround51 ,
  Surround71 , Surround714 , Ambisonic
}
 
enum class  ColorMap {
  Inferno , Viridis , Gray , Magma ,
  Turbo , CoolWarm
}
 
enum class  Window { Hann , BlackmanHarris , FlatTop }
 
enum class  Layout { Single , Overview }
 

Functions

ChannelLayout resolve (ChannelLayout l, int channels) noexcept
 
std::span< const Speaker > speakers (ChannelLayout l, int channels) noexcept
 The speakers of a layout, empty when it has no fixed positions.
 
QString channelLabel (ChannelLayout l, int channels, int c)
 
double loudnessWeight (ChannelLayout l, int channels, int c) noexcept
 
Ring ring (ChannelLayout l, int channels) noexcept
 
const Process::ControlInlet * controlInlet (const Process::ProcessModel &p, std::size_t index) noexcept
 
template<typename E >
E enumValue (const Process::ControlInlet *c, E fallback, E last) noexcept
 
float floatValue (const Process::ControlInlet *c, float fallback) noexcept
 
bool boolValue (const Process::ControlInlet *c, bool fallback) noexcept
 
void showInlet (const Process::ProcessModel &p, std::size_t index, const Process::Context &doc, QGraphicsItem *parent, QObject *owner, double y=5.)
 
template<typename Item , typename... C>
void repaintOn (Item *item, C *... controls)
 Repaints item whenever one of the given controls changes in the model.
 
void setControls (const score::CommandStackFacade &stack, std::initializer_list< std::pair< const Process::ControlInlet *, ossia::value > > values)
 Sets several controls as one undoable edit.
 
QString midiNoteName (int pitch)
 The name of a MIDI note, middle C (60) being C4; "?" out of 0 to 127.
 
constexpr libremidi::message_type midiMessageType (uint8_t status, uint8_t d1, uint8_t d2) noexcept
 
constexpr bool isChannelMessage (libremidi::message_type t) noexcept
 Whether the message belongs to a channel, as opposed to the system ones.
 
QString describeMidi (uint8_t status, uint8_t d1, uint8_t d2, uint32_t size, bool aligned)
 
QString midiBytesText (uint8_t status, uint8_t d1, uint8_t d2, uint32_t size)
 The bytes of a message in hexadecimal, or its size for a SysEx.
 
QColor background ()
 
QColor gridColor ()
 
QColor majorGridColor ()
 
QColor textColor ()
 
QColor traceColor ()
 
QColor warnColor ()
 
QColor overColor ()
 
const QFont & smallFont ()
 
QColor channelColor (int i)
 Colours for the n-th channel or trace, distinct on a dark background.
 
QColor zoneColor (double v, double warn, double over)
 
QLinearGradient zoneGradient (double y_lo, double y_hi, double lo, double hi, double warn, double over, double alpha=1.)
 
const std::array< QRgb, 256 > & colorMap (ColorMap m)
 
QString formatHz (double hz)
 "1.5k", "20k", "440"
 
std::vector< Tick > linearTicks (double lo, double hi, double pixels, double min_spacing=18., QString unit={})
 
std::vector< Tick > frequencyTicks (double lo, double hi, double pixels)
 Ticks of a log frequency axis: decades labelled, 2 and 5 in between.
 
void drawLabel (QPainter &p, const QRectF &r, int flags, const QString &text, QColor c=textColor())
 Draws text in the small monitor font, flags as for QPainter::drawText.
 
template<typename XOf >
void drawXAxisLabels (QPainter &p, const QRectF &plot, const std::vector< Tick > &ticks, XOf x_of)
 
template<typename YOf >
void drawYAxisLabels (QPainter &p, const QRectF &plot, const std::vector< Tick > &ticks, YOf y_of)
 
void drawReadout (QPainter &p, QPointF topLeft, const QStringList &lines)
 A readout box in a corner: semi-opaque so that it stays legible over traces.
 
template<typename T , typename V >
void pushRing (boost::circular_buffer< T > &ring, V &&v, std::size_t limit=std::numeric_limits< std::size_t >::max())
 
QString noteName (double f, double *cents=nullptr)
 "A4", "C#3"
 
void publish (TextureShapeMonitor &m, const score::gfx::TextureShape &s) noexcept
 The node tells the views the texture it got.
 
score::gfx::TextureShape latestShape (const TextureShapeMonitor &m) noexcept
 
score::gfx::ShownTexture shownTexture (const score::gfx::TextureShape &shape, Layout layout, float slice, int layer) noexcept
 
score::gfx::ShownTexture shownTexture (const Process::ProcessModel &p, const score::gfx::TextureShape &shape) noexcept
 
QStringList describeShown (const score::gfx::ShownTexture &shown, std::optional< QPointF > at={})
 

Variables

constexpr std::string_view channel_layout_names []
 

Enumeration Type Documentation

◆ ColorMap

enum class Ui::Monitor::ColorMap
strong

Perceptual colour maps for intensities in [0, 1], built once from the anchor colours of matplotlib's maps.

Enumerator
CoolWarm 

Diverging: blue below the middle, red above.

Function Documentation

◆ controlInlet()

const Process::ControlInlet * Ui::Monitor::controlInlet ( const Process::ProcessModel &  p,
std::size_t  index 
)
inlinenoexcept

The control inlet at index, or null: processes saved before an inlet was added do not have it until they are reloaded.

◆ describeMidi()

QString Ui::Monitor::describeMidi ( uint8_t  status,
uint8_t  d1,
uint8_t  d2,
uint32_t  size,
bool  aligned 
)
inline

One line describing a message. aligned pads the fields into columns, for a list in a monospace font; otherwise the line is as short as it gets. size is the size of the whole message, which only matters for a SysEx.

◆ describeShown()

QStringList Ui::Monitor::describeShown ( const score::gfx::ShownTexture &  shown,
std::optional< QPointF >  at = {} 
)
inline

The readout of a texture of several images: what it is, and what a point of the image shown, in [0, 1] from its top left, is in it.

◆ drawXAxisLabels()

template<typename XOf >
void Ui::Monitor::drawXAxisLabels ( QPainter &  p,
const QRectF &  plot,
const std::vector< Tick > &  ticks,
XOf  x_of 
)

Labels of a horizontal axis, under plot, at x_of(value): each takes its own width, stays within the plot's width, and is left out when it would touch one already placed. Major ticks are placed first, so that the remaining steps stay even.

◆ drawYAxisLabels()

template<typename YOf >
void Ui::Monitor::drawYAxisLabels ( QPainter &  p,
const QRectF &  plot,
const std::vector< Tick > &  ticks,
YOf  y_of 
)

Labels of a vertical axis, right-aligned left of plot, at y_of(value): left out when they would touch one already placed, or reach below the plot where a horizontal axis has its labels. Major ticks are placed first.

◆ linearTicks()

std::vector< Tick > Ui::Monitor::linearTicks ( double  lo,
double  hi,
double  pixels,
double  min_spacing = 18.,
QString  unit = {} 
)
inline

Ticks for a linear axis from lo to hi drawn over pixels: the finest 1-2-5 step that keeps labels at least min_spacing pixels apart.

◆ loudnessWeight()

double Ui::Monitor::loudnessWeight ( ChannelLayout  l,
int  channels,
int  c 
)
inlinenoexcept

BS.1770 channel weight: 0 for LFE, 1.41 (+1.5 dB) for channels below 30 degrees of elevation and between 60 and 120 degrees of azimuth, 1 otherwise. Ambisonic channels are not speakers: only W, the omnidirectional one, is measured.

◆ midiMessageType()

constexpr libremidi::message_type Ui::Monitor::midiMessageType ( uint8_t  status,
uint8_t  d1,
uint8_t  d2 
)
constexprnoexcept

What a message is. A note-on of velocity 0 is a note-off, as the MIDI specification has it. A status byte below 0x80, or a channel message with a data byte of 0x80 or more, is malformed: INVALID.

◆ pushRing()

template<typename T , typename V >
void Ui::Monitor::pushRing ( boost::circular_buffer< T > &  ring,
V &&  v,
std::size_t  limit = std::numeric_limits<std::size_t>::max() 
)

Appends to a history kept as a ring, oldest first. The ring grows as needed up to limit items; past it, the oldest item gives way to the new one.

◆ resolve()

ChannelLayout Ui::Monitor::resolve ( ChannelLayout  l,
int  channels 
)
inlinenoexcept

The layout l resolves to for channels channels: Auto picks the standard layout with exactly that many channels.

◆ showInlet()

void Ui::Monitor::showInlet ( const Process::ProcessModel &  p,
std::size_t  index,
const Process::Context &  doc,
QGraphicsItem *  parent,
QObject *  owner,
double  y = 5. 
)
inline

A fully custom item draws no inlets of its own: show the one it monitors at its top-left corner.

◆ shownTexture()

score::gfx::ShownTexture Ui::Monitor::shownTexture ( const Process::ProcessModel &  p,
const score::gfx::TextureShape &  shape 
)
inlinenoexcept

What the controls Layout, Slice and Layer of p, which follow one another, show of shape.

◆ zoneColor()

QColor Ui::Monitor::zoneColor ( double  v,
double  warn,
double  over 
)
inline

Level colours of a bar meter: green, then yellow from warn, red from over (all in the meter's own units).

◆ zoneGradient()

QLinearGradient Ui::Monitor::zoneGradient ( double  y_lo,
double  y_hi,
double  lo,
double  hi,
double  warn,
double  over,
double  alpha = 1. 
)
inline

The zone colours of zoneColor() as a vertical gradient, lo at y_lo and hi at y_hi, with the given opacity: a bar of any height is one fill.

Variable Documentation

◆ channel_layout_names

constexpr std::string_view Ui::Monitor::channel_layout_names[]
inlineconstexpr
Initial value:
{
"Auto", "Numbered", "Stereo", "5.1", "7.1", "7.1.4", "Ambisonic"}