From 93d7040d046f793d7908ff301910874c10012edd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 16 Feb 2009 04:39:34 +0000 Subject: 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 --- libs/evoral/evoral/TimeConverter.hpp | 9 +++++++++ libs/evoral/src/Sequence.cpp | 11 ++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'libs') 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 +class IdentityConverter : public TimeConverter { + B to(A a) const { return static_cast(a); } + A from(B b) const { return static_cast(b); } +}; + + } // namespace Evoral #endif // EVORAL_TIME_CONVERTER_HPP diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp index ac0ca231f1..d11988e70c 100644 --- a/libs/evoral/src/Sequence.cpp +++ b/libs/evoral/src/Sequence.cpp @@ -191,12 +191,10 @@ Sequence