mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
e58f84d5c8
Former-commit-id: 97b281cc14b3bc239fc5eab1f66c9d15e67f753f
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
// getoptPlusPLus includes
|
|
#include <getoptPlusPlus/getoptpp.h>
|
|
|
|
// grabber includes
|
|
#include <grabber/VideoStandard.h>
|
|
|
|
using namespace vlofgren;
|
|
|
|
/// Data parameter for the video standard
|
|
typedef vlofgren::PODParameter<VideoStandard> VideoStandardParameter;
|
|
|
|
namespace vlofgren {
|
|
/// Translates a string (as passed on the commandline) to a color standard
|
|
///
|
|
/// @param[in] s The string (as passed on the commandline)
|
|
/// @return The color standard
|
|
/// @throws Parameter::ParameterRejected If the string did not result in a video standard
|
|
template<>
|
|
VideoStandard VideoStandardParameter::validate(const std::string& s) throw (Parameter::ParameterRejected)
|
|
{
|
|
QString input = QString::fromStdString(s).toLower();
|
|
|
|
if (input == "pal")
|
|
{
|
|
return VIDEOSTANDARD_PAL;
|
|
}
|
|
else if (input == "ntsc")
|
|
{
|
|
return VIDEOSTANDARD_NTSC;
|
|
}
|
|
else if (input == "no-change")
|
|
{
|
|
return VIDEOSTANDARD_NO_CHANGE;
|
|
}
|
|
|
|
throw Parameter::ParameterRejected("Invalid value for video standard. Valid values are: PAL, NTSC, and NO-CHANGE");
|
|
return VIDEOSTANDARD_NO_CHANGE;
|
|
}
|
|
}
|