2017-06-06 17:05:34 +02:00
|
|
|
#include <formats.hpp>
|
|
|
|
|
|
|
|
QString formats::normalFormatName(formats::Normal format) {
|
|
|
|
switch (format) {
|
|
|
|
case Normal::JPG:
|
|
|
|
return "JPG";
|
|
|
|
break;
|
|
|
|
case Normal::PNG:
|
|
|
|
return "PNG";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return QString();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
formats::Normal formats::normalFormatFromName(QString format) {
|
|
|
|
if (format.toLower() == "jpg") return Normal::JPG;
|
|
|
|
if (format.toLower() == "jpeg") return Normal::JPG;
|
|
|
|
if (format.toLower() == "png") return Normal::PNG;
|
|
|
|
return Normal::None;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString formats::normalFormatMIME(formats::Normal format) {
|
|
|
|
switch (format) {
|
|
|
|
case Normal::JPG:
|
|
|
|
return "image/jpeg";
|
|
|
|
break;
|
|
|
|
case Normal::PNG:
|
|
|
|
return "image/png";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return QString();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QString formats::recordingFormatName(formats::Recording format) {
|
|
|
|
switch (format) {
|
|
|
|
case Recording::GIF:
|
|
|
|
return "GIF";
|
|
|
|
break;
|
2017-06-11 23:56:06 +02:00
|
|
|
case Recording::WebM:
|
|
|
|
return "WEBM";
|
|
|
|
break;
|
2017-06-13 01:18:18 +02:00
|
|
|
case Recording::MP4:
|
|
|
|
return "MP4";
|
|
|
|
break;
|
2017-06-06 17:05:34 +02:00
|
|
|
default:
|
|
|
|
return QString();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
formats::Recording formats::recordingFormatFromName(QString format) {
|
|
|
|
if (format.toLower() == "gif") return Recording::GIF;
|
2017-06-11 23:56:06 +02:00
|
|
|
if (format.toLower() == "webm") return Recording::WebM;
|
2017-06-13 01:18:18 +02:00
|
|
|
if (format.toLower() == "mp4") return Recording::MP4;
|
2017-06-06 17:05:34 +02:00
|
|
|
return Recording::None;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString formats::recordingFormatMIME(formats::Recording format) {
|
|
|
|
switch (format) {
|
|
|
|
case Recording::GIF:
|
|
|
|
return "image/gif";
|
|
|
|
break;
|
2017-06-11 23:56:06 +02:00
|
|
|
case Recording::WebM:
|
|
|
|
return "video/webm";
|
|
|
|
break;
|
2017-06-13 01:18:18 +02:00
|
|
|
case Recording::MP4:
|
|
|
|
return "video/mp4";
|
|
|
|
break;
|
2017-06-06 17:05:34 +02:00
|
|
|
default:
|
|
|
|
return QString();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|