Changeset View
Changeset View
Standalone View
Standalone View
extern/audaspace/include/sequence/SequenceEntry.h
- This file was moved from intern/audaspace/intern/AUD_SequencerEntry.h.
| /* | /******************************************************************************* | ||||
| * ***** BEGIN GPL LICENSE BLOCK ***** | * Copyright 2009-2016 Jörg Müller | ||||
| * | * | ||||
| * Copyright 2009-2011 Jörg Hermann Müller | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | |||||
| * You may obtain a copy of the License at | |||||
| * | * | ||||
| * This file is part of AudaSpace. | * http://www.apache.org/licenses/LICENSE-2.0 | ||||
| * | * | ||||
| * Audaspace is free software; you can redistribute it and/or modify | * Unless required by applicable law or agreed to in writing, software | ||||
| * it under the terms of the GNU General Public License as published by | * distributed under the License is distributed on an "AS IS" BASIS, | ||||
| * the Free Software Foundation; either version 2 of the License, or | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| * (at your option) any later version. | * See the License for the specific language governing permissions and | ||||
| * | * limitations under the License. | ||||
| * AudaSpace is distributed in the hope that it will be useful, | ******************************************************************************/ | ||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| * GNU General Public License for more details. | |||||
| * | |||||
| * You should have received a copy of the GNU General Public License | |||||
| * along with Audaspace; if not, write to the Free Software Foundation, | |||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||||
| * | |||||
| * ***** END GPL LICENSE BLOCK ***** | |||||
| */ | |||||
| /** \file audaspace/intern/AUD_SequencerEntry.h | #pragma once | ||||
| * \ingroup audaspaceintern | |||||
| /** | |||||
| * @file SequenceEntry.h | |||||
| * @ingroup sequence | |||||
| * The SequenceEntry class. | |||||
| */ | */ | ||||
| #include "sequence/AnimateableProperty.h" | |||||
| #include "util/ILockable.h" | |||||
| #ifndef __AUD_SEQUENCERENTRY_H__ | #include <mutex> | ||||
| #define __AUD_SEQUENCERENTRY_H__ | #include <memory> | ||||
| #include "AUD_AnimateableProperty.h" | AUD_NAMESPACE_BEGIN | ||||
| #include "AUD_IFactory.h" | |||||
| #include "AUD_ILockable.h" | |||||
| #include <pthread.h> | class ISound; | ||||
| #include <boost/shared_ptr.hpp> | |||||
| /** | /** | ||||
| * This class represents a sequenced entry in a sequencer factory. | * This class represents a sequenced entry in a sequencer sound. | ||||
| */ | */ | ||||
| class AUD_SequencerEntry : public AUD_ILockable | class AUD_API SequenceEntry : public ILockable | ||||
| { | { | ||||
| friend class AUD_SequencerHandle; | friend class SequenceHandle; | ||||
| private: | private: | ||||
| /// The status of the entry. Changes every time a non-animated parameter changes. | /// The status of the entry. Changes every time a non-animated parameter changes. | ||||
| int m_status; | int m_status; | ||||
| Context not available. | |||||
| /// The sound status, changed when the sound is changed. | /// The sound status, changed when the sound is changed. | ||||
| int m_sound_status; | int m_sound_status; | ||||
| /// The unique (regarding the factory) ID of the entry. | /// The unique (regarding the sound) ID of the entry. | ||||
| int m_id; | int m_id; | ||||
| /// The sound this entry plays. | /// The sound this entry plays. | ||||
| boost::shared_ptr<AUD_IFactory> m_sound; | std::shared_ptr<ISound> m_sound; | ||||
| /// The begin time. | /// The begin time. | ||||
| float m_begin; | float m_begin; | ||||
| Context not available. | |||||
| float m_cone_volume_outer; | float m_cone_volume_outer; | ||||
| /// The mutex for locking. | /// The mutex for locking. | ||||
| pthread_mutex_t m_mutex; | std::recursive_mutex m_mutex; | ||||
| /// The animated volume. | /// The animated volume. | ||||
| AUD_AnimateableProperty m_volume; | AnimateableProperty m_volume; | ||||
| /// The animated panning. | /// The animated panning. | ||||
| AUD_AnimateableProperty m_panning; | AnimateableProperty m_panning; | ||||
| /// The animated pitch. | /// The animated pitch. | ||||
| AUD_AnimateableProperty m_pitch; | AnimateableProperty m_pitch; | ||||
| /// The animated location. | /// The animated location. | ||||
| AUD_AnimateableProperty m_location; | AnimateableProperty m_location; | ||||
| /// The animated orientation. | /// The animated orientation. | ||||
| AUD_AnimateableProperty m_orientation; | AnimateableProperty m_orientation; | ||||
| // delete copy constructor and operator= | |||||
| SequenceEntry(const SequenceEntry&) = delete; | |||||
| SequenceEntry& operator=(const SequenceEntry&) = delete; | |||||
| public: | public: | ||||
| /** | /** | ||||
| Context not available. | |||||
| * \param skip How much seconds should be skipped at the beginning. | * \param skip How much seconds should be skipped at the beginning. | ||||
| * \param id The ID of the entry. | * \param id The ID of the entry. | ||||
| */ | */ | ||||
| AUD_SequencerEntry(boost::shared_ptr<AUD_IFactory> sound, float begin, float end, float skip, int id); | SequenceEntry(std::shared_ptr<ISound> sound, float begin, float end, float skip, int id); | ||||
| virtual ~AUD_SequencerEntry(); | virtual ~SequenceEntry(); | ||||
| /** | /** | ||||
| * Locks the entry. | * Locks the entry. | ||||
| Context not available. | |||||
| */ | */ | ||||
| virtual void unlock(); | virtual void unlock(); | ||||
| /** | |||||
| * Retrieves the sound of the entry. | |||||
| * \return The sound. | |||||
| */ | |||||
| std::shared_ptr<ISound> getSound(); | |||||
| /** | /** | ||||
| * Sets the sound of the entry. | * Sets the sound of the entry. | ||||
| * \param sound The new sound. | * \param sound The new sound. | ||||
| */ | */ | ||||
| void setSound(boost::shared_ptr<AUD_IFactory> sound); | void setSound(std::shared_ptr<ISound> sound); | ||||
| /** | /** | ||||
| * Moves the entry. | * Moves the entry. | ||||
| Context not available. | |||||
| */ | */ | ||||
| void move(float begin, float end, float skip); | void move(float begin, float end, float skip); | ||||
| /** | |||||
| * Retrieves the muting state of the entry. | |||||
| * \return Whether the entry should is muted or not. | |||||
| */ | |||||
| bool isMuted(); | |||||
| /** | /** | ||||
| * Sets the muting state of the entry. | * Sets the muting state of the entry. | ||||
| * \param mute Whether the entry should be muted or not. | * \param mute Whether the entry should be muted or not. | ||||
| Context not available. | |||||
| * \return A pointer to the animated property, valid as long as the | * \return A pointer to the animated property, valid as long as the | ||||
| * entry is. | * entry is. | ||||
| */ | */ | ||||
| AUD_AnimateableProperty* getAnimProperty(AUD_AnimateablePropertyType type); | AnimateableProperty* getAnimProperty(AnimateablePropertyType type); | ||||
| /** | |||||
| * Updates all non-animated parameters of the entry. | |||||
| * \param volume_max The maximum volume. | |||||
| * \param volume_min The minimum volume. | |||||
| * \param distance_max The maximum distance. | |||||
| * \param distance_reference The reference distance. | |||||
| * \param attenuation The attenuation. | |||||
| * \param cone_angle_outer The outer cone opening angle. | |||||
| * \param cone_angle_inner The inner cone opening angle. | |||||
| * \param cone_volume_outer The volume outside the outer cone. | |||||
| */ | |||||
| void updateAll(float volume_max, float volume_min, float distance_max, | |||||
| float distance_reference, float attenuation, float cone_angle_outer, | |||||
| float cone_angle_inner, float cone_volume_outer); | |||||
| /** | /** | ||||
| * Checks whether the source location, velocity and orientation are relative | * Checks whether the source location, velocity and orientation are relative | ||||
| Context not available. | |||||
| void setConeVolumeOuter(float volume); | void setConeVolumeOuter(float volume); | ||||
| }; | }; | ||||
| #endif //__AUD_SEQUENCERENTRY_H__ | AUD_NAMESPACE_END | ||||
| Context not available. | |||||