Core¶
Imports¶
In Protobuf files:
import "melo/api/Core.proto";
In C++ files:
#include <melo/api/Core.pb.h>
MessageType¶
This enumerator is defining the different kind of message type. We can find three main categories:
The request messages as MESSAGE_TYPE_REQUEST or MESSAGE_TYPE_CANCEL which are respectively used to send a request or cancel a request,
The response messages as MESSAGE_TYPE_RESPONSE or MESSAGE_TYPE_ERROR which are used to provide a response or an error to a request,
The event message as MESSAGE_TYPE_EVENT which are used to broadcast events inside and outside of Melo.
Name |
Number |
Description |
|---|---|---|
MESSAGE_TYPE_UNKNOWN |
0 |
Undefined message type
|
MESSAGE_TYPE_REQUEST |
1 |
A request message is a message sent from a “source” Node to a “destination” Node with a unique
ID and the sender waits for a Response or an Error message with the same unique ID.
The request can also be canceled with a Cancel message using the same unique ID.
|
MESSAGE_TYPE_CANCEL |
2 |
A cancel message is used to cancel a Request message identified by its unique ID. After the
message is sent, the sender should not wait for any Response or Error message.
|
MESSAGE_TYPE_RESPONSE |
3 |
A cancel message is holding the response for a Request message identified by its unique ID.
|
MESSAGE_TYPE_ERROR |
4 |
A cancel message is holding the Error message for a Request message identified by its
unique ID.
|
MESSAGE_TYPE_EVENT |
20 |
An event message is sent from any Node and can be received by any Node who subscribed to the
“source” Node.
To subscribe to event, a Request message with subscription must be sent to the
NODE_TYPE_EVENT Node.
|
NodeType¶
Node type.
A node is the base class to define a new part of Melo: each node has a specific function like a Browser to list medias from a local storage or an online server, a Player to play a media from a local storage or an online platform, …
Each node is identified by its type and an optional unique ID: the combination of both is called the node address.
Name |
Number |
Description |
|---|---|---|
NODE_TYPE_INVALID |
0 |
Invalid node type
|
NODE_TYPE_EVENT |
1 |
An Event node is managing the subscription and routing of events: it will broadcast received
events to all the subscribers.
Note: Assigning an ID to an Event node is forbidden.
|
NODE_TYPE_SDK |
2 |
An SDK node is used to interact from outside of Melo with internal nodes: it is the main gate
to control Melo from a UI.
Note: ID assignment is mandatory for an SDK node.
|
NODE_TYPE_PLUGIN |
3 |
Two variants are supported:
- The Plugin Manager node (without ID) which manage all installed Plugins: it can be used
to list, install, remove, update, enable, disable a Plugin node identified by its unique ID,
- The Plugin node (with an ID) which correspond to one installed Plugin nodes: it is
identified by its unique ID and is used internally to add / remove Browser or Player
nodes.
|
NODE_TYPE_SETTINGS |
4 |
Two variants are supported:
- The Settings Manager node (without ID) which manage all available Settings: it can be
used to list all available Settings node identified by their unique ID,
- The Settings node (with an ID) which correspond to one available Settings node: it is
identified by its unique ID and is used to get and update settings values.
|
NODE_TYPE_BROWSER |
5 |
Two variants are supported:
- The Browser Manager node (without ID) which manage all available Browsers: it can be
used to list all available Browser modes identified by their unique ID,
- The Browser node (with an ID) which correspond to one available Browser node: it is
identified by its unique ID and is used to list and queue Medias to a Player node.
|
NODE_TYPE_PLAYER |
6 |
Two variants are supported:
- The Main Player node (without ID) which wrap the current Player Backend node used to
play the current media in the player queue: all requests to this node are forwarded to the
backend node,
- The Player backend node (with an ID) which correspond to one Player node used as a
player backend.
Note: The Player backend is not accessible from an SDK node.
|
NODE_TYPE_PLAYER_QUEUE |
7 |
A Player Queue node is used to maintain the list of past, current and future media played,
playing and to play.
Note: Assigning an ID to a Player Queue node is forbidden.
|
NODE_TYPE_PLAYLIST |
8 |
Two variants are supported:
- The Playlist Manager node (without ID) which manage all available Playlists: it can be
used to list all available Playlist modes identified by their unique ID and to remove them,
- The Playlist node (with an ID) which correspond to one available Playlist node: it is
identified by its unique ID and is used to list, modify and queue Medias to a Player node.
|