Audaspace  1.6.0
A high level audio library.
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 
30 enum Status
31 {
32  STATUS_INVALID = 0,
36 };
37 
42 typedef void (*stopCallback)(void*);
43 
49 {
50 public:
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 
#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
virtual ~IHandle()
Destroys the handle.
Definition: IHandle.h:54
void(* stopCallback)(void *)
The stopCallback is called when a handle reaches the end of the stream and thus gets stopped...
Definition: IHandle.h:42
Sound is playing.
Definition: IHandle.h:34
Sound is being paused.
Definition: IHandle.h:35
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition: Audaspace.h:119
The IHandle interface represents a playback handles of a specific device.
Definition: IHandle.h:48
The main header file of the library defining the namespace and basic data types.
Invalid handle. Maybe due to stopping.
Definition: IHandle.h:33
Status
Status of a playback handle.
Definition: IHandle.h:30