package com.audio.record.screen.test.viewmodel

import androidx.lifecycle.LiveData

import androidx.lifecycle.MutableLiveData

import androidx.lifecycle.ViewModel

class PreviewViewModel : ViewModel() {

    //裁剪比例选择变化
    private val _cropRatioText = MutableLiveData<String>()
    val cropRatioText: LiveData<String> get() = _cropRatioText


    //复制当前文件到内部存储的结果
    private val _copySuccess = MutableLiveData<Pair<Boolean,String>>()
    val copySuccess: LiveData<Pair<Boolean,String>> get() = _copySuccess


    //保存裁剪文件
    private val _saveCrop = MutableLiveData<Boolean>()
    val saveCrop: LiveData<Boolean> get() = _saveCrop


    //更新当前播放速度
    private val _changeSpeed = MutableLiveData<Float>()
    val changeSpeed: LiveData<Float> get() = _changeSpeed


    fun updateCropText(message: String) {
        _cropRatioText.value = message
    }

    fun updateCopyResult(message: Pair<Boolean,String>) {
        _copySuccess.value = message
    }

    fun updateClickCropSave(message: Boolean) {
        _saveCrop.value = message
    }

    fun updateSpeed(message: Float) {
        _changeSpeed.value = message
    }
}