Add empty TranscriptionManager.

This commit is contained in:
levlam 2023-11-21 15:14:26 +03:00
parent b55af58a69
commit a83f90448f
6 changed files with 59 additions and 0 deletions

View File

@ -498,6 +498,7 @@ set(TDLIB_SOURCE
td/telegram/TopDialogCategory.cpp td/telegram/TopDialogCategory.cpp
td/telegram/TopDialogManager.cpp td/telegram/TopDialogManager.cpp
td/telegram/TranscriptionInfo.cpp td/telegram/TranscriptionInfo.cpp
td/telegram/TranscriptionManager.cpp
td/telegram/TranslationManager.cpp td/telegram/TranslationManager.cpp
td/telegram/UpdatesManager.cpp td/telegram/UpdatesManager.cpp
td/telegram/Usernames.cpp td/telegram/Usernames.cpp
@ -819,6 +820,7 @@ set(TDLIB_SOURCE
td/telegram/TopDialogCategory.h td/telegram/TopDialogCategory.h
td/telegram/TopDialogManager.h td/telegram/TopDialogManager.h
td/telegram/TranscriptionInfo.h td/telegram/TranscriptionInfo.h
td/telegram/TranscriptionManager.h
td/telegram/TranslationManager.h td/telegram/TranslationManager.h
td/telegram/UniqueId.h td/telegram/UniqueId.h
td/telegram/UpdatesManager.h td/telegram/UpdatesManager.h

View File

@ -322,6 +322,7 @@ function split_file($file, $chunks, $undo) {
'TopDialogCategory|get_top_dialog_category' => 'TopDialogCategory', 'TopDialogCategory|get_top_dialog_category' => 'TopDialogCategory',
'top_dialog_manager[_(-][^.]|TopDialogManager' => 'TopDialogManager', 'top_dialog_manager[_(-][^.]|TopDialogManager' => 'TopDialogManager',
'translation_manager[_(-][^.]|TranslationManager' => "TranslationManager", 'translation_manager[_(-][^.]|TranslationManager' => "TranslationManager",
'transcription_manager[_(-][^.]|TranscriptionManager' => "TranscriptionManager",
'updates_manager[_(-][^.]|UpdatesManager|get_difference[)]|updateSentMessage|dummyUpdate' => 'UpdatesManager', 'updates_manager[_(-][^.]|UpdatesManager|get_difference[)]|updateSentMessage|dummyUpdate' => 'UpdatesManager',
'WebPageId(Hash)?' => 'WebPageId', 'WebPageId(Hash)?' => 'WebPageId',
'web_pages_manager[_(-][^.]|WebPagesManager' => 'WebPagesManager'); 'web_pages_manager[_(-][^.]|WebPagesManager' => 'WebPagesManager');

View File

@ -141,6 +141,7 @@
#include "td/telegram/ThemeManager.h" #include "td/telegram/ThemeManager.h"
#include "td/telegram/TopDialogCategory.h" #include "td/telegram/TopDialogCategory.h"
#include "td/telegram/TopDialogManager.h" #include "td/telegram/TopDialogManager.h"
#include "td/telegram/TranscriptionManager.h"
#include "td/telegram/TranslationManager.h" #include "td/telegram/TranslationManager.h"
#include "td/telegram/UpdatesManager.h" #include "td/telegram/UpdatesManager.h"
#include "td/telegram/UserId.h" #include "td/telegram/UserId.h"
@ -3330,6 +3331,8 @@ void Td::dec_actor_refcnt() {
LOG(DEBUG) << "ThemeManager was cleared" << timer; LOG(DEBUG) << "ThemeManager was cleared" << timer;
top_dialog_manager_.reset(); top_dialog_manager_.reset();
LOG(DEBUG) << "TopDialogManager was cleared" << timer; LOG(DEBUG) << "TopDialogManager was cleared" << timer;
transcription_manager_.reset();
LOG(DEBUG) << "TranscriptionManager was cleared" << timer;
translation_manager_.reset(); translation_manager_.reset();
LOG(DEBUG) << "TranslationManager was cleared" << timer; LOG(DEBUG) << "TranslationManager was cleared" << timer;
updates_manager_.reset(); updates_manager_.reset();
@ -3537,6 +3540,8 @@ void Td::clear() {
LOG(DEBUG) << "ThemeManager actor was cleared" << timer; LOG(DEBUG) << "ThemeManager actor was cleared" << timer;
top_dialog_manager_actor_.reset(); top_dialog_manager_actor_.reset();
LOG(DEBUG) << "TopDialogManager actor was cleared" << timer; LOG(DEBUG) << "TopDialogManager actor was cleared" << timer;
transcription_manager_actor_.reset();
LOG(DEBUG) << "TranscriptionManager actor was cleared" << timer;
translation_manager_actor_.reset(); translation_manager_actor_.reset();
LOG(DEBUG) << "TranslationManager actor was cleared" << timer; LOG(DEBUG) << "TranslationManager actor was cleared" << timer;
updates_manager_actor_.reset(); updates_manager_actor_.reset();
@ -4038,6 +4043,8 @@ void Td::init_managers() {
top_dialog_manager_ = make_unique<TopDialogManager>(this, create_reference()); top_dialog_manager_ = make_unique<TopDialogManager>(this, create_reference());
top_dialog_manager_actor_ = register_actor("TopDialogManager", top_dialog_manager_.get()); top_dialog_manager_actor_ = register_actor("TopDialogManager", top_dialog_manager_.get());
G()->set_top_dialog_manager(top_dialog_manager_actor_.get()); G()->set_top_dialog_manager(top_dialog_manager_actor_.get());
transcription_manager_ = make_unique<TranscriptionManager>(this, create_reference());
transcription_manager_actor_ = register_actor("TranscriptionManager", transcription_manager_.get());
translation_manager_ = make_unique<TranslationManager>(this, create_reference()); translation_manager_ = make_unique<TranslationManager>(this, create_reference());
translation_manager_actor_ = register_actor("TranslationManager", translation_manager_.get()); translation_manager_actor_ = register_actor("TranslationManager", translation_manager_.get());
updates_manager_ = make_unique<UpdatesManager>(this, create_reference()); updates_manager_ = make_unique<UpdatesManager>(this, create_reference());

View File

@ -84,6 +84,7 @@ class StorageManager;
class StoryManager; class StoryManager;
class ThemeManager; class ThemeManager;
class TopDialogManager; class TopDialogManager;
class TranscriptionManager;
class TranslationManager; class TranslationManager;
class UpdatesManager; class UpdatesManager;
class VideoNotesManager; class VideoNotesManager;
@ -213,6 +214,8 @@ class Td final : public Actor {
ActorOwn<ThemeManager> theme_manager_actor_; ActorOwn<ThemeManager> theme_manager_actor_;
unique_ptr<TopDialogManager> top_dialog_manager_; unique_ptr<TopDialogManager> top_dialog_manager_;
ActorOwn<TopDialogManager> top_dialog_manager_actor_; ActorOwn<TopDialogManager> top_dialog_manager_actor_;
unique_ptr<TranscriptionManager> transcription_manager_;
ActorOwn<TranscriptionManager> transcription_manager_actor_;
unique_ptr<TranslationManager> translation_manager_; unique_ptr<TranslationManager> translation_manager_;
ActorOwn<TranslationManager> translation_manager_actor_; ActorOwn<TranslationManager> translation_manager_actor_;
unique_ptr<UpdatesManager> updates_manager_; unique_ptr<UpdatesManager> updates_manager_;

View File

@ -0,0 +1,18 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/telegram/TranscriptionManager.h"
namespace td {
TranscriptionManager::TranscriptionManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) {
}
void TranscriptionManager::tear_down() {
parent_.reset();
}
} // namespace td

View File

@ -0,0 +1,28 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/actor/actor.h"
#include "td/utils/common.h"
namespace td {
class Td;
class TranscriptionManager final : public Actor {
public:
TranscriptionManager(Td *td, ActorShared<> parent);
private:
void tear_down() final;
Td *td_;
ActorShared<> parent_;
};
} // namespace td