Browse Source

Audio: deprecated PlayableGroup::setClean() in favor of Listener::update().

No reason to keep the same functionality on two places.
pull/255/head
Vladimír Vondruš 8 years ago
parent
commit
3b88f242cf
  1. 3
      doc/changelog.dox
  2. 2
      src/Magnum/Audio/PlayableGroup.cpp
  3. 6
      src/Magnum/Audio/PlayableGroup.h
  4. 8
      src/Magnum/Audio/Test/PlayableALTest.cpp

3
doc/changelog.dox

@ -102,6 +102,9 @@ See also:
deeply nested, use @ref Math::Distance and @ref Math::Intersection instead deeply nested, use @ref Math::Distance and @ref Math::Intersection instead
- `Math::Geometry::Intersection::boxFrustum()` is deprecated, use - `Math::Geometry::Intersection::boxFrustum()` is deprecated, use
@ref Math::Intersection::rangeFrustum() instead @ref Math::Intersection::rangeFrustum() instead
- @ref Audio::PlayableGroup::setClean() is deprecated in favor of
@ref Audio::Listener::update(), as that one is a feature superset with
clearer naming
- @ref MeshTools::compile() taking a @ref GL::BufferUsage and returning a - @ref MeshTools::compile() taking a @ref GL::BufferUsage and returning a
tuple was deprecated, use the simpler version taking just tuple was deprecated, use the simpler version taking just
@ref Trade::MeshData2D / @ref Trade::MeshData3D and directly returning a @ref Trade::MeshData2D / @ref Trade::MeshData3D and directly returning a

2
src/Magnum/Audio/PlayableGroup.cpp

@ -83,6 +83,7 @@ template<UnsignedInt dimensions> PlayableGroup<dimensions>& PlayableGroup<dimens
return *this; return *this;
} }
#ifdef MAGNUM_BUILD_DEPRECATED
template<UnsignedInt dimensions> void PlayableGroup<dimensions>::setClean() { template<UnsignedInt dimensions> void PlayableGroup<dimensions>::setClean() {
std::vector<std::reference_wrapper<SceneGraph::AbstractObject<dimensions, Float>>> objects; std::vector<std::reference_wrapper<SceneGraph::AbstractObject<dimensions, Float>>> objects;
objects.reserve(this->size()); objects.reserve(this->size());
@ -92,6 +93,7 @@ template<UnsignedInt dimensions> void PlayableGroup<dimensions>::setClean() {
SceneGraph::AbstractObject<dimensions, Float>::setClean(objects); SceneGraph::AbstractObject<dimensions, Float>::setClean(objects);
} }
#endif
/* On non-MinGW Windows the instantiations are already marked with extern /* On non-MinGW Windows the instantiations are already marked with extern
template */ template */

6
src/Magnum/Audio/PlayableGroup.h

@ -99,11 +99,13 @@ template<UnsignedInt dimensions> class PlayableGroup: public SceneGraph::Feature
*/ */
PlayableGroup& setSoundTransformation(const Matrix4& matrix); PlayableGroup& setSoundTransformation(const Matrix4& matrix);
#ifdef MAGNUM_BUILD_DEPRECATED
/** /**
* @brief Set all contained Playables clean * @brief Set all contained Playables clean
* @see @ref AbstractObject::setClean() * @deprecated Use @ref Listener::update() instead.
*/ */
void setClean(); CORRADE_DEPRECATED("use Listener::update() instead") void setClean();
#endif
private: private:
friend Playable<dimensions>; friend Playable<dimensions>;

8
src/Magnum/Audio/Test/PlayableALTest.cpp

@ -72,10 +72,14 @@ void PlayableALTest::group() {
PlayableGroup3D group; PlayableGroup3D group;
Playable3D playable{object, &group}; Playable3D playable{object, &group};
#ifdef MAGNUM_BUILD_DEPRECATED
constexpr Vector3 offset{-3.0f, 2.0f, 1.0f}; constexpr Vector3 offset{-3.0f, 2.0f, 1.0f};
object.translate(offset); object.translate(offset);
CORRADE_IGNORE_DEPRECATED_PUSH
group.setClean(); group.setClean();
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE(playable.source().position(), offset); CORRADE_COMPARE(playable.source().position(), offset);
#endif
group.setGain(0.5f); group.setGain(0.5f);
CORRADE_COMPARE(playable.source().gain(), 0.5f); CORRADE_COMPARE(playable.source().gain(), 0.5f);
@ -83,9 +87,13 @@ void PlayableALTest::group() {
playable.setGain(0.5f); playable.setGain(0.5f);
CORRADE_COMPARE(playable.source().gain(), 0.25f); CORRADE_COMPARE(playable.source().gain(), 0.25f);
#ifdef MAGNUM_BUILD_DEPRECATED
group.setSoundTransformation(Matrix4::fromDiagonal(Vector4{10.0f, 10.0f, 10.0f, 1.0f})); group.setSoundTransformation(Matrix4::fromDiagonal(Vector4{10.0f, 10.0f, 10.0f, 1.0f}));
CORRADE_IGNORE_DEPRECATED_PUSH
group.setClean(); group.setClean();
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE(playable.source().position(), offset*10.0f); CORRADE_COMPARE(playable.source().position(), offset*10.0f);
#endif
group.play(); group.play();
group.pause(); group.pause();

Loading…
Cancel
Save