feat(pager): add bounded voice messages

This commit is contained in:
liu weikai
2026-08-10 11:13:48 +08:00
parent 6bc25ce5e1
commit b3ebdcea84
77 changed files with 11332 additions and 10 deletions
@@ -0,0 +1,49 @@
/**
* @file chat_voice_runtime.cpp
* @brief Global binding for the optional isolated VMP voice UI port.
*/
#include "ui/chat_voice_runtime.h"
namespace ui::chat_voice
{
namespace
{
IVoiceMessageRuntime* s_runtime = nullptr;
} // namespace
void setRuntime(IVoiceMessageRuntime* runtime)
{
s_runtime = runtime;
}
bool isAvailable()
{
return s_runtime && s_runtime->isAvailable();
}
bool canRecordAndSend()
{
return s_runtime && s_runtime->canRecordAndSend();
}
StartResult requestRecordAndSend(uint32_t target_id)
{
return s_runtime ? s_runtime->requestRecordAndSend(target_id)
: StartResult::Unsupported;
}
std::size_t listReceivedMessages(MessageSummary* out_messages,
std::size_t capacity)
{
return s_runtime ? s_runtime->listReceivedMessages(out_messages, capacity) : 0U;
}
bool requestPlayback(uint64_t local_id)
{
return s_runtime && s_runtime->requestPlayback(local_id);
}
} // namespace ui::chat_voice