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)
40 memset(m, 0, sizeof(SFileInfo));
42 if (!CExtNameInfo::Create(CExtNameInfo::CLASS_TYPE_FILE)) {
52 void CFileInfo::Destroy(void)
56 CExtNameInfo::Destroy();
63 groups gType(media_content_type_e type)
65 groups ret = E_GRP_OTHER;
68 case MEDIA_CONTENT_TYPE_IMAGE:
72 case MEDIA_CONTENT_TYPE_VIDEO:
75 case MEDIA_CONTENT_TYPE_MUSIC:
87 bool CFileInfo::Duplicate(CNameInfo* obj)
91 if (!CExtNameInfo::Duplicate(obj))
98 bool CFileInfo::SetLoadInfo(media_info_h handle)
106 bool CFileInfo::Load(void)
113 if (media_info_get_media_id(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
114 _ERR("media ID Fetch error");
120 if (media_info_get_title(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
121 _ERR("media name Fetch error");
127 media_content_type_e ctype;
128 if (media_info_get_media_type(m->handle, &ctype) != MEDIA_CONTENT_ERROR_NONE) {
129 _ERR("media type Fetch error");
132 SetType(gType(ctype));
135 if (media_info_get_size(m->handle, &size) != MEDIA_CONTENT_ERROR_NONE) {
136 _ERR("media size Fetch error");
141 if (media_info_get_file_path(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
142 _ERR("media file path Fetch error");
148 if (media_info_get_thumbnail_path(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
149 _ERR("media thumb Fetch error");
154 _ERR("Fail to get string by media_info_get_thumbnail_path");
159 SetThumbnailPath(str);
164 if (media_info_get_modified_time(m->handle, &time) != MEDIA_CONTENT_ERROR_NONE) {
165 _ERR("media mod time Fetch error");
168 SetModifiedTime(time);