Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AUD_I3DDevice.h « intern « audaspace « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c36924160deccc0edac6b5b18c5b8772c327b142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
 * $Id$
 *
 * ***** BEGIN LGPL LICENSE BLOCK *****
 *
 * Copyright 2009 Jörg Hermann Müller
 *
 * This file is part of AudaSpace.
 *
 * AudaSpace is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with AudaSpace.  If not, see <http://www.gnu.org/licenses/>.
 *
 * ***** END LGPL LICENSE BLOCK *****
 */

#ifndef AUD_I3DDEVICE
#define AUD_I3DDEVICE

#include "AUD_Space.h"

/**
 * This class represents an output device for 3D sound.
 * Whether a normal device supports this or not can be checked with the
 * AUD_CAPS_3D_DEVICE capability.
 */
class AUD_I3DDevice
{
public:
	/**
	 * Plays a 3D sound source.
	 * \param factory The factory to create the reader for the sound source.
	 * \param keep When keep is true the sound source will not be deleted but
	 *             set to paused when its end has been reached.
	 * \return Returns a handle with which the playback can be controlled.
	 *         This is NULL if the sound couldn't be played back.
	 * \exception AUD_Exception Thrown if there's an unexpected (from the
	 *            device side) error during creation of the reader.
	 * \note The factory must provide a mono (single channel) source otherwise
	 *       the sound is played back normally.
	 */
	virtual AUD_Handle* play3D(AUD_IFactory* factory, bool keep = false)=0;

	/**
	 * Updates a listeners 3D data.
	 * \param data The 3D data.
	 * \return Whether the action succeeded.
	 */
	virtual bool updateListener(AUD_3DData &data)=0;

	/**
	 * Sets a 3D device setting.
	 * \param setting The setting type.
	 * \param value The new setting value.
	 * \return Whether the action succeeded.
	 */
	virtual bool setSetting(AUD_3DSetting setting, float value)=0;

	/**
	 * Retrieves a 3D device setting.
	 * \param setting The setting type.
	 * \return The setting value.
	 */
	virtual float getSetting(AUD_3DSetting setting)=0;

	/**
	 * Updates a listeners 3D data.
	 * \param handle The source handle.
	 * \param data The 3D data.
	 * \return Whether the action succeeded.
	 */
	virtual bool updateSource(AUD_Handle* handle, AUD_3DData &data)=0;

	/**
	 * Sets a 3D source setting.
	 * \param handle The source handle.
	 * \param setting The setting type.
	 * \param value The new setting value.
	 * \return Whether the action succeeded.
	 */
	virtual bool setSourceSetting(AUD_Handle* handle,
								  AUD_3DSourceSetting setting, float value)=0;

	/**
	 * Retrieves a 3D source setting.
	 * \param handle The source handle.
	 * \param setting The setting type.
	 * \return The setting value.
	 */
	virtual float getSourceSetting(AUD_Handle* handle,
								   AUD_3DSourceSetting setting)=0;
};

#endif //AUD_I3DDEVICE