package com.adealink.weparty.room.sdk.controller

import com.adealink.frame.base.IError
import com.adealink.weparty.room.sdk.listener.IDeviceListener
import io.trtc.tuikit.atomicxcore.api.device.DeviceStatus
import kotlinx.coroutines.flow.StateFlow

interface IDeviceController<L : IDeviceListener> : IController<L> {

    val microphoneStatusFlow: StateFlow<DeviceStatus>

    fun isLocalUserMute(): Boolean

    fun openLocalMicrophone(onSuccess: (() -> Unit)? = null, onFail: ((error: IError) -> Unit)? = null)

    fun closeLocalMicrophone()

    fun toggleMicrophone(onSuccess: (() -> Unit)? = null, onFail: ((error: IError) -> Unit)? = null)

}