"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleManagementAudioRequests = handleManagementAudioRequests;
const audioCommands_1 = require("./audioCommands");
function handleManagementAudioRequests(onCommand, dispatch, frontApplet) {
    onCommand(async (commandEvent) => {
        switch (commandEvent.command.type) {
            case audioCommands_1.ManagementAudioGetVolumeRequest:
                await dispatch({
                    type: audioCommands_1.ManagementAudioGetVolumeResult,
                    volume: await frontApplet.management.audio.getVolume(),
                });
                break;
            case audioCommands_1.ManagementAudioSetVolumeRequest:
                await frontApplet.management.audio.setVolume(commandEvent.command.volume);
                await dispatch({
                    type: audioCommands_1.ManagementAudioSetVolumeResult,
                    result: {},
                });
                break;
            default:
        }
    });
}
//# sourceMappingURL=handleAudioRequests.js.map