Changeset View
Changeset View
Standalone View
Standalone View
extern/audaspace/include/sequence/SequenceData.h
- This file was moved from intern/audaspace/intern/AUD_Sequencer.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_Sequencer.h | |||||
| * \ingroup audaspaceintern | |||||
| */ | |||||
| #pragma once | |||||
| #ifndef __AUD_SEQUENCER_H__ | /** | ||||
| #define __AUD_SEQUENCER_H__ | * @file SequenceData.h | ||||
| * @ingroup sequence | |||||
| * The SequenceData class. | |||||
| */ | |||||
| #include "AUD_AnimateableProperty.h" | #include "respec/Specification.h" | ||||
| #include "AUD_IFactory.h" | #include "sequence/AnimateableProperty.h" | ||||
| #include "AUD_ILockable.h" | #include "devices/I3DDevice.h" | ||||
| #include "util/ILockable.h" | |||||
| #include <list> | #include <list> | ||||
| #include <pthread.h> | #include <memory> | ||||
| #include <mutex> | |||||
| class AUD_SequencerEntry; | AUD_NAMESPACE_BEGIN | ||||
| class SequenceEntry; | |||||
| class ISound; | |||||
| /** | /** | ||||
| * This class represents sequenced entries to play a sound scene. | * This class represents sequenced entries to play a sound scene. | ||||
| */ | */ | ||||
| class AUD_Sequencer : public AUD_ILockable | class AUD_API SequenceData : public ILockable | ||||
| { | { | ||||
| friend class AUD_SequencerReader; | friend class SequenceReader; | ||||
| private: | private: | ||||
| /// The target specification. | /// The target specification. | ||||
| AUD_Specs m_specs; | Specs m_specs; | ||||
| /// The status of the sequence. Changes every time a non-animated parameter changes. | /// The status of the sequence. Changes every time a non-animated parameter changes. | ||||
| int m_status; | int m_status; | ||||
| Context not available. | |||||
| int m_id; | int m_id; | ||||
| /// The sequenced entries. | /// The sequenced entries. | ||||
| std::list<boost::shared_ptr<AUD_SequencerEntry> > m_entries; | std::list<std::shared_ptr<SequenceEntry> > m_entries; | ||||
| /// Whether the whole scene is muted. | /// Whether the whole scene is muted. | ||||
| bool m_muted; | bool m_muted; | ||||
| Context not available. | |||||
| float m_doppler_factor; | float m_doppler_factor; | ||||
| /// Distance model. | /// Distance model. | ||||
| AUD_DistanceModel m_distance_model; | DistanceModel m_distance_model; | ||||
| /// The animated volume. | /// The animated volume. | ||||
| AUD_AnimateableProperty m_volume; | AnimateableProperty m_volume; | ||||
| /// The animated listener location. | /// The animated listener location. | ||||
| AUD_AnimateableProperty m_location; | AnimateableProperty m_location; | ||||
| /// The animated listener orientation. | /// The animated listener orientation. | ||||
| AUD_AnimateableProperty m_orientation; | AnimateableProperty m_orientation; | ||||
| /// The mutex for locking. | /// The mutex for locking. | ||||
| pthread_mutex_t m_mutex; | std::recursive_mutex m_mutex; | ||||
| // hide copy constructor and operator= | // delete copy constructor and operator= | ||||
| AUD_Sequencer(const AUD_Sequencer&); | SequenceData(const SequenceData&) = delete; | ||||
| AUD_Sequencer& operator=(const AUD_Sequencer&); | SequenceData& operator=(const SequenceData&) = delete; | ||||
| public: | public: | ||||
| /** | /** | ||||
| Context not available. | |||||
| * \param fps The FPS of the scene. | * \param fps The FPS of the scene. | ||||
| * \param muted Whether the whole scene is muted. | * \param muted Whether the whole scene is muted. | ||||
| */ | */ | ||||
| AUD_Sequencer(AUD_Specs specs, float fps, bool muted); | SequenceData(Specs specs, float fps, bool muted); | ||||
| virtual ~AUD_Sequencer(); | virtual ~SequenceData(); | ||||
| /** | /** | ||||
| * Locks the sequence. | * Locks the sequence. | ||||
| Context not available. | |||||
| virtual void unlock(); | virtual void unlock(); | ||||
| /** | /** | ||||
| * Retrieves the audio output specification. | |||||
| * \return The specification. | |||||
| */ | |||||
| Specs getSpecs(); | |||||
| /** | |||||
| * Sets the audio output specification. | * Sets the audio output specification. | ||||
| * \param specs The new specification. | * \param specs The new specification. | ||||
| */ | */ | ||||
| void setSpecs(AUD_Specs specs); | void setSpecs(Specs specs); | ||||
| /** | |||||
| * Retrieves the scene's FPS. | |||||
| * \return The scene's FPS. | |||||
| */ | |||||
| float getFPS() const; | |||||
| /** | /** | ||||
| * Sets the scene's FPS. | * Sets the scene's FPS. | ||||
| Context not available. | |||||
| * Retrieves the muting state of the scene. | * Retrieves the muting state of the scene. | ||||
| * \return Whether the scene is muted. | * \return Whether the scene is muted. | ||||
| */ | */ | ||||
| bool getMute() const; | bool isMuted() const; | ||||
| /** | /** | ||||
| * Retrieves the speed of sound. | * Retrieves the speed of sound. | ||||
| Context not available. | |||||
| * Retrieves the distance model. | * Retrieves the distance model. | ||||
| * \return The distance model. | * \return The distance model. | ||||
| */ | */ | ||||
| AUD_DistanceModel getDistanceModel() const; | DistanceModel getDistanceModel() const; | ||||
| /** | /** | ||||
| * Sets the distance model. | * Sets the distance model. | ||||
| * \param model distance model. | * \param model distance model. | ||||
| */ | */ | ||||
| void setDistanceModel(AUD_DistanceModel model); | void setDistanceModel(DistanceModel model); | ||||
| /** | /** | ||||
| * Retrieves one of the animated properties of the sequence. | * Retrieves one of the animated properties of the sequence. | ||||
| 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 | ||||
| * sequence is. | * sequence is. | ||||
| */ | */ | ||||
| AUD_AnimateableProperty* getAnimProperty(AUD_AnimateablePropertyType type); | AnimateableProperty* getAnimProperty(AnimateablePropertyType type); | ||||
| /** | /** | ||||
| * Adds a new entry to the scene. | * Adds a new entry to the scene. | ||||
| 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. | ||||
| * \return The entry added. | * \return The entry added. | ||||
| */ | */ | ||||
| boost::shared_ptr<AUD_SequencerEntry> add(boost::shared_ptr<AUD_IFactory> sound, float begin, float end, float skip); | std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, float begin, float end, float skip); | ||||
| /** | /** | ||||
| * Removes an entry from the scene. | * Removes an entry from the scene. | ||||
| * \param entry The entry to remove. | * \param entry The entry to remove. | ||||
| */ | */ | ||||
| void remove(boost::shared_ptr<AUD_SequencerEntry> entry); | void remove(std::shared_ptr<SequenceEntry> entry); | ||||
| }; | }; | ||||
| #endif //__AUD_SEQUENCER_H__ | AUD_NAMESPACE_END | ||||
| Context not available. | |||||