syntax = "proto3";

import "cmvr/api/common.proto";

package cmvr.api;

message SpeakerState {
    bool is_initialized = 1;
    bool is_running = 2;
    bool is_decoding = 3;
    bool is_paused = 5;
    int32 volume = 6;
    string error_message = 7;
}

message GetSpeakerStateCommand {
    message Request {
        CommandHeader.Request header = 1;
    }

    message Feedback {
        CommandHeader.Feedback header = 1;
        SpeakerState state = 2;
    }
}

message PlayAudioCommand {
    message Request {
        CommandHeader.Request header = 1;
        string audio_path = 2;
    }
    message Feedback {
        CommandHeader.Feedback header = 1;
    }
}

message StreamSpeakerAudioCommand {
    message Request {
        CommandHeader.Request header = 1;
        AudioData audio = 2;
    }
    message Feedback {
        CommandHeader.Feedback header = 1;
    }
}

message StopSpeakerCommand {
    message Request {
        CommandHeader.Request header = 1;
    }
    message Feedback {
        CommandHeader.Feedback header = 1;
    }
}

message PauseSpeakerCommand {
    message Request {
        CommandHeader.Request header = 1;
    }
    message Feedback {
        CommandHeader.Feedback header = 1;
    }
}

message ResumeSpeakerCommand {
    message Request {
        CommandHeader.Request header = 1;
    }
    message Feedback {
        CommandHeader.Feedback header = 1;
    }
}

message SetSpeakerVolumeCommand {
    message Request {
        CommandHeader.Request header = 1;
        int32 volume = 2;
    }
    message Feedback {
        CommandHeader.Feedback header = 1;
    }
}

message GetSpeakerVolumeCommand {
    message Request {
        CommandHeader.Request header = 1;
    }
    message Feedback {
        CommandHeader.Feedback header = 1;
        int32 volume = 2;
    }
}
