1 /*  RetroArch - A frontend for libretro.
2  *  Copyright (C) 2010-2014 - Hans-Kristian Arntzen
3  *  Copyright (C) 2011-2017 - Daniel De Matteis
4  *
5  *  RetroArch is free software: you can redistribute it and/or modify it under the terms
6  *  of the GNU General Public License as published by the Free Software Found-
7  *  ation, either version 3 of the License, or (at your option) any later version.
8  *
9  *  RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10  *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  *  PURPOSE.  See the GNU General Public License for more details.
12  *
13  *  You should have received a copy of the GNU General Public License along with RetroArch.
14  *  If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef __AUDIO_DEFINES__H
18 #define __AUDIO_DEFINES__H
19 
20 #include <retro_common_api.h>
21 
22 RETRO_BEGIN_DECLS
23 
24 #define AUDIO_CHUNK_SIZE_BLOCKING      512
25 
26 /* So we don't get complete line-noise when fast-forwarding audio. */
27 #define AUDIO_CHUNK_SIZE_NONBLOCKING   2048
28 
29 #define AUDIO_MAX_RATIO                16
30 
31 #define AUDIO_MIXER_MAX_STREAMS        16
32 
33 #define AUDIO_MIXER_MAX_SYSTEM_STREAMS (AUDIO_MIXER_MAX_STREAMS + 5)
34 
35 /* do not define more than (MAX_SYSTEM_STREAMS - MAX_STREAMS) */
36 enum audio_mixer_system_slot
37 {
38    AUDIO_MIXER_SYSTEM_SLOT_OK = AUDIO_MIXER_MAX_STREAMS,
39    AUDIO_MIXER_SYSTEM_SLOT_CANCEL,
40    AUDIO_MIXER_SYSTEM_SLOT_NOTICE,
41    AUDIO_MIXER_SYSTEM_SLOT_BGM,
42    AUDIO_MIXER_SYSTEM_SLOT_ACHIEVEMENT_UNLOCK
43 };
44 
45 enum audio_action
46 {
47    AUDIO_ACTION_NONE = 0,
48    AUDIO_ACTION_RATE_CONTROL_DELTA,
49    AUDIO_ACTION_MIXER_MUTE_ENABLE,
50    AUDIO_ACTION_MUTE_ENABLE,
51    AUDIO_ACTION_VOLUME_GAIN,
52    AUDIO_ACTION_MIXER_VOLUME_GAIN,
53    AUDIO_ACTION_MIXER
54 };
55 
56 enum audio_mixer_slot_selection_type
57 {
58    AUDIO_MIXER_SLOT_SELECTION_AUTOMATIC = 0,
59    AUDIO_MIXER_SLOT_SELECTION_MANUAL
60 };
61 
62 enum audio_mixer_stream_type
63 {
64    AUDIO_STREAM_TYPE_NONE = 0,
65    AUDIO_STREAM_TYPE_USER,
66    AUDIO_STREAM_TYPE_SYSTEM
67 };
68 
69 enum audio_mixer_state
70 {
71    AUDIO_STREAM_STATE_NONE = 0,
72    AUDIO_STREAM_STATE_STOPPED,
73    AUDIO_STREAM_STATE_PLAYING,
74    AUDIO_STREAM_STATE_PLAYING_LOOPED,
75    AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL
76 };
77 
78 typedef struct audio_statistics
79 {
80    unsigned samples;
81    float average_buffer_saturation;
82    float std_deviation_percentage;
83    float close_to_underrun;
84    float close_to_blocking;
85 } audio_statistics_t;
86 
87 RETRO_END_DECLS
88 
89 #endif
90