tdesktop/Telegram/SourceFiles/media/player/media_player_volume_control...

53 lines
1.1 KiB
C
Raw Normal View History

2016-09-15 16:32:49 +00:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
2016-09-15 16:32:49 +00:00
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
2016-09-15 16:32:49 +00:00
*/
#pragma once
#include "ui/rp_widget.h"
2019-09-13 12:22:54 +00:00
#include "base/object_ptr.h"
class QWheelEvent;
namespace Ui {
class MediaSlider;
} // namespace Ui
2020-06-08 15:17:33 +00:00
namespace Window {
class SessionController;
} // namespace Window
namespace Media::Player {
class Dropdown;
2016-09-15 16:32:49 +00:00
class VolumeController final : public Ui::RpWidget {
2016-09-17 19:28:33 +00:00
public:
2020-06-08 15:17:33 +00:00
VolumeController(
QWidget *parent,
not_null<Window::SessionController*> controller);
2016-09-17 19:28:33 +00:00
void setIsVertical(bool vertical);
void outerWheelEvent(not_null<QWheelEvent*> e);
2016-09-17 19:28:33 +00:00
protected:
void resizeEvent(QResizeEvent *e) override;
2016-09-17 19:28:33 +00:00
private:
void setVolume(float64 volume);
void applyVolumeChange(float64 volume);
object_ptr<Ui::MediaSlider> _slider;
};
void PrepareVolumeDropdown(
not_null<Dropdown*> dropdown,
not_null<Window::SessionController*> controller,
rpl::producer<not_null<QWheelEvent*>> outerWheelEvents);
2016-09-17 19:28:33 +00:00
} // namespace Media::Player