Changeset View
Changeset View
Standalone View
Standalone View
extern/audaspace/include/devices/IHandle.h
- This file was moved from intern/audaspace/intern/AUD_IHandle.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 | #pragma once | ||||
| * 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_IHandle.h | /** | ||||
| * \ingroup audaspaceintern | * @file IHandle.h | ||||
| * @ingroup devices | |||||
| * Defines the IHandle interface as well as possible states of the handle. | |||||
| */ | */ | ||||
| #ifndef __AUD_IHANDLE_H__ | #include "Audaspace.h" | ||||
| #define __AUD_IHANDLE_H__ | |||||
| //#include "AUD_Space.h" | AUD_NAMESPACE_BEGIN | ||||
| //#include "AUD_Reference.h" | |||||
| /// Status of a playback handle. | |||||
| enum Status | |||||
| { | |||||
| STATUS_INVALID = 0, /// Invalid handle. Maybe due to stopping. | |||||
| STATUS_PLAYING, /// Sound is playing. | |||||
| STATUS_PAUSED, /// Sound is being paused. | |||||
| STATUS_STOPPED /// Sound is stopped but kept in the device. | |||||
| }; | |||||
| /** | |||||
| * The stopCallback is called when a handle reaches the end of the stream and | |||||
| * thus gets stopped. A user defined pointer is supplied to the callback. | |||||
| */ | |||||
| typedef void (*stopCallback)(void*); | typedef void (*stopCallback)(void*); | ||||
| /** | /** | ||||
| * This class represents a playback handles for specific devices. | * @interface IHandle | ||||
| * The IHandle interface represents a playback handles of a specific device. | |||||
| */ | */ | ||||
| class AUD_IHandle | class AUD_API IHandle | ||||
| { | { | ||||
| public: | public: | ||||
| /** | /** | ||||
| * Destroys the handle. | * Destroys the handle. | ||||
| */ | */ | ||||
| virtual ~AUD_IHandle() {} | virtual ~IHandle() {} | ||||
| /** | /** | ||||
| * Pauses a played back sound. | * Pauses a played back sound. | ||||
| Context not available. | |||||
| /** | /** | ||||
| * Returns the status of a played back sound. | * Returns the status of a played back sound. | ||||
| * \return | * \return | ||||
| * - AUD_STATUS_INVALID if the sound has stopped or the handle is | * - STATUS_INVALID if the sound has stopped or the handle is | ||||
| *. invalid | *. invalid | ||||
| * - AUD_STATUS_PLAYING if the sound is currently played back. | * - STATUS_PLAYING if the sound is currently played back. | ||||
| * - AUD_STATUS_PAUSED if the sound is currently paused. | * - STATUS_PAUSED if the sound is currently paused. | ||||
| * - AUD_STATUS_STOPPED if the sound finished playing and is still | * - STATUS_STOPPED if the sound finished playing and is still | ||||
| * kept in the device. | * kept in the device. | ||||
| * \see AUD_Status | * \see Status | ||||
| */ | */ | ||||
| virtual AUD_Status getStatus()=0; | virtual Status getStatus()=0; | ||||
| /** | /** | ||||
| * Retrieves the volume of a playing sound. | * Retrieves the volume of a playing sound. | ||||
| Context not available. | |||||
| virtual bool setStopCallback(stopCallback callback = 0, void* data = 0)=0; | virtual bool setStopCallback(stopCallback callback = 0, void* data = 0)=0; | ||||
| }; | }; | ||||
| #endif //AUD_IHandle | AUD_NAMESPACE_END | ||||
| Context not available. | |||||