mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-17 05:09:58 +01:00
New Source Callbacks for Play control )fast forward, seek, etc.)
2 new callbacks (PlayFastForward, PlaySpeed), modified Seek callback to take target time in seconds (instead of ratio of duration). Integrating this in Input Mapping GUI and Session saving.
This commit is contained in:
@@ -211,6 +211,24 @@ bool BaseToolkit::is_a_number(const std::string& str, int *val)
|
||||
return isanumber;
|
||||
}
|
||||
|
||||
bool BaseToolkit::is_a_value(const std::string& str, float *val)
|
||||
{
|
||||
bool isavalue = false;
|
||||
|
||||
try {
|
||||
*val = std::stof(str);
|
||||
isavalue = true;
|
||||
}
|
||||
catch (const std::invalid_argument&) {
|
||||
// avoids crash
|
||||
}
|
||||
catch (const std::out_of_range&) {
|
||||
// avoids crash
|
||||
}
|
||||
|
||||
return isavalue;
|
||||
}
|
||||
|
||||
std::string BaseToolkit::common_prefix( const std::list<std::string> & allStrings )
|
||||
{
|
||||
if (allStrings.empty())
|
||||
|
||||
Reference in New Issue
Block a user