init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
142
Telegram/SourceFiles/calls/group/calls_group_viewport_tile.h
Normal file
142
Telegram/SourceFiles/calls/group/calls_group_viewport_tile.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "calls/group/calls_group_viewport.h"
|
||||
#include "calls/group/calls_group_call.h"
|
||||
#include "ui/effects/animations.h"
|
||||
|
||||
class Painter;
|
||||
class QOpenGLFunctions;
|
||||
|
||||
namespace Ui {
|
||||
class CrossLineAnimation;
|
||||
class RoundRect;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Calls::Group {
|
||||
|
||||
class Viewport::VideoTile final {
|
||||
public:
|
||||
VideoTile(
|
||||
const VideoEndpoint &endpoint,
|
||||
VideoTileTrack track,
|
||||
rpl::producer<QSize> trackSize,
|
||||
rpl::producer<bool> pinned,
|
||||
Fn<void()> update,
|
||||
bool self);
|
||||
|
||||
[[nodiscard]] not_null<Webrtc::VideoTrack*> track() const {
|
||||
return _track.track;
|
||||
}
|
||||
[[nodiscard]] not_null<MembersRow*> row() const {
|
||||
return _track.row;
|
||||
}
|
||||
[[nodiscard]] not_null<PeerData*> peer() const {
|
||||
return _peer;
|
||||
}
|
||||
[[nodiscard]] bool rtmp() const {
|
||||
return _rtmp;
|
||||
}
|
||||
[[nodiscard]] QRect geometry() const {
|
||||
return _geometry;
|
||||
}
|
||||
[[nodiscard]] TileAnimation animation() const {
|
||||
return _animation;
|
||||
}
|
||||
[[nodiscard]] bool pinned() const {
|
||||
return _pinned;
|
||||
}
|
||||
[[nodiscard]] bool hidden() const {
|
||||
return _hidden;
|
||||
}
|
||||
[[nodiscard]] bool visible() const {
|
||||
return !_hidden && !_geometry.isEmpty();
|
||||
}
|
||||
[[nodiscard]] bool self() const {
|
||||
return _self;
|
||||
}
|
||||
[[nodiscard]] bool mirror() const;
|
||||
[[nodiscard]] QRect pinOuter() const;
|
||||
[[nodiscard]] QRect pinInner() const;
|
||||
[[nodiscard]] QRect backOuter() const;
|
||||
[[nodiscard]] QRect backInner() const;
|
||||
[[nodiscard]] const VideoEndpoint &endpoint() const {
|
||||
return _endpoint;
|
||||
}
|
||||
[[nodiscard]] QSize trackSize() const {
|
||||
return _trackSize.current();
|
||||
}
|
||||
[[nodiscard]] rpl::producer<QSize> trackSizeValue() const {
|
||||
return _trackSize.value();
|
||||
}
|
||||
[[nodiscard]] QSize trackOrUserpicSize() const;
|
||||
[[nodiscard]] static QSize PausedVideoSize();
|
||||
|
||||
[[nodiscard]] bool screencast() const;
|
||||
void setGeometry(
|
||||
QRect geometry,
|
||||
TileAnimation animation = TileAnimation());
|
||||
void hide();
|
||||
void toggleTopControlsShown(bool shown);
|
||||
bool updateRequestedQuality(VideoQuality quality);
|
||||
|
||||
[[nodiscard]] rpl::lifetime &lifetime() {
|
||||
return _lifetime;
|
||||
}
|
||||
|
||||
[[nodiscard]] static QSize PinInnerSize(bool pinned);
|
||||
static void PaintPinButton(
|
||||
Painter &p,
|
||||
bool pinned,
|
||||
int x,
|
||||
int y,
|
||||
int outerWidth,
|
||||
not_null<Ui::RoundRect*> background,
|
||||
not_null<Ui::CrossLineAnimation*> icon);
|
||||
|
||||
[[nodiscard]] static QSize BackInnerSize();
|
||||
static void PaintBackButton(
|
||||
Painter &p,
|
||||
int x,
|
||||
int y,
|
||||
int outerWidth,
|
||||
not_null<Ui::RoundRect*> background);
|
||||
|
||||
private:
|
||||
void setup(rpl::producer<bool> pinned);
|
||||
[[nodiscard]] int topControlsSlide() const;
|
||||
void updateTopControlsSize();
|
||||
void updateTopControlsPosition();
|
||||
|
||||
const VideoEndpoint _endpoint;
|
||||
const Fn<void()> _update;
|
||||
const VideoTileTrack _track;
|
||||
const not_null<PeerData*> _peer;
|
||||
|
||||
QRect _geometry;
|
||||
TileAnimation _animation;
|
||||
rpl::variable<QSize> _trackSize;
|
||||
QRect _pinOuter;
|
||||
QRect _pinInner;
|
||||
QRect _backOuter;
|
||||
QRect _backInner;
|
||||
Ui::Animations::Simple _topControlsShownAnimation;
|
||||
bool _wasPaused = false;
|
||||
bool _topControlsShown = false;
|
||||
bool _pinned = false;
|
||||
bool _hidden = true;
|
||||
bool _rtmp = false;
|
||||
bool _self = false;
|
||||
std::optional<VideoQuality> _quality;
|
||||
|
||||
rpl::lifetime _lifetime;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Calls::Group
|
||||
Reference in New Issue
Block a user