"Fossies" - the Fresh Open Source Software Archive

Member "FreeBASIC-1.09.0-win64/inc/allegro5/allegro_audio.bi" (1 Jan 2022, 16049 Bytes) of package /windows/misc/FreeBASIC-1.09.0-win64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Visual Basic source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 '' FreeBASIC binding for allegro-5.0.11
    2 ''
    3 '' based on the C header files:
    4 ''   Copyright (c) 2004-2011 the Allegro 5 Development Team
    5 ''
    6 ''   This software is provided 'as-is', without any express or implied
    7 ''   warranty. In no event will the authors be held liable for any damages
    8 ''   arising from the use of this software.
    9 ''
   10 ''   Permission is granted to anyone to use this software for any purpose,
   11 ''   including commercial applications, and to alter it and redistribute it
   12 ''   freely, subject to the following restrictions:
   13 ''
   14 ''       1. The origin of this software must not be misrepresented; you must not
   15 ''       claim that you wrote the original software. If you use this software
   16 ''       in a product, an acknowledgment in the product documentation would be
   17 ''       appreciated but is not required.
   18 ''
   19 ''       2. Altered source versions must be plainly marked as such, and must not be
   20 ''       misrepresented as being the original software.
   21 ''
   22 ''       3. This notice may not be removed or altered from any source
   23 ''       distribution.
   24 ''
   25 '' translated to FreeBASIC by:
   26 ''   Copyright © 2015 FreeBASIC development team
   27 
   28 #pragma once
   29 
   30 #ifdef __FB_UNIX__
   31     #inclib "allegro_audio"
   32 #elseif defined(__FB_WIN32__) and defined(ALLEGRO_STATICLINK)
   33     #inclib "allegro_audio-5.0.10-static-md"
   34 #else
   35     #inclib "allegro_audio-5.0.10-md"
   36 #endif
   37 
   38 #include once "allegro5/allegro.bi"
   39 
   40 extern "C"
   41 
   42 #define __al_included_allegro5_allegro_audio_h
   43 const _KCM_STREAM_FEEDER_QUIT_EVENT_TYPE = 512
   44 const ALLEGRO_EVENT_AUDIO_STREAM_FRAGMENT = 513
   45 const ALLEGRO_EVENT_AUDIO_STREAM_FINISHED = 514
   46 
   47 type ALLEGRO_AUDIO_DEPTH as long
   48 enum
   49     ALLEGRO_AUDIO_DEPTH_INT8 = &h00
   50     ALLEGRO_AUDIO_DEPTH_INT16 = &h01
   51     ALLEGRO_AUDIO_DEPTH_INT24 = &h02
   52     ALLEGRO_AUDIO_DEPTH_FLOAT32 = &h03
   53     ALLEGRO_AUDIO_DEPTH_UNSIGNED = &h08
   54     ALLEGRO_AUDIO_DEPTH_UINT8 = ALLEGRO_AUDIO_DEPTH_INT8 or ALLEGRO_AUDIO_DEPTH_UNSIGNED
   55     ALLEGRO_AUDIO_DEPTH_UINT16 = ALLEGRO_AUDIO_DEPTH_INT16 or ALLEGRO_AUDIO_DEPTH_UNSIGNED
   56     ALLEGRO_AUDIO_DEPTH_UINT24 = ALLEGRO_AUDIO_DEPTH_INT24 or ALLEGRO_AUDIO_DEPTH_UNSIGNED
   57 end enum
   58 
   59 type ALLEGRO_CHANNEL_CONF as long
   60 enum
   61     ALLEGRO_CHANNEL_CONF_1 = &h10
   62     ALLEGRO_CHANNEL_CONF_2 = &h20
   63     ALLEGRO_CHANNEL_CONF_3 = &h30
   64     ALLEGRO_CHANNEL_CONF_4 = &h40
   65     ALLEGRO_CHANNEL_CONF_5_1 = &h51
   66     ALLEGRO_CHANNEL_CONF_6_1 = &h61
   67     ALLEGRO_CHANNEL_CONF_7_1 = &h71
   68 end enum
   69 
   70 const ALLEGRO_MAX_CHANNELS = 8
   71 
   72 type ALLEGRO_PLAYMODE as long
   73 enum
   74     ALLEGRO_PLAYMODE_ONCE = &h100
   75     ALLEGRO_PLAYMODE_LOOP = &h101
   76     ALLEGRO_PLAYMODE_BIDIR = &h102
   77     _ALLEGRO_PLAYMODE_STREAM_ONCE = &h103
   78     _ALLEGRO_PLAYMODE_STREAM_ONEDIR = &h104
   79 end enum
   80 
   81 type ALLEGRO_MIXER_QUALITY as long
   82 enum
   83     ALLEGRO_MIXER_QUALITY_POINT = &h110
   84     ALLEGRO_MIXER_QUALITY_LINEAR = &h111
   85     ALLEGRO_MIXER_QUALITY_CUBIC = &h112
   86 end enum
   87 
   88 const ALLEGRO_AUDIO_PAN_NONE = -1000.0f
   89 
   90 type ALLEGRO_SAMPLE_ID
   91     _index as long
   92     _id as long
   93 end type
   94 
   95 type ALLEGRO_SAMPLE as ALLEGRO_SAMPLE_
   96 declare function al_create_sample(byval buf as any ptr, byval samples as ulong, byval freq as ulong, byval depth as ALLEGRO_AUDIO_DEPTH, byval chan_conf as ALLEGRO_CHANNEL_CONF, byval free_buf as byte) as ALLEGRO_SAMPLE ptr
   97 declare sub al_destroy_sample(byval spl as ALLEGRO_SAMPLE ptr)
   98 type ALLEGRO_SAMPLE_INSTANCE as ALLEGRO_SAMPLE_INSTANCE_
   99 declare function al_create_sample_instance(byval data as ALLEGRO_SAMPLE ptr) as ALLEGRO_SAMPLE_INSTANCE ptr
  100 declare sub al_destroy_sample_instance(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr)
  101 declare function al_get_sample_frequency(byval spl as const ALLEGRO_SAMPLE ptr) as ulong
  102 declare function al_get_sample_length(byval spl as const ALLEGRO_SAMPLE ptr) as ulong
  103 declare function al_get_sample_depth(byval spl as const ALLEGRO_SAMPLE ptr) as ALLEGRO_AUDIO_DEPTH
  104 declare function al_get_sample_channels(byval spl as const ALLEGRO_SAMPLE ptr) as ALLEGRO_CHANNEL_CONF
  105 declare function al_get_sample_data(byval spl as const ALLEGRO_SAMPLE ptr) as any ptr
  106 declare function al_get_sample_instance_frequency(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ulong
  107 declare function al_get_sample_instance_length(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ulong
  108 declare function al_get_sample_instance_position(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ulong
  109 declare function al_get_sample_instance_speed(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as single
  110 declare function al_get_sample_instance_gain(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as single
  111 declare function al_get_sample_instance_pan(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as single
  112 declare function al_get_sample_instance_time(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as single
  113 declare function al_get_sample_instance_depth(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ALLEGRO_AUDIO_DEPTH
  114 declare function al_get_sample_instance_channels(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ALLEGRO_CHANNEL_CONF
  115 declare function al_get_sample_instance_playmode(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ALLEGRO_PLAYMODE
  116 declare function al_get_sample_instance_playing(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as byte
  117 declare function al_get_sample_instance_attached(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as byte
  118 declare function al_set_sample_instance_position(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val as ulong) as byte
  119 declare function al_set_sample_instance_length(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val as ulong) as byte
  120 declare function al_set_sample_instance_speed(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val as single) as byte
  121 declare function al_set_sample_instance_gain(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val as single) as byte
  122 declare function al_set_sample_instance_pan(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val as single) as byte
  123 declare function al_set_sample_instance_playmode(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val as ALLEGRO_PLAYMODE) as byte
  124 declare function al_set_sample_instance_playing(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val as byte) as byte
  125 declare function al_detach_sample_instance(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr) as byte
  126 declare function al_set_sample(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval data as ALLEGRO_SAMPLE ptr) as byte
  127 declare function al_get_sample(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr) as ALLEGRO_SAMPLE ptr
  128 declare function al_play_sample_instance(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr) as byte
  129 declare function al_stop_sample_instance(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr) as byte
  130 type ALLEGRO_AUDIO_STREAM as ALLEGRO_AUDIO_STREAM_
  131 declare function al_create_audio_stream(byval buffer_count as uinteger, byval samples as ulong, byval freq as ulong, byval depth as ALLEGRO_AUDIO_DEPTH, byval chan_conf as ALLEGRO_CHANNEL_CONF) as ALLEGRO_AUDIO_STREAM ptr
  132 declare sub al_destroy_audio_stream(byval stream as ALLEGRO_AUDIO_STREAM ptr)
  133 declare sub al_drain_audio_stream(byval stream as ALLEGRO_AUDIO_STREAM ptr)
  134 declare function al_get_audio_stream_frequency(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ulong
  135 declare function al_get_audio_stream_length(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ulong
  136 declare function al_get_audio_stream_fragments(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ulong
  137 declare function al_get_available_audio_stream_fragments(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ulong
  138 declare function al_get_audio_stream_speed(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as single
  139 declare function al_get_audio_stream_gain(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as single
  140 declare function al_get_audio_stream_pan(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as single
  141 declare function al_get_audio_stream_channels(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ALLEGRO_CHANNEL_CONF
  142 declare function al_get_audio_stream_depth(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ALLEGRO_AUDIO_DEPTH
  143 declare function al_get_audio_stream_playmode(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ALLEGRO_PLAYMODE
  144 declare function al_get_audio_stream_playing(byval spl as const ALLEGRO_AUDIO_STREAM ptr) as byte
  145 declare function al_get_audio_stream_attached(byval spl as const ALLEGRO_AUDIO_STREAM ptr) as byte
  146 declare function al_get_audio_stream_fragment(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as any ptr
  147 declare function al_set_audio_stream_speed(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val as single) as byte
  148 declare function al_set_audio_stream_gain(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val as single) as byte
  149 declare function al_set_audio_stream_pan(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val as single) as byte
  150 declare function al_set_audio_stream_playmode(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val as ALLEGRO_PLAYMODE) as byte
  151 declare function al_set_audio_stream_playing(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val as byte) as byte
  152 declare function al_detach_audio_stream(byval stream as ALLEGRO_AUDIO_STREAM ptr) as byte
  153 declare function al_set_audio_stream_fragment(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val as any ptr) as byte
  154 declare function al_rewind_audio_stream(byval stream as ALLEGRO_AUDIO_STREAM ptr) as byte
  155 declare function al_seek_audio_stream_secs(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval time as double) as byte
  156 declare function al_get_audio_stream_position_secs(byval stream as ALLEGRO_AUDIO_STREAM ptr) as double
  157 declare function al_get_audio_stream_length_secs(byval stream as ALLEGRO_AUDIO_STREAM ptr) as double
  158 declare function al_set_audio_stream_loop_secs(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval start as double, byval end as double) as byte
  159 declare function al_get_audio_stream_event_source(byval stream as ALLEGRO_AUDIO_STREAM ptr) as ALLEGRO_EVENT_SOURCE ptr
  160 type ALLEGRO_MIXER as ALLEGRO_MIXER_
  161 declare function al_create_mixer(byval freq as ulong, byval depth as ALLEGRO_AUDIO_DEPTH, byval chan_conf as ALLEGRO_CHANNEL_CONF) as ALLEGRO_MIXER ptr
  162 declare sub al_destroy_mixer(byval mixer as ALLEGRO_MIXER ptr)
  163 declare function al_attach_sample_instance_to_mixer(byval stream as ALLEGRO_SAMPLE_INSTANCE ptr, byval mixer as ALLEGRO_MIXER ptr) as byte
  164 declare function al_attach_audio_stream_to_mixer(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval mixer as ALLEGRO_MIXER ptr) as byte
  165 declare function al_attach_mixer_to_mixer(byval stream as ALLEGRO_MIXER ptr, byval mixer as ALLEGRO_MIXER ptr) as byte
  166 declare function al_set_mixer_postprocess_callback(byval mixer as ALLEGRO_MIXER ptr, byval cb as sub(byval buf as any ptr, byval samples as ulong, byval data as any ptr), byval data as any ptr) as byte
  167 declare function al_get_mixer_frequency(byval mixer as const ALLEGRO_MIXER ptr) as ulong
  168 declare function al_get_mixer_channels(byval mixer as const ALLEGRO_MIXER ptr) as ALLEGRO_CHANNEL_CONF
  169 declare function al_get_mixer_depth(byval mixer as const ALLEGRO_MIXER ptr) as ALLEGRO_AUDIO_DEPTH
  170 declare function al_get_mixer_quality(byval mixer as const ALLEGRO_MIXER ptr) as ALLEGRO_MIXER_QUALITY
  171 declare function al_get_mixer_gain(byval mixer as const ALLEGRO_MIXER ptr) as single
  172 declare function al_get_mixer_playing(byval mixer as const ALLEGRO_MIXER ptr) as byte
  173 declare function al_get_mixer_attached(byval mixer as const ALLEGRO_MIXER ptr) as byte
  174 declare function al_set_mixer_frequency(byval mixer as ALLEGRO_MIXER ptr, byval val as ulong) as byte
  175 declare function al_set_mixer_quality(byval mixer as ALLEGRO_MIXER ptr, byval val as ALLEGRO_MIXER_QUALITY) as byte
  176 declare function al_set_mixer_gain(byval mixer as ALLEGRO_MIXER ptr, byval gain as single) as byte
  177 declare function al_set_mixer_playing(byval mixer as ALLEGRO_MIXER ptr, byval val as byte) as byte
  178 declare function al_detach_mixer(byval mixer as ALLEGRO_MIXER ptr) as byte
  179 type ALLEGRO_VOICE as ALLEGRO_VOICE_
  180 declare function al_create_voice(byval freq as ulong, byval depth as ALLEGRO_AUDIO_DEPTH, byval chan_conf as ALLEGRO_CHANNEL_CONF) as ALLEGRO_VOICE ptr
  181 declare sub al_destroy_voice(byval voice as ALLEGRO_VOICE ptr)
  182 declare function al_attach_sample_instance_to_voice(byval stream as ALLEGRO_SAMPLE_INSTANCE ptr, byval voice as ALLEGRO_VOICE ptr) as byte
  183 declare function al_attach_audio_stream_to_voice(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval voice as ALLEGRO_VOICE ptr) as byte
  184 declare function al_attach_mixer_to_voice(byval mixer as ALLEGRO_MIXER ptr, byval voice as ALLEGRO_VOICE ptr) as byte
  185 declare sub al_detach_voice(byval voice as ALLEGRO_VOICE ptr)
  186 declare function al_get_voice_frequency(byval voice as const ALLEGRO_VOICE ptr) as ulong
  187 declare function al_get_voice_position(byval voice as const ALLEGRO_VOICE ptr) as ulong
  188 declare function al_get_voice_channels(byval voice as const ALLEGRO_VOICE ptr) as ALLEGRO_CHANNEL_CONF
  189 declare function al_get_voice_depth(byval voice as const ALLEGRO_VOICE ptr) as ALLEGRO_AUDIO_DEPTH
  190 declare function al_get_voice_playing(byval voice as const ALLEGRO_VOICE ptr) as byte
  191 declare function al_set_voice_position(byval voice as ALLEGRO_VOICE ptr, byval val as ulong) as byte
  192 declare function al_set_voice_playing(byval voice as ALLEGRO_VOICE ptr, byval val as byte) as byte
  193 declare function al_install_audio() as byte
  194 declare sub al_uninstall_audio()
  195 declare function al_is_audio_installed() as byte
  196 declare function al_get_allegro_audio_version() as ulong
  197 declare function al_get_channel_count(byval conf as ALLEGRO_CHANNEL_CONF) as uinteger
  198 declare function al_get_audio_depth_size(byval conf as ALLEGRO_AUDIO_DEPTH) as uinteger
  199 declare function al_reserve_samples(byval reserve_samples as long) as byte
  200 declare function al_get_default_mixer() as ALLEGRO_MIXER ptr
  201 declare function al_set_default_mixer(byval mixer as ALLEGRO_MIXER ptr) as byte
  202 declare function al_restore_default_mixer() as byte
  203 declare function al_play_sample(byval data as ALLEGRO_SAMPLE ptr, byval gain as single, byval pan as single, byval speed as single, byval loop as ALLEGRO_PLAYMODE, byval ret_id as ALLEGRO_SAMPLE_ID ptr) as byte
  204 declare sub al_stop_sample(byval spl_id as ALLEGRO_SAMPLE_ID ptr)
  205 declare sub al_stop_samples()
  206 declare function al_register_sample_loader(byval ext as const zstring ptr, byval loader as function(byval filename as const zstring ptr) as ALLEGRO_SAMPLE ptr) as byte
  207 declare function al_register_sample_saver(byval ext as const zstring ptr, byval saver as function(byval filename as const zstring ptr, byval spl as ALLEGRO_SAMPLE ptr) as byte) as byte
  208 declare function al_register_audio_stream_loader(byval ext as const zstring ptr, byval stream_loader as function(byval filename as const zstring ptr, byval buffer_count as uinteger, byval samples as ulong) as ALLEGRO_AUDIO_STREAM ptr) as byte
  209 declare function al_register_sample_loader_f(byval ext as const zstring ptr, byval loader as function(byval fp as ALLEGRO_FILE ptr) as ALLEGRO_SAMPLE ptr) as byte
  210 declare function al_register_sample_saver_f(byval ext as const zstring ptr, byval saver as function(byval fp as ALLEGRO_FILE ptr, byval spl as ALLEGRO_SAMPLE ptr) as byte) as byte
  211 declare function al_register_audio_stream_loader_f(byval ext as const zstring ptr, byval stream_loader as function(byval fp as ALLEGRO_FILE ptr, byval buffer_count as uinteger, byval samples as ulong) as ALLEGRO_AUDIO_STREAM ptr) as byte
  212 declare function al_load_sample(byval filename as const zstring ptr) as ALLEGRO_SAMPLE ptr
  213 declare function al_save_sample(byval filename as const zstring ptr, byval spl as ALLEGRO_SAMPLE ptr) as byte
  214 declare function al_load_audio_stream(byval filename as const zstring ptr, byval buffer_count as uinteger, byval samples as ulong) as ALLEGRO_AUDIO_STREAM ptr
  215 declare function al_load_sample_f(byval fp as ALLEGRO_FILE ptr, byval ident as const zstring ptr) as ALLEGRO_SAMPLE ptr
  216 declare function al_save_sample_f(byval fp as ALLEGRO_FILE ptr, byval ident as const zstring ptr, byval spl as ALLEGRO_SAMPLE ptr) as byte
  217 declare function al_load_audio_stream_f(byval fp as ALLEGRO_FILE ptr, byval ident as const zstring ptr, byval buffer_count as uinteger, byval samples as ulong) as ALLEGRO_AUDIO_STREAM ptr
  218 
  219 end extern