// Extracted from: Spotify 1.2.52.442 (windows)

syntax = "proto3";

package spotify.playback_esperanto.proto;

option objc_class_prefix = "ESP";
option optimize_for = CODE_SIZE;
option java_package = "com.spotify.playback_esperanto.proto";

message ConnectLoggingParams {
    repeated string interaction_ids = 1;
    repeated string page_instance_ids = 2;
}

message GetVolumeResponse {
    Status status = 1;
    double volume = 2;
}

message GetRawVolumeResponse {
    Status status = 1;
    int32 volume = 2;
}

message SubVolumeResponse {
    Status status = 1;
    double volume = 2;
    VolumeChangeSource source = 3;
}

message SubRawVolumeResponse {
    Status status = 1;
    int32 volume = 2;
    VolumeChangeSource source = 3;
}

message SetVolumeRequest {
    VolumeChangeSource source = 1;
    double volume = 2;
    ConnectLoggingParams connect_logging_params = 3;
}

message SetRawVolumeRequest {
    VolumeChangeSource source = 1;
    int32 volume = 2;
    ConnectLoggingParams connect_logging_params = 3;
}

message NudgeVolumeRequest {
    VolumeChangeSource source = 1;
    ConnectLoggingParams connect_logging_params = 2;
}

message PlaybackInfoResponse {
    reserved 3;
    reserved 16;
    Status status = 1;
    uint64 length_ms = 2;
    bool playing = 4;
    bool buffering = 5;
    int32 error = 6;
    string file_id = 7;
    string file_type = 8;
    string resolved_content_url = 9;
    int32 file_bitrate = 10;
    string codec_name = 11;
    double playback_speed = 12;
    float gain_adjustment = 13;
    bool has_loudness = 14;
    float loudness = 15;
    string strategy = 17;
    int32 target_bitrate = 18;
    int32 advised_bitrate = 19;
    bool target_file_available = 20;
    string audio_id = 21;
}

message GetFormatsResponse {
    message Format {
        string enum_key = 1;
        uint32 enum_value = 2;
        bool supported = 3;
        uint32 bitrate = 4;
        string mime_type = 5;
    }

    repeated GetFormatsResponse.Format formats = 1;
}

message SubPositionRequest {
    uint64 position = 1;
}

message SubPositionResponse {
    Status status = 1;
    uint64 position = 2;
}

message GetFilesRequest {
    string uri = 1;
}

message GetFilesResponse {
    message File {
        string file_id = 1;
        string format = 2;
        uint32 bitrate = 3;
        uint32 format_enum = 4;
    }

    GetFilesStatus status = 1;
    repeated File files = 2;
}

message DuckRequest {
    enum Action {
        START = 0;
        STOP = 1;
    }

    Action action = 2;
    double volume = 3;
    uint32 fade_duration_ms = 4;
}

message DuckResponse {
    Status status = 1;
}

enum Status {
    OK = 0;
    NOT_AVAILABLE = 1;
}

enum GetFilesStatus {
    GETFILES_OK = 0;
    METADATA_CLIENT_NOT_AVAILABLE = 1;
    FILES_NOT_FOUND = 2;
    TRACK_NOT_AVAILABLE = 3;
    EXTENDED_METADATA_ERROR = 4;
}

enum VolumeChangeSource {
    USER = 0;
    SYSTEM = 1;
    CONNECT = 2;
}
