AudioType, /**< Audio file. Can be played with smil-player.*/
VideoType, /**< Video file. Can be played with smil-player.*/
TextType, /**< Text-section of page.*/
- AnimateType, /**< Animated vector graphics or other animated format supported by smil-player. */
- ImageOrVideoType //TODO: I'm unused enum-item, remove me.
};
public:
}
}
-void MsgUtilsPrivate::checkSmilType()
-{
- static_assert((int)MMS_SMIL_MEDIA_INVALID == (int)MsgMedia::UnknownType &&
- (int)MMS_SMIL_MEDIA_IMG == (int)MsgMedia::ImageType &&
- (int)MMS_SMIL_MEDIA_AUDIO == (int)MsgMedia::AudioType &&
- (int)MMS_SMIL_MEDIA_VIDEO == (int)MsgMedia::VideoType &&
- (int)MMS_SMIL_MEDIA_TEXT == (int)MsgMedia::TextType &&
- (int)MMS_SMIL_MEDIA_ANIMATE == (int)MsgMedia::AnimateType &&
- (int)MMS_SMIL_MEDIA_IMG_OR_VIDEO == (int)MsgMedia::ImageOrVideoType, "");
-}
-
MsgMedia::Type MsgUtilsPrivate::nativeToSmilType(int type)
{
- checkSmilType();
- return (MsgMedia::Type)type;
+ switch(type)
+ {
+ case MMS_SMIL_MEDIA_IMG:
+ return MsgMedia::ImageType;
+ case MMS_SMIL_MEDIA_AUDIO:
+ return MsgMedia::AudioType;
+ case MMS_SMIL_MEDIA_VIDEO:
+ return MsgMedia::VideoType;
+ case MMS_SMIL_MEDIA_TEXT:
+ return MsgMedia::TextType;
+ }
+ return MsgMedia::UnknownType;
}
int MsgUtilsPrivate::smilTypeToNative(MsgMedia::Type type)
{
- checkSmilType();
- return (int)type;
+ switch(type)
+ {
+ case MsgMedia::ImageType:
+ return MMS_SMIL_MEDIA_IMG;
+ case MsgMedia::AudioType:
+ return MMS_SMIL_MEDIA_AUDIO;
+ case MsgMedia::VideoType:
+ return MMS_SMIL_MEDIA_VIDEO;
+ case MsgMedia::TextType:
+ return MMS_SMIL_MEDIA_TEXT;
+ case MsgMedia::UnknownType:
+ break;
+ }
+ return MMS_SMIL_MEDIA_INVALID;
}
std::string MsgUtilsPrivate::getStr(msg_struct_t msgStruct, int field, int maxStrLen)