Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
IHandle.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright 2009-2016 Jörg Müller
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 ******************************************************************************/
16
17#pragma once
18
25#include "Audaspace.h"
26
28
31{
32 STATUS_INVALID = 0,
36};
37
42typedef void (*stopCallback)(void*);
43
49{
50public:
54 virtual ~IHandle() {}
55
62 virtual bool pause()=0;
63
70 virtual bool resume()=0;
71
79 virtual bool stop()=0;
80
88 virtual bool getKeep()=0;
89
98 virtual bool setKeep(bool keep)=0;
99
108 virtual bool seek(double position)=0;
109
115 virtual double getPosition()=0;
116
128 virtual Status getStatus()=0;
129
134 virtual float getVolume()=0;
135
143 virtual bool setVolume(float volume)=0;
144
149 virtual float getPitch()=0;
150
158 virtual bool setPitch(float pitch)=0;
159
165 virtual int getLoopCount()=0;
166
175 virtual bool setLoopCount(int count)=0;
176
186 virtual bool setStopCallback(stopCallback callback = 0, void* data = 0)=0;
187};
188
The main header file of the library defining the namespace and basic data types.
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition Audaspace.h:119
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition Audaspace.h:116
#define AUD_API
Used for exporting symbols in the shared library.
Definition Audaspace.h:93
Status
Status of a playback handle.
Definition IHandle.h:31
@ STATUS_PAUSED
Sound is playing.
Definition IHandle.h:34
@ STATUS_PLAYING
Invalid handle. Maybe due to stopping.
Definition IHandle.h:33
@ STATUS_STOPPED
Sound is being paused.
Definition IHandle.h:35
void(* stopCallback)(void *)
The stopCallback is called when a handle reaches the end of the stream and thus gets stopped.
Definition IHandle.h:42
The IHandle interface represents a playback handles of a specific device.
Definition IHandle.h:49
virtual bool getKeep()=0
Gets the behaviour of the device for a played back sound when the sound doesn't return any more sampl...
virtual bool pause()=0
Pauses a played back sound.
virtual bool setLoopCount(int count)=0
Sets the loop count of a playing sound.
virtual float getPitch()=0
Retrieves the pitch of a playing sound.
virtual Status getStatus()=0
Returns the status of a played back sound.
virtual bool seek(double position)=0
Seeks in a played back sound.
virtual bool stop()=0
Stops a played back or paused sound.
virtual double getPosition()=0
Retrieves the current playback position of a sound.
virtual bool setKeep(bool keep)=0
Sets the behaviour of the device for a played back sound when the sound doesn't return any more sampl...
virtual ~IHandle()
Destroys the handle.
Definition IHandle.h:54
virtual int getLoopCount()=0
Retrieves the loop count of a playing sound.
virtual bool setVolume(float volume)=0
Sets the volume of a playing sound.
virtual bool resume()=0
Resumes a paused sound.
virtual float getVolume()=0
Retrieves the volume of a playing sound.
virtual bool setPitch(float pitch)=0
Sets the pitch of a playing sound.
virtual bool setStopCallback(stopCallback callback=0, void *data=0)=0
Sets the callback function that's called when the end of a playing sound is reached.