GotyeMedia.h
1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/****************************************************************************
Copyright(c) 2013-2014, Shanghai AiLiao Information Technology Co.,Ltd
http://www.gotye.com.cn
@author: liugan
@date: 2014-06-20
@version: v3.0
@filename: GotyeMedia.h
@description:
This header file declares gotye media struct for audio/image.
Include "GotyeAPI.h" instead of this.
****************************************************************************/
#ifndef __GOTYE_MEDIA_H__
#define __GOTYE_MEDIA_H__
#include "Gotye.h"
NS_GOTYEAPI_BEGIN
typedef enum
{
GotyeMediaTypeImage = 1, ///<image
GotyeMediaTypeAudio, ///<audio
GotyeMediaTypeUserData, ///< user data
GotyeMediaTypeExtraData ///< extra data
}GotyeMediaType; ///<enum media type.
typedef enum
{
GotyeMediaStatusCreated,
GotyeMediaStatusDownloading,
GotyeMediaStatusDownloaded,
GotyeMediaStatusDownloadFailed
}GotyeMediaStatus;
/**
* @summary: GotyeMedia encapsulates audio/media/user data content using in GotyeAPI
*/
struct GotyeMedia
{
long long tag; ///< reserved
GotyeMediaType type; ///< media type
GotyeMediaStatus status; ///< status of audio/image
std::string url; ///< the relative url for downloading/uploading media
std::string path; ///< saving audio/image thumbnail/userdata
std::string pathEx; ///< saving original image or audio PCM file while decoding.
unsigned duration; ///< audio duration(in millisecond), valid only when the media type is GotyeMediaTypeAudio
GotyeMedia():type(GotyeMediaTypeImage), url(""), path(""), duration(0), tag(0), status(GotyeMediaStatusCreated){ } ///< default ctor
GotyeMedia(GotyeMediaType t):type(t), url(""), path(""), duration(0), tag(0), status(GotyeMediaStatusCreated){ } ///< ctor
};
NS_GOTYEAPI_END
#endif