Changeset 37242 in project


Ignore:
Timestamp:
02/14/19 06:49:29 (3 months ago)
Author:
svnwiki
Message:

Anonymous wiki edit for IP [69.172.150.121]:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/allegro

    r37241 r37242  
    33== allegro
    44
    5 [[http://alleg.sourceforge.net/readme.html|Allegro 5.0 bindings for Chicken.]]
     5This document pertains to audio related methods found in the Allegro egg.
     6
     7Please see the main [allegro] wiki page for more information.
    68
    79[[toc:]]
    810
    9 == Author
    10 
    11 Dan Leslie (dan@ironoxide.ca)
    12 
    13 == Subpages
    14 
    15 The allegro docs are divided up into pages by category.
    16 
    17 * [[/eggref/5/allegro/audio|audio]]
    18 * [[/eggref/5/allegro/bitmap|bitmap]]
    19 * [[/eggref/5/allegro/color|color]]
    20 * [[/eggref/5/allegro/config|config]]
    21 * [[/eggref/5/allegro/debugging|debugging]]
    22 * [[/eggref/5/allegro/display|display]]
    23 * [[/eggref/5/allegro/drawing|drawing]]
    24 * [[/eggref/5/allegro/events|events]]
    25 * [[/eggref/5/allegro/file|file]]
    26 * [[/eggref/5/allegro/font|font]]
    27 * [[/eggref/5/allegro/input|input]]
    28 * [[/eggref/5/allegro/math|math]]
    29 * [[/eggref/5/allegro/memory|memory]]
    30 * [[/eggref/4/allegro/system|system]]
    31 
    32 == Repository
    33 
    34 The main repository can be found on [[https://github.com/dleslie/allegro-egg|GitHub]].
    35 
    36 == Supported Versions
    37 
    38 Allegro versions 5.0.x up to 5.2.x are supported.
    39 
    40 == Examples
    41 
    42 A growing number of examples can be found on [[https://github.com/dleslie/allegro-examples|GitHub]].
    43 
    44 Please contribute!
    45 
    46 == Windows Extras
    47 
    48 Since building all your packages on windows is a bit of a pain in the ass I've written the Egg with the assumption that you're using the pre-built Allegro libraries.
    49 The only extra step you'll need to do, after installing the prebuilt Allegro bins to your MingW32 directory should be:
    50 
    51 <enscript hilight="bash">
    52 # cd /MingW/lib
    53 # cp liballegro-INSTALLED_VERSION-monolith-md.a liballegro.a
    54 </enscript>
    55 
    56 Assuming, of course, that you've installed MingW32 to C:\Mingw
    57 
    58 == Naming Key
    59 
    60 In general, the naming is fairly indicative of the function's behaviour.
    61 
    62 The gist is something like this:
    63 
    64 ; make-type : Constructs a type (Not always available)
    65 ; make-type* : Constructs a type, returning a value which must be manually destructed
    66 ; free-type! : Manually destructs a type (Not available for internally managed types)
    67 ; type-noun : Accessor for value "noun" on a specific type
    68 ; type-noun-set! : Mutator for value "noun" on a specific type
    69 ; type-verb : Method which requires a specific type to operate
    70 ; type-verb! : Method which modifies an object of a specific type
    71 ; verbage : Function which operates on the global state
    72 ; verbage* : Function which operates on the global state, but also returns a value which must be manually destructed
    73 
    74 If a function begins with a type name then you can be assured that the first parameter will be an object of that specific type.
    75 
    76 == License
    77 
    78  Copyright 2012-2019 Daniel J. Leslie. All rights reserved.
    79  
    80  Redistribution and use in source and binary forms, with or without modification, are
    81 permitted provided that the following conditions are met:
    82 
    83    1. Redistributions of source code must retain the above copyright notice, this list of
    84       conditions and the following disclaimer.
    85 
    86    2. Redistributions in binary form must reproduce the above copyright notice, this list
    87       of conditions and the following disclaimer in the documentation and/or other materials
    88       provided with the distribution.
    89 
    90  THIS SOFTWARE IS PROVIDED BY DANIEL J. LESLIE ''AS IS'' AND ANY EXPRESS OR IMPLIED
    91  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    92  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DANIEL J. LESLIE OR
    93  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    94  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    95  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
    96  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    97  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
    98  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    99 
    100  The views and conclusions contained in the software and documentation are those of the
    101  authors and should not be interpreted as representing official policies, either expressed
    102  or implied, of Daniel J. Leslie.
     11== Constants
     12
     13* audio-pan-none
     14
     15== Enums
     16
     17=== audio-depth
     18
     19<procedure>(audio-depth->int audio-depth)</procedure>
     20
     21{{{audio-depth}} may be one of the following symbols:
     22* int8
     23* int16
     24* int24
     25* float32
     26* unsigned
     27* uint8
     28* uint16
     29* uint24
     30
     31<procedure>(int->audio-depth integer)</procedure>
     32
     33=== channel-configuration
     34
     35<procedure>(channel-configuration->int channel-configuration)</procedure>
     36
     37{{channel-configuration}} may be one of the following symbols:
     38* one
     39* two
     40* three
     41* four
     42* five-one
     43* six-one
     44* seven-one
     45
     46<procedure>(int->channel-configuration integer)</procedure>
     47
     48=== mixer-quality
     49
     50<procedure>(mixer-quality->int mixer-quality)</procedure>
     51
     52{{mixer-quality}} may be one of the following symbols:
     53* point
     54* linear
     55
     56<procedure>(int->mixer-quality integer)</procedure>
     57
     58=== playmode
     59
     60<procedure>(playmode->int playmode)</procedure>
     61
     62{{playmode}} may be one of the following symbols:
     63* once
     64* loop
     65* bidirectional
     66
     67<procedure>(int->playmode integer)</procedure>
     68
     69== Records
     70
     71=== audio-stream
     72
     73<record>audio-stream</record>
     74
     75=== mixer
     76
     77<record>mixer</record>
     78
     79=== sample
     80
     81<record>sample</record>
     82
     83=== sample-id
     84
     85<record>sample-id</record>
     86
     87=== sample-instance
     88
     89<record>sample-instance</record>
     90
     91=== voice
     92
     93<record>voice</record>
     94
     95== Functions
     96
     97=== Audio
     98
     99<procedure>(make-sample* (blob buffer) (unsigned-integer samples) (unsigned-integer frequency) audio-depth channel-configuration (bool free-buffer))</procedure>
     100
     101Implements al_create_sample.
     102
     103<procedure>(make-sample (blob buffer) (unsigned-integer samples) (unsigned-integer frequency) audio-depth channel-configuration (bool free-buffer))</procedure>
     104
     105Implements al_create_sample, with (free-sample!) declared as a finalizer.
     106
     107<procedure>(free-sample! sample)</procedure>
     108
     109Implements al_destroy_sample.
     110
     111<procedure>(make-sample-instance* sample)</procedure>
     112
     113Implements al_create_sample_instance.
     114
     115<procedure>(make-sample-instance sample)</procedure>
     116
     117Implements al_create_sample_instance, with (free-sample-instance!) declared as a finalizer.
     118
     119<procedure>(free-sample-instance! sample)</procedure>
     120
     121Implements al_destroy_sample_instance.
     122
     123<procedure>(sample-frequency sample)</procedure>
     124
     125Implements al_get_sample_frequenecy.
     126
     127<procedure>(sample-length sample)</procedure>
     128
     129Implements al_get_sample_length.
     130
     131<procedure>(sample-depth sample)</procedure>
     132
     133Implements al_get_sample_depth.
     134
     135<procedure>(sample-channels sample)</procedure>
     136
     137Implements al_get_sample_channels.
     138
     139<procedure>(sample-instance-frequency sample-instance)</procedure>
     140
     141Implements al_get_sample_instance_frequency.
     142
     143<procedure>(sample-instance-length sample-instance)</procedure>
     144
     145Implements al_get_sample_instance_length.
     146
     147<procedure>(sample-instance-position sample-instance)</procedure>
     148
     149Implements al_get_sample_instance-position.
     150
     151<procedure>(sample-instance-speed sample-instance)</procedure>
     152
     153Implements al_get_sample_instance_speed.
     154
     155<procedure>(sample-instance-gain sample-instance)</procedure>
     156
     157Implements al_get_sample_instance_gain.
     158
     159<procedure>(sample-instance-pan sample-instance)</procedure>
     160
     161Implements al_get_sample_instance_pan.
     162
     163<procedure>(sample-instance-time sample-instance)</procedure>
     164
     165Implements al_get_sample_instance_time.
     166
     167<procedure>(sample-instance-depth sample-instance)</procedure>
     168
     169Implements al_get_sample_instance_depth.
     170
     171<procedure>(sample-instance-channels sample-instance)</procedure>
     172
     173Implements al_get_sample_instance_channels.
     174
     175<procedure>(sample-instance-playmode sample-instance)</procedure>
     176
     177Implements al_get_sample_instance_playmode.
     178
     179<procedure>(sample-instance-playing? sample-instance)</procedure>
     180
     181Implements al_get_sample_instance_playing.
     182
     183<procedure>(sample-instance-attached? sample-instance)</procedure>
     184
     185Implements al_get_sample_instance_attached.
     186
     187<procedure>(sample-instance-position-set! sample-instance unsigned-integer)</procedure>
     188
     189Implements al_set_sample_instance_position.
     190
     191<procedure>(sample-instance-length-set! sample-instance unsigned-integer)</procedure>
     192
     193Implements al_set_sample_instance_length.
     194
     195<procedure>(sample-instance-speed-set! sample-instance float)</procedure>
     196
     197Implements al_set_sample_instance_speed.
     198
     199<procedure>(sample-instance-gain-set! sample-instance float)</procedure>
     200
     201Implements al_set_sample_instance_gain.
     202
     203<procedure>(sample-instance-pan-set! sample-instance float)</procedure>
     204
     205Implements al_set_sample_instance_pan.
     206
     207<procedure>(sample-instance-playmode-set! sample-instance playmode)</procedure>
     208
     209Implements al_set_sample_instance_playmode.
     210
     211<procedure>(sample-instance-playing-set! sample-instance bool)</procedure>
     212
     213Implements al_set_sample_instance_playing.
     214
     215<procedure>(sample-instance-detach! sample-instance)</procedure>
     216
     217Implements al_detach_sample_instance.
     218
     219<procedure>(sample-instance-sample sample-instance)</procedure>
     220
     221Implements al_get_sample.
     222
     223<procedure>(sample-instance-sample-set! sample-instance sample)</procedure>
     224
     225Implements al_set_sample
     226
     227<procedure>(sample-instance-play sample-instance)</procedure>
     228
     229Implements al_play_sample_instance.
     230
     231<procedure>(sample-instance-stop sample-instance)</procedure>
     232
     233Implements al_stop_sample_instance.
     234
     235<procedure>(make-audio-stream* (integer buffer-count) (unsigned-integer samples) (unsigned-integer frequency) audio-depth channel-configuration)</procedure>
     236
     237Implements al_create_audio_stream.
     238
     239<procedure>(make-audio-stream (integer buffer-count) (unsigned-integer samples) (unsigned-integer frequency) audio-depth channel-configuration)</procedure>
     240
     241Implements al_create_audio_stream, with (free-audio-stream!) declared as a finalizer.
     242
     243<procedure>(free-audio-stream! audio-stream)</procedure>
     244
     245Implements al_destroy_audio_stream.
     246
     247<procedure>(audio-stram-drain audio-stream)</procedure>
     248
     249Implements al_drain_audio_stream.
     250
     251<procedure>(audio-stream-frequency audio-stream)</procedure>
     252
     253Implements al_get_audio_stream_frequency.
     254
     255<procedure>(audio-stream-length audio-stream)</procedure>
     256
     257Implements al_get_audio_stream_length.
     258
     259<procedure>(audio-stream-fragments audio-stream)</procedure>
     260
     261Implements al_get_available_audio_stream_fragments.
     262
     263<procedure>(audio-stream-available-fragments audio-stream)</procedure>
     264
     265Implements al_get_available_audio_stream_fragments.
     266
     267<procedure>(audio-stream-speed audio-stream)</procedure>
     268
     269Implements al_get_audio_stream_speed.
     270
     271<procedure>(audio-stream-gain audio-stream)</procedure>
     272
     273Implements al_get_audio_stream_gain.
     274
     275<procedure>(audio-stream-channels audio-stream)</procedure>
     276
     277Implements al_get_audio_stream_channels.
     278
     279<procedure>(audio-stream-depth audio-stream)</procedure>
     280
     281Implements al_get_audio_stream_depth.
     282
     283<procedure>(audio-stream-playmode audio-stream)</procedure>
     284
     285Implements al_get_audio_stream_playmode.
     286
     287<procedure>(audio-stream-playing? audio-stream)</procedure>
     288
     289Implements al_get_audio_stream_playing.
     290
     291<procedure>(audio-stream-attached? audio-stream)</procedure>
     292
     293Implements al_get_audio_stream_attached.
     294
     295<procedure>(audio-stream-fragment audio-stream)</procedure>
     296
     297Implements al_get_audio_stream_fragment.
     298
     299<procedure>(audio-stream-speed-set! audio-stream float)</procedure>
     300
     301Implements al_set_audio_stream_speed.
     302
     303<procedure>(audio-stream-gain-set! audio-stream float)</procedure>
     304
     305Implements al_set_audio_stream_gain.
     306
     307<procedure>(audio-stream-pan-set! audio-stream float)</procedure>
     308
     309Implements al_set_audio_stream_pan.
     310
     311<procedure>(audio-stream-playmode-set! audio-stream playmode)</procedure>
     312
     313Implements al_set_audio_stream_playmode.
     314
     315<procedure>(audio-stream-playing-set! audio-stream bool)</procedure>
     316
     317Implements al_set_audio_stream_playing.
     318
     319<procedure>(audio-stream-detach! audio-stream)</procedure>
     320
     321Implements al_detach_audio_stream.
     322
     323<procedure>(audio-stream-fragment-set! audio-stream c-pointer)</procedure>
     324
     325Implements al_set_audio_stream_fragment.
     326
     327<procedure>(audio-stream-rewind! audio-stream)</procedure>
     328
     329Implements al_rewind_audio_stream.
     330
     331<procedure>(audio-stream-seek-seconds! audio-stream double)</procedure>
     332
     333Implements al_seek_audio_stream_secs.
     334
     335<procedure>(audio-stream-position-seconds audio-stream)</procedure>
     336
     337Impements al_get_audio_stream_position_secs.
     338
     339<procedure>(audio-stream-length-seconds audio-stream)</procedure>
     340
     341Implements al_get_audio_length_secs.
     342
     343<procedure>(audio-stream-loop-set! audio-stream (double start-seconds) (double end-seconds))</procedure>
     344
     345Implements al_set_audio_stream_loop_secs.
     346
     347<procedure>(audio-stream-event-source audio-stream)</procedure>
     348
     349Implements al_get_audio_stream_event_source.
     350
     351<procedure>(make-mixer* (unsigned-integer frequency) audio-depth channel-configuration)</procedure>
     352
     353Implements al_create_mixer.
     354
     355<procedure>(make-mixer (unsigned-integer frequency) audio-depth channel-configuration)</procedure>
     356
     357Implements al_create_mixer, with (free-mixer!) declared as a finalizer.
     358
     359<procedure>(free-mixer! mixer)</procedure>
     360
     361Implements al_destroy_mixer.
     362
     363<procedure>(sample-instance-attach-to-mixer! sample-instance mixer)</procedure>
     364
     365Implements al_attach_sample_instance_to_mixer.
     366
     367<procedure>(audio-stream-attach-to-mixer! audio-stream mixer)</procedure>
     368
     369Implements al_attach_audio_stram_to_mixer.
     370
     371<procedure>(mixer-attach-to-mixer! mixer mixer)</procedure>
     372
     373Implements al_attach_mixer_to_mixer.
     374
     375<procedure>(mixer-postprocess-callback-set! mixer (function void (c-pointer unsigned-integer32 c-pointer)) (c-pointer data))</procedure>
     376
     377Implements al_set_mixer_postprocess_callback.
     378
     379<procedure>(mixer-frequency mixer)</procedure>
     380
     381Implements al_get_mixer_frequency.
     382
     383<procedure>(mixer-channels mixer)</procedure>
     384
     385Implements al_get_mixer_channels.
     386
     387<procedure>(mixer-depth mixer)</procedure>
     388
     389Implements al_get_mixer_depth.
     390
     391<procedure>(mixer-quality mixer)</procedure>
     392
     393Implements al_get_mixer_quality.
     394
     395<procedure>(mixer-playing? mixer)</procedure>
     396
     397Implements al_get_mixer_playing.
     398
     399<procedure>(mixer-attached? mixer)</procedure>
     400
     401Implements al_get_mixer_attached.
     402
     403<procedure>(mixer-frequency-set! mixer unsigned-integer)</procedure>
     404
     405Implements al_set_mixer_frequency.
     406
     407<procedure>(mixer-quality-set! mixer mixer-quality)</procedure>
     408
     409Implements al_set_mixer_quality.
     410
     411<procedure>(mixer-playing-set! mixer bool)</procedure>
     412
     413Implements al_set_mixer_playing.
     414
     415<procedure>(mixer-detach! mixer)</procedure>
     416
     417Implements al_detach_mixer.
     418
     419<procedure>(make-voice* (unsigned-integer frequency) audio-depth channel-configuration)</procedure>
     420
     421Implements al_create_voice.
     422
     423<procedure>(make-voice (unsigned-integer frequency) audio-depth channel-configuration)</procedure>
     424
     425Implements al_create_voice, with (free-voice!) declared as a finalizer.
     426
     427<procedure>(free-voice! voice)</procedure>
     428
     429Implements al_destroy_voice.
     430
     431<procedure>(sample-instance-attach-to-voice! sample-instance voice)</procedure>
     432
     433Implements al_attach_sample_instance_to_voice.
     434
     435<procedure>(audio-stream-attach-to-voice! audio-stram voice)</procedure>
     436
     437Implements al_attach_audio_stream_to_voice.
     438
     439<procedure>(mixer-attach-to-voice! mixer voice)</procedure>
     440
     441Implements al_attach_mixer_to_voice.
     442
     443<procedure>(voice-detach! voice)</procedure>
     444
     445Implements al_detach_voice.
     446
     447<procedure>(voice-frequency voice)</procedure>
     448
     449Implements al_get_voice_frequency.
     450
     451<procedure>(voice-position voice)</procedure>
     452
     453Implements al_get_voice_position voice)</procedure>
     454
     455<procedure>(voice-channels voice)</procedure>
     456
     457Implements al_get_voice_channels.
     458
     459<procedure>(voice-depth voice)</procedure>
     460
     461Implements al_get_voice_depth.
     462
     463<procedure>(voice-playing? voice)</procedure>
     464
     465Implements al_get_voice_playing.
     466
     467<procedure>(voice-position-set! voice unsigned-integer)</procedure>
     468
     469Implements al_set_voice_position.
     470
     471<procedure>(voice-playing-set! voice bool)</procedure>
     472
     473Implements al_set_voice_playing.
     474
     475<procedure>(audio-addon-install)</procedure>
     476
     477Implements al_install_audio.
     478
     479<procedure>(audio-addon-uninstall)</procedure>
     480
     481Implements al_uninstall_audio.
     482
     483<procedure>(audio-addon-installed?)</procedure>
     484
     485Implements al_is_audio_installed.
     486
     487<procedure>(audio-addon-version)</procedure>
     488
     489Implements al_get_allegro_audio_version.
     490
     491<procedure>(channel-configuration-count channel-configuration)</procedure>
     492
     493Implements al_get_channel_count.
     494
     495<procedure>(audio-depth-size audio-depth)</procedure>
     496
     497Implements al_get_audio_depth_size.
     498
     499<procedure>(default-mixer)</procedure>
     500
     501Implements al_get_default_mixer.
     502
     503<procedure>(default-mixer-set! mixer)</procedure>
     504
     505Implements al_set_default_mixer.
     506
     507<procedure>(default-mixer-restore!)</procedure>
     508
     509Implements al_restore_default_mixer.
     510
     511<procedure>(sample-play sample (float gain) (float pan) (float speed) playmode sample-id)</procedure>
     512
     513Implements al_play_sample.
     514
     515The Sample ID is written to the provided sample-id struct.
     516
     517<procedure>(sample-stop sample-id)</procedure>
     518
     519Implements al_stop_sample.
     520
     521<procedure>(reserve-samples integer)</procedure>
     522
     523Implements al_reserve_samples.
     524
     525<procedure>(stop-all-samples)</procedure>
     526
     527Implements al_stop_samples.
     528
     529<procedure>(register-sample-loader (string extension) (function sample ((const string))))</procedure>
     530
     531Implements al_register_sample_loader.
     532
     533<procedure>(register-sample-saver (string extension) (function bool ((const c-string) sample)))</procedure>
     534
     535Implements al_register_sample_saver.
     536
     537<procedure>(register-audio-stream-loader (string extension) (function audio-stream ((const string) size_t unsigned-integer32)))</procedure>
     538
     539Implements al_register_audio_stream_loader.
     540
     541<procedure>(register-sample-file-loader (string extension) (function sample (file)))</procedure>
     542
     543Implements al_register_sample_loader_f.
     544
     545<procedure>(register-sample-file-saver (string extension) (function bool (file sample)))</procedure>
     546
     547Implements al_register_sample_saver_f.
     548
     549<procedure>(register-audio-stream-file-loader (string extension) (function audio-stream (file size_t unsigned-integer)))</procedure>
     550
     551Implements al_register_audio_stream_loader_f.
     552
     553<procedure>(load-sample* string)</procedure>
     554
     555Implements al_load_sample.
     556
     557<procedure>(load-sample string)</procedure>
     558
     559Implements al_load_sample, with (free-sample!) declared as a finalizer.
     560
     561<procedure>(load-audio-stream* string (integer buffer-count) (unsigned-integer samples))</procedure>
     562
     563Implements al_load_audio_stream.
     564
     565<procedure>(load-audio-stream string (integer buffer-count) (unsigned-integer samples))</procedure>
     566
     567Implements al_load_audio_stream, with (free-audio-stream!) declared as a finalizer.
     568
     569<procedure>(load-audio-stream-from-file* file (string identity) (integer buffer-count) (unsigned-integer samples))</procedure>
     570
     571Implements al_load_audio_straem_from_file.
     572
     573<procedure>(load-audio-stream-from-file file (string identity) (integer buffer-count) (unsigned-integer samples))</procedure>
     574
     575Implements al_load_audio_straem_from_file, with (free-audio-stream!) declared as a finalizer.
     576
     577<procedure>(load-sample-from-file* file (string identity))</procedure>
     578
     579Implements al_load_sample_f.
     580
     581<procedure>(load-sample-from-file file (string identity))</procedure>
     582
     583Implements al_load_sample_f, with (free-sample!) declared as a finalizer.
     584
     585<procedure>(sample-save-to-file sample file (string identity))</procedure>
     586
     587Implements al_save_sample_f.
     588
     589<procedure>(sample-save sample (string filename))</procedure>
     590
     591Implements al_save_sample.
     592
     593
     594=== Audio Codec Addon
     595
     596<procedure>(acodec-addon-init)</procedure>
     597
     598Implements al_init_acodec_addon.
     599
     600<procedure>(acodec-addon-version)</procedure>
     601
     602Implements al_get_allegro_acodec_version.
Note: See TracChangeset for help on using the changeset viewer.