2014-05-04 07:54:38 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <obs.hpp>
|
|
|
|
#include <QWidget>
|
2018-04-03 10:21:57 +02:00
|
|
|
#include <QPaintEvent>
|
2021-09-23 18:27:30 +02:00
|
|
|
#include <QTimer>
|
2017-02-06 06:56:01 +01:00
|
|
|
#include <QMutex>
|
|
|
|
#include <QList>
|
2021-01-23 15:53:16 +01:00
|
|
|
#include <QMenu>
|
2024-04-28 18:57:41 +02:00
|
|
|
#include <QAccessibleWidget>
|
2024-04-28 19:29:02 +02:00
|
|
|
#include "absolute-slider.hpp"
|
2014-05-04 07:54:38 +02:00
|
|
|
|
2015-06-21 03:56:07 +02:00
|
|
|
class QPushButton;
|
2017-02-06 06:56:01 +01:00
|
|
|
class VolumeMeterTimer;
|
2024-04-21 01:58:20 +02:00
|
|
|
class VolumeSlider;
|
2015-06-21 03:56:07 +02:00
|
|
|
|
2014-07-14 18:32:39 +02:00
|
|
|
class VolumeMeter : public QWidget {
|
|
|
|
Q_OBJECT
|
2017-12-31 17:43:57 +01:00
|
|
|
Q_PROPERTY(QColor backgroundNominalColor READ getBackgroundNominalColor
|
|
|
|
WRITE setBackgroundNominalColor DESIGNABLE true)
|
|
|
|
Q_PROPERTY(QColor backgroundWarningColor READ getBackgroundWarningColor
|
|
|
|
WRITE setBackgroundWarningColor DESIGNABLE true)
|
|
|
|
Q_PROPERTY(QColor backgroundErrorColor READ getBackgroundErrorColor
|
|
|
|
WRITE setBackgroundErrorColor DESIGNABLE true)
|
|
|
|
Q_PROPERTY(QColor foregroundNominalColor READ getForegroundNominalColor
|
|
|
|
WRITE setForegroundNominalColor DESIGNABLE true)
|
|
|
|
Q_PROPERTY(QColor foregroundWarningColor READ getForegroundWarningColor
|
|
|
|
WRITE setForegroundWarningColor DESIGNABLE true)
|
|
|
|
Q_PROPERTY(QColor foregroundErrorColor READ getForegroundErrorColor
|
|
|
|
WRITE setForegroundErrorColor DESIGNABLE true)
|
2021-12-13 13:28:03 +01:00
|
|
|
|
|
|
|
Q_PROPERTY(QColor backgroundNominalColorDisabled READ
|
|
|
|
getBackgroundNominalColorDisabled WRITE
|
|
|
|
setBackgroundNominalColorDisabled
|
|
|
|
DESIGNABLE true)
|
|
|
|
Q_PROPERTY(QColor backgroundWarningColorDisabled READ
|
|
|
|
getBackgroundWarningColorDisabled WRITE
|
|
|
|
setBackgroundWarningColorDisabled
|
|
|
|
DESIGNABLE true)
|
|
|
|
Q_PROPERTY(
|
|
|
|
QColor backgroundErrorColorDisabled READ
|
|
|
|
getBackgroundErrorColorDisabled WRITE
|
|
|
|
setBackgroundErrorColorDisabled DESIGNABLE true)
|
|
|
|
Q_PROPERTY(QColor foregroundNominalColorDisabled READ
|
|
|
|
getForegroundNominalColorDisabled WRITE
|
|
|
|
setForegroundNominalColorDisabled
|
|
|
|
DESIGNABLE true)
|
|
|
|
Q_PROPERTY(QColor foregroundWarningColorDisabled READ
|
|
|
|
getForegroundWarningColorDisabled WRITE
|
|
|
|
setForegroundWarningColorDisabled
|
|
|
|
DESIGNABLE true)
|
|
|
|
Q_PROPERTY(
|
|
|
|
QColor foregroundErrorColorDisabled READ
|
|
|
|
getForegroundErrorColorDisabled WRITE
|
|
|
|
setForegroundErrorColorDisabled DESIGNABLE true)
|
|
|
|
|
2017-12-31 17:43:57 +01:00
|
|
|
Q_PROPERTY(QColor clipColor READ getClipColor WRITE setClipColor
|
|
|
|
DESIGNABLE true)
|
|
|
|
Q_PROPERTY(QColor magnitudeColor READ getMagnitudeColor WRITE
|
|
|
|
setMagnitudeColor DESIGNABLE true)
|
|
|
|
Q_PROPERTY(QColor majorTickColor READ getMajorTickColor WRITE
|
|
|
|
setMajorTickColor DESIGNABLE true)
|
|
|
|
Q_PROPERTY(QColor minorTickColor READ getMinorTickColor WRITE
|
|
|
|
setMinorTickColor DESIGNABLE true)
|
2021-08-30 23:27:36 +02:00
|
|
|
Q_PROPERTY(int meterThickness READ getMeterThickness WRITE
|
|
|
|
setMeterThickness DESIGNABLE true)
|
|
|
|
Q_PROPERTY(qreal meterFontScaling READ getMeterFontScaling WRITE
|
|
|
|
setMeterFontScaling DESIGNABLE true)
|
2017-12-31 17:43:57 +01:00
|
|
|
|
|
|
|
// Levels are denoted in dBFS.
|
|
|
|
Q_PROPERTY(qreal minimumLevel READ getMinimumLevel WRITE setMinimumLevel
|
|
|
|
DESIGNABLE true)
|
|
|
|
Q_PROPERTY(qreal warningLevel READ getWarningLevel WRITE setWarningLevel
|
|
|
|
DESIGNABLE true)
|
|
|
|
Q_PROPERTY(qreal errorLevel READ getErrorLevel WRITE setErrorLevel
|
|
|
|
DESIGNABLE true)
|
|
|
|
Q_PROPERTY(qreal clipLevel READ getClipLevel WRITE setClipLevel
|
|
|
|
DESIGNABLE true)
|
|
|
|
Q_PROPERTY(qreal minimumInputLevel READ getMinimumInputLevel WRITE
|
|
|
|
setMinimumInputLevel DESIGNABLE true)
|
|
|
|
|
|
|
|
// Rates are denoted in dB/second.
|
|
|
|
Q_PROPERTY(qreal peakDecayRate READ getPeakDecayRate WRITE
|
|
|
|
setPeakDecayRate DESIGNABLE true)
|
|
|
|
|
|
|
|
// Time in seconds for the VU meter to integrate over.
|
|
|
|
Q_PROPERTY(
|
|
|
|
qreal magnitudeIntegrationTime READ getMagnitudeIntegrationTime
|
|
|
|
WRITE setMagnitudeIntegrationTime DESIGNABLE true)
|
|
|
|
|
|
|
|
// Duration is denoted in seconds.
|
|
|
|
Q_PROPERTY(qreal peakHoldDuration READ getPeakHoldDuration WRITE
|
|
|
|
setPeakHoldDuration DESIGNABLE true)
|
|
|
|
Q_PROPERTY(qreal inputPeakHoldDuration READ getInputPeakHoldDuration
|
|
|
|
WRITE setInputPeakHoldDuration DESIGNABLE true)
|
2015-01-14 08:01:14 +01:00
|
|
|
|
2021-08-24 08:12:24 +02:00
|
|
|
friend class VolControl;
|
|
|
|
|
2014-07-14 18:32:39 +02:00
|
|
|
private:
|
2017-12-31 17:43:57 +01:00
|
|
|
obs_volmeter_t *obs_volmeter;
|
2023-10-04 00:13:56 +02:00
|
|
|
static std::weak_ptr<VolumeMeterTimer> updateTimer;
|
|
|
|
std::shared_ptr<VolumeMeterTimer> updateTimerRef;
|
2017-02-06 06:56:01 +01:00
|
|
|
|
2017-12-31 17:43:57 +01:00
|
|
|
inline void resetLevels();
|
2021-08-30 23:27:36 +02:00
|
|
|
inline void doLayout();
|
2017-12-31 17:43:57 +01:00
|
|
|
inline bool detectIdle(uint64_t ts);
|
|
|
|
inline void calculateBallistics(uint64_t ts,
|
|
|
|
qreal timeSinceLastRedraw = 0.0);
|
|
|
|
inline void calculateBallisticsForChannel(int channelNr, uint64_t ts,
|
|
|
|
qreal timeSinceLastRedraw);
|
|
|
|
|
2022-10-08 23:56:53 +02:00
|
|
|
inline int convertToInt(float number);
|
2018-04-28 04:49:48 +02:00
|
|
|
void paintInputMeter(QPainter &painter, int x, int y, int width,
|
|
|
|
int height, float peakHold);
|
|
|
|
void paintHMeter(QPainter &painter, int x, int y, int width, int height,
|
|
|
|
float magnitude, float peak, float peakHold);
|
2021-08-30 23:27:36 +02:00
|
|
|
void paintHTicks(QPainter &painter, int x, int y, int width);
|
2018-04-28 04:49:48 +02:00
|
|
|
void paintVMeter(QPainter &painter, int x, int y, int width, int height,
|
|
|
|
float magnitude, float peak, float peakHold);
|
|
|
|
void paintVTicks(QPainter &painter, int x, int y, int height);
|
2017-02-06 06:56:01 +01:00
|
|
|
|
|
|
|
QMutex dataMutex;
|
|
|
|
|
2021-08-30 23:27:36 +02:00
|
|
|
bool recalculateLayout = true;
|
2017-12-31 17:43:57 +01:00
|
|
|
uint64_t currentLastUpdateTime = 0;
|
|
|
|
float currentMagnitude[MAX_AUDIO_CHANNELS];
|
|
|
|
float currentPeak[MAX_AUDIO_CHANNELS];
|
|
|
|
float currentInputPeak[MAX_AUDIO_CHANNELS];
|
|
|
|
|
|
|
|
int displayNrAudioChannels = 0;
|
|
|
|
float displayMagnitude[MAX_AUDIO_CHANNELS];
|
|
|
|
float displayPeak[MAX_AUDIO_CHANNELS];
|
|
|
|
float displayPeakHold[MAX_AUDIO_CHANNELS];
|
|
|
|
uint64_t displayPeakHoldLastUpdateTime[MAX_AUDIO_CHANNELS];
|
|
|
|
float displayInputPeakHold[MAX_AUDIO_CHANNELS];
|
|
|
|
uint64_t displayInputPeakHoldLastUpdateTime[MAX_AUDIO_CHANNELS];
|
|
|
|
|
2018-01-09 21:55:41 +01:00
|
|
|
QFont tickFont;
|
2017-12-31 17:43:57 +01:00
|
|
|
QColor backgroundNominalColor;
|
|
|
|
QColor backgroundWarningColor;
|
|
|
|
QColor backgroundErrorColor;
|
|
|
|
QColor foregroundNominalColor;
|
|
|
|
QColor foregroundWarningColor;
|
|
|
|
QColor foregroundErrorColor;
|
2021-12-13 13:28:03 +01:00
|
|
|
|
|
|
|
QColor backgroundNominalColorDisabled;
|
|
|
|
QColor backgroundWarningColorDisabled;
|
|
|
|
QColor backgroundErrorColorDisabled;
|
|
|
|
QColor foregroundNominalColorDisabled;
|
|
|
|
QColor foregroundWarningColorDisabled;
|
|
|
|
QColor foregroundErrorColorDisabled;
|
|
|
|
|
2017-12-31 17:43:57 +01:00
|
|
|
QColor clipColor;
|
|
|
|
QColor magnitudeColor;
|
|
|
|
QColor majorTickColor;
|
|
|
|
QColor minorTickColor;
|
2021-08-30 23:27:36 +02:00
|
|
|
|
|
|
|
int meterThickness;
|
|
|
|
qreal meterFontScaling;
|
|
|
|
|
2017-12-31 17:43:57 +01:00
|
|
|
qreal minimumLevel;
|
|
|
|
qreal warningLevel;
|
|
|
|
qreal errorLevel;
|
|
|
|
qreal clipLevel;
|
|
|
|
qreal minimumInputLevel;
|
|
|
|
qreal peakDecayRate;
|
|
|
|
qreal magnitudeIntegrationTime;
|
|
|
|
qreal peakHoldDuration;
|
|
|
|
qreal inputPeakHoldDuration;
|
|
|
|
|
2021-07-03 07:55:47 +02:00
|
|
|
QColor p_backgroundNominalColor;
|
|
|
|
QColor p_backgroundWarningColor;
|
|
|
|
QColor p_backgroundErrorColor;
|
|
|
|
QColor p_foregroundNominalColor;
|
|
|
|
QColor p_foregroundWarningColor;
|
|
|
|
QColor p_foregroundErrorColor;
|
|
|
|
|
2017-12-31 17:43:57 +01:00
|
|
|
uint64_t lastRedrawTime = 0;
|
2018-11-10 00:29:28 +01:00
|
|
|
int channels = 0;
|
2018-04-19 08:42:05 +02:00
|
|
|
bool clipping = false;
|
2018-04-28 04:49:48 +02:00
|
|
|
bool vertical;
|
2021-08-24 08:12:24 +02:00
|
|
|
bool muted = false;
|
2015-03-22 22:58:07 +01:00
|
|
|
|
2014-07-14 18:32:39 +02:00
|
|
|
public:
|
2018-04-03 10:21:57 +02:00
|
|
|
explicit VolumeMeter(QWidget *parent = nullptr,
|
2018-04-28 04:49:48 +02:00
|
|
|
obs_volmeter_t *obs_volmeter = nullptr,
|
|
|
|
bool vertical = false);
|
2017-02-06 06:56:01 +01:00
|
|
|
~VolumeMeter();
|
|
|
|
|
2017-12-31 17:43:57 +01:00
|
|
|
void setLevels(const float magnitude[MAX_AUDIO_CHANNELS],
|
|
|
|
const float peak[MAX_AUDIO_CHANNELS],
|
|
|
|
const float inputPeak[MAX_AUDIO_CHANNELS]);
|
2021-08-30 23:27:36 +02:00
|
|
|
QRect getBarRect() const;
|
|
|
|
bool needLayoutChange();
|
2017-12-31 17:43:57 +01:00
|
|
|
|
|
|
|
QColor getBackgroundNominalColor() const;
|
|
|
|
void setBackgroundNominalColor(QColor c);
|
|
|
|
QColor getBackgroundWarningColor() const;
|
|
|
|
void setBackgroundWarningColor(QColor c);
|
|
|
|
QColor getBackgroundErrorColor() const;
|
|
|
|
void setBackgroundErrorColor(QColor c);
|
|
|
|
QColor getForegroundNominalColor() const;
|
|
|
|
void setForegroundNominalColor(QColor c);
|
|
|
|
QColor getForegroundWarningColor() const;
|
|
|
|
void setForegroundWarningColor(QColor c);
|
|
|
|
QColor getForegroundErrorColor() const;
|
|
|
|
void setForegroundErrorColor(QColor c);
|
2021-12-13 13:28:03 +01:00
|
|
|
|
|
|
|
QColor getBackgroundNominalColorDisabled() const;
|
|
|
|
void setBackgroundNominalColorDisabled(QColor c);
|
|
|
|
QColor getBackgroundWarningColorDisabled() const;
|
|
|
|
void setBackgroundWarningColorDisabled(QColor c);
|
|
|
|
QColor getBackgroundErrorColorDisabled() const;
|
|
|
|
void setBackgroundErrorColorDisabled(QColor c);
|
|
|
|
QColor getForegroundNominalColorDisabled() const;
|
|
|
|
void setForegroundNominalColorDisabled(QColor c);
|
|
|
|
QColor getForegroundWarningColorDisabled() const;
|
|
|
|
void setForegroundWarningColorDisabled(QColor c);
|
|
|
|
QColor getForegroundErrorColorDisabled() const;
|
|
|
|
void setForegroundErrorColorDisabled(QColor c);
|
|
|
|
|
2017-12-31 17:43:57 +01:00
|
|
|
QColor getClipColor() const;
|
|
|
|
void setClipColor(QColor c);
|
|
|
|
QColor getMagnitudeColor() const;
|
|
|
|
void setMagnitudeColor(QColor c);
|
|
|
|
QColor getMajorTickColor() const;
|
|
|
|
void setMajorTickColor(QColor c);
|
|
|
|
QColor getMinorTickColor() const;
|
|
|
|
void setMinorTickColor(QColor c);
|
2021-08-30 23:27:36 +02:00
|
|
|
int getMeterThickness() const;
|
|
|
|
void setMeterThickness(int v);
|
|
|
|
qreal getMeterFontScaling() const;
|
|
|
|
void setMeterFontScaling(qreal v);
|
2017-12-31 17:43:57 +01:00
|
|
|
qreal getMinimumLevel() const;
|
|
|
|
void setMinimumLevel(qreal v);
|
|
|
|
qreal getWarningLevel() const;
|
|
|
|
void setWarningLevel(qreal v);
|
|
|
|
qreal getErrorLevel() const;
|
|
|
|
void setErrorLevel(qreal v);
|
|
|
|
qreal getClipLevel() const;
|
|
|
|
void setClipLevel(qreal v);
|
|
|
|
qreal getMinimumInputLevel() const;
|
|
|
|
void setMinimumInputLevel(qreal v);
|
|
|
|
qreal getPeakDecayRate() const;
|
|
|
|
void setPeakDecayRate(qreal v);
|
|
|
|
qreal getMagnitudeIntegrationTime() const;
|
|
|
|
void setMagnitudeIntegrationTime(qreal v);
|
|
|
|
qreal getPeakHoldDuration() const;
|
|
|
|
void setPeakHoldDuration(qreal v);
|
|
|
|
qreal getInputPeakHoldDuration() const;
|
|
|
|
void setInputPeakHoldDuration(qreal v);
|
2018-01-19 22:57:36 +01:00
|
|
|
void setPeakMeterType(enum obs_peak_meter_type peakMeterType);
|
2019-04-19 04:02:35 +02:00
|
|
|
virtual void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
virtual void wheelEvent(QWheelEvent *event) override;
|
2015-01-14 08:01:14 +01:00
|
|
|
|
2014-07-14 18:32:39 +02:00
|
|
|
protected:
|
2018-04-03 10:21:57 +02:00
|
|
|
void paintEvent(QPaintEvent *event) override;
|
2021-08-30 23:27:36 +02:00
|
|
|
void changeEvent(QEvent *e) override;
|
2017-02-06 06:56:01 +01:00
|
|
|
};
|
|
|
|
|
2021-09-23 18:27:30 +02:00
|
|
|
class VolumeMeterTimer : public QTimer {
|
2017-02-06 06:56:01 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-09-23 18:27:30 +02:00
|
|
|
inline VolumeMeterTimer() : QTimer() {}
|
|
|
|
|
2017-02-06 06:56:01 +01:00
|
|
|
void AddVolControl(VolumeMeter *meter);
|
|
|
|
void RemoveVolControl(VolumeMeter *meter);
|
|
|
|
|
|
|
|
protected:
|
2021-09-23 18:27:30 +02:00
|
|
|
void timerEvent(QTimerEvent *event) override;
|
2017-02-06 06:56:01 +01:00
|
|
|
QList<VolumeMeter *> volumeMeters;
|
2014-07-14 18:32:39 +02:00
|
|
|
};
|
2014-05-04 07:54:38 +02:00
|
|
|
|
|
|
|
class QLabel;
|
2024-04-28 18:57:41 +02:00
|
|
|
class VolumeSlider;
|
2015-03-22 22:58:07 +01:00
|
|
|
class MuteCheckBox;
|
2024-02-13 10:41:48 +01:00
|
|
|
class OBSSourceLabel;
|
2014-05-04 07:54:38 +02:00
|
|
|
|
2024-04-21 01:58:20 +02:00
|
|
|
class VolControl : public QFrame {
|
2014-05-04 07:54:38 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
OBSSource source;
|
2024-02-13 10:35:14 +01:00
|
|
|
std::vector<OBSSignal> sigs;
|
2024-02-13 10:41:48 +01:00
|
|
|
OBSSourceLabel *nameLabel;
|
2014-05-20 16:26:18 +02:00
|
|
|
QLabel *volLabel;
|
2014-07-14 18:32:39 +02:00
|
|
|
VolumeMeter *volMeter;
|
2024-04-28 18:57:41 +02:00
|
|
|
VolumeSlider *slider;
|
2015-03-22 22:58:07 +01:00
|
|
|
MuteCheckBox *mute;
|
2015-06-21 03:56:07 +02:00
|
|
|
QPushButton *config = nullptr;
|
2014-06-03 13:51:27 +02:00
|
|
|
float levelTotal;
|
|
|
|
float levelCount;
|
2022-01-27 11:10:12 +01:00
|
|
|
OBSFader obs_fader;
|
|
|
|
OBSVolMeter obs_volmeter;
|
2018-04-28 04:49:48 +02:00
|
|
|
bool vertical;
|
2021-01-23 15:53:16 +01:00
|
|
|
QMenu *contextMenu;
|
2014-05-04 07:54:38 +02:00
|
|
|
|
2016-01-08 04:48:36 +01:00
|
|
|
static void OBSVolumeChanged(void *param, float db);
|
2017-12-31 17:43:57 +01:00
|
|
|
static void OBSVolumeLevel(void *data,
|
|
|
|
const float magnitude[MAX_AUDIO_CHANNELS],
|
|
|
|
const float peak[MAX_AUDIO_CHANNELS],
|
|
|
|
const float inputPeak[MAX_AUDIO_CHANNELS]);
|
2015-03-22 22:58:07 +01:00
|
|
|
static void OBSVolumeMuted(void *data, calldata_t *calldata);
|
2023-05-03 15:46:40 +02:00
|
|
|
static void OBSMixersOrMonitoringChanged(void *data, calldata_t *);
|
2014-05-04 07:54:38 +02:00
|
|
|
|
2015-06-21 03:56:07 +02:00
|
|
|
void EmitConfigClicked();
|
|
|
|
|
2014-05-04 07:54:38 +02:00
|
|
|
private slots:
|
2014-11-19 16:41:07 +01:00
|
|
|
void VolumeChanged();
|
2015-03-22 22:58:07 +01:00
|
|
|
void VolumeMuted(bool muted);
|
2023-05-03 15:46:40 +02:00
|
|
|
void MixersOrMonitoringChanged();
|
2015-03-22 22:58:07 +01:00
|
|
|
|
|
|
|
void SetMuted(bool checked);
|
2014-05-04 07:54:38 +02:00
|
|
|
void SliderChanged(int vol);
|
2014-12-28 12:31:21 +01:00
|
|
|
void updateText();
|
2014-05-04 07:54:38 +02:00
|
|
|
|
2015-06-21 03:56:07 +02:00
|
|
|
signals:
|
|
|
|
void ConfigClicked();
|
|
|
|
|
2014-05-04 07:54:38 +02:00
|
|
|
public:
|
2018-04-28 04:49:48 +02:00
|
|
|
explicit VolControl(OBSSource source, bool showConfig = false,
|
|
|
|
bool vertical = false);
|
2014-05-04 07:54:38 +02:00
|
|
|
~VolControl();
|
|
|
|
|
2014-09-26 02:44:05 +02:00
|
|
|
inline obs_source_t *GetSource() const { return source; }
|
2014-07-08 20:58:48 +02:00
|
|
|
|
2018-01-09 21:45:20 +01:00
|
|
|
void SetMeterDecayRate(qreal q);
|
2018-01-19 22:57:36 +01:00
|
|
|
void setPeakMeterType(enum obs_peak_meter_type peakMeterType);
|
2020-02-17 01:32:00 +01:00
|
|
|
|
|
|
|
void EnableSlider(bool enable);
|
2021-01-23 15:53:16 +01:00
|
|
|
inline void SetContextMenu(QMenu *cm) { contextMenu = cm; }
|
2021-07-03 07:55:47 +02:00
|
|
|
|
|
|
|
void refreshColors();
|
2014-05-04 07:54:38 +02:00
|
|
|
};
|
2024-04-28 18:57:41 +02:00
|
|
|
|
2024-04-28 19:29:02 +02:00
|
|
|
class VolumeSlider : public AbsoluteSlider {
|
2024-04-28 18:57:41 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
obs_fader_t *fad;
|
|
|
|
|
|
|
|
VolumeSlider(obs_fader_t *fader, QWidget *parent = nullptr);
|
|
|
|
VolumeSlider(obs_fader_t *fader, Qt::Orientation orientation,
|
|
|
|
QWidget *parent = nullptr);
|
2024-04-21 01:58:20 +02:00
|
|
|
|
|
|
|
bool getDisplayTicks() const;
|
|
|
|
void setDisplayTicks(bool display);
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool displayTicks = false;
|
|
|
|
QColor tickColor;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void paintEvent(QPaintEvent *event) override;
|
2024-04-28 18:57:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class VolumeAccessibleInterface : public QAccessibleWidget {
|
|
|
|
|
|
|
|
public:
|
|
|
|
VolumeAccessibleInterface(QWidget *w);
|
|
|
|
|
|
|
|
QVariant currentValue() const;
|
|
|
|
void setCurrentValue(const QVariant &value);
|
|
|
|
|
|
|
|
QVariant maximumValue() const;
|
|
|
|
QVariant minimumValue() const;
|
|
|
|
|
|
|
|
QVariant minimumStepSize() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
VolumeSlider *slider() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual QAccessible::Role role() const override;
|
|
|
|
virtual QString text(QAccessible::Text t) const override;
|
|
|
|
};
|