~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to intern/audaspace/intern/AUD_IDevice.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $Id: AUD_IDevice.h 25643 2010-01-01 05:09:30Z nexyon $
3
 
 *
4
 
 * ***** BEGIN LGPL LICENSE BLOCK *****
5
 
 *
6
 
 * Copyright 2009 Jörg Hermann Müller
 
2
 * ***** BEGIN GPL LICENSE BLOCK *****
 
3
 *
 
4
 * Copyright 2009-2011 Jörg Hermann Müller
7
5
 *
8
6
 * This file is part of AudaSpace.
9
7
 *
10
 
 * AudaSpace is free software: you can redistribute it and/or modify
11
 
 * it under the terms of the GNU Lesser General Public License as published by
12
 
 * the Free Software Foundation, either version 3 of the License, or
 
8
 * Audaspace is free software; you can redistribute it and/or modify
 
9
 * it under the terms of the GNU General Public License as published by
 
10
 * the Free Software Foundation; either version 2 of the License, or
13
11
 * (at your option) any later version.
14
12
 *
15
13
 * AudaSpace is distributed in the hope that it will be useful,
16
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 * GNU Lesser General Public License for more details.
19
 
 *
20
 
 * You should have received a copy of the GNU Lesser General Public License
21
 
 * along with AudaSpace.  If not, see <http://www.gnu.org/licenses/>.
22
 
 *
23
 
 * ***** END LGPL LICENSE BLOCK *****
24
 
 */
25
 
 
26
 
#ifndef AUD_IDEVICE
27
 
#define AUD_IDEVICE
 
16
 * GNU General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU General Public License
 
19
 * along with Audaspace; if not, write to the Free Software Foundation,
 
20
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
21
 *
 
22
 * ***** END GPL LICENSE BLOCK *****
 
23
 */
 
24
 
 
25
/** \file audaspace/intern/AUD_IDevice.h
 
26
 *  \ingroup audaspaceintern
 
27
 */
 
28
 
 
29
 
 
30
#ifndef __AUD_IDEVICE_H__
 
31
#define __AUD_IDEVICE_H__
28
32
 
29
33
#include "AUD_Space.h"
30
 
class AUD_IFactory;
31
 
 
32
 
/// Handle structure, for inherition.
33
 
typedef struct
34
 
{
35
 
} AUD_Handle;
 
34
#include "AUD_Reference.h"
 
35
#include "AUD_IFactory.h"
 
36
#include "AUD_IReader.h"
 
37
#include "AUD_IHandle.h"
36
38
 
37
39
/**
38
40
 * This class represents an output device for sound sources.
53
55
        /**
54
56
         * Returns the specification of the device.
55
57
         */
56
 
        virtual AUD_DeviceSpecs getSpecs()=0;
 
58
        virtual AUD_DeviceSpecs getSpecs() const=0;
 
59
 
 
60
        /**
 
61
         * Plays a sound source.
 
62
         * \param reader The reader to play.
 
63
         * \param keep When keep is true the sound source will not be deleted but
 
64
         *             set to paused when its end has been reached.
 
65
         * \return Returns a handle with which the playback can be controlled.
 
66
         *         This is NULL if the sound couldn't be played back.
 
67
         * \exception AUD_Exception Thrown if there's an unexpected (from the
 
68
         *            device side) error during creation of the reader.
 
69
         */
 
70
        virtual AUD_Reference<AUD_IHandle> play(AUD_Reference<AUD_IReader> reader, bool keep = false)=0;
57
71
 
58
72
        /**
59
73
         * Plays a sound source.
65
79
         * \exception AUD_Exception Thrown if there's an unexpected (from the
66
80
         *            device side) error during creation of the reader.
67
81
         */
68
 
        virtual AUD_Handle* play(AUD_IFactory* factory, bool keep = false)=0;
69
 
 
70
 
        /**
71
 
         * Pauses a played back sound.
72
 
         * \param handle The handle returned by the play function.
73
 
         * \return
74
 
         *        - true if the sound has been paused.
75
 
         *        - false if the sound isn't playing back or the handle is invalid.
76
 
         */
77
 
        virtual bool pause(AUD_Handle* handle)=0;
78
 
 
79
 
        /**
80
 
         * Resumes a paused sound.
81
 
         * \param handle The handle returned by the play function.
82
 
         * \return
83
 
         *        - true if the sound has been resumed.
84
 
         *        - false if the sound isn't paused or the handle is invalid.
85
 
         */
86
 
        virtual bool resume(AUD_Handle* handle)=0;
