timidity/output.h
author Ozkan Sezer <sezeroz@gmail.com>
Sat, 13 Oct 2018 23:02:04 +0300
branchSDL-1.2
changeset 908 6b860486ce24
parent 518 8bc9b5fd2aae
child 782 e7d3a8f73e88
permissions -rw-r--r--
Mix_InitMP3: unload dll if mpg123_init() fails.
slouken@518
     1
/*
slouken@0
     2
    TiMidity -- Experimental MIDI to WAVE converter
slouken@0
     3
    Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
slouken@0
     4
slouken@0
     5
    This program is free software; you can redistribute it and/or modify
slouken@518
     6
    it under the terms of the Perl Artistic License, available in COPYING.
slouken@518
     7
 */
slouken@0
     8
slouken@0
     9
/* Data format encoding bits */
slouken@0
    10
slouken@0
    11
#define PE_MONO 	0x01  /* versus stereo */
slouken@0
    12
#define PE_SIGNED	0x02  /* versus unsigned */
slouken@0
    13
#define PE_16BIT 	0x04  /* versus 8-bit */
slouken@0
    14
#define PE_ULAW 	0x08  /* versus linear */
slouken@0
    15
#define PE_BYTESWAP	0x10  /* versus the other way */
slouken@0
    16
slouken@0
    17
typedef struct {
slouken@0
    18
  int32 rate, encoding;
slouken@0
    19
  char *id_name;
slouken@0
    20
} PlayMode;
slouken@0
    21
slouken@0
    22
extern PlayMode *play_mode_list[], *play_mode;
slouken@0
    23
extern int init_buffers(int kbytes);
slouken@0
    24
slouken@0
    25
/* Conversion functions -- These overwrite the int32 data in *lp with
slouken@0
    26
   data in another format */
slouken@0
    27
slouken@0
    28
/* The size of the output buffers */
slouken@0
    29
extern int AUDIO_BUFFER_SIZE;
slouken@0
    30
slouken@0
    31
/* Actual copy function */
slouken@0
    32
extern void (*s32tobuf)(void *dp, int32 *lp, int32 c);
slouken@0
    33
slouken@0
    34
/* 8-bit signed and unsigned*/
slouken@0
    35
extern void s32tos8(void *dp, int32 *lp, int32 c);
slouken@0
    36
extern void s32tou8(void *dp, int32 *lp, int32 c);
slouken@0
    37
slouken@0
    38
/* 16-bit */
slouken@0
    39
extern void s32tos16(void *dp, int32 *lp, int32 c);
slouken@0
    40
extern void s32tou16(void *dp, int32 *lp, int32 c);
slouken@0
    41
slouken@0
    42
/* byte-exchanged 16-bit */
slouken@0
    43
extern void s32tos16x(void *dp, int32 *lp, int32 c);
slouken@0
    44
extern void s32tou16x(void *dp, int32 *lp, int32 c);
slouken@0
    45
slouken@0
    46
/* uLaw (8 bits) */
slouken@0
    47
extern void s32toulaw(void *dp, int32 *lp, int32 c);
slouken@0
    48
slouken@0
    49
/* little-endian and big-endian specific */
slouken@294
    50
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
slouken@0
    51
#define s32tou16l s32tou16
slouken@0
    52
#define s32tou16b s32tou16x
slouken@0
    53
#define s32tos16l s32tos16
slouken@0
    54
#define s32tos16b s32tos16x
slouken@0
    55
#else
slouken@0
    56
#define s32tou16l s32tou16x
slouken@0
    57
#define s32tou16b s32tou16
slouken@0
    58
#define s32tos16l s32tos16x
slouken@0
    59
#define s32tos16b s32tos16
slouken@0
    60
#endif