{"18", MC_CONTENT_RATING_18_PLUS}, {"19", MC_CONTENT_RATING_19_PLUS}
};
+const common::PlatformEnum<mc_content_type_e> MediaControllerContentTypeEnum {
+ {"IMAGE", MC_CONTENT_TYPE_IMAGE},
+ {"MUSIC", MC_CONTENT_TYPE_MUSIC},
+ {"VIDEO", MC_CONTENT_TYPE_VIDEO},
+ {"OTHER", MC_CONTENT_TYPE_OTHER},
+ {"UNDECIDED", MC_CONTENT_TYPE_UNDECIDED}
+};
+
PlatformResult ConvertPlaybackState(mc_playback_h playback_h, std::string* state) {
ScopeLogger();
return PlatformResult(ErrorCode::NO_ERROR);
}
+PlatformResult ConvertContentType(mc_playback_h playback_h, std::string* contentType) {
+ ScopeLogger();
+ mc_content_type_e content_type_e = MC_CONTENT_TYPE_UNDECIDED;
+ int ret = mc_client_get_playback_content_type(playback_h, &content_type_e);
+ if (ret != MEDIA_CONTROLLER_ERROR_NONE) {
+ return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Error getting content type",
+ ("mc_client_get_playback_content_type() error: %d, message: %s", ret, get_error_message(ret)));
+ }
+
+ PlatformResult result = MediaControllerContentTypeEnum.getName(content_type_e, contentType);
+ if (!result) {
+ LoggerE("MediaControllerContentTypeEnum.getName() failed, error: %s", result.message().c_str());
+ return result;
+ }
+
+ return PlatformResult(ErrorCode::NO_ERROR);
+}
+
PlatformResult ConvertPlaybackPosition(mc_playback_h playback_h, double* position) {
ScopeLogger();
typedef std::function<void(picojson::value*)> JsonCallback;
-
namespace types {
common::PlatformResult ConvertPlaybackState(mc_playback_h playback_h, std::string* state);
common::PlatformResult ConvertContentAgeRating(mc_playback_h playback_h, std::string* state);
common::PlatformResult ConvertPlaybackPosition(mc_playback_h playback_h, double* position);
common::PlatformResult ConvertMetadata(mc_metadata_h metadata_h, picojson::object* metadata);
+common::PlatformResult ConvertContentType(mc_playback_h playback_h, std::string* contentType);
extern const common::PlatformEnum<mc_server_state_e> MediaControllerServerStateEnum;
extern const common::PlatformEnum<mc_playback_states_e> MediaControllerPlaybackStateEnum;
extern const common::PlatformEnum<mc_meta_e> MediaControllerMetadataAttributeEnum;
extern const common::PlatformEnum<mc_repeat_mode_e> MediaControllerRepeatModeEnum;
extern const common::PlatformEnum<mc_content_age_rating_e> MediaControllerContentAgeRatingEnum;
+extern const common::PlatformEnum<mc_content_type_e> MediaControllerContentTypeEnum;
} // namespace types