URY playd
C++ minimalist audio player
messages.h
Go to the documentation of this file.
1 // This file is part of playd.
2 // playd is licensed under the MIT licence: see LICENSE.txt.
3 
9 #ifndef PLAYD_MESSAGES_H
10 #define PLAYD_MESSAGES_H
11 
12 #include <string>
13 
14 //
15 // Client communications
16 //
17 
18 #ifndef PD_VERSION
19 #define PD_VERSION "0.0.0"
20 #endif
21 const std::string MSG_OHAI_PLAYD = "playd-" PD_VERSION;
23 
25 const std::string MSG_OHAI_BIFROST = "bifrost-0.3.0";
26 
27 //
28 // Command failure messages
29 //
30 
32 const std::string MSG_CMD_SHORT =
33  "Command must contain at least a tag and one command word";
34 
36 const std::string MSG_CMD_INVALID = "Bad command or file name";
37 
42 const std::string MSG_CMD_NEEDS_LOADED = "Command requires a loaded file";
43 
48 const std::string MSG_CMD_NEEDS_PLAYING = "Command requires a playing file";
49 
54 const std::string MSG_CMD_NEEDS_STOPPED = "Command requires a stopped file";
55 
57 const std::string MSG_CMD_PLAYER_CLOSING = "Server is closing";
58 
59 //
60 // Decoder failures
61 //
62 
64 const std::string MSG_DECODE_BADRATE = "Unsupported or invalid sample rate";
65 
66 //
67 // Device ID failures
68 //
69 
71 const std::string MSG_DEV_BADID = "Incorrect device ID";
72 
73 //
74 // Load failures
75 //
76 
78 const std::string MSG_LOAD_EMPTY_PATH = "Empty file path given";
79 
80 //
81 // Audio output failures
82 //
83 
85 const std::string MSG_OUTPUT_RINGWRITE = "Ring buffer write error";
86 
88 const std::string MSG_OUTPUT_RINGINIT = "Ring buffer init error";
89 
90 //
91 // Seek failures
92 //
93 
95 const std::string MSG_SEEK_FAIL = "Seek failed";
96 
98 const std::string MSG_SEEK_INVALID_VALUE = "Invalid time: try integer";
99 
100 //
101 // General command failures
102 //
103 
105 const std::string MSG_NOT_FOUND = "not found";
106 
108 const std::string MSG_INVALID_PAYLOAD = "cannot write this value";
109 
111 const std::string MSG_INVALID_ACTION = "cannot perform this action";
112 
113 //
114 // IO failures
115 //
116 
118 const std::string MSG_IO_CANNOT_ALLOC = "cannot allocate I/O object";
119 
121 const std::string MSG_TOO_MANY_CONNS = "too many simultaneous connections";
122 
123 #endif // PLAYD_MESSAGES_H
const std::string MSG_DEV_BADID
Message shown when an incorrect device ID is provided.
Definition: messages.h:71
const std::string MSG_IO_CANNOT_ALLOC
Message shown when allocating an IO object fails.
Definition: messages.h:118
const std::string MSG_CMD_SHORT
Message shown when the CommandHandler receives an under-length command.
Definition: messages.h:32
const std::string MSG_NOT_FOUND
Message shown when a command is called with a missing resource.
Definition: messages.h:105
const std::string MSG_CMD_NEEDS_LOADED
Message shown when a command that works only when a file is loaded is fired when there isn&#39;t anything...
Definition: messages.h:42
const std::string MSG_LOAD_EMPTY_PATH
Message shown when one tries to Load an empty path.
Definition: messages.h:78
const std::string MSG_INVALID_PAYLOAD
Message shown when an invalid payload is supplied for writing.
Definition: messages.h:108
const std::string MSG_CMD_PLAYER_CLOSING
Message shown when a command is sent to a closing Player.
Definition: messages.h:57
const std::string MSG_CMD_NEEDS_STOPPED
Message shown when a command that works only when a file is stopped is fired when there isn&#39;t anythin...
Definition: messages.h:54
const std::string MSG_CMD_NEEDS_PLAYING
Message shown when a command that works only when a file is playing is fired when there isn&#39;t anythin...
Definition: messages.h:48
const std::string MSG_CMD_INVALID
Message shown when the CommandHandler receives an invalid command.
Definition: messages.h:36
const std::string MSG_SEEK_FAIL
Message shown when an attempt to seek fails.
Definition: messages.h:95
const std::string MSG_OUTPUT_RINGINIT
Message shown when there is an error initialising the ring buffer.
Definition: messages.h:88
const std::string MSG_TOO_MANY_CONNS
Message shown when too many simultaneous connections are launched.
Definition: messages.h:121
const std::string MSG_OHAI_BIFROST
The protocol name and version.
Definition: messages.h:25
const std::string MSG_OUTPUT_RINGWRITE
Message shown when there is an error writing to the ring buffer.
Definition: messages.h:85
const std::string MSG_SEEK_INVALID_VALUE
Message shown when a seek command has an invalid time value.
Definition: messages.h:98
const std::string MSG_INVALID_ACTION
Message shown when we try to write/delete to something we can&#39;t.
Definition: messages.h:111
const std::string MSG_DECODE_BADRATE
Message shown when a bad sample rate is found.
Definition: messages.h:64
const std::string MSG_OHAI_PLAYD
The playd name and version.
Definition: messages.h:22