mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
temporal: add to_string() converters for BBT_Offset
This commit is contained in:
parent
bca2f306ea
commit
4eda53c8c9
1 changed files with 17 additions and 0 deletions
|
|
@ -358,6 +358,23 @@ inline bool string_to (std::string const & str, Temporal::BBT_Time & val)
|
||||||
return (bool) istr;
|
return (bool) istr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline bool to_string (Temporal::BBT_Offset val, std::string & str)
|
||||||
|
{
|
||||||
|
std::ostringstream ostr;
|
||||||
|
ostr << val;
|
||||||
|
str = ostr.str();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline bool string_to (std::string const & str, Temporal::BBT_Offset & val)
|
||||||
|
{
|
||||||
|
std::istringstream istr (str);
|
||||||
|
istr >> val;
|
||||||
|
return (bool) istr;
|
||||||
|
}
|
||||||
|
|
||||||
} /* end namespace PBD */
|
} /* end namespace PBD */
|
||||||
|
|
||||||
#endif /* __libtemporal_bbt_time_h__ */
|
#endif /* __libtemporal_bbt_time_h__ */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue