added stream state "unknown"

This commit is contained in:
badaix 2016-03-07 22:05:48 +01:00
parent 4a75aaf84b
commit a77be90fee
3 changed files with 7 additions and 5 deletions

View file

@ -25,7 +25,7 @@ public class Stream implements JsonSerialisable {
} else {
uri = new StreamUri(json);
id = json.getString("id");
status = Status.fromString("idle");
status = Status.unknown;
}
} catch (JSONException e) {
e.printStackTrace();
@ -99,6 +99,7 @@ public class Stream implements JsonSerialisable {
}
public enum Status {
unknown("unknown"),
idle("idle"),
playing("playing"),
disabled("disabled");

View file

@ -135,7 +135,7 @@ void PcmReader::onChunkEncoded(const Encoder* encoder, msg::PcmChunk* chunk, dou
json PcmReader::toJson() const
{
string state("idle");
string state("unknown");
if (state_ == kIdle)
state = "idle";
else if (state_ == kPlaying)

View file

@ -34,9 +34,10 @@ class PcmReader;
enum ReaderState
{
kIdle = 0,
kPlaying = 1,
kDisabled = 2
kUnknown = 0,
kIdle = 1,
kPlaying = 2,
kDisabled = 3
};