2021-05-29 14:13:12 +00:00
|
|
|
/*
|
|
|
|
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
|
|
|
|
|
2021-08-31 11:26:17 +00:00
|
|
|
#include "data/data_audio_msg_id.h"
|
|
|
|
|
2021-05-29 14:13:12 +00:00
|
|
|
namespace base::Platform {
|
2021-06-04 20:35:56 +00:00
|
|
|
class SystemMediaControls;
|
2021-05-29 14:13:12 +00:00
|
|
|
} // namespace base::Platform
|
|
|
|
|
|
|
|
namespace Data {
|
|
|
|
class DocumentMedia;
|
|
|
|
} // namespace Data
|
|
|
|
|
2021-06-06 19:49:15 +00:00
|
|
|
namespace Window {
|
|
|
|
class Controller;
|
|
|
|
} // namespace Window
|
|
|
|
|
2021-06-08 04:14:36 +00:00
|
|
|
namespace Media::Streaming {
|
|
|
|
class Instance;
|
|
|
|
} // namespace Media::Streaming
|
|
|
|
|
2021-06-08 18:58:34 +00:00
|
|
|
namespace Media {
|
2021-05-29 14:13:12 +00:00
|
|
|
|
|
|
|
class SystemMediaControlsManager {
|
|
|
|
public:
|
2021-06-06 19:49:15 +00:00
|
|
|
SystemMediaControlsManager(not_null<Window::Controller*> controller);
|
2021-05-29 14:13:12 +00:00
|
|
|
~SystemMediaControlsManager();
|
|
|
|
|
2021-06-04 20:35:56 +00:00
|
|
|
static bool Supported();
|
|
|
|
|
2021-05-29 14:13:12 +00:00
|
|
|
private:
|
2021-06-04 20:35:56 +00:00
|
|
|
const std::unique_ptr<base::Platform::SystemMediaControls> _controls;
|
2021-05-29 14:13:12 +00:00
|
|
|
|
|
|
|
std::vector<std::shared_ptr<Data::DocumentMedia>> _cachedMediaView;
|
2021-06-08 04:14:36 +00:00
|
|
|
std::unique_ptr<Media::Streaming::Instance> _streamed;
|
2021-06-07 05:28:53 +00:00
|
|
|
AudioMsgId _lastAudioMsgId;
|
2021-05-29 14:13:12 +00:00
|
|
|
|
|
|
|
rpl::lifetime _lifetimeDownload;
|
|
|
|
rpl::lifetime _lifetime;
|
|
|
|
};
|
|
|
|
|
2021-06-08 18:58:34 +00:00
|
|
|
} // namespace Media
|