Olive
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Protected Member Functions | Private Slots | Private Attributes | List of all members
AudioMonitor Class Reference

The AudioMonitor class. More...

#include <audiomonitor.h>

Inheritance diagram for AudioMonitor:

Public Member Functions

 AudioMonitor (QWidget *parent=nullptr)
 AudioMonitor Constructor. More...
 
void set_value (const QVector< double > &values)
 Set the current audio value. More...
 

Protected Member Functions

void paintEvent (QPaintEvent *)
 Internal paint event. More...
 
void resizeEvent (QResizeEvent *)
 Internal resize event handler. More...
 

Private Slots

void clear ()
 Slot to clear the audio monitor. More...
 

Private Attributes

QLinearGradient gradient
 Internal gradient object from red to yellow to green. More...
 
QVector< double > values
 Internal value storage. More...
 
QTimer clear_timer
 Internal timer to clear the audio monitor after a certain amount of time. More...
 

Detailed Description

The AudioMonitor class.

Used to show a visual representation of audio currently playing

Constructor & Destructor Documentation

AudioMonitor::AudioMonitor ( QWidget *  parent = nullptr)
explicit

AudioMonitor Constructor.

Parameters
parentQWidget parent object.

Member Function Documentation

void AudioMonitor::clear ( )
privateslot

Slot to clear the audio monitor.

void AudioMonitor::paintEvent ( QPaintEvent *  )
protected

Internal paint event.

Paints the

void AudioMonitor::resizeEvent ( QResizeEvent *  e)
protected

Internal resize event handler.

Triggers a repaint when the widget is resized.

void AudioMonitor::set_value ( const QVector< double > &  values)

Set the current audio value.

The main interface for updating the audio monitor. Using this function will redraw the monitor with the values specified.

Parameters
valuesAn array of doubles between 0.0 and 1.0 to display the amplitude. 0.0 is no audio, 1.0 is full volume. Each array entry is a channel and the audio monitor will automatically adjust to the channel count in the array.

Member Data Documentation

QTimer AudioMonitor::clear_timer
private

Internal timer to clear the audio monitor after a certain amount of time.

If it doesn't receive any values within a certain amount of time, it's assumed audio is no longer playing and the monitor is cleared.

QLinearGradient AudioMonitor::gradient
private

Internal gradient object from red to yellow to green.

QVector<double> AudioMonitor::values
private

Internal value storage.


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