audioswitch icon indicating copy to clipboard operation
audioswitch copied to clipboard

[Feature request] need an API AudioSwitch.start() without parameter listener or manager multiple listeners

Open Tougee opened this issue 3 years ago • 0 comments

Thanks for making this convenient library!

Currently the start() must invoke with a listener parameter, and the listener parameter will override audioDeviceChangeListener which means it cannot use multiple listeners.

Is it possible to provide a start() without any parameters like this:

fun start(listener: AudioDeviceChangeListener) {
        audioDeviceChangeListener = listener
        start()
    }

fun start() {
        when (state) {
            STOPPED -> {
                bluetoothHeadsetManager?.start(bluetoothDeviceConnectionListener)
                wiredHeadsetReceiver.start(wiredDeviceConnectionListener)
                enumerateDevices()
                state = STARTED
            }
            else -> {
                logger.d(TAG, "Redundant start() invocation while already in the started or activated state")
            }
        }
    }

or provider some addListener() API to manager a list of audioDeviceChangeListener.

Tougee avatar Feb 09 '22 14:02 Tougee