mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Optimized includes of attach_prepare.h.
This commit is contained in:
parent
8f3c3b2a54
commit
57c50c8655
9 changed files with 36 additions and 13 deletions
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "main/main_session.h"
|
||||
#include "data/data_session.h"
|
||||
#include "data/data_document.h"
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
#include "ui/image/image_location_factory.h"
|
||||
#include "storage/localimageloader.h"
|
||||
#include "base/unixtime.h"
|
||||
|
|
|
@ -25,6 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "core/core_settings.h"
|
||||
#include "core/application.h"
|
||||
#include "storage/file_download.h"
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
#include "ui/image/image.h"
|
||||
|
||||
#include <QtCore/QBuffer>
|
||||
|
@ -60,7 +61,8 @@ enum class FileType {
|
|||
QByteArray data,
|
||||
FileType type) {
|
||||
if (type == FileType::Video || type == FileType::VideoSticker) {
|
||||
auto result = ::Media::Clip::PrepareForSending(path, data);
|
||||
auto result = v::get<Ui::PreparedFileInformation::Video>(
|
||||
::Media::Clip::PrepareForSending(path, data).media);
|
||||
if (result.isWebmSticker && type == FileType::Video) {
|
||||
result.thumbnail = Images::Opaque(std::move(result.thumbnail));
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "history/view/media/history_view_media_common.h"
|
||||
#include "window/window_session_controller.h"
|
||||
#include "core/application.h" // Application::showDocument.
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
#include "ui/chat/chat_style.h"
|
||||
#include "ui/image/image.h"
|
||||
#include "ui/text/format_values.h"
|
||||
|
@ -730,7 +731,8 @@ void Gif::validateVideoThumbnail() const {
|
|||
if (_videoThumbnailFrame || content.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
auto info = ::Media::Clip::PrepareForSending(QString(), content);
|
||||
auto info = v::get<Ui::PreparedFileInformation::Video>(
|
||||
::Media::Clip::PrepareForSending(QString(), content).media);
|
||||
_videoThumbnailFrame = std::make_unique<Image>(info.thumbnail.isNull()
|
||||
? Image::BlankMedia()->original()
|
||||
: info.thumbnail);
|
||||
|
|
|
@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "core/application.h"
|
||||
#include "core/core_settings.h"
|
||||
#include "main/main_session.h"
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
|
||||
#include <al.h>
|
||||
#include <alc.h>
|
||||
|
@ -1718,7 +1719,9 @@ private:
|
|||
|
||||
namespace Player {
|
||||
|
||||
Ui::PreparedFileInformation::Song PrepareForSending(const QString &fname, const QByteArray &data) {
|
||||
Ui::PreparedFileInformation PrepareForSending(
|
||||
const QString &fname,
|
||||
const QByteArray &data) {
|
||||
auto result = Ui::PreparedFileInformation::Song();
|
||||
FFMpegAttributesReader reader(Core::FileLocation(fname), data);
|
||||
const auto positionMs = crl::time(0);
|
||||
|
@ -1728,7 +1731,7 @@ Ui::PreparedFileInformation::Song PrepareForSending(const QString &fname, const
|
|||
result.performer = reader.performer();
|
||||
result.cover = reader.cover();
|
||||
}
|
||||
return result;
|
||||
return { .media = result };
|
||||
}
|
||||
|
||||
} // namespace Player
|
||||
|
|
|
@ -8,7 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#pragma once
|
||||
|
||||
#include "ui/effects/animation_value.h"
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
#include "core/file_location.h"
|
||||
#include "data/data_audio_msg_id.h"
|
||||
#include "base/bytes.h"
|
||||
|
@ -16,6 +15,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
namespace Ui {
|
||||
struct PreparedFileInformation;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Media {
|
||||
struct ExternalSoundData;
|
||||
struct ExternalSoundPart;
|
||||
|
@ -369,7 +372,7 @@ private:
|
|||
|
||||
};
|
||||
|
||||
[[nodiscard]] Ui::PreparedFileInformation::Song PrepareForSending(
|
||||
[[nodiscard]] Ui::PreparedFileInformation PrepareForSending(
|
||||
const QString &fname,
|
||||
const QByteArray &data);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "media/clip/media_clip_ffmpeg.h"
|
||||
#include "media/clip/media_clip_check_streaming.h"
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
#include "ui/painter.h"
|
||||
#include "core/file_location.h"
|
||||
#include "base/random.h"
|
||||
|
@ -963,7 +964,9 @@ Manager::~Manager() {
|
|||
clear();
|
||||
}
|
||||
|
||||
Ui::PreparedFileInformation::Video PrepareForSending(const QString &fname, const QByteArray &data) {
|
||||
Ui::PreparedFileInformation PrepareForSending(
|
||||
const QString &fname,
|
||||
const QByteArray &data) {
|
||||
auto result = Ui::PreparedFileInformation::Video();
|
||||
auto localLocation = Core::FileLocation(fname);
|
||||
auto localData = QByteArray(data);
|
||||
|
@ -999,7 +1002,7 @@ Ui::PreparedFileInformation::Video PrepareForSending(const QString &fname, const
|
|||
localData);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return { .media = result };
|
||||
}
|
||||
|
||||
void Finish() {
|
||||
|
|
|
@ -7,12 +7,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#pragma once
|
||||
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
#include "ui/image/image_prepare.h"
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QMutex>
|
||||
|
||||
namespace Ui {
|
||||
struct PreparedFileInformation;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Core {
|
||||
class FileLocation;
|
||||
} // namespace Core
|
||||
|
@ -236,7 +239,7 @@ inline ReaderPointer MakeReader(Args&&... args) {
|
|||
return ReaderPointer(new Reader(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
[[nodiscard]] Ui::PreparedFileInformation::Video PrepareForSending(
|
||||
[[nodiscard]] Ui::PreparedFileInformation PrepareForSending(
|
||||
const QString &fname,
|
||||
const QByteArray &data);
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "boxes/send_files_box.h"
|
||||
#include "boxes/premium_limits_box.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
#include "ui/image/image_prepare.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "storage/file_download.h"
|
||||
|
@ -630,7 +631,8 @@ bool FileLoadTask::CheckForSong(
|
|||
return false;
|
||||
}
|
||||
|
||||
auto media = Media::Player::PrepareForSending(filepath, content);
|
||||
auto media = v::get<Ui::PreparedFileInformation::Song>(
|
||||
Media::Player::PrepareForSending(filepath, content).media);
|
||||
if (media.duration < 0) {
|
||||
return false;
|
||||
}
|
||||
|
@ -658,7 +660,8 @@ bool FileLoadTask::CheckForVideo(
|
|||
return false;
|
||||
}
|
||||
|
||||
auto media = Media::Clip::PrepareForSending(filepath, content);
|
||||
auto media = v::get<Ui::PreparedFileInformation::Video>(
|
||||
Media::Clip::PrepareForSending(filepath, content).media);
|
||||
if (media.duration < 0) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "base/variant.h"
|
||||
#include "api/api_common.h"
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
|
||||
namespace Ui {
|
||||
struct PreparedFileInformation;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Main {
|
||||
class Session;
|
||||
|
|
Loading…
Add table
Reference in a new issue