2 * Copyright 2001-2002, Haiku Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Christopher ML Zumwalt May (zummy@users.sf.net)
8 #ifndef _GAME_SOUND_DEFS_H
9 #define _GAME_SOUND_DEFS_H
12 #include <SupportDefs.h>
17 #define B_GS_CUR_API_VERSION B_BEOS_VERSION
18 #define B_GS_MIN_API_VERSION 0x100
20 // invalid sound handle
21 #define B_GS_INVALID_SOUND ((gs_id)-1)
23 // gs_id for the main mix buffer
24 #define B_GS_MAIN_SOUND ((gs_id)-2)
28 B_GS_BAD_HANDLE
= -99999,
31 B_GS_ALREADY_COMMITTED
,
36 struct gs_audio_format
{
37 // same as media_raw_audio_format
38 enum format
{ // for "format"
39 B_GS_U8
= 0x11, // 128 == mid, 1 == bottom, 255 == top
40 B_GS_S16
= 0x2, // 0 == mid, -32767 == bottom, +32767 == top
41 B_GS_F
= 0x24, // 0 == mid, -1.0 == bottom, 1.0 == top
42 B_GS_S32
= 0x4 // 0 == mid, 0x80000001 == bottom,
46 uint32 channel_count
; // 1 or 2, mostly
47 uint32 format
; // for compressed formats, go to
48 // media_encoded_audio_format
49 uint32 byte_order
; // 2 for little endian, 1 for big endian
50 size_t buffer_size
; // size of each buffer -- NOT GUARANTEED
55 B_GS_NO_ATTRIBUTE
= 0, // when there is no attribute
56 B_GS_MAIN_GAIN
= 1, // 0 == 0 dB, -6.0 == -6 dB (gs_id ignored)
57 B_GS_CD_THROUGH_GAIN
, // 0 == 0 dB, -12.0 == -12 dB (gs_id ignored)
59 B_GS_GAIN
= 128, // 0 == 0 dB, -1.0 == -1 dB, +10.0 == +10 dB
60 B_GS_PAN
, // 0 == middle, -1.0 == left, +1.0 == right
61 B_GS_SAMPLING_RATE
, // 44100.0 == 44.1 kHz
62 B_GS_LOOPING
, // 0 == no
63 B_GS_FIRST_PRIVATE_ATTRIBUTE
= 90000,
64 B_GS_FIRST_USER_ATTRIBUTE
= 100000
69 int32 attribute
; // which attribute
70 bigtime_t duration
; // how long of time to ramp over for the change
71 float value
; // where the value stops changing
72 uint32 flags
; // whatever flags are for the attribute
76 struct gs_attribute_info
{
84 #endif // _GAME_SOUND_DEFS_H