media_player_float.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #include "media/player/media_player_float.h"
  8. #include "data/data_document.h"
  9. #include "data/data_session.h"
  10. #include "history/view/media/history_view_media.h"
  11. #include "history/history_item.h"
  12. #include "history/history.h"
  13. #include "history/view/history_view_element.h"
  14. #include "media/audio/media_audio.h"
  15. #include "media/streaming/media_streaming_instance.h"
  16. #include "media/view/media_view_playback_progress.h"
  17. #include "media/player/media_player_instance.h"
  18. #include "window/window_session_controller.h"
  19. #include "window/section_widget.h"
  20. #include "core/application.h"
  21. #include "core/core_settings.h"
  22. #include "main/main_session.h"
  23. #include "main/main_account.h"
  24. #include "ui/painter.h"
  25. #include "ui/ui_utility.h"
  26. #include "styles/style_media_player.h"
  27. #include "styles/style_chat.h"
  28. #include <QtWidgets/QApplication>
  29. namespace Media {
  30. namespace Player {
  31. using DoubleClickedCallback = Fn<void(not_null<const HistoryItem*>)>;
  32. RoundPainter::RoundPainter(not_null<HistoryItem*> item)
  33. : _item(item) {
  34. }
  35. bool RoundPainter::fillFrame(const QSize &size) {
  36. auto creating = _frame.isNull();
  37. const auto ratio = style::DevicePixelRatio();
  38. if (creating) {
  39. _frame = QImage(
  40. size * ratio,
  41. QImage::Format_ARGB32_Premultiplied);
  42. _frame.setDevicePixelRatio(ratio);
  43. }
  44. auto frameInner = [&] {
  45. return QRect(QPoint(), _frame.size() / ratio);
  46. };
  47. if (const auto streamed = instance()->roundVideoStreamed(_item)) {
  48. auto request = Streaming::FrameRequest::NonStrict();
  49. request.outer = request.resize = _frame.size();
  50. if (_roundingMask.size() != request.outer) {
  51. _roundingMask = Images::EllipseMask(frameInner().size());
  52. }
  53. request.mask = _roundingMask;
  54. auto frame = streamed->frame(request);
  55. if (!frame.isNull()) {
  56. _frame.fill(Qt::transparent);
  57. auto p = QPainter(&_frame);
  58. PainterHighQualityEnabler hq(p);
  59. p.drawImage(frameInner(), frame);
  60. return true;
  61. }
  62. }
  63. if (creating) {
  64. _frame.fill(Qt::transparent);
  65. auto p = QPainter(&_frame);
  66. PainterHighQualityEnabler hq(p);
  67. p.setPen(Qt::NoPen);
  68. p.setBrush(st::imageBg);
  69. p.drawEllipse(frameInner());
  70. }
  71. return false;
  72. }
  73. const QImage &RoundPainter::frame() const {
  74. return _frame;
  75. }
  76. Float::Float(
  77. QWidget *parent,
  78. not_null<HistoryItem*> item,
  79. Fn<void(bool visible)> toggleCallback,
  80. Fn<void(bool closed)> draggedCallback,
  81. DoubleClickedCallback doubleClickedCallback)
  82. : RpWidget(parent)
  83. , _item(item)
  84. , _toggleCallback(std::move(toggleCallback))
  85. , _draggedCallback(std::move(draggedCallback))
  86. , _doubleClickedCallback(std::move(doubleClickedCallback)) {
  87. auto media = _item->media();
  88. Assert(media != nullptr);
  89. auto document = media->document();
  90. Assert(document != nullptr);
  91. Assert(document->isVideoMessage());
  92. auto margin = st::mediaPlayerFloatMargin;
  93. auto size = 2 * margin + st::mediaPlayerFloatSize;
  94. resize(size, size);
  95. _roundPainter = std::make_unique<RoundPainter>(item);
  96. prepareShadow();
  97. document->session().data().itemRepaintRequest(
  98. ) | rpl::start_with_next([this](auto item) {
  99. if (_item == item) {
  100. repaintItem();
  101. }
  102. }, lifetime());
  103. document->session().data().itemRemoved(
  104. ) | rpl::start_with_next([this](auto item) {
  105. if (_item == item) {
  106. detach();
  107. }
  108. }, lifetime());
  109. document->session().account().sessionChanges(
  110. ) | rpl::start_with_next([=] {
  111. detach();
  112. }, lifetime());
  113. setCursor(style::cur_pointer);
  114. }
  115. void Float::mousePressEvent(QMouseEvent *e) {
  116. _down = true;
  117. _downPoint = e->pos();
  118. }
  119. void Float::mouseMoveEvent(QMouseEvent *e) {
  120. if (_down && (e->pos() - _downPoint).manhattanLength() > QApplication::startDragDistance()) {
  121. _down = false;
  122. _drag = true;
  123. _dragLocalPoint = e->pos();
  124. } else if (_drag) {
  125. auto delta = (e->pos() - _dragLocalPoint);
  126. move(pos() + delta);
  127. setOpacity(outRatio());
  128. }
  129. }
  130. float64 Float::outRatio() const {
  131. auto parent = parentWidget()->rect();
  132. auto min = 1.;
  133. if (x() < parent.x()) {
  134. accumulate_min(min, 1. - (parent.x() - x()) / float64(width()));
  135. }
  136. if (y() < parent.y()) {
  137. accumulate_min(min, 1. - (parent.y() - y()) / float64(height()));
  138. }
  139. if (x() + width() > parent.x() + parent.width()) {
  140. accumulate_min(min, 1. - (x() + width() - parent.x() - parent.width()) / float64(width()));
  141. }
  142. if (y() + height() > parent.y() + parent.height()) {
  143. accumulate_min(min, 1. - (y() + height() - parent.y() - parent.height()) / float64(height()));
  144. }
  145. return std::clamp(min, 0., 1.);
  146. }
  147. void Float::mouseReleaseEvent(QMouseEvent *e) {
  148. if (base::take(_down) && _item) {
  149. pauseResume();
  150. }
  151. if (_drag) {
  152. finishDrag(outRatio() < 0.5);
  153. }
  154. }
  155. void Float::finishDrag(bool closed) {
  156. _drag = false;
  157. if (_draggedCallback) {
  158. _draggedCallback(closed);
  159. }
  160. }
  161. void Float::mouseDoubleClickEvent(QMouseEvent *e) {
  162. if (_item && _doubleClickedCallback) {
  163. // Handle second click.
  164. pauseResume();
  165. _doubleClickedCallback(_item);
  166. }
  167. }
  168. void Float::pauseResume() {
  169. if (const auto streamed = getStreamed()) {
  170. if (streamed->paused()) {
  171. streamed->resume();
  172. } else {
  173. streamed->pause();
  174. }
  175. }
  176. }
  177. void Float::detach() {
  178. if (_item) {
  179. _item = nullptr;
  180. _roundPainter = nullptr;
  181. if (_toggleCallback) {
  182. _toggleCallback(false);
  183. }
  184. }
  185. }
  186. void Float::prepareShadow() {
  187. const auto ratio = style::DevicePixelRatio();
  188. auto shadow = QImage(
  189. size() * ratio,
  190. QImage::Format_ARGB32_Premultiplied);
  191. shadow.fill(Qt::transparent);
  192. shadow.setDevicePixelRatio(ratio);
  193. {
  194. auto p = QPainter(&shadow);
  195. PainterHighQualityEnabler hq(p);
  196. p.setPen(Qt::NoPen);
  197. p.setBrush(st::shadowFg);
  198. auto extend = 2 * st::lineWidth;
  199. p.drawEllipse(getInnerRect().marginsAdded(QMargins(extend, extend, extend, extend)));
  200. }
  201. _shadow = Ui::PixmapFromImage(Images::Blur(std::move(shadow)));
  202. }
  203. QRect Float::getInnerRect() const {
  204. auto margin = st::mediaPlayerFloatMargin;
  205. return rect().marginsRemoved(QMargins(margin, margin, margin, margin));
  206. }
  207. void Float::paintEvent(QPaintEvent *e) {
  208. auto p = QPainter(this);
  209. p.setOpacity(_opacity);
  210. p.drawPixmap(0, 0, _shadow);
  211. const auto inner = getInnerRect();
  212. if (!(_roundPainter && _roundPainter->fillFrame(inner.size()))
  213. && _toggleCallback) {
  214. _toggleCallback(false);
  215. }
  216. if (_roundPainter) {
  217. p.drawImage(inner.topLeft(), _roundPainter->frame());
  218. }
  219. const auto playback = getPlayback();
  220. const auto progress = playback ? playback->value() : 1.;
  221. if (progress > 0.) {
  222. auto pen = st::historyVideoMessageProgressFg->p;
  223. //auto was = p.pen();
  224. pen.setWidth(st::radialLine);
  225. pen.setCapStyle(Qt::RoundCap);
  226. p.setPen(pen);
  227. p.setOpacity(_opacity * st::historyVideoMessageProgressOpacity);
  228. auto from = arc::kQuarterLength;
  229. auto len = -qRound(arc::kFullLength * progress);
  230. auto stepInside = st::radialLine / 2;
  231. {
  232. PainterHighQualityEnabler hq(p);
  233. p.drawArc(inner.marginsRemoved(QMargins(stepInside, stepInside, stepInside, stepInside)), from, len);
  234. }
  235. //p.setPen(was);
  236. //p.setOpacity(_opacity);
  237. }
  238. }
  239. Streaming::Instance *Float::getStreamed() const {
  240. return instance()->roundVideoStreamed(_item);
  241. }
  242. View::PlaybackProgress *Float::getPlayback() const {
  243. return instance()->roundVideoPlayback(_item);
  244. }
  245. bool Float::hasFrame() const {
  246. return (getStreamed() != nullptr);
  247. }
  248. void Float::repaintItem() {
  249. update();
  250. if (hasFrame() && _toggleCallback) {
  251. _toggleCallback(true);
  252. }
  253. }
  254. template <typename ToggleCallback, typename DraggedCallback>
  255. FloatController::Item::Item(
  256. not_null<QWidget*> parent,
  257. not_null<HistoryItem*> item,
  258. ToggleCallback toggle,
  259. DraggedCallback dragged,
  260. DoubleClickedCallback doubleClicked)
  261. : animationSide(RectPart::Right)
  262. , column(Window::Column::Second)
  263. , corner(RectPart::TopRight)
  264. , widget(
  265. parent,
  266. item,
  267. [=, toggle = std::move(toggle)](bool visible) {
  268. toggle(this, visible);
  269. },
  270. [=, dragged = std::move(dragged)](bool closed) {
  271. dragged(this, closed);
  272. },
  273. std::move(doubleClicked)) {
  274. }
  275. FloatController::FloatController(not_null<FloatDelegate*> delegate)
  276. : _delegate(delegate)
  277. , _parent(_delegate->floatPlayerWidget()) {
  278. Media::Player::instance()->trackChanged(
  279. ) | rpl::filter([=](AudioMsgId::Type type) {
  280. return (type == AudioMsgId::Type::Voice);
  281. }) | rpl::start_with_next([=] {
  282. checkCurrent();
  283. }, _lifetime);
  284. startDelegateHandling();
  285. }
  286. void FloatController::replaceDelegate(not_null<FloatDelegate*> delegate) {
  287. _delegateLifetime.destroy();
  288. _delegate = delegate;
  289. _parent = _delegate->floatPlayerWidget();
  290. startDelegateHandling();
  291. for (const auto &item : _items) {
  292. item->widget->setParent(_parent);
  293. }
  294. checkVisibility();
  295. }
  296. void FloatController::startDelegateHandling() {
  297. _delegate->floatPlayerCheckVisibilityRequests(
  298. ) | rpl::start_with_next([=] {
  299. checkVisibility();
  300. }, _delegateLifetime);
  301. _delegate->floatPlayerHideAllRequests(
  302. ) | rpl::start_with_next([=] {
  303. hideAll();
  304. }, _delegateLifetime);
  305. _delegate->floatPlayerShowVisibleRequests(
  306. ) | rpl::start_with_next([=] {
  307. showVisible();
  308. }, _delegateLifetime);
  309. _delegate->floatPlayerRaiseAllRequests(
  310. ) | rpl::start_with_next([=] {
  311. raiseAll();
  312. }, _delegateLifetime);
  313. _delegate->floatPlayerUpdatePositionsRequests(
  314. ) | rpl::start_with_next([=] {
  315. updatePositions();
  316. }, _delegateLifetime);
  317. _delegate->floatPlayerFilterWheelEventRequests(
  318. ) | rpl::start_with_next([=](
  319. const FloatDelegate::FloatPlayerFilterWheelEventRequest &request) {
  320. *request.result = filterWheelEvent(request.object, request.event);
  321. }, _delegateLifetime);
  322. _delegate->floatPlayerAreaUpdates(
  323. ) | rpl::start_with_next([=] {
  324. checkVisibility();
  325. }, _delegateLifetime);
  326. }
  327. void FloatController::checkCurrent() {
  328. const auto state = Media::Player::instance()->current(AudioMsgId::Type::Voice);
  329. const auto audio = state.audio();
  330. const auto fullId = state.contextId();
  331. const auto last = current();
  332. if (last
  333. && audio
  334. && !last->widget->detached()
  335. && (&last->widget->item()->history()->session() == &audio->session())
  336. && (last->widget->item()->fullId() == fullId)) {
  337. return;
  338. }
  339. if (last) {
  340. last->widget->detach();
  341. }
  342. if (!audio) {
  343. return;
  344. }
  345. if (const auto item = audio->session().data().message(fullId)) {
  346. if (const auto media = item->media()) {
  347. if (const auto document = media->document()) {
  348. if (document->isVideoMessage()) {
  349. create(item);
  350. }
  351. }
  352. }
  353. }
  354. }
  355. void FloatController::create(not_null<HistoryItem*> item) {
  356. _items.push_back(std::make_unique<Item>(
  357. _parent,
  358. item,
  359. [=](not_null<Item*> instance, bool visible) {
  360. instance->hiddenByWidget = !visible;
  361. toggle(instance);
  362. },
  363. [=](not_null<Item*> instance, bool closed) {
  364. finishDrag(instance, closed);
  365. },
  366. [=](not_null<const HistoryItem*> item) {
  367. _delegate->floatPlayerDoubleClickEvent(item);
  368. }));
  369. current()->column = Core::App().settings().floatPlayerColumn();
  370. current()->corner = Core::App().settings().floatPlayerCorner();
  371. checkVisibility();
  372. }
  373. void FloatController::toggle(not_null<Item*> instance) {
  374. auto visible = !instance->hiddenByHistory && !instance->hiddenByWidget && instance->widget->isReady();
  375. if (instance->visible != visible) {
  376. instance->widget->resetMouseState();
  377. instance->visible = visible;
  378. if (!instance->visibleAnimation.animating() && !instance->hiddenByDrag) {
  379. auto finalRect = QRect(getPosition(instance), instance->widget->size());
  380. instance->animationSide = getSide(finalRect.center());
  381. }
  382. instance->visibleAnimation.start([=] {
  383. updatePosition(instance);
  384. }, visible ? 0. : 1., visible ? 1. : 0., st::slideDuration, visible ? anim::easeOutCirc : anim::linear);
  385. updatePosition(instance);
  386. }
  387. }
  388. void FloatController::checkVisibility() {
  389. const auto instance = current();
  390. if (!instance) {
  391. return;
  392. }
  393. const auto item = instance->widget->item();
  394. instance->hiddenByHistory = item
  395. ? _delegate->floatPlayerIsVisible(item)
  396. : false;
  397. toggle(instance);
  398. updatePosition(instance);
  399. }
  400. void FloatController::hideAll() {
  401. for (const auto &instance : _items) {
  402. instance->widget->hide();
  403. }
  404. }
  405. void FloatController::showVisible() {
  406. for (const auto &instance : _items) {
  407. if (instance->visible) {
  408. instance->widget->show();
  409. }
  410. }
  411. }
  412. void FloatController::raiseAll() {
  413. for (const auto &instance : _items) {
  414. instance->widget->raise();
  415. }
  416. }
  417. void FloatController::updatePositions() {
  418. for (const auto &instance : _items) {
  419. updatePosition(instance.get());
  420. }
  421. }
  422. std::optional<bool> FloatController::filterWheelEvent(
  423. not_null<QObject*> object,
  424. not_null<QEvent*> event) {
  425. for (const auto &instance : _items) {
  426. if (instance->widget == object) {
  427. const auto section = _delegate->floatPlayerGetSection(
  428. instance->column);
  429. return section->floatPlayerHandleWheelEvent(event);
  430. }
  431. }
  432. return std::nullopt;
  433. }
  434. void FloatController::updatePosition(not_null<Item*> instance) {
  435. auto visible = instance->visibleAnimation.value(instance->visible ? 1. : 0.);
  436. if (visible == 0. && !instance->visible) {
  437. instance->widget->hide();
  438. if (instance->widget->detached()) {
  439. InvokeQueued(instance->widget, [=] {
  440. remove(instance);
  441. });
  442. }
  443. return;
  444. }
  445. if (!instance->widget->dragged()) {
  446. if (instance->widget->isHidden()) {
  447. instance->widget->show();
  448. }
  449. auto dragged = instance->draggedAnimation.value(1.);
  450. auto position = QPoint();
  451. if (instance->hiddenByDrag) {
  452. instance->widget->setOpacity(instance->widget->countOpacityByParent());
  453. position = getHiddenPosition(instance->dragFrom, instance->widget->size(), instance->animationSide);
  454. } else {
  455. instance->widget->setOpacity(visible * visible);
  456. position = getPosition(instance);
  457. if (visible < 1.) {
  458. auto hiddenPosition = getHiddenPosition(position, instance->widget->size(), instance->animationSide);
  459. position.setX(anim::interpolate(hiddenPosition.x(), position.x(), visible));
  460. position.setY(anim::interpolate(hiddenPosition.y(), position.y(), visible));
  461. }
  462. }
  463. if (dragged < 1.) {
  464. position.setX(anim::interpolate(instance->dragFrom.x(), position.x(), dragged));
  465. position.setY(anim::interpolate(instance->dragFrom.y(), position.y(), dragged));
  466. }
  467. instance->widget->move(position);
  468. }
  469. }
  470. QPoint FloatController::getHiddenPosition(
  471. QPoint position,
  472. QSize size,
  473. RectPart side) const {
  474. switch (side) {
  475. case RectPart::Left: return { -size.width(), position.y() };
  476. case RectPart::Top: return { position.x(), -size.height() };
  477. case RectPart::Right: return { _parent->width(), position.y() };
  478. case RectPart::Bottom: return { position.x(), _parent->height() };
  479. }
  480. Unexpected("Bad side in MainWidget::getFloatPlayerHiddenPosition().");
  481. }
  482. QPoint FloatController::getPosition(not_null<Item*> instance) const {
  483. const auto section = _delegate->floatPlayerGetSection(instance->column);
  484. const auto rect = section->floatPlayerAvailableRect();
  485. auto position = rect.topLeft();
  486. if (IsBottomCorner(instance->corner)) {
  487. position.setY(position.y() + rect.height() - instance->widget->height());
  488. }
  489. if (IsRightCorner(instance->corner)) {
  490. position.setX(position.x() + rect.width() - instance->widget->width());
  491. }
  492. return _parent->mapFromGlobal(position);
  493. }
  494. RectPart FloatController::getSide(QPoint center) const {
  495. const auto left = std::abs(center.x());
  496. const auto right = std::abs(_parent->width() - center.x());
  497. const auto top = std::abs(center.y());
  498. const auto bottom = std::abs(_parent->height() - center.y());
  499. if (left < right && left < top && left < bottom) {
  500. return RectPart::Left;
  501. } else if (right < top && right < bottom) {
  502. return RectPart::Right;
  503. } else if (top < bottom) {
  504. return RectPart::Top;
  505. }
  506. return RectPart::Bottom;
  507. }
  508. void FloatController::remove(not_null<Item*> instance) {
  509. auto widget = std::move(instance->widget);
  510. auto i = ranges::find_if(_items, [&](auto &item) {
  511. return (item.get() == instance);
  512. });
  513. Assert(i != _items.end());
  514. _items.erase(i);
  515. // ~QWidget() can call HistoryInner::enterEvent() which can
  516. // lead to repaintHistoryItem() and we'll have an instance
  517. // in _items with destroyed widget. So we destroy the
  518. // instance first and only after that destroy the widget.
  519. widget.destroy();
  520. }
  521. void FloatController::updateColumnCorner(QPoint center) {
  522. Expects(!_items.empty());
  523. auto size = _items.back()->widget->size();
  524. auto min = INT_MAX;
  525. auto column = Core::App().settings().floatPlayerColumn();
  526. auto corner = Core::App().settings().floatPlayerCorner();
  527. auto checkSection = [&](
  528. not_null<FloatSectionDelegate*> widget,
  529. Window::Column widgetColumn) {
  530. auto rect = _parent->mapFromGlobal(
  531. widget->floatPlayerAvailableRect());
  532. auto left = rect.x() + (size.width() / 2);
  533. auto right = rect.x() + rect.width() - (size.width() / 2);
  534. auto top = rect.y() + (size.height() / 2);
  535. auto bottom = rect.y() + rect.height() - (size.height() / 2);
  536. auto checkCorner = [&](QPoint point, RectPart checked) {
  537. auto distance = (point - center).manhattanLength();
  538. if (min > distance) {
  539. min = distance;
  540. column = widgetColumn;
  541. corner = checked;
  542. }
  543. };
  544. checkCorner({ left, top }, RectPart::TopLeft);
  545. checkCorner({ right, top }, RectPart::TopRight);
  546. checkCorner({ left, bottom }, RectPart::BottomLeft);
  547. checkCorner({ right, bottom }, RectPart::BottomRight);
  548. };
  549. _delegate->floatPlayerEnumerateSections(checkSection);
  550. auto &settings = Core::App().settings();
  551. if (settings.floatPlayerColumn() != column) {
  552. settings.setFloatPlayerColumn(column);
  553. Core::App().saveSettingsDelayed();
  554. }
  555. if (settings.floatPlayerCorner() != corner) {
  556. settings.setFloatPlayerCorner(corner);
  557. Core::App().saveSettingsDelayed();
  558. }
  559. }
  560. void FloatController::finishDrag(not_null<Item*> instance, bool closed) {
  561. instance->dragFrom = instance->widget->pos();
  562. const auto center = instance->widget->geometry().center();
  563. if (closed) {
  564. instance->hiddenByDrag = true;
  565. instance->animationSide = getSide(center);
  566. }
  567. updateColumnCorner(center);
  568. instance->column = Core::App().settings().floatPlayerColumn();
  569. instance->corner = Core::App().settings().floatPlayerCorner();
  570. instance->draggedAnimation.stop();
  571. instance->draggedAnimation.start(
  572. [=] { updatePosition(instance); },
  573. 0.,
  574. 1.,
  575. st::slideDuration,
  576. anim::sineInOut);
  577. updatePosition(instance);
  578. if (closed) {
  579. if (const auto item = instance->widget->item()) {
  580. _closeEvents.fire(item->fullId());
  581. }
  582. instance->widget->detach();
  583. Media::Player::instance()->stop(AudioMsgId::Type::Voice);
  584. }
  585. }
  586. } // namespace Player
  587. } // namespace Media