import '../tmg_ptt.dart';
import '../tmg_type.dart';
import '../bindings/tmg_ptt_bindings.dart' as TMGPTTBindings;

class TMGPTTImpl extends ITMGPTT {
  late final _instance;
  TMGPTTImpl() {
    _instance = new TMGPTTBindings.TMGPTTBindings();
  }

  @override
  int ApplyPTTAuthbuffer(String userSig) {
    return _instance.ApplyPTTAuthbuffer(userSig);
  }

  @override
  int SetMaxMessageLength(int msTime) {
    return _instance.SetMaxMessageLength(msTime);
  }

  @override
  int StartRecording(String filePath) {
    return _instance.StartRecording(filePath);
  }

  @override
  int StopRecording() {
    return _instance.StopRecording();
  }

  @override
  int CancelRecording() {
    return _instance.CancelRecording();
  }

  @override
  int UploadRecordedFile(String filePath) {
    return _instance.UploadRecordedFile(filePath);
  }

  @override
  int DownloadRecordedFile(String fileId, String filePath) {
    return _instance.DownloadRecordedFile(fileId, filePath);
  }

  @override
  int PlayRecordedFile(String filePath, ITMG_VOICE_TYPE voiceType) {
    return _instance.PlayRecordedFile(filePath, voiceType);
  }

  @override
  int StopPlayFile() {
    return _instance.StopPlayFile();
  }

  @override
  int SpeechToText(
    String fileID,
    String speechLanguage,
    String translateLanguage,
  ) {
    return _instance.SpeechToText(fileID, speechLanguage, translateLanguage);
  }

  @override
  int TranslateText(
    String text,
    String sourceLanguage,
    String translateLanguage,
  ) {
    return _instance.TranslateText(text, sourceLanguage, translateLanguage);
  }

  @override
  int GetFileSize(String filePath) {
    return _instance.GetFileSize(filePath);
  }

  @override
  int GetVoiceFileDuration(String filePath) {
    return _instance.GetVoiceFileDuration(filePath);
  }

  @override
  int StartRecordingWithStreamingRecognition(
    String filePath,
    String speechLanguage,
    String translateLanguage,
  ) {
    return _instance.StartRecordingWithStreamingRecognition(
      filePath,
      speechLanguage,
      translateLanguage,
    );
  }

  @override
  int SetPTTSourceLanguage(String sourceLanguage) {
    return _instance.SetPTTSourceLanguage(sourceLanguage);
  }

  @override
  int TextToSpeech(
    int serialNumber,
    String text,
    String voiceName,
    String languageCode,
    double speakingRate,
  ) {
    return _instance.TextToSpeech(
      serialNumber,
      text,
      voiceName,
      languageCode,
      speakingRate,
    );
  }
}
