-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsonica.proto
112 lines (87 loc) · 2.03 KB
/
sonica.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
syntax = "proto3";
service Sonica {
// Playback commands
rpc Play (Empty) returns (Result);
rpc Stop (Empty) returns (Result);
rpc Skip (Empty) returns (Result);
// Queue commands
rpc Clear (Queue.Hash) returns (Result);
rpc Shuffle (Queue.ShuffleTargets) returns (Result);
rpc Move(Queue.Pair) returns (Result);
rpc Remove(Queue.Target) returns (Result);
// Adding commands
rpc Search (Search.Query) returns (Search.Result);
rpc Choose (Search.Choice) returns (Result);
// Info Commands
rpc Engines (Empty) returns (EngineList);
rpc Status (Status.Query) returns (Status.Info);
rpc Library (Empty) returns (LibraryInfo);
}
message Empty {}
message Result {
bool success = 1;
string reason = 2;
}
message Queue {
message Hash {
int64 value = 1;
}
message Target {
int32 index = 1;
}
message Pair {
Hash hash = 1;
Target from_index = 2;
Target to_index = 3;
}
message ShuffleTargets {
Hash hash = 1;
bool queue = 2;
bool autoplay = 3;
}
}
message Search {
message Query {
repeated string query = 1;
repeated string engines = 2;
}
message Result {
message EngineResult {
string name = 1;
map<int64, Song> possibilities = 2;
}
repeated EngineResult results = 1;
}
message Choice {
int64 possibility_id = 1;
bool add_to_top = 2;
}
}
message Song {
string title = 1;
string artist = 2;
string album = 3;
}
message EngineList {
repeated string engines = 1;
}
message Status {
message Query {
int32 queue_max = 1;
int32 autoplay_max = 2;
}
message Info {
Song current = 1;
int32 length = 2;
int32 progress = 3;
int32 state = 8; // Stopped : 1, Playing : 2, Paused : 3
int32 queue_length = 4;
int64 queue_hash = 5;
repeated Song queue = 6;
repeated Song autoplay = 7;
}
}
message LibraryInfo {
int64 size = 1;
repeated Song songs = 2;
}