87
 
 
88
 
        /**
89
 
         * Stops a played back or paused sound. The handle is definitely invalid
90
 
         * afterwards.
91
 
         * \param handle The handle returned by the play function.
92
 
         * \return
93
 
         *        - true if the sound has been stopped.
94
 
         *        - false if the handle is invalid.
95
 
         */
96
 
        virtual bool stop(AUD_Handle* handle)=0;
97
 
 
98
 
        /**
99
 
         * Sets the behaviour of the device for a played back sound when the sound
100
 
         * doesn't return any more samples.
101
 
         * \param handle The handle returned by the play function.
102
 
         * \param keep True when the source should be paused and not deleted.
103
 
         * \return
104
 
         *        - true if the behaviour has been changed.
105
 
         *        - false if the handle is invalid.
106
 
         */
107
 
        virtual bool setKeep(AUD_Handle* handle, bool keep)=0;
108
 
 
109
 
        /**
110
 
         * Sends a message to a sound or all sounds that are currently played or
111
 
         * paused.
112
 
         * \param handle The sound that should receive the message or NULL if all
113
 
         *        sounds should receive it.
114
 
         * \param message The message.
115
 
         * \return True if the message has been read by at least one sound.
116
 
         */
117
 
        virtual bool sendMessage(AUD_Handle* handle, AUD_Message &message)=0;
118
 
 
119
 
        /**
120
 
         * Seeks in a played back sound.
121
 
         * \param handle The handle returned by the play function.
122
 
         * \param position The new position from where to play back, in seconds.
123
 
         * \return
124
 
         *        - true if the handle is valid.
125
 
         *        - false if the handle is invalid.
126
 
         * \warning Whether the seek works or not depends on the sound source.
127
 
         */
128
 
        virtual bool seek(AUD_Handle* handle, float position)=0;
129
 
 
130
 
        /**
131
 
         * Retrieves the current playback position of a sound.
132
 
         * \param handle The handle returned by the play function.
133
 
         * \return The playback position in seconds, or 0.0 if the handle is
134
 
         *         invalid.
135
 
         */
136
 
        virtual float getPosition(AUD_Handle* handle)=0;
137
 
 
138
 
        /**
139
 
         * Returns the status of a played back sound.
140
 
         * \param handle The handle returned by the play function.
141
 
         * \return
142
 
         *        - AUD_STATUS_INVALID if the sound has stopped or the handle is
143
 
         *.         invalid
144
 
         *        - AUD_STATUS_PLAYING if the sound is currently played back.
145
 
         *        - AUD_STATUS_PAUSED if the sound is currently paused.
146
 
         * \see AUD_Status
147
 
         */
148
 
        virtual AUD_Status getStatus(AUD_Handle* handle)=0;
 
82
        virtual AUD_Reference<AUD_IHandle> play(AUD_Reference<AUD_IFactory> factory, bool keep = false)=0;
 
83
 
 
84
        /**
 
85
         * Stops all playing sounds.
 
86
         */
 
87
        virtual void stopAll()=0;
149
88
 
150
89
        /**
151
90
         * Locks the device.
163
102
        virtual void unlock()=0;
164
103
 
165
104
        /**
166
 
         * Checks if a specific capability as available on a device.
167
 
         * \param capability The capability.
168
 
         * \return Whether it is available or not.
169
 
         */
170
 
        virtual bool checkCapability(int capability)=0;
171
 
 
172
 
        /**
173
 
         * Set a value of a capability. The data behind the pointer depends on the
174
 
         * capability.
175
 
         * \param capability The capability.
176
 
         * \param value The value.
177
 
         * \return Whether the action succeeded or not.
178
 
         */
179
 
        virtual bool setCapability(int capability, void *value)=0;
180
 
 
181
 
        /**
182
 
         * Retrieves a value of a capability. The data behind the pointer depends on
183
 
         * the capability.
184
 
         * \param capability The capability.
185
 
         * \param value The value.
186
 
         * \return Whether the action succeeded or not.
187
 
         */
188
 
        virtual bool getCapability(int capability, void *value)=0;
 
105
         * Retrieves the overall device volume.
 
106
         * \return The overall device volume.
 
107
         */
 
108
        virtual float getVolume() const=0;
 
109
 
 
110
        /**
 
111
         * Sets the overall device volume.
 
112
         * \param handle The sound handle.
 
113
         * \param volume The overall device volume.
 
114
         */
 
115
        virtual void setVolume(float volume)=0;
189
116
};
190
117
 
191
118
#endif //AUD_IDevice