volume-control.hpp 567 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include <obs.hpp>
  3. #include <QWidget>
  4. /* TODO: Make a real volume control that isn't terrible */
  5. class QLabel;
  6. class QSlider;
  7. class VolControl : public QWidget {
  8. Q_OBJECT
  9. private:
  10. OBSSource source;
  11. QLabel *nameLabel;
  12. QLabel *volLabel;
  13. QSlider *slider;
  14. bool signalChanged;
  15. static void OBSVolumeChanged(void *param, calldata_t calldata);
  16. private slots:
  17. void VolumeChanged(int vol);
  18. void SliderChanged(int vol);
  19. public:
  20. VolControl(OBSSource source);
  21. ~VolControl();
  22. inline obs_source_t GetSource() const {return source;}
  23. };