diff options
author | David Robillard <d@drobilla.net> | 2009-02-16 04:39:34 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-02-16 04:39:34 +0000 |
commit | 93d7040d046f793d7908ff301910874c10012edd (patch) | |
tree | 11142af8017f4bd4fa70b6013fabad673833cb0b /libs/evoral/evoral/TimeConverter.hpp | |
parent | 3963d2b0b224e79fdf8e852e39fc3a765fa1431b (diff) |
Fix deadlock issues.
Add IdentityConverter for when no conversion is actually needed.
git-svn-id: svn://localhost/ardour2/branches/3.0@4595 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/evoral/TimeConverter.hpp')
-rw-r--r-- | libs/evoral/evoral/TimeConverter.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/evoral/evoral/TimeConverter.hpp b/libs/evoral/evoral/TimeConverter.hpp index 3f434d9dd7..eabe0e4762 100644 --- a/libs/evoral/evoral/TimeConverter.hpp +++ b/libs/evoral/evoral/TimeConverter.hpp @@ -38,6 +38,15 @@ public: virtual A from(B b) const = 0; }; + +/** A stub TimeConverter that simple statically casts between types. */ +template<typename A, typename B> +class IdentityConverter : public TimeConverter<A,B> { + B to(A a) const { return static_cast<B>(a); } + A from(B b) const { return static_cast<A>(b); } +}; + + } // namespace Evoral #endif // EVORAL_TIME_CONVERTER_HPP |