2 * Copyright (c) 2014 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.
22 #include <media_content.h>
24 #include "ExtNameInfo.h"
33 bool CFileInfo::Create(void)
42 memset(m, 0, sizeof(SFileInfo));
44 if (!CExtNameInfo::Create(CExtNameInfo::CLASS_TYPE_FILE)) {
54 void CFileInfo::Destroy(void)
59 CExtNameInfo::Destroy();
66 groups gType(media_content_type_e type)
68 groups ret = E_GRP_OTHER;
71 case MEDIA_CONTENT_TYPE_IMAGE:
75 case MEDIA_CONTENT_TYPE_VIDEO:
78 case MEDIA_CONTENT_TYPE_MUSIC:
90 bool CFileInfo::Duplicate(CNameInfo* obj)
95 if (!CExtNameInfo::Duplicate(obj))
102 bool CFileInfo::SetLoadInfo(media_info_h handle)
111 bool CFileInfo::Load(void)
119 if (media_info_get_media_id(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
120 _ERR("media ID Fetch error");
126 if (media_info_get_title(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
127 _ERR("media name Fetch error");
133 media_content_type_e ctype;
134 if (media_info_get_media_type(m->handle, &ctype) != MEDIA_CONTENT_ERROR_NONE) {
135 _ERR("media type Fetch error");
138 SetType(gType(ctype));
141 if (media_info_get_size(m->handle, &size) != MEDIA_CONTENT_ERROR_NONE) {
142 _ERR("media size Fetch error");
147 if (media_info_get_file_path(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
148 _ERR("media file path Fetch error");
154 if (media_info_get_thumbnail_path(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
155 _ERR("media thumb Fetch error");
160 _ERR("Fail to get string by media_info_get_thumbnail_path");
165 SetThumbnailPath(str);
170 if (media_info_get_modified_time(m->handle, &time) != MEDIA_CONTENT_ERROR_NONE) {
171 _ERR("media mod time Fetch error");
174 SetModifiedTime(time);