2019-04-06 17:56:52 -07:00
|
|
|
#pragma once
|
|
|
|
|
2020-11-25 01:45:28 -08:00
|
|
|
#include "obs.hpp"
|
2019-04-06 17:56:52 -07:00
|
|
|
#include <QSlider>
|
|
|
|
#include <QInputEvent>
|
|
|
|
#include <QtCore/QObject>
|
2020-11-25 01:45:28 -08:00
|
|
|
#include <QAccessibleWidget>
|
2019-04-06 17:56:52 -07:00
|
|
|
|
|
|
|
class SliderIgnoreScroll : public QSlider {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
SliderIgnoreScroll(QWidget *parent = nullptr);
|
2019-06-22 22:13:45 -07:00
|
|
|
SliderIgnoreScroll(Qt::Orientation orientation,
|
|
|
|
QWidget *parent = nullptr);
|
2019-04-06 17:56:52 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void wheelEvent(QWheelEvent *event) override;
|
|
|
|
};
|
2020-11-25 01:45:28 -08:00
|
|
|
|
|
|
|
class VolumeSlider : public SliderIgnoreScroll {
|
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|