// Copyright (c) 2025 Tencent. All rights reserved.
// Author: felixyyan

#pragma once

#include <string>
#include "../include/av_ptt.h"
#include "../include/av_type.h"
#include "bindings/sebind/sebind.h"
#include "tmg_context_bindings.h"

class TMGPTTBindings {
 public:
  explicit TMGPTTBindings(std::shared_ptr<TMGContextBindings> context_bindings);

  int applyPTTAuthbuffer(const std::string& user_sig);
  int setMaxMessageLength(int ms_time);
  int startRecording(const std::string& file_path);
  int stopRecording();
  int cancelRecording();
  int uploadRecordedFile(const std::string& file_path);
  int downloadRecordedFile(const std::string& file_id, const std::string& file_path);
  int playRecordedFile(const std::string& file_path, ITMG_VOICE_TYPE voice_type);
  int stopPlayFile();
  int speechToText(const std::string& file_id,
                   const std::string& speech_language,
                   const std::string& translate_language);
  int translateText(const std::string& text,
                    const std::string& source_language,
                    const std::string& translate_language);
  int getFileSize(const std::string& file_path);
  int getVoiceFileDuration(const std::string& file_path);
  int startRecordingWithStreamingRecognition(const std::string& file_path,
                                             const std::string& speech_language,
                                             const std::string& translate_language);
  int setPTTSourceLanguage(const std::string& source_language);
  int textToSpeech(int serial_number,
                   const std::string& text,
                   const std::string& voice_name,
                   const std::string& language_code,
                   float speaking_rate);

 private:
  ITMGPTT* ptt_ = nullptr;
};
