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

import androidx.lifecycle.LiveData

import androidx.lifecycle.MutableLiveData

import androidx.lifecycle.ViewModel
import androidx.navigation.NavController

class MainViewModel : ViewModel() {

    //服务连接
    private val _serviceConnectStatus = MutableLiveData<Boolean>()
    val serviceConnectStatus: LiveData<Boolean> get() = _serviceConnectStatus


    //前置摄像头状态
    private val _webcamStatus = MutableLiveData<Boolean>()
    val webcamStatus: LiveData<Boolean> get() = _webcamStatus


    //截屏状态
    private val _screenshotStatus = MutableLiveData<Boolean>()
    val screenshotStatus: LiveData<Boolean> get() = _screenshotStatus


    //悬浮球状态
    private val _ballStatus = MutableLiveData<Boolean>()
    val ballStatus: LiveData<Boolean> get() = _ballStatus


    //录制状态
    private val _recordingStatus = MutableLiveData<Int>()
    val recordingStatus: LiveData<Int> get() = _recordingStatus


    //录制导航器
    private val _navController = MutableLiveData<NavController>()
    val navController: LiveData<NavController> get() = _navController


    fun updateNavController(message: NavController) {
        _navController.value = message
    }


    fun updateServiceConnectStatus(message: Boolean) {
        _serviceConnectStatus.value = message
    }

    fun updateBallStatus(message: Boolean) {
        _ballStatus.value = message
    }
    fun updateWebcamStatus(message: Boolean) {
        _webcamStatus.value = message
    }
    fun updateScreenshotStatus(message: Boolean) {
        _screenshotStatus.value = message
    }


    fun updateRecordingStatus(message: Int) {
        _recordingStatus.value = message
    }
}