2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef MEDIACONTROLLER_MEDIACONTROLLER_UTILS_H_
18 #define MEDIACONTROLLER_MEDIACONTROLLER_UTILS_H_
20 #include <media_controller_type.h>
25 #include "common/platform_result.h"
26 #include "common/platform_enum.h"
30 namespace mediacontroller {
32 typedef std::function<void(picojson::value*)> JsonCallback;
37 common::PlatformResult ConvertPlaybackState(mc_playback_h playback_h, std::string* state);
38 common::PlatformResult ConvertContentAgeRating(mc_playback_h playback_h, std::string* state);
39 common::PlatformResult ConvertPlaybackPosition(mc_playback_h playback_h, double* position);
40 common::PlatformResult ConvertMetadata(mc_metadata_h metadata_h, picojson::object* metadata);
42 extern const common::PlatformEnum<mc_server_state_e> MediaControllerServerStateEnum;
43 extern const common::PlatformEnum<mc_playback_states_e> MediaControllerPlaybackStateEnum;
44 extern const common::PlatformEnum<mc_playback_action_e> MediaControllerPlaybackActionEnum;
45 extern const common::PlatformEnum<mc_meta_e> MediaControllerMetadataAttributeEnum;
46 extern const common::PlatformEnum<mc_repeat_mode_e> MediaControllerRepeatModeEnum;
47 extern const common::PlatformEnum<mc_content_age_rating_e> MediaControllerContentAgeRatingEnum;
53 common::PlatformResult GetAllPlaylists(const std::string& app_id, picojson::array* playlists);
56 } // namespace mediacontroller
57 } // namespace extension
59 #endif // MEDIACONTROLLER_MEDIACONTROLLER_UTILS_H_