2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Active round video moving to active window.

This commit is contained in:
John Preston
2023-01-19 11:40:39 +04:00
parent b80b770631
commit ec3957fcf3
14 changed files with 140 additions and 78 deletions

View File

@@ -20,6 +20,10 @@ namespace Media::View {
struct OpenRequest;
} // namespace Media::View
namespace Media::Player {
class FloatDelegate;
} // namespace Media::Player
namespace Window {
class Controller final : public base::has_weak_ptr {
@@ -114,9 +118,20 @@ public:
[[nodiscard]] auto openInMediaViewRequests() const
-> rpl::producer<Media::View::OpenRequest>;
QPoint getPointForCallPanelCenter() const;
[[nodiscard]] QPoint getPointForCallPanelCenter() const;
rpl::lifetime &lifetime();
using FloatDelegate = Media::Player::FloatDelegate;
void setDefaultFloatPlayerDelegate(
not_null<Media::Player::FloatDelegate*> delegate);
void replaceFloatPlayerDelegate(
not_null<Media::Player::FloatDelegate*> replacement);
void restoreFloatPlayerDelegate(
not_null<Media::Player::FloatDelegate*> replacement);
[[nodiscard]] FloatDelegate *floatPlayerDelegate() const;
[[nodiscard]] auto floatPlayerDelegateValue() const
-> rpl::producer<FloatDelegate*>;
[[nodiscard]] rpl::lifetime &lifetime();
private:
struct CreateArgs {
@@ -154,6 +169,10 @@ private:
rpl::event_stream<Media::View::OpenRequest> _openInMediaViewRequests;
FloatDelegate *_defaultFloatPlayerDelegate = nullptr;
FloatDelegate *_replacementFloatPlayerDelegate = nullptr;
rpl::variable<FloatDelegate*> _floatPlayerDelegate = nullptr;
rpl::lifetime _accountLifetime;
rpl::lifetime _lifetime;