const std::vector<AudioStateMachine::Transition> AudioStateMachine::transitions_ = {
// === 1. 初始化 / 去初始化 ===
Transition{ServiceState::DEINIT, StreamType::NONE, EventType::INIT, &AudioStateMachine::initAction, ServiceState::INIT_SUCCESS, StreamType::NONE},
Transition{ServiceState::INIT_SUCCESS, StreamType::NONE, EventType::DEINIT, &AudioStateMachine::deinitAction, ServiceState::DEINIT, StreamType::NONE},
Transition{ServiceState::INIT_SUCCESS, StreamType::LOOPBACK, EventType::DEINIT, &AudioStateMachine::deinitAction, ServiceState::DEINIT, StreamType::NONE},
Transition{ServiceState::INIT_SUCCESS, StreamType::TONE, EventType::DEINIT, &AudioStateMachine::deinitAction, ServiceState::DEINIT, StreamType::NONE},
Transition{ServiceState::INIT_SUCCESS, StreamType::PLAYBACK, EventType::DEINIT, &AudioStateMachine::deinitAction, ServiceState::DEINIT, StreamType::NONE},
Transition{ServiceState::INIT_SUCCESS, StreamType::VOICE_CALL,EventType::DEINIT, &AudioStateMachine::deinitAction, ServiceState::DEINIT, StreamType::NONE},
Transition{ServiceState::INIT_FAILED, StreamType::NONE, EventType::DEINIT, &AudioStateMachine::deinitAction, ServiceState::DEINIT, StreamType::NONE},
// === 2. Loopback 操作 ===
Transition{ServiceState::INIT_SUCCESS, StreamType::NONE, EventType::START_LOOPBACK, &AudioStateMachine::startLoopbackAction, ServiceState::INIT_SUCCESS, StreamType::LOOPBACK},
Transition{ServiceState::INIT_SUCCESS, StreamType::LOOPBACK, EventType::STOP_LOOPBACK, &AudioStateMachine::stopLoopbackAction, ServiceState::INIT_SUCCESS, StreamType::NONE},
// === 3. Tone 操作 ===
Transition{ServiceState::INIT_SUCCESS, StreamType::NONE, EventType::START_TONE, &AudioStateMachine::startToneAction, ServiceState::INIT_SUCCESS, StreamType::TONE},
Transition{ServiceState::INIT_SUCCESS, StreamType::TONE, EventType::START_TONE, &AudioStateMachine::startToneAction, ServiceState::INIT_SUCCESS, StreamType::TONE},
Transition{ServiceState::INIT_SUCCESS, StreamType::TONE, EventType::STOP_TONE, &AudioStateMachine::stopToneAction, ServiceState::INIT_SUCCESS, StreamType::NONE},
// === 4. Playback 操作 ===
Transition{ServiceState::INIT_SUCCESS, StreamType::NONE, EventType::START_PLAYBACK, &AudioStateMachine::initPlaybackAction, ServiceState::INIT_SUCCESS, StreamType::PLAYBACK},
Transition{ServiceState::INIT_SUCCESS, StreamType::PLAYBACK, EventType::START_PLAYBACK, &AudioStateMachine::startPlaybackAction, ServiceState::INIT_SUCCESS, StreamType::PLAYBACK},
Transition{ServiceState::INIT_SUCCESS, StreamType::PLAYBACK, EventType::PAUSE_PLAYBACK, &AudioStateMachine::pausePlaybackAction, ServiceState::INIT_SUCCESS, StreamType::PLAYBACK},
Transition{ServiceState::INIT_SUCCESS, StreamType::PLAYBACK, EventType::RESUME_PLAYBACK, &AudioStateMachine::resumePlaybackAction,ServiceState::INIT_SUCCESS, StreamType::PLAYBACK},
Transition{ServiceState::INIT_SUCCESS, StreamType::PLAYBACK, EventType::STOP_PLAYBACK, &AudioStateMachine::stopPlaybackAction, ServiceState::INIT_SUCCESS, StreamType::PLAYBACK},
Transition{ServiceState::INIT_SUCCESS, StreamType::PLAYBACK, EventType::CLOSE_PLAYBACK, &AudioStateMachine::closePlaybackAction, ServiceState::INIT_SUCCESS, StreamType::NONE},
// === 5. Voice Call 操作 ===
Transition{ServiceState::INIT_SUCCESS, StreamType::NONE, EventType::START_VOICE_CALL, &AudioStateMachine::startVoiceCallAction, ServiceState::INIT_SUCCESS, StreamType::VOICE_CALL},
Transition{ServiceState::INIT_SUCCESS, StreamType::VOICE_CALL,EventType::STOP_VOICE_CALL, &AudioStateMachine::stopVoiceCallAction, ServiceState::INIT_SUCCESS, StreamType::NONE},
// === 6. 配置操作(SetConfig)===
Transition{ServiceState::INIT_SUCCESS, StreamType::NONE, EventType::SET_CONFIG, &AudioStateMachine::setConfigAction, ServiceState::INIT_SUCCESS, StreamType::NONE},
Transition{ServiceState::INIT_SUCCESS, StreamType::LOOPBACK, EventType::SET_CONFIG, &AudioStateMachine::setConfigAction, ServiceState::INIT_SUCCESS, StreamType::LOOPBACK},
Transition{ServiceState::INIT_SUCCESS, StreamType::TONE, EventType::SET_CONFIG, &AudioStateMachine::setConfigAction, ServiceState::INIT_SUCCESS, StreamType::TONE},
Transition{ServiceState::INIT_SUCCESS, StreamType::PLAYBACK, EventType::SET_CONFIG, &AudioStateMachine::setConfigAction, ServiceState::INIT_SUCCESS, StreamType::PLAYBACK},
Transition{ServiceState::INIT_SUCCESS, StreamType::VOICE_CALL,EventType::SET_CONFIG, &AudioStateMachine::setConfigAction, ServiceState::INIT_SUCCESS, StreamType::VOICE_CALL}
};