[LMSAPI] move proto files into lms-api/proto

This commit is contained in:
emeric
2015-07-29 23:00:03 +02:00
parent e361e38a98
commit dabed0b3cf
7 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -112,8 +112,8 @@ MOSTLYCLEANFILES = \
$(builddir)/messages.pb.cc \
$(builddir)/messages.pb.h
%.pb.cc %.pb.h: $(srcdir)/lms-api/proto/%.proto
$(PROTOC) --proto_path=$(srcdir)/lms-api/proto/ --cpp_out=$(builddir)/ $^
%.pb.cc %.pb.h: $(top_srcdir)/lms-api/proto/%.proto
$(PROTOC) --proto_path=$(top_srcdir)/lms-api/proto/ --cpp_out=$(builddir)/ $^
endif
-67
View File
@@ -1,67 +0,0 @@
/*
* Copyright (C) 2013 Emeric Poupon
*
* This file is part of LMS.
*
* LMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
*/
import "common.proto";
package LmsAPI;
message AuthRequest
{
message Password
{
required string user_login = 1;
required string user_password = 2;
}
enum Type
{
TypePassword = 1;
}
required Type type = 1;
optional Password password = 2;
}
message AuthResponse
{
message PasswordResult
{
enum Type
{
TypePasswordInvalid = 1;
TypeLoginThrottling = 2; // The attempt was not processed because of throttling
TypePasswordValid = 3;
}
required Type type = 1;
optional uint32 delay = 2; // in seconds, in case of PasswordInvalid/LoginThrottling
}
enum Type
{
TypePasswordResult = 1;
}
required Type type = 1;
optional PasswordResult password_result = 2;
}
-197
View File
@@ -1,197 +0,0 @@
/*
* Copyright (C) 2013 Emeric Poupon
*
* This file is part of LMS.
*
* LMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
*/
import "common.proto";
package LmsAPI;
message AudioCollectionRequest
{
message SearchFilter
{
repeated uint64 artist_id = 1; // has one of these artists
repeated uint64 genre_id = 2; // has one of these genres
repeated uint64 release_id = 3; // hase one of these releases
repeated uint64 track_id = 4; // has one of theses tracks
}
message BatchParameter
{
required uint32 offset = 1; // First element requested
required uint32 size = 2; // Number of elements requested. Server may not honor this size if too big
}
message GetGenreList
{
required BatchParameter batch_parameter = 1;
optional SearchFilter search_filter = 2;
}
message GetArtistList
{
required BatchParameter batch_parameter = 1;
optional SearchFilter search_filter = 2;
}
message GetReleaseList
{
required BatchParameter batch_parameter = 1;
optional SearchFilter search_filter = 2;
}
message GetTrackList
{
required BatchParameter batch_parameter = 1;
optional SearchFilter search_filter = 2;
}
message GetCoverArt
{
enum Type
{
TypeGetCoverArtRelease = 1;
TypeGetCoverArtTrack = 2;
}
required Type type = 1;
optional uint64 release_id = 2; // Release that owns the cover art
optional uint64 track_id = 3; // Track that owns the cover art
required uint32 size = 4; // Scale image to size*size pixels. Set 0 to get the biggest image
}
enum Type
{
TypeGetRevision = 1;
TypeGetGenreList = 2;
TypeGetArtistList = 3;
TypeGetReleaseList = 4;
TypeGetTrackList = 5;
TypeGetCoverArt = 6;
}
required Type type = 1;
optional GetGenreList get_genres = 3;
optional GetArtistList get_artists = 4;
optional GetReleaseList get_releases = 5;
optional GetTrackList get_tracks = 6;
optional GetCoverArt get_cover_art = 7;
}
message AudioCollectionResponse
{
message Revision
{
required string rev = 1; // Unique identifier of the database revision
}
message GenreList
{
repeated Genre genres = 1;
}
message ArtistList
{
repeated Artist artists = 1;
}
message ReleaseList
{
repeated Release releases = 1;
}
message TrackList
{
repeated Track tracks = 1;
}
message CoverArt
{
optional string mime_type = 1;
required bytes data = 2;
}
message Genre
{
required uint64 id = 1;
optional string mbid = 2;
required string name = 3;
}
message Artist
{
required uint64 id = 1;
optional string mbid = 2;
required string name = 3;
}
message Release
{
required uint64 id = 1;
optional string mbid = 2;
required string name = 3;
}
message Track
{
required uint64 id = 1; // Track id
optional string mbid = 2;
required uint64 artist_id = 3;
required uint64 release_id = 4;
repeated uint64 genre_id = 5;
optional string artist_mbid = 6;
optional string release_mbid = 7;
optional uint32 disc_number = 8;
optional uint32 track_number = 9;
required string name = 10;
required uint32 duration_secs = 11;
optional string release_date = 12;
optional string original_release_date = 13;
}
enum Type {
TypeRevision = 1;
TypeGenreList = 2;
TypeArtistList = 3;
TypeReleaseList = 4;
TypeTrackList = 5;
TypeCoverArt = 6;
}
required Type type = 1;
optional Revision revision = 2;
optional GenreList genre_list = 3;
optional ArtistList artist_list = 4;
optional ReleaseList release_list = 5;
optional TrackList track_list = 6;
repeated CoverArt cover_art = 7;
}
-27
View File
@@ -1,27 +0,0 @@
/*
* Copyright (C) 2013 Emeric Poupon
*
* This file is part of LMS.
*
* LMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
*/
package LmsAPI;
message Error
{
required bool error = 1;
optional string message = 2;
}
-139
View File
@@ -1,139 +0,0 @@
/*
* Copyright (C) 2013 Emeric Poupon
*
* This file is part of LMS.
*
* LMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
*/
import "common.proto";
package LmsAPI;
message MediaRequest
{
message Prepare
{
enum AudioCodecType
{
AudioCodecTypeOGA = 1;
}
enum AudioBitrate {
AudioBitrate_32_kbps = 1;
AudioBitrate_64_kbps = 2;
AudioBitrate_96_kbps = 3;
AudioBitrate_128_kbps = 4;
AudioBitrate_192_kbps = 5;
AudioBitrate_256_kbps = 6;
}
enum VideoCodecType
{
VideoCodecTypeOGV = 1;
}
enum VideoBitrate {
VideoBitrate_512_kbps = 1;
}
message Audio
{
required int64 track_id = 1; // Id if the media
required AudioCodecType codec_type = 2;
required AudioBitrate bitrate = 3;
optional uint32 stream_idx = 4;
optional uint32 offset_secs = 5;
}
message Video
{
required int64 video_id = 1; // Id if the media
required VideoCodecType codec_type = 2;
required AudioBitrate audio_bitrate = 3;
required VideoBitrate video_bitrate = 4;
optional uint32 offset_secs = 5;
optional uint32 audio_stream_idx = 6;
optional uint32 video_stream_idx = 7;
optional uint32 subtitle_stream_idx = 8;
}
enum Type {
AudioRequest = 1;
VideoRequest = 2;
}
required Type type = 1;
optional Audio audio = 2;
optional Video video = 3;
}
message GetPart
{
required uint32 handle = 1; // handle that uniquely identify the media. Get using the Prepare request
required uint32 requested_data_size = 2; // Amount of data requested. May receive more or less. May receive 0 byte if complete
}
message Terminate
{
required uint32 handle = 1;
}
enum Type
{
TypeMediaPrepare = 1;
TypeMediaGetPart = 2;
TypeMediaTerminate = 3;
}
required Type type = 1;
optional Prepare prepare = 2;
optional GetPart get_part = 3;
optional Terminate terminate = 4;
} // MediaRequest
message MediaResponse
{
message PrepareResult
{
optional uint32 handle = 1; // handle iif prepare request was ok
}
message PartResult
{
optional bytes data = 2; // 0 bytes when the media is over, nothing when the request is ill formed
}
message TerminateResult
{
}
enum Type
{
TypePrepareResult = 1;
TypePartResult = 2;
TypeTerminateResult = 3;
}
required Type type = 1;
optional PrepareResult prepare_result = 2;
optional PartResult part_result = 3;
optional TerminateResult terminate_result = 4;
}
-71
View File
@@ -1,71 +0,0 @@
/*
* Copyright (C) 2013 Emeric Poupon
*
* This file is part of LMS.
*
* LMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
*/
import "common.proto";
import "auth.proto";
import "collection.proto";
import "media.proto";
package LmsAPI;
// Every request sent by the client must be a ClientMessage
// The server will answer using a ServerMessage
//
// The client must authenticate first before querying data
// If an expected message is received, the connection is dropped by the server
//
// A header is to be added before the serialized protobuf message in order to keep
// track of where one message ends and the next begins.
// Format:
// MAGIC (4 bytes, 0xDE, 0xAD, 0xBE, 0xEF)- SIZE (4 bytes, big endian encoded) - serialized proto message
message ClientMessage
{
enum Type
{
AuthRequest = 1;
AudioCollectionRequest = 2;
MediaRequest = 3;
}
required Type type = 1;
optional AuthRequest auth_request = 2;
optional AudioCollectionRequest audio_collection_request = 3;
optional MediaRequest media_request = 4;
}
message ServerMessage
{
enum Type
{
AuthResponse = 1;
AudioCollectionResponse = 2;
MediaResponse = 3;
}
required Type type = 1;
optional AuthResponse auth_response = 2;
optional AudioCollectionResponse audio_collection_response = 3;
optional MediaResponse media_response = 4;
}