Skip to content

Commit

Permalink
Add convertToText(StreamState). Fixes #38
Browse files Browse the repository at this point in the history
  • Loading branch information
dturner committed Feb 12, 2018
1 parent f6586af commit 1415d4b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/oboe/Definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace oboe {

enum class StreamState : aaudio_stream_state_t {
Uninitialized = AAUDIO_STREAM_STATE_UNINITIALIZED,
Unknown = AAUDIO_STREAM_STATE_UNKNOWN,
Open = AAUDIO_STREAM_STATE_OPEN,
Starting = AAUDIO_STREAM_STATE_STARTING,
Started = AAUDIO_STREAM_STATE_STARTED,
Expand Down
23 changes: 23 additions & 0 deletions src/common/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,27 @@ const char *convertToText<Direction>(Direction direction) {
}
}

template<>
const char *convertToText<StreamState>(StreamState state) {
switch (state) {
OBOE_CASE_ENUM(StreamState::Closed);
OBOE_CASE_ENUM(StreamState::Closing);
OBOE_CASE_ENUM(StreamState::Disconnected);
OBOE_CASE_ENUM(StreamState::Flushed);
OBOE_CASE_ENUM(StreamState::Flushing);
OBOE_CASE_ENUM(StreamState::Open);
OBOE_CASE_ENUM(StreamState::Paused);
OBOE_CASE_ENUM(StreamState::Pausing);
OBOE_CASE_ENUM(StreamState::Started);
OBOE_CASE_ENUM(StreamState::Starting);
OBOE_CASE_ENUM(StreamState::Stopped);
OBOE_CASE_ENUM(StreamState::Stopping);
OBOE_CASE_ENUM(StreamState::Uninitialized);
OBOE_CASE_ENUM(StreamState::Unknown);
default:
return "Unrecognized stream state";
}
}


} // namespace oboe

0 comments on commit 1415d4b

Please sign in to comment.