Codebase list libsdl2-mixer / upstream/2.0.2+dfsg1
New upstream version 2.0.2+dfsg1 Fabian Greffrath 6 years ago
155 changed file(s) with 25140 addition(s) and 13717 deletion(s). Raw diff Collapse all Expand all
0 LOCAL_PATH := $(call my-dir)
0 # Save the local path
1 MY_LOCAL_PATH := $(call my-dir)
2
3
4 # Enable this if you want to support loading FLAC music with libFLAC
5 SUPPORT_FLAC ?= true
6 FLAC_LIBRARY_PATH := external/flac-1.3.2
7
8 # Enable this if you want to support loading OGG Vorbis music via Tremor
9 SUPPORT_OGG ?= true
10 OGG_LIBRARY_PATH := external/libogg-1.3.2
11 VORBIS_LIBRARY_PATH := external/libvorbisidec-1.2.1
12
13 # Enable this if you want to support loading MP3 music via MPG123
14 SUPPORT_MP3_MPG123 ?= true
15 MPG123_LIBRARY_PATH := external/mpg123-1.25.6
16
17 # Enable this if you want to support loading MOD music via modplug
18 SUPPORT_MOD_MODPLUG ?= true
19 MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.9.0
20
21 # Enable this if you want to support TiMidity
22 SUPPORT_TIMIDITY ?= true
23 TIMIDITY_LIBRARY_PATH := timidity
24
25
26 # Build the library
27 ifeq ($(SUPPORT_FLAC),true)
28 include $(MY_LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/Android.mk
29 endif
30
31 # Build the library
32 ifeq ($(SUPPORT_OGG),true)
33 include $(MY_LOCAL_PATH)/$(OGG_LIBRARY_PATH)/Android.mk
34 include $(MY_LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)/Android.mk
35 endif
36
37 # Build the library
38 ifeq ($(SUPPORT_MP3_MPG123),true)
39 include $(MY_LOCAL_PATH)/$(MPG123_LIBRARY_PATH)/Android.mk
40 endif
41
42 # Build the library
43 ifeq ($(SUPPORT_MOD_MODPLUG),true)
44 include $(MY_LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/Android.mk
45 endif
46
47 # Build the library
48 ifeq ($(SUPPORT_TIMIDITY),true)
49 include $(MY_LOCAL_PATH)/$(TIMIDITY_LIBRARY_PATH)/Android.mk
50 endif
51
52
53 # Restore local path
54 LOCAL_PATH := $(MY_LOCAL_PATH)
155
256 include $(CLEAR_VARS)
357
458 LOCAL_MODULE := SDL2_mixer
559
6 # Enable this if you want to support loading MOD music via modplug
7 # The library path should be a relative path to this directory.
8 SUPPORT_MOD_MODPLUG ?= true
9 MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.8.4
10
11 # Enable this if you want to support loading MOD music via mikmod
12 # The library path should be a relative path to this directory.
13 SUPPORT_MOD_MIKMOD ?= true
14 MIKMOD_LIBRARY_PATH := external/libmikmod-3.1.12
15
16 # Enable this if you want to support loading MP3 music via SMPEG
17 # The library path should be a relative path to this directory.
18 SUPPORT_MP3_SMPEG ?= true
19 SMPEG_LIBRARY_PATH := external/smpeg2-2.0.0
20
21 # Enable this if you want to support loading OGG Vorbis music via Tremor
22 # The library path should be a relative path to this directory.
23 SUPPORT_OGG ?= true
24 OGG_LIBRARY_PATH := external/libogg-1.3.1
25 VORBIS_LIBRARY_PATH := external/libvorbisidec-1.2.1
26
27
28 # Enable this if you want to support TiMidity
29 SUPPORT_TIMIDITY ?= true
30
31 LOCAL_C_INCLUDES := $(LOCAL_PATH)
32 LOCAL_CFLAGS := -DWAV_MUSIC
33
3460 LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c))) \
3561
36
62 LOCAL_CFLAGS :=
3763 LOCAL_LDLIBS :=
3864 LOCAL_STATIC_LIBRARIES :=
3965 LOCAL_SHARED_LIBRARIES := SDL2
4066
41 ifeq ($(SUPPORT_TIMIDITY),true)
42 LOCAL_C_INCLUDES += $(LOCAL_PATH)/timidity
43 LOCAL_CFLAGS += -DMID_MUSIC -DUSE_TIMIDITY_MIDI
44 LOCAL_SRC_FILES += $(subst $(LOCAL_PATH)/,,$(wildcard $(LOCAL_PATH)/timidity/*.c))
67 ifeq ($(SUPPORT_FLAC),true)
68 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/include
69 LOCAL_CFLAGS += -DMUSIC_FLAC
70 LOCAL_STATIC_LIBRARIES += libFLAC
71 endif
72
73 ifeq ($(SUPPORT_OGG),true)
74 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/include
75 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)
76 LOCAL_CFLAGS += -DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>"
77 LOCAL_STATIC_LIBRARIES += ogg vorbisidec
78 endif
79
80 # This needs to be a shared library to comply with the LGPL license
81 ifeq ($(SUPPORT_MP3_MPG123),true)
82 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MPG123_LIBRARY_PATH)
83 LOCAL_CFLAGS += -DMUSIC_MP3_MPG123
84 LOCAL_SHARED_LIBRARIES += mpg123
4585 endif
4686
4787 ifeq ($(SUPPORT_MOD_MODPLUG),true)
48 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
49 LOCAL_CFLAGS += -DMODPLUG_MUSIC -DMODPLUG_HEADER="<modplug.h>" -DHAVE_SETENV -DHAVE_SINF
50 LOCAL_SRC_FILES += \
51 $(MODPLUG_LIBRARY_PATH)/src/fastmix.cpp \
52 $(MODPLUG_LIBRARY_PATH)/src/load_669.cpp \
53 $(MODPLUG_LIBRARY_PATH)/src/load_abc.cpp \
54 $(MODPLUG_LIBRARY_PATH)/src/load_amf.cpp \
55 $(MODPLUG_LIBRARY_PATH)/src/load_ams.cpp \
56 $(MODPLUG_LIBRARY_PATH)/src/load_dbm.cpp \
57 $(MODPLUG_LIBRARY_PATH)/src/load_dmf.cpp \
58 $(MODPLUG_LIBRARY_PATH)/src/load_dsm.cpp \
59 $(MODPLUG_LIBRARY_PATH)/src/load_far.cpp \
60 $(MODPLUG_LIBRARY_PATH)/src/load_it.cpp \
61 $(MODPLUG_LIBRARY_PATH)/src/load_j2b.cpp \
62 $(MODPLUG_LIBRARY_PATH)/src/load_mdl.cpp \
63 $(MODPLUG_LIBRARY_PATH)/src/load_med.cpp \
64 $(MODPLUG_LIBRARY_PATH)/src/load_mid.cpp \
65 $(MODPLUG_LIBRARY_PATH)/src/load_mod.cpp \
66 $(MODPLUG_LIBRARY_PATH)/src/load_mt2.cpp \
67 $(MODPLUG_LIBRARY_PATH)/src/load_mtm.cpp \
68 $(MODPLUG_LIBRARY_PATH)/src/load_okt.cpp \
69 $(MODPLUG_LIBRARY_PATH)/src/load_pat.cpp \
70 $(MODPLUG_LIBRARY_PATH)/src/load_psm.cpp \
71 $(MODPLUG_LIBRARY_PATH)/src/load_ptm.cpp \
72 $(MODPLUG_LIBRARY_PATH)/src/load_s3m.cpp \
73 $(MODPLUG_LIBRARY_PATH)/src/load_stm.cpp \
74 $(MODPLUG_LIBRARY_PATH)/src/load_ult.cpp \
75 $(MODPLUG_LIBRARY_PATH)/src/load_umx.cpp \
76 $(MODPLUG_LIBRARY_PATH)/src/load_wav.cpp \
77 $(MODPLUG_LIBRARY_PATH)/src/load_xm.cpp \
78 $(MODPLUG_LIBRARY_PATH)/src/mmcmp.cpp \
79 $(MODPLUG_LIBRARY_PATH)/src/modplug.cpp \
80 $(MODPLUG_LIBRARY_PATH)/src/snd_dsp.cpp \
81 $(MODPLUG_LIBRARY_PATH)/src/snd_flt.cpp \
82 $(MODPLUG_LIBRARY_PATH)/src/snd_fx.cpp \
83 $(MODPLUG_LIBRARY_PATH)/src/sndfile.cpp \
84 $(MODPLUG_LIBRARY_PATH)/src/sndmix.cpp
88 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src
89 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
90 LOCAL_CFLAGS += -DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>"
91 LOCAL_STATIC_LIBRARIES += modplug
8592 endif
8693
87 ifeq ($(SUPPORT_MOD_MIKMOD),true)
88 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MIKMOD_LIBRARY_PATH)/include
89 LOCAL_CFLAGS += -DMOD_MUSIC
90 LOCAL_SHARED_LIBRARIES += mikmod
94 ifeq ($(SUPPORT_TIMIDITY),true)
95 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(TIMIDITY_LIBRARY_PATH)
96 LOCAL_CFLAGS += -DMUSIC_MID_TIMIDITY
97 LOCAL_STATIC_LIBRARIES += timidity
9198 endif
9299
93 ifeq ($(SUPPORT_MP3_SMPEG),true)
94 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(SMPEG_LIBRARY_PATH)
95 LOCAL_CFLAGS += -DMP3_MUSIC
96 LOCAL_SHARED_LIBRARIES += smpeg2
97 endif
98
99 ifeq ($(SUPPORT_OGG),true)
100 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/include $(LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)
101 LOCAL_CFLAGS += -DOGG_MUSIC -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>"
102 ifeq ($(TARGET_ARCH_ABI),armeabi)
103 LOCAL_CFLAGS += -D_ARM_ASSEM_
104 endif
105 ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
106 LOCAL_CFLAGS += -D_ARM_ASSEM_
107 endif
108 LOCAL_SRC_FILES += \
109 $(VORBIS_LIBRARY_PATH)/mdct.c \
110 $(VORBIS_LIBRARY_PATH)/block.c \
111 $(VORBIS_LIBRARY_PATH)/window.c \
112 $(VORBIS_LIBRARY_PATH)/synthesis.c \
113 $(VORBIS_LIBRARY_PATH)/info.c \
114 $(VORBIS_LIBRARY_PATH)/floor1.c \
115 $(VORBIS_LIBRARY_PATH)/floor0.c \
116 $(VORBIS_LIBRARY_PATH)/vorbisfile.c \
117 $(VORBIS_LIBRARY_PATH)/res012.c \
118 $(VORBIS_LIBRARY_PATH)/mapping0.c \
119 $(VORBIS_LIBRARY_PATH)/registry.c \
120 $(VORBIS_LIBRARY_PATH)/codebook.c \
121 $(VORBIS_LIBRARY_PATH)/sharedbook.c \
122 $(OGG_LIBRARY_PATH)/src/framing.c \
123 $(OGG_LIBRARY_PATH)/src/bitwise.c
124 endif
125
126 LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
127
128 LOCAL_ARM_MODE := arm
100 LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
129101
130102 include $(BUILD_SHARED_LIBRARY)
0 2.0.2:
1 Sam Lantinga - Fri Oct 20 22:04:50 PDT 2017
2 * Implemented 24-bit and surround sound support for FLAC audio files
3 Sam Lantinga - Thu Oct 12 21:32:44 PDT 2017
4 * Updated external libraries flac-1.3.2, libmodplug-0.8.9.0, libogg-1.3.2 and libvorbis-1.3.5
5 Ryan Gordon - Thu Oct 12 21:29:59 PDT 2017
6 * Updated for SDL 2.0.6 and newer
7 Franc[e]sco - Thu Jul 20 22:03:19 2017 +0200
8 * Added support for MP3 playback using mpg123
9 David Ludwig - Sun Apr 10 22:35:38 2016
10 * Added support for UWP / Windows 10 apps
11 Juha Kuikka - Fri Jan 29 12:44:01 PST 2016
12 * Added Mix_OpenAudioDevice() so you can specify the audio device to open
13
014 2.0.1:
115 Sam Lantinga - Tue Jul 7 11:40:33 PDT 2015
216 * Added support for 'smpl' format loop points in music WAV files
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
1919 EXE = @EXE@
2020 SHELL = @SHELL@
2121 CC = @CC@
22 CXX = g++
2322 CFLAGS = @BUILD_CFLAGS@
2423 EXTRA_CFLAGS = @EXTRA_CFLAGS@
2524 LDFLAGS = @BUILD_LDFLAGS@
3837 PLAYWAVE_OBJECTS = @PLAYWAVE_OBJECTS@
3938 PLAYMUS_OBJECTS = @PLAYMUS_OBJECTS@
4039
41 DIST = *.txt Android.mk Makefile.in SDL2_mixer.pc.in SDL_mixer.h SDL2_mixer.spec SDL2_mixer.spec.in debian VisualC Xcode Xcode-iOS acinclude autogen.sh build-scripts configure configure.in dynamic_flac.c dynamic_flac.h dynamic_fluidsynth.c dynamic_fluidsynth.h dynamic_modplug.c dynamic_modplug.h dynamic_mod.c dynamic_mod.h dynamic_mp3.c dynamic_mp3.h dynamic_ogg.c dynamic_ogg.h effect_position.c effect_stereoreverse.c effects_internal.c effects_internal.h fluidsynth.c fluidsynth.h external gcc-fat.sh libmikmod-3.1.12.zip load_aiff.c load_aiff.h load_flac.c load_flac.h load_mp3.c load_mp3.h load_ogg.c load_ogg.h load_voc.c load_voc.h mixer.c music.c music_cmd.c music_cmd.h music_flac.c music_flac.h music_mad.c music_mad.h music_mod.c music_mod.h music_modplug.c music_modplug.h music_ogg.c music_ogg.h native_midi playmus.c playwave.c timidity wavestream.c wavestream.h version.rc
40 DIST = *.txt Android.mk Makefile.in SDL2_mixer.pc.in SDL2_mixer.spec.in SDL_mixer.h VisualC VisualC-WinRT Xcode Xcode-iOS acinclude aclocal.m4 autogen.sh build-scripts configure configure.in debian effect_position.c effect_stereoreverse.c effects_internal.c effects_internal.h external gcc-fat.sh load_aiff.c load_aiff.h load_voc.c load_voc.h mixer.c mixer.h music.c music.h music_cmd.c music_cmd.h music_flac.c music_flac.h music_fluidsynth.c music_fluidsynth.h music_mad.c music_mad.h music_mikmod.c music_mikmod.h music_modplug.c music_modplug.h music_mpg123.c music_mpg123.h music_nativemidi.c music_nativemidi.h music_ogg.c music_ogg.h music_smpeg.c music_smpeg.h music_timidity.c music_timidity.h music_wav.c music_wav.h native_midi playmus.c playwave.c timidity version.rc
4241
4342 LT_AGE = @LT_AGE@
4443 LT_CURRENT = @LT_CURRENT@
6564 $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
6665
6766 $(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET)
68 $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(LDFLAGS) $(objects)/$(TARGET)
67 $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(objects)/$(TARGET) $(SDL_LIBS) $(LDFLAGS)
6968
7069 $(objects)/playmus$(EXE): $(objects)/playmus.lo $(objects)/$(TARGET)
71 $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(SDL_LIBS) $(LDFLAGS) $(objects)/$(TARGET)
70 $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(objects)/$(TARGET) $(SDL_LIBS) $(LDFLAGS)
7271
7372 install: all install-hdrs install-lib #install-bin
7473 install-hdrs:
55
66 Due to popular demand, here is a simple multi-channel audio mixer.
77 It supports 8 channels of 16 bit stereo audio, plus a single channel
8 of music, mixed by the popular MikMod MOD, Timidity MIDI and SMPEG MP3
9 libraries.
8 of music.
109
1110 See the header file SDL_mixer.h and the examples playwave.c and playmus.c
1211 for documentation on this mixer library.
1312
1413 The mixer can currently load Microsoft WAVE files and Creative Labs VOC
15 files as audio samples, and can load MIDI files via Timidity and the
16 following music formats via MikMod: .MOD .S3M .IT .XM. It can load
17 Ogg Vorbis streams as music if built with Ogg Vorbis or Tremor libraries,
18 and finally it can load MP3 music using the SMPEG or libmad libraries.
14 files as audio samples, it can load FLAC files with libFLAC, it can load
15 Ogg Vorbis files with Ogg Vorbis or Tremor libraries, it can load MP3 files
16 using mpg123, SMPEG or libmad, and it can load MIDI files with Timidity,
17 FluidSynth, and natively on Windows, Mac OSX, and Linux, and finally it can
18 load the following file formats via ModPlug or MikMod: .MOD .S3M .IT .XM.
1919
2020 Tremor decoding is disabled by default; you can enable it by passing
2121 --enable-music-ogg-tremor
22 to configure, or by defining OGG_MUSIC and OGG_USE_TREMOR.
22 to configure, or by defining MUSIC_OGG and OGG_USE_TREMOR.
2323
2424 libmad decoding is disabled by default; you can enable it by passing
2525 --enable-music-mp3-mad
26 to configure, or by defining MP3_MAD_MUSIC
26 to configure, or by defining MUSIC_MP3_MAD
2727 vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2828 WARNING: The license for libmad is GPL, which means that in order to
2929 use it your application must also be GPL!
3333 so if playing regular WAVE files sound great, but playing MIDI files
3434 sound choppy, try using 8-bit audio, mono audio, or lower frequencies.
3535
36 To play MIDI files, you'll need to get a complete set of GUS patches
37 from:
36 To play MIDI files using FluidSynth, you'll need to set the SDL_SOUNDFONTS
37 environment variable to a Sound Font 2 (.sf2) file containing the musical
38 instruments you want to use for MIDI playback.
39 (On some Linux distributions you can install the fluid-soundfont-gm package)
40
41 To play MIDI files using Timidity, you'll need to get a complete set of
42 GUS patches from:
3843 http://www.libsdl.org/projects/mixer/timidity/timidity.tar.gz
3944 and unpack them in /usr/local/lib under UNIX, and C:\ under Win32.
4045
46 iOS:
47 In order to use this library on iOS, you should include the SDL.xcodeproj
48 and Xcode-iOS/SDL_mixer.xcodeproj in your application, add the SDL/include
49 and SDL_mixer directories to your "Header Search Paths" setting, then add the
50 libSDL2.a and libSDL2_mixer.a to your "Link Binary with Libraries" setting.
51
4152 This library is under the zlib license, see the file "COPYING.txt" for details.
4253
+0
-64
SDL2_mixer.spec less more
0 %define name SDL2_mixer
1 %define version 2.0.1
2 %define release 1
3
4 Summary: Simple DirectMedia Layer - Sample Mixer Library
5 Name: %{name}
6 Version: %{version}
7 Release: %{release}
8 Source0: %{name}-%{version}.tar.gz
9 License: LGPL
10 Group: System Environment/Libraries
11 BuildRoot: /var/tmp/%{name}-buildroot
12 Prefix: %{_prefix}
13
14 %description
15 Due to popular demand, here is a simple multi-channel audio mixer.
16 It supports 4 channels of 16 bit stereo audio, plus a single channel
17 of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
18 Tremor, SMPEG MP3, and libmad MP3 libraries.
19
20 %package devel
21 Summary: Libraries, includes and more to develop SDL applications.
22 Group: Development/Libraries
23 Requires: %{name}
24
25 %description devel
26 Due to popular demand, here is a simple multi-channel audio mixer.
27 It supports 4 channels of 16 bit stereo audio, plus a single channel
28 of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
29 Tremor, SMPEG MP3, and libmad MP3 libraries.
30
31 %prep
32 %setup
33
34 %build
35 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
36 make
37
38 %install
39 rm -rf $RPM_BUILD_ROOT
40 make install prefix=$RPM_BUILD_ROOT/%{prefix}
41
42 %clean
43 rm -rf $RPM_BUILD_ROOT
44
45 %files
46 %defattr(-,root,root)
47 %doc README.txt CHANGES.txt COPYING.txt
48 %{prefix}/lib/lib*.so.*
49
50 %files devel
51 %defattr(-,root,root)
52 %{prefix}/lib/lib*.a
53 %{prefix}/lib/lib*.la
54 %{prefix}/lib/lib*.so
55 %{prefix}/include/*/
56 %{prefix}/lib/pkgconfig/*.pc
57
58 %changelog
59 * Wed Jan 19 2000 Sam Lantinga
60 - converted to get package information from configure
61 * Sun Jan 16 2000 Hakan Tandogan <hakan@iconsult.com>
62 - initial spec file
63
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
1818 3. This notice may not be removed or altered from any source distribution.
1919 */
2020
21 /* $Id$ */
22
23 #ifndef _SDL_MIXER_H
24 #define _SDL_MIXER_H
21 #ifndef SDL_MIXER_H_
22 #define SDL_MIXER_H_
2523
2624 #include "SDL_stdinc.h"
2725 #include "SDL_rwops.h"
3937 */
4038 #define SDL_MIXER_MAJOR_VERSION 2
4139 #define SDL_MIXER_MINOR_VERSION 0
42 #define SDL_MIXER_PATCHLEVEL 1
40 #define SDL_MIXER_PATCHLEVEL 2
4341
4442 /* This macro can be used to fill a version structure with the compile-time
4543 * version of the SDL_mixer library.
5755 #define MIX_PATCHLEVEL SDL_MIXER_PATCHLEVEL
5856 #define MIX_VERSION(X) SDL_MIXER_VERSION(X)
5957
58 /**
59 * This is the version number macro for the current SDL_mixer version.
60 */
61 #define SDL_MIXER_COMPILEDVERSION \
62 SDL_VERSIONNUM(SDL_MIXER_MAJOR_VERSION, SDL_MIXER_MINOR_VERSION, SDL_MIXER_PATCHLEVEL)
63
64 /**
65 * This macro will evaluate to true if compiled with SDL_mixer at least X.Y.Z.
66 */
67 #define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) \
68 (SDL_MIXER_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
69
6070 /* This function gets the version of the dynamically linked SDL_mixer library.
6171 it should NOT be used to fill a version structure, instead you should
6272 use the SDL_MIXER_VERSION() macro.
6575
6676 typedef enum
6777 {
68 MIX_INIT_FLAC = 0x00000001,
69 MIX_INIT_MOD = 0x00000002,
70 MIX_INIT_MODPLUG = 0x00000004,
71 MIX_INIT_MP3 = 0x00000008,
72 MIX_INIT_OGG = 0x00000010,
73 MIX_INIT_FLUIDSYNTH = 0x00000020
78 MIX_INIT_FLAC = 0x00000001,
79 MIX_INIT_MOD = 0x00000002,
80 MIX_INIT_MP3 = 0x00000008,
81 MIX_INIT_OGG = 0x00000010,
82 MIX_INIT_MID = 0x00000020
7483 } MIX_InitFlags;
7584
7685 /* Loads dynamic libraries and prepares them for use. Flags should be
96105 #define MIX_DEFAULT_FORMAT AUDIO_S16MSB
97106 #endif
98107 #define MIX_DEFAULT_CHANNELS 2
99 #define MIX_MAX_VOLUME 128 /* Volume of a chunk */
108 #define MIX_MAX_VOLUME SDL_MIX_MAXVOLUME /* Volume of a chunk */
100109
101110 /* The internal format for an audio chunk */
102111 typedef struct Mix_Chunk {
113122 MIX_FADING_IN
114123 } Mix_Fading;
115124
125 /* These are types of music files (not libraries used to load them) */
116126 typedef enum {
117127 MUS_NONE,
118128 MUS_CMD,
121131 MUS_MID,
122132 MUS_OGG,
123133 MUS_MP3,
124 MUS_MP3_MAD,
134 MUS_MP3_MAD_UNUSED,
125135 MUS_FLAC,
126 MUS_MODPLUG
136 MUS_MODPLUG_UNUSED
127137 } Mix_MusicType;
128138
129139 /* The internal format for a music chunk interpreted via mikmod */
131141
132142 /* Open the mixer with a certain audio format */
133143 extern DECLSPEC int SDLCALL Mix_OpenAudio(int frequency, Uint16 format, int channels, int chunksize);
144
145 /* Open the mixer with specific device and certain audio format */
146 extern DECLSPEC int SDLCALL Mix_OpenAudioDevice(int frequency, Uint16 format, int channels, int chunksize, const char* device, int allowed_changes);
134147
135148 /* Dynamically change the number of channels managed by the mixer.
136149 If decreasing the number of channels, the upper channels are
187200 */
188201 extern DECLSPEC int SDLCALL Mix_GetNumChunkDecoders(void);
189202 extern DECLSPEC const char * SDLCALL Mix_GetChunkDecoder(int index);
203 extern DECLSPEC SDL_bool SDLCALL Mix_HasChunkDecoder(const char *name);
190204 extern DECLSPEC int SDLCALL Mix_GetNumMusicDecoders(void);
191205 extern DECLSPEC const char * SDLCALL Mix_GetMusicDecoder(int index);
206 extern DECLSPEC SDL_bool SDLCALL Mix_HasMusicDecoder(const char *name);
192207
193208 /* Find out the music format of a mixer music, or the currently playing
194209 music, if 'music' is NULL.
199214 This can be used to provide real-time visual display of the audio stream
200215 or add a custom mixer filter for the stream data.
201216 */
202 extern DECLSPEC void SDLCALL Mix_SetPostMix(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg);
217 extern DECLSPEC void SDLCALL Mix_SetPostMix(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len), void *arg);
203218
204219 /* Add your own music player or additional mixer function.
205220 If 'mix_func' is NULL, the default music player is re-enabled.
206221 */
207 extern DECLSPEC void SDLCALL Mix_HookMusic(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg);
222 extern DECLSPEC void SDLCALL Mix_HookMusic(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len), void *arg);
208223
209224 /* Add your own callback for when the music has finished playing or when it is
210225 * stopped from a call to Mix_HaltMusic.
211226 */
212 extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void (*music_finished)(void));
227 extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void (SDLCALL *music_finished)(void));
213228
214229 /* Get a pointer to the user data for the current music hook */
215230 extern DECLSPEC void * SDLCALL Mix_GetMusicHookData(void);
222237 * inside the audio callback, or SDL_mixer will explicitly lock the audio
223238 * before calling your callback.
224239 */
225 extern DECLSPEC void SDLCALL Mix_ChannelFinished(void (*channel_finished)(int channel));
240 extern DECLSPEC void SDLCALL Mix_ChannelFinished(void (SDLCALL *channel_finished)(int channel));
226241
227242
228243 /* Special Effects API by ryan c. gordon. (icculus@icculus.org) */
246261 *
247262 * DO NOT EVER call SDL_LockAudio() from your callback function!
248263 */
249 typedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata);
264 typedef void (SDLCALL *Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata);
250265
251266 /*
252267 * This is a callback that signifies that a channel has finished all its
257272 *
258273 * DO NOT EVER call SDL_LockAudio() from your callback function!
259274 */
260 typedef void (*Mix_EffectDone_t)(int chan, void *udata);
275 typedef void (SDLCALL *Mix_EffectDone_t)(int chan, void *udata);
261276
262277
263278 /* Register a special effect function. At mixing time, the channel data is
586601 /* Set the current position in the music stream.
587602 This returns 0 if successful, or -1 if it failed or isn't implemented.
588603 This function is only implemented for MOD music formats (set pattern
589 order number) and for OGG, FLAC, MP3_MAD, and MODPLUG music (set
590 position in seconds), at the moment.
604 order number) and for OGG, FLAC, MP3_MAD, MP3_MPG and MODPLUG music
605 (set position in seconds), at the moment.
591606 */
592607 extern DECLSPEC int SDLCALL Mix_SetMusicPosition(double position);
593608
607622 /* Set/Get/Iterate SoundFonts paths to use by supported MIDI backends */
608623 extern DECLSPEC int SDLCALL Mix_SetSoundFonts(const char *paths);
609624 extern DECLSPEC const char* SDLCALL Mix_GetSoundFonts(void);
610 extern DECLSPEC int SDLCALL Mix_EachSoundFont(int (*function)(const char*, void*), void *data);
625 extern DECLSPEC int SDLCALL Mix_EachSoundFont(int (SDLCALL *function)(const char*, void*), void *data);
611626
612627 /* Get the Mix_Chunk currently associated with a mixer channel
613628 Returns NULL if it's an invalid channel, or there's no chunk associated.
620635 /* We'll use SDL for reporting errors */
621636 #define Mix_SetError SDL_SetError
622637 #define Mix_GetError SDL_GetError
638 #define Mix_ClearError SDL_ClearError
623639
624640 /* Ends C function definitions when using C++ */
625641 #ifdef __cplusplus
627643 #endif
628644 #include "close_code.h"
629645
630 #endif /* _SDL_MIXER_H */
646 #endif /* SDL_MIXER_H_ */
647
648 /* vi: set ts=4 sw=4 expandtab: */
0 
1 Microsoft Visual Studio Solution File, Format Version 12.00
2 # Visual Studio 14
3 VisualStudioVersion = 14.0.25420.1
4 MinimumVisualStudioVersion = 10.0.40219.1
5 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2_mixer-UWP", "SDL_mixer-UWP.vcxproj", "{18665277-E558-4484-93F4-E4DC7BB614CB}"
6 EndProject
7 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libogg_dynamic-UWP", "libogg_dynamic-UWP.vcxproj", "{B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}"
8 EndProject
9 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbis_dynamic-UWP", "libvorbis_dynamic-UWP.vcxproj", "{6B6C1F59-6A82-4097-8907-04DF5C95D014}"
10 EndProject
11 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbisfile_dynamic-UWP", "libvorbisfile_dynamic-UWP.vcxproj", "{70EF3B8F-6AAF-401B-9818-3371E950E73C}"
12 EndProject
13 Global
14 GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 Debug|ARM = Debug|ARM
16 Debug|x64 = Debug|x64
17 Debug|x86 = Debug|x86
18 Release|ARM = Release|ARM
19 Release|x64 = Release|x64
20 Release|x86 = Release|x86
21 EndGlobalSection
22 GlobalSection(ProjectConfigurationPlatforms) = postSolution
23 {18665277-E558-4484-93F4-E4DC7BB614CB}.Debug|ARM.ActiveCfg = Debug|ARM
24 {18665277-E558-4484-93F4-E4DC7BB614CB}.Debug|ARM.Build.0 = Debug|ARM
25 {18665277-E558-4484-93F4-E4DC7BB614CB}.Debug|x64.ActiveCfg = Debug|x64
26 {18665277-E558-4484-93F4-E4DC7BB614CB}.Debug|x64.Build.0 = Debug|x64
27 {18665277-E558-4484-93F4-E4DC7BB614CB}.Debug|x86.ActiveCfg = Debug|Win32
28 {18665277-E558-4484-93F4-E4DC7BB614CB}.Debug|x86.Build.0 = Debug|Win32
29 {18665277-E558-4484-93F4-E4DC7BB614CB}.Release|ARM.ActiveCfg = Release|ARM
30 {18665277-E558-4484-93F4-E4DC7BB614CB}.Release|ARM.Build.0 = Release|ARM
31 {18665277-E558-4484-93F4-E4DC7BB614CB}.Release|x64.ActiveCfg = Release|x64
32 {18665277-E558-4484-93F4-E4DC7BB614CB}.Release|x64.Build.0 = Release|x64
33 {18665277-E558-4484-93F4-E4DC7BB614CB}.Release|x86.ActiveCfg = Release|Win32
34 {18665277-E558-4484-93F4-E4DC7BB614CB}.Release|x86.Build.0 = Release|Win32
35 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Debug|ARM.ActiveCfg = Debug|ARM
36 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Debug|ARM.Build.0 = Debug|ARM
37 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Debug|x64.ActiveCfg = Debug|x64
38 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Debug|x64.Build.0 = Debug|x64
39 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Debug|x86.ActiveCfg = Debug|Win32
40 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Debug|x86.Build.0 = Debug|Win32
41 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Release|ARM.ActiveCfg = Release|ARM
42 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Release|ARM.Build.0 = Release|ARM
43 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Release|x64.ActiveCfg = Release|x64
44 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Release|x64.Build.0 = Release|x64
45 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Release|x86.ActiveCfg = Release|Win32
46 {B14F8B7F-C9FF-4FD3-B328-7C68AB801E85}.Release|x86.Build.0 = Release|Win32
47 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Debug|ARM.ActiveCfg = Debug|ARM
48 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Debug|ARM.Build.0 = Debug|ARM
49 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Debug|x64.ActiveCfg = Debug|x64
50 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Debug|x64.Build.0 = Debug|x64
51 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Debug|x86.ActiveCfg = Debug|Win32
52 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Debug|x86.Build.0 = Debug|Win32
53 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Release|ARM.ActiveCfg = Release|ARM
54 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Release|ARM.Build.0 = Release|ARM
55 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Release|x64.ActiveCfg = Release|x64
56 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Release|x64.Build.0 = Release|x64
57 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Release|x86.ActiveCfg = Release|Win32
58 {6B6C1F59-6A82-4097-8907-04DF5C95D014}.Release|x86.Build.0 = Release|Win32
59 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Debug|ARM.ActiveCfg = Debug|ARM
60 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Debug|ARM.Build.0 = Debug|ARM
61 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Debug|x64.ActiveCfg = Debug|x64
62 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Debug|x64.Build.0 = Debug|x64
63 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Debug|x86.ActiveCfg = Debug|Win32
64 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Debug|x86.Build.0 = Debug|Win32
65 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Release|ARM.ActiveCfg = Release|ARM
66 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Release|ARM.Build.0 = Release|ARM
67 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Release|x64.ActiveCfg = Release|x64
68 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Release|x64.Build.0 = Release|x64
69 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Release|x86.ActiveCfg = Release|Win32
70 {70EF3B8F-6AAF-401B-9818-3371E950E73C}.Release|x86.Build.0 = Release|Win32
71 EndGlobalSection
72 GlobalSection(SolutionProperties) = preSolution
73 HideSolutionNode = FALSE
74 EndGlobalSection
75 EndGlobal
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <ItemGroup>
29 <ClCompile Include="..\..\effects_internal.c" />
30 <ClCompile Include="..\..\effect_position.c" />
31 <ClCompile Include="..\..\effect_stereoreverse.c" />
32 <ClCompile Include="..\..\load_aiff.c" />
33 <ClCompile Include="..\..\load_voc.c" />
34 <ClCompile Include="..\..\mixer.c" />
35 <ClCompile Include="..\..\music.c" />
36 <ClCompile Include="..\..\music_cmd.c" />
37 <ClCompile Include="..\..\music_flac.c" />
38 <ClCompile Include="..\..\music_fluidsynth.c" />
39 <ClCompile Include="..\..\music_mad.c" />
40 <ClCompile Include="..\..\music_mikmod.c" />
41 <ClCompile Include="..\..\music_modplug.c" />
42 <ClCompile Include="..\..\music_mpg123.c" />
43 <ClCompile Include="..\..\music_nativemidi.c" />
44 <ClCompile Include="..\..\music_ogg.c" />
45 <ClCompile Include="..\..\music_smpeg.c" />
46 <ClCompile Include="..\..\music_timidity.c" />
47 <ClCompile Include="..\..\music_wav.c" />
48 <ClCompile Include="..\..\timidity\common.c" />
49 <ClCompile Include="..\..\timidity\instrum.c" />
50 <ClCompile Include="..\..\timidity\mix.c" />
51 <ClCompile Include="..\..\timidity\output.c" />
52 <ClCompile Include="..\..\timidity\playmidi.c" />
53 <ClCompile Include="..\..\timidity\readmidi.c" />
54 <ClCompile Include="..\..\timidity\resample.c" />
55 <ClCompile Include="..\..\timidity\tables.c" />
56 <ClCompile Include="..\..\timidity\timidity.c" />
57 </ItemGroup>
58 <ItemGroup>
59 <ClInclude Include="..\..\SDL_mixer.h" />
60 <ClInclude Include="..\..\timidity\common.h" />
61 <ClInclude Include="..\..\timidity\instrum.h" />
62 <ClInclude Include="..\..\timidity\mix.h" />
63 <ClInclude Include="..\..\timidity\options.h" />
64 <ClInclude Include="..\..\timidity\output.h" />
65 <ClInclude Include="..\..\timidity\playmidi.h" />
66 <ClInclude Include="..\..\timidity\readmidi.h" />
67 <ClInclude Include="..\..\timidity\resample.h" />
68 <ClInclude Include="..\..\timidity\tables.h" />
69 <ClInclude Include="..\..\timidity\timidity.h" />
70 </ItemGroup>
71 <ItemGroup>
72 <ProjectReference Include="..\..\..\SDL\VisualC-WinRT\UWP_VS2015\SDL-UWP.vcxproj">
73 <Project>{89e9b32e-a86a-47c3-a948-d2b1622925ce}</Project>
74 </ProjectReference>
75 <ProjectReference Include="libogg_dynamic-UWP.vcxproj">
76 <Project>{b14f8b7f-c9ff-4fd3-b328-7c68ab801e85}</Project>
77 </ProjectReference>
78 <ProjectReference Include="libvorbisfile_dynamic-UWP.vcxproj">
79 <Project>{70ef3b8f-6aaf-401b-9818-3371e950e73c}</Project>
80 </ProjectReference>
81 <ProjectReference Include="libvorbis_dynamic-UWP.vcxproj">
82 <Project>{6b6c1f59-6a82-4097-8907-04df5c95d014}</Project>
83 </ProjectReference>
84 </ItemGroup>
85 <PropertyGroup Label="Globals">
86 <ProjectGuid>{18665277-e558-4484-93f4-e4dc7bb614cb}</ProjectGuid>
87 <Keyword>DynamicLibrary</Keyword>
88 <ProjectName>SDL2_mixer-UWP</ProjectName>
89 <RootNamespace>SDL2_mixer_UWP</RootNamespace>
90 <DefaultLanguage>en-US</DefaultLanguage>
91 <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
92 <AppContainerApplication>true</AppContainerApplication>
93 <ApplicationType>Windows Store</ApplicationType>
94 <ApplicationTypeRevision>8.2</ApplicationTypeRevision>
95 <TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
96 <TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
97 <WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
98 <WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
99 </PropertyGroup>
100 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
101 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
102 <ConfigurationType>DynamicLibrary</ConfigurationType>
103 <UseDebugLibraries>true</UseDebugLibraries>
104 <PlatformToolset>v140</PlatformToolset>
105 </PropertyGroup>
106 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
107 <ConfigurationType>DynamicLibrary</ConfigurationType>
108 <UseDebugLibraries>true</UseDebugLibraries>
109 <PlatformToolset>v140</PlatformToolset>
110 </PropertyGroup>
111 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
112 <ConfigurationType>DynamicLibrary</ConfigurationType>
113 <UseDebugLibraries>true</UseDebugLibraries>
114 <PlatformToolset>v140</PlatformToolset>
115 </PropertyGroup>
116 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
117 <ConfigurationType>DynamicLibrary</ConfigurationType>
118 <UseDebugLibraries>false</UseDebugLibraries>
119 <WholeProgramOptimization>true</WholeProgramOptimization>
120 <PlatformToolset>v140</PlatformToolset>
121 </PropertyGroup>
122 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
123 <ConfigurationType>DynamicLibrary</ConfigurationType>
124 <UseDebugLibraries>false</UseDebugLibraries>
125 <WholeProgramOptimization>true</WholeProgramOptimization>
126 <PlatformToolset>v140</PlatformToolset>
127 </PropertyGroup>
128 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
129 <ConfigurationType>DynamicLibrary</ConfigurationType>
130 <UseDebugLibraries>false</UseDebugLibraries>
131 <WholeProgramOptimization>true</WholeProgramOptimization>
132 <PlatformToolset>v140</PlatformToolset>
133 </PropertyGroup>
134 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
135 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
136 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
137 </ImportGroup>
138 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
139 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
140 </ImportGroup>
141 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
142 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
143 </ImportGroup>
144 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
145 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
146 </ImportGroup>
147 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
148 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
149 </ImportGroup>
150 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
151 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
152 </ImportGroup>
153 <PropertyGroup Label="UserMacros" />
154 <PropertyGroup />
155 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
156 <GenerateManifest>false</GenerateManifest>
157 <IgnoreImportLibrary>false</IgnoreImportLibrary>
158 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
159 <TargetName>SDL2_mixer</TargetName>
160 </PropertyGroup>
161 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
162 <GenerateManifest>false</GenerateManifest>
163 <IgnoreImportLibrary>false</IgnoreImportLibrary>
164 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
165 <TargetName>SDL2_mixer</TargetName>
166 </PropertyGroup>
167 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
168 <GenerateManifest>false</GenerateManifest>
169 <IgnoreImportLibrary>false</IgnoreImportLibrary>
170 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
171 <TargetName>SDL2_mixer</TargetName>
172 </PropertyGroup>
173 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
174 <GenerateManifest>false</GenerateManifest>
175 <IgnoreImportLibrary>false</IgnoreImportLibrary>
176 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
177 <TargetName>SDL2_mixer</TargetName>
178 </PropertyGroup>
179 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
180 <GenerateManifest>false</GenerateManifest>
181 <IgnoreImportLibrary>false</IgnoreImportLibrary>
182 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
183 <TargetName>SDL2_mixer</TargetName>
184 </PropertyGroup>
185 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
186 <GenerateManifest>false</GenerateManifest>
187 <IgnoreImportLibrary>false</IgnoreImportLibrary>
188 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
189 <TargetName>SDL2_mixer</TargetName>
190 </PropertyGroup>
191 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
192 <ClCompile>
193 <PrecompiledHeader>NotUsing</PrecompiledHeader>
194 <CompileAsWinRT>false</CompileAsWinRT>
195 <AdditionalIncludeDirectories>..\..\timidity;..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
196 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
197 </ClCompile>
198 <Link>
199 <SubSystem>Console</SubSystem>
200 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
201 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
202 </Link>
203 </ItemDefinitionGroup>
204 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
205 <ClCompile>
206 <PrecompiledHeader>NotUsing</PrecompiledHeader>
207 <CompileAsWinRT>false</CompileAsWinRT>
208 <AdditionalIncludeDirectories>..\..\timidity;..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
209 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
210 </ClCompile>
211 <Link>
212 <SubSystem>Console</SubSystem>
213 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
214 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
215 </Link>
216 </ItemDefinitionGroup>
217 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
218 <ClCompile>
219 <PrecompiledHeader>NotUsing</PrecompiledHeader>
220 <CompileAsWinRT>false</CompileAsWinRT>
221 <AdditionalIncludeDirectories>..\..\timidity;..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
222 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
223 </ClCompile>
224 <Link>
225 <SubSystem>Console</SubSystem>
226 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
227 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
228 </Link>
229 </ItemDefinitionGroup>
230 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
231 <ClCompile>
232 <PrecompiledHeader>NotUsing</PrecompiledHeader>
233 <CompileAsWinRT>false</CompileAsWinRT>
234 <AdditionalIncludeDirectories>..\..\timidity;..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
235 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
236 </ClCompile>
237 <Link>
238 <SubSystem>Console</SubSystem>
239 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
240 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
241 </Link>
242 </ItemDefinitionGroup>
243 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
244 <ClCompile>
245 <PrecompiledHeader>NotUsing</PrecompiledHeader>
246 <CompileAsWinRT>false</CompileAsWinRT>
247 <AdditionalIncludeDirectories>..\..\timidity;..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
248 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
249 </ClCompile>
250 <Link>
251 <SubSystem>Console</SubSystem>
252 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
253 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
254 </Link>
255 </ItemDefinitionGroup>
256 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
257 <ClCompile>
258 <PrecompiledHeader>NotUsing</PrecompiledHeader>
259 <CompileAsWinRT>false</CompileAsWinRT>
260 <AdditionalIncludeDirectories>..\..\timidity;..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
261 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
262 </ClCompile>
263 <Link>
264 <SubSystem>Console</SubSystem>
265 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
266 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
267 </Link>
268 </ItemDefinitionGroup>
269 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
270 <ImportGroup Label="ExtensionTargets">
271 </ImportGroup>
272 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\effect_position.c" />
4 <ClCompile Include="..\..\effect_stereoreverse.c" />
5 <ClCompile Include="..\..\effects_internal.c" />
6 <ClCompile Include="..\..\load_aiff.c" />
7 <ClCompile Include="..\..\load_voc.c" />
8 <ClCompile Include="..\..\mixer.c" />
9 <ClCompile Include="..\..\music.c" />
10 <ClCompile Include="..\..\music_cmd.c" />
11 <ClCompile Include="..\..\music_flac.c" />
12 <ClCompile Include="..\..\music_fluidsynth.c" />
13 <ClCompile Include="..\..\music_mad.c" />
14 <ClCompile Include="..\..\music_mikmod.c" />
15 <ClCompile Include="..\..\music_modplug.c" />
16 <ClCompile Include="..\..\music_mpg123.c" />
17 <ClCompile Include="..\..\music_nativemidi.c" />
18 <ClCompile Include="..\..\music_ogg.c" />
19 <ClCompile Include="..\..\music_smpeg.c" />
20 <ClCompile Include="..\..\music_timidity.c" />
21 <ClCompile Include="..\..\music_wav.c" />
22 <ClCompile Include="..\..\timidity\common.c">
23 <Filter>Timidity</Filter>
24 </ClCompile>
25 <ClCompile Include="..\..\timidity\instrum.c">
26 <Filter>Timidity</Filter>
27 </ClCompile>
28 <ClCompile Include="..\..\timidity\mix.c">
29 <Filter>Timidity</Filter>
30 </ClCompile>
31 <ClCompile Include="..\..\timidity\output.c">
32 <Filter>Timidity</Filter>
33 </ClCompile>
34 <ClCompile Include="..\..\timidity\playmidi.c">
35 <Filter>Timidity</Filter>
36 </ClCompile>
37 <ClCompile Include="..\..\timidity\readmidi.c">
38 <Filter>Timidity</Filter>
39 </ClCompile>
40 <ClCompile Include="..\..\timidity\resample.c">
41 <Filter>Timidity</Filter>
42 </ClCompile>
43 <ClCompile Include="..\..\timidity\tables.c">
44 <Filter>Timidity</Filter>
45 </ClCompile>
46 <ClCompile Include="..\..\timidity\timidity.c">
47 <Filter>Timidity</Filter>
48 </ClCompile>
49 </ItemGroup>
50 <ItemGroup>
51 <ClInclude Include="..\..\SDL_mixer.h" />
52 <ClInclude Include="..\..\timidity\common.h">
53 <Filter>Timidity</Filter>
54 </ClInclude>
55 <ClInclude Include="..\..\timidity\instrum.h">
56 <Filter>Timidity</Filter>
57 </ClInclude>
58 <ClInclude Include="..\..\timidity\mix.h">
59 <Filter>Timidity</Filter>
60 </ClInclude>
61 <ClInclude Include="..\..\timidity\options.h">
62 <Filter>Timidity</Filter>
63 </ClInclude>
64 <ClInclude Include="..\..\timidity\output.h">
65 <Filter>Timidity</Filter>
66 </ClInclude>
67 <ClInclude Include="..\..\timidity\playmidi.h">
68 <Filter>Timidity</Filter>
69 </ClInclude>
70 <ClInclude Include="..\..\timidity\readmidi.h">
71 <Filter>Timidity</Filter>
72 </ClInclude>
73 <ClInclude Include="..\..\timidity\resample.h">
74 <Filter>Timidity</Filter>
75 </ClInclude>
76 <ClInclude Include="..\..\timidity\tables.h">
77 <Filter>Timidity</Filter>
78 </ClInclude>
79 <ClInclude Include="..\..\timidity\timidity.h">
80 <Filter>Timidity</Filter>
81 </ClInclude>
82 </ItemGroup>
83 <ItemGroup>
84 <Filter Include="Timidity">
85 <UniqueIdentifier>{660dbe57-4c07-417e-9609-12b312726942}</UniqueIdentifier>
86 </Filter>
87 </ItemGroup>
88 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <ItemGroup>
29 <ClCompile Include="..\..\external\libogg-1.3.2\src\bitwise.c" />
30 <ClCompile Include="..\..\external\libogg-1.3.2\src\framing.c" />
31 </ItemGroup>
32 <ItemGroup>
33 <None Include="..\..\external\libogg-1.3.2\win32\ogg.def" />
34 </ItemGroup>
35 <ItemGroup>
36 <ClInclude Include="..\..\external\libogg-1.3.2\include\ogg\ogg.h" />
37 <ClInclude Include="..\..\external\libogg-1.3.2\include\ogg\os_types.h" />
38 </ItemGroup>
39 <PropertyGroup Label="Globals">
40 <ProjectGuid>{b14f8b7f-c9ff-4fd3-b328-7c68ab801e85}</ProjectGuid>
41 <Keyword>DynamicLibrary</Keyword>
42 <ProjectName>libogg_dynamic-UWP</ProjectName>
43 <RootNamespace>libogg_dynamic_UWP</RootNamespace>
44 <DefaultLanguage>en-US</DefaultLanguage>
45 <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
46 <AppContainerApplication>true</AppContainerApplication>
47 <ApplicationType>Windows Store</ApplicationType>
48 <ApplicationTypeRevision>8.2</ApplicationTypeRevision>
49 <TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
50 <TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
51 <WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
52 <WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
53 </PropertyGroup>
54 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
55 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
56 <ConfigurationType>DynamicLibrary</ConfigurationType>
57 <UseDebugLibraries>true</UseDebugLibraries>
58 <PlatformToolset>v140</PlatformToolset>
59 </PropertyGroup>
60 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
61 <ConfigurationType>DynamicLibrary</ConfigurationType>
62 <UseDebugLibraries>true</UseDebugLibraries>
63 <PlatformToolset>v140</PlatformToolset>
64 </PropertyGroup>
65 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
66 <ConfigurationType>DynamicLibrary</ConfigurationType>
67 <UseDebugLibraries>true</UseDebugLibraries>
68 <PlatformToolset>v140</PlatformToolset>
69 </PropertyGroup>
70 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
71 <ConfigurationType>DynamicLibrary</ConfigurationType>
72 <UseDebugLibraries>false</UseDebugLibraries>
73 <WholeProgramOptimization>true</WholeProgramOptimization>
74 <PlatformToolset>v140</PlatformToolset>
75 </PropertyGroup>
76 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
77 <ConfigurationType>DynamicLibrary</ConfigurationType>
78 <UseDebugLibraries>false</UseDebugLibraries>
79 <WholeProgramOptimization>true</WholeProgramOptimization>
80 <PlatformToolset>v140</PlatformToolset>
81 </PropertyGroup>
82 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
83 <ConfigurationType>DynamicLibrary</ConfigurationType>
84 <UseDebugLibraries>false</UseDebugLibraries>
85 <WholeProgramOptimization>true</WholeProgramOptimization>
86 <PlatformToolset>v140</PlatformToolset>
87 </PropertyGroup>
88 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
89 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
90 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
91 </ImportGroup>
92 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
93 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
94 </ImportGroup>
95 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
96 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
97 </ImportGroup>
98 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
99 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
100 </ImportGroup>
101 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
102 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
103 </ImportGroup>
104 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
105 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
106 </ImportGroup>
107 <PropertyGroup Label="UserMacros" />
108 <PropertyGroup />
109 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
110 <GenerateManifest>false</GenerateManifest>
111 <IgnoreImportLibrary>false</IgnoreImportLibrary>
112 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
113 <TargetName>libogg</TargetName>
114 </PropertyGroup>
115 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
116 <GenerateManifest>false</GenerateManifest>
117 <IgnoreImportLibrary>false</IgnoreImportLibrary>
118 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
119 <TargetName>libogg</TargetName>
120 </PropertyGroup>
121 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
122 <GenerateManifest>false</GenerateManifest>
123 <IgnoreImportLibrary>false</IgnoreImportLibrary>
124 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
125 <TargetName>libogg</TargetName>
126 </PropertyGroup>
127 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
128 <GenerateManifest>false</GenerateManifest>
129 <IgnoreImportLibrary>false</IgnoreImportLibrary>
130 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
131 <TargetName>libogg</TargetName>
132 </PropertyGroup>
133 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
134 <GenerateManifest>false</GenerateManifest>
135 <IgnoreImportLibrary>false</IgnoreImportLibrary>
136 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
137 <TargetName>libogg</TargetName>
138 </PropertyGroup>
139 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
140 <GenerateManifest>false</GenerateManifest>
141 <IgnoreImportLibrary>false</IgnoreImportLibrary>
142 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
143 <TargetName>libogg</TargetName>
144 </PropertyGroup>
145 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
146 <ClCompile>
147 <PrecompiledHeader>NotUsing</PrecompiledHeader>
148 <CompileAsWinRT>false</CompileAsWinRT>
149 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
150 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
151 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
152 </ClCompile>
153 <Link>
154 <SubSystem>Console</SubSystem>
155 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
156 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
157 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
158 </Link>
159 </ItemDefinitionGroup>
160 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
161 <ClCompile>
162 <PrecompiledHeader>NotUsing</PrecompiledHeader>
163 <CompileAsWinRT>false</CompileAsWinRT>
164 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
165 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
166 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
167 </ClCompile>
168 <Link>
169 <SubSystem>Console</SubSystem>
170 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
171 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
172 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
173 </Link>
174 </ItemDefinitionGroup>
175 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
176 <ClCompile>
177 <PrecompiledHeader>NotUsing</PrecompiledHeader>
178 <CompileAsWinRT>false</CompileAsWinRT>
179 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
180 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
181 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
182 </ClCompile>
183 <Link>
184 <SubSystem>Console</SubSystem>
185 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
186 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
187 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
188 </Link>
189 </ItemDefinitionGroup>
190 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
191 <ClCompile>
192 <PrecompiledHeader>NotUsing</PrecompiledHeader>
193 <CompileAsWinRT>false</CompileAsWinRT>
194 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
195 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
196 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
197 </ClCompile>
198 <Link>
199 <SubSystem>Console</SubSystem>
200 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
201 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
202 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
203 </Link>
204 </ItemDefinitionGroup>
205 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
206 <ClCompile>
207 <PrecompiledHeader>NotUsing</PrecompiledHeader>
208 <CompileAsWinRT>false</CompileAsWinRT>
209 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
210 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
211 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
212 </ClCompile>
213 <Link>
214 <SubSystem>Console</SubSystem>
215 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
216 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
217 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
218 </Link>
219 </ItemDefinitionGroup>
220 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
221 <ClCompile>
222 <PrecompiledHeader>NotUsing</PrecompiledHeader>
223 <CompileAsWinRT>false</CompileAsWinRT>
224 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
225 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
226 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
227 </ClCompile>
228 <Link>
229 <SubSystem>Console</SubSystem>
230 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
231 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
232 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
233 </Link>
234 </ItemDefinitionGroup>
235 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
236 <ImportGroup Label="ExtensionTargets">
237 </ImportGroup>
238 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libogg-1.3.1\src\bitwise.c" />
4 <ClCompile Include="..\..\external\libogg-1.3.1\src\framing.c" />
5 </ItemGroup>
6 <ItemGroup>
7 <None Include="..\..\external\libogg-1.3.1\win32\ogg.def" />
8 </ItemGroup>
9 <ItemGroup>
10 <ClInclude Include="..\..\external\libogg-1.3.1\include\ogg\ogg.h" />
11 <ClInclude Include="..\..\external\libogg-1.3.1\include\ogg\os_types.h" />
12 </ItemGroup>
13 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <ItemGroup>
29 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\analysis.c" />
30 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\bitrate.c" />
31 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\block.c" />
32 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\codebook.c" />
33 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\envelope.c" />
34 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\floor0.c" />
35 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\floor1.c" />
36 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\info.c" />
37 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lookup.c" />
38 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lpc.c" />
39 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lsp.c" />
40 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\mapping0.c" />
41 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\mdct.c" />
42 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\psy.c" />
43 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\registry.c" />
44 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\res0.c" />
45 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\sharedbook.c" />
46 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\smallft.c" />
47 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\synthesis.c" />
48 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\vorbisenc.c" />
49 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\window.c" />
50 </ItemGroup>
51 <ItemGroup>
52 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\codec.h" />
53 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisenc.h" />
54 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisfile.h" />
55 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\backends.h" />
56 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\bitrate.h" />
57 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\coupled\res_books_stereo.h" />
58 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\floor\floor_books.h" />
59 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\uncoupled\res_books_uncoupled.h" />
60 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\codebook.h" />
61 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\codec_internal.h" />
62 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\envelope.h" />
63 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\highlevel.h" />
64 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lookup.h" />
65 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lookup_data.h" />
66 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lpc.h" />
67 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lsp.h" />
68 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\masking.h" />
69 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\mdct.h" />
70 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\misc.h" />
71 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\floor_all.h" />
72 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_11.h" />
73 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_16.h" />
74 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_44.h" />
75 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_8.h" />
76 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_16.h" />
77 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_44.h" />
78 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_44u.h" />
79 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_8.h" />
80 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_11.h" />
81 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_16.h" />
82 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_22.h" />
83 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_32.h" />
84 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_44.h" />
85 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_44u.h" />
86 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_8.h" />
87 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_X.h" />
88 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\os.h" />
89 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\psy.h" />
90 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\registry.h" />
91 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\scales.h" />
92 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\smallft.h" />
93 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\window.h" />
94 </ItemGroup>
95 <ItemGroup>
96 <None Include="..\..\external\libvorbis-1.3.5\win32\vorbis.def" />
97 </ItemGroup>
98 <ItemGroup>
99 <ProjectReference Include="libogg_dynamic-UWP.vcxproj">
100 <Project>{b14f8b7f-c9ff-4fd3-b328-7c68ab801e85}</Project>
101 </ProjectReference>
102 </ItemGroup>
103 <PropertyGroup Label="Globals">
104 <ProjectGuid>{6b6c1f59-6a82-4097-8907-04df5c95d014}</ProjectGuid>
105 <Keyword>Win32Proj</Keyword>
106 <ProjectName>libvorbis_dynamic-UWP</ProjectName>
107 <RootNamespace>libvorbis_dynamic_UWP</RootNamespace>
108 <DefaultLanguage>en-US</DefaultLanguage>
109 <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
110 <AppContainerApplication>true</AppContainerApplication>
111 <ApplicationType>Windows Store</ApplicationType>
112 <ApplicationTypeRevision>8.1</ApplicationTypeRevision>
113 <TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
114 <TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
115 <WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
116 <WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
117 </PropertyGroup>
118 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
119 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
120 <ConfigurationType>DynamicLibrary</ConfigurationType>
121 <UseDebugLibraries>true</UseDebugLibraries>
122 <PlatformToolset>v140</PlatformToolset>
123 </PropertyGroup>
124 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
125 <ConfigurationType>DynamicLibrary</ConfigurationType>
126 <UseDebugLibraries>true</UseDebugLibraries>
127 <PlatformToolset>v140</PlatformToolset>
128 </PropertyGroup>
129 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
130 <ConfigurationType>DynamicLibrary</ConfigurationType>
131 <UseDebugLibraries>true</UseDebugLibraries>
132 <PlatformToolset>v140</PlatformToolset>
133 </PropertyGroup>
134 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
135 <ConfigurationType>DynamicLibrary</ConfigurationType>
136 <UseDebugLibraries>false</UseDebugLibraries>
137 <WholeProgramOptimization>true</WholeProgramOptimization>
138 <PlatformToolset>v140</PlatformToolset>
139 </PropertyGroup>
140 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
141 <ConfigurationType>DynamicLibrary</ConfigurationType>
142 <UseDebugLibraries>false</UseDebugLibraries>
143 <WholeProgramOptimization>true</WholeProgramOptimization>
144 <PlatformToolset>v140</PlatformToolset>
145 </PropertyGroup>
146 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
147 <ConfigurationType>DynamicLibrary</ConfigurationType>
148 <UseDebugLibraries>false</UseDebugLibraries>
149 <WholeProgramOptimization>true</WholeProgramOptimization>
150 <PlatformToolset>v140</PlatformToolset>
151 </PropertyGroup>
152 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
153 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
154 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
155 </ImportGroup>
156 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
157 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
158 </ImportGroup>
159 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
160 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
161 </ImportGroup>
162 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
163 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
164 </ImportGroup>
165 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
166 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
167 </ImportGroup>
168 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
169 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
170 </ImportGroup>
171 <PropertyGroup Label="UserMacros" />
172 <PropertyGroup />
173 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
174 <GenerateManifest>false</GenerateManifest>
175 <IgnoreImportLibrary>false</IgnoreImportLibrary>
176 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
177 <TargetName>libvorbis</TargetName>
178 </PropertyGroup>
179 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
180 <GenerateManifest>false</GenerateManifest>
181 <IgnoreImportLibrary>false</IgnoreImportLibrary>
182 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
183 <TargetName>libvorbis</TargetName>
184 </PropertyGroup>
185 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
186 <GenerateManifest>false</GenerateManifest>
187 <IgnoreImportLibrary>false</IgnoreImportLibrary>
188 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
189 <TargetName>libvorbis</TargetName>
190 </PropertyGroup>
191 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
192 <GenerateManifest>false</GenerateManifest>
193 <IgnoreImportLibrary>false</IgnoreImportLibrary>
194 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
195 <TargetName>libvorbis</TargetName>
196 </PropertyGroup>
197 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
198 <GenerateManifest>false</GenerateManifest>
199 <IgnoreImportLibrary>false</IgnoreImportLibrary>
200 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
201 <TargetName>libvorbis</TargetName>
202 </PropertyGroup>
203 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
204 <GenerateManifest>false</GenerateManifest>
205 <IgnoreImportLibrary>false</IgnoreImportLibrary>
206 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
207 <TargetName>libvorbis</TargetName>
208 </PropertyGroup>
209 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
210 <ClCompile>
211 <PrecompiledHeader>NotUsing</PrecompiledHeader>
212 <CompileAsWinRT>false</CompileAsWinRT>
213 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
214 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
215 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
216 </ClCompile>
217 <Link>
218 <SubSystem>Console</SubSystem>
219 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
220 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
221 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
222 </Link>
223 </ItemDefinitionGroup>
224 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
225 <ClCompile>
226 <PrecompiledHeader>NotUsing</PrecompiledHeader>
227 <CompileAsWinRT>false</CompileAsWinRT>
228 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
229 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
230 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
231 </ClCompile>
232 <Link>
233 <SubSystem>Console</SubSystem>
234 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
235 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
236 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
237 </Link>
238 </ItemDefinitionGroup>
239 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
240 <ClCompile>
241 <PrecompiledHeader>NotUsing</PrecompiledHeader>
242 <CompileAsWinRT>false</CompileAsWinRT>
243 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
244 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
245 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
246 </ClCompile>
247 <Link>
248 <SubSystem>Console</SubSystem>
249 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
250 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
251 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
252 </Link>
253 </ItemDefinitionGroup>
254 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
255 <ClCompile>
256 <PrecompiledHeader>NotUsing</PrecompiledHeader>
257 <CompileAsWinRT>false</CompileAsWinRT>
258 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
259 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
260 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
261 </ClCompile>
262 <Link>
263 <SubSystem>Console</SubSystem>
264 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
265 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
266 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
267 </Link>
268 </ItemDefinitionGroup>
269 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
270 <ClCompile>
271 <PrecompiledHeader>NotUsing</PrecompiledHeader>
272 <CompileAsWinRT>false</CompileAsWinRT>
273 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
274 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
275 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
276 </ClCompile>
277 <Link>
278 <SubSystem>Console</SubSystem>
279 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
280 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
281 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
282 </Link>
283 </ItemDefinitionGroup>
284 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
285 <ClCompile>
286 <PrecompiledHeader>NotUsing</PrecompiledHeader>
287 <CompileAsWinRT>false</CompileAsWinRT>
288 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
289 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
290 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
291 </ClCompile>
292 <Link>
293 <SubSystem>Console</SubSystem>
294 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
295 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
296 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
297 </Link>
298 </ItemDefinitionGroup>
299 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
300 <ImportGroup Label="ExtensionTargets">
301 </ImportGroup>
302 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\analysis.c" />
4 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\bitrate.c" />
5 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\block.c" />
6 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\codebook.c" />
7 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\envelope.c" />
8 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\floor0.c" />
9 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\floor1.c" />
10 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\info.c" />
11 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lookup.c" />
12 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lpc.c" />
13 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lsp.c" />
14 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\mapping0.c" />
15 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\mdct.c" />
16 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\psy.c" />
17 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\registry.c" />
18 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\res0.c" />
19 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\sharedbook.c" />
20 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\smallft.c" />
21 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\synthesis.c" />
22 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\vorbisenc.c" />
23 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\window.c" />
24 </ItemGroup>
25 <ItemGroup>
26 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\backends.h" />
27 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\bitrate.h" />
28 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\codebook.h" />
29 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\codec.h" />
30 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\codec_internal.h" />
31 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\envelope.h" />
32 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\floor_all.h" />
33 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\floor\floor_books.h" />
34 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\highlevel.h" />
35 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lookup.h" />
36 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lookup_data.h" />
37 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lpc.h" />
38 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lsp.h" />
39 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\masking.h" />
40 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\mdct.h" />
41 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\misc.h" />
42 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\os.h" />
43 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\psy.h" />
44 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_8.h" />
45 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_11.h" />
46 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_16.h" />
47 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_44.h" />
48 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\registry.h" />
49 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\coupled\res_books_stereo.h" />
50 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\uncoupled\res_books_uncoupled.h" />
51 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_8.h" />
52 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_16.h" />
53 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_44.h" />
54 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_44u.h" />
55 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\scales.h" />
56 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_8.h" />
57 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_11.h" />
58 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_16.h" />
59 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_22.h" />
60 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_32.h" />
61 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_44.h" />
62 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_44u.h" />
63 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_X.h" />
64 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\smallft.h" />
65 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisenc.h" />
66 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisfile.h" />
67 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\window.h" />
68 </ItemGroup>
69 <ItemGroup>
70 <None Include="..\..\external\libvorbis-1.3.3\win32\vorbis.def" />
71 </ItemGroup>
72 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <ItemGroup>
29 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\vorbisfile.c" />
30 </ItemGroup>
31 <ItemGroup>
32 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisfile.h" />
33 </ItemGroup>
34 <ItemGroup>
35 <ProjectReference Include="libogg_dynamic-UWP.vcxproj">
36 <Project>{b14f8b7f-c9ff-4fd3-b328-7c68ab801e85}</Project>
37 </ProjectReference>
38 <ProjectReference Include="libvorbis_dynamic-UWP.vcxproj">
39 <Project>{6b6c1f59-6a82-4097-8907-04df5c95d014}</Project>
40 </ProjectReference>
41 </ItemGroup>
42 <PropertyGroup Label="Globals">
43 <ProjectGuid>{70ef3b8f-6aaf-401b-9818-3371e950e73c}</ProjectGuid>
44 <Keyword>DynamicLibrary</Keyword>
45 <ProjectName>libvorbisfile_dynamic-UWP</ProjectName>
46 <RootNamespace>libvorbisfile_dynamic_UWP</RootNamespace>
47 <DefaultLanguage>en-US</DefaultLanguage>
48 <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
49 <AppContainerApplication>true</AppContainerApplication>
50 <ApplicationType>Windows Store</ApplicationType>
51 <ApplicationTypeRevision>8.2</ApplicationTypeRevision>
52 <TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
53 <TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
54 <WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
55 <WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
56 </PropertyGroup>
57 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
58 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
59 <ConfigurationType>DynamicLibrary</ConfigurationType>
60 <UseDebugLibraries>true</UseDebugLibraries>
61 <PlatformToolset>v140</PlatformToolset>
62 </PropertyGroup>
63 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
64 <ConfigurationType>DynamicLibrary</ConfigurationType>
65 <UseDebugLibraries>true</UseDebugLibraries>
66 <PlatformToolset>v140</PlatformToolset>
67 </PropertyGroup>
68 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
69 <ConfigurationType>DynamicLibrary</ConfigurationType>
70 <UseDebugLibraries>true</UseDebugLibraries>
71 <PlatformToolset>v140</PlatformToolset>
72 </PropertyGroup>
73 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
74 <ConfigurationType>DynamicLibrary</ConfigurationType>
75 <UseDebugLibraries>false</UseDebugLibraries>
76 <WholeProgramOptimization>true</WholeProgramOptimization>
77 <PlatformToolset>v140</PlatformToolset>
78 </PropertyGroup>
79 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
80 <ConfigurationType>DynamicLibrary</ConfigurationType>
81 <UseDebugLibraries>false</UseDebugLibraries>
82 <WholeProgramOptimization>true</WholeProgramOptimization>
83 <PlatformToolset>v140</PlatformToolset>
84 </PropertyGroup>
85 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
86 <ConfigurationType>DynamicLibrary</ConfigurationType>
87 <UseDebugLibraries>false</UseDebugLibraries>
88 <WholeProgramOptimization>true</WholeProgramOptimization>
89 <PlatformToolset>v140</PlatformToolset>
90 </PropertyGroup>
91 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
92 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
93 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
94 </ImportGroup>
95 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
96 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
97 </ImportGroup>
98 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
99 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
100 </ImportGroup>
101 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
102 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
103 </ImportGroup>
104 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
105 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
106 </ImportGroup>
107 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
108 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
109 </ImportGroup>
110 <PropertyGroup Label="UserMacros" />
111 <PropertyGroup />
112 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
113 <GenerateManifest>false</GenerateManifest>
114 <IgnoreImportLibrary>false</IgnoreImportLibrary>
115 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
116 <TargetName>libvorbisfile</TargetName>
117 </PropertyGroup>
118 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
119 <GenerateManifest>false</GenerateManifest>
120 <IgnoreImportLibrary>false</IgnoreImportLibrary>
121 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
122 <TargetName>libvorbisfile</TargetName>
123 </PropertyGroup>
124 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
125 <GenerateManifest>false</GenerateManifest>
126 <IgnoreImportLibrary>false</IgnoreImportLibrary>
127 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
128 <TargetName>libvorbisfile</TargetName>
129 </PropertyGroup>
130 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
131 <GenerateManifest>false</GenerateManifest>
132 <IgnoreImportLibrary>false</IgnoreImportLibrary>
133 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
134 <TargetName>libvorbisfile</TargetName>
135 </PropertyGroup>
136 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
137 <GenerateManifest>false</GenerateManifest>
138 <IgnoreImportLibrary>false</IgnoreImportLibrary>
139 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
140 <TargetName>libvorbisfile</TargetName>
141 </PropertyGroup>
142 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
143 <GenerateManifest>false</GenerateManifest>
144 <IgnoreImportLibrary>false</IgnoreImportLibrary>
145 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
146 <TargetName>libvorbisfile</TargetName>
147 </PropertyGroup>
148 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
149 <ClCompile>
150 <PrecompiledHeader>NotUsing</PrecompiledHeader>
151 <CompileAsWinRT>false</CompileAsWinRT>
152 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
153 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
154 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
155 </ClCompile>
156 <Link>
157 <SubSystem>Console</SubSystem>
158 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
159 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
160 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
161 </Link>
162 </ItemDefinitionGroup>
163 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
164 <ClCompile>
165 <PrecompiledHeader>NotUsing</PrecompiledHeader>
166 <CompileAsWinRT>false</CompileAsWinRT>
167 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
168 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
169 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
170 </ClCompile>
171 <Link>
172 <SubSystem>Console</SubSystem>
173 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
174 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
175 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
176 </Link>
177 </ItemDefinitionGroup>
178 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
179 <ClCompile>
180 <PrecompiledHeader>NotUsing</PrecompiledHeader>
181 <CompileAsWinRT>false</CompileAsWinRT>
182 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
183 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
184 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
185 </ClCompile>
186 <Link>
187 <SubSystem>Console</SubSystem>
188 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
189 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
190 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
191 </Link>
192 </ItemDefinitionGroup>
193 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
194 <ClCompile>
195 <PrecompiledHeader>NotUsing</PrecompiledHeader>
196 <CompileAsWinRT>false</CompileAsWinRT>
197 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
198 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
199 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
200 </ClCompile>
201 <Link>
202 <SubSystem>Console</SubSystem>
203 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
204 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
205 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
206 </Link>
207 </ItemDefinitionGroup>
208 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
209 <ClCompile>
210 <PrecompiledHeader>NotUsing</PrecompiledHeader>
211 <CompileAsWinRT>false</CompileAsWinRT>
212 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
213 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
214 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
215 </ClCompile>
216 <Link>
217 <SubSystem>Console</SubSystem>
218 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
219 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
220 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
221 </Link>
222 </ItemDefinitionGroup>
223 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
224 <ClCompile>
225 <PrecompiledHeader>NotUsing</PrecompiledHeader>
226 <CompileAsWinRT>false</CompileAsWinRT>
227 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
228 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
229 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
230 </ClCompile>
231 <Link>
232 <SubSystem>Console</SubSystem>
233 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
234 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
235 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
236 </Link>
237 </ItemDefinitionGroup>
238 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
239 <ImportGroup Label="ExtensionTargets">
240 </ImportGroup>
241 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\vorbisfile.c" />
4 </ItemGroup>
5 <ItemGroup>
6 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisfile.h" />
7 </ItemGroup>
8 </Project>
0 
1 Microsoft Visual Studio Solution File, Format Version 12.00
2 # Visual Studio 2012
3 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2_mixer-WinPhone80", "SDL_mixer-WinPhone80.vcxproj", "{1F710837-D5C0-4E7F-ABEA-FBFF64722E7E}"
4 EndProject
5 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libogg_dynamic-WinPhone80", "libogg_dynamic-WinPhone80.vcxproj", "{DDB6F9C3-25D1-43C1-B439-20F2016D2F2E}"
6 EndProject
7 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbis_dynamic-WinPhone80", "libvorbis_dynamic-WinPhone80.vcxproj", "{8859E555-5684-436D-AD14-4E8CEB11EAD1}"
8 EndProject
9 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbisfile_dynamic-WinPhone80", "libvorbisfile_dynamic-WinPhone80.vcxproj", "{E1553EFC-2C62-41AE-ABA3-D933D66D435D}"
10 EndProject
11 Global
12 GlobalSection(SolutionConfigurationPlatforms) = preSolution
13 Debug|ARM = Debug|ARM
14 Debug|Win32 = Debug|Win32
15 Release|ARM = Release|ARM
16 Release|Win32 = Release|Win32
17 EndGlobalSection
18 GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 {1F710837-D5C0-4E7F-ABEA-FBFF64722E7E}.Debug|ARM.ActiveCfg = Debug|ARM
20 {1F710837-D5C0-4E7F-ABEA-FBFF64722E7E}.Debug|ARM.Build.0 = Debug|ARM
21 {1F710837-D5C0-4E7F-ABEA-FBFF64722E7E}.Debug|Win32.ActiveCfg = Debug|Win32
22 {1F710837-D5C0-4E7F-ABEA-FBFF64722E7E}.Debug|Win32.Build.0 = Debug|Win32
23 {1F710837-D5C0-4E7F-ABEA-FBFF64722E7E}.Release|ARM.ActiveCfg = Release|ARM
24 {1F710837-D5C0-4E7F-ABEA-FBFF64722E7E}.Release|ARM.Build.0 = Release|ARM
25 {1F710837-D5C0-4E7F-ABEA-FBFF64722E7E}.Release|Win32.ActiveCfg = Release|Win32
26 {1F710837-D5C0-4E7F-ABEA-FBFF64722E7E}.Release|Win32.Build.0 = Release|Win32
27 {DDB6F9C3-25D1-43C1-B439-20F2016D2F2E}.Debug|ARM.ActiveCfg = Debug|ARM
28 {DDB6F9C3-25D1-43C1-B439-20F2016D2F2E}.Debug|ARM.Build.0 = Debug|ARM
29 {DDB6F9C3-25D1-43C1-B439-20F2016D2F2E}.Debug|Win32.ActiveCfg = Debug|Win32
30 {DDB6F9C3-25D1-43C1-B439-20F2016D2F2E}.Debug|Win32.Build.0 = Debug|Win32
31 {DDB6F9C3-25D1-43C1-B439-20F2016D2F2E}.Release|ARM.ActiveCfg = Release|ARM
32 {DDB6F9C3-25D1-43C1-B439-20F2016D2F2E}.Release|ARM.Build.0 = Release|ARM
33 {DDB6F9C3-25D1-43C1-B439-20F2016D2F2E}.Release|Win32.ActiveCfg = Release|Win32
34 {DDB6F9C3-25D1-43C1-B439-20F2016D2F2E}.Release|Win32.Build.0 = Release|Win32
35 {8859E555-5684-436D-AD14-4E8CEB11EAD1}.Debug|ARM.ActiveCfg = Debug|ARM
36 {8859E555-5684-436D-AD14-4E8CEB11EAD1}.Debug|ARM.Build.0 = Debug|ARM
37 {8859E555-5684-436D-AD14-4E8CEB11EAD1}.Debug|Win32.ActiveCfg = Debug|Win32
38 {8859E555-5684-436D-AD14-4E8CEB11EAD1}.Debug|Win32.Build.0 = Debug|Win32
39 {8859E555-5684-436D-AD14-4E8CEB11EAD1}.Release|ARM.ActiveCfg = Release|ARM
40 {8859E555-5684-436D-AD14-4E8CEB11EAD1}.Release|ARM.Build.0 = Release|ARM
41 {8859E555-5684-436D-AD14-4E8CEB11EAD1}.Release|Win32.ActiveCfg = Release|Win32
42 {8859E555-5684-436D-AD14-4E8CEB11EAD1}.Release|Win32.Build.0 = Release|Win32
43 {E1553EFC-2C62-41AE-ABA3-D933D66D435D}.Debug|ARM.ActiveCfg = Debug|ARM
44 {E1553EFC-2C62-41AE-ABA3-D933D66D435D}.Debug|ARM.Build.0 = Debug|ARM
45 {E1553EFC-2C62-41AE-ABA3-D933D66D435D}.Debug|Win32.ActiveCfg = Debug|Win32
46 {E1553EFC-2C62-41AE-ABA3-D933D66D435D}.Debug|Win32.Build.0 = Debug|Win32
47 {E1553EFC-2C62-41AE-ABA3-D933D66D435D}.Release|ARM.ActiveCfg = Release|ARM
48 {E1553EFC-2C62-41AE-ABA3-D933D66D435D}.Release|ARM.Build.0 = Release|ARM
49 {E1553EFC-2C62-41AE-ABA3-D933D66D435D}.Release|Win32.ActiveCfg = Release|Win32
50 {E1553EFC-2C62-41AE-ABA3-D933D66D435D}.Release|Win32.Build.0 = Release|Win32
51 EndGlobalSection
52 GlobalSection(SolutionProperties) = preSolution
53 HideSolutionNode = FALSE
54 EndGlobalSection
55 EndGlobal
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|Win32">
4 <Configuration>Debug</Configuration>
5 <Platform>Win32</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|ARM">
8 <Configuration>Debug</Configuration>
9 <Platform>ARM</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Release|Win32">
12 <Configuration>Release</Configuration>
13 <Platform>Win32</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 </ItemGroup>
20 <PropertyGroup Label="Globals">
21 <ProjectGuid>{1f710837-d5c0-4e7f-abea-fbff64722e7e}</ProjectGuid>
22 <RootNamespace>SDL2_mixer_WinPhone</RootNamespace>
23 <DefaultLanguage>en-US</DefaultLanguage>
24 <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
25 <ProjectName>SDL2_mixer-WinPhone80</ProjectName>
26 </PropertyGroup>
27 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
29 <ConfigurationType>DynamicLibrary</ConfigurationType>
30 <UseDebugLibraries>true</UseDebugLibraries>
31 <PlatformToolset>v110_wp80</PlatformToolset>
32 <IgnoreImportLibrary>false</IgnoreImportLibrary>
33 </PropertyGroup>
34 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
35 <ConfigurationType>DynamicLibrary</ConfigurationType>
36 <UseDebugLibraries>true</UseDebugLibraries>
37 <PlatformToolset>v110_wp80</PlatformToolset>
38 <IgnoreImportLibrary>false</IgnoreImportLibrary>
39 </PropertyGroup>
40 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
41 <ConfigurationType>DynamicLibrary</ConfigurationType>
42 <UseDebugLibraries>false</UseDebugLibraries>
43 <WholeProgramOptimization>true</WholeProgramOptimization>
44 <PlatformToolset>v110_wp80</PlatformToolset>
45 <IgnoreImportLibrary>false</IgnoreImportLibrary>
46 </PropertyGroup>
47 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
48 <ConfigurationType>DynamicLibrary</ConfigurationType>
49 <UseDebugLibraries>false</UseDebugLibraries>
50 <WholeProgramOptimization>true</WholeProgramOptimization>
51 <PlatformToolset>v110_wp80</PlatformToolset>
52 <IgnoreImportLibrary>false</IgnoreImportLibrary>
53 </PropertyGroup>
54 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
55 <ImportGroup Label="PropertySheets">
56 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
57 </ImportGroup>
58 <PropertyGroup Label="UserMacros" />
59 <PropertyGroup>
60 <GenerateManifest>false</GenerateManifest>
61 </PropertyGroup>
62 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
63 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
64 <TargetName>SDL2_mixer</TargetName>
65 </PropertyGroup>
66 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
67 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
68 <TargetName>SDL2_mixer</TargetName>
69 </PropertyGroup>
70 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
71 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
72 <TargetName>SDL2_mixer</TargetName>
73 </PropertyGroup>
74 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
75 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
76 <TargetName>SDL2_mixer</TargetName>
77 </PropertyGroup>
78 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
79 <ClCompile>
80 <PreprocessorDefinitions>_USRDLL;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
81 <PrecompiledHeader>NotUsing</PrecompiledHeader>
82 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
83 <CompileAsWinRT>false</CompileAsWinRT>
84 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
85 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include</AdditionalIncludeDirectories>
86 </ClCompile>
87 <Link>
88 <SubSystem>Console</SubSystem>
89 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
90 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
91 <GenerateDebugInformation>true</GenerateDebugInformation>
92 </Link>
93 </ItemDefinitionGroup>
94 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
95 <ClCompile>
96 <PreprocessorDefinitions>_USRDLL;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
97 <PrecompiledHeader>NotUsing</PrecompiledHeader>
98 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
99 <CompileAsWinRT>false</CompileAsWinRT>
100 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
101 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include</AdditionalIncludeDirectories>
102 </ClCompile>
103 <Link>
104 <SubSystem>Console</SubSystem>
105 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
106 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
107 <GenerateDebugInformation>true</GenerateDebugInformation>
108 </Link>
109 </ItemDefinitionGroup>
110 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
111 <ClCompile>
112 <PreprocessorDefinitions>_USRDLL;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
113 <PrecompiledHeader>NotUsing</PrecompiledHeader>
114 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
115 <CompileAsWinRT>false</CompileAsWinRT>
116 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
117 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include</AdditionalIncludeDirectories>
118 </ClCompile>
119 <Link>
120 <SubSystem>Console</SubSystem>
121 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
122 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
123 <GenerateDebugInformation>true</GenerateDebugInformation>
124 </Link>
125 </ItemDefinitionGroup>
126 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
127 <ClCompile>
128 <PreprocessorDefinitions>_USRDLL;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
129 <PrecompiledHeader>NotUsing</PrecompiledHeader>
130 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
131 <CompileAsWinRT>false</CompileAsWinRT>
132 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
133 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include</AdditionalIncludeDirectories>
134 </ClCompile>
135 <Link>
136 <SubSystem>Console</SubSystem>
137 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
138 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
139 <GenerateDebugInformation>true</GenerateDebugInformation>
140 </Link>
141 </ItemDefinitionGroup>
142 <ItemGroup>
143 <Reference Include="Windows">
144 <IsWinMDFile>true</IsWinMDFile>
145 </Reference>
146 <Reference Include="platform.winmd">
147 <IsWinMDFile>true</IsWinMDFile>
148 <Private>false</Private>
149 </Reference>
150 </ItemGroup>
151 <ItemGroup>
152 <ProjectReference Include="..\..\..\SDL\VisualC-WinRT\WinPhone80_VS2012\SDL-WinPhone80.vcxproj">
153 <Project>{33048af1-031a-4ce6-b61e-fad2db832e9e}</Project>
154 </ProjectReference>
155 <ProjectReference Include="libogg_dynamic-WinPhone80.vcxproj">
156 <Project>{ddb6f9c3-25d1-43c1-b439-20f2016d2f2e}</Project>
157 </ProjectReference>
158 <ProjectReference Include="libvorbisfile_dynamic-WinPhone80.vcxproj">
159 <Project>{e1553efc-2c62-41ae-aba3-d933d66d435d}</Project>
160 </ProjectReference>
161 <ProjectReference Include="libvorbis_dynamic-WinPhone80.vcxproj">
162 <Project>{8859e555-5684-436d-ad14-4e8ceb11ead1}</Project>
163 </ProjectReference>
164 </ItemGroup>
165 <ItemGroup>
166 <ClCompile Include="..\..\effects_internal.c" />
167 <ClCompile Include="..\..\effect_position.c" />
168 <ClCompile Include="..\..\effect_stereoreverse.c" />
169 <ClCompile Include="..\..\load_aiff.c" />
170 <ClCompile Include="..\..\load_voc.c" />
171 <ClCompile Include="..\..\mixer.c" />
172 <ClCompile Include="..\..\music.c" />
173 <ClCompile Include="..\..\music_cmd.c" />
174 <ClCompile Include="..\..\music_flac.c" />
175 <ClCompile Include="..\..\music_fluidsynth.c" />
176 <ClCompile Include="..\..\music_mad.c" />
177 <ClCompile Include="..\..\music_mikmod.c" />
178 <ClCompile Include="..\..\music_modplug.c" />
179 <ClCompile Include="..\..\music_mpg123.c" />
180 <ClCompile Include="..\..\music_nativemidi.c" />
181 <ClCompile Include="..\..\music_ogg.c" />
182 <ClCompile Include="..\..\music_smpeg.c" />
183 <ClCompile Include="..\..\music_timidity.c" />
184 <ClCompile Include="..\..\music_wav.c" />
185 <ClCompile Include="..\..\timidity\common.c" />
186 <ClCompile Include="..\..\timidity\instrum.c" />
187 <ClCompile Include="..\..\timidity\mix.c" />
188 <ClCompile Include="..\..\timidity\output.c" />
189 <ClCompile Include="..\..\timidity\playmidi.c" />
190 <ClCompile Include="..\..\timidity\readmidi.c" />
191 <ClCompile Include="..\..\timidity\resample.c" />
192 <ClCompile Include="..\..\timidity\tables.c" />
193 <ClCompile Include="..\..\timidity\timidity.c" />
194 </ItemGroup>
195 <ItemGroup>
196 <ClInclude Include="..\..\effects_internal.h" />
197 <ClInclude Include="..\..\load_aiff.h" />
198 <ClInclude Include="..\..\load_voc.h" />
199 <ClInclude Include="..\..\mixer.h" />
200 <ClInclude Include="..\..\music.h" />
201 <ClInclude Include="..\..\music_cmd.h" />
202 <ClInclude Include="..\..\music_flac.h" />
203 <ClInclude Include="..\..\music_fluidsynth.h" />
204 <ClInclude Include="..\..\music_mad.h" />
205 <ClInclude Include="..\..\music_mikmod.h" />
206 <ClInclude Include="..\..\music_modplug.h" />
207 <ClInclude Include="..\..\music_mpg123.h" />
208 <ClInclude Include="..\..\music_nativemidi.h" />
209 <ClInclude Include="..\..\music_ogg.h" />
210 <ClInclude Include="..\..\music_smpeg.h" />
211 <ClInclude Include="..\..\music_timidity.h" />
212 <ClInclude Include="..\..\music_wav.h" />
213 <ClInclude Include="..\..\SDL_mixer.h" />
214 <ClInclude Include="..\..\timidity\common.h" />
215 <ClInclude Include="..\..\timidity\instrum.h" />
216 <ClInclude Include="..\..\timidity\mix.h" />
217 <ClInclude Include="..\..\timidity\options.h" />
218 <ClInclude Include="..\..\timidity\output.h" />
219 <ClInclude Include="..\..\timidity\playmidi.h" />
220 <ClInclude Include="..\..\timidity\readmidi.h" />
221 <ClInclude Include="..\..\timidity\resample.h" />
222 <ClInclude Include="..\..\timidity\tables.h" />
223 <ClInclude Include="..\..\timidity\timidity.h" />
224 </ItemGroup>
225 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
226 <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
227 <ImportGroup Label="ExtensionTargets">
228 </ImportGroup>
229 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\effect_position.c" />
4 <ClCompile Include="..\..\effect_stereoreverse.c" />
5 <ClCompile Include="..\..\effects_internal.c" />
6 <ClCompile Include="..\..\load_aiff.c" />
7 <ClCompile Include="..\..\load_voc.c" />
8 <ClCompile Include="..\..\mixer.c" />
9 <ClCompile Include="..\..\music.c" />
10 <ClCompile Include="..\..\music_cmd.c" />
11 <ClCompile Include="..\..\music_flac.c" />
12 <ClCompile Include="..\..\music_fluidsynth.c" />
13 <ClCompile Include="..\..\music_mad.c" />
14 <ClCompile Include="..\..\music_mikmod.c" />
15 <ClCompile Include="..\..\music_modplug.c" />
16 <ClCompile Include="..\..\music_mpg123.c" />
17 <ClCompile Include="..\..\music_nativemidi.c" />
18 <ClCompile Include="..\..\music_ogg.c" />
19 <ClCompile Include="..\..\music_smpeg.c" />
20 <ClCompile Include="..\..\music_timidity.c" />
21 <ClCompile Include="..\..\music_wav.c" />
22 <ClCompile Include="..\..\timidity\common.c">
23 <Filter>Timidity</Filter>
24 </ClCompile>
25 <ClCompile Include="..\..\timidity\instrum.c">
26 <Filter>Timidity</Filter>
27 </ClCompile>
28 <ClCompile Include="..\..\timidity\mix.c">
29 <Filter>Timidity</Filter>
30 </ClCompile>
31 <ClCompile Include="..\..\timidity\output.c">
32 <Filter>Timidity</Filter>
33 </ClCompile>
34 <ClCompile Include="..\..\timidity\playmidi.c">
35 <Filter>Timidity</Filter>
36 </ClCompile>
37 <ClCompile Include="..\..\timidity\readmidi.c">
38 <Filter>Timidity</Filter>
39 </ClCompile>
40 <ClCompile Include="..\..\timidity\resample.c">
41 <Filter>Timidity</Filter>
42 </ClCompile>
43 <ClCompile Include="..\..\timidity\tables.c">
44 <Filter>Timidity</Filter>
45 </ClCompile>
46 <ClCompile Include="..\..\timidity\timidity.c">
47 <Filter>Timidity</Filter>
48 </ClCompile>
49 </ItemGroup>
50 <ItemGroup>
51 <ClInclude Include="..\..\effects_internal.h" />
52 <ClInclude Include="..\..\load_aiff.h" />
53 <ClInclude Include="..\..\load_voc.h" />
54 <ClInclude Include="..\..\mixer.h" />
55 <ClInclude Include="..\..\music.h" />
56 <ClInclude Include="..\..\music_cmd.h" />
57 <ClInclude Include="..\..\music_flac.h" />
58 <ClInclude Include="..\..\music_fluidsynth.h" />
59 <ClInclude Include="..\..\music_mad.h" />
60 <ClInclude Include="..\..\music_mikmod.h" />
61 <ClInclude Include="..\..\music_modplug.h" />
62 <ClInclude Include="..\..\music_mpg123.h" />
63 <ClInclude Include="..\..\music_nativemidi.h" />
64 <ClInclude Include="..\..\music_ogg.h" />
65 <ClInclude Include="..\..\music_smpeg.h" />
66 <ClInclude Include="..\..\music_timidity.h" />
67 <ClInclude Include="..\..\music_wav.h" />
68 <ClInclude Include="..\..\SDL_mixer.h" />
69 <ClInclude Include="..\..\timidity\common.h">
70 <Filter>Timidity</Filter>
71 </ClInclude>
72 <ClInclude Include="..\..\timidity\instrum.h">
73 <Filter>Timidity</Filter>
74 </ClInclude>
75 <ClInclude Include="..\..\timidity\mix.h">
76 <Filter>Timidity</Filter>
77 </ClInclude>
78 <ClInclude Include="..\..\timidity\options.h">
79 <Filter>Timidity</Filter>
80 </ClInclude>
81 <ClInclude Include="..\..\timidity\output.h">
82 <Filter>Timidity</Filter>
83 </ClInclude>
84 <ClInclude Include="..\..\timidity\playmidi.h">
85 <Filter>Timidity</Filter>
86 </ClInclude>
87 <ClInclude Include="..\..\timidity\readmidi.h">
88 <Filter>Timidity</Filter>
89 </ClInclude>
90 <ClInclude Include="..\..\timidity\resample.h">
91 <Filter>Timidity</Filter>
92 </ClInclude>
93 <ClInclude Include="..\..\timidity\tables.h">
94 <Filter>Timidity</Filter>
95 </ClInclude>
96 <ClInclude Include="..\..\timidity\timidity.h">
97 <Filter>Timidity</Filter>
98 </ClInclude>
99 </ItemGroup>
100 <ItemGroup>
101 <Filter Include="Timidity">
102 <UniqueIdentifier>{ba754ab5-5a7c-4e3c-9a2f-a1a8cf93fa90}</UniqueIdentifier>
103 </Filter>
104 </ItemGroup>
105 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|Win32">
4 <Configuration>Debug</Configuration>
5 <Platform>Win32</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|ARM">
8 <Configuration>Debug</Configuration>
9 <Platform>ARM</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Release|Win32">
12 <Configuration>Release</Configuration>
13 <Platform>Win32</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 </ItemGroup>
20 <PropertyGroup Label="Globals">
21 <ProjectGuid>{ddb6f9c3-25d1-43c1-b439-20f2016d2f2e}</ProjectGuid>
22 <RootNamespace>libogg_WinPhone</RootNamespace>
23 <DefaultLanguage>en-US</DefaultLanguage>
24 <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
25 <ProjectName>libogg_dynamic-WinPhone80</ProjectName>
26 </PropertyGroup>
27 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
29 <ConfigurationType>DynamicLibrary</ConfigurationType>
30 <UseDebugLibraries>true</UseDebugLibraries>
31 <PlatformToolset>v110_wp80</PlatformToolset>
32 <IgnoreImportLibrary>false</IgnoreImportLibrary>
33 </PropertyGroup>
34 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
35 <ConfigurationType>DynamicLibrary</ConfigurationType>
36 <UseDebugLibraries>true</UseDebugLibraries>
37 <PlatformToolset>v110_wp80</PlatformToolset>
38 <IgnoreImportLibrary>false</IgnoreImportLibrary>
39 </PropertyGroup>
40 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
41 <ConfigurationType>DynamicLibrary</ConfigurationType>
42 <UseDebugLibraries>false</UseDebugLibraries>
43 <WholeProgramOptimization>true</WholeProgramOptimization>
44 <PlatformToolset>v110_wp80</PlatformToolset>
45 <IgnoreImportLibrary>false</IgnoreImportLibrary>
46 </PropertyGroup>
47 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
48 <ConfigurationType>DynamicLibrary</ConfigurationType>
49 <UseDebugLibraries>false</UseDebugLibraries>
50 <WholeProgramOptimization>true</WholeProgramOptimization>
51 <PlatformToolset>v110_wp80</PlatformToolset>
52 <IgnoreImportLibrary>false</IgnoreImportLibrary>
53 </PropertyGroup>
54 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
55 <ImportGroup Label="PropertySheets">
56 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
57 </ImportGroup>
58 <PropertyGroup Label="UserMacros" />
59 <PropertyGroup>
60 <GenerateManifest>false</GenerateManifest>
61 </PropertyGroup>
62 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
63 <TargetName>libogg</TargetName>
64 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
65 </PropertyGroup>
66 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
67 <TargetName>libogg</TargetName>
68 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
69 </PropertyGroup>
70 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
71 <TargetName>libogg</TargetName>
72 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
73 </PropertyGroup>
74 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
75 <TargetName>libogg</TargetName>
76 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
77 </PropertyGroup>
78 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
79 <ClCompile>
80 <PreprocessorDefinitions>_USRDLL;WIN32;_DEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
81 <PrecompiledHeader>NotUsing</PrecompiledHeader>
82 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
83 <CompileAsWinRT>false</CompileAsWinRT>
84 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
85 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
86 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
87 </ClCompile>
88 <Link>
89 <SubSystem>Console</SubSystem>
90 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
91 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
92 <GenerateDebugInformation>true</GenerateDebugInformation>
93 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
94 </Link>
95 </ItemDefinitionGroup>
96 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
97 <ClCompile>
98 <PreprocessorDefinitions>_USRDLL;WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
99 <PrecompiledHeader>NotUsing</PrecompiledHeader>
100 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
101 <CompileAsWinRT>false</CompileAsWinRT>
102 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
103 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
104 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
105 </ClCompile>
106 <Link>
107 <SubSystem>Console</SubSystem>
108 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
109 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
110 <GenerateDebugInformation>true</GenerateDebugInformation>
111 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
112 </Link>
113 </ItemDefinitionGroup>
114 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
115 <ClCompile>
116 <PreprocessorDefinitions>_USRDLL;WIN32;_DEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
117 <PrecompiledHeader>NotUsing</PrecompiledHeader>
118 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
119 <CompileAsWinRT>false</CompileAsWinRT>
120 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
121 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
122 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
123 </ClCompile>
124 <Link>
125 <SubSystem>Console</SubSystem>
126 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
127 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
128 <GenerateDebugInformation>true</GenerateDebugInformation>
129 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
130 </Link>
131 </ItemDefinitionGroup>
132 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
133 <ClCompile>
134 <PreprocessorDefinitions>_USRDLL;WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
135 <PrecompiledHeader>NotUsing</PrecompiledHeader>
136 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
137 <CompileAsWinRT>false</CompileAsWinRT>
138 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
139 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
140 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
141 </ClCompile>
142 <Link>
143 <SubSystem>Console</SubSystem>
144 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
145 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
146 <GenerateDebugInformation>true</GenerateDebugInformation>
147 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
148 </Link>
149 </ItemDefinitionGroup>
150 <ItemGroup>
151 <Reference Include="Windows">
152 <IsWinMDFile>true</IsWinMDFile>
153 </Reference>
154 <Reference Include="platform.winmd">
155 <IsWinMDFile>true</IsWinMDFile>
156 <Private>false</Private>
157 </Reference>
158 </ItemGroup>
159 <ItemGroup>
160 <ClCompile Include="..\..\external\libogg-1.3.2\src\bitwise.c" />
161 <ClCompile Include="..\..\external\libogg-1.3.2\src\framing.c" />
162 </ItemGroup>
163 <ItemGroup>
164 <None Include="..\..\external\libogg-1.3.2\win32\ogg.def" />
165 </ItemGroup>
166 <ItemGroup>
167 <ClInclude Include="..\..\external\libogg-1.3.2\include\ogg\ogg.h" />
168 <ClInclude Include="..\..\external\libogg-1.3.2\include\ogg\os_types.h" />
169 </ItemGroup>
170 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
171 <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
172 <ImportGroup Label="ExtensionTargets">
173 </ImportGroup>
174 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libogg-1.3.1\src\bitwise.c" />
4 <ClCompile Include="..\..\external\libogg-1.3.1\src\framing.c" />
5 </ItemGroup>
6 <ItemGroup>
7 <None Include="..\..\external\libogg-1.3.1\win32\ogg.def" />
8 </ItemGroup>
9 <ItemGroup>
10 <ClInclude Include="..\..\external\libogg-1.3.1\include\ogg\ogg.h" />
11 <ClInclude Include="..\..\external\libogg-1.3.1\include\ogg\os_types.h" />
12 </ItemGroup>
13 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|Win32">
4 <Configuration>Debug</Configuration>
5 <Platform>Win32</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|ARM">
8 <Configuration>Debug</Configuration>
9 <Platform>ARM</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Release|Win32">
12 <Configuration>Release</Configuration>
13 <Platform>Win32</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 </ItemGroup>
20 <PropertyGroup Label="Globals">
21 <ProjectGuid>{8859e555-5684-436d-ad14-4e8ceb11ead1}</ProjectGuid>
22 <RootNamespace>libvorbis_dynamic_WinPhone</RootNamespace>
23 <DefaultLanguage>en-US</DefaultLanguage>
24 <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
25 </PropertyGroup>
26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
28 <ConfigurationType>DynamicLibrary</ConfigurationType>
29 <UseDebugLibraries>true</UseDebugLibraries>
30 <PlatformToolset>v110_wp80</PlatformToolset>
31 <IgnoreImportLibrary>false</IgnoreImportLibrary>
32 </PropertyGroup>
33 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
34 <ConfigurationType>DynamicLibrary</ConfigurationType>
35 <UseDebugLibraries>true</UseDebugLibraries>
36 <PlatformToolset>v110_wp80</PlatformToolset>
37 <IgnoreImportLibrary>false</IgnoreImportLibrary>
38 </PropertyGroup>
39 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
40 <ConfigurationType>DynamicLibrary</ConfigurationType>
41 <UseDebugLibraries>false</UseDebugLibraries>
42 <WholeProgramOptimization>true</WholeProgramOptimization>
43 <PlatformToolset>v110_wp80</PlatformToolset>
44 <IgnoreImportLibrary>false</IgnoreImportLibrary>
45 </PropertyGroup>
46 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
47 <ConfigurationType>DynamicLibrary</ConfigurationType>
48 <UseDebugLibraries>false</UseDebugLibraries>
49 <WholeProgramOptimization>true</WholeProgramOptimization>
50 <PlatformToolset>v110_wp80</PlatformToolset>
51 <IgnoreImportLibrary>false</IgnoreImportLibrary>
52 </PropertyGroup>
53 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
54 <ImportGroup Label="PropertySheets">
55 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
56 </ImportGroup>
57 <PropertyGroup Label="UserMacros" />
58 <PropertyGroup>
59 <GenerateManifest>false</GenerateManifest>
60 </PropertyGroup>
61 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
62 <TargetName>libvorbis</TargetName>
63 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
64 </PropertyGroup>
65 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
66 <TargetName>libvorbis</TargetName>
67 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
68 </PropertyGroup>
69 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
70 <TargetName>libvorbis</TargetName>
71 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
72 </PropertyGroup>
73 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
74 <TargetName>libvorbis</TargetName>
75 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
76 </PropertyGroup>
77 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
78 <ClCompile>
79 <PreprocessorDefinitions>_USRDLL;_DEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
80 <PrecompiledHeader>NotUsing</PrecompiledHeader>
81 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
82 <CompileAsWinRT>false</CompileAsWinRT>
83 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
84 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
85 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
86 </ClCompile>
87 <Link>
88 <SubSystem>Console</SubSystem>
89 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
90 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
91 <GenerateDebugInformation>true</GenerateDebugInformation>
92 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
93 </Link>
94 </ItemDefinitionGroup>
95 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
96 <ClCompile>
97 <PreprocessorDefinitions>_USRDLL;NDEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
98 <PrecompiledHeader>NotUsing</PrecompiledHeader>
99 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
100 <CompileAsWinRT>false</CompileAsWinRT>
101 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
102 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
103 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
104 </ClCompile>
105 <Link>
106 <SubSystem>Console</SubSystem>
107 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
108 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
109 <GenerateDebugInformation>true</GenerateDebugInformation>
110 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
111 </Link>
112 </ItemDefinitionGroup>
113 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
114 <ClCompile>
115 <PreprocessorDefinitions>_USRDLL;_WIN32_WCE;_DEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
116 <PrecompiledHeader>NotUsing</PrecompiledHeader>
117 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
118 <CompileAsWinRT>false</CompileAsWinRT>
119 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
120 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
121 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
122 </ClCompile>
123 <Link>
124 <SubSystem>Console</SubSystem>
125 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
126 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
127 <GenerateDebugInformation>true</GenerateDebugInformation>
128 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
129 </Link>
130 </ItemDefinitionGroup>
131 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
132 <ClCompile>
133 <PreprocessorDefinitions>_USRDLL;_WIN32_WCE;NDEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
134 <PrecompiledHeader>NotUsing</PrecompiledHeader>
135 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
136 <CompileAsWinRT>false</CompileAsWinRT>
137 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
138 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
139 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
140 </ClCompile>
141 <Link>
142 <SubSystem>Console</SubSystem>
143 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
144 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
145 <GenerateDebugInformation>true</GenerateDebugInformation>
146 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
147 </Link>
148 </ItemDefinitionGroup>
149 <ItemGroup>
150 <Reference Include="Windows">
151 <IsWinMDFile>true</IsWinMDFile>
152 </Reference>
153 <Reference Include="platform.winmd">
154 <IsWinMDFile>true</IsWinMDFile>
155 <Private>false</Private>
156 </Reference>
157 </ItemGroup>
158 <ItemGroup>
159 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\analysis.c" />
160 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\bitrate.c" />
161 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\block.c" />
162 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\codebook.c" />
163 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\envelope.c" />
164 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\floor0.c" />
165 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\floor1.c" />
166 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\info.c" />
167 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lookup.c" />
168 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lpc.c" />
169 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lsp.c" />
170 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\mapping0.c" />
171 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\mdct.c" />
172 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\psy.c" />
173 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\registry.c" />
174 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\res0.c" />
175 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\sharedbook.c" />
176 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\smallft.c" />
177 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\synthesis.c" />
178 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\vorbisenc.c" />
179 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\window.c" />
180 </ItemGroup>
181 <ItemGroup>
182 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\codec.h" />
183 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisenc.h" />
184 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisfile.h" />
185 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\backends.h" />
186 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\bitrate.h" />
187 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\coupled\res_books_stereo.h" />
188 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\floor\floor_books.h" />
189 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\uncoupled\res_books_uncoupled.h" />
190 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\codebook.h" />
191 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\codec_internal.h" />
192 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\envelope.h" />
193 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\highlevel.h" />
194 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lookup.h" />
195 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lookup_data.h" />
196 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lpc.h" />
197 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lsp.h" />
198 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\masking.h" />
199 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\mdct.h" />
200 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\misc.h" />
201 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\floor_all.h" />
202 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_11.h" />
203 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_16.h" />
204 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_44.h" />
205 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_8.h" />
206 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_16.h" />
207 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_44.h" />
208 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_44u.h" />
209 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_8.h" />
210 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_11.h" />
211 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_16.h" />
212 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_22.h" />
213 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_32.h" />
214 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_44.h" />
215 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_44u.h" />
216 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_8.h" />
217 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_X.h" />
218 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\os.h" />
219 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\psy.h" />
220 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\registry.h" />
221 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\scales.h" />
222 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\smallft.h" />
223 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\window.h" />
224 </ItemGroup>
225 <ItemGroup>
226 <None Include="..\..\external\libvorbis-1.3.5\win32\vorbis.def" />
227 </ItemGroup>
228 <ItemGroup>
229 <ProjectReference Include="libogg_dynamic-WinPhone80.vcxproj">
230 <Project>{ddb6f9c3-25d1-43c1-b439-20f2016d2f2e}</Project>
231 </ProjectReference>
232 </ItemGroup>
233 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
234 <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
235 <ImportGroup Label="ExtensionTargets">
236 </ImportGroup>
237 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\analysis.c" />
4 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\bitrate.c" />
5 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\block.c" />
6 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\codebook.c" />
7 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\envelope.c" />
8 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\floor0.c" />
9 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\floor1.c" />
10 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\info.c" />
11 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lookup.c" />
12 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lpc.c" />
13 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lsp.c" />
14 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\mapping0.c" />
15 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\mdct.c" />
16 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\psy.c" />
17 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\registry.c" />
18 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\res0.c" />
19 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\sharedbook.c" />
20 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\smallft.c" />
21 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\synthesis.c" />
22 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\vorbisenc.c" />
23 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\window.c" />
24 </ItemGroup>
25 <ItemGroup>
26 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\backends.h" />
27 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\bitrate.h" />
28 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\codebook.h" />
29 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\codec.h" />
30 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\codec_internal.h" />
31 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\envelope.h" />
32 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\floor_all.h" />
33 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\floor\floor_books.h" />
34 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\highlevel.h" />
35 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lookup.h" />
36 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lookup_data.h" />
37 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lpc.h" />
38 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lsp.h" />
39 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\masking.h" />
40 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\mdct.h" />
41 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\misc.h" />
42 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\os.h" />
43 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\psy.h" />
44 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_11.h" />
45 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_16.h" />
46 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_44.h" />
47 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_8.h" />
48 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\registry.h" />
49 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\coupled\res_books_stereo.h" />
50 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\uncoupled\res_books_uncoupled.h" />
51 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_16.h" />
52 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_44.h" />
53 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_44u.h" />
54 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_8.h" />
55 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\scales.h" />
56 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_11.h" />
57 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_16.h" />
58 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_22.h" />
59 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_32.h" />
60 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_44.h" />
61 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_44u.h" />
62 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_8.h" />
63 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_X.h" />
64 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\smallft.h" />
65 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisenc.h" />
66 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisfile.h" />
67 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\window.h" />
68 </ItemGroup>
69 <ItemGroup>
70 <None Include="..\..\external\libvorbis-1.3.3\win32\vorbis.def" />
71 </ItemGroup>
72 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|Win32">
4 <Configuration>Debug</Configuration>
5 <Platform>Win32</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|ARM">
8 <Configuration>Debug</Configuration>
9 <Platform>ARM</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Release|Win32">
12 <Configuration>Release</Configuration>
13 <Platform>Win32</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 </ItemGroup>
20 <PropertyGroup Label="Globals">
21 <ProjectGuid>{e1553efc-2c62-41ae-aba3-d933d66d435d}</ProjectGuid>
22 <RootNamespace>libvorbisfile_dynamic_WinPhone</RootNamespace>
23 <DefaultLanguage>en-US</DefaultLanguage>
24 <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
25 </PropertyGroup>
26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
28 <ConfigurationType>DynamicLibrary</ConfigurationType>
29 <UseDebugLibraries>true</UseDebugLibraries>
30 <PlatformToolset>v110_wp80</PlatformToolset>
31 <IgnoreImportLibrary>false</IgnoreImportLibrary>
32 </PropertyGroup>
33 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
34 <ConfigurationType>DynamicLibrary</ConfigurationType>
35 <UseDebugLibraries>true</UseDebugLibraries>
36 <PlatformToolset>v110_wp80</PlatformToolset>
37 <IgnoreImportLibrary>false</IgnoreImportLibrary>
38 </PropertyGroup>
39 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
40 <ConfigurationType>DynamicLibrary</ConfigurationType>
41 <UseDebugLibraries>false</UseDebugLibraries>
42 <WholeProgramOptimization>true</WholeProgramOptimization>
43 <PlatformToolset>v110_wp80</PlatformToolset>
44 <IgnoreImportLibrary>false</IgnoreImportLibrary>
45 </PropertyGroup>
46 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
47 <ConfigurationType>DynamicLibrary</ConfigurationType>
48 <UseDebugLibraries>false</UseDebugLibraries>
49 <WholeProgramOptimization>true</WholeProgramOptimization>
50 <PlatformToolset>v110_wp80</PlatformToolset>
51 <IgnoreImportLibrary>false</IgnoreImportLibrary>
52 </PropertyGroup>
53 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
54 <ImportGroup Label="PropertySheets">
55 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
56 </ImportGroup>
57 <PropertyGroup Label="UserMacros" />
58 <PropertyGroup>
59 <GenerateManifest>false</GenerateManifest>
60 </PropertyGroup>
61 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
62 <TargetName>libvorbisfile</TargetName>
63 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
64 </PropertyGroup>
65 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
66 <TargetName>libvorbisfile</TargetName>
67 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
68 </PropertyGroup>
69 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
70 <TargetName>libvorbisfile</TargetName>
71 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
72 </PropertyGroup>
73 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
74 <TargetName>libvorbisfile</TargetName>
75 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
76 </PropertyGroup>
77 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
78 <ClCompile>
79 <PreprocessorDefinitions>_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
80 <PrecompiledHeader>NotUsing</PrecompiledHeader>
81 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
82 <CompileAsWinRT>false</CompileAsWinRT>
83 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
84 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
85 </ClCompile>
86 <Link>
87 <SubSystem>Console</SubSystem>
88 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
89 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
90 <GenerateDebugInformation>true</GenerateDebugInformation>
91 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
92 </Link>
93 </ItemDefinitionGroup>
94 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
95 <ClCompile>
96 <PreprocessorDefinitions>_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
97 <PrecompiledHeader>NotUsing</PrecompiledHeader>
98 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
99 <CompileAsWinRT>false</CompileAsWinRT>
100 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
101 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
102 </ClCompile>
103 <Link>
104 <SubSystem>Console</SubSystem>
105 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
106 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
107 <GenerateDebugInformation>true</GenerateDebugInformation>
108 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
109 </Link>
110 </ItemDefinitionGroup>
111 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
112 <ClCompile>
113 <PreprocessorDefinitions>_USRDLL;_WIN32_WCE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
114 <PrecompiledHeader>NotUsing</PrecompiledHeader>
115 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
116 <CompileAsWinRT>false</CompileAsWinRT>
117 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
118 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
119 </ClCompile>
120 <Link>
121 <SubSystem>Console</SubSystem>
122 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
123 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
124 <GenerateDebugInformation>true</GenerateDebugInformation>
125 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
126 </Link>
127 </ItemDefinitionGroup>
128 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
129 <ClCompile>
130 <PreprocessorDefinitions>_USRDLL;_WIN32_WCE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
131 <PrecompiledHeader>NotUsing</PrecompiledHeader>
132 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
133 <CompileAsWinRT>false</CompileAsWinRT>
134 <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
135 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include</AdditionalIncludeDirectories>
136 </ClCompile>
137 <Link>
138 <SubSystem>Console</SubSystem>
139 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
140 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
141 <GenerateDebugInformation>true</GenerateDebugInformation>
142 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
143 </Link>
144 </ItemDefinitionGroup>
145 <ItemGroup>
146 <Reference Include="Windows">
147 <IsWinMDFile>true</IsWinMDFile>
148 </Reference>
149 <Reference Include="platform.winmd">
150 <IsWinMDFile>true</IsWinMDFile>
151 <Private>false</Private>
152 </Reference>
153 </ItemGroup>
154 <ItemGroup>
155 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\vorbisfile.c" />
156 </ItemGroup>
157 <ItemGroup>
158 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisfile.h" />
159 </ItemGroup>
160 <ItemGroup>
161 <ProjectReference Include="libogg_dynamic-WinPhone80.vcxproj">
162 <Project>{ddb6f9c3-25d1-43c1-b439-20f2016d2f2e}</Project>
163 </ProjectReference>
164 <ProjectReference Include="libvorbis_dynamic-WinPhone80.vcxproj">
165 <Project>{8859e555-5684-436d-ad14-4e8ceb11ead1}</Project>
166 </ProjectReference>
167 </ItemGroup>
168 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
169 <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
170 <ImportGroup Label="ExtensionTargets">
171 </ImportGroup>
172 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\vorbisfile.c" />
4 </ItemGroup>
5 <ItemGroup>
6 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisfile.h" />
7 </ItemGroup>
8 </Project>
0 
1 Microsoft Visual Studio Solution File, Format Version 12.00
2 # Visual Studio 2013
3 VisualStudioVersion = 12.0.40629.0
4 MinimumVisualStudioVersion = 10.0.40219.1
5 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2_mixer-WinPhone81", "SDL_mixer-WinPhone81.vcxproj", "{FB75C3D3-D261-4575-9D17-9E88E09568BA}"
6 EndProject
7 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libogg_dynamic-WinPhone81", "libogg_dynamic-WinPhone81.vcxproj", "{0CCC2E56-E3A4-4CD7-92BA-0C6F99440753}"
8 EndProject
9 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbis_dynamic-WinPhone81", "libvorbis_dynamic-WinPhone81.vcxproj", "{C943DBC9-4EB0-4684-BE3E-334342A7EE2C}"
10 EndProject
11 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbisfile_dynamic-WinPhone81", "libvorbisfile_dynamic-WinPhone81.vcxproj", "{203EFCC5-CE11-4A75-92F4-C3DBF7609376}"
12 EndProject
13 Global
14 GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 Debug|ARM = Debug|ARM
16 Debug|Win32 = Debug|Win32
17 Release|ARM = Release|ARM
18 Release|Win32 = Release|Win32
19 EndGlobalSection
20 GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 {FB75C3D3-D261-4575-9D17-9E88E09568BA}.Debug|ARM.ActiveCfg = Debug|ARM
22 {FB75C3D3-D261-4575-9D17-9E88E09568BA}.Debug|ARM.Build.0 = Debug|ARM
23 {FB75C3D3-D261-4575-9D17-9E88E09568BA}.Debug|Win32.ActiveCfg = Debug|Win32
24 {FB75C3D3-D261-4575-9D17-9E88E09568BA}.Debug|Win32.Build.0 = Debug|Win32
25 {FB75C3D3-D261-4575-9D17-9E88E09568BA}.Release|ARM.ActiveCfg = Release|ARM
26 {FB75C3D3-D261-4575-9D17-9E88E09568BA}.Release|ARM.Build.0 = Release|ARM
27 {FB75C3D3-D261-4575-9D17-9E88E09568BA}.Release|Win32.ActiveCfg = Release|Win32
28 {FB75C3D3-D261-4575-9D17-9E88E09568BA}.Release|Win32.Build.0 = Release|Win32
29 {0CCC2E56-E3A4-4CD7-92BA-0C6F99440753}.Debug|ARM.ActiveCfg = Debug|ARM
30 {0CCC2E56-E3A4-4CD7-92BA-0C6F99440753}.Debug|ARM.Build.0 = Debug|ARM
31 {0CCC2E56-E3A4-4CD7-92BA-0C6F99440753}.Debug|Win32.ActiveCfg = Debug|Win32
32 {0CCC2E56-E3A4-4CD7-92BA-0C6F99440753}.Debug|Win32.Build.0 = Debug|Win32
33 {0CCC2E56-E3A4-4CD7-92BA-0C6F99440753}.Release|ARM.ActiveCfg = Release|ARM
34 {0CCC2E56-E3A4-4CD7-92BA-0C6F99440753}.Release|ARM.Build.0 = Release|ARM
35 {0CCC2E56-E3A4-4CD7-92BA-0C6F99440753}.Release|Win32.ActiveCfg = Release|Win32
36 {0CCC2E56-E3A4-4CD7-92BA-0C6F99440753}.Release|Win32.Build.0 = Release|Win32
37 {C943DBC9-4EB0-4684-BE3E-334342A7EE2C}.Debug|ARM.ActiveCfg = Debug|ARM
38 {C943DBC9-4EB0-4684-BE3E-334342A7EE2C}.Debug|ARM.Build.0 = Debug|ARM
39 {C943DBC9-4EB0-4684-BE3E-334342A7EE2C}.Debug|Win32.ActiveCfg = Debug|Win32
40 {C943DBC9-4EB0-4684-BE3E-334342A7EE2C}.Debug|Win32.Build.0 = Debug|Win32
41 {C943DBC9-4EB0-4684-BE3E-334342A7EE2C}.Release|ARM.ActiveCfg = Release|ARM
42 {C943DBC9-4EB0-4684-BE3E-334342A7EE2C}.Release|ARM.Build.0 = Release|ARM
43 {C943DBC9-4EB0-4684-BE3E-334342A7EE2C}.Release|Win32.ActiveCfg = Release|Win32
44 {C943DBC9-4EB0-4684-BE3E-334342A7EE2C}.Release|Win32.Build.0 = Release|Win32
45 {203EFCC5-CE11-4A75-92F4-C3DBF7609376}.Debug|ARM.ActiveCfg = Debug|ARM
46 {203EFCC5-CE11-4A75-92F4-C3DBF7609376}.Debug|ARM.Build.0 = Debug|ARM
47 {203EFCC5-CE11-4A75-92F4-C3DBF7609376}.Debug|Win32.ActiveCfg = Debug|Win32
48 {203EFCC5-CE11-4A75-92F4-C3DBF7609376}.Debug|Win32.Build.0 = Debug|Win32
49 {203EFCC5-CE11-4A75-92F4-C3DBF7609376}.Release|ARM.ActiveCfg = Release|ARM
50 {203EFCC5-CE11-4A75-92F4-C3DBF7609376}.Release|ARM.Build.0 = Release|ARM
51 {203EFCC5-CE11-4A75-92F4-C3DBF7609376}.Release|Win32.ActiveCfg = Release|Win32
52 {203EFCC5-CE11-4A75-92F4-C3DBF7609376}.Release|Win32.Build.0 = Release|Win32
53 EndGlobalSection
54 GlobalSection(SolutionProperties) = preSolution
55 HideSolutionNode = FALSE
56 EndGlobalSection
57 EndGlobal
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|Win32">
4 <Configuration>Debug</Configuration>
5 <Platform>Win32</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Release|Win32">
8 <Configuration>Release</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|ARM">
12 <Configuration>Debug</Configuration>
13 <Platform>ARM</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 </ItemGroup>
20 <ItemGroup>
21 <ProjectReference Include="..\..\..\SDL\VisualC-WinRT\WinPhone81_VS2013\SDL-WinPhone81.vcxproj">
22 <Project>{48fadc0e-964d-4dab-bced-372e0ad19577}</Project>
23 </ProjectReference>
24 <ProjectReference Include="libogg_dynamic-WinPhone81.vcxproj">
25 <Project>{0ccc2e56-e3a4-4cd7-92ba-0c6f99440753}</Project>
26 </ProjectReference>
27 <ProjectReference Include="libvorbisfile_dynamic-WinPhone81.vcxproj">
28 <Project>{203efcc5-ce11-4a75-92f4-c3dbf7609376}</Project>
29 </ProjectReference>
30 <ProjectReference Include="libvorbis_dynamic-WinPhone81.vcxproj">
31 <Project>{c943dbc9-4eb0-4684-be3e-334342a7ee2c}</Project>
32 </ProjectReference>
33 </ItemGroup>
34 <ItemGroup>
35 <ClCompile Include="..\..\effects_internal.c" />
36 <ClCompile Include="..\..\effect_position.c" />
37 <ClCompile Include="..\..\effect_stereoreverse.c" />
38 <ClCompile Include="..\..\load_aiff.c" />
39 <ClCompile Include="..\..\load_voc.c" />
40 <ClCompile Include="..\..\mixer.c" />
41 <ClCompile Include="..\..\music.c" />
42 <ClCompile Include="..\..\music_cmd.c" />
43 <ClCompile Include="..\..\music_flac.c" />
44 <ClCompile Include="..\..\music_fluidsynth.c" />
45 <ClCompile Include="..\..\music_mad.c" />
46 <ClCompile Include="..\..\music_mikmod.c" />
47 <ClCompile Include="..\..\music_modplug.c" />
48 <ClCompile Include="..\..\music_mpg123.c" />
49 <ClCompile Include="..\..\music_nativemidi.c" />
50 <ClCompile Include="..\..\music_ogg.c" />
51 <ClCompile Include="..\..\music_smpeg.c" />
52 <ClCompile Include="..\..\music_timidity.c" />
53 <ClCompile Include="..\..\music_wav.c" />
54 <ClCompile Include="..\..\timidity\common.c" />
55 <ClCompile Include="..\..\timidity\instrum.c" />
56 <ClCompile Include="..\..\timidity\mix.c" />
57 <ClCompile Include="..\..\timidity\output.c" />
58 <ClCompile Include="..\..\timidity\playmidi.c" />
59 <ClCompile Include="..\..\timidity\readmidi.c" />
60 <ClCompile Include="..\..\timidity\resample.c" />
61 <ClCompile Include="..\..\timidity\tables.c" />
62 <ClCompile Include="..\..\timidity\timidity.c" />
63 </ItemGroup>
64 <ItemGroup>
65 <ClInclude Include="..\..\effects_internal.h" />
66 <ClInclude Include="..\..\load_aiff.h" />
67 <ClInclude Include="..\..\load_voc.h" />
68 <ClInclude Include="..\..\mixer.h" />
69 <ClInclude Include="..\..\music.h" />
70 <ClInclude Include="..\..\music_cmd.h" />
71 <ClInclude Include="..\..\music_flac.h" />
72 <ClInclude Include="..\..\music_fluidsynth.h" />
73 <ClInclude Include="..\..\music_mad.h" />
74 <ClInclude Include="..\..\music_mikmod.h" />
75 <ClInclude Include="..\..\music_modplug.h" />
76 <ClInclude Include="..\..\music_mpg123.h" />
77 <ClInclude Include="..\..\music_nativemidi.h" />
78 <ClInclude Include="..\..\music_ogg.h" />
79 <ClInclude Include="..\..\music_smpeg.h" />
80 <ClInclude Include="..\..\music_timidity.h" />
81 <ClInclude Include="..\..\music_wav.h" />
82 <ClInclude Include="..\..\SDL_mixer.h" />
83 <ClInclude Include="..\..\timidity\common.h" />
84 <ClInclude Include="..\..\timidity\instrum.h" />
85 <ClInclude Include="..\..\timidity\mix.h" />
86 <ClInclude Include="..\..\timidity\options.h" />
87 <ClInclude Include="..\..\timidity\output.h" />
88 <ClInclude Include="..\..\timidity\playmidi.h" />
89 <ClInclude Include="..\..\timidity\readmidi.h" />
90 <ClInclude Include="..\..\timidity\resample.h" />
91 <ClInclude Include="..\..\timidity\tables.h" />
92 <ClInclude Include="..\..\timidity\timidity.h" />
93 </ItemGroup>
94 <PropertyGroup Label="Globals">
95 <ProjectGuid>{fb75c3d3-d261-4575-9d17-9e88e09568ba}</ProjectGuid>
96 <Keyword>Win32Proj</Keyword>
97 <ProjectName>SDL2_mixer-WinPhone81</ProjectName>
98 <RootNamespace>SDL2_mixer_WinPhone81</RootNamespace>
99 <DefaultLanguage>en-US</DefaultLanguage>
100 <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
101 <AppContainerApplication>true</AppContainerApplication>
102 <ApplicationType>Windows Phone</ApplicationType>
103 <ApplicationTypeRevision>8.1</ApplicationTypeRevision>
104 </PropertyGroup>
105 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
106 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
107 <ConfigurationType>DynamicLibrary</ConfigurationType>
108 <UseDebugLibraries>true</UseDebugLibraries>
109 <PlatformToolset>v120_wp81</PlatformToolset>
110 </PropertyGroup>
111 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
112 <ConfigurationType>DynamicLibrary</ConfigurationType>
113 <UseDebugLibraries>false</UseDebugLibraries>
114 <WholeProgramOptimization>true</WholeProgramOptimization>
115 <PlatformToolset>v120_wp81</PlatformToolset>
116 </PropertyGroup>
117 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
118 <ConfigurationType>DynamicLibrary</ConfigurationType>
119 <UseDebugLibraries>true</UseDebugLibraries>
120 <PlatformToolset>v120_wp81</PlatformToolset>
121 </PropertyGroup>
122 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
123 <ConfigurationType>DynamicLibrary</ConfigurationType>
124 <UseDebugLibraries>false</UseDebugLibraries>
125 <WholeProgramOptimization>true</WholeProgramOptimization>
126 <PlatformToolset>v120_wp81</PlatformToolset>
127 </PropertyGroup>
128 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
129 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
130 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
131 </ImportGroup>
132 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
133 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
134 </ImportGroup>
135 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
136 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
137 </ImportGroup>
138 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
139 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
140 </ImportGroup>
141 <PropertyGroup Label="UserMacros" />
142 <PropertyGroup />
143 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
144 <IgnoreImportLibrary>false</IgnoreImportLibrary>
145 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
146 <TargetName>SDL2_mixer</TargetName>
147 </PropertyGroup>
148 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
149 <IgnoreImportLibrary>false</IgnoreImportLibrary>
150 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
151 <TargetName>SDL2_mixer</TargetName>
152 </PropertyGroup>
153 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
154 <IgnoreImportLibrary>false</IgnoreImportLibrary>
155 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
156 <TargetName>SDL2_mixer</TargetName>
157 </PropertyGroup>
158 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
159 <IgnoreImportLibrary>false</IgnoreImportLibrary>
160 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
161 <TargetName>SDL2_mixer</TargetName>
162 </PropertyGroup>
163 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
164 <ClCompile>
165 <PrecompiledHeader>NotUsing</PrecompiledHeader>
166 <CompileAsWinRT>false</CompileAsWinRT>
167 <SDLCheck>true</SDLCheck>
168 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
169 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
170 </ClCompile>
171 <Link>
172 <SubSystem>Console</SubSystem>
173 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
174 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
175 </Link>
176 </ItemDefinitionGroup>
177 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
178 <ClCompile>
179 <PrecompiledHeader>NotUsing</PrecompiledHeader>
180 <CompileAsWinRT>false</CompileAsWinRT>
181 <SDLCheck>true</SDLCheck>
182 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
183 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
184 </ClCompile>
185 <Link>
186 <SubSystem>Console</SubSystem>
187 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
188 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
189 </Link>
190 </ItemDefinitionGroup>
191 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
192 <ClCompile>
193 <PrecompiledHeader>NotUsing</PrecompiledHeader>
194 <CompileAsWinRT>false</CompileAsWinRT>
195 <SDLCheck>true</SDLCheck>
196 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
197 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
198 </ClCompile>
199 <Link>
200 <SubSystem>Console</SubSystem>
201 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
202 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
203 </Link>
204 </ItemDefinitionGroup>
205 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
206 <ClCompile>
207 <PrecompiledHeader>NotUsing</PrecompiledHeader>
208 <CompileAsWinRT>false</CompileAsWinRT>
209 <SDLCheck>true</SDLCheck>
210 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
211 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
212 </ClCompile>
213 <Link>
214 <SubSystem>Console</SubSystem>
215 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
216 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
217 </Link>
218 </ItemDefinitionGroup>
219 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
220 <ImportGroup Label="ExtensionTargets">
221 </ImportGroup>
222 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\effect_position.c" />
4 <ClCompile Include="..\..\effect_stereoreverse.c" />
5 <ClCompile Include="..\..\effects_internal.c" />
6 <ClCompile Include="..\..\load_aiff.c" />
7 <ClCompile Include="..\..\load_voc.c" />
8 <ClCompile Include="..\..\mixer.c" />
9 <ClCompile Include="..\..\music.c" />
10 <ClCompile Include="..\..\music_cmd.c" />
11 <ClCompile Include="..\..\music_flac.c" />
12 <ClCompile Include="..\..\music_fluidsynth.c" />
13 <ClCompile Include="..\..\music_mad.c" />
14 <ClCompile Include="..\..\music_mikmod.c" />
15 <ClCompile Include="..\..\music_modplug.c" />
16 <ClCompile Include="..\..\music_mpg123.c" />
17 <ClCompile Include="..\..\music_nativemidi.c" />
18 <ClCompile Include="..\..\music_ogg.c" />
19 <ClCompile Include="..\..\music_smpeg.c" />
20 <ClCompile Include="..\..\music_timidity.c" />
21 <ClCompile Include="..\..\music_wav.c" />
22 <ClCompile Include="..\..\timidity\common.c">
23 <Filter>Timidity</Filter>
24 </ClCompile>
25 <ClCompile Include="..\..\timidity\instrum.c">
26 <Filter>Timidity</Filter>
27 </ClCompile>
28 <ClCompile Include="..\..\timidity\mix.c">
29 <Filter>Timidity</Filter>
30 </ClCompile>
31 <ClCompile Include="..\..\timidity\output.c">
32 <Filter>Timidity</Filter>
33 </ClCompile>
34 <ClCompile Include="..\..\timidity\playmidi.c">
35 <Filter>Timidity</Filter>
36 </ClCompile>
37 <ClCompile Include="..\..\timidity\readmidi.c">
38 <Filter>Timidity</Filter>
39 </ClCompile>
40 <ClCompile Include="..\..\timidity\resample.c">
41 <Filter>Timidity</Filter>
42 </ClCompile>
43 <ClCompile Include="..\..\timidity\tables.c">
44 <Filter>Timidity</Filter>
45 </ClCompile>
46 <ClCompile Include="..\..\timidity\timidity.c">
47 <Filter>Timidity</Filter>
48 </ClCompile>
49 </ItemGroup>
50 <ItemGroup>
51 <ClInclude Include="..\..\effects_internal.h" />
52 <ClInclude Include="..\..\load_aiff.h" />
53 <ClInclude Include="..\..\load_voc.h" />
54 <ClInclude Include="..\..\mixer.h" />
55 <ClInclude Include="..\..\music.h" />
56 <ClInclude Include="..\..\music_cmd.h" />
57 <ClInclude Include="..\..\music_flac.h" />
58 <ClInclude Include="..\..\music_fluidsynth.h" />
59 <ClInclude Include="..\..\music_mad.h" />
60 <ClInclude Include="..\..\music_mikmod.h" />
61 <ClInclude Include="..\..\music_modplug.h" />
62 <ClInclude Include="..\..\music_mpg123.h" />
63 <ClInclude Include="..\..\music_nativemidi.h" />
64 <ClInclude Include="..\..\music_ogg.h" />
65 <ClInclude Include="..\..\music_smpeg.h" />
66 <ClInclude Include="..\..\music_timidity.h" />
67 <ClInclude Include="..\..\music_wav.h" />
68 <ClInclude Include="..\..\SDL_mixer.h" />
69 <ClInclude Include="..\..\timidity\common.h">
70 <Filter>Timidity</Filter>
71 </ClInclude>
72 <ClInclude Include="..\..\timidity\instrum.h">
73 <Filter>Timidity</Filter>
74 </ClInclude>
75 <ClInclude Include="..\..\timidity\mix.h">
76 <Filter>Timidity</Filter>
77 </ClInclude>
78 <ClInclude Include="..\..\timidity\options.h">
79 <Filter>Timidity</Filter>
80 </ClInclude>
81 <ClInclude Include="..\..\timidity\output.h">
82 <Filter>Timidity</Filter>
83 </ClInclude>
84 <ClInclude Include="..\..\timidity\playmidi.h">
85 <Filter>Timidity</Filter>
86 </ClInclude>
87 <ClInclude Include="..\..\timidity\readmidi.h">
88 <Filter>Timidity</Filter>
89 </ClInclude>
90 <ClInclude Include="..\..\timidity\resample.h">
91 <Filter>Timidity</Filter>
92 </ClInclude>
93 <ClInclude Include="..\..\timidity\tables.h">
94 <Filter>Timidity</Filter>
95 </ClInclude>
96 <ClInclude Include="..\..\timidity\timidity.h">
97 <Filter>Timidity</Filter>
98 </ClInclude>
99 </ItemGroup>
100 <ItemGroup>
101 <Filter Include="Timidity">
102 <UniqueIdentifier>{3f55d8a7-802e-40cd-8b4e-b87e9fe24589}</UniqueIdentifier>
103 </Filter>
104 </ItemGroup>
105 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|Win32">
4 <Configuration>Debug</Configuration>
5 <Platform>Win32</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Release|Win32">
8 <Configuration>Release</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|ARM">
12 <Configuration>Debug</Configuration>
13 <Platform>ARM</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 </ItemGroup>
20 <ItemGroup>
21 <ClCompile Include="..\..\external\libogg-1.3.2\src\bitwise.c" />
22 <ClCompile Include="..\..\external\libogg-1.3.2\src\framing.c" />
23 </ItemGroup>
24 <ItemGroup>
25 <None Include="..\..\external\libogg-1.3.2\win32\ogg.def" />
26 </ItemGroup>
27 <ItemGroup>
28 <ClInclude Include="..\..\external\libogg-1.3.2\include\ogg\ogg.h" />
29 <ClInclude Include="..\..\external\libogg-1.3.2\include\ogg\os_types.h" />
30 </ItemGroup>
31 <PropertyGroup Label="Globals">
32 <ProjectGuid>{0ccc2e56-e3a4-4cd7-92ba-0c6f99440753}</ProjectGuid>
33 <Keyword>Win32Proj</Keyword>
34 <ProjectName>libogg_dynamic-WinPhone81</ProjectName>
35 <RootNamespace>libogg_dynamic_WinPhone81</RootNamespace>
36 <DefaultLanguage>en-US</DefaultLanguage>
37 <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
38 <AppContainerApplication>true</AppContainerApplication>
39 <ApplicationType>Windows Phone</ApplicationType>
40 <ApplicationTypeRevision>8.1</ApplicationTypeRevision>
41 </PropertyGroup>
42 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
43 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
44 <ConfigurationType>DynamicLibrary</ConfigurationType>
45 <UseDebugLibraries>true</UseDebugLibraries>
46 <PlatformToolset>v120_wp81</PlatformToolset>
47 </PropertyGroup>
48 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
49 <ConfigurationType>DynamicLibrary</ConfigurationType>
50 <UseDebugLibraries>false</UseDebugLibraries>
51 <WholeProgramOptimization>true</WholeProgramOptimization>
52 <PlatformToolset>v120_wp81</PlatformToolset>
53 </PropertyGroup>
54 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
55 <ConfigurationType>DynamicLibrary</ConfigurationType>
56 <UseDebugLibraries>true</UseDebugLibraries>
57 <PlatformToolset>v120_wp81</PlatformToolset>
58 </PropertyGroup>
59 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
60 <ConfigurationType>DynamicLibrary</ConfigurationType>
61 <UseDebugLibraries>false</UseDebugLibraries>
62 <WholeProgramOptimization>true</WholeProgramOptimization>
63 <PlatformToolset>v120_wp81</PlatformToolset>
64 </PropertyGroup>
65 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
66 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
67 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68 </ImportGroup>
69 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
70 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71 </ImportGroup>
72 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
73 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
74 </ImportGroup>
75 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
76 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
77 </ImportGroup>
78 <PropertyGroup Label="UserMacros" />
79 <PropertyGroup />
80 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
81 <IgnoreImportLibrary>false</IgnoreImportLibrary>
82 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
83 <TargetName>libogg</TargetName>
84 </PropertyGroup>
85 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
86 <IgnoreImportLibrary>false</IgnoreImportLibrary>
87 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
88 <TargetName>libogg</TargetName>
89 </PropertyGroup>
90 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
91 <IgnoreImportLibrary>false</IgnoreImportLibrary>
92 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
93 <TargetName>libogg</TargetName>
94 </PropertyGroup>
95 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
96 <IgnoreImportLibrary>false</IgnoreImportLibrary>
97 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
98 <TargetName>libogg</TargetName>
99 </PropertyGroup>
100 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
101 <ClCompile>
102 <PrecompiledHeader>NotUsing</PrecompiledHeader>
103 <CompileAsWinRT>false</CompileAsWinRT>
104 <SDLCheck>true</SDLCheck>
105 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
106 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
107 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
108 </ClCompile>
109 <Link>
110 <SubSystem>Console</SubSystem>
111 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
112 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
113 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
114 </Link>
115 </ItemDefinitionGroup>
116 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
117 <ClCompile>
118 <PrecompiledHeader>NotUsing</PrecompiledHeader>
119 <CompileAsWinRT>false</CompileAsWinRT>
120 <SDLCheck>true</SDLCheck>
121 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
122 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
123 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
124 </ClCompile>
125 <Link>
126 <SubSystem>Console</SubSystem>
127 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
128 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
129 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
130 </Link>
131 </ItemDefinitionGroup>
132 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
133 <ClCompile>
134 <PrecompiledHeader>NotUsing</PrecompiledHeader>
135 <CompileAsWinRT>false</CompileAsWinRT>
136 <SDLCheck>true</SDLCheck>
137 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
138 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
139 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
140 </ClCompile>
141 <Link>
142 <SubSystem>Console</SubSystem>
143 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
144 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
145 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
146 </Link>
147 </ItemDefinitionGroup>
148 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
149 <ClCompile>
150 <PrecompiledHeader>NotUsing</PrecompiledHeader>
151 <CompileAsWinRT>false</CompileAsWinRT>
152 <SDLCheck>true</SDLCheck>
153 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
154 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
155 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
156 </ClCompile>
157 <Link>
158 <SubSystem>Console</SubSystem>
159 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
160 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
161 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
162 </Link>
163 </ItemDefinitionGroup>
164 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
165 <ImportGroup Label="ExtensionTargets">
166 </ImportGroup>
167 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libogg-1.3.1\src\bitwise.c" />
4 <ClCompile Include="..\..\external\libogg-1.3.1\src\framing.c" />
5 </ItemGroup>
6 <ItemGroup>
7 <None Include="..\..\external\libogg-1.3.1\win32\ogg.def" />
8 </ItemGroup>
9 <ItemGroup>
10 <ClInclude Include="..\..\external\libogg-1.3.1\include\ogg\ogg.h" />
11 <ClInclude Include="..\..\external\libogg-1.3.1\include\ogg\os_types.h" />
12 </ItemGroup>
13 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|Win32">
4 <Configuration>Debug</Configuration>
5 <Platform>Win32</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Release|Win32">
8 <Configuration>Release</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|ARM">
12 <Configuration>Debug</Configuration>
13 <Platform>ARM</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 </ItemGroup>
20 <ItemGroup>
21 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\analysis.c" />
22 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\bitrate.c" />
23 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\block.c" />
24 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\codebook.c" />
25 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\envelope.c" />
26 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\floor0.c" />
27 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\floor1.c" />
28 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\info.c" />
29 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lookup.c" />
30 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lpc.c" />
31 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lsp.c" />
32 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\mapping0.c" />
33 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\mdct.c" />
34 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\psy.c" />
35 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\registry.c" />
36 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\res0.c" />
37 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\sharedbook.c" />
38 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\smallft.c" />
39 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\synthesis.c" />
40 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\vorbisenc.c" />
41 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\window.c" />
42 </ItemGroup>
43 <ItemGroup>
44 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\codec.h" />
45 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisenc.h" />
46 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisfile.h" />
47 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\backends.h" />
48 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\bitrate.h" />
49 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\coupled\res_books_stereo.h" />
50 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\floor\floor_books.h" />
51 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\uncoupled\res_books_uncoupled.h" />
52 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\codebook.h" />
53 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\codec_internal.h" />
54 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\envelope.h" />
55 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\highlevel.h" />
56 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lookup.h" />
57 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lookup_data.h" />
58 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lpc.h" />
59 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lsp.h" />
60 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\masking.h" />
61 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\mdct.h" />
62 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\misc.h" />
63 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\floor_all.h" />
64 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_11.h" />
65 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_16.h" />
66 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_44.h" />
67 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_8.h" />
68 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_16.h" />
69 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_44.h" />
70 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_44u.h" />
71 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_8.h" />
72 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_11.h" />
73 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_16.h" />
74 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_22.h" />
75 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_32.h" />
76 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_44.h" />
77 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_44u.h" />
78 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_8.h" />
79 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_X.h" />
80 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\os.h" />
81 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\psy.h" />
82 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\registry.h" />
83 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\scales.h" />
84 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\smallft.h" />
85 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\window.h" />
86 </ItemGroup>
87 <ItemGroup>
88 <None Include="..\..\external\libvorbis-1.3.5\win32\vorbis.def" />
89 </ItemGroup>
90 <ItemGroup>
91 <ProjectReference Include="libogg_dynamic-WinPhone81.vcxproj">
92 <Project>{0ccc2e56-e3a4-4cd7-92ba-0c6f99440753}</Project>
93 </ProjectReference>
94 </ItemGroup>
95 <PropertyGroup Label="Globals">
96 <ProjectGuid>{c943dbc9-4eb0-4684-be3e-334342a7ee2c}</ProjectGuid>
97 <Keyword>Win32Proj</Keyword>
98 <ProjectName>libvorbis_dynamic-WinPhone81</ProjectName>
99 <RootNamespace>libvorbis_dynamic_WinPhone81</RootNamespace>
100 <DefaultLanguage>en-US</DefaultLanguage>
101 <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
102 <AppContainerApplication>true</AppContainerApplication>
103 <ApplicationType>Windows Phone</ApplicationType>
104 <ApplicationTypeRevision>8.1</ApplicationTypeRevision>
105 </PropertyGroup>
106 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
107 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
108 <ConfigurationType>DynamicLibrary</ConfigurationType>
109 <UseDebugLibraries>true</UseDebugLibraries>
110 <PlatformToolset>v120_wp81</PlatformToolset>
111 </PropertyGroup>
112 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
113 <ConfigurationType>DynamicLibrary</ConfigurationType>
114 <UseDebugLibraries>false</UseDebugLibraries>
115 <WholeProgramOptimization>true</WholeProgramOptimization>
116 <PlatformToolset>v120_wp81</PlatformToolset>
117 </PropertyGroup>
118 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
119 <ConfigurationType>DynamicLibrary</ConfigurationType>
120 <UseDebugLibraries>true</UseDebugLibraries>
121 <PlatformToolset>v120_wp81</PlatformToolset>
122 </PropertyGroup>
123 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
124 <ConfigurationType>DynamicLibrary</ConfigurationType>
125 <UseDebugLibraries>false</UseDebugLibraries>
126 <WholeProgramOptimization>true</WholeProgramOptimization>
127 <PlatformToolset>v120_wp81</PlatformToolset>
128 </PropertyGroup>
129 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
130 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
131 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
132 </ImportGroup>
133 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
134 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
135 </ImportGroup>
136 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
137 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
138 </ImportGroup>
139 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
140 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
141 </ImportGroup>
142 <PropertyGroup Label="UserMacros" />
143 <PropertyGroup />
144 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
145 <IgnoreImportLibrary>false</IgnoreImportLibrary>
146 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
147 <TargetName>libvorbis</TargetName>
148 </PropertyGroup>
149 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
150 <IgnoreImportLibrary>false</IgnoreImportLibrary>
151 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
152 <TargetName>libvorbis</TargetName>
153 </PropertyGroup>
154 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
155 <IgnoreImportLibrary>false</IgnoreImportLibrary>
156 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
157 <TargetName>libvorbis</TargetName>
158 </PropertyGroup>
159 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
160 <IgnoreImportLibrary>false</IgnoreImportLibrary>
161 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
162 <TargetName>libvorbis</TargetName>
163 </PropertyGroup>
164 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
165 <ClCompile>
166 <PrecompiledHeader>NotUsing</PrecompiledHeader>
167 <CompileAsWinRT>false</CompileAsWinRT>
168 <SDLCheck>true</SDLCheck>
169 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
170 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
171 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
172 </ClCompile>
173 <Link>
174 <SubSystem>Console</SubSystem>
175 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
176 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
177 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
178 </Link>
179 </ItemDefinitionGroup>
180 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
181 <ClCompile>
182 <PrecompiledHeader>NotUsing</PrecompiledHeader>
183 <CompileAsWinRT>false</CompileAsWinRT>
184 <SDLCheck>true</SDLCheck>
185 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
186 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
187 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
188 </ClCompile>
189 <Link>
190 <SubSystem>Console</SubSystem>
191 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
192 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
193 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
194 </Link>
195 </ItemDefinitionGroup>
196 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
197 <ClCompile>
198 <PrecompiledHeader>NotUsing</PrecompiledHeader>
199 <CompileAsWinRT>false</CompileAsWinRT>
200 <SDLCheck>true</SDLCheck>
201 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
202 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
203 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
204 </ClCompile>
205 <Link>
206 <SubSystem>Console</SubSystem>
207 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
208 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
209 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
210 </Link>
211 </ItemDefinitionGroup>
212 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
213 <ClCompile>
214 <PrecompiledHeader>NotUsing</PrecompiledHeader>
215 <CompileAsWinRT>false</CompileAsWinRT>
216 <SDLCheck>true</SDLCheck>
217 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
218 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
219 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
220 </ClCompile>
221 <Link>
222 <SubSystem>Console</SubSystem>
223 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
224 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
225 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
226 </Link>
227 </ItemDefinitionGroup>
228 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
229 <ImportGroup Label="ExtensionTargets">
230 </ImportGroup>
231 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\analysis.c" />
4 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\bitrate.c" />
5 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\block.c" />
6 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\codebook.c" />
7 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\envelope.c" />
8 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\floor0.c" />
9 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\floor1.c" />
10 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\info.c" />
11 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lookup.c" />
12 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lpc.c" />
13 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lsp.c" />
14 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\mapping0.c" />
15 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\mdct.c" />
16 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\psy.c" />
17 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\registry.c" />
18 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\res0.c" />
19 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\sharedbook.c" />
20 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\smallft.c" />
21 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\synthesis.c" />
22 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\vorbisenc.c" />
23 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\window.c" />
24 </ItemGroup>
25 <ItemGroup>
26 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\backends.h" />
27 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\bitrate.h" />
28 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\codebook.h" />
29 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\codec.h" />
30 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\codec_internal.h" />
31 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\envelope.h" />
32 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\floor_all.h" />
33 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\floor\floor_books.h" />
34 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\highlevel.h" />
35 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lookup.h" />
36 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lookup_data.h" />
37 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lpc.h" />
38 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lsp.h" />
39 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\masking.h" />
40 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\mdct.h" />
41 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\misc.h" />
42 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\os.h" />
43 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\psy.h" />
44 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_8.h" />
45 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_11.h" />
46 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_16.h" />
47 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_44.h" />
48 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\registry.h" />
49 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\coupled\res_books_stereo.h" />
50 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\uncoupled\res_books_uncoupled.h" />
51 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_8.h" />
52 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_16.h" />
53 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_44.h" />
54 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_44u.h" />
55 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\scales.h" />
56 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_8.h" />
57 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_11.h" />
58 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_16.h" />
59 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_22.h" />
60 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_32.h" />
61 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_44.h" />
62 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_44u.h" />
63 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_X.h" />
64 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\smallft.h" />
65 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisenc.h" />
66 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisfile.h" />
67 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\window.h" />
68 </ItemGroup>
69 <ItemGroup>
70 <None Include="..\..\external\libvorbis-1.3.3\win32\vorbis.def" />
71 </ItemGroup>
72 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|Win32">
4 <Configuration>Debug</Configuration>
5 <Platform>Win32</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Release|Win32">
8 <Configuration>Release</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|ARM">
12 <Configuration>Debug</Configuration>
13 <Platform>ARM</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 </ItemGroup>
20 <ItemGroup>
21 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\vorbisfile.c" />
22 </ItemGroup>
23 <ItemGroup>
24 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisfile.h" />
25 </ItemGroup>
26 <ItemGroup>
27 <ProjectReference Include="libogg_dynamic-WinPhone81.vcxproj">
28 <Project>{0ccc2e56-e3a4-4cd7-92ba-0c6f99440753}</Project>
29 </ProjectReference>
30 <ProjectReference Include="libvorbis_dynamic-WinPhone81.vcxproj">
31 <Project>{c943dbc9-4eb0-4684-be3e-334342a7ee2c}</Project>
32 </ProjectReference>
33 </ItemGroup>
34 <PropertyGroup Label="Globals">
35 <ProjectGuid>{203efcc5-ce11-4a75-92f4-c3dbf7609376}</ProjectGuid>
36 <Keyword>Win32Proj</Keyword>
37 <ProjectName>libvorbisfile_dynamic-WinPhone81</ProjectName>
38 <RootNamespace>libvorbisfile_dynamic_WinPhone81</RootNamespace>
39 <DefaultLanguage>en-US</DefaultLanguage>
40 <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
41 <AppContainerApplication>true</AppContainerApplication>
42 <ApplicationType>Windows Phone</ApplicationType>
43 <ApplicationTypeRevision>8.1</ApplicationTypeRevision>
44 </PropertyGroup>
45 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
46 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
47 <ConfigurationType>DynamicLibrary</ConfigurationType>
48 <UseDebugLibraries>true</UseDebugLibraries>
49 <PlatformToolset>v120_wp81</PlatformToolset>
50 </PropertyGroup>
51 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
52 <ConfigurationType>DynamicLibrary</ConfigurationType>
53 <UseDebugLibraries>false</UseDebugLibraries>
54 <WholeProgramOptimization>true</WholeProgramOptimization>
55 <PlatformToolset>v120_wp81</PlatformToolset>
56 </PropertyGroup>
57 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
58 <ConfigurationType>DynamicLibrary</ConfigurationType>
59 <UseDebugLibraries>true</UseDebugLibraries>
60 <PlatformToolset>v120_wp81</PlatformToolset>
61 </PropertyGroup>
62 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
63 <ConfigurationType>DynamicLibrary</ConfigurationType>
64 <UseDebugLibraries>false</UseDebugLibraries>
65 <WholeProgramOptimization>true</WholeProgramOptimization>
66 <PlatformToolset>v120_wp81</PlatformToolset>
67 </PropertyGroup>
68 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
69 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
70 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71 </ImportGroup>
72 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
73 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
74 </ImportGroup>
75 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
76 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
77 </ImportGroup>
78 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
79 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
80 </ImportGroup>
81 <PropertyGroup Label="UserMacros" />
82 <PropertyGroup />
83 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
84 <IgnoreImportLibrary>false</IgnoreImportLibrary>
85 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
86 <TargetName>libvorbisfile</TargetName>
87 </PropertyGroup>
88 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
89 <IgnoreImportLibrary>false</IgnoreImportLibrary>
90 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
91 <TargetName>libvorbisfile</TargetName>
92 </PropertyGroup>
93 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
94 <IgnoreImportLibrary>false</IgnoreImportLibrary>
95 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
96 <TargetName>libvorbisfile</TargetName>
97 </PropertyGroup>
98 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
99 <IgnoreImportLibrary>false</IgnoreImportLibrary>
100 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
101 <TargetName>libvorbisfile</TargetName>
102 </PropertyGroup>
103 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
104 <ClCompile>
105 <PrecompiledHeader>NotUsing</PrecompiledHeader>
106 <CompileAsWinRT>false</CompileAsWinRT>
107 <SDLCheck>true</SDLCheck>
108 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
109 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;PSAPI_VERSION=2;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_UITHREADCTXT_SUPPORT=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
110 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
111 </ClCompile>
112 <Link>
113 <SubSystem>Console</SubSystem>
114 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
115 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
116 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
117 </Link>
118 </ItemDefinitionGroup>
119 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
120 <ClCompile>
121 <PrecompiledHeader>NotUsing</PrecompiledHeader>
122 <CompileAsWinRT>false</CompileAsWinRT>
123 <SDLCheck>true</SDLCheck>
124 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
125 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
126 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
127 </ClCompile>
128 <Link>
129 <SubSystem>Console</SubSystem>
130 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
131 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
132 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
133 </Link>
134 </ItemDefinitionGroup>
135 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
136 <ClCompile>
137 <PrecompiledHeader>NotUsing</PrecompiledHeader>
138 <CompileAsWinRT>false</CompileAsWinRT>
139 <SDLCheck>true</SDLCheck>
140 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
141 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;PSAPI_VERSION=2;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_UITHREADCTXT_SUPPORT=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
142 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
143 </ClCompile>
144 <Link>
145 <SubSystem>Console</SubSystem>
146 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
147 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
148 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
149 </Link>
150 </ItemDefinitionGroup>
151 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
152 <ClCompile>
153 <PrecompiledHeader>NotUsing</PrecompiledHeader>
154 <CompileAsWinRT>false</CompileAsWinRT>
155 <SDLCheck>true</SDLCheck>
156 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
157 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
158 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
159 </ClCompile>
160 <Link>
161 <SubSystem>Console</SubSystem>
162 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
163 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
164 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
165 </Link>
166 </ItemDefinitionGroup>
167 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
168 <ImportGroup Label="ExtensionTargets">
169 </ImportGroup>
170 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\vorbisfile.c" />
4 </ItemGroup>
5 <ItemGroup>
6 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisfile.h" />
7 </ItemGroup>
8 </Project>
0 
1 Microsoft Visual Studio Solution File, Format Version 12.00
2 # Visual Studio 2012
3 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2_mixer-WinRT80", "SDL_mixer-WinRT80.vcxproj", "{06925935-B340-44E8-BDDD-7C1B8D64FF76}"
4 EndProject
5 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libogg_dynamic-WinRT80", "libogg_dynamic-WinRT80.vcxproj", "{15CBFEFF-7965-41F5-B4E2-21E8795C9159}"
6 EndProject
7 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbis_dynamic-WinRT80", "libvorbis_dynamic-WinRT80.vcxproj", "{3A214E06-B95E-4D61-A291-1F8DF2EC10FD}"
8 EndProject
9 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbisfile_dynamic-WinRT80", "libvorbisfile_dynamic-WinRT80.vcxproj", "{CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}"
10 EndProject
11 Global
12 GlobalSection(SolutionConfigurationPlatforms) = preSolution
13 Debug|ARM = Debug|ARM
14 Debug|Win32 = Debug|Win32
15 Debug|x64 = Debug|x64
16 Release|ARM = Release|ARM
17 Release|Win32 = Release|Win32
18 Release|x64 = Release|x64
19 EndGlobalSection
20 GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Debug|ARM.ActiveCfg = Debug|ARM
22 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Debug|ARM.Build.0 = Debug|ARM
23 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Debug|Win32.ActiveCfg = Debug|Win32
24 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Debug|Win32.Build.0 = Debug|Win32
25 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Debug|x64.ActiveCfg = Debug|x64
26 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Debug|x64.Build.0 = Debug|x64
27 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Release|ARM.ActiveCfg = Release|ARM
28 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Release|ARM.Build.0 = Release|ARM
29 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Release|Win32.ActiveCfg = Release|Win32
30 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Release|Win32.Build.0 = Release|Win32
31 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Release|x64.ActiveCfg = Release|x64
32 {06925935-B340-44E8-BDDD-7C1B8D64FF76}.Release|x64.Build.0 = Release|x64
33 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Debug|ARM.ActiveCfg = Debug|ARM
34 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Debug|ARM.Build.0 = Debug|ARM
35 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Debug|Win32.ActiveCfg = Debug|Win32
36 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Debug|Win32.Build.0 = Debug|Win32
37 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Debug|x64.ActiveCfg = Debug|x64
38 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Debug|x64.Build.0 = Debug|x64
39 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Release|ARM.ActiveCfg = Release|ARM
40 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Release|ARM.Build.0 = Release|ARM
41 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Release|Win32.ActiveCfg = Release|Win32
42 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Release|Win32.Build.0 = Release|Win32
43 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Release|x64.ActiveCfg = Release|x64
44 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Release|x64.Build.0 = Release|x64
45 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Debug|ARM.ActiveCfg = Debug|ARM
46 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Debug|ARM.Build.0 = Debug|ARM
47 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Debug|Win32.ActiveCfg = Debug|Win32
48 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Debug|Win32.Build.0 = Debug|Win32
49 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Debug|x64.ActiveCfg = Debug|x64
50 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Debug|x64.Build.0 = Debug|x64
51 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Release|ARM.ActiveCfg = Release|ARM
52 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Release|ARM.Build.0 = Release|ARM
53 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Release|Win32.ActiveCfg = Release|Win32
54 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Release|Win32.Build.0 = Release|Win32
55 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Release|x64.ActiveCfg = Release|x64
56 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Release|x64.Build.0 = Release|x64
57 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Debug|ARM.ActiveCfg = Debug|ARM
58 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Debug|ARM.Build.0 = Debug|ARM
59 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Debug|Win32.ActiveCfg = Debug|Win32
60 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Debug|Win32.Build.0 = Debug|Win32
61 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Debug|x64.ActiveCfg = Debug|x64
62 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Debug|x64.Build.0 = Debug|x64
63 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Release|ARM.ActiveCfg = Release|ARM
64 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Release|ARM.Build.0 = Release|ARM
65 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Release|Win32.ActiveCfg = Release|Win32
66 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Release|Win32.Build.0 = Release|Win32
67 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Release|x64.ActiveCfg = Release|x64
68 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Release|x64.Build.0 = Release|x64
69 EndGlobalSection
70 GlobalSection(SolutionProperties) = preSolution
71 HideSolutionNode = FALSE
72 EndGlobalSection
73 EndGlobal
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <ItemGroup>
29 <ProjectReference Include="..\..\..\SDL\VisualC-WinRT\WinRT80_VS2012\SDL-WinRT80.vcxproj">
30 <Project>{aeaea3a2-d4e6-45b1-8ec6-53d84287fc14}</Project>
31 </ProjectReference>
32 <ProjectReference Include="libogg_dynamic-WinRT80.vcxproj">
33 <Project>{15cbfeff-7965-41f5-b4e2-21e8795c9159}</Project>
34 </ProjectReference>
35 <ProjectReference Include="libvorbisfile_dynamic-WinRT80.vcxproj">
36 <Project>{cebde98b-a6aa-46e6-bc79-faaf823db9ec}</Project>
37 </ProjectReference>
38 <ProjectReference Include="libvorbis_dynamic-WinRT80.vcxproj">
39 <Project>{3a214e06-b95e-4d61-a291-1f8df2ec10fd}</Project>
40 </ProjectReference>
41 </ItemGroup>
42 <ItemGroup>
43 <ClCompile Include="..\..\effects_internal.c" />
44 <ClCompile Include="..\..\effect_position.c" />
45 <ClCompile Include="..\..\effect_stereoreverse.c" />
46 <ClCompile Include="..\..\load_aiff.c" />
47 <ClCompile Include="..\..\load_voc.c" />
48 <ClCompile Include="..\..\mixer.c" />
49 <ClCompile Include="..\..\music.c" />
50 <ClCompile Include="..\..\music_cmd.c" />
51 <ClCompile Include="..\..\music_flac.c" />
52 <ClCompile Include="..\..\music_fluidsynth.c" />
53 <ClCompile Include="..\..\music_mad.c" />
54 <ClCompile Include="..\..\music_mikmod.c" />
55 <ClCompile Include="..\..\music_modplug.c" />
56 <ClCompile Include="..\..\music_mpg123.c" />
57 <ClCompile Include="..\..\music_nativemidi.c" />
58 <ClCompile Include="..\..\music_ogg.c" />
59 <ClCompile Include="..\..\music_smpeg.c" />
60 <ClCompile Include="..\..\music_timidity.c" />
61 <ClCompile Include="..\..\music_wav.c" />
62 <ClCompile Include="..\..\timidity\common.c" />
63 <ClCompile Include="..\..\timidity\instrum.c" />
64 <ClCompile Include="..\..\timidity\mix.c" />
65 <ClCompile Include="..\..\timidity\output.c" />
66 <ClCompile Include="..\..\timidity\playmidi.c" />
67 <ClCompile Include="..\..\timidity\readmidi.c" />
68 <ClCompile Include="..\..\timidity\resample.c" />
69 <ClCompile Include="..\..\timidity\tables.c" />
70 <ClCompile Include="..\..\timidity\timidity.c" />
71 </ItemGroup>
72 <ItemGroup>
73 <ClInclude Include="..\..\effects_internal.h" />
74 <ClInclude Include="..\..\load_aiff.h" />
75 <ClInclude Include="..\..\load_voc.h" />
76 <ClInclude Include="..\..\mixer.h" />
77 <ClInclude Include="..\..\music.h" />
78 <ClInclude Include="..\..\music_cmd.h" />
79 <ClInclude Include="..\..\music_flac.h" />
80 <ClInclude Include="..\..\music_fluidsynth.h" />
81 <ClInclude Include="..\..\music_mad.h" />
82 <ClInclude Include="..\..\music_mikmod.h" />
83 <ClInclude Include="..\..\music_modplug.h" />
84 <ClInclude Include="..\..\music_mpg123.h" />
85 <ClInclude Include="..\..\music_nativemidi.h" />
86 <ClInclude Include="..\..\music_ogg.h" />
87 <ClInclude Include="..\..\music_smpeg.h" />
88 <ClInclude Include="..\..\music_timidity.h" />
89 <ClInclude Include="..\..\music_wav.h" />
90 <ClInclude Include="..\..\SDL_mixer.h" />
91 <ClInclude Include="..\..\timidity\common.h" />
92 <ClInclude Include="..\..\timidity\instrum.h" />
93 <ClInclude Include="..\..\timidity\mix.h" />
94 <ClInclude Include="..\..\timidity\options.h" />
95 <ClInclude Include="..\..\timidity\output.h" />
96 <ClInclude Include="..\..\timidity\playmidi.h" />
97 <ClInclude Include="..\..\timidity\readmidi.h" />
98 <ClInclude Include="..\..\timidity\resample.h" />
99 <ClInclude Include="..\..\timidity\tables.h" />
100 <ClInclude Include="..\..\timidity\timidity.h" />
101 </ItemGroup>
102 <PropertyGroup Label="Globals">
103 <ProjectGuid>{06925935-b340-44e8-bddd-7c1b8d64ff76}</ProjectGuid>
104 <Keyword>Win32Proj</Keyword>
105 <ProjectName>SDL2_mixer-WinRT80</ProjectName>
106 <RootNamespace>SDL_mixer_VS2012_WinRT</RootNamespace>
107 <DefaultLanguage>en-US</DefaultLanguage>
108 <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
109 <AppContainerApplication>true</AppContainerApplication>
110 </PropertyGroup>
111 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
112 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
113 <ConfigurationType>DynamicLibrary</ConfigurationType>
114 <UseDebugLibraries>true</UseDebugLibraries>
115 <PlatformToolset>v110</PlatformToolset>
116 </PropertyGroup>
117 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
118 <ConfigurationType>DynamicLibrary</ConfigurationType>
119 <UseDebugLibraries>true</UseDebugLibraries>
120 <PlatformToolset>v110</PlatformToolset>
121 </PropertyGroup>
122 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
123 <ConfigurationType>DynamicLibrary</ConfigurationType>
124 <UseDebugLibraries>true</UseDebugLibraries>
125 <PlatformToolset>v110</PlatformToolset>
126 </PropertyGroup>
127 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
128 <ConfigurationType>DynamicLibrary</ConfigurationType>
129 <UseDebugLibraries>false</UseDebugLibraries>
130 <WholeProgramOptimization>true</WholeProgramOptimization>
131 <PlatformToolset>v110</PlatformToolset>
132 </PropertyGroup>
133 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
134 <ConfigurationType>DynamicLibrary</ConfigurationType>
135 <UseDebugLibraries>false</UseDebugLibraries>
136 <WholeProgramOptimization>true</WholeProgramOptimization>
137 <PlatformToolset>v110</PlatformToolset>
138 </PropertyGroup>
139 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
140 <ConfigurationType>DynamicLibrary</ConfigurationType>
141 <UseDebugLibraries>false</UseDebugLibraries>
142 <WholeProgramOptimization>true</WholeProgramOptimization>
143 <PlatformToolset>v110</PlatformToolset>
144 </PropertyGroup>
145 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
146 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
147 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
148 </ImportGroup>
149 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
150 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
151 </ImportGroup>
152 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
153 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
154 </ImportGroup>
155 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
156 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
157 </ImportGroup>
158 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
159 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
160 </ImportGroup>
161 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
162 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
163 </ImportGroup>
164 <PropertyGroup Label="UserMacros" />
165 <PropertyGroup />
166 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
167 <GenerateManifest>false</GenerateManifest>
168 <IgnoreImportLibrary>false</IgnoreImportLibrary>
169 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
170 <TargetName>SDL2_mixer</TargetName>
171 </PropertyGroup>
172 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
173 <GenerateManifest>false</GenerateManifest>
174 <IgnoreImportLibrary>false</IgnoreImportLibrary>
175 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
176 <TargetName>SDL2_mixer</TargetName>
177 </PropertyGroup>
178 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
179 <GenerateManifest>false</GenerateManifest>
180 <IgnoreImportLibrary>false</IgnoreImportLibrary>
181 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
182 <TargetName>SDL2_mixer</TargetName>
183 </PropertyGroup>
184 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
185 <GenerateManifest>false</GenerateManifest>
186 <IgnoreImportLibrary>false</IgnoreImportLibrary>
187 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
188 <TargetName>SDL2_mixer</TargetName>
189 </PropertyGroup>
190 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
191 <GenerateManifest>false</GenerateManifest>
192 <IgnoreImportLibrary>false</IgnoreImportLibrary>
193 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
194 <TargetName>SDL2_mixer</TargetName>
195 </PropertyGroup>
196 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
197 <GenerateManifest>false</GenerateManifest>
198 <IgnoreImportLibrary>false</IgnoreImportLibrary>
199 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
200 <TargetName>SDL2_mixer</TargetName>
201 </PropertyGroup>
202 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
203 <ClCompile>
204 <PrecompiledHeader>NotUsing</PrecompiledHeader>
205 <CompileAsWinRT>false</CompileAsWinRT>
206 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
207 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
208 </ClCompile>
209 <Link>
210 <SubSystem>Console</SubSystem>
211 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
212 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
213 </Link>
214 </ItemDefinitionGroup>
215 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
216 <ClCompile>
217 <PrecompiledHeader>NotUsing</PrecompiledHeader>
218 <CompileAsWinRT>false</CompileAsWinRT>
219 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
220 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
221 </ClCompile>
222 <Link>
223 <SubSystem>Console</SubSystem>
224 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
225 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
226 </Link>
227 </ItemDefinitionGroup>
228 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
229 <ClCompile>
230 <PrecompiledHeader>NotUsing</PrecompiledHeader>
231 <CompileAsWinRT>false</CompileAsWinRT>
232 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
233 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
234 </ClCompile>
235 <Link>
236 <SubSystem>Console</SubSystem>
237 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
238 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
239 </Link>
240 </ItemDefinitionGroup>
241 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
242 <ClCompile>
243 <PrecompiledHeader>NotUsing</PrecompiledHeader>
244 <CompileAsWinRT>false</CompileAsWinRT>
245 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
246 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
247 </ClCompile>
248 <Link>
249 <SubSystem>Console</SubSystem>
250 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
251 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
252 </Link>
253 </ItemDefinitionGroup>
254 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
255 <ClCompile>
256 <PrecompiledHeader>NotUsing</PrecompiledHeader>
257 <CompileAsWinRT>false</CompileAsWinRT>
258 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
259 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
260 </ClCompile>
261 <Link>
262 <SubSystem>Console</SubSystem>
263 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
264 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
265 </Link>
266 </ItemDefinitionGroup>
267 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
268 <ClCompile>
269 <PrecompiledHeader>NotUsing</PrecompiledHeader>
270 <CompileAsWinRT>false</CompileAsWinRT>
271 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
272 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
273 </ClCompile>
274 <Link>
275 <SubSystem>Console</SubSystem>
276 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
277 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
278 </Link>
279 </ItemDefinitionGroup>
280 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
281 <ImportGroup Label="ExtensionTargets">
282 </ImportGroup>
283 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\effects_internal.c" />
4 <ClCompile Include="..\..\effect_position.c" />
5 <ClCompile Include="..\..\effect_stereoreverse.c" />
6 <ClCompile Include="..\..\load_aiff.c" />
7 <ClCompile Include="..\..\load_voc.c" />
8 <ClCompile Include="..\..\mixer.c" />
9 <ClCompile Include="..\..\music.c" />
10 <ClCompile Include="..\..\music_cmd.c" />
11 <ClCompile Include="..\..\music_flac.c" />
12 <ClCompile Include="..\..\music_fluidsynth.c" />
13 <ClCompile Include="..\..\music_mad.c" />
14 <ClCompile Include="..\..\music_mikmod.c" />
15 <ClCompile Include="..\..\music_modplug.c" />
16 <ClCompile Include="..\..\music_mpg123.c" />
17 <ClCompile Include="..\..\music_nativemidi.c" />
18 <ClCompile Include="..\..\music_ogg.c" />
19 <ClCompile Include="..\..\music_smpeg.c" />
20 <ClCompile Include="..\..\music_timidity.c" />
21 <ClCompile Include="..\..\music_wav.c" />
22 <ClCompile Include="..\..\timidity\common.c">
23 <Filter>Timidity</Filter>
24 </ClCompile>
25 <ClCompile Include="..\..\timidity\instrum.c">
26 <Filter>Timidity</Filter>
27 </ClCompile>
28 <ClCompile Include="..\..\timidity\mix.c">
29 <Filter>Timidity</Filter>
30 </ClCompile>
31 <ClCompile Include="..\..\timidity\output.c">
32 <Filter>Timidity</Filter>
33 </ClCompile>
34 <ClCompile Include="..\..\timidity\playmidi.c">
35 <Filter>Timidity</Filter>
36 </ClCompile>
37 <ClCompile Include="..\..\timidity\readmidi.c">
38 <Filter>Timidity</Filter>
39 </ClCompile>
40 <ClCompile Include="..\..\timidity\resample.c">
41 <Filter>Timidity</Filter>
42 </ClCompile>
43 <ClCompile Include="..\..\timidity\tables.c">
44 <Filter>Timidity</Filter>
45 </ClCompile>
46 <ClCompile Include="..\..\timidity\timidity.c">
47 <Filter>Timidity</Filter>
48 </ClCompile>
49 </ItemGroup>
50 <ItemGroup>
51 <ClInclude Include="..\..\effects_internal.h" />
52 <ClInclude Include="..\..\load_aiff.h" />
53 <ClInclude Include="..\..\load_voc.h" />
54 <ClInclude Include="..\..\mixer.h" />
55 <ClInclude Include="..\..\music.h" />
56 <ClInclude Include="..\..\music_cmd.h" />
57 <ClInclude Include="..\..\music_flac.h" />
58 <ClInclude Include="..\..\music_fluidsynth.h" />
59 <ClInclude Include="..\..\music_mad.h" />
60 <ClInclude Include="..\..\music_mikmod.h" />
61 <ClInclude Include="..\..\music_modplug.h" />
62 <ClInclude Include="..\..\music_mpg123.h" />
63 <ClInclude Include="..\..\music_nativemidi.h" />
64 <ClInclude Include="..\..\music_ogg.h" />
65 <ClInclude Include="..\..\music_smpeg.h" />
66 <ClInclude Include="..\..\music_timidity.h" />
67 <ClInclude Include="..\..\music_wav.h" />
68 <ClInclude Include="..\..\SDL_mixer.h" />
69 <ClInclude Include="..\..\timidity\common.h">
70 <Filter>Timidity</Filter>
71 </ClInclude>
72 <ClInclude Include="..\..\timidity\instrum.h">
73 <Filter>Timidity</Filter>
74 </ClInclude>
75 <ClInclude Include="..\..\timidity\mix.h">
76 <Filter>Timidity</Filter>
77 </ClInclude>
78 <ClInclude Include="..\..\timidity\options.h">
79 <Filter>Timidity</Filter>
80 </ClInclude>
81 <ClInclude Include="..\..\timidity\output.h">
82 <Filter>Timidity</Filter>
83 </ClInclude>
84 <ClInclude Include="..\..\timidity\playmidi.h">
85 <Filter>Timidity</Filter>
86 </ClInclude>
87 <ClInclude Include="..\..\timidity\readmidi.h">
88 <Filter>Timidity</Filter>
89 </ClInclude>
90 <ClInclude Include="..\..\timidity\resample.h">
91 <Filter>Timidity</Filter>
92 </ClInclude>
93 <ClInclude Include="..\..\timidity\tables.h">
94 <Filter>Timidity</Filter>
95 </ClInclude>
96 <ClInclude Include="..\..\timidity\timidity.h">
97 <Filter>Timidity</Filter>
98 </ClInclude>
99 </ItemGroup>
100 <ItemGroup>
101 <Filter Include="Timidity">
102 <UniqueIdentifier>{76edff39-58d9-4391-b729-e34269a68b5a}</UniqueIdentifier>
103 </Filter>
104 </ItemGroup>
105 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <PropertyGroup Label="Globals">
29 <ProjectName>libogg_dynamic-WinRT80</ProjectName>
30 <ProjectGuid>{15CBFEFF-7965-41F5-B4E2-21E8795C9159}</ProjectGuid>
31 <RootNamespace>libogg</RootNamespace>
32 <Keyword>Win32Proj</Keyword>
33 </PropertyGroup>
34 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
35 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36 <ConfigurationType>DynamicLibrary</ConfigurationType>
37 <CharacterSet>Unicode</CharacterSet>
38 <WholeProgramOptimization>true</WholeProgramOptimization>
39 <PlatformToolset>v110</PlatformToolset>
40 <WindowsAppContainer>true</WindowsAppContainer>
41 </PropertyGroup>
42 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
43 <ConfigurationType>DynamicLibrary</ConfigurationType>
44 <CharacterSet>Unicode</CharacterSet>
45 <WholeProgramOptimization>true</WholeProgramOptimization>
46 <PlatformToolset>v110</PlatformToolset>
47 <WindowsAppContainer>true</WindowsAppContainer>
48 </PropertyGroup>
49 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
50 <ConfigurationType>DynamicLibrary</ConfigurationType>
51 <CharacterSet>Unicode</CharacterSet>
52 <PlatformToolset>v110</PlatformToolset>
53 <WindowsAppContainer>true</WindowsAppContainer>
54 </PropertyGroup>
55 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
56 <ConfigurationType>DynamicLibrary</ConfigurationType>
57 <CharacterSet>Unicode</CharacterSet>
58 <PlatformToolset>v110</PlatformToolset>
59 <WindowsAppContainer>true</WindowsAppContainer>
60 </PropertyGroup>
61 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
62 <ConfigurationType>DynamicLibrary</ConfigurationType>
63 <CharacterSet>Unicode</CharacterSet>
64 <WholeProgramOptimization>true</WholeProgramOptimization>
65 <PlatformToolset>v110</PlatformToolset>
66 <WindowsAppContainer>true</WindowsAppContainer>
67 </PropertyGroup>
68 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
69 <ConfigurationType>DynamicLibrary</ConfigurationType>
70 <CharacterSet>Unicode</CharacterSet>
71 <PlatformToolset>v110</PlatformToolset>
72 <WindowsAppContainer>true</WindowsAppContainer>
73 </PropertyGroup>
74 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
75 <ImportGroup Label="ExtensionSettings">
76 </ImportGroup>
77 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
78 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
79 </ImportGroup>
80 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
81 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
82 </ImportGroup>
83 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
84 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
85 </ImportGroup>
86 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
87 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
88 </ImportGroup>
89 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
90 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
91 </ImportGroup>
92 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
93 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
94 </ImportGroup>
95 <PropertyGroup Label="UserMacros" />
96 <PropertyGroup>
97 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
98 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
99 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
100 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
101 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
102 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
103 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
104 </PropertyGroup>
105 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
106 <TargetName>libogg</TargetName>
107 </PropertyGroup>
108 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
109 <TargetName>libogg</TargetName>
110 </PropertyGroup>
111 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
112 <TargetName>libogg</TargetName>
113 </PropertyGroup>
114 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
115 <TargetName>libogg</TargetName>
116 </PropertyGroup>
117 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
118 <TargetName>libogg</TargetName>
119 </PropertyGroup>
120 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
121 <TargetName>libogg</TargetName>
122 </PropertyGroup>
123 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
124 <ClCompile>
125 <Optimization>Disabled</Optimization>
126 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
127 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
128 <MinimalRebuild>true</MinimalRebuild>
129 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
130 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
131 <PrecompiledHeader>
132 </PrecompiledHeader>
133 <WarningLevel>Level4</WarningLevel>
134 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
135 <CompileAs>CompileAsC</CompileAs>
136 <CallingConvention>Cdecl</CallingConvention>
137 </ClCompile>
138 <Link>
139 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
140 </Link>
141 </ItemDefinitionGroup>
142 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
143 <ClCompile>
144 <Optimization>Disabled</Optimization>
145 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
146 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
147 <MinimalRebuild>true</MinimalRebuild>
148 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
149 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
150 <PrecompiledHeader>
151 </PrecompiledHeader>
152 <WarningLevel>Level4</WarningLevel>
153 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
154 <CompileAs>CompileAsC</CompileAs>
155 <CallingConvention>Cdecl</CallingConvention>
156 </ClCompile>
157 <Link>
158 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
159 </Link>
160 </ItemDefinitionGroup>
161 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
162 <Midl>
163 <TargetEnvironment>X64</TargetEnvironment>
164 </Midl>
165 <ClCompile>
166 <Optimization>Disabled</Optimization>
167 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
168 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
169 <MinimalRebuild>true</MinimalRebuild>
170 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
171 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
172 <PrecompiledHeader>
173 </PrecompiledHeader>
174 <WarningLevel>Level4</WarningLevel>
175 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
176 <CompileAs>CompileAsC</CompileAs>
177 <CallingConvention>Cdecl</CallingConvention>
178 </ClCompile>
179 <Link>
180 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
181 </Link>
182 </ItemDefinitionGroup>
183 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
184 <ClCompile>
185 <Optimization>MaxSpeed</Optimization>
186 <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
187 <IntrinsicFunctions>true</IntrinsicFunctions>
188 <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
189 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
190 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
191 <StringPooling>true</StringPooling>
192 <ExceptionHandling>
193 </ExceptionHandling>
194 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
195 <BufferSecurityCheck>false</BufferSecurityCheck>
196 <PrecompiledHeader>
197 </PrecompiledHeader>
198 <WarningLevel>Level4</WarningLevel>
199 <DebugInformationFormat>
200 </DebugInformationFormat>
201 <CompileAs>CompileAsC</CompileAs>
202 <DisableSpecificWarnings>4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
203 <CallingConvention>Cdecl</CallingConvention>
204 </ClCompile>
205 <Link>
206 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
207 </Link>
208 </ItemDefinitionGroup>
209 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
210 <ClCompile>
211 <Optimization>MaxSpeed</Optimization>
212 <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
213 <IntrinsicFunctions>true</IntrinsicFunctions>
214 <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
215 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
216 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
217 <StringPooling>true</StringPooling>
218 <ExceptionHandling>
219 </ExceptionHandling>
220 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
221 <BufferSecurityCheck>false</BufferSecurityCheck>
222 <PrecompiledHeader>
223 </PrecompiledHeader>
224 <WarningLevel>Level4</WarningLevel>
225 <DebugInformationFormat>
226 </DebugInformationFormat>
227 <CompileAs>CompileAsC</CompileAs>
228 <DisableSpecificWarnings>4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
229 <CallingConvention>Cdecl</CallingConvention>
230 </ClCompile>
231 <Link>
232 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
233 </Link>
234 </ItemDefinitionGroup>
235 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
236 <Midl>
237 <TargetEnvironment>X64</TargetEnvironment>
238 </Midl>
239 <ClCompile>
240 <Optimization>MaxSpeed</Optimization>
241 <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
242 <IntrinsicFunctions>true</IntrinsicFunctions>
243 <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
244 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
245 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
246 <StringPooling>true</StringPooling>
247 <ExceptionHandling>
248 </ExceptionHandling>
249 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
250 <BufferSecurityCheck>false</BufferSecurityCheck>
251 <PrecompiledHeader>
252 </PrecompiledHeader>
253 <WarningLevel>Level4</WarningLevel>
254 <DebugInformationFormat>
255 </DebugInformationFormat>
256 <CompileAs>CompileAsC</CompileAs>
257 <DisableSpecificWarnings>4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
258 <CallingConvention>Cdecl</CallingConvention>
259 </ClCompile>
260 <Link>
261 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
262 </Link>
263 </ItemDefinitionGroup>
264 <ItemGroup>
265 <ClCompile Include="..\..\external\libogg-1.3.2\src\bitwise.c" />
266 <ClCompile Include="..\..\external\libogg-1.3.2\src\framing.c" />
267 </ItemGroup>
268 <ItemGroup>
269 <None Include="..\..\external\libogg-1.3.2\win32\ogg.def" />
270 </ItemGroup>
271 <ItemGroup>
272 <ClInclude Include="..\..\external\libogg-1.3.2\include\ogg\ogg.h" />
273 <ClInclude Include="..\..\external\libogg-1.3.2\include\ogg\os_types.h" />
274 </ItemGroup>
275 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
276 <ImportGroup Label="ExtensionTargets">
277 </ImportGroup>
278 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <PropertyGroup Label="Globals">
29 <ProjectName>libvorbis_dynamic-WinRT80</ProjectName>
30 <ProjectGuid>{3A214E06-B95E-4D61-A291-1F8DF2EC10FD}</ProjectGuid>
31 <RootNamespace>libvorbis</RootNamespace>
32 <Keyword>Win32Proj</Keyword>
33 </PropertyGroup>
34 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
35 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36 <ConfigurationType>DynamicLibrary</ConfigurationType>
37 <CharacterSet>Unicode</CharacterSet>
38 <WholeProgramOptimization>true</WholeProgramOptimization>
39 <PlatformToolset>v110</PlatformToolset>
40 <WindowsAppContainer>true</WindowsAppContainer>
41 </PropertyGroup>
42 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
43 <ConfigurationType>DynamicLibrary</ConfigurationType>
44 <CharacterSet>Unicode</CharacterSet>
45 <WholeProgramOptimization>true</WholeProgramOptimization>
46 <PlatformToolset>v110</PlatformToolset>
47 <WindowsAppContainer>true</WindowsAppContainer>
48 </PropertyGroup>
49 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
50 <ConfigurationType>DynamicLibrary</ConfigurationType>
51 <CharacterSet>Unicode</CharacterSet>
52 <PlatformToolset>v110</PlatformToolset>
53 <WindowsAppContainer>true</WindowsAppContainer>
54 </PropertyGroup>
55 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
56 <ConfigurationType>DynamicLibrary</ConfigurationType>
57 <CharacterSet>Unicode</CharacterSet>
58 <PlatformToolset>v110</PlatformToolset>
59 <WindowsAppContainer>true</WindowsAppContainer>
60 </PropertyGroup>
61 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
62 <ConfigurationType>DynamicLibrary</ConfigurationType>
63 <CharacterSet>Unicode</CharacterSet>
64 <WholeProgramOptimization>true</WholeProgramOptimization>
65 <PlatformToolset>v110</PlatformToolset>
66 <WindowsAppContainer>true</WindowsAppContainer>
67 </PropertyGroup>
68 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
69 <ConfigurationType>DynamicLibrary</ConfigurationType>
70 <CharacterSet>Unicode</CharacterSet>
71 <PlatformToolset>v110</PlatformToolset>
72 <WindowsAppContainer>true</WindowsAppContainer>
73 </PropertyGroup>
74 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
75 <ImportGroup Label="ExtensionSettings">
76 </ImportGroup>
77 <PropertyGroup Label="UserMacros" />
78 <PropertyGroup>
79 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
80 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
81 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
82 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
83 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</LinkIncremental>
84 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
85 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
86 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
87 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
88 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
89 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</LinkIncremental>
90 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
91 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
92 </PropertyGroup>
93 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
94 <TargetName>libvorbis</TargetName>
95 </PropertyGroup>
96 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
97 <TargetName>libvorbis</TargetName>
98 </PropertyGroup>
99 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
100 <TargetName>libvorbis</TargetName>
101 </PropertyGroup>
102 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
103 <TargetName>libvorbis</TargetName>
104 </PropertyGroup>
105 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
106 <TargetName>libvorbis</TargetName>
107 </PropertyGroup>
108 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
109 <TargetName>libvorbis</TargetName>
110 </PropertyGroup>
111 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
112 <ClCompile>
113 <Optimization>Disabled</Optimization>
114 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
115 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
116 <MinimalRebuild>true</MinimalRebuild>
117 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
118 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
119 <PrecompiledHeader>
120 </PrecompiledHeader>
121 <WarningLevel>Level4</WarningLevel>
122 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
123 <CompileAs>CompileAsC</CompileAs>
124 <CallingConvention>Cdecl</CallingConvention>
125 </ClCompile>
126 <Link>
127 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
128 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
129 <GenerateDebugInformation>true</GenerateDebugInformation>
130 <ProgramDatabaseFile>$(OutDir)libvorbis.pdb</ProgramDatabaseFile>
131 <SubSystem>Windows</SubSystem>
132 <TargetMachine>MachineX86</TargetMachine>
133 </Link>
134 </ItemDefinitionGroup>
135 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
136 <ClCompile>
137 <Optimization>Disabled</Optimization>
138 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
139 <PreprocessorDefinitions>WIN32;_WIN32_WCE;_DEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
140 <MinimalRebuild>true</MinimalRebuild>
141 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
142 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
143 <PrecompiledHeader>
144 </PrecompiledHeader>
145 <WarningLevel>Level4</WarningLevel>
146 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
147 <CompileAs>CompileAsC</CompileAs>
148 <CallingConvention>Cdecl</CallingConvention>
149 </ClCompile>
150 <Link>
151 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
152 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
153 <GenerateDebugInformation>true</GenerateDebugInformation>
154 <ProgramDatabaseFile>$(OutDir)libvorbis.pdb</ProgramDatabaseFile>
155 <SubSystem>Windows</SubSystem>
156 </Link>
157 </ItemDefinitionGroup>
158 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
159 <Midl>
160 <TargetEnvironment>X64</TargetEnvironment>
161 </Midl>
162 <ClCompile>
163 <Optimization>Disabled</Optimization>
164 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
165 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
166 <MinimalRebuild>true</MinimalRebuild>
167 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
168 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
169 <PrecompiledHeader>
170 </PrecompiledHeader>
171 <WarningLevel>Level4</WarningLevel>
172 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
173 <CompileAs>CompileAsC</CompileAs>
174 <CallingConvention>Cdecl</CallingConvention>
175 </ClCompile>
176 <Link>
177 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
178 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
179 <GenerateDebugInformation>true</GenerateDebugInformation>
180 <ProgramDatabaseFile>$(OutDir)libvorbis.pdb</ProgramDatabaseFile>
181 <SubSystem>Windows</SubSystem>
182 <TargetMachine>MachineX64</TargetMachine>
183 </Link>
184 </ItemDefinitionGroup>
185 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
186 <ClCompile>
187 <Optimization>Full</Optimization>
188 <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
189 <IntrinsicFunctions>true</IntrinsicFunctions>
190 <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
191 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
192 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
193 <StringPooling>true</StringPooling>
194 <ExceptionHandling>
195 </ExceptionHandling>
196 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
197 <BufferSecurityCheck>false</BufferSecurityCheck>
198 <PrecompiledHeader>
199 </PrecompiledHeader>
200 <WarningLevel>Level4</WarningLevel>
201 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
202 <CompileAs>CompileAsC</CompileAs>
203 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
204 <CallingConvention>Cdecl</CallingConvention>
205 </ClCompile>
206 <Link>
207 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
208 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
209 <GenerateDebugInformation>false</GenerateDebugInformation>
210 <SubSystem>Windows</SubSystem>
211 <OptimizeReferences>true</OptimizeReferences>
212 <EnableCOMDATFolding>true</EnableCOMDATFolding>
213 <TargetMachine>MachineX86</TargetMachine>
214 </Link>
215 </ItemDefinitionGroup>
216 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
217 <ClCompile>
218 <Optimization>Full</Optimization>
219 <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
220 <IntrinsicFunctions>true</IntrinsicFunctions>
221 <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
222 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
223 <PreprocessorDefinitions>WIN32;_WIN32_WCE;NDEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
224 <StringPooling>true</StringPooling>
225 <ExceptionHandling>
226 </ExceptionHandling>
227 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
228 <BufferSecurityCheck>false</BufferSecurityCheck>
229 <PrecompiledHeader>
230 </PrecompiledHeader>
231 <WarningLevel>Level4</WarningLevel>
232 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
233 <CompileAs>CompileAsC</CompileAs>
234 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
235 <CallingConvention>Cdecl</CallingConvention>
236 </ClCompile>
237 <Link>
238 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
239 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
240 <GenerateDebugInformation>false</GenerateDebugInformation>
241 <SubSystem>Windows</SubSystem>
242 <OptimizeReferences>true</OptimizeReferences>
243 <EnableCOMDATFolding>true</EnableCOMDATFolding>
244 </Link>
245 </ItemDefinitionGroup>
246 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
247 <Midl>
248 <TargetEnvironment>X64</TargetEnvironment>
249 </Midl>
250 <ClCompile>
251 <Optimization>Full</Optimization>
252 <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
253 <IntrinsicFunctions>true</IntrinsicFunctions>
254 <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
255 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
256 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
257 <StringPooling>true</StringPooling>
258 <ExceptionHandling>
259 </ExceptionHandling>
260 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
261 <BufferSecurityCheck>false</BufferSecurityCheck>
262 <PrecompiledHeader>
263 </PrecompiledHeader>
264 <WarningLevel>Level4</WarningLevel>
265 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
266 <CompileAs>CompileAsC</CompileAs>
267 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
268 <CallingConvention>Cdecl</CallingConvention>
269 </ClCompile>
270 <Link>
271 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
272 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
273 <GenerateDebugInformation>false</GenerateDebugInformation>
274 <SubSystem>Windows</SubSystem>
275 <OptimizeReferences>true</OptimizeReferences>
276 <EnableCOMDATFolding>true</EnableCOMDATFolding>
277 <TargetMachine>MachineX64</TargetMachine>
278 </Link>
279 </ItemDefinitionGroup>
280 <ItemGroup>
281 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\analysis.c" />
282 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\bitrate.c" />
283 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\block.c" />
284 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\codebook.c" />
285 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\envelope.c" />
286 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\floor0.c" />
287 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\floor1.c" />
288 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\info.c" />
289 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lookup.c" />
290 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lpc.c" />
291 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lsp.c" />
292 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\mapping0.c" />
293 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\mdct.c" />
294 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\psy.c" />
295 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\registry.c" />
296 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\res0.c" />
297 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\sharedbook.c" />
298 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\smallft.c" />
299 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\synthesis.c" />
300 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\vorbisenc.c" />
301 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\window.c" />
302 </ItemGroup>
303 <ItemGroup>
304 <None Include="..\..\external\libvorbis-1.3.5\win32\vorbis.def" />
305 </ItemGroup>
306 <ItemGroup>
307 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\backends.h" />
308 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\bitrate.h" />
309 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\codebook.h" />
310 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\codec.h" />
311 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\codec_internal.h" />
312 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\envelope.h" />
313 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\floor_all.h" />
314 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\floor\floor_books.h" />
315 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\highlevel.h" />
316 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lookup.h" />
317 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lookup_data.h" />
318 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lpc.h" />
319 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lsp.h" />
320 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\masking.h" />
321 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\mdct.h" />
322 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\misc.h" />
323 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\os.h" />
324 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\psy.h" />
325 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_11.h" />
326 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_16.h" />
327 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_44.h" />
328 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_8.h" />
329 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\registry.h" />
330 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\coupled\res_books_stereo.h" />
331 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\uncoupled\res_books_uncoupled.h" />
332 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_16.h" />
333 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_44.h" />
334 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_44u.h" />
335 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_8.h" />
336 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\scales.h" />
337 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_11.h" />
338 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_16.h" />
339 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_22.h" />
340 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_32.h" />
341 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_44.h" />
342 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_44u.h" />
343 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_8.h" />
344 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_X.h" />
345 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\smallft.h" />
346 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisenc.h" />
347 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisfile.h" />
348 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\window.h" />
349 </ItemGroup>
350 <ItemGroup>
351 <ProjectReference Include="libogg_dynamic-WinRT80.vcxproj">
352 <Project>{15cbfeff-7965-41f5-b4e2-21e8795c9159}</Project>
353 </ProjectReference>
354 </ItemGroup>
355 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
356 <ImportGroup Label="ExtensionTargets">
357 </ImportGroup>
358 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <PropertyGroup Label="Globals">
29 <ProjectName>libvorbisfile_dynamic-WinRT80</ProjectName>
30 <ProjectGuid>{CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}</ProjectGuid>
31 <RootNamespace>libvorbisfile</RootNamespace>
32 <Keyword>Win32Proj</Keyword>
33 </PropertyGroup>
34 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
35 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36 <ConfigurationType>DynamicLibrary</ConfigurationType>
37 <CharacterSet>Unicode</CharacterSet>
38 <PlatformToolset>v110</PlatformToolset>
39 <WindowsAppContainer>true</WindowsAppContainer>
40 </PropertyGroup>
41 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
42 <ConfigurationType>DynamicLibrary</ConfigurationType>
43 <CharacterSet>Unicode</CharacterSet>
44 <PlatformToolset>v110</PlatformToolset>
45 <WindowsAppContainer>true</WindowsAppContainer>
46 </PropertyGroup>
47 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
48 <ConfigurationType>DynamicLibrary</ConfigurationType>
49 <CharacterSet>Unicode</CharacterSet>
50 <PlatformToolset>v110</PlatformToolset>
51 <WindowsAppContainer>true</WindowsAppContainer>
52 </PropertyGroup>
53 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
54 <ConfigurationType>DynamicLibrary</ConfigurationType>
55 <CharacterSet>Unicode</CharacterSet>
56 <PlatformToolset>v110</PlatformToolset>
57 <WindowsAppContainer>true</WindowsAppContainer>
58 </PropertyGroup>
59 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
60 <ConfigurationType>DynamicLibrary</ConfigurationType>
61 <CharacterSet>Unicode</CharacterSet>
62 <PlatformToolset>v110</PlatformToolset>
63 <WindowsAppContainer>true</WindowsAppContainer>
64 </PropertyGroup>
65 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
66 <ConfigurationType>DynamicLibrary</ConfigurationType>
67 <CharacterSet>Unicode</CharacterSet>
68 <PlatformToolset>v110</PlatformToolset>
69 <WindowsAppContainer>true</WindowsAppContainer>
70 </PropertyGroup>
71 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
72 <ImportGroup Label="ExtensionSettings">
73 </ImportGroup>
74 <PropertyGroup Label="UserMacros" />
75 <PropertyGroup>
76 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
77 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
78 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
79 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
80 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
81 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</LinkIncremental>
82 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
83 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
84 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
85 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
86 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
87 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
88 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
89 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</LinkIncremental>
90 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
91 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
92 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
93 </PropertyGroup>
94 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
95 <TargetName>libvorbisfile</TargetName>
96 </PropertyGroup>
97 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
98 <TargetName>libvorbisfile</TargetName>
99 </PropertyGroup>
100 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
101 <TargetName>libvorbisfile</TargetName>
102 </PropertyGroup>
103 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
104 <TargetName>libvorbisfile</TargetName>
105 </PropertyGroup>
106 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
107 <TargetName>libvorbisfile</TargetName>
108 </PropertyGroup>
109 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
110 <TargetName>libvorbisfile</TargetName>
111 </PropertyGroup>
112 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
113 <ClCompile>
114 <Optimization>Disabled</Optimization>
115 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
116 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBVORBISFILE_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
117 <MinimalRebuild>true</MinimalRebuild>
118 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
119 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
120 <PrecompiledHeader>
121 </PrecompiledHeader>
122 <WarningLevel>Level3</WarningLevel>
123 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
124 <CallingConvention>Cdecl</CallingConvention>
125 </ClCompile>
126 <Link>
127 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
128 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
129 <GenerateDebugInformation>true</GenerateDebugInformation>
130 <ProgramDatabaseFile>$(OutDir)libvorbisfile.pdb</ProgramDatabaseFile>
131 <SubSystem>Windows</SubSystem>
132 <TargetMachine>MachineX86</TargetMachine>
133 </Link>
134 </ItemDefinitionGroup>
135 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
136 <ClCompile>
137 <Optimization>Disabled</Optimization>
138 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
139 <PreprocessorDefinitions>WIN32;_WIN32_WCE;_DEBUG;_WINDOWS;_USRDLL;LIBVORBISFILE_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
140 <MinimalRebuild>true</MinimalRebuild>
141 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
142 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
143 <PrecompiledHeader>
144 </PrecompiledHeader>
145 <WarningLevel>Level3</WarningLevel>
146 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
147 <CallingConvention>Cdecl</CallingConvention>
148 </ClCompile>
149 <Link>
150 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
151 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
152 <GenerateDebugInformation>true</GenerateDebugInformation>
153 <ProgramDatabaseFile>$(OutDir)libvorbisfile.pdb</ProgramDatabaseFile>
154 <SubSystem>Windows</SubSystem>
155 </Link>
156 </ItemDefinitionGroup>
157 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
158 <Midl>
159 <TargetEnvironment>X64</TargetEnvironment>
160 </Midl>
161 <ClCompile>
162 <Optimization>Disabled</Optimization>
163 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
164 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBVORBISFILE_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
165 <MinimalRebuild>true</MinimalRebuild>
166 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
167 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
168 <PrecompiledHeader>
169 </PrecompiledHeader>
170 <WarningLevel>Level3</WarningLevel>
171 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
172 <CallingConvention>Cdecl</CallingConvention>
173 </ClCompile>
174 <Link>
175 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
176 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
177 <GenerateDebugInformation>true</GenerateDebugInformation>
178 <ProgramDatabaseFile>$(OutDir)libvorbisfile.pdb</ProgramDatabaseFile>
179 <SubSystem>Windows</SubSystem>
180 <TargetMachine>MachineX64</TargetMachine>
181 </Link>
182 </ItemDefinitionGroup>
183 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
184 <ClCompile>
185 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
186 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBVORBISFILE_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
187 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
188 <PrecompiledHeader>
189 </PrecompiledHeader>
190 <WarningLevel>Level3</WarningLevel>
191 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
192 <CallingConvention>Cdecl</CallingConvention>
193 </ClCompile>
194 <Link>
195 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
196 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
197 <GenerateDebugInformation>false</GenerateDebugInformation>
198 <SubSystem>Windows</SubSystem>
199 <OptimizeReferences>true</OptimizeReferences>
200 <EnableCOMDATFolding>true</EnableCOMDATFolding>
201 <TargetMachine>MachineX86</TargetMachine>
202 </Link>
203 </ItemDefinitionGroup>
204 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
205 <ClCompile>
206 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
207 <PreprocessorDefinitions>WIN32;_WIN32_WCE;NDEBUG;_WINDOWS;_USRDLL;LIBVORBISFILE_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
208 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
209 <PrecompiledHeader>
210 </PrecompiledHeader>
211 <WarningLevel>Level3</WarningLevel>
212 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
213 <CallingConvention>Cdecl</CallingConvention>
214 </ClCompile>
215 <Link>
216 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
217 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
218 <GenerateDebugInformation>false</GenerateDebugInformation>
219 <SubSystem>Windows</SubSystem>
220 <OptimizeReferences>true</OptimizeReferences>
221 <EnableCOMDATFolding>true</EnableCOMDATFolding>
222 </Link>
223 </ItemDefinitionGroup>
224 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
225 <Midl>
226 <TargetEnvironment>X64</TargetEnvironment>
227 </Midl>
228 <ClCompile>
229 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
230 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBVORBISFILE_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
231 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
232 <PrecompiledHeader>
233 </PrecompiledHeader>
234 <WarningLevel>Level3</WarningLevel>
235 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
236 <CallingConvention>Cdecl</CallingConvention>
237 </ClCompile>
238 <Link>
239 <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
240 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
241 <GenerateDebugInformation>false</GenerateDebugInformation>
242 <SubSystem>Windows</SubSystem>
243 <OptimizeReferences>true</OptimizeReferences>
244 <EnableCOMDATFolding>true</EnableCOMDATFolding>
245 <TargetMachine>MachineX64</TargetMachine>
246 </Link>
247 </ItemDefinitionGroup>
248 <ItemGroup>
249 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\vorbisfile.c" />
250 </ItemGroup>
251 <ItemGroup>
252 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisfile.h" />
253 </ItemGroup>
254 <ItemGroup>
255 <ProjectReference Include="libogg_dynamic-WinRT80.vcxproj">
256 <Project>{15cbfeff-7965-41f5-b4e2-21e8795c9159}</Project>
257 </ProjectReference>
258 <ProjectReference Include="libvorbis_dynamic-WinRT80.vcxproj">
259 <Project>{3a214e06-b95e-4d61-a291-1f8df2ec10fd}</Project>
260 </ProjectReference>
261 </ItemGroup>
262 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
263 <ImportGroup Label="ExtensionTargets">
264 </ImportGroup>
265 </Project>
0 
1 Microsoft Visual Studio Solution File, Format Version 12.00
2 # Visual Studio 2013
3 VisualStudioVersion = 12.0.40629.0
4 MinimumVisualStudioVersion = 10.0.40219.1
5 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2_mixer-WinRT81", "SDL_mixer-WinRT81.vcxproj", "{3A833C7A-C776-4202-9DBD-BC879B23C605}"
6 EndProject
7 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libogg_dynamic-WinRT81", "libogg_dynamic-WinRT81.vcxproj", "{6BC6349C-E355-4F1C-9290-FF755114A84B}"
8 EndProject
9 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbis_dynamic-WinRT81", "libvorbis_dynamic-WinRT81.vcxproj", "{E3AB27F1-EB89-4C65-85DF-CB6A4F805753}"
10 EndProject
11 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbisfile_dynamic-WinRT81", "libvorbisfile_dynamic-WinRT81.vcxproj", "{936B2819-2364-45D9-901D-52878914FAFA}"
12 EndProject
13 Global
14 GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 Debug|ARM = Debug|ARM
16 Debug|Win32 = Debug|Win32
17 Debug|x64 = Debug|x64
18 Release|ARM = Release|ARM
19 Release|Win32 = Release|Win32
20 Release|x64 = Release|x64
21 EndGlobalSection
22 GlobalSection(ProjectConfigurationPlatforms) = postSolution
23 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Debug|ARM.ActiveCfg = Debug|ARM
24 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Debug|ARM.Build.0 = Debug|ARM
25 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Debug|Win32.ActiveCfg = Debug|Win32
26 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Debug|Win32.Build.0 = Debug|Win32
27 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Debug|x64.ActiveCfg = Debug|x64
28 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Debug|x64.Build.0 = Debug|x64
29 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Release|ARM.ActiveCfg = Release|ARM
30 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Release|ARM.Build.0 = Release|ARM
31 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Release|Win32.ActiveCfg = Release|Win32
32 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Release|Win32.Build.0 = Release|Win32
33 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Release|x64.ActiveCfg = Release|x64
34 {3A833C7A-C776-4202-9DBD-BC879B23C605}.Release|x64.Build.0 = Release|x64
35 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Debug|ARM.ActiveCfg = Debug|ARM
36 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Debug|ARM.Build.0 = Debug|ARM
37 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Debug|Win32.ActiveCfg = Debug|Win32
38 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Debug|Win32.Build.0 = Debug|Win32
39 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Debug|x64.ActiveCfg = Debug|x64
40 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Debug|x64.Build.0 = Debug|x64
41 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Release|ARM.ActiveCfg = Release|ARM
42 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Release|ARM.Build.0 = Release|ARM
43 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Release|Win32.ActiveCfg = Release|Win32
44 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Release|Win32.Build.0 = Release|Win32
45 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Release|x64.ActiveCfg = Release|x64
46 {6BC6349C-E355-4F1C-9290-FF755114A84B}.Release|x64.Build.0 = Release|x64
47 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Debug|ARM.ActiveCfg = Debug|ARM
48 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Debug|ARM.Build.0 = Debug|ARM
49 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Debug|Win32.ActiveCfg = Debug|Win32
50 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Debug|Win32.Build.0 = Debug|Win32
51 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Debug|x64.ActiveCfg = Debug|x64
52 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Debug|x64.Build.0 = Debug|x64
53 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Release|ARM.ActiveCfg = Release|ARM
54 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Release|ARM.Build.0 = Release|ARM
55 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Release|Win32.ActiveCfg = Release|Win32
56 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Release|Win32.Build.0 = Release|Win32
57 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Release|x64.ActiveCfg = Release|x64
58 {E3AB27F1-EB89-4C65-85DF-CB6A4F805753}.Release|x64.Build.0 = Release|x64
59 {936B2819-2364-45D9-901D-52878914FAFA}.Debug|ARM.ActiveCfg = Debug|ARM
60 {936B2819-2364-45D9-901D-52878914FAFA}.Debug|ARM.Build.0 = Debug|ARM
61 {936B2819-2364-45D9-901D-52878914FAFA}.Debug|Win32.ActiveCfg = Debug|Win32
62 {936B2819-2364-45D9-901D-52878914FAFA}.Debug|Win32.Build.0 = Debug|Win32
63 {936B2819-2364-45D9-901D-52878914FAFA}.Debug|x64.ActiveCfg = Debug|x64
64 {936B2819-2364-45D9-901D-52878914FAFA}.Debug|x64.Build.0 = Debug|x64
65 {936B2819-2364-45D9-901D-52878914FAFA}.Release|ARM.ActiveCfg = Release|ARM
66 {936B2819-2364-45D9-901D-52878914FAFA}.Release|ARM.Build.0 = Release|ARM
67 {936B2819-2364-45D9-901D-52878914FAFA}.Release|Win32.ActiveCfg = Release|Win32
68 {936B2819-2364-45D9-901D-52878914FAFA}.Release|Win32.Build.0 = Release|Win32
69 {936B2819-2364-45D9-901D-52878914FAFA}.Release|x64.ActiveCfg = Release|x64
70 {936B2819-2364-45D9-901D-52878914FAFA}.Release|x64.Build.0 = Release|x64
71 EndGlobalSection
72 GlobalSection(SolutionProperties) = preSolution
73 HideSolutionNode = FALSE
74 EndGlobalSection
75 EndGlobal
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <ItemGroup>
29 <ProjectReference Include="..\..\..\SDL\VisualC-WinRT\WinRT81_VS2013\SDL-WinRT81.vcxproj">
30 <Project>{c8df6173-06a1-4f56-a9bc-2002596b30e9}</Project>
31 </ProjectReference>
32 <ProjectReference Include="libogg_dynamic-WinRT81.vcxproj">
33 <Project>{6bc6349c-e355-4f1c-9290-ff755114a84b}</Project>
34 </ProjectReference>
35 <ProjectReference Include="libvorbisfile_dynamic-WinRT81.vcxproj">
36 <Project>{936b2819-2364-45d9-901d-52878914fafa}</Project>
37 </ProjectReference>
38 <ProjectReference Include="libvorbis_dynamic-WinRT81.vcxproj">
39 <Project>{e3ab27f1-eb89-4c65-85df-cb6a4f805753}</Project>
40 </ProjectReference>
41 </ItemGroup>
42 <ItemGroup>
43 <ClCompile Include="..\..\effects_internal.c" />
44 <ClCompile Include="..\..\effect_position.c" />
45 <ClCompile Include="..\..\effect_stereoreverse.c" />
46 <ClCompile Include="..\..\load_aiff.c" />
47 <ClCompile Include="..\..\load_voc.c" />
48 <ClCompile Include="..\..\mixer.c" />
49 <ClCompile Include="..\..\music.c" />
50 <ClCompile Include="..\..\music_cmd.c" />
51 <ClCompile Include="..\..\music_flac.c" />
52 <ClCompile Include="..\..\music_fluidsynth.c" />
53 <ClCompile Include="..\..\music_mad.c" />
54 <ClCompile Include="..\..\music_mikmod.c" />
55 <ClCompile Include="..\..\music_modplug.c" />
56 <ClCompile Include="..\..\music_mpg123.c" />
57 <ClCompile Include="..\..\music_nativemidi.c" />
58 <ClCompile Include="..\..\music_ogg.c" />
59 <ClCompile Include="..\..\music_smpeg.c" />
60 <ClCompile Include="..\..\music_timidity.c" />
61 <ClCompile Include="..\..\music_wav.c" />
62 <ClCompile Include="..\..\timidity\common.c" />
63 <ClCompile Include="..\..\timidity\instrum.c" />
64 <ClCompile Include="..\..\timidity\mix.c" />
65 <ClCompile Include="..\..\timidity\output.c" />
66 <ClCompile Include="..\..\timidity\playmidi.c" />
67 <ClCompile Include="..\..\timidity\readmidi.c" />
68 <ClCompile Include="..\..\timidity\resample.c" />
69 <ClCompile Include="..\..\timidity\tables.c" />
70 <ClCompile Include="..\..\timidity\timidity.c" />
71 </ItemGroup>
72 <ItemGroup>
73 <ClInclude Include="..\..\effects_internal.h" />
74 <ClInclude Include="..\..\load_aiff.h" />
75 <ClInclude Include="..\..\load_voc.h" />
76 <ClInclude Include="..\..\mixer.h" />
77 <ClInclude Include="..\..\music.h" />
78 <ClInclude Include="..\..\music_cmd.h" />
79 <ClInclude Include="..\..\music_flac.h" />
80 <ClInclude Include="..\..\music_fluidsynth.h" />
81 <ClInclude Include="..\..\music_mad.h" />
82 <ClInclude Include="..\..\music_mikmod.h" />
83 <ClInclude Include="..\..\music_modplug.h" />
84 <ClInclude Include="..\..\music_mpg123.h" />
85 <ClInclude Include="..\..\music_nativemidi.h" />
86 <ClInclude Include="..\..\music_ogg.h" />
87 <ClInclude Include="..\..\music_smpeg.h" />
88 <ClInclude Include="..\..\music_timidity.h" />
89 <ClInclude Include="..\..\music_wav.h" />
90 <ClInclude Include="..\..\SDL_mixer.h" />
91 <ClInclude Include="..\..\timidity\common.h" />
92 <ClInclude Include="..\..\timidity\instrum.h" />
93 <ClInclude Include="..\..\timidity\mix.h" />
94 <ClInclude Include="..\..\timidity\options.h" />
95 <ClInclude Include="..\..\timidity\output.h" />
96 <ClInclude Include="..\..\timidity\playmidi.h" />
97 <ClInclude Include="..\..\timidity\readmidi.h" />
98 <ClInclude Include="..\..\timidity\resample.h" />
99 <ClInclude Include="..\..\timidity\tables.h" />
100 <ClInclude Include="..\..\timidity\timidity.h" />
101 </ItemGroup>
102 <PropertyGroup Label="Globals">
103 <ProjectGuid>{3a833c7a-c776-4202-9dbd-bc879b23c605}</ProjectGuid>
104 <Keyword>Win32Proj</Keyword>
105 <ProjectName>SDL2_mixer-WinRT81</ProjectName>
106 <RootNamespace>SDL2_mixer_WinRT81</RootNamespace>
107 <DefaultLanguage>en-US</DefaultLanguage>
108 <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
109 <AppContainerApplication>true</AppContainerApplication>
110 <ApplicationType>Windows Store</ApplicationType>
111 <ApplicationTypeRevision>8.1</ApplicationTypeRevision>
112 </PropertyGroup>
113 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
114 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
115 <ConfigurationType>DynamicLibrary</ConfigurationType>
116 <UseDebugLibraries>true</UseDebugLibraries>
117 <PlatformToolset>v120</PlatformToolset>
118 </PropertyGroup>
119 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
120 <ConfigurationType>DynamicLibrary</ConfigurationType>
121 <UseDebugLibraries>true</UseDebugLibraries>
122 <PlatformToolset>v120</PlatformToolset>
123 </PropertyGroup>
124 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
125 <ConfigurationType>DynamicLibrary</ConfigurationType>
126 <UseDebugLibraries>true</UseDebugLibraries>
127 <PlatformToolset>v120</PlatformToolset>
128 </PropertyGroup>
129 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
130 <ConfigurationType>DynamicLibrary</ConfigurationType>
131 <UseDebugLibraries>false</UseDebugLibraries>
132 <WholeProgramOptimization>true</WholeProgramOptimization>
133 <PlatformToolset>v120</PlatformToolset>
134 </PropertyGroup>
135 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
136 <ConfigurationType>DynamicLibrary</ConfigurationType>
137 <UseDebugLibraries>false</UseDebugLibraries>
138 <WholeProgramOptimization>true</WholeProgramOptimization>
139 <PlatformToolset>v120</PlatformToolset>
140 </PropertyGroup>
141 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
142 <ConfigurationType>DynamicLibrary</ConfigurationType>
143 <UseDebugLibraries>false</UseDebugLibraries>
144 <WholeProgramOptimization>true</WholeProgramOptimization>
145 <PlatformToolset>v120</PlatformToolset>
146 </PropertyGroup>
147 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
148 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
149 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
150 </ImportGroup>
151 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
152 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
153 </ImportGroup>
154 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
155 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
156 </ImportGroup>
157 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
158 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
159 </ImportGroup>
160 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
161 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
162 </ImportGroup>
163 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
164 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
165 </ImportGroup>
166 <PropertyGroup Label="UserMacros" />
167 <PropertyGroup />
168 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
169 <GenerateManifest>false</GenerateManifest>
170 <IgnoreImportLibrary>false</IgnoreImportLibrary>
171 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
172 <TargetName>SDL2_mixer</TargetName>
173 </PropertyGroup>
174 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
175 <GenerateManifest>false</GenerateManifest>
176 <IgnoreImportLibrary>false</IgnoreImportLibrary>
177 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
178 <TargetName>SDL2_mixer</TargetName>
179 </PropertyGroup>
180 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
181 <GenerateManifest>false</GenerateManifest>
182 <IgnoreImportLibrary>false</IgnoreImportLibrary>
183 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
184 <TargetName>SDL2_mixer</TargetName>
185 </PropertyGroup>
186 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
187 <GenerateManifest>false</GenerateManifest>
188 <IgnoreImportLibrary>false</IgnoreImportLibrary>
189 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
190 <TargetName>SDL2_mixer</TargetName>
191 </PropertyGroup>
192 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
193 <GenerateManifest>false</GenerateManifest>
194 <IgnoreImportLibrary>false</IgnoreImportLibrary>
195 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
196 <TargetName>SDL2_mixer</TargetName>
197 </PropertyGroup>
198 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
199 <GenerateManifest>false</GenerateManifest>
200 <IgnoreImportLibrary>false</IgnoreImportLibrary>
201 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
202 <TargetName>SDL2_mixer</TargetName>
203 </PropertyGroup>
204 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
205 <ClCompile>
206 <PrecompiledHeader>NotUsing</PrecompiledHeader>
207 <CompileAsWinRT>false</CompileAsWinRT>
208 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
209 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
210 </ClCompile>
211 <Link>
212 <SubSystem>Console</SubSystem>
213 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
214 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
215 </Link>
216 </ItemDefinitionGroup>
217 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
218 <ClCompile>
219 <PrecompiledHeader>NotUsing</PrecompiledHeader>
220 <CompileAsWinRT>false</CompileAsWinRT>
221 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
222 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
223 </ClCompile>
224 <Link>
225 <SubSystem>Console</SubSystem>
226 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
227 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
228 </Link>
229 </ItemDefinitionGroup>
230 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
231 <ClCompile>
232 <PrecompiledHeader>NotUsing</PrecompiledHeader>
233 <CompileAsWinRT>false</CompileAsWinRT>
234 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
235 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
236 </ClCompile>
237 <Link>
238 <SubSystem>Console</SubSystem>
239 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
240 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
241 </Link>
242 </ItemDefinitionGroup>
243 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
244 <ClCompile>
245 <PrecompiledHeader>NotUsing</PrecompiledHeader>
246 <CompileAsWinRT>false</CompileAsWinRT>
247 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
248 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
249 </ClCompile>
250 <Link>
251 <SubSystem>Console</SubSystem>
252 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
253 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
254 </Link>
255 </ItemDefinitionGroup>
256 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
257 <ClCompile>
258 <PrecompiledHeader>NotUsing</PrecompiledHeader>
259 <CompileAsWinRT>false</CompileAsWinRT>
260 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
261 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
262 </ClCompile>
263 <Link>
264 <SubSystem>Console</SubSystem>
265 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
266 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
267 </Link>
268 </ItemDefinitionGroup>
269 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
270 <ClCompile>
271 <PrecompiledHeader>NotUsing</PrecompiledHeader>
272 <CompileAsWinRT>false</CompileAsWinRT>
273 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;..\..\external\libvorbis-1.3.5\include;..\..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
274 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_OGG;OGG_DYNAMIC="libvorbisfile.dll";MUSIC_MID_TIMIDITY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
275 </ClCompile>
276 <Link>
277 <SubSystem>Console</SubSystem>
278 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
279 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
280 </Link>
281 </ItemDefinitionGroup>
282 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
283 <ImportGroup Label="ExtensionTargets">
284 </ImportGroup>
285 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\effect_position.c" />
4 <ClCompile Include="..\..\effect_stereoreverse.c" />
5 <ClCompile Include="..\..\effects_internal.c" />
6 <ClCompile Include="..\..\load_aiff.c" />
7 <ClCompile Include="..\..\load_voc.c" />
8 <ClCompile Include="..\..\mixer.c" />
9 <ClCompile Include="..\..\music.c" />
10 <ClCompile Include="..\..\music_cmd.c" />
11 <ClCompile Include="..\..\music_flac.c" />
12 <ClCompile Include="..\..\music_fluidsynth.c" />
13 <ClCompile Include="..\..\music_mad.c" />
14 <ClCompile Include="..\..\music_mikmod.c" />
15 <ClCompile Include="..\..\music_modplug.c" />
16 <ClCompile Include="..\..\music_mpg123.c" />
17 <ClCompile Include="..\..\music_nativemidi.c" />
18 <ClCompile Include="..\..\music_ogg.c" />
19 <ClCompile Include="..\..\music_smpeg.c" />
20 <ClCompile Include="..\..\music_timidity.c" />
21 <ClCompile Include="..\..\music_wav.c" />
22 <ClCompile Include="..\..\timidity\common.c">
23 <Filter>Timidity</Filter>
24 </ClCompile>
25 <ClCompile Include="..\..\timidity\instrum.c">
26 <Filter>Timidity</Filter>
27 </ClCompile>
28 <ClCompile Include="..\..\timidity\mix.c">
29 <Filter>Timidity</Filter>
30 </ClCompile>
31 <ClCompile Include="..\..\timidity\output.c">
32 <Filter>Timidity</Filter>
33 </ClCompile>
34 <ClCompile Include="..\..\timidity\playmidi.c">
35 <Filter>Timidity</Filter>
36 </ClCompile>
37 <ClCompile Include="..\..\timidity\readmidi.c">
38 <Filter>Timidity</Filter>
39 </ClCompile>
40 <ClCompile Include="..\..\timidity\resample.c">
41 <Filter>Timidity</Filter>
42 </ClCompile>
43 <ClCompile Include="..\..\timidity\tables.c">
44 <Filter>Timidity</Filter>
45 </ClCompile>
46 <ClCompile Include="..\..\timidity\timidity.c">
47 <Filter>Timidity</Filter>
48 </ClCompile>
49 </ItemGroup>
50 <ItemGroup>
51 <ClInclude Include="..\..\effects_internal.h" />
52 <ClInclude Include="..\..\load_aiff.h" />
53 <ClInclude Include="..\..\load_voc.h" />
54 <ClInclude Include="..\..\mixer.h" />
55 <ClInclude Include="..\..\music.h" />
56 <ClInclude Include="..\..\music_cmd.h" />
57 <ClInclude Include="..\..\music_flac.h" />
58 <ClInclude Include="..\..\music_fluidsynth.h" />
59 <ClInclude Include="..\..\music_mad.h" />
60 <ClInclude Include="..\..\music_mikmod.h" />
61 <ClInclude Include="..\..\music_modplug.h" />
62 <ClInclude Include="..\..\music_mpg123.h" />
63 <ClInclude Include="..\..\music_nativemidi.h" />
64 <ClInclude Include="..\..\music_ogg.h" />
65 <ClInclude Include="..\..\music_smpeg.h" />
66 <ClInclude Include="..\..\music_timidity.h" />
67 <ClInclude Include="..\..\music_wav.h" />
68 <ClInclude Include="..\..\SDL_mixer.h" />
69 <ClInclude Include="..\..\timidity\common.h">
70 <Filter>Timidity</Filter>
71 </ClInclude>
72 <ClInclude Include="..\..\timidity\instrum.h">
73 <Filter>Timidity</Filter>
74 </ClInclude>
75 <ClInclude Include="..\..\timidity\mix.h">
76 <Filter>Timidity</Filter>
77 </ClInclude>
78 <ClInclude Include="..\..\timidity\options.h">
79 <Filter>Timidity</Filter>
80 </ClInclude>
81 <ClInclude Include="..\..\timidity\output.h">
82 <Filter>Timidity</Filter>
83 </ClInclude>
84 <ClInclude Include="..\..\timidity\playmidi.h">
85 <Filter>Timidity</Filter>
86 </ClInclude>
87 <ClInclude Include="..\..\timidity\readmidi.h">
88 <Filter>Timidity</Filter>
89 </ClInclude>
90 <ClInclude Include="..\..\timidity\resample.h">
91 <Filter>Timidity</Filter>
92 </ClInclude>
93 <ClInclude Include="..\..\timidity\tables.h">
94 <Filter>Timidity</Filter>
95 </ClInclude>
96 <ClInclude Include="..\..\timidity\timidity.h">
97 <Filter>Timidity</Filter>
98 </ClInclude>
99 </ItemGroup>
100 <ItemGroup>
101 <Filter Include="Timidity">
102 <UniqueIdentifier>{1a42c048-3a89-4691-8289-2eb5b280596f}</UniqueIdentifier>
103 </Filter>
104 </ItemGroup>
105 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <ItemGroup>
29 <ClCompile Include="..\..\external\libogg-1.3.2\src\bitwise.c" />
30 <ClCompile Include="..\..\external\libogg-1.3.2\src\framing.c" />
31 </ItemGroup>
32 <ItemGroup>
33 <None Include="..\..\external\libogg-1.3.2\win32\ogg.def" />
34 </ItemGroup>
35 <ItemGroup>
36 <ClInclude Include="..\..\external\libogg-1.3.2\include\ogg\ogg.h" />
37 <ClInclude Include="..\..\external\libogg-1.3.2\include\ogg\os_types.h" />
38 </ItemGroup>
39 <PropertyGroup Label="Globals">
40 <ProjectGuid>{6bc6349c-e355-4f1c-9290-ff755114a84b}</ProjectGuid>
41 <Keyword>Win32Proj</Keyword>
42 <ProjectName>libogg_dynamic-WinRT81</ProjectName>
43 <RootNamespace>libogg_dynamic_WinRT81</RootNamespace>
44 <DefaultLanguage>en-US</DefaultLanguage>
45 <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
46 <AppContainerApplication>true</AppContainerApplication>
47 <ApplicationType>Windows Store</ApplicationType>
48 <ApplicationTypeRevision>8.1</ApplicationTypeRevision>
49 </PropertyGroup>
50 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
51 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
52 <ConfigurationType>DynamicLibrary</ConfigurationType>
53 <UseDebugLibraries>true</UseDebugLibraries>
54 <PlatformToolset>v120</PlatformToolset>
55 </PropertyGroup>
56 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
57 <ConfigurationType>DynamicLibrary</ConfigurationType>
58 <UseDebugLibraries>true</UseDebugLibraries>
59 <PlatformToolset>v120</PlatformToolset>
60 </PropertyGroup>
61 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
62 <ConfigurationType>DynamicLibrary</ConfigurationType>
63 <UseDebugLibraries>true</UseDebugLibraries>
64 <PlatformToolset>v120</PlatformToolset>
65 </PropertyGroup>
66 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
67 <ConfigurationType>DynamicLibrary</ConfigurationType>
68 <UseDebugLibraries>false</UseDebugLibraries>
69 <WholeProgramOptimization>true</WholeProgramOptimization>
70 <PlatformToolset>v120</PlatformToolset>
71 </PropertyGroup>
72 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
73 <ConfigurationType>DynamicLibrary</ConfigurationType>
74 <UseDebugLibraries>false</UseDebugLibraries>
75 <WholeProgramOptimization>true</WholeProgramOptimization>
76 <PlatformToolset>v120</PlatformToolset>
77 </PropertyGroup>
78 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
79 <ConfigurationType>DynamicLibrary</ConfigurationType>
80 <UseDebugLibraries>false</UseDebugLibraries>
81 <WholeProgramOptimization>true</WholeProgramOptimization>
82 <PlatformToolset>v120</PlatformToolset>
83 </PropertyGroup>
84 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
85 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
86 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
87 </ImportGroup>
88 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
89 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
90 </ImportGroup>
91 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
92 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
93 </ImportGroup>
94 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
95 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
96 </ImportGroup>
97 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
98 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
99 </ImportGroup>
100 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
101 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
102 </ImportGroup>
103 <PropertyGroup Label="UserMacros" />
104 <PropertyGroup />
105 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
106 <GenerateManifest>false</GenerateManifest>
107 <IgnoreImportLibrary>false</IgnoreImportLibrary>
108 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
109 <TargetName>libogg</TargetName>
110 </PropertyGroup>
111 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
112 <GenerateManifest>false</GenerateManifest>
113 <IgnoreImportLibrary>false</IgnoreImportLibrary>
114 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
115 <TargetName>libogg</TargetName>
116 </PropertyGroup>
117 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
118 <GenerateManifest>false</GenerateManifest>
119 <IgnoreImportLibrary>false</IgnoreImportLibrary>
120 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
121 <TargetName>libogg</TargetName>
122 </PropertyGroup>
123 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
124 <GenerateManifest>false</GenerateManifest>
125 <IgnoreImportLibrary>false</IgnoreImportLibrary>
126 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
127 <TargetName>libogg</TargetName>
128 </PropertyGroup>
129 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
130 <GenerateManifest>false</GenerateManifest>
131 <IgnoreImportLibrary>false</IgnoreImportLibrary>
132 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
133 <TargetName>libogg</TargetName>
134 </PropertyGroup>
135 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
136 <GenerateManifest>false</GenerateManifest>
137 <IgnoreImportLibrary>false</IgnoreImportLibrary>
138 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
139 <TargetName>libogg</TargetName>
140 </PropertyGroup>
141 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
142 <ClCompile>
143 <PrecompiledHeader>NotUsing</PrecompiledHeader>
144 <CompileAsWinRT>false</CompileAsWinRT>
145 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
146 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
147 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
148 </ClCompile>
149 <Link>
150 <SubSystem>Console</SubSystem>
151 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
152 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
153 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
154 </Link>
155 </ItemDefinitionGroup>
156 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
157 <ClCompile>
158 <PrecompiledHeader>NotUsing</PrecompiledHeader>
159 <CompileAsWinRT>false</CompileAsWinRT>
160 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
161 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
162 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
163 </ClCompile>
164 <Link>
165 <SubSystem>Console</SubSystem>
166 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
167 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
168 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
169 </Link>
170 </ItemDefinitionGroup>
171 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
172 <ClCompile>
173 <PrecompiledHeader>NotUsing</PrecompiledHeader>
174 <CompileAsWinRT>false</CompileAsWinRT>
175 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
176 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
177 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
178 </ClCompile>
179 <Link>
180 <SubSystem>Console</SubSystem>
181 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
182 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
183 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
184 </Link>
185 </ItemDefinitionGroup>
186 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
187 <ClCompile>
188 <PrecompiledHeader>NotUsing</PrecompiledHeader>
189 <CompileAsWinRT>false</CompileAsWinRT>
190 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
191 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
192 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
193 </ClCompile>
194 <Link>
195 <SubSystem>Console</SubSystem>
196 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
197 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
198 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
199 </Link>
200 </ItemDefinitionGroup>
201 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
202 <ClCompile>
203 <PrecompiledHeader>NotUsing</PrecompiledHeader>
204 <CompileAsWinRT>false</CompileAsWinRT>
205 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
206 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
207 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
208 </ClCompile>
209 <Link>
210 <SubSystem>Console</SubSystem>
211 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
212 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
213 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
214 </Link>
215 </ItemDefinitionGroup>
216 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
217 <ClCompile>
218 <PrecompiledHeader>NotUsing</PrecompiledHeader>
219 <CompileAsWinRT>false</CompileAsWinRT>
220 <AdditionalIncludeDirectories>..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
221 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBOGG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
222 <DisableSpecificWarnings>4244</DisableSpecificWarnings>
223 </ClCompile>
224 <Link>
225 <SubSystem>Console</SubSystem>
226 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
227 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
228 <ModuleDefinitionFile>..\..\external\libogg-1.3.2\win32\ogg.def</ModuleDefinitionFile>
229 </Link>
230 </ItemDefinitionGroup>
231 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
232 <ImportGroup Label="ExtensionTargets">
233 </ImportGroup>
234 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libogg-1.3.1\src\bitwise.c" />
4 <ClCompile Include="..\..\external\libogg-1.3.1\src\framing.c" />
5 </ItemGroup>
6 <ItemGroup>
7 <None Include="..\..\external\libogg-1.3.1\win32\ogg.def" />
8 </ItemGroup>
9 <ItemGroup>
10 <ClInclude Include="..\..\external\libogg-1.3.1\include\ogg\ogg.h" />
11 <ClInclude Include="..\..\external\libogg-1.3.1\include\ogg\os_types.h" />
12 </ItemGroup>
13 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <ItemGroup>
29 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\analysis.c" />
30 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\bitrate.c" />
31 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\block.c" />
32 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\codebook.c" />
33 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\envelope.c" />
34 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\floor0.c" />
35 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\floor1.c" />
36 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\info.c" />
37 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lookup.c" />
38 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lpc.c" />
39 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\lsp.c" />
40 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\mapping0.c" />
41 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\mdct.c" />
42 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\psy.c" />
43 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\registry.c" />
44 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\res0.c" />
45 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\sharedbook.c" />
46 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\smallft.c" />
47 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\synthesis.c" />
48 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\vorbisenc.c" />
49 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\window.c" />
50 </ItemGroup>
51 <ItemGroup>
52 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\codec.h" />
53 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisenc.h" />
54 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisfile.h" />
55 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\backends.h" />
56 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\bitrate.h" />
57 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\coupled\res_books_stereo.h" />
58 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\floor\floor_books.h" />
59 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\books\uncoupled\res_books_uncoupled.h" />
60 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\codebook.h" />
61 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\codec_internal.h" />
62 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\envelope.h" />
63 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\highlevel.h" />
64 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lookup.h" />
65 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lookup_data.h" />
66 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lpc.h" />
67 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\lsp.h" />
68 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\masking.h" />
69 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\mdct.h" />
70 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\misc.h" />
71 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\floor_all.h" />
72 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_11.h" />
73 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_16.h" />
74 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_44.h" />
75 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\psych_8.h" />
76 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_16.h" />
77 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_44.h" />
78 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_44u.h" />
79 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\residue_8.h" />
80 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_11.h" />
81 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_16.h" />
82 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_22.h" />
83 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_32.h" />
84 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_44.h" />
85 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_44u.h" />
86 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_8.h" />
87 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\modes\setup_X.h" />
88 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\os.h" />
89 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\psy.h" />
90 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\registry.h" />
91 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\scales.h" />
92 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\smallft.h" />
93 <ClInclude Include="..\..\external\libvorbis-1.3.5\lib\window.h" />
94 </ItemGroup>
95 <ItemGroup>
96 <None Include="..\..\external\libvorbis-1.3.5\win32\vorbis.def" />
97 </ItemGroup>
98 <ItemGroup>
99 <ProjectReference Include="libogg_dynamic-WinRT81.vcxproj">
100 <Project>{6bc6349c-e355-4f1c-9290-ff755114a84b}</Project>
101 </ProjectReference>
102 </ItemGroup>
103 <PropertyGroup Label="Globals">
104 <ProjectGuid>{e3ab27f1-eb89-4c65-85df-cb6a4f805753}</ProjectGuid>
105 <Keyword>Win32Proj</Keyword>
106 <ProjectName>libvorbis_dynamic-WinRT81</ProjectName>
107 <RootNamespace>libvorbis_dynamic_WinRT81</RootNamespace>
108 <DefaultLanguage>en-US</DefaultLanguage>
109 <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
110 <AppContainerApplication>true</AppContainerApplication>
111 <ApplicationType>Windows Store</ApplicationType>
112 <ApplicationTypeRevision>8.1</ApplicationTypeRevision>
113 </PropertyGroup>
114 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
115 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
116 <ConfigurationType>DynamicLibrary</ConfigurationType>
117 <UseDebugLibraries>true</UseDebugLibraries>
118 <PlatformToolset>v120</PlatformToolset>
119 </PropertyGroup>
120 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
121 <ConfigurationType>DynamicLibrary</ConfigurationType>
122 <UseDebugLibraries>true</UseDebugLibraries>
123 <PlatformToolset>v120</PlatformToolset>
124 </PropertyGroup>
125 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
126 <ConfigurationType>DynamicLibrary</ConfigurationType>
127 <UseDebugLibraries>true</UseDebugLibraries>
128 <PlatformToolset>v120</PlatformToolset>
129 </PropertyGroup>
130 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
131 <ConfigurationType>DynamicLibrary</ConfigurationType>
132 <UseDebugLibraries>false</UseDebugLibraries>
133 <WholeProgramOptimization>true</WholeProgramOptimization>
134 <PlatformToolset>v120</PlatformToolset>
135 </PropertyGroup>
136 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
137 <ConfigurationType>DynamicLibrary</ConfigurationType>
138 <UseDebugLibraries>false</UseDebugLibraries>
139 <WholeProgramOptimization>true</WholeProgramOptimization>
140 <PlatformToolset>v120</PlatformToolset>
141 </PropertyGroup>
142 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
143 <ConfigurationType>DynamicLibrary</ConfigurationType>
144 <UseDebugLibraries>false</UseDebugLibraries>
145 <WholeProgramOptimization>true</WholeProgramOptimization>
146 <PlatformToolset>v120</PlatformToolset>
147 </PropertyGroup>
148 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
149 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
150 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
151 </ImportGroup>
152 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
153 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
154 </ImportGroup>
155 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
156 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
157 </ImportGroup>
158 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
159 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
160 </ImportGroup>
161 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
162 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
163 </ImportGroup>
164 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
165 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
166 </ImportGroup>
167 <PropertyGroup Label="UserMacros" />
168 <PropertyGroup />
169 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
170 <GenerateManifest>false</GenerateManifest>
171 <IgnoreImportLibrary>false</IgnoreImportLibrary>
172 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
173 <TargetName>libvorbis</TargetName>
174 </PropertyGroup>
175 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
176 <GenerateManifest>false</GenerateManifest>
177 <IgnoreImportLibrary>false</IgnoreImportLibrary>
178 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
179 <TargetName>libvorbis</TargetName>
180 </PropertyGroup>
181 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
182 <GenerateManifest>false</GenerateManifest>
183 <IgnoreImportLibrary>false</IgnoreImportLibrary>
184 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
185 <TargetName>libvorbis</TargetName>
186 </PropertyGroup>
187 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
188 <GenerateManifest>false</GenerateManifest>
189 <IgnoreImportLibrary>false</IgnoreImportLibrary>
190 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
191 <TargetName>libvorbis</TargetName>
192 </PropertyGroup>
193 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
194 <GenerateManifest>false</GenerateManifest>
195 <IgnoreImportLibrary>false</IgnoreImportLibrary>
196 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
197 <TargetName>libvorbis</TargetName>
198 </PropertyGroup>
199 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
200 <GenerateManifest>false</GenerateManifest>
201 <IgnoreImportLibrary>false</IgnoreImportLibrary>
202 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
203 <TargetName>libvorbis</TargetName>
204 </PropertyGroup>
205 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
206 <ClCompile>
207 <PrecompiledHeader>NotUsing</PrecompiledHeader>
208 <CompileAsWinRT>false</CompileAsWinRT>
209 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
210 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
211 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
212 </ClCompile>
213 <Link>
214 <SubSystem>Console</SubSystem>
215 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
216 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
217 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
218 </Link>
219 </ItemDefinitionGroup>
220 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
221 <ClCompile>
222 <PrecompiledHeader>NotUsing</PrecompiledHeader>
223 <CompileAsWinRT>false</CompileAsWinRT>
224 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
225 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
226 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
227 </ClCompile>
228 <Link>
229 <SubSystem>Console</SubSystem>
230 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
231 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
232 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
233 </Link>
234 </ItemDefinitionGroup>
235 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
236 <ClCompile>
237 <PrecompiledHeader>NotUsing</PrecompiledHeader>
238 <CompileAsWinRT>false</CompileAsWinRT>
239 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
240 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
241 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
242 </ClCompile>
243 <Link>
244 <SubSystem>Console</SubSystem>
245 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
246 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
247 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
248 </Link>
249 </ItemDefinitionGroup>
250 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
251 <ClCompile>
252 <PrecompiledHeader>NotUsing</PrecompiledHeader>
253 <CompileAsWinRT>false</CompileAsWinRT>
254 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
255 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
256 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
257 </ClCompile>
258 <Link>
259 <SubSystem>Console</SubSystem>
260 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
261 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
262 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
263 </Link>
264 </ItemDefinitionGroup>
265 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
266 <ClCompile>
267 <PrecompiledHeader>NotUsing</PrecompiledHeader>
268 <CompileAsWinRT>false</CompileAsWinRT>
269 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
270 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
271 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
272 </ClCompile>
273 <Link>
274 <SubSystem>Console</SubSystem>
275 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
276 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
277 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
278 </Link>
279 </ItemDefinitionGroup>
280 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
281 <ClCompile>
282 <PrecompiledHeader>NotUsing</PrecompiledHeader>
283 <CompileAsWinRT>false</CompileAsWinRT>
284 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
285 <PreprocessorDefinitions>LIBVORBIS_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
286 <DisableSpecificWarnings>4244;4100;4267;4189;4305;4127;4706</DisableSpecificWarnings>
287 </ClCompile>
288 <Link>
289 <SubSystem>Console</SubSystem>
290 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
291 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
292 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbis.def</ModuleDefinitionFile>
293 </Link>
294 </ItemDefinitionGroup>
295 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
296 <ImportGroup Label="ExtensionTargets">
297 </ImportGroup>
298 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\analysis.c" />
4 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\bitrate.c" />
5 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\block.c" />
6 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\codebook.c" />
7 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\envelope.c" />
8 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\floor0.c" />
9 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\floor1.c" />
10 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\info.c" />
11 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lookup.c" />
12 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lpc.c" />
13 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\lsp.c" />
14 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\mapping0.c" />
15 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\mdct.c" />
16 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\psy.c" />
17 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\registry.c" />
18 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\res0.c" />
19 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\sharedbook.c" />
20 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\smallft.c" />
21 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\synthesis.c" />
22 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\vorbisenc.c" />
23 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\window.c" />
24 </ItemGroup>
25 <ItemGroup>
26 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\backends.h" />
27 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\bitrate.h" />
28 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\codebook.h" />
29 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\codec.h" />
30 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\codec_internal.h" />
31 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\envelope.h" />
32 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\floor_all.h" />
33 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\floor\floor_books.h" />
34 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\highlevel.h" />
35 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lookup.h" />
36 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lookup_data.h" />
37 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lpc.h" />
38 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\lsp.h" />
39 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\masking.h" />
40 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\mdct.h" />
41 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\misc.h" />
42 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\os.h" />
43 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\psy.h" />
44 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_8.h" />
45 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_11.h" />
46 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_16.h" />
47 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\psych_44.h" />
48 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\registry.h" />
49 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\coupled\res_books_stereo.h" />
50 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\books\uncoupled\res_books_uncoupled.h" />
51 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_8.h" />
52 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_16.h" />
53 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_44.h" />
54 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\residue_44u.h" />
55 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\scales.h" />
56 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_8.h" />
57 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_11.h" />
58 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_16.h" />
59 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_22.h" />
60 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_32.h" />
61 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_44.h" />
62 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_44u.h" />
63 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\modes\setup_X.h" />
64 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\smallft.h" />
65 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisenc.h" />
66 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisfile.h" />
67 <ClInclude Include="..\..\external\libvorbis-1.3.3\lib\window.h" />
68 </ItemGroup>
69 <ItemGroup>
70 <None Include="..\..\external\libvorbis-1.3.3\win32\vorbis.def" />
71 </ItemGroup>
72 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup Label="ProjectConfigurations">
3 <ProjectConfiguration Include="Debug|ARM">
4 <Configuration>Debug</Configuration>
5 <Platform>ARM</Platform>
6 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Debug|x64">
12 <Configuration>Debug</Configuration>
13 <Platform>x64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM">
16 <Configuration>Release</Configuration>
17 <Platform>ARM</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|Win32">
20 <Configuration>Release</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|x64">
24 <Configuration>Release</Configuration>
25 <Platform>x64</Platform>
26 </ProjectConfiguration>
27 </ItemGroup>
28 <ItemGroup>
29 <ClCompile Include="..\..\external\libvorbis-1.3.5\lib\vorbisfile.c" />
30 </ItemGroup>
31 <ItemGroup>
32 <ClInclude Include="..\..\external\libvorbis-1.3.5\include\vorbis\vorbisfile.h" />
33 </ItemGroup>
34 <ItemGroup>
35 <ProjectReference Include="libogg_dynamic-WinRT81.vcxproj">
36 <Project>{6bc6349c-e355-4f1c-9290-ff755114a84b}</Project>
37 </ProjectReference>
38 <ProjectReference Include="libvorbis_dynamic-WinRT81.vcxproj">
39 <Project>{e3ab27f1-eb89-4c65-85df-cb6a4f805753}</Project>
40 </ProjectReference>
41 </ItemGroup>
42 <PropertyGroup Label="Globals">
43 <ProjectGuid>{936b2819-2364-45d9-901d-52878914fafa}</ProjectGuid>
44 <Keyword>Win32Proj</Keyword>
45 <ProjectName>libvorbisfile_dynamic-WinRT81</ProjectName>
46 <RootNamespace>libvorbisfile_dynamic_WinRT81</RootNamespace>
47 <DefaultLanguage>en-US</DefaultLanguage>
48 <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
49 <AppContainerApplication>true</AppContainerApplication>
50 <ApplicationType>Windows Store</ApplicationType>
51 <ApplicationTypeRevision>8.1</ApplicationTypeRevision>
52 </PropertyGroup>
53 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
54 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
55 <ConfigurationType>DynamicLibrary</ConfigurationType>
56 <UseDebugLibraries>true</UseDebugLibraries>
57 <PlatformToolset>v120</PlatformToolset>
58 </PropertyGroup>
59 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
60 <ConfigurationType>DynamicLibrary</ConfigurationType>
61 <UseDebugLibraries>true</UseDebugLibraries>
62 <PlatformToolset>v120</PlatformToolset>
63 </PropertyGroup>
64 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
65 <ConfigurationType>DynamicLibrary</ConfigurationType>
66 <UseDebugLibraries>true</UseDebugLibraries>
67 <PlatformToolset>v120</PlatformToolset>
68 </PropertyGroup>
69 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
70 <ConfigurationType>DynamicLibrary</ConfigurationType>
71 <UseDebugLibraries>false</UseDebugLibraries>
72 <WholeProgramOptimization>true</WholeProgramOptimization>
73 <PlatformToolset>v120</PlatformToolset>
74 </PropertyGroup>
75 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
76 <ConfigurationType>DynamicLibrary</ConfigurationType>
77 <UseDebugLibraries>false</UseDebugLibraries>
78 <WholeProgramOptimization>true</WholeProgramOptimization>
79 <PlatformToolset>v120</PlatformToolset>
80 </PropertyGroup>
81 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
82 <ConfigurationType>DynamicLibrary</ConfigurationType>
83 <UseDebugLibraries>false</UseDebugLibraries>
84 <WholeProgramOptimization>true</WholeProgramOptimization>
85 <PlatformToolset>v120</PlatformToolset>
86 </PropertyGroup>
87 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
88 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
89 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
90 </ImportGroup>
91 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
92 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
93 </ImportGroup>
94 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
95 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
96 </ImportGroup>
97 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
98 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
99 </ImportGroup>
100 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
101 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
102 </ImportGroup>
103 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
104 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
105 </ImportGroup>
106 <PropertyGroup Label="UserMacros" />
107 <PropertyGroup />
108 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
109 <GenerateManifest>false</GenerateManifest>
110 <IgnoreImportLibrary>false</IgnoreImportLibrary>
111 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
112 <TargetName>libvorbisfile</TargetName>
113 </PropertyGroup>
114 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
115 <GenerateManifest>false</GenerateManifest>
116 <IgnoreImportLibrary>false</IgnoreImportLibrary>
117 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
118 <TargetName>libvorbisfile</TargetName>
119 </PropertyGroup>
120 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
121 <GenerateManifest>false</GenerateManifest>
122 <IgnoreImportLibrary>false</IgnoreImportLibrary>
123 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
124 <TargetName>libvorbisfile</TargetName>
125 </PropertyGroup>
126 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
127 <GenerateManifest>false</GenerateManifest>
128 <IgnoreImportLibrary>false</IgnoreImportLibrary>
129 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
130 <TargetName>libvorbisfile</TargetName>
131 </PropertyGroup>
132 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
133 <GenerateManifest>false</GenerateManifest>
134 <IgnoreImportLibrary>false</IgnoreImportLibrary>
135 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
136 <TargetName>libvorbisfile</TargetName>
137 </PropertyGroup>
138 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
139 <GenerateManifest>false</GenerateManifest>
140 <IgnoreImportLibrary>false</IgnoreImportLibrary>
141 <IntDir>Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
142 <TargetName>libvorbisfile</TargetName>
143 </PropertyGroup>
144 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
145 <ClCompile>
146 <PrecompiledHeader>NotUsing</PrecompiledHeader>
147 <CompileAsWinRT>false</CompileAsWinRT>
148 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
149 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
150 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
151 </ClCompile>
152 <Link>
153 <SubSystem>Console</SubSystem>
154 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
155 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
156 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
157 </Link>
158 </ItemDefinitionGroup>
159 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
160 <ClCompile>
161 <PrecompiledHeader>NotUsing</PrecompiledHeader>
162 <CompileAsWinRT>false</CompileAsWinRT>
163 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
164 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
165 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
166 </ClCompile>
167 <Link>
168 <SubSystem>Console</SubSystem>
169 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
170 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
171 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
172 </Link>
173 </ItemDefinitionGroup>
174 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
175 <ClCompile>
176 <PrecompiledHeader>NotUsing</PrecompiledHeader>
177 <CompileAsWinRT>false</CompileAsWinRT>
178 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
179 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
180 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
181 </ClCompile>
182 <Link>
183 <SubSystem>Console</SubSystem>
184 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
185 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
186 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
187 </Link>
188 </ItemDefinitionGroup>
189 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
190 <ClCompile>
191 <PrecompiledHeader>NotUsing</PrecompiledHeader>
192 <CompileAsWinRT>false</CompileAsWinRT>
193 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
194 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WIN32_WCE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
195 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
196 </ClCompile>
197 <Link>
198 <SubSystem>Console</SubSystem>
199 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
200 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
201 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
202 </Link>
203 </ItemDefinitionGroup>
204 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
205 <ClCompile>
206 <PrecompiledHeader>NotUsing</PrecompiledHeader>
207 <CompileAsWinRT>false</CompileAsWinRT>
208 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
209 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
210 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
211 </ClCompile>
212 <Link>
213 <SubSystem>Console</SubSystem>
214 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
215 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
216 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
217 </Link>
218 </ItemDefinitionGroup>
219 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
220 <ClCompile>
221 <PrecompiledHeader>NotUsing</PrecompiledHeader>
222 <CompileAsWinRT>false</CompileAsWinRT>
223 <AdditionalIncludeDirectories>..\..\external\libvorbis-1.3.5\include;..\..\external\libogg-1.3.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
224 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
225 <DisableSpecificWarnings>4244;4101</DisableSpecificWarnings>
226 </ClCompile>
227 <Link>
228 <SubSystem>Console</SubSystem>
229 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
230 <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
231 <ModuleDefinitionFile>..\..\external\libvorbis-1.3.5\win32\vorbisfile.def</ModuleDefinitionFile>
232 </Link>
233 </ItemDefinitionGroup>
234 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
235 <ImportGroup Label="ExtensionTargets">
236 </ImportGroup>
237 </Project>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <ItemGroup>
3 <ClCompile Include="..\..\external\libvorbis-1.3.3\lib\vorbisfile.c" />
4 </ItemGroup>
5 <ItemGroup>
6 <ClInclude Include="..\..\external\libvorbis-1.3.3\include\vorbis\vorbisfile.h" />
7 </ItemGroup>
8 </Project>
13011301 x86_64-*linux*)
13021302 LD="${LD-ld} -m elf_x86_64"
13031303 ;;
1304 ppc*-*linux*|powerpc*-*linux*)
1304 powerpc64le-*linux*)
1305 LD="${LD-ld} -m elf64lppc"
1306 ;;
1307 powerpc64-*linux*)
13051308 LD="${LD-ld} -m elf64ppc"
13061309 ;;
13071310 s390*-*linux*|s390*-*tpf*)
0 ##############################################################################
1 # Based on libtool-2.2.6a
2 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
3 #
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
5 # 2006, 2007, 2008 Free Software Foundation, Inc.
6 # Written by Gordon Matzigkeit, 1996
7 #
8 # This file is free software; the Free Software Foundation gives
9 # unlimited permission to copy and/or distribute it, with or without
10 # modifications, as long as this notice is preserved.
11
12 m4_define([_LT_COPYING], [dnl
13 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
14 # 2006, 2007, 2008 Free Software Foundation, Inc.
15 # Written by Gordon Matzigkeit, 1996
16 #
17 # This file is part of GNU Libtool.
18 #
19 # GNU Libtool is free software; you can redistribute it and/or
20 # modify it under the terms of the GNU General Public License as
21 # published by the Free Software Foundation; either version 2 of
22 # the License, or (at your option) any later version.
23 #
24 # As a special exception to the GNU General Public License,
25 # if you distribute this file as part of a program or library that
26 # is built using GNU Libtool, you may include this file under the
27 # same distribution terms that you use for the rest of that program.
28 #
29 # GNU Libtool is distributed in the hope that it will be useful,
30 # but WITHOUT ANY WARRANTY; without even the implied warranty of
31 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 # GNU General Public License for more details.
33 #
34 # You should have received a copy of the GNU General Public License
35 # along with GNU Libtool; see the file COPYING. If not, a copy
36 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
37 # obtained by writing to the Free Software Foundation, Inc.,
38 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
39 ])
40
41 # serial 56 LT_INIT
42
43
44 # LT_PREREQ(VERSION)
45 # ------------------
46 # Complain and exit if this libtool version is less that VERSION.
47 m4_defun([LT_PREREQ],
48 [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
49 [m4_default([$3],
50 [m4_fatal([Libtool version $1 or higher is required],
51 63)])],
52 [$2])])
53
54
55 # _LT_CHECK_BUILDDIR
56 # ------------------
57 # Complain if the absolute build directory name contains unusual characters
58 m4_defun([_LT_CHECK_BUILDDIR],
59 [case `pwd` in
60 *\ * | *\ *)
61 AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
62 esac
63 ])
64
65
66 # LT_INIT([OPTIONS])
67 # ------------------
68 AC_DEFUN([LT_INIT],
69 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
70 AC_BEFORE([$0], [LT_LANG])dnl
71 AC_BEFORE([$0], [LT_OUTPUT])dnl
72 AC_BEFORE([$0], [LTDL_INIT])dnl
73 m4_require([_LT_CHECK_BUILDDIR])dnl
74
75 dnl Autoconf doesn't catch unexpanded LT_ macros by default:
76 m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
77 m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
78 dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
79 dnl unless we require an AC_DEFUNed macro:
80 AC_REQUIRE([LTOPTIONS_VERSION])dnl
81 AC_REQUIRE([LTSUGAR_VERSION])dnl
82 AC_REQUIRE([LTVERSION_VERSION])dnl
83 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
84 m4_require([_LT_PROG_LTMAIN])dnl
85
86 dnl Parse OPTIONS
87 _LT_SET_OPTIONS([$0], [$1])
88
89 # This can be used to rebuild libtool when needed
90 LIBTOOL_DEPS="$ltmain"
91
92 # Always use our own libtool.
93 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
94 AC_SUBST(LIBTOOL)dnl
95
96 _LT_SETUP
97
98 # Only expand once:
99 m4_define([LT_INIT])
100 ])# LT_INIT
101
102 # Old names:
103 AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
104 AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
105 dnl aclocal-1.4 backwards compatibility:
106 dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
107 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
108
109
110 # _LT_CC_BASENAME(CC)
111 # -------------------
112 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
113 m4_defun([_LT_CC_BASENAME],
114 [for cc_temp in $1""; do
115 case $cc_temp in
116 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
117 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
118 \-*) ;;
119 *) break;;
120 esac
121 done
122 cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
123 ])
124
125
126 # _LT_FILEUTILS_DEFAULTS
127 # ----------------------
128 # It is okay to use these file commands and assume they have been set
129 # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
130 m4_defun([_LT_FILEUTILS_DEFAULTS],
131 [: ${CP="cp -f"}
132 : ${MV="mv -f"}
133 : ${RM="rm -f"}
134 ])# _LT_FILEUTILS_DEFAULTS
135
136
137 # _LT_SETUP
138 # ---------
139 m4_defun([_LT_SETUP],
140 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
141 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
142 _LT_DECL([], [host_alias], [0], [The host system])dnl
143 _LT_DECL([], [host], [0])dnl
144 _LT_DECL([], [host_os], [0])dnl
145 dnl
146 _LT_DECL([], [build_alias], [0], [The build system])dnl
147 _LT_DECL([], [build], [0])dnl
148 _LT_DECL([], [build_os], [0])dnl
149 dnl
150 AC_REQUIRE([AC_PROG_CC])dnl
151 AC_REQUIRE([LT_PATH_LD])dnl
152 AC_REQUIRE([LT_PATH_NM])dnl
153 dnl
154 AC_REQUIRE([AC_PROG_LN_S])dnl
155 test -z "$LN_S" && LN_S="ln -s"
156 _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
157 dnl
158 AC_REQUIRE([LT_CMD_MAX_LEN])dnl
159 _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
160 _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
161 dnl
162 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
163 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
164 m4_require([_LT_CMD_RELOAD])dnl
165 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
166 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
167 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
168
169 _LT_CONFIG_LIBTOOL_INIT([
170 # See if we are running on zsh, and set the options which allow our
171 # commands through without removal of \ escapes INIT.
172 if test -n "\${ZSH_VERSION+set}" ; then
173 setopt NO_GLOB_SUBST
174 fi
175 ])
176 if test -n "${ZSH_VERSION+set}" ; then
177 setopt NO_GLOB_SUBST
178 fi
179
180 _LT_CHECK_OBJDIR
181
182 m4_require([_LT_TAG_COMPILER])dnl
183 _LT_PROG_ECHO_BACKSLASH
184
185 case $host_os in
186 aix3*)
187 # AIX sometimes has problems with the GCC collect2 program. For some
188 # reason, if we set the COLLECT_NAMES environment variable, the problems
189 # vanish in a puff of smoke.
190 if test "X${COLLECT_NAMES+set}" != Xset; then
191 COLLECT_NAMES=
192 export COLLECT_NAMES
193 fi
194 ;;
195 esac
196
197 # Sed substitution that helps us do robust quoting. It backslashifies
198 # metacharacters that are still active within double-quoted strings.
199 sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
200
201 # Same as above, but do not quote variable references.
202 double_quote_subst='s/\([["`\\]]\)/\\\1/g'
203
204 # Sed substitution to delay expansion of an escaped shell variable in a
205 # double_quote_subst'ed string.
206 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
207
208 # Sed substitution to delay expansion of an escaped single quote.
209 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
210
211 # Sed substitution to avoid accidental globbing in evaled expressions
212 no_glob_subst='s/\*/\\\*/g'
213
214 # Global variables:
215 ofile=libtool
216 can_build_shared=yes
217
218 # All known linkers require a `.a' archive for static linking (except MSVC,
219 # which needs '.lib').
220 libext=a
221
222 with_gnu_ld="$lt_cv_prog_gnu_ld"
223
224 old_CC="$CC"
225 old_CFLAGS="$CFLAGS"
226
227 # Set sane defaults for various variables
228 test -z "$CC" && CC=cc
229 test -z "$LTCC" && LTCC=$CC
230 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
231 test -z "$LD" && LD=ld
232 test -z "$ac_objext" && ac_objext=o
233
234 _LT_CC_BASENAME([$compiler])
235
236 # Only perform the check for file, if the check method requires it
237 test -z "$MAGIC_CMD" && MAGIC_CMD=file
238 case $deplibs_check_method in
239 file_magic*)
240 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
241 _LT_PATH_MAGIC
242 fi
243 ;;
244 esac
245
246 # Use C for the default configuration in the libtool script
247 LT_SUPPORTED_TAG([CC])
248 _LT_LANG_C_CONFIG
249 _LT_LANG_DEFAULT_CONFIG
250 _LT_CONFIG_COMMANDS
251 ])# _LT_SETUP
252
253
254 # _LT_PROG_LTMAIN
255 # ---------------
256 # Note that this code is called both from `configure', and `config.status'
257 # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
258 # `config.status' has no value for ac_aux_dir unless we are using Automake,
259 # so we pass a copy along to make sure it has a sensible value anyway.
260 m4_defun([_LT_PROG_LTMAIN],
261 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
262 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
263 ltmain="$ac_aux_dir/ltmain.sh"
264 ])# _LT_PROG_LTMAIN
265
266
267 ## ------------------------------------- ##
268 ## Accumulate code for creating libtool. ##
269 ## ------------------------------------- ##
270
271 # So that we can recreate a full libtool script including additional
272 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
273 # in macros and then make a single call at the end using the `libtool'
274 # label.
275
276
277 # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
278 # ----------------------------------------
279 # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
280 m4_define([_LT_CONFIG_LIBTOOL_INIT],
281 [m4_ifval([$1],
282 [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
283 [$1
284 ])])])
285
286 # Initialize.
287 m4_define([_LT_OUTPUT_LIBTOOL_INIT])
288
289
290 # _LT_CONFIG_LIBTOOL([COMMANDS])
291 # ------------------------------
292 # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
293 m4_define([_LT_CONFIG_LIBTOOL],
294 [m4_ifval([$1],
295 [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
296 [$1
297 ])])])
298
299 # Initialize.
300 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
301
302
303 # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
304 # -----------------------------------------------------
305 m4_defun([_LT_CONFIG_SAVE_COMMANDS],
306 [_LT_CONFIG_LIBTOOL([$1])
307 _LT_CONFIG_LIBTOOL_INIT([$2])
308 ])
309
310
311 # _LT_FORMAT_COMMENT([COMMENT])
312 # -----------------------------
313 # Add leading comment marks to the start of each line, and a trailing
314 # full-stop to the whole comment if one is not present already.
315 m4_define([_LT_FORMAT_COMMENT],
316 [m4_ifval([$1], [
317 m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
318 [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
319 )])
320
321
322
323 ## ------------------------ ##
324 ## FIXME: Eliminate VARNAME ##
325 ## ------------------------ ##
326
327
328 # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
329 # -------------------------------------------------------------------
330 # CONFIGNAME is the name given to the value in the libtool script.
331 # VARNAME is the (base) name used in the configure script.
332 # VALUE may be 0, 1 or 2 for a computed quote escaped value based on
333 # VARNAME. Any other value will be used directly.
334 m4_define([_LT_DECL],
335 [lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
336 [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
337 [m4_ifval([$1], [$1], [$2])])
338 lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
339 m4_ifval([$4],
340 [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
341 lt_dict_add_subkey([lt_decl_dict], [$2],
342 [tagged?], [m4_ifval([$5], [yes], [no])])])
343 ])
344
345
346 # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
347 # --------------------------------------------------------
348 m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
349
350
351 # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
352 # ------------------------------------------------
353 m4_define([lt_decl_tag_varnames],
354 [_lt_decl_filter([tagged?], [yes], $@)])
355
356
357 # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
358 # ---------------------------------------------------------
359 m4_define([_lt_decl_filter],
360 [m4_case([$#],
361 [0], [m4_fatal([$0: too few arguments: $#])],
362 [1], [m4_fatal([$0: too few arguments: $#: $1])],
363 [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
364 [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
365 [lt_dict_filter([lt_decl_dict], $@)])[]dnl
366 ])
367
368
369 # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
370 # --------------------------------------------------
371 m4_define([lt_decl_quote_varnames],
372 [_lt_decl_filter([value], [1], $@)])
373
374
375 # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
376 # ---------------------------------------------------
377 m4_define([lt_decl_dquote_varnames],
378 [_lt_decl_filter([value], [2], $@)])
379
380
381 # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
382 # ---------------------------------------------------
383 m4_define([lt_decl_varnames_tagged],
384 [m4_assert([$# <= 2])dnl
385 _$0(m4_quote(m4_default([$1], [[, ]])),
386 m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
387 m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
388 m4_define([_lt_decl_varnames_tagged],
389 [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
390
391
392 # lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
393 # ------------------------------------------------
394 m4_define([lt_decl_all_varnames],
395 [_$0(m4_quote(m4_default([$1], [[, ]])),
396 m4_if([$2], [],
397 m4_quote(lt_decl_varnames),
398 m4_quote(m4_shift($@))))[]dnl
399 ])
400 m4_define([_lt_decl_all_varnames],
401 [lt_join($@, lt_decl_varnames_tagged([$1],
402 lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
403 ])
404
405
406 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
407 # ------------------------------------
408 # Quote a variable value, and forward it to `config.status' so that its
409 # declaration there will have the same value as in `configure'. VARNAME
410 # must have a single quote delimited value for this to work.
411 m4_define([_LT_CONFIG_STATUS_DECLARE],
412 [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
413
414
415 # _LT_CONFIG_STATUS_DECLARATIONS
416 # ------------------------------
417 # We delimit libtool config variables with single quotes, so when
418 # we write them to config.status, we have to be sure to quote all
419 # embedded single quotes properly. In configure, this macro expands
420 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
421 #
422 # <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
423 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
424 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
425 [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
426
427
428 # _LT_LIBTOOL_TAGS
429 # ----------------
430 # Output comment and list of tags supported by the script
431 m4_defun([_LT_LIBTOOL_TAGS],
432 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
433 available_tags="_LT_TAGS"dnl
434 ])
435
436
437 # _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
438 # -----------------------------------
439 # Extract the dictionary values for VARNAME (optionally with TAG) and
440 # expand to a commented shell variable setting:
441 #
442 # # Some comment about what VAR is for.
443 # visible_name=$lt_internal_name
444 m4_define([_LT_LIBTOOL_DECLARE],
445 [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
446 [description])))[]dnl
447 m4_pushdef([_libtool_name],
448 m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
449 m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
450 [0], [_libtool_name=[$]$1],
451 [1], [_libtool_name=$lt_[]$1],
452 [2], [_libtool_name=$lt_[]$1],
453 [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
454 m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
455 ])
456
457
458 # _LT_LIBTOOL_CONFIG_VARS
459 # -----------------------
460 # Produce commented declarations of non-tagged libtool config variables
461 # suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
462 # script. Tagged libtool config variables (even for the LIBTOOL CONFIG
463 # section) are produced by _LT_LIBTOOL_TAG_VARS.
464 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
465 [m4_foreach([_lt_var],
466 m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
467 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
468
469
470 # _LT_LIBTOOL_TAG_VARS(TAG)
471 # -------------------------
472 m4_define([_LT_LIBTOOL_TAG_VARS],
473 [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
474 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
475
476
477 # _LT_TAGVAR(VARNAME, [TAGNAME])
478 # ------------------------------
479 m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
480
481
482 # _LT_CONFIG_COMMANDS
483 # -------------------
484 # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
485 # variables for single and double quote escaping we saved from calls
486 # to _LT_DECL, we can put quote escaped variables declarations
487 # into `config.status', and then the shell code to quote escape them in
488 # for loops in `config.status'. Finally, any additional code accumulated
489 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
490 m4_defun([_LT_CONFIG_COMMANDS],
491 [AC_PROVIDE_IFELSE([LT_OUTPUT],
492 dnl If the libtool generation code has been placed in $CONFIG_LT,
493 dnl instead of duplicating it all over again into config.status,
494 dnl then we will have config.status run $CONFIG_LT later, so it
495 dnl needs to know what name is stored there:
496 [AC_CONFIG_COMMANDS([libtool],
497 [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
498 dnl If the libtool generation code is destined for config.status,
499 dnl expand the accumulated commands and init code now:
500 [AC_CONFIG_COMMANDS([libtool],
501 [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
502 ])#_LT_CONFIG_COMMANDS
503
504
505 # Initialize.
506 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
507 [
508
509 # The HP-UX ksh and POSIX shell print the target directory to stdout
510 # if CDPATH is set.
511 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
512
513 sed_quote_subst='$sed_quote_subst'
514 double_quote_subst='$double_quote_subst'
515 delay_variable_subst='$delay_variable_subst'
516 _LT_CONFIG_STATUS_DECLARATIONS
517 LTCC='$LTCC'
518 LTCFLAGS='$LTCFLAGS'
519 compiler='$compiler_DEFAULT'
520
521 # Quote evaled strings.
522 for var in lt_decl_all_varnames([[ \
523 ]], lt_decl_quote_varnames); do
524 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
525 *[[\\\\\\\`\\"\\\$]]*)
526 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
527 ;;
528 *)
529 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
530 ;;
531 esac
532 done
533
534 # Double-quote double-evaled strings.
535 for var in lt_decl_all_varnames([[ \
536 ]], lt_decl_dquote_varnames); do
537 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
538 *[[\\\\\\\`\\"\\\$]]*)
539 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
540 ;;
541 *)
542 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
543 ;;
544 esac
545 done
546
547 # Fix-up fallback echo if it was mangled by the above quoting rules.
548 case \$lt_ECHO in
549 *'\\\[$]0 --fallback-echo"')dnl "
550 lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
551 ;;
552 esac
553
554 _LT_OUTPUT_LIBTOOL_INIT
555 ])
556
557
558 # LT_OUTPUT
559 # ---------
560 # This macro allows early generation of the libtool script (before
561 # AC_OUTPUT is called), incase it is used in configure for compilation
562 # tests.
563 AC_DEFUN([LT_OUTPUT],
564 [: ${CONFIG_LT=./config.lt}
565 AC_MSG_NOTICE([creating $CONFIG_LT])
566 cat >"$CONFIG_LT" <<_LTEOF
567 #! $SHELL
568 # Generated by $as_me.
569 # Run this file to recreate a libtool stub with the current configuration.
570
571 lt_cl_silent=false
572 SHELL=\${CONFIG_SHELL-$SHELL}
573 _LTEOF
574
575 cat >>"$CONFIG_LT" <<\_LTEOF
576 AS_SHELL_SANITIZE
577 _AS_PREPARE
578
579 exec AS_MESSAGE_FD>&1
580 exec AS_MESSAGE_LOG_FD>>config.log
581 {
582 echo
583 AS_BOX([Running $as_me.])
584 } >&AS_MESSAGE_LOG_FD
585
586 lt_cl_help="\
587 \`$as_me' creates a local libtool stub from the current configuration,
588 for use in further configure time tests before the real libtool is
589 generated.
590
591 Usage: $[0] [[OPTIONS]]
592
593 -h, --help print this help, then exit
594 -V, --version print version number, then exit
595 -q, --quiet do not print progress messages
596 -d, --debug don't remove temporary files
597
598 Report bugs to <bug-libtool@gnu.org>."
599
600 lt_cl_version="\
601 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
602 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
603 configured by $[0], generated by m4_PACKAGE_STRING.
604
605 Copyright (C) 2008 Free Software Foundation, Inc.
606 This config.lt script is free software; the Free Software Foundation
607 gives unlimited permision to copy, distribute and modify it."
608
609 while test $[#] != 0
610 do
611 case $[1] in
612 --version | --v* | -V )
613 echo "$lt_cl_version"; exit 0 ;;
614 --help | --h* | -h )
615 echo "$lt_cl_help"; exit 0 ;;
616 --debug | --d* | -d )
617 debug=: ;;
618 --quiet | --q* | --silent | --s* | -q )
619 lt_cl_silent=: ;;
620
621 -*) AC_MSG_ERROR([unrecognized option: $[1]
622 Try \`$[0] --help' for more information.]) ;;
623
624 *) AC_MSG_ERROR([unrecognized argument: $[1]
625 Try \`$[0] --help' for more information.]) ;;
626 esac
627 shift
628 done
629
630 if $lt_cl_silent; then
631 exec AS_MESSAGE_FD>/dev/null
632 fi
633 _LTEOF
634
635 cat >>"$CONFIG_LT" <<_LTEOF
636 _LT_OUTPUT_LIBTOOL_COMMANDS_INIT
637 _LTEOF
638
639 cat >>"$CONFIG_LT" <<\_LTEOF
640 AC_MSG_NOTICE([creating $ofile])
641 _LT_OUTPUT_LIBTOOL_COMMANDS
642 AS_EXIT(0)
643 _LTEOF
644 chmod +x "$CONFIG_LT"
645
646 # configure is writing to config.log, but config.lt does its own redirection,
647 # appending to config.log, which fails on DOS, as config.log is still kept
648 # open by configure. Here we exec the FD to /dev/null, effectively closing
649 # config.log, so it can be properly (re)opened and appended to by config.lt.
650 if test "$no_create" != yes; then
651 lt_cl_success=:
652 test "$silent" = yes &&
653 lt_config_lt_args="$lt_config_lt_args --quiet"
654 exec AS_MESSAGE_LOG_FD>/dev/null
655 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
656 exec AS_MESSAGE_LOG_FD>>config.log
657 $lt_cl_success || AS_EXIT(1)
658 fi
659 ])# LT_OUTPUT
660
661
662 # _LT_CONFIG(TAG)
663 # ---------------
664 # If TAG is the built-in tag, create an initial libtool script with a
665 # default configuration from the untagged config vars. Otherwise add code
666 # to config.status for appending the configuration named by TAG from the
667 # matching tagged config vars.
668 m4_defun([_LT_CONFIG],
669 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
670 _LT_CONFIG_SAVE_COMMANDS([
671 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
672 m4_if(_LT_TAG, [C], [
673 # See if we are running on zsh, and set the options which allow our
674 # commands through without removal of \ escapes.
675 if test -n "${ZSH_VERSION+set}" ; then
676 setopt NO_GLOB_SUBST
677 fi
678
679 cfgfile="${ofile}T"
680 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
681 $RM "$cfgfile"
682
683 cat <<_LT_EOF >> "$cfgfile"
684 #! $SHELL
685
686 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
687 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
688 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
689 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
690 #
691 _LT_COPYING
692 _LT_LIBTOOL_TAGS
693
694 # ### BEGIN LIBTOOL CONFIG
695 _LT_LIBTOOL_CONFIG_VARS
696 _LT_LIBTOOL_TAG_VARS
697 # ### END LIBTOOL CONFIG
698
699 _LT_EOF
700
701 case $host_os in
702 aix3*)
703 cat <<\_LT_EOF >> "$cfgfile"
704 # AIX sometimes has problems with the GCC collect2 program. For some
705 # reason, if we set the COLLECT_NAMES environment variable, the problems
706 # vanish in a puff of smoke.
707 if test "X${COLLECT_NAMES+set}" != Xset; then
708 COLLECT_NAMES=
709 export COLLECT_NAMES
710 fi
711 _LT_EOF
712 ;;
713 esac
714
715 _LT_PROG_LTMAIN
716
717 # We use sed instead of cat because bash on DJGPP gets confused if
718 # if finds mixed CR/LF and LF-only lines. Since sed operates in
719 # text mode, it properly converts lines to CR/LF. This bash problem
720 # is reportedly fixed, but why not run on old versions too?
721 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
722 || (rm -f "$cfgfile"; exit 1)
723
724 _LT_PROG_XSI_SHELLFNS
725
726 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
727 || (rm -f "$cfgfile"; exit 1)
728
729 mv -f "$cfgfile" "$ofile" ||
730 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
731 chmod +x "$ofile"
732 ],
733 [cat <<_LT_EOF >> "$ofile"
734
735 dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
736 dnl in a comment (ie after a #).
737 # ### BEGIN LIBTOOL TAG CONFIG: $1
738 _LT_LIBTOOL_TAG_VARS(_LT_TAG)
739 # ### END LIBTOOL TAG CONFIG: $1
740 _LT_EOF
741 ])dnl /m4_if
742 ],
743 [m4_if([$1], [], [
744 PACKAGE='$PACKAGE'
745 VERSION='$VERSION'
746 TIMESTAMP='$TIMESTAMP'
747 RM='$RM'
748 ofile='$ofile'], [])
749 ])dnl /_LT_CONFIG_SAVE_COMMANDS
750 ])# _LT_CONFIG
751
752
753 # LT_SUPPORTED_TAG(TAG)
754 # ---------------------
755 # Trace this macro to discover what tags are supported by the libtool
756 # --tag option, using:
757 # autoconf --trace 'LT_SUPPORTED_TAG:$1'
758 AC_DEFUN([LT_SUPPORTED_TAG], [])
759
760
761 # C support is built-in for now
762 m4_define([_LT_LANG_C_enabled], [])
763 m4_define([_LT_TAGS], [])
764
765
766 # LT_LANG(LANG)
767 # -------------
768 # Enable libtool support for the given language if not already enabled.
769 AC_DEFUN([LT_LANG],
770 [AC_BEFORE([$0], [LT_OUTPUT])dnl
771 m4_case([$1],
772 [C], [_LT_LANG(C)],
773 [C++], [_LT_LANG(CXX)],
774 [Java], [_LT_LANG(GCJ)],
775 [Fortran 77], [_LT_LANG(F77)],
776 [Fortran], [_LT_LANG(FC)],
777 [Windows Resource], [_LT_LANG(RC)],
778 [m4_ifdef([_LT_LANG_]$1[_CONFIG],
779 [_LT_LANG($1)],
780 [m4_fatal([$0: unsupported language: "$1"])])])dnl
781 ])# LT_LANG
782
783
784 # _LT_LANG(LANGNAME)
785 # ------------------
786 m4_defun([_LT_LANG],
787 [m4_ifdef([_LT_LANG_]$1[_enabled], [],
788 [LT_SUPPORTED_TAG([$1])dnl
789 m4_append([_LT_TAGS], [$1 ])dnl
790 m4_define([_LT_LANG_]$1[_enabled], [])dnl
791 _LT_LANG_$1_CONFIG($1)])dnl
792 ])# _LT_LANG
793
794
795 # _LT_LANG_DEFAULT_CONFIG
796 # -----------------------
797 m4_defun([_LT_LANG_DEFAULT_CONFIG],
798 [AC_PROVIDE_IFELSE([AC_PROG_CXX],
799 [LT_LANG(CXX)],
800 [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
801
802 AC_PROVIDE_IFELSE([AC_PROG_F77],
803 [LT_LANG(F77)],
804 [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
805
806 AC_PROVIDE_IFELSE([AC_PROG_FC],
807 [LT_LANG(FC)],
808 [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
809
810 dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
811 dnl pulling things in needlessly.
812 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
813 [LT_LANG(GCJ)],
814 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
815 [LT_LANG(GCJ)],
816 [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
817 [LT_LANG(GCJ)],
818 [m4_ifdef([AC_PROG_GCJ],
819 [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
820 m4_ifdef([A][M_PROG_GCJ],
821 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
822 m4_ifdef([LT_PROG_GCJ],
823 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
824
825 AC_PROVIDE_IFELSE([LT_PROG_RC],
826 [LT_LANG(RC)],
827 [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
828 ])# _LT_LANG_DEFAULT_CONFIG
829
830 # Obsolete macros:
831 AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
832 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
833 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
834 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
835 dnl aclocal-1.4 backwards compatibility:
836 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
837 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
838 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
839 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
840
841
842 # _LT_TAG_COMPILER
843 # ----------------
844 m4_defun([_LT_TAG_COMPILER],
845 [AC_REQUIRE([AC_PROG_CC])dnl
846
847 _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
848 _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
849 _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
850 _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
851
852 # If no C compiler was specified, use CC.
853 LTCC=${LTCC-"$CC"}
854
855 # If no C compiler flags were specified, use CFLAGS.
856 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
857
858 # Allow CC to be a program name with arguments.
859 compiler=$CC
860 ])# _LT_TAG_COMPILER
861
862
863 # _LT_COMPILER_BOILERPLATE
864 # ------------------------
865 # Check for compiler boilerplate output or warnings with
866 # the simple compiler test code.
867 m4_defun([_LT_COMPILER_BOILERPLATE],
868 [m4_require([_LT_DECL_SED])dnl
869 ac_outfile=conftest.$ac_objext
870 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
871 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
872 _lt_compiler_boilerplate=`cat conftest.err`
873 $RM conftest*
874 ])# _LT_COMPILER_BOILERPLATE
875
876
877 # _LT_LINKER_BOILERPLATE
878 # ----------------------
879 # Check for linker boilerplate output or warnings with
880 # the simple link test code.
881 m4_defun([_LT_LINKER_BOILERPLATE],
882 [m4_require([_LT_DECL_SED])dnl
883 ac_outfile=conftest.$ac_objext
884 echo "$lt_simple_link_test_code" >conftest.$ac_ext
885 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
886 _lt_linker_boilerplate=`cat conftest.err`
887 $RM -r conftest*
888 ])# _LT_LINKER_BOILERPLATE
889
890 # _LT_REQUIRED_DARWIN_CHECKS
891 # -------------------------
892 m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
893 case $host_os in
894 rhapsody* | darwin*)
895 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
896 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
897 AC_CHECK_TOOL([LIPO], [lipo], [:])
898 AC_CHECK_TOOL([OTOOL], [otool], [:])
899 AC_CHECK_TOOL([OTOOL64], [otool64], [:])
900 _LT_DECL([], [DSYMUTIL], [1],
901 [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
902 _LT_DECL([], [NMEDIT], [1],
903 [Tool to change global to local symbols on Mac OS X])
904 _LT_DECL([], [LIPO], [1],
905 [Tool to manipulate fat objects and archives on Mac OS X])
906 _LT_DECL([], [OTOOL], [1],
907 [ldd/readelf like tool for Mach-O binaries on Mac OS X])
908 _LT_DECL([], [OTOOL64], [1],
909 [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
910
911 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
912 [lt_cv_apple_cc_single_mod=no
913 if test -z "${LT_MULTI_MODULE}"; then
914 # By default we will add the -single_module flag. You can override
915 # by either setting the environment variable LT_MULTI_MODULE
916 # non-empty at configure time, or by adding -multi_module to the
917 # link flags.
918 rm -rf libconftest.dylib*
919 echo "int foo(void){return 1;}" > conftest.c
920 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
921 -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
922 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
923 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
924 _lt_result=$?
925 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
926 lt_cv_apple_cc_single_mod=yes
927 else
928 cat conftest.err >&AS_MESSAGE_LOG_FD
929 fi
930 rm -rf libconftest.dylib*
931 rm -f conftest.*
932 fi])
933 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
934 [lt_cv_ld_exported_symbols_list],
935 [lt_cv_ld_exported_symbols_list=no
936 save_LDFLAGS=$LDFLAGS
937 echo "_main" > conftest.sym
938 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
939 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
940 [lt_cv_ld_exported_symbols_list=yes],
941 [lt_cv_ld_exported_symbols_list=no])
942 LDFLAGS="$save_LDFLAGS"
943 ])
944 case $host_os in
945 rhapsody* | darwin1.[[012]])
946 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
947 darwin1.*)
948 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
949 darwin*) # darwin 5.x on
950 # if running on 10.5 or later, the deployment target defaults
951 # to the OS version, if on x86, and 10.4, the deployment
952 # target defaults to 10.4. Don't you love it?
953 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
954 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
955 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
956 10.[[012]]*)
957 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
958 10.*)
959 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
960 esac
961 ;;
962 esac
963 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
964 _lt_dar_single_mod='$single_module'
965 fi
966 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
967 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
968 else
969 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
970 fi
971 if test "$DSYMUTIL" != ":"; then
972 _lt_dsymutil='~$DSYMUTIL $lib || :'
973 else
974 _lt_dsymutil=
975 fi
976 ;;
977 esac
978 ])
979
980
981 # _LT_DARWIN_LINKER_FEATURES
982 # --------------------------
983 # Checks for linker and compiler features on darwin
984 m4_defun([_LT_DARWIN_LINKER_FEATURES],
985 [
986 m4_require([_LT_REQUIRED_DARWIN_CHECKS])
987 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
988 _LT_TAGVAR(hardcode_direct, $1)=no
989 _LT_TAGVAR(hardcode_automatic, $1)=yes
990 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
991 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
992 _LT_TAGVAR(link_all_deplibs, $1)=yes
993 _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
994 case $cc_basename in
995 ifort*) _lt_dar_can_shared=yes ;;
996 *) _lt_dar_can_shared=$GCC ;;
997 esac
998 if test "$_lt_dar_can_shared" = "yes"; then
999 output_verbose_link_cmd=echo
1000 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
1001 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1002 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
1003 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
1004 m4_if([$1], [CXX],
1005 [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1006 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
1007 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
1008 fi
1009 ],[])
1010 else
1011 _LT_TAGVAR(ld_shlibs, $1)=no
1012 fi
1013 ])
1014
1015 # _LT_SYS_MODULE_PATH_AIX
1016 # -----------------------
1017 # Links a minimal program and checks the executable
1018 # for the system default hardcoded library path. In most cases,
1019 # this is /usr/lib:/lib, but when the MPI compilers are used
1020 # the location of the communication and MPI libs are included too.
1021 # If we don't find anything, use the default library path according
1022 # to the aix ld manual.
1023 m4_defun([_LT_SYS_MODULE_PATH_AIX],
1024 [m4_require([_LT_DECL_SED])dnl
1025 AC_LINK_IFELSE(AC_LANG_PROGRAM,[
1026 lt_aix_libpath_sed='
1027 /Import File Strings/,/^$/ {
1028 /^0/ {
1029 s/^0 *\(.*\)$/\1/
1030 p
1031 }
1032 }'
1033 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1034 # Check for a 64-bit object if we didn't find anything.
1035 if test -z "$aix_libpath"; then
1036 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1037 fi],[])
1038 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1039 ])# _LT_SYS_MODULE_PATH_AIX
1040
1041
1042 # _LT_SHELL_INIT(ARG)
1043 # -------------------
1044 m4_define([_LT_SHELL_INIT],
1045 [ifdef([AC_DIVERSION_NOTICE],
1046 [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1047 [AC_DIVERT_PUSH(NOTICE)])
1048 $1
1049 AC_DIVERT_POP
1050 ])# _LT_SHELL_INIT
1051
1052
1053 # _LT_PROG_ECHO_BACKSLASH
1054 # -----------------------
1055 # Add some code to the start of the generated configure script which
1056 # will find an echo command which doesn't interpret backslashes.
1057 m4_defun([_LT_PROG_ECHO_BACKSLASH],
1058 [_LT_SHELL_INIT([
1059 # Check that we are running under the correct shell.
1060 SHELL=${CONFIG_SHELL-/bin/sh}
1061
1062 case X$lt_ECHO in
1063 X*--fallback-echo)
1064 # Remove one level of quotation (which was required for Make).
1065 ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1066 ;;
1067 esac
1068
1069 ECHO=${lt_ECHO-echo}
1070 if test "X[$]1" = X--no-reexec; then
1071 # Discard the --no-reexec flag, and continue.
1072 shift
1073 elif test "X[$]1" = X--fallback-echo; then
1074 # Avoid inline document here, it may be left over
1075 :
1076 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
1077 # Yippee, $ECHO works!
1078 :
1079 else
1080 # Restart under the correct shell.
1081 exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1082 fi
1083
1084 if test "X[$]1" = X--fallback-echo; then
1085 # used as fallback echo
1086 shift
1087 cat <<_LT_EOF
1088 [$]*
1089 _LT_EOF
1090 exit 0
1091 fi
1092
1093 # The HP-UX ksh and POSIX shell print the target directory to stdout
1094 # if CDPATH is set.
1095 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1096
1097 if test -z "$lt_ECHO"; then
1098 if test "X${echo_test_string+set}" != Xset; then
1099 # find a string as large as possible, as long as the shell can cope with it
1100 for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1101 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1102 if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
1103 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
1104 then
1105 break
1106 fi
1107 done
1108 fi
1109
1110 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1111 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1112 test "X$echo_testing_string" = "X$echo_test_string"; then
1113 :
1114 else
1115 # The Solaris, AIX, and Digital Unix default echo programs unquote
1116 # backslashes. This makes it impossible to quote backslashes using
1117 # echo "$something" | sed 's/\\/\\\\/g'
1118 #
1119 # So, first we look for a working echo in the user's PATH.
1120
1121 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1122 for dir in $PATH /usr/ucb; do
1123 IFS="$lt_save_ifs"
1124 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1125 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1126 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1127 test "X$echo_testing_string" = "X$echo_test_string"; then
1128 ECHO="$dir/echo"
1129 break
1130 fi
1131 done
1132 IFS="$lt_save_ifs"
1133
1134 if test "X$ECHO" = Xecho; then
1135 # We didn't find a better echo, so look for alternatives.
1136 if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
1137 echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
1138 test "X$echo_testing_string" = "X$echo_test_string"; then
1139 # This shell has a builtin print -r that does the trick.
1140 ECHO='print -r'
1141 elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
1142 test "X$CONFIG_SHELL" != X/bin/ksh; then
1143 # If we have ksh, try running configure again with it.
1144 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1145 export ORIGINAL_CONFIG_SHELL
1146 CONFIG_SHELL=/bin/ksh
1147 export CONFIG_SHELL
1148 exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1149 else
1150 # Try using printf.
1151 ECHO='printf %s\n'
1152 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1153 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1154 test "X$echo_testing_string" = "X$echo_test_string"; then
1155 # Cool, printf works
1156 :
1157 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1158 test "X$echo_testing_string" = 'X\t' &&
1159 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1160 test "X$echo_testing_string" = "X$echo_test_string"; then
1161 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1162 export CONFIG_SHELL
1163 SHELL="$CONFIG_SHELL"
1164 export SHELL
1165 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1166 elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1167 test "X$echo_testing_string" = 'X\t' &&
1168 echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1169 test "X$echo_testing_string" = "X$echo_test_string"; then
1170 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1171 else
1172 # maybe with a smaller string...
1173 prev=:
1174
1175 for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1176 if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
1177 then
1178 break
1179 fi
1180 prev="$cmd"
1181 done
1182
1183 if test "$prev" != 'sed 50q "[$]0"'; then
1184 echo_test_string=`eval $prev`
1185 export echo_test_string
1186 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1187 else
1188 # Oops. We lost completely, so just stick with echo.
1189 ECHO=echo
1190 fi
1191 fi
1192 fi
1193 fi
1194 fi
1195 fi
1196
1197 # Copy echo and quote the copy suitably for passing to libtool from
1198 # the Makefile, instead of quoting the original, which is used later.
1199 lt_ECHO=$ECHO
1200 if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1201 lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1202 fi
1203
1204 AC_SUBST(lt_ECHO)
1205 ])
1206 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1207 _LT_DECL([], [ECHO], [1],
1208 [An echo program that does not interpret backslashes])
1209 ])# _LT_PROG_ECHO_BACKSLASH
1210
1211
1212 # _LT_ENABLE_LOCK
1213 # ---------------
1214 m4_defun([_LT_ENABLE_LOCK],
1215 [AC_ARG_ENABLE([libtool-lock],
1216 [AS_HELP_STRING([--disable-libtool-lock],
1217 [avoid locking (might break parallel builds)])])
1218 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1219
1220 # Some flags need to be propagated to the compiler or linker for good
1221 # libtool support.
1222 case $host in
1223 ia64-*-hpux*)
1224 # Find out which ABI we are using.
1225 echo 'int i;' > conftest.$ac_ext
1226 if AC_TRY_EVAL(ac_compile); then
1227 case `/usr/bin/file conftest.$ac_objext` in
1228 *ELF-32*)
1229 HPUX_IA64_MODE="32"
1230 ;;
1231 *ELF-64*)
1232 HPUX_IA64_MODE="64"
1233 ;;
1234 esac
1235 fi
1236 rm -rf conftest*
1237 ;;
1238 *-*-irix6*)
1239 # Find out which ABI we are using.
1240 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1241 if AC_TRY_EVAL(ac_compile); then
1242 if test "$lt_cv_prog_gnu_ld" = yes; then
1243 case `/usr/bin/file conftest.$ac_objext` in
1244 *32-bit*)
1245 LD="${LD-ld} -melf32bsmip"
1246 ;;
1247 *N32*)
1248 LD="${LD-ld} -melf32bmipn32"
1249 ;;
1250 *64-bit*)
1251 LD="${LD-ld} -melf64bmip"
1252 ;;
1253 esac
1254 else
1255 case `/usr/bin/file conftest.$ac_objext` in
1256 *32-bit*)
1257 LD="${LD-ld} -32"
1258 ;;
1259 *N32*)
1260 LD="${LD-ld} -n32"
1261 ;;
1262 *64-bit*)
1263 LD="${LD-ld} -64"
1264 ;;
1265 esac
1266 fi
1267 fi
1268 rm -rf conftest*
1269 ;;
1270
1271 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1272 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1273 # Find out which ABI we are using.
1274 echo 'int i;' > conftest.$ac_ext
1275 if AC_TRY_EVAL(ac_compile); then
1276 case `/usr/bin/file conftest.o` in
1277 *32-bit*)
1278 case $host in
1279 x86_64-*kfreebsd*-gnu)
1280 LD="${LD-ld} -m elf_i386_fbsd"
1281 ;;
1282 x86_64-*linux*)
1283 LD="${LD-ld} -m elf_i386"
1284 ;;
1285 ppc64-*linux*|powerpc64-*linux*)
1286 LD="${LD-ld} -m elf32ppclinux"
1287 ;;
1288 s390x-*linux*)
1289 LD="${LD-ld} -m elf_s390"
1290 ;;
1291 sparc64-*linux*)
1292 LD="${LD-ld} -m elf32_sparc"
1293 ;;
1294 esac
1295 ;;
1296 *64-bit*)
1297 case $host in
1298 x86_64-*kfreebsd*-gnu)
1299 LD="${LD-ld} -m elf_x86_64_fbsd"
1300 ;;
1301 x86_64-*linux*)
1302 LD="${LD-ld} -m elf_x86_64"
1303 ;;
1304 powerpc64le-*linux*)
1305 LD="${LD-ld} -m elf64lppc"
1306 ;;
1307 powerpc64-*linux*)
1308 LD="${LD-ld} -m elf64ppc"
1309 ;;
1310 s390*-*linux*|s390*-*tpf*)
1311 LD="${LD-ld} -m elf64_s390"
1312 ;;
1313 sparc*-*linux*)
1314 LD="${LD-ld} -m elf64_sparc"
1315 ;;
1316 esac
1317 ;;
1318 esac
1319 fi
1320 rm -rf conftest*
1321 ;;
1322
1323 *-*-sco3.2v5*)
1324 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1325 SAVE_CFLAGS="$CFLAGS"
1326 CFLAGS="$CFLAGS -belf"
1327 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1328 [AC_LANG_PUSH(C)
1329 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1330 AC_LANG_POP])
1331 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1332 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1333 CFLAGS="$SAVE_CFLAGS"
1334 fi
1335 ;;
1336 sparc*-*solaris*)
1337 # Find out which ABI we are using.
1338 echo 'int i;' > conftest.$ac_ext
1339 if AC_TRY_EVAL(ac_compile); then
1340 case `/usr/bin/file conftest.o` in
1341 *64-bit*)
1342 case $lt_cv_prog_gnu_ld in
1343 yes*) LD="${LD-ld} -m elf64_sparc" ;;
1344 *)
1345 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1346 LD="${LD-ld} -64"
1347 fi
1348 ;;
1349 esac
1350 ;;
1351 esac
1352 fi
1353 rm -rf conftest*
1354 ;;
1355 esac
1356
1357 need_locks="$enable_libtool_lock"
1358 ])# _LT_ENABLE_LOCK
1359
1360
1361 # _LT_CMD_OLD_ARCHIVE
1362 # -------------------
1363 m4_defun([_LT_CMD_OLD_ARCHIVE],
1364 [AC_CHECK_TOOL(AR, ar, false)
1365 test -z "$AR" && AR=ar
1366 test -z "$AR_FLAGS" && AR_FLAGS=cru
1367 _LT_DECL([], [AR], [1], [The archiver])
1368 _LT_DECL([], [AR_FLAGS], [1])
1369
1370 AC_CHECK_TOOL(STRIP, strip, :)
1371 test -z "$STRIP" && STRIP=:
1372 _LT_DECL([], [STRIP], [1], [A symbol stripping program])
1373
1374 AC_CHECK_TOOL(RANLIB, ranlib, :)
1375 test -z "$RANLIB" && RANLIB=:
1376 _LT_DECL([], [RANLIB], [1],
1377 [Commands used to install an old-style archive])
1378
1379 # Determine commands to create old-style static archives.
1380 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1381 old_postinstall_cmds='chmod 644 $oldlib'
1382 old_postuninstall_cmds=
1383
1384 if test -n "$RANLIB"; then
1385 case $host_os in
1386 openbsd*)
1387 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1388 ;;
1389 *)
1390 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1391 ;;
1392 esac
1393 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1394 fi
1395 _LT_DECL([], [old_postinstall_cmds], [2])
1396 _LT_DECL([], [old_postuninstall_cmds], [2])
1397 _LT_TAGDECL([], [old_archive_cmds], [2],
1398 [Commands used to build an old-style archive])
1399 ])# _LT_CMD_OLD_ARCHIVE
1400
1401
1402 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1403 # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1404 # ----------------------------------------------------------------
1405 # Check whether the given compiler option works
1406 AC_DEFUN([_LT_COMPILER_OPTION],
1407 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1408 m4_require([_LT_DECL_SED])dnl
1409 AC_CACHE_CHECK([$1], [$2],
1410 [$2=no
1411 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1412 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1413 lt_compiler_flag="$3"
1414 # Insert the option either (1) after the last *FLAGS variable, or
1415 # (2) before a word containing "conftest.", or (3) at the end.
1416 # Note that $ac_compile itself does not contain backslashes and begins
1417 # with a dollar sign (not a hyphen), so the echo should work correctly.
1418 # The option is referenced via a variable to avoid confusing sed.
1419 lt_compile=`echo "$ac_compile" | $SED \
1420 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1421 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1422 -e 's:$: $lt_compiler_flag:'`
1423 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1424 (eval "$lt_compile" 2>conftest.err)
1425 ac_status=$?
1426 cat conftest.err >&AS_MESSAGE_LOG_FD
1427 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1428 if (exit $ac_status) && test -s "$ac_outfile"; then
1429 # The compiler can only warn and ignore the option if not recognized
1430 # So say no if there are warnings other than the usual output.
1431 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1432 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1433 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1434 $2=yes
1435 fi
1436 fi
1437 $RM conftest*
1438 ])
1439
1440 if test x"[$]$2" = xyes; then
1441 m4_if([$5], , :, [$5])
1442 else
1443 m4_if([$6], , :, [$6])
1444 fi
1445 ])# _LT_COMPILER_OPTION
1446
1447 # Old name:
1448 AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1449 dnl aclocal-1.4 backwards compatibility:
1450 dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1451
1452
1453 # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1454 # [ACTION-SUCCESS], [ACTION-FAILURE])
1455 # ----------------------------------------------------
1456 # Check whether the given linker option works
1457 AC_DEFUN([_LT_LINKER_OPTION],
1458 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1459 m4_require([_LT_DECL_SED])dnl
1460 AC_CACHE_CHECK([$1], [$2],
1461 [$2=no
1462 save_LDFLAGS="$LDFLAGS"
1463 LDFLAGS="$LDFLAGS $3"
1464 echo "$lt_simple_link_test_code" > conftest.$ac_ext
1465 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1466 # The linker can only warn and ignore the option if not recognized
1467 # So say no if there are warnings
1468 if test -s conftest.err; then
1469 # Append any errors to the config.log.
1470 cat conftest.err 1>&AS_MESSAGE_LOG_FD
1471 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1472 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1473 if diff conftest.exp conftest.er2 >/dev/null; then
1474 $2=yes
1475 fi
1476 else
1477 $2=yes
1478 fi
1479 fi
1480 $RM -r conftest*
1481 LDFLAGS="$save_LDFLAGS"
1482 ])
1483
1484 if test x"[$]$2" = xyes; then
1485 m4_if([$4], , :, [$4])
1486 else
1487 m4_if([$5], , :, [$5])
1488 fi
1489 ])# _LT_LINKER_OPTION
1490
1491 # Old name:
1492 AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1493 dnl aclocal-1.4 backwards compatibility:
1494 dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1495
1496
1497 # LT_CMD_MAX_LEN
1498 #---------------
1499 AC_DEFUN([LT_CMD_MAX_LEN],
1500 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1501 # find the maximum length of command line arguments
1502 AC_MSG_CHECKING([the maximum length of command line arguments])
1503 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1504 i=0
1505 teststring="ABCD"
1506
1507 case $build_os in
1508 msdosdjgpp*)
1509 # On DJGPP, this test can blow up pretty badly due to problems in libc
1510 # (any single argument exceeding 2000 bytes causes a buffer overrun
1511 # during glob expansion). Even if it were fixed, the result of this
1512 # check would be larger than it should be.
1513 lt_cv_sys_max_cmd_len=12288; # 12K is about right
1514 ;;
1515
1516 gnu*)
1517 # Under GNU Hurd, this test is not required because there is
1518 # no limit to the length of command line arguments.
1519 # Libtool will interpret -1 as no limit whatsoever
1520 lt_cv_sys_max_cmd_len=-1;
1521 ;;
1522
1523 cygwin* | mingw* | cegcc*)
1524 # On Win9x/ME, this test blows up -- it succeeds, but takes
1525 # about 5 minutes as the teststring grows exponentially.
1526 # Worse, since 9x/ME are not pre-emptively multitasking,
1527 # you end up with a "frozen" computer, even though with patience
1528 # the test eventually succeeds (with a max line length of 256k).
1529 # Instead, let's just punt: use the minimum linelength reported by
1530 # all of the supported platforms: 8192 (on NT/2K/XP).
1531 lt_cv_sys_max_cmd_len=8192;
1532 ;;
1533
1534 beos*)
1535 # On BeOS, this test takes a really really long time.
1536 # So we just punt and use a minimum line length of 8192.
1537 lt_cv_sys_max_cmd_len=8192;
1538 ;;
1539
1540 amigaos*)
1541 # On AmigaOS with pdksh, this test takes hours, literally.
1542 # So we just punt and use a minimum line length of 8192.
1543 lt_cv_sys_max_cmd_len=8192;
1544 ;;
1545
1546 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1547 # This has been around since 386BSD, at least. Likely further.
1548 if test -x /sbin/sysctl; then
1549 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1550 elif test -x /usr/sbin/sysctl; then
1551 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1552 else
1553 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
1554 fi
1555 # And add a safety zone
1556 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1557 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1558 ;;
1559
1560 interix*)
1561 # We know the value 262144 and hardcode it with a safety zone (like BSD)
1562 lt_cv_sys_max_cmd_len=196608
1563 ;;
1564
1565 osf*)
1566 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1567 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1568 # nice to cause kernel panics so lets avoid the loop below.
1569 # First set a reasonable default.
1570 lt_cv_sys_max_cmd_len=16384
1571 #
1572 if test -x /sbin/sysconfig; then
1573 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1574 *1*) lt_cv_sys_max_cmd_len=-1 ;;
1575 esac
1576 fi
1577 ;;
1578 sco3.2v5*)
1579 lt_cv_sys_max_cmd_len=102400
1580 ;;
1581 sysv5* | sco5v6* | sysv4.2uw2*)
1582 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1583 if test -n "$kargmax"; then
1584 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
1585 else
1586 lt_cv_sys_max_cmd_len=32768
1587 fi
1588 ;;
1589 *)
1590 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1591 if test -n "$lt_cv_sys_max_cmd_len"; then
1592 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1593 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1594 else
1595 # Make teststring a little bigger before we do anything with it.
1596 # a 1K string should be a reasonable start.
1597 for i in 1 2 3 4 5 6 7 8 ; do
1598 teststring=$teststring$teststring
1599 done
1600 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1601 # If test is not a shell built-in, we'll probably end up computing a
1602 # maximum length that is only half of the actual maximum length, but
1603 # we can't tell.
1604 while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
1605 = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
1606 test $i != 17 # 1/2 MB should be enough
1607 do
1608 i=`expr $i + 1`
1609 teststring=$teststring$teststring
1610 done
1611 # Only check the string length outside the loop.
1612 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1613 teststring=
1614 # Add a significant safety factor because C++ compilers can tack on
1615 # massive amounts of additional arguments before passing them to the
1616 # linker. It appears as though 1/2 is a usable value.
1617 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1618 fi
1619 ;;
1620 esac
1621 ])
1622 if test -n $lt_cv_sys_max_cmd_len ; then
1623 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1624 else
1625 AC_MSG_RESULT(none)
1626 fi
1627 max_cmd_len=$lt_cv_sys_max_cmd_len
1628 _LT_DECL([], [max_cmd_len], [0],
1629 [What is the maximum length of a command?])
1630 ])# LT_CMD_MAX_LEN
1631
1632 # Old name:
1633 AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1634 dnl aclocal-1.4 backwards compatibility:
1635 dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1636
1637
1638 # _LT_HEADER_DLFCN
1639 # ----------------
1640 m4_defun([_LT_HEADER_DLFCN],
1641 [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1642 ])# _LT_HEADER_DLFCN
1643
1644
1645 # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1646 # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1647 # ----------------------------------------------------------------
1648 m4_defun([_LT_TRY_DLOPEN_SELF],
1649 [m4_require([_LT_HEADER_DLFCN])dnl
1650 if test "$cross_compiling" = yes; then :
1651 [$4]
1652 else
1653 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1654 lt_status=$lt_dlunknown
1655 cat > conftest.$ac_ext <<_LT_EOF
1656 [#line __oline__ "configure"
1657 #include "confdefs.h"
1658
1659 #if HAVE_DLFCN_H
1660 #include <dlfcn.h>
1661 #endif
1662
1663 #include <stdio.h>
1664
1665 #ifdef RTLD_GLOBAL
1666 # define LT_DLGLOBAL RTLD_GLOBAL
1667 #else
1668 # ifdef DL_GLOBAL
1669 # define LT_DLGLOBAL DL_GLOBAL
1670 # else
1671 # define LT_DLGLOBAL 0
1672 # endif
1673 #endif
1674
1675 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1676 find out it does not work in some platform. */
1677 #ifndef LT_DLLAZY_OR_NOW
1678 # ifdef RTLD_LAZY
1679 # define LT_DLLAZY_OR_NOW RTLD_LAZY
1680 # else
1681 # ifdef DL_LAZY
1682 # define LT_DLLAZY_OR_NOW DL_LAZY
1683 # else
1684 # ifdef RTLD_NOW
1685 # define LT_DLLAZY_OR_NOW RTLD_NOW
1686 # else
1687 # ifdef DL_NOW
1688 # define LT_DLLAZY_OR_NOW DL_NOW
1689 # else
1690 # define LT_DLLAZY_OR_NOW 0
1691 # endif
1692 # endif
1693 # endif
1694 # endif
1695 #endif
1696
1697 void fnord() { int i=42;}
1698 int main ()
1699 {
1700 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1701 int status = $lt_dlunknown;
1702
1703 if (self)
1704 {
1705 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
1706 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1707 /* dlclose (self); */
1708 }
1709 else
1710 puts (dlerror ());
1711
1712 return status;
1713 }]
1714 _LT_EOF
1715 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1716 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1717 lt_status=$?
1718 case x$lt_status in
1719 x$lt_dlno_uscore) $1 ;;
1720 x$lt_dlneed_uscore) $2 ;;
1721 x$lt_dlunknown|x*) $3 ;;
1722 esac
1723 else :
1724 # compilation failed
1725 $3
1726 fi
1727 fi
1728 rm -fr conftest*
1729 ])# _LT_TRY_DLOPEN_SELF
1730
1731
1732 # LT_SYS_DLOPEN_SELF
1733 # ------------------
1734 AC_DEFUN([LT_SYS_DLOPEN_SELF],
1735 [m4_require([_LT_HEADER_DLFCN])dnl
1736 if test "x$enable_dlopen" != xyes; then
1737 enable_dlopen=unknown
1738 enable_dlopen_self=unknown
1739 enable_dlopen_self_static=unknown
1740 else
1741 lt_cv_dlopen=no
1742 lt_cv_dlopen_libs=
1743
1744 case $host_os in
1745 beos*)
1746 lt_cv_dlopen="load_add_on"
1747 lt_cv_dlopen_libs=
1748 lt_cv_dlopen_self=yes
1749 ;;
1750
1751 mingw* | pw32* | cegcc*)
1752 lt_cv_dlopen="LoadLibrary"
1753 lt_cv_dlopen_libs=
1754 ;;
1755
1756 cygwin*)
1757 lt_cv_dlopen="dlopen"
1758 lt_cv_dlopen_libs=
1759 ;;
1760
1761 darwin*)
1762 # if libdl is installed we need to link against it
1763 AC_CHECK_LIB([dl], [dlopen],
1764 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1765 lt_cv_dlopen="dyld"
1766 lt_cv_dlopen_libs=
1767 lt_cv_dlopen_self=yes
1768 ])
1769 ;;
1770
1771 *)
1772 AC_CHECK_FUNC([shl_load],
1773 [lt_cv_dlopen="shl_load"],
1774 [AC_CHECK_LIB([dld], [shl_load],
1775 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1776 [AC_CHECK_FUNC([dlopen],
1777 [lt_cv_dlopen="dlopen"],
1778 [AC_CHECK_LIB([dl], [dlopen],
1779 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1780 [AC_CHECK_LIB([svld], [dlopen],
1781 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1782 [AC_CHECK_LIB([dld], [dld_link],
1783 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1784 ])
1785 ])
1786 ])
1787 ])
1788 ])
1789 ;;
1790 esac
1791
1792 if test "x$lt_cv_dlopen" != xno; then
1793 enable_dlopen=yes
1794 else
1795 enable_dlopen=no
1796 fi
1797
1798 case $lt_cv_dlopen in
1799 dlopen)
1800 save_CPPFLAGS="$CPPFLAGS"
1801 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1802
1803 save_LDFLAGS="$LDFLAGS"
1804 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1805
1806 save_LIBS="$LIBS"
1807 LIBS="$lt_cv_dlopen_libs $LIBS"
1808
1809 AC_CACHE_CHECK([whether a program can dlopen itself],
1810 lt_cv_dlopen_self, [dnl
1811 _LT_TRY_DLOPEN_SELF(
1812 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1813 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1814 ])
1815
1816 if test "x$lt_cv_dlopen_self" = xyes; then
1817 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1818 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1819 lt_cv_dlopen_self_static, [dnl
1820 _LT_TRY_DLOPEN_SELF(
1821 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1822 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
1823 ])
1824 fi
1825
1826 CPPFLAGS="$save_CPPFLAGS"
1827 LDFLAGS="$save_LDFLAGS"
1828 LIBS="$save_LIBS"
1829 ;;
1830 esac
1831
1832 case $lt_cv_dlopen_self in
1833 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1834 *) enable_dlopen_self=unknown ;;
1835 esac
1836
1837 case $lt_cv_dlopen_self_static in
1838 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1839 *) enable_dlopen_self_static=unknown ;;
1840 esac
1841 fi
1842 _LT_DECL([dlopen_support], [enable_dlopen], [0],
1843 [Whether dlopen is supported])
1844 _LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1845 [Whether dlopen of programs is supported])
1846 _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1847 [Whether dlopen of statically linked programs is supported])
1848 ])# LT_SYS_DLOPEN_SELF
1849
1850 # Old name:
1851 AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1852 dnl aclocal-1.4 backwards compatibility:
1853 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1854
1855
1856 # _LT_COMPILER_C_O([TAGNAME])
1857 # ---------------------------
1858 # Check to see if options -c and -o are simultaneously supported by compiler.
1859 # This macro does not hard code the compiler like AC_PROG_CC_C_O.
1860 m4_defun([_LT_COMPILER_C_O],
1861 [m4_require([_LT_DECL_SED])dnl
1862 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1863 m4_require([_LT_TAG_COMPILER])dnl
1864 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1865 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1866 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1867 $RM -r conftest 2>/dev/null
1868 mkdir conftest
1869 cd conftest
1870 mkdir out
1871 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1872
1873 lt_compiler_flag="-o out/conftest2.$ac_objext"
1874 # Insert the option either (1) after the last *FLAGS variable, or
1875 # (2) before a word containing "conftest.", or (3) at the end.
1876 # Note that $ac_compile itself does not contain backslashes and begins
1877 # with a dollar sign (not a hyphen), so the echo should work correctly.
1878 lt_compile=`echo "$ac_compile" | $SED \
1879 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1880 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1881 -e 's:$: $lt_compiler_flag:'`
1882 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1883 (eval "$lt_compile" 2>out/conftest.err)
1884 ac_status=$?
1885 cat out/conftest.err >&AS_MESSAGE_LOG_FD
1886 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1887 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1888 then
1889 # The compiler can only warn and ignore the option if not recognized
1890 # So say no if there are warnings
1891 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1892 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1893 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1894 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1895 fi
1896 fi
1897 chmod u+w . 2>&AS_MESSAGE_LOG_FD
1898 $RM conftest*
1899 # SGI C++ compiler will create directory out/ii_files/ for
1900 # template instantiation
1901 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1902 $RM out/* && rmdir out
1903 cd ..
1904 $RM -r conftest
1905 $RM conftest*
1906 ])
1907 _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1908 [Does compiler simultaneously support -c and -o options?])
1909 ])# _LT_COMPILER_C_O
1910
1911
1912 # _LT_COMPILER_FILE_LOCKS([TAGNAME])
1913 # ----------------------------------
1914 # Check to see if we can do hard links to lock some files if needed
1915 m4_defun([_LT_COMPILER_FILE_LOCKS],
1916 [m4_require([_LT_ENABLE_LOCK])dnl
1917 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1918 _LT_COMPILER_C_O([$1])
1919
1920 hard_links="nottested"
1921 if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1922 # do not overwrite the value of need_locks provided by the user
1923 AC_MSG_CHECKING([if we can lock with hard links])
1924 hard_links=yes
1925 $RM conftest*
1926 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1927 touch conftest.a
1928 ln conftest.a conftest.b 2>&5 || hard_links=no
1929 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1930 AC_MSG_RESULT([$hard_links])
1931 if test "$hard_links" = no; then
1932 AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1933 need_locks=warn
1934 fi
1935 else
1936 need_locks=no
1937 fi
1938 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1939 ])# _LT_COMPILER_FILE_LOCKS
1940
1941
1942 # _LT_CHECK_OBJDIR
1943 # ----------------
1944 m4_defun([_LT_CHECK_OBJDIR],
1945 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1946 [rm -f .libs 2>/dev/null
1947 mkdir .libs 2>/dev/null
1948 if test -d .libs; then
1949 lt_cv_objdir=.libs
1950 else
1951 # MS-DOS does not allow filenames that begin with a dot.
1952 lt_cv_objdir=_libs
1953 fi
1954 rmdir .libs 2>/dev/null])
1955 objdir=$lt_cv_objdir
1956 _LT_DECL([], [objdir], [0],
1957 [The name of the directory that contains temporary libtool files])dnl
1958 m4_pattern_allow([LT_OBJDIR])dnl
1959 AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1960 [Define to the sub-directory in which libtool stores uninstalled libraries.])
1961 ])# _LT_CHECK_OBJDIR
1962
1963
1964 # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1965 # --------------------------------------
1966 # Check hardcoding attributes.
1967 m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1968 [AC_MSG_CHECKING([how to hardcode library paths into programs])
1969 _LT_TAGVAR(hardcode_action, $1)=
1970 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1971 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1972 test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1973
1974 # We can hardcode non-existent directories.
1975 if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1976 # If the only mechanism to avoid hardcoding is shlibpath_var, we
1977 # have to relink, otherwise we might link with an installed library
1978 # when we should be linking with a yet-to-be-installed one
1979 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1980 test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1981 # Linking always hardcodes the temporary library directory.
1982 _LT_TAGVAR(hardcode_action, $1)=relink
1983 else
1984 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1985 _LT_TAGVAR(hardcode_action, $1)=immediate
1986 fi
1987 else
1988 # We cannot hardcode anything, or else we can only hardcode existing
1989 # directories.
1990 _LT_TAGVAR(hardcode_action, $1)=unsupported
1991 fi
1992 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1993
1994 if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
1995 test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
1996 # Fast installation is not supported
1997 enable_fast_install=no
1998 elif test "$shlibpath_overrides_runpath" = yes ||
1999 test "$enable_shared" = no; then
2000 # Fast installation is not necessary
2001 enable_fast_install=needless
2002 fi
2003 _LT_TAGDECL([], [hardcode_action], [0],
2004 [How to hardcode a shared library path into an executable])
2005 ])# _LT_LINKER_HARDCODE_LIBPATH
2006
2007
2008 # _LT_CMD_STRIPLIB
2009 # ----------------
2010 m4_defun([_LT_CMD_STRIPLIB],
2011 [m4_require([_LT_DECL_EGREP])
2012 striplib=
2013 old_striplib=
2014 AC_MSG_CHECKING([whether stripping libraries is possible])
2015 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2016 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2017 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2018 AC_MSG_RESULT([yes])
2019 else
2020 # FIXME - insert some real tests, host_os isn't really good enough
2021 case $host_os in
2022 darwin*)
2023 if test -n "$STRIP" ; then
2024 striplib="$STRIP -x"
2025 old_striplib="$STRIP -S"
2026 AC_MSG_RESULT([yes])
2027 else
2028 AC_MSG_RESULT([no])
2029 fi
2030 ;;
2031 *)
2032 AC_MSG_RESULT([no])
2033 ;;
2034 esac
2035 fi
2036 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2037 _LT_DECL([], [striplib], [1])
2038 ])# _LT_CMD_STRIPLIB
2039
2040
2041 # _LT_SYS_DYNAMIC_LINKER([TAG])
2042 # -----------------------------
2043 # PORTME Fill in your ld.so characteristics
2044 m4_defun([_LT_SYS_DYNAMIC_LINKER],
2045 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2046 m4_require([_LT_DECL_EGREP])dnl
2047 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2048 m4_require([_LT_DECL_OBJDUMP])dnl
2049 m4_require([_LT_DECL_SED])dnl
2050 AC_MSG_CHECKING([dynamic linker characteristics])
2051 m4_if([$1],
2052 [], [
2053 if test "$GCC" = yes; then
2054 case $host_os in
2055 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2056 *) lt_awk_arg="/^libraries:/" ;;
2057 esac
2058 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2059 if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
2060 # if the path contains ";" then we assume it to be the separator
2061 # otherwise default to the standard path separator (i.e. ":") - it is
2062 # assumed that no part of a normal pathname contains ";" but that should
2063 # okay in the real world where ";" in dirpaths is itself problematic.
2064 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
2065 else
2066 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2067 fi
2068 # Ok, now we have the path, separated by spaces, we can step through it
2069 # and add multilib dir if necessary.
2070 lt_tmp_lt_search_path_spec=
2071 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2072 for lt_sys_path in $lt_search_path_spec; do
2073 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2074 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2075 else
2076 test -d "$lt_sys_path" && \
2077 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2078 fi
2079 done
2080 lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
2081 BEGIN {RS=" "; FS="/|\n";} {
2082 lt_foo="";
2083 lt_count=0;
2084 for (lt_i = NF; lt_i > 0; lt_i--) {
2085 if ($lt_i != "" && $lt_i != ".") {
2086 if ($lt_i == "..") {
2087 lt_count++;
2088 } else {
2089 if (lt_count == 0) {
2090 lt_foo="/" $lt_i lt_foo;
2091 } else {
2092 lt_count--;
2093 }
2094 }
2095 }
2096 }
2097 if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2098 if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2099 }'`
2100 sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
2101 else
2102 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2103 fi])
2104 library_names_spec=
2105 libname_spec='lib$name'
2106 soname_spec=
2107 shrext_cmds=".so"
2108 postinstall_cmds=
2109 postuninstall_cmds=
2110 finish_cmds=
2111 finish_eval=
2112 shlibpath_var=
2113 shlibpath_overrides_runpath=unknown
2114 version_type=none
2115 dynamic_linker="$host_os ld.so"
2116 sys_lib_dlsearch_path_spec="/lib /usr/lib"
2117 need_lib_prefix=unknown
2118 hardcode_into_libs=no
2119
2120 # when you set need_version to no, make sure it does not cause -set_version
2121 # flags to be left without arguments
2122 need_version=unknown
2123
2124 case $host_os in
2125 aix3*)
2126 version_type=linux
2127 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2128 shlibpath_var=LIBPATH
2129
2130 # AIX 3 has no versioning support, so we append a major version to the name.
2131 soname_spec='${libname}${release}${shared_ext}$major'
2132 ;;
2133
2134 aix[[4-9]]*)
2135 version_type=linux
2136 need_lib_prefix=no
2137 need_version=no
2138 hardcode_into_libs=yes
2139 if test "$host_cpu" = ia64; then
2140 # AIX 5 supports IA64
2141 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2142 shlibpath_var=LD_LIBRARY_PATH
2143 else
2144 # With GCC up to 2.95.x, collect2 would create an import file
2145 # for dependence libraries. The import file would start with
2146 # the line `#! .'. This would cause the generated library to
2147 # depend on `.', always an invalid library. This was fixed in
2148 # development snapshots of GCC prior to 3.0.
2149 case $host_os in
2150 aix4 | aix4.[[01]] | aix4.[[01]].*)
2151 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2152 echo ' yes '
2153 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2154 :
2155 else
2156 can_build_shared=no
2157 fi
2158 ;;
2159 esac
2160 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2161 # soname into executable. Probably we can add versioning support to
2162 # collect2, so additional links can be useful in future.
2163 if test "$aix_use_runtimelinking" = yes; then
2164 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2165 # instead of lib<name>.a to let people know that these are not
2166 # typical AIX shared libraries.
2167 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2168 else
2169 # We preserve .a as extension for shared libraries through AIX4.2
2170 # and later when we are not doing run time linking.
2171 library_names_spec='${libname}${release}.a $libname.a'
2172 soname_spec='${libname}${release}${shared_ext}$major'
2173 fi
2174 shlibpath_var=LIBPATH
2175 fi
2176 ;;
2177
2178 amigaos*)
2179 case $host_cpu in
2180 powerpc)
2181 # Since July 2007 AmigaOS4 officially supports .so libraries.
2182 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2183 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2184 ;;
2185 m68k)
2186 library_names_spec='$libname.ixlibrary $libname.a'
2187 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2188 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2189 ;;
2190 esac
2191 ;;
2192
2193 beos*)
2194 library_names_spec='${libname}${shared_ext}'
2195 dynamic_linker="$host_os ld.so"
2196 shlibpath_var=LIBRARY_PATH
2197 ;;
2198
2199 bsdi[[45]]*)
2200 version_type=linux
2201 need_version=no
2202 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2203 soname_spec='${libname}${release}${shared_ext}$major'
2204 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2205 shlibpath_var=LD_LIBRARY_PATH
2206 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2207 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2208 # the default ld.so.conf also contains /usr/contrib/lib and
2209 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2210 # libtool to hard-code these into programs
2211 ;;
2212
2213 cygwin* | mingw* | pw32* | cegcc*)
2214 version_type=windows
2215 shrext_cmds=".dll"
2216 need_version=no
2217 need_lib_prefix=no
2218
2219 case $GCC,$host_os in
2220 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2221 library_names_spec='$libname.dll.a'
2222 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2223 postinstall_cmds='base_file=`basename \${file}`~
2224 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2225 dldir=$destdir/`dirname \$dlpath`~
2226 test -d \$dldir || mkdir -p \$dldir~
2227 $install_prog $dir/$dlname \$dldir/$dlname~
2228 chmod a+x \$dldir/$dlname~
2229 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2230 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2231 fi'
2232 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2233 dlpath=$dir/\$dldll~
2234 $RM \$dlpath'
2235 shlibpath_overrides_runpath=yes
2236
2237 case $host_os in
2238 cygwin*)
2239 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2240 #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2241 soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}'
2242 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2243 ;;
2244 mingw* | cegcc*)
2245 # MinGW DLLs use traditional 'lib' prefix
2246 #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2247 soname_spec='`echo ${libname} | $SED -e 's/^lib//'`${shared_ext}'
2248 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2249 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2250 # It is most probably a Windows format PATH printed by
2251 # mingw gcc, but we are running on Cygwin. Gcc prints its search
2252 # path with ; separators, and with drive letters. We can handle the
2253 # drive letters (cygwin fileutils understands them), so leave them,
2254 # especially as we might pass files found there to a mingw objdump,
2255 # which wouldn't understand a cygwinified path. Ahh.
2256 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2257 else
2258 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2259 fi
2260 ;;
2261 pw32*)
2262 # pw32 DLLs use 'pw' prefix rather than 'lib'
2263 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2264 ;;
2265 esac
2266 ;;
2267
2268 *)
2269 library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2270 ;;
2271 esac
2272 dynamic_linker='Win32 ld.exe'
2273 # FIXME: first we should search . and the directory the executable is in
2274 shlibpath_var=PATH
2275 ;;
2276
2277 darwin* | rhapsody*)
2278 dynamic_linker="$host_os dyld"
2279 version_type=darwin
2280 need_lib_prefix=no
2281 need_version=no
2282 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2283 soname_spec='${libname}${release}${major}$shared_ext'
2284 shlibpath_overrides_runpath=yes
2285 shlibpath_var=DYLD_LIBRARY_PATH
2286 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2287 m4_if([$1], [],[
2288 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2289 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2290 ;;
2291
2292 dgux*)
2293 version_type=linux
2294 need_lib_prefix=no
2295 need_version=no
2296 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2297 soname_spec='${libname}${release}${shared_ext}$major'
2298 shlibpath_var=LD_LIBRARY_PATH
2299 ;;
2300
2301 freebsd1*)
2302 dynamic_linker=no
2303 ;;
2304
2305 freebsd* | dragonfly*)
2306 # DragonFly does not have aout. When/if they implement a new
2307 # versioning mechanism, adjust this.
2308 if test -x /usr/bin/objformat; then
2309 objformat=`/usr/bin/objformat`
2310 else
2311 case $host_os in
2312 freebsd[[123]]*) objformat=aout ;;
2313 *) objformat=elf ;;
2314 esac
2315 fi
2316 version_type=freebsd-$objformat
2317 case $version_type in
2318 freebsd-elf*)
2319 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2320 need_version=no
2321 need_lib_prefix=no
2322 ;;
2323 freebsd-*)
2324 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2325 need_version=yes
2326 ;;
2327 esac
2328 shlibpath_var=LD_LIBRARY_PATH
2329 case $host_os in
2330 freebsd2*)
2331 shlibpath_overrides_runpath=yes
2332 ;;
2333 freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2334 shlibpath_overrides_runpath=yes
2335 hardcode_into_libs=yes
2336 ;;
2337 freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2338 freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2339 shlibpath_overrides_runpath=no
2340 hardcode_into_libs=yes
2341 ;;
2342 *) # from 4.6 on, and DragonFly
2343 shlibpath_overrides_runpath=yes
2344 hardcode_into_libs=yes
2345 ;;
2346 esac
2347 ;;
2348
2349 gnu*)
2350 version_type=linux
2351 need_lib_prefix=no
2352 need_version=no
2353 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2354 soname_spec='${libname}${release}${shared_ext}$major'
2355 shlibpath_var=LD_LIBRARY_PATH
2356 hardcode_into_libs=yes
2357 ;;
2358
2359 hpux9* | hpux10* | hpux11*)
2360 # Give a soname corresponding to the major version so that dld.sl refuses to
2361 # link against other versions.
2362 version_type=sunos
2363 need_lib_prefix=no
2364 need_version=no
2365 case $host_cpu in
2366 ia64*)
2367 shrext_cmds='.so'
2368 hardcode_into_libs=yes
2369 dynamic_linker="$host_os dld.so"
2370 shlibpath_var=LD_LIBRARY_PATH
2371 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2372 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2373 soname_spec='${libname}${release}${shared_ext}$major'
2374 if test "X$HPUX_IA64_MODE" = X32; then
2375 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2376 else
2377 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2378 fi
2379 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2380 ;;
2381 hppa*64*)
2382 shrext_cmds='.sl'
2383 hardcode_into_libs=yes
2384 dynamic_linker="$host_os dld.sl"
2385 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2386 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2387 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2388 soname_spec='${libname}${release}${shared_ext}$major'
2389 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2390 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2391 ;;
2392 *)
2393 shrext_cmds='.sl'
2394 dynamic_linker="$host_os dld.sl"
2395 shlibpath_var=SHLIB_PATH
2396 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2397 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2398 soname_spec='${libname}${release}${shared_ext}$major'
2399 ;;
2400 esac
2401 # HP-UX runs *really* slowly unless shared libraries are mode 555.
2402 postinstall_cmds='chmod 555 $lib'
2403 ;;
2404
2405 interix[[3-9]]*)
2406 version_type=linux
2407 need_lib_prefix=no
2408 need_version=no
2409 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2410 soname_spec='${libname}${release}${shared_ext}$major'
2411 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2412 shlibpath_var=LD_LIBRARY_PATH
2413 shlibpath_overrides_runpath=no
2414 hardcode_into_libs=yes
2415 ;;
2416
2417 irix5* | irix6* | nonstopux*)
2418 case $host_os in
2419 nonstopux*) version_type=nonstopux ;;
2420 *)
2421 if test "$lt_cv_prog_gnu_ld" = yes; then
2422 version_type=linux
2423 else
2424 version_type=irix
2425 fi ;;
2426 esac
2427 need_lib_prefix=no
2428 need_version=no
2429 soname_spec='${libname}${release}${shared_ext}$major'
2430 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2431 case $host_os in
2432 irix5* | nonstopux*)
2433 libsuff= shlibsuff=
2434 ;;
2435 *)
2436 case $LD in # libtool.m4 will add one of these switches to LD
2437 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2438 libsuff= shlibsuff= libmagic=32-bit;;
2439 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2440 libsuff=32 shlibsuff=N32 libmagic=N32;;
2441 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2442 libsuff=64 shlibsuff=64 libmagic=64-bit;;
2443 *) libsuff= shlibsuff= libmagic=never-match;;
2444 esac
2445 ;;
2446 esac
2447 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2448 shlibpath_overrides_runpath=no
2449 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2450 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2451 hardcode_into_libs=yes
2452 ;;
2453
2454 # No shared lib support for Linux oldld, aout, or coff.
2455 linux*oldld* | linux*aout* | linux*coff*)
2456 dynamic_linker=no
2457 ;;
2458
2459 # This must be Linux ELF.
2460 linux* | k*bsd*-gnu)
2461 version_type=linux
2462 need_lib_prefix=no
2463 need_version=no
2464 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2465 soname_spec='${libname}${release}${shared_ext}$major'
2466 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2467 shlibpath_var=LD_LIBRARY_PATH
2468 shlibpath_overrides_runpath=no
2469 # Some binutils ld are patched to set DT_RUNPATH
2470 save_LDFLAGS=$LDFLAGS
2471 save_libdir=$libdir
2472 eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2473 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2474 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2475 [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2476 [shlibpath_overrides_runpath=yes])])
2477 LDFLAGS=$save_LDFLAGS
2478 libdir=$save_libdir
2479
2480 # This implies no fast_install, which is unacceptable.
2481 # Some rework will be needed to allow for fast_install
2482 # before this can be enabled.
2483 hardcode_into_libs=yes
2484
2485 # Append ld.so.conf contents to the search path
2486 if test -f /etc/ld.so.conf; then
2487 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
2488 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2489 fi
2490
2491 # We used to test for /lib/ld.so.1 and disable shared libraries on
2492 # powerpc, because MkLinux only supported shared libraries with the
2493 # GNU dynamic linker. Since this was broken with cross compilers,
2494 # most powerpc-linux boxes support dynamic linking these days and
2495 # people can always --disable-shared, the test was removed, and we
2496 # assume the GNU/Linux dynamic linker is in use.
2497 dynamic_linker='GNU/Linux ld.so'
2498 ;;
2499
2500 netbsd*)
2501 version_type=sunos
2502 need_lib_prefix=no
2503 need_version=no
2504 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2505 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2506 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2507 dynamic_linker='NetBSD (a.out) ld.so'
2508 else
2509 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2510 soname_spec='${libname}${release}${shared_ext}$major'
2511 dynamic_linker='NetBSD ld.elf_so'
2512 fi
2513 shlibpath_var=LD_LIBRARY_PATH
2514 shlibpath_overrides_runpath=yes
2515 hardcode_into_libs=yes
2516 ;;
2517
2518 newsos6)
2519 version_type=linux
2520 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2521 shlibpath_var=LD_LIBRARY_PATH
2522 shlibpath_overrides_runpath=yes
2523 ;;
2524
2525 *nto* | *qnx*)
2526 version_type=qnx
2527 need_lib_prefix=no
2528 need_version=no
2529 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2530 soname_spec='${libname}${release}${shared_ext}$major'
2531 shlibpath_var=LD_LIBRARY_PATH
2532 shlibpath_overrides_runpath=no
2533 hardcode_into_libs=yes
2534 dynamic_linker='ldqnx.so'
2535 ;;
2536
2537 openbsd*)
2538 version_type=sunos
2539 sys_lib_dlsearch_path_spec="/usr/lib"
2540 need_lib_prefix=no
2541 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2542 case $host_os in
2543 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
2544 *) need_version=no ;;
2545 esac
2546 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2547 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2548 shlibpath_var=LD_LIBRARY_PATH
2549 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2550 case $host_os in
2551 openbsd2.[[89]] | openbsd2.[[89]].*)
2552 shlibpath_overrides_runpath=no
2553 ;;
2554 *)
2555 shlibpath_overrides_runpath=yes
2556 ;;
2557 esac
2558 else
2559 shlibpath_overrides_runpath=yes
2560 fi
2561 ;;
2562
2563 os2*)
2564 libname_spec='$name'
2565 shrext_cmds=".dll"
2566 need_lib_prefix=no
2567 library_names_spec='$libname${shared_ext} $libname.a'
2568 dynamic_linker='OS/2 ld.exe'
2569 shlibpath_var=LIBPATH
2570 ;;
2571
2572 osf3* | osf4* | osf5*)
2573 version_type=osf
2574 need_lib_prefix=no
2575 need_version=no
2576 soname_spec='${libname}${release}${shared_ext}$major'
2577 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2578 shlibpath_var=LD_LIBRARY_PATH
2579 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2580 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2581 ;;
2582
2583 rdos*)
2584 dynamic_linker=no
2585 ;;
2586
2587 solaris*)
2588 version_type=linux
2589 need_lib_prefix=no
2590 need_version=no
2591 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2592 soname_spec='${libname}${release}${shared_ext}$major'
2593 shlibpath_var=LD_LIBRARY_PATH
2594 shlibpath_overrides_runpath=yes
2595 hardcode_into_libs=yes
2596 # ldd complains unless libraries are executable
2597 postinstall_cmds='chmod +x $lib'
2598 ;;
2599
2600 sunos4*)
2601 version_type=sunos
2602 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2603 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2604 shlibpath_var=LD_LIBRARY_PATH
2605 shlibpath_overrides_runpath=yes
2606 if test "$with_gnu_ld" = yes; then
2607 need_lib_prefix=no
2608 fi
2609 need_version=yes
2610 ;;
2611
2612 sysv4 | sysv4.3*)
2613 version_type=linux
2614 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2615 soname_spec='${libname}${release}${shared_ext}$major'
2616 shlibpath_var=LD_LIBRARY_PATH
2617 case $host_vendor in
2618 sni)
2619 shlibpath_overrides_runpath=no
2620 need_lib_prefix=no
2621 runpath_var=LD_RUN_PATH
2622 ;;
2623 siemens)
2624 need_lib_prefix=no
2625 ;;
2626 motorola)
2627 need_lib_prefix=no
2628 need_version=no
2629 shlibpath_overrides_runpath=no
2630 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2631 ;;
2632 esac
2633 ;;
2634
2635 sysv4*MP*)
2636 if test -d /usr/nec ;then
2637 version_type=linux
2638 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2639 soname_spec='$libname${shared_ext}.$major'
2640 shlibpath_var=LD_LIBRARY_PATH
2641 fi
2642 ;;
2643
2644 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2645 version_type=freebsd-elf
2646 need_lib_prefix=no
2647 need_version=no
2648 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2649 soname_spec='${libname}${release}${shared_ext}$major'
2650 shlibpath_var=LD_LIBRARY_PATH
2651 shlibpath_overrides_runpath=yes
2652 hardcode_into_libs=yes
2653 if test "$with_gnu_ld" = yes; then
2654 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2655 else
2656 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2657 case $host_os in
2658 sco3.2v5*)
2659 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2660 ;;
2661 esac
2662 fi
2663 sys_lib_dlsearch_path_spec='/usr/lib'
2664 ;;
2665
2666 tpf*)
2667 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
2668 version_type=linux
2669 need_lib_prefix=no
2670 need_version=no
2671 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2672 shlibpath_var=LD_LIBRARY_PATH
2673 shlibpath_overrides_runpath=no
2674 hardcode_into_libs=yes
2675 ;;
2676
2677 uts4*)
2678 version_type=linux
2679 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2680 soname_spec='${libname}${release}${shared_ext}$major'
2681 shlibpath_var=LD_LIBRARY_PATH
2682 ;;
2683
2684 *)
2685 dynamic_linker=no
2686 ;;
2687 esac
2688 AC_MSG_RESULT([$dynamic_linker])
2689 test "$dynamic_linker" = no && can_build_shared=no
2690
2691 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2692 if test "$GCC" = yes; then
2693 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2694 fi
2695
2696 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2697 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2698 fi
2699 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2700 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2701 fi
2702
2703 _LT_DECL([], [variables_saved_for_relink], [1],
2704 [Variables whose values should be saved in libtool wrapper scripts and
2705 restored at link time])
2706 _LT_DECL([], [need_lib_prefix], [0],
2707 [Do we need the "lib" prefix for modules?])
2708 _LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2709 _LT_DECL([], [version_type], [0], [Library versioning type])
2710 _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
2711 _LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2712 _LT_DECL([], [shlibpath_overrides_runpath], [0],
2713 [Is shlibpath searched before the hard-coded library search path?])
2714 _LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2715 _LT_DECL([], [library_names_spec], [1],
2716 [[List of archive names. First name is the real one, the rest are links.
2717 The last name is the one that the linker finds with -lNAME]])
2718 _LT_DECL([], [soname_spec], [1],
2719 [[The coded name of the library, if different from the real name]])
2720 _LT_DECL([], [postinstall_cmds], [2],
2721 [Command to use after installation of a shared archive])
2722 _LT_DECL([], [postuninstall_cmds], [2],
2723 [Command to use after uninstallation of a shared archive])
2724 _LT_DECL([], [finish_cmds], [2],
2725 [Commands used to finish a libtool library installation in a directory])
2726 _LT_DECL([], [finish_eval], [1],
2727 [[As "finish_cmds", except a single script fragment to be evaled but
2728 not shown]])
2729 _LT_DECL([], [hardcode_into_libs], [0],
2730 [Whether we should hardcode library paths into libraries])
2731 _LT_DECL([], [sys_lib_search_path_spec], [2],
2732 [Compile-time system search path for libraries])
2733 _LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2734 [Run-time system search path for libraries])
2735 ])# _LT_SYS_DYNAMIC_LINKER
2736
2737
2738 # _LT_PATH_TOOL_PREFIX(TOOL)
2739 # --------------------------
2740 # find a file program which can recognize shared library
2741 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
2742 [m4_require([_LT_DECL_EGREP])dnl
2743 AC_MSG_CHECKING([for $1])
2744 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2745 [case $MAGIC_CMD in
2746 [[\\/*] | ?:[\\/]*])
2747 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2748 ;;
2749 *)
2750 lt_save_MAGIC_CMD="$MAGIC_CMD"
2751 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2752 dnl $ac_dummy forces splitting on constant user-supplied paths.
2753 dnl POSIX.2 word splitting is done only on the output of word expansions,
2754 dnl not every word. This closes a longstanding sh security hole.
2755 ac_dummy="m4_if([$2], , $PATH, [$2])"
2756 for ac_dir in $ac_dummy; do
2757 IFS="$lt_save_ifs"
2758 test -z "$ac_dir" && ac_dir=.
2759 if test -f $ac_dir/$1; then
2760 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2761 if test -n "$file_magic_test_file"; then
2762 case $deplibs_check_method in
2763 "file_magic "*)
2764 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2765 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2766 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2767 $EGREP "$file_magic_regex" > /dev/null; then
2768 :
2769 else
2770 cat <<_LT_EOF 1>&2
2771
2772 *** Warning: the command libtool uses to detect shared libraries,
2773 *** $file_magic_cmd, produces output that libtool cannot recognize.
2774 *** The result is that libtool may fail to recognize shared libraries
2775 *** as such. This will affect the creation of libtool libraries that
2776 *** depend on shared libraries, but programs linked with such libtool
2777 *** libraries will work regardless of this problem. Nevertheless, you
2778 *** may want to report the problem to your system manager and/or to
2779 *** bug-libtool@gnu.org
2780
2781 _LT_EOF
2782 fi ;;
2783 esac
2784 fi
2785 break
2786 fi
2787 done
2788 IFS="$lt_save_ifs"
2789 MAGIC_CMD="$lt_save_MAGIC_CMD"
2790 ;;
2791 esac])
2792 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2793 if test -n "$MAGIC_CMD"; then
2794 AC_MSG_RESULT($MAGIC_CMD)
2795 else
2796 AC_MSG_RESULT(no)
2797 fi
2798 _LT_DECL([], [MAGIC_CMD], [0],
2799 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2800 ])# _LT_PATH_TOOL_PREFIX
2801
2802 # Old name:
2803 AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2804 dnl aclocal-1.4 backwards compatibility:
2805 dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2806
2807
2808 # _LT_PATH_MAGIC
2809 # --------------
2810 # find a file program which can recognize a shared library
2811 m4_defun([_LT_PATH_MAGIC],
2812 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2813 if test -z "$lt_cv_path_MAGIC_CMD"; then
2814 if test -n "$ac_tool_prefix"; then
2815 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2816 else
2817 MAGIC_CMD=:
2818 fi
2819 fi
2820 ])# _LT_PATH_MAGIC
2821
2822
2823 # LT_PATH_LD
2824 # ----------
2825 # find the pathname to the GNU or non-GNU linker
2826 AC_DEFUN([LT_PATH_LD],
2827 [AC_REQUIRE([AC_PROG_CC])dnl
2828 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2829 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2830 m4_require([_LT_DECL_SED])dnl
2831 m4_require([_LT_DECL_EGREP])dnl
2832
2833 AC_ARG_WITH([gnu-ld],
2834 [AS_HELP_STRING([--with-gnu-ld],
2835 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
2836 [test "$withval" = no || with_gnu_ld=yes],
2837 [with_gnu_ld=no])dnl
2838
2839 ac_prog=ld
2840 if test "$GCC" = yes; then
2841 # Check if gcc -print-prog-name=ld gives a path.
2842 AC_MSG_CHECKING([for ld used by $CC])
2843 case $host in
2844 *-*-mingw*)
2845 # gcc leaves a trailing carriage return which upsets mingw
2846 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2847 *)
2848 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2849 esac
2850 case $ac_prog in
2851 # Accept absolute paths.
2852 [[\\/]]* | ?:[[\\/]]*)
2853 re_direlt='/[[^/]][[^/]]*/\.\./'
2854 # Canonicalize the pathname of ld
2855 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
2856 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
2857 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
2858 done
2859 test -z "$LD" && LD="$ac_prog"
2860 ;;
2861 "")
2862 # If it fails, then pretend we aren't using GCC.
2863 ac_prog=ld
2864 ;;
2865 *)
2866 # If it is relative, then search for the first ld in PATH.
2867 with_gnu_ld=unknown
2868 ;;
2869 esac
2870 elif test "$with_gnu_ld" = yes; then
2871 AC_MSG_CHECKING([for GNU ld])
2872 else
2873 AC_MSG_CHECKING([for non-GNU ld])
2874 fi
2875 AC_CACHE_VAL(lt_cv_path_LD,
2876 [if test -z "$LD"; then
2877 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2878 for ac_dir in $PATH; do
2879 IFS="$lt_save_ifs"
2880 test -z "$ac_dir" && ac_dir=.
2881 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2882 lt_cv_path_LD="$ac_dir/$ac_prog"
2883 # Check to see if the program is GNU ld. I'd rather use --version,
2884 # but apparently some variants of GNU ld only accept -v.
2885 # Break only if it was the GNU/non-GNU ld that we prefer.
2886 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2887 *GNU* | *'with BFD'*)
2888 test "$with_gnu_ld" != no && break
2889 ;;
2890 *)
2891 test "$with_gnu_ld" != yes && break
2892 ;;
2893 esac
2894 fi
2895 done
2896 IFS="$lt_save_ifs"
2897 else
2898 lt_cv_path_LD="$LD" # Let the user override the test with a path.
2899 fi])
2900 LD="$lt_cv_path_LD"
2901 if test -n "$LD"; then
2902 AC_MSG_RESULT($LD)
2903 else
2904 AC_MSG_RESULT(no)
2905 fi
2906 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2907 _LT_PATH_LD_GNU
2908 AC_SUBST([LD])
2909
2910 _LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
2911 ])# LT_PATH_LD
2912
2913 # Old names:
2914 AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
2915 AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
2916 dnl aclocal-1.4 backwards compatibility:
2917 dnl AC_DEFUN([AM_PROG_LD], [])
2918 dnl AC_DEFUN([AC_PROG_LD], [])
2919
2920
2921 # _LT_PATH_LD_GNU
2922 #- --------------
2923 m4_defun([_LT_PATH_LD_GNU],
2924 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2925 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
2926 case `$LD -v 2>&1 </dev/null` in
2927 *GNU* | *'with BFD'*)
2928 lt_cv_prog_gnu_ld=yes
2929 ;;
2930 *)
2931 lt_cv_prog_gnu_ld=no
2932 ;;
2933 esac])
2934 with_gnu_ld=$lt_cv_prog_gnu_ld
2935 ])# _LT_PATH_LD_GNU
2936
2937
2938 # _LT_CMD_RELOAD
2939 # --------------
2940 # find reload flag for linker
2941 # -- PORTME Some linkers may need a different reload flag.
2942 m4_defun([_LT_CMD_RELOAD],
2943 [AC_CACHE_CHECK([for $LD option to reload object files],
2944 lt_cv_ld_reload_flag,
2945 [lt_cv_ld_reload_flag='-r'])
2946 reload_flag=$lt_cv_ld_reload_flag
2947 case $reload_flag in
2948 "" | " "*) ;;
2949 *) reload_flag=" $reload_flag" ;;
2950 esac
2951 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2952 case $host_os in
2953 darwin*)
2954 if test "$GCC" = yes; then
2955 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2956 else
2957 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2958 fi
2959 ;;
2960 esac
2961 _LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
2962 _LT_DECL([], [reload_cmds], [2])dnl
2963 ])# _LT_CMD_RELOAD
2964
2965
2966 # _LT_CHECK_MAGIC_METHOD
2967 # ----------------------
2968 # how to check for library dependencies
2969 # -- PORTME fill in with the dynamic library characteristics
2970 m4_defun([_LT_CHECK_MAGIC_METHOD],
2971 [m4_require([_LT_DECL_EGREP])
2972 m4_require([_LT_DECL_OBJDUMP])
2973 AC_CACHE_CHECK([how to recognize dependent libraries],
2974 lt_cv_deplibs_check_method,
2975 [lt_cv_file_magic_cmd='$MAGIC_CMD'
2976 lt_cv_file_magic_test_file=
2977 lt_cv_deplibs_check_method='unknown'
2978 # Need to set the preceding variable on all platforms that support
2979 # interlibrary dependencies.
2980 # 'none' -- dependencies not supported.
2981 # `unknown' -- same as none, but documents that we really don't know.
2982 # 'pass_all' -- all dependencies passed with no checks.
2983 # 'test_compile' -- check by making test program.
2984 # 'file_magic [[regex]]' -- check by looking for files in library path
2985 # which responds to the $file_magic_cmd with a given extended regex.
2986 # If you have `file' or equivalent on your system and you're not sure
2987 # whether `pass_all' will *always* work, you probably want this one.
2988
2989 case $host_os in
2990 aix[[4-9]]*)
2991 lt_cv_deplibs_check_method=pass_all
2992 ;;
2993
2994 beos*)
2995 lt_cv_deplibs_check_method=pass_all
2996 ;;
2997
2998 bsdi[[45]]*)
2999 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3000 lt_cv_file_magic_cmd='/usr/bin/file -L'
3001 lt_cv_file_magic_test_file=/shlib/libc.so
3002 ;;
3003
3004 cygwin*)
3005 # func_win32_libid is a shell function defined in ltmain.sh
3006 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3007 lt_cv_deplibs_check_method=pass_all
3008 lt_cv_file_magic_cmd='func_win32_libid'
3009 ;;
3010
3011 mingw* | pw32*)
3012 # Base MSYS/MinGW do not provide the 'file' command needed by
3013 # func_win32_libid shell function, so use a weaker test based on 'objdump',
3014 # unless we find 'file', for example because we are cross-compiling.
3015 if ( file / ) >/dev/null 2>&1; then
3016 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3017 lt_cv_file_magic_cmd='func_win32_libid'
3018 else
3019 lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3020 lt_cv_file_magic_cmd='$OBJDUMP -f'
3021 fi
3022 lt_cv_deplibs_check_method=pass_all
3023 ;;
3024
3025 cegcc)
3026 # use the weaker test based on 'objdump'. See mingw*.
3027 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3028 lt_cv_file_magic_cmd='$OBJDUMP -f'
3029 ;;
3030
3031 darwin* | rhapsody*)
3032 lt_cv_deplibs_check_method=pass_all
3033 ;;
3034
3035 freebsd* | dragonfly*)
3036 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3037 case $host_cpu in
3038 i*86 )
3039 # Not sure whether the presence of OpenBSD here was a mistake.
3040 # Let's accept both of them until this is cleared up.
3041 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3042 lt_cv_file_magic_cmd=/usr/bin/file
3043 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3044 ;;
3045 esac
3046 else
3047 lt_cv_deplibs_check_method=pass_all
3048 fi
3049 ;;
3050
3051 gnu*)
3052 lt_cv_deplibs_check_method=pass_all
3053 ;;
3054
3055 hpux10.20* | hpux11*)
3056 lt_cv_file_magic_cmd=/usr/bin/file
3057 case $host_cpu in
3058 ia64*)
3059 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3060 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3061 ;;
3062 hppa*64*)
3063 [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
3064 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3065 ;;
3066 *)
3067 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3068 lt_cv_file_magic_test_file=/usr/lib/libc.sl
3069 ;;
3070 esac
3071 ;;
3072
3073 interix[[3-9]]*)
3074 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3075 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3076 ;;
3077
3078 irix5* | irix6* | nonstopux*)
3079 case $LD in
3080 *-32|*"-32 ") libmagic=32-bit;;
3081 *-n32|*"-n32 ") libmagic=N32;;
3082 *-64|*"-64 ") libmagic=64-bit;;
3083 *) libmagic=never-match;;
3084 esac
3085 lt_cv_deplibs_check_method=pass_all
3086 ;;
3087
3088 # This must be Linux ELF.
3089 linux* | k*bsd*-gnu)
3090 lt_cv_deplibs_check_method=pass_all
3091 ;;
3092
3093 netbsd*)
3094 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3095 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3096 else
3097 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3098 fi
3099 ;;
3100
3101 newos6*)
3102 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3103 lt_cv_file_magic_cmd=/usr/bin/file
3104 lt_cv_file_magic_test_file=/usr/lib/libnls.so
3105 ;;
3106
3107 *nto* | *qnx*)
3108 lt_cv_deplibs_check_method=pass_all
3109 ;;
3110
3111 openbsd*)
3112 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3113 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3114 else
3115 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3116 fi
3117 ;;
3118
3119 osf3* | osf4* | osf5*)
3120 lt_cv_deplibs_check_method=pass_all
3121 ;;
3122
3123 rdos*)
3124 lt_cv_deplibs_check_method=pass_all
3125 ;;
3126
3127 solaris*)
3128 lt_cv_deplibs_check_method=pass_all
3129 ;;
3130
3131 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3132 lt_cv_deplibs_check_method=pass_all
3133 ;;
3134
3135 sysv4 | sysv4.3*)
3136 case $host_vendor in
3137 motorola)
3138 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
3139 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3140 ;;
3141 ncr)
3142 lt_cv_deplibs_check_method=pass_all
3143 ;;
3144 sequent)
3145 lt_cv_file_magic_cmd='/bin/file'
3146 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3147 ;;
3148 sni)
3149 lt_cv_file_magic_cmd='/bin/file'
3150 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3151 lt_cv_file_magic_test_file=/lib/libc.so
3152 ;;
3153 siemens)
3154 lt_cv_deplibs_check_method=pass_all
3155 ;;
3156 pc)
3157 lt_cv_deplibs_check_method=pass_all
3158 ;;
3159 esac
3160 ;;
3161
3162 tpf*)
3163 lt_cv_deplibs_check_method=pass_all
3164 ;;
3165 esac
3166 ])
3167 file_magic_cmd=$lt_cv_file_magic_cmd
3168 deplibs_check_method=$lt_cv_deplibs_check_method
3169 test -z "$deplibs_check_method" && deplibs_check_method=unknown
3170
3171 _LT_DECL([], [deplibs_check_method], [1],
3172 [Method to check whether dependent libraries are shared objects])
3173 _LT_DECL([], [file_magic_cmd], [1],
3174 [Command to use when deplibs_check_method == "file_magic"])
3175 ])# _LT_CHECK_MAGIC_METHOD
3176
3177
3178 # LT_PATH_NM
3179 # ----------
3180 # find the pathname to a BSD- or MS-compatible name lister
3181 AC_DEFUN([LT_PATH_NM],
3182 [AC_REQUIRE([AC_PROG_CC])dnl
3183 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3184 [if test -n "$NM"; then
3185 # Let the user override the test.
3186 lt_cv_path_NM="$NM"
3187 else
3188 lt_nm_to_check="${ac_tool_prefix}nm"
3189 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3190 lt_nm_to_check="$lt_nm_to_check nm"
3191 fi
3192 for lt_tmp_nm in $lt_nm_to_check; do
3193 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3194 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3195 IFS="$lt_save_ifs"
3196 test -z "$ac_dir" && ac_dir=.
3197 tmp_nm="$ac_dir/$lt_tmp_nm"
3198 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3199 # Check to see if the nm accepts a BSD-compat flag.
3200 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3201 # nm: unknown option "B" ignored
3202 # Tru64's nm complains that /dev/null is an invalid object file
3203 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3204 */dev/null* | *'Invalid file or object type'*)
3205 lt_cv_path_NM="$tmp_nm -B"
3206 break
3207 ;;
3208 *)
3209 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3210 */dev/null*)
3211 lt_cv_path_NM="$tmp_nm -p"
3212 break
3213 ;;
3214 *)
3215 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3216 continue # so that we can try to find one that supports BSD flags
3217 ;;
3218 esac
3219 ;;
3220 esac
3221 fi
3222 done
3223 IFS="$lt_save_ifs"
3224 done
3225 : ${lt_cv_path_NM=no}
3226 fi])
3227 if test "$lt_cv_path_NM" != "no"; then
3228 NM="$lt_cv_path_NM"
3229 else
3230 # Didn't find any BSD compatible name lister, look for dumpbin.
3231 AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
3232 AC_SUBST([DUMPBIN])
3233 if test "$DUMPBIN" != ":"; then
3234 NM="$DUMPBIN"
3235 fi
3236 fi
3237 test -z "$NM" && NM=nm
3238 AC_SUBST([NM])
3239 _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3240
3241 AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3242 [lt_cv_nm_interface="BSD nm"
3243 echo "int some_variable = 0;" > conftest.$ac_ext
3244 (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3245 (eval "$ac_compile" 2>conftest.err)
3246 cat conftest.err >&AS_MESSAGE_LOG_FD
3247 (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3248 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3249 cat conftest.err >&AS_MESSAGE_LOG_FD
3250 (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
3251 cat conftest.out >&AS_MESSAGE_LOG_FD
3252 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3253 lt_cv_nm_interface="MS dumpbin"
3254 fi
3255 rm -f conftest*])
3256 ])# LT_PATH_NM
3257
3258 # Old names:
3259 AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3260 AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3261 dnl aclocal-1.4 backwards compatibility:
3262 dnl AC_DEFUN([AM_PROG_NM], [])
3263 dnl AC_DEFUN([AC_PROG_NM], [])
3264
3265
3266 # LT_LIB_M
3267 # --------
3268 # check for math library
3269 AC_DEFUN([LT_LIB_M],
3270 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3271 LIBM=
3272 case $host in
3273 *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3274 # These system don't have libm, or don't need it
3275 ;;
3276 *-ncr-sysv4.3*)
3277 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3278 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3279 ;;
3280 *)
3281 AC_CHECK_LIB(m, cos, LIBM="-lm")
3282 ;;
3283 esac
3284 AC_SUBST([LIBM])
3285 ])# LT_LIB_M
3286
3287 # Old name:
3288 AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3289 dnl aclocal-1.4 backwards compatibility:
3290 dnl AC_DEFUN([AC_CHECK_LIBM], [])
3291
3292
3293 # _LT_COMPILER_NO_RTTI([TAGNAME])
3294 # -------------------------------
3295 m4_defun([_LT_COMPILER_NO_RTTI],
3296 [m4_require([_LT_TAG_COMPILER])dnl
3297
3298 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3299
3300 if test "$GCC" = yes; then
3301 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3302
3303 _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3304 lt_cv_prog_compiler_rtti_exceptions,
3305 [-fno-rtti -fno-exceptions], [],
3306 [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3307 fi
3308 _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3309 [Compiler flag to turn off builtin functions])
3310 ])# _LT_COMPILER_NO_RTTI
3311
3312
3313 # _LT_CMD_GLOBAL_SYMBOLS
3314 # ----------------------
3315 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3316 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3317 AC_REQUIRE([AC_PROG_CC])dnl
3318 AC_REQUIRE([LT_PATH_NM])dnl
3319 AC_REQUIRE([LT_PATH_LD])dnl
3320 m4_require([_LT_DECL_SED])dnl
3321 m4_require([_LT_DECL_EGREP])dnl
3322 m4_require([_LT_TAG_COMPILER])dnl
3323
3324 # Check for command to grab the raw symbol name followed by C symbol from nm.
3325 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
3326 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3327 [
3328 # These are sane defaults that work on at least a few old systems.
3329 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
3330
3331 # Character class describing NM global symbol codes.
3332 symcode='[[BCDEGRST]]'
3333
3334 # Regexp to match symbols that can be accessed directly from C.
3335 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3336
3337 # Define system-specific variables.
3338 case $host_os in
3339 aix*)
3340 symcode='[[BCDT]]'
3341 ;;
3342 cygwin* | mingw* | pw32* | cegcc*)
3343 symcode='[[ABCDGISTW]]'
3344 ;;
3345 hpux*)
3346 if test "$host_cpu" = ia64; then
3347 symcode='[[ABCDEGRST]]'
3348 fi
3349 ;;
3350 irix* | nonstopux*)
3351 symcode='[[BCDEGRST]]'
3352 ;;
3353 osf*)
3354 symcode='[[BCDEGQRST]]'
3355 ;;
3356 solaris*)
3357 symcode='[[BDRT]]'
3358 ;;
3359 sco3.2v5*)
3360 symcode='[[DT]]'
3361 ;;
3362 sysv4.2uw2*)
3363 symcode='[[DT]]'
3364 ;;
3365 sysv5* | sco5v6* | unixware* | OpenUNIX*)
3366 symcode='[[ABDT]]'
3367 ;;
3368 sysv4)
3369 symcode='[[DFNSTU]]'
3370 ;;
3371 esac
3372
3373 # If we're using GNU nm, then use its standard symbol codes.
3374 case `$NM -V 2>&1` in
3375 *GNU* | *'with BFD'*)
3376 symcode='[[ABCDGIRSTW]]' ;;
3377 esac
3378
3379 # Transform an extracted symbol line into a proper C declaration.
3380 # Some systems (esp. on ia64) link data and code symbols differently,
3381 # so use this general approach.
3382 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3383
3384 # Transform an extracted symbol line into symbol name and symbol address
3385 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
3386 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
3387
3388 # Handle CRLF in mingw tool chain
3389 opt_cr=
3390 case $build_os in
3391 mingw*)
3392 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3393 ;;
3394 esac
3395
3396 # Try without a prefix underscore, then with it.
3397 for ac_symprfx in "" "_"; do
3398
3399 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3400 symxfrm="\\1 $ac_symprfx\\2 \\2"
3401
3402 # Write the raw and C identifiers.
3403 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3404 # Fake it for dumpbin and say T for any non-static function
3405 # and D for any global variable.
3406 # Also find C++ and __fastcall symbols from MSVC++,
3407 # which start with @ or ?.
3408 lt_cv_sys_global_symbol_pipe="$AWK ['"\
3409 " {last_section=section; section=\$ 3};"\
3410 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3411 " \$ 0!~/External *\|/{next};"\
3412 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3413 " {if(hide[section]) next};"\
3414 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3415 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3416 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
3417 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3418 " ' prfx=^$ac_symprfx]"
3419 else
3420 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3421 fi
3422
3423 # Check to see that the pipe works correctly.
3424 pipe_works=no
3425
3426 rm -f conftest*
3427 cat > conftest.$ac_ext <<_LT_EOF
3428 #ifdef __cplusplus
3429 extern "C" {
3430 #endif
3431 char nm_test_var;
3432 void nm_test_func(void);
3433 void nm_test_func(void){}
3434 #ifdef __cplusplus
3435 }
3436 #endif
3437 int main(){nm_test_var='a';nm_test_func();return(0);}
3438 _LT_EOF
3439
3440 if AC_TRY_EVAL(ac_compile); then
3441 # Now try to grab the symbols.
3442 nlist=conftest.nm
3443 if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
3444 # Try sorting and uniquifying the output.
3445 if sort "$nlist" | uniq > "$nlist"T; then
3446 mv -f "$nlist"T "$nlist"
3447 else
3448 rm -f "$nlist"T
3449 fi
3450
3451 # Make sure that we snagged all the symbols we need.
3452 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3453 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3454 cat <<_LT_EOF > conftest.$ac_ext
3455 #ifdef __cplusplus
3456 extern "C" {
3457 #endif
3458
3459 _LT_EOF
3460 # Now generate the symbol file.
3461 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3462
3463 cat <<_LT_EOF >> conftest.$ac_ext
3464
3465 /* The mapping between symbol names and symbols. */
3466 const struct {
3467 const char *name;
3468 void *address;
3469 }
3470 lt__PROGRAM__LTX_preloaded_symbols[[]] =
3471 {
3472 { "@PROGRAM@", (void *) 0 },
3473 _LT_EOF
3474 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3475 cat <<\_LT_EOF >> conftest.$ac_ext
3476 {0, (void *) 0}
3477 };
3478
3479 /* This works around a problem in FreeBSD linker */
3480 #ifdef FREEBSD_WORKAROUND
3481 static const void *lt_preloaded_setup() {
3482 return lt__PROGRAM__LTX_preloaded_symbols;
3483 }
3484 #endif
3485
3486 #ifdef __cplusplus
3487 }
3488 #endif
3489 _LT_EOF
3490 # Now try linking the two files.
3491 mv conftest.$ac_objext conftstm.$ac_objext
3492 lt_save_LIBS="$LIBS"
3493 lt_save_CFLAGS="$CFLAGS"
3494 LIBS="conftstm.$ac_objext"
3495 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3496 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3497 pipe_works=yes
3498 fi
3499 LIBS="$lt_save_LIBS"
3500 CFLAGS="$lt_save_CFLAGS"
3501 else
3502 echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3503 fi
3504 else
3505 echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3506 fi
3507 else
3508 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3509 fi
3510 else
3511 echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3512 cat conftest.$ac_ext >&5
3513 fi
3514 rm -rf conftest* conftst*
3515
3516 # Do not use the global_symbol_pipe unless it works.
3517 if test "$pipe_works" = yes; then
3518 break
3519 else
3520 lt_cv_sys_global_symbol_pipe=
3521 fi
3522 done
3523 ])
3524 if test -z "$lt_cv_sys_global_symbol_pipe"; then
3525 lt_cv_sys_global_symbol_to_cdecl=
3526 fi
3527 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3528 AC_MSG_RESULT(failed)
3529 else
3530 AC_MSG_RESULT(ok)
3531 fi
3532
3533 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3534 [Take the output of nm and produce a listing of raw symbols and C names])
3535 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3536 [Transform the output of nm in a proper C declaration])
3537 _LT_DECL([global_symbol_to_c_name_address],
3538 [lt_cv_sys_global_symbol_to_c_name_address], [1],
3539 [Transform the output of nm in a C name address pair])
3540 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3541 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3542 [Transform the output of nm in a C name address pair when lib prefix is needed])
3543 ]) # _LT_CMD_GLOBAL_SYMBOLS
3544
3545
3546 # _LT_COMPILER_PIC([TAGNAME])
3547 # ---------------------------
3548 m4_defun([_LT_COMPILER_PIC],
3549 [m4_require([_LT_TAG_COMPILER])dnl
3550 _LT_TAGVAR(lt_prog_compiler_wl, $1)=
3551 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3552 _LT_TAGVAR(lt_prog_compiler_static, $1)=
3553
3554 AC_MSG_CHECKING([for $compiler option to produce PIC])
3555 m4_if([$1], [CXX], [
3556 # C++ specific cases for pic, static, wl, etc.
3557 if test "$GXX" = yes; then
3558 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3559 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3560
3561 case $host_os in
3562 aix*)
3563 # All AIX code is PIC.
3564 if test "$host_cpu" = ia64; then
3565 # AIX 5 now supports IA64 processor
3566 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3567 fi
3568 ;;
3569
3570 amigaos*)
3571 case $host_cpu in
3572 powerpc)
3573 # see comment about AmigaOS4 .so support
3574 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3575 ;;
3576 m68k)
3577 # FIXME: we need at least 68020 code to build shared libraries, but
3578 # adding the `-m68020' flag to GCC prevents building anything better,
3579 # like `-m68040'.
3580 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3581 ;;
3582 esac
3583 ;;
3584
3585 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3586 # PIC is the default for these OSes.
3587 ;;
3588 mingw* | cygwin* | os2* | pw32* | cegcc*)
3589 # This hack is so that the source file can tell whether it is being
3590 # built for inclusion in a dll (and should export symbols for example).
3591 # Although the cygwin gcc ignores -fPIC, still need this for old-style
3592 # (--disable-auto-import) libraries
3593 m4_if([$1], [GCJ], [],
3594 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3595 ;;
3596 darwin* | rhapsody*)
3597 # PIC is the default on this platform
3598 # Common symbols not allowed in MH_DYLIB files
3599 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3600 ;;
3601 *djgpp*)
3602 # DJGPP does not support shared libraries at all
3603 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3604 ;;
3605 interix[[3-9]]*)
3606 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3607 # Instead, we relocate shared libraries at runtime.
3608 ;;
3609 sysv4*MP*)
3610 if test -d /usr/nec; then
3611 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3612 fi
3613 ;;
3614 hpux*)
3615 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3616 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
3617 # sets the default TLS model and affects inlining.
3618 case $host_cpu in
3619 hppa*64*)
3620 ;;
3621 *)
3622 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3623 ;;
3624 esac
3625 ;;
3626 *qnx* | *nto*)
3627 # QNX uses GNU C++, but need to define -shared option too, otherwise
3628 # it will coredump.
3629 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3630 ;;
3631 *)
3632 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3633 ;;
3634 esac
3635 else
3636 case $host_os in
3637 aix[[4-9]]*)
3638 # All AIX code is PIC.
3639 if test "$host_cpu" = ia64; then
3640 # AIX 5 now supports IA64 processor
3641 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3642 else
3643 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3644 fi
3645 ;;
3646 chorus*)
3647 case $cc_basename in
3648 cxch68*)
3649 # Green Hills C++ Compiler
3650 # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
3651 ;;
3652 esac
3653 ;;
3654 dgux*)
3655 case $cc_basename in
3656 ec++*)
3657 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3658 ;;
3659 ghcx*)
3660 # Green Hills C++ Compiler
3661 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3662 ;;
3663 *)
3664 ;;
3665 esac
3666 ;;
3667 freebsd* | dragonfly*)
3668 # FreeBSD uses GNU C++
3669 ;;
3670 hpux9* | hpux10* | hpux11*)
3671 case $cc_basename in
3672 CC*)
3673 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3674 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3675 if test "$host_cpu" != ia64; then
3676 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3677 fi
3678 ;;
3679 aCC*)
3680 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3681 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3682 case $host_cpu in
3683 hppa*64*|ia64*)
3684 # +Z the default
3685 ;;
3686 *)
3687 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3688 ;;
3689 esac
3690 ;;
3691 *)
3692 ;;
3693 esac
3694 ;;
3695 interix*)
3696 # This is c89, which is MS Visual C++ (no shared libs)
3697 # Anyone wants to do a port?
3698 ;;
3699 irix5* | irix6* | nonstopux*)
3700 case $cc_basename in
3701 CC*)
3702 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3703 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3704 # CC pic flag -KPIC is the default.
3705 ;;
3706 *)
3707 ;;
3708 esac
3709 ;;
3710 linux* | k*bsd*-gnu)
3711 case $cc_basename in
3712 KCC*)
3713 # KAI C++ Compiler
3714 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3715 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3716 ;;
3717 ecpc* )
3718 # old Intel C++ for x86_64 which still supported -KPIC.
3719 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3720 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3721 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3722 ;;
3723 icpc* )
3724 # Intel C++, used to be incompatible with GCC.
3725 # ICC 10 doesn't accept -KPIC any more.
3726 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3727 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3728 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3729 ;;
3730 pgCC* | pgcpp*)
3731 # Portland Group C++ compiler
3732 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3733 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
3734 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3735 ;;
3736 cxx*)
3737 # Compaq C++
3738 # Make sure the PIC flag is empty. It appears that all Alpha
3739 # Linux and Compaq Tru64 Unix objects are PIC.
3740 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3741 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3742 ;;
3743 xlc* | xlC*)
3744 # IBM XL 8.0 on PPC
3745 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3746 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
3747 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
3748 ;;
3749 *)
3750 case `$CC -V 2>&1 | sed 5q` in
3751 *Sun\ C*)
3752 # Sun C++ 5.9
3753 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3754 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3755 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3756 ;;
3757 esac
3758 ;;
3759 esac
3760 ;;
3761 lynxos*)
3762 ;;
3763 m88k*)
3764 ;;
3765 mvs*)
3766 case $cc_basename in
3767 cxx*)
3768 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
3769 ;;
3770 *)
3771 ;;
3772 esac
3773 ;;
3774 netbsd*)
3775 ;;
3776 *qnx* | *nto*)
3777 # QNX uses GNU C++, but need to define -shared option too, otherwise
3778 # it will coredump.
3779 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3780 ;;
3781 osf3* | osf4* | osf5*)
3782 case $cc_basename in
3783 KCC*)
3784 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3785 ;;
3786 RCC*)
3787 # Rational C++ 2.4.1
3788 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3789 ;;
3790 cxx*)
3791 # Digital/Compaq C++
3792 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3793 # Make sure the PIC flag is empty. It appears that all Alpha
3794 # Linux and Compaq Tru64 Unix objects are PIC.
3795 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3796 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3797 ;;
3798 *)
3799 ;;
3800 esac
3801 ;;
3802 psos*)
3803 ;;
3804 solaris*)
3805 case $cc_basename in
3806 CC*)
3807 # Sun C++ 4.2, 5.x and Centerline C++
3808 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3809 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3810 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3811 ;;
3812 gcx*)
3813 # Green Hills C++ Compiler
3814 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
3815 ;;
3816 *)
3817 ;;
3818 esac
3819 ;;
3820 sunos4*)
3821 case $cc_basename in
3822 CC*)
3823 # Sun C++ 4.x
3824 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3825 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3826 ;;
3827 lcc*)
3828 # Lucid
3829 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3830 ;;
3831 *)
3832 ;;
3833 esac
3834 ;;
3835 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
3836 case $cc_basename in
3837 CC*)
3838 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3839 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3840 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3841 ;;
3842 esac
3843 ;;
3844 tandem*)
3845 case $cc_basename in
3846 NCC*)
3847 # NonStop-UX NCC 3.20
3848 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3849 ;;
3850 *)
3851 ;;
3852 esac
3853 ;;
3854 vxworks*)
3855 ;;
3856 *)
3857 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3858 ;;
3859 esac
3860 fi
3861 ],
3862 [
3863 if test "$GCC" = yes; then
3864 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3865 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3866
3867 case $host_os in
3868 aix*)
3869 # All AIX code is PIC.
3870 if test "$host_cpu" = ia64; then
3871 # AIX 5 now supports IA64 processor
3872 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3873 fi
3874 ;;
3875
3876 amigaos*)
3877 case $host_cpu in
3878 powerpc)
3879 # see comment about AmigaOS4 .so support
3880 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3881 ;;
3882 m68k)
3883 # FIXME: we need at least 68020 code to build shared libraries, but
3884 # adding the `-m68020' flag to GCC prevents building anything better,
3885 # like `-m68040'.
3886 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3887 ;;
3888 esac
3889 ;;
3890
3891 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3892 # PIC is the default for these OSes.
3893 ;;
3894
3895 mingw* | cygwin* | pw32* | os2* | cegcc*)
3896 # This hack is so that the source file can tell whether it is being
3897 # built for inclusion in a dll (and should export symbols for example).
3898 # Although the cygwin gcc ignores -fPIC, still need this for old-style
3899 # (--disable-auto-import) libraries
3900 m4_if([$1], [GCJ], [],
3901 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3902 ;;
3903
3904 darwin* | rhapsody*)
3905 # PIC is the default on this platform
3906 # Common symbols not allowed in MH_DYLIB files
3907 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3908 ;;
3909
3910 hpux*)
3911 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3912 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
3913 # sets the default TLS model and affects inlining.
3914 case $host_cpu in
3915 hppa*64*)
3916 # +Z the default
3917 ;;
3918 *)
3919 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3920 ;;
3921 esac
3922 ;;
3923
3924 interix[[3-9]]*)
3925 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3926 # Instead, we relocate shared libraries at runtime.
3927 ;;
3928
3929 msdosdjgpp*)
3930 # Just because we use GCC doesn't mean we suddenly get shared libraries
3931 # on systems that don't support them.
3932 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3933 enable_shared=no
3934 ;;
3935
3936 *nto* | *qnx*)
3937 # QNX uses GNU C++, but need to define -shared option too, otherwise
3938 # it will coredump.
3939 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3940 ;;
3941
3942 sysv4*MP*)
3943 if test -d /usr/nec; then
3944 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3945 fi
3946 ;;
3947
3948 *)
3949 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3950 ;;
3951 esac
3952 else
3953 # PORTME Check for flag to pass linker flags through the system compiler.
3954 case $host_os in
3955 aix*)
3956 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3957 if test "$host_cpu" = ia64; then
3958 # AIX 5 now supports IA64 processor
3959 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3960 else
3961 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3962 fi
3963 ;;
3964
3965 mingw* | cygwin* | pw32* | os2* | cegcc*)
3966 # This hack is so that the source file can tell whether it is being
3967 # built for inclusion in a dll (and should export symbols for example).
3968 m4_if([$1], [GCJ], [],
3969 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3970 ;;
3971
3972 hpux9* | hpux10* | hpux11*)
3973 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3974 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
3975 # not for PA HP-UX.
3976 case $host_cpu in
3977 hppa*64*|ia64*)
3978 # +Z the default
3979 ;;
3980 *)
3981 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3982 ;;
3983 esac
3984 # Is there a better lt_prog_compiler_static that works with the bundled CC?
3985 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3986 ;;
3987
3988 irix5* | irix6* | nonstopux*)
3989 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3990 # PIC (with -KPIC) is the default.
3991 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3992 ;;
3993
3994 linux* | k*bsd*-gnu)
3995 case $cc_basename in
3996 # old Intel for x86_64 which still supported -KPIC.
3997 ecc*)
3998 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3999 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4000 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4001 ;;
4002 # icc used to be incompatible with GCC.
4003 # ICC 10 doesn't accept -KPIC any more.
4004 icc* | ifort*)
4005 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4006 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4007 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4008 ;;
4009 # Lahey Fortran 8.1.
4010 lf95*)
4011 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4012 _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4013 _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4014 ;;
4015 pgcc* | pgf77* | pgf90* | pgf95*)
4016 # Portland Group compilers (*not* the Pentium gcc compiler,
4017 # which looks to be a dead project)
4018 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4019 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4020 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4021 ;;
4022 ccc*)
4023 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4024 # All Alpha code is PIC.
4025 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4026 ;;
4027 xl*)
4028 # IBM XL C 8.0/Fortran 10.1 on PPC
4029 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4030 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4031 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4032 ;;
4033 *)
4034 case `$CC -V 2>&1 | sed 5q` in
4035 *Sun\ C*)
4036 # Sun C 5.9
4037 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4038 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4039 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4040 ;;
4041 *Sun\ F*)
4042 # Sun Fortran 8.3 passes all unrecognized flags to the linker
4043 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4044 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4045 _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4046 ;;
4047 esac
4048 ;;
4049 esac
4050 ;;
4051
4052 newsos6)
4053 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4054 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4055 ;;
4056
4057 *nto* | *qnx*)
4058 # QNX uses GNU C++, but need to define -shared option too, otherwise
4059 # it will coredump.
4060 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4061 ;;
4062
4063 osf3* | osf4* | osf5*)
4064 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4065 # All OSF/1 code is PIC.
4066 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4067 ;;
4068
4069 rdos*)
4070 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4071 ;;
4072
4073 solaris*)
4074 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4075 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4076 case $cc_basename in
4077 f77* | f90* | f95*)
4078 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4079 *)
4080 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4081 esac
4082 ;;
4083
4084 sunos4*)
4085 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4086 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4087 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4088 ;;
4089
4090 sysv4 | sysv4.2uw2* | sysv4.3*)
4091 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4092 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4093 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4094 ;;
4095
4096 sysv4*MP*)
4097 if test -d /usr/nec ;then
4098 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4099 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4100 fi
4101 ;;
4102
4103 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4104 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4105 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4106 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4107 ;;
4108
4109 unicos*)
4110 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4111 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4112 ;;
4113
4114 uts4*)
4115 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4116 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4117 ;;
4118
4119 *)
4120 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4121 ;;
4122 esac
4123 fi
4124 ])
4125 case $host_os in
4126 # For platforms which do not support PIC, -DPIC is meaningless:
4127 *djgpp*)
4128 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4129 ;;
4130 *)
4131 _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4132 ;;
4133 esac
4134 AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4135 _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4136 [How to pass a linker flag through the compiler])
4137
4138 #
4139 # Check to make sure the PIC flag actually works.
4140 #
4141 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4142 _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4143 [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4144 [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4145 [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4146 "" | " "*) ;;
4147 *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4148 esac],
4149 [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4150 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4151 fi
4152 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4153 [Additional compiler flags for building library objects])
4154
4155 #
4156 # Check to make sure the static flag actually works.
4157 #
4158 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4159 _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4160 _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4161 $lt_tmp_static_flag,
4162 [],
4163 [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4164 _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4165 [Compiler flag to prevent dynamic linking])
4166 ])# _LT_COMPILER_PIC
4167
4168
4169 # _LT_LINKER_SHLIBS([TAGNAME])
4170 # ----------------------------
4171 # See if the linker supports building shared libraries.
4172 m4_defun([_LT_LINKER_SHLIBS],
4173 [AC_REQUIRE([LT_PATH_LD])dnl
4174 AC_REQUIRE([LT_PATH_NM])dnl
4175 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4176 m4_require([_LT_DECL_EGREP])dnl
4177 m4_require([_LT_DECL_SED])dnl
4178 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4179 m4_require([_LT_TAG_COMPILER])dnl
4180 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4181 m4_if([$1], [CXX], [
4182 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4183 case $host_os in
4184 aix[[4-9]]*)
4185 # If we're using GNU nm, then we don't want the "-C" option.
4186 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4187 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4188 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4189 else
4190 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4191 fi
4192 ;;
4193 pw32*)
4194 _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4195 ;;
4196 cygwin* | mingw* | cegcc*)
4197 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4198 ;;
4199 *)
4200 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4201 ;;
4202 esac
4203 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4204 ], [
4205 runpath_var=
4206 _LT_TAGVAR(allow_undefined_flag, $1)=
4207 _LT_TAGVAR(always_export_symbols, $1)=no
4208 _LT_TAGVAR(archive_cmds, $1)=
4209 _LT_TAGVAR(archive_expsym_cmds, $1)=
4210 _LT_TAGVAR(compiler_needs_object, $1)=no
4211 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4212 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4213 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4214 _LT_TAGVAR(hardcode_automatic, $1)=no
4215 _LT_TAGVAR(hardcode_direct, $1)=no
4216 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4217 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4218 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4219 _LT_TAGVAR(hardcode_libdir_separator, $1)=
4220 _LT_TAGVAR(hardcode_minus_L, $1)=no
4221 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4222 _LT_TAGVAR(inherit_rpath, $1)=no
4223 _LT_TAGVAR(link_all_deplibs, $1)=unknown
4224 _LT_TAGVAR(module_cmds, $1)=
4225 _LT_TAGVAR(module_expsym_cmds, $1)=
4226 _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4227 _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4228 _LT_TAGVAR(thread_safe_flag_spec, $1)=
4229 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4230 # include_expsyms should be a list of space-separated symbols to be *always*
4231 # included in the symbol list
4232 _LT_TAGVAR(include_expsyms, $1)=
4233 # exclude_expsyms can be an extended regexp of symbols to exclude
4234 # it will be wrapped by ` (' and `)$', so one must not match beginning or
4235 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4236 # as well as any symbol that contains `d'.
4237 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4238 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4239 # platforms (ab)use it in PIC code, but their linkers get confused if
4240 # the symbol is explicitly referenced. Since portable code cannot
4241 # rely on this symbol name, it's probably fine to never include it in
4242 # preloaded symbol tables.
4243 # Exclude shared library initialization/finalization symbols.
4244 dnl Note also adjust exclude_expsyms for C++ above.
4245 extract_expsyms_cmds=
4246
4247 case $host_os in
4248 cygwin* | mingw* | pw32* | cegcc*)
4249 # FIXME: the MSVC++ port hasn't been tested in a loooong time
4250 # When not using gcc, we currently assume that we are using
4251 # Microsoft Visual C++.
4252 if test "$GCC" != yes; then
4253 with_gnu_ld=no
4254 fi
4255 ;;
4256 interix*)
4257 # we just hope/assume this is gcc and not c89 (= MSVC++)
4258 with_gnu_ld=yes
4259 ;;
4260 openbsd*)
4261 with_gnu_ld=no
4262 ;;
4263 esac
4264
4265 _LT_TAGVAR(ld_shlibs, $1)=yes
4266 if test "$with_gnu_ld" = yes; then
4267 # If archive_cmds runs LD, not CC, wlarc should be empty
4268 wlarc='${wl}'
4269
4270 # Set some defaults for GNU ld with shared library support. These
4271 # are reset later if shared libraries are not supported. Putting them
4272 # here allows them to be overridden if necessary.
4273 runpath_var=LD_RUN_PATH
4274 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4275 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4276 # ancient GNU ld didn't support --whole-archive et. al.
4277 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4278 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4279 else
4280 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4281 fi
4282 supports_anon_versioning=no
4283 case `$LD -v 2>&1` in
4284 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4285 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4286 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4287 *\ 2.11.*) ;; # other 2.11 versions
4288 *) supports_anon_versioning=yes ;;
4289 esac
4290
4291 # See if GNU ld supports shared libraries.
4292 case $host_os in
4293 aix[[3-9]]*)
4294 # On AIX/PPC, the GNU linker is very broken
4295 if test "$host_cpu" != ia64; then
4296 _LT_TAGVAR(ld_shlibs, $1)=no
4297 cat <<_LT_EOF 1>&2
4298
4299 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
4300 *** to be unable to reliably create shared libraries on AIX.
4301 *** Therefore, libtool is disabling shared libraries support. If you
4302 *** really care for shared libraries, you may want to modify your PATH
4303 *** so that a non-GNU linker is found, and then restart.
4304
4305 _LT_EOF
4306 fi
4307 ;;
4308
4309 amigaos*)
4310 case $host_cpu in
4311 powerpc)
4312 # see comment about AmigaOS4 .so support
4313 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4314 _LT_TAGVAR(archive_expsym_cmds, $1)=''
4315 ;;
4316 m68k)
4317 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
4318 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4319 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4320 ;;
4321 esac
4322 ;;
4323
4324 beos*)
4325 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4326 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4327 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4328 # support --undefined. This deserves some investigation. FIXME
4329 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4330 else
4331 _LT_TAGVAR(ld_shlibs, $1)=no
4332 fi
4333 ;;
4334
4335 cygwin* | mingw* | pw32* | cegcc*)
4336 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4337 # as there is no search path for DLLs.
4338 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4339 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4340 _LT_TAGVAR(always_export_symbols, $1)=no
4341 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4342 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
4343
4344 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4345 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4346 # If the export-symbols file already is a .def file (1st line
4347 # is EXPORTS), use it as is; otherwise, prepend...
4348 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4349 cp $export_symbols $output_objdir/$soname.def;
4350 else
4351 echo EXPORTS > $output_objdir/$soname.def;
4352 cat $export_symbols >> $output_objdir/$soname.def;
4353 fi~
4354 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4355 else
4356 _LT_TAGVAR(ld_shlibs, $1)=no
4357 fi
4358 ;;
4359
4360 interix[[3-9]]*)
4361 _LT_TAGVAR(hardcode_direct, $1)=no
4362 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4363 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4364 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4365 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4366 # Instead, shared libraries are loaded at an image base (0x10000000 by
4367 # default) and relocated if they conflict, which is a slow very memory
4368 # consuming and fragmenting process. To avoid this, we pick a random,
4369 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4370 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
4371 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4372 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4373 ;;
4374
4375 gnu* | linux* | tpf* | k*bsd*-gnu)
4376 tmp_diet=no
4377 if test "$host_os" = linux-dietlibc; then
4378 case $cc_basename in
4379 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
4380 esac
4381 fi
4382 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4383 && test "$tmp_diet" = no
4384 then
4385 tmp_addflag=
4386 tmp_sharedflag='-shared'
4387 case $cc_basename,$host_cpu in
4388 pgcc*) # Portland Group C compiler
4389 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4390 tmp_addflag=' $pic_flag'
4391 ;;
4392 pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
4393 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4394 tmp_addflag=' $pic_flag -Mnomain' ;;
4395 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
4396 tmp_addflag=' -i_dynamic' ;;
4397 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
4398 tmp_addflag=' -i_dynamic -nofor_main' ;;
4399 ifc* | ifort*) # Intel Fortran compiler
4400 tmp_addflag=' -nofor_main' ;;
4401 lf95*) # Lahey Fortran 8.1
4402 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4403 tmp_sharedflag='--shared' ;;
4404 xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4405 tmp_sharedflag='-qmkshrobj'
4406 tmp_addflag= ;;
4407 esac
4408 case `$CC -V 2>&1 | sed 5q` in
4409 *Sun\ C*) # Sun C 5.9
4410 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4411 _LT_TAGVAR(compiler_needs_object, $1)=yes
4412 tmp_sharedflag='-G' ;;
4413 *Sun\ F*) # Sun Fortran 8.3
4414 tmp_sharedflag='-G' ;;
4415 esac
4416 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4417
4418 if test "x$supports_anon_versioning" = xyes; then
4419 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4420 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4421 echo "local: *; };" >> $output_objdir/$libname.ver~
4422 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4423 fi
4424
4425 case $cc_basename in
4426 xlf*)
4427 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4428 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4429 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4430 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
4431 _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
4432 if test "x$supports_anon_versioning" = xyes; then
4433 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4434 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4435 echo "local: *; };" >> $output_objdir/$libname.ver~
4436 $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4437 fi
4438 ;;
4439 esac
4440 else
4441 _LT_TAGVAR(ld_shlibs, $1)=no
4442 fi
4443 ;;
4444
4445 netbsd*)
4446 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4447 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4448 wlarc=
4449 else
4450 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4451 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4452 fi
4453 ;;
4454
4455 solaris*)
4456 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4457 _LT_TAGVAR(ld_shlibs, $1)=no
4458 cat <<_LT_EOF 1>&2
4459
4460 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
4461 *** create shared libraries on Solaris systems. Therefore, libtool
4462 *** is disabling shared libraries support. We urge you to upgrade GNU
4463 *** binutils to release 2.9.1 or newer. Another option is to modify
4464 *** your PATH or compiler configuration so that the native linker is
4465 *** used, and then restart.
4466
4467 _LT_EOF
4468 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4469 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4470 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4471 else
4472 _LT_TAGVAR(ld_shlibs, $1)=no
4473 fi
4474 ;;
4475
4476 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4477 case `$LD -v 2>&1` in
4478 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4479 _LT_TAGVAR(ld_shlibs, $1)=no
4480 cat <<_LT_EOF 1>&2
4481
4482 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4483 *** reliably create shared libraries on SCO systems. Therefore, libtool
4484 *** is disabling shared libraries support. We urge you to upgrade GNU
4485 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
4486 *** your PATH or compiler configuration so that the native linker is
4487 *** used, and then restart.
4488
4489 _LT_EOF
4490 ;;
4491 *)
4492 # For security reasons, it is highly recommended that you always
4493 # use absolute paths for naming shared libraries, and exclude the
4494 # DT_RUNPATH tag from executables and libraries. But doing so
4495 # requires that you compile everything twice, which is a pain.
4496 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4497 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4498 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4499 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4500 else
4501 _LT_TAGVAR(ld_shlibs, $1)=no
4502 fi
4503 ;;
4504 esac
4505 ;;
4506
4507 sunos4*)
4508 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4509 wlarc=
4510 _LT_TAGVAR(hardcode_direct, $1)=yes
4511 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4512 ;;
4513
4514 *)
4515 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4516 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4517 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4518 else
4519 _LT_TAGVAR(ld_shlibs, $1)=no
4520 fi
4521 ;;
4522 esac
4523
4524 if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4525 runpath_var=
4526 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4527 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4528 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4529 fi
4530 else
4531 # PORTME fill in a description of your system's linker (not GNU ld)
4532 case $host_os in
4533 aix3*)
4534 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4535 _LT_TAGVAR(always_export_symbols, $1)=yes
4536 _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
4537 # Note: this linker hardcodes the directories in LIBPATH if there
4538 # are no directories specified by -L.
4539 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4540 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4541 # Neither direct hardcoding nor static linking is supported with a
4542 # broken collect2.
4543 _LT_TAGVAR(hardcode_direct, $1)=unsupported
4544 fi
4545 ;;
4546
4547 aix[[4-9]]*)
4548 if test "$host_cpu" = ia64; then
4549 # On IA64, the linker does run time linking by default, so we don't
4550 # have to do anything special.
4551 aix_use_runtimelinking=no
4552 exp_sym_flag='-Bexport'
4553 no_entry_flag=""
4554 else
4555 # If we're using GNU nm, then we don't want the "-C" option.
4556 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4557 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4558 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4559 else
4560 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4561 fi
4562 aix_use_runtimelinking=no
4563
4564 # Test if we are trying to use run time linking or normal
4565 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
4566 # need to do runtime linking.
4567 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4568 for ld_flag in $LDFLAGS; do
4569 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
4570 aix_use_runtimelinking=yes
4571 break
4572 fi
4573 done
4574 ;;
4575 esac
4576
4577 exp_sym_flag='-bexport'
4578 no_entry_flag='-bnoentry'
4579 fi
4580
4581 # When large executables or shared objects are built, AIX ld can
4582 # have problems creating the table of contents. If linking a library
4583 # or program results in "error TOC overflow" add -mminimal-toc to
4584 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
4585 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4586
4587 _LT_TAGVAR(archive_cmds, $1)=''
4588 _LT_TAGVAR(hardcode_direct, $1)=yes
4589 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4590 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
4591 _LT_TAGVAR(link_all_deplibs, $1)=yes
4592 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4593
4594 if test "$GCC" = yes; then
4595 case $host_os in aix4.[[012]]|aix4.[[012]].*)
4596 # We only want to do this on AIX 4.2 and lower, the check
4597 # below for broken collect2 doesn't work under 4.3+
4598 collect2name=`${CC} -print-prog-name=collect2`
4599 if test -f "$collect2name" &&
4600 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
4601 then
4602 # We have reworked collect2
4603 :
4604 else
4605 # We have old collect2
4606 _LT_TAGVAR(hardcode_direct, $1)=unsupported
4607 # It fails to find uninstalled libraries when the uninstalled
4608 # path is not listed in the libpath. Setting hardcode_minus_L
4609 # to unsupported forces relinking
4610 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4611 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4612 _LT_TAGVAR(hardcode_libdir_separator, $1)=
4613 fi
4614 ;;
4615 esac
4616 shared_flag='-shared'
4617 if test "$aix_use_runtimelinking" = yes; then
4618 shared_flag="$shared_flag "'${wl}-G'
4619 fi
4620 else
4621 # not using gcc
4622 if test "$host_cpu" = ia64; then
4623 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4624 # chokes on -Wl,-G. The following line is correct:
4625 shared_flag='-G'
4626 else
4627 if test "$aix_use_runtimelinking" = yes; then
4628 shared_flag='${wl}-G'
4629 else
4630 shared_flag='${wl}-bM:SRE'
4631 fi
4632 fi
4633 fi
4634
4635 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
4636 # It seems that -bexpall does not export symbols beginning with
4637 # underscore (_), so it is better to generate a list of symbols to export.
4638 _LT_TAGVAR(always_export_symbols, $1)=yes
4639 if test "$aix_use_runtimelinking" = yes; then
4640 # Warning - without using the other runtime loading flags (-brtl),
4641 # -berok will link without error, but may produce a broken library.
4642 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
4643 # Determine the default libpath from the value encoded in an
4644 # empty executable.
4645 _LT_SYS_MODULE_PATH_AIX
4646 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4647 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
4648 else
4649 if test "$host_cpu" = ia64; then
4650 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4651 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4652 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
4653 else
4654 # Determine the default libpath from the value encoded in an
4655 # empty executable.
4656 _LT_SYS_MODULE_PATH_AIX
4657 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4658 # Warning - without using the other run time loading flags,
4659 # -berok will link without error, but may produce a broken library.
4660 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4661 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4662 # Exported symbols can be pulled into shared objects from archives
4663 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4664 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
4665 # This is similar to how AIX traditionally builds its shared libraries.
4666 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
4667 fi
4668 fi
4669 ;;
4670
4671 amigaos*)
4672 case $host_cpu in
4673 powerpc)
4674 # see comment about AmigaOS4 .so support
4675 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4676 _LT_TAGVAR(archive_expsym_cmds, $1)=''
4677 ;;
4678 m68k)
4679 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
4680 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4681 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4682 ;;
4683 esac
4684 ;;
4685
4686 bsdi[[45]]*)
4687 _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
4688 ;;
4689
4690 cygwin* | mingw* | pw32* | cegcc*)
4691 # When not using gcc, we currently assume that we are using
4692 # Microsoft Visual C++.
4693 # hardcode_libdir_flag_spec is actually meaningless, as there is
4694 # no search path for DLLs.
4695 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
4696 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4697 # Tell ltmain to make .lib files, not .a files.
4698 libext=lib
4699 # Tell ltmain to make .dll files, not .so files.
4700 shrext_cmds=".dll"
4701 # FIXME: Setting linknames here is a bad hack.
4702 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
4703 # The linker will automatically build a .lib file if we build a DLL.
4704 _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
4705 # FIXME: Should let the user specify the lib program.
4706 _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
4707 _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
4708 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4709 ;;
4710
4711 darwin* | rhapsody*)
4712 _LT_DARWIN_LINKER_FEATURES($1)
4713 ;;
4714
4715 dgux*)
4716 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4717 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4718 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4719 ;;
4720
4721 freebsd1*)
4722 _LT_TAGVAR(ld_shlibs, $1)=no
4723 ;;
4724
4725 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
4726 # support. Future versions do this automatically, but an explicit c++rt0.o
4727 # does not break anything, and helps significantly (at the cost of a little
4728 # extra space).
4729 freebsd2.2*)
4730 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
4731 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4732 _LT_TAGVAR(hardcode_direct, $1)=yes
4733 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4734 ;;
4735
4736 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
4737 freebsd2*)
4738 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4739 _LT_TAGVAR(hardcode_direct, $1)=yes
4740 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4741 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4742 ;;
4743
4744 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
4745 freebsd* | dragonfly*)
4746 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
4747 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4748 _LT_TAGVAR(hardcode_direct, $1)=yes
4749 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4750 ;;
4751
4752 hpux9*)
4753 if test "$GCC" = yes; then
4754 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4755 else
4756 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4757 fi
4758 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4759 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4760 _LT_TAGVAR(hardcode_direct, $1)=yes
4761
4762 # hardcode_minus_L: Not really in the search PATH,
4763 # but as the default location of the library.
4764 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4765 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4766 ;;
4767
4768 hpux10*)
4769 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4770 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4771 else
4772 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
4773 fi
4774 if test "$with_gnu_ld" = no; then
4775 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4776 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4777 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4778 _LT_TAGVAR(hardcode_direct, $1)=yes
4779 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4780 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4781 # hardcode_minus_L: Not really in the search PATH,
4782 # but as the default location of the library.
4783 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4784 fi
4785 ;;
4786
4787 hpux11*)
4788 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4789 case $host_cpu in
4790 hppa*64*)
4791 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4792 ;;
4793 ia64*)
4794 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4795 ;;
4796 *)
4797 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4798 ;;
4799 esac
4800 else
4801 case $host_cpu in
4802 hppa*64*)
4803 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4804 ;;
4805 ia64*)
4806 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4807 ;;
4808 *)
4809 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4810 ;;
4811 esac
4812 fi
4813 if test "$with_gnu_ld" = no; then
4814 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4815 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4816
4817 case $host_cpu in
4818 hppa*64*|ia64*)
4819 _LT_TAGVAR(hardcode_direct, $1)=no
4820 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4821 ;;
4822 *)
4823 _LT_TAGVAR(hardcode_direct, $1)=yes
4824 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4825 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4826
4827 # hardcode_minus_L: Not really in the search PATH,
4828 # but as the default location of the library.
4829 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4830 ;;
4831 esac
4832 fi
4833 ;;
4834
4835 irix5* | irix6* | nonstopux*)
4836 if test "$GCC" = yes; then
4837 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4838 # Try to use the -exported_symbol ld option, if it does not
4839 # work, assume that -exports_file does not work either and
4840 # implicitly export all symbols.
4841 save_LDFLAGS="$LDFLAGS"
4842 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4843 AC_LINK_IFELSE(int foo(void) {},
4844 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
4845 )
4846 LDFLAGS="$save_LDFLAGS"
4847 else
4848 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4849 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
4850 fi
4851 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4852 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4853 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4854 _LT_TAGVAR(inherit_rpath, $1)=yes
4855 _LT_TAGVAR(link_all_deplibs, $1)=yes
4856 ;;
4857
4858 netbsd*)
4859 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4860 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
4861 else
4862 _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
4863 fi
4864 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4865 _LT_TAGVAR(hardcode_direct, $1)=yes
4866 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4867 ;;
4868
4869 newsos6)
4870 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4871 _LT_TAGVAR(hardcode_direct, $1)=yes
4872 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4873 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4874 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4875 ;;
4876
4877 *nto* | *qnx*)
4878 ;;
4879
4880 openbsd*)
4881 if test -f /usr/libexec/ld.so; then
4882 _LT_TAGVAR(hardcode_direct, $1)=yes
4883 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4884 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4885 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4886 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4887 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
4888 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4889 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4890 else
4891 case $host_os in
4892 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
4893 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4894 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4895 ;;
4896 *)
4897 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4898 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4899 ;;
4900 esac
4901 fi
4902 else
4903 _LT_TAGVAR(ld_shlibs, $1)=no
4904 fi
4905 ;;
4906
4907 os2*)
4908 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4909 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4910 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4911 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
4912 _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
4913 ;;
4914
4915 osf3*)
4916 if test "$GCC" = yes; then
4917 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4918 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4919 else
4920 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4921 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4922 fi
4923 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4924 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4925 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4926 ;;
4927
4928 osf4* | osf5*) # as osf3* with the addition of -msym flag
4929 if test "$GCC" = yes; then
4930 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4931 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4932 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4933 else
4934 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4935 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4936 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
4937 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
4938
4939 # Both c and cxx compiler support -rpath directly
4940 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4941 fi
4942 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4943 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4944 ;;
4945
4946 solaris*)
4947 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
4948 if test "$GCC" = yes; then
4949 wlarc='${wl}'
4950 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4951 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4952 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4953 else
4954 case `$CC -V 2>&1` in
4955 *"Compilers 5.0"*)
4956 wlarc=''
4957 _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
4958 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4959 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
4960 ;;
4961 *)
4962 wlarc='${wl}'
4963 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
4964 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4965 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4966 ;;
4967 esac
4968 fi
4969 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4970 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4971 case $host_os in
4972 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
4973 *)
4974 # The compiler driver will combine and reorder linker options,
4975 # but understands `-z linker_flag'. GCC discards it without `$wl',
4976 # but is careful enough not to reorder.
4977 # Supported since Solaris 2.6 (maybe 2.5.1?)
4978 if test "$GCC" = yes; then
4979 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
4980 else
4981 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
4982 fi
4983 ;;
4984 esac
4985 _LT_TAGVAR(link_all_deplibs, $1)=yes
4986 ;;
4987
4988 sunos4*)
4989 if test "x$host_vendor" = xsequent; then
4990 # Use $CC to link under sequent, because it throws in some extra .o
4991 # files that make .init and .fini sections work.
4992 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
4993 else
4994 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
4995 fi
4996 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4997 _LT_TAGVAR(hardcode_direct, $1)=yes
4998 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4999 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5000 ;;
5001
5002 sysv4)
5003 case $host_vendor in
5004 sni)
5005 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5006 _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5007 ;;
5008 siemens)
5009 ## LD is ld it makes a PLAMLIB
5010 ## CC just makes a GrossModule.
5011 _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5012 _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5013 _LT_TAGVAR(hardcode_direct, $1)=no
5014 ;;
5015 motorola)
5016 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5017 _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5018 ;;
5019 esac
5020 runpath_var='LD_RUN_PATH'
5021 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5022 ;;
5023
5024 sysv4.3*)
5025 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5026 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5027 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5028 ;;
5029
5030 sysv4*MP*)
5031 if test -d /usr/nec; then
5032 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5033 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5034 runpath_var=LD_RUN_PATH
5035 hardcode_runpath_var=yes
5036 _LT_TAGVAR(ld_shlibs, $1)=yes
5037 fi
5038 ;;
5039
5040 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5041 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5042 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5043 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5044 runpath_var='LD_RUN_PATH'
5045
5046 if test "$GCC" = yes; then
5047 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5048 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5049 else
5050 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5051 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5052 fi
5053 ;;
5054
5055 sysv5* | sco3.2v5* | sco5v6*)
5056 # Note: We can NOT use -z defs as we might desire, because we do not
5057 # link with -lc, and that would cause any symbols used from libc to
5058 # always be unresolved, which means just about no library would
5059 # ever link correctly. If we're not using GNU ld we use -z text
5060 # though, which does catch some bad symbols but isn't as heavy-handed
5061 # as -z defs.
5062 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5063 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5064 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5065 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5066 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5067 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5068 _LT_TAGVAR(link_all_deplibs, $1)=yes
5069 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5070 runpath_var='LD_RUN_PATH'
5071
5072 if test "$GCC" = yes; then
5073 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5074 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5075 else
5076 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5077 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5078 fi
5079 ;;
5080
5081 uts4*)
5082 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5083 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5084 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5085 ;;
5086
5087 *)
5088 _LT_TAGVAR(ld_shlibs, $1)=no
5089 ;;
5090 esac
5091
5092 if test x$host_vendor = xsni; then
5093 case $host in
5094 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5095 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5096 ;;
5097 esac
5098 fi
5099 fi
5100 ])
5101 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5102 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5103
5104 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5105
5106 _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5107 _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5108 _LT_DECL([], [extract_expsyms_cmds], [2],
5109 [The commands to extract the exported symbol list from a shared archive])
5110
5111 #
5112 # Do we need to explicitly link libc?
5113 #
5114 case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5115 x|xyes)
5116 # Assume -lc should be added
5117 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5118
5119 if test "$enable_shared" = yes && test "$GCC" = yes; then
5120 case $_LT_TAGVAR(archive_cmds, $1) in
5121 *'~'*)
5122 # FIXME: we may have to deal with multi-command sequences.
5123 ;;
5124 '$CC '*)
5125 # Test whether the compiler implicitly links with -lc since on some
5126 # systems, -lgcc has to come before -lc. If gcc already passes -lc
5127 # to ld, don't add -lc before -lgcc.
5128 AC_MSG_CHECKING([whether -lc should be explicitly linked in])
5129 $RM conftest*
5130 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5131
5132 if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5133 soname=conftest
5134 lib=conftest
5135 libobjs=conftest.$ac_objext
5136 deplibs=
5137 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5138 pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5139 compiler_flags=-v
5140 linker_flags=-v
5141 verstring=
5142 output_objdir=.
5143 libname=conftest
5144 lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5145 _LT_TAGVAR(allow_undefined_flag, $1)=
5146 if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5147 then
5148 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5149 else
5150 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5151 fi
5152 _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5153 else
5154 cat conftest.err 1>&5
5155 fi
5156 $RM conftest*
5157 AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
5158 ;;
5159 esac
5160 fi
5161 ;;
5162 esac
5163
5164 _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5165 [Whether or not to add -lc for building shared libraries])
5166 _LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5167 [enable_shared_with_static_runtimes], [0],
5168 [Whether or not to disallow shared libs when runtime libs are static])
5169 _LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5170 [Compiler flag to allow reflexive dlopens])
5171 _LT_TAGDECL([], [whole_archive_flag_spec], [1],
5172 [Compiler flag to generate shared objects directly from archives])
5173 _LT_TAGDECL([], [compiler_needs_object], [1],
5174 [Whether the compiler copes with passing no objects directly])
5175 _LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5176 [Create an old-style archive from a shared archive])
5177 _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5178 [Create a temporary old-style archive to link instead of a shared archive])
5179 _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5180 _LT_TAGDECL([], [archive_expsym_cmds], [2])
5181 _LT_TAGDECL([], [module_cmds], [2],
5182 [Commands used to build a loadable module if different from building
5183 a shared archive.])
5184 _LT_TAGDECL([], [module_expsym_cmds], [2])
5185 _LT_TAGDECL([], [with_gnu_ld], [1],
5186 [Whether we are building with GNU ld or not])
5187 _LT_TAGDECL([], [allow_undefined_flag], [1],
5188 [Flag that allows shared libraries with undefined symbols to be built])
5189 _LT_TAGDECL([], [no_undefined_flag], [1],
5190 [Flag that enforces no undefined symbols])
5191 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5192 [Flag to hardcode $libdir into a binary during linking.
5193 This must work even if $libdir does not exist])
5194 _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5195 [[If ld is used when linking, flag to hardcode $libdir into a binary
5196 during linking. This must work even if $libdir does not exist]])
5197 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
5198 [Whether we need a single "-rpath" flag with a separated argument])
5199 _LT_TAGDECL([], [hardcode_direct], [0],
5200 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5201 DIR into the resulting binary])
5202 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
5203 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5204 DIR into the resulting binary and the resulting library dependency is
5205 "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5206 library is relocated])
5207 _LT_TAGDECL([], [hardcode_minus_L], [0],
5208 [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5209 into the resulting binary])
5210 _LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5211 [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5212 into the resulting binary])
5213 _LT_TAGDECL([], [hardcode_automatic], [0],
5214 [Set to "yes" if building a shared library automatically hardcodes DIR
5215 into the library and all subsequent libraries and executables linked
5216 against it])
5217 _LT_TAGDECL([], [inherit_rpath], [0],
5218 [Set to yes if linker adds runtime paths of dependent libraries
5219 to runtime path list])
5220 _LT_TAGDECL([], [link_all_deplibs], [0],
5221 [Whether libtool must link a program against all its dependency libraries])
5222 _LT_TAGDECL([], [fix_srcfile_path], [1],
5223 [Fix the shell variable $srcfile for the compiler])
5224 _LT_TAGDECL([], [always_export_symbols], [0],
5225 [Set to "yes" if exported symbols are required])
5226 _LT_TAGDECL([], [export_symbols_cmds], [2],
5227 [The commands to list exported symbols])
5228 _LT_TAGDECL([], [exclude_expsyms], [1],
5229 [Symbols that should not be listed in the preloaded symbols])
5230 _LT_TAGDECL([], [include_expsyms], [1],
5231 [Symbols that must always be exported])
5232 _LT_TAGDECL([], [prelink_cmds], [2],
5233 [Commands necessary for linking programs (against libraries) with templates])
5234 _LT_TAGDECL([], [file_list_spec], [1],
5235 [Specify filename containing input files])
5236 dnl FIXME: Not yet implemented
5237 dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5238 dnl [Compiler flag to generate thread safe objects])
5239 ])# _LT_LINKER_SHLIBS
5240
5241
5242 # _LT_LANG_C_CONFIG([TAG])
5243 # ------------------------
5244 # Ensure that the configuration variables for a C compiler are suitably
5245 # defined. These variables are subsequently used by _LT_CONFIG to write
5246 # the compiler configuration to `libtool'.
5247 m4_defun([_LT_LANG_C_CONFIG],
5248 [m4_require([_LT_DECL_EGREP])dnl
5249 lt_save_CC="$CC"
5250 AC_LANG_PUSH(C)
5251
5252 # Source file extension for C test sources.
5253 ac_ext=c
5254
5255 # Object file extension for compiled C test sources.
5256 objext=o
5257 _LT_TAGVAR(objext, $1)=$objext
5258
5259 # Code to be used in simple compile tests
5260 lt_simple_compile_test_code="int some_variable = 0;"
5261
5262 # Code to be used in simple link tests
5263 lt_simple_link_test_code='int main(){return(0);}'
5264
5265 _LT_TAG_COMPILER
5266 # Save the default compiler, since it gets overwritten when the other
5267 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5268 compiler_DEFAULT=$CC
5269
5270 # save warnings/boilerplate of simple test code
5271 _LT_COMPILER_BOILERPLATE
5272 _LT_LINKER_BOILERPLATE
5273
5274 ## CAVEAT EMPTOR:
5275 ## There is no encapsulation within the following macros, do not change
5276 ## the running order or otherwise move them around unless you know exactly
5277 ## what you are doing...
5278 if test -n "$compiler"; then
5279 _LT_COMPILER_NO_RTTI($1)
5280 _LT_COMPILER_PIC($1)
5281 _LT_COMPILER_C_O($1)
5282 _LT_COMPILER_FILE_LOCKS($1)
5283 _LT_LINKER_SHLIBS($1)
5284 _LT_SYS_DYNAMIC_LINKER($1)
5285 _LT_LINKER_HARDCODE_LIBPATH($1)
5286 LT_SYS_DLOPEN_SELF
5287 _LT_CMD_STRIPLIB
5288
5289 # Report which library types will actually be built
5290 AC_MSG_CHECKING([if libtool supports shared libraries])
5291 AC_MSG_RESULT([$can_build_shared])
5292
5293 AC_MSG_CHECKING([whether to build shared libraries])
5294 test "$can_build_shared" = "no" && enable_shared=no
5295
5296 # On AIX, shared libraries and static libraries use the same namespace, and
5297 # are all built from PIC.
5298 case $host_os in
5299 aix3*)
5300 test "$enable_shared" = yes && enable_static=no
5301 if test -n "$RANLIB"; then
5302 archive_cmds="$archive_cmds~\$RANLIB \$lib"
5303 postinstall_cmds='$RANLIB $lib'
5304 fi
5305 ;;
5306
5307 aix[[4-9]]*)
5308 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5309 test "$enable_shared" = yes && enable_static=no
5310 fi
5311 ;;
5312 esac
5313 AC_MSG_RESULT([$enable_shared])
5314
5315 AC_MSG_CHECKING([whether to build static libraries])
5316 # Make sure either enable_shared or enable_static is yes.
5317 test "$enable_shared" = yes || enable_static=yes
5318 AC_MSG_RESULT([$enable_static])
5319
5320 _LT_CONFIG($1)
5321 fi
5322 AC_LANG_POP
5323 CC="$lt_save_CC"
5324 ])# _LT_LANG_C_CONFIG
5325
5326
5327 # _LT_PROG_CXX
5328 # ------------
5329 # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
5330 # compiler, we have our own version here.
5331 m4_defun([_LT_PROG_CXX],
5332 [
5333 pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
5334 AC_PROG_CXX
5335 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5336 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5337 (test "X$CXX" != "Xg++"))) ; then
5338 AC_PROG_CXXCPP
5339 else
5340 _lt_caught_CXX_error=yes
5341 fi
5342 popdef([AC_MSG_ERROR])
5343 ])# _LT_PROG_CXX
5344
5345 dnl aclocal-1.4 backwards compatibility:
5346 dnl AC_DEFUN([_LT_PROG_CXX], [])
5347
5348
5349 # _LT_LANG_CXX_CONFIG([TAG])
5350 # --------------------------
5351 # Ensure that the configuration variables for a C++ compiler are suitably
5352 # defined. These variables are subsequently used by _LT_CONFIG to write
5353 # the compiler configuration to `libtool'.
5354 m4_defun([_LT_LANG_CXX_CONFIG],
5355 [AC_REQUIRE([_LT_PROG_CXX])dnl
5356 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5357 m4_require([_LT_DECL_EGREP])dnl
5358
5359 AC_LANG_PUSH(C++)
5360 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5361 _LT_TAGVAR(allow_undefined_flag, $1)=
5362 _LT_TAGVAR(always_export_symbols, $1)=no
5363 _LT_TAGVAR(archive_expsym_cmds, $1)=
5364 _LT_TAGVAR(compiler_needs_object, $1)=no
5365 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5366 _LT_TAGVAR(hardcode_direct, $1)=no
5367 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5368 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5369 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5370 _LT_TAGVAR(hardcode_libdir_separator, $1)=
5371 _LT_TAGVAR(hardcode_minus_L, $1)=no
5372 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5373 _LT_TAGVAR(hardcode_automatic, $1)=no
5374 _LT_TAGVAR(inherit_rpath, $1)=no
5375 _LT_TAGVAR(module_cmds, $1)=
5376 _LT_TAGVAR(module_expsym_cmds, $1)=
5377 _LT_TAGVAR(link_all_deplibs, $1)=unknown
5378 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5379 _LT_TAGVAR(no_undefined_flag, $1)=
5380 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5381 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5382
5383 # Source file extension for C++ test sources.
5384 ac_ext=cpp
5385
5386 # Object file extension for compiled C++ test sources.
5387 objext=o
5388 _LT_TAGVAR(objext, $1)=$objext
5389
5390 # No sense in running all these tests if we already determined that
5391 # the CXX compiler isn't working. Some variables (like enable_shared)
5392 # are currently assumed to apply to all compilers on this platform,
5393 # and will be corrupted by setting them based on a non-working compiler.
5394 if test "$_lt_caught_CXX_error" != yes; then
5395 # Code to be used in simple compile tests
5396 lt_simple_compile_test_code="int some_variable = 0;"
5397
5398 # Code to be used in simple link tests
5399 lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5400
5401 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5402 _LT_TAG_COMPILER
5403
5404 # save warnings/boilerplate of simple test code
5405 _LT_COMPILER_BOILERPLATE
5406 _LT_LINKER_BOILERPLATE
5407
5408 # Allow CC to be a program name with arguments.
5409 lt_save_CC=$CC
5410 lt_save_LD=$LD
5411 lt_save_GCC=$GCC
5412 GCC=$GXX
5413 lt_save_with_gnu_ld=$with_gnu_ld
5414 lt_save_path_LD=$lt_cv_path_LD
5415 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5416 lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5417 else
5418 $as_unset lt_cv_prog_gnu_ld
5419 fi
5420 if test -n "${lt_cv_path_LDCXX+set}"; then
5421 lt_cv_path_LD=$lt_cv_path_LDCXX
5422 else
5423 $as_unset lt_cv_path_LD
5424 fi
5425 test -z "${LDCXX+set}" || LD=$LDCXX
5426 CC=${CXX-"c++"}
5427 compiler=$CC
5428 _LT_TAGVAR(compiler, $1)=$CC
5429 _LT_CC_BASENAME([$compiler])
5430
5431 if test -n "$compiler"; then
5432 # We don't want -fno-exception when compiling C++ code, so set the
5433 # no_builtin_flag separately
5434 if test "$GXX" = yes; then
5435 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5436 else
5437 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5438 fi
5439
5440 if test "$GXX" = yes; then
5441 # Set up default GNU C++ configuration
5442
5443 LT_PATH_LD
5444
5445 # Check if GNU C++ uses GNU ld as the underlying linker, since the
5446 # archiving commands below assume that GNU ld is being used.
5447 if test "$with_gnu_ld" = yes; then
5448 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5449 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5450
5451 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5452 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5453
5454 # If archive_cmds runs LD, not CC, wlarc should be empty
5455 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5456 # investigate it a little bit more. (MM)
5457 wlarc='${wl}'
5458
5459 # ancient GNU ld didn't support --whole-archive et. al.
5460 if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5461 $GREP 'no-whole-archive' > /dev/null; then
5462 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5463 else
5464 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5465 fi
5466 else
5467 with_gnu_ld=no
5468 wlarc=
5469
5470 # A generic and very simple default shared library creation
5471 # command for GNU C++ for the case where it uses the native
5472 # linker, instead of GNU ld. If possible, this setting should
5473 # overridden to take advantage of the native linker features on
5474 # the platform it is being used on.
5475 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5476 fi
5477
5478 # Commands to make compiler produce verbose output that lists
5479 # what "hidden" libraries, object files and flags are used when
5480 # linking a shared library.
5481 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
5482
5483 else
5484 GXX=no
5485 with_gnu_ld=no
5486 wlarc=
5487 fi
5488
5489 # PORTME: fill in a description of your system's C++ link characteristics
5490 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5491 _LT_TAGVAR(ld_shlibs, $1)=yes
5492 case $host_os in
5493 aix3*)
5494 # FIXME: insert proper C++ library support
5495 _LT_TAGVAR(ld_shlibs, $1)=no
5496 ;;
5497 aix[[4-9]]*)
5498 if test "$host_cpu" = ia64; then
5499 # On IA64, the linker does run time linking by default, so we don't
5500 # have to do anything special.
5501 aix_use_runtimelinking=no
5502 exp_sym_flag='-Bexport'
5503 no_entry_flag=""
5504 else
5505 aix_use_runtimelinking=no
5506
5507 # Test if we are trying to use run time linking or normal
5508 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5509 # need to do runtime linking.
5510 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5511 for ld_flag in $LDFLAGS; do
5512 case $ld_flag in
5513 *-brtl*)
5514 aix_use_runtimelinking=yes
5515 break
5516 ;;
5517 esac
5518 done
5519 ;;
5520 esac
5521
5522 exp_sym_flag='-bexport'
5523 no_entry_flag='-bnoentry'
5524 fi
5525
5526 # When large executables or shared objects are built, AIX ld can
5527 # have problems creating the table of contents. If linking a library
5528 # or program results in "error TOC overflow" add -mminimal-toc to
5529 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
5530 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5531
5532 _LT_TAGVAR(archive_cmds, $1)=''
5533 _LT_TAGVAR(hardcode_direct, $1)=yes
5534 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5535 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5536 _LT_TAGVAR(link_all_deplibs, $1)=yes
5537 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5538
5539 if test "$GXX" = yes; then
5540 case $host_os in aix4.[[012]]|aix4.[[012]].*)
5541 # We only want to do this on AIX 4.2 and lower, the check
5542 # below for broken collect2 doesn't work under 4.3+
5543 collect2name=`${CC} -print-prog-name=collect2`
5544 if test -f "$collect2name" &&
5545 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5546 then
5547 # We have reworked collect2
5548 :
5549 else
5550 # We have old collect2
5551 _LT_TAGVAR(hardcode_direct, $1)=unsupported
5552 # It fails to find uninstalled libraries when the uninstalled
5553 # path is not listed in the libpath. Setting hardcode_minus_L
5554 # to unsupported forces relinking
5555 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5556 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5557 _LT_TAGVAR(hardcode_libdir_separator, $1)=
5558 fi
5559 esac
5560 shared_flag='-shared'
5561 if test "$aix_use_runtimelinking" = yes; then
5562 shared_flag="$shared_flag "'${wl}-G'
5563 fi
5564 else
5565 # not using gcc
5566 if test "$host_cpu" = ia64; then
5567 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5568 # chokes on -Wl,-G. The following line is correct:
5569 shared_flag='-G'
5570 else
5571 if test "$aix_use_runtimelinking" = yes; then
5572 shared_flag='${wl}-G'
5573 else
5574 shared_flag='${wl}-bM:SRE'
5575 fi
5576 fi
5577 fi
5578
5579 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5580 # It seems that -bexpall does not export symbols beginning with
5581 # underscore (_), so it is better to generate a list of symbols to
5582 # export.
5583 _LT_TAGVAR(always_export_symbols, $1)=yes
5584 if test "$aix_use_runtimelinking" = yes; then
5585 # Warning - without using the other runtime loading flags (-brtl),
5586 # -berok will link without error, but may produce a broken library.
5587 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5588 # Determine the default libpath from the value encoded in an empty
5589 # executable.
5590 _LT_SYS_MODULE_PATH_AIX
5591 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5592
5593 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5594 else
5595 if test "$host_cpu" = ia64; then
5596 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5597 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5598 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
5599 else
5600 # Determine the default libpath from the value encoded in an
5601 # empty executable.
5602 _LT_SYS_MODULE_PATH_AIX
5603 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5604 # Warning - without using the other run time loading flags,
5605 # -berok will link without error, but may produce a broken library.
5606 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5607 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5608 # Exported symbols can be pulled into shared objects from archives
5609 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5610 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5611 # This is similar to how AIX traditionally builds its shared
5612 # libraries.
5613 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5614 fi
5615 fi
5616 ;;
5617
5618 beos*)
5619 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5620 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5621 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5622 # support --undefined. This deserves some investigation. FIXME
5623 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5624 else
5625 _LT_TAGVAR(ld_shlibs, $1)=no
5626 fi
5627 ;;
5628
5629 chorus*)
5630 case $cc_basename in
5631 *)
5632 # FIXME: insert proper C++ library support
5633 _LT_TAGVAR(ld_shlibs, $1)=no
5634 ;;
5635 esac
5636 ;;
5637
5638 cygwin* | mingw* | pw32* | cegcc*)
5639 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5640 # as there is no search path for DLLs.
5641 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5642 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5643 _LT_TAGVAR(always_export_symbols, $1)=no
5644 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5645
5646 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5647 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5648 # If the export-symbols file already is a .def file (1st line
5649 # is EXPORTS), use it as is; otherwise, prepend...
5650 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5651 cp $export_symbols $output_objdir/$soname.def;
5652 else
5653 echo EXPORTS > $output_objdir/$soname.def;
5654 cat $export_symbols >> $output_objdir/$soname.def;
5655 fi~
5656 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5657 else
5658 _LT_TAGVAR(ld_shlibs, $1)=no
5659 fi
5660 ;;
5661 darwin* | rhapsody*)
5662 _LT_DARWIN_LINKER_FEATURES($1)
5663 ;;
5664
5665 dgux*)
5666 case $cc_basename in
5667 ec++*)
5668 # FIXME: insert proper C++ library support
5669 _LT_TAGVAR(ld_shlibs, $1)=no
5670 ;;
5671 ghcx*)
5672 # Green Hills C++ Compiler
5673 # FIXME: insert proper C++ library support
5674 _LT_TAGVAR(ld_shlibs, $1)=no
5675 ;;
5676 *)
5677 # FIXME: insert proper C++ library support
5678 _LT_TAGVAR(ld_shlibs, $1)=no
5679 ;;
5680 esac
5681 ;;
5682
5683 freebsd[[12]]*)
5684 # C++ shared libraries reported to be fairly broken before
5685 # switch to ELF
5686 _LT_TAGVAR(ld_shlibs, $1)=no
5687 ;;
5688
5689 freebsd-elf*)
5690 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5691 ;;
5692
5693 freebsd* | dragonfly*)
5694 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5695 # conventions
5696 _LT_TAGVAR(ld_shlibs, $1)=yes
5697 ;;
5698
5699 gnu*)
5700 ;;
5701
5702 hpux9*)
5703 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5704 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5705 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5706 _LT_TAGVAR(hardcode_direct, $1)=yes
5707 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5708 # but as the default
5709 # location of the library.
5710
5711 case $cc_basename in
5712 CC*)
5713 # FIXME: insert proper C++ library support
5714 _LT_TAGVAR(ld_shlibs, $1)=no
5715 ;;
5716 aCC*)
5717 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5718 # Commands to make compiler produce verbose output that lists
5719 # what "hidden" libraries, object files and flags are used when
5720 # linking a shared library.
5721 #
5722 # There doesn't appear to be a way to prevent this compiler from
5723 # explicitly linking system object files so we need to strip them
5724 # from the output so that they don't get included in the library
5725 # dependencies.
5726 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5727 ;;
5728 *)
5729 if test "$GXX" = yes; then
5730 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5731 else
5732 # FIXME: insert proper C++ library support
5733 _LT_TAGVAR(ld_shlibs, $1)=no
5734 fi
5735 ;;
5736 esac
5737 ;;
5738
5739 hpux10*|hpux11*)
5740 if test $with_gnu_ld = no; then
5741 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5742 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5743
5744 case $host_cpu in
5745 hppa*64*|ia64*)
5746 ;;
5747 *)
5748 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5749 ;;
5750 esac
5751 fi
5752 case $host_cpu in
5753 hppa*64*|ia64*)
5754 _LT_TAGVAR(hardcode_direct, $1)=no
5755 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5756 ;;
5757 *)
5758 _LT_TAGVAR(hardcode_direct, $1)=yes
5759 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5760 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5761 # but as the default
5762 # location of the library.
5763 ;;
5764 esac
5765
5766 case $cc_basename in
5767 CC*)
5768 # FIXME: insert proper C++ library support
5769 _LT_TAGVAR(ld_shlibs, $1)=no
5770 ;;
5771 aCC*)
5772 case $host_cpu in
5773 hppa*64*)
5774 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5775 ;;
5776 ia64*)
5777 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5778 ;;
5779 *)
5780 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5781 ;;
5782 esac
5783 # Commands to make compiler produce verbose output that lists
5784 # what "hidden" libraries, object files and flags are used when
5785 # linking a shared library.
5786 #
5787 # There doesn't appear to be a way to prevent this compiler from
5788 # explicitly linking system object files so we need to strip them
5789 # from the output so that they don't get included in the library
5790 # dependencies.
5791 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5792 ;;
5793 *)
5794 if test "$GXX" = yes; then
5795 if test $with_gnu_ld = no; then
5796 case $host_cpu in
5797 hppa*64*)
5798 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5799 ;;
5800 ia64*)
5801 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5802 ;;
5803 *)
5804 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5805 ;;
5806 esac
5807 fi
5808 else
5809 # FIXME: insert proper C++ library support
5810 _LT_TAGVAR(ld_shlibs, $1)=no
5811 fi
5812 ;;
5813 esac
5814 ;;
5815
5816 interix[[3-9]]*)
5817 _LT_TAGVAR(hardcode_direct, $1)=no
5818 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5819 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5820 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5821 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5822 # Instead, shared libraries are loaded at an image base (0x10000000 by
5823 # default) and relocated if they conflict, which is a slow very memory
5824 # consuming and fragmenting process. To avoid this, we pick a random,
5825 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5826 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
5827 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5828 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5829 ;;
5830 irix5* | irix6*)
5831 case $cc_basename in
5832 CC*)
5833 # SGI C++
5834 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
5835
5836 # Archives containing C++ object files must be created using
5837 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
5838 # necessary to make sure instantiated templates are included
5839 # in the archive.
5840 _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5841 ;;
5842 *)
5843 if test "$GXX" = yes; then
5844 if test "$with_gnu_ld" = no; then
5845 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5846 else
5847 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
5848 fi
5849 fi
5850 _LT_TAGVAR(link_all_deplibs, $1)=yes
5851 ;;
5852 esac
5853 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5854 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5855 _LT_TAGVAR(inherit_rpath, $1)=yes
5856 ;;
5857
5858 linux* | k*bsd*-gnu)
5859 case $cc_basename in
5860 KCC*)
5861 # Kuck and Associates, Inc. (KAI) C++ Compiler
5862
5863 # KCC will only create a shared library if the output file
5864 # ends with ".so" (or ".sl" for HP-UX), so rename the library
5865 # to its proper name (with version) after linking.
5866 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
5867 _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
5868 # Commands to make compiler produce verbose output that lists
5869 # what "hidden" libraries, object files and flags are used when
5870 # linking a shared library.
5871 #
5872 # There doesn't appear to be a way to prevent this compiler from
5873 # explicitly linking system object files so we need to strip them
5874 # from the output so that they don't get included in the library
5875 # dependencies.
5876 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5877
5878 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5879 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5880
5881 # Archives containing C++ object files must be created using
5882 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
5883 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5884 ;;
5885 icpc* | ecpc* )
5886 # Intel C++
5887 with_gnu_ld=yes
5888 # version 8.0 and above of icpc choke on multiply defined symbols
5889 # if we add $predep_objects and $postdep_objects, however 7.1 and
5890 # earlier do not add the objects themselves.
5891 case `$CC -V 2>&1` in
5892 *"Version 7."*)
5893 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5894 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5895 ;;
5896 *) # Version 8.0 or newer
5897 tmp_idyn=
5898 case $host_cpu in
5899 ia64*) tmp_idyn=' -i_dynamic';;
5900 esac
5901 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5902 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5903 ;;
5904 esac
5905 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5906 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5907 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5908 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5909 ;;
5910 pgCC* | pgcpp*)
5911 # Portland Group C++ compiler
5912 case `$CC -V` in
5913 *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
5914 _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
5915 rm -rf $tpldir~
5916 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
5917 compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
5918 _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
5919 rm -rf $tpldir~
5920 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
5921 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
5922 $RANLIB $oldlib'
5923 _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
5924 rm -rf $tpldir~
5925 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5926 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5927 _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
5928 rm -rf $tpldir~
5929 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5930 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
5931 ;;
5932 *) # Version 6 will use weak symbols
5933 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5934 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
5935 ;;
5936 esac
5937
5938 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5939 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5940 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5941 ;;
5942 cxx*)
5943 # Compaq C++
5944 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5945 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
5946
5947 runpath_var=LD_RUN_PATH
5948 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5949 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5950
5951 # Commands to make compiler produce verbose output that lists
5952 # what "hidden" libraries, object files and flags are used when
5953 # linking a shared library.
5954 #
5955 # There doesn't appear to be a way to prevent this compiler from
5956 # explicitly linking system object files so we need to strip them
5957 # from the output so that they don't get included in the library
5958 # dependencies.
5959 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5960 ;;
5961 xl*)
5962 # IBM XL 8.0 on PPC, with GNU ld
5963 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5964 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5965 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5966 if test "x$supports_anon_versioning" = xyes; then
5967 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5968 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5969 echo "local: *; };" >> $output_objdir/$libname.ver~
5970 $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5971 fi
5972 ;;
5973 *)
5974 case `$CC -V 2>&1 | sed 5q` in
5975 *Sun\ C*)
5976 # Sun C++ 5.9
5977 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
5978 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5979 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
5980 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5981 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5982 _LT_TAGVAR(compiler_needs_object, $1)=yes
5983
5984 # Not sure whether something based on
5985 # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
5986 # would be better.
5987 output_verbose_link_cmd='echo'
5988
5989 # Archives containing C++ object files must be created using
5990 # "CC -xar", where "CC" is the Sun C++ compiler. This is
5991 # necessary to make sure instantiated templates are included
5992 # in the archive.
5993 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
5994 ;;
5995 esac
5996 ;;
5997 esac
5998 ;;
5999
6000 lynxos*)
6001 # FIXME: insert proper C++ library support
6002 _LT_TAGVAR(ld_shlibs, $1)=no
6003 ;;
6004
6005 m88k*)
6006 # FIXME: insert proper C++ library support
6007 _LT_TAGVAR(ld_shlibs, $1)=no
6008 ;;
6009
6010 mvs*)
6011 case $cc_basename in
6012 cxx*)
6013 # FIXME: insert proper C++ library support
6014 _LT_TAGVAR(ld_shlibs, $1)=no
6015 ;;
6016 *)
6017 # FIXME: insert proper C++ library support
6018 _LT_TAGVAR(ld_shlibs, $1)=no
6019 ;;
6020 esac
6021 ;;
6022
6023 netbsd*)
6024 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6025 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6026 wlarc=
6027 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6028 _LT_TAGVAR(hardcode_direct, $1)=yes
6029 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6030 fi
6031 # Workaround some broken pre-1.5 toolchains
6032 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6033 ;;
6034
6035 *nto* | *qnx*)
6036 _LT_TAGVAR(ld_shlibs, $1)=yes
6037 ;;
6038
6039 openbsd2*)
6040 # C++ shared libraries are fairly broken
6041 _LT_TAGVAR(ld_shlibs, $1)=no
6042 ;;
6043
6044 openbsd*)
6045 if test -f /usr/libexec/ld.so; then
6046 _LT_TAGVAR(hardcode_direct, $1)=yes
6047 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6048 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6049 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6050 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6051 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6052 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
6053 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6054 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6055 fi
6056 output_verbose_link_cmd=echo
6057 else
6058 _LT_TAGVAR(ld_shlibs, $1)=no
6059 fi
6060 ;;
6061
6062 osf3* | osf4* | osf5*)
6063 case $cc_basename in
6064 KCC*)
6065 # Kuck and Associates, Inc. (KAI) C++ Compiler
6066
6067 # KCC will only create a shared library if the output file
6068 # ends with ".so" (or ".sl" for HP-UX), so rename the library
6069 # to its proper name (with version) after linking.
6070 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6071
6072 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6073 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6074
6075 # Archives containing C++ object files must be created using
6076 # the KAI C++ compiler.
6077 case $host in
6078 osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6079 *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6080 esac
6081 ;;
6082 RCC*)
6083 # Rational C++ 2.4.1
6084 # FIXME: insert proper C++ library support
6085 _LT_TAGVAR(ld_shlibs, $1)=no
6086 ;;
6087 cxx*)
6088 case $host in
6089 osf3*)
6090 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6091 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6092 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6093 ;;
6094 *)
6095 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6096 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6097 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6098 echo "-hidden">> $lib.exp~
6099 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
6100 $RM $lib.exp'
6101 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6102 ;;
6103 esac
6104
6105 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6106
6107 # Commands to make compiler produce verbose output that lists
6108 # what "hidden" libraries, object files and flags are used when
6109 # linking a shared library.
6110 #
6111 # There doesn't appear to be a way to prevent this compiler from
6112 # explicitly linking system object files so we need to strip them
6113 # from the output so that they don't get included in the library
6114 # dependencies.
6115 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
6116 ;;
6117 *)
6118 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6119 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6120 case $host in
6121 osf3*)
6122 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6123 ;;
6124 *)
6125 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6126 ;;
6127 esac
6128
6129 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6130 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6131
6132 # Commands to make compiler produce verbose output that lists
6133 # what "hidden" libraries, object files and flags are used when
6134 # linking a shared library.
6135 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6136
6137 else
6138 # FIXME: insert proper C++ library support
6139 _LT_TAGVAR(ld_shlibs, $1)=no
6140 fi
6141 ;;
6142 esac
6143 ;;
6144
6145 psos*)
6146 # FIXME: insert proper C++ library support
6147 _LT_TAGVAR(ld_shlibs, $1)=no
6148 ;;
6149
6150 sunos4*)
6151 case $cc_basename in
6152 CC*)
6153 # Sun C++ 4.x
6154 # FIXME: insert proper C++ library support
6155 _LT_TAGVAR(ld_shlibs, $1)=no
6156 ;;
6157 lcc*)
6158 # Lucid
6159 # FIXME: insert proper C++ library support
6160 _LT_TAGVAR(ld_shlibs, $1)=no
6161 ;;
6162 *)
6163 # FIXME: insert proper C++ library support
6164 _LT_TAGVAR(ld_shlibs, $1)=no
6165 ;;
6166 esac
6167 ;;
6168
6169 solaris*)
6170 case $cc_basename in
6171 CC*)
6172 # Sun C++ 4.2, 5.x and Centerline C++
6173 _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6174 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6175 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6176 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6177 $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6178
6179 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6180 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6181 case $host_os in
6182 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6183 *)
6184 # The compiler driver will combine and reorder linker options,
6185 # but understands `-z linker_flag'.
6186 # Supported since Solaris 2.6 (maybe 2.5.1?)
6187 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6188 ;;
6189 esac
6190 _LT_TAGVAR(link_all_deplibs, $1)=yes
6191
6192 output_verbose_link_cmd='echo'
6193
6194 # Archives containing C++ object files must be created using
6195 # "CC -xar", where "CC" is the Sun C++ compiler. This is
6196 # necessary to make sure instantiated templates are included
6197 # in the archive.
6198 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6199 ;;
6200 gcx*)
6201 # Green Hills C++ Compiler
6202 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6203
6204 # The C++ compiler must be used to create the archive.
6205 _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6206 ;;
6207 *)
6208 # GNU C++ compiler with Solaris linker
6209 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6210 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6211 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6212 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6213 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6214 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6215
6216 # Commands to make compiler produce verbose output that lists
6217 # what "hidden" libraries, object files and flags are used when
6218 # linking a shared library.
6219 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6220 else
6221 # g++ 2.7 appears to require `-G' NOT `-shared' on this
6222 # platform.
6223 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6224 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6225 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6226
6227 # Commands to make compiler produce verbose output that lists
6228 # what "hidden" libraries, object files and flags are used when
6229 # linking a shared library.
6230 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6231 fi
6232
6233 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6234 case $host_os in
6235 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6236 *)
6237 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6238 ;;
6239 esac
6240 fi
6241 ;;
6242 esac
6243 ;;
6244
6245 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6246 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6247 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6248 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6249 runpath_var='LD_RUN_PATH'
6250
6251 case $cc_basename in
6252 CC*)
6253 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6254 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6255 ;;
6256 *)
6257 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6258 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6259 ;;
6260 esac
6261 ;;
6262
6263 sysv5* | sco3.2v5* | sco5v6*)
6264 # Note: We can NOT use -z defs as we might desire, because we do not
6265 # link with -lc, and that would cause any symbols used from libc to
6266 # always be unresolved, which means just about no library would
6267 # ever link correctly. If we're not using GNU ld we use -z text
6268 # though, which does catch some bad symbols but isn't as heavy-handed
6269 # as -z defs.
6270 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6271 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6272 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6273 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6274 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6275 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6276 _LT_TAGVAR(link_all_deplibs, $1)=yes
6277 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6278 runpath_var='LD_RUN_PATH'
6279
6280 case $cc_basename in
6281 CC*)
6282 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6283 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6284 ;;
6285 *)
6286 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6287 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6288 ;;
6289 esac
6290 ;;
6291
6292 tandem*)
6293 case $cc_basename in
6294 NCC*)
6295 # NonStop-UX NCC 3.20
6296 # FIXME: insert proper C++ library support
6297 _LT_TAGVAR(ld_shlibs, $1)=no
6298 ;;
6299 *)
6300 # FIXME: insert proper C++ library support
6301 _LT_TAGVAR(ld_shlibs, $1)=no
6302 ;;
6303 esac
6304 ;;
6305
6306 vxworks*)
6307 # FIXME: insert proper C++ library support
6308 _LT_TAGVAR(ld_shlibs, $1)=no
6309 ;;
6310
6311 *)
6312 # FIXME: insert proper C++ library support
6313 _LT_TAGVAR(ld_shlibs, $1)=no
6314 ;;
6315 esac
6316
6317 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6318 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6319
6320 _LT_TAGVAR(GCC, $1)="$GXX"
6321 _LT_TAGVAR(LD, $1)="$LD"
6322
6323 ## CAVEAT EMPTOR:
6324 ## There is no encapsulation within the following macros, do not change
6325 ## the running order or otherwise move them around unless you know exactly
6326 ## what you are doing...
6327 _LT_SYS_HIDDEN_LIBDEPS($1)
6328 _LT_COMPILER_PIC($1)
6329 _LT_COMPILER_C_O($1)
6330 _LT_COMPILER_FILE_LOCKS($1)
6331 _LT_LINKER_SHLIBS($1)
6332 _LT_SYS_DYNAMIC_LINKER($1)
6333 _LT_LINKER_HARDCODE_LIBPATH($1)
6334
6335 _LT_CONFIG($1)
6336 fi # test -n "$compiler"
6337
6338 CC=$lt_save_CC
6339 LDCXX=$LD
6340 LD=$lt_save_LD
6341 GCC=$lt_save_GCC
6342 with_gnu_ld=$lt_save_with_gnu_ld
6343 lt_cv_path_LDCXX=$lt_cv_path_LD
6344 lt_cv_path_LD=$lt_save_path_LD
6345 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6346 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6347 fi # test "$_lt_caught_CXX_error" != yes
6348
6349 AC_LANG_POP
6350 ])# _LT_LANG_CXX_CONFIG
6351
6352
6353 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6354 # ---------------------------------
6355 # Figure out "hidden" library dependencies from verbose
6356 # compiler output when linking a shared library.
6357 # Parse the compiler output and extract the necessary
6358 # objects, libraries and library flags.
6359 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6360 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6361 # Dependencies to place before and after the object being linked:
6362 _LT_TAGVAR(predep_objects, $1)=
6363 _LT_TAGVAR(postdep_objects, $1)=
6364 _LT_TAGVAR(predeps, $1)=
6365 _LT_TAGVAR(postdeps, $1)=
6366 _LT_TAGVAR(compiler_lib_search_path, $1)=
6367
6368 dnl we can't use the lt_simple_compile_test_code here,
6369 dnl because it contains code intended for an executable,
6370 dnl not a library. It's possible we should let each
6371 dnl tag define a new lt_????_link_test_code variable,
6372 dnl but it's only used here...
6373 m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6374 int a;
6375 void foo (void) { a = 0; }
6376 _LT_EOF
6377 ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6378 class Foo
6379 {
6380 public:
6381 Foo (void) { a = 0; }
6382 private:
6383 int a;
6384 };
6385 _LT_EOF
6386 ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6387 subroutine foo
6388 implicit none
6389 integer*4 a
6390 a=0
6391 return
6392 end
6393 _LT_EOF
6394 ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6395 subroutine foo
6396 implicit none
6397 integer a
6398 a=0
6399 return
6400 end
6401 _LT_EOF
6402 ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6403 public class foo {
6404 private int a;
6405 public void bar (void) {
6406 a = 0;
6407 }
6408 };
6409 _LT_EOF
6410 ])
6411 dnl Parse the compiler output and extract the necessary
6412 dnl objects, libraries and library flags.
6413 if AC_TRY_EVAL(ac_compile); then
6414 # Parse the compiler output and extract the necessary
6415 # objects, libraries and library flags.
6416
6417 # Sentinel used to keep track of whether or not we are before
6418 # the conftest object file.
6419 pre_test_object_deps_done=no
6420
6421 for p in `eval "$output_verbose_link_cmd"`; do
6422 case $p in
6423
6424 -L* | -R* | -l*)
6425 # Some compilers place space between "-{L,R}" and the path.
6426 # Remove the space.
6427 if test $p = "-L" ||
6428 test $p = "-R"; then
6429 prev=$p
6430 continue
6431 else
6432 prev=
6433 fi
6434
6435 if test "$pre_test_object_deps_done" = no; then
6436 case $p in
6437 -L* | -R*)
6438 # Internal compiler library paths should come after those
6439 # provided the user. The postdeps already come after the
6440 # user supplied libs so there is no need to process them.
6441 if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
6442 _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6443 else
6444 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6445 fi
6446 ;;
6447 # The "-l" case would never come before the object being
6448 # linked, so don't bother handling this case.
6449 esac
6450 else
6451 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
6452 _LT_TAGVAR(postdeps, $1)="${prev}${p}"
6453 else
6454 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
6455 fi
6456 fi
6457 ;;
6458
6459 *.$objext)
6460 # This assumes that the test object file only shows up
6461 # once in the compiler output.
6462 if test "$p" = "conftest.$objext"; then
6463 pre_test_object_deps_done=yes
6464 continue
6465 fi
6466
6467 if test "$pre_test_object_deps_done" = no; then
6468 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
6469 _LT_TAGVAR(predep_objects, $1)="$p"
6470 else
6471 _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
6472 fi
6473 else
6474 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
6475 _LT_TAGVAR(postdep_objects, $1)="$p"
6476 else
6477 _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
6478 fi
6479 fi
6480 ;;
6481
6482 *) ;; # Ignore the rest.
6483
6484 esac
6485 done
6486
6487 # Clean up.
6488 rm -f a.out a.exe
6489 else
6490 echo "libtool.m4: error: problem compiling $1 test program"
6491 fi
6492
6493 $RM -f confest.$objext
6494
6495 # PORTME: override above test on systems where it is broken
6496 m4_if([$1], [CXX],
6497 [case $host_os in
6498 interix[[3-9]]*)
6499 # Interix 3.5 installs completely hosed .la files for C++, so rather than
6500 # hack all around it, let's just trust "g++" to DTRT.
6501 _LT_TAGVAR(predep_objects,$1)=
6502 _LT_TAGVAR(postdep_objects,$1)=
6503 _LT_TAGVAR(postdeps,$1)=
6504 ;;
6505
6506 linux*)
6507 case `$CC -V 2>&1 | sed 5q` in
6508 *Sun\ C*)
6509 # Sun C++ 5.9
6510
6511 # The more standards-conforming stlport4 library is
6512 # incompatible with the Cstd library. Avoid specifying
6513 # it if it's in CXXFLAGS. Ignore libCrun as
6514 # -library=stlport4 depends on it.
6515 case " $CXX $CXXFLAGS " in
6516 *" -library=stlport4 "*)
6517 solaris_use_stlport4=yes
6518 ;;
6519 esac
6520
6521 if test "$solaris_use_stlport4" != yes; then
6522 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6523 fi
6524 ;;
6525 esac
6526 ;;
6527
6528 solaris*)
6529 case $cc_basename in
6530 CC*)
6531 # The more standards-conforming stlport4 library is
6532 # incompatible with the Cstd library. Avoid specifying
6533 # it if it's in CXXFLAGS. Ignore libCrun as
6534 # -library=stlport4 depends on it.
6535 case " $CXX $CXXFLAGS " in
6536 *" -library=stlport4 "*)
6537 solaris_use_stlport4=yes
6538 ;;
6539 esac
6540
6541 # Adding this requires a known-good setup of shared libraries for
6542 # Sun compiler versions before 5.6, else PIC objects from an old
6543 # archive will be linked into the output, leading to subtle bugs.
6544 if test "$solaris_use_stlport4" != yes; then
6545 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6546 fi
6547 ;;
6548 esac
6549 ;;
6550 esac
6551 ])
6552
6553 case " $_LT_TAGVAR(postdeps, $1) " in
6554 *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6555 esac
6556 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
6557 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
6558 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
6559 fi
6560 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
6561 [The directories searched by this compiler when creating a shared library])
6562 _LT_TAGDECL([], [predep_objects], [1],
6563 [Dependencies to place before and after the objects being linked to
6564 create a shared library])
6565 _LT_TAGDECL([], [postdep_objects], [1])
6566 _LT_TAGDECL([], [predeps], [1])
6567 _LT_TAGDECL([], [postdeps], [1])
6568 _LT_TAGDECL([], [compiler_lib_search_path], [1],
6569 [The library search path used internally by the compiler when linking
6570 a shared library])
6571 ])# _LT_SYS_HIDDEN_LIBDEPS
6572
6573
6574 # _LT_PROG_F77
6575 # ------------
6576 # Since AC_PROG_F77 is broken, in that it returns the empty string
6577 # if there is no fortran compiler, we have our own version here.
6578 m4_defun([_LT_PROG_F77],
6579 [
6580 pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
6581 AC_PROG_F77
6582 if test -z "$F77" || test "X$F77" = "Xno"; then
6583 _lt_disable_F77=yes
6584 fi
6585 popdef([AC_MSG_ERROR])
6586 ])# _LT_PROG_F77
6587
6588 dnl aclocal-1.4 backwards compatibility:
6589 dnl AC_DEFUN([_LT_PROG_F77], [])
6590
6591
6592 # _LT_LANG_F77_CONFIG([TAG])
6593 # --------------------------
6594 # Ensure that the configuration variables for a Fortran 77 compiler are
6595 # suitably defined. These variables are subsequently used by _LT_CONFIG
6596 # to write the compiler configuration to `libtool'.
6597 m4_defun([_LT_LANG_F77_CONFIG],
6598 [AC_REQUIRE([_LT_PROG_F77])dnl
6599 AC_LANG_PUSH(Fortran 77)
6600
6601 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6602 _LT_TAGVAR(allow_undefined_flag, $1)=
6603 _LT_TAGVAR(always_export_symbols, $1)=no
6604 _LT_TAGVAR(archive_expsym_cmds, $1)=
6605 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6606 _LT_TAGVAR(hardcode_direct, $1)=no
6607 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6608 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6609 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6610 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6611 _LT_TAGVAR(hardcode_minus_L, $1)=no
6612 _LT_TAGVAR(hardcode_automatic, $1)=no
6613 _LT_TAGVAR(inherit_rpath, $1)=no
6614 _LT_TAGVAR(module_cmds, $1)=
6615 _LT_TAGVAR(module_expsym_cmds, $1)=
6616 _LT_TAGVAR(link_all_deplibs, $1)=unknown
6617 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6618 _LT_TAGVAR(no_undefined_flag, $1)=
6619 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6620 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6621
6622 # Source file extension for f77 test sources.
6623 ac_ext=f
6624
6625 # Object file extension for compiled f77 test sources.
6626 objext=o
6627 _LT_TAGVAR(objext, $1)=$objext
6628
6629 # No sense in running all these tests if we already determined that
6630 # the F77 compiler isn't working. Some variables (like enable_shared)
6631 # are currently assumed to apply to all compilers on this platform,
6632 # and will be corrupted by setting them based on a non-working compiler.
6633 if test "$_lt_disable_F77" != yes; then
6634 # Code to be used in simple compile tests
6635 lt_simple_compile_test_code="\
6636 subroutine t
6637 return
6638 end
6639 "
6640
6641 # Code to be used in simple link tests
6642 lt_simple_link_test_code="\
6643 program t
6644 end
6645 "
6646
6647 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6648 _LT_TAG_COMPILER
6649
6650 # save warnings/boilerplate of simple test code
6651 _LT_COMPILER_BOILERPLATE
6652 _LT_LINKER_BOILERPLATE
6653
6654 # Allow CC to be a program name with arguments.
6655 lt_save_CC="$CC"
6656 lt_save_GCC=$GCC
6657 CC=${F77-"f77"}
6658 compiler=$CC
6659 _LT_TAGVAR(compiler, $1)=$CC
6660 _LT_CC_BASENAME([$compiler])
6661 GCC=$G77
6662 if test -n "$compiler"; then
6663 AC_MSG_CHECKING([if libtool supports shared libraries])
6664 AC_MSG_RESULT([$can_build_shared])
6665
6666 AC_MSG_CHECKING([whether to build shared libraries])
6667 test "$can_build_shared" = "no" && enable_shared=no
6668
6669 # On AIX, shared libraries and static libraries use the same namespace, and
6670 # are all built from PIC.
6671 case $host_os in
6672 aix3*)
6673 test "$enable_shared" = yes && enable_static=no
6674 if test -n "$RANLIB"; then
6675 archive_cmds="$archive_cmds~\$RANLIB \$lib"
6676 postinstall_cmds='$RANLIB $lib'
6677 fi
6678 ;;
6679 aix[[4-9]]*)
6680 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6681 test "$enable_shared" = yes && enable_static=no
6682 fi
6683 ;;
6684 esac
6685 AC_MSG_RESULT([$enable_shared])
6686
6687 AC_MSG_CHECKING([whether to build static libraries])
6688 # Make sure either enable_shared or enable_static is yes.
6689 test "$enable_shared" = yes || enable_static=yes
6690 AC_MSG_RESULT([$enable_static])
6691
6692 _LT_TAGVAR(GCC, $1)="$G77"
6693 _LT_TAGVAR(LD, $1)="$LD"
6694
6695 ## CAVEAT EMPTOR:
6696 ## There is no encapsulation within the following macros, do not change
6697 ## the running order or otherwise move them around unless you know exactly
6698 ## what you are doing...
6699 _LT_COMPILER_PIC($1)
6700 _LT_COMPILER_C_O($1)
6701 _LT_COMPILER_FILE_LOCKS($1)
6702 _LT_LINKER_SHLIBS($1)
6703 _LT_SYS_DYNAMIC_LINKER($1)
6704 _LT_LINKER_HARDCODE_LIBPATH($1)
6705
6706 _LT_CONFIG($1)
6707 fi # test -n "$compiler"
6708
6709 GCC=$lt_save_GCC
6710 CC="$lt_save_CC"
6711 fi # test "$_lt_disable_F77" != yes
6712
6713 AC_LANG_POP
6714 ])# _LT_LANG_F77_CONFIG
6715
6716
6717 # _LT_PROG_FC
6718 # -----------
6719 # Since AC_PROG_FC is broken, in that it returns the empty string
6720 # if there is no fortran compiler, we have our own version here.
6721 m4_defun([_LT_PROG_FC],
6722 [
6723 pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
6724 AC_PROG_FC
6725 if test -z "$FC" || test "X$FC" = "Xno"; then
6726 _lt_disable_FC=yes
6727 fi
6728 popdef([AC_MSG_ERROR])
6729 ])# _LT_PROG_FC
6730
6731 dnl aclocal-1.4 backwards compatibility:
6732 dnl AC_DEFUN([_LT_PROG_FC], [])
6733
6734
6735 # _LT_LANG_FC_CONFIG([TAG])
6736 # -------------------------
6737 # Ensure that the configuration variables for a Fortran compiler are
6738 # suitably defined. These variables are subsequently used by _LT_CONFIG
6739 # to write the compiler configuration to `libtool'.
6740 m4_defun([_LT_LANG_FC_CONFIG],
6741 [AC_REQUIRE([_LT_PROG_FC])dnl
6742 AC_LANG_PUSH(Fortran)
6743
6744 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6745 _LT_TAGVAR(allow_undefined_flag, $1)=
6746 _LT_TAGVAR(always_export_symbols, $1)=no
6747 _LT_TAGVAR(archive_expsym_cmds, $1)=
6748 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6749 _LT_TAGVAR(hardcode_direct, $1)=no
6750 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6751 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6752 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6753 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6754 _LT_TAGVAR(hardcode_minus_L, $1)=no
6755 _LT_TAGVAR(hardcode_automatic, $1)=no
6756 _LT_TAGVAR(inherit_rpath, $1)=no
6757 _LT_TAGVAR(module_cmds, $1)=
6758 _LT_TAGVAR(module_expsym_cmds, $1)=
6759 _LT_TAGVAR(link_all_deplibs, $1)=unknown
6760 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6761 _LT_TAGVAR(no_undefined_flag, $1)=
6762 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6763 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6764
6765 # Source file extension for fc test sources.
6766 ac_ext=${ac_fc_srcext-f}
6767
6768 # Object file extension for compiled fc test sources.
6769 objext=o
6770 _LT_TAGVAR(objext, $1)=$objext
6771
6772 # No sense in running all these tests if we already determined that
6773 # the FC compiler isn't working. Some variables (like enable_shared)
6774 # are currently assumed to apply to all compilers on this platform,
6775 # and will be corrupted by setting them based on a non-working compiler.
6776 if test "$_lt_disable_FC" != yes; then
6777 # Code to be used in simple compile tests
6778 lt_simple_compile_test_code="\
6779 subroutine t
6780 return
6781 end
6782 "
6783
6784 # Code to be used in simple link tests
6785 lt_simple_link_test_code="\
6786 program t
6787 end
6788 "
6789
6790 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6791 _LT_TAG_COMPILER
6792
6793 # save warnings/boilerplate of simple test code
6794 _LT_COMPILER_BOILERPLATE
6795 _LT_LINKER_BOILERPLATE
6796
6797 # Allow CC to be a program name with arguments.
6798 lt_save_CC="$CC"
6799 lt_save_GCC=$GCC
6800 CC=${FC-"f95"}
6801 compiler=$CC
6802 GCC=$ac_cv_fc_compiler_gnu
6803
6804 _LT_TAGVAR(compiler, $1)=$CC
6805 _LT_CC_BASENAME([$compiler])
6806
6807 if test -n "$compiler"; then
6808 AC_MSG_CHECKING([if libtool supports shared libraries])
6809 AC_MSG_RESULT([$can_build_shared])
6810
6811 AC_MSG_CHECKING([whether to build shared libraries])
6812 test "$can_build_shared" = "no" && enable_shared=no
6813
6814 # On AIX, shared libraries and static libraries use the same namespace, and
6815 # are all built from PIC.
6816 case $host_os in
6817 aix3*)
6818 test "$enable_shared" = yes && enable_static=no
6819 if test -n "$RANLIB"; then
6820 archive_cmds="$archive_cmds~\$RANLIB \$lib"
6821 postinstall_cmds='$RANLIB $lib'
6822 fi
6823 ;;
6824 aix[[4-9]]*)
6825 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6826 test "$enable_shared" = yes && enable_static=no
6827 fi
6828 ;;
6829 esac
6830 AC_MSG_RESULT([$enable_shared])
6831
6832 AC_MSG_CHECKING([whether to build static libraries])
6833 # Make sure either enable_shared or enable_static is yes.
6834 test "$enable_shared" = yes || enable_static=yes
6835 AC_MSG_RESULT([$enable_static])
6836
6837 _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
6838 _LT_TAGVAR(LD, $1)="$LD"
6839
6840 ## CAVEAT EMPTOR:
6841 ## There is no encapsulation within the following macros, do not change
6842 ## the running order or otherwise move them around unless you know exactly
6843 ## what you are doing...
6844 _LT_SYS_HIDDEN_LIBDEPS($1)
6845 _LT_COMPILER_PIC($1)
6846 _LT_COMPILER_C_O($1)
6847 _LT_COMPILER_FILE_LOCKS($1)
6848 _LT_LINKER_SHLIBS($1)
6849 _LT_SYS_DYNAMIC_LINKER($1)
6850 _LT_LINKER_HARDCODE_LIBPATH($1)
6851
6852 _LT_CONFIG($1)
6853 fi # test -n "$compiler"
6854
6855 GCC=$lt_save_GCC
6856 CC="$lt_save_CC"
6857 fi # test "$_lt_disable_FC" != yes
6858
6859 AC_LANG_POP
6860 ])# _LT_LANG_FC_CONFIG
6861
6862
6863 # _LT_LANG_GCJ_CONFIG([TAG])
6864 # --------------------------
6865 # Ensure that the configuration variables for the GNU Java Compiler compiler
6866 # are suitably defined. These variables are subsequently used by _LT_CONFIG
6867 # to write the compiler configuration to `libtool'.
6868 m4_defun([_LT_LANG_GCJ_CONFIG],
6869 [AC_REQUIRE([LT_PROG_GCJ])dnl
6870 AC_LANG_SAVE
6871
6872 # Source file extension for Java test sources.
6873 ac_ext=java
6874
6875 # Object file extension for compiled Java test sources.
6876 objext=o
6877 _LT_TAGVAR(objext, $1)=$objext
6878
6879 # Code to be used in simple compile tests
6880 lt_simple_compile_test_code="class foo {}"
6881
6882 # Code to be used in simple link tests
6883 lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
6884
6885 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6886 _LT_TAG_COMPILER
6887
6888 # save warnings/boilerplate of simple test code
6889 _LT_COMPILER_BOILERPLATE
6890 _LT_LINKER_BOILERPLATE
6891
6892 # Allow CC to be a program name with arguments.
6893 lt_save_CC="$CC"
6894 lt_save_GCC=$GCC
6895 GCC=yes
6896 CC=${GCJ-"gcj"}
6897 compiler=$CC
6898 _LT_TAGVAR(compiler, $1)=$CC
6899 _LT_TAGVAR(LD, $1)="$LD"
6900 _LT_CC_BASENAME([$compiler])
6901
6902 # GCJ did not exist at the time GCC didn't implicitly link libc in.
6903 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6904
6905 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6906
6907 ## CAVEAT EMPTOR:
6908 ## There is no encapsulation within the following macros, do not change
6909 ## the running order or otherwise move them around unless you know exactly
6910 ## what you are doing...
6911 if test -n "$compiler"; then
6912 _LT_COMPILER_NO_RTTI($1)
6913 _LT_COMPILER_PIC($1)
6914 _LT_COMPILER_C_O($1)
6915 _LT_COMPILER_FILE_LOCKS($1)
6916 _LT_LINKER_SHLIBS($1)
6917 _LT_LINKER_HARDCODE_LIBPATH($1)
6918
6919 _LT_CONFIG($1)
6920 fi
6921
6922 AC_LANG_RESTORE
6923
6924 GCC=$lt_save_GCC
6925 CC="$lt_save_CC"
6926 ])# _LT_LANG_GCJ_CONFIG
6927
6928
6929 # _LT_LANG_RC_CONFIG([TAG])
6930 # -------------------------
6931 # Ensure that the configuration variables for the Windows resource compiler
6932 # are suitably defined. These variables are subsequently used by _LT_CONFIG
6933 # to write the compiler configuration to `libtool'.
6934 m4_defun([_LT_LANG_RC_CONFIG],
6935 [AC_REQUIRE([LT_PROG_RC])dnl
6936 AC_LANG_SAVE
6937
6938 # Source file extension for RC test sources.
6939 ac_ext=rc
6940
6941 # Object file extension for compiled RC test sources.
6942 objext=o
6943 _LT_TAGVAR(objext, $1)=$objext
6944
6945 # Code to be used in simple compile tests
6946 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
6947
6948 # Code to be used in simple link tests
6949 lt_simple_link_test_code="$lt_simple_compile_test_code"
6950
6951 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6952 _LT_TAG_COMPILER
6953
6954 # save warnings/boilerplate of simple test code
6955 _LT_COMPILER_BOILERPLATE
6956 _LT_LINKER_BOILERPLATE
6957
6958 # Allow CC to be a program name with arguments.
6959 lt_save_CC="$CC"
6960 lt_save_GCC=$GCC
6961 GCC=
6962 CC=${RC-"windres"}
6963 compiler=$CC
6964 _LT_TAGVAR(compiler, $1)=$CC
6965 _LT_CC_BASENAME([$compiler])
6966 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6967
6968 if test -n "$compiler"; then
6969 :
6970 _LT_CONFIG($1)
6971 fi
6972
6973 GCC=$lt_save_GCC
6974 AC_LANG_RESTORE
6975 CC="$lt_save_CC"
6976 ])# _LT_LANG_RC_CONFIG
6977
6978
6979 # LT_PROG_GCJ
6980 # -----------
6981 AC_DEFUN([LT_PROG_GCJ],
6982 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
6983 [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
6984 [AC_CHECK_TOOL(GCJ, gcj,)
6985 test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6986 AC_SUBST(GCJFLAGS)])])[]dnl
6987 ])
6988
6989 # Old name:
6990 AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
6991 dnl aclocal-1.4 backwards compatibility:
6992 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
6993
6994
6995 # LT_PROG_RC
6996 # ----------
6997 AC_DEFUN([LT_PROG_RC],
6998 [AC_CHECK_TOOL(RC, windres,)
6999 ])
7000
7001 # Old name:
7002 AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7003 dnl aclocal-1.4 backwards compatibility:
7004 dnl AC_DEFUN([LT_AC_PROG_RC], [])
7005
7006
7007 # _LT_DECL_EGREP
7008 # --------------
7009 # If we don't have a new enough Autoconf to choose the best grep
7010 # available, choose the one first in the user's PATH.
7011 m4_defun([_LT_DECL_EGREP],
7012 [AC_REQUIRE([AC_PROG_EGREP])dnl
7013 AC_REQUIRE([AC_PROG_FGREP])dnl
7014 test -z "$GREP" && GREP=grep
7015 _LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7016 _LT_DECL([], [EGREP], [1], [An ERE matcher])
7017 _LT_DECL([], [FGREP], [1], [A literal string matcher])
7018 dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7019 AC_SUBST([GREP])
7020 ])
7021
7022
7023 # _LT_DECL_OBJDUMP
7024 # --------------
7025 # If we don't have a new enough Autoconf to choose the best objdump
7026 # available, choose the one first in the user's PATH.
7027 m4_defun([_LT_DECL_OBJDUMP],
7028 [AC_CHECK_TOOL(OBJDUMP, objdump, false)
7029 test -z "$OBJDUMP" && OBJDUMP=objdump
7030 _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7031 AC_SUBST([OBJDUMP])
7032 ])
7033
7034
7035 # _LT_DECL_SED
7036 # ------------
7037 # Check for a fully-functional sed program, that truncates
7038 # as few characters as possible. Prefer GNU sed if found.
7039 m4_defun([_LT_DECL_SED],
7040 [AC_PROG_SED
7041 test -z "$SED" && SED=sed
7042 Xsed="$SED -e 1s/^X//"
7043 _LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7044 _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7045 [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7046 ])# _LT_DECL_SED
7047
7048 m4_ifndef([AC_PROG_SED], [
7049 ############################################################
7050 # NOTE: This macro has been submitted for inclusion into #
7051 # GNU Autoconf as AC_PROG_SED. When it is available in #
7052 # a released version of Autoconf we should remove this #
7053 # macro and use it instead. #
7054 ############################################################
7055
7056 m4_defun([AC_PROG_SED],
7057 [AC_MSG_CHECKING([for a sed that does not truncate output])
7058 AC_CACHE_VAL(lt_cv_path_SED,
7059 [# Loop through the user's path and test for sed and gsed.
7060 # Then use that list of sed's as ones to test for truncation.
7061 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7062 for as_dir in $PATH
7063 do
7064 IFS=$as_save_IFS
7065 test -z "$as_dir" && as_dir=.
7066 for lt_ac_prog in sed gsed; do
7067 for ac_exec_ext in '' $ac_executable_extensions; do
7068 if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7069 lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7070 fi
7071 done
7072 done
7073 done
7074 IFS=$as_save_IFS
7075 lt_ac_max=0
7076 lt_ac_count=0
7077 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
7078 # along with /bin/sed that truncates output.
7079 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7080 test ! -f $lt_ac_sed && continue
7081 cat /dev/null > conftest.in
7082 lt_ac_count=0
7083 echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7084 # Check for GNU sed and select it if it is found.
7085 if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7086 lt_cv_path_SED=$lt_ac_sed
7087 break
7088 fi
7089 while true; do
7090 cat conftest.in conftest.in >conftest.tmp
7091 mv conftest.tmp conftest.in
7092 cp conftest.in conftest.nl
7093 echo >>conftest.nl
7094 $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7095 cmp -s conftest.out conftest.nl || break
7096 # 10000 chars as input seems more than enough
7097 test $lt_ac_count -gt 10 && break
7098 lt_ac_count=`expr $lt_ac_count + 1`
7099 if test $lt_ac_count -gt $lt_ac_max; then
7100 lt_ac_max=$lt_ac_count
7101 lt_cv_path_SED=$lt_ac_sed
7102 fi
7103 done
7104 done
7105 ])
7106 SED=$lt_cv_path_SED
7107 AC_SUBST([SED])
7108 AC_MSG_RESULT([$SED])
7109 ])#AC_PROG_SED
7110 ])#m4_ifndef
7111
7112 # Old name:
7113 AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7114 dnl aclocal-1.4 backwards compatibility:
7115 dnl AC_DEFUN([LT_AC_PROG_SED], [])
7116
7117
7118 # _LT_CHECK_SHELL_FEATURES
7119 # ------------------------
7120 # Find out whether the shell is Bourne or XSI compatible,
7121 # or has some other useful features.
7122 m4_defun([_LT_CHECK_SHELL_FEATURES],
7123 [AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7124 # Try some XSI features
7125 xsi_shell=no
7126 ( _lt_dummy="a/b/c"
7127 test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
7128 = c,a/b,, \
7129 && eval 'test $(( 1 + 1 )) -eq 2 \
7130 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7131 && xsi_shell=yes
7132 AC_MSG_RESULT([$xsi_shell])
7133 _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7134
7135 AC_MSG_CHECKING([whether the shell understands "+="])
7136 lt_shell_append=no
7137 ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7138 >/dev/null 2>&1 \
7139 && lt_shell_append=yes
7140 AC_MSG_RESULT([$lt_shell_append])
7141 _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7142
7143 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7144 lt_unset=unset
7145 else
7146 lt_unset=false
7147 fi
7148 _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7149
7150 # test EBCDIC or ASCII
7151 case `echo X|tr X '\101'` in
7152 A) # ASCII based system
7153 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7154 lt_SP2NL='tr \040 \012'
7155 lt_NL2SP='tr \015\012 \040\040'
7156 ;;
7157 *) # EBCDIC based system
7158 lt_SP2NL='tr \100 \n'
7159 lt_NL2SP='tr \r\n \100\100'
7160 ;;
7161 esac
7162 _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7163 _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7164 ])# _LT_CHECK_SHELL_FEATURES
7165
7166
7167 # _LT_PROG_XSI_SHELLFNS
7168 # ---------------------
7169 # Bourne and XSI compatible variants of some useful shell functions.
7170 m4_defun([_LT_PROG_XSI_SHELLFNS],
7171 [case $xsi_shell in
7172 yes)
7173 cat << \_LT_EOF >> "$cfgfile"
7174
7175 # func_dirname file append nondir_replacement
7176 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
7177 # otherwise set result to NONDIR_REPLACEMENT.
7178 func_dirname ()
7179 {
7180 case ${1} in
7181 */*) func_dirname_result="${1%/*}${2}" ;;
7182 * ) func_dirname_result="${3}" ;;
7183 esac
7184 }
7185
7186 # func_basename file
7187 func_basename ()
7188 {
7189 func_basename_result="${1##*/}"
7190 }
7191
7192 # func_dirname_and_basename file append nondir_replacement
7193 # perform func_basename and func_dirname in a single function
7194 # call:
7195 # dirname: Compute the dirname of FILE. If nonempty,
7196 # add APPEND to the result, otherwise set result
7197 # to NONDIR_REPLACEMENT.
7198 # value returned in "$func_dirname_result"
7199 # basename: Compute filename of FILE.
7200 # value retuned in "$func_basename_result"
7201 # Implementation must be kept synchronized with func_dirname
7202 # and func_basename. For efficiency, we do not delegate to
7203 # those functions but instead duplicate the functionality here.
7204 func_dirname_and_basename ()
7205 {
7206 case ${1} in
7207 */*) func_dirname_result="${1%/*}${2}" ;;
7208 * ) func_dirname_result="${3}" ;;
7209 esac
7210 func_basename_result="${1##*/}"
7211 }
7212
7213 # func_stripname prefix suffix name
7214 # strip PREFIX and SUFFIX off of NAME.
7215 # PREFIX and SUFFIX must not contain globbing or regex special
7216 # characters, hashes, percent signs, but SUFFIX may contain a leading
7217 # dot (in which case that matches only a dot).
7218 func_stripname ()
7219 {
7220 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7221 # positional parameters, so assign one to ordinary parameter first.
7222 func_stripname_result=${3}
7223 func_stripname_result=${func_stripname_result#"${1}"}
7224 func_stripname_result=${func_stripname_result%"${2}"}
7225 }
7226
7227 # func_opt_split
7228 func_opt_split ()
7229 {
7230 func_opt_split_opt=${1%%=*}
7231 func_opt_split_arg=${1#*=}
7232 }
7233
7234 # func_lo2o object
7235 func_lo2o ()
7236 {
7237 case ${1} in
7238 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7239 *) func_lo2o_result=${1} ;;
7240 esac
7241 }
7242
7243 # func_xform libobj-or-source
7244 func_xform ()
7245 {
7246 func_xform_result=${1%.*}.lo
7247 }
7248
7249 # func_arith arithmetic-term...
7250 func_arith ()
7251 {
7252 func_arith_result=$(( $[*] ))
7253 }
7254
7255 # func_len string
7256 # STRING may not start with a hyphen.
7257 func_len ()
7258 {
7259 func_len_result=${#1}
7260 }
7261
7262 _LT_EOF
7263 ;;
7264 *) # Bourne compatible functions.
7265 cat << \_LT_EOF >> "$cfgfile"
7266
7267 # func_dirname file append nondir_replacement
7268 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
7269 # otherwise set result to NONDIR_REPLACEMENT.
7270 func_dirname ()
7271 {
7272 # Extract subdirectory from the argument.
7273 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
7274 if test "X$func_dirname_result" = "X${1}"; then
7275 func_dirname_result="${3}"
7276 else
7277 func_dirname_result="$func_dirname_result${2}"
7278 fi
7279 }
7280
7281 # func_basename file
7282 func_basename ()
7283 {
7284 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
7285 }
7286
7287 dnl func_dirname_and_basename
7288 dnl A portable version of this function is already defined in general.m4sh
7289 dnl so there is no need for it here.
7290
7291 # func_stripname prefix suffix name
7292 # strip PREFIX and SUFFIX off of NAME.
7293 # PREFIX and SUFFIX must not contain globbing or regex special
7294 # characters, hashes, percent signs, but SUFFIX may contain a leading
7295 # dot (in which case that matches only a dot).
7296 # func_strip_suffix prefix name
7297 func_stripname ()
7298 {
7299 case ${2} in
7300 .*) func_stripname_result=`$ECHO "X${3}" \
7301 | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
7302 *) func_stripname_result=`$ECHO "X${3}" \
7303 | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
7304 esac
7305 }
7306
7307 # sed scripts:
7308 my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
7309 my_sed_long_arg='1s/^-[[^=]]*=//'
7310
7311 # func_opt_split
7312 func_opt_split ()
7313 {
7314 func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
7315 func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
7316 }
7317
7318 # func_lo2o object
7319 func_lo2o ()
7320 {
7321 func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
7322 }
7323
7324 # func_xform libobj-or-source
7325 func_xform ()
7326 {
7327 func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
7328 }
7329
7330 # func_arith arithmetic-term...
7331 func_arith ()
7332 {
7333 func_arith_result=`expr "$[@]"`
7334 }
7335
7336 # func_len string
7337 # STRING may not start with a hyphen.
7338 func_len ()
7339 {
7340 func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
7341 }
7342
7343 _LT_EOF
7344 esac
7345
7346 case $lt_shell_append in
7347 yes)
7348 cat << \_LT_EOF >> "$cfgfile"
7349
7350 # func_append var value
7351 # Append VALUE to the end of shell variable VAR.
7352 func_append ()
7353 {
7354 eval "$[1]+=\$[2]"
7355 }
7356 _LT_EOF
7357 ;;
7358 *)
7359 cat << \_LT_EOF >> "$cfgfile"
7360
7361 # func_append var value
7362 # Append VALUE to the end of shell variable VAR.
7363 func_append ()
7364 {
7365 eval "$[1]=\$$[1]\$[2]"
7366 }
7367
7368 _LT_EOF
7369 ;;
7370 esac
7371 ])
7372
7373 ##############################################################################
7374 # ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
7375 #
7376 # Copyright (C) 1999-2006, 2007, 2008 Free Software Foundation, Inc.
7377 # Written by Thomas Tanner, 1999
7378 #
7379 # This file is free software; the Free Software Foundation gives
7380 # unlimited permission to copy and/or distribute it, with or without
7381 # modifications, as long as this notice is preserved.
7382
7383 # serial 17 LTDL_INIT
7384
7385 # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE])
7386 # ------------------------------------------
7387 # DIRECTORY contains the libltdl sources. It is okay to call this
7388 # function multiple times, as long as the same DIRECTORY is always given.
7389 AC_DEFUN([LT_CONFIG_LTDL_DIR],
7390 [AC_BEFORE([$0], [LTDL_INIT])
7391 _$0($*)
7392 ])# LT_CONFIG_LTDL_DIR
7393
7394 # We break this out into a separate macro, so that we can call it safely
7395 # internally without being caught accidentally by the sed scan in libtoolize.
7396 m4_defun([_LT_CONFIG_LTDL_DIR],
7397 [dnl remove trailing slashes
7398 m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$]))
7399 m4_case(_LTDL_DIR,
7400 [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.'
7401 m4_if(_ARG_DIR, [.],
7402 [],
7403 [m4_define([_LTDL_DIR], _ARG_DIR)
7404 _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])],
7405 [m4_if(_ARG_DIR, _LTDL_DIR,
7406 [],
7407 [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])])
7408 m4_popdef([_ARG_DIR])
7409 ])# _LT_CONFIG_LTDL_DIR
7410
7411 # Initialise:
7412 m4_define([_LTDL_DIR], [])
7413
7414
7415 # _LT_BUILD_PREFIX
7416 # ----------------
7417 # If Autoconf is new enough, expand to `${top_build_prefix}', otherwise
7418 # to `${top_builddir}/'.
7419 m4_define([_LT_BUILD_PREFIX],
7420 [m4_ifdef([AC_AUTOCONF_VERSION],
7421 [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]),
7422 [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX],
7423 [${top_build_prefix}],
7424 [${top_builddir}/])],
7425 [${top_build_prefix}])],
7426 [${top_builddir}/])[]dnl
7427 ])
7428
7429
7430 # LTDL_CONVENIENCE
7431 # ----------------
7432 # sets LIBLTDL to the link flags for the libltdl convenience library and
7433 # LTDLINCL to the include flags for the libltdl header and adds
7434 # --enable-ltdl-convenience to the configure arguments. Note that
7435 # AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with
7436 # '${top_build_prefix}' if available, otherwise with '${top_builddir}/',
7437 # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
7438 # quotes!). If your package is not flat and you're not using automake,
7439 # define top_build_prefix, top_builddir, and top_srcdir appropriately
7440 # in your Makefiles.
7441 AC_DEFUN([LTDL_CONVENIENCE],
7442 [AC_BEFORE([$0], [LTDL_INIT])dnl
7443 dnl Although the argument is deprecated and no longer documented,
7444 dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one
7445 dnl here make sure it is the same as any other declaration of libltdl's
7446 dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
7447 dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
7448 m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
7449 _$0()
7450 ])# LTDL_CONVENIENCE
7451
7452 # AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools,
7453 # now we have LT_CONFIG_LTDL_DIR:
7454 AU_DEFUN([AC_LIBLTDL_CONVENIENCE],
7455 [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
7456 _LTDL_CONVENIENCE])
7457
7458 dnl aclocal-1.4 backwards compatibility:
7459 dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [])
7460
7461
7462 # _LTDL_CONVENIENCE
7463 # -----------------
7464 # Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]).
7465 m4_defun([_LTDL_CONVENIENCE],
7466 [case $enable_ltdl_convenience in
7467 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
7468 "") enable_ltdl_convenience=yes
7469 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
7470 esac
7471 LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la"
7472 LTDLDEPS=$LIBLTDL
7473 LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
7474
7475 AC_SUBST([LIBLTDL])
7476 AC_SUBST([LTDLDEPS])
7477 AC_SUBST([LTDLINCL])
7478
7479 # For backwards non-gettext consistent compatibility...
7480 INCLTDL="$LTDLINCL"
7481 AC_SUBST([INCLTDL])
7482 ])# _LTDL_CONVENIENCE
7483
7484
7485 # LTDL_INSTALLABLE
7486 # ----------------
7487 # sets LIBLTDL to the link flags for the libltdl installable library
7488 # and LTDLINCL to the include flags for the libltdl header and adds
7489 # --enable-ltdl-install to the configure arguments. Note that
7490 # AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl
7491 # is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if
7492 # available, otherwise with '${top_builddir}/', and LTDLINCL will be
7493 # prefixed with '${top_srcdir}/' (note the single quotes!). If your
7494 # package is not flat and you're not using automake, define top_build_prefix,
7495 # top_builddir, and top_srcdir appropriately in your Makefiles.
7496 # In the future, this macro may have to be called after LT_INIT.
7497 AC_DEFUN([LTDL_INSTALLABLE],
7498 [AC_BEFORE([$0], [LTDL_INIT])dnl
7499 dnl Although the argument is deprecated and no longer documented,
7500 dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one
7501 dnl here make sure it is the same as any other declaration of libltdl's
7502 dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
7503 dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
7504 m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
7505 _$0()
7506 ])# LTDL_INSTALLABLE
7507
7508 # AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools,
7509 # now we have LT_CONFIG_LTDL_DIR:
7510 AU_DEFUN([AC_LIBLTDL_INSTALLABLE],
7511 [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
7512 _LTDL_INSTALLABLE])
7513
7514 dnl aclocal-1.4 backwards compatibility:
7515 dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [])
7516
7517
7518 # _LTDL_INSTALLABLE
7519 # -----------------
7520 # Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]).
7521 m4_defun([_LTDL_INSTALLABLE],
7522 [if test -f $prefix/lib/libltdl.la; then
7523 lt_save_LDFLAGS="$LDFLAGS"
7524 LDFLAGS="-L$prefix/lib $LDFLAGS"
7525 AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes])
7526 LDFLAGS="$lt_save_LDFLAGS"
7527 if test x"${lt_lib_ltdl-no}" = xyes; then
7528 if test x"$enable_ltdl_install" != xyes; then
7529 # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install
7530 AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install'])
7531 enable_ltdl_install=no
7532 fi
7533 elif test x"$enable_ltdl_install" = xno; then
7534 AC_MSG_WARN([libltdl not installed, but installation disabled])
7535 fi
7536 fi
7537
7538 # If configure.ac declared an installable ltdl, and the user didn't override
7539 # with --disable-ltdl-install, we will install the shipped libltdl.
7540 case $enable_ltdl_install in
7541 no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
7542 LIBLTDL="-lltdl"
7543 LTDLDEPS=
7544 LTDLINCL=
7545 ;;
7546 *) enable_ltdl_install=yes
7547 ac_configure_args="$ac_configure_args --enable-ltdl-install"
7548 LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la"
7549 LTDLDEPS=$LIBLTDL
7550 LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
7551 ;;
7552 esac
7553
7554 AC_SUBST([LIBLTDL])
7555 AC_SUBST([LTDLDEPS])
7556 AC_SUBST([LTDLINCL])
7557
7558 # For backwards non-gettext consistent compatibility...
7559 INCLTDL="$LTDLINCL"
7560 AC_SUBST([INCLTDL])
7561 ])# LTDL_INSTALLABLE
7562
7563
7564 # _LTDL_MODE_DISPATCH
7565 # -------------------
7566 m4_define([_LTDL_MODE_DISPATCH],
7567 [dnl If _LTDL_DIR is `.', then we are configuring libltdl itself:
7568 m4_if(_LTDL_DIR, [],
7569 [],
7570 dnl if _LTDL_MODE was not set already, the default value is `subproject':
7571 [m4_case(m4_default(_LTDL_MODE, [subproject]),
7572 [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR)
7573 _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])],
7574 [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])],
7575 [recursive], [],
7576 [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl
7577 dnl Be careful not to expand twice:
7578 m4_define([$0], [])
7579 ])# _LTDL_MODE_DISPATCH
7580
7581
7582 # _LT_LIBOBJ(MODULE_NAME)
7583 # -----------------------
7584 # Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead
7585 # of into LIBOBJS.
7586 AC_DEFUN([_LT_LIBOBJ], [
7587 m4_pattern_allow([^_LT_LIBOBJS$])
7588 _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext"
7589 ])# _LT_LIBOBJS
7590
7591
7592 # LTDL_INIT([OPTIONS])
7593 # --------------------
7594 # Clients of libltdl can use this macro to allow the installer to
7595 # choose between a shipped copy of the ltdl sources or a preinstalled
7596 # version of the library. If the shipped ltdl sources are not in a
7597 # subdirectory named libltdl, the directory name must be given by
7598 # LT_CONFIG_LTDL_DIR.
7599 AC_DEFUN([LTDL_INIT],
7600 [dnl Parse OPTIONS
7601 _LT_SET_OPTIONS([$0], [$1])
7602
7603 dnl We need to keep our own list of libobjs separate from our parent project,
7604 dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while
7605 dnl we look for our own LIBOBJs.
7606 m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ]))
7607 m4_pushdef([AC_LIBSOURCES])
7608
7609 dnl If not otherwise defined, default to the 1.5.x compatible subproject mode:
7610 m4_if(_LTDL_MODE, [],
7611 [m4_define([_LTDL_MODE], m4_default([$2], [subproject]))
7612 m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])],
7613 [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])
7614
7615 AC_ARG_WITH([included_ltdl],
7616 [AS_HELP_STRING([--with-included-ltdl],
7617 [use the GNU ltdl sources included here])])
7618
7619 if test "x$with_included_ltdl" != xyes; then
7620 # We are not being forced to use the included libltdl sources, so
7621 # decide whether there is a useful installed version we can use.
7622 AC_CHECK_HEADER([ltdl.h],
7623 [AC_CHECK_DECL([lt_dlinterface_register],
7624 [AC_CHECK_LIB([ltdl], [lt_dladvise_preload],
7625 [with_included_ltdl=no],
7626 [with_included_ltdl=yes])],
7627 [with_included_ltdl=yes],
7628 [AC_INCLUDES_DEFAULT
7629 #include <ltdl.h>])],
7630 [with_included_ltdl=yes],
7631 [AC_INCLUDES_DEFAULT]
7632 )
7633 fi
7634
7635 dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE
7636 dnl was called yet, then for old times' sake, we assume libltdl is in an
7637 dnl eponymous directory:
7638 AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])])
7639
7640 AC_ARG_WITH([ltdl_include],
7641 [AS_HELP_STRING([--with-ltdl-include=DIR],
7642 [use the ltdl headers installed in DIR])])
7643
7644 if test -n "$with_ltdl_include"; then
7645 if test -f "$with_ltdl_include/ltdl.h"; then :
7646 else
7647 AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include'])
7648 fi
7649 else
7650 with_ltdl_include=no
7651 fi
7652
7653 AC_ARG_WITH([ltdl_lib],
7654 [AS_HELP_STRING([--with-ltdl-lib=DIR],
7655 [use the libltdl.la installed in DIR])])
7656
7657 if test -n "$with_ltdl_lib"; then
7658 if test -f "$with_ltdl_lib/libltdl.la"; then :
7659 else
7660 AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib'])
7661 fi
7662 else
7663 with_ltdl_lib=no
7664 fi
7665
7666 case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in
7667 ,yes,no,no,)
7668 m4_case(m4_default(_LTDL_TYPE, [convenience]),
7669 [convenience], [_LTDL_CONVENIENCE],
7670 [installable], [_LTDL_INSTALLABLE],
7671 [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)])
7672 ;;
7673 ,no,no,no,)
7674 # If the included ltdl is not to be used, then use the
7675 # preinstalled libltdl we found.
7676 AC_DEFINE([HAVE_LTDL], [1],
7677 [Define this if a modern libltdl is already installed])
7678 LIBLTDL=-lltdl
7679 LTDLDEPS=
7680 LTDLINCL=
7681 ;;
7682 ,no*,no,*)
7683 AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together])
7684 ;;
7685 *) with_included_ltdl=no
7686 LIBLTDL="-L$with_ltdl_lib -lltdl"
7687 LTDLDEPS=
7688 LTDLINCL="-I$with_ltdl_include"
7689 ;;
7690 esac
7691 INCLTDL="$LTDLINCL"
7692
7693 # Report our decision...
7694 AC_MSG_CHECKING([where to find libltdl headers])
7695 AC_MSG_RESULT([$LTDLINCL])
7696 AC_MSG_CHECKING([where to find libltdl library])
7697 AC_MSG_RESULT([$LIBLTDL])
7698
7699 _LTDL_SETUP
7700
7701 dnl restore autoconf definition.
7702 m4_popdef([AC_LIBOBJ])
7703 m4_popdef([AC_LIBSOURCES])
7704
7705 AC_CONFIG_COMMANDS_PRE([
7706 _ltdl_libobjs=
7707 _ltdl_ltlibobjs=
7708 if test -n "$_LT_LIBOBJS"; then
7709 # Remove the extension.
7710 _lt_sed_drop_objext='s/\.o$//;s/\.obj$//'
7711 for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do
7712 _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext"
7713 _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo"
7714 done
7715 fi
7716 AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs])
7717 AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs])
7718 ])
7719
7720 # Only expand once:
7721 m4_define([LTDL_INIT])
7722 ])# LTDL_INIT
7723
7724 # Old names:
7725 AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)])
7726 AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)])
7727 AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)])
7728 dnl aclocal-1.4 backwards compatibility:
7729 dnl AC_DEFUN([AC_LIB_LTDL], [])
7730 dnl AC_DEFUN([AC_WITH_LTDL], [])
7731 dnl AC_DEFUN([LT_WITH_LTDL], [])
7732
7733
7734 # _LTDL_SETUP
7735 # -----------
7736 # Perform all the checks necessary for compilation of the ltdl objects
7737 # -- including compiler checks and header checks. This is a public
7738 # interface mainly for the benefit of libltdl's own configure.ac, most
7739 # other users should call LTDL_INIT instead.
7740 AC_DEFUN([_LTDL_SETUP],
7741 [AC_REQUIRE([AC_PROG_CC])dnl
7742 AC_REQUIRE([LT_SYS_MODULE_EXT])dnl
7743 AC_REQUIRE([LT_SYS_MODULE_PATH])dnl
7744 AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl
7745 AC_REQUIRE([LT_LIB_DLLOAD])dnl
7746 AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
7747 AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl
7748 AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl
7749 AC_REQUIRE([gl_FUNC_ARGZ])dnl
7750
7751 m4_require([_LT_CHECK_OBJDIR])dnl
7752 m4_require([_LT_HEADER_DLFCN])dnl
7753 m4_require([_LT_CHECK_DLPREOPEN])dnl
7754 m4_require([_LT_DECL_SED])dnl
7755
7756 dnl Don't require this, or it will be expanded earlier than the code
7757 dnl that sets the variables it relies on:
7758 _LT_ENABLE_INSTALL
7759
7760 dnl _LTDL_MODE specific code must be called at least once:
7761 _LTDL_MODE_DISPATCH
7762
7763 # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS
7764 # the user used. This is so that ltdl.h can pick up the parent projects
7765 # config.h file, The first file in AC_CONFIG_HEADERS must contain the
7766 # definitions required by ltdl.c.
7767 # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility).
7768 AC_CONFIG_COMMANDS_PRE([dnl
7769 m4_pattern_allow([^LT_CONFIG_H$])dnl
7770 m4_ifset([AH_HEADER],
7771 [LT_CONFIG_H=AH_HEADER],
7772 [m4_ifset([AC_LIST_HEADERS],
7773 [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`],
7774 [])])])
7775 AC_SUBST([LT_CONFIG_H])
7776
7777 AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h],
7778 [], [], [AC_INCLUDES_DEFAULT])
7779
7780 AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])])
7781 AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])])
7782
7783 AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension])
7784
7785 name=ltdl
7786 LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""`
7787 AC_SUBST([LTDLOPEN])
7788 ])# _LTDL_SETUP
7789
7790
7791 # _LT_ENABLE_INSTALL
7792 # ------------------
7793 m4_define([_LT_ENABLE_INSTALL],
7794 [AC_ARG_ENABLE([ltdl-install],
7795 [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])])
7796
7797 case ,${enable_ltdl_install},${enable_ltdl_convenience} in
7798 *yes*) ;;
7799 *) enable_ltdl_convenience=yes ;;
7800 esac
7801
7802 m4_ifdef([AM_CONDITIONAL],
7803 [AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
7804 AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)])
7805 ])# _LT_ENABLE_INSTALL
7806
7807
7808 # LT_SYS_DLOPEN_DEPLIBS
7809 # ---------------------
7810 AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS],
7811 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
7812 AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
7813 [lt_cv_sys_dlopen_deplibs],
7814 [# PORTME does your system automatically load deplibs for dlopen?
7815 # or its logical equivalent (e.g. shl_load for HP-UX < 11)
7816 # For now, we just catch OSes we know something about -- in the
7817 # future, we'll try test this programmatically.
7818 lt_cv_sys_dlopen_deplibs=unknown
7819 case $host_os in
7820 aix3*|aix4.1.*|aix4.2.*)
7821 # Unknown whether this is true for these versions of AIX, but
7822 # we want this `case' here to explicitly catch those versions.
7823 lt_cv_sys_dlopen_deplibs=unknown
7824 ;;
7825 aix[[4-9]]*)
7826 lt_cv_sys_dlopen_deplibs=yes
7827 ;;
7828 amigaos*)
7829 case $host_cpu in
7830 powerpc)
7831 lt_cv_sys_dlopen_deplibs=no
7832 ;;
7833 esac
7834 ;;
7835 darwin*)
7836 # Assuming the user has installed a libdl from somewhere, this is true
7837 # If you are looking for one http://www.opendarwin.org/projects/dlcompat
7838 lt_cv_sys_dlopen_deplibs=yes
7839 ;;
7840 freebsd* | dragonfly*)
7841 lt_cv_sys_dlopen_deplibs=yes
7842 ;;
7843 gnu* | linux* | k*bsd*-gnu)
7844 # GNU and its variants, using gnu ld.so (Glibc)
7845 lt_cv_sys_dlopen_deplibs=yes
7846 ;;
7847 hpux10*|hpux11*)
7848 lt_cv_sys_dlopen_deplibs=yes
7849 ;;
7850 interix*)
7851 lt_cv_sys_dlopen_deplibs=yes
7852 ;;
7853 irix[[12345]]*|irix6.[[01]]*)
7854 # Catch all versions of IRIX before 6.2, and indicate that we don't
7855 # know how it worked for any of those versions.
7856 lt_cv_sys_dlopen_deplibs=unknown
7857 ;;
7858 irix*)
7859 # The case above catches anything before 6.2, and it's known that
7860 # at 6.2 and later dlopen does load deplibs.
7861 lt_cv_sys_dlopen_deplibs=yes
7862 ;;
7863 netbsd*)
7864 lt_cv_sys_dlopen_deplibs=yes
7865 ;;
7866 openbsd*)
7867 lt_cv_sys_dlopen_deplibs=yes
7868 ;;
7869 osf[[1234]]*)
7870 # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
7871 # it did *not* use an RPATH in a shared library to find objects the
7872 # library depends on, so we explicitly say `no'.
7873 lt_cv_sys_dlopen_deplibs=no
7874 ;;
7875 osf5.0|osf5.0a|osf5.1)
7876 # dlopen *does* load deplibs and with the right loader patch applied
7877 # it even uses RPATH in a shared library to search for shared objects
7878 # that the library depends on, but there's no easy way to know if that
7879 # patch is installed. Since this is the case, all we can really
7880 # say is unknown -- it depends on the patch being installed. If
7881 # it is, this changes to `yes'. Without it, it would be `no'.
7882 lt_cv_sys_dlopen_deplibs=unknown
7883 ;;
7884 osf*)
7885 # the two cases above should catch all versions of osf <= 5.1. Read
7886 # the comments above for what we know about them.
7887 # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
7888 # is used to find them so we can finally say `yes'.
7889 lt_cv_sys_dlopen_deplibs=yes
7890 ;;
7891 qnx*)
7892 lt_cv_sys_dlopen_deplibs=yes
7893 ;;
7894 solaris*)
7895 lt_cv_sys_dlopen_deplibs=yes
7896 ;;
7897 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
7898 libltdl_cv_sys_dlopen_deplibs=yes
7899 ;;
7900 esac
7901 ])
7902 if test "$lt_cv_sys_dlopen_deplibs" != yes; then
7903 AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
7904 [Define if the OS needs help to load dependent libraries for dlopen().])
7905 fi
7906 ])# LT_SYS_DLOPEN_DEPLIBS
7907
7908 # Old name:
7909 AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS])
7910 dnl aclocal-1.4 backwards compatibility:
7911 dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [])
7912
7913
7914 # LT_SYS_MODULE_EXT
7915 # -----------------
7916 AC_DEFUN([LT_SYS_MODULE_EXT],
7917 [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
7918 AC_CACHE_CHECK([which extension is used for runtime loadable modules],
7919 [libltdl_cv_shlibext],
7920 [
7921 module=yes
7922 eval libltdl_cv_shlibext=$shrext_cmds
7923 ])
7924 if test -n "$libltdl_cv_shlibext"; then
7925 m4_pattern_allow([LT_MODULE_EXT])dnl
7926 AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"],
7927 [Define to the extension used for runtime loadable modules, say, ".so".])
7928 fi
7929 ])# LT_SYS_MODULE_EXT
7930
7931 # Old name:
7932 AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT])
7933 dnl aclocal-1.4 backwards compatibility:
7934 dnl AC_DEFUN([AC_LTDL_SHLIBEXT], [])
7935
7936
7937 # LT_SYS_MODULE_PATH
7938 # ------------------
7939 AC_DEFUN([LT_SYS_MODULE_PATH],
7940 [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
7941 AC_CACHE_CHECK([which variable specifies run-time module search path],
7942 [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"])
7943 if test -n "$lt_cv_module_path_var"; then
7944 m4_pattern_allow([LT_MODULE_PATH_VAR])dnl
7945 AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"],
7946 [Define to the name of the environment variable that determines the run-time module search path.])
7947 fi
7948 ])# LT_SYS_MODULE_PATH
7949
7950 # Old name:
7951 AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH])
7952 dnl aclocal-1.4 backwards compatibility:
7953 dnl AC_DEFUN([AC_LTDL_SHLIBPATH], [])
7954
7955
7956 # LT_SYS_DLSEARCH_PATH
7957 # --------------------
7958 AC_DEFUN([LT_SYS_DLSEARCH_PATH],
7959 [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
7960 AC_CACHE_CHECK([for the default library search path],
7961 [lt_cv_sys_dlsearch_path],
7962 [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"])
7963 if test -n "$lt_cv_sys_dlsearch_path"; then
7964 sys_dlsearch_path=
7965 for dir in $lt_cv_sys_dlsearch_path; do
7966 if test -z "$sys_dlsearch_path"; then
7967 sys_dlsearch_path="$dir"
7968 else
7969 sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir"
7970 fi
7971 done
7972 m4_pattern_allow([LT_DLSEARCH_PATH])dnl
7973 AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"],
7974 [Define to the system default library search path.])
7975 fi
7976 ])# LT_SYS_DLSEARCH_PATH
7977
7978 # Old name:
7979 AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH])
7980 dnl aclocal-1.4 backwards compatibility:
7981 dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [])
7982
7983
7984 # _LT_CHECK_DLPREOPEN
7985 # -------------------
7986 m4_defun([_LT_CHECK_DLPREOPEN],
7987 [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
7988 AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
7989 [libltdl_cv_preloaded_symbols],
7990 [if test -n "$lt_cv_sys_global_symbol_pipe"; then
7991 libltdl_cv_preloaded_symbols=yes
7992 else
7993 libltdl_cv_preloaded_symbols=no
7994 fi
7995 ])
7996 if test x"$libltdl_cv_preloaded_symbols" = xyes; then
7997 AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1],
7998 [Define if libtool can extract symbol lists from object files.])
7999 fi
8000 ])# _LT_CHECK_DLPREOPEN
8001
8002
8003 # LT_LIB_DLLOAD
8004 # -------------
8005 AC_DEFUN([LT_LIB_DLLOAD],
8006 [m4_pattern_allow([^LT_DLLOADERS$])
8007 LT_DLLOADERS=
8008 AC_SUBST([LT_DLLOADERS])
8009
8010 AC_LANG_PUSH([C])
8011
8012 LIBADD_DLOPEN=
8013 AC_SEARCH_LIBS([dlopen], [dl],
8014 [AC_DEFINE([HAVE_LIBDL], [1],
8015 [Define if you have the libdl library or equivalent.])
8016 if test "$ac_cv_search_dlopen" != "none required" ; then
8017 LIBADD_DLOPEN="-ldl"
8018 fi
8019 libltdl_cv_lib_dl_dlopen="yes"
8020 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
8021 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H
8022 # include <dlfcn.h>
8023 #endif
8024 ]], [[dlopen(0, 0);]])],
8025 [AC_DEFINE([HAVE_LIBDL], [1],
8026 [Define if you have the libdl library or equivalent.])
8027 libltdl_cv_func_dlopen="yes"
8028 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
8029 [AC_CHECK_LIB([svld], [dlopen],
8030 [AC_DEFINE([HAVE_LIBDL], [1],
8031 [Define if you have the libdl library or equivalent.])
8032 LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes"
8033 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])])
8034 if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
8035 then
8036 lt_save_LIBS="$LIBS"
8037 LIBS="$LIBS $LIBADD_DLOPEN"
8038 AC_CHECK_FUNCS([dlerror])
8039 LIBS="$lt_save_LIBS"
8040 fi
8041 AC_SUBST([LIBADD_DLOPEN])
8042
8043 LIBADD_SHL_LOAD=
8044 AC_CHECK_FUNC([shl_load],
8045 [AC_DEFINE([HAVE_SHL_LOAD], [1],
8046 [Define if you have the shl_load function.])
8047 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"],
8048 [AC_CHECK_LIB([dld], [shl_load],
8049 [AC_DEFINE([HAVE_SHL_LOAD], [1],
8050 [Define if you have the shl_load function.])
8051 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"
8052 LIBADD_SHL_LOAD="-ldld"])])
8053 AC_SUBST([LIBADD_SHL_LOAD])
8054
8055 case $host_os in
8056 darwin[[1567]].*)
8057 # We only want this for pre-Mac OS X 10.4.
8058 AC_CHECK_FUNC([_dyld_func_lookup],
8059 [AC_DEFINE([HAVE_DYLD], [1],
8060 [Define if you have the _dyld_func_lookup function.])
8061 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"])
8062 ;;
8063 beos*)
8064 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
8065 ;;
8066 cygwin* | mingw* | os2* | pw32*)
8067 AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include <sys/cygwin.h>]])
8068 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la"
8069 ;;
8070 esac
8071
8072 AC_CHECK_LIB([dld], [dld_link],
8073 [AC_DEFINE([HAVE_DLD], [1],
8074 [Define if you have the GNU dld library.])
8075 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"])
8076 AC_SUBST([LIBADD_DLD_LINK])
8077
8078 m4_pattern_allow([^LT_DLPREOPEN$])
8079 LT_DLPREOPEN=
8080 if test -n "$LT_DLLOADERS"
8081 then
8082 for lt_loader in $LT_DLLOADERS; do
8083 LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader "
8084 done
8085 AC_DEFINE([HAVE_LIBDLLOADER], [1],
8086 [Define if libdlloader will be built on this platform])
8087 fi
8088 AC_SUBST([LT_DLPREOPEN])
8089
8090 dnl This isn't used anymore, but set it for backwards compatibility
8091 LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD"
8092 AC_SUBST([LIBADD_DL])
8093
8094 AC_LANG_POP
8095 ])# LT_LIB_DLLOAD
8096
8097 # Old name:
8098 AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD])
8099 dnl aclocal-1.4 backwards compatibility:
8100 dnl AC_DEFUN([AC_LTDL_DLLIB], [])
8101
8102
8103 # LT_SYS_SYMBOL_USCORE
8104 # --------------------
8105 # does the compiler prefix global symbols with an underscore?
8106 AC_DEFUN([LT_SYS_SYMBOL_USCORE],
8107 [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
8108 AC_CACHE_CHECK([for _ prefix in compiled symbols],
8109 [lt_cv_sys_symbol_underscore],
8110 [lt_cv_sys_symbol_underscore=no
8111 cat > conftest.$ac_ext <<_LT_EOF
8112 void nm_test_func(){}
8113 int main(){nm_test_func;return 0;}
8114 _LT_EOF
8115 if AC_TRY_EVAL(ac_compile); then
8116 # Now try to grab the symbols.
8117 ac_nlist=conftest.nm
8118 if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
8119 # See whether the symbols have a leading underscore.
8120 if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
8121 lt_cv_sys_symbol_underscore=yes
8122 else
8123 if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
8124 :
8125 else
8126 echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
8127 fi
8128 fi
8129 else
8130 echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
8131 fi
8132 else
8133 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
8134 cat conftest.c >&AS_MESSAGE_LOG_FD
8135 fi
8136 rm -rf conftest*
8137 ])
8138 sys_symbol_underscore=$lt_cv_sys_symbol_underscore
8139 AC_SUBST([sys_symbol_underscore])
8140 ])# LT_SYS_SYMBOL_USCORE
8141
8142 # Old name:
8143 AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE])
8144 dnl aclocal-1.4 backwards compatibility:
8145 dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [])
8146
8147
8148 # LT_FUNC_DLSYM_USCORE
8149 # --------------------
8150 AC_DEFUN([LT_FUNC_DLSYM_USCORE],
8151 [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
8152 if test x"$lt_cv_sys_symbol_underscore" = xyes; then
8153 if test x"$libltdl_cv_func_dlopen" = xyes ||
8154 test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
8155 AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
8156 [libltdl_cv_need_uscore],
8157 [libltdl_cv_need_uscore=unknown
8158 save_LIBS="$LIBS"
8159 LIBS="$LIBS $LIBADD_DLOPEN"
8160 _LT_TRY_DLOPEN_SELF(
8161 [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
8162 [], [libltdl_cv_need_uscore=cross])
8163 LIBS="$save_LIBS"
8164 ])
8165 fi
8166 fi
8167
8168 if test x"$libltdl_cv_need_uscore" = xyes; then
8169 AC_DEFINE([NEED_USCORE], [1],
8170 [Define if dlsym() requires a leading underscore in symbol names.])
8171 fi
8172 ])# LT_FUNC_DLSYM_USCORE
8173
8174 # Old name:
8175 AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE])
8176 dnl aclocal-1.4 backwards compatibility:
8177 dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], [])
8178
8179 ##############################################################################
8180 # Helper functions for option handling. -*- Autoconf -*-
8181 #
8182 # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
8183 # Written by Gary V. Vaughan, 2004
8184 #
8185 # This file is free software; the Free Software Foundation gives
8186 # unlimited permission to copy and/or distribute it, with or without
8187 # modifications, as long as this notice is preserved.
8188
8189 # serial 6 ltoptions.m4
8190
8191 # This is to help aclocal find these macros, as it can't see m4_define.
8192 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8193
8194
8195 # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8196 # ------------------------------------------
8197 m4_define([_LT_MANGLE_OPTION],
8198 [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8199
8200
8201 # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8202 # ---------------------------------------
8203 # Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8204 # matching handler defined, dispatch to it. Other OPTION-NAMEs are
8205 # saved as a flag.
8206 m4_define([_LT_SET_OPTION],
8207 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8208 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8209 _LT_MANGLE_DEFUN([$1], [$2]),
8210 [m4_warning([Unknown $1 option `$2'])])[]dnl
8211 ])
8212
8213
8214 # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8215 # ------------------------------------------------------------
8216 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8217 m4_define([_LT_IF_OPTION],
8218 [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8219
8220
8221 # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8222 # -------------------------------------------------------
8223 # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8224 # are set.
8225 m4_define([_LT_UNLESS_OPTIONS],
8226 [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8227 [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8228 [m4_define([$0_found])])])[]dnl
8229 m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8230 ])[]dnl
8231 ])
8232
8233
8234 # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8235 # ----------------------------------------
8236 # OPTION-LIST is a space-separated list of Libtool options associated
8237 # with MACRO-NAME. If any OPTION has a matching handler declared with
8238 # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8239 # the unknown option and exit.
8240 m4_defun([_LT_SET_OPTIONS],
8241 [# Set options
8242 m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8243 [_LT_SET_OPTION([$1], _LT_Option)])
8244
8245 m4_if([$1],[LT_INIT],[
8246 dnl
8247 dnl Simply set some default values (i.e off) if boolean options were not
8248 dnl specified:
8249 _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8250 ])
8251 _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8252 ])
8253 dnl
8254 dnl If no reference was made to various pairs of opposing options, then
8255 dnl we run the default mode handler for the pair. For example, if neither
8256 dnl `shared' nor `disable-shared' was passed, we enable building of shared
8257 dnl archives by default:
8258 _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8259 _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8260 _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8261 _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8262 [_LT_ENABLE_FAST_INSTALL])
8263 ])
8264 ])# _LT_SET_OPTIONS
8265
8266
8267 ## --------------------------------- ##
8268 ## Macros to handle LT_INIT options. ##
8269 ## --------------------------------- ##
8270
8271 # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8272 # -----------------------------------------
8273 m4_define([_LT_MANGLE_DEFUN],
8274 [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8275
8276
8277 # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8278 # -----------------------------------------------
8279 m4_define([LT_OPTION_DEFINE],
8280 [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8281 ])# LT_OPTION_DEFINE
8282
8283
8284 # dlopen
8285 # ------
8286 LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8287 ])
8288
8289 AU_DEFUN([AC_LIBTOOL_DLOPEN],
8290 [_LT_SET_OPTION([LT_INIT], [dlopen])
8291 AC_DIAGNOSE([obsolete],
8292 [$0: Remove this warning and the call to _LT_SET_OPTION when you
8293 put the `dlopen' option into LT_INIT's first parameter.])
8294 ])
8295
8296 dnl aclocal-1.4 backwards compatibility:
8297 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8298
8299
8300 # win32-dll
8301 # ---------
8302 # Declare package support for building win32 dll's.
8303 LT_OPTION_DEFINE([LT_INIT], [win32-dll],
8304 [enable_win32_dll=yes
8305
8306 case $host in
8307 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
8308 AC_CHECK_TOOL(AS, as, false)
8309 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8310 AC_CHECK_TOOL(OBJDUMP, objdump, false)
8311 ;;
8312 esac
8313
8314 test -z "$AS" && AS=as
8315 _LT_DECL([], [AS], [0], [Assembler program])dnl
8316
8317 test -z "$DLLTOOL" && DLLTOOL=dlltool
8318 _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
8319
8320 test -z "$OBJDUMP" && OBJDUMP=objdump
8321 _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
8322 ])# win32-dll
8323
8324 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8325 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
8326 _LT_SET_OPTION([LT_INIT], [win32-dll])
8327 AC_DIAGNOSE([obsolete],
8328 [$0: Remove this warning and the call to _LT_SET_OPTION when you
8329 put the `win32-dll' option into LT_INIT's first parameter.])
8330 ])
8331
8332 dnl aclocal-1.4 backwards compatibility:
8333 dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8334
8335
8336 # _LT_ENABLE_SHARED([DEFAULT])
8337 # ----------------------------
8338 # implement the --enable-shared flag, and supports the `shared' and
8339 # `disable-shared' LT_INIT options.
8340 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
8341 m4_define([_LT_ENABLE_SHARED],
8342 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8343 AC_ARG_ENABLE([shared],
8344 [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8345 [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8346 [p=${PACKAGE-default}
8347 case $enableval in
8348 yes) enable_shared=yes ;;
8349 no) enable_shared=no ;;
8350 *)
8351 enable_shared=no
8352 # Look at the argument we got. We use all the common list separators.
8353 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8354 for pkg in $enableval; do
8355 IFS="$lt_save_ifs"
8356 if test "X$pkg" = "X$p"; then
8357 enable_shared=yes
8358 fi
8359 done
8360 IFS="$lt_save_ifs"
8361 ;;
8362 esac],
8363 [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8364
8365 _LT_DECL([build_libtool_libs], [enable_shared], [0],
8366 [Whether or not to build shared libraries])
8367 ])# _LT_ENABLE_SHARED
8368
8369 LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8370 LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8371
8372 # Old names:
8373 AC_DEFUN([AC_ENABLE_SHARED],
8374 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8375 ])
8376
8377 AC_DEFUN([AC_DISABLE_SHARED],
8378 [_LT_SET_OPTION([LT_INIT], [disable-shared])
8379 ])
8380
8381 AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8382 AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8383
8384 dnl aclocal-1.4 backwards compatibility:
8385 dnl AC_DEFUN([AM_ENABLE_SHARED], [])
8386 dnl AC_DEFUN([AM_DISABLE_SHARED], [])
8387
8388
8389
8390 # _LT_ENABLE_STATIC([DEFAULT])
8391 # ----------------------------
8392 # implement the --enable-static flag, and support the `static' and
8393 # `disable-static' LT_INIT options.
8394 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
8395 m4_define([_LT_ENABLE_STATIC],
8396 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8397 AC_ARG_ENABLE([static],
8398 [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8399 [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8400 [p=${PACKAGE-default}
8401 case $enableval in
8402 yes) enable_static=yes ;;
8403 no) enable_static=no ;;
8404 *)
8405 enable_static=no
8406 # Look at the argument we got. We use all the common list separators.
8407 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8408 for pkg in $enableval; do
8409 IFS="$lt_save_ifs"
8410 if test "X$pkg" = "X$p"; then
8411 enable_static=yes
8412 fi
8413 done
8414 IFS="$lt_save_ifs"
8415 ;;
8416 esac],
8417 [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8418
8419 _LT_DECL([build_old_libs], [enable_static], [0],
8420 [Whether or not to build static libraries])
8421 ])# _LT_ENABLE_STATIC
8422
8423 LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8424 LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8425
8426 # Old names:
8427 AC_DEFUN([AC_ENABLE_STATIC],
8428 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8429 ])
8430
8431 AC_DEFUN([AC_DISABLE_STATIC],
8432 [_LT_SET_OPTION([LT_INIT], [disable-static])
8433 ])
8434
8435 AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8436 AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8437
8438 dnl aclocal-1.4 backwards compatibility:
8439 dnl AC_DEFUN([AM_ENABLE_STATIC], [])
8440 dnl AC_DEFUN([AM_DISABLE_STATIC], [])
8441
8442
8443
8444 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
8445 # ----------------------------------
8446 # implement the --enable-fast-install flag, and support the `fast-install'
8447 # and `disable-fast-install' LT_INIT options.
8448 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
8449 m4_define([_LT_ENABLE_FAST_INSTALL],
8450 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8451 AC_ARG_ENABLE([fast-install],
8452 [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8453 [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8454 [p=${PACKAGE-default}
8455 case $enableval in
8456 yes) enable_fast_install=yes ;;
8457 no) enable_fast_install=no ;;
8458 *)
8459 enable_fast_install=no
8460 # Look at the argument we got. We use all the common list separators.
8461 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8462 for pkg in $enableval; do
8463 IFS="$lt_save_ifs"
8464 if test "X$pkg" = "X$p"; then
8465 enable_fast_install=yes
8466 fi
8467 done
8468 IFS="$lt_save_ifs"
8469 ;;
8470 esac],
8471 [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8472
8473 _LT_DECL([fast_install], [enable_fast_install], [0],
8474 [Whether or not to optimize for fast installation])dnl
8475 ])# _LT_ENABLE_FAST_INSTALL
8476
8477 LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8478 LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8479
8480 # Old names:
8481 AU_DEFUN([AC_ENABLE_FAST_INSTALL],
8482 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8483 AC_DIAGNOSE([obsolete],
8484 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
8485 the `fast-install' option into LT_INIT's first parameter.])
8486 ])
8487
8488 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
8489 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8490 AC_DIAGNOSE([obsolete],
8491 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
8492 the `disable-fast-install' option into LT_INIT's first parameter.])
8493 ])
8494
8495 dnl aclocal-1.4 backwards compatibility:
8496 dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8497 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8498
8499
8500 # _LT_WITH_PIC([MODE])
8501 # --------------------
8502 # implement the --with-pic flag, and support the `pic-only' and `no-pic'
8503 # LT_INIT options.
8504 # MODE is either `yes' or `no'. If omitted, it defaults to `both'.
8505 m4_define([_LT_WITH_PIC],
8506 [AC_ARG_WITH([pic],
8507 [AS_HELP_STRING([--with-pic],
8508 [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8509 [pic_mode="$withval"],
8510 [pic_mode=default])
8511
8512 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8513
8514 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8515 ])# _LT_WITH_PIC
8516
8517 LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8518 LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8519
8520 # Old name:
8521 AU_DEFUN([AC_LIBTOOL_PICMODE],
8522 [_LT_SET_OPTION([LT_INIT], [pic-only])
8523 AC_DIAGNOSE([obsolete],
8524 [$0: Remove this warning and the call to _LT_SET_OPTION when you
8525 put the `pic-only' option into LT_INIT's first parameter.])
8526 ])
8527
8528 dnl aclocal-1.4 backwards compatibility:
8529 dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8530
8531 ## ----------------- ##
8532 ## LTDL_INIT Options ##
8533 ## ----------------- ##
8534
8535 m4_define([_LTDL_MODE], [])
8536 LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8537 [m4_define([_LTDL_MODE], [nonrecursive])])
8538 LT_OPTION_DEFINE([LTDL_INIT], [recursive],
8539 [m4_define([_LTDL_MODE], [recursive])])
8540 LT_OPTION_DEFINE([LTDL_INIT], [subproject],
8541 [m4_define([_LTDL_MODE], [subproject])])
8542
8543 m4_define([_LTDL_TYPE], [])
8544 LT_OPTION_DEFINE([LTDL_INIT], [installable],
8545 [m4_define([_LTDL_TYPE], [installable])])
8546 LT_OPTION_DEFINE([LTDL_INIT], [convenience],
8547 [m4_define([_LTDL_TYPE], [convenience])])
8548
8549 ##############################################################################
8550 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
8551 #
8552 # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
8553 # Written by Gary V. Vaughan, 2004
8554 #
8555 # This file is free software; the Free Software Foundation gives
8556 # unlimited permission to copy and/or distribute it, with or without
8557 # modifications, as long as this notice is preserved.
8558
8559 # serial 6 ltsugar.m4
8560
8561 # This is to help aclocal find these macros, as it can't see m4_define.
8562 AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8563
8564
8565 # lt_join(SEP, ARG1, [ARG2...])
8566 # -----------------------------
8567 # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8568 # associated separator.
8569 # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8570 # versions in m4sugar had bugs.
8571 m4_define([lt_join],
8572 [m4_if([$#], [1], [],
8573 [$#], [2], [[$2]],
8574 [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8575 m4_define([_lt_join],
8576 [m4_if([$#$2], [2], [],
8577 [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8578
8579
8580 # lt_car(LIST)
8581 # lt_cdr(LIST)
8582 # ------------
8583 # Manipulate m4 lists.
8584 # These macros are necessary as long as will still need to support
8585 # Autoconf-2.59 which quotes differently.
8586 m4_define([lt_car], [[$1]])
8587 m4_define([lt_cdr],
8588 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8589 [$#], 1, [],
8590 [m4_dquote(m4_shift($@))])])
8591 m4_define([lt_unquote], $1)
8592
8593
8594 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
8595 # ------------------------------------------
8596 # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
8597 # Note that neither SEPARATOR nor STRING are expanded; they are appended
8598 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8599 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
8600 # than defined and empty).
8601 #
8602 # This macro is needed until we can rely on Autoconf 2.62, since earlier
8603 # versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8604 m4_define([lt_append],
8605 [m4_define([$1],
8606 m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8607
8608
8609
8610 # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8611 # ----------------------------------------------------------
8612 # Produce a SEP delimited list of all paired combinations of elements of
8613 # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
8614 # has the form PREFIXmINFIXSUFFIXn.
8615 # Needed until we can rely on m4_combine added in Autoconf 2.62.
8616 m4_define([lt_combine],
8617 [m4_if(m4_eval([$# > 3]), [1],
8618 [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8619 [[m4_foreach([_Lt_prefix], [$2],
8620 [m4_foreach([_Lt_suffix],
8621 ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8622 [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8623
8624
8625 # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8626 # -----------------------------------------------------------------------
8627 # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8628 # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8629 m4_define([lt_if_append_uniq],
8630 [m4_ifdef([$1],
8631 [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8632 [lt_append([$1], [$2], [$3])$4],
8633 [$5])],
8634 [lt_append([$1], [$2], [$3])$4])])
8635
8636
8637 # lt_dict_add(DICT, KEY, VALUE)
8638 # -----------------------------
8639 m4_define([lt_dict_add],
8640 [m4_define([$1($2)], [$3])])
8641
8642
8643 # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8644 # --------------------------------------------
8645 m4_define([lt_dict_add_subkey],
8646 [m4_define([$1($2:$3)], [$4])])
8647
8648
8649 # lt_dict_fetch(DICT, KEY, [SUBKEY])
8650 # ----------------------------------
8651 m4_define([lt_dict_fetch],
8652 [m4_ifval([$3],
8653 m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8654 m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8655
8656
8657 # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8658 # -----------------------------------------------------------------
8659 m4_define([lt_if_dict_fetch],
8660 [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8661 [$5],
8662 [$6])])
8663
8664
8665 # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8666 # --------------------------------------------------------------
8667 m4_define([lt_dict_filter],
8668 [m4_if([$5], [], [],
8669 [lt_join(m4_quote(m4_default([$4], [[, ]])),
8670 lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8671 [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8672 ])
8673
8674 ##############################################################################
8675 # ltversion.m4 -- version numbers -*- Autoconf -*-
8676 #
8677 # Copyright (C) 2004 Free Software Foundation, Inc.
8678 # Written by Scott James Remnant, 2004
8679 #
8680 # This file is free software; the Free Software Foundation gives
8681 # unlimited permission to copy and/or distribute it, with or without
8682 # modifications, as long as this notice is preserved.
8683
8684 # Generated from ltversion.in.
8685
8686 # serial 3012 ltversion.m4
8687 # This file is part of GNU Libtool
8688
8689 m4_define([LT_PACKAGE_VERSION], [2.2.6])
8690 m4_define([LT_PACKAGE_REVISION], [1.3012])
8691
8692 AC_DEFUN([LTVERSION_VERSION],
8693 [macro_version='2.2.6'
8694 macro_revision='1.3012'
8695 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8696 _LT_DECL(, macro_revision, 0)
8697 ])
8698
8699 ##############################################################################
8700 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
8701 #
8702 # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
8703 # Written by Scott James Remnant, 2004.
8704 #
8705 # This file is free software; the Free Software Foundation gives
8706 # unlimited permission to copy and/or distribute it, with or without
8707 # modifications, as long as this notice is preserved.
8708
8709 # serial 4 lt~obsolete.m4
8710
8711 # These exist entirely to fool aclocal when bootstrapping libtool.
8712 #
8713 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
8714 # which have later been changed to m4_define as they aren't part of the
8715 # exported API, or moved to Autoconf or Automake where they belong.
8716 #
8717 # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
8718 # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8719 # using a macro with the same name in our local m4/libtool.m4 it'll
8720 # pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8721 # and doesn't know about Autoconf macros at all.)
8722 #
8723 # So we provide this file, which has a silly filename so it's always
8724 # included after everything else. This provides aclocal with the
8725 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8726 # because those macros already exist, or will be overwritten later.
8727 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
8728 #
8729 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8730 # Yes, that means every name once taken will need to remain here until
8731 # we give up compatibility with versions before 1.7, at which point
8732 # we need to keep only those names which we still refer to.
8733
8734 # This is to help aclocal find these macros, as it can't see m4_define.
8735 AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8736
8737 m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8738 m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
8739 m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8740 m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
8741 m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8742 m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
8743 m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
8744 m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
8745 m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
8746 m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
8747 m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
8748 m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
8749 m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
8750 m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
8751 m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
8752 m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
8753 m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
8754 m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
8755 m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
8756 m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
8757 m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
8758 m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
8759 m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
8760 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
8761 m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
8762 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
8763 m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
8764 m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
8765 m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
8766 m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
8767 m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
8768 m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
8769 m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
8770 m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
8771 m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
8772 m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
8773 m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
8774 m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
8775 m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
8776 m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
8777 m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
8778 m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
8779 m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
8780 m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
8781 m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
8782 m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
8783 m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
8784 m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
8785 m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
8786 m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
8787 m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
8788 m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
8789 m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
8790 m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
8791 m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
8792 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
8793 #
8794 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
8795 #
8796 # This program is free software; you can redistribute it and/or modify
8797 # it under the terms of the GNU General Public License as published by
8798 # the Free Software Foundation; either version 2 of the License, or
8799 # (at your option) any later version.
8800 #
8801 # This program is distributed in the hope that it will be useful, but
8802 # WITHOUT ANY WARRANTY; without even the implied warranty of
8803 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8804 # General Public License for more details.
8805 #
8806 # You should have received a copy of the GNU General Public License
8807 # along with this program; if not, write to the Free Software
8808 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8809 #
8810 # As a special exception to the GNU General Public License, if you
8811 # distribute this file as part of a program that contains a
8812 # configuration script generated by Autoconf, you may include it under
8813 # the same distribution terms that you use for the rest of that program.
8814
8815 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
8816 # ----------------------------------
8817 AC_DEFUN([PKG_PROG_PKG_CONFIG],
8818 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
8819 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
8820 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
8821 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8822 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8823 fi
8824 if test -n "$PKG_CONFIG"; then
8825 _pkg_min_version=m4_default([$1], [0.9.0])
8826 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8827 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8828 AC_MSG_RESULT([yes])
8829 else
8830 AC_MSG_RESULT([no])
8831 PKG_CONFIG=""
8832 fi
8833
8834 fi[]dnl
8835 ])# PKG_PROG_PKG_CONFIG
8836
8837 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8838 #
8839 # Check to see whether a particular set of modules exists. Similar
8840 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
8841 #
8842 #
8843 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
8844 # this or PKG_CHECK_MODULES is called, or make sure to call
8845 # PKG_CHECK_EXISTS manually
8846 # --------------------------------------------------------------
8847 AC_DEFUN([PKG_CHECK_EXISTS],
8848 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8849 if test -n "$PKG_CONFIG" && \
8850 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8851 m4_ifval([$2], [$2], [:])
8852 m4_ifvaln([$3], [else
8853 $3])dnl
8854 fi])
8855
8856
8857 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8858 # ---------------------------------------------
8859 m4_define([_PKG_CONFIG],
8860 [if test -n "$PKG_CONFIG"; then
8861 if test -n "$$1"; then
8862 pkg_cv_[]$1="$$1"
8863 else
8864 PKG_CHECK_EXISTS([$3],
8865 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8866 [pkg_failed=yes])
8867 fi
8868 else
8869 pkg_failed=untried
8870 fi[]dnl
8871 ])# _PKG_CONFIG
8872
8873 # _PKG_SHORT_ERRORS_SUPPORTED
8874 # -----------------------------
8875 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8876 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8877 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8878 _pkg_short_errors_supported=yes
8879 else
8880 _pkg_short_errors_supported=no
8881 fi[]dnl
8882 ])# _PKG_SHORT_ERRORS_SUPPORTED
8883
8884
8885 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8886 # [ACTION-IF-NOT-FOUND])
8887 #
8888 #
8889 # Note that if there is a possibility the first call to
8890 # PKG_CHECK_MODULES might not happen, you should be sure to include an
8891 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8892 #
8893 #
8894 # --------------------------------------------------------------
8895 AC_DEFUN([PKG_CHECK_MODULES],
8896 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8897 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8898 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8899
8900 pkg_failed=no
8901 AC_MSG_CHECKING([for $1])
8902
8903 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8904 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
8905
8906 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8907 and $1[]_LIBS to avoid the need to call pkg-config.
8908 See the pkg-config man page for more details.])
8909
8910 if test $pkg_failed = yes; then
8911 _PKG_SHORT_ERRORS_SUPPORTED
8912 if test $_pkg_short_errors_supported = yes; then
8913 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
8914 else
8915 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
8916 fi
8917 # Put the nasty error message in config.log where it belongs
8918 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8919
8920 ifelse([$4], , [AC_MSG_ERROR(dnl
8921 [Package requirements ($2) were not met:
8922
8923 $$1_PKG_ERRORS
8924
8925 Consider adjusting the PKG_CONFIG_PATH environment variable if you
8926 installed software in a non-standard prefix.
8927
8928 _PKG_TEXT
8929 ])],
8930 [AC_MSG_RESULT([no])
8931 $4])
8932 elif test $pkg_failed = untried; then
8933 ifelse([$4], , [AC_MSG_FAILURE(dnl
8934 [The pkg-config script could not be found or is too old. Make sure it
8935 is in your PATH or set the PKG_CONFIG environment variable to the full
8936 path to pkg-config.
8937
8938 _PKG_TEXT
8939
8940 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
8941 [$4])
8942 else
8943 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8944 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8945 AC_MSG_RESULT([yes])
8946 ifelse([$3], , :, [$3])
8947 fi[]dnl
8948 ])# PKG_CHECK_MODULES
8949 # Configure paths for SDL
8950 # Sam Lantinga 9/21/99
8951 # stolen from Manish Singh
8952 # stolen back from Frank Belew
8953 # stolen from Manish Singh
8954 # Shamelessly stolen from Owen Taylor
8955
8956 # serial 1
8957
8958 dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
8959 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
8960 dnl
8961 AC_DEFUN([AM_PATH_SDL2],
8962 [dnl
8963 dnl Get the cflags and libraries from the sdl2-config script
8964 dnl
8965 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
8966 sdl_prefix="$withval", sdl_prefix="")
8967 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
8968 sdl_exec_prefix="$withval", sdl_exec_prefix="")
8969 AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
8970 , enable_sdltest=yes)
8971
8972 min_sdl_version=ifelse([$1], ,2.0.0,$1)
8973
8974 if test "x$sdl_prefix$sdl_exec_prefix" = x ; then
8975 PKG_CHECK_MODULES([SDL], [sdl2 >= $min_sdl_version],
8976 [sdl_pc=yes],
8977 [sdl_pc=no])
8978 else
8979 sdl_pc=no
8980 if test x$sdl_exec_prefix != x ; then
8981 sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
8982 if test x${SDL2_CONFIG+set} != xset ; then
8983 SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config
8984 fi
8985 fi
8986 if test x$sdl_prefix != x ; then
8987 sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
8988 if test x${SDL2_CONFIG+set} != xset ; then
8989 SDL2_CONFIG=$sdl_prefix/bin/sdl2-config
8990 fi
8991 fi
8992 fi
8993
8994 if test "x$sdl_pc" = xyes ; then
8995 no_sdl=""
8996 SDL2_CONFIG="pkg-config sdl2"
8997 else
8998 as_save_PATH="$PATH"
8999 if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then
9000 PATH="$prefix/bin:$prefix/usr/bin:$PATH"
9001 fi
9002 AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no, [$PATH])
9003 PATH="$as_save_PATH"
9004 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
9005 no_sdl=""
9006
9007 if test "$SDL2_CONFIG" = "no" ; then
9008 no_sdl=yes
9009 else
9010 SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags`
9011 SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs`
9012
9013 sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \
9014 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
9015 sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \
9016 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
9017 sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \
9018 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
9019 if test "x$enable_sdltest" = "xyes" ; then
9020 ac_save_CFLAGS="$CFLAGS"
9021 ac_save_CXXFLAGS="$CXXFLAGS"
9022 ac_save_LIBS="$LIBS"
9023 CFLAGS="$CFLAGS $SDL_CFLAGS"
9024 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
9025 LIBS="$LIBS $SDL_LIBS"
9026 dnl
9027 dnl Now check if the installed SDL is sufficiently new. (Also sanity
9028 dnl checks the results of sdl2-config to some extent
9029 dnl
9030 rm -f conf.sdltest
9031 AC_TRY_RUN([
9032 #include <stdio.h>
9033 #include <stdlib.h>
9034 #include <string.h>
9035 #include "SDL.h"
9036
9037 char*
9038 my_strdup (char *str)
9039 {
9040 char *new_str;
9041
9042 if (str)
9043 {
9044 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
9045 strcpy (new_str, str);
9046 }
9047 else
9048 new_str = NULL;
9049
9050 return new_str;
9051 }
9052
9053 int main (int argc, char *argv[])
9054 {
9055 int major, minor, micro;
9056 char *tmp_version;
9057
9058 /* This hangs on some systems (?)
9059 system ("touch conf.sdltest");
9060 */
9061 { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
9062
9063 /* HP/UX 9 (%@#!) writes to sscanf strings */
9064 tmp_version = my_strdup("$min_sdl_version");
9065 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
9066 printf("%s, bad version string\n", "$min_sdl_version");
9067 exit(1);
9068 }
9069
9070 if (($sdl_major_version > major) ||
9071 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
9072 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
9073 {
9074 return 0;
9075 }
9076 else
9077 {
9078 printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
9079 printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro);
9080 printf("*** best to upgrade to the required version.\n");
9081 printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n");
9082 printf("*** to point to the correct copy of sdl2-config, and remove the file\n");
9083 printf("*** config.cache before re-running configure\n");
9084 return 1;
9085 }
9086 }
9087
9088 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
9089 CFLAGS="$ac_save_CFLAGS"
9090 CXXFLAGS="$ac_save_CXXFLAGS"
9091 LIBS="$ac_save_LIBS"
9092 fi
9093 fi
9094 if test "x$no_sdl" = x ; then
9095 AC_MSG_RESULT(yes)
9096 else
9097 AC_MSG_RESULT(no)
9098 fi
9099 fi
9100 if test "x$no_sdl" = x ; then
9101 ifelse([$2], , :, [$2])
9102 else
9103 if test "$SDL2_CONFIG" = "no" ; then
9104 echo "*** The sdl2-config script installed by SDL could not be found"
9105 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
9106 echo "*** your path, or set the SDL2_CONFIG environment variable to the"
9107 echo "*** full path to sdl2-config."
9108 else
9109 if test -f conf.sdltest ; then
9110 :
9111 else
9112 echo "*** Could not run SDL test program, checking why..."
9113 CFLAGS="$CFLAGS $SDL_CFLAGS"
9114 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
9115 LIBS="$LIBS $SDL_LIBS"
9116 AC_TRY_LINK([
9117 #include <stdio.h>
9118 #include "SDL.h"
9119
9120 int main(int argc, char *argv[])
9121 { return 0; }
9122 #undef main
9123 #define main K_and_R_C_main
9124 ], [ return 0; ],
9125 [ echo "*** The test program compiled, but did not run. This usually means"
9126 echo "*** that the run-time linker is not finding SDL or finding the wrong"
9127 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
9128 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
9129 echo "*** to the installed location Also, make sure you have run ldconfig if that"
9130 echo "*** is required on your system"
9131 echo "***"
9132 echo "*** If you have an old version installed, it is best to remove it, although"
9133 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
9134 [ echo "*** The test program failed to compile or link. See the file config.log for the"
9135 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
9136 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
9137 echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" ])
9138 CFLAGS="$ac_save_CFLAGS"
9139 CXXFLAGS="$ac_save_CXXFLAGS"
9140 LIBS="$ac_save_LIBS"
9141 fi
9142 fi
9143 SDL_CFLAGS=""
9144 SDL_LIBS=""
9145 ifelse([$3], , :, [$3])
9146 fi
9147 AC_SUBST(SDL_CFLAGS)
9148 AC_SUBST(SDL_LIBS)
9149 rm -f conf.sdltest
9150 ])
9151 # Configure paths for SMPEG
9152 # Nicolas Vignal 11/19/2000
9153 # stolen from Sam Lantinga
9154 # stolen from Manish Singh
9155 # stolen back from Frank Belew
9156 # stolen from Manish Singh
9157 # Shamelessly stolen from Owen Taylor
9158
9159 dnl AM_PATH_SMPEG2([MINIMUM-VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
9160 dnl Test for SMPEG, and define SMPEG_CFLAGS and SMPEG_LIBS
9161 dnl
9162 AC_DEFUN([AM_PATH_SMPEG2],
9163 [dnl
9164 dnl Get the cflags and libraries from the smpeg2-config script
9165 dnl
9166 AC_ARG_WITH([smpeg-prefix],
9167 AS_HELP_STRING([--with-smpeg-prefix=PFX],
9168 [Prefix where SMPEG is installed (optional)]),
9169 [smpeg_prefix="$withval"], [smpeg_prefix=""])
9170 AC_ARG_WITH([smpeg-exec-prefix],
9171 AS_HELP_STRING([--with-smpeg-exec-prefix=PFX],
9172 [Exec prefix where SMPEG is installed (optional)]),
9173 [smpeg_exec_prefix="$withval"], [smpeg_exec_prefix=""])
9174 AC_ARG_ENABLE([smpegtest],
9175 AS_HELP_STRING([--disable-smpegtest],
9176 [Do not try to compile and run a test SMPEG program]),
9177 [], [enable_smpegtest=yes])
9178
9179 if test x$smpeg_exec_prefix != x ; then
9180 smpeg_args="$smpeg_args --exec-prefix=$smpeg_exec_prefix"
9181 if test x${SMPEG_CONFIG+set} != xset ; then
9182 SMPEG_CONFIG=$smpeg_exec_prefix/bin/smpeg2-config
9183 fi
9184 fi
9185 if test x$smpeg_prefix != x ; then
9186 smpeg_args="$smpeg_args --prefix=$smpeg_prefix"
9187 if test x${SMPEG_CONFIG+set} != xset ; then
9188 SMPEG_CONFIG=$smpeg_prefix/bin/smpeg2-config
9189 fi
9190 fi
9191
9192 AC_PATH_PROG([SMPEG_CONFIG], [smpeg2-config], [no])
9193 min_smpeg_version=ifelse([$1], [], [2.0.0], [$1])
9194 AC_MSG_CHECKING([for SMPEG - version >= $min_smpeg_version])
9195 no_smpeg=""
9196 if test "$SMPEG_CONFIG" = "no" ; then
9197 no_smpeg=yes
9198 else
9199 SMPEG_CFLAGS=`$SMPEG_CONFIG $smpegconf_args --cflags`
9200 SMPEG_LIBS=`$SMPEG_CONFIG $smpegconf_args --libs`
9201
9202 smpeg_major_version=`$SMPEG_CONFIG $smpeg_args --version | \
9203 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
9204 smpeg_minor_version=`$SMPEG_CONFIG $smpeg_args --version | \
9205 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
9206 smpeg_micro_version=`$SMPEG_CONFIG $smpeg_config_args --version | \
9207 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
9208 if test "x$enable_smpegtest" = "xyes" ; then
9209 ac_save_CFLAGS="$CFLAGS"
9210 ac_save_LIBS="$LIBS"
9211 CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
9212 LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
9213 dnl
9214 dnl Now check if the installed SMPEG is sufficiently new. (Also sanity
9215 dnl checks the results of smpeg2-config to some extent
9216 dnl
9217 rm -f conf.smpegtest
9218 AC_RUN_IFELSE([AC_LANG_SOURCE([[
9219 #include <stdio.h>
9220 #include <stdlib.h>
9221 #include <string.h>
9222 #include "smpeg.h"
9223
9224 char*
9225 my_strdup (char *str)
9226 {
9227 char *new_str;
9228
9229 if (str)
9230 {
9231 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
9232 strcpy (new_str, str);
9233 }
9234 else
9235 new_str = NULL;
9236
9237 return new_str;
9238 }
9239
9240 int main (int argc, char *argv[])
9241 {
9242 int major, minor, micro;
9243 char *tmp_version;
9244
9245 /* This hangs on some systems (?)
9246 system ("touch conf.smpegtest");
9247 */
9248 { FILE *fp = fopen("conf.smpegtest", "a"); if ( fp ) fclose(fp); }
9249
9250 /* HP/UX 9 (%@#!) writes to sscanf strings */
9251 tmp_version = my_strdup("$min_smpeg_version");
9252 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
9253 printf("%s, bad version string\n", "$min_smpeg_version");
9254 exit(1);
9255 }
9256
9257 if (($smpeg_major_version > major) ||
9258 (($smpeg_major_version == major) && ($smpeg_minor_version > minor)) ||
9259 (($smpeg_major_version == major) && ($smpeg_minor_version == minor) && ($smpeg_micro_version >= micro)))
9260 {
9261 return 0;
9262 }
9263 else
9264 {
9265 printf("\n*** 'smpeg2-config --version' returned %d.%d.%d, but the minimum version\n", $smpeg_major_version, $smpeg_minor_version, $smpeg_micro_version);
9266 printf("*** of SMPEG required is %d.%d.%d. If smpeg2-config is correct, then it is\n", major, minor, micro);
9267 printf("*** best to upgrade to the required version.\n");
9268 printf("*** If smpeg2-config was wrong, set the environment variable SMPEG_CONFIG\n");
9269 printf("*** to point to the correct copy of smpeg2-config, and remove the file\n");
9270 printf("*** config.cache before re-running configure\n");
9271 return 1;
9272 }
9273 }
9274
9275 ]])],[],[no_smpeg=yes], [echo $ac_n "cross compiling; assumed OK... $ac_c"])
9276 CFLAGS="$ac_save_CFLAGS"
9277 LIBS="$ac_save_LIBS"
9278 fi
9279 fi
9280 if test "x$no_smpeg" = x ; then
9281 AC_MSG_RESULT([yes])
9282 ifelse([$2], [], [:], [$2])
9283 else
9284 AC_MSG_RESULT([no])
9285 if test "$SMPEG_CONFIG" = "no" ; then
9286 echo "*** The smpeg2-config script installed by SMPEG could not be found"
9287 echo "*** If SMPEG was installed in PREFIX, make sure PREFIX/bin is in"
9288 echo "*** your path, or set the SMPEG_CONFIG environment variable to the"
9289 echo "*** full path to smpeg2-config."
9290 else
9291 if test -f conf.smpegtest ; then
9292 :
9293 else
9294 echo "*** Could not run SMPEG test program, checking why..."
9295 CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
9296 LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
9297 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
9298 #include <stdio.h>
9299 #include "smpeg.h"
9300 ]],
9301 [[ return 0; ]])],
9302 [ echo "*** The test program compiled, but did not run. This usually means"
9303 echo "*** that the run-time linker is not finding SMPEG or finding the wrong"
9304 echo "*** version of SMPEG. If it is not finding SMPEG, you'll need to set your"
9305 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
9306 echo "*** to the installed location Also, make sure you have run ldconfig if that"
9307 echo "*** is required on your system"
9308 echo "***"
9309 echo "*** If you have an old version installed, it is best to remove it, although"
9310 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
9311 [ echo "*** The test program failed to compile or link. See the file config.log for the"
9312 echo "*** exact error that occured. This usually means SMPEG was incorrectly installed"
9313 echo "*** or that you have moved SMPEG since it was installed. In the latter case, you"
9314 echo "*** may want to edit the smpeg2-config script: $SMPEG_CONFIG" ])
9315 CFLAGS="$ac_save_CFLAGS"
9316 LIBS="$ac_save_LIBS"
9317 fi
9318 fi
9319 SMPEG_CFLAGS=""
9320 SMPEG_LIBS=""
9321 ifelse([$3], [], [:], [$3])
9322 fi
9323 AC_SUBST([SMPEG_CFLAGS])
9324 AC_SUBST([SMPEG_LIBS])
9325 rm -f conf.smpegtest
9326 ])
00 #! /bin/sh
11 # Attempt to guess a canonical system name.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
4 # 2011, 2012 Free Software Foundation, Inc.
5
6 timestamp='2012-08-14'
2 # Copyright 1992-2017 Free Software Foundation, Inc.
3
4 timestamp='2017-08-08'
75
86 # This file is free software; you can redistribute it and/or modify it
97 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
8 # the Free Software Foundation; either version 3 of the License, or
119 # (at your option) any later version.
1210 #
1311 # This program is distributed in the hope that it will be useful, but
2119 # As a special exception to the GNU General Public License, if you
2220 # distribute this file as part of a program that contains a
2321 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26
27 # Originally written by Per Bothner. Please send patches (context
28 # diff format) to <config-patches@gnu.org> and include a ChangeLog
29 # entry.
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
3025 #
31 # This script attempts to guess a canonical system name similar to
32 # config.sub. If it succeeds, it prints the system name on stdout, and
33 # exits with 0. Otherwise, it exits with 1.
26 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
3427 #
3528 # You can get the latest version of this script from:
36 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
29 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
30 #
31 # Please send patches to <config-patches@gnu.org>.
32
3733
3834 me=`echo "$0" | sed -e 's,.*/,,'`
3935
5349 GNU config.guess ($timestamp)
5450
5551 Originally written by Per Bothner.
56 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
57 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
58 Free Software Foundation, Inc.
52 Copyright 1992-2017 Free Software Foundation, Inc.
5953
6054 This is free software; see the source for copying conditions. There is NO
6155 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
137131 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
138132 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
139133
134 case "${UNAME_SYSTEM}" in
135 Linux|GNU|GNU/*)
136 # If the system lacks a compiler, then just pick glibc.
137 # We could probably try harder.
138 LIBC=gnu
139
140 eval $set_cc_for_build
141 cat <<-EOF > $dummy.c
142 #include <features.h>
143 #if defined(__UCLIBC__)
144 LIBC=uclibc
145 #elif defined(__dietlibc__)
146 LIBC=dietlibc
147 #else
148 LIBC=gnu
149 #endif
150 EOF
151 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
152 ;;
153 esac
154
140155 # Note: order is significant - the case branches are not exclusive.
141156
142157 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
152167 # Note: NetBSD doesn't particularly care about the vendor
153168 # portion of the name. We always set it to "unknown".
154169 sysctl="sysctl -n hw.machine_arch"
155 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
156 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
170 UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
171 /sbin/$sysctl 2>/dev/null || \
172 /usr/sbin/$sysctl 2>/dev/null || \
173 echo unknown)`
157174 case "${UNAME_MACHINE_ARCH}" in
158175 armeb) machine=armeb-unknown ;;
159176 arm*) machine=arm-unknown ;;
160177 sh3el) machine=shl-unknown ;;
161178 sh3eb) machine=sh-unknown ;;
162179 sh5el) machine=sh5le-unknown ;;
180 earmv*)
181 arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
182 endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
183 machine=${arch}${endian}-unknown
184 ;;
163185 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
164186 esac
165187 # The Operating System including object format, if it has switched
166 # to ELF recently, or will in the future.
188 # to ELF recently (or will in the future) and ABI.
167189 case "${UNAME_MACHINE_ARCH}" in
190 earm*)
191 os=netbsdelf
192 ;;
168193 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
169194 eval $set_cc_for_build
170195 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
181206 os=netbsd
182207 ;;
183208 esac
209 # Determine ABI tags.
210 case "${UNAME_MACHINE_ARCH}" in
211 earm*)
212 expr='s/^earmv[0-9]/-eabi/;s/eb$//'
213 abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
214 ;;
215 esac
184216 # The OS release
185217 # Debian GNU/NetBSD machines have a different userland, and
186218 # thus, need a distinct triplet. However, they do not need
191223 release='-gnu'
192224 ;;
193225 *)
194 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
226 release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
195227 ;;
196228 esac
197229 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
198230 # contains redundant information, the shorter form:
199231 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
200 echo "${machine}-${os}${release}"
232 echo "${machine}-${os}${release}${abi}"
201233 exit ;;
202234 *:Bitrig:*:*)
203235 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
207239 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
208240 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
209241 exit ;;
242 *:LibertyBSD:*:*)
243 UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
244 echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
245 exit ;;
210246 *:ekkoBSD:*:*)
211247 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
212248 exit ;;
218254 exit ;;
219255 *:MirBSD:*:*)
220256 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
257 exit ;;
258 *:Sortix:*:*)
259 echo ${UNAME_MACHINE}-unknown-sortix
260 exit ;;
261 *:Redox:*:*)
262 echo ${UNAME_MACHINE}-unknown-redox
221263 exit ;;
222264 alpha:OSF1:*:*)
223265 case $UNAME_RELEASE in
235277 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
236278 case "$ALPHA_CPU_TYPE" in
237279 "EV4 (21064)")
238 UNAME_MACHINE="alpha" ;;
280 UNAME_MACHINE=alpha ;;
239281 "EV4.5 (21064)")
240 UNAME_MACHINE="alpha" ;;
282 UNAME_MACHINE=alpha ;;
241283 "LCA4 (21066/21068)")
242 UNAME_MACHINE="alpha" ;;
284 UNAME_MACHINE=alpha ;;
243285 "EV5 (21164)")
244 UNAME_MACHINE="alphaev5" ;;
286 UNAME_MACHINE=alphaev5 ;;
245287 "EV5.6 (21164A)")
246 UNAME_MACHINE="alphaev56" ;;
288 UNAME_MACHINE=alphaev56 ;;
247289 "EV5.6 (21164PC)")
248 UNAME_MACHINE="alphapca56" ;;
290 UNAME_MACHINE=alphapca56 ;;
249291 "EV5.7 (21164PC)")
250 UNAME_MACHINE="alphapca57" ;;
292 UNAME_MACHINE=alphapca57 ;;
251293 "EV6 (21264)")
252 UNAME_MACHINE="alphaev6" ;;
294 UNAME_MACHINE=alphaev6 ;;
253295 "EV6.7 (21264A)")
254 UNAME_MACHINE="alphaev67" ;;
296 UNAME_MACHINE=alphaev67 ;;
255297 "EV6.8CB (21264C)")
256 UNAME_MACHINE="alphaev68" ;;
298 UNAME_MACHINE=alphaev68 ;;
257299 "EV6.8AL (21264B)")
258 UNAME_MACHINE="alphaev68" ;;
300 UNAME_MACHINE=alphaev68 ;;
259301 "EV6.8CX (21264D)")
260 UNAME_MACHINE="alphaev68" ;;
302 UNAME_MACHINE=alphaev68 ;;
261303 "EV6.9A (21264/EV69A)")
262 UNAME_MACHINE="alphaev69" ;;
304 UNAME_MACHINE=alphaev69 ;;
263305 "EV7 (21364)")
264 UNAME_MACHINE="alphaev7" ;;
306 UNAME_MACHINE=alphaev7 ;;
265307 "EV7.9 (21364A)")
266 UNAME_MACHINE="alphaev79" ;;
308 UNAME_MACHINE=alphaev79 ;;
267309 esac
268310 # A Pn.n version is a patched version.
269311 # A Vn.n version is a released version.
270312 # A Tn.n version is a released field test version.
271313 # A Xn.n version is an unreleased experimental baselevel.
272314 # 1.2 uses "1.2" for uname -r.
273 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
315 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
274316 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
275317 exitcode=$?
276318 trap '' 0
305347 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
306348 echo arm-acorn-riscix${UNAME_RELEASE}
307349 exit ;;
308 arm:riscos:*:*|arm:RISCOS:*:*)
350 arm*:riscos:*:*|arm*:RISCOS:*:*)
309351 echo arm-unknown-riscos
310352 exit ;;
311353 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
343385 exit ;;
344386 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
345387 eval $set_cc_for_build
346 SUN_ARCH="i386"
388 SUN_ARCH=i386
347389 # If there is a compiler, see if it is configured for 64-bit objects.
348390 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
349391 # This test works for both compilers.
350 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
392 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
351393 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
352 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
394 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
353395 grep IS_64BIT_ARCH >/dev/null
354396 then
355 SUN_ARCH="x86_64"
397 SUN_ARCH=x86_64
356398 fi
357399 fi
358400 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
377419 exit ;;
378420 sun*:*:4.2BSD:*)
379421 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
380 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
422 test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
381423 case "`/bin/arch`" in
382424 sun3)
383425 echo m68k-sun-sunos${UNAME_RELEASE}
563605 else
564606 IBM_ARCH=powerpc
565607 fi
566 if [ -x /usr/bin/oslevel ] ; then
567 IBM_REV=`/usr/bin/oslevel`
608 if [ -x /usr/bin/lslpp ] ; then
609 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
610 awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
568611 else
569612 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
570613 fi
601644 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
602645 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
603646 case "${sc_cpu_version}" in
604 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
605 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
647 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
648 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
606649 532) # CPU_PA_RISC2_0
607650 case "${sc_kernel_bits}" in
608 32) HP_ARCH="hppa2.0n" ;;
609 64) HP_ARCH="hppa2.0w" ;;
610 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
651 32) HP_ARCH=hppa2.0n ;;
652 64) HP_ARCH=hppa2.0w ;;
653 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
611654 esac ;;
612655 esac
613656 fi
646689 exit (0);
647690 }
648691 EOF
649 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
692 (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
650693 test -z "$HP_ARCH" && HP_ARCH=hppa
651694 fi ;;
652695 esac
653 if [ ${HP_ARCH} = "hppa2.0w" ]
696 if [ ${HP_ARCH} = hppa2.0w ]
654697 then
655698 eval $set_cc_for_build
656699
663706 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
664707 # => hppa64-hp-hpux11.23
665708
666 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
709 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
667710 grep -q __LP64__
668711 then
669 HP_ARCH="hppa2.0w"
712 HP_ARCH=hppa2.0w
670713 else
671 HP_ARCH="hppa64"
714 HP_ARCH=hppa64
672715 fi
673716 fi
674717 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
773816 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
774817 exit ;;
775818 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
776 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
777 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
819 FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
820 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
778821 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
779822 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
780823 exit ;;
781824 5000:UNIX_System_V:4.*:*)
782 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
783 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
825 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
826 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
784827 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
785828 exit ;;
786829 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
796839 UNAME_PROCESSOR=`/usr/bin/uname -p`
797840 case ${UNAME_PROCESSOR} in
798841 amd64)
799 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
800 *)
801 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
842 UNAME_PROCESSOR=x86_64 ;;
843 i386)
844 UNAME_PROCESSOR=i586 ;;
802845 esac
846 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
803847 exit ;;
804848 i*:CYGWIN*:*)
805849 echo ${UNAME_MACHINE}-pc-cygwin
810854 *:MINGW*:*)
811855 echo ${UNAME_MACHINE}-pc-mingw32
812856 exit ;;
813 i*:MSYS*:*)
857 *:MSYS*:*)
814858 echo ${UNAME_MACHINE}-pc-msys
815859 exit ;;
816860 i*:windows32*:*)
858902 exit ;;
859903 *:GNU:*:*)
860904 # the GNU system
861 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
905 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
862906 exit ;;
863907 *:GNU/*:*:*)
864908 # other systems with GNU libc and userland
865 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
909 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
866910 exit ;;
867911 i*86:Minix:*:*)
868912 echo ${UNAME_MACHINE}-pc-minix
869913 exit ;;
870914 aarch64:Linux:*:*)
871 echo ${UNAME_MACHINE}-unknown-linux-gnu
915 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
872916 exit ;;
873917 aarch64_be:Linux:*:*)
874918 UNAME_MACHINE=aarch64_be
875 echo ${UNAME_MACHINE}-unknown-linux-gnu
919 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
876920 exit ;;
877921 alpha:Linux:*:*)
878922 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
885929 EV68*) UNAME_MACHINE=alphaev68 ;;
886930 esac
887931 objdump --private-headers /bin/sh | grep -q ld.so.1
888 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
889 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
932 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
933 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
934 exit ;;
935 arc:Linux:*:* | arceb:Linux:*:*)
936 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
890937 exit ;;
891938 arm*:Linux:*:*)
892939 eval $set_cc_for_build
893940 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
894941 | grep -q __ARM_EABI__
895942 then
896 echo ${UNAME_MACHINE}-unknown-linux-gnu
943 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
897944 else
898 case `sed -n '/^Hardware/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
899 BCM2708) MANUFACTURER=raspberry;;
900 *) MANUFACTURER=unknown;;
901 esac
902945 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
903946 | grep -q __ARM_PCS_VFP
904947 then
905 echo ${UNAME_MACHINE}-${MANUFACTURER}-linux-gnueabi
948 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
906949 else
907 echo ${UNAME_MACHINE}-${MANUFACTURER}-linux-gnueabihf
950 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
908951 fi
909952 fi
910953 exit ;;
911954 avr32*:Linux:*:*)
912 echo ${UNAME_MACHINE}-unknown-linux-gnu
955 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
913956 exit ;;
914957 cris:Linux:*:*)
915 echo ${UNAME_MACHINE}-axis-linux-gnu
958 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
916959 exit ;;
917960 crisv32:Linux:*:*)
918 echo ${UNAME_MACHINE}-axis-linux-gnu
961 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
962 exit ;;
963 e2k:Linux:*:*)
964 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
919965 exit ;;
920966 frv:Linux:*:*)
921 echo ${UNAME_MACHINE}-unknown-linux-gnu
967 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
922968 exit ;;
923969 hexagon:Linux:*:*)
924 echo ${UNAME_MACHINE}-unknown-linux-gnu
970 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
925971 exit ;;
926972 i*86:Linux:*:*)
927 LIBC=gnu
928 eval $set_cc_for_build
929 sed 's/^ //' << EOF >$dummy.c
930 #ifdef __dietlibc__
931 LIBC=dietlibc
932 #endif
933 EOF
934 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
935 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
973 echo ${UNAME_MACHINE}-pc-linux-${LIBC}
936974 exit ;;
937975 ia64:Linux:*:*)
938 echo ${UNAME_MACHINE}-unknown-linux-gnu
976 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
977 exit ;;
978 k1om:Linux:*:*)
979 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
939980 exit ;;
940981 m32r*:Linux:*:*)
941 echo ${UNAME_MACHINE}-unknown-linux-gnu
982 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
942983 exit ;;
943984 m68*:Linux:*:*)
944 echo ${UNAME_MACHINE}-unknown-linux-gnu
985 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
945986 exit ;;
946987 mips:Linux:*:* | mips64:Linux:*:*)
947988 eval $set_cc_for_build
9601001 #endif
9611002 EOF
9621003 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
963 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
1004 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
9641005 ;;
965 or32:Linux:*:*)
966 echo ${UNAME_MACHINE}-unknown-linux-gnu
1006 mips64el:Linux:*:*)
1007 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1008 exit ;;
1009 openrisc*:Linux:*:*)
1010 echo or1k-unknown-linux-${LIBC}
1011 exit ;;
1012 or32:Linux:*:* | or1k*:Linux:*:*)
1013 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9671014 exit ;;
9681015 padre:Linux:*:*)
969 echo sparc-unknown-linux-gnu
1016 echo sparc-unknown-linux-${LIBC}
9701017 exit ;;
9711018 parisc64:Linux:*:* | hppa64:Linux:*:*)
972 echo hppa64-unknown-linux-gnu
1019 echo hppa64-unknown-linux-${LIBC}
9731020 exit ;;
9741021 parisc:Linux:*:* | hppa:Linux:*:*)
9751022 # Look for CPU level
9761023 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
977 PA7*) echo hppa1.1-unknown-linux-gnu ;;
978 PA8*) echo hppa2.0-unknown-linux-gnu ;;
979 *) echo hppa-unknown-linux-gnu ;;
1024 PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
1025 PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
1026 *) echo hppa-unknown-linux-${LIBC} ;;
9801027 esac
9811028 exit ;;
9821029 ppc64:Linux:*:*)
983 echo powerpc64-unknown-linux-gnu
1030 echo powerpc64-unknown-linux-${LIBC}
9841031 exit ;;
9851032 ppc:Linux:*:*)
986 echo powerpc-unknown-linux-gnu
1033 echo powerpc-unknown-linux-${LIBC}
1034 exit ;;
1035 ppc64le:Linux:*:*)
1036 echo powerpc64le-unknown-linux-${LIBC}
1037 exit ;;
1038 ppcle:Linux:*:*)
1039 echo powerpcle-unknown-linux-${LIBC}
1040 exit ;;
1041 riscv32:Linux:*:* | riscv64:Linux:*:*)
1042 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9871043 exit ;;
9881044 s390:Linux:*:* | s390x:Linux:*:*)
989 echo ${UNAME_MACHINE}-ibm-linux
1045 echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
9901046 exit ;;
9911047 sh64*:Linux:*:*)
992 echo ${UNAME_MACHINE}-unknown-linux-gnu
1048 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9931049 exit ;;
9941050 sh*:Linux:*:*)
995 echo ${UNAME_MACHINE}-unknown-linux-gnu
1051 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9961052 exit ;;
9971053 sparc:Linux:*:* | sparc64:Linux:*:*)
998 echo ${UNAME_MACHINE}-unknown-linux-gnu
1054 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9991055 exit ;;
10001056 tile*:Linux:*:*)
1001 echo ${UNAME_MACHINE}-unknown-linux-gnu
1057 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10021058 exit ;;
10031059 vax:Linux:*:*)
1004 echo ${UNAME_MACHINE}-dec-linux-gnu
1060 echo ${UNAME_MACHINE}-dec-linux-${LIBC}
10051061 exit ;;
10061062 x86_64:Linux:*:*)
1007 echo ${UNAME_MACHINE}-unknown-linux-gnu
1063 echo ${UNAME_MACHINE}-pc-linux-${LIBC}
10081064 exit ;;
10091065 xtensa*:Linux:*:*)
1010 echo ${UNAME_MACHINE}-unknown-linux-gnu
1066 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10111067 exit ;;
10121068 i*86:DYNIX/ptx:4*:*)
10131069 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10831139 # uname -m prints for DJGPP always 'pc', but it prints nothing about
10841140 # the processor, so we play safe by assuming i586.
10851141 # Note: whatever this is, it MUST be the same as what config.sub
1086 # prints for the "djgpp" host, or else GDB configury will decide that
1142 # prints for the "djgpp" host, or else GDB configure will decide that
10871143 # this is a cross-build.
10881144 echo i586-pc-msdosdjgpp
10891145 exit ;;
12321288 SX-8R:SUPER-UX:*:*)
12331289 echo sx8r-nec-superux${UNAME_RELEASE}
12341290 exit ;;
1291 SX-ACE:SUPER-UX:*:*)
1292 echo sxace-nec-superux${UNAME_RELEASE}
1293 exit ;;
12351294 Power*:Rhapsody:*:*)
12361295 echo powerpc-apple-rhapsody${UNAME_RELEASE}
12371296 exit ;;
12401299 exit ;;
12411300 *:Darwin:*:*)
12421301 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1243 case $UNAME_PROCESSOR in
1244 i386)
1245 eval $set_cc_for_build
1246 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1247 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1248 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1249 grep IS_64BIT_ARCH >/dev/null
1250 then
1251 UNAME_PROCESSOR="x86_64"
1252 fi
1253 fi ;;
1254 unknown) UNAME_PROCESSOR=powerpc ;;
1255 esac
1302 eval $set_cc_for_build
1303 if test "$UNAME_PROCESSOR" = unknown ; then
1304 UNAME_PROCESSOR=powerpc
1305 fi
1306 if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1307 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1308 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1309 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1310 grep IS_64BIT_ARCH >/dev/null
1311 then
1312 case $UNAME_PROCESSOR in
1313 i386) UNAME_PROCESSOR=x86_64 ;;
1314 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1315 esac
1316 fi
1317 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1318 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1319 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1320 grep IS_PPC >/dev/null
1321 then
1322 UNAME_PROCESSOR=powerpc
1323 fi
1324 fi
1325 elif test "$UNAME_PROCESSOR" = i386 ; then
1326 # Avoid executing cc on OS X 10.9, as it ships with a stub
1327 # that puts up a graphical alert prompting to install
1328 # developer tools. Any system running Mac OS X 10.7 or
1329 # later (Darwin 11 and later) is required to have a 64-bit
1330 # processor. This is not true of the ARM version of Darwin
1331 # that Apple uses in portable devices.
1332 UNAME_PROCESSOR=x86_64
1333 fi
12561334 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12571335 exit ;;
12581336 *:procnto*:*:* | *:QNX:[0123456789]*:*)
12591337 UNAME_PROCESSOR=`uname -p`
1260 if test "$UNAME_PROCESSOR" = "x86"; then
1338 if test "$UNAME_PROCESSOR" = x86; then
12611339 UNAME_PROCESSOR=i386
12621340 UNAME_MACHINE=pc
12631341 fi
12661344 *:QNX:*:4*)
12671345 echo i386-pc-qnx
12681346 exit ;;
1269 NEO-?:NONSTOP_KERNEL:*:*)
1347 NEO-*:NONSTOP_KERNEL:*:*)
12701348 echo neo-tandem-nsk${UNAME_RELEASE}
12711349 exit ;;
12721350 NSE-*:NONSTOP_KERNEL:*:*)
12731351 echo nse-tandem-nsk${UNAME_RELEASE}
12741352 exit ;;
1275 NSR-?:NONSTOP_KERNEL:*:*)
1353 NSR-*:NONSTOP_KERNEL:*:*)
12761354 echo nsr-tandem-nsk${UNAME_RELEASE}
1355 exit ;;
1356 NSX-*:NONSTOP_KERNEL:*:*)
1357 echo nsx-tandem-nsk${UNAME_RELEASE}
12771358 exit ;;
12781359 *:NonStop-UX:*:*)
12791360 echo mips-compaq-nonstopux
12881369 # "uname -m" is not consistent, so use $cputype instead. 386
12891370 # is converted to i386 for consistency with other x86
12901371 # operating systems.
1291 if test "$cputype" = "386"; then
1372 if test "$cputype" = 386; then
12921373 UNAME_MACHINE=i386
12931374 else
12941375 UNAME_MACHINE="$cputype"
13301411 echo i386-pc-xenix
13311412 exit ;;
13321413 i*86:skyos:*:*)
1333 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1414 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
13341415 exit ;;
13351416 i*86:rdos:*:*)
13361417 echo ${UNAME_MACHINE}-pc-rdos
13411422 x86_64:VMkernel:*:*)
13421423 echo ${UNAME_MACHINE}-unknown-esx
13431424 exit ;;
1425 amd64:Isilon\ OneFS:*:*)
1426 echo x86_64-unknown-onefs
1427 exit ;;
13441428 esac
1345
1346 eval $set_cc_for_build
1347 cat >$dummy.c <<EOF
1348 #ifdef _SEQUENT_
1349 # include <sys/types.h>
1350 # include <sys/utsname.h>
1351 #endif
1352 main ()
1353 {
1354 #if defined (sony)
1355 #if defined (MIPSEB)
1356 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1357 I don't know.... */
1358 printf ("mips-sony-bsd\n"); exit (0);
1359 #else
1360 #include <sys/param.h>
1361 printf ("m68k-sony-newsos%s\n",
1362 #ifdef NEWSOS4
1363 "4"
1364 #else
1365 ""
1366 #endif
1367 ); exit (0);
1368 #endif
1369 #endif
1370
1371 #if defined (__arm) && defined (__acorn) && defined (__unix)
1372 printf ("arm-acorn-riscix\n"); exit (0);
1373 #endif
1374
1375 #if defined (hp300) && !defined (hpux)
1376 printf ("m68k-hp-bsd\n"); exit (0);
1377 #endif
1378
1379 #if defined (NeXT)
1380 #if !defined (__ARCHITECTURE__)
1381 #define __ARCHITECTURE__ "m68k"
1382 #endif
1383 int version;
1384 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1385 if (version < 4)
1386 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1387 else
1388 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1389 exit (0);
1390 #endif
1391
1392 #if defined (MULTIMAX) || defined (n16)
1393 #if defined (UMAXV)
1394 printf ("ns32k-encore-sysv\n"); exit (0);
1395 #else
1396 #if defined (CMU)
1397 printf ("ns32k-encore-mach\n"); exit (0);
1398 #else
1399 printf ("ns32k-encore-bsd\n"); exit (0);
1400 #endif
1401 #endif
1402 #endif
1403
1404 #if defined (__386BSD__)
1405 printf ("i386-pc-bsd\n"); exit (0);
1406 #endif
1407
1408 #if defined (sequent)
1409 #if defined (i386)
1410 printf ("i386-sequent-dynix\n"); exit (0);
1411 #endif
1412 #if defined (ns32000)
1413 printf ("ns32k-sequent-dynix\n"); exit (0);
1414 #endif
1415 #endif
1416
1417 #if defined (_SEQUENT_)
1418 struct utsname un;
1419
1420 uname(&un);
1421
1422 if (strncmp(un.version, "V2", 2) == 0) {
1423 printf ("i386-sequent-ptx2\n"); exit (0);
1424 }
1425 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1426 printf ("i386-sequent-ptx1\n"); exit (0);
1427 }
1428 printf ("i386-sequent-ptx\n"); exit (0);
1429
1430 #endif
1431
1432 #if defined (vax)
1433 # if !defined (ultrix)
1434 # include <sys/param.h>
1435 # if defined (BSD)
1436 # if BSD == 43
1437 printf ("vax-dec-bsd4.3\n"); exit (0);
1438 # else
1439 # if BSD == 199006
1440 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1441 # else
1442 printf ("vax-dec-bsd\n"); exit (0);
1443 # endif
1444 # endif
1445 # else
1446 printf ("vax-dec-bsd\n"); exit (0);
1447 # endif
1448 # else
1449 printf ("vax-dec-ultrix\n"); exit (0);
1450 # endif
1451 #endif
1452
1453 #if defined (alliant) && defined (i860)
1454 printf ("i860-alliant-bsd\n"); exit (0);
1455 #endif
1456
1457 exit (1);
1458 }
1459 EOF
1460
1461 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1462 { echo "$SYSTEM_NAME"; exit; }
1463
1464 # Apollos put the system type in the environment.
1465
1466 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1467
1468 # Convex versions that predate uname can use getsysinfo(1)
1469
1470 if [ -x /usr/convex/getsysinfo ]
1471 then
1472 case `getsysinfo -f cpu_type` in
1473 c1*)
1474 echo c1-convex-bsd
1475 exit ;;
1476 c2*)
1477 if getsysinfo -f scalar_acc
1478 then echo c32-convex-bsd
1479 else echo c2-convex-bsd
1480 fi
1481 exit ;;
1482 c34*)
1483 echo c34-convex-bsd
1484 exit ;;
1485 c38*)
1486 echo c38-convex-bsd
1487 exit ;;
1488 c4*)
1489 echo c4-convex-bsd
1490 exit ;;
1491 esac
1492 fi
14931429
14941430 cat >&2 <<EOF
14951431 $0: unable to guess system type
14961432
1497 This script, last modified $timestamp, has failed to recognize
1498 the operating system you are using. It is advised that you
1499 download the most up to date version of the config scripts from
1500
1501 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1433 This script (version $timestamp), has failed to recognize the
1434 operating system you are using. If your script is old, overwrite *all*
1435 copies of config.guess and config.sub with the latest versions from:
1436
1437 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
15021438 and
1503 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1504
1505 If the version you run ($0) is already up to date, please
1506 send the following data and any information you think might be
1507 pertinent to <config-patches@gnu.org> in order to provide the needed
1508 information to handle your system.
1439 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1440
1441 If $0 has already been updated, send the following data and any
1442 information you think might be pertinent to config-patches@gnu.org to
1443 provide the necessary information to handle your system.
15091444
15101445 config.guess timestamp = $timestamp
15111446
00 #! /bin/sh
11 # Configuration validation subroutine script.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
4 # 2011, 2012 Free Software Foundation, Inc.
5
6 timestamp='2012-08-18'
7
8 # This file is (in principle) common to ALL GNU software.
9 # The presence of a machine in this file suggests that SOME GNU software
10 # can handle that machine. It does not imply ALL GNU software can.
11 #
12 # This file is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
2 # Copyright 1992-2017 Free Software Foundation, Inc.
3
4 timestamp='2017-04-02'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
159 # (at your option) any later version.
1610 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
2115 #
2216 # You should have received a copy of the GNU General Public License
2317 # along with this program; if not, see <http://www.gnu.org/licenses/>.
2519 # As a special exception to the GNU General Public License, if you
2620 # distribute this file as part of a program that contains a
2721 # configuration script generated by Autoconf, you may include it under
28 # the same distribution terms that you use for the rest of that program.
29
30
31 # Please send patches to <config-patches@gnu.org>. Submit a context
32 # diff and a properly formatted GNU ChangeLog entry.
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25
26
27 # Please send patches to <config-patches@gnu.org>.
3328 #
3429 # Configuration subroutine to validate and canonicalize a configuration type.
3530 # Supply the specified configuration type as an argument.
3732 # Otherwise, we print the canonical config type on stdout and succeed.
3833
3934 # You can get the latest version of this script from:
40 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
35 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
4136
4237 # This file is supposed to be the same for all GNU packages
4338 # and recognize all the CPU types, system types and aliases
5752 me=`echo "$0" | sed -e 's,.*/,,'`
5853
5954 usage="\
60 Usage: $0 [OPTION] CPU-MFR-OPSYS
61 $0 [OPTION] ALIAS
55 Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
6256
6357 Canonicalize a configuration name.
6458
7266 version="\
7367 GNU config.sub ($timestamp)
7468
75 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
76 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
77 Free Software Foundation, Inc.
69 Copyright 1992-2017 Free Software Foundation, Inc.
7870
7971 This is free software; see the source for copying conditions. There is NO
8072 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
123115 case $maybe_os in
124116 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
125117 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
126 knetbsd*-gnu* | netbsd*-gnu* | \
127 kopensolaris*-gnu* | \
118 knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
119 kopensolaris*-gnu* | cloudabi*-eabi* | \
128120 storm-chaos* | os2-emx* | rtmk-nova*)
129121 os=-$maybe_os
130122 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
155147 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
156148 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
157149 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
158 -apple | -axis | -knuth | -cray | -microblaze)
150 -apple | -axis | -knuth | -cray | -microblaze*)
159151 os=
160152 basic_machine=$1
161153 ;;
258250 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
259251 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
260252 | am33_2.0 \
261 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
262 | be32 | be64 \
253 | arc | arceb \
254 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
255 | avr | avr32 \
256 | ba \
257 | be32 | be64 \
263258 | bfin \
264 | c4x | clipper \
259 | c4x | c8051 | clipper \
265260 | d10v | d30v | dlx | dsp16xx \
266 | epiphany \
267 | fido | fr30 | frv \
261 | e2k | epiphany \
262 | fido | fr30 | frv | ft32 \
268263 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
269264 | hexagon \
270 | i370 | i860 | i960 | ia64 \
265 | i370 | i860 | i960 | ia16 | ia64 \
271266 | ip2k | iq2000 \
267 | k1om \
272268 | le32 | le64 \
273269 | lm32 \
274270 | m32c | m32r | m32rle | m68000 | m68k | m88k \
275 | maxq | mb | microblaze | mcore | mep | metag \
271 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
276272 | mips | mipsbe | mipseb | mipsel | mipsle \
277273 | mips16 \
278274 | mips64 | mips64el \
286282 | mips64vr5900 | mips64vr5900el \
287283 | mipsisa32 | mipsisa32el \
288284 | mipsisa32r2 | mipsisa32r2el \
285 | mipsisa32r6 | mipsisa32r6el \
289286 | mipsisa64 | mipsisa64el \
290287 | mipsisa64r2 | mipsisa64r2el \
288 | mipsisa64r6 | mipsisa64r6el \
291289 | mipsisa64sb1 | mipsisa64sb1el \
292290 | mipsisa64sr71k | mipsisa64sr71kel \
291 | mipsr5900 | mipsr5900el \
293292 | mipstx39 | mipstx39el \
294293 | mn10200 | mn10300 \
295294 | moxie \
296295 | mt \
297296 | msp430 \
298297 | nds32 | nds32le | nds32be \
299 | nios | nios2 \
298 | nios | nios2 | nios2eb | nios2el \
300299 | ns16k | ns32k \
301 | open8 \
302 | or32 \
300 | open8 | or1k | or1knd | or32 \
303301 | pdp10 | pdp11 | pj | pjl \
304302 | powerpc | powerpc64 | powerpc64le | powerpcle \
303 | pru \
305304 | pyramid \
305 | riscv32 | riscv64 \
306306 | rl78 | rx \
307307 | score \
308 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
308 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
309309 | sh64 | sh64le \
310310 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
311311 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
313313 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
314314 | ubicom32 \
315315 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
316 | visium \
317 | wasm32 \
316318 | we32k \
317319 | x86 | xc16x | xstormy16 | xtensa \
318320 | z8k | z80)
327329 c6x)
328330 basic_machine=tic6x-unknown
329331 ;;
330 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
332 leon|leon[3-9])
333 basic_machine=sparc-$basic_machine
334 ;;
335 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
331336 basic_machine=$basic_machine-unknown
332337 os=-none
333338 ;;
382387 | aarch64-* | aarch64_be-* \
383388 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
384389 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
385 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
390 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
386391 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
387392 | avr-* | avr32-* \
393 | ba-* \
388394 | be32-* | be64-* \
389395 | bfin-* | bs2000-* \
390396 | c[123]* | c30-* | [cjt]90-* | c4x-* \
391 | clipper-* | craynv-* | cydra-* \
397 | c8051-* | clipper-* | craynv-* | cydra-* \
392398 | d10v-* | d30v-* | dlx-* \
393 | elxsi-* \
399 | e2k-* | elxsi-* \
394400 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
395401 | h8300-* | h8500-* \
396402 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
397403 | hexagon-* \
398 | i*86-* | i860-* | i960-* | ia64-* \
404 | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
399405 | ip2k-* | iq2000-* \
406 | k1om-* \
400407 | le32-* | le64-* \
401408 | lm32-* \
402409 | m32c-* | m32r-* | m32rle-* \
403410 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
404 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
411 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
412 | microblaze-* | microblazeel-* \
405413 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
406414 | mips16-* \
407415 | mips64-* | mips64el-* \
415423 | mips64vr5900-* | mips64vr5900el-* \
416424 | mipsisa32-* | mipsisa32el-* \
417425 | mipsisa32r2-* | mipsisa32r2el-* \
426 | mipsisa32r6-* | mipsisa32r6el-* \
418427 | mipsisa64-* | mipsisa64el-* \
419428 | mipsisa64r2-* | mipsisa64r2el-* \
429 | mipsisa64r6-* | mipsisa64r6el-* \
420430 | mipsisa64sb1-* | mipsisa64sb1el-* \
421431 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
432 | mipsr5900-* | mipsr5900el-* \
422433 | mipstx39-* | mipstx39el-* \
423434 | mmix-* \
424435 | mt-* \
425436 | msp430-* \
426437 | nds32-* | nds32le-* | nds32be-* \
427 | nios-* | nios2-* \
438 | nios-* | nios2-* | nios2eb-* | nios2el-* \
428439 | none-* | np1-* | ns16k-* | ns32k-* \
429440 | open8-* \
441 | or1k*-* \
430442 | orion-* \
431443 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
432444 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
445 | pru-* \
433446 | pyramid-* \
447 | riscv32-* | riscv64-* \
434448 | rl78-* | romp-* | rs6000-* | rx-* \
435449 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
436450 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
437451 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
438452 | sparclite-* \
439 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
453 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
440454 | tahoe-* \
441455 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
442456 | tile*-* \
444458 | ubicom32-* \
445459 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
446460 | vax-* \
461 | visium-* \
462 | wasm32-* \
447463 | we32k-* \
448464 | x86-* | x86_64-* | xc16x-* | xps100-* \
449465 | xstormy16-* | xtensa*-* \
520536 basic_machine=i386-pc
521537 os=-aros
522538 ;;
539 asmjs)
540 basic_machine=asmjs-unknown
541 ;;
523542 aux)
524543 basic_machine=m68k-apple
525544 os=-aux
639658 dpx2* | dpx2*-bull)
640659 basic_machine=m68k-bull
641660 os=-sysv3
661 ;;
662 e500v[12])
663 basic_machine=powerpc-unknown
664 os=$os"spe"
665 ;;
666 e500v[12]-*)
667 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
668 os=$os"spe"
642669 ;;
643670 ebmon29k)
644671 basic_machine=a29k-amd
781808 basic_machine=m68k-isi
782809 os=-sysv
783810 ;;
811 leon-*|leon[3-9]-*)
812 basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
813 ;;
784814 m68knommu)
785815 basic_machine=m68k-unknown
786816 os=-linux
800830 basic_machine=ns32k-utek
801831 os=-sysv
802832 ;;
803 microblaze)
833 microblaze*)
804834 basic_machine=microblaze-xilinx
805835 ;;
806836 mingw64)
808838 os=-mingw64
809839 ;;
810840 mingw32)
811 basic_machine=i386-pc
841 basic_machine=i686-pc
812842 os=-mingw32
813843 ;;
814844 mingw32ce)
836866 basic_machine=powerpc-unknown
837867 os=-morphos
838868 ;;
869 moxiebox)
870 basic_machine=moxie-unknown
871 os=-moxiebox
872 ;;
839873 msdos)
840874 basic_machine=i386-pc
841875 os=-msdos
844878 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
845879 ;;
846880 msys)
847 basic_machine=i386-pc
881 basic_machine=i686-pc
848882 os=-msys
849883 ;;
850884 mvs)
932966 nsr-tandem)
933967 basic_machine=nsr-tandem
934968 ;;
969 nsx-tandem)
970 basic_machine=nsx-tandem
971 ;;
935972 op50n-* | op60c-*)
936973 basic_machine=hppa1.1-oki
937974 os=-proelf
10161053 ppc-* | ppcbe-*)
10171054 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
10181055 ;;
1019 ppcle | powerpclittle | ppc-le | powerpc-little)
1056 ppcle | powerpclittle)
10201057 basic_machine=powerpcle-unknown
10211058 ;;
10221059 ppcle-* | powerpclittle-*)
10261063 ;;
10271064 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
10281065 ;;
1029 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
1066 ppc64le | powerpc64little)
10301067 basic_machine=powerpc64le-unknown
10311068 ;;
10321069 ppc64le-* | powerpc64little-*)
10391076 basic_machine=i586-unknown
10401077 os=-pw32
10411078 ;;
1042 rdos)
1079 rdos | rdos64)
1080 basic_machine=x86_64-pc
1081 os=-rdos
1082 ;;
1083 rdos32)
10431084 basic_machine=i386-pc
10441085 os=-rdos
10451086 ;;
12221263 vxworks29k)
12231264 basic_machine=a29k-wrs
12241265 os=-vxworks
1266 ;;
1267 wasm32)
1268 basic_machine=wasm32-unknown
12251269 ;;
12261270 w65*)
12271271 basic_machine=w65-wdc
13661410 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
13671411 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
13681412 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1369 | -sym* | -kopensolaris* \
1413 | -sym* | -kopensolaris* | -plan9* \
13701414 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1371 | -aos* | -aros* \
1415 | -aos* | -aros* | -cloudabi* | -sortix* \
13721416 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
13731417 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
13741418 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1375 | -bitrig* | -openbsd* | -solidbsd* \
1419 | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
13761420 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
13771421 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
13781422 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
13791423 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1380 | -chorusos* | -chorusrdb* | -cegcc* \
1424 | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
13811425 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1382 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1426 | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
13831427 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1384 | -uxpv* | -beos* | -mpeix* | -udk* \
1428 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
13851429 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
13861430 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
13871431 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
13881432 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
13891433 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
13901434 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1391 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1435 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
1436 | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
13921437 # Remember, each alternative MUST END IN *, to match a version number.
13931438 ;;
13941439 -qnx*)
14361481 -os400*)
14371482 os=-os400
14381483 ;;
1484 -cegcc*)
1485 os=-cegcc
1486 ;;
14391487 -wince*)
14401488 os=-wince
14411489 ;;
15171565 ;;
15181566 -aros*)
15191567 os=-aros
1520 ;;
1521 -kaos*)
1522 os=-kaos
15231568 ;;
15241569 -zvmoe)
15251570 os=-zvmoe
15331578 -pnacl*)
15341579 os=-pnacl
15351580 ;;
1581 -ios)
1582 ;;
1583 -emscripten*)
1584 ;;
15361585 -none)
15371586 ;;
15381587 *)
15731622 c4x-* | tic4x-*)
15741623 os=-coff
15751624 ;;
1625 c8051-*)
1626 os=-elf
1627 ;;
15761628 hexagon-*)
15771629 os=-elf
15781630 ;;
16241676 ;;
16251677 sparc-* | *-sun)
16261678 os=-sunos4.1.1
1679 ;;
1680 pru-*)
1681 os=-elf
16271682 ;;
16281683 *-be)
16291684 os=-beos
918918 with_smpeg_exec_prefix
919919 enable_smpegtest
920920 enable_music_mp3_mad_gpl
921 enable_music_mp3_mad_gpl_dithering
922 enable_music_mp3_mpg123
923 enable_music_mp3_mpg123_shared
921924 '
922925 ac_precious_vars='build_alias
923926 host_alias
15821585 dynamically load FLAC library [[default=yes]]
15831586 --enable-music-mp3 enable MP3 music [[default=yes]]
15841587 --enable-music-mp3-smpeg
1585 enable MP3 music via smpeg [[default=yes]]
1588 enable MP3 music via smpeg [[default=no]]
15861589 --enable-music-mp3-smpeg-shared
15871590 dynamically load smpeg library [[default=yes]]
15881591 --disable-smpegtest Do not try to compile and run a test SMPEG program
15891592 --enable-music-mp3-mad-gpl
15901593 enable MP3 music via libmad GPL code [[default=no]]
1594 --enable-music-mp3-mad-gpl-dithering
1595 enable MP3 music via libmad GPL code [[default=yes]]
1596 --enable-music-mp3-mpg123
1597 enable MP3 music via libmpg123 [[default=yes]]
1598 --enable-music-mp3-mpg123-shared
1599 dynamically load libmpg123 library [[default=yes]]
15911600
15921601 Optional Packages:
15931602 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
24382447 #
24392448 MAJOR_VERSION=2
24402449 MINOR_VERSION=0
2441 MICRO_VERSION=1
2442 INTERFACE_AGE=1
2443 BINARY_AGE=1
2450 MICRO_VERSION=2
2451 INTERFACE_AGE=0
2452 BINARY_AGE=2
24442453 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
24452454
24462455
39203929 else
39213930 lt_cv_nm_interface="BSD nm"
39223931 echo "int some_variable = 0;" > conftest.$ac_ext
3923 (eval echo "\"\$as_me:3924: $ac_compile\"" >&5)
3932 (eval echo "\"\$as_me:3933: $ac_compile\"" >&5)
39243933 (eval "$ac_compile" 2>conftest.err)
39253934 cat conftest.err >&5
3926 (eval echo "\"\$as_me:3927: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
3935 (eval echo "\"\$as_me:3936: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
39273936 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
39283937 cat conftest.err >&5
3929 (eval echo "\"\$as_me:3930: output\"" >&5)
3938 (eval echo "\"\$as_me:3939: output\"" >&5)
39303939 cat conftest.out >&5
39313940 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
39323941 lt_cv_nm_interface="MS dumpbin"
51375146 ;;
51385147 *-*-irix6*)
51395148 # Find out which ABI we are using.
5140 echo '#line 5141 "configure"' > conftest.$ac_ext
5149 echo '#line 5150 "configure"' > conftest.$ac_ext
51415150 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
51425151 (eval $ac_compile) 2>&5
51435152 ac_status=$?
52095218 x86_64-*linux*)
52105219 LD="${LD-ld} -m elf_x86_64"
52115220 ;;
5212 ppc*-*linux*|powerpc*-*linux*)
5221 powerpc64le-*linux*)
5222 LD="${LD-ld} -m elf64lppc"
5223 ;;
5224 powerpc64-*linux*)
52135225 LD="${LD-ld} -m elf64ppc"
52145226 ;;
52155227 s390*-*linux*|s390*-*tpf*)
69646976 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
69656977 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
69666978 -e 's:$: $lt_compiler_flag:'`
6967 (eval echo "\"\$as_me:6968: $lt_compile\"" >&5)
6979 (eval echo "\"\$as_me:6980: $lt_compile\"" >&5)
69686980 (eval "$lt_compile" 2>conftest.err)
69696981 ac_status=$?
69706982 cat conftest.err >&5
6971 echo "$as_me:6972: \$? = $ac_status" >&5
6983 echo "$as_me:6984: \$? = $ac_status" >&5
69726984 if (exit $ac_status) && test -s "$ac_outfile"; then
69736985 # The compiler can only warn and ignore the option if not recognized
69746986 # So say no if there are warnings other than the usual output.
73037315 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
73047316 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
73057317 -e 's:$: $lt_compiler_flag:'`
7306 (eval echo "\"\$as_me:7307: $lt_compile\"" >&5)
7318 (eval echo "\"\$as_me:7319: $lt_compile\"" >&5)
73077319 (eval "$lt_compile" 2>conftest.err)
73087320 ac_status=$?
73097321 cat conftest.err >&5
7310 echo "$as_me:7311: \$? = $ac_status" >&5
7322 echo "$as_me:7323: \$? = $ac_status" >&5
73117323 if (exit $ac_status) && test -s "$ac_outfile"; then
73127324 # The compiler can only warn and ignore the option if not recognized
73137325 # So say no if there are warnings other than the usual output.
74087420 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
74097421 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
74107422 -e 's:$: $lt_compiler_flag:'`
7411 (eval echo "\"\$as_me:7412: $lt_compile\"" >&5)
7423 (eval echo "\"\$as_me:7424: $lt_compile\"" >&5)
74127424 (eval "$lt_compile" 2>out/conftest.err)
74137425 ac_status=$?
74147426 cat out/conftest.err >&5
7415 echo "$as_me:7416: \$? = $ac_status" >&5
7427 echo "$as_me:7428: \$? = $ac_status" >&5
74167428 if (exit $ac_status) && test -s out/conftest2.$ac_objext
74177429 then
74187430 # The compiler can only warn and ignore the option if not recognized
74637475 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
74647476 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
74657477 -e 's:$: $lt_compiler_flag:'`
7466 (eval echo "\"\$as_me:7467: $lt_compile\"" >&5)
7478 (eval echo "\"\$as_me:7479: $lt_compile\"" >&5)
74677479 (eval "$lt_compile" 2>out/conftest.err)
74687480 ac_status=$?
74697481 cat out/conftest.err >&5
7470 echo "$as_me:7471: \$? = $ac_status" >&5
7482 echo "$as_me:7483: \$? = $ac_status" >&5
74717483 if (exit $ac_status) && test -s out/conftest2.$ac_objext
74727484 then
74737485 # The compiler can only warn and ignore the option if not recognized
98329844 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
98339845 lt_status=$lt_dlunknown
98349846 cat > conftest.$ac_ext <<_LT_EOF
9835 #line 9836 "configure"
9847 #line 9848 "configure"
98369848 #include "confdefs.h"
98379849
98389850 #if HAVE_DLFCN_H
99289940 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
99299941 lt_status=$lt_dlunknown
99309942 cat > conftest.$ac_ext <<_LT_EOF
9931 #line 9932 "configure"
9943 #line 9944 "configure"
99329944 #include "confdefs.h"
99339945
99349946 #if HAVE_DLFCN_H
1107911091 fi
1108011092 ;;
1108111093 *)
11082 SOURCES=""
1108311094 EXE=""
1108411095 ;;
1108511096 esac
1108611097
1108711098 # Standard C sources
11088 SOURCES="$SOURCES \
11089 $srcdir/effect_position.c \
11090 $srcdir/effect_stereoreverse.c \
11091 $srcdir/effects_internal.c \
11092 $srcdir/load_aiff.c \
11093 $srcdir/load_voc.c \
11094 $srcdir/mixer.c \
11095 $srcdir/music.c"
11099 SOURCES=`ls $srcdir/*.c | fgrep -v playwave.c | fgrep -v playmus.c`
1109611100
1109711101 base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
1109811102
1115611160 done
1115711161 }
1115811162
11159 SDL_VERSION=2.0.0
11163 SDL_VERSION=2.0.7
1116011164
1116111165
1116211166 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1171511719 enable_music_cmd=no
1171611720 fi
1171711721 if test "x$enable_music_cmd" != xno; then
11718 SOURCES="$SOURCES $srcdir/music_cmd.c"
11719 EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC"
11722 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_CMD"
1172011723 fi
1172111724 fi
1172211725
1172811731 fi
1172911732
1173011733 if test x$enable_music_wave = xyes; then
11731 SOURCES="$SOURCES $srcdir/wavestream.c"
11732 EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC"
11734 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_WAV"
1173311735 fi
1173411736
1173511737 # Check whether --enable-music-mod was given.
1182211824 fi
1182311825
1182411826
11825 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for have_libmodplug_lib=yes in -lmodplug" >&5
11826 $as_echo_n "checking for have_libmodplug_lib=yes in -lmodplug... " >&6; }
11827 if ${ac_cv_lib_modplug_have_libmodplug_lib_yes+:} false; then :
11827 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ModPlug_Load in -lmodplug" >&5
11828 $as_echo_n "checking for ModPlug_Load in -lmodplug... " >&6; }
11829 if ${ac_cv_lib_modplug_ModPlug_Load+:} false; then :
1182811830 $as_echo_n "(cached) " >&6
1182911831 else
1183011832 ac_check_lib_save_LIBS=$LIBS
1183811840 #ifdef __cplusplus
1183911841 extern "C"
1184011842 #endif
11841 char have_libmodplug_lib=yes ();
11843 char ModPlug_Load ();
1184211844 int
1184311845 main ()
1184411846 {
11845 return have_libmodplug_lib=yes ();
11847 return ModPlug_Load ();
1184611848 ;
1184711849 return 0;
1184811850 }
1184911851 _ACEOF
1185011852 if ac_fn_c_try_link "$LINENO"; then :
11851 ac_cv_lib_modplug_have_libmodplug_lib_yes=yes
11852 else
11853 ac_cv_lib_modplug_have_libmodplug_lib_yes=no
11853 ac_cv_lib_modplug_ModPlug_Load=yes
11854 else
11855 ac_cv_lib_modplug_ModPlug_Load=no
1185411856 fi
1185511857 rm -f core conftest.err conftest.$ac_objext \
1185611858 conftest$ac_exeext conftest.$ac_ext
1185711859 LIBS=$ac_check_lib_save_LIBS
1185811860 fi
11859 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_modplug_have_libmodplug_lib_yes" >&5
11860 $as_echo "$ac_cv_lib_modplug_have_libmodplug_lib_yes" >&6; }
11861 if test "x$ac_cv_lib_modplug_have_libmodplug_lib_yes" = xyes; then :
11862 cat >>confdefs.h <<_ACEOF
11863 #define HAVE_LIBMODPLUG 1
11864 _ACEOF
11865
11866 LIBS="-lmodplug $LIBS"
11867
11861 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_modplug_ModPlug_Load" >&5
11862 $as_echo "$ac_cv_lib_modplug_ModPlug_Load" >&6; }
11863 if test "x$ac_cv_lib_modplug_ModPlug_Load" = xyes; then :
11864 have_libmodplug_lib=yes
1186811865 fi
1186911866
1187011867
1187511872 fi
1187611873
1187711874
11878 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for have_libmodplug_lib=yes in -lmodplug" >&5
11879 $as_echo_n "checking for have_libmodplug_lib=yes in -lmodplug... " >&6; }
11880 if ${ac_cv_lib_modplug_have_libmodplug_lib_yes+:} false; then :
11875 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ModPlug_Load in -lmodplug" >&5
11876 $as_echo_n "checking for ModPlug_Load in -lmodplug... " >&6; }
11877 if ${ac_cv_lib_modplug_ModPlug_Load+:} false; then :
1188111878 $as_echo_n "(cached) " >&6
1188211879 else
1188311880 ac_check_lib_save_LIBS=$LIBS
1189111888 #ifdef __cplusplus
1189211889 extern "C"
1189311890 #endif
11894 char have_libmodplug_lib=yes ();
11891 char ModPlug_Load ();
1189511892 int
1189611893 main ()
1189711894 {
11898 return have_libmodplug_lib=yes ();
11895 return ModPlug_Load ();
1189911896 ;
1190011897 return 0;
1190111898 }
1190211899 _ACEOF
1190311900 if ac_fn_c_try_link "$LINENO"; then :
11904 ac_cv_lib_modplug_have_libmodplug_lib_yes=yes
11905 else
11906 ac_cv_lib_modplug_have_libmodplug_lib_yes=no
11901 ac_cv_lib_modplug_ModPlug_Load=yes
11902 else
11903 ac_cv_lib_modplug_ModPlug_Load=no
1190711904 fi
1190811905 rm -f core conftest.err conftest.$ac_objext \
1190911906 conftest$ac_exeext conftest.$ac_ext
1191011907 LIBS=$ac_check_lib_save_LIBS
1191111908 fi
11912 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_modplug_have_libmodplug_lib_yes" >&5
11913 $as_echo "$ac_cv_lib_modplug_have_libmodplug_lib_yes" >&6; }
11914 if test "x$ac_cv_lib_modplug_have_libmodplug_lib_yes" = xyes; then :
11915 cat >>confdefs.h <<_ACEOF
11916 #define HAVE_LIBMODPLUG 1
11917 _ACEOF
11918
11919 LIBS="-lmodplug $LIBS"
11920
11909 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_modplug_ModPlug_Load" >&5
11910 $as_echo "$ac_cv_lib_modplug_ModPlug_Load" >&6; }
11911 if test "x$ac_cv_lib_modplug_ModPlug_Load" = xyes; then :
11912 have_libmodplug_lib=yes
1192111913 fi
1192211914
1192311915
1194711939 fi
1194811940 ;;
1194911941 esac
11950 SOURCES="$SOURCES $srcdir/*_modplug.c"
11951 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_MUSIC $MODPLUG_CFLAGS"
11942 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MOD_MODPLUG $MODPLUG_CFLAGS"
1195211943 if test x$enable_music_mod_modplug_shared = xyes && test x$modplug_lib != x; then
1195311944 echo "-- dynamic libmodplug -> $modplug_lib"
1195411945 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_DYNAMIC=\\\"$modplug_lib\\\""
1202612017
1202712018 CFLAGS_SAVED="$CFLAGS"
1202812019 LIBS_SAVED="$LIBS"
12029 CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
12020 CFLAGS="$CFLAGS `$LIBMIKMOD_CONFIG --cflags`"
1203012021 LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
1203112022 have_libmikmod=yes
1203212023 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmikmod - version >= $libmikmod_ver" >&5
1207912070 fi
1208012071 ;;
1208112072 esac
12082 SOURCES="$SOURCES $srcdir/*_mod.c"
12083 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
12073 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MOD_MIKMOD `$LIBMIKMOD_CONFIG --cflags`"
1208412074 if test x$enable_music_mod_mikmod_shared = xyes && test x$mikmod_lib != x; then
1208512075 echo "-- dynamic libmikmod -> $mikmod_lib"
12086 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_DYNAMIC=\\\"$mikmod_lib\\\""
12076 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMIKMOD_DYNAMIC=\\\"$mikmod_lib\\\""
1208712077 else
1208812078 EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$LIBMIKMOD_CONFIG --libs`"
1208912079 fi
1210612096 fi
1210712097
1210812098 if test x$enable_music_midi = xyes; then
12109 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC"
12099 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID"
1211012100 # Check whether --enable-music-midi-timidity was given.
1211112101 if test "${enable_music_midi_timidity+set}" = set; then :
1211212102 enableval=$enable_music_midi_timidity;
1211512105 fi
1211612106
1211712107 if test x$enable_music_midi_timidity = xyes; then
12118 EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity"
12108 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_TIMIDITY -I\$(srcdir)/timidity"
1211912109 SOURCES="$SOURCES $srcdir/timidity/*.c"
1212012110 fi
1212112111 # Check whether --enable-music-midi-native was given.
1214512135 ;;
1214612136 esac
1214712137 if test x$use_music_midi_native = xyes; then
12148 EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
12138 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_NATIVE -I\$(srcdir)/native_midi"
1214912139 SOURCES="$SOURCES $srcdir/native_midi/*.c"
1215012140 elif test x$use_music_midi_native = xyes_cpp; then
12151 EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
12141 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_NATIVE -I\$(srcdir)/native_midi"
1215212142 SOURCES="$SOURCES $srcdir/native_midi/*.c"
1215312143 SOURCES_CXX="$SOURCES_CXX $srcdir/native_midi/*.cpp"
1215412144 fi
1223012220 fi
1223112221 ;;
1223212222 esac
12233 SOURCES="$SOURCES $srcdir/dynamic_fluidsynth.c $srcdir/fluidsynth.c"
12234 EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_FLUIDSYNTH_MIDI"
12223 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_FLUIDSYNTH"
1223512224 if test x$enable_music_midi_fluidsynth_shared = xyes && test x$fluidsynth_lib != x; then
12236 echo "-- dynamic libfluidsyth -> $fluidsynth_lib"
12225 echo "-- dynamic libfluidsynth -> $fluidsynth_lib"
1223712226 EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLUIDSYNTH_DYNAMIC=\\\"$fluidsynth_lib\\\""
1223812227 else
1223912228 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lfluidsynth"
1234012329 fi
1234112330 ;;
1234212331 esac
12343 SOURCES="$SOURCES $srcdir/*_ogg.c"
12344 EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC -DOGG_USE_TREMOR"
12332 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_OGG -DOGG_USE_TREMOR"
1234512333 if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
1234612334 echo "-- dynamic libvorbisidec -> $ogg_lib"
1234712335 EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
1241812406 fi
1241912407 ;;
1242012408 esac
12421 SOURCES="$SOURCES $srcdir/*_ogg.c"
12422 EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC"
12409 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_OGG"
1242312410 if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
1242412411 echo "-- dynamic libvorbisfile -> $ogg_lib"
1242512412 EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
1255412541 fi
1255512542 ;;
1255612543 esac
12557 SOURCES="$SOURCES $srcdir/*_flac.c"
12558 EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_MUSIC"
12544 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_FLAC"
1255912545 if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then
1256012546 echo "-- dynamic libFLAC -> $flac_lib"
1256112547 EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\""
1258312569 if test "${enable_music_mp3_smpeg+set}" = set; then :
1258412570 enableval=$enable_music_mp3_smpeg;
1258512571 else
12586 enable_music_mp3_smpeg=yes
12572 enable_music_mp3_smpeg=no
1258712573 fi
1258812574
1258912575 # Check whether --enable-music-mp3-smpeg-shared was given.
1284712833 smpeg_lib=`find_lib "libsmpeg2*.so.*"`
1284812834 ;;
1284912835 esac
12850 SOURCES="$SOURCES $srcdir/*_mp3.c"
12851 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
12836 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_SMPEG $SMPEG_CFLAGS"
1285212837 if test x$enable_music_mp3_smpeg_shared = xyes && test x$smpeg_lib != x; then
1285312838 echo "-- dynamic libsmpeg -> $smpeg_lib"
12854 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\""
12839 EXTRA_CFLAGS="$EXTRA_CFLAGS -DSMPEG_DYNAMIC=\\\"$smpeg_lib\\\""
1285512840 else
1285612841 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
1285712842 fi
1286812853 enable_music_mp3_mad_gpl=no
1286912854 fi
1287012855
12856 # Check whether --enable-music-mp3-mad-gpl-dithering was given.
12857 if test "${enable_music_mp3_mad_gpl_dithering+set}" = set; then :
12858 enableval=$enable_music_mp3_mad_gpl_dithering;
12859 else
12860 enable_music_mp3_mad_gpl_dithering=yes
12861 fi
12862
1287112863 if test x$enable_music_mp3 = xyes -a x$enable_music_mp3_mad_gpl = xyes; then
1287212864 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmad headers" >&5
1287312865 $as_echo_n "checking for libmad headers... " >&6; }
1289512887 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_libmad" >&5
1289612888 $as_echo "$have_libmad" >&6; }
1289712889 if test x$have_libmad = xyes; then
12898 SOURCES="$SOURCES $srcdir/music_mad.c"
12899 if echo "$SOURCES" | grep "load_mp3.c" >/dev/null; then
12900 :
12901 else
12902 SOURCES="$SOURCES $srcdir/load_mp3.c"
12890 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MAD"
12891 if test x$enable_music_mp3_mad_gpl_dithering = xyes; then
12892 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Using GPL libmad and MP3 dithering routines, this build of SDL_mixer is now under the GPL" >&5
12893 $as_echo "$as_me: WARNING: *** Using GPL libmad and MP3 dithering routines, this build of SDL_mixer is now under the GPL" >&2;}
12894 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MAD_GPL_DITHERING"
1290312895 fi
12904 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MAD_MUSIC"
1290512896 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
1290612897 else
1290712898 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to find MAD library (http://www.underbit.com/products/mad/)" >&5
1290912900 fi
1291012901 fi
1291112902
12912 if test x$have_smpeg != xyes -a x$have_libmad != xyes; then
12903 # Check whether --enable-music-mp3-mpg123 was given.
12904 if test "${enable_music_mp3_mpg123+set}" = set; then :
12905 enableval=$enable_music_mp3_mpg123;
12906 else
12907 enable_music_mp3_mpg123=yes
12908 fi
12909
12910 # Check whether --enable-music-mp3-mpg123-shared was given.
12911 if test "${enable_music_mp3_mpg123_shared+set}" = set; then :
12912 enableval=$enable_music_mp3_mpg123_shared;
12913 else
12914 enable_music_mp3_mpg123_shared=yes
12915 fi
12916
12917 if test x$enable_music_mp3_mpg123 = xyes; then
12918 ac_fn_c_check_header_mongrel "$LINENO" "mpg123.h" "ac_cv_header_mpg123_h" "$ac_includes_default"
12919 if test "x$ac_cv_header_mpg123_h" = xyes; then :
12920 have_mpg123_hdr=yes
12921 fi
12922
12923
12924 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpg123_replace_reader_handle in -lmpg123" >&5
12925 $as_echo_n "checking for mpg123_replace_reader_handle in -lmpg123... " >&6; }
12926 if ${ac_cv_lib_mpg123_mpg123_replace_reader_handle+:} false; then :
12927 $as_echo_n "(cached) " >&6
12928 else
12929 ac_check_lib_save_LIBS=$LIBS
12930 LIBS="-lmpg123 $LIBS"
12931 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12932 /* end confdefs.h. */
12933
12934 /* Override any GCC internal prototype to avoid an error.
12935 Use char because int might match the return type of a GCC
12936 builtin and then its argument prototype would still apply. */
12937 #ifdef __cplusplus
12938 extern "C"
12939 #endif
12940 char mpg123_replace_reader_handle ();
12941 int
12942 main ()
12943 {
12944 return mpg123_replace_reader_handle ();
12945 ;
12946 return 0;
12947 }
12948 _ACEOF
12949 if ac_fn_c_try_link "$LINENO"; then :
12950 ac_cv_lib_mpg123_mpg123_replace_reader_handle=yes
12951 else
12952 ac_cv_lib_mpg123_mpg123_replace_reader_handle=no
12953 fi
12954 rm -f core conftest.err conftest.$ac_objext \
12955 conftest$ac_exeext conftest.$ac_ext
12956 LIBS=$ac_check_lib_save_LIBS
12957 fi
12958 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpg123_mpg123_replace_reader_handle" >&5
12959 $as_echo "$ac_cv_lib_mpg123_mpg123_replace_reader_handle" >&6; }
12960 if test "x$ac_cv_lib_mpg123_mpg123_replace_reader_handle" = xyes; then :
12961 have_mpg123_lib=yes
12962 fi
12963
12964 if test x$have_mpg123_hdr = xyes -a x$have_mpg123_lib = xyes; then
12965 have_mpg123=yes
12966 case "$host" in
12967 *-*-darwin*)
12968 mpg123_lib=`find_lib libmpg123.dylib`
12969 ;;
12970 *-*-cygwin* | *-*-mingw32*)
12971 mpg123_lib=`find_lib "libmpg123*.dll"`
12972 ;;
12973 *)
12974 mpg123_lib=`find_lib "libmpg123.so.*"`
12975 ;;
12976 esac
12977 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MPG123"
12978 if test x$enable_music_mp3_mpg123_shared = xyes && test x$mpg123_lib != x; then
12979 echo "-- dynamic libmpg123 -> $mpg123_lib"
12980 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMPG123_DYNAMIC=\\\"$mpg123_lib\\\""
12981 else
12982 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmpg123"
12983 fi
12984 else
12985 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to find mpg123 library (https://www.mpg123.de)" >&5
12986 $as_echo "$as_me: WARNING: *** Unable to find mpg123 library (https://www.mpg123.de)" >&2;}
12987 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mpg123 support disabled" >&5
12988 $as_echo "$as_me: WARNING: mpg123 support disabled" >&2;}
12989 fi
12990 fi
12991
12992 if test x$have_smpeg = xyes -o x$have_libmad = xyes -o x$have_libmpg123; then
12993 :
12994 else
1291312995 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: MP3 support disabled" >&5
1291412996 $as_echo "$as_me: WARNING: MP3 support disabled" >&2;}
1291512997 fi
1313 #
1414 MAJOR_VERSION=2
1515 MINOR_VERSION=0
16 MICRO_VERSION=1
17 INTERFACE_AGE=1
18 BINARY_AGE=1
16 MICRO_VERSION=2
17 INTERFACE_AGE=0
18 BINARY_AGE=2
1919 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
2020
2121 AC_SUBST(MAJOR_VERSION)
129129 fi
130130 ;;
131131 *)
132 SOURCES=""
133132 EXE=""
134133 ;;
135134 esac
136135
137136 # Standard C sources
138 SOURCES="$SOURCES \
139 $srcdir/effect_position.c \
140 $srcdir/effect_stereoreverse.c \
141 $srcdir/effects_internal.c \
142 $srcdir/load_aiff.c \
143 $srcdir/load_voc.c \
144 $srcdir/mixer.c \
145 $srcdir/music.c"
137 SOURCES=`ls $srcdir/*.c | fgrep -v playwave.c | fgrep -v playmus.c`
146138
147139 dnl set this to use on systems that use lib64 instead of lib
148140 base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
195187 }
196188
197189 dnl Check for SDL
198 SDL_VERSION=2.0.0
190 SDL_VERSION=2.0.7
199191 AM_PATH_SDL2($SDL_VERSION,
200192 :,
201193 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
228220 enable_music_cmd=no
229221 fi
230222 if test "x$enable_music_cmd" != xno; then
231 SOURCES="$SOURCES $srcdir/music_cmd.c"
232 EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC"
223 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_CMD"
233224 fi
234225 fi
235226
237228 AC_HELP_STRING([--enable-music-wave], [enable streaming WAVE music [[default=yes]]]),
238229 [], [enable_music_wave=yes])
239230 if test x$enable_music_wave = xyes; then
240 SOURCES="$SOURCES $srcdir/wavestream.c"
241 EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC"
231 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_WAV"
242232 fi
243233
244234 AC_ARG_ENABLE([music-mod],
257247 have_libmodplug_lib=yes
258248 ], [dnl
259249 AC_CHECK_HEADER([libmodplug/modplug.h], [have_libmodplug_hdr=yes])
260 AC_CHECK_LIB([modplug], [have_libmodplug_lib=yes])
250 AC_CHECK_LIB([modplug], [ModPlug_Load], [have_libmodplug_lib=yes])
261251 ])
262252
263253 if test x$have_libmodplug_hdr = xyes -a x$have_libmodplug_lib = xyes; then
276266 fi
277267 ;;
278268 esac
279 SOURCES="$SOURCES $srcdir/*_modplug.c"
280 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_MUSIC $MODPLUG_CFLAGS"
269 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MOD_MODPLUG $MODPLUG_CFLAGS"
281270 if test x$enable_music_mod_modplug_shared = xyes && test x$modplug_lib != x; then
282271 echo "-- dynamic libmodplug -> $modplug_lib"
283272 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_DYNAMIC=\\\"$modplug_lib\\\""
306295
307296 CFLAGS_SAVED="$CFLAGS"
308297 LIBS_SAVED="$LIBS"
309 CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
298 CFLAGS="$CFLAGS `$LIBMIKMOD_CONFIG --cflags`"
310299 LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
311300 have_libmikmod=yes
312301 AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
344333 fi
345334 ;;
346335 esac
347 SOURCES="$SOURCES $srcdir/*_mod.c"
348 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
336 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MOD_MIKMOD `$LIBMIKMOD_CONFIG --cflags`"
349337 if test x$enable_music_mod_mikmod_shared = xyes && test x$mikmod_lib != x; then
350338 echo "-- dynamic libmikmod -> $mikmod_lib"
351 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_DYNAMIC=\\\"$mikmod_lib\\\""
339 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMIKMOD_DYNAMIC=\\\"$mikmod_lib\\\""
352340 else
353341 EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$LIBMIKMOD_CONFIG --libs`"
354342 fi
365353 AC_HELP_STRING([--enable-music-midi], [enable MIDI music [[default=yes]]]),
366354 [], [enable_music_midi=yes])
367355 if test x$enable_music_midi = xyes; then
368 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC"
356 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID"
369357 AC_ARG_ENABLE([music-midi-timidity],
370358 AC_HELP_STRING([--enable-music-midi-timidity], [enable timidity MIDI output [[default=yes]]]),
371359 [], [enable_music_midi_timidity=yes])
372360 if test x$enable_music_midi_timidity = xyes; then
373 EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity"
361 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_TIMIDITY -I\$(srcdir)/timidity"
374362 SOURCES="$SOURCES $srcdir/timidity/*.c"
375363 fi
376364 AC_ARG_ENABLE([music-midi-native],
396384 ;;
397385 esac
398386 if test x$use_music_midi_native = xyes; then
399 EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
387 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_NATIVE -I\$(srcdir)/native_midi"
400388 SOURCES="$SOURCES $srcdir/native_midi/*.c"
401389 elif test x$use_music_midi_native = xyes_cpp; then
402 EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
390 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_NATIVE -I\$(srcdir)/native_midi"
403391 SOURCES="$SOURCES $srcdir/native_midi/*.c"
404392 SOURCES_CXX="$SOURCES_CXX $srcdir/native_midi/*.cpp"
405393 fi
429417 fi
430418 ;;
431419 esac
432 SOURCES="$SOURCES $srcdir/dynamic_fluidsynth.c $srcdir/fluidsynth.c"
433 EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_FLUIDSYNTH_MIDI"
420 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_FLUIDSYNTH"
434421 if test x$enable_music_midi_fluidsynth_shared = xyes && test x$fluidsynth_lib != x; then
435 echo "-- dynamic libfluidsyth -> $fluidsynth_lib"
422 echo "-- dynamic libfluidsynth -> $fluidsynth_lib"
436423 EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLUIDSYNTH_DYNAMIC=\\\"$fluidsynth_lib\\\""
437424 else
438425 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lfluidsynth"
478465 fi
479466 ;;
480467 esac
481 SOURCES="$SOURCES $srcdir/*_ogg.c"
482 EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC -DOGG_USE_TREMOR"
468 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_OGG -DOGG_USE_TREMOR"
483469 if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
484470 echo "-- dynamic libvorbisidec -> $ogg_lib"
485471 EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
508494 fi
509495 ;;
510496 esac
511 SOURCES="$SOURCES $srcdir/*_ogg.c"
512 EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC"
497 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_OGG"
513498 if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
514499 echo "-- dynamic libvorbisfile -> $ogg_lib"
515500 EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
568553 fi
569554 ;;
570555 esac
571 SOURCES="$SOURCES $srcdir/*_flac.c"
572 EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_MUSIC"
556 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_FLAC"
573557 if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then
574558 echo "-- dynamic libFLAC -> $flac_lib"
575559 EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\""
588572 [], enable_music_mp3=yes)
589573
590574 AC_ARG_ENABLE(music-mp3-smpeg,
591 AC_HELP_STRING([--enable-music-mp3-smpeg], [enable MP3 music via smpeg [[default=yes]]]),
592 [], enable_music_mp3_smpeg=yes)
575 AC_HELP_STRING([--enable-music-mp3-smpeg], [enable MP3 music via smpeg [[default=no]]]),
576 [], enable_music_mp3_smpeg=no)
593577 AC_ARG_ENABLE([music-mp3-smpeg-shared],
594578 AC_HELP_STRING([--enable-music-mp3-smpeg-shared], [dynamically load smpeg library [[default=yes]]]),
595579 [], [enable_music_mp3_smpeg_shared=yes])
608592 smpeg_lib=[`find_lib "libsmpeg2*.so.*"`]
609593 ;;
610594 esac
611 SOURCES="$SOURCES $srcdir/*_mp3.c"
612 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
595 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_SMPEG $SMPEG_CFLAGS"
613596 if test x$enable_music_mp3_smpeg_shared = xyes && test x$smpeg_lib != x; then
614597 echo "-- dynamic libsmpeg -> $smpeg_lib"
615 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\""
598 EXTRA_CFLAGS="$EXTRA_CFLAGS -DSMPEG_DYNAMIC=\\\"$smpeg_lib\\\""
616599 else
617600 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
618601 fi
624607 AC_ARG_ENABLE(music-mp3-mad-gpl,
625608 AC_HELP_STRING([--enable-music-mp3-mad-gpl], [enable MP3 music via libmad GPL code [[default=no]]]),
626609 [], [enable_music_mp3_mad_gpl=no])
610 AC_ARG_ENABLE(music-mp3-mad-gpl-dithering,
611 AC_HELP_STRING([--enable-music-mp3-mad-gpl-dithering], [enable MP3 music via libmad GPL code [[default=yes]]]),
612 [], [enable_music_mp3_mad_gpl_dithering=yes])
627613 if test x$enable_music_mp3 = xyes -a x$enable_music_mp3_mad_gpl = xyes; then
628614 AC_MSG_CHECKING(for libmad headers)
629615 have_libmad=no
635621 ])
636622 AC_MSG_RESULT($have_libmad)
637623 if test x$have_libmad = xyes; then
638 SOURCES="$SOURCES $srcdir/music_mad.c"
639 if echo "$SOURCES" | grep "load_mp3.c" >/dev/null; then
640 :
624 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MAD"
625 if test x$enable_music_mp3_mad_gpl_dithering = xyes; then
626 AC_MSG_WARN([*** Using GPL libmad and MP3 dithering routines, this build of SDL_mixer is now under the GPL])
627 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MAD_GPL_DITHERING"
628 fi
629 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
630 else
631 AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)])
632 fi
633 fi
634
635 AC_ARG_ENABLE(music-mp3-mpg123,
636 AC_HELP_STRING([--enable-music-mp3-mpg123], [enable MP3 music via libmpg123 [[default=yes]]]),
637 [], [enable_music_mp3_mpg123=yes])
638 AC_ARG_ENABLE([music-mp3-mpg123-shared],
639 AC_HELP_STRING([--enable-music-mp3-mpg123-shared], [dynamically load libmpg123 library [[default=yes]]]),
640 [], [enable_music_mp3_mpg123_shared=yes])
641 if test x$enable_music_mp3_mpg123 = xyes; then
642 AC_CHECK_HEADER([mpg123.h], [have_mpg123_hdr=yes])
643 AC_CHECK_LIB([mpg123], [mpg123_replace_reader_handle], [have_mpg123_lib=yes])
644 if test x$have_mpg123_hdr = xyes -a x$have_mpg123_lib = xyes; then
645 have_mpg123=yes
646 case "$host" in
647 *-*-darwin*)
648 mpg123_lib=[`find_lib libmpg123.dylib`]
649 ;;
650 *-*-cygwin* | *-*-mingw32*)
651 mpg123_lib=[`find_lib "libmpg123*.dll"`]
652 ;;
653 *)
654 mpg123_lib=[`find_lib "libmpg123.so.*"`]
655 ;;
656 esac
657 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MPG123"
658 if test x$enable_music_mp3_mpg123_shared = xyes && test x$mpg123_lib != x; then
659 echo "-- dynamic libmpg123 -> $mpg123_lib"
660 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMPG123_DYNAMIC=\\\"$mpg123_lib\\\""
641661 else
642 SOURCES="$SOURCES $srcdir/load_mp3.c"
643 fi
644 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MAD_MUSIC"
645 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
646 else
647 AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)])
648 fi
649 fi
650
651 if test x$have_smpeg != xyes -a x$have_libmad != xyes; then
662 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmpg123"
663 fi
664 else
665 AC_MSG_WARN([*** Unable to find mpg123 library (https://www.mpg123.de)])
666 AC_MSG_WARN([mpg123 support disabled])
667 fi
668 fi
669
670 if test x$have_smpeg = xyes -o x$have_libmad = xyes -o x$have_libmpg123; then
671 :
672 else
652673 AC_MSG_WARN([MP3 support disabled])
653674 fi
654675
+0
-187
dynamic_flac.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 Implementation of the dynamic loading functionality for libFLAC.
21 ~ Austen Dicken (admin@cvpcs.org)
22 */
23
24 #ifdef FLAC_MUSIC
25
26 #include "SDL_loadso.h"
27 #include "SDL_mixer.h"
28 #include "dynamic_flac.h"
29
30 flac_loader flac = {
31 0, NULL
32 };
33
34 #ifdef FLAC_DYNAMIC
35 int Mix_InitFLAC()
36 {
37 if ( flac.loaded == 0 ) {
38 flac.handle = SDL_LoadObject(FLAC_DYNAMIC);
39 if ( flac.handle == NULL ) {
40 return -1;
41 }
42 flac.FLAC__stream_decoder_new =
43 (FLAC__StreamDecoder *(*)())
44 SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_new");
45 if ( flac.FLAC__stream_decoder_new == NULL ) {
46 SDL_UnloadObject(flac.handle);
47 return -1;
48 }
49 flac.FLAC__stream_decoder_delete =
50 (void (*)(FLAC__StreamDecoder *))
51 SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_delete");
52 if ( flac.FLAC__stream_decoder_delete == NULL ) {
53 SDL_UnloadObject(flac.handle);
54 return -1;
55 }
56 flac.FLAC__stream_decoder_init_stream =
57 (FLAC__StreamDecoderInitStatus (*)(
58 FLAC__StreamDecoder *,
59 FLAC__StreamDecoderReadCallback,
60 FLAC__StreamDecoderSeekCallback,
61 FLAC__StreamDecoderTellCallback,
62 FLAC__StreamDecoderLengthCallback,
63 FLAC__StreamDecoderEofCallback,
64 FLAC__StreamDecoderWriteCallback,
65 FLAC__StreamDecoderMetadataCallback,
66 FLAC__StreamDecoderErrorCallback,
67 void *))
68 SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_init_stream");
69 if ( flac.FLAC__stream_decoder_init_stream == NULL ) {
70 SDL_UnloadObject(flac.handle);
71 return -1;
72 }
73 flac.FLAC__stream_decoder_finish =
74 (FLAC__bool (*)(FLAC__StreamDecoder *))
75 SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_finish");
76 if ( flac.FLAC__stream_decoder_finish == NULL ) {
77 SDL_UnloadObject(flac.handle);
78 return -1;
79 }
80 flac.FLAC__stream_decoder_flush =
81 (FLAC__bool (*)(FLAC__StreamDecoder *))
82 SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_flush");
83 if ( flac.FLAC__stream_decoder_flush == NULL ) {
84 SDL_UnloadObject(flac.handle);
85 return -1;
86 }
87 flac.FLAC__stream_decoder_process_single =
88 (FLAC__bool (*)(FLAC__StreamDecoder *))
89 SDL_LoadFunction(flac.handle,
90 "FLAC__stream_decoder_process_single");
91 if ( flac.FLAC__stream_decoder_process_single == NULL ) {
92 SDL_UnloadObject(flac.handle);
93 return -1;
94 }
95 flac.FLAC__stream_decoder_process_until_end_of_metadata =
96 (FLAC__bool (*)(FLAC__StreamDecoder *))
97 SDL_LoadFunction(flac.handle,
98 "FLAC__stream_decoder_process_until_end_of_metadata");
99 if ( flac.FLAC__stream_decoder_process_until_end_of_metadata == NULL ) {
100 SDL_UnloadObject(flac.handle);
101 return -1;
102 }
103 flac.FLAC__stream_decoder_process_until_end_of_stream =
104 (FLAC__bool (*)(FLAC__StreamDecoder *))
105 SDL_LoadFunction(flac.handle,
106 "FLAC__stream_decoder_process_until_end_of_stream");
107 if ( flac.FLAC__stream_decoder_process_until_end_of_stream == NULL ) {
108 SDL_UnloadObject(flac.handle);
109 return -1;
110 }
111 flac.FLAC__stream_decoder_seek_absolute =
112 (FLAC__bool (*)(FLAC__StreamDecoder *, FLAC__uint64))
113 SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_seek_absolute");
114 if ( flac.FLAC__stream_decoder_seek_absolute == NULL ) {
115 SDL_UnloadObject(flac.handle);
116 return -1;
117 }
118 flac.FLAC__stream_decoder_get_state =
119 (FLAC__StreamDecoderState (*)(const FLAC__StreamDecoder *decoder))
120 SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_get_state");
121 if ( flac.FLAC__stream_decoder_get_state == NULL ) {
122 SDL_UnloadObject(flac.handle);
123 return -1;
124 }
125 }
126 ++flac.loaded;
127
128 return 0;
129 }
130 void Mix_QuitFLAC()
131 {
132 if ( flac.loaded == 0 ) {
133 return;
134 }
135 if ( flac.loaded == 1 ) {
136 SDL_UnloadObject(flac.handle);
137 }
138 --flac.loaded;
139 }
140 #else
141 int Mix_InitFLAC()
142 {
143 if ( flac.loaded == 0 ) {
144 #ifdef __MACOSX__
145 extern FLAC__StreamDecoder *FLAC__stream_decoder_new(void) __attribute__((weak_import));
146 if ( FLAC__stream_decoder_new == NULL )
147 {
148 /* Missing weakly linked framework */
149 Mix_SetError("Missing FLAC.framework");
150 return -1;
151 }
152 #endif // __MACOSX__
153
154 flac.FLAC__stream_decoder_new = FLAC__stream_decoder_new;
155 flac.FLAC__stream_decoder_delete = FLAC__stream_decoder_delete;
156 flac.FLAC__stream_decoder_init_stream =
157 FLAC__stream_decoder_init_stream;
158 flac.FLAC__stream_decoder_finish = FLAC__stream_decoder_finish;
159 flac.FLAC__stream_decoder_flush = FLAC__stream_decoder_flush;
160 flac.FLAC__stream_decoder_process_single =
161 FLAC__stream_decoder_process_single;
162 flac.FLAC__stream_decoder_process_until_end_of_metadata =
163 FLAC__stream_decoder_process_until_end_of_metadata;
164 flac.FLAC__stream_decoder_process_until_end_of_stream =
165 FLAC__stream_decoder_process_until_end_of_stream;
166 flac.FLAC__stream_decoder_seek_absolute =
167 FLAC__stream_decoder_seek_absolute;
168 flac.FLAC__stream_decoder_get_state =
169 FLAC__stream_decoder_get_state;
170 }
171 ++flac.loaded;
172
173 return 0;
174 }
175 void Mix_QuitFLAC()
176 {
177 if ( flac.loaded == 0 ) {
178 return;
179 }
180 if ( flac.loaded == 1 ) {
181 }
182 --flac.loaded;
183 }
184 #endif /* FLAC_DYNAMIC */
185
186 #endif /* FLAC_MUSIC */
+0
-66
dynamic_flac.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 The following file defines all of the functions/objects used to dynamically
21 link to the libFLAC library.
22 ~ Austen Dicken (admin@cvpcs.org)
23 */
24
25 #ifdef FLAC_MUSIC
26
27 #include <FLAC/stream_decoder.h>
28
29 typedef struct {
30 int loaded;
31 void *handle;
32 FLAC__StreamDecoder *(*FLAC__stream_decoder_new)();
33 void (*FLAC__stream_decoder_delete)(FLAC__StreamDecoder *decoder);
34 FLAC__StreamDecoderInitStatus (*FLAC__stream_decoder_init_stream)(
35 FLAC__StreamDecoder *decoder,
36 FLAC__StreamDecoderReadCallback read_callback,
37 FLAC__StreamDecoderSeekCallback seek_callback,
38 FLAC__StreamDecoderTellCallback tell_callback,
39 FLAC__StreamDecoderLengthCallback length_callback,
40 FLAC__StreamDecoderEofCallback eof_callback,
41 FLAC__StreamDecoderWriteCallback write_callback,
42 FLAC__StreamDecoderMetadataCallback metadata_callback,
43 FLAC__StreamDecoderErrorCallback error_callback,
44 void *client_data);
45 FLAC__bool (*FLAC__stream_decoder_finish)(FLAC__StreamDecoder *decoder);
46 FLAC__bool (*FLAC__stream_decoder_flush)(FLAC__StreamDecoder *decoder);
47 FLAC__bool (*FLAC__stream_decoder_process_single)(
48 FLAC__StreamDecoder *decoder);
49 FLAC__bool (*FLAC__stream_decoder_process_until_end_of_metadata)(
50 FLAC__StreamDecoder *decoder);
51 FLAC__bool (*FLAC__stream_decoder_process_until_end_of_stream)(
52 FLAC__StreamDecoder *decoder);
53 FLAC__bool (*FLAC__stream_decoder_seek_absolute)(
54 FLAC__StreamDecoder *decoder,
55 FLAC__uint64 sample);
56 FLAC__StreamDecoderState (*FLAC__stream_decoder_get_state)(
57 const FLAC__StreamDecoder *decoder);
58 } flac_loader;
59
60 extern flac_loader flac;
61
62 #endif /* FLAC_MUSIC */
63
64 extern int Mix_InitFLAC();
65 extern void Mix_QuitFLAC();
+0
-87
dynamic_fluidsynth.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 James Le Cuirot
21 chewi@aura-online.co.uk
22 */
23
24 #ifdef USE_FLUIDSYNTH_MIDI
25
26 #include "SDL_loadso.h"
27 #include "dynamic_fluidsynth.h"
28
29 fluidsynth_loader fluidsynth = {
30 0, NULL
31 };
32
33 #ifdef FLUIDSYNTH_DYNAMIC
34 #define FLUIDSYNTH_LOADER(FUNC, SIG) \
35 fluidsynth.FUNC = (SIG) SDL_LoadFunction(fluidsynth.handle, #FUNC); \
36 if (fluidsynth.FUNC == NULL) { SDL_UnloadObject(fluidsynth.handle); return -1; }
37 #else
38 #define FLUIDSYNTH_LOADER(FUNC, SIG) \
39 fluidsynth.FUNC = FUNC;
40 #endif
41
42 int Mix_InitFluidSynth()
43 {
44 if ( fluidsynth.loaded == 0 ) {
45 #ifdef FLUIDSYNTH_DYNAMIC
46 fluidsynth.handle = SDL_LoadObject(FLUIDSYNTH_DYNAMIC);
47 if ( fluidsynth.handle == NULL ) return -1;
48 #endif
49
50 FLUIDSYNTH_LOADER(delete_fluid_player, int (*)(fluid_player_t*));
51 FLUIDSYNTH_LOADER(delete_fluid_settings, void (*)(fluid_settings_t*));
52 FLUIDSYNTH_LOADER(delete_fluid_synth, int (*)(fluid_synth_t*));
53 FLUIDSYNTH_LOADER(fluid_player_add, int (*)(fluid_player_t*, const char*));
54 FLUIDSYNTH_LOADER(fluid_player_add_mem, int (*)(fluid_player_t*, const void*, size_t));
55 FLUIDSYNTH_LOADER(fluid_player_get_status, int (*)(fluid_player_t*));
56 FLUIDSYNTH_LOADER(fluid_player_play, int (*)(fluid_player_t*));
57 FLUIDSYNTH_LOADER(fluid_player_set_loop, int (*)(fluid_player_t*, int));
58 FLUIDSYNTH_LOADER(fluid_player_stop, int (*)(fluid_player_t*));
59 FLUIDSYNTH_LOADER(fluid_settings_setnum, int (*)(fluid_settings_t*, const char*, double));
60 FLUIDSYNTH_LOADER(fluid_synth_get_settings, fluid_settings_t* (*)(fluid_synth_t*));
61 FLUIDSYNTH_LOADER(fluid_synth_set_gain, void (*)(fluid_synth_t*, float));
62 FLUIDSYNTH_LOADER(fluid_synth_sfload, int(*)(fluid_synth_t*, const char*, int));
63 FLUIDSYNTH_LOADER(fluid_synth_write_s16, int(*)(fluid_synth_t*, int, void*, int, int, void*, int, int));
64 FLUIDSYNTH_LOADER(new_fluid_player, fluid_player_t* (*)(fluid_synth_t*));
65 FLUIDSYNTH_LOADER(new_fluid_settings, fluid_settings_t* (*)(void));
66 FLUIDSYNTH_LOADER(new_fluid_synth, fluid_synth_t* (*)(fluid_settings_t*));
67 }
68 ++fluidsynth.loaded;
69
70 return 0;
71 }
72
73 void Mix_QuitFluidSynth()
74 {
75 if ( fluidsynth.loaded == 0 ) {
76 return;
77 }
78 if ( fluidsynth.loaded == 1 ) {
79 #ifdef FLUIDSYNTH_DYNAMIC
80 SDL_UnloadObject(fluidsynth.handle);
81 #endif
82 }
83 --fluidsynth.loaded;
84 }
85
86 #endif /* USE_FLUIDSYNTH_MIDI */
+0
-57
dynamic_fluidsynth.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 James Le Cuirot
21 chewi@aura-online.co.uk
22 */
23
24 #ifdef USE_FLUIDSYNTH_MIDI
25
26 #include <fluidsynth.h>
27
28 typedef struct {
29 int loaded;
30 void *handle;
31
32 int (*delete_fluid_player)(fluid_player_t*);
33 void (*delete_fluid_settings)(fluid_settings_t*);
34 int (*delete_fluid_synth)(fluid_synth_t*);
35 int (*fluid_player_add)(fluid_player_t*, const char*);
36 int (*fluid_player_add_mem)(fluid_player_t*, const void*, size_t);
37 int (*fluid_player_get_status)(fluid_player_t*);
38 int (*fluid_player_play)(fluid_player_t*);
39 int (*fluid_player_set_loop)(fluid_player_t*, int);
40 int (*fluid_player_stop)(fluid_player_t*);
41 int (*fluid_settings_setnum)(fluid_settings_t*, const char*, double);
42 fluid_settings_t* (*fluid_synth_get_settings)(fluid_synth_t*);
43 void (*fluid_synth_set_gain)(fluid_synth_t*, float);
44 int (*fluid_synth_sfload)(fluid_synth_t*, const char*, int);
45 int (*fluid_synth_write_s16)(fluid_synth_t*, int, void*, int, int, void*, int, int);
46 fluid_player_t* (*new_fluid_player)(fluid_synth_t*);
47 fluid_settings_t* (*new_fluid_settings)(void);
48 fluid_synth_t* (*new_fluid_synth)(fluid_settings_t*);
49 } fluidsynth_loader;
50
51 extern fluidsynth_loader fluidsynth;
52
53 #endif /* USE_FLUIDSYNTH_MIDI */
54
55 extern int Mix_InitFluidSynth();
56 extern void Mix_QuitFluidSynth();
+0
-297
dynamic_mod.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef MOD_MUSIC
22
23 #include "SDL_loadso.h"
24 #include "SDL_mixer.h"
25 #include "dynamic_mod.h"
26
27 mikmod_loader mikmod = {
28 0, NULL
29 };
30
31 #ifdef MOD_DYNAMIC
32 int Mix_InitMOD()
33 {
34 if ( mikmod.loaded == 0 ) {
35 mikmod.handle = SDL_LoadObject(MOD_DYNAMIC);
36 if ( mikmod.handle == NULL ) {
37 return -1;
38 }
39 mikmod.MikMod_Exit =
40 (void (*)(void))
41 SDL_LoadFunction(mikmod.handle, "MikMod_Exit");
42 if ( mikmod.MikMod_Exit == NULL ) {
43 SDL_UnloadObject(mikmod.handle);
44 return -1;
45 }
46 mikmod.MikMod_InfoDriver =
47 (CHAR* (*)(void))
48 SDL_LoadFunction(mikmod.handle, "MikMod_InfoDriver");
49 if ( mikmod.MikMod_InfoDriver == NULL ) {
50 SDL_UnloadObject(mikmod.handle);
51 return -1;
52 }
53 mikmod.MikMod_InfoLoader =
54 (CHAR* (*)(void))
55 SDL_LoadFunction(mikmod.handle, "MikMod_InfoLoader");
56 if ( mikmod.MikMod_InfoLoader == NULL ) {
57 SDL_UnloadObject(mikmod.handle);
58 return -1;
59 }
60 mikmod.MikMod_Init =
61 (BOOL (*)(CHAR*))
62 SDL_LoadFunction(mikmod.handle, "MikMod_Init");
63 if ( mikmod.MikMod_Init == NULL ) {
64 SDL_UnloadObject(mikmod.handle);
65 return -1;
66 }
67 mikmod.MikMod_RegisterAllLoaders =
68 (void (*)(void))
69 SDL_LoadFunction(mikmod.handle, "MikMod_RegisterAllLoaders");
70 if ( mikmod.MikMod_RegisterAllLoaders == NULL ) {
71 SDL_UnloadObject(mikmod.handle);
72 return -1;
73 }
74 mikmod.MikMod_RegisterDriver =
75 (void (*)(struct MDRIVER*))
76 SDL_LoadFunction(mikmod.handle, "MikMod_RegisterDriver");
77 if ( mikmod.MikMod_RegisterDriver == NULL ) {
78 SDL_UnloadObject(mikmod.handle);
79 return -1;
80 }
81 mikmod.MikMod_errno =
82 (int*)
83 SDL_LoadFunction(mikmod.handle, "MikMod_errno");
84 if ( mikmod.MikMod_errno == NULL ) {
85 SDL_UnloadObject(mikmod.handle);
86 return -1;
87 }
88 mikmod.MikMod_strerror =
89 (char* (*)(int))
90 SDL_LoadFunction(mikmod.handle, "MikMod_strerror");
91 if ( mikmod.MikMod_strerror == NULL ) {
92 SDL_UnloadObject(mikmod.handle);
93 return -1;
94 }
95 mikmod.MikMod_free =
96 (void (*)(void*))
97 SDL_LoadFunction(mikmod.handle, "MikMod_free");
98 if ( mikmod.MikMod_free == NULL ) {
99 /* libmikmod 3.1 and earlier doesn't have it */
100 mikmod.MikMod_free = free;
101 }
102 mikmod.Player_Active =
103 (BOOL (*)(void))
104 SDL_LoadFunction(mikmod.handle, "Player_Active");
105 if ( mikmod.Player_Active == NULL ) {
106 SDL_UnloadObject(mikmod.handle);
107 return -1;
108 }
109 mikmod.Player_Free =
110 (void (*)(MODULE*))
111 SDL_LoadFunction(mikmod.handle, "Player_Free");
112 if ( mikmod.Player_Free == NULL ) {
113 SDL_UnloadObject(mikmod.handle);
114 return -1;
115 }
116 mikmod.Player_LoadGeneric =
117 (MODULE* (*)(MREADER*,int,BOOL))
118 SDL_LoadFunction(mikmod.handle, "Player_LoadGeneric");
119 if ( mikmod.Player_LoadGeneric == NULL ) {
120 SDL_UnloadObject(mikmod.handle);
121 return -1;
122 }
123 mikmod.Player_SetPosition =
124 (void (*)(UWORD))
125 SDL_LoadFunction(mikmod.handle, "Player_SetPosition");
126 if ( mikmod.Player_SetPosition == NULL ) {
127 SDL_UnloadObject(mikmod.handle);
128 return -1;
129 }
130 mikmod.Player_SetVolume =
131 (void (*)(SWORD))
132 SDL_LoadFunction(mikmod.handle, "Player_SetVolume");
133 if ( mikmod.Player_SetVolume == NULL ) {
134 SDL_UnloadObject(mikmod.handle);
135 return -1;
136 }
137 mikmod.Player_Start =
138 (void (*)(MODULE*))
139 SDL_LoadFunction(mikmod.handle, "Player_Start");
140 if ( mikmod.Player_Start == NULL ) {
141 SDL_UnloadObject(mikmod.handle);
142 return -1;
143 }
144 mikmod.Player_Stop =
145 (void (*)(void))
146 SDL_LoadFunction(mikmod.handle, "Player_Stop");
147 if ( mikmod.Player_Stop == NULL ) {
148 SDL_UnloadObject(mikmod.handle);
149 return -1;
150 }
151 mikmod.VC_WriteBytes =
152 (ULONG (*)(SBYTE*,ULONG))
153 SDL_LoadFunction(mikmod.handle, "VC_WriteBytes");
154 if ( mikmod.VC_WriteBytes == NULL ) {
155 SDL_UnloadObject(mikmod.handle);
156 return -1;
157 }
158 mikmod.drv_nos =
159 (MDRIVER*)
160 SDL_LoadFunction(mikmod.handle, "drv_nos");
161 if ( mikmod.drv_nos == NULL ) {
162 SDL_UnloadObject(mikmod.handle);
163 return -1;
164 }
165 mikmod.md_device =
166 (UWORD*)
167 SDL_LoadFunction(mikmod.handle, "md_device");
168 if ( mikmod.md_device == NULL ) {
169 SDL_UnloadObject(mikmod.handle);
170 return -1;
171 }
172 mikmod.md_mixfreq =
173 (UWORD*)
174 SDL_LoadFunction(mikmod.handle, "md_mixfreq");
175 if ( mikmod.md_mixfreq == NULL ) {
176 SDL_UnloadObject(mikmod.handle);
177 return -1;
178 }
179 mikmod.md_mode =
180 (UWORD*)
181 SDL_LoadFunction(mikmod.handle, "md_mode");
182 if ( mikmod.md_mode == NULL ) {
183 SDL_UnloadObject(mikmod.handle);
184 return -1;
185 }
186 mikmod.md_musicvolume =
187 (UBYTE*)
188 SDL_LoadFunction(mikmod.handle, "md_musicvolume");
189 if ( mikmod.md_musicvolume == NULL ) {
190 SDL_UnloadObject(mikmod.handle);
191 return -1;
192 }
193 mikmod.md_pansep =
194 (UBYTE*)
195 SDL_LoadFunction(mikmod.handle, "md_pansep");
196 if ( mikmod.md_pansep == NULL ) {
197 SDL_UnloadObject(mikmod.handle);
198 return -1;
199 }
200 mikmod.md_reverb =
201 (UBYTE*)
202 SDL_LoadFunction(mikmod.handle, "md_reverb");
203 if ( mikmod.md_reverb == NULL ) {
204 SDL_UnloadObject(mikmod.handle);
205 return -1;
206 }
207 mikmod.md_sndfxvolume =
208 (UBYTE*)
209 SDL_LoadFunction(mikmod.handle, "md_sndfxvolume");
210 if ( mikmod.md_sndfxvolume == NULL ) {
211 SDL_UnloadObject(mikmod.handle);
212 return -1;
213 }
214 mikmod.md_volume =
215 (UBYTE*)
216 SDL_LoadFunction(mikmod.handle, "md_volume");
217 if ( mikmod.md_volume == NULL ) {
218 SDL_UnloadObject(mikmod.handle);
219 return -1;
220 }
221 }
222 ++mikmod.loaded;
223
224 return 0;
225 }
226 void Mix_QuitMOD()
227 {
228 if ( mikmod.loaded == 0 ) {
229 return;
230 }
231 if ( mikmod.loaded == 1 ) {
232 SDL_UnloadObject(mikmod.handle);
233 }
234 --mikmod.loaded;
235 }
236 #else
237 int Mix_InitMOD()
238 {
239 if ( mikmod.loaded == 0 ) {
240 #ifdef __MACOSX__
241 extern void Player_Start(MODULE*) __attribute__((weak_import));
242 if ( Player_Start == NULL )
243 {
244 /* Missing weakly linked framework */
245 Mix_SetError("Missing mikmod.framework");
246 return -1;
247 }
248 #endif // __MACOSX__
249
250 mikmod.MikMod_Exit = MikMod_Exit;
251 mikmod.MikMod_InfoDriver = MikMod_InfoDriver;
252 mikmod.MikMod_InfoLoader = MikMod_InfoLoader;
253 mikmod.MikMod_Init = MikMod_Init;
254 mikmod.MikMod_RegisterAllLoaders = MikMod_RegisterAllLoaders;
255 mikmod.MikMod_RegisterDriver = MikMod_RegisterDriver;
256 mikmod.MikMod_errno = &MikMod_errno;
257 mikmod.MikMod_strerror = MikMod_strerror;
258 #if LIBMIKMOD_VERSION < ((3<<16)|(2<<8))
259 mikmod.MikMod_free = free;
260 #else
261 mikmod.MikMod_free = MikMod_free;
262 #endif
263 mikmod.Player_Active = Player_Active;
264 mikmod.Player_Free = Player_Free;
265 mikmod.Player_LoadGeneric = Player_LoadGeneric;
266 mikmod.Player_SetPosition = Player_SetPosition;
267 mikmod.Player_SetVolume = Player_SetVolume;
268 mikmod.Player_Start = Player_Start;
269 mikmod.Player_Stop = Player_Stop;
270 mikmod.VC_WriteBytes = VC_WriteBytes;
271 mikmod.drv_nos = &drv_nos;
272 mikmod.md_device = &md_device;
273 mikmod.md_mixfreq = &md_mixfreq;
274 mikmod.md_mode = &md_mode;
275 mikmod.md_musicvolume = &md_musicvolume;
276 mikmod.md_pansep = &md_pansep;
277 mikmod.md_reverb = &md_reverb;
278 mikmod.md_sndfxvolume = &md_sndfxvolume;
279 mikmod.md_volume = &md_volume;
280 }
281 ++mikmod.loaded;
282
283 return 0;
284 }
285 void Mix_QuitMOD()
286 {
287 if ( mikmod.loaded == 0 ) {
288 return;
289 }
290 if ( mikmod.loaded == 1 ) {
291 }
292 --mikmod.loaded;
293 }
294 #endif /* MOD_DYNAMIC */
295
296 #endif /* MOD_MUSIC */
+0
-63
dynamic_mod.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef MOD_MUSIC
22
23 #include "mikmod.h"
24
25 typedef struct {
26 int loaded;
27 void *handle;
28
29 void (*MikMod_Exit)(void);
30 CHAR* (*MikMod_InfoDriver)(void);
31 CHAR* (*MikMod_InfoLoader)(void);
32 BOOL (*MikMod_Init)(CHAR*);
33 void (*MikMod_RegisterAllLoaders)(void);
34 void (*MikMod_RegisterDriver)(struct MDRIVER*);
35 int* MikMod_errno;
36 char* (*MikMod_strerror)(int);
37 void (*MikMod_free)(void*);
38 BOOL (*Player_Active)(void);
39 void (*Player_Free)(MODULE*);
40 MODULE* (*Player_LoadGeneric)(MREADER*,int,BOOL);
41 void (*Player_SetPosition)(UWORD);
42 void (*Player_SetVolume)(SWORD);
43 void (*Player_Start)(MODULE*);
44 void (*Player_Stop)(void);
45 ULONG (*VC_WriteBytes)(SBYTE*,ULONG);
46 struct MDRIVER* drv_nos;
47 UWORD* md_device;
48 UWORD* md_mixfreq;
49 UWORD* md_mode;
50 UBYTE* md_musicvolume;
51 UBYTE* md_pansep;
52 UBYTE* md_reverb;
53 UBYTE* md_sndfxvolume;
54 UBYTE* md_volume;
55 } mikmod_loader;
56
57 extern mikmod_loader mikmod;
58
59 #endif /* MOD_MUSIC */
60
61 extern int Mix_InitMOD();
62 extern void Mix_QuitMOD();
+0
-121
dynamic_modplug.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef MODPLUG_MUSIC
22
23 #include "SDL_loadso.h"
24 #include "SDL_mixer.h"
25 #include "dynamic_modplug.h"
26
27 modplug_loader modplug = {
28 0, NULL
29 };
30
31 #ifdef MODPLUG_DYNAMIC
32 int Mix_InitModPlug()
33 {
34 if ( modplug.loaded == 0 ) {
35 modplug.handle = SDL_LoadObject(MODPLUG_DYNAMIC);
36 if ( modplug.handle == NULL ) {
37 return -1;
38 }
39
40 modplug.ModPlug_Load =
41 (ModPlugFile* (*)(const void* data, int size))
42 SDL_LoadFunction(modplug.handle, "ModPlug_Load");
43
44 modplug.ModPlug_Unload =
45 (void (*)(ModPlugFile* file))
46 SDL_LoadFunction(modplug.handle, "ModPlug_Unload");
47
48 modplug.ModPlug_Read =
49 (int (*)(ModPlugFile* file, void* buffer, int size))
50 SDL_LoadFunction(modplug.handle, "ModPlug_Read");
51
52 modplug.ModPlug_Seek =
53 (void (*)(ModPlugFile* file, int millisecond))
54 SDL_LoadFunction(modplug.handle, "ModPlug_Seek");
55
56 modplug.ModPlug_GetSettings =
57 (void (*)(ModPlug_Settings* settings))
58 SDL_LoadFunction(modplug.handle, "ModPlug_GetSettings");
59
60 modplug.ModPlug_SetSettings =
61 (void (*)(const ModPlug_Settings* settings))
62 SDL_LoadFunction(modplug.handle, "ModPlug_SetSettings");
63
64 modplug.ModPlug_SetMasterVolume =
65 (void (*)(ModPlugFile* file,unsigned int cvol))
66 SDL_LoadFunction(modplug.handle, "ModPlug_SetMasterVolume");
67 }
68 ++modplug.loaded;
69
70 return 0;
71 }
72
73 void Mix_QuitModPlug()
74 {
75 if ( modplug.loaded == 0 ) {
76 return;
77 }
78 if ( modplug.loaded == 1 ) {
79 SDL_UnloadObject(modplug.handle);
80 }
81 --modplug.loaded;
82 }
83 #else
84 int Mix_InitModPlug()
85 {
86 if ( modplug.loaded == 0 ) {
87 #ifdef __MACOSX__
88 extern ModPlugFile* ModPlug_Load(const void* data, int size) __attribute__((weak_import));
89 if ( ModPlug_Load == NULL )
90 {
91 /* Missing weakly linked framework */
92 Mix_SetError("Missing modplug.framework");
93 return -1;
94 }
95 #endif // __MACOSX__
96
97 modplug.ModPlug_Load = ModPlug_Load;
98 modplug.ModPlug_Unload = ModPlug_Unload;
99 modplug.ModPlug_Read = ModPlug_Read;
100 modplug.ModPlug_Seek = ModPlug_Seek;
101 modplug.ModPlug_GetSettings = ModPlug_GetSettings;
102 modplug.ModPlug_SetSettings = ModPlug_SetSettings;
103 modplug.ModPlug_SetMasterVolume = ModPlug_SetMasterVolume;
104 }
105 ++modplug.loaded;
106
107 return 0;
108 }
109 void Mix_QuitModPlug()
110 {
111 if ( modplug.loaded == 0 ) {
112 return;
113 }
114 if ( modplug.loaded == 1 ) {
115 }
116 --modplug.loaded;
117 }
118 #endif /* MODPLUG_DYNAMIC */
119
120 #endif /* MODPLUG_MUSIC */
+0
-48
dynamic_modplug.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef MODPLUG_MUSIC
22
23 #ifdef MODPLUG_HEADER
24 #include MODPLUG_HEADER
25 #else
26 #include <libmodplug/modplug.h>
27 #endif
28
29 typedef struct {
30 int loaded;
31 void *handle;
32
33 ModPlugFile* (*ModPlug_Load)(const void* data, int size);
34 void (*ModPlug_Unload)(ModPlugFile* file);
35 int (*ModPlug_Read)(ModPlugFile* file, void* buffer, int size);
36 void (*ModPlug_Seek)(ModPlugFile* file, int millisecond);
37 void (*ModPlug_GetSettings)(ModPlug_Settings* settings);
38 void (*ModPlug_SetSettings)(const ModPlug_Settings* settings);
39 void (*ModPlug_SetMasterVolume)(ModPlugFile* file,unsigned int cvol) ;
40 } modplug_loader;
41
42 extern modplug_loader modplug;
43
44 #endif /* MODPLUG_MUSIC */
45
46 extern int Mix_InitModPlug();
47 extern void Mix_QuitModPlug();
+0
-181
dynamic_mp3.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef MP3_MUSIC
22
23 #include "SDL_loadso.h"
24 #include "SDL_mixer.h"
25 #include "dynamic_mp3.h"
26
27 smpeg_loader smpeg = {
28 0, NULL
29 };
30
31 #ifdef MP3_DYNAMIC
32 int Mix_InitMP3()
33 {
34 if ( smpeg.loaded == 0 ) {
35 smpeg.handle = SDL_LoadObject(MP3_DYNAMIC);
36 if ( smpeg.handle == NULL ) {
37 return -1;
38 }
39 smpeg.SMPEG_actualSpec =
40 (void (*)( SMPEG *, SDL_AudioSpec * ))
41 SDL_LoadFunction(smpeg.handle, "SMPEG_actualSpec");
42 if ( smpeg.SMPEG_actualSpec == NULL ) {
43 SDL_UnloadObject(smpeg.handle);
44 return -1;
45 }
46 smpeg.SMPEG_delete =
47 (void (*)( SMPEG* ))
48 SDL_LoadFunction(smpeg.handle, "SMPEG_delete");
49 if ( smpeg.SMPEG_delete == NULL ) {
50 SDL_UnloadObject(smpeg.handle);
51 return -1;
52 }
53 smpeg.SMPEG_enableaudio =
54 (void (*)( SMPEG*, int ))
55 SDL_LoadFunction(smpeg.handle, "SMPEG_enableaudio");
56 if ( smpeg.SMPEG_enableaudio == NULL ) {
57 SDL_UnloadObject(smpeg.handle);
58 return -1;
59 }
60 smpeg.SMPEG_enablevideo =
61 (void (*)( SMPEG*, int ))
62 SDL_LoadFunction(smpeg.handle, "SMPEG_enablevideo");
63 if ( smpeg.SMPEG_enablevideo == NULL ) {
64 SDL_UnloadObject(smpeg.handle);
65 return -1;
66 }
67 smpeg.SMPEG_new_rwops =
68 (SMPEG* (*)(SDL_RWops *, SMPEG_Info*, int, int))
69 SDL_LoadFunction(smpeg.handle, "SMPEG_new_rwops");
70 if ( smpeg.SMPEG_new_rwops == NULL ) {
71 SDL_UnloadObject(smpeg.handle);
72 return -1;
73 }
74 smpeg.SMPEG_play =
75 (void (*)( SMPEG* ))
76 SDL_LoadFunction(smpeg.handle, "SMPEG_play");
77 if ( smpeg.SMPEG_play == NULL ) {
78 SDL_UnloadObject(smpeg.handle);
79 return -1;
80 }
81 smpeg.SMPEG_playAudio =
82 (int (*)( SMPEG *, Uint8 *, int ))
83 SDL_LoadFunction(smpeg.handle, "SMPEG_playAudio");
84 if ( smpeg.SMPEG_playAudio == NULL ) {
85 SDL_UnloadObject(smpeg.handle);
86 return -1;
87 }
88 smpeg.SMPEG_rewind =
89 (void (*)( SMPEG* ))
90 SDL_LoadFunction(smpeg.handle, "SMPEG_rewind");
91 if ( smpeg.SMPEG_rewind == NULL ) {
92 SDL_UnloadObject(smpeg.handle);
93 return -1;
94 }
95 smpeg.SMPEG_setvolume =
96 (void (*)( SMPEG*, int ))
97 SDL_LoadFunction(smpeg.handle, "SMPEG_setvolume");
98 if ( smpeg.SMPEG_setvolume == NULL ) {
99 SDL_UnloadObject(smpeg.handle);
100 return -1;
101 }
102 smpeg.SMPEG_skip =
103 (void (*)( SMPEG*, float ))
104 SDL_LoadFunction(smpeg.handle, "SMPEG_skip");
105 if ( smpeg.SMPEG_skip == NULL ) {
106 SDL_UnloadObject(smpeg.handle);
107 return -1;
108 }
109 smpeg.SMPEG_status =
110 (SMPEGstatus (*)( SMPEG* ))
111 SDL_LoadFunction(smpeg.handle, "SMPEG_status");
112 if ( smpeg.SMPEG_status == NULL ) {
113 SDL_UnloadObject(smpeg.handle);
114 return -1;
115 }
116 smpeg.SMPEG_stop =
117 (void (*)( SMPEG* ))
118 SDL_LoadFunction(smpeg.handle, "SMPEG_stop");
119 if ( smpeg.SMPEG_stop == NULL ) {
120 SDL_UnloadObject(smpeg.handle);
121 return -1;
122 }
123 }
124 ++smpeg.loaded;
125
126 return 0;
127 }
128 void Mix_QuitMP3()
129 {
130 if ( smpeg.loaded == 0 ) {
131 return;
132 }
133 if ( smpeg.loaded == 1 ) {
134 SDL_UnloadObject(smpeg.handle);
135 }
136 --smpeg.loaded;
137 }
138 #else
139 int Mix_InitMP3()
140 {
141 if ( smpeg.loaded == 0 ) {
142 #ifdef __MACOSX__
143 extern SMPEG* SMPEG_new_rwops(SDL_RWops*, SMPEG_Info*, int, int) __attribute__((weak_import));
144 if ( SMPEG_new_rwops == NULL )
145 {
146 /* Missing weakly linked framework */
147 Mix_SetError("Missing smpeg2.framework");
148 return -1;
149 }
150 #endif // __MACOSX__
151
152 smpeg.SMPEG_actualSpec = SMPEG_actualSpec;
153 smpeg.SMPEG_delete = SMPEG_delete;
154 smpeg.SMPEG_enableaudio = SMPEG_enableaudio;
155 smpeg.SMPEG_enablevideo = SMPEG_enablevideo;
156 smpeg.SMPEG_new_rwops = SMPEG_new_rwops;
157 smpeg.SMPEG_play = SMPEG_play;
158 smpeg.SMPEG_playAudio = SMPEG_playAudio;
159 smpeg.SMPEG_rewind = SMPEG_rewind;
160 smpeg.SMPEG_setvolume = SMPEG_setvolume;
161 smpeg.SMPEG_skip = SMPEG_skip;
162 smpeg.SMPEG_status = SMPEG_status;
163 smpeg.SMPEG_stop = SMPEG_stop;
164 }
165 ++smpeg.loaded;
166
167 return 0;
168 }
169 void Mix_QuitMP3()
170 {
171 if ( smpeg.loaded == 0 ) {
172 return;
173 }
174 if ( smpeg.loaded == 1 ) {
175 }
176 --smpeg.loaded;
177 }
178 #endif /* MP3_DYNAMIC */
179
180 #endif /* MP3_MUSIC */
+0
-47
dynamic_mp3.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef MP3_MUSIC
22 #include "smpeg.h"
23
24 typedef struct {
25 int loaded;
26 void *handle;
27 void (*SMPEG_actualSpec)( SMPEG *mpeg, SDL_AudioSpec *spec );
28 void (*SMPEG_delete)( SMPEG* mpeg );
29 void (*SMPEG_enableaudio)( SMPEG* mpeg, int enable );
30 void (*SMPEG_enablevideo)( SMPEG* mpeg, int enable );
31 SMPEG* (*SMPEG_new_rwops)(SDL_RWops *src, SMPEG_Info* info, int freesrc, int sdl_audio);
32 void (*SMPEG_play)( SMPEG* mpeg );
33 int (*SMPEG_playAudio)( SMPEG *mpeg, Uint8 *stream, int len );
34 void (*SMPEG_rewind)( SMPEG* mpeg );
35 void (*SMPEG_setvolume)( SMPEG* mpeg, int volume );
36 void (*SMPEG_skip)( SMPEG* mpeg, float seconds );
37 SMPEGstatus (*SMPEG_status)( SMPEG* mpeg );
38 void (*SMPEG_stop)( SMPEG* mpeg );
39 } smpeg_loader;
40
41 extern smpeg_loader smpeg;
42
43 #endif /* MUSIC_MP3 */
44
45 extern int Mix_InitMP3();
46 extern void Mix_QuitMP3();
+0
-141
dynamic_ogg.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef OGG_MUSIC
22
23 #include "SDL_loadso.h"
24 #include "SDL_mixer.h"
25 #include "dynamic_ogg.h"
26
27 vorbis_loader vorbis = {
28 0, NULL
29 };
30
31 #ifdef OGG_DYNAMIC
32 int Mix_InitOgg()
33 {
34 if ( vorbis.loaded == 0 ) {
35 vorbis.handle = SDL_LoadObject(OGG_DYNAMIC);
36 if ( vorbis.handle == NULL ) {
37 return -1;
38 }
39 vorbis.ov_clear =
40 (int (*)(OggVorbis_File *))
41 SDL_LoadFunction(vorbis.handle, "ov_clear");
42 if ( vorbis.ov_clear == NULL ) {
43 SDL_UnloadObject(vorbis.handle);
44 return -1;
45 }
46 vorbis.ov_info =
47 (vorbis_info *(*)(OggVorbis_File *,int))
48 SDL_LoadFunction(vorbis.handle, "ov_info");
49 if ( vorbis.ov_info == NULL ) {
50 SDL_UnloadObject(vorbis.handle);
51 return -1;
52 }
53 vorbis.ov_open_callbacks =
54 (int (*)(void *, OggVorbis_File *, const char *, long, ov_callbacks))
55 SDL_LoadFunction(vorbis.handle, "ov_open_callbacks");
56 if ( vorbis.ov_open_callbacks == NULL ) {
57 SDL_UnloadObject(vorbis.handle);
58 return -1;
59 }
60 vorbis.ov_pcm_total =
61 (ogg_int64_t (*)(OggVorbis_File *,int))
62 SDL_LoadFunction(vorbis.handle, "ov_pcm_total");
63 if ( vorbis.ov_pcm_total == NULL ) {
64 SDL_UnloadObject(vorbis.handle);
65 return -1;
66 }
67 vorbis.ov_read =
68 #ifdef OGG_USE_TREMOR
69 (long (*)(OggVorbis_File *,char *,int,int *))
70 #else
71 (long (*)(OggVorbis_File *,char *,int,int,int,int,int *))
72 #endif
73 SDL_LoadFunction(vorbis.handle, "ov_read");
74 if ( vorbis.ov_read == NULL ) {
75 SDL_UnloadObject(vorbis.handle);
76 return -1;
77 }
78 vorbis.ov_time_seek =
79 #ifdef OGG_USE_TREMOR
80 (long (*)(OggVorbis_File *,ogg_int64_t))
81 #else
82 (int (*)(OggVorbis_File *,double))
83 #endif
84 SDL_LoadFunction(vorbis.handle, "ov_time_seek");
85 if ( vorbis.ov_time_seek == NULL ) {
86 SDL_UnloadObject(vorbis.handle);
87 return -1;
88 }
89 }
90 ++vorbis.loaded;
91
92 return 0;
93 }
94 void Mix_QuitOgg()
95 {
96 if ( vorbis.loaded == 0 ) {
97 return;
98 }
99 if ( vorbis.loaded == 1 ) {
100 SDL_UnloadObject(vorbis.handle);
101 }
102 --vorbis.loaded;
103 }
104 #else
105 int Mix_InitOgg()
106 {
107 if ( vorbis.loaded == 0 ) {
108 #ifdef __MACOSX__
109 extern int ov_open_callbacks(void*, OggVorbis_File*, const char*, long, ov_callbacks) __attribute__((weak_import));
110 if ( ov_open_callbacks == NULL )
111 {
112 /* Missing weakly linked framework */
113 Mix_SetError("Missing Vorbis.framework");
114 return -1;
115 }
116 #endif // __MACOSX__
117
118 vorbis.ov_clear = ov_clear;
119 vorbis.ov_info = ov_info;
120 vorbis.ov_open_callbacks = ov_open_callbacks;
121 vorbis.ov_pcm_total = ov_pcm_total;
122 vorbis.ov_read = ov_read;
123 vorbis.ov_time_seek = ov_time_seek;
124 }
125 ++vorbis.loaded;
126
127 return 0;
128 }
129 void Mix_QuitOgg()
130 {
131 if ( vorbis.loaded == 0 ) {
132 return;
133 }
134 if ( vorbis.loaded == 1 ) {
135 }
136 --vorbis.loaded;
137 }
138 #endif /* OGG_DYNAMIC */
139
140 #endif /* OGG_MUSIC */
+0
-55
dynamic_ogg.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef OGG_MUSIC
22 #if defined(OGG_HEADER)
23 #include OGG_HEADER
24 #elif defined(OGG_USE_TREMOR)
25 #include <tremor/ivorbisfile.h>
26 #else
27 #include <vorbis/vorbisfile.h>
28 #endif
29
30 typedef struct {
31 int loaded;
32 void *handle;
33 int (*ov_clear)(OggVorbis_File *vf);
34 vorbis_info *(*ov_info)(OggVorbis_File *vf,int link);
35 int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks);
36 ogg_int64_t (*ov_pcm_total)(OggVorbis_File *vf,int i);
37 #ifdef OGG_USE_TREMOR
38 long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int *bitstream);
39 #else
40 long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int bigendianp,int word,int sgned,int *bitstream);
41 #endif
42 #ifdef OGG_USE_TREMOR
43 int (*ov_time_seek)(OggVorbis_File *vf,ogg_int64_t pos);
44 #else
45 int (*ov_time_seek)(OggVorbis_File *vf,double pos);
46 #endif
47 } vorbis_loader;
48
49 extern vorbis_loader vorbis;
50
51 #endif /* OGG_MUSIC */
52
53 extern int Mix_InitOgg();
54 extern void Mix_QuitOgg();
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
3030 #include <string.h>
3131
3232 #include "SDL.h"
33 #include "SDL_endian.h"
3334 #include "SDL_mixer.h"
34 #include "SDL_endian.h"
35 #include "mixer.h"
3536
3637 #define __MIX_INTERNAL_EFFECT__
3738 #include "effects_internal.h"
9798
9899
99100 /* This just frees up the callback-specific data. */
100 static void _Eff_PositionDone(int channel, void *udata)
101 static void SDLCALL _Eff_PositionDone(int channel, void *udata)
101102 {
102103 if (channel < 0) {
103104 if (pos_args_global != NULL) {
113114 }
114115
115116
116 static void _Eff_position_u8(int chan, void *stream, int len, void *udata)
117 static void SDLCALL _Eff_position_u8(int chan, void *stream, int len, void *udata)
117118 {
118119 volatile position_args *args = (volatile position_args *) udata;
119120 Uint8 *ptr = (Uint8 *) stream;
150151 ptr++;
151152 }
152153 }
153 static void _Eff_position_u8_c4(int chan, void *stream, int len, void *udata)
154 static void SDLCALL _Eff_position_u8_c4(int chan, void *stream, int len, void *udata)
154155 {
155156 volatile position_args *args = (volatile position_args *) udata;
156157 Uint8 *ptr = (Uint8 *) stream;
234235 }
235236
236237
237 static void _Eff_position_u8_c6(int chan, void *stream, int len, void *udata)
238 static void SDLCALL _Eff_position_u8_c6(int chan, void *stream, int len, void *udata)
238239 {
239240 volatile position_args *args = (volatile position_args *) udata;
240241 Uint8 *ptr = (Uint8 *) stream;
356357 * in case the user has called Mix_SetPanning() or whatnot again while this
357358 * callback is running.
358359 */
359 static void _Eff_position_table_u8(int chan, void *stream, int len, void *udata)
360 static void SDLCALL _Eff_position_table_u8(int chan, void *stream, int len, void *udata)
360361 {
361362 volatile position_args *args = (volatile position_args *) udata;
362363 Uint8 *ptr = (Uint8 *) stream;
393394 *p = (d[l[(*p & 0xFF000000) >> 24]] << 24) |
394395 (d[r[(*p & 0x00FF0000) >> 16]] << 16) |
395396 (d[l[(*p & 0x0000FF00) >> 8]] << 8) |
396 (d[r[(*p & 0x000000FF) ]] ) ;
397 (d[r[(*p & 0x000000FF) ]] ) ;
397398 #else
398399 *p = (d[r[(*p & 0xFF000000) >> 24]] << 24) |
399400 (d[l[(*p & 0x00FF0000) >> 16]] << 16) |
400401 (d[r[(*p & 0x0000FF00) >> 8]] << 8) |
401 (d[l[(*p & 0x000000FF) ]] ) ;
402 (d[l[(*p & 0x000000FF) ]] ) ;
402403 #endif
403404 ++p;
404405 }
405406 }
406407
407408
408 static void _Eff_position_s8(int chan, void *stream, int len, void *udata)
409 static void SDLCALL _Eff_position_s8(int chan, void *stream, int len, void *udata)
409410 {
410411 volatile position_args *args = (volatile position_args *) udata;
411412 Sint8 *ptr = (Sint8 *) stream;
437438 ptr++;
438439 }
439440 }
440 static void _Eff_position_s8_c4(int chan, void *stream, int len, void *udata)
441 static void SDLCALL _Eff_position_s8_c4(int chan, void *stream, int len, void *udata)
441442 {
442443 volatile position_args *args = (volatile position_args *) udata;
443444 Sint8 *ptr = (Sint8 *) stream;
483484 }
484485 }
485486 }
486 static void _Eff_position_s8_c6(int chan, void *stream, int len, void *udata)
487 static void SDLCALL _Eff_position_s8_c6(int chan, void *stream, int len, void *udata)
487488 {
488489 volatile position_args *args = (volatile position_args *) udata;
489490 Sint8 *ptr = (Sint8 *) stream;
550551 * in case the user has called Mix_SetPanning() or whatnot again while this
551552 * callback is running.
552553 */
553 static void _Eff_position_table_s8(int chan, void *stream, int len, void *udata)
554 static void SDLCALL _Eff_position_table_s8(int chan, void *stream, int len, void *udata)
554555 {
555556 volatile position_args *args = (volatile position_args *) udata;
556557 Sint8 *ptr = (Sint8 *) stream;
584585 *p = (d[l[((Sint16)(Sint8)((*p & 0xFF000000) >> 24))+128]] << 24) |
585586 (d[r[((Sint16)(Sint8)((*p & 0x00FF0000) >> 16))+128]] << 16) |
586587 (d[l[((Sint16)(Sint8)((*p & 0x0000FF00) >> 8))+128]] << 8) |
587 (d[r[((Sint16)(Sint8)((*p & 0x000000FF) ))+128]] ) ;
588 (d[r[((Sint16)(Sint8)((*p & 0x000000FF) ))+128]] ) ;
588589 #else
589590 *p = (d[r[((Sint16)(Sint8)((*p & 0xFF000000) >> 24))+128]] << 24) |
590591 (d[l[((Sint16)(Sint8)((*p & 0x00FF0000) >> 16))+128]] << 16) |
591592 (d[r[((Sint16)(Sint8)((*p & 0x0000FF00) >> 8))+128]] << 8) |
592 (d[l[((Sint16)(Sint8)((*p & 0x000000FF) ))+128]] ) ;
593 (d[l[((Sint16)(Sint8)((*p & 0x000000FF) ))+128]] ) ;
593594 #endif
594595 ++p;
595596 }
600601
601602 /* !!! FIXME : Optimize the code for 16-bit samples? */
602603
603 static void _Eff_position_u16lsb(int chan, void *stream, int len, void *udata)
604 static void SDLCALL _Eff_position_u16lsb(int chan, void *stream, int len, void *udata)
604605 {
605606 volatile position_args *args = (volatile position_args *) udata;
606607 Uint16 *ptr = (Uint16 *) stream;
625626 }
626627 }
627628 }
628 static void _Eff_position_u16lsb_c4(int chan, void *stream, int len, void *udata)
629 static void SDLCALL _Eff_position_u16lsb_c4(int chan, void *stream, int len, void *udata)
629630 {
630631 volatile position_args *args = (volatile position_args *) udata;
631632 Uint16 *ptr = (Uint16 *) stream;
674675 }
675676 }
676677 }
677 static void _Eff_position_u16lsb_c6(int chan, void *stream, int len, void *udata)
678 static void SDLCALL _Eff_position_u16lsb_c6(int chan, void *stream, int len, void *udata)
678679 {
679680 volatile position_args *args = (volatile position_args *) udata;
680681 Uint16 *ptr = (Uint16 *) stream;
738739 }
739740 }
740741
741 static void _Eff_position_s16lsb(int chan, void *stream, int len, void *udata)
742 static void SDLCALL _Eff_position_s16lsb(int chan, void *stream, int len, void *udata)
742743 {
743744 /* 16 signed bits (lsb) * 2 channels. */
744745 volatile position_args *args = (volatile position_args *) udata;
767768 }
768769 }
769770 }
770 static void _Eff_position_s16lsb_c4(int chan, void *stream, int len, void *udata)
771 static void SDLCALL _Eff_position_s16lsb_c4(int chan, void *stream, int len, void *udata)
771772 {
772773 /* 16 signed bits (lsb) * 4 channels. */
773774 volatile position_args *args = (volatile position_args *) udata;
812813 }
813814 }
814815
815 static void _Eff_position_s16lsb_c6(int chan, void *stream, int len, void *udata)
816 static void SDLCALL _Eff_position_s16lsb_c6(int chan, void *stream, int len, void *udata)
816817 {
817818 /* 16 signed bits (lsb) * 6 channels. */
818819 volatile position_args *args = (volatile position_args *) udata;
869870 }
870871 }
871872
872 static void _Eff_position_u16msb(int chan, void *stream, int len, void *udata)
873 static void SDLCALL _Eff_position_u16msb(int chan, void *stream, int len, void *udata)
873874 {
874875 /* 16 signed bits (lsb) * 2 channels. */
875876 volatile position_args *args = (volatile position_args *) udata;
895896 }
896897 }
897898 }
898 static void _Eff_position_u16msb_c4(int chan, void *stream, int len, void *udata)
899 static void SDLCALL _Eff_position_u16msb_c4(int chan, void *stream, int len, void *udata)
899900 {
900901 /* 16 signed bits (lsb) * 4 channels. */
901902 volatile position_args *args = (volatile position_args *) udata;
945946 }
946947 }
947948 }
948 static void _Eff_position_u16msb_c6(int chan, void *stream, int len, void *udata)
949 static void SDLCALL _Eff_position_u16msb_c6(int chan, void *stream, int len, void *udata)
949950 {
950951 /* 16 signed bits (lsb) * 6 channels. */
951952 volatile position_args *args = (volatile position_args *) udata;
10101011 }
10111012 }
10121013
1013 static void _Eff_position_s16msb(int chan, void *stream, int len, void *udata)
1014 static void SDLCALL _Eff_position_s16msb(int chan, void *stream, int len, void *udata)
10141015 {
10151016 /* 16 signed bits (lsb) * 2 channels. */
10161017 volatile position_args *args = (volatile position_args *) udata;
10261027 *(ptr++) = (Sint16) SDL_SwapBE16(swapr);
10271028 }
10281029 }
1029 static void _Eff_position_s16msb_c4(int chan, void *stream, int len, void *udata)
1030 static void SDLCALL _Eff_position_s16msb_c4(int chan, void *stream, int len, void *udata)
10301031 {
10311032 /* 16 signed bits (lsb) * 4 channels. */
10321033 volatile position_args *args = (volatile position_args *) udata;
10701071 }
10711072 }
10721073 }
1073 static void _Eff_position_s16msb_c6(int chan, void *stream, int len, void *udata)
1074 static void SDLCALL _Eff_position_s16msb_c6(int chan, void *stream, int len, void *udata)
10741075 {
10751076 /* 16 signed bits (lsb) * 6 channels. */
10761077 volatile position_args *args = (volatile position_args *) udata;
11281129 }
11291130 }
11301131
1132 static void SDLCALL _Eff_position_s32lsb(int chan, void *stream, int len, void *udata)
1133 {
1134 /* 32 signed bits (lsb) * 2 channels. */
1135 volatile position_args *args = (volatile position_args *) udata;
1136 Sint32 *ptr = (Sint32 *) stream;
1137 int i;
1138
1139 #if 0
1140 if (len % (sizeof(Sint32) * 2)) {
1141 fprintf(stderr,"Not an even number of frames! len=%d\n", len);
1142 return;
1143 }
1144 #endif
1145
1146 for (i = 0; i < len; i += sizeof (Sint32) * 2) {
1147 Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+0))) *
1148 args->left_f) * args->distance_f);
1149 Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+1))) *
1150 args->right_f) * args->distance_f);
1151 if (args->room_angle == 180) {
1152 *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
1153 *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
1154 }
1155 else {
1156 *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
1157 *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
1158 }
1159 }
1160 }
1161 static void SDLCALL _Eff_position_s32lsb_c4(int chan, void *stream, int len, void *udata)
1162 {
1163 /* 32 signed bits (lsb) * 4 channels. */
1164 volatile position_args *args = (volatile position_args *) udata;
1165 Sint32 *ptr = (Sint32 *) stream;
1166 int i;
1167
1168 for (i = 0; i < len; i += sizeof (Sint32) * 4) {
1169 Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+0))) *
1170 args->left_f) * args->distance_f);
1171 Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+1))) *
1172 args->right_f) * args->distance_f);
1173 Sint32 swaplr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+1))) *
1174 args->left_rear_f) * args->distance_f);
1175 Sint32 swaprr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+2))) *
1176 args->right_rear_f) * args->distance_f);
1177 switch (args->room_angle) {
1178 case 0:
1179 *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
1180 *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
1181 *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
1182 *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
1183 break;
1184 case 90:
1185 *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
1186 *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
1187 *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
1188 *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
1189 break;
1190 case 180:
1191 *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
1192 *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
1193 *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
1194 *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
1195 break;
1196 case 270:
1197 *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
1198 *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
1199 *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
1200 *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
1201 break;
1202 }
1203 }
1204 }
1205
1206 static void SDLCALL _Eff_position_s32lsb_c6(int chan, void *stream, int len, void *udata)
1207 {
1208 /* 32 signed bits (lsb) * 6 channels. */
1209 volatile position_args *args = (volatile position_args *) udata;
1210 Sint32 *ptr = (Sint32 *) stream;
1211 int i;
1212
1213 for (i = 0; i < len; i += sizeof (Sint32) * 6) {
1214 Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+0))) *
1215 args->left_f) * args->distance_f);
1216 Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+1))) *
1217 args->right_f) * args->distance_f);
1218 Sint32 swaplr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+2))) *
1219 args->left_rear_f) * args->distance_f);
1220 Sint32 swaprr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+3))) *
1221 args->right_rear_f) * args->distance_f);
1222 Sint32 swapce = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+4))) *
1223 args->center_f) * args->distance_f);
1224 Sint32 swapwf = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+5))) *
1225 args->lfe_f) * args->distance_f);
1226 switch (args->room_angle) {
1227 case 0:
1228 *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
1229 *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
1230 *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
1231 *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
1232 *(ptr++) = (Sint32) SDL_SwapLE32(swapce);
1233 *(ptr++) = (Sint32) SDL_SwapLE32(swapwf);
1234 break;
1235 case 90:
1236 *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
1237 *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
1238 *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
1239 *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
1240 *(ptr++) = (Sint32) SDL_SwapLE32(swapr)/2 + (Sint32) SDL_SwapLE32(swaprr)/2;
1241 *(ptr++) = (Sint32) SDL_SwapLE32(swapwf);
1242 break;
1243 case 180:
1244 *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
1245 *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
1246 *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
1247 *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
1248 *(ptr++) = (Sint32) SDL_SwapLE32(swaprr)/2 + (Sint32) SDL_SwapLE32(swaplr)/2;
1249 *(ptr++) = (Sint32) SDL_SwapLE32(swapwf);
1250 break;
1251 case 270:
1252 *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
1253 *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
1254 *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
1255 *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
1256 *(ptr++) = (Sint32) SDL_SwapLE32(swapl)/2 + (Sint32) SDL_SwapLE32(swaplr)/2;
1257 *(ptr++) = (Sint32) SDL_SwapLE32(swapwf);
1258 break;
1259 }
1260 }
1261 }
1262
1263 static void SDLCALL _Eff_position_s32msb(int chan, void *stream, int len, void *udata)
1264 {
1265 /* 32 signed bits (lsb) * 2 channels. */
1266 volatile position_args *args = (volatile position_args *) udata;
1267 Sint32 *ptr = (Sint32 *) stream;
1268 int i;
1269
1270 for (i = 0; i < len; i += sizeof (Sint32) * 2) {
1271 Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+0))) *
1272 args->left_f) * args->distance_f);
1273 Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+1))) *
1274 args->right_f) * args->distance_f);
1275 *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
1276 *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
1277 }
1278 }
1279 static void SDLCALL _Eff_position_s32msb_c4(int chan, void *stream, int len, void *udata)
1280 {
1281 /* 32 signed bits (lsb) * 4 channels. */
1282 volatile position_args *args = (volatile position_args *) udata;
1283 Sint32 *ptr = (Sint32 *) stream;
1284 int i;
1285
1286 for (i = 0; i < len; i += sizeof (Sint32) * 4) {
1287 Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+0))) *
1288 args->left_f) * args->distance_f);
1289 Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+1))) *
1290 args->right_f) * args->distance_f);
1291 Sint32 swaplr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+2))) *
1292 args->left_rear_f) * args->distance_f);
1293 Sint32 swaprr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+3))) *
1294 args->right_rear_f) * args->distance_f);
1295 switch (args->room_angle) {
1296 case 0:
1297 *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
1298 *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
1299 *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
1300 *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
1301 break;
1302 case 90:
1303 *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
1304 *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
1305 *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
1306 *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
1307 break;
1308 case 180:
1309 *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
1310 *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
1311 *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
1312 *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
1313 break;
1314 case 270:
1315 *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
1316 *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
1317 *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
1318 *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
1319 break;
1320 }
1321 }
1322 }
1323 static void SDLCALL _Eff_position_s32msb_c6(int chan, void *stream, int len, void *udata)
1324 {
1325 /* 32 signed bits (lsb) * 6 channels. */
1326 volatile position_args *args = (volatile position_args *) udata;
1327 Sint32 *ptr = (Sint32 *) stream;
1328 int i;
1329
1330 for (i = 0; i < len; i += sizeof (Sint32) * 6) {
1331 Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+0))) *
1332 args->left_f) * args->distance_f);
1333 Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+1))) *
1334 args->right_f) * args->distance_f);
1335 Sint32 swaplr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+2))) *
1336 args->left_rear_f) * args->distance_f);
1337 Sint32 swaprr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+3))) *
1338 args->right_rear_f) * args->distance_f);
1339 Sint32 swapce = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+4))) *
1340 args->center_f) * args->distance_f);
1341 Sint32 swapwf = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+5))) *
1342 args->lfe_f) * args->distance_f);
1343
1344 switch (args->room_angle) {
1345 case 0:
1346 *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
1347 *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
1348 *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
1349 *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
1350 *(ptr++) = (Sint32) SDL_SwapBE32(swapce);
1351 *(ptr++) = (Sint32) SDL_SwapBE32(swapwf);
1352 break;
1353 case 90:
1354 *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
1355 *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
1356 *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
1357 *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
1358 *(ptr++) = (Sint32) SDL_SwapBE32(swapr)/2 + (Sint32) SDL_SwapBE32(swaprr)/2;
1359 *(ptr++) = (Sint32) SDL_SwapBE32(swapwf);
1360 break;
1361 case 180:
1362 *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
1363 *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
1364 *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
1365 *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
1366 *(ptr++) = (Sint32) SDL_SwapBE32(swaprr)/2 + (Sint32) SDL_SwapBE32(swaplr)/2;
1367 *(ptr++) = (Sint32) SDL_SwapBE32(swapwf);
1368 break;
1369 case 270:
1370 *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
1371 *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
1372 *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
1373 *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
1374 *(ptr++) = (Sint32) SDL_SwapBE32(swapl)/2 + (Sint32) SDL_SwapBE32(swaplr)/2;
1375 *(ptr++) = (Sint32) SDL_SwapBE32(swapwf);
1376 break;
1377 }
1378 }
1379 }
1380
1381 static void SDLCALL _Eff_position_f32sys(int chan, void *stream, int len, void *udata)
1382 {
1383 /* float * 2 channels. */
1384 volatile position_args *args = (volatile position_args *) udata;
1385 float *ptr = (float *) stream;
1386 int i;
1387
1388 for (i = 0; i < len; i += sizeof (float) * 2) {
1389 float swapl = ((*(ptr+0) * args->left_f) * args->distance_f);
1390 float swapr = ((*(ptr+1) * args->right_f) * args->distance_f);
1391 *(ptr++) = swapl;
1392 *(ptr++) = swapr;
1393 }
1394 }
1395 static void SDLCALL _Eff_position_f32sys_c4(int chan, void *stream, int len, void *udata)
1396 {
1397 /* float * 4 channels. */
1398 volatile position_args *args = (volatile position_args *) udata;
1399 float *ptr = (float *) stream;
1400 int i;
1401
1402 for (i = 0; i < len; i += sizeof (float) * 4) {
1403 float swapl = ((*(ptr+0) * args->left_f) * args->distance_f);
1404 float swapr = ((*(ptr+1) * args->right_f) * args->distance_f);
1405 float swaplr = ((*(ptr+2) * args->left_rear_f) * args->distance_f);
1406 float swaprr = ((*(ptr+3) * args->right_rear_f) * args->distance_f);
1407 switch (args->room_angle) {
1408 case 0:
1409 *(ptr++) = swapl;
1410 *(ptr++) = swapr;
1411 *(ptr++) = swaplr;
1412 *(ptr++) = swaprr;
1413 break;
1414 case 90:
1415 *(ptr++) = swapr;
1416 *(ptr++) = swaprr;
1417 *(ptr++) = swapl;
1418 *(ptr++) = swaplr;
1419 break;
1420 case 180:
1421 *(ptr++) = swaprr;
1422 *(ptr++) = swaplr;
1423 *(ptr++) = swapr;
1424 *(ptr++) = swapl;
1425 break;
1426 case 270:
1427 *(ptr++) = swaplr;
1428 *(ptr++) = swapl;
1429 *(ptr++) = swaprr;
1430 *(ptr++) = swapr;
1431 break;
1432 }
1433 }
1434 }
1435 static void SDLCALL _Eff_position_f32sys_c6(int chan, void *stream, int len, void *udata)
1436 {
1437 /* float * 6 channels. */
1438 volatile position_args *args = (volatile position_args *) udata;
1439 float *ptr = (float *) stream;
1440 int i;
1441
1442 for (i = 0; i < len; i += sizeof (float) * 6) {
1443 float swapl = ((*(ptr+0) * args->left_f) * args->distance_f);
1444 float swapr = ((*(ptr+1) * args->right_f) * args->distance_f);
1445 float swaplr = ((*(ptr+2) * args->left_rear_f) * args->distance_f);
1446 float swaprr = ((*(ptr+3) * args->right_rear_f) * args->distance_f);
1447 float swapce = ((*(ptr+4) * args->center_f) * args->distance_f);
1448 float swapwf = ((*(ptr+5) * args->lfe_f) * args->distance_f);
1449
1450 switch (args->room_angle) {
1451 case 0:
1452 *(ptr++) = swapl;
1453 *(ptr++) = swapr;
1454 *(ptr++) = swaplr;
1455 *(ptr++) = swaprr;
1456 *(ptr++) = swapce;
1457 *(ptr++) = swapwf;
1458 break;
1459 case 90:
1460 *(ptr++) = swapr;
1461 *(ptr++) = swaprr;
1462 *(ptr++) = swapl;
1463 *(ptr++) = swaplr;
1464 *(ptr++) = swapr/2.0f + swaprr/2.0f;
1465 *(ptr++) = swapwf;
1466 break;
1467 case 180:
1468 *(ptr++) = swaprr;
1469 *(ptr++) = swaplr;
1470 *(ptr++) = swapr;
1471 *(ptr++) = swapl;
1472 *(ptr++) = swaprr/2.0f + swaplr/2.0f;
1473 *(ptr++) = swapwf;
1474 break;
1475 case 270:
1476 *(ptr++) = swaplr;
1477 *(ptr++) = swapl;
1478 *(ptr++) = swaprr;
1479 *(ptr++) = swapr;
1480 *(ptr++) = swapl/2.0f + swaplr/2.0f;
1481 *(ptr++) = swapwf;
1482 break;
1483 }
1484 }
1485 }
1486
11311487 static void init_position_args(position_args *args)
11321488 {
11331489 SDL_memset(args, '\0', sizeof (position_args));
11941550 switch (channels) {
11951551 case 1:
11961552 case 2:
1197 f = (_Eff_build_volume_table_u8()) ? _Eff_position_table_u8 :
1553 f = (_Eff_build_volume_table_u8()) ? _Eff_position_table_u8 :
11981554 _Eff_position_u8;
11991555 break;
1200 case 4:
1201 f = _Eff_position_u8_c4;
1202 break;
1203 case 6:
1204 f = _Eff_position_u8_c6;
1205 break;
1206 }
1207 break;
1556 case 4:
1557 f = _Eff_position_u8_c4;
1558 break;
1559 case 6:
1560 f = _Eff_position_u8_c6;
1561 break;
1562 default:
1563 Mix_SetError("Unsupported audio channels");
1564 break;
1565 }
1566 break;
12081567
12091568 case AUDIO_S8:
12101569 switch (channels) {
12111570 case 1:
12121571 case 2:
1213 f = (_Eff_build_volume_table_s8()) ? _Eff_position_table_s8 :
1572 f = (_Eff_build_volume_table_s8()) ? _Eff_position_table_s8 :
12141573 _Eff_position_s8;
12151574 break;
1216 case 4:
1217 f = _Eff_position_s8_c4;
1218 break;
1219 case 6:
1220 f = _Eff_position_s8_c6;
1221 break;
1222 }
1223 break;
1575 case 4:
1576 f = _Eff_position_s8_c4;
1577 break;
1578 case 6:
1579 f = _Eff_position_s8_c6;
1580 break;
1581 default:
1582 Mix_SetError("Unsupported audio channels");
1583 break;
1584 }
1585 break;
12241586
12251587 case AUDIO_U16LSB:
12261588 switch (channels) {
12271589 case 1:
12281590 case 2:
1229 f = _Eff_position_u16lsb;
1230 break;
1231 case 4:
1232 f = _Eff_position_u16lsb_c4;
1233 break;
1234 case 6:
1235 f = _Eff_position_u16lsb_c6;
1236 break;
1237 }
1238 break;
1591 f = _Eff_position_u16lsb;
1592 break;
1593 case 4:
1594 f = _Eff_position_u16lsb_c4;
1595 break;
1596 case 6:
1597 f = _Eff_position_u16lsb_c6;
1598 break;
1599 default:
1600 Mix_SetError("Unsupported audio channels");
1601 break;
1602 }
1603 break;
12391604
12401605 case AUDIO_S16LSB:
12411606 switch (channels) {
12421607 case 1:
12431608 case 2:
1244 f = _Eff_position_s16lsb;
1245 break;
1246 case 4:
1247 f = _Eff_position_s16lsb_c4;
1248 break;
1249 case 6:
1250 f = _Eff_position_s16lsb_c6;
1251 break;
1252 }
1253 break;
1609 f = _Eff_position_s16lsb;
1610 break;
1611 case 4:
1612 f = _Eff_position_s16lsb_c4;
1613 break;
1614 case 6:
1615 f = _Eff_position_s16lsb_c6;
1616 break;
1617 default:
1618 Mix_SetError("Unsupported audio channels");
1619 break;
1620 }
1621 break;
12541622
12551623 case AUDIO_U16MSB:
12561624 switch (channels) {
12571625 case 1:
12581626 case 2:
1259 f = _Eff_position_u16msb;
1260 break;
1261 case 4:
1262 f = _Eff_position_u16msb_c4;
1263 break;
1264 case 6:
1265 f = _Eff_position_u16msb_c6;
1266 break;
1267 }
1268 break;
1627 f = _Eff_position_u16msb;
1628 break;
1629 case 4:
1630 f = _Eff_position_u16msb_c4;
1631 break;
1632 case 6:
1633 f = _Eff_position_u16msb_c6;
1634 break;
1635 default:
1636 Mix_SetError("Unsupported audio channels");
1637 break;
1638 }
1639 break;
12691640
12701641 case AUDIO_S16MSB:
12711642 switch (channels) {
12721643 case 1:
12731644 case 2:
1274 f = _Eff_position_s16msb;
1275 break;
1276 case 4:
1277 f = _Eff_position_s16msb_c4;
1278 break;
1279 case 6:
1280 f = _Eff_position_s16msb_c6;
1281 break;
1282 }
1283 break;
1645 f = _Eff_position_s16msb;
1646 break;
1647 case 4:
1648 f = _Eff_position_s16msb_c4;
1649 break;
1650 case 6:
1651 f = _Eff_position_s16msb_c6;
1652 break;
1653 default:
1654 Mix_SetError("Unsupported audio channels");
1655 break;
1656 }
1657 break;
1658
1659 case AUDIO_S32MSB:
1660 switch (channels) {
1661 case 1:
1662 case 2:
1663 f = _Eff_position_s32msb;
1664 break;
1665 case 4:
1666 f = _Eff_position_s32msb_c4;
1667 break;
1668 case 6:
1669 f = _Eff_position_s32msb_c6;
1670 break;
1671 default:
1672 Mix_SetError("Unsupported audio channels");
1673 break;
1674 }
1675 break;
1676
1677 case AUDIO_S32LSB:
1678 switch (channels) {
1679 case 1:
1680 case 2:
1681 f = _Eff_position_s32lsb;
1682 break;
1683 case 4:
1684 f = _Eff_position_s32lsb_c4;
1685 break;
1686 case 6:
1687 f = _Eff_position_s32lsb_c6;
1688 break;
1689 default:
1690 Mix_SetError("Unsupported audio channels");
1691 break;
1692 }
1693 break;
1694
1695 case AUDIO_F32SYS:
1696 switch (channels) {
1697 case 1:
1698 case 2:
1699 f = _Eff_position_f32sys;
1700 break;
1701 case 4:
1702 f = _Eff_position_f32sys_c4;
1703 break;
1704 case 6:
1705 f = _Eff_position_f32sys_c6;
1706 break;
1707 default:
1708 Mix_SetError("Unsupported audio channels");
1709 break;
1710 }
1711 break;
12841712
12851713 default:
12861714 Mix_SetError("Unsupported audio format");
1715 break;
12871716 }
12881717
12891718 return(f);
14451874 angle = -angle;
14461875 angle = angle * 90 / 128; /* Make it larger for more effect? */
14471876 }
1448 return( Mix_SetPosition(channel, angle, 0) );
1877 return(Mix_SetPosition(channel, angle, 0));
14491878 }
14501879
14511880 f = get_position_effect_func(format, channels);
14521881 if (f == NULL)
14531882 return(0);
14541883
1455 SDL_LockAudio();
1884 Mix_LockAudio();
14561885 args = get_position_arg(channel);
14571886 if (!args) {
1458 SDL_UnlockAudio();
1887 Mix_UnlockAudio();
14591888 return(0);
14601889 }
14611890
14631892 if ((args->distance_u8 == 255) && (left == 255) && (right == 255)) {
14641893 if (args->in_use) {
14651894 retval = _Mix_UnregisterEffect_locked(channel, f);
1466 SDL_UnlockAudio();
1895 Mix_UnlockAudio();
14671896 return(retval);
14681897 } else {
1469 SDL_UnlockAudio();
1898 Mix_UnlockAudio();
14701899 return(1);
14711900 }
14721901 }
14821911 retval=_Mix_RegisterEffect_locked(channel, f, _Eff_PositionDone, (void*)args);
14831912 }
14841913
1485 SDL_UnlockAudio();
1914 Mix_UnlockAudio();
14861915 return(retval);
14871916 }
14881917
15001929 if (f == NULL)
15011930 return(0);
15021931
1503 SDL_LockAudio();
1932 Mix_LockAudio();
15041933 args = get_position_arg(channel);
15051934 if (!args) {
1506 SDL_UnlockAudio();
1935 Mix_UnlockAudio();
15071936 return(0);
15081937 }
15091938
15131942 if ((distance == 255) && (args->left_u8 == 255) && (args->right_u8 == 255)) {
15141943 if (args->in_use) {
15151944 retval = _Mix_UnregisterEffect_locked(channel, f);
1516 SDL_UnlockAudio();
1945 Mix_UnlockAudio();
15171946 return(retval);
15181947 } else {
1519 SDL_UnlockAudio();
1948 Mix_UnlockAudio();
15201949 return(1);
15211950 }
15221951 }
15281957 retval = _Mix_RegisterEffect_locked(channel, f, _Eff_PositionDone, (void *) args);
15291958 }
15301959
1531 SDL_UnlockAudio();
1960 Mix_UnlockAudio();
15321961 return(retval);
15331962 }
15341963
15491978
15501979 angle = SDL_abs(angle) % 360; /* make angle between 0 and 359. */
15511980
1552 SDL_LockAudio();
1981 Mix_LockAudio();
15531982 args = get_position_arg(channel);
15541983 if (!args) {
1555 SDL_UnlockAudio();
1984 Mix_UnlockAudio();
15561985 return(0);
15571986 }
15581987
15601989 if ((!distance) && (!angle)) {
15611990 if (args->in_use) {
15621991 retval = _Mix_UnregisterEffect_locked(channel, f);
1563 SDL_UnlockAudio();
1992 Mix_UnlockAudio();
15641993 return(retval);
15651994 } else {
1566 SDL_UnlockAudio();
1995 Mix_UnlockAudio();
15671996 return(1);
15681997 }
15691998 }
16092038 retval = _Mix_RegisterEffect_locked(channel, f, _Eff_PositionDone, (void *) args);
16102039 }
16112040
1612 SDL_UnlockAudio();
2041 Mix_UnlockAudio();
16132042 return(retval);
16142043 }
16152044
16162045
16172046 /* end of effects_position.c ... */
16182047
2048 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
5454 * Stereo reversal effect...this one's pretty straightforward...
5555 */
5656
57 static void _Eff_reversestereo16(int chan, void *stream, int len, void *udata)
57 static void SDLCALL _Eff_reversestereo32(int chan, void *stream, int len, void *udata)
58 {
59 /* 16 bits * 2 channels. */
60 Uint32 *ptr = (Uint32 *) stream;
61 Uint32 tmp;
62 int i;
63
64 for (i = 0; i < len; i += 2 * sizeof (Uint32), ptr += 2) {
65 tmp = ptr[0];
66 ptr[0] = ptr[1];
67 ptr[1] = tmp;
68 }
69 }
70
71
72 static void SDLCALL _Eff_reversestereo16(int chan, void *stream, int len, void *udata)
5873 {
5974 /* 16 bits * 2 channels. */
6075 Uint32 *ptr = (Uint32 *) stream;
6681 }
6782
6883
69 static void _Eff_reversestereo8(int chan, void *stream, int len, void *udata)
84 static void SDLCALL _Eff_reversestereo8(int chan, void *stream, int len, void *udata)
7085 {
7186 /* 8 bits * 2 channels. */
7287 Uint32 *ptr = (Uint32 *) stream;
95110 Mix_QuerySpec(NULL, &format, &channels);
96111
97112 if (channels == 2) {
98 if ((format & 0xFF) == 16)
113 int bits = (format & 0xFF);
114 switch (bits) {
115 case 8:
116 f = _Eff_reversestereo8;
117 break;
118 case 16:
99119 f = _Eff_reversestereo16;
100 else if ((format & 0xFF) == 8)
101 f = _Eff_reversestereo8;
102 else {
120 break;
121 case 32:
122 f = _Eff_reversestereo32;
123 break;
124 default:
103125 Mix_SetError("Unsupported audio format");
104126 return(0);
105127 }
109131 } else {
110132 return(Mix_RegisterEffect(channel, f, NULL, NULL));
111133 }
134 } else {
135 Mix_SetError("Trying to reverse stereo on a non-stereo stream");
136 return(0);
112137 }
113138
114139 return(1);
117142
118143 /* end of effect_stereoreverse.c ... */
119144
145 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
121121
122122 /* end of effects.c ... */
123123
124 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
2929
3030 #include "SDL_mixer.h"
3131
32 /* Set up for C function definitions, even when using C++ */
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
3732 extern int _Mix_effects_max_speed;
3833 extern void *_Eff_volume_table;
3934 void *_Eff_build_volume_table_u8(void);
4843 int _Mix_UnregisterEffect_locked(int channel, Mix_EffectFunc_t f);
4944 int _Mix_UnregisterAllEffects_locked(int channel);
5045
46 #endif /* _INCLUDE_EFFECTS_INTERNAL_H_ */
5147
52 /* Set up for C function definitions, even when using C++ */
53 #ifdef __cplusplus
54 }
55 #endif
56
57
58 #endif
59
48 /* vi: set ts=4 sw=4 expandtab: */
+0
-223
fluidsynth.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 James Le Cuirot
21 chewi@aura-online.co.uk
22 */
23
24 #ifdef USE_FLUIDSYNTH_MIDI
25
26 #include <stdio.h>
27 #include <sys/types.h>
28
29 #include "SDL_mixer.h"
30 #include "fluidsynth.h"
31
32 static Uint16 format;
33 static Uint8 channels;
34 static int freq;
35
36 int fluidsynth_check_soundfont(const char *path, void *data)
37 {
38 FILE *file = fopen(path, "r");
39
40 if (file) {
41 fclose(file);
42 return 1;
43 } else {
44 Mix_SetError("Failed to access the SoundFont %s", path);
45 return 0;
46 }
47 }
48
49 int fluidsynth_load_soundfont(const char *path, void *data)
50 {
51 /* If this fails, it's too late to try Timidity so pray that at least one works. */
52 fluidsynth.fluid_synth_sfload((fluid_synth_t*) data, path, 1);
53 return 1;
54 }
55
56 int fluidsynth_init(SDL_AudioSpec *mixer)
57 {
58 if (!Mix_EachSoundFont(fluidsynth_check_soundfont, NULL))
59 return -1;
60
61 format = mixer->format;
62 channels = mixer->channels;
63 freq = mixer->freq;
64
65 return 0;
66 }
67
68 static FluidSynthMidiSong *fluidsynth_loadsong_common(int (*function)(FluidSynthMidiSong*, void*), void *data)
69 {
70 FluidSynthMidiSong *song;
71 fluid_settings_t *settings = NULL;
72
73 if (!Mix_Init(MIX_INIT_FLUIDSYNTH)) {
74 return NULL;
75 }
76
77 if ((song = SDL_malloc(sizeof(FluidSynthMidiSong)))) {
78 SDL_memset(song, 0, sizeof(FluidSynthMidiSong));
79
80 if (SDL_BuildAudioCVT(&song->convert, AUDIO_S16, 2, freq, format, channels, freq) >= 0) {
81 if ((settings = fluidsynth.new_fluid_settings())) {
82 fluidsynth.fluid_settings_setnum(settings, "synth.sample-rate", (double) freq);
83
84 if ((song->synth = fluidsynth.new_fluid_synth(settings))) {
85 if (Mix_EachSoundFont(fluidsynth_load_soundfont, (void*) song->synth)) {
86 if ((song->player = fluidsynth.new_fluid_player(song->synth))) {
87 if (function(song, data)) return song;
88 fluidsynth.delete_fluid_player(song->player);
89 } else {
90 Mix_SetError("Failed to create FluidSynth player");
91 }
92 }
93 fluidsynth.delete_fluid_synth(song->synth);
94 } else {
95 Mix_SetError("Failed to create FluidSynth synthesizer");
96 }
97 fluidsynth.delete_fluid_settings(settings);
98 } else {
99 Mix_SetError("Failed to create FluidSynth settings");
100 }
101 } else {
102 Mix_SetError("Failed to set up audio conversion");
103 }
104 SDL_free(song);
105 } else {
106 Mix_SetError("Insufficient memory for song");
107 }
108 return NULL;
109 }
110
111 static int fluidsynth_loadsong_RW_internal(FluidSynthMidiSong *song, void *data)
112 {
113 Sint64 offset;
114 size_t size;
115 char *buffer;
116 SDL_RWops *src = (SDL_RWops*) data;
117
118 offset = SDL_RWtell(src);
119 SDL_RWseek(src, 0, RW_SEEK_END);
120 size = (size_t)(SDL_RWtell(src) - offset);
121 SDL_RWseek(src, offset, RW_SEEK_SET);
122
123 if ((buffer = (char*) SDL_malloc(size))) {
124 if(SDL_RWread(src, buffer, size, 1) == 1) {
125 if (fluidsynth.fluid_player_add_mem(song->player, buffer, size) == FLUID_OK) {
126 SDL_free(buffer);
127 return 1;
128 } else {
129 Mix_SetError("FluidSynth failed to load in-memory song");
130 }
131 } else {
132 Mix_SetError("Failed to read in-memory song");
133 }
134 SDL_free(buffer);
135 } else {
136 Mix_SetError("Insufficient memory for song");
137 }
138 return 0;
139 }
140
141 FluidSynthMidiSong *fluidsynth_loadsong_RW(SDL_RWops *src, int freesrc)
142 {
143 FluidSynthMidiSong *song;
144
145 song = fluidsynth_loadsong_common(fluidsynth_loadsong_RW_internal, (void*) src);
146 if (song && freesrc) {
147 SDL_RWclose(src);
148 }
149 return song;
150 }
151
152 void fluidsynth_freesong(FluidSynthMidiSong *song)
153 {
154 if (!song) return;
155 fluidsynth.delete_fluid_player(song->player);
156 fluidsynth.delete_fluid_settings(fluidsynth.fluid_synth_get_settings(song->synth));
157 fluidsynth.delete_fluid_synth(song->synth);
158 SDL_free(song);
159 }
160
161 void fluidsynth_start(FluidSynthMidiSong *song)
162 {
163 fluidsynth.fluid_player_set_loop(song->player, 1);
164 fluidsynth.fluid_player_play(song->player);
165 }
166
167 void fluidsynth_stop(FluidSynthMidiSong *song)
168 {
169 fluidsynth.fluid_player_stop(song->player);
170 }
171
172 int fluidsynth_active(FluidSynthMidiSong *song)
173 {
174 return fluidsynth.fluid_player_get_status(song->player) == FLUID_PLAYER_PLAYING ? 1 : 0;
175 }
176
177 void fluidsynth_setvolume(FluidSynthMidiSong *song, int volume)
178 {
179 /* FluidSynth's default is 0.2. Make 1.2 the maximum. */
180 fluidsynth.fluid_synth_set_gain(song->synth, (float) (volume * 1.2 / MIX_MAX_VOLUME));
181 }
182
183 int fluidsynth_playsome(FluidSynthMidiSong *song, void *dest, int dest_len)
184 {
185 int result = -1;
186 int frames = dest_len / channels / ((format & 0xFF) / 8);
187 int src_len = frames * 4; /* 16-bit stereo */
188 void *src = dest;
189
190 if (dest_len < src_len) {
191 if (!(src = SDL_malloc(src_len))) {
192 Mix_SetError("Insufficient memory for audio conversion");
193 return result;
194 }
195 }
196
197 if (fluidsynth.fluid_synth_write_s16(song->synth, frames, src, 0, 2, src, 1, 2) != FLUID_OK) {
198 Mix_SetError("Error generating FluidSynth audio");
199 goto finish;
200 }
201
202 song->convert.buf = src;
203 song->convert.len = src_len;
204
205 if (SDL_ConvertAudio(&song->convert) < 0) {
206 Mix_SetError("Error during audio conversion");
207 goto finish;
208 }
209
210 if (src != dest)
211 SDL_memcpy(dest, src, dest_len);
212
213 result = 0;
214
215 finish:
216 if (src != dest)
217 SDL_free(src);
218
219 return result;
220 }
221
222 #endif /* USE_FLUIDSYNTH_MIDI */
+0
-51
fluidsynth.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 James Le Cuirot
21 chewi@aura-online.co.uk
22 */
23
24 #ifndef _FLUIDSYNTH_H_
25 #define _FLUIDSYNTH_H_
26
27 #ifdef USE_FLUIDSYNTH_MIDI
28
29 #include "dynamic_fluidsynth.h"
30 #include <SDL_rwops.h>
31 #include <SDL_audio.h>
32
33 typedef struct {
34 SDL_AudioCVT convert;
35 fluid_synth_t *synth;
36 fluid_player_t* player;
37 } FluidSynthMidiSong;
38
39 int fluidsynth_init(SDL_AudioSpec *mixer);
40 FluidSynthMidiSong *fluidsynth_loadsong_RW(SDL_RWops *rw, int freerw);
41 void fluidsynth_freesong(FluidSynthMidiSong *song);
42 void fluidsynth_start(FluidSynthMidiSong *song);
43 void fluidsynth_stop(FluidSynthMidiSong *song);
44 int fluidsynth_active(FluidSynthMidiSong *song);
45 void fluidsynth_setvolume(FluidSynthMidiSong *song, int volume);
46 int fluidsynth_playsome(FluidSynthMidiSong *song, void *stream, int len);
47
48 #endif /* USE_FLUIDSYNTH_MIDI */
49
50 #endif /* _FLUIDSYNTH_H_ */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
2727 in december 2002.
2828 */
2929
30 /* $Id$ */
31
32 #include <stdlib.h>
33 #include <string.h>
34
3530 #include "SDL_endian.h"
3631 #include "SDL_mixer.h"
3732 #include "load_aiff.h"
5651 static Uint32 SANE_to_Uint32 (Uint8 *sanebuf)
5752 {
5853 /* Is the frequency outside of what we can represent with Uint32? */
59 if ( (sanebuf[0] & 0x80) || (sanebuf[0] <= 0x3F) || (sanebuf[0] > 0x40)
60 || (sanebuf[0] == 0x40 && sanebuf[1] > 0x1C) )
54 if ((sanebuf[0] & 0x80) || (sanebuf[0] <= 0x3F) || (sanebuf[0] > 0x40)
55 || (sanebuf[0] == 0x40 && sanebuf[1] > 0x1C))
6156 return 0;
6257
6358 return ((sanebuf[2] << 23) | (sanebuf[3] << 15) | (sanebuf[4] << 7)
9792
9893 /* Make sure we are passed a valid data source */
9994 was_error = 0;
100 if ( src == NULL ) {
95 if (src == NULL) {
10196 was_error = 1;
10297 goto done;
10398 }
10499
105100 FORMchunk = SDL_ReadLE32(src);
106101 chunk_length = SDL_ReadBE32(src);
107 if ( chunk_length == AIFF ) { /* The FORMchunk has already been read */
102 if (chunk_length == AIFF) { /* The FORMchunk has already been read */
108103 AIFFmagic = chunk_length;
109104 chunk_length = FORMchunk;
110105 FORMchunk = FORM;
111106 } else {
112107 AIFFmagic = SDL_ReadLE32(src);
113108 }
114 if ( (FORMchunk != FORM) || ( (AIFFmagic != AIFF) && (AIFFmagic != _8SVX) ) ) {
109 if ((FORMchunk != FORM) || ((AIFFmagic != AIFF) && (AIFFmagic != _8SVX))) {
115110 SDL_SetError("Unrecognized file type (not AIFF nor 8SVX)");
116111 was_error = 1;
117112 goto done;
176171 /* a 0 pad byte can be stored for any odd-length chunk */
177172 if (chunk_length&1)
178173 next_chunk++;
179 } while ( ( ( (AIFFmagic == AIFF) && ( !found_SSND || !found_COMM ) )
180 || ( (AIFFmagic == _8SVX ) && ( !found_VHDR || !found_BODY ) ) )
181 && SDL_RWseek(src, next_chunk, RW_SEEK_SET) != 1 );
182
183 if ( (AIFFmagic == AIFF) && !found_SSND ) {
174 } while ((((AIFFmagic == AIFF) && (!found_SSND || !found_COMM))
175 || ((AIFFmagic == _8SVX) && (!found_VHDR || !found_BODY)))
176 && SDL_RWseek(src, next_chunk, RW_SEEK_SET) != 1);
177
178 if ((AIFFmagic == AIFF) && !found_SSND) {
184179 SDL_SetError("Bad AIFF (no SSND chunk)");
185180 was_error = 1;
186181 goto done;
187182 }
188183
189 if ( (AIFFmagic == AIFF) && !found_COMM ) {
184 if ((AIFFmagic == AIFF) && !found_COMM) {
190185 SDL_SetError("Bad AIFF (no COMM chunk)");
191186 was_error = 1;
192187 goto done;
193188 }
194189
195 if ( (AIFFmagic == _8SVX) && !found_VHDR ) {
190 if ((AIFFmagic == _8SVX) && !found_VHDR) {
196191 SDL_SetError("Bad 8SVX (no VHDR chunk)");
197192 was_error = 1;
198193 goto done;
199194 }
200195
201 if ( (AIFFmagic == _8SVX) && !found_BODY ) {
196 if ((AIFFmagic == _8SVX) && !found_BODY) {
202197 SDL_SetError("Bad 8SVX (no BODY chunk)");
203198 was_error = 1;
204199 goto done;
224219
225220 *audio_len = channels * numsamples * (samplesize / 8);
226221 *audio_buf = (Uint8 *)SDL_malloc(*audio_len);
227 if ( *audio_buf == NULL ) {
222 if (*audio_buf == NULL) {
228223 SDL_SetError("Out of memory");
229224 return(NULL);
230225 }
231226 SDL_RWseek(src, start, RW_SEEK_SET);
232 if ( SDL_RWread(src, *audio_buf, *audio_len, 1) != 1 ) {
227 if (SDL_RWread(src, *audio_buf, *audio_len, 1) != 1) {
233228 SDL_SetError("Unable to read audio data");
234229 return(NULL);
235230 }
247242 return(spec);
248243 }
249244
245 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
2525 This file by Torbjörn Andersson (torbjorn.andersson@eurotime.se)
2626 */
2727
28 /* $Id$ */
29
3028 /* Don't call this directly; use Mix_LoadWAV_RW() for now. */
3129 SDL_AudioSpec *Mix_LoadAIFF_RW (SDL_RWops *src, int freesrc,
3230 SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
31
32 /* vi: set ts=4 sw=4 expandtab: */
+0
-329
load_flac.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 This is the source needed to decode a FLAC into a waveform.
21 ~ Austen Dicken (admin@cvpcs.org).
22 */
23
24 #ifdef FLAC_MUSIC
25
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29
30 #include "SDL_mutex.h"
31 #include "SDL_endian.h"
32 #include "SDL_timer.h"
33
34 #include "SDL_mixer.h"
35 #include "dynamic_flac.h"
36 #include "load_flac.h"
37
38 #include <FLAC/stream_decoder.h>
39
40 typedef struct {
41 SDL_RWops* sdl_src;
42 SDL_AudioSpec* sdl_spec;
43 Uint8** sdl_audio_buf;
44 Uint32* sdl_audio_len;
45 int sdl_audio_read;
46 FLAC__uint64 flac_total_samples;
47 unsigned flac_bps;
48 } FLAC_SDL_Data;
49
50 static FLAC__StreamDecoderReadStatus flac_read_load_cb(
51 const FLAC__StreamDecoder *decoder,
52 FLAC__byte buffer[],
53 size_t *bytes,
54 void *client_data)
55 {
56 // make sure there is something to be reading
57 if (*bytes > 0) {
58 FLAC_SDL_Data *data = (FLAC_SDL_Data *)client_data;
59
60 *bytes = SDL_RWread (data->sdl_src, buffer, sizeof (FLAC__byte),
61 *bytes);
62
63 if (*bytes == 0) { // error or no data was read (EOF)
64 return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
65 } else { // data was read, continue
66 return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
67 }
68 } else {
69 return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
70 }
71 }
72
73 static FLAC__StreamDecoderSeekStatus flac_seek_load_cb(
74 const FLAC__StreamDecoder *decoder,
75 FLAC__uint64 absolute_byte_offset,
76 void *client_data)
77 {
78 FLAC_SDL_Data *data = (FLAC_SDL_Data *)client_data;
79
80 if (SDL_RWseek (data->sdl_src, absolute_byte_offset, RW_SEEK_SET) < 0) {
81 return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
82 } else {
83 return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
84 }
85 }
86
87 static FLAC__StreamDecoderTellStatus flac_tell_load_cb(
88 const FLAC__StreamDecoder *decoder,
89 FLAC__uint64 *absolute_byte_offset,
90 void *client_data)
91 {
92 FLAC_SDL_Data *data = (FLAC_SDL_Data *)client_data;
93
94 Sint64 pos = SDL_RWtell (data->sdl_src);
95
96 if (pos < 0) {
97 return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
98 } else {
99 *absolute_byte_offset = (FLAC__uint64)pos;
100 return FLAC__STREAM_DECODER_TELL_STATUS_OK;
101 }
102 }
103
104 static FLAC__StreamDecoderLengthStatus flac_length_load_cb(
105 const FLAC__StreamDecoder *decoder,
106 FLAC__uint64 *stream_length,
107 void *client_data)
108 {
109 FLAC_SDL_Data *data = (FLAC_SDL_Data *)client_data;
110
111 Sint64 pos = SDL_RWtell (data->sdl_src);
112 Sint64 length = SDL_RWseek (data->sdl_src, 0, RW_SEEK_END);
113
114 if (SDL_RWseek (data->sdl_src, pos, RW_SEEK_SET) != pos || length < 0) {
115 /* there was an error attempting to return the stream to the original
116 * position, or the length was invalid. */
117 return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
118 } else {
119 *stream_length = (FLAC__uint64)length;
120 return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
121 }
122 }
123
124 static FLAC__bool flac_eof_load_cb(const FLAC__StreamDecoder *decoder,
125 void *client_data)
126 {
127 FLAC_SDL_Data *data = (FLAC_SDL_Data *)client_data;
128
129 Sint64 pos = SDL_RWtell (data->sdl_src);
130 Sint64 end = SDL_RWseek (data->sdl_src, 0, RW_SEEK_END);
131
132 // was the original position equal to the end (a.k.a. the seek didn't move)?
133 if (pos == end) {
134 // must be EOF
135 return true;
136 } else {
137 // not EOF, return to the original position
138 SDL_RWseek (data->sdl_src, pos, RW_SEEK_SET);
139 return false;
140 }
141 }
142
143 static FLAC__StreamDecoderWriteStatus flac_write_load_cb(
144 const FLAC__StreamDecoder *decoder,
145 const FLAC__Frame *frame,
146 const FLAC__int32 *const buffer[],
147 void *client_data)
148 {
149 FLAC_SDL_Data *data = (FLAC_SDL_Data *)client_data;
150 size_t i;
151 Uint8 *buf;
152
153 if (data->flac_total_samples == 0) {
154 SDL_SetError ("Given FLAC file does not specify its sample count.");
155 return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
156 }
157
158 if (data->sdl_spec->channels != 2 || data->flac_bps != 16) {
159 SDL_SetError ("Current FLAC support is only for 16 bit Stereo files.");
160 return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
161 }
162
163 // check if it is the first audio frame so we can initialize the output
164 // buffer
165 if (frame->header.number.sample_number == 0) {
166 *(data->sdl_audio_len) = data->sdl_spec->size;
167 data->sdl_audio_read = 0;
168 *(data->sdl_audio_buf) = SDL_malloc (*(data->sdl_audio_len));
169
170 if (*(data->sdl_audio_buf) == NULL) {
171 SDL_SetError
172 ("Unable to allocate memory to store the FLAC stream.");
173 return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
174 }
175 }
176
177 buf = *(data->sdl_audio_buf);
178
179 for (i = 0; i < frame->header.blocksize; i++) {
180 FLAC__int16 i16;
181 FLAC__uint16 ui16;
182
183 i16 = (FLAC__int16)buffer[0][i];
184 ui16 = (FLAC__uint16)i16;
185
186 *(buf + (data->sdl_audio_read++)) = (char)(ui16);
187 *(buf + (data->sdl_audio_read++)) = (char)(ui16 >> 8);
188
189 i16 = (FLAC__int16)buffer[1][i];
190 ui16 = (FLAC__uint16)i16;
191
192 *(buf + (data->sdl_audio_read++)) = (char)(ui16);
193 *(buf + (data->sdl_audio_read++)) = (char)(ui16 >> 8);
194 }
195
196 return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
197 }
198
199 static void flac_metadata_load_cb(
200 const FLAC__StreamDecoder *decoder,
201 const FLAC__StreamMetadata *metadata,
202 void *client_data)
203 {
204 FLAC_SDL_Data *data = (FLAC_SDL_Data *)client_data;
205 FLAC__uint64 total_samples;
206 unsigned bps;
207
208 if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
209 // save the metadata right now for use later on
210 *(data->sdl_audio_buf) = NULL;
211 *(data->sdl_audio_len) = 0;
212 memset (data->sdl_spec, '\0', sizeof (SDL_AudioSpec));
213
214 data->sdl_spec->format = AUDIO_S16;
215 data->sdl_spec->freq = (int)(metadata->data.stream_info.sample_rate);
216 data->sdl_spec->channels = (Uint8)(metadata->data.stream_info.channels);
217 data->sdl_spec->samples = 8192; /* buffer size */
218
219 total_samples = metadata->data.stream_info.total_samples;
220 bps = metadata->data.stream_info.bits_per_sample;
221
222 data->sdl_spec->size = (Uint32)(total_samples * data->sdl_spec->channels * (bps / 8));
223 data->flac_total_samples = total_samples;
224 data->flac_bps = bps;
225 }
226 }
227
228 static void flac_error_load_cb(
229 const FLAC__StreamDecoder *decoder,
230 FLAC__StreamDecoderErrorStatus status,
231 void *client_data)
232 {
233 // print an SDL error based on the error status
234 switch (status) {
235 case FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC:
236 SDL_SetError ("Error processing the FLAC file [LOST_SYNC].");
237 break;
238 case FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER:
239 SDL_SetError ("Error processing the FLAC file [BAD_HEADER].");
240 break;
241 case FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH:
242 SDL_SetError ("Error processing the FLAC file [CRC_MISMATCH].");
243 break;
244 case FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM:
245 SDL_SetError ("Error processing the FLAC file [UNPARSEABLE].");
246 break;
247 default:
248 SDL_SetError ("Error processing the FLAC file [UNKNOWN].");
249 break;
250 }
251 }
252
253 /* don't call this directly; use Mix_LoadWAV_RW() for now. */
254 SDL_AudioSpec *Mix_LoadFLAC_RW (SDL_RWops *src, int freesrc,
255 SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
256 {
257 FLAC__StreamDecoder *decoder = 0;
258 FLAC__StreamDecoderInitStatus init_status;
259 int was_error = 1;
260 int was_init = 0;
261 Uint32 samplesize;
262
263 // create the client data passing information
264 FLAC_SDL_Data* client_data;
265 client_data = (FLAC_SDL_Data *)SDL_malloc (sizeof (FLAC_SDL_Data));
266
267 if ((!src) || (!audio_buf) || (!audio_len)) /* sanity checks. */
268 goto done;
269
270 if (!Mix_Init(MIX_INIT_FLAC))
271 goto done;
272
273 if ((decoder = flac.FLAC__stream_decoder_new ()) == NULL) {
274 SDL_SetError ("Unable to allocate FLAC decoder.");
275 goto done;
276 }
277
278 init_status = flac.FLAC__stream_decoder_init_stream (decoder,
279 flac_read_load_cb, flac_seek_load_cb,
280 flac_tell_load_cb, flac_length_load_cb,
281 flac_eof_load_cb, flac_write_load_cb,
282 flac_metadata_load_cb, flac_error_load_cb,
283 client_data);
284
285 if (init_status != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
286 SDL_SetError ("Unable to initialize FLAC stream decoder.");
287 goto done;
288 }
289
290 was_init = 1;
291
292 client_data->sdl_src = src;
293 client_data->sdl_spec = spec;
294 client_data->sdl_audio_buf = audio_buf;
295 client_data->sdl_audio_len = audio_len;
296
297 if (!flac.FLAC__stream_decoder_process_until_end_of_stream (decoder)) {
298 SDL_SetError ("Unable to process FLAC file.");
299 goto done;
300 }
301
302 was_error = 0;
303
304 /* Don't return a buffer that isn't a multiple of samplesize */
305 samplesize = ((spec->format & 0xFF) / 8) * spec->channels;
306 *audio_len &= ~(samplesize - 1);
307
308 done:
309 if (was_init && decoder) {
310 flac.FLAC__stream_decoder_finish (decoder);
311 }
312
313 if (decoder) {
314 flac.FLAC__stream_decoder_delete (decoder);
315 }
316
317 if (freesrc && src) {
318 SDL_RWclose (src);
319 }
320
321 if (was_error) {
322 spec = NULL;
323 }
324
325 return spec;
326 }
327
328 #endif // FLAC_MUSIC
+0
-31
load_flac.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 This is the source needed to decode a FLAC into a waveform.
21 ~ Austen Dicken (admin@cvpcs.org).
22 */
23
24 /* $Id: $ */
25
26 #ifdef FLAC_MUSIC
27 /* Don't call this directly; use Mix_LoadWAV_RW() for now. */
28 SDL_AudioSpec *Mix_LoadFLAC_RW (SDL_RWops *src, int freesrc,
29 SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
30 #endif
+0
-195
load_mp3.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 This is the source needed to decode an MP3 into a waveform.
21 */
22
23 /* $Id$ */
24
25 #if defined(MP3_MUSIC) || defined(MP3_MAD_MUSIC)
26
27 #include "SDL_mixer.h"
28
29 #include "load_mp3.h"
30
31 #if defined(MP3_MUSIC)
32 #include "dynamic_mp3.h"
33 #elif defined(MP3_MAD_MUSIC)
34 #include "music_mad.h"
35 #endif
36
37 SDL_AudioSpec *Mix_LoadMP3_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
38 {
39 /* note: spec is initialized to mixer spec */
40
41 #if defined(MP3_MUSIC)
42 SMPEG* mp3;
43 SMPEG_Info info;
44 #elif defined(MP3_MAD_MUSIC)
45 mad_data *mp3_mad;
46 #endif
47 long samplesize;
48 int read_len;
49 const Uint32 chunk_len = 4096;
50 int err = 0;
51
52 if ((!src) || (!spec) || (!audio_buf) || (!audio_len))
53 {
54 return NULL;
55 }
56
57 if (!err)
58 {
59 *audio_len = 0;
60 *audio_buf = (Uint8*) SDL_malloc(chunk_len);
61 err = (*audio_buf == NULL);
62 }
63
64 if (!err)
65 {
66 err = ((Mix_Init(MIX_INIT_MP3) & MIX_INIT_MP3) == 0);
67 }
68
69 if (!err)
70 {
71 #if defined(MP3_MUSIC)
72 mp3 = smpeg.SMPEG_new_rwops(src, &info, freesrc, 0);
73 err = (mp3 == NULL);
74 #elif defined(MP3_MAD_MUSIC)
75 mp3_mad = mad_openFileRW(src, spec, freesrc);
76 err = (mp3_mad == NULL);
77 #endif
78 }
79
80 #if defined(MP3_MUSIC)
81 if (!err)
82 {
83 err = !info.has_audio;
84 }
85 #endif
86
87 if (!err)
88 {
89 #if defined(MP3_MUSIC)
90
91 smpeg.SMPEG_actualSpec(mp3, spec);
92
93 smpeg.SMPEG_enableaudio(mp3, 1);
94 smpeg.SMPEG_enablevideo(mp3, 0);
95
96 smpeg.SMPEG_play(mp3);
97
98 /* read once for audio length */
99 while ((read_len = smpeg.SMPEG_playAudio(mp3, *audio_buf, chunk_len)) > 0)
100 {
101 *audio_len += read_len;
102 }
103
104 smpeg.SMPEG_stop(mp3);
105
106 #elif defined(MP3_MAD_MUSIC)
107
108 mad_start(mp3_mad);
109
110 /* read once for audio length */
111 while ((read_len = mad_getSamples(mp3_mad, *audio_buf, chunk_len)) > 0)
112 {
113 *audio_len += read_len;
114 }
115
116 mad_stop(mp3_mad);
117
118 #endif
119
120 err = (read_len < 0);
121 }
122
123 if (!err)
124 {
125 /* reallocate, if needed */
126 if ((*audio_len > 0) && (*audio_len != chunk_len))
127 {
128 *audio_buf = (Uint8*) SDL_realloc(*audio_buf, *audio_len);
129 err = (*audio_buf == NULL);
130 }
131 }
132
133 if (!err)
134 {
135 /* read again for audio buffer, if needed */
136 if (*audio_len > chunk_len)
137 {
138 #if defined(MP3_MUSIC)
139 smpeg.SMPEG_rewind(mp3);
140 smpeg.SMPEG_play(mp3);
141 err = (*audio_len != smpeg.SMPEG_playAudio(mp3, *audio_buf, *audio_len));
142 smpeg.SMPEG_stop(mp3);
143 #elif defined(MP3_MAD_MUSIC)
144 mad_seek(mp3_mad, 0);
145 mad_start(mp3_mad);
146 err = (*audio_len != mad_getSamples(mp3_mad, *audio_buf, *audio_len));
147 mad_stop(mp3_mad);
148 #endif
149 }
150 }
151
152 if (!err)
153 {
154 /* Don't return a buffer that isn't a multiple of samplesize */
155 samplesize = ((spec->format & 0xFF)/8)*spec->channels;
156 *audio_len &= ~(samplesize-1);
157 }
158
159 #if defined(MP3_MUSIC)
160 if (mp3)
161 {
162 smpeg.SMPEG_delete(mp3); mp3 = NULL;
163 /* Deleting the MP3 closed the source if desired */
164 freesrc = SDL_FALSE;
165 }
166 #elif defined(MP3_MAD_MUSIC)
167 if (mp3_mad)
168 {
169 mad_closeFile(mp3_mad); mp3_mad = NULL;
170 /* Deleting the MP3 closed the source if desired */
171 freesrc = SDL_FALSE;
172 }
173 #endif
174
175 if (freesrc)
176 {
177 SDL_RWclose(src); src = NULL;
178 }
179
180 /* handle error */
181 if (err)
182 {
183 if (*audio_buf != NULL)
184 {
185 SDL_free(*audio_buf); *audio_buf = NULL;
186 }
187 *audio_len = 0;
188 spec = NULL;
189 }
190
191 return spec;
192 }
193
194 #endif
+0
-30
load_mp3.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 This is the source needed to decode an MP3 into a waveform.
21 */
22
23 /* $Id$ */
24
25 #if defined(MP3_MUSIC) || defined(MP3_MAD_MUSIC)
26 /* Don't call this directly; use Mix_LoadWAV_RW() for now. */
27 SDL_AudioSpec *Mix_LoadMP3_RW (SDL_RWops *src, int freesrc,
28 SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
29 #endif
+0
-161
load_ogg.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 This is the source needed to decode an Ogg Vorbis into a waveform.
21 This file by Vaclav Slavik (vaclav.slavik@matfyz.cz).
22 */
23
24 /* $Id$ */
25
26 #ifdef OGG_MUSIC
27
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <string.h>
31
32 #include "SDL_mutex.h"
33 #include "SDL_endian.h"
34 #include "SDL_timer.h"
35
36 #include "SDL_mixer.h"
37 #include "dynamic_ogg.h"
38 #include "load_ogg.h"
39
40 static size_t sdl_read_func(void *ptr, size_t size, size_t nmemb, void *datasource)
41 {
42 return SDL_RWread((SDL_RWops*)datasource, ptr, size, nmemb);
43 }
44
45 static int sdl_seek_func(void *datasource, ogg_int64_t offset, int whence)
46 {
47 return (int)SDL_RWseek((SDL_RWops*)datasource, offset, whence);
48 }
49
50 static int sdl_close_func_freesrc(void *datasource)
51 {
52 return SDL_RWclose((SDL_RWops*)datasource);
53 }
54
55 static int sdl_close_func_nofreesrc(void *datasource)
56 {
57 SDL_RWseek((SDL_RWops*)datasource, 0, RW_SEEK_SET);
58 return 0;
59 }
60
61 static long sdl_tell_func(void *datasource)
62 {
63 return (long)SDL_RWtell((SDL_RWops*)datasource);
64 }
65
66
67 /* don't call this directly; use Mix_LoadWAV_RW() for now. */
68 SDL_AudioSpec *Mix_LoadOGG_RW (SDL_RWops *src, int freesrc,
69 SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
70 {
71 OggVorbis_File vf;
72 ov_callbacks callbacks;
73 vorbis_info *info;
74 Uint8 *buf;
75 int bitstream = -1;
76 long samplesize;
77 long samples;
78 int read, to_read;
79 int must_close = 1;
80 int was_error = 1;
81
82 if ( (!src) || (!audio_buf) || (!audio_len) ) /* sanity checks. */
83 goto done;
84
85 if ( !Mix_Init(MIX_INIT_OGG) )
86 goto done;
87
88 callbacks.read_func = sdl_read_func;
89 callbacks.seek_func = sdl_seek_func;
90 callbacks.tell_func = sdl_tell_func;
91 callbacks.close_func = freesrc ?
92 sdl_close_func_freesrc : sdl_close_func_nofreesrc;
93
94 if (vorbis.ov_open_callbacks(src, &vf, NULL, 0, callbacks) != 0)
95 {
96 SDL_SetError("OGG bitstream is not valid Vorbis stream!");
97 goto done;
98 }
99
100 must_close = 0;
101
102 info = vorbis.ov_info(&vf, -1);
103
104 *audio_buf = NULL;
105 *audio_len = 0;
106 memset(spec, '\0', sizeof (SDL_AudioSpec));
107
108 spec->format = AUDIO_S16;
109 spec->channels = info->channels;
110 spec->freq = info->rate;
111 spec->samples = 4096; /* buffer size */
112
113 samples = (long)vorbis.ov_pcm_total(&vf, -1);
114
115 *audio_len = spec->size = samples * spec->channels * 2;
116 *audio_buf = (Uint8 *)SDL_malloc(*audio_len);
117 if (*audio_buf == NULL)
118 goto done;
119
120 buf = *audio_buf;
121 to_read = *audio_len;
122 #ifdef OGG_USE_TREMOR
123 for (read = vorbis.ov_read(&vf, (char *)buf, to_read, &bitstream);
124 read > 0;
125 read = vorbis.ov_read(&vf, (char *)buf, to_read, &bitstream))
126 #else
127 for (read = vorbis.ov_read(&vf, (char *)buf, to_read, 0/*LE*/, 2/*16bit*/, 1/*signed*/, &bitstream);
128 read > 0;
129 read = vorbis.ov_read(&vf, (char *)buf, to_read, 0, 2, 1, &bitstream))
130 #endif
131 {
132 if (read == OV_HOLE || read == OV_EBADLINK)
133 break; /* error */
134
135 to_read -= read;
136 buf += read;
137 }
138
139 vorbis.ov_clear(&vf);
140 was_error = 0;
141
142 /* Don't return a buffer that isn't a multiple of samplesize */
143 samplesize = ((spec->format & 0xFF)/8)*spec->channels;
144 *audio_len &= ~(samplesize-1);
145
146 done:
147 if (freesrc && src && must_close) {
148 SDL_RWclose(src);
149 }
150
151 if (was_error) {
152 spec = NULL;
153 }
154
155 return(spec);
156 } /* Mix_LoadOGG_RW */
157
158 /* end of load_ogg.c ... */
159
160 #endif
+0
-31
load_ogg.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 This is the source needed to decode an Ogg Vorbis into a waveform.
21 This file by Vaclav Slavik (vaclav.slavik@matfyz.cz).
22 */
23
24 /* $Id$ */
25
26 #ifdef OGG_MUSIC
27 /* Don't call this directly; use Mix_LoadWAV_RW() for now. */
28 SDL_AudioSpec *Mix_LoadOGG_RW (SDL_RWops *src, int freesrc,
29 SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
30 #endif
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
2727 Heavily borrowed from sox v12.17.1's voc.c.
2828 (http://www.freshmeat.net/projects/sox/)
2929 */
30
31 /* $Id$ */
32
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <string.h>
36
37 #include "SDL_mutex.h"
38 #include "SDL_endian.h"
39 #include "SDL_timer.h"
4030
4131 #include "SDL_mixer.h"
4232 #include "load_voc.h"
9888 if (SDL_RWread(src, signature, sizeof (signature), 1) != 1)
9989 return(0);
10090
101 if (memcmp(signature, "Creative Voice File\032", sizeof (signature)) != 0) {
91 if (SDL_memcmp(signature, "Creative Voice File\032", sizeof (signature)) != 0) {
10292 SDL_SetError("Unrecognized file type (not VOC)");
10393 return(0);
10494 }
141131 return 1; /* assume that's the end of the file. */
142132
143133 /* Size is an 24-bit value. Ugh. */
144 sblen = ( (bits24[0]) | (bits24[1] << 8) | (bits24[2] << 16) );
134 sblen = ((bits24[0]) | (bits24[1] << 8) | (bits24[2] << 16));
145135
146136 switch(block)
147137 {
328318
329319 static int voc_read(SDL_RWops *src, vs_t *v, Uint8 *buf, SDL_AudioSpec *spec)
330320 {
331 int done = 0;
321 Uint32 done = 0;
332322 Uint8 silence = 0x80;
333323
334324 if (v->rest == 0)
353343
354344 else
355345 {
356 done = SDL_RWread(src, buf, 1, v->rest);
346 done = (Uint32)SDL_RWread(src, buf, 1, v->rest);
357347 v->rest -= done;
358348 if (v->size == ST_SIZE_WORD)
359349 {
383373 Uint8 *fillptr;
384374 void *ptr;
385375
386 if ( (!src) || (!audio_buf) || (!audio_len) ) /* sanity checks. */
376 if ((!src) || (!audio_buf) || (!audio_len)) /* sanity checks. */
387377 goto done;
388378
389 if ( !voc_check_header(src) )
379 if (!voc_check_header(src))
390380 goto done;
391381
392382 v.rate = -1;
456446 } /* Mix_LoadVOC_RW */
457447
458448 /* end of load_voc.c ... */
449
450 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
2828 (http://www.freshmeat.net/projects/sox/)
2929 */
3030
31 /* $Id$ */
32
3331 /* Don't call this directly; use Mix_LoadWAV_RW() for now. */
3432 SDL_AudioSpec *Mix_LoadVOC_RW (SDL_RWops *src, int freesrc,
3533 SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
34
35 /* vi: set ts=4 sw=4 expandtab: */
+432
-370
mixer.c less more
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
2424 #include <stdlib.h>
2525 #include <string.h>
2626
27 #include "SDL_mutex.h"
28 #include "SDL_endian.h"
29 #include "SDL_timer.h"
27 #include "SDL.h"
3028
3129 #include "SDL_mixer.h"
30 #include "mixer.h"
31 #include "music.h"
3232 #include "load_aiff.h"
3333 #include "load_voc.h"
34 #include "load_mp3.h"
35 #include "load_ogg.h"
36 #include "load_flac.h"
37 #include "dynamic_flac.h"
38 #include "dynamic_fluidsynth.h"
39 #include "dynamic_modplug.h"
40 #include "dynamic_mod.h"
41 #include "dynamic_mp3.h"
42 #include "dynamic_ogg.h"
4334
4435 #define __MIX_INTERNAL_EFFECT__
4536 #include "effects_internal.h"
4839 #define RIFF 0x46464952 /* "RIFF" */
4940 #define WAVE 0x45564157 /* "WAVE" */
5041 #define FORM 0x4d524f46 /* "FORM" */
51 #define OGGS 0x5367674f /* "OggS" */
5242 #define CREA 0x61657243 /* "Crea" */
53 #define FLAC 0x43614C66 /* "fLaC" */
5443
5544 static int audio_opened = 0;
5645 static SDL_AudioSpec mixer;
46 static SDL_AudioDeviceID audio_device;
5747
5848 typedef struct _Mix_effectinfo
5949 {
8878
8979
9080 /* Support for hooking into the mixer callback system */
91 static void (*mix_postmix)(void *udata, Uint8 *stream, int len) = NULL;
81 static void (SDLCALL *mix_postmix)(void *udata, Uint8 *stream, int len) = NULL;
9282 static void *mix_postmix_data = NULL;
9383
9484 /* rcg07062001 callback to alert when channels are done playing. */
95 static void (*channel_done_callback)(int channel) = NULL;
96
97 /* Music function declarations */
98 extern int open_music(SDL_AudioSpec *mixer);
99 extern void close_music(void);
100
101 /* Support for user defined music functions, plus the default one */
102 extern int volatile music_active;
103 extern void music_mixer(void *udata, Uint8 *stream, int len);
104 static void (*mix_music)(void *udata, Uint8 *stream, int len) = music_mixer;
85 static void (SDLCALL *channel_done_callback)(int channel) = NULL;
86
87 /* Support for user defined music functions */
88 static void (SDLCALL *mix_music)(void *udata, Uint8 *stream, int len) = music_mixer;
10589 static void *music_data = NULL;
10690
10791 /* rcg06042009 report available decoders at runtime. */
10892 static const char **chunk_decoders = NULL;
10993 static int num_decoders = 0;
11094
111 /* Semicolon-separated SoundFont paths */
112 #ifdef MID_MUSIC
113 extern char* soundfont_paths;
114 #endif
11595
11696 int Mix_GetNumChunkDecoders(void)
11797 {
124104 return NULL;
125105 }
126106 return(chunk_decoders[index]);
107 }
108
109 SDL_bool Mix_HasChunkDecoder(const char *name)
110 {
111 int index;
112 for (index = 0; index < num_decoders; ++index) {
113 if (SDL_strcasecmp(name, chunk_decoders[index]) == 0) {
114 return SDL_TRUE;
115 }
116 }
117 return SDL_FALSE;
127118 }
128119
129120 static void add_chunk_decoder(const char *decoder)
144135 return(&linked_version);
145136 }
146137
147 static int initialized = 0;
148
149138 int Mix_Init(int flags)
150139 {
151140 int result = 0;
152141
153 if (flags & MIX_INIT_FLUIDSYNTH) {
154 #ifdef USE_FLUIDSYNTH_MIDI
155 if ((initialized & MIX_INIT_FLUIDSYNTH) || Mix_InitFluidSynth() == 0) {
156 result |= MIX_INIT_FLUIDSYNTH;
157 }
158 #else
159 Mix_SetError("Mixer not built with FluidSynth support");
160 #endif
161 }
142 load_music();
143
162144 if (flags & MIX_INIT_FLAC) {
163 #ifdef FLAC_MUSIC
164 if ((initialized & MIX_INIT_FLAC) || Mix_InitFLAC() == 0) {
145 if (has_music(MUS_FLAC)) {
165146 result |= MIX_INIT_FLAC;
166 }
167 #else
168 Mix_SetError("Mixer not built with FLAC support");
169 #endif
170 }
171 if (flags & MIX_INIT_MODPLUG) {
172 #ifdef MODPLUG_MUSIC
173 if ((initialized & MIX_INIT_MODPLUG) || Mix_InitModPlug() == 0) {
174 result |= MIX_INIT_MODPLUG;
175 }
176 #else
177 Mix_SetError("Mixer not built with MOD modplug support");
178 #endif
147 } else {
148 Mix_SetError("FLAC support not available");
149 }
179150 }
180151 if (flags & MIX_INIT_MOD) {
181 #ifdef MOD_MUSIC
182 if ((initialized & MIX_INIT_MOD) || Mix_InitMOD() == 0) {
152 if (has_music(MUS_MOD)) {
183153 result |= MIX_INIT_MOD;
184 }
185 #else
186 Mix_SetError("Mixer not built with MOD mikmod support");
187 #endif
154 } else {
155 Mix_SetError("MOD support not available");
156 }
188157 }
189158 if (flags & MIX_INIT_MP3) {
190 #ifdef MP3_MUSIC
191 if ((initialized & MIX_INIT_MP3) || Mix_InitMP3() == 0) {
159 if (has_music(MUS_MP3)) {
192160 result |= MIX_INIT_MP3;
193 }
194 #elif defined(MP3_MAD_MUSIC)
195 result |= MIX_INIT_MP3;
196 #else
197 Mix_SetError("Mixer not built with MP3 support");
198 #endif
161 } else {
162 Mix_SetError("MP3 support not available");
163 }
199164 }
200165 if (flags & MIX_INIT_OGG) {
201 #ifdef OGG_MUSIC
202 if ((initialized & MIX_INIT_OGG) || Mix_InitOgg() == 0) {
166 if (has_music(MUS_OGG)) {
203167 result |= MIX_INIT_OGG;
204 }
205 #else
206 Mix_SetError("Mixer not built with Ogg Vorbis support");
207 #endif
208 }
209 initialized |= result;
210
168 } else {
169 Mix_SetError("OGG support not available");
170 }
171 }
172 if (flags & MIX_INIT_MID) {
173 if (has_music(MUS_MID)) {
174 result |= MIX_INIT_MID;
175 } else {
176 Mix_SetError("MIDI support not available");
177 }
178 }
211179 return (result);
212180 }
213181
214182 void Mix_Quit()
215183 {
216 #ifdef USE_FLUIDSYNTH_MIDI
217 if (initialized & MIX_INIT_FLUIDSYNTH) {
218 Mix_QuitFluidSynth();
219 }
220 #endif
221 #ifdef FLAC_MUSIC
222 if (initialized & MIX_INIT_FLAC) {
223 Mix_QuitFLAC();
224 }
225 #endif
226 #ifdef MODPLUG_MUSIC
227 if (initialized & MIX_INIT_MODPLUG) {
228 Mix_QuitModPlug();
229 }
230 #endif
231 #ifdef MOD_MUSIC
232 if (initialized & MIX_INIT_MOD) {
233 Mix_QuitMOD();
234 }
235 #endif
236 #ifdef MP3_MUSIC
237 if (initialized & MIX_INIT_MP3) {
238 Mix_QuitMP3();
239 }
240 #endif
241 #ifdef OGG_MUSIC
242 if (initialized & MIX_INIT_OGG) {
243 Mix_QuitOgg();
244 }
245 #endif
246 #ifdef MID_MUSIC
247 if (soundfont_paths) {
248 SDL_free(soundfont_paths);
249 soundfont_paths = NULL;
250 }
251 #endif
252 initialized = 0;
184 unload_music();
253185 }
254186
255187 static int _Mix_remove_all_effects(int channel, effect_info **e);
256188
257189 /*
258190 * rcg06122001 Cleanup effect callbacks.
259 * MAKE SURE SDL_LockAudio() is called before this (or you're in the
191 * MAKE SURE Mix_LockAudio() is called before this (or you're in the
260192 * audio callback).
261193 */
262194 static void _Mix_channel_done_playing(int channel)
302234
303235
304236 /* Mixing function */
305 static void mix_channels(void *udata, Uint8 *stream, int len)
237 static void SDLCALL
238 mix_channels(void *udata, Uint8 *stream, int len)
306239 {
307240 Uint8 *mix_input;
308 int i, mixable, volume = SDL_MIX_MAXVOLUME;
241 int i, mixable, volume = MIX_MAX_VOLUME;
309242 Uint32 sdl_ticks;
310243
311244 #if SDL_VERSION_ATLEAST(1, 3, 0)
314247 #endif
315248
316249 /* Mix the music (must be done before the channels are added) */
317 if ( music_active || (mix_music != music_mixer) ) {
318 mix_music(music_data, stream, len);
319 }
250 mix_music(music_data, stream, len);
320251
321252 /* Mix any playing channels... */
322253 sdl_ticks = SDL_GetTicks();
323 for ( i=0; i<num_channels; ++i ) {
324 if ( !mix_channel[i].paused ) {
325 if ( mix_channel[i].expire > 0 && mix_channel[i].expire < sdl_ticks ) {
254 for (i=0; i<num_channels; ++i) {
255 if (!mix_channel[i].paused) {
256 if (mix_channel[i].expire > 0 && mix_channel[i].expire < sdl_ticks) {
326257 /* Expiration delay for that channel is reached */
327258 mix_channel[i].playing = 0;
328259 mix_channel[i].looping = 0;
329260 mix_channel[i].fading = MIX_NO_FADING;
330261 mix_channel[i].expire = 0;
331262 _Mix_channel_done_playing(i);
332 } else if ( mix_channel[i].fading != MIX_NO_FADING ) {
263 } else if (mix_channel[i].fading != MIX_NO_FADING) {
333264 Uint32 ticks = sdl_ticks - mix_channel[i].ticks_fade;
334 if ( ticks >= mix_channel[i].fade_length ) {
265 if (ticks >= mix_channel[i].fade_length) {
335266 Mix_Volume(i, mix_channel[i].fade_volume_reset); /* Restore the volume */
336 if( mix_channel[i].fading == MIX_FADING_OUT ) {
267 if(mix_channel[i].fading == MIX_FADING_OUT) {
337268 mix_channel[i].playing = 0;
338269 mix_channel[i].looping = 0;
339270 mix_channel[i].expire = 0;
341272 }
342273 mix_channel[i].fading = MIX_NO_FADING;
343274 } else {
344 if ( mix_channel[i].fading == MIX_FADING_OUT ) {
275 if (mix_channel[i].fading == MIX_FADING_OUT) {
345276 Mix_Volume(i, (mix_channel[i].fade_volume * (mix_channel[i].fade_length-ticks))
346 / mix_channel[i].fade_length );
277 / mix_channel[i].fade_length);
347278 } else {
348 Mix_Volume(i, (mix_channel[i].fade_volume * ticks) / mix_channel[i].fade_length );
279 Mix_Volume(i, (mix_channel[i].fade_volume * ticks) / mix_channel[i].fade_length);
349280 }
350281 }
351282 }
352 if ( mix_channel[i].playing > 0 ) {
283 if (mix_channel[i].playing > 0) {
353284 int index = 0;
354285 int remaining = len;
355286 while (mix_channel[i].playing > 0 && index < len) {
356287 remaining = len - index;
357288 volume = (mix_channel[i].volume*mix_channel[i].chunk->volume) / MIX_MAX_VOLUME;
358289 mixable = mix_channel[i].playing;
359 if ( mixable > remaining ) {
290 if (mixable > remaining) {
360291 mixable = remaining;
361292 }
362293
363294 mix_input = Mix_DoEffects(i, mix_channel[i].samples, mixable);
364 SDL_MixAudio(stream+index,mix_input,mixable,volume);
295 SDL_MixAudioFormat(stream+index,mix_input,mixer.format,mixable,volume);
365296 if (mix_input != mix_channel[i].samples)
366297 SDL_free(mix_input);
367298
377308
378309 /* If looping the sample and we are at its end, make sure
379310 we will still return a full buffer */
380 while ( mix_channel[i].looping && index < len ) {
311 while (mix_channel[i].looping && index < len) {
381312 int alen = mix_channel[i].chunk->alen;
382313 remaining = len - index;
383314 if (remaining > alen) {
385316 }
386317
387318 mix_input = Mix_DoEffects(i, mix_channel[i].chunk->abuf, remaining);
388 SDL_MixAudio(stream+index, mix_input, remaining, volume);
319 SDL_MixAudioFormat(stream+index, mix_input, mixer.format, remaining, volume);
389320 if (mix_input != mix_channel[i].chunk->abuf)
390321 SDL_free(mix_input);
391322
396327 mix_channel[i].playing = mix_channel[i].chunk->alen - remaining;
397328 index += remaining;
398329 }
399 if ( ! mix_channel[i].playing && mix_channel[i].looping ) {
330 if (! mix_channel[i].playing && mix_channel[i].looping) {
400331 if (mix_channel[i].looping > 0) {
401332 --mix_channel[i].looping;
402333 }
410341 /* rcg06122001 run posteffects... */
411342 Mix_DoEffects(MIX_CHANNEL_POST, stream, len);
412343
413 if ( mix_postmix ) {
344 if (mix_postmix) {
414345 mix_postmix(mix_postmix_data, stream, len);
415346 }
416347 }
425356 }
426357 #endif
427358
428
429359 /* Open the mixer with a certain desired audio format */
430 int Mix_OpenAudio(int frequency, Uint16 format, int nchannels, int chunksize)
360 int Mix_OpenAudioDevice(int frequency, Uint16 format, int nchannels, int chunksize,
361 const char* device, int allowed_changes)
431362 {
432363 int i;
433364 SDL_AudioSpec desired;
434365
366 /* This used to call SDL_OpenAudio(), which initializes the audio
367 subsystem if necessary. Since SDL_OpenAudioDevice() doesn't,
368 we have to handle this case here. */
369 if (!SDL_WasInit(SDL_INIT_AUDIO)) {
370 if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) {
371 return -1;
372 }
373 }
374
435375 /* If the mixer is already opened, increment open count */
436 if ( audio_opened ) {
437 if ( format == mixer.format && nchannels == mixer.channels ) {
376 if (audio_opened) {
377 if (format == mixer.format && nchannels == mixer.channels) {
438378 ++audio_opened;
439379 return(0);
440380 }
441 while ( audio_opened ) {
381 while (audio_opened) {
442382 Mix_CloseAudio();
443383 }
444384 }
452392 desired.userdata = NULL;
453393
454394 /* Accept nearly any audio format */
455 if ( SDL_OpenAudio(&desired, &mixer) < 0 ) {
395 if ((audio_device = SDL_OpenAudioDevice(device, 0, &desired, &mixer, allowed_changes)) == 0) {
456396 return(-1);
457397 }
458398 #if 0
460400 #endif
461401
462402 /* Initialize the music players */
463 if ( open_music(&mixer) < 0 ) {
464 SDL_CloseAudio();
403 load_music();
404 if (open_music(&mixer) < 0) {
405 SDL_CloseAudioDevice(audio_device);
465406 return(-1);
466407 }
467408
469410 mix_channel = (struct _Mix_Channel *) SDL_malloc(num_channels * sizeof(struct _Mix_Channel));
470411
471412 /* Clear out the audio channels */
472 for ( i=0; i<num_channels; ++i ) {
413 for (i=0; i<num_channels; ++i) {
473414 mix_channel[i].chunk = NULL;
474415 mix_channel[i].playing = 0;
475416 mix_channel[i].looping = 0;
486427
487428 _Mix_InitEffects();
488429
489 /* This list is (currently) decided at build time. */
490430 add_chunk_decoder("WAVE");
491431 add_chunk_decoder("AIFF");
492432 add_chunk_decoder("VOC");
493 #ifdef OGG_MUSIC
494 add_chunk_decoder("OGG");
495 #endif
496 #ifdef FLAC_MUSIC
497 add_chunk_decoder("FLAC");
498 #endif
499 #if defined(MP3_MUSIC) || defined(MP3_MAD_MUSIC)
500 add_chunk_decoder("MP3");
501 #endif
433 if (has_music(MUS_MOD)) {
434 add_chunk_decoder("MOD");
435 }
436 if (has_music(MUS_MID)) {
437 add_chunk_decoder("MID");
438 }
439 if (has_music(MUS_OGG)) {
440 add_chunk_decoder("OGG");
441 }
442 if (has_music(MUS_MP3)) {
443 add_chunk_decoder("MP3");
444 }
445 if (has_music(MUS_FLAC)) {
446 add_chunk_decoder("FLAC");
447 }
502448
503449 audio_opened = 1;
504 SDL_PauseAudio(0);
450 SDL_PauseAudioDevice(audio_device, 0);
505451 return(0);
452 }
453
454 /* Open the mixer with a certain desired audio format */
455 int Mix_OpenAudio(int frequency, Uint16 format, int nchannels, int chunksize)
456 {
457 return Mix_OpenAudioDevice(frequency, format, nchannels, chunksize, NULL,
458 SDL_AUDIO_ALLOW_FREQUENCY_CHANGE |
459 SDL_AUDIO_ALLOW_CHANNELS_CHANGE);
506460 }
507461
508462 /* Dynamically change the number of channels managed by the mixer.
511465 */
512466 int Mix_AllocateChannels(int numchans)
513467 {
514 if ( numchans<0 || numchans==num_channels )
468 if (numchans<0 || numchans==num_channels)
515469 return(num_channels);
516470
517 if ( numchans < num_channels ) {
471 if (numchans < num_channels) {
518472 /* Stop the affected channels */
519473 int i;
520474 for(i=numchans; i < num_channels; i++) {
522476 Mix_HaltChannel(i);
523477 }
524478 }
525 SDL_LockAudio();
479 Mix_LockAudio();
526480 mix_channel = (struct _Mix_Channel *) SDL_realloc(mix_channel, numchans * sizeof(struct _Mix_Channel));
527 if ( numchans > num_channels ) {
481 if (numchans > num_channels) {
528482 /* Initialize the new channels */
529483 int i;
530484 for(i=num_channels; i < numchans; i++) {
531485 mix_channel[i].chunk = NULL;
532486 mix_channel[i].playing = 0;
533487 mix_channel[i].looping = 0;
534 mix_channel[i].volume = SDL_MIX_MAXVOLUME;
535 mix_channel[i].fade_volume = SDL_MIX_MAXVOLUME;
536 mix_channel[i].fade_volume_reset = SDL_MIX_MAXVOLUME;
488 mix_channel[i].volume = MIX_MAX_VOLUME;
489 mix_channel[i].fade_volume = MIX_MAX_VOLUME;
490 mix_channel[i].fade_volume_reset = MIX_MAX_VOLUME;
537491 mix_channel[i].fading = MIX_NO_FADING;
538492 mix_channel[i].tag = -1;
539493 mix_channel[i].expire = 0;
542496 }
543497 }
544498 num_channels = numchans;
545 SDL_UnlockAudio();
499 Mix_UnlockAudio();
546500 return(num_channels);
547501 }
548502
549503 /* Return the actual mixer parameters */
550504 int Mix_QuerySpec(int *frequency, Uint16 *format, int *channels)
551505 {
552 if ( audio_opened ) {
553 if ( frequency ) {
506 if (audio_opened) {
507 if (frequency) {
554508 *frequency = mixer.freq;
555509 }
556 if ( format ) {
510 if (format) {
557511 *format = mixer.format;
558512 }
559 if ( channels ) {
513 if (channels) {
560514 *channels = mixer.channels;
561515 }
562516 }
563517 return(audio_opened);
564518 }
565519
566 static int detect_mp3(Uint8 *magic)
567 {
568 if ( strncmp((char *)magic, "ID3", 3) == 0 ) {
569 return 1;
570 }
571
572 /* Detection code lifted from SMPEG */
573 if(((magic[0] & 0xff) != 0xff) || // No sync bits
574 ((magic[1] & 0xf0) != 0xf0) || //
575 ((magic[2] & 0xf0) == 0x00) || // Bitrate is 0
576 ((magic[2] & 0xf0) == 0xf0) || // Bitrate is 15
577 ((magic[2] & 0x0c) == 0x0c) || // Frequency is 3
578 ((magic[1] & 0x06) == 0x00)) { // Layer is 4
579 return(0);
580 }
581 return 1;
520 typedef struct _MusicFragment
521 {
522 Uint8 *data;
523 int size;
524 struct _MusicFragment *next;
525 } MusicFragment;
526
527 static SDL_AudioSpec *Mix_LoadMusic_RW(Mix_MusicType music_type, SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
528 {
529 int i;
530 Mix_MusicInterface *interface = NULL;
531 void *music = NULL;
532 Sint64 start;
533 SDL_bool playing;
534 MusicFragment *first = NULL, *last = NULL, *fragment = NULL;
535 int count = 0;
536 int fragment_size;
537
538 *spec = mixer;
539
540 /* Use fragments sized on full audio frame boundaries - this'll do */
541 fragment_size = spec->size;
542
543 start = SDL_RWtell(src);
544 for (i = 0; i < get_num_music_interfaces(); ++i) {
545 interface = get_music_interface(i);
546 if (interface->type != music_type) {
547 continue;
548 }
549 if (!interface->CreateFromRW || !interface->GetAudio) {
550 continue;
551 }
552
553 /* These music interfaces are not safe to use while music is playing */
554 if (interface->api == MIX_MUSIC_CMD ||
555 interface->api == MIX_MUSIC_MIKMOD ||
556 interface->api == MIX_MUSIC_NATIVEMIDI) {
557 continue;
558 }
559
560 music = interface->CreateFromRW(src, freesrc);
561 if (music) {
562 /* The interface owns the data source now */
563 freesrc = SDL_FALSE;
564 break;
565 }
566
567 /* Reset the stream for the next decoder */
568 SDL_RWseek(src, start, RW_SEEK_SET);
569 }
570
571 if (!music) {
572 if (freesrc) {
573 SDL_RWclose(src);
574 }
575 Mix_SetError("Unrecognized audio format");
576 return NULL;
577 }
578
579 Mix_LockAudio();
580
581 if (interface->Play) {
582 interface->Play(music, 1);
583 }
584 playing = SDL_TRUE;
585
586 while (playing) {
587 int left;
588
589 fragment = (MusicFragment *)SDL_malloc(sizeof(*fragment));
590 if (!fragment) {
591 /* Uh oh, out of memory, let's return what we have */
592 break;
593 }
594 fragment->data = (Uint8 *)SDL_malloc(fragment_size);
595 if (!fragment->data) {
596 /* Uh oh, out of memory, let's return what we have */
597 SDL_free(fragment);
598 break;
599 }
600 fragment->next = NULL;
601
602 left = interface->GetAudio(music, fragment->data, fragment_size);
603 if (left > 0) {
604 playing = SDL_FALSE;
605 } else if (interface->IsPlaying) {
606 playing = interface->IsPlaying(music);
607 }
608 fragment->size = (fragment_size - left);
609
610 if (!first) {
611 first = fragment;
612 }
613 if (last) {
614 last->next = fragment;
615 }
616 last = fragment;
617 ++count;
618 }
619
620 if (interface->Stop) {
621 interface->Stop(music);
622 }
623
624 if (music) {
625 interface->Delete(music);
626 }
627
628 Mix_UnlockAudio();
629
630 if (count > 0) {
631 *audio_len = (count - 1) * fragment_size + fragment->size;
632 *audio_buf = (Uint8 *)SDL_malloc(*audio_len);
633 if (*audio_buf) {
634 Uint8 *dst = *audio_buf;
635 for (fragment = first; fragment; fragment = fragment->next) {
636 SDL_memcpy(dst, fragment->data, fragment->size);
637 dst += fragment->size;
638 }
639 } else {
640 SDL_OutOfMemory();
641 spec = NULL;
642 }
643 } else {
644 Mix_SetError("No audio data");
645 spec = NULL;
646 }
647
648 while (first) {
649 fragment = first;
650 first = first->next;
651 SDL_free(fragment->data);
652 SDL_free(fragment);
653 }
654
655 if (freesrc) {
656 SDL_RWclose(src);
657 }
658 return spec;
582659 }
583660
584661 /* Load a wave file */
585662 Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc)
586663 {
587 Uint32 magic;
664 Uint8 magic[4];
588665 Mix_Chunk *chunk;
589666 SDL_AudioSpec wavespec, *loaded;
590667 SDL_AudioCVT wavecvt;
591668 int samplesize;
592669
593670 /* rcg06012001 Make sure src is valid */
594 if ( ! src ) {
671 if (!src) {
595672 SDL_SetError("Mix_LoadWAV_RW with NULL src");
596673 return(NULL);
597674 }
598675
599676 /* Make sure audio has been opened */
600 if ( ! audio_opened ) {
677 if (!audio_opened) {
601678 SDL_SetError("Audio device hasn't been opened");
602 if ( freesrc ) {
679 if (freesrc) {
603680 SDL_RWclose(src);
604681 }
605682 return(NULL);
607684
608685 /* Allocate the chunk memory */
609686 chunk = (Mix_Chunk *)SDL_malloc(sizeof(Mix_Chunk));
610 if ( chunk == NULL ) {
687 if (chunk == NULL) {
611688 SDL_SetError("Out of memory");
612 if ( freesrc ) {
689 if (freesrc) {
613690 SDL_RWclose(src);
614691 }
615692 return(NULL);
616693 }
617694
618695 /* Find out what kind of audio file this is */
619 magic = SDL_ReadLE32(src);
696 if (SDL_RWread(src, magic, 1, 4) != 4) {
697 if (freesrc) {
698 SDL_RWclose(src);
699 }
700 Mix_SetError("Couldn't read first 4 bytes of audio data");
701 return NULL;
702 }
620703 /* Seek backwards for compatibility with older loaders */
621 SDL_RWseek(src, -(int)sizeof(Uint32), RW_SEEK_CUR);
622
623 switch (magic) {
624 case WAVE:
625 case RIFF:
626 loaded = SDL_LoadWAV_RW(src, freesrc, &wavespec,
627 (Uint8 **)&chunk->abuf, &chunk->alen);
628 break;
629 case FORM:
630 loaded = Mix_LoadAIFF_RW(src, freesrc, &wavespec,
631 (Uint8 **)&chunk->abuf, &chunk->alen);
632 break;
633 #ifdef OGG_MUSIC
634 case OGGS:
635 loaded = Mix_LoadOGG_RW(src, freesrc, &wavespec,
636 (Uint8 **)&chunk->abuf, &chunk->alen);
637 break;
638 #endif
639 #ifdef FLAC_MUSIC
640 case FLAC:
641 loaded = Mix_LoadFLAC_RW(src, freesrc, &wavespec,
642 (Uint8 **)&chunk->abuf, &chunk->alen);
643 break;
644 #endif
645 case CREA:
646 loaded = Mix_LoadVOC_RW(src, freesrc, &wavespec,
647 (Uint8 **)&chunk->abuf, &chunk->alen);
648 break;
649 default:
650 #if defined(MP3_MUSIC) || defined(MP3_MAD_MUSIC)
651 if (detect_mp3((Uint8*)&magic))
652 {
653 /* note: send a copy of the mixer spec */
654 wavespec = mixer;
655 loaded = Mix_LoadMP3_RW(src, freesrc, &wavespec,
656 (Uint8 **)&chunk->abuf, &chunk->alen);
657 break;
658 }
659 #endif
660 SDL_SetError("Unrecognized sound file type");
661 if ( freesrc ) {
662 SDL_RWclose(src);
663 }
664 loaded = NULL;
665 break;
666 }
667 if ( !loaded ) {
704 SDL_RWseek(src, -4, RW_SEEK_CUR);
705
706 if (SDL_memcmp(magic, "WAVE", 4) == 0 || SDL_memcmp(magic, "RIFF", 4) == 0) {
707 loaded = SDL_LoadWAV_RW(src, freesrc, &wavespec, (Uint8 **)&chunk->abuf, &chunk->alen);
708 } else if (SDL_memcmp(magic, "FORM", 4) == 0) {
709 loaded = Mix_LoadAIFF_RW(src, freesrc, &wavespec, (Uint8 **)&chunk->abuf, &chunk->alen);
710 } else if (SDL_memcmp(magic, "CREA", 4) == 0) {
711 loaded = Mix_LoadVOC_RW(src, freesrc, &wavespec, (Uint8 **)&chunk->abuf, &chunk->alen);
712 } else {
713 Mix_MusicType music_type = detect_music_type_from_magic(magic);
714 loaded = Mix_LoadMusic_RW(music_type, src, freesrc, &wavespec, (Uint8 **)&chunk->abuf, &chunk->alen);
715 }
716 if (!loaded) {
668717 /* The individual loaders have closed src if needed */
669718 SDL_free(chunk);
670719 return(NULL);
676725 #endif
677726
678727 /* Build the audio converter and create conversion buffers */
679 if ( wavespec.format != mixer.format ||
728 if (wavespec.format != mixer.format ||
680729 wavespec.channels != mixer.channels ||
681 wavespec.freq != mixer.freq ) {
682 if ( SDL_BuildAudioCVT(&wavecvt,
730 wavespec.freq != mixer.freq) {
731 if (SDL_BuildAudioCVT(&wavecvt,
683732 wavespec.format, wavespec.channels, wavespec.freq,
684 mixer.format, mixer.channels, mixer.freq) < 0 ) {
733 mixer.format, mixer.channels, mixer.freq) < 0) {
685734 SDL_free(chunk->abuf);
686735 SDL_free(chunk);
687736 return(NULL);
689738 samplesize = ((wavespec.format & 0xFF)/8)*wavespec.channels;
690739 wavecvt.len = chunk->alen & ~(samplesize-1);
691740 wavecvt.buf = (Uint8 *)SDL_calloc(1, wavecvt.len*wavecvt.len_mult);
692 if ( wavecvt.buf == NULL ) {
741 if (wavecvt.buf == NULL) {
693742 SDL_SetError("Out of memory");
694743 SDL_free(chunk->abuf);
695744 SDL_free(chunk);
696745 return(NULL);
697746 }
698 SDL_memcpy(wavecvt.buf, chunk->abuf, chunk->alen);
747 SDL_memcpy(wavecvt.buf, chunk->abuf, wavecvt.len);
699748 SDL_free(chunk->abuf);
700749
701750 /* Run the audio converter */
702 if ( SDL_ConvertAudio(&wavecvt) < 0 ) {
751 if (SDL_ConvertAudio(&wavecvt) < 0) {
703752 SDL_free(wavecvt.buf);
704753 SDL_free(chunk);
705754 return(NULL);
722771 Uint8 magic[4];
723772
724773 /* Make sure audio has been opened */
725 if ( ! audio_opened ) {
774 if (! audio_opened) {
726775 SDL_SetError("Audio device hasn't been opened");
727776 return(NULL);
728777 }
729778
730779 /* Allocate the chunk memory */
731780 chunk = (Mix_Chunk *)SDL_calloc(1,sizeof(Mix_Chunk));
732 if ( chunk == NULL ) {
781 if (chunk == NULL) {
733782 SDL_SetError("Out of memory");
734783 return(NULL);
735784 }
744793 mem += 4;
745794 chunk->abuf = mem;
746795 mem += chunk->alen;
747 } while ( memcmp(magic, "data", 4) != 0 );
796 } while (memcmp(magic, "data", 4) != 0);
748797 chunk->volume = MIX_MAX_VOLUME;
749798
750799 return(chunk);
756805 Mix_Chunk *chunk;
757806
758807 /* Make sure audio has been opened */
759 if ( ! audio_opened ) {
808 if (! audio_opened) {
760809 SDL_SetError("Audio device hasn't been opened");
761810 return(NULL);
762811 }
763812
764813 /* Allocate the chunk memory */
765814 chunk = (Mix_Chunk *)SDL_malloc(sizeof(Mix_Chunk));
766 if ( chunk == NULL ) {
815 if (chunk == NULL) {
767816 SDL_SetError("Out of memory");
768817 return(NULL);
769818 }
783832 int i;
784833
785834 /* Caution -- if the chunk is playing, the mixer will crash */
786 if ( chunk ) {
835 if (chunk) {
787836 /* Guarantee that this chunk isn't playing */
788 SDL_LockAudio();
789 if ( mix_channel ) {
790 for ( i=0; i<num_channels; ++i ) {
791 if ( chunk == mix_channel[i].chunk ) {
837 Mix_LockAudio();
838 if (mix_channel) {
839 for (i=0; i<num_channels; ++i) {
840 if (chunk == mix_channel[i].chunk) {
792841 mix_channel[i].playing = 0;
793842 mix_channel[i].looping = 0;
794843 }
795844 }
796845 }
797 SDL_UnlockAudio();
846 Mix_UnlockAudio();
798847 /* Actually free the chunk */
799 if ( chunk->allocated ) {
848 if (chunk->allocated) {
800849 SDL_free(chunk->abuf);
801850 }
802851 SDL_free(chunk);
807856 This can be used to provide real-time visual display of the audio stream
808857 or add a custom mixer filter for the stream data.
809858 */
810 void Mix_SetPostMix(void (*mix_func)
859 void Mix_SetPostMix(void (SDLCALL *mix_func)
811860 (void *udata, Uint8 *stream, int len), void *arg)
812861 {
813 SDL_LockAudio();
862 Mix_LockAudio();
814863 mix_postmix_data = arg;
815864 mix_postmix = mix_func;
816 SDL_UnlockAudio();
865 Mix_UnlockAudio();
817866 }
818867
819868 /* Add your own music player or mixer function.
820869 If 'mix_func' is NULL, the default music player is re-enabled.
821870 */
822 void Mix_HookMusic(void (*mix_func)(void *udata, Uint8 *stream, int len),
871 void Mix_HookMusic(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len),
823872 void *arg)
824873 {
825 SDL_LockAudio();
826 if ( mix_func != NULL ) {
874 Mix_LockAudio();
875 if (mix_func != NULL) {
827876 music_data = arg;
828877 mix_music = mix_func;
829878 } else {
830879 music_data = NULL;
831880 mix_music = music_mixer;
832881 }
833 SDL_UnlockAudio();
882 Mix_UnlockAudio();
834883 }
835884
836885 void *Mix_GetMusicHookData(void)
838887 return(music_data);
839888 }
840889
841 void Mix_ChannelFinished(void (*channel_finished)(int channel))
842 {
843 SDL_LockAudio();
890 void Mix_ChannelFinished(void (SDLCALL *channel_finished)(int channel))
891 {
892 Mix_LockAudio();
844893 channel_done_callback = channel_finished;
845 SDL_UnlockAudio();
894 Mix_UnlockAudio();
846895 }
847896
848897
879928 int i;
880929
881930 /* Don't play null pointers :-) */
882 if ( chunk == NULL ) {
931 if (chunk == NULL) {
883932 Mix_SetError("Tried to play a NULL chunk");
884933 return(-1);
885934 }
886 if ( !checkchunkintegral(chunk)) {
935 if (!checkchunkintegral(chunk)) {
887936 Mix_SetError("Tried to play a chunk with a bad frame");
888937 return(-1);
889938 }
890939
891940 /* Lock the mixer while modifying the playing channels */
892 SDL_LockAudio();
941 Mix_LockAudio();
893942 {
894943 /* If which is -1, play on the first free channel */
895 if ( which == -1 ) {
896 for ( i=reserved_channels; i<num_channels; ++i ) {
897 if ( mix_channel[i].playing <= 0 )
944 if (which == -1) {
945 for (i=reserved_channels; i<num_channels; ++i) {
946 if (mix_channel[i].playing <= 0)
898947 break;
899948 }
900 if ( i == num_channels ) {
949 if (i == num_channels) {
901950 Mix_SetError("No free channels available");
902951 which = -1;
903952 } else {
906955 }
907956
908957 /* Queue up the audio data for this channel */
909 if ( which >= 0 && which < num_channels ) {
958 if (which >= 0 && which < num_channels) {
910959 Uint32 sdl_ticks = SDL_GetTicks();
911960 if (Mix_Playing(which))
912961 _Mix_channel_done_playing(which);
920969 mix_channel[which].expire = (ticks>0) ? (sdl_ticks + ticks) : 0;
921970 }
922971 }
923 SDL_UnlockAudio();
972 Mix_UnlockAudio();
924973
925974 /* Return the channel on which the sound is being played */
926975 return(which);
931980 {
932981 int status = 0;
933982
934 if ( which == -1 ) {
983 if (which == -1) {
935984 int i;
936 for ( i=0; i < num_channels; ++ i ) {
985 for (i=0; i < num_channels; ++ i) {
937986 status += Mix_ExpireChannel(i, ticks);
938987 }
939 } else if ( which < num_channels ) {
940 SDL_LockAudio();
988 } else if (which < num_channels) {
989 Mix_LockAudio();
941990 mix_channel[which].expire = (ticks>0) ? (SDL_GetTicks() + ticks) : 0;
942 SDL_UnlockAudio();
991 Mix_UnlockAudio();
943992 ++ status;
944993 }
945994 return(status);
9511000 int i;
9521001
9531002 /* Don't play null pointers :-) */
954 if ( chunk == NULL ) {
1003 if (chunk == NULL) {
9551004 return(-1);
9561005 }
957 if ( !checkchunkintegral(chunk)) {
1006 if (!checkchunkintegral(chunk)) {
9581007 Mix_SetError("Tried to play a chunk with a bad frame");
9591008 return(-1);
9601009 }
9611010
9621011 /* Lock the mixer while modifying the playing channels */
963 SDL_LockAudio();
1012 Mix_LockAudio();
9641013 {
9651014 /* If which is -1, play on the first free channel */
966 if ( which == -1 ) {
967 for ( i=reserved_channels; i<num_channels; ++i ) {
968 if ( mix_channel[i].playing <= 0 )
1015 if (which == -1) {
1016 for (i=reserved_channels; i<num_channels; ++i) {
1017 if (mix_channel[i].playing <= 0)
9691018 break;
9701019 }
971 if ( i == num_channels ) {
1020 if (i == num_channels) {
9721021 which = -1;
9731022 } else {
9741023 which = i;
9761025 }
9771026
9781027 /* Queue up the audio data for this channel */
979 if ( which >= 0 && which < num_channels ) {
1028 if (which >= 0 && which < num_channels) {
9801029 Uint32 sdl_ticks = SDL_GetTicks();
9811030 if (Mix_Playing(which))
9821031 _Mix_channel_done_playing(which);
9941043 mix_channel[which].expire = (ticks > 0) ? (sdl_ticks+ticks) : 0;
9951044 }
9961045 }
997 SDL_UnlockAudio();
1046 Mix_UnlockAudio();
9981047
9991048 /* Return the channel on which the sound is being played */
10001049 return(which);
10061055 int i;
10071056 int prev_volume = 0;
10081057
1009 if ( which == -1 ) {
1010 for ( i=0; i<num_channels; ++i ) {
1058 if (which == -1) {
1059 for (i=0; i<num_channels; ++i) {
10111060 prev_volume += Mix_Volume(i, volume);
10121061 }
10131062 prev_volume /= num_channels;
1014 } else if ( which < num_channels ) {
1063 } else if (which < num_channels) {
10151064 prev_volume = mix_channel[which].volume;
1016 if ( volume >= 0 ) {
1017 if ( volume > SDL_MIX_MAXVOLUME ) {
1018 volume = SDL_MIX_MAXVOLUME;
1065 if (volume >= 0) {
1066 if (volume > MIX_MAX_VOLUME) {
1067 volume = MIX_MAX_VOLUME;
10191068 }
10201069 mix_channel[which].volume = volume;
10211070 }
10281077 int prev_volume;
10291078
10301079 prev_volume = chunk->volume;
1031 if ( volume >= 0 ) {
1032 if ( volume > MIX_MAX_VOLUME ) {
1080 if (volume >= 0) {
1081 if (volume > MIX_MAX_VOLUME) {
10331082 volume = MIX_MAX_VOLUME;
10341083 }
10351084 chunk->volume = volume;
10421091 {
10431092 int i;
10441093
1045 if ( which == -1 ) {
1046 for ( i=0; i<num_channels; ++i ) {
1094 if (which == -1) {
1095 for (i=0; i<num_channels; ++i) {
10471096 Mix_HaltChannel(i);
10481097 }
1049 } else if ( which < num_channels ) {
1050 SDL_LockAudio();
1098 } else if (which < num_channels) {
1099 Mix_LockAudio();
10511100 if (mix_channel[which].playing) {
10521101 _Mix_channel_done_playing(which);
10531102 mix_channel[which].playing = 0;
10571106 if(mix_channel[which].fading != MIX_NO_FADING) /* Restore volume */
10581107 mix_channel[which].volume = mix_channel[which].fade_volume_reset;
10591108 mix_channel[which].fading = MIX_NO_FADING;
1060 SDL_UnlockAudio();
1109 Mix_UnlockAudio();
10611110 }
10621111 return(0);
10631112 }
10671116 {
10681117 int i;
10691118
1070 for ( i=0; i<num_channels; ++i ) {
1071 if( mix_channel[i].tag == tag ) {
1119 for (i=0; i<num_channels; ++i) {
1120 if(mix_channel[i].tag == tag) {
10721121 Mix_HaltChannel(i);
10731122 }
10741123 }
10811130 int status;
10821131
10831132 status = 0;
1084 if ( audio_opened ) {
1085 if ( which == -1 ) {
1133 if (audio_opened) {
1134 if (which == -1) {
10861135 int i;
10871136
1088 for ( i=0; i<num_channels; ++i ) {
1137 for (i=0; i<num_channels; ++i) {
10891138 status += Mix_FadeOutChannel(i, ms);
10901139 }
1091 } else if ( which < num_channels ) {
1092 SDL_LockAudio();
1093 if ( mix_channel[which].playing &&
1140 } else if (which < num_channels) {
1141 Mix_LockAudio();
1142 if (mix_channel[which].playing &&
10941143 (mix_channel[which].volume > 0) &&
1095 (mix_channel[which].fading != MIX_FADING_OUT) ) {
1144 (mix_channel[which].fading != MIX_FADING_OUT)) {
10961145 mix_channel[which].fade_volume = mix_channel[which].volume;
10971146 mix_channel[which].fading = MIX_FADING_OUT;
10981147 mix_channel[which].fade_length = (Uint32)ms;
11041153 }
11051154 ++status;
11061155 }
1107 SDL_UnlockAudio();
1156 Mix_UnlockAudio();
11081157 }
11091158 }
11101159 return(status);
11151164 {
11161165 int i;
11171166 int status = 0;
1118 for ( i=0; i<num_channels; ++i ) {
1119 if( mix_channel[i].tag == tag ) {
1167 for (i=0; i<num_channels; ++i) {
1168 if(mix_channel[i].tag == tag) {
11201169 status += Mix_FadeOutChannel(i,ms);
11211170 }
11221171 }
11251174
11261175 Mix_Fading Mix_FadingChannel(int which)
11271176 {
1128 if ( which < 0 || which >= num_channels ) {
1177 if (which < 0 || which >= num_channels) {
11291178 return MIX_NO_FADING;
11301179 }
11311180 return mix_channel[which].fading;
11391188 int status;
11401189
11411190 status = 0;
1142 if ( which == -1 ) {
1191 if (which == -1) {
11431192 int i;
11441193
1145 for ( i=0; i<num_channels; ++i ) {
1194 for (i=0; i<num_channels; ++i) {
11461195 if ((mix_channel[i].playing > 0) ||
11471196 mix_channel[i].looping)
11481197 {
11491198 ++status;
11501199 }
11511200 }
1152 } else if ( which < num_channels ) {
1153 if ( (mix_channel[which].playing > 0) ||
1154 mix_channel[which].looping )
1201 } else if (which < num_channels) {
1202 if ((mix_channel[which].playing > 0) ||
1203 mix_channel[which].looping)
11551204 {
11561205 ++status;
11571206 }
11761225 {
11771226 int i;
11781227
1179 if ( audio_opened ) {
1180 if ( audio_opened == 1 ) {
1228 if (audio_opened) {
1229 if (audio_opened == 1) {
11811230 for (i = 0; i < num_channels; i++) {
11821231 Mix_UnregisterAllEffects(i);
11831232 }
11841233 Mix_UnregisterAllEffects(MIX_CHANNEL_POST);
11851234 close_music();
1235 Mix_SetMusicCMD(NULL);
11861236 Mix_HaltChannel(-1);
11871237 _Mix_DeinitEffects();
1188 SDL_CloseAudio();
1238 SDL_CloseAudioDevice(audio_device);
1239 audio_device = 0;
11891240 SDL_free(mix_channel);
11901241 mix_channel = NULL;
11911242
12021253 void Mix_Pause(int which)
12031254 {
12041255 Uint32 sdl_ticks = SDL_GetTicks();
1205 if ( which == -1 ) {
1256 if (which == -1) {
12061257 int i;
12071258
1208 for ( i=0; i<num_channels; ++i ) {
1209 if ( mix_channel[i].playing > 0 ) {
1259 for (i=0; i<num_channels; ++i) {
1260 if (mix_channel[i].playing > 0) {
12101261 mix_channel[i].paused = sdl_ticks;
12111262 }
12121263 }
1213 } else if ( which < num_channels ) {
1214 if ( mix_channel[which].playing > 0 ) {
1264 } else if (which < num_channels) {
1265 if (mix_channel[which].playing > 0) {
12151266 mix_channel[which].paused = sdl_ticks;
12161267 }
12171268 }
12221273 {
12231274 Uint32 sdl_ticks = SDL_GetTicks();
12241275
1225 SDL_LockAudio();
1226 if ( which == -1 ) {
1276 Mix_LockAudio();
1277 if (which == -1) {
12271278 int i;
12281279
1229 for ( i=0; i<num_channels; ++i ) {
1230 if ( mix_channel[i].playing > 0 ) {
1280 for (i=0; i<num_channels; ++i) {
1281 if (mix_channel[i].playing > 0) {
12311282 if(mix_channel[i].expire > 0)
12321283 mix_channel[i].expire += sdl_ticks - mix_channel[i].paused;
12331284 mix_channel[i].paused = 0;
12341285 }
12351286 }
1236 } else if ( which < num_channels ) {
1237 if ( mix_channel[which].playing > 0 ) {
1287 } else if (which < num_channels) {
1288 if (mix_channel[which].playing > 0) {
12381289 if(mix_channel[which].expire > 0)
12391290 mix_channel[which].expire += sdl_ticks - mix_channel[which].paused;
12401291 mix_channel[which].paused = 0;
12411292 }
12421293 }
1243 SDL_UnlockAudio();
1294 Mix_UnlockAudio();
12441295 }
12451296
12461297 int Mix_Paused(int which)
12471298 {
1248 if ( which < 0 ) {
1299 if (which < 0) {
12491300 int status = 0;
12501301 int i;
1251 for( i=0; i < num_channels; ++i ) {
1252 if ( mix_channel[i].paused ) {
1302 for(i=0; i < num_channels; ++i) {
1303 if (mix_channel[i].paused) {
12531304 ++ status;
12541305 }
12551306 }
12561307 return(status);
1257 } else if ( which < num_channels ) {
1308 } else if (which < num_channels) {
12581309 return(mix_channel[which].paused != 0);
12591310 } else {
12601311 return(0);
12641315 /* Change the group of a channel */
12651316 int Mix_GroupChannel(int which, int tag)
12661317 {
1267 if ( which < 0 || which > num_channels )
1318 if (which < 0 || which > num_channels)
12681319 return(0);
12691320
1270 SDL_LockAudio();
1321 Mix_LockAudio();
12711322 mix_channel[which].tag = tag;
1272 SDL_UnlockAudio();
1323 Mix_UnlockAudio();
12731324 return(1);
12741325 }
12751326
12771328 int Mix_GroupChannels(int from, int to, int tag)
12781329 {
12791330 int status = 0;
1280 for( ; from <= to; ++ from ) {
1331 for(; from <= to; ++ from) {
12811332 status += Mix_GroupChannel(from, tag);
12821333 }
12831334 return(status);
12871338 int Mix_GroupAvailable(int tag)
12881339 {
12891340 int i;
1290 for( i=0; i < num_channels; i ++ ) {
1291 if ( ((tag == -1) || (tag == mix_channel[i].tag)) &&
1292 (mix_channel[i].playing <= 0) )
1341 for(i=0; i < num_channels; i ++) {
1342 if (((tag == -1) || (tag == mix_channel[i].tag)) &&
1343 (mix_channel[i].playing <= 0))
12931344 return i;
12941345 }
12951346 return(-1);
12991350 {
13001351 int count = 0;
13011352 int i;
1302 for( i=0; i < num_channels; i ++ ) {
1303 if ( mix_channel[i].tag==tag || tag==-1 )
1353 for(i=0; i < num_channels; i ++) {
1354 if (mix_channel[i].tag==tag || tag==-1)
13041355 ++ count;
13051356 }
13061357 return(count);
13121363 int chan = -1;
13131364 Uint32 mintime = SDL_GetTicks();
13141365 int i;
1315 for( i=0; i < num_channels; i ++ ) {
1316 if ( (mix_channel[i].tag==tag || tag==-1) && mix_channel[i].playing > 0
1317 && mix_channel[i].start_time <= mintime ) {
1366 for(i=0; i < num_channels; i ++) {
1367 if ((mix_channel[i].tag==tag || tag==-1) && mix_channel[i].playing > 0
1368 && mix_channel[i].start_time <= mintime) {
13181369 mintime = mix_channel[i].start_time;
13191370 chan = i;
13201371 }
13281379 int chan = -1;
13291380 Uint32 maxtime = 0;
13301381 int i;
1331 for( i=0; i < num_channels; i ++ ) {
1332 if ( (mix_channel[i].tag==tag || tag==-1) && mix_channel[i].playing > 0
1333 && mix_channel[i].start_time >= maxtime ) {
1382 for(i=0; i < num_channels; i ++) {
1383 if ((mix_channel[i].tag==tag || tag==-1) && mix_channel[i].playing > 0
1384 && mix_channel[i].start_time >= maxtime) {
13341385 maxtime = mix_channel[i].start_time;
13351386 chan = i;
13361387 }
13461397 * as Mix_SetPanning().
13471398 */
13481399
1349 /* MAKE SURE you hold the audio lock (SDL_LockAudio()) before calling this! */
1400 /* MAKE SURE you hold the audio lock (Mix_LockAudio()) before calling this! */
13501401 static int _Mix_register_effect(effect_info **e, Mix_EffectFunc_t f,
13511402 Mix_EffectDone_t d, void *arg)
13521403 {
13911442 }
13921443
13931444
1394 /* MAKE SURE you hold the audio lock (SDL_LockAudio()) before calling this! */
1445 /* MAKE SURE you hold the audio lock (Mix_LockAudio()) before calling this! */
13951446 static int _Mix_remove_effect(int channel, effect_info **e, Mix_EffectFunc_t f)
13961447 {
13971448 effect_info *cur;
14261477 }
14271478
14281479
1429 /* MAKE SURE you hold the audio lock (SDL_LockAudio()) before calling this! */
1480 /* MAKE SURE you hold the audio lock (Mix_LockAudio()) before calling this! */
14301481 static int _Mix_remove_all_effects(int channel, effect_info **e)
14311482 {
14321483 effect_info *cur;
14501501 }
14511502
14521503
1453 /* MAKE SURE you hold the audio lock (SDL_LockAudio()) before calling this! */
1504 /* MAKE SURE you hold the audio lock (Mix_LockAudio()) before calling this! */
14541505 int _Mix_RegisterEffect_locked(int channel, Mix_EffectFunc_t f,
14551506 Mix_EffectDone_t d, void *arg)
14561507 {
14731524 Mix_EffectDone_t d, void *arg)
14741525 {
14751526 int retval;
1476 SDL_LockAudio();
1527 Mix_LockAudio();
14771528 retval = _Mix_RegisterEffect_locked(channel, f, d, arg);
1478 SDL_UnlockAudio();
1529 Mix_UnlockAudio();
14791530 return retval;
14801531 }
14811532
14821533
1483 /* MAKE SURE you hold the audio lock (SDL_LockAudio()) before calling this! */
1534 /* MAKE SURE you hold the audio lock (Mix_LockAudio()) before calling this! */
14841535 int _Mix_UnregisterEffect_locked(int channel, Mix_EffectFunc_t f)
14851536 {
14861537 effect_info **e = NULL;
15011552 int Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f)
15021553 {
15031554 int retval;
1504 SDL_LockAudio();
1555 Mix_LockAudio();
15051556 retval = _Mix_UnregisterEffect_locked(channel, f);
1506 SDL_UnlockAudio();
1557 Mix_UnlockAudio();
15071558 return(retval);
15081559 }
15091560
1510 /* MAKE SURE you hold the audio lock (SDL_LockAudio()) before calling this! */
1561 /* MAKE SURE you hold the audio lock (Mix_LockAudio()) before calling this! */
15111562 int _Mix_UnregisterAllEffects_locked(int channel)
15121563 {
15131564 effect_info **e = NULL;
15281579 int Mix_UnregisterAllEffects(int channel)
15291580 {
15301581 int retval;
1531 SDL_LockAudio();
1582 Mix_LockAudio();
15321583 retval = _Mix_UnregisterAllEffects_locked(channel);
1533 SDL_UnlockAudio();
1584 Mix_UnlockAudio();
15341585 return(retval);
15351586 }
15361587
1588 void Mix_LockAudio(void)
1589 {
1590 SDL_LockAudioDevice(audio_device);
1591 }
1592
1593 void Mix_UnlockAudio(void)
1594 {
1595 SDL_UnlockAudioDevice(audio_device);
1596 }
1597
15371598 /* end of mixer.c ... */
15381599
1600 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* Locking wrapper functions */
22 extern void Mix_LockAudio(void);
23 extern void Mix_UnlockAudio(void);
24
25 /* vi: set ts=4 sw=4 expandtab: */
+596
-1142
music.c less more
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
1717 misrepresented as being the original software.
1818 3. This notice may not be removed or altered from any source distribution.
1919 */
20
21 /* $Id$ */
22
23 #include <stdlib.h>
24 #include <string.h>
25 #include <ctype.h>
26 #include <assert.h>
27 #include "SDL_endian.h"
28 #include "SDL_audio.h"
20 #include <string.h> /* for strtok() and strtok_s() */
21
22 #include "SDL_hints.h"
23 #include "SDL_log.h"
2924 #include "SDL_timer.h"
3025
3126 #include "SDL_mixer.h"
32
33 #ifdef CMD_MUSIC
27 #include "mixer.h"
28 #include "music.h"
29
3430 #include "music_cmd.h"
35 #endif
36 #ifdef WAV_MUSIC
37 #include "wavestream.h"
38 #endif
39 #ifdef MODPLUG_MUSIC
31 #include "music_wav.h"
32 #include "music_mikmod.h"
4033 #include "music_modplug.h"
41 #endif
42 #ifdef MOD_MUSIC
43 #include "music_mod.h"
44 #endif
45 #ifdef MID_MUSIC
46 # ifdef USE_TIMIDITY_MIDI
47 # include "timidity.h"
48 # endif
49 # ifdef USE_FLUIDSYNTH_MIDI
50 # include "fluidsynth.h"
51 # endif
52 # ifdef USE_NATIVE_MIDI
53 # include "native_midi.h"
54 # endif
55 #endif
56 #ifdef OGG_MUSIC
34 #include "music_nativemidi.h"
35 #include "music_fluidsynth.h"
36 #include "music_timidity.h"
5737 #include "music_ogg.h"
58 #endif
59 #ifdef MP3_MUSIC
60 #include "dynamic_mp3.h"
61 #endif
62 #ifdef MP3_MAD_MUSIC
38 #include "music_mpg123.h"
6339 #include "music_mad.h"
64 #endif
65 #ifdef FLAC_MUSIC
40 #include "music_smpeg.h"
6641 #include "music_flac.h"
67 #endif
68
69 #if defined(MP3_MUSIC) || defined(MP3_MAD_MUSIC)
70 static SDL_AudioSpec used_mixer;
71 #endif
72
73
74 int volatile music_active = 1;
75 static int volatile music_stopped = 0;
76 static int music_loops = 0;
77 static char *music_cmd = NULL;
42 #include "native_midi/native_midi.h"
43
44
45 char *music_cmd = NULL;
46 static SDL_bool music_active = SDL_TRUE;
47 static int music_volume = MIX_MAX_VOLUME;
7848 static Mix_Music * volatile music_playing = NULL;
79 static int music_volume = MIX_MAX_VOLUME;
49 SDL_AudioSpec music_spec;
8050
8151 struct _Mix_Music {
82 Mix_MusicType type;
83 union {
84 #ifdef CMD_MUSIC
85 MusicCMD *cmd;
86 #endif
87 #ifdef WAV_MUSIC
88 WAVStream *wave;
89 #endif
90 #ifdef MODPLUG_MUSIC
91 modplug_data *modplug;
92 #endif
93 #ifdef MOD_MUSIC
94 struct MODULE *module;
95 #endif
96 #ifdef MID_MUSIC
97 #ifdef USE_TIMIDITY_MIDI
98 MidiSong *midi;
99 #endif
100 #ifdef USE_FLUIDSYNTH_MIDI
101 FluidSynthMidiSong *fluidsynthmidi;
102 #endif
103 #ifdef USE_NATIVE_MIDI
104 NativeMidiSong *nativemidi;
105 #endif
106 #endif
107 #ifdef OGG_MUSIC
108 OGG_music *ogg;
109 #endif
110 #ifdef MP3_MUSIC
111 SMPEG *mp3;
112 #endif
113 #ifdef MP3_MAD_MUSIC
114 mad_data *mp3_mad;
115 #endif
116 #ifdef FLAC_MUSIC
117 FLAC_music *flac;
118 #endif
119 } data;
52 Mix_MusicInterface *interface;
53 void *context;
54
55 SDL_bool playing;
12056 Mix_Fading fading;
12157 int fade_step;
12258 int fade_steps;
123 int error;
12459 };
125 #ifdef MID_MUSIC
126 #ifdef USE_TIMIDITY_MIDI
127 static int timidity_ok;
128 static int samplesize;
129 #endif
130 #ifdef USE_FLUIDSYNTH_MIDI
131 static int fluidsynth_ok;
132 #endif
133 #ifdef USE_NATIVE_MIDI
134 static int native_midi_ok;
135 #endif
136 #endif
13760
13861 /* Used to calculate fading steps */
13962 static int ms_per_step;
14366 static int num_decoders = 0;
14467
14568 /* Semicolon-separated SoundFont paths */
146 #ifdef MID_MUSIC
147 char* soundfont_paths = NULL;
148 #endif
69 static char* soundfont_paths = NULL;
70
71 /* Interfaces for the various music interfaces, ordered by priority */
72 static Mix_MusicInterface *s_music_interfaces[] =
73 {
74 #ifdef MUSIC_CMD
75 &Mix_MusicInterface_CMD,
76 #endif
77 #ifdef MUSIC_WAV
78 &Mix_MusicInterface_WAV,
79 #endif
80 #ifdef MUSIC_FLAC
81 &Mix_MusicInterface_FLAC,
82 #endif
83 #ifdef MUSIC_OGG
84 &Mix_MusicInterface_OGG,
85 #endif
86 #ifdef MUSIC_MP3_MPG123
87 &Mix_MusicInterface_MPG123,
88 #endif
89 #ifdef MUSIC_MP3_MAD
90 &Mix_MusicInterface_MAD,
91 #endif
92 #ifdef MUSIC_MP3_SMPEG
93 &Mix_MusicInterface_SMPEG,
94 #endif
95 #ifdef MUSIC_MOD_MODPLUG
96 &Mix_MusicInterface_MODPLUG,
97 #endif
98 #ifdef MUSIC_MOD_MIKMOD
99 &Mix_MusicInterface_MIKMOD,
100 #endif
101 #ifdef MUSIC_MID_FLUIDSYNTH
102 &Mix_MusicInterface_FLUIDSYNTH,
103 #endif
104 #ifdef MUSIC_MID_TIMIDITY
105 &Mix_MusicInterface_TIMIDITY,
106 #endif
107 #ifdef MUSIC_MID_NATIVE
108 &Mix_MusicInterface_NATIVEMIDI,
109 #endif
110 };
111
112 int get_num_music_interfaces(void)
113 {
114 return SDL_arraysize(s_music_interfaces);
115 }
116
117 Mix_MusicInterface *get_music_interface(int index)
118 {
119 return s_music_interfaces[index];
120 }
149121
150122 int Mix_GetNumMusicDecoders(void)
151123 {
173145 /* Local low-level functions prototypes */
174146 static void music_internal_initialize_volume(void);
175147 static void music_internal_volume(int volume);
176 static int music_internal_play(Mix_Music *music, double position);
148 static int music_internal_play(Mix_Music *music, int play_count, double position);
177149 static int music_internal_position(double position);
178 static int music_internal_playing();
150 static SDL_bool music_internal_playing(void);
179151 static void music_internal_halt(void);
180152
181153
182154 /* Support for hooking when the music has finished */
183 static void (*music_finished_hook)(void) = NULL;
184
185 void Mix_HookMusicFinished(void (*music_finished)(void))
186 {
187 SDL_LockAudio();
155 static void (SDLCALL *music_finished_hook)(void) = NULL;
156
157 void Mix_HookMusicFinished(void (SDLCALL *music_finished)(void))
158 {
159 Mix_LockAudio();
188160 music_finished_hook = music_finished;
189 SDL_UnlockAudio();
190 }
191
192
193 /* If music isn't playing, halt it if no looping is required, restart it */
194 /* othesrchise. NOP if the music is playing */
195 static int music_halt_or_loop (void)
196 {
197 /* Restart music if it has to loop */
198
199 if (!music_internal_playing())
200 {
201 #ifdef USE_NATIVE_MIDI
202 /* Native MIDI handles looping internally */
203 if (music_playing->type == MUS_MID && native_midi_ok) {
204 music_loops = 0;
205 }
206 #endif
207
208 /* Restart music if it has to loop at a high level */
209 if (music_loops)
210 {
211 Mix_Fading current_fade;
212 if (music_loops > 0) {
213 --music_loops;
214 }
215 current_fade = music_playing->fading;
216 music_internal_play(music_playing, 0.0);
217 music_playing->fading = current_fade;
218 }
219 else
220 {
221 music_internal_halt();
222 if (music_finished_hook)
223 music_finished_hook();
224
225 return 0;
226 }
227 }
228
229 return 1;
230 }
231
232
161 Mix_UnlockAudio();
162 }
163
164 /* Convenience function to fill audio and mix at the specified volume
165 This is called from many music player's GetAudio callback.
166 */
167 int music_pcm_getaudio(void *context, void *data, int bytes, int volume,
168 int (*GetSome)(void *context, void *data, int bytes, SDL_bool *done))
169 {
170 Uint8 *snd = (Uint8 *)data;
171 Uint8 *dst;
172 int len = bytes;
173 SDL_bool done = SDL_FALSE;
174
175 if (volume == MIX_MAX_VOLUME) {
176 dst = snd;
177 } else {
178 dst = SDL_stack_alloc(Uint8, bytes);
179 }
180 while (len > 0 && !done) {
181 int consumed = GetSome(context, dst, len, &done);
182 if (consumed < 0) {
183 break;
184 }
185
186 if (volume == MIX_MAX_VOLUME) {
187 dst += consumed;
188 } else {
189 SDL_MixAudioFormat(snd, dst, music_spec.format, (Uint32)consumed, volume);
190 snd += consumed;
191 }
192 len -= consumed;
193 }
194 if (volume != MIX_MAX_VOLUME) {
195 SDL_stack_free(dst);
196 }
197 return len;
198 }
233199
234200 /* Mixing function */
235 void music_mixer(void *udata, Uint8 *stream, int len)
236 {
237 int left = 0;
238
239 if ( music_playing && music_active ) {
201 void SDLCALL music_mixer(void *udata, Uint8 *stream, int len)
202 {
203 while (music_playing && music_active && len > 0) {
240204 /* Handle fading */
241 if ( music_playing->fading != MIX_NO_FADING ) {
242 if ( music_playing->fade_step++ < music_playing->fade_steps ) {
205 if (music_playing->fading != MIX_NO_FADING) {
206 if (music_playing->fade_step++ < music_playing->fade_steps) {
243207 int volume;
244208 int fade_step = music_playing->fade_step;
245209 int fade_steps = music_playing->fade_steps;
246210
247 if ( music_playing->fading == MIX_FADING_OUT ) {
211 if (music_playing->fading == MIX_FADING_OUT) {
248212 volume = (music_volume * (fade_steps-fade_step)) / fade_steps;
249213 } else { /* Fading in */
250214 volume = (music_volume * fade_step) / fade_steps;
251215 }
252216 music_internal_volume(volume);
253217 } else {
254 if ( music_playing->fading == MIX_FADING_OUT ) {
218 if (music_playing->fading == MIX_FADING_OUT) {
255219 music_internal_halt();
256 if ( music_finished_hook ) {
220 if (music_finished_hook) {
257221 music_finished_hook();
258222 }
259223 return;
262226 }
263227 }
264228
265 music_halt_or_loop();
266 if (!music_internal_playing())
267 return;
268
269 switch (music_playing->type) {
270 #ifdef CMD_MUSIC
271 case MUS_CMD:
272 /* The playing is done externally */
273 break;
274 #endif
275 #ifdef WAV_MUSIC
276 case MUS_WAV:
277 left = WAVStream_PlaySome(stream, len);
278 break;
279 #endif
280 #ifdef MODPLUG_MUSIC
281 case MUS_MODPLUG:
282 left = modplug_playAudio(music_playing->data.modplug, stream, len);
283 break;
284 #endif
285 #ifdef MOD_MUSIC
286 case MUS_MOD:
287 left = MOD_playAudio(music_playing->data.module, stream, len);
288 break;
289 #endif
290 #ifdef MID_MUSIC
291 case MUS_MID:
292 #ifdef USE_NATIVE_MIDI
293 if ( native_midi_ok ) {
294 /* Native midi is handled asynchronously */
295 goto skip;
296 }
297 #endif
298 #ifdef USE_FLUIDSYNTH_MIDI
299 if ( fluidsynth_ok ) {
300 fluidsynth_playsome(music_playing->data.fluidsynthmidi, stream, len);
301 goto skip;
302 }
303 #endif
304 #ifdef USE_TIMIDITY_MIDI
305 if ( timidity_ok ) {
306 int samples = len / samplesize;
307 Timidity_PlaySome(stream, samples);
308 goto skip;
309 }
310 #endif
311 break;
312 #endif
313 #ifdef OGG_MUSIC
314 case MUS_OGG:
315
316 left = OGG_playAudio(music_playing->data.ogg, stream, len);
317 break;
318 #endif
319 #ifdef FLAC_MUSIC
320 case MUS_FLAC:
321 left = FLAC_playAudio(music_playing->data.flac, stream, len);
322 break;
323 #endif
324 #ifdef MP3_MUSIC
325 case MUS_MP3:
326 left = (len - smpeg.SMPEG_playAudio(music_playing->data.mp3, stream, len));
327 break;
328 #endif
329 #ifdef MP3_MAD_MUSIC
330 case MUS_MP3_MAD:
331 left = mad_getSamples(music_playing->data.mp3_mad, stream, len);
332 break;
333 #endif
334 default:
335 /* Unknown music type?? */
336 break;
337 }
338 }
339
340 skip:
341 /* Handle seamless music looping */
342 if (left > 0 && left < len) {
343 music_halt_or_loop();
344 if (music_internal_playing())
345 music_mixer(udata, stream+(len-left), left);
346 }
347 }
348
349 /* Initialize the music players with a certain desired audio format */
350 int open_music(SDL_AudioSpec *mixer)
351 {
352 #ifdef WAV_MUSIC
353 if ( WAVStream_Init(mixer) == 0 ) {
354 add_music_decoder("WAVE");
355 }
356 #endif
357 #ifdef MODPLUG_MUSIC
358 if ( modplug_init(mixer) == 0 ) {
359 add_music_decoder("MODPLUG");
360 }
361 #endif
362 #ifdef MOD_MUSIC
363 if ( MOD_init(mixer) == 0 ) {
364 add_music_decoder("MIKMOD");
365 }
366 #endif
367 #ifdef MID_MUSIC
368 #ifdef USE_TIMIDITY_MIDI
369 samplesize = mixer->size / mixer->samples;
370 if ( Timidity_Init(mixer->freq, mixer->format,
371 mixer->channels, mixer->samples) == 0 ) {
372 timidity_ok = 1;
373 add_music_decoder("TIMIDITY");
374 } else {
375 timidity_ok = 0;
376 }
377 #endif
378 #ifdef USE_FLUIDSYNTH_MIDI
379 if ( fluidsynth_init(mixer) == 0 ) {
380 fluidsynth_ok = 1;
381 add_music_decoder("FLUIDSYNTH");
382 } else {
383 fluidsynth_ok = 0;
384 }
385 #endif
386 #ifdef USE_NATIVE_MIDI
387 #ifdef USE_FLUIDSYNTH_MIDI
388 native_midi_ok = !fluidsynth_ok;
389 if ( native_midi_ok )
390 #endif
391 #ifdef USE_TIMIDITY_MIDI
392 native_midi_ok = !timidity_ok;
393 if ( !native_midi_ok ) {
394 native_midi_ok = (getenv("SDL_NATIVE_MUSIC") != NULL);
395 }
396 if ( native_midi_ok )
397 #endif
398 native_midi_ok = native_midi_detect();
399 if ( native_midi_ok )
400 add_music_decoder("NATIVEMIDI");
401 #endif
402 #endif
403 #ifdef OGG_MUSIC
404 if ( OGG_init(mixer) == 0 ) {
405 add_music_decoder("OGG");
406 }
407 #endif
408 #ifdef FLAC_MUSIC
409 if ( FLAC_init(mixer) == 0 ) {
410 add_music_decoder("FLAC");
411 }
412 #endif
413 #if defined(MP3_MUSIC) || defined(MP3_MAD_MUSIC)
414 /* Keep a copy of the mixer */
415 used_mixer = *mixer;
416 add_music_decoder("MP3");
417 #endif
418
419 music_playing = NULL;
420 music_stopped = 0;
421 Mix_VolumeMusic(SDL_MIX_MAXVOLUME);
229 if (music_playing->interface->GetAudio) {
230 int left = music_playing->interface->GetAudio(music_playing->context, stream, len);
231 if (left != 0) {
232 /* Either an error or finished playing with data left */
233 music_playing->playing = SDL_FALSE;
234 }
235 if (left > 0) {
236 stream += (len - left);
237 len = left;
238 } else {
239 len = 0;
240 }
241 } else {
242 len = 0;
243 }
244
245 if (!music_internal_playing()) {
246 music_internal_halt();
247 if (music_finished_hook) {
248 music_finished_hook();
249 }
250 }
251 }
252 }
253
254 /* Load the music interface libraries */
255 int load_music(void)
256 {
257 char hint[128];
258
259 int i;
260 for (i = 0; i < SDL_arraysize(s_music_interfaces); ++i) {
261 Mix_MusicInterface *interface = s_music_interfaces[i];
262 if (interface->loaded) {
263 continue;
264 }
265
266 SDL_snprintf(hint, sizeof(hint), "SDL_MIXER_DISABLE_%s", interface->tag);
267 if (SDL_GetHintBoolean(hint, SDL_FALSE)) {
268 continue;
269 }
270
271 if (!interface->Load || interface->Load() == 0) {
272 interface->loaded = SDL_TRUE;
273 }
274 }
275 return 0;
276 }
277
278 /* Return SDL_TRUE if the music type is available */
279 SDL_bool has_music(Mix_MusicType type)
280 {
281 int i;
282 for (i = 0; i < SDL_arraysize(s_music_interfaces); ++i) {
283 Mix_MusicInterface *interface = s_music_interfaces[i];
284 if (interface->type != type) {
285 continue;
286 }
287 if (interface->opened) {
288 return SDL_TRUE;
289 }
290 }
291 return SDL_FALSE;
292 }
293
294 /* Initialize the music interfaces with a certain desired audio format */
295 int open_music(const SDL_AudioSpec *spec)
296 {
297 int i;
298 SDL_bool use_native_midi = SDL_FALSE;
299
300 #ifdef MIX_INIT_SOUNDFONT_PATHS
301 if (!soundfont_paths) {
302 soundfont_paths = SDL_strdup(MIX_INIT_SOUNDFONT_PATHS);
303 }
304 #endif
305
306
307 #ifdef MUSIC_MID_NATIVE
308 if (SDL_GetHintBoolean("SDL_NATIVE_MUSIC", SDL_FALSE) && native_midi_detect()) {
309 use_native_midi = SDL_TRUE;
310 }
311 #endif
312
313 music_spec = *spec;
314 for (i = 0; i < SDL_arraysize(s_music_interfaces); ++i) {
315 Mix_MusicInterface *interface = s_music_interfaces[i];
316 if (!interface->loaded) {
317 continue;
318 }
319
320 if (interface->type == MUS_MID && use_native_midi && interface->api != MIX_MUSIC_NATIVEMIDI) {
321 continue;
322 }
323
324 if (!interface->Open || interface->Open(spec) == 0) {
325 interface->opened = SDL_TRUE;
326 add_music_decoder(interface->tag);
327 }
328 }
329
330 if (has_music(MUS_MOD)) {
331 add_music_decoder("MOD");
332 }
333 if (has_music(MUS_MID)) {
334 add_music_decoder("MIDI");
335 }
336 if (has_music(MUS_MP3)) {
337 add_music_decoder("MP3");
338 }
339
340 Mix_VolumeMusic(MIX_MAX_VOLUME);
422341
423342 /* Calculate the number of ms for each callback */
424 ms_per_step = (int) (((float)mixer->samples * 1000.0) / mixer->freq);
425
426 return(0);
427 }
428
429 /* Portable case-insensitive string compare function */
430 int MIX_string_equals(const char *str1, const char *str2)
431 {
432 while ( *str1 && *str2 ) {
433 if ( toupper((unsigned char)*str1) !=
434 toupper((unsigned char)*str2) )
435 break;
436 ++str1;
437 ++str2;
438 }
439 return (!*str1 && !*str2);
440 }
441
442 static int detect_mp3(Uint8 *magic)
443 {
444 if ( strncmp((char *)magic, "ID3", 3) == 0 ) {
445 return 1;
446 }
447
448 /* Detection code lifted from SMPEG */
449 if(((magic[0] & 0xff) != 0xff) || // No sync bits
450 ((magic[1] & 0xf0) != 0xf0) || //
451 ((magic[2] & 0xf0) == 0x00) || // Bitrate is 0
452 ((magic[2] & 0xf0) == 0xf0) || // Bitrate is 15
453 ((magic[2] & 0x0c) == 0x0c) || // Frequency is 3
454 ((magic[1] & 0x06) == 0x00)) { // Layer is 4
455 return(0);
456 }
457 return 1;
458 }
459
460 /* MUS_MOD can't be auto-detected. If no other format was detected, MOD is
461 * assumed and MUS_MOD will be returned, meaning that the format might not
462 * actually be MOD-based.
463 *
464 * Returns MUS_NONE in case of errors. */
465 static Mix_MusicType detect_music_type(SDL_RWops *src)
466 {
467 Uint8 magic[5];
468 Uint8 moremagic[9];
469
470 Sint64 start = SDL_RWtell(src);
471 if (SDL_RWread(src, magic, 1, 4) != 4 || SDL_RWread(src, moremagic, 1, 8) != 8 ) {
472 Mix_SetError("Couldn't read from RWops");
473 return MUS_NONE;
474 }
475 SDL_RWseek(src, start, RW_SEEK_SET);
476 magic[4]='\0';
477 moremagic[8] = '\0';
478
479 /* WAVE files have the magic four bytes "RIFF"
480 AIFF files have the magic 12 bytes "FORM" XXXX "AIFF" */
481 if (((strcmp((char *)magic, "RIFF") == 0) && (strcmp((char *)(moremagic+4), "WAVE") == 0)) ||
482 (strcmp((char *)magic, "FORM") == 0)) {
483 return MUS_WAV;
484 }
485
343 ms_per_step = (int) (((float)spec->samples * 1000.0) / spec->freq);
344
345 return 0;
346 }
347
348 Mix_MusicType detect_music_type_from_magic(const Uint8 *magic)
349 {
486350 /* Ogg Vorbis files have the magic four bytes "OggS" */
487 if (strcmp((char *)magic, "OggS") == 0) {
351 if (SDL_memcmp(magic, "OggS", 4) == 0) {
488352 return MUS_OGG;
489353 }
490354
491355 /* FLAC files have the magic four bytes "fLaC" */
492 if (strcmp((char *)magic, "fLaC") == 0) {
356 if (SDL_memcmp(magic, "fLaC", 4) == 0) {
493357 return MUS_FLAC;
494358 }
495359
496360 /* MIDI files have the magic four bytes "MThd" */
497 if (strcmp((char *)magic, "MThd") == 0) {
361 if (SDL_memcmp(magic, "MThd", 4) == 0) {
498362 return MUS_MID;
499363 }
500364
501 if (detect_mp3(magic)) {
365 if (SDL_memcmp(magic, "ID3", 3) == 0 ||
366 (magic[0] == 0xFF && (magic[1] & 0xFE) == 0xFA)) {
502367 return MUS_MP3;
503368 }
504369
510375 return MUS_MOD;
511376 }
512377
378 static Mix_MusicType detect_music_type(SDL_RWops *src)
379 {
380 Uint8 magic[12];
381
382 if (SDL_RWread(src, magic, 1, 12) != 12) {
383 Mix_SetError("Couldn't read first 12 bytes of audio data");
384 return MUS_NONE;
385 }
386 SDL_RWseek(src, -12, RW_SEEK_CUR);
387
388 /* WAVE files have the magic four bytes "RIFF"
389 AIFF files have the magic 12 bytes "FORM" XXXX "AIFF" */
390 if (((SDL_memcmp(magic, "RIFF", 4) == 0) && (SDL_memcmp((magic+8), "WAVE", 4) == 0)) ||
391 (SDL_memcmp(magic, "FORM", 4) == 0)) {
392 return MUS_WAV;
393 }
394
395 return detect_music_type_from_magic(magic);
396 }
397
513398 /* Load a music file */
514399 Mix_Music *Mix_LoadMUS(const char *file)
515400 {
401 int i;
402 void *context;
403 char *ext;
404 Mix_MusicType type;
516405 SDL_RWops *src;
517 Mix_Music *music;
518 Mix_MusicType type;
519 char *ext = strrchr(file, '.');
520
521 #ifdef CMD_MUSIC
522 if ( music_cmd ) {
523 /* Allocate memory for the music structure */
524 music = (Mix_Music *)SDL_malloc(sizeof(Mix_Music));
525 if ( music == NULL ) {
526 Mix_SetError("Out of memory");
527 return(NULL);
528 }
529 music->error = 0;
530 music->type = MUS_CMD;
531 music->data.cmd = MusicCMD_LoadSong(music_cmd, file);
532 if ( music->data.cmd == NULL ) {
533 SDL_free(music);
534 music = NULL;
535 }
536 return music;
537 }
538 #endif
406
407 for (i = 0; i < SDL_arraysize(s_music_interfaces); ++i) {
408 Mix_MusicInterface *interface = s_music_interfaces[i];
409 if (!interface->opened || !interface->CreateFromFile) {
410 continue;
411 }
412
413 context = interface->CreateFromFile(file);
414 if (context) {
415 /* Allocate memory for the music structure */
416 Mix_Music *music = (Mix_Music *)SDL_calloc(1, sizeof(Mix_Music));
417 if (music == NULL) {
418 Mix_SetError("Out of memory");
419 return NULL;
420 }
421 music->interface = interface;
422 music->context = context;
423 return music;
424 }
425 }
539426
540427 src = SDL_RWFromFile(file, "rb");
541 if ( src == NULL ) {
428 if (src == NULL) {
542429 Mix_SetError("Couldn't open '%s'", file);
543430 return NULL;
544431 }
546433 /* Use the extension as a first guess on the file type */
547434 type = MUS_NONE;
548435 ext = strrchr(file, '.');
549 /* No need to guard these with #ifdef *_MUSIC stuff,
550 * since we simply call Mix_LoadMUSType_RW() later */
551 if ( ext ) {
436 if (ext) {
552437 ++ext; /* skip the dot in the extension */
553 if ( MIX_string_equals(ext, "WAV") ) {
438 if (SDL_strcasecmp(ext, "WAV") == 0) {
554439 type = MUS_WAV;
555 } else if ( MIX_string_equals(ext, "MID") ||
556 MIX_string_equals(ext, "MIDI") ||
557 MIX_string_equals(ext, "KAR") ) {
440 } else if (SDL_strcasecmp(ext, "MID") == 0 ||
441 SDL_strcasecmp(ext, "MIDI") == 0 ||
442 SDL_strcasecmp(ext, "KAR") == 0) {
558443 type = MUS_MID;
559 } else if ( MIX_string_equals(ext, "OGG") ) {
444 } else if (SDL_strcasecmp(ext, "OGG") == 0) {
560445 type = MUS_OGG;
561 } else if ( MIX_string_equals(ext, "FLAC") ) {
446 } else if (SDL_strcasecmp(ext, "FLAC") == 0) {
562447 type = MUS_FLAC;
563 } else if ( MIX_string_equals(ext, "MPG") ||
564 MIX_string_equals(ext, "MPEG") ||
565 MIX_string_equals(ext, "MP3") ||
566 MIX_string_equals(ext, "MAD") ) {
448 } else if (SDL_strcasecmp(ext, "MPG") == 0 ||
449 SDL_strcasecmp(ext, "MPEG") == 0 ||
450 SDL_strcasecmp(ext, "MP3") == 0 ||
451 SDL_strcasecmp(ext, "MAD") == 0) {
567452 type = MUS_MP3;
568 }
569 }
570 if ( type == MUS_NONE ) {
571 type = detect_music_type(src);
572 }
573
574 /* We need to know if a specific error occurs; if not, we'll set a
575 * generic one, so we clear the current one. */
576 SDL_ClearError();
577 music = Mix_LoadMUSType_RW(src, type, SDL_TRUE);
578 if ( music == NULL && Mix_GetError()[0] == '\0' ) {
579 Mix_SetError("Unrecognized music format");
580 }
581 return music;
453 } else if (SDL_strcasecmp(ext, "669") == 0 ||
454 SDL_strcasecmp(ext, "AMF") == 0 ||
455 SDL_strcasecmp(ext, "AMS") == 0 ||
456 SDL_strcasecmp(ext, "DBM") == 0 ||
457 SDL_strcasecmp(ext, "DSM") == 0 ||
458 SDL_strcasecmp(ext, "FAR") == 0 ||
459 SDL_strcasecmp(ext, "IT") == 0 ||
460 SDL_strcasecmp(ext, "MED") == 0 ||
461 SDL_strcasecmp(ext, "MDL") == 0 ||
462 SDL_strcasecmp(ext, "MOD") == 0 ||
463 SDL_strcasecmp(ext, "MOL") == 0 ||
464 SDL_strcasecmp(ext, "MTM") == 0 ||
465 SDL_strcasecmp(ext, "NST") == 0 ||
466 SDL_strcasecmp(ext, "OKT") == 0 ||
467 SDL_strcasecmp(ext, "PTM") == 0 ||
468 SDL_strcasecmp(ext, "S3M") == 0 ||
469 SDL_strcasecmp(ext, "STM") == 0 ||
470 SDL_strcasecmp(ext, "ULT") == 0 ||
471 SDL_strcasecmp(ext, "UMX") == 0 ||
472 SDL_strcasecmp(ext, "WOW") == 0 ||
473 SDL_strcasecmp(ext, "XM") == 0) {
474 type = MUS_MOD;
475 }
476 }
477 return Mix_LoadMUSType_RW(src, type, SDL_TRUE);
582478 }
583479
584480 Mix_Music *Mix_LoadMUS_RW(SDL_RWops *src, int freesrc)
588484
589485 Mix_Music *Mix_LoadMUSType_RW(SDL_RWops *src, Mix_MusicType type, int freesrc)
590486 {
591 Mix_Music *music;
487 int i;
488 void *context;
592489 Sint64 start;
593490
594491 if (!src) {
601498 * this is. */
602499 if (type == MUS_NONE) {
603500 if ((type = detect_music_type(src)) == MUS_NONE) {
604 /* Don't call Mix_SetError() here since detect_music_type()
605 * does that. */
501 /* Don't call Mix_SetError() since detect_music_type() does that. */
606502 if (freesrc) {
607503 SDL_RWclose(src);
608504 }
610506 }
611507 }
612508
613 /* Allocate memory for the music structure */
614 music = (Mix_Music *)SDL_malloc(sizeof(Mix_Music));
615 if (music == NULL ) {
616 Mix_SetError("Out of memory");
617 if (freesrc) {
618 SDL_RWclose(src);
619 }
620 return NULL;
621 }
622 music->error = 1;
623
624 switch (type) {
625 #ifdef WAV_MUSIC
626 case MUS_WAV:
627 music->type = MUS_WAV;
628 music->data.wave = WAVStream_LoadSong_RW(src, freesrc);
629 if (music->data.wave) {
630 music->error = 0;
631 }
632 break;
633 #endif
634 #ifdef OGG_MUSIC
635 case MUS_OGG:
636 music->type = MUS_OGG;
637 music->data.ogg = OGG_new_RW(src, freesrc);
638 if (music->data.ogg) {
639 music->error = 0;
640 }
641 break;
642 #endif
643 #ifdef FLAC_MUSIC
644 case MUS_FLAC:
645 music->type = MUS_FLAC;
646 music->data.flac = FLAC_new_RW(src, freesrc);
647 if (music->data.flac) {
648 music->error = 0;
649 }
650 break;
651 #endif
652 #ifdef MP3_MUSIC
653 case MUS_MP3:
654 if (Mix_Init(MIX_INIT_MP3)) {
655 SMPEG_Info info;
656 music->type = MUS_MP3;
657 music->data.mp3 = smpeg.SMPEG_new_rwops(src, &info, freesrc, 0);
658 if (!info.has_audio) {
659 Mix_SetError("MPEG file does not have any audio stream.");
660 smpeg.SMPEG_delete(music->data.mp3);
661 /* Deleting the MP3 closed the source if desired */
662 freesrc = SDL_FALSE;
663 } else {
664 smpeg.SMPEG_actualSpec(music->data.mp3, &used_mixer);
665 music->error = 0;
666 }
667 }
668 break;
669 #elif defined(MP3_MAD_MUSIC)
670 case MUS_MP3:
671 music->type = MUS_MP3_MAD;
672 music->data.mp3_mad = mad_openFileRW(src, &used_mixer, freesrc);
673 if (music->data.mp3_mad) {
674 music->error = 0;
675 } else {
676 Mix_SetError("Could not initialize MPEG stream.");
677 }
678 break;
679 #endif
680 #ifdef MID_MUSIC
681 case MUS_MID:
682 music->type = MUS_MID;
683 #ifdef USE_NATIVE_MIDI
684 if (native_midi_ok) {
685 SDL_RWseek(src, start, RW_SEEK_SET);
686 music->data.nativemidi = native_midi_loadsong_RW(src, freesrc);
687 if (music->data.nativemidi) {
688 music->error = 0;
689 } else {
690 Mix_SetError("%s", native_midi_error());
691 }
692 break;
693 }
694 #endif
695 #ifdef USE_FLUIDSYNTH_MIDI
696 if (fluidsynth_ok) {
697 SDL_RWseek(src, start, RW_SEEK_SET);
698 music->data.fluidsynthmidi = fluidsynth_loadsong_RW(src, freesrc);
699 if (music->data.fluidsynthmidi) {
700 music->error = 0;
701 }
702 break;
703 }
704 #endif
705 #ifdef USE_TIMIDITY_MIDI
706 if (timidity_ok) {
707 SDL_RWseek(src, start, RW_SEEK_SET);
708 music->data.midi = Timidity_LoadSong_RW(src, freesrc);
709 if (music->data.midi) {
710 music->error = 0;
711 } else {
712 Mix_SetError("%s", Timidity_Error());
713 }
714 } else {
715 Mix_SetError("%s", Timidity_Error());
716 }
717 #endif
718 break;
719 #endif
720 #if defined(MODPLUG_MUSIC) || defined(MOD_MUSIC)
721 case MUS_MOD:
722 #ifdef MODPLUG_MUSIC
723 if (music->error) {
724 SDL_RWseek(src, start, RW_SEEK_SET);
725 music->type = MUS_MODPLUG;
726 music->data.modplug = modplug_new_RW(src, freesrc);
727 if (music->data.modplug) {
728 music->error = 0;
729 }
730 }
731 #endif
732 #ifdef MOD_MUSIC
733 if (music->error) {
734 SDL_RWseek(src, start, RW_SEEK_SET);
735 music->type = MUS_MOD;
736 music->data.module = MOD_new_RW(src, freesrc);
737 if (music->data.module) {
738 music->error = 0;
739 }
740 }
741 #endif
742 break;
743 #endif
744
745 default:
746 Mix_SetError("Unrecognized music format");
747 break;
748 } /* switch (want) */
749
750 if (music->error) {
751 SDL_free(music);
752 if (freesrc) {
753 SDL_RWclose(src);
754 } else {
755 SDL_RWseek(src, start, RW_SEEK_SET);
756 }
757 music = NULL;
758 }
759 return music;
509 Mix_ClearError();
510
511 for (i = 0; i < SDL_arraysize(s_music_interfaces); ++i) {
512 Mix_MusicInterface *interface = s_music_interfaces[i];
513 if (!interface->opened || type != interface->type || !interface->CreateFromRW) {
514 continue;
515 }
516
517 context = interface->CreateFromRW(src, freesrc);
518 if (context) {
519 /* Allocate memory for the music structure */
520 Mix_Music *music = (Mix_Music *)SDL_calloc(1, sizeof(Mix_Music));
521 if (music == NULL) {
522 interface->Delete(context);
523 Mix_SetError("Out of memory");
524 return NULL;
525 }
526 music->interface = interface;
527 music->context = context;
528 #ifdef DEBUG_MUSIC
529 /* This would be useful to expose via an API */
530 SDL_Log("Music playing with %s\n", interface->tag);
531 #endif
532 return music;
533 }
534
535 /* Reset the stream for the next decoder */
536 SDL_RWseek(src, start, RW_SEEK_SET);
537 }
538
539 if (!*Mix_GetError()) {
540 Mix_SetError("Unrecognized audio format");
541 }
542 if (freesrc) {
543 SDL_RWclose(src);
544 } else {
545 SDL_RWseek(src, start, RW_SEEK_SET);
546 }
547 return NULL;
760548 }
761549
762550 /* Free a music chunk previously loaded */
763551 void Mix_FreeMusic(Mix_Music *music)
764552 {
765 if ( music ) {
553 if (music) {
766554 /* Stop the music if it's currently playing */
767 SDL_LockAudio();
768 if ( music == music_playing ) {
555 Mix_LockAudio();
556 if (music == music_playing) {
769557 /* Wait for any fade out to finish */
770 while ( music->fading == MIX_FADING_OUT ) {
771 SDL_UnlockAudio();
558 while (music->fading == MIX_FADING_OUT) {
559 Mix_UnlockAudio();
772560 SDL_Delay(100);
773 SDL_LockAudio();
774 }
775 if ( music == music_playing ) {
561 Mix_LockAudio();
562 }
563 if (music == music_playing) {
776564 music_internal_halt();
777565 }
778566 }
779 SDL_UnlockAudio();
780 switch (music->type) {
781 #ifdef CMD_MUSIC
782 case MUS_CMD:
783 MusicCMD_FreeSong(music->data.cmd);
784 break;
785 #endif
786 #ifdef WAV_MUSIC
787 case MUS_WAV:
788 WAVStream_FreeSong(music->data.wave);
789 break;
790 #endif
791 #ifdef MODPLUG_MUSIC
792 case MUS_MODPLUG:
793 modplug_delete(music->data.modplug);
794 break;
795 #endif
796 #ifdef MOD_MUSIC
797 case MUS_MOD:
798 MOD_delete(music->data.module);
799 break;
800 #endif
801 #ifdef MID_MUSIC
802 case MUS_MID:
803 #ifdef USE_NATIVE_MIDI
804 if ( native_midi_ok ) {
805 native_midi_freesong(music->data.nativemidi);
806 goto skip;
807 }
808 #endif
809 #ifdef USE_FLUIDSYNTH_MIDI
810 if ( fluidsynth_ok ) {
811 fluidsynth_freesong(music->data.fluidsynthmidi);
812 goto skip;
813 }
814 #endif
815 #ifdef USE_TIMIDITY_MIDI
816 if ( timidity_ok ) {
817 Timidity_FreeSong(music->data.midi);
818 goto skip;
819 }
820 #endif
821 break;
822 #endif
823 #ifdef OGG_MUSIC
824 case MUS_OGG:
825 OGG_delete(music->data.ogg);
826 break;
827 #endif
828 #ifdef FLAC_MUSIC
829 case MUS_FLAC:
830 FLAC_delete(music->data.flac);
831 break;
832 #endif
833 #ifdef MP3_MUSIC
834 case MUS_MP3:
835 smpeg.SMPEG_delete(music->data.mp3);
836 break;
837 #endif
838 #ifdef MP3_MAD_MUSIC
839 case MUS_MP3_MAD:
840 mad_closeFile(music->data.mp3_mad);
841 break;
842 #endif
843 default:
844 /* Unknown music type?? */
845 break;
846 }
847
848 skip:
567 Mix_UnlockAudio();
568
569 music->interface->Delete(music->context);
849570 SDL_free(music);
850571 }
851572 }
857578 {
858579 Mix_MusicType type = MUS_NONE;
859580
860 if ( music ) {
861 type = music->type;
581 if (music) {
582 type = music->interface->type;
862583 } else {
863 SDL_LockAudio();
864 if ( music_playing ) {
865 type = music_playing->type;
866 }
867 SDL_UnlockAudio();
584 Mix_LockAudio();
585 if (music_playing) {
586 type = music_playing->interface->type;
587 }
588 Mix_UnlockAudio();
868589 }
869590 return(type);
870591 }
871592
872593 /* Play a music chunk. Returns 0, or -1 if there was an error.
873594 */
874 static int music_internal_play(Mix_Music *music, double position)
595 static int music_internal_play(Mix_Music *music, int play_count, double position)
875596 {
876597 int retval = 0;
877598
878 #if defined(__MACOSX__) && defined(USE_NATIVE_MIDI)
599 #if defined(__MACOSX__) && defined(MID_MUSIC_NATIVE)
879600 /* This fixes a bug with native MIDI on Mac OS X, where you
880601 can't really stop and restart MIDI from the audio callback.
881602 */
882 if ( music == music_playing && music->type == MUS_MID && native_midi_ok ) {
603 if (music == music_playing && music->api == MIX_MUSIC_NATIVEMIDI) {
883604 /* Just a seek suffices to restart playing */
884605 music_internal_position(position);
885606 return 0;
887608 #endif
888609
889610 /* Note the music we're playing */
890 if ( music_playing ) {
611 if (music_playing) {
891612 music_internal_halt();
892613 }
893614 music_playing = music;
615 music_playing->playing = SDL_TRUE;
894616
895617 /* Set the initial volume */
896 if ( music->type != MUS_MOD ) {
897 music_internal_initialize_volume();
898 }
618 music_internal_initialize_volume();
899619
900620 /* Set up for playback */
901 switch (music->type) {
902 #ifdef CMD_MUSIC
903 case MUS_CMD:
904 MusicCMD_Start(music->data.cmd);
905 break;
906 #endif
907 #ifdef WAV_MUSIC
908 case MUS_WAV:
909 WAVStream_Start(music->data.wave);
910 break;
911 #endif
912 #ifdef MODPLUG_MUSIC
913 case MUS_MODPLUG:
914 /* can't set volume until file is loaded, so finally set it now */
915 music_internal_initialize_volume();
916 modplug_play(music->data.modplug);
917 break;
918 #endif
919 #ifdef MOD_MUSIC
920 case MUS_MOD:
921 MOD_play(music->data.module);
922 /* Player_SetVolume() does nothing before Player_Start() */
923 music_internal_initialize_volume();
924 break;
925 #endif
926 #ifdef MID_MUSIC
927 case MUS_MID:
928 #ifdef USE_NATIVE_MIDI
929 if ( native_midi_ok ) {
930 native_midi_start(music->data.nativemidi, music_loops);
931 goto skip;
932 }
933 #endif
934 #ifdef USE_FLUIDSYNTH_MIDI
935 if (fluidsynth_ok ) {
936 fluidsynth_start(music->data.fluidsynthmidi);
937 goto skip;
938 }
939 #endif
940 #ifdef USE_TIMIDITY_MIDI
941 if ( timidity_ok ) {
942 Timidity_Start(music->data.midi);
943 goto skip;
944 }
945 #endif
946 break;
947 #endif
948 #ifdef OGG_MUSIC
949 case MUS_OGG:
950 OGG_play(music->data.ogg);
951 break;
952 #endif
953 #ifdef FLAC_MUSIC
954 case MUS_FLAC:
955 FLAC_play(music->data.flac);
956 break;
957 #endif
958 #ifdef MP3_MUSIC
959 case MUS_MP3:
960 smpeg.SMPEG_enableaudio(music->data.mp3,1);
961 smpeg.SMPEG_enablevideo(music->data.mp3,0);
962 smpeg.SMPEG_play(music_playing->data.mp3);
963 break;
964 #endif
965 #ifdef MP3_MAD_MUSIC
966 case MUS_MP3_MAD:
967 mad_start(music->data.mp3_mad);
968 break;
969 #endif
970 default:
971 Mix_SetError("Can't play unknown music type");
972 retval = -1;
973 break;
974 }
975
976 skip:
621 retval = music->interface->Play(music->context, play_count);
622
977623 /* Set the playback position, note any errors if an offset is used */
978 if ( retval == 0 ) {
979 if ( position > 0.0 ) {
980 if ( music_internal_position(position) < 0 ) {
624 if (retval == 0) {
625 if (position > 0.0) {
626 if (music_internal_position(position) < 0) {
981627 Mix_SetError("Position not implemented for music type");
982628 retval = -1;
983629 }
987633 }
988634
989635 /* If the setup failed, we're not playing any music anymore */
990 if ( retval < 0 ) {
636 if (retval < 0) {
637 music->playing = SDL_FALSE;
991638 music_playing = NULL;
992639 }
993640 return(retval);
994641 }
642
995643 int Mix_FadeInMusicPos(Mix_Music *music, int loops, int ms, double position)
996644 {
997645 int retval;
998646
999 if ( ms_per_step == 0 ) {
647 if (ms_per_step == 0) {
1000648 SDL_SetError("Audio device hasn't been opened");
1001649 return(-1);
1002650 }
1003651
1004652 /* Don't play null pointers :-) */
1005 if ( music == NULL ) {
653 if (music == NULL) {
1006654 Mix_SetError("music parameter was NULL");
1007655 return(-1);
1008656 }
1009657
1010658 /* Setup the data */
1011 if ( ms ) {
659 if (ms) {
1012660 music->fading = MIX_FADING_IN;
1013661 } else {
1014662 music->fading = MIX_NO_FADING;
1017665 music->fade_steps = ms/ms_per_step;
1018666
1019667 /* Play the puppy */
1020 SDL_LockAudio();
668 Mix_LockAudio();
1021669 /* If the current music is fading out, wait for the fade to complete */
1022 while ( music_playing && (music_playing->fading == MIX_FADING_OUT) ) {
1023 SDL_UnlockAudio();
670 while (music_playing && (music_playing->fading == MIX_FADING_OUT)) {
671 Mix_UnlockAudio();
1024672 SDL_Delay(100);
1025 SDL_LockAudio();
1026 }
1027 music_active = 1;
1028 if (loops == 1) {
673 Mix_LockAudio();
674 }
675 if (loops == 0) {
1029676 /* Loop is the number of times to play the audio */
1030 loops = 0;
1031 }
1032 music_loops = loops;
1033 retval = music_internal_play(music, position);
1034 SDL_UnlockAudio();
677 loops = 1;
678 }
679 retval = music_internal_play(music, loops, position);
680 Mix_UnlockAudio();
1035681
1036682 return(retval);
1037683 }
1047693 /* Set the playing music position */
1048694 int music_internal_position(double position)
1049695 {
1050 int retval = 0;
1051
1052 switch (music_playing->type) {
1053 #ifdef MODPLUG_MUSIC
1054 case MUS_MODPLUG:
1055 modplug_jump_to_time(music_playing->data.modplug, position);
1056 break;
1057 #endif
1058 #ifdef MOD_MUSIC
1059 case MUS_MOD:
1060 MOD_jump_to_time(music_playing->data.module, position);
1061 break;
1062 #endif
1063 #ifdef OGG_MUSIC
1064 case MUS_OGG:
1065 OGG_jump_to_time(music_playing->data.ogg, position);
1066 break;
1067 #endif
1068 #ifdef FLAC_MUSIC
1069 case MUS_FLAC:
1070 FLAC_jump_to_time(music_playing->data.flac, position);
1071 break;
1072 #endif
1073 #ifdef MP3_MUSIC
1074 case MUS_MP3:
1075 smpeg.SMPEG_rewind(music_playing->data.mp3);
1076 smpeg.SMPEG_play(music_playing->data.mp3);
1077 if ( position > 0.0 ) {
1078 smpeg.SMPEG_skip(music_playing->data.mp3, (float)position);
1079 }
1080 break;
1081 #endif
1082 #ifdef MP3_MAD_MUSIC
1083 case MUS_MP3_MAD:
1084 mad_seek(music_playing->data.mp3_mad, position);
1085 break;
1086 #endif
1087 default:
1088 /* TODO: Implement this for other music backends */
1089 retval = -1;
1090 break;
1091 }
1092 return(retval);
696 if (music_playing->interface->Seek) {
697 return music_playing->interface->Seek(music_playing->context, position);
698 }
699 return -1;
1093700 }
1094701 int Mix_SetMusicPosition(double position)
1095702 {
1096703 int retval;
1097704
1098 SDL_LockAudio();
1099 if ( music_playing ) {
705 Mix_LockAudio();
706 if (music_playing) {
1100707 retval = music_internal_position(position);
1101 if ( retval < 0 ) {
708 if (retval < 0) {
1102709 Mix_SetError("Position not implemented for music type");
1103710 }
1104711 } else {
1105712 Mix_SetError("Music isn't playing");
1106713 retval = -1;
1107714 }
1108 SDL_UnlockAudio();
715 Mix_UnlockAudio();
1109716
1110717 return(retval);
1111718 }
1113720 /* Set the music's initial volume */
1114721 static void music_internal_initialize_volume(void)
1115722 {
1116 if ( music_playing->fading == MIX_FADING_IN ) {
723 if (music_playing->fading == MIX_FADING_IN) {
1117724 music_internal_volume(0);
1118725 } else {
1119726 music_internal_volume(music_volume);
1123730 /* Set the music volume */
1124731 static void music_internal_volume(int volume)
1125732 {
1126 switch (music_playing->type) {
1127 #ifdef CMD_MUSIC
1128 case MUS_CMD:
1129 MusicCMD_SetVolume(volume);
1130 break;
1131 #endif
1132 #ifdef WAV_MUSIC
1133 case MUS_WAV:
1134 WAVStream_SetVolume(volume);
1135 break;
1136 #endif
1137 #ifdef MODPLUG_MUSIC
1138 case MUS_MODPLUG:
1139 modplug_setvolume(music_playing->data.modplug, volume);
1140 break;
1141 #endif
1142 #ifdef MOD_MUSIC
1143 case MUS_MOD:
1144 MOD_setvolume(music_playing->data.module, volume);
1145 break;
1146 #endif
1147 #ifdef MID_MUSIC
1148 case MUS_MID:
1149 #ifdef USE_NATIVE_MIDI
1150 if ( native_midi_ok ) {
1151 native_midi_setvolume(volume);
1152 return;
1153 }
1154 #endif
1155 #ifdef USE_FLUIDSYNTH_MIDI
1156 if ( fluidsynth_ok ) {
1157 fluidsynth_setvolume(music_playing->data.fluidsynthmidi, volume);
1158 return;
1159 }
1160 #endif
1161 #ifdef USE_TIMIDITY_MIDI
1162 if ( timidity_ok ) {
1163 Timidity_SetVolume(volume);
1164 return;
1165 }
1166 #endif
1167 break;
1168 #endif
1169 #ifdef OGG_MUSIC
1170 case MUS_OGG:
1171 OGG_setvolume(music_playing->data.ogg, volume);
1172 break;
1173 #endif
1174 #ifdef FLAC_MUSIC
1175 case MUS_FLAC:
1176 FLAC_setvolume(music_playing->data.flac, volume);
1177 break;
1178 #endif
1179 #ifdef MP3_MUSIC
1180 case MUS_MP3:
1181 smpeg.SMPEG_setvolume(music_playing->data.mp3,(int)(((float)volume/(float)MIX_MAX_VOLUME)*100.0));
1182 break;
1183 #endif
1184 #ifdef MP3_MAD_MUSIC
1185 case MUS_MP3_MAD:
1186 mad_setVolume(music_playing->data.mp3_mad, volume);
1187 break;
1188 #endif
1189 default:
1190 /* Unknown music type?? */
1191 break;
733 if (music_playing->interface->SetVolume) {
734 music_playing->interface->SetVolume(music_playing->context, volume);
1192735 }
1193736 }
1194737 int Mix_VolumeMusic(int volume)
1196739 int prev_volume;
1197740
1198741 prev_volume = music_volume;
1199 if ( volume < 0 ) {
742 if (volume < 0) {
1200743 return prev_volume;
1201744 }
1202 if ( volume > SDL_MIX_MAXVOLUME ) {
745 if (volume > SDL_MIX_MAXVOLUME) {
1203746 volume = SDL_MIX_MAXVOLUME;
1204747 }
1205748 music_volume = volume;
1206 SDL_LockAudio();
1207 if ( music_playing ) {
749 Mix_LockAudio();
750 if (music_playing) {
1208751 music_internal_volume(music_volume);
1209752 }
1210 SDL_UnlockAudio();
753 Mix_UnlockAudio();
1211754 return(prev_volume);
1212755 }
1213756
1214757 /* Halt playing of music */
1215758 static void music_internal_halt(void)
1216759 {
1217 switch (music_playing->type) {
1218 #ifdef CMD_MUSIC
1219 case MUS_CMD:
1220 MusicCMD_Stop(music_playing->data.cmd);
1221 break;
1222 #endif
1223 #ifdef WAV_MUSIC
1224 case MUS_WAV:
1225 WAVStream_Stop();
1226 break;
1227 #endif
1228 #ifdef MODPLUG_MUSIC
1229 case MUS_MODPLUG:
1230 modplug_stop(music_playing->data.modplug);
1231 break;
1232 #endif
1233 #ifdef MOD_MUSIC
1234 case MUS_MOD:
1235 MOD_stop(music_playing->data.module);
1236 break;
1237 #endif
1238 #ifdef MID_MUSIC
1239 case MUS_MID:
1240 #ifdef USE_NATIVE_MIDI
1241 if ( native_midi_ok ) {
1242 native_midi_stop();
1243 goto skip;
1244 }
1245 #endif
1246 #ifdef USE_FLUIDSYNTH_MIDI
1247 if ( fluidsynth_ok ) {
1248 fluidsynth_stop(music_playing->data.fluidsynthmidi);
1249 goto skip;
1250 }
1251 #endif
1252 #ifdef USE_TIMIDITY_MIDI
1253 if ( timidity_ok ) {
1254 Timidity_Stop();
1255 goto skip;
1256 }
1257 #endif
1258 break;
1259 #endif
1260 #ifdef OGG_MUSIC
1261 case MUS_OGG:
1262 OGG_stop(music_playing->data.ogg);
1263 break;
1264 #endif
1265 #ifdef FLAC_MUSIC
1266 case MUS_FLAC:
1267 FLAC_stop(music_playing->data.flac);
1268 break;
1269 #endif
1270 #ifdef MP3_MUSIC
1271 case MUS_MP3:
1272 smpeg.SMPEG_stop(music_playing->data.mp3);
1273 break;
1274 #endif
1275 #ifdef MP3_MAD_MUSIC
1276 case MUS_MP3_MAD:
1277 mad_stop(music_playing->data.mp3_mad);
1278 break;
1279 #endif
1280 default:
1281 /* Unknown music type?? */
1282 return;
1283 }
1284
1285 skip:
760 if (music_playing->interface->Stop) {
761 music_playing->interface->Stop(music_playing->context);
762 }
763
764 music_playing->playing = SDL_FALSE;
1286765 music_playing->fading = MIX_NO_FADING;
1287766 music_playing = NULL;
1288767 }
1289768 int Mix_HaltMusic(void)
1290769 {
1291 SDL_LockAudio();
1292 if ( music_playing ) {
770 Mix_LockAudio();
771 if (music_playing) {
1293772 music_internal_halt();
1294 if ( music_finished_hook ) {
773 if (music_finished_hook) {
1295774 music_finished_hook();
1296775 }
1297776 }
1298 SDL_UnlockAudio();
777 Mix_UnlockAudio();
1299778
1300779 return(0);
1301780 }
1305784 {
1306785 int retval = 0;
1307786
1308 if ( ms_per_step == 0 ) {
787 if (ms_per_step == 0) {
1309788 SDL_SetError("Audio device hasn't been opened");
1310789 return 0;
1311790 }
1315794 return 1;
1316795 }
1317796
1318 SDL_LockAudio();
1319 if ( music_playing) {
1320 int fade_steps = (ms + ms_per_step - 1)/ms_per_step;
1321 if ( music_playing->fading == MIX_NO_FADING ) {
1322 music_playing->fade_step = 0;
1323 } else {
1324 int step;
1325 int old_fade_steps = music_playing->fade_steps;
1326 if ( music_playing->fading == MIX_FADING_OUT ) {
1327 step = music_playing->fade_step;
1328 } else {
1329 step = old_fade_steps
1330 - music_playing->fade_step + 1;
1331 }
1332 music_playing->fade_step = (step * fade_steps)
1333 / old_fade_steps;
1334 }
797 Mix_LockAudio();
798 if (music_playing) {
799 int fade_steps = (ms + ms_per_step - 1) / ms_per_step;
800 if (music_playing->fading == MIX_NO_FADING) {
801 music_playing->fade_step = 0;
802 } else {
803 int step;
804 int old_fade_steps = music_playing->fade_steps;
805 if (music_playing->fading == MIX_FADING_OUT) {
806 step = music_playing->fade_step;
807 } else {
808 step = old_fade_steps - music_playing->fade_step + 1;
809 }
810 music_playing->fade_step = (step * fade_steps) / old_fade_steps;
811 }
1335812 music_playing->fading = MIX_FADING_OUT;
1336813 music_playing->fade_steps = fade_steps;
1337814 retval = 1;
1338815 }
1339 SDL_UnlockAudio();
816 Mix_UnlockAudio();
1340817
1341818 return(retval);
1342819 }
1345822 {
1346823 Mix_Fading fading = MIX_NO_FADING;
1347824
1348 SDL_LockAudio();
1349 if ( music_playing ) {
825 Mix_LockAudio();
826 if (music_playing) {
1350827 fading = music_playing->fading;
1351828 }
1352 SDL_UnlockAudio();
829 Mix_UnlockAudio();
1353830
1354831 return(fading);
1355832 }
1357834 /* Pause/Resume the music stream */
1358835 void Mix_PauseMusic(void)
1359836 {
1360 music_active = 0;
837 Mix_LockAudio();
838 if (music_playing) {
839 if (music_playing->interface->Pause) {
840 music_playing->interface->Pause(music_playing->context);
841 }
842 }
843 music_active = SDL_FALSE;
844 Mix_UnlockAudio();
1361845 }
1362846
1363847 void Mix_ResumeMusic(void)
1364848 {
1365 music_active = 1;
849 Mix_LockAudio();
850 if (music_playing) {
851 if (music_playing->interface->Resume) {
852 music_playing->interface->Resume(music_playing->context);
853 }
854 }
855 music_active = SDL_TRUE;
856 Mix_UnlockAudio();
1366857 }
1367858
1368859 void Mix_RewindMusic(void)
1372863
1373864 int Mix_PausedMusic(void)
1374865 {
1375 return (music_active == 0);
866 return (music_active == SDL_FALSE);
1376867 }
1377868
1378869 /* Check the status of the music */
1379 static int music_internal_playing()
1380 {
1381 int playing = 1;
1382
1383 if (music_playing == NULL) {
1384 return 0;
1385 }
1386
1387 switch (music_playing->type) {
1388 #ifdef CMD_MUSIC
1389 case MUS_CMD:
1390 if (!MusicCMD_Active(music_playing->data.cmd)) {
1391 playing = 0;
1392 }
1393 break;
1394 #endif
1395 #ifdef WAV_MUSIC
1396 case MUS_WAV:
1397 if ( ! WAVStream_Active() ) {
1398 playing = 0;
1399 }
1400 break;
1401 #endif
1402 #ifdef MODPLUG_MUSIC
1403 case MUS_MODPLUG:
1404 if ( ! modplug_playing(music_playing->data.modplug) ) {
1405 playing = 0;
1406 }
1407 break;
1408 #endif
1409 #ifdef MOD_MUSIC
1410 case MUS_MOD:
1411 if ( ! MOD_playing(music_playing->data.module) ) {
1412 playing = 0;
1413 }
1414 break;
1415 #endif
1416 #ifdef MID_MUSIC
1417 case MUS_MID:
1418 #ifdef USE_NATIVE_MIDI
1419 if ( native_midi_ok ) {
1420 if ( ! native_midi_active() )
1421 playing = 0;
1422 goto skip;
1423 }
1424 #endif
1425 #ifdef USE_FLUIDSYNTH_MIDI
1426 if ( fluidsynth_ok ) {
1427 if ( ! fluidsynth_active(music_playing->data.fluidsynthmidi) )
1428 playing = 0;
1429 goto skip;
1430 }
1431 #endif
1432 #ifdef USE_TIMIDITY_MIDI
1433 if ( timidity_ok ) {
1434 if ( ! Timidity_Active() )
1435 playing = 0;
1436 goto skip;
1437 }
1438 #endif
1439 break;
1440 #endif
1441 #ifdef OGG_MUSIC
1442 case MUS_OGG:
1443 if ( ! OGG_playing(music_playing->data.ogg) ) {
1444 playing = 0;
1445 }
1446 break;
1447 #endif
1448 #ifdef FLAC_MUSIC
1449 case MUS_FLAC:
1450 if ( ! FLAC_playing(music_playing->data.flac) ) {
1451 playing = 0;
1452 }
1453 break;
1454 #endif
1455 #ifdef MP3_MUSIC
1456 case MUS_MP3:
1457 if ( smpeg.SMPEG_status(music_playing->data.mp3) != SMPEG_PLAYING )
1458 playing = 0;
1459 break;
1460 #endif
1461 #ifdef MP3_MAD_MUSIC
1462 case MUS_MP3_MAD:
1463 if (!mad_isPlaying(music_playing->data.mp3_mad)) {
1464 playing = 0;
1465 }
1466 break;
1467 #endif
1468 default:
1469 playing = 0;
1470 break;
1471 }
1472
1473 skip:
1474 return(playing);
870 static SDL_bool music_internal_playing(void)
871 {
872 if (!music_playing) {
873 return SDL_FALSE;
874 }
875
876 if (music_playing->interface->IsPlaying) {
877 music_playing->playing = music_playing->interface->IsPlaying(music_playing->context);
878 }
879 return music_playing->playing;
1475880 }
1476881 int Mix_PlayingMusic(void)
1477882 {
1478 int playing = 0;
1479
1480 SDL_LockAudio();
1481 if ( music_playing ) {
1482 playing = music_loops || music_internal_playing();
1483 }
1484 SDL_UnlockAudio();
1485
1486 return(playing);
883 SDL_bool playing;
884
885 Mix_LockAudio();
886 playing = music_internal_playing();
887 Mix_UnlockAudio();
888
889 return playing ? 1 : 0;
1487890 }
1488891
1489892 /* Set the external music playback command */
1490893 int Mix_SetMusicCMD(const char *command)
1491894 {
1492895 Mix_HaltMusic();
1493 if ( music_cmd ) {
896 if (music_cmd) {
1494897 SDL_free(music_cmd);
1495898 music_cmd = NULL;
1496899 }
1497 if ( command ) {
1498 music_cmd = (char *)SDL_malloc(strlen(command)+1);
1499 if ( music_cmd == NULL ) {
1500 return(-1);
1501 }
1502 strcpy(music_cmd, command);
1503 }
1504 return(0);
900 if (command) {
901 size_t length = SDL_strlen(command) + 1;
902 music_cmd = (char *)SDL_malloc(length);
903 if (music_cmd == NULL) {
904 return SDL_OutOfMemory();
905 }
906 SDL_memcpy(music_cmd, command, length);
907 }
908 return 0;
1505909 }
1506910
1507911 int Mix_SetSynchroValue(int i)
1517921 }
1518922
1519923
1520 /* Uninitialize the music players */
924 /* Uninitialize the music interfaces */
1521925 void close_music(void)
1522926 {
927 int i;
928
1523929 Mix_HaltMusic();
1524 #ifdef CMD_MUSIC
1525 Mix_SetMusicCMD(NULL);
1526 #endif
1527 #ifdef MODPLUG_MUSIC
1528 modplug_exit();
1529 #endif
1530 #ifdef MOD_MUSIC
1531 MOD_exit();
1532 #endif
1533 #ifdef MID_MUSIC
1534 # ifdef USE_TIMIDITY_MIDI
1535 Timidity_Close();
1536 # endif
1537 #endif
930
931 for (i = 0; i < SDL_arraysize(s_music_interfaces); ++i) {
932 Mix_MusicInterface *interface = s_music_interfaces[i];
933 if (!interface || !interface->opened) {
934 continue;
935 }
936
937 if (interface->Close) {
938 interface->Close();
939 }
940 interface->opened = SDL_FALSE;
941 }
942
943 if (soundfont_paths) {
944 SDL_free(soundfont_paths);
945 soundfont_paths = NULL;
946 }
1538947
1539948 /* rcg06042009 report available decoders at runtime. */
1540 SDL_free((void *)music_decoders);
1541 music_decoders = NULL;
949 if (music_decoders) {
950 SDL_free((void *)music_decoders);
951 music_decoders = NULL;
952 }
1542953 num_decoders = 0;
1543954
1544955 ms_per_step = 0;
1545956 }
1546957
958 /* Unload the music interface libraries */
959 void unload_music(void)
960 {
961 int i;
962 for (i = 0; i < SDL_arraysize(s_music_interfaces); ++i) {
963 Mix_MusicInterface *interface = s_music_interfaces[i];
964 if (!interface || !interface->loaded) {
965 continue;
966 }
967
968 if (interface->Unload) {
969 interface->Unload();
970 }
971 interface->loaded = SDL_FALSE;
972 }
973 }
974
1547975 int Mix_SetSoundFonts(const char *paths)
1548976 {
1549 #ifdef MID_MUSIC
1550977 if (soundfont_paths) {
1551978 SDL_free(soundfont_paths);
1552979 soundfont_paths = NULL;
1558985 return 0;
1559986 }
1560987 }
1561 #endif
1562988 return 1;
1563989 }
1564990
1565 #ifdef MID_MUSIC
1566991 const char* Mix_GetSoundFonts(void)
1567992 {
1568 const char* force = getenv("SDL_FORCE_SOUNDFONTS");
1569
1570 if (!soundfont_paths || (force && force[0] == '1')) {
1571 return getenv("SDL_SOUNDFONTS");
1572 } else {
993 const char *env_paths = SDL_getenv("SDL_SOUNDFONTS");
994 SDL_bool force_env_paths = SDL_GetHintBoolean("SDL_FORCE_SOUNDFONTS", SDL_FALSE);
995 if (force_env_paths && (!env_paths || !*env_paths)) {
996 force_env_paths = SDL_FALSE;
997 }
998 if (soundfont_paths && *soundfont_paths && !force_env_paths) {
1573999 return soundfont_paths;
15741000 }
1575 }
1576
1577 int Mix_EachSoundFont(int (*function)(const char*, void*), void *data)
1001 if (env_paths) {
1002 return env_paths;
1003 }
1004
1005 /* We don't have any sound fonts set programmatically or in the environment
1006 Time to start guessing where they might be...
1007 */
1008 {
1009 static char *s_soundfont_paths[] = {
1010 "/usr/share/sounds/sf2/FluidR3_GM.sf2" /* Remember to add ',' here */
1011 };
1012 unsigned i;
1013
1014 for (i = 0; i < SDL_arraysize(s_soundfont_paths); ++i) {
1015 SDL_RWops *rwops = SDL_RWFromFile(s_soundfont_paths[i], "rb");
1016 if (rwops) {
1017 SDL_RWclose(rwops);
1018 return s_soundfont_paths[i];
1019 }
1020 }
1021 }
1022 return NULL;
1023 }
1024
1025 int Mix_EachSoundFont(int (SDLCALL *function)(const char*, void*), void *data)
15781026 {
15791027 char *context, *path, *paths;
15801028 const char* cpaths = Mix_GetSoundFonts();
1029 int soundfonts_found = 0;
15811030
15821031 if (!cpaths) {
15831032 Mix_SetError("No SoundFonts have been requested");
15891038 return 0;
15901039 }
15911040
1592 #if defined(__MINGW32__) || defined(__MINGW64__)
1041 #if defined(__MINGW32__) || defined(__MINGW64__) || defined(__WATCOMC__)
15931042 for (path = strtok(paths, ";"); path; path = strtok(NULL, ";")) {
15941043 #elif defined(_WIN32)
15951044 for (path = strtok_s(paths, ";", &context); path; path = strtok_s(NULL, ";", &context)) {
15971046 for (path = strtok_r(paths, ":;", &context); path; path = strtok_r(NULL, ":;", &context)) {
15981047 #endif
15991048 if (!function(path, data)) {
1600 SDL_free(paths);
1601 return 0;
1049 continue;
1050 } else {
1051 soundfonts_found++;
16021052 }
16031053 }
16041054
16051055 SDL_free(paths);
1606 return 1;
1607 }
1608 #endif
1056 if (soundfonts_found > 0)
1057 return 1;
1058 else
1059 return 0;
1060 }
1061
1062 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20 #include "SDL_mixer.h"
21
22 #ifndef MUSIC_H_
23 #define MUSIC_H_
24
25 /* Supported music APIs, in order of preference */
26
27 typedef enum
28 {
29 MIX_MUSIC_CMD,
30 MIX_MUSIC_WAVE,
31 MIX_MUSIC_MODPLUG,
32 MIX_MUSIC_MIKMOD,
33 MIX_MUSIC_FLUIDSYNTH,
34 MIX_MUSIC_TIMIDITY,
35 MIX_MUSIC_NATIVEMIDI,
36 MIX_MUSIC_OGG,
37 MIX_MUSIC_MPG123,
38 MIX_MUSIC_MAD,
39 MIX_MUSIC_SMPEG,
40 MIX_MUSIC_FLAC,
41 MIX_MUSIC_LAST
42 } Mix_MusicAPI;
43
44
45 /* Music API implementation */
46
47 typedef struct
48 {
49 const char *tag;
50 Mix_MusicAPI api;
51 Mix_MusicType type;
52 SDL_bool loaded;
53 SDL_bool opened;
54
55 /* Load the library */
56 int (*Load)(void);
57
58 /* Initialize for the audio output */
59 int (*Open)(const SDL_AudioSpec *spec);
60
61 /* Create a music object from an SDL_RWops stream
62 * If the function returns NULL, 'src' will be freed if needed by the caller.
63 */
64 void *(*CreateFromRW)(SDL_RWops *src, int freesrc);
65
66 /* Create a music object from a file, if SDL_RWops are not supported */
67 void *(*CreateFromFile)(const char *file);
68
69 /* Set the volume */
70 void (*SetVolume)(void *music, int volume);
71
72 /* Start playing music from the beginning with an optional loop count */
73 int (*Play)(void *music, int play_count);
74
75 /* Returns SDL_TRUE if music is still playing */
76 SDL_bool (*IsPlaying)(void *music);
77
78 /* Get music data, returns the number of bytes left */
79 int (*GetAudio)(void *music, void *data, int bytes);
80
81 /* Seek to a play position (in seconds) */
82 int (*Seek)(void *music, double position);
83
84 /* Pause playing music */
85 void (*Pause)(void *music);
86
87 /* Resume playing music */
88 void (*Resume)(void *music);
89
90 /* Stop playing music */
91 void (*Stop)(void *music);
92
93 /* Delete a music object */
94 void (*Delete)(void *music);
95
96 /* Close the library and clean up */
97 void (*Close)(void);
98
99 /* Unload the library */
100 void (*Unload)(void);
101
102 } Mix_MusicInterface;
103
104
105 extern int load_music(void);
106 extern Mix_MusicType detect_music_type_from_magic(const Uint8 *magic);
107 extern int get_num_music_interfaces(void);
108 extern Mix_MusicInterface *get_music_interface(int index);
109 extern SDL_bool has_music(Mix_MusicType type);
110 extern int open_music(const SDL_AudioSpec *spec);
111 extern int music_pcm_getaudio(void *context, void *data, int bytes, int volume,
112 int (*GetSome)(void *context, void *data, int bytes, SDL_bool *done));
113 extern void SDLCALL music_mixer(void *udata, Uint8 *stream, int len);
114 extern void close_music(void);
115 extern void unload_music(void);
116
117 extern char *music_cmd;
118 extern SDL_AudioSpec music_spec;
119
120 #endif /* MUSIC_H_ */
121
122 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
2121
2222 /* This file supports an external command for playing music */
2323
24 #ifdef CMD_MUSIC
24 #ifdef MUSIC_CMD
2525
2626 #include <sys/types.h>
2727 #include <sys/wait.h>
3131 #include <string.h>
3232 #include <signal.h>
3333 #include <ctype.h>
34
35 #include "SDL_mixer.h"
34 #include <limits.h>
35 #if defined(__linux__) && defined(__arm__)
36 # include <linux/limits.h>
37 #endif
38
3639 #include "music_cmd.h"
3740
38 /* Unimplemented */
39 void MusicCMD_SetVolume(int volume)
40 {
41 Mix_SetError("No way to modify external player volume");
42 }
41
42 typedef struct {
43 char *file;
44 char *cmd;
45 pid_t pid;
46 int play_count;
47 } MusicCMD;
48
4349
4450 /* Load a music stream from the given file */
45 MusicCMD *MusicCMD_LoadSong(const char *cmd, const char *file)
51 static void *MusicCMD_CreateFromFile(const char *file)
4652 {
4753 MusicCMD *music;
4854
55 if (!music_cmd) {
56 Mix_SetError("You must call Mix_SetMusicCMD() first");
57 return NULL;
58 }
59
4960 /* Allocate and fill the music structure */
50 music = (MusicCMD *)SDL_malloc(sizeof *music);
51 if ( music == NULL ) {
61 music = (MusicCMD *)SDL_calloc(1, sizeof *music);
62 if (music == NULL) {
5263 Mix_SetError("Out of memory");
53 return(NULL);
64 return NULL;
5465 }
5566 music->file = SDL_strdup(file);
56 music->cmd = SDL_strdup(cmd);
67 music->cmd = SDL_strdup(music_cmd);
5768 music->pid = 0;
5869
5970 /* We're done */
60 return(music);
71 return music;
6172 }
6273
6374 /* Parse a command line buffer into arguments */
6778 int argc;
6879
6980 argc = 0;
70 for ( bufp = cmdline; *bufp; ) {
81 for (bufp = cmdline; *bufp;) {
7182 /* Skip leading whitespace */
72 while ( isspace(*bufp) ) {
83 while (isspace(*bufp)) {
7384 ++bufp;
7485 }
7586 /* Skip over argument */
76 if ( *bufp == '"' ) {
87 if (*bufp == '"') {
7788 ++bufp;
78 if ( *bufp ) {
79 if ( argv ) {
89 if (*bufp) {
90 if (argv) {
8091 argv[argc] = bufp;
8192 }
8293 ++argc;
8394 }
8495 /* Skip over word */
85 while ( *bufp && (*bufp != '"') ) {
96 while (*bufp && (*bufp != '"')) {
8697 ++bufp;
8798 }
8899 } else {
89 if ( *bufp ) {
90 if ( argv ) {
100 if (*bufp) {
101 if (argv) {
91102 argv[argc] = bufp;
92103 }
93104 ++argc;
94105 }
95106 /* Skip over word */
96 while ( *bufp && ! isspace(*bufp) ) {
107 while (*bufp && ! isspace(*bufp)) {
97108 ++bufp;
98109 }
99110 }
100 if ( *bufp ) {
101 if ( argv ) {
111 if (*bufp) {
112 if (argv) {
102113 *bufp = '\0';
103114 }
104115 ++bufp;
105116 }
106117 }
107 if ( argv ) {
118 if (argv) {
108119 argv[argc] = NULL;
109120 }
110121 return(argc);
117128
118129 /* Parse the command line */
119130 argc = ParseCommandLine(command, NULL);
120 if ( last_arg ) {
131 if (last_arg) {
121132 ++argc;
122133 }
123134 argv = (char **)SDL_malloc((argc+1)*(sizeof *argv));
124 if ( argv == NULL ) {
135 if (argv == NULL) {
125136 return(NULL);
126137 }
127138 argc = ParseCommandLine(command, argv);
128139
129140 /* Add last command line argument */
130 if ( last_arg ) {
141 if (last_arg) {
131142 argv[argc++] = last_arg;
132143 }
133144 argv[argc] = NULL;
137148 }
138149
139150 /* Start playback of a given music stream */
140 void MusicCMD_Start(MusicCMD *music)
141 {
151 static int MusicCMD_Play(void *context, int play_count)
152 {
153 MusicCMD *music = (MusicCMD *)context;
154
155 music->play_count = play_count;
142156 #ifdef HAVE_FORK
143157 music->pid = fork();
144158 #else
145159 music->pid = vfork();
146160 #endif
147161 switch(music->pid) {
148 /* Failed fork() system call */
149 case -1:
162 /* Failed fork() system call */
163 case -1:
150164 Mix_SetError("fork() failed");
151 return;
152
153 /* Child process - executes here */
154 case 0: {
155 char *command;
156 char **argv;
157
158 /* Unblock signals in case we're called from a thread */
159 {
165 return -1;
166
167 /* Child process - executes here */
168 case 0: {
169 char **argv;
170
171 /* Unblock signals in case we're called from a thread */
172 {
160173 sigset_t mask;
161174 sigemptyset(&mask);
162175 sigprocmask(SIG_SETMASK, &mask, NULL);
163 }
164
165 /* Execute the command */
166 command = SDL_strdup(music->cmd);
167 argv = parse_args(command, music->file);
168 if ( argv != NULL ) {
176 }
177
178 /* Execute the command */
179 argv = parse_args(music->cmd, music->file);
180 if (argv != NULL) {
169181 execvp(argv[0], argv);
170 }
171 SDL_free(command);
172182
173183 /* exec() failed */
174184 perror(argv[0]);
175 _exit(-1);
176 }
185 }
186 _exit(-1);
187 }
188 break;
189
190 /* Parent process - executes here */
191 default:
177192 break;
178
179 /* Parent process - executes here */
180 default:
181 break;
182 }
183 return;
193 }
194 return 0;
195 }
196
197 /* Return non-zero if a stream is currently playing */
198 static SDL_bool MusicCMD_IsPlaying(void *context)
199 {
200 MusicCMD *music = (MusicCMD *)context;
201 int status;
202
203 if (music->pid > 0) {
204 waitpid(music->pid, &status, WNOHANG);
205 if (kill(music->pid, 0) == 0) {
206 return SDL_TRUE;
207 }
208
209 /* We might want to loop */
210 if (music->play_count != 1) {
211 int play_count = -1;
212 if (music->play_count > 0) {
213 play_count = (music->play_count - 1);
214 }
215 MusicCMD_Play(music, play_count);
216 return SDL_TRUE;
217 }
218 }
219 return SDL_FALSE;
220 }
221
222 /* Pause playback of a given music stream */
223 static void MusicCMD_Pause(void *context)
224 {
225 MusicCMD *music = (MusicCMD *)context;
226 if (music->pid > 0) {
227 kill(music->pid, SIGSTOP);
228 }
229 }
230
231 /* Resume playback of a given music stream */
232 static void MusicCMD_Resume(void *context)
233 {
234 MusicCMD *music = (MusicCMD *)context;
235 if (music->pid > 0) {
236 kill(music->pid, SIGCONT);
237 }
184238 }
185239
186240 /* Stop playback of a stream previously started with MusicCMD_Start() */
187 void MusicCMD_Stop(MusicCMD *music)
188 {
241 static void MusicCMD_Stop(void *context)
242 {
243 MusicCMD *music = (MusicCMD *)context;
189244 int status;
190245
191 if ( music->pid > 0 ) {
192 while ( kill(music->pid, 0) == 0 ) {
246 if (music->pid > 0) {
247 while (kill(music->pid, 0) == 0) {
193248 kill(music->pid, SIGTERM);
194249 sleep(1);
195250 waitpid(music->pid, &status, WNOHANG);
198253 }
199254 }
200255
201 /* Pause playback of a given music stream */
202 void MusicCMD_Pause(MusicCMD *music)
203 {
204 if ( music->pid > 0 ) {
205 kill(music->pid, SIGSTOP);
206 }
207 }
208
209 /* Resume playback of a given music stream */
210 void MusicCMD_Resume(MusicCMD *music)
211 {
212 if ( music->pid > 0 ) {
213 kill(music->pid, SIGCONT);
214 }
215 }
216
217256 /* Close the given music stream */
218 void MusicCMD_FreeSong(MusicCMD *music)
219 {
257 void MusicCMD_Delete(void *context)
258 {
259 MusicCMD *music = (MusicCMD *)context;
220260 SDL_free(music->file);
221 SDL_free(music->cmd);
222261 SDL_free(music);
223262 }
224263
225 /* Return non-zero if a stream is currently playing */
226 int MusicCMD_Active(MusicCMD *music)
227 {
228 int status;
229 int active;
230
231 active = 0;
232 if ( music->pid > 0 ) {
233 waitpid(music->pid, &status, WNOHANG);
234 if ( kill(music->pid, 0) == 0 ) {
235 active = 1;
236 }
237 }
238 return(active);
239 }
240
241 #endif /* CMD_MUSIC */
264 Mix_MusicInterface Mix_MusicInterface_CMD =
265 {
266 "CMD",
267 MIX_MUSIC_CMD,
268 MUS_CMD,
269 SDL_FALSE,
270 SDL_FALSE,
271
272 NULL, /* Load */
273 NULL, /* Open */
274 NULL, /* CreateFromRW */
275 MusicCMD_CreateFromFile,
276 NULL, /* SetVolume */
277 MusicCMD_Play,
278 MusicCMD_IsPlaying,
279 NULL, /* GetAudio */
280 NULL, /* Seek */
281 MusicCMD_Pause,
282 MusicCMD_Resume,
283 MusicCMD_Stop,
284 MusicCMD_Delete,
285 NULL, /* Close */
286 NULL, /* Unload */
287 };
288
289 #endif /* MUSIC_CMD */
290
291 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
2020
2121 /* This file supports an external command for playing music */
2222
23 #ifdef CMD_MUSIC
23 #include "music.h"
2424
25 #include <sys/types.h>
26 #include <limits.h>
27 #include <stdio.h>
28 #if defined(__linux__) && defined(__arm__)
29 # include <linux/limits.h>
30 #endif
31 typedef struct {
32 char *file;
33 char *cmd;
34 pid_t pid;
35 } MusicCMD;
25 extern Mix_MusicInterface Mix_MusicInterface_CMD;
3626
37 /* Unimplemented */
38 extern void MusicCMD_SetVolume(int volume);
39
40 /* Load a music stream from the given file */
41 extern MusicCMD *MusicCMD_LoadSong(const char *cmd, const char *file);
42
43 /* Start playback of a given music stream */
44 extern void MusicCMD_Start(MusicCMD *music);
45
46 /* Stop playback of a stream previously started with MusicCMD_Start() */
47 extern void MusicCMD_Stop(MusicCMD *music);
48
49 /* Pause playback of a given music stream */
50 extern void MusicCMD_Pause(MusicCMD *music);
51
52 /* Resume playback of a given music stream */
53 extern void MusicCMD_Resume(MusicCMD *music);
54
55 /* Close the given music stream */
56 extern void MusicCMD_FreeSong(MusicCMD *music);
57
58 /* Return non-zero if a stream is currently playing */
59 extern int MusicCMD_Active(MusicCMD *music);
60
61 #endif /* CMD_MUSIC */
27 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
2121 ~ Austen Dicken (admin@cvpcs.org)
2222 */
2323
24 #ifdef FLAC_MUSIC
25
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29
30 #include "SDL_mixer.h"
31 #include "dynamic_flac.h"
24 #ifdef MUSIC_FLAC
25
26 #include "SDL_assert.h"
27 #include "SDL_loadso.h"
28
3229 #include "music_flac.h"
3330
34 /* This is the format of the audio mixer data */
35 static SDL_AudioSpec mixer;
36
37 /* Initialize the FLAC player, with the given mixer settings
38 This function returns 0, or -1 if there was an error.
39 */
40 int FLAC_init(SDL_AudioSpec *mixerfmt)
41 {
42 mixer = *mixerfmt;
43 return(0);
44 }
45
46 /* Set the volume for an FLAC stream */
47 void FLAC_setvolume(FLAC_music *music, int volume)
48 {
49 music->volume = volume;
50 }
31 #include <FLAC/stream_decoder.h>
32
33
34 typedef struct {
35 int loaded;
36 void *handle;
37 FLAC__StreamDecoder *(*FLAC__stream_decoder_new)(void);
38 void (*FLAC__stream_decoder_delete)(FLAC__StreamDecoder *decoder);
39 FLAC__StreamDecoderInitStatus (*FLAC__stream_decoder_init_stream)(
40 FLAC__StreamDecoder *decoder,
41 FLAC__StreamDecoderReadCallback read_callback,
42 FLAC__StreamDecoderSeekCallback seek_callback,
43 FLAC__StreamDecoderTellCallback tell_callback,
44 FLAC__StreamDecoderLengthCallback length_callback,
45 FLAC__StreamDecoderEofCallback eof_callback,
46 FLAC__StreamDecoderWriteCallback write_callback,
47 FLAC__StreamDecoderMetadataCallback metadata_callback,
48 FLAC__StreamDecoderErrorCallback error_callback,
49 void *client_data);
50 FLAC__bool (*FLAC__stream_decoder_finish)(FLAC__StreamDecoder *decoder);
51 FLAC__bool (*FLAC__stream_decoder_flush)(FLAC__StreamDecoder *decoder);
52 FLAC__bool (*FLAC__stream_decoder_process_single)(
53 FLAC__StreamDecoder *decoder);
54 FLAC__bool (*FLAC__stream_decoder_process_until_end_of_metadata)(
55 FLAC__StreamDecoder *decoder);
56 FLAC__bool (*FLAC__stream_decoder_process_until_end_of_stream)(
57 FLAC__StreamDecoder *decoder);
58 FLAC__bool (*FLAC__stream_decoder_seek_absolute)(
59 FLAC__StreamDecoder *decoder,
60 FLAC__uint64 sample);
61 FLAC__StreamDecoderState (*FLAC__stream_decoder_get_state)(
62 const FLAC__StreamDecoder *decoder);
63 } flac_loader;
64
65 static flac_loader flac = {
66 0, NULL
67 };
68
69 #ifdef FLAC_DYNAMIC
70 #define FUNCTION_LOADER(FUNC, SIG) \
71 flac.FUNC = (SIG) SDL_LoadFunction(flac.handle, #FUNC); \
72 if (flac.FUNC == NULL) { SDL_UnloadObject(flac.handle); return -1; }
73 #else
74 #define FUNCTION_LOADER(FUNC, SIG) \
75 flac.FUNC = FUNC;
76 #endif
77
78 static int FLAC_Load(void)
79 {
80 if (flac.loaded == 0) {
81 #ifdef FLAC_DYNAMIC
82 flac.handle = SDL_LoadObject(FLAC_DYNAMIC);
83 if (flac.handle == NULL) {
84 return -1;
85 }
86 #elif defined(__MACOSX__)
87 extern FLAC__StreamDecoder *FLAC__stream_decoder_new(void) __attribute__((weak_import));
88 if (FLAC__stream_decoder_new == NULL)
89 {
90 /* Missing weakly linked framework */
91 Mix_SetError("Missing FLAC.framework");
92 return -1;
93 }
94 #endif
95
96 FUNCTION_LOADER(FLAC__stream_decoder_new, FLAC__StreamDecoder *(*)(void))
97 FUNCTION_LOADER(FLAC__stream_decoder_delete, void (*)(FLAC__StreamDecoder *))
98 FUNCTION_LOADER(FLAC__stream_decoder_init_stream, FLAC__StreamDecoderInitStatus (*)(
99 FLAC__StreamDecoder *,
100 FLAC__StreamDecoderReadCallback,
101 FLAC__StreamDecoderSeekCallback,
102 FLAC__StreamDecoderTellCallback,
103 FLAC__StreamDecoderLengthCallback,
104 FLAC__StreamDecoderEofCallback,
105 FLAC__StreamDecoderWriteCallback,
106 FLAC__StreamDecoderMetadataCallback,
107 FLAC__StreamDecoderErrorCallback,
108 void *))
109 FUNCTION_LOADER(FLAC__stream_decoder_finish, FLAC__bool (*)(FLAC__StreamDecoder *))
110 FUNCTION_LOADER(FLAC__stream_decoder_flush, FLAC__bool (*)(FLAC__StreamDecoder *))
111 FUNCTION_LOADER(FLAC__stream_decoder_process_single, FLAC__bool (*)(FLAC__StreamDecoder *))
112 FUNCTION_LOADER(FLAC__stream_decoder_process_until_end_of_metadata, FLAC__bool (*)(FLAC__StreamDecoder *))
113 FUNCTION_LOADER(FLAC__stream_decoder_process_until_end_of_stream, FLAC__bool (*)(FLAC__StreamDecoder *))
114 FUNCTION_LOADER(FLAC__stream_decoder_seek_absolute, FLAC__bool (*)(FLAC__StreamDecoder *, FLAC__uint64))
115 FUNCTION_LOADER(FLAC__stream_decoder_get_state, FLAC__StreamDecoderState (*)(const FLAC__StreamDecoder *decoder))
116 }
117 ++flac.loaded;
118
119 return 0;
120 }
121
122 static void FLAC_Unload(void)
123 {
124 if (flac.loaded == 0) {
125 return;
126 }
127 if (flac.loaded == 1) {
128 #ifdef FLAC_DYNAMIC
129 SDL_UnloadObject(flac.handle);
130 #endif
131 }
132 --flac.loaded;
133 }
134
135
136 typedef struct {
137 int volume;
138 int play_count;
139 FLAC__StreamDecoder *flac_decoder;
140 unsigned sample_rate;
141 unsigned channels;
142 unsigned bits_per_sample;
143 SDL_RWops *src;
144 int freesrc;
145 SDL_AudioStream *stream;
146 } FLAC_Music;
147
148
149 static int FLAC_Seek(void *context, double position);
51150
52151 static FLAC__StreamDecoderReadStatus flac_read_music_cb(
53152 const FLAC__StreamDecoder *decoder,
55154 size_t *bytes,
56155 void *client_data)
57156 {
58 FLAC_music *data = (FLAC_music*)client_data;
59
60 // make sure there is something to be reading
157 FLAC_Music *data = (FLAC_Music*)client_data;
158
159 /* make sure there is something to be reading */
61160 if (*bytes > 0) {
62161 *bytes = SDL_RWread (data->src, buffer, sizeof (FLAC__byte), *bytes);
63162
64 if (*bytes == 0 ) { // error or no data was read (EOF)
163 if (*bytes == 0) { /* error or no data was read (EOF) */
65164 return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
66 } else { // data was read, continue
165 } else { /* data was read, continue */
67166 return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
68167 }
69168 } else {
76175 FLAC__uint64 absolute_byte_offset,
77176 void *client_data)
78177 {
79 FLAC_music *data = (FLAC_music*)client_data;
80
81 if (SDL_RWseek (data->src, absolute_byte_offset, RW_SEEK_SET) < 0) {
178 FLAC_Music *data = (FLAC_Music*)client_data;
179
180 if (SDL_RWseek(data->src, absolute_byte_offset, RW_SEEK_SET) < 0) {
82181 return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
83182 } else {
84183 return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
88187 static FLAC__StreamDecoderTellStatus flac_tell_music_cb(
89188 const FLAC__StreamDecoder *decoder,
90189 FLAC__uint64 *absolute_byte_offset,
91 void *client_data )
92 {
93 FLAC_music *data = (FLAC_music*)client_data;
94
95 Sint64 pos = SDL_RWtell (data->src);
190 void *client_data)
191 {
192 FLAC_Music *data = (FLAC_Music*)client_data;
193
194 Sint64 pos = SDL_RWtell(data->src);
96195
97196 if (pos < 0) {
98197 return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
102201 }
103202 }
104203
105 static FLAC__StreamDecoderLengthStatus flac_length_music_cb (
204 static FLAC__StreamDecoderLengthStatus flac_length_music_cb(
106205 const FLAC__StreamDecoder *decoder,
107206 FLAC__uint64 *stream_length,
108207 void *client_data)
109208 {
110 FLAC_music *data = (FLAC_music*)client_data;
111
112 Sint64 pos = SDL_RWtell (data->src);
113 Sint64 length = SDL_RWseek (data->src, 0, RW_SEEK_END);
114
115 if (SDL_RWseek (data->src, pos, RW_SEEK_SET) != pos || length < 0) {
209 FLAC_Music *data = (FLAC_Music*)client_data;
210
211 Sint64 pos = SDL_RWtell(data->src);
212 Sint64 length = SDL_RWseek(data->src, 0, RW_SEEK_END);
213
214 if (SDL_RWseek(data->src, pos, RW_SEEK_SET) != pos || length < 0) {
116215 /* there was an error attempting to return the stream to the original
117216 * position, or the length was invalid. */
118217 return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
124223
125224 static FLAC__bool flac_eof_music_cb(
126225 const FLAC__StreamDecoder *decoder,
127 void *client_data )
128 {
129 FLAC_music *data = (FLAC_music*)client_data;
130
131 Sint64 pos = SDL_RWtell (data->src);
132 Sint64 end = SDL_RWseek (data->src, 0, RW_SEEK_END);
133
134 // was the original position equal to the end (a.k.a. the seek didn't move)?
226 void *client_data)
227 {
228 FLAC_Music *data = (FLAC_Music*)client_data;
229
230 Sint64 pos = SDL_RWtell(data->src);
231 Sint64 end = SDL_RWseek(data->src, 0, RW_SEEK_END);
232
233 /* was the original position equal to the end (a.k.a. the seek didn't move)? */
135234 if (pos == end) {
136 // must be EOF
235 /* must be EOF */
137236 return true;
138237 } else {
139 // not EOF, return to the original position
140 SDL_RWseek (data->src, pos, RW_SEEK_SET);
238 /* not EOF, return to the original position */
239 SDL_RWseek(data->src, pos, RW_SEEK_SET);
141240 return false;
142241 }
143242 }
148247 const FLAC__int32 *const buffer[],
149248 void *client_data)
150249 {
151 FLAC_music *data = (FLAC_music *)client_data;
152 size_t i;
153
154 if (data->flac_data.total_samples == 0) {
155 SDL_SetError ("Given FLAC file does not specify its sample count.");
250 FLAC_Music *music = (FLAC_Music *)client_data;
251 Sint16 *data;
252 unsigned int i, j, channels;
253 int shift_amount = 0;
254
255 if (!music->stream) {
156256 return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
157257 }
158258
159 if (data->flac_data.channels != 2 ||
160 data->flac_data.bits_per_sample != 16) {
161 SDL_SetError("Current FLAC support is only for 16 bit Stereo files.");
259 switch (music->bits_per_sample) {
260 case 16:
261 shift_amount = 0;
262 break;
263 case 20:
264 shift_amount = 4;
265 break;
266 case 24:
267 shift_amount = 8;
268 break;
269 default:
270 SDL_SetError("FLAC decoder doesn't support %d bits_per_sample", music->bits_per_sample);
162271 return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
163272 }
164273
165 for (i = 0; i < frame->header.blocksize; i++) {
166 FLAC__int16 i16;
167 FLAC__uint16 ui16;
168
169 // make sure we still have at least two bytes that can be read (one for
170 // each channel)
171 if (data->flac_data.max_to_read >= 4) {
172 // does the data block exist?
173 if (!data->flac_data.data) {
174 data->flac_data.data_len = data->flac_data.max_to_read;
175 data->flac_data.data_read = 0;
176
177 // create it
178 data->flac_data.data =
179 (char *)SDL_malloc (data->flac_data.data_len);
180
181 if (!data->flac_data.data) {
182 return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
183 }
274 if (music->channels == 3) {
275 /* We'll just drop the center channel for now */
276 channels = 2;
277 } else {
278 channels = music->channels;
279 }
280
281 data = SDL_stack_alloc(Sint16, (frame->header.blocksize * channels));
282 if (!data) {
283 SDL_SetError("Couldn't allocate %d bytes stack memory", (int)(frame->header.blocksize * channels * sizeof(*data)));
284 return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
285 }
286 if (music->channels == 3) {
287 Sint16 *dst = data;
288 for (i = 0; i < frame->header.blocksize; ++i) {
289 Sint16 FL = (buffer[0][i] >> shift_amount);
290 Sint16 FR = (buffer[1][i] >> shift_amount);
291 Sint16 FCmix = (Sint16)((buffer[2][i] >> shift_amount) * 0.5f);
292 int sample;
293
294 sample = (FL + FCmix);
295 if (sample > SDL_MAX_SINT16) {
296 *dst = SDL_MAX_SINT16;
297 } else if (sample < SDL_MIN_SINT16) {
298 *dst = SDL_MIN_SINT16;
299 } else {
300 *dst = sample;
184301 }
185
186 i16 = (FLAC__int16)buffer[0][i];
187 ui16 = (FLAC__uint16)i16;
188
189 *((data->flac_data.data) + (data->flac_data.data_read++)) =
190 (char)(ui16);
191 *((data->flac_data.data) + (data->flac_data.data_read++)) =
192 (char)(ui16 >> 8);
193
194 i16 = (FLAC__int16)buffer[1][i];
195 ui16 = (FLAC__uint16)i16;
196
197 *((data->flac_data.data) + (data->flac_data.data_read++)) =
198 (char)(ui16);
199 *((data->flac_data.data) + (data->flac_data.data_read++)) =
200 (char)(ui16 >> 8);
201
202 data->flac_data.max_to_read -= 4;
203
204 if (data->flac_data.max_to_read < 4) {
205 // we need to set this so that the read halts from the
206 // FLAC_getsome function.
207 data->flac_data.max_to_read = 0;
302 ++dst;
303
304 sample = (FR + FCmix);
305 if (sample > SDL_MAX_SINT16) {
306 *dst = SDL_MAX_SINT16;
307 } else if (sample < SDL_MIN_SINT16) {
308 *dst = SDL_MIN_SINT16;
309 } else {
310 *dst = sample;
208311 }
209 }
210 else {
211 // we need to write to the overflow
212 if (!data->flac_data.overflow) {
213 data->flac_data.overflow_len =
214 4 * (frame->header.blocksize - i);
215 data->flac_data.overflow_read = 0;
216
217 // make it big enough for the rest of the block
218 data->flac_data.overflow =
219 (char *)SDL_malloc (data->flac_data.overflow_len);
220
221 if (!data->flac_data.overflow) {
222 return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
223 }
312 ++dst;
313 }
314 } else {
315 for (i = 0; i < channels; ++i) {
316 Sint16 *dst = data + i;
317 for (j = 0; j < frame->header.blocksize; ++j) {
318 *dst = (buffer[i][j] >> shift_amount);
319 dst += channels;
224320 }
225
226 i16 = (FLAC__int16)buffer[0][i];
227 ui16 = (FLAC__uint16)i16;
228
229 *((data->flac_data.overflow) + (data->flac_data.overflow_read++)) =
230 (char)(ui16);
231 *((data->flac_data.overflow) + (data->flac_data.overflow_read++)) =
232 (char)(ui16 >> 8);
233
234 i16 = (FLAC__int16)buffer[1][i];
235 ui16 = (FLAC__uint16)i16;
236
237 *((data->flac_data.overflow) + (data->flac_data.overflow_read++)) =
238 (char)(ui16);
239 *((data->flac_data.overflow) + (data->flac_data.overflow_read++)) =
240 (char)(ui16 >> 8);
241 }
242 }
321 }
322 }
323 SDL_AudioStreamPut(music->stream, data, (frame->header.blocksize * channels * sizeof(*data)));
324 SDL_stack_free(data);
243325
244326 return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
245327 }
249331 const FLAC__StreamMetadata *metadata,
250332 void *client_data)
251333 {
252 FLAC_music *data = (FLAC_music *)client_data;
253
254 if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
255 data->flac_data.sample_rate = metadata->data.stream_info.sample_rate;
256 data->flac_data.channels = metadata->data.stream_info.channels;
257 data->flac_data.total_samples =
258 metadata->data.stream_info.total_samples;
259 data->flac_data.bits_per_sample =
260 metadata->data.stream_info.bits_per_sample;
261 data->flac_data.sample_size = data->flac_data.channels *
262 ((data->flac_data.bits_per_sample) / 8);
263 }
334 FLAC_Music *music = (FLAC_Music *)client_data;
335 int channels;
336
337 if (metadata->type != FLAC__METADATA_TYPE_STREAMINFO) {
338 return;
339 }
340
341 music->sample_rate = metadata->data.stream_info.sample_rate;
342 music->channels = metadata->data.stream_info.channels;
343 music->bits_per_sample = metadata->data.stream_info.bits_per_sample;
344 /*printf("FLAC: Sample rate = %d, channels = %d, bits_per_sample = %d\n", music->sample_rate, music->channels, music->bits_per_sample);*/
345
346 /* SDL's channel mapping and FLAC channel mapping are the same,
347 except for 3 channels: SDL is FL FR LFE and FLAC is FL FR FC
348 */
349 if (music->channels == 3) {
350 channels = 2;
351 } else {
352 channels = music->channels;
353 }
354 /* We check for NULL stream later when we get data */
355 SDL_assert(!music->stream);
356 music->stream = SDL_NewAudioStream(AUDIO_S16SYS, channels, music->sample_rate,
357 music_spec.format, music_spec.channels, music_spec.freq);
264358 }
265359
266360 static void flac_error_music_cb(
268362 FLAC__StreamDecoderErrorStatus status,
269363 void *client_data)
270364 {
271 // print an SDL error based on the error status
365 /* print an SDL error based on the error status */
272366 switch (status) {
273 case FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC:
274 SDL_SetError ("Error processing the FLAC file [LOST_SYNC].");
275 break;
276 case FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER:
277 SDL_SetError ("Error processing the FLAC file [BAD_HEADER].");
278 break;
279 case FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH:
280 SDL_SetError ("Error processing the FLAC file [CRC_MISMATCH].");
281 break;
282 case FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM:
283 SDL_SetError ("Error processing the FLAC file [UNPARSEABLE].");
284 break;
285 default:
286 SDL_SetError ("Error processing the FLAC file [UNKNOWN].");
367 case FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC:
368 SDL_SetError("Error processing the FLAC file [LOST_SYNC].");
369 break;
370 case FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER:
371 SDL_SetError("Error processing the FLAC file [BAD_HEADER].");
372 break;
373 case FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH:
374 SDL_SetError("Error processing the FLAC file [CRC_MISMATCH].");
375 break;
376 case FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM:
377 SDL_SetError("Error processing the FLAC file [UNPARSEABLE].");
378 break;
379 default:
380 SDL_SetError("Error processing the FLAC file [UNKNOWN].");
287381 break;
288382 }
289383 }
290384
291385 /* Load an FLAC stream from an SDL_RWops object */
292 FLAC_music *FLAC_new_RW(SDL_RWops *src, int freesrc)
293 {
294 FLAC_music *music;
386 static void *FLAC_CreateFromRW(SDL_RWops *src, int freesrc)
387 {
388 FLAC_Music *music;
295389 int init_stage = 0;
296390 int was_error = 1;
297391
298 if (!Mix_Init(MIX_INIT_FLAC)) {
392 music = (FLAC_Music *)SDL_calloc(1, sizeof(*music));
393 if (!music) {
394 SDL_OutOfMemory();
299395 return NULL;
300396 }
301
302 music = (FLAC_music *)SDL_malloc ( sizeof (*music));
303 if (music) {
304 /* Initialize the music structure */
305 memset (music, 0, (sizeof (*music)));
306 FLAC_stop (music);
307 FLAC_setvolume (music, MIX_MAX_VOLUME);
308 music->section = -1;
309 music->src = src;
310 music->freesrc = freesrc;
311 music->flac_data.max_to_read = 0;
312 music->flac_data.overflow = NULL;
313 music->flac_data.overflow_len = 0;
314 music->flac_data.overflow_read = 0;
315 music->flac_data.data = NULL;
316 music->flac_data.data_len = 0;
317 music->flac_data.data_read = 0;
318
319 init_stage++; // stage 1!
320
321 music->flac_decoder = flac.FLAC__stream_decoder_new ();
322
323 if (music->flac_decoder != NULL) {
324 init_stage++; // stage 2!
325
326 if (flac.FLAC__stream_decoder_init_stream(
327 music->flac_decoder,
328 flac_read_music_cb, flac_seek_music_cb,
329 flac_tell_music_cb, flac_length_music_cb,
330 flac_eof_music_cb, flac_write_music_cb,
331 flac_metadata_music_cb, flac_error_music_cb,
332 music) == FLAC__STREAM_DECODER_INIT_STATUS_OK ) {
333 init_stage++; // stage 3!
334
335 if (flac.FLAC__stream_decoder_process_until_end_of_metadata
336 (music->flac_decoder)) {
337 was_error = 0;
338 } else {
339 SDL_SetError("FLAC__stream_decoder_process_until_end_of_metadata() failed");
340 }
397 music->src = src;
398 music->volume = MIX_MAX_VOLUME;
399
400 music->flac_decoder = flac.FLAC__stream_decoder_new();
401 if (music->flac_decoder) {
402 init_stage++; /* stage 1! */
403
404 if (flac.FLAC__stream_decoder_init_stream(
405 music->flac_decoder,
406 flac_read_music_cb, flac_seek_music_cb,
407 flac_tell_music_cb, flac_length_music_cb,
408 flac_eof_music_cb, flac_write_music_cb,
409 flac_metadata_music_cb, flac_error_music_cb,
410 music) == FLAC__STREAM_DECODER_INIT_STATUS_OK) {
411 init_stage++; /* stage 2! */
412
413 if (flac.FLAC__stream_decoder_process_until_end_of_metadata(music->flac_decoder)) {
414 was_error = 0;
341415 } else {
342 SDL_SetError("FLAC__stream_decoder_init_stream() failed");
416 SDL_SetError("FLAC__stream_decoder_process_until_end_of_metadata() failed");
343417 }
344418 } else {
345 SDL_SetError("FLAC__stream_decoder_new() failed");
346 }
347
348 if (was_error) {
349 switch (init_stage) {
350 case 3:
351 flac.FLAC__stream_decoder_finish( music->flac_decoder );
352 case 2:
353 flac.FLAC__stream_decoder_delete( music->flac_decoder );
354 case 1:
355 case 0:
356 SDL_free(music);
357 break;
419 SDL_SetError("FLAC__stream_decoder_init_stream() failed");
420 }
421 } else {
422 SDL_SetError("FLAC__stream_decoder_new() failed");
423 }
424
425 if (was_error) {
426 switch (init_stage) {
427 case 2:
428 flac.FLAC__stream_decoder_finish(music->flac_decoder);
429 case 1:
430 flac.FLAC__stream_decoder_delete(music->flac_decoder);
431 case 0:
432 SDL_free(music);
433 break;
434 }
435 return NULL;
436 }
437
438 music->freesrc = freesrc;
439 return music;
440 }
441
442 /* Set the volume for an FLAC stream */
443 static void FLAC_SetVolume(void *context, int volume)
444 {
445 FLAC_Music *music = (FLAC_Music *)context;
446 music->volume = volume;
447 }
448
449 /* Start playback of a given FLAC stream */
450 static int FLAC_Play(void *context, int play_count)
451 {
452 FLAC_Music *music = (FLAC_Music *)context;
453 music->play_count = play_count;
454 return FLAC_Seek(music, 0.0);
455 }
456
457 /* Read some FLAC stream data and convert it for output */
458 static int FLAC_GetSome(void *context, void *data, int bytes, SDL_bool *done)
459 {
460 FLAC_Music *music = (FLAC_Music *)context;
461 int filled;
462
463 filled = SDL_AudioStreamGet(music->stream, data, bytes);
464 if (filled != 0) {
465 return filled;
466 }
467
468 if (!music->play_count) {
469 /* All done */
470 *done = SDL_TRUE;
471 return 0;
472 }
473
474 if (!flac.FLAC__stream_decoder_process_single(music->flac_decoder)) {
475 SDL_SetError("FLAC__stream_decoder_process_single() failed");
476 return -1;
477 }
478
479 if (flac.FLAC__stream_decoder_get_state(music->flac_decoder) == FLAC__STREAM_DECODER_END_OF_STREAM) {
480 if (music->play_count == 1) {
481 music->play_count = 0;
482 SDL_AudioStreamFlush(music->stream);
483 } else {
484 int play_count = -1;
485 if (music->play_count > 0) {
486 play_count = (music->play_count - 1);
358487 }
359 return NULL;
360 }
361 } else {
362 SDL_OutOfMemory();
363 return NULL;
364 }
365
366 return music;
367 }
368
369 /* Start playback of a given FLAC stream */
370 void FLAC_play(FLAC_music *music)
371 {
372 music->playing = 1;
373 }
374
375 /* Return non-zero if a stream is currently playing */
376 int FLAC_playing(FLAC_music *music)
377 {
378 return(music->playing);
379 }
380
381 /* Read some FLAC stream data and convert it for output */
382 static void FLAC_getsome(FLAC_music *music)
383 {
384 SDL_AudioCVT *cvt;
385
386 /* GET AUDIO WAVE DATA */
387 // set the max number of characters to read
388 music->flac_data.max_to_read = 8192;
389 music->flac_data.data_len = music->flac_data.max_to_read;
390 music->flac_data.data_read = 0;
391 if (!music->flac_data.data) {
392 music->flac_data.data = (char *)SDL_malloc (music->flac_data.data_len);
393 }
394
395 // we have data to read
396 while(music->flac_data.max_to_read > 0) {
397 // first check if there is data in the overflow from before
398 if (music->flac_data.overflow) {
399 size_t overflow_len = music->flac_data.overflow_read;
400
401 if (overflow_len > (size_t)music->flac_data.max_to_read) {
402 size_t overflow_extra_len = overflow_len -
403 music->flac_data.max_to_read;
404
405 SDL_memcpy (music->flac_data.data+music->flac_data.data_read,
406 music->flac_data.overflow, music->flac_data.max_to_read);
407 music->flac_data.data_read += music->flac_data.max_to_read;
408 SDL_memcpy (music->flac_data.overflow,
409 music->flac_data.overflow + music->flac_data.max_to_read,
410 overflow_extra_len);
411 music->flac_data.overflow_len = overflow_extra_len;
412 music->flac_data.overflow_read = overflow_extra_len;
413 music->flac_data.max_to_read = 0;
414 } else {
415 SDL_memcpy (music->flac_data.data+music->flac_data.data_read,
416 music->flac_data.overflow, overflow_len);
417 music->flac_data.data_read += overflow_len;
418 SDL_free (music->flac_data.overflow);
419 music->flac_data.overflow = NULL;
420 music->flac_data.overflow_len = 0;
421 music->flac_data.overflow_read = 0;
422 music->flac_data.max_to_read -= overflow_len;
488 if (FLAC_Play(music, play_count) < 0) {
489 return -1;
423490 }
424491 }
425 else {
426 if (!flac.FLAC__stream_decoder_process_single (
427 music->flac_decoder)) {
428 music->flac_data.max_to_read = 0;
429 }
430
431 if (flac.FLAC__stream_decoder_get_state (music->flac_decoder)
432 == FLAC__STREAM_DECODER_END_OF_STREAM) {
433 music->flac_data.max_to_read = 0;
434 }
435 }
436 }
437
438 if (music->flac_data.data_read <= 0) {
439 if (music->flac_data.data_read == 0) {
440 music->playing = 0;
441 }
442 return;
443 }
444 cvt = &music->cvt;
445 if (music->section < 0) {
446 SDL_BuildAudioCVT (cvt, AUDIO_S16, (Uint8)music->flac_data.channels,
447 (int)music->flac_data.sample_rate, mixer.format,
448 mixer.channels, mixer.freq);
449 if (cvt->buf) {
450 SDL_free (cvt->buf);
451 }
452 cvt->buf = (Uint8 *)SDL_malloc (music->flac_data.data_len * cvt->len_mult);
453 music->section = 0;
454 }
455 if (cvt->buf) {
456 SDL_memcpy (cvt->buf, music->flac_data.data, music->flac_data.data_read);
457 if (cvt->needed) {
458 cvt->len = music->flac_data.data_read;
459 SDL_ConvertAudio (cvt);
460 }
461 else {
462 cvt->len_cvt = music->flac_data.data_read;
463 }
464 music->len_available = music->cvt.len_cvt;
465 music->snd_available = music->cvt.buf;
466 }
467 else {
468 SDL_SetError ("Out of memory");
469 music->playing = 0;
470 }
492 }
493 return 0;
471494 }
472495
473496 /* Play some of a stream previously started with FLAC_play() */
474 int FLAC_playAudio(FLAC_music *music, Uint8 *snd, int len)
475 {
476 int mixable;
477
478 while ((len > 0) && music->playing) {
479 if (!music->len_available) {
480 FLAC_getsome (music);
481 }
482 mixable = len;
483 if (mixable > music->len_available) {
484 mixable = music->len_available;
485 }
486 if (music->volume == MIX_MAX_VOLUME) {
487 SDL_memcpy (snd, music->snd_available, mixable);
488 }
489 else {
490 SDL_MixAudio (snd, music->snd_available, mixable, music->volume);
491 }
492 music->len_available -= mixable;
493 music->snd_available += mixable;
494 len -= mixable;
495 snd += mixable;
496 }
497
498 return len;
499 }
500
501 /* Stop playback of a stream previously started with FLAC_play() */
502 void FLAC_stop(FLAC_music *music)
503 {
504 music->playing = 0;
505 }
506
507 /* Close the given FLAC_music object */
508 void FLAC_delete(FLAC_music *music)
509 {
497 static int FLAC_GetAudio(void *context, void *data, int bytes)
498 {
499 FLAC_Music *music = (FLAC_Music *)context;
500 return music_pcm_getaudio(context, data, bytes, music->volume, FLAC_GetSome);
501 }
502
503 /* Jump (seek) to a given position (position is in seconds) */
504 static int FLAC_Seek(void *context, double position)
505 {
506 FLAC_Music *music = (FLAC_Music *)context;
507 double seek_sample = music->sample_rate * position;
508
509 if (!flac.FLAC__stream_decoder_seek_absolute(music->flac_decoder, (FLAC__uint64)seek_sample)) {
510 if (flac.FLAC__stream_decoder_get_state(music->flac_decoder) == FLAC__STREAM_DECODER_SEEK_ERROR) {
511 flac.FLAC__stream_decoder_flush(music->flac_decoder);
512 }
513
514 SDL_SetError("Seeking of FLAC stream failed: libFLAC seek failed.");
515 return -1;
516 }
517 return 0;
518 }
519
520 /* Close the given FLAC_Music object */
521 static void FLAC_Delete(void *context)
522 {
523 FLAC_Music *music = (FLAC_Music *)context;
510524 if (music) {
511525 if (music->flac_decoder) {
512 flac.FLAC__stream_decoder_finish (music->flac_decoder);
513 flac.FLAC__stream_decoder_delete (music->flac_decoder);
514 }
515
516 if (music->flac_data.data) {
517 SDL_free (music->flac_data.data);
518 }
519
520 if (music->flac_data.overflow) {
521 SDL_free (music->flac_data.overflow);
522 }
523
524 if (music->cvt.buf) {
525 SDL_free (music->cvt.buf);
526 }
527
526 flac.FLAC__stream_decoder_finish(music->flac_decoder);
527 flac.FLAC__stream_decoder_delete(music->flac_decoder);
528 }
529 if (music->stream) {
530 SDL_FreeAudioStream(music->stream);
531 }
528532 if (music->freesrc) {
529533 SDL_RWclose(music->src);
530534 }
531 SDL_free (music);
532 }
533 }
534
535 /* Jump (seek) to a given position (time is in seconds) */
536 void FLAC_jump_to_time(FLAC_music *music, double time)
537 {
538 if (music) {
539 if (music->flac_decoder) {
540 double seek_sample = music->flac_data.sample_rate * time;
541
542 // clear data if it has data
543 if (music->flac_data.data) {
544 SDL_free (music->flac_data.data);
545 music->flac_data.data = NULL;
546 }
547
548 // clear overflow if it has data
549 if (music->flac_data.overflow) {
550 SDL_free (music->flac_data.overflow);
551 music->flac_data.overflow = NULL;
552 }
553
554 if (!flac.FLAC__stream_decoder_seek_absolute (music->flac_decoder,
555 (FLAC__uint64)seek_sample)) {
556 if (flac.FLAC__stream_decoder_get_state (music->flac_decoder)
557 == FLAC__STREAM_DECODER_SEEK_ERROR) {
558 flac.FLAC__stream_decoder_flush (music->flac_decoder);
559 }
560
561 SDL_SetError
562 ("Seeking of FLAC stream failed: libFLAC seek failed.");
563 }
564 }
565 else {
566 SDL_SetError
567 ("Seeking of FLAC stream failed: FLAC decoder was NULL.");
568 }
569 }
570 else {
571 SDL_SetError ("Seeking of FLAC stream failed: music was NULL.");
572 }
573 }
574
575 #endif /* FLAC_MUSIC */
535 SDL_free(music);
536 }
537 }
538
539 Mix_MusicInterface Mix_MusicInterface_FLAC =
540 {
541 "FLAC",
542 MIX_MUSIC_FLAC,
543 MUS_FLAC,
544 SDL_FALSE,
545 SDL_FALSE,
546
547 FLAC_Load,
548 NULL, /* Open */
549 FLAC_CreateFromRW,
550 NULL, /* CreateFromFile */
551 FLAC_SetVolume,
552 FLAC_Play,
553 NULL, /* IsPlaying */
554 FLAC_GetAudio,
555 FLAC_Seek,
556 NULL, /* Pause */
557 NULL, /* Resume */
558 NULL, /* Stop */
559 FLAC_Delete,
560 NULL, /* Close */
561 FLAC_Unload,
562 };
563
564 #endif /* MUSIC_FLAC */
565
566 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
1616 2. Altered source versions must be plainly marked as such, and must not be
1717 misrepresented as being the original software.
1818 3. This notice may not be removed or altered from any source distribution.
19
20 Header to handle loading FLAC music files in SDL.
21 ~ Austen Dicken (admin@cvpcs.org)
2219 */
2320
24 /* $Id: $ */
21 #include "music.h"
2522
26 #ifdef FLAC_MUSIC
23 extern Mix_MusicInterface Mix_MusicInterface_FLAC;
2724
28 #include <FLAC/stream_decoder.h>
29
30 typedef struct {
31 FLAC__uint64 sample_size;
32 unsigned sample_rate;
33 unsigned channels;
34 unsigned bits_per_sample;
35 FLAC__uint64 total_samples;
36
37 // the following are used to handle the callback nature of the writer
38 int max_to_read;
39 char *data; // pointer to beginning of data array
40 int data_len; // size of data array
41 int data_read; // amount of data array used
42 char *overflow; // pointer to beginning of overflow array
43 int overflow_len; // size of overflow array
44 int overflow_read; // amount of overflow array used
45 } FLAC_Data;
46
47 typedef struct {
48 int playing;
49 int volume;
50 int section;
51 FLAC__StreamDecoder *flac_decoder;
52 FLAC_Data flac_data;
53 SDL_RWops *src;
54 int freesrc;
55 SDL_AudioCVT cvt;
56 int len_available;
57 Uint8 *snd_available;
58 } FLAC_music;
59
60 /* Initialize the FLAC player, with the given mixer settings
61 This function returns 0, or -1 if there was an error.
62 */
63 extern int FLAC_init(SDL_AudioSpec *mixer);
64
65 /* Set the volume for a FLAC stream */
66 extern void FLAC_setvolume(FLAC_music *music, int volume);
67
68 /* Load an FLAC stream from an SDL_RWops object */
69 extern FLAC_music *FLAC_new_RW(SDL_RWops *src, int freesrc);
70
71 /* Start playback of a given FLAC stream */
72 extern void FLAC_play(FLAC_music *music);
73
74 /* Return non-zero if a stream is currently playing */
75 extern int FLAC_playing(FLAC_music *music);
76
77 /* Play some of a stream previously started with FLAC_play() */
78 extern int FLAC_playAudio(FLAC_music *music, Uint8 *stream, int len);
79
80 /* Stop playback of a stream previously started with FLAC_play() */
81 extern void FLAC_stop(FLAC_music *music);
82
83 /* Close the given FLAC stream */
84 extern void FLAC_delete(FLAC_music *music);
85
86 /* Jump (seek) to a given position (time is in seconds) */
87 extern void FLAC_jump_to_time(FLAC_music *music, double time);
88
89 #endif /* FLAC_MUSIC */
25 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 James Le Cuirot
21 chewi@aura-online.co.uk
22 */
23
24 #ifdef MUSIC_MID_FLUIDSYNTH
25
26 #include <stdio.h>
27
28 #include "SDL_loadso.h"
29
30 #include "music_fluidsynth.h"
31
32 #include <fluidsynth.h>
33
34
35 typedef struct {
36 int loaded;
37 void *handle;
38
39 int (*delete_fluid_player)(fluid_player_t*);
40 void (*delete_fluid_settings)(fluid_settings_t*);
41 int (*delete_fluid_synth)(fluid_synth_t*);
42 int (*fluid_player_add)(fluid_player_t*, const char*);
43 int (*fluid_player_add_mem)(fluid_player_t*, const void*, size_t);
44 int (*fluid_player_get_status)(fluid_player_t*);
45 int (*fluid_player_play)(fluid_player_t*);
46 int (*fluid_player_set_loop)(fluid_player_t*, int);
47 int (*fluid_player_stop)(fluid_player_t*);
48 int (*fluid_settings_setnum)(fluid_settings_t*, const char*, double);
49 fluid_settings_t* (*fluid_synth_get_settings)(fluid_synth_t*);
50 void (*fluid_synth_set_gain)(fluid_synth_t*, float);
51 int (*fluid_synth_sfload)(fluid_synth_t*, const char*, int);
52 int (*fluid_synth_write_s16)(fluid_synth_t*, int, void*, int, int, void*, int, int);
53 fluid_player_t* (*new_fluid_player)(fluid_synth_t*);
54 fluid_settings_t* (*new_fluid_settings)(void);
55 fluid_synth_t* (*new_fluid_synth)(fluid_settings_t*);
56 } fluidsynth_loader;
57
58 static fluidsynth_loader fluidsynth = {
59 0, NULL
60 };
61
62 #ifdef FLUIDSYNTH_DYNAMIC
63 #define FUNCTION_LOADER(FUNC, SIG) \
64 fluidsynth.FUNC = (SIG) SDL_LoadFunction(fluidsynth.handle, #FUNC); \
65 if (fluidsynth.FUNC == NULL) { SDL_UnloadObject(fluidsynth.handle); return -1; }
66 #else
67 #define FUNCTION_LOADER(FUNC, SIG) \
68 fluidsynth.FUNC = FUNC;
69 #endif
70
71 static int FLUIDSYNTH_Load()
72 {
73 if (fluidsynth.loaded == 0) {
74 #ifdef FLUIDSYNTH_DYNAMIC
75 fluidsynth.handle = SDL_LoadObject(FLUIDSYNTH_DYNAMIC);
76 if (fluidsynth.handle == NULL) {
77 return -1;
78 }
79 #endif
80 FUNCTION_LOADER(delete_fluid_player, int (*)(fluid_player_t*))
81 FUNCTION_LOADER(delete_fluid_settings, void (*)(fluid_settings_t*))
82 FUNCTION_LOADER(delete_fluid_synth, int (*)(fluid_synth_t*))
83 FUNCTION_LOADER(fluid_player_add, int (*)(fluid_player_t*, const char*))
84 FUNCTION_LOADER(fluid_player_add_mem, int (*)(fluid_player_t*, const void*, size_t))
85 FUNCTION_LOADER(fluid_player_get_status, int (*)(fluid_player_t*))
86 FUNCTION_LOADER(fluid_player_play, int (*)(fluid_player_t*))
87 FUNCTION_LOADER(fluid_player_set_loop, int (*)(fluid_player_t*, int))
88 FUNCTION_LOADER(fluid_player_stop, int (*)(fluid_player_t*))
89 FUNCTION_LOADER(fluid_settings_setnum, int (*)(fluid_settings_t*, const char*, double))
90 FUNCTION_LOADER(fluid_synth_get_settings, fluid_settings_t* (*)(fluid_synth_t*))
91 FUNCTION_LOADER(fluid_synth_set_gain, void (*)(fluid_synth_t*, float))
92 FUNCTION_LOADER(fluid_synth_sfload, int(*)(fluid_synth_t*, const char*, int))
93 FUNCTION_LOADER(fluid_synth_write_s16, int(*)(fluid_synth_t*, int, void*, int, int, void*, int, int))
94 FUNCTION_LOADER(new_fluid_player, fluid_player_t* (*)(fluid_synth_t*))
95 FUNCTION_LOADER(new_fluid_settings, fluid_settings_t* (*)(void))
96 FUNCTION_LOADER(new_fluid_synth, fluid_synth_t* (*)(fluid_settings_t*))
97 }
98 ++fluidsynth.loaded;
99
100 return 0;
101 }
102
103 static void FLUIDSYNTH_Unload()
104 {
105 if (fluidsynth.loaded == 0) {
106 return;
107 }
108 if (fluidsynth.loaded == 1) {
109 #ifdef FLUIDSYNTH_DYNAMIC
110 SDL_UnloadObject(fluidsynth.handle);
111 #endif
112 }
113 --fluidsynth.loaded;
114 }
115
116
117 typedef struct {
118 fluid_synth_t *synth;
119 fluid_player_t *player;
120 SDL_AudioStream *stream;
121 void *buffer;
122 int buffer_size;
123 } FLUIDSYNTH_Music;
124
125
126 static int SDLCALL fluidsynth_check_soundfont(const char *path, void *data)
127 {
128 FILE *file = fopen(path, "r");
129
130 if (file) {
131 fclose(file);
132 return 1;
133 } else {
134 Mix_SetError("Failed to access the SoundFont %s", path);
135 return 0;
136 }
137 }
138
139 static int SDLCALL fluidsynth_load_soundfont(const char *path, void *data)
140 {
141 /* If this fails, it's too late to try Timidity so pray that at least one works. */
142 fluidsynth.fluid_synth_sfload((fluid_synth_t*) data, path, 1);
143 return 1;
144 }
145
146 static int FLUIDSYNTH_Open(const SDL_AudioSpec *spec)
147 {
148 if (!Mix_EachSoundFont(fluidsynth_check_soundfont, NULL)) {
149 return -1;
150 }
151 return 0;
152 }
153
154 static FLUIDSYNTH_Music *FLUIDSYNTH_LoadMusic(void *data)
155 {
156 SDL_RWops *src = (SDL_RWops *)data;
157 FLUIDSYNTH_Music *music;
158 fluid_settings_t *settings;
159
160 if ((music = SDL_calloc(1, sizeof(FLUIDSYNTH_Music)))) {
161 int channels = 2;
162 if ((music->stream = SDL_NewAudioStream(AUDIO_S16SYS, channels, music_spec.freq, music_spec.format, music_spec.channels, music_spec.freq))) {
163 music->buffer_size = music_spec.samples * sizeof(Sint16) * channels;
164 if ((music->buffer = SDL_malloc(music->buffer_size))) {
165 if ((settings = fluidsynth.new_fluid_settings())) {
166 fluidsynth.fluid_settings_setnum(settings, "synth.sample-rate", (double) music_spec.freq);
167
168 if ((music->synth = fluidsynth.new_fluid_synth(settings))) {
169 if (Mix_EachSoundFont(fluidsynth_load_soundfont, (void*) music->synth)) {
170 if ((music->player = fluidsynth.new_fluid_player(music->synth))) {
171 void *buffer;
172 size_t size;
173
174 buffer = SDL_LoadFile_RW(src, &size, SDL_FALSE);
175 if (buffer) {
176 if (fluidsynth.fluid_player_add_mem(music->player, buffer, size) == FLUID_OK) {
177 SDL_free(buffer);
178 return music;
179 } else {
180 Mix_SetError("FluidSynth failed to load in-memory song");
181 }
182 SDL_free(buffer);
183 } else {
184 SDL_OutOfMemory();
185 }
186 fluidsynth.delete_fluid_player(music->player);
187 } else {
188 Mix_SetError("Failed to create FluidSynth player");
189 }
190 }
191 fluidsynth.delete_fluid_synth(music->synth);
192 } else {
193 Mix_SetError("Failed to create FluidSynth synthesizer");
194 }
195 fluidsynth.delete_fluid_settings(settings);
196 } else {
197 Mix_SetError("Failed to create FluidSynth settings");
198 }
199 } else {
200 SDL_OutOfMemory();
201 }
202 }
203 SDL_free(music);
204 } else {
205 SDL_OutOfMemory();
206 }
207 return NULL;
208 }
209
210 static void *FLUIDSYNTH_CreateFromRW(SDL_RWops *src, int freesrc)
211 {
212 FLUIDSYNTH_Music *music;
213
214 music = FLUIDSYNTH_LoadMusic(src);
215 if (music && freesrc) {
216 SDL_RWclose(src);
217 }
218 return music;
219 }
220
221 static void FLUIDSYNTH_SetVolume(void *context, int volume)
222 {
223 FLUIDSYNTH_Music *music = (FLUIDSYNTH_Music *)context;
224 /* FluidSynth's default is 0.2. Make 1.2 the maximum. */
225 fluidsynth.fluid_synth_set_gain(music->synth, (float) (volume * 1.2 / MIX_MAX_VOLUME));
226 }
227
228 static int FLUIDSYNTH_Play(void *context, int play_count)
229 {
230 FLUIDSYNTH_Music *music = (FLUIDSYNTH_Music *)context;
231 fluidsynth.fluid_player_set_loop(music->player, play_count);
232 fluidsynth.fluid_player_play(music->player);
233 return 0;
234 }
235
236 static SDL_bool FLUIDSYNTH_IsPlaying(void *context)
237 {
238 FLUIDSYNTH_Music *music = (FLUIDSYNTH_Music *)context;
239 return fluidsynth.fluid_player_get_status(music->player) == FLUID_PLAYER_PLAYING ? SDL_TRUE : SDL_FALSE;
240 }
241
242 static int FLUIDSYNTH_GetSome(void *context, void *data, int bytes, SDL_bool *done)
243 {
244 FLUIDSYNTH_Music *music = (FLUIDSYNTH_Music *)context;
245 int filled;
246
247 filled = SDL_AudioStreamGet(music->stream, data, bytes);
248 if (filled != 0) {
249 return filled;
250 }
251
252 if (fluidsynth.fluid_synth_write_s16(music->synth, music_spec.samples, music->buffer, 0, 2, music->buffer, 1, 2) != FLUID_OK) {
253 Mix_SetError("Error generating FluidSynth audio");
254 return -1;
255 }
256 if (SDL_AudioStreamPut(music->stream, music->buffer, music->buffer_size) < 0) {
257 return -1;
258 }
259 return 0;
260 }
261 static int FLUIDSYNTH_GetAudio(void *context, void *data, int bytes)
262 {
263 return music_pcm_getaudio(context, data, bytes, MIX_MAX_VOLUME, FLUIDSYNTH_GetSome);
264 }
265
266 static void FLUIDSYNTH_Stop(void *context)
267 {
268 FLUIDSYNTH_Music *music = (FLUIDSYNTH_Music *)context;
269 fluidsynth.fluid_player_stop(music->player);
270 }
271
272 static void FLUIDSYNTH_Delete(void *context)
273 {
274 FLUIDSYNTH_Music *music = (FLUIDSYNTH_Music *)context;
275 fluidsynth.delete_fluid_player(music->player);
276 fluidsynth.delete_fluid_settings(fluidsynth.fluid_synth_get_settings(music->synth));
277 fluidsynth.delete_fluid_synth(music->synth);
278 SDL_free(music);
279 }
280
281 Mix_MusicInterface Mix_MusicInterface_FLUIDSYNTH =
282 {
283 "FLUIDSYNTH",
284 MIX_MUSIC_FLUIDSYNTH,
285 MUS_MID,
286 SDL_FALSE,
287 SDL_FALSE,
288
289 FLUIDSYNTH_Load,
290 FLUIDSYNTH_Open,
291 FLUIDSYNTH_CreateFromRW,
292 NULL, /* CreateFromFile */
293 FLUIDSYNTH_SetVolume,
294 FLUIDSYNTH_Play,
295 FLUIDSYNTH_IsPlaying,
296 FLUIDSYNTH_GetAudio,
297 NULL, /* Seek */
298 NULL, /* Pause */
299 NULL, /* Resume */
300 FLUIDSYNTH_Stop,
301 FLUIDSYNTH_Delete,
302 NULL, /* Close */
303 FLUIDSYNTH_Unload,
304 };
305
306 #endif /* MUSIC_MID_FLUIDSYNTH */
307
308 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 James Le Cuirot
21 chewi@aura-online.co.uk
22 */
23
24 /* This file supports playing MIDI files with FluidSynth */
25
26 #include "music.h"
27
28 extern Mix_MusicInterface Mix_MusicInterface_FLUIDSYNTH;
29
30 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
1818 3. This notice may not be removed or altered from any source distribution.
1919 */
2020
21 #ifdef MP3_MAD_MUSIC
22
23 #include <string.h>
21 #ifdef MUSIC_MP3_MAD
2422
2523 #include "music_mad.h"
2624
27 mad_data *
28 mad_openFileRW(SDL_RWops *src, SDL_AudioSpec *mixer, int freesrc)
29 {
30 mad_data *mp3_mad;
31
32 mp3_mad = (mad_data *)SDL_malloc(sizeof(mad_data));
33 if (mp3_mad) {
34 mp3_mad->src = src;
35 mp3_mad->freesrc = freesrc;
36 mad_stream_init(&mp3_mad->stream);
37 mad_frame_init(&mp3_mad->frame);
38 mad_synth_init(&mp3_mad->synth);
39 mp3_mad->frames_read = 0;
40 mad_timer_reset(&mp3_mad->next_frame_start);
41 mp3_mad->volume = MIX_MAX_VOLUME;
42 mp3_mad->status = 0;
43 mp3_mad->output_begin = 0;
44 mp3_mad->output_end = 0;
45 mp3_mad->mixer = *mixer;
46 }
47 return mp3_mad;
48 }
49
50 void
51 mad_closeFile(mad_data *mp3_mad)
52 {
53 mad_stream_finish(&mp3_mad->stream);
54 mad_frame_finish(&mp3_mad->frame);
55 mad_synth_finish(&mp3_mad->synth);
56
57 if (mp3_mad->freesrc) {
58 SDL_RWclose(mp3_mad->src);
59 }
60 SDL_free(mp3_mad);
25 #include "mad.h"
26
27
28 /* NOTE: The dithering functions are GPL, which should be fine if your
29 application is GPL (which would need to be true if you enabled
30 libmad support in SDL_mixer). If you're using libmad under the
31 commercial license, you need to disable this code.
32 */
33 /************************ dithering functions ***************************/
34
35 #ifdef MUSIC_MP3_MAD_GPL_DITHERING
36
37 /* All dithering done here is taken from the GPL'ed xmms-mad plugin. */
38
39 /* Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura. */
40 /* Any feedback is very welcome. For any question, comments, */
41 /* see http://www.math.keio.ac.jp/matumoto/emt.html or email */
42 /* matumoto@math.keio.ac.jp */
43
44 /* Period parameters */
45 #define MP3_DITH_N 624
46 #define MP3_DITH_M 397
47 #define MATRIX_A 0x9908b0df /* constant vector a */
48 #define UPPER_MASK 0x80000000 /* most significant w-r bits */
49 #define LOWER_MASK 0x7fffffff /* least significant r bits */
50
51 /* Tempering parameters */
52 #define TEMPERING_MASK_B 0x9d2c5680
53 #define TEMPERING_MASK_C 0xefc60000
54 #define TEMPERING_SHIFT_U(y) (y >> 11)
55 #define TEMPERING_SHIFT_S(y) (y << 7)
56 #define TEMPERING_SHIFT_T(y) (y << 15)
57 #define TEMPERING_SHIFT_L(y) (y >> 18)
58
59 static unsigned long mt[MP3_DITH_N]; /* the array for the state vector */
60 static int mti=MP3_DITH_N+1; /* mti==MP3_DITH_N+1 means mt[MP3_DITH_N] is not initialized */
61
62 /* initializing the array with a NONZERO seed */
63 static void sgenrand(unsigned long seed)
64 {
65 /* setting initial seeds to mt[MP3_DITH_N] using */
66 /* the generator Line 25 of Table 1 in */
67 /* [KNUTH 1981, The Art of Computer Programming */
68 /* Vol. 2 (2nd Ed.), pp102] */
69 mt[0]= seed & 0xffffffff;
70 for (mti=1; mti<MP3_DITH_N; mti++)
71 mt[mti] = (69069 * mt[mti-1]) & 0xffffffff;
72 }
73
74 static unsigned long genrand(void)
75 {
76 unsigned long y;
77 static unsigned long mag01[2]={0x0, MATRIX_A};
78 /* mag01[x] = x * MATRIX_A for x=0,1 */
79
80 if (mti >= MP3_DITH_N) { /* generate MP3_DITH_N words at one time */
81 int kk;
82
83 if (mti == MP3_DITH_N+1) /* if sgenrand() has not been called, */
84 sgenrand(4357); /* a default initial seed is used */
85
86 for (kk=0;kk<MP3_DITH_N-MP3_DITH_M;kk++) {
87 y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
88 mt[kk] = mt[kk+MP3_DITH_M] ^ (y >> 1) ^ mag01[y & 0x1];
89 }
90 for (;kk<MP3_DITH_N-1;kk++) {
91 y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
92 mt[kk] = mt[kk+(MP3_DITH_M-MP3_DITH_N)] ^ (y >> 1) ^ mag01[y & 0x1];
93 }
94 y = (mt[MP3_DITH_N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK);
95 mt[MP3_DITH_N-1] = mt[MP3_DITH_M-1] ^ (y >> 1) ^ mag01[y & 0x1];
96
97 mti = 0;
98 }
99
100 y = mt[mti++];
101 y ^= TEMPERING_SHIFT_U(y);
102 y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B;
103 y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C;
104 y ^= TEMPERING_SHIFT_L(y);
105
106 return y;
107 }
108
109 static long triangular_dither_noise(int nbits) {
110 /* parameter nbits : the peak-to-peak amplitude desired (in bits)
111 * use with nbits set to 2 + nber of bits to be trimmed.
112 * (because triangular is made from two uniformly distributed processes,
113 * it starts at 2 bits peak-to-peak amplitude)
114 * see The Theory of Dithered Quantization by Robert Alexander Wannamaker
115 * for complete proof of why that's optimal
116 */
117 long v = (genrand()/2 - genrand()/2); /* in ]-2^31, 2^31[ */
118 long P = 1 << (32 - nbits); /* the power of 2 */
119 v /= P;
120 /* now v in ]-2^(nbits-1), 2^(nbits-1) [ */
121
122 return v;
123 }
124
125 #endif /* MUSIC_MP3_MAD_GPL_DITHERING */
126
127
128 #define MAD_INPUT_BUFFER_SIZE (5*8192)
129
130 enum {
131 MS_input_eof = 0x0001,
132 MS_input_error = 0x0001,
133 MS_decode_error = 0x0002,
134 MS_error_flags = 0x000f,
135 };
136
137 typedef struct {
138 int play_count;
139 SDL_RWops *src;
140 int freesrc;
141 struct mad_stream stream;
142 struct mad_frame frame;
143 struct mad_synth synth;
144 mad_timer_t next_frame_start;
145 int volume;
146 int status;
147 SDL_AudioStream *audiostream;
148
149 unsigned char input_buffer[MAD_INPUT_BUFFER_SIZE + MAD_BUFFER_GUARD];
150 } MAD_Music;
151
152
153 static int MAD_Seek(void *context, double position);
154
155 static void *MAD_CreateFromRW(SDL_RWops *src, int freesrc)
156 {
157 MAD_Music *music;
158
159 music = (MAD_Music *)SDL_calloc(1, sizeof(MAD_Music));
160 if (!music) {
161 SDL_OutOfMemory();
162 return NULL;
163 }
164 music->src = src;
165 music->volume = MIX_MAX_VOLUME;
166
167 mad_stream_init(&music->stream);
168 mad_frame_init(&music->frame);
169 mad_synth_init(&music->synth);
170 mad_timer_reset(&music->next_frame_start);
171
172 music->freesrc = freesrc;
173 return music;
174 }
175
176 static void MAD_SetVolume(void *context, int volume)
177 {
178 MAD_Music *music = (MAD_Music *)context;
179 music->volume = volume;
61180 }
62181
63182 /* Starts the playback. */
64 void
65 mad_start(mad_data *mp3_mad) {
66 mp3_mad->status |= MS_playing;
67 }
68
69 /* Stops the playback. */
70 void
71 mad_stop(mad_data *mp3_mad) {
72 mp3_mad->status &= ~MS_playing;
73 }
74
75 /* Returns true if the playing is engaged, false otherwise. */
76 int
77 mad_isPlaying(mad_data *mp3_mad) {
78 return ((mp3_mad->status & MS_playing) != 0);
79 }
80
81 /* Reads the next frame from the file. Returns true on success or
82 false on failure. */
83 static int
84 read_next_frame(mad_data *mp3_mad) {
85 if (mp3_mad->stream.buffer == NULL ||
86 mp3_mad->stream.error == MAD_ERROR_BUFLEN) {
87 size_t read_size;
88 size_t remaining;
89 unsigned char *read_start;
90
91 /* There might be some bytes in the buffer left over from last
92 time. If so, move them down and read more bytes following
93 them. */
94 if (mp3_mad->stream.next_frame != NULL) {
95 remaining = mp3_mad->stream.bufend - mp3_mad->stream.next_frame;
96 memmove(mp3_mad->input_buffer, mp3_mad->stream.next_frame, remaining);
97 read_start = mp3_mad->input_buffer + remaining;
98 read_size = MAD_INPUT_BUFFER_SIZE - remaining;
99
183 static int MAD_Play(void *context, int play_count)
184 {
185 MAD_Music *music = (MAD_Music *)context;
186 music->play_count = play_count;
187 return MAD_Seek(music, 0.0);
188 }
189
190 /* Reads the next frame from the file.
191 Returns true on success or false on failure.
192 */
193 static SDL_bool read_next_frame(MAD_Music *music)
194 {
195 if (music->stream.buffer == NULL ||
196 music->stream.error == MAD_ERROR_BUFLEN) {
197 size_t read_size;
198 size_t remaining;
199 unsigned char *read_start;
200
201 /* There might be some bytes in the buffer left over from last
202 time. If so, move them down and read more bytes following
203 them. */
204 if (music->stream.next_frame != NULL) {
205 remaining = music->stream.bufend - music->stream.next_frame;
206 memmove(music->input_buffer, music->stream.next_frame, remaining);
207 read_start = music->input_buffer + remaining;
208 read_size = MAD_INPUT_BUFFER_SIZE - remaining;
209
210 } else {
211 read_size = MAD_INPUT_BUFFER_SIZE;
212 read_start = music->input_buffer;
213 remaining = 0;
214 }
215
216 /* Now read additional bytes from the input file. */
217 read_size = SDL_RWread(music->src, read_start, 1, read_size);
218
219 if (read_size == 0) {
220 if ((music->status & (MS_input_eof | MS_input_error)) == 0) {
221 /* FIXME: how to detect error? */
222 music->status |= MS_input_eof;
223
224 /* At the end of the file, we must stuff MAD_BUFFER_GUARD
225 number of 0 bytes. */
226 SDL_memset(read_start + read_size, 0, MAD_BUFFER_GUARD);
227 read_size += MAD_BUFFER_GUARD;
228 }
229 }
230
231 /* Now feed those bytes into the libmad stream. */
232 mad_stream_buffer(&music->stream, music->input_buffer,
233 read_size + remaining);
234 music->stream.error = MAD_ERROR_NONE;
235 }
236
237 /* Now ask libmad to extract a frame from the data we just put in
238 its buffer. */
239 if (mad_frame_decode(&music->frame, &music->stream)) {
240 if (MAD_RECOVERABLE(music->stream.error)) {
241 return SDL_FALSE;
242
243 } else if (music->stream.error == MAD_ERROR_BUFLEN) {
244 return SDL_FALSE;
245
246 } else {
247 Mix_SetError("mad_frame_decode() failed, corrupt stream?");
248 music->status |= MS_decode_error;
249 return SDL_FALSE;
250 }
251 }
252
253 mad_timer_add(&music->next_frame_start, music->frame.header.duration);
254
255 return SDL_TRUE;
256 }
257
258 /* Scale a MAD sample to 16 bits for output. */
259 static Sint16 scale(mad_fixed_t sample)
260 {
261 const int n_bits_to_loose = MAD_F_FRACBITS + 1 - 16;
262
263 /* round */
264 sample += (1L << (n_bits_to_loose - 1));
265
266 #ifdef MUSIC_MP3_MAD_GPL_DITHERING
267 sample += triangular_dither_noise(n_bits_to_loose + 1);
268 #endif
269
270 /* clip */
271 if (sample >= MAD_F_ONE)
272 sample = MAD_F_ONE - 1;
273 else if (sample < -MAD_F_ONE)
274 sample = -MAD_F_ONE;
275
276 /* quantize */
277 return (Sint16)(sample >> n_bits_to_loose);
278 }
279
280 /* Once the frame has been read, copies its samples into the output buffer. */
281 static SDL_bool decode_frame(MAD_Music *music)
282 {
283 struct mad_pcm *pcm;
284 unsigned int i, nchannels, nsamples;
285 mad_fixed_t const *left_ch, *right_ch;
286 Sint16 *buffer, *dst;
287 int result;
288
289 mad_synth_frame(&music->synth, &music->frame);
290 pcm = &music->synth.pcm;
291
292 if (!music->audiostream) {
293 music->audiostream = SDL_NewAudioStream(AUDIO_S16, pcm->channels, pcm->samplerate, music_spec.format, music_spec.channels, music_spec.freq);
294 if (!music->audiostream) {
295 return SDL_FALSE;
296 }
297 }
298
299 nchannels = pcm->channels;
300 nsamples = pcm->length;
301 left_ch = pcm->samples[0];
302 right_ch = pcm->samples[1];
303 buffer = SDL_stack_alloc(Sint16, nsamples*nchannels);
304 if (!buffer) {
305 SDL_OutOfMemory();
306 return SDL_FALSE;
307 }
308
309 dst = buffer;
310 if (nchannels == 1) {
311 for (i = nsamples; i--;) {
312 *dst++ = scale(*left_ch++);
313 }
100314 } else {
101 read_size = MAD_INPUT_BUFFER_SIZE;
102 read_start = mp3_mad->input_buffer;
103 remaining = 0;
104 }
105
106 /* Now read additional bytes from the input file. */
107 read_size = SDL_RWread(mp3_mad->src, read_start, 1, read_size);
108
109 if (read_size <= 0) {
110 if ((mp3_mad->status & (MS_input_eof | MS_input_error)) == 0) {
111 if (read_size == 0) {
112 mp3_mad->status |= MS_input_eof;
113 } else {
114 mp3_mad->status |= MS_input_error;
115 }
116
117 /* At the end of the file, we must stuff MAD_BUFFER_GUARD
118 number of 0 bytes. */
119 SDL_memset(read_start + read_size, 0, MAD_BUFFER_GUARD);
120 read_size += MAD_BUFFER_GUARD;
121 }
122 }
123
124 /* Now feed those bytes into the libmad stream. */
125 mad_stream_buffer(&mp3_mad->stream, mp3_mad->input_buffer,
126 read_size + remaining);
127 mp3_mad->stream.error = MAD_ERROR_NONE;
128 }
129
130 /* Now ask libmad to extract a frame from the data we just put in
131 its buffer. */
132 if (mad_frame_decode(&mp3_mad->frame, &mp3_mad->stream)) {
133 if (MAD_RECOVERABLE(mp3_mad->stream.error)) {
134 return 0;
135
136 } else if (mp3_mad->stream.error == MAD_ERROR_BUFLEN) {
137 return 0;
138
139 } else {
140 mp3_mad->status |= MS_decode_error;
141 return 0;
142 }
143 }
144
145 mp3_mad->frames_read++;
146 mad_timer_add(&mp3_mad->next_frame_start, mp3_mad->frame.header.duration);
147
148 return 1;
149 }
150
151 /* Scale a MAD sample to 16 bits for output. */
152 static signed int
153 scale(mad_fixed_t sample) {
154 /* round */
155 sample += (1L << (MAD_F_FRACBITS - 16));
156
157 /* clip */
158 if (sample >= MAD_F_ONE)
159 sample = MAD_F_ONE - 1;
160 else if (sample < -MAD_F_ONE)
161 sample = -MAD_F_ONE;
162
163 /* quantize */
164 return sample >> (MAD_F_FRACBITS + 1 - 16);
165 }
166
167 /* Once the frame has been read, copies its samples into the output
168 buffer. */
169 static void
170 decode_frame(mad_data *mp3_mad) {
171 struct mad_pcm *pcm;
172 unsigned int nchannels, nsamples;
173 mad_fixed_t const *left_ch, *right_ch;
174 unsigned char *out;
175 int ret;
176
177 mad_synth_frame(&mp3_mad->synth, &mp3_mad->frame);
178 pcm = &mp3_mad->synth.pcm;
179 out = mp3_mad->output_buffer + mp3_mad->output_end;
180
181 if ((mp3_mad->status & MS_cvt_decoded) == 0) {
182 mp3_mad->status |= MS_cvt_decoded;
183
184 /* The first frame determines some key properties of the stream.
185 In particular, it tells us enough to set up the convert
186 structure now. */
187 SDL_BuildAudioCVT(&mp3_mad->cvt, AUDIO_S16, pcm->channels, mp3_mad->frame.header.samplerate, mp3_mad->mixer.format, mp3_mad->mixer.channels, mp3_mad->mixer.freq);
188 }
189
190 /* pcm->samplerate contains the sampling frequency */
191
192 nchannels = pcm->channels;
193 nsamples = pcm->length;
194 left_ch = pcm->samples[0];
195 right_ch = pcm->samples[1];
196
197 while (nsamples--) {
198 signed int sample;
199
200 /* output sample(s) in 16-bit signed little-endian PCM */
201
202 sample = scale(*left_ch++);
203 *out++ = ((sample >> 0) & 0xff);
204 *out++ = ((sample >> 8) & 0xff);
205
206 if (nchannels == 2) {
207 sample = scale(*right_ch++);
208 *out++ = ((sample >> 0) & 0xff);
209 *out++ = ((sample >> 8) & 0xff);
210 }
211 }
212
213 mp3_mad->output_end = out - mp3_mad->output_buffer;
214 /*assert(mp3_mad->output_end <= MAD_OUTPUT_BUFFER_SIZE);*/
215 }
216
217 int
218 mad_getSamples(mad_data *mp3_mad, Uint8 *stream, int len) {
219 int bytes_remaining;
220 int num_bytes;
221 Uint8 *out;
222
223 if ((mp3_mad->status & MS_playing) == 0) {
224 /* We're not supposed to be playing, so send silence instead. */
225 SDL_memset(stream, 0, len);
315 for (i = nsamples; i--;) {
316 *dst++ = scale(*left_ch++);
317 *dst++ = scale(*right_ch++);
318 }
319 }
320
321 result = SDL_AudioStreamPut(music->audiostream, buffer, (nsamples * nchannels * sizeof(Sint16)));
322 SDL_stack_free(buffer);
323
324 if (result < 0) {
325 return SDL_FALSE;
326 }
327 return SDL_TRUE;
328 }
329
330 static int MAD_GetSome(void *context, void *data, int bytes, SDL_bool *done)
331 {
332 MAD_Music *music = (MAD_Music *)context;
333 int filled;
334
335 if (music->audiostream) {
336 filled = SDL_AudioStreamGet(music->audiostream, data, bytes);
337 if (filled != 0) {
338 return filled;
339 }
340 }
341
342 if (!music->play_count) {
343 /* All done */
344 *done = SDL_TRUE;
345 return 0;
346 }
347
348 if (read_next_frame(music)) {
349 if (!decode_frame(music)) {
350 return -1;
351 }
352 } else if (music->status & MS_input_eof) {
353 int play_count = -1;
354 if (music->play_count > 0) {
355 play_count = (music->play_count - 1);
356 }
357 if (MAD_Play(music, play_count) < 0) {
358 return -1;
359 }
360 } else if (music->status & MS_decode_error) {
361 return -1;
362 }
226363 return 0;
227 }
228
229 out = stream;
230 bytes_remaining = len;
231 while (bytes_remaining > 0) {
232 if (mp3_mad->output_end == mp3_mad->output_begin) {
233 /* We need to get a new frame. */
234 mp3_mad->output_begin = 0;
235 mp3_mad->output_end = 0;
236 if (!read_next_frame(mp3_mad)) {
237 if ((mp3_mad->status & MS_error_flags) != 0) {
238 /* Couldn't read a frame; either an error condition or
239 end-of-file. Stop. */
240 SDL_memset(out, 0, bytes_remaining);
241 mp3_mad->status &= ~MS_playing;
242 return bytes_remaining;
243 }
244 } else {
245 decode_frame(mp3_mad);
246
247 /* Now convert the frame data to the appropriate format for
248 output. */
249 mp3_mad->cvt.buf = mp3_mad->output_buffer;
250 mp3_mad->cvt.len = mp3_mad->output_end;
251
252 mp3_mad->output_end = (int)(mp3_mad->output_end * mp3_mad->cvt.len_ratio);
253 /*assert(mp3_mad->output_end <= MAD_OUTPUT_BUFFER_SIZE);*/
254 SDL_ConvertAudio(&mp3_mad->cvt);
255 }
256 }
257
258 num_bytes = mp3_mad->output_end - mp3_mad->output_begin;
259 if (bytes_remaining < num_bytes) {
260 num_bytes = bytes_remaining;
261 }
262
263 if (mp3_mad->volume == MIX_MAX_VOLUME) {
264 SDL_memcpy(out, mp3_mad->output_buffer + mp3_mad->output_begin, num_bytes);
265 } else {
266 SDL_MixAudio(out, mp3_mad->output_buffer + mp3_mad->output_begin,
267 num_bytes, mp3_mad->volume);
268 }
269 out += num_bytes;
270 mp3_mad->output_begin += num_bytes;
271 bytes_remaining -= num_bytes;
272 }
273 return 0;
274 }
275
276 void
277 mad_seek(mad_data *mp3_mad, double position) {
278 mad_timer_t target;
279 int int_part;
280
281 int_part = (int)position;
282 mad_timer_set(&target, int_part,
283 (int)((position - int_part) * 1000000), 1000000);
284
285 if (mad_timer_compare(mp3_mad->next_frame_start, target) > 0) {
286 /* In order to seek backwards in a VBR file, we have to rewind and
287 start again from the beginning. This isn't necessary if the
288 file happens to be CBR, of course; in that case we could seek
289 directly to the frame we want. But I leave that little
290 optimization for the future developer who discovers she really
291 needs it. */
292 mp3_mad->frames_read = 0;
293 mad_timer_reset(&mp3_mad->next_frame_start);
294 mp3_mad->status &= ~MS_error_flags;
295 mp3_mad->output_begin = 0;
296 mp3_mad->output_end = 0;
297
298 SDL_RWseek(mp3_mad->src, 0, RW_SEEK_SET);
299 }
300
301 /* Now we have to skip frames until we come to the right one.
302 Again, only truly necessary if the file is VBR. */
303 while (mad_timer_compare(mp3_mad->next_frame_start, target) < 0) {
304 if (!read_next_frame(mp3_mad)) {
305 if ((mp3_mad->status & MS_error_flags) != 0) {
306 /* Couldn't read a frame; either an error condition or
307 end-of-file. Stop. */
308 mp3_mad->status &= ~MS_playing;
309 return;
310 }
311 }
312 }
313
314 /* Here we are, at the beginning of the frame that contains the
315 target time. Ehh, I say that's close enough. If we wanted to,
316 we could get more precise by decoding the frame now and counting
317 the appropriate number of samples out of it. */
318 }
319
320 void
321 mad_setVolume(mad_data *mp3_mad, int volume) {
322 mp3_mad->volume = volume;
323 }
324
325
326 #endif /* MP3_MAD_MUSIC */
364 }
365 static int MAD_GetAudio(void *context, void *data, int bytes)
366 {
367 MAD_Music *music = (MAD_Music *)context;
368 return music_pcm_getaudio(context, data, bytes, music->volume, MAD_GetSome);
369 }
370
371 static int MAD_Seek(void *context, double position)
372 {
373 MAD_Music *music = (MAD_Music *)context;
374 mad_timer_t target;
375 int int_part;
376
377 int_part = (int)position;
378 mad_timer_set(&target, int_part, (int)((position - int_part) * 1000000), 1000000);
379
380 if (mad_timer_compare(music->next_frame_start, target) > 0) {
381 /* In order to seek backwards in a VBR file, we have to rewind and
382 start again from the beginning. This isn't necessary if the
383 file happens to be CBR, of course; in that case we could seek
384 directly to the frame we want. But I leave that little
385 optimization for the future developer who discovers she really
386 needs it. */
387 mad_timer_reset(&music->next_frame_start);
388 music->status &= ~MS_error_flags;
389
390 SDL_RWseek(music->src, 0, RW_SEEK_SET);
391 }
392
393 /* Now we have to skip frames until we come to the right one.
394 Again, only truly necessary if the file is VBR. */
395 while (mad_timer_compare(music->next_frame_start, target) < 0) {
396 if (!read_next_frame(music)) {
397 if ((music->status & MS_error_flags) != 0) {
398 /* Couldn't read a frame; either an error condition or
399 end-of-file. Stop. */
400 return Mix_SetError("Seek position out of range");
401 }
402 }
403 }
404
405 /* Here we are, at the beginning of the frame that contains the
406 target time. Ehh, I say that's close enough. If we wanted to,
407 we could get more precise by decoding the frame now and counting
408 the appropriate number of samples out of it. */
409 return 0;
410 }
411
412 static void MAD_Delete(void *context)
413 {
414 MAD_Music *music = (MAD_Music *)context;
415
416 mad_stream_finish(&music->stream);
417 mad_frame_finish(&music->frame);
418 mad_synth_finish(&music->synth);
419
420 if (music->audiostream) {
421 SDL_FreeAudioStream(music->audiostream);
422 }
423 if (music->freesrc) {
424 SDL_RWclose(music->src);
425 }
426 SDL_free(music);
427 }
428
429 Mix_MusicInterface Mix_MusicInterface_MAD =
430 {
431 "MAD",
432 MIX_MUSIC_MAD,
433 MUS_MP3,
434 SDL_FALSE,
435 SDL_FALSE,
436
437 NULL, /* Load */
438 NULL, /* Open */
439 MAD_CreateFromRW,
440 NULL, /* CreateFromFile */
441 MAD_SetVolume,
442 MAD_Play,
443 NULL, /* IsPlaying */
444 MAD_GetAudio,
445 MAD_Seek,
446 NULL, /* Pause */
447 NULL, /* Resume */
448 NULL, /* Stop */
449 MAD_Delete,
450 NULL, /* Close */
451 NULL, /* Unload */
452 };
453
454 #endif /* MUSIC_MP3_MAD */
455
456 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
1818 3. This notice may not be removed or altered from any source distribution.
1919 */
2020
21 #ifdef MP3_MAD_MUSIC
21 /* This file supports playing MP3 files with libmad */
2222
23 #include "mad.h"
24 #include "SDL_rwops.h"
25 #include "SDL_audio.h"
26 #include "SDL_mixer.h"
23 #include "music.h"
2724
28 #define MAD_INPUT_BUFFER_SIZE (5*8192)
29 #define MAD_OUTPUT_BUFFER_SIZE 8192
25 extern Mix_MusicInterface Mix_MusicInterface_MAD;
3026
31 enum {
32 MS_input_eof = 0x0001,
33 MS_input_error = 0x0001,
34 MS_decode_eof = 0x0002,
35 MS_decode_error = 0x0004,
36 MS_error_flags = 0x000f,
37
38 MS_playing = 0x0100,
39 MS_cvt_decoded = 0x0200,
40 };
41
42 typedef struct {
43 SDL_RWops *src;
44 int freesrc;
45 struct mad_stream stream;
46 struct mad_frame frame;
47 struct mad_synth synth;
48 int frames_read;
49 mad_timer_t next_frame_start;
50 int volume;
51 int status;
52 int output_begin, output_end;
53 SDL_AudioSpec mixer;
54 SDL_AudioCVT cvt;
55
56 unsigned char input_buffer[MAD_INPUT_BUFFER_SIZE + MAD_BUFFER_GUARD];
57 unsigned char output_buffer[MAD_OUTPUT_BUFFER_SIZE];
58 } mad_data;
59
60 mad_data *mad_openFileRW(SDL_RWops *src, SDL_AudioSpec *mixer, int freesrc);
61 void mad_closeFile(mad_data *mp3_mad);
62
63 void mad_start(mad_data *mp3_mad);
64 void mad_stop(mad_data *mp3_mad);
65 int mad_isPlaying(mad_data *mp3_mad);
66
67 int mad_getSamples(mad_data *mp3_mad, Uint8 *stream, int len);
68 void mad_seek(mad_data *mp3_mad, double position);
69 void mad_setVolume(mad_data *mp3_mad, int volume);
70
71 #endif
27 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef MUSIC_MOD_MIKMOD
22
23 /* This file supports MOD tracker music streams */
24
25 #include "SDL_loadso.h"
26
27 #include "music_mikmod.h"
28
29 #include "mikmod.h"
30
31
32 /* libmikmod >= 3.3.2 constified several funcs */
33 #if (LIBMIKMOD_VERSION < 0x030302)
34 #define MIKMOD3_CONST
35 #else
36 #define MIKMOD3_CONST const
37 #endif
38
39 typedef struct {
40 int loaded;
41 void *handle;
42
43 void (*MikMod_Exit)(void);
44 CHAR* (*MikMod_InfoDriver)(void);
45 CHAR* (*MikMod_InfoLoader)(void);
46 int (*MikMod_Init)(MIKMOD3_CONST CHAR*);
47 void (*MikMod_RegisterAllLoaders)(void);
48 void (*MikMod_RegisterDriver)(struct MDRIVER*);
49 int* MikMod_errno;
50 MIKMOD3_CONST char* (*MikMod_strerror)(int);
51 void (*MikMod_free)(void*);
52 BOOL (*Player_Active)(void);
53 void (*Player_Free)(MODULE*);
54 MODULE* (*Player_LoadGeneric)(MREADER*,int,BOOL);
55 void (*Player_SetPosition)(UWORD);
56 void (*Player_SetVolume)(SWORD);
57 void (*Player_Start)(MODULE*);
58 void (*Player_Stop)(void);
59 ULONG (*VC_WriteBytes)(SBYTE*,ULONG);
60 struct MDRIVER* drv_nos;
61 UWORD* md_device;
62 UWORD* md_mixfreq;
63 UWORD* md_mode;
64 UBYTE* md_musicvolume;
65 UBYTE* md_pansep;
66 UBYTE* md_reverb;
67 UBYTE* md_sndfxvolume;
68 UBYTE* md_volume;
69 } mikmod_loader;
70
71 static mikmod_loader mikmod = {
72 0, NULL
73 };
74
75 #ifdef MIKMOD_DYNAMIC
76 #define FUNCTION_LOADER(FUNC, SIG) \
77 mikmod.FUNC = (SIG) SDL_LoadFunction(mikmod.handle, #FUNC); \
78 if (mikmod.FUNC == NULL) { SDL_UnloadObject(mikmod.handle); return -1; }
79 #define VARIABLE_LOADER(NAME, SIG) \
80 mikmod.NAME = (SIG) SDL_LoadFunction(mikmod.handle, #NAME); \
81 if (mikmod.NAME == NULL) { SDL_UnloadObject(mikmod.handle); return -1; }
82 #else
83 #define FUNCTION_LOADER(FUNC, SIG) \
84 mikmod.FUNC = FUNC;
85 #define VARIABLE_LOADER(NAME, SIG) \
86 mikmod.NAME = &NAME;
87 #endif
88
89 static int MIKMOD_Load()
90 {
91 if (mikmod.loaded == 0) {
92 #ifdef MIKMOD_DYNAMIC
93 mikmod.handle = SDL_LoadObject(MIKMOD_DYNAMIC);
94 if (mikmod.handle == NULL) {
95 return -1;
96 }
97 #elif defined(__MACOSX__)
98 extern void Player_Start(MODULE*) __attribute__((weak_import));
99 if (Player_Start == NULL)
100 {
101 /* Missing weakly linked framework */
102 Mix_SetError("Missing mikmod.framework");
103 return -1;
104 }
105 #endif
106 FUNCTION_LOADER(MikMod_Exit, void (*)(void))
107 FUNCTION_LOADER(MikMod_InfoDriver, CHAR* (*)(void))
108 FUNCTION_LOADER(MikMod_InfoLoader, CHAR* (*)(void))
109 FUNCTION_LOADER(MikMod_Init, int (*)(MIKMOD3_CONST CHAR*))
110 FUNCTION_LOADER(MikMod_RegisterAllLoaders, void (*)(void))
111 FUNCTION_LOADER(MikMod_RegisterDriver, void (*)(struct MDRIVER*))
112 VARIABLE_LOADER(MikMod_errno, int*)
113 FUNCTION_LOADER(MikMod_strerror, MIKMOD3_CONST char* (*)(int))
114 #ifdef MIKMOD_DYNAMIC
115 mikmod.MikMod_free = (void (*)(void*)) SDL_LoadFunction(mikmod.handle, "MikMod_free");
116 if (!mikmod.MikMod_free) {
117 /* libmikmod 3.1 and earlier doesn't have it */
118 mikmod.MikMod_free = free;
119 }
120 #else
121 #if LIBMIKMOD_VERSION < ((3<<16)|(2<<8))
122 mikmod.MikMod_free = free;
123 #else
124 mikmod.MikMod_free = MikMod_free;
125 #endif
126 #endif /* MIKMOD_DYNAMIC */
127 FUNCTION_LOADER(Player_Active, BOOL (*)(void))
128 FUNCTION_LOADER(Player_Free, void (*)(MODULE*))
129 FUNCTION_LOADER(Player_LoadGeneric, MODULE* (*)(MREADER*,int,BOOL))
130 FUNCTION_LOADER(Player_SetPosition, void (*)(UWORD))
131 FUNCTION_LOADER(Player_SetVolume, void (*)(SWORD))
132 FUNCTION_LOADER(Player_Start, void (*)(MODULE*))
133 FUNCTION_LOADER(Player_Stop, void (*)(void))
134 FUNCTION_LOADER(VC_WriteBytes, ULONG (*)(SBYTE*,ULONG))
135 VARIABLE_LOADER(drv_nos, MDRIVER*)
136 VARIABLE_LOADER(md_device, UWORD*)
137 VARIABLE_LOADER(md_mixfreq, UWORD*)
138 VARIABLE_LOADER(md_mode, UWORD*)
139 VARIABLE_LOADER(md_musicvolume, UBYTE*)
140 VARIABLE_LOADER(md_pansep, UBYTE*)
141 VARIABLE_LOADER(md_reverb, UBYTE*)
142 VARIABLE_LOADER(md_sndfxvolume, UBYTE*)
143 VARIABLE_LOADER(md_volume, UBYTE*)
144 }
145 ++mikmod.loaded;
146
147 return 0;
148 }
149
150 static void MIKMOD_Unload()
151 {
152 if (mikmod.loaded == 0) {
153 return;
154 }
155 if (mikmod.loaded == 1) {
156 #ifdef MIKMOD_DYNAMIC
157 SDL_UnloadObject(mikmod.handle);
158 #endif
159 }
160 --mikmod.loaded;
161 }
162
163
164 typedef struct
165 {
166 int play_count;
167 int volume;
168 MODULE *module;
169 SDL_AudioStream *stream;
170 SBYTE *buffer;
171 ULONG buffer_size;
172 } MIKMOD_Music;
173
174
175 static int MIKMOD_Seek(void *context, double position);
176 static void MIKMOD_Delete(void *context);
177
178 /* Initialize the MOD player, with the given mixer settings
179 This function returns 0, or -1 if there was an error.
180 */
181 static int MIKMOD_Open(const SDL_AudioSpec *spec)
182 {
183 CHAR *list;
184
185 /* Set the MikMod music format */
186 if (spec->format == AUDIO_S8 || spec->format == AUDIO_U8) {
187 /* MIKMOD audio format is AUDIO_U8 */
188 *mikmod.md_mode = 0;
189 } else {
190 /* MIKMOD audio format is AUDIO_S16SYS */
191 *mikmod.md_mode = DMODE_16BITS;
192 }
193 if (spec->channels > 1) {
194 *mikmod.md_mode |= DMODE_STEREO;
195 }
196 *mikmod.md_mixfreq = spec->freq;
197 *mikmod.md_device = 0;
198 *mikmod.md_volume = 96;
199 *mikmod.md_musicvolume = 128;
200 *mikmod.md_sndfxvolume = 128;
201 *mikmod.md_pansep = 128;
202 *mikmod.md_reverb = 0;
203 *mikmod.md_mode |= DMODE_HQMIXER|DMODE_SOFT_MUSIC|DMODE_SURROUND;
204
205 list = mikmod.MikMod_InfoDriver();
206 if (list) {
207 mikmod.MikMod_free(list);
208 } else {
209 mikmod.MikMod_RegisterDriver(mikmod.drv_nos);
210 }
211
212 list = mikmod.MikMod_InfoLoader();
213 if (list) {
214 mikmod.MikMod_free(list);
215 } else {
216 mikmod.MikMod_RegisterAllLoaders();
217 }
218
219 if (mikmod.MikMod_Init(NULL)) {
220 Mix_SetError("%s", mikmod.MikMod_strerror(*mikmod.MikMod_errno));
221 return -1;
222 }
223 return 0;
224 }
225
226 /* Uninitialize the music players */
227 static void MIKMOD_Close(void)
228 {
229 if (mikmod.MikMod_Exit) {
230 mikmod.MikMod_Exit();
231 }
232 }
233
234 typedef struct
235 {
236 MREADER mr;
237 /* struct MREADER in libmikmod <= 3.2.0-beta2
238 * doesn't have iobase members. adding them here
239 * so that if we compile against 3.2.0-beta2, we
240 * can still run OK against 3.2.0b3 and newer. */
241 long iobase, prev_iobase;
242 Sint64 offset;
243 Sint64 eof;
244 SDL_RWops *src;
245 } LMM_MREADER;
246
247 int LMM_Seek(struct MREADER *mr,long to,int dir)
248 {
249 Sint64 offset = to;
250 LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
251 if (dir == SEEK_SET) {
252 offset += lmmmr->offset;
253 if (offset < lmmmr->offset)
254 return -1;
255 }
256 return (int)(SDL_RWseek(lmmmr->src, offset, dir));
257 }
258 long LMM_Tell(struct MREADER *mr)
259 {
260 LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
261 return (long)(SDL_RWtell(lmmmr->src) - lmmmr->offset);
262 }
263 BOOL LMM_Read(struct MREADER *mr,void *buf,size_t sz)
264 {
265 LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
266 return SDL_RWread(lmmmr->src, buf, sz, 1);
267 }
268 int LMM_Get(struct MREADER *mr)
269 {
270 unsigned char c;
271 LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
272 if (SDL_RWread(lmmmr->src, &c, 1, 1)) {
273 return c;
274 }
275 return EOF;
276 }
277 BOOL LMM_Eof(struct MREADER *mr)
278 {
279 Sint64 offset;
280 LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
281 offset = LMM_Tell(mr);
282 return offset >= lmmmr->eof;
283 }
284 MODULE *MikMod_LoadSongRW(SDL_RWops *src, int maxchan)
285 {
286 LMM_MREADER lmmmr = {
287 { LMM_Seek, LMM_Tell, LMM_Read, LMM_Get, LMM_Eof },
288 0,
289 0,
290 0
291 };
292 lmmmr.offset = SDL_RWtell(src);
293 SDL_RWseek(src, 0, RW_SEEK_END);
294 lmmmr.eof = SDL_RWtell(src);
295 SDL_RWseek(src, lmmmr.offset, RW_SEEK_SET);
296 lmmmr.src = src;
297 return mikmod.Player_LoadGeneric((MREADER*)&lmmmr, maxchan, 0);
298 }
299
300 /* Load a MOD stream from an SDL_RWops object */
301 void *MIKMOD_CreateFromRW(SDL_RWops *src, int freesrc)
302 {
303 MIKMOD_Music *music;
304 SDL_AudioFormat format;
305 Uint8 channels;
306
307 music = (MIKMOD_Music *)SDL_calloc(1, sizeof(*music));
308 if (!music) {
309 SDL_OutOfMemory();
310 return NULL;
311 }
312 music->volume = MIX_MAX_VOLUME;
313
314 music->module = MikMod_LoadSongRW(src, 64);
315 if (!music->module) {
316 Mix_SetError("%s", mikmod.MikMod_strerror(*mikmod.MikMod_errno));
317 MIKMOD_Delete(music);
318 return NULL;
319 }
320
321 /* Allow implicit looping, disable fade out and other flags. */
322 music->module->extspd = 1;
323 music->module->panflag = 1;
324 music->module->wrap = 0;
325 music->module->loop = 1;
326 music->module->fadeout = 0;
327
328 if ((*mikmod.md_mode & DMODE_16BITS) == DMODE_16BITS) {
329 format = AUDIO_S16SYS;
330 } else {
331 format = AUDIO_U8;
332 }
333 if ((*mikmod.md_mode & DMODE_STEREO) == DMODE_STEREO) {
334 channels = 2;
335 } else {
336 channels = 1;
337 }
338 music->stream = SDL_NewAudioStream(format, channels, *mikmod.md_mixfreq,
339 music_spec.format, music_spec.channels, music_spec.freq);
340 if (!music->stream) {
341 MIKMOD_Delete(music);
342 return NULL;
343 }
344
345 music->buffer_size = music_spec.samples * (SDL_AUDIO_BITSIZE(format) / 8) * channels;
346 music->buffer = (SBYTE *)SDL_malloc(music->buffer_size);
347 if (!music->buffer) {
348 SDL_OutOfMemory();
349 MIKMOD_Delete(music);
350 return NULL;
351 }
352
353 if (freesrc) {
354 SDL_RWclose(src);
355 }
356 return music;
357 }
358
359 /* Set the volume for a MOD stream */
360 static void MIKMOD_SetVolume(void *context, int volume)
361 {
362 MIKMOD_Music *music = (MIKMOD_Music *)context;
363 music->volume = volume;
364 mikmod.Player_SetVolume((SWORD)volume);
365 }
366
367 /* Start playback of a given MOD stream */
368 static int MIKMOD_Play(void *context, int play_count)
369 {
370 MIKMOD_Music *music = (MIKMOD_Music *)context;
371 music->play_count = play_count;
372 music->module->initvolume = music->volume;
373 mikmod.Player_Start(music->module);
374 return MIKMOD_Seek(music, 0.0);
375 }
376
377 /* Return non-zero if a stream is currently playing */
378 static SDL_bool MIKMOD_IsPlaying(void *context)
379 {
380 return mikmod.Player_Active() ? SDL_TRUE : SDL_FALSE;
381 }
382
383 /* Play some of a stream previously started with MOD_play() */
384 static int MIKMOD_GetSome(void *context, void *data, int bytes, SDL_bool *done)
385 {
386 MIKMOD_Music *music = (MIKMOD_Music *)context;
387 int filled;
388
389 filled = SDL_AudioStreamGet(music->stream, data, bytes);
390 if (filled != 0) {
391 return filled;
392 }
393
394 if (!music->play_count) {
395 /* All done */
396 *done = SDL_TRUE;
397 return 0;
398 }
399
400 /* This never fails, and always writes a full buffer */
401 mikmod.VC_WriteBytes(music->buffer, music->buffer_size);
402
403 if (SDL_AudioStreamPut(music->stream, music->buffer, music->buffer_size) < 0) {
404 return -1;
405 }
406
407 /* Check to see if we're done now */
408 if (!mikmod.Player_Active()) {
409 if (music->play_count == 1) {
410 music->play_count = 0;
411 SDL_AudioStreamFlush(music->stream);
412 } else {
413 int play_count = -1;
414 if (music->play_count > 0) {
415 play_count = (music->play_count - 1);
416 }
417 if (MIKMOD_Play(music, play_count) < 0) {
418 return -1;
419 }
420 }
421 }
422 return 0;
423 }
424 static int MIKMOD_GetAudio(void *context, void *data, int bytes)
425 {
426 return music_pcm_getaudio(context, data, bytes, MIX_MAX_VOLUME, MIKMOD_GetSome);
427 }
428
429 /* Jump (seek) to a given position (time is in seconds) */
430 static int MIKMOD_Seek(void *context, double position)
431 {
432 mikmod.Player_SetPosition((UWORD)position);
433 return 0;
434 }
435
436 /* Stop playback of a stream previously started with MOD_play() */
437 static void MIKMOD_Stop(void *context)
438 {
439 mikmod.Player_Stop();
440 }
441
442 /* Close the given MOD stream */
443 static void MIKMOD_Delete(void *context)
444 {
445 MIKMOD_Music *music = (MIKMOD_Music *)context;
446
447 if (music->module) {
448 mikmod.Player_Free(music->module);
449 }
450 if (music->stream) {
451 SDL_FreeAudioStream(music->stream);
452 }
453 if (music->buffer) {
454 SDL_free(music->buffer);
455 }
456 SDL_free(music);
457 }
458
459 Mix_MusicInterface Mix_MusicInterface_MIKMOD =
460 {
461 "MIKMOD",
462 MIX_MUSIC_MIKMOD,
463 MUS_MOD,
464 SDL_FALSE,
465 SDL_FALSE,
466
467 MIKMOD_Load,
468 MIKMOD_Open,
469 MIKMOD_CreateFromRW,
470 NULL, /* CreateFromFile */
471 MIKMOD_SetVolume,
472 MIKMOD_Play,
473 MIKMOD_IsPlaying,
474 MIKMOD_GetAudio,
475 MIKMOD_Seek,
476 NULL, /* Pause */
477 NULL, /* Resume */
478 MIKMOD_Stop,
479 MIKMOD_Delete,
480 MIKMOD_Close,
481 MIKMOD_Unload,
482 };
483
484 #endif /* MUSIC_MOD_MIKMOD */
485
486 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* This file supports playing MOD files with libmikmod */
22
23 #include "music.h"
24
25 extern Mix_MusicInterface Mix_MusicInterface_MIKMOD;
26
27 /* vi: set ts=4 sw=4 expandtab: */
+0
-341
music_mod.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* $Id: music_mod.c 4211 2008-12-08 00:27:32Z slouken $ */
22
23 #ifdef MOD_MUSIC
24
25 /* This file supports MOD tracker music streams */
26
27 #include "SDL_mixer.h"
28 #include "dynamic_mod.h"
29 #include "music_mod.h"
30
31 #include "mikmod.h"
32
33 #define SDL_SURROUND
34 #ifdef SDL_SURROUND
35 #define MAX_OUTPUT_CHANNELS 6
36 #else
37 #define MAX_OUTPUT_CHANNELS 2
38 #endif
39
40 /* Reference for converting mikmod output to 4/6 channels */
41 static int current_output_channels;
42 static Uint16 current_output_format;
43
44 static int music_swap8;
45 static int music_swap16;
46
47 /* Initialize the MOD player, with the given mixer settings
48 This function returns 0, or -1 if there was an error.
49 */
50 int MOD_init(SDL_AudioSpec *mixerfmt)
51 {
52 CHAR *list;
53
54 if ( !Mix_Init(MIX_INIT_MOD) ) {
55 return -1;
56 }
57
58 /* Set the MikMod music format */
59 music_swap8 = 0;
60 music_swap16 = 0;
61 switch (mixerfmt->format) {
62
63 case AUDIO_U8:
64 case AUDIO_S8: {
65 if ( mixerfmt->format == AUDIO_S8 ) {
66 music_swap8 = 1;
67 }
68 *mikmod.md_mode = 0;
69 }
70 break;
71
72 case AUDIO_S16LSB:
73 case AUDIO_S16MSB: {
74 /* See if we need to correct MikMod mixing */
75 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
76 if ( mixerfmt->format == AUDIO_S16MSB ) {
77 #else
78 if ( mixerfmt->format == AUDIO_S16LSB ) {
79 #endif
80 music_swap16 = 1;
81 }
82 *mikmod.md_mode = DMODE_16BITS;
83 }
84 break;
85
86 default: {
87 Mix_SetError("Unknown hardware audio format");
88 return -1;
89 }
90 }
91 current_output_channels = mixerfmt->channels;
92 current_output_format = mixerfmt->format;
93 if ( mixerfmt->channels > 1 ) {
94 if ( mixerfmt->channels > MAX_OUTPUT_CHANNELS ) {
95 Mix_SetError("Hardware uses more channels than mixerfmt");
96 return -1;
97 }
98 *mikmod.md_mode |= DMODE_STEREO;
99 }
100 *mikmod.md_mixfreq = mixerfmt->freq;
101 *mikmod.md_device = 0;
102 *mikmod.md_volume = 96;
103 *mikmod.md_musicvolume = 128;
104 *mikmod.md_sndfxvolume = 128;
105 *mikmod.md_pansep = 128;
106 *mikmod.md_reverb = 0;
107 *mikmod.md_mode |= DMODE_HQMIXER|DMODE_SOFT_MUSIC|DMODE_SURROUND;
108
109 list = mikmod.MikMod_InfoDriver();
110 if ( list )
111 mikmod.MikMod_free(list);
112 else
113 mikmod.MikMod_RegisterDriver(mikmod.drv_nos);
114
115 list = mikmod.MikMod_InfoLoader();
116 if ( list )
117 mikmod.MikMod_free(list);
118 else
119 mikmod.MikMod_RegisterAllLoaders();
120
121 if ( mikmod.MikMod_Init(NULL) ) {
122 Mix_SetError("%s", mikmod.MikMod_strerror(*mikmod.MikMod_errno));
123 return -1;
124 }
125
126 return 0;
127 }
128
129 /* Uninitialize the music players */
130 void MOD_exit(void)
131 {
132 if (mikmod.MikMod_Exit) {
133 mikmod.MikMod_Exit();
134 }
135 }
136
137 /* Set the volume for a MOD stream */
138 void MOD_setvolume(MODULE *music, int volume)
139 {
140 mikmod.Player_SetVolume((SWORD)volume);
141 }
142
143 typedef struct
144 {
145 MREADER mr;
146 Sint64 offset;
147 Sint64 eof;
148 SDL_RWops *src;
149 } LMM_MREADER;
150
151 BOOL LMM_Seek(struct MREADER *mr,long to,int dir)
152 {
153 Sint64 offset = to;
154 LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
155 if ( dir == SEEK_SET ) {
156 offset += lmmmr->offset;
157 }
158 return (SDL_RWseek(lmmmr->src, offset, dir) < lmmmr->offset);
159 }
160 long LMM_Tell(struct MREADER *mr)
161 {
162 LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
163 return (long)(SDL_RWtell(lmmmr->src) - lmmmr->offset);
164 }
165 BOOL LMM_Read(struct MREADER *mr,void *buf,size_t sz)
166 {
167 LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
168 return SDL_RWread(lmmmr->src, buf, sz, 1);
169 }
170 int LMM_Get(struct MREADER *mr)
171 {
172 unsigned char c;
173 LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
174 if ( SDL_RWread(lmmmr->src, &c, 1, 1) ) {
175 return c;
176 }
177 return EOF;
178 }
179 BOOL LMM_Eof(struct MREADER *mr)
180 {
181 Sint64 offset;
182 LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
183 offset = LMM_Tell(mr);
184 return offset >= lmmmr->eof;
185 }
186 MODULE *MikMod_LoadSongRW(SDL_RWops *src, int maxchan)
187 {
188 LMM_MREADER lmmmr = {
189 { LMM_Seek, LMM_Tell, LMM_Read, LMM_Get, LMM_Eof },
190 0,
191 0,
192 0
193 };
194 lmmmr.offset = SDL_RWtell(src);
195 SDL_RWseek(src, 0, RW_SEEK_END);
196 lmmmr.eof = SDL_RWtell(src);
197 SDL_RWseek(src, lmmmr.offset, RW_SEEK_SET);
198 lmmmr.src = src;
199 return mikmod.Player_LoadGeneric((MREADER*)&lmmmr, maxchan, 0);
200 }
201
202 /* Load a MOD stream from an SDL_RWops object */
203 MODULE *MOD_new_RW(SDL_RWops *src, int freesrc)
204 {
205 MODULE *module;
206
207 /* Make sure the mikmod library is loaded */
208 if ( !Mix_Init(MIX_INIT_MOD) ) {
209 return NULL;
210 }
211
212 module = MikMod_LoadSongRW(src, 64);
213 if (!module) {
214 Mix_SetError("%s", mikmod.MikMod_strerror(*mikmod.MikMod_errno));
215 return NULL;
216 }
217
218 /* Stop implicit looping, fade out and other flags. */
219 module->extspd = 1;
220 module->panflag = 1;
221 module->wrap = 0;
222 module->loop = 0;
223 #if 0 /* Don't set fade out by default - unfortunately there's no real way
224 to query the status of the song or set trigger actions. Hum. */
225 module->fadeout = 1;
226 #endif
227
228 if ( freesrc ) {
229 SDL_RWclose(src);
230 }
231 return module;
232 }
233
234 /* Start playback of a given MOD stream */
235 void MOD_play(MODULE *music)
236 {
237 mikmod.Player_Start(music);
238 }
239
240 /* Return non-zero if a stream is currently playing */
241 int MOD_playing(MODULE *music)
242 {
243 return mikmod.Player_Active();
244 }
245
246 /* Play some of a stream previously started with MOD_play() */
247 int MOD_playAudio(MODULE *music, Uint8 *stream, int len)
248 {
249 if (current_output_channels > 2) {
250 int small_len = 2 * len / current_output_channels;
251 int i;
252 Uint8 *src, *dst;
253
254 mikmod.VC_WriteBytes((SBYTE *)stream, small_len);
255 /* and extend to len by copying channels */
256 src = stream + small_len;
257 dst = stream + len;
258
259 switch (current_output_format & 0xFF) {
260 case 8:
261 for ( i=small_len/2; i; --i ) {
262 src -= 2;
263 dst -= current_output_channels;
264 dst[0] = src[0];
265 dst[1] = src[1];
266 dst[2] = src[0];
267 dst[3] = src[1];
268 if (current_output_channels == 6) {
269 dst[4] = src[0];
270 dst[5] = src[1];
271 }
272 }
273 break;
274 case 16:
275 for ( i=small_len/4; i; --i ) {
276 src -= 4;
277 dst -= 2 * current_output_channels;
278 dst[0] = src[0];
279 dst[1] = src[1];
280 dst[2] = src[2];
281 dst[3] = src[3];
282 dst[4] = src[0];
283 dst[5] = src[1];
284 dst[6] = src[2];
285 dst[7] = src[3];
286 if (current_output_channels == 6) {
287 dst[8] = src[0];
288 dst[9] = src[1];
289 dst[10] = src[2];
290 dst[11] = src[3];
291 }
292 }
293 break;
294 }
295 } else {
296 mikmod.VC_WriteBytes((SBYTE *)stream, len);
297 }
298 if ( music_swap8 ) {
299 Uint8 *dst;
300 int i;
301
302 dst = stream;
303 for ( i=len; i; --i ) {
304 *dst++ ^= 0x80;
305 }
306 } else
307 if ( music_swap16 ) {
308 Uint8 *dst, tmp;
309 int i;
310
311 dst = stream;
312 for ( i=(len/2); i; --i ) {
313 tmp = dst[0];
314 dst[0] = dst[1];
315 dst[1] = tmp;
316 dst += 2;
317 }
318 }
319 return 0;
320 }
321
322 /* Stop playback of a stream previously started with MOD_play() */
323 void MOD_stop(MODULE *music)
324 {
325 mikmod.Player_Stop();
326 }
327
328 /* Close the given MOD stream */
329 void MOD_delete(MODULE *music)
330 {
331 mikmod.Player_Free(music);
332 }
333
334 /* Jump (seek) to a given position (time is in seconds) */
335 void MOD_jump_to_time(MODULE *music, double time)
336 {
337 mikmod.Player_SetPosition((UWORD)time);
338 }
339
340 #endif /* MOD_MUSIC */
+0
-62
music_mod.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* $Id: music_mod.h 4211 2008-12-08 00:27:32Z slouken $ */
22
23 #ifdef MOD_MUSIC
24
25 /* This file supports MOD tracker music streams */
26
27 struct MODULE;
28
29 /* Initialize the Ogg Vorbis player, with the given mixer settings
30 This function returns 0, or -1 if there was an error.
31 */
32 extern int MOD_init(SDL_AudioSpec *mixer);
33
34 /* Uninitialize the music players */
35 extern void MOD_exit(void);
36
37 /* Set the volume for a MOD stream */
38 extern void MOD_setvolume(struct MODULE *music, int volume);
39
40 /* Load a MOD stream from an SDL_RWops object */
41 extern struct MODULE *MOD_new_RW(SDL_RWops *rw, int freerw);
42
43 /* Start playback of a given MOD stream */
44 extern void MOD_play(struct MODULE *music);
45
46 /* Return non-zero if a stream is currently playing */
47 extern int MOD_playing(struct MODULE *music);
48
49 /* Play some of a stream previously started with MOD_play() */
50 extern int MOD_playAudio(struct MODULE *music, Uint8 *stream, int len);
51
52 /* Stop playback of a stream previously started with MOD_play() */
53 extern void MOD_stop(struct MODULE *music);
54
55 /* Close the given MOD stream */
56 extern void MOD_delete(struct MODULE *music);
57
58 /* Jump (seek) to a given position (time is in seconds) */
59 extern void MOD_jump_to_time(struct MODULE *music, double time);
60
61 #endif /* MOD_MUSIC */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
1818 3. This notice may not be removed or altered from any source distribution.
1919 */
2020
21 #ifdef MODPLUG_MUSIC
22
23 #include "SDL_mixer.h"
24 #include "dynamic_modplug.h"
21 #ifdef MUSIC_MOD_MODPLUG
22
23 #include "SDL_loadso.h"
24
2525 #include "music_modplug.h"
2626
27 static int current_output_channels=0;
28 static int music_swap8=0;
29 static int music_swap16=0;
27 #ifdef MODPLUG_HEADER
28 #include MODPLUG_HEADER
29 #else
30 #include <libmodplug/modplug.h>
31 #endif
32
33 typedef struct {
34 int loaded;
35 void *handle;
36
37 ModPlugFile* (*ModPlug_Load)(const void* data, int size);
38 void (*ModPlug_Unload)(ModPlugFile* file);
39 int (*ModPlug_Read)(ModPlugFile* file, void* buffer, int size);
40 void (*ModPlug_Seek)(ModPlugFile* file, int millisecond);
41 void (*ModPlug_GetSettings)(ModPlug_Settings* settings);
42 void (*ModPlug_SetSettings)(const ModPlug_Settings* settings);
43 void (*ModPlug_SetMasterVolume)(ModPlugFile* file,unsigned int cvol) ;
44 } modplug_loader;
45
46 static modplug_loader modplug = {
47 0, NULL
48 };
49
50
3051 static ModPlug_Settings settings;
3152
32 int modplug_init(SDL_AudioSpec *spec)
33 {
34 if ( !Mix_Init(MIX_INIT_MODPLUG) ) {
35 return -1;
36 }
37
53 #ifdef MODPLUG_DYNAMIC
54 #define FUNCTION_LOADER(FUNC, SIG) \
55 modplug.FUNC = (SIG) SDL_LoadFunction(modplug.handle, #FUNC); \
56 if (modplug.FUNC == NULL) { SDL_UnloadObject(modplug.handle); return -1; }
57 #else
58 #define FUNCTION_LOADER(FUNC, SIG) \
59 modplug.FUNC = FUNC;
60 #endif
61
62 static int MODPLUG_Load(void)
63 {
64 if (modplug.loaded == 0) {
65 #ifdef MODPLUG_DYNAMIC
66 modplug.handle = SDL_LoadObject(MODPLUG_DYNAMIC);
67 if (modplug.handle == NULL) {
68 return -1;
69 }
70 #elif defined(__MACOSX__)
71 extern ModPlugFile* ModPlug_Load(const void* data, int size) __attribute__((weak_import));
72 if (ModPlug_Load == NULL)
73 {
74 /* Missing weakly linked framework */
75 Mix_SetError("Missing modplug.framework");
76 return -1;
77 }
78 #endif
79 FUNCTION_LOADER(ModPlug_Load, ModPlugFile* (*)(const void* data, int size))
80 FUNCTION_LOADER(ModPlug_Unload, void (*)(ModPlugFile* file))
81 FUNCTION_LOADER(ModPlug_Read, int (*)(ModPlugFile* file, void* buffer, int size))
82 FUNCTION_LOADER(ModPlug_Seek, void (*)(ModPlugFile* file, int millisecond))
83 FUNCTION_LOADER(ModPlug_GetSettings, void (*)(ModPlug_Settings* settings))
84 FUNCTION_LOADER(ModPlug_SetSettings, void (*)(const ModPlug_Settings* settings))
85 FUNCTION_LOADER(ModPlug_SetMasterVolume, void (*)(ModPlugFile* file,unsigned int cvol))
86 }
87 ++modplug.loaded;
88
89 return 0;
90 }
91
92 static void MODPLUG_Unload(void)
93 {
94 if (modplug.loaded == 0) {
95 return;
96 }
97 if (modplug.loaded == 1) {
98 #ifdef MODPLUG_DYNAMIC
99 SDL_UnloadObject(modplug.handle);
100 #endif
101 }
102 --modplug.loaded;
103 }
104
105
106 typedef struct
107 {
108 int play_count;
109 ModPlugFile *file;
110 SDL_AudioStream *stream;
111 void *buffer;
112 int buffer_size;
113 } MODPLUG_Music;
114
115
116 static int MODPLUG_Seek(void *context, double position);
117 static void MODPLUG_Delete(void *context);
118
119 static int MODPLUG_Open(const SDL_AudioSpec *spec)
120 {
121 /* ModPlug supports U8 or S16 audio output */
38122 modplug.ModPlug_GetSettings(&settings);
39 settings.mFlags=MODPLUG_ENABLE_OVERSAMPLING;
40 current_output_channels=spec->channels;
41 settings.mChannels=spec->channels>1?2:1;
42 settings.mBits=spec->format&0xFF;
43
44 music_swap8 = 0;
45 music_swap16 = 0;
46
47 switch(spec->format)
48 {
49 case AUDIO_U8:
50 case AUDIO_S8: {
51 if ( spec->format == AUDIO_S8 ) {
52 music_swap8 = 1;
53 }
54 settings.mBits=8;
55 }
56 break;
57
58 case AUDIO_S16LSB:
59 case AUDIO_S16MSB: {
60 /* See if we need to correct MikMod mixing */
61 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
62 if ( spec->format == AUDIO_S16MSB ) {
63 #else
64 if ( spec->format == AUDIO_S16LSB ) {
65 #endif
66 music_swap16 = 1;
67 }
68 settings.mBits=16;
69 }
70 break;
71
72 default: {
73 Mix_SetError("Unknown hardware audio format");
74 return -1;
75 }
76
77 }
78
79 settings.mFrequency=spec->freq; /*TODO: limit to 11025, 22050, or 44100 ? */
80 settings.mResamplingMode=MODPLUG_RESAMPLE_FIR;
81 settings.mReverbDepth=0;
82 settings.mReverbDelay=100;
83 settings.mBassAmount=0;
84 settings.mBassRange=50;
85 settings.mSurroundDepth=0;
86 settings.mSurroundDelay=10;
87 settings.mLoopCount=0;
123 settings.mFlags = MODPLUG_ENABLE_OVERSAMPLING;
124 if (spec->channels == 1) {
125 settings.mChannels = 1;
126 } else {
127 settings.mChannels = 2;
128 }
129 if (SDL_AUDIO_BITSIZE(spec->format) == 8) {
130 settings.mBits = 8;
131 } else {
132 settings.mBits = 16;
133 }
134 if (spec->freq >= 44100) {
135 settings.mFrequency = 44100;
136 } else if (spec->freq >= 22050) {
137 settings.mFrequency = 22050;
138 } else {
139 settings.mFrequency = 11025;
140 }
141 settings.mResamplingMode = MODPLUG_RESAMPLE_FIR;
142 settings.mReverbDepth = 0;
143 settings.mReverbDelay = 100;
144 settings.mBassAmount = 0;
145 settings.mBassRange = 50;
146 settings.mSurroundDepth = 0;
147 settings.mSurroundDelay = 10;
148 settings.mLoopCount = 0;
88149 modplug.ModPlug_SetSettings(&settings);
89150 return 0;
90151 }
91152
92 /* Uninitialize the music players */
93 void modplug_exit()
94 {
153 /* Load a modplug stream from an SDL_RWops object */
154 void *MODPLUG_CreateFromRW(SDL_RWops *src, int freesrc)
155 {
156 MODPLUG_Music *music;
157 void *buffer;
158 size_t size;
159
160 music = (MODPLUG_Music *)SDL_calloc(1, sizeof(*music));
161 if (!music) {
162 SDL_OutOfMemory();
163 return NULL;
164 }
165
166 music->stream = SDL_NewAudioStream((settings.mBits == 8) ? AUDIO_U8 : AUDIO_S16SYS, settings.mChannels, settings.mFrequency,
167 music_spec.format, music_spec.channels, music_spec.freq);
168 if (!music->stream) {
169 MODPLUG_Delete(music);
170 return NULL;
171 }
172
173 music->buffer_size = music_spec.samples * (settings.mBits / 8) * settings.mChannels;
174 music->buffer = SDL_malloc(music->buffer_size);
175 if (!music->buffer) {
176 MODPLUG_Delete(music);
177 return NULL;
178 }
179
180 buffer = SDL_LoadFile_RW(src, &size, SDL_FALSE);
181 if (buffer) {
182 music->file = modplug.ModPlug_Load(buffer, (int)size);
183 if (!music->file) {
184 Mix_SetError("ModPlug_Load failed");
185 }
186 SDL_free(buffer);
187 }
188
189 if (!music->file) {
190 MODPLUG_Delete(music);
191 return NULL;
192 }
193
194 if (freesrc) {
195 SDL_RWclose(src);
196 }
197 return music;
95198 }
96199
97200 /* Set the volume for a modplug stream */
98 void modplug_setvolume(modplug_data *music, int volume)
99 {
201 static void MODPLUG_SetVolume(void *context, int volume)
202 {
203 MODPLUG_Music *music = (MODPLUG_Music *)context;
100204 modplug.ModPlug_SetMasterVolume(music->file, volume*4);
101205 }
102206
103 /* Load a modplug stream from an SDL_RWops object */
104 modplug_data *modplug_new_RW(SDL_RWops *src, int freesrc)
105 {
106 modplug_data *music = NULL;
107 Sint64 offset;
108 size_t sz;
109 char *buf;
110
111 /* Make sure the modplug library is loaded */
112 if ( !Mix_Init(MIX_INIT_MODPLUG) ) {
113 return NULL;
114 }
115
116 offset = SDL_RWtell(src);
117 SDL_RWseek(src, 0, RW_SEEK_END);
118 sz = (size_t)(SDL_RWtell(src) - offset);
119 SDL_RWseek(src, offset, RW_SEEK_SET);
120 buf = (char*)SDL_malloc(sz);
121 if (buf) {
122 if (SDL_RWread(src, buf, sz, 1) == 1) {
123 music = (modplug_data*)SDL_malloc(sizeof(modplug_data));
124 if (music) {
125 music->playing = 0;
126 music->file = modplug.ModPlug_Load(buf, sz);
127 if (!music->file) {
128 SDL_free(music);
129 music = NULL;
130 }
131 } else {
132 SDL_OutOfMemory();
207 /* Start playback of a given modplug stream */
208 static int MODPLUG_Play(void *context, int play_count)
209 {
210 MODPLUG_Music *music = (MODPLUG_Music *)context;
211 music->play_count = play_count;
212 return MODPLUG_Seek(music, 0.0);
213 }
214
215 /* Play some of a stream previously started with modplug_play() */
216 static int MODPLUG_GetSome(void *context, void *data, int bytes, SDL_bool *done)
217 {
218 MODPLUG_Music *music = (MODPLUG_Music *)context;
219 int filled, amount;
220
221 filled = SDL_AudioStreamGet(music->stream, data, bytes);
222 if (filled != 0) {
223 return filled;
224 }
225
226 if (!music->play_count) {
227 /* All done */
228 *done = SDL_TRUE;
229 return 0;
230 }
231
232 amount = modplug.ModPlug_Read(music->file, music->buffer, music->buffer_size);
233 if (amount > 0) {
234 if (SDL_AudioStreamPut(music->stream, music->buffer, amount) < 0) {
235 return -1;
236 }
237 } else {
238 if (music->play_count == 1) {
239 music->play_count = 0;
240 SDL_AudioStreamFlush(music->stream);
241 } else {
242 int play_count = -1;
243 if (music->play_count > 0) {
244 play_count = (music->play_count - 1);
133245 }
134 }
135 SDL_free(buf);
136 } else {
137 SDL_OutOfMemory();
138 }
139 if (music && freesrc) {
140 SDL_RWclose(src);
141 }
142 return music;
143 }
144
145 /* Start playback of a given modplug stream */
146 void modplug_play(modplug_data *music)
147 {
148 modplug.ModPlug_Seek(music->file,0);
149 music->playing=1;
150 }
151
152 /* Return non-zero if a stream is currently playing */
153 int modplug_playing(modplug_data *music)
154 {
155 return music && music->playing;
156 }
157
158 /* Play some of a stream previously started with modplug_play() */
159 int modplug_playAudio(modplug_data *music, Uint8 *stream, int len)
160 {
161 if (current_output_channels > 2) {
162 int small_len = 2 * len / current_output_channels;
163 int i;
164 Uint8 *src, *dst;
165
166 i=modplug.ModPlug_Read(music->file, stream, small_len);
167 if(i<small_len)
168 {
169 SDL_memset(stream+i,0,small_len-i);
170 music->playing=0;
171 }
172 /* and extend to len by copying channels */
173 src = stream + small_len;
174 dst = stream + len;
175
176 switch (settings.mBits) {
177 case 8:
178 for ( i=small_len/2; i; --i ) {
179 src -= 2;
180 dst -= current_output_channels;
181 dst[0] = src[0];
182 dst[1] = src[1];
183 dst[2] = src[0];
184 dst[3] = src[1];
185 if (current_output_channels == 6) {
186 dst[4] = src[0];
187 dst[5] = src[1];
188 }
189 }
190 break;
191 case 16:
192 for ( i=small_len/4; i; --i ) {
193 src -= 4;
194 dst -= 2 * current_output_channels;
195 dst[0] = src[0];
196 dst[1] = src[1];
197 dst[2] = src[2];
198 dst[3] = src[3];
199 dst[4] = src[0];
200 dst[5] = src[1];
201 dst[6] = src[2];
202 dst[7] = src[3];
203 if (current_output_channels == 6) {
204 dst[8] = src[0];
205 dst[9] = src[1];
206 dst[10] = src[2];
207 dst[11] = src[3];
208 }
209 }
210 break;
211 }
212 } else {
213 int i=modplug.ModPlug_Read(music->file, stream, len);
214 if(i<len)
215 {
216 SDL_memset(stream+i,0,len-i);
217 music->playing=0;
218 }
219 }
220 if ( music_swap8 ) {
221 Uint8 *dst;
222 int i;
223
224 dst = stream;
225 for ( i=len; i; --i ) {
226 *dst++ ^= 0x80;
227 }
228 } else
229 if ( music_swap16 ) {
230 Uint8 *dst, tmp;
231 int i;
232
233 dst = stream;
234 for ( i=(len/2); i; --i ) {
235 tmp = dst[0];
236 dst[0] = dst[1];
237 dst[1] = tmp;
238 dst += 2;
246 if (MODPLUG_Play(music, play_count) < 0) {
247 return -1;
248 }
239249 }
240250 }
241251 return 0;
242252 }
243
244 /* Stop playback of a stream previously started with modplug_play() */
245 void modplug_stop(modplug_data *music)
246 {
247 music->playing=0;
253 static int MODPLUG_GetAudio(void *context, void *data, int bytes)
254 {
255 return music_pcm_getaudio(context, data, bytes, MIX_MAX_VOLUME, MODPLUG_GetSome);
256 }
257
258 /* Jump (seek) to a given position */
259 static int MODPLUG_Seek(void *context, double position)
260 {
261 MODPLUG_Music *music = (MODPLUG_Music *)context;
262 modplug.ModPlug_Seek(music->file, (int)(position*1000));
263 return 0;
248264 }
249265
250266 /* Close the given modplug stream */
251 void modplug_delete(modplug_data *music)
252 {
253 modplug.ModPlug_Unload(music->file);
267 static void MODPLUG_Delete(void *context)
268 {
269 MODPLUG_Music *music = (MODPLUG_Music *)context;
270 if (music->file) {
271 modplug.ModPlug_Unload(music->file);
272 }
273 if (music->stream) {
274 SDL_FreeAudioStream(music->stream);
275 }
276 if (music->buffer) {
277 SDL_free(music->buffer);
278 }
254279 SDL_free(music);
255280 }
256281
257 /* Jump (seek) to a given position (time is in seconds) */
258 void modplug_jump_to_time(modplug_data *music, double time)
259 {
260 modplug.ModPlug_Seek(music->file,(int)(time*1000));
261 }
262
263 #endif /* MODPLUG_MUSIC */
282 Mix_MusicInterface Mix_MusicInterface_MODPLUG =
283 {
284 "MODPLUG",
285 MIX_MUSIC_MODPLUG,
286 MUS_MOD,
287 SDL_FALSE,
288 SDL_FALSE,
289
290 MODPLUG_Load,
291 MODPLUG_Open,
292 MODPLUG_CreateFromRW,
293 NULL, /* CreateFromFile */
294 MODPLUG_SetVolume,
295 MODPLUG_Play,
296 NULL, /* IsPlaying */
297 MODPLUG_GetAudio,
298 MODPLUG_Seek,
299 NULL, /* Pause */
300 NULL, /* Resume */
301 NULL, /* Stop */
302 MODPLUG_Delete,
303 NULL, /* Close */
304 MODPLUG_Unload,
305 };
306
307 #endif /* MUSIC_MOD_MODPLUG */
308
309 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
1818 3. This notice may not be removed or altered from any source distribution.
1919 */
2020
21 #ifdef MODPLUG_MUSIC
21 /* This file supports playing MOD files with libmodplug */
2222
23 #ifdef MODPLUG_HEADER
24 #include MODPLUG_HEADER
25 #else
26 #include <libmodplug/modplug.h>
27 #endif
28 #include "SDL_rwops.h"
29 #include "SDL_audio.h"
30 #include "SDL_mixer.h"
23 #include "music.h"
3124
32 typedef struct {
33 ModPlugFile *file;
34 int playing;
35 } modplug_data;
25 extern Mix_MusicInterface Mix_MusicInterface_MODPLUG;
3626
37 int modplug_init(SDL_AudioSpec *mixer);
38
39 /* Uninitialize the music players */
40 void modplug_exit(void);
41
42 /* Set the volume for a modplug stream */
43 void modplug_setvolume(modplug_data *music, int volume);
44
45 /* Load a modplug stream from an SDL_RWops object */
46 modplug_data *modplug_new_RW(SDL_RWops *rw, int freerw);
47
48 /* Start playback of a given modplug stream */
49 void modplug_play(modplug_data *music);
50
51 /* Return non-zero if a stream is currently playing */
52 int modplug_playing(modplug_data *music);
53
54 /* Play some of a stream previously started with modplug_play() */
55 int modplug_playAudio(modplug_data *music, Uint8 *stream, int len);
56
57 /* Stop playback of a stream previously started with modplug_play() */
58 void modplug_stop(modplug_data *music);
59
60 /* Close the given modplug stream */
61 void modplug_delete(modplug_data *music);
62
63 /* Jump (seek) to a given position (time is in seconds) */
64 void modplug_jump_to_time(modplug_data *music, double time);
65
66 #endif /* MODPLUG_MUSIC */
27 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* This file supports playing MP3 files with mpg123 */
22
23 #ifdef MUSIC_MP3_MPG123
24
25 #include <stdio.h> // For SEEK_SET
26
27 #include "SDL_assert.h"
28 #include "SDL_loadso.h"
29
30 #include "music_mpg123.h"
31
32 #include <mpg123.h>
33
34
35 typedef struct {
36 int loaded;
37 void *handle;
38
39 int (*mpg123_close)(mpg123_handle *mh);
40 void (*mpg123_delete)(mpg123_handle *mh);
41 void (*mpg123_exit)(void);
42 int (*mpg123_format)( mpg123_handle *mh, long rate, int channels, int encodings );
43 int (*mpg123_format_none)(mpg123_handle *mh);
44 int (*mpg123_getformat)( mpg123_handle *mh, long *rate, int *channels, int *encoding );
45 int (*mpg123_init)(void);
46 mpg123_handle *(*mpg123_new)(const char* decoder, int *error);
47 int (*mpg123_open_handle)(mpg123_handle *mh, void *iohandle);
48 const char* (*mpg123_plain_strerror)(int errcode);
49 void (*mpg123_rates)(const long **list, size_t *number);
50 int (*mpg123_read)(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done );
51 int (*mpg123_replace_reader_handle)( mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*) );
52 off_t (*mpg123_seek)( mpg123_handle *mh, off_t sampleoff, int whence );
53 const char* (*mpg123_strerror)(mpg123_handle *mh);
54 } mpg123_loader;
55
56 static mpg123_loader mpg123 = {
57 0, NULL
58 };
59
60 #ifdef MPG123_DYNAMIC
61 #define FUNCTION_LOADER(FUNC, SIG) \
62 mpg123.FUNC = (SIG) SDL_LoadFunction(mpg123.handle, #FUNC); \
63 if (mpg123.FUNC == NULL) { SDL_UnloadObject(mpg123.handle); return -1; }
64 #else
65 #define FUNCTION_LOADER(FUNC, SIG) \
66 mpg123.FUNC = FUNC;
67 #endif
68
69 static int MPG123_Load(void)
70 {
71 if (mpg123.loaded == 0) {
72 #ifdef MPG123_DYNAMIC
73 mpg123.handle = SDL_LoadObject(MPG123_DYNAMIC);
74 if (mpg123.handle == NULL) {
75 return -1;
76 }
77 #elif defined(__MACOSX__)
78 extern int mpg123_init(void) __attribute__((weak_import));
79 if (mpg123_init == NULL)
80 {
81 /* Missing weakly linked framework */
82 Mix_SetError("Missing mpg123.framework");
83 return -1;
84 }
85 #endif
86 FUNCTION_LOADER(mpg123_close, int (*)(mpg123_handle *mh))
87 FUNCTION_LOADER(mpg123_delete, void (*)(mpg123_handle *mh))
88 FUNCTION_LOADER(mpg123_exit, void (*)(void))
89 FUNCTION_LOADER(mpg123_format, int (*)( mpg123_handle *mh, long rate, int channels, int encodings ))
90 FUNCTION_LOADER(mpg123_format_none, int (*)(mpg123_handle *mh))
91 FUNCTION_LOADER(mpg123_getformat, int (*)( mpg123_handle *mh, long *rate, int *channels, int *encoding ))
92 FUNCTION_LOADER(mpg123_init, int (*)(void))
93 FUNCTION_LOADER(mpg123_new, mpg123_handle *(*)(const char* decoder, int *error))
94 FUNCTION_LOADER(mpg123_open_handle, int (*)(mpg123_handle *mh, void *iohandle))
95 FUNCTION_LOADER(mpg123_plain_strerror, const char* (*)(int errcode))
96 FUNCTION_LOADER(mpg123_rates, void (*)(const long **list, size_t *number));
97 FUNCTION_LOADER(mpg123_read, int (*)(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done ))
98 FUNCTION_LOADER(mpg123_replace_reader_handle, int (*)( mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*) ))
99 FUNCTION_LOADER(mpg123_seek, off_t (*)( mpg123_handle *mh, off_t sampleoff, int whence ))
100 FUNCTION_LOADER(mpg123_strerror, const char* (*)(mpg123_handle *mh))
101 }
102 ++mpg123.loaded;
103
104 return 0;
105 }
106
107 static void MPG123_Unload(void)
108 {
109 if (mpg123.loaded == 0) {
110 return;
111 }
112 if (mpg123.loaded == 1) {
113 #ifdef MPG123_DYNAMIC
114 SDL_UnloadObject(mpg123.handle);
115 #endif
116 }
117 --mpg123.loaded;
118 }
119
120
121 typedef struct
122 {
123 int play_count;
124 SDL_RWops* src;
125 int freesrc;
126 int volume;
127
128 mpg123_handle* handle;
129 SDL_AudioStream *stream;
130 unsigned char *buffer;
131 size_t buffer_size;
132 } MPG123_Music;
133
134
135 static int MPG123_Seek(void *context, double secs);
136 static void MPG123_Delete(void *context);
137
138 static int mpg123_format_to_sdl(int fmt)
139 {
140 switch (fmt)
141 {
142 case MPG123_ENC_SIGNED_8: return AUDIO_S8;
143 case MPG123_ENC_UNSIGNED_8: return AUDIO_U8;
144 case MPG123_ENC_SIGNED_16: return AUDIO_S16SYS;
145 case MPG123_ENC_UNSIGNED_16: return AUDIO_U16SYS;
146 case MPG123_ENC_SIGNED_32: return AUDIO_S32SYS;
147 case MPG123_ENC_FLOAT_32: return AUDIO_F32SYS;
148 default: return -1;
149 }
150 }
151
152 /*
153 static const char *mpg123_format_str(int fmt)
154 {
155 switch (fmt)
156 {
157 #define f(x) case x: return #x;
158 f(MPG123_ENC_UNSIGNED_8)
159 f(MPG123_ENC_UNSIGNED_16)
160 f(MPG123_ENC_SIGNED_8)
161 f(MPG123_ENC_SIGNED_16)
162 f(MPG123_ENC_SIGNED_32)
163 f(MPG123_ENC_FLOAT_32)
164 #undef f
165 }
166 return "unknown";
167 }
168 */
169
170 static char const* mpg_err(mpg123_handle* mpg, int result)
171 {
172 char const* err = "unknown error";
173
174 if (mpg && result == MPG123_ERR) {
175 err = mpg123.mpg123_strerror(mpg);
176 } else {
177 err = mpg123.mpg123_plain_strerror(result);
178 }
179 return err;
180 }
181
182 /* we're gonna override mpg123's I/O with these wrappers for RWops */
183 static ssize_t rwops_read(void* p, void* dst, size_t n)
184 {
185 return (ssize_t)SDL_RWread((SDL_RWops*)p, dst, 1, n);
186 }
187
188 static off_t rwops_seek(void* p, off_t offset, int whence)
189 {
190 return (off_t)SDL_RWseek((SDL_RWops*)p, (Sint64)offset, whence);
191 }
192
193 static void rwops_cleanup(void* p)
194 {
195 (void)p;
196 /* do nothing, we will free the file later */
197 }
198
199
200 static int MPG123_Open(const SDL_AudioSpec *spec)
201 {
202 if (mpg123.mpg123_init() != MPG123_OK) {
203 Mix_SetError("mpg123_init() failed");
204 return -1;
205 }
206 return 0;
207 }
208
209 static void *MPG123_CreateFromRW(SDL_RWops *src, int freesrc)
210 {
211 MPG123_Music *music;
212 int result;
213 const long *rates;
214 size_t i, num_rates;
215
216 music = (MPG123_Music*)SDL_calloc(1, sizeof(*music));
217 if (!music) {
218 return NULL;
219 }
220 music->src = src;
221 music->volume = MIX_MAX_VOLUME;
222
223 /* Just assume 16-bit 2 channel audio for now */
224 music->buffer_size = music_spec.samples * sizeof(Sint16) * 2;
225 music->buffer = (unsigned char *)SDL_malloc(music->buffer_size);
226 if (!music->buffer) {
227 MPG123_Delete(music);
228 SDL_OutOfMemory();
229 return NULL;
230 }
231
232 music->handle = mpg123.mpg123_new(0, &result);
233 if (result != MPG123_OK) {
234 MPG123_Delete(music);
235 Mix_SetError("mpg123_new failed");
236 return NULL;
237 }
238
239 result = mpg123.mpg123_replace_reader_handle(
240 music->handle,
241 rwops_read, rwops_seek, rwops_cleanup
242 );
243 if (result != MPG123_OK) {
244 MPG123_Delete(music);
245 Mix_SetError("mpg123_replace_reader_handle: %s", mpg_err(music->handle, result));
246 return NULL;
247 }
248
249 result = mpg123.mpg123_format_none(music->handle);
250 if (result != MPG123_OK) {
251 MPG123_Delete(music);
252 Mix_SetError("mpg123_format_none: %s", mpg_err(music->handle, result));
253 return NULL;
254 }
255
256 mpg123.mpg123_rates(&rates, &num_rates);
257 for (i = 0; i < num_rates; ++i) {
258 const int channels = (MPG123_MONO|MPG123_STEREO);
259 const int formats = (MPG123_ENC_SIGNED_8 |
260 MPG123_ENC_UNSIGNED_8 |
261 MPG123_ENC_SIGNED_16 |
262 MPG123_ENC_UNSIGNED_16 |
263 MPG123_ENC_SIGNED_32 |
264 MPG123_ENC_FLOAT_32);
265
266 mpg123.mpg123_format(music->handle, rates[i], channels, formats);
267 }
268
269 result = mpg123.mpg123_open_handle(music->handle, music->src);
270 if (result != MPG123_OK) {
271 MPG123_Delete(music);
272 Mix_SetError("mpg123_open_handle: %s", mpg_err(music->handle, result));
273 return NULL;
274 }
275
276 music->freesrc = freesrc;
277 return music;
278 }
279
280 static void MPG123_SetVolume(void *context, int volume)
281 {
282 MPG123_Music *music = (MPG123_Music *)context;
283 music->volume = volume;
284 }
285
286 static int MPG123_Play(void *context, int play_count)
287 {
288 MPG123_Music *music = (MPG123_Music *)context;
289 music->play_count = play_count;
290 return MPG123_Seek(music, 0.0);
291 }
292
293 /* read some mp3 stream data and convert it for output */
294 static int MPG123_GetSome(void *context, void *data, int bytes, SDL_bool *done)
295 {
296 MPG123_Music *music = (MPG123_Music *)context;
297 int filled, result;
298 size_t amount;
299 long rate;
300 int channels, encoding, format;
301
302 if (music->stream) {
303 filled = SDL_AudioStreamGet(music->stream, data, bytes);
304 if (filled != 0) {
305 return filled;
306 }
307 }
308
309 if (!music->play_count) {
310 /* All done */
311 *done = SDL_TRUE;
312 return 0;
313 }
314
315 result = mpg123.mpg123_read(music->handle, music->buffer, music->buffer_size, &amount);
316 switch (result) {
317 case MPG123_OK:
318 if (SDL_AudioStreamPut(music->stream, music->buffer, (int)amount) < 0) {
319 return -1;
320 }
321 break;
322
323 case MPG123_NEW_FORMAT:
324 result = mpg123.mpg123_getformat(music->handle, &rate, &channels, &encoding);
325 if (result != MPG123_OK) {
326 Mix_SetError("mpg123_getformat: %s", mpg_err(music->handle, result));
327 return -1;
328 }
329 /*printf("MPG123 format: %s, channels = %d, rate = %ld\n", mpg123_format_str(encoding), channels, rate);*/
330
331 format = mpg123_format_to_sdl(encoding);
332 SDL_assert(format != -1);
333
334 music->stream = SDL_NewAudioStream(format, channels, (int)rate,
335 music_spec.format, music_spec.channels, music_spec.freq);
336 if (!music->stream) {
337 return -1;
338 }
339 break;
340
341 case MPG123_DONE:
342 if (music->play_count == 1) {
343 music->play_count = 0;
344 SDL_AudioStreamFlush(music->stream);
345 } else {
346 int play_count = -1;
347 if (music->play_count > 0) {
348 play_count = (music->play_count - 1);
349 }
350 if (MPG123_Play(music, play_count) < 0) {
351 return -1;
352 }
353 }
354 break;
355 default:
356 Mix_SetError("mpg123_read: %s", mpg_err(music->handle, result));
357 return -1;
358 }
359 return 0;
360 }
361 static int MPG123_GetAudio(void *context, void *data, int bytes)
362 {
363 MPG123_Music *music = (MPG123_Music *)context;
364 return music_pcm_getaudio(context, data, bytes, music->volume, MPG123_GetSome);
365 }
366
367 static int MPG123_Seek(void *context, double secs)
368 {
369 MPG123_Music *music = (MPG123_Music *)context;
370 off_t offset = (off_t)(music_spec.freq * secs);
371
372 if ((offset = mpg123.mpg123_seek(music->handle, offset, SEEK_SET)) < 0) {
373 return Mix_SetError("mpg123_seek: %s", mpg_err(music->handle, (int)-offset));
374 }
375 return 0;
376 }
377
378 static void MPG123_Delete(void *context)
379 {
380 MPG123_Music *music = (MPG123_Music *)context;
381
382 if (music->handle) {
383 mpg123.mpg123_close(music->handle);
384 mpg123.mpg123_delete(music->handle);
385 }
386 if (music->stream) {
387 SDL_FreeAudioStream(music->stream);
388 }
389 if (music->buffer) {
390 SDL_free(music->buffer);
391 }
392 if (music->freesrc) {
393 SDL_RWclose(music->src);
394 }
395 SDL_free(music);
396 }
397
398 static void MPG123_Close(void)
399 {
400 mpg123.mpg123_exit();
401 }
402
403 Mix_MusicInterface Mix_MusicInterface_MPG123 =
404 {
405 "MPG123",
406 MIX_MUSIC_MPG123,
407 MUS_MP3,
408 SDL_FALSE,
409 SDL_FALSE,
410
411 MPG123_Load,
412 MPG123_Open,
413 MPG123_CreateFromRW,
414 NULL, /* CreateFromFile */
415 MPG123_SetVolume,
416 MPG123_Play,
417 NULL, /* IsPlaying */
418 MPG123_GetAudio,
419 MPG123_Seek,
420 NULL, /* Pause */
421 NULL, /* Resume */
422 NULL, /* Stop */
423 MPG123_Delete,
424 MPG123_Close,
425 MPG123_Unload
426 };
427
428 #endif /* MUSIC_MP3_MPG123 */
429
430 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* This file supports playing MP3 files with mpg123 */
22
23 #include "music.h"
24
25 extern Mix_MusicInterface Mix_MusicInterface_MPG123;
26
27 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef MUSIC_MID_NATIVE
22
23 /* This file supports playing MIDI files with OS APIs */
24
25 #include "music_nativemidi.h"
26 #include "native_midi/native_midi.h"
27
28
29 static void *NATIVEMIDI_CreateFromRW(SDL_RWops *src, int freesrc)
30 {
31 NativeMidiSong *music = native_midi_loadsong_RW(src, freesrc);
32 if (!music) {
33 Mix_SetError("%s", native_midi_error());
34 }
35 return music;
36 }
37
38 static int NATIVEMIDI_Play(void *context, int play_count)
39 {
40 NativeMidiSong *music = (NativeMidiSong *)context;
41 int loops = play_count;
42 if (loops > 0) {
43 --loops;
44 }
45 native_midi_start(music, loops);
46 return 0;
47 }
48
49 static void NATIVEMIDI_SetVolume(void *context, int volume)
50 {
51 native_midi_setvolume(volume);
52 }
53
54 static SDL_bool NATIVEMIDI_IsPlaying(void *context)
55 {
56 return native_midi_active() ? SDL_TRUE : SDL_FALSE;
57 }
58
59 static void NATIVEMIDI_Pause(void *context)
60 {
61 native_midi_pause();
62 }
63
64 static void NATIVEMIDI_Resume(void *context)
65 {
66 native_midi_resume();
67 }
68
69 static void NATIVEMIDI_Stop(void *context)
70 {
71 native_midi_stop();
72 }
73
74 static void NATIVEMIDI_Delete(void *context)
75 {
76 NativeMidiSong *music = (NativeMidiSong *)context;
77 native_midi_freesong(music);
78 }
79
80 Mix_MusicInterface Mix_MusicInterface_NATIVEMIDI =
81 {
82 "NATIVEMIDI",
83 MIX_MUSIC_NATIVEMIDI,
84 MUS_MID,
85 SDL_FALSE,
86 SDL_FALSE,
87
88 NULL, /* Load */
89 NULL, /* Open */
90 NATIVEMIDI_CreateFromRW,
91 NULL, /* CreateFromFile */
92 NATIVEMIDI_SetVolume,
93 NATIVEMIDI_Play,
94 NATIVEMIDI_IsPlaying,
95 NULL, /* GetAudio */
96 NULL, /* Seek */
97 NATIVEMIDI_Pause,
98 NATIVEMIDI_Resume,
99 NATIVEMIDI_Stop,
100 NATIVEMIDI_Delete,
101 NULL, /* Close */
102 NULL, /* Unload */
103 };
104
105 #endif /* MUSIC_MID_NATIVE */
106
107 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* This file supports playing MIDI files with OS APIs */
22
23 #include "music.h"
24
25 extern Mix_MusicInterface Mix_MusicInterface_NATIVEMIDI;
26
27 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
1818 3. This notice may not be removed or altered from any source distribution.
1919 */
2020
21 /* $Id$ */
22
23 #ifdef OGG_MUSIC
21 #ifdef MUSIC_OGG
2422
2523 /* This file supports Ogg Vorbis music streams */
2624
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30
31 #include "SDL_mixer.h"
32 #include "dynamic_ogg.h"
25 #include "SDL_loadso.h"
26
3327 #include "music_ogg.h"
3428
35 /* This is the format of the audio mixer data */
36 static SDL_AudioSpec mixer;
37
38 /* Initialize the Ogg Vorbis player, with the given mixer settings
39 This function returns 0, or -1 if there was an error.
40 */
41 int OGG_init(SDL_AudioSpec *mixerfmt)
42 {
43 mixer = *mixerfmt;
44 return(0);
45 }
46
47 /* Set the volume for an OGG stream */
48 void OGG_setvolume(OGG_music *music, int volume)
49 {
50 music->volume = volume;
29 #if defined(OGG_HEADER)
30 #include OGG_HEADER
31 #elif defined(OGG_USE_TREMOR)
32 #include <tremor/ivorbisfile.h>
33 #else
34 #include <vorbis/vorbisfile.h>
35 #endif
36
37 typedef struct {
38 int loaded;
39 void *handle;
40 int (*ov_clear)(OggVorbis_File *vf);
41 vorbis_info *(*ov_info)(OggVorbis_File *vf,int link);
42 vorbis_comment *(*ov_comment)(OggVorbis_File *vf,int link);
43 int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks);
44 ogg_int64_t (*ov_pcm_total)(OggVorbis_File *vf,int i);
45 #ifdef OGG_USE_TREMOR
46 long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int *bitstream);
47 #else
48 long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int bigendianp,int word,int sgned,int *bitstream);
49 #endif
50 #ifdef OGG_USE_TREMOR
51 int (*ov_time_seek)(OggVorbis_File *vf,ogg_int64_t pos);
52 #else
53 int (*ov_time_seek)(OggVorbis_File *vf,double pos);
54 #endif
55 int (*ov_pcm_seek)(OggVorbis_File *vf, ogg_int64_t pos);
56 ogg_int64_t (*ov_pcm_tell)(OggVorbis_File *vf);
57 } vorbis_loader;
58
59 static vorbis_loader vorbis = {
60 0, NULL
61 };
62
63 #ifdef OGG_DYNAMIC
64 #define FUNCTION_LOADER(FUNC, SIG) \
65 vorbis.FUNC = (SIG) SDL_LoadFunction(vorbis.handle, #FUNC); \
66 if (vorbis.FUNC == NULL) { SDL_UnloadObject(vorbis.handle); return -1; }
67 #else
68 #define FUNCTION_LOADER(FUNC, SIG) \
69 vorbis.FUNC = FUNC;
70 #endif
71
72 static int OGG_Load(void)
73 {
74 if (vorbis.loaded == 0) {
75 #ifdef OGG_DYNAMIC
76 vorbis.handle = SDL_LoadObject(OGG_DYNAMIC);
77 if (vorbis.handle == NULL) {
78 return -1;
79 }
80 #elif defined(__MACOSX__)
81 extern int ov_open_callbacks(void*, OggVorbis_File*, const char*, long, ov_callbacks) __attribute__((weak_import));
82 if (ov_open_callbacks == NULL)
83 {
84 /* Missing weakly linked framework */
85 Mix_SetError("Missing Vorbis.framework");
86 return -1;
87 }
88 #endif
89 FUNCTION_LOADER(ov_clear, int (*)(OggVorbis_File *))
90 FUNCTION_LOADER(ov_info, vorbis_info *(*)(OggVorbis_File *,int))
91 FUNCTION_LOADER(ov_comment, vorbis_comment *(*)(OggVorbis_File *,int))
92 FUNCTION_LOADER(ov_open_callbacks, int (*)(void *, OggVorbis_File *, const char *, long, ov_callbacks))
93 FUNCTION_LOADER(ov_pcm_total, ogg_int64_t (*)(OggVorbis_File *,int))
94 #ifdef OGG_USE_TREMOR
95 FUNCTION_LOADER(ov_read, long (*)(OggVorbis_File *,char *,int,int *))
96 FUNCTION_LOADER(ov_time_seek, long (*)(OggVorbis_File *,ogg_int64_t))
97 #else
98 FUNCTION_LOADER(ov_read, long (*)(OggVorbis_File *,char *,int,int,int,int,int *))
99 FUNCTION_LOADER(ov_time_seek, int (*)(OggVorbis_File *,double))
100 #endif
101 FUNCTION_LOADER(ov_pcm_seek, int (*)(OggVorbis_File *,ogg_int64_t))
102 FUNCTION_LOADER(ov_pcm_tell, ogg_int64_t (*)(OggVorbis_File *))
103 }
104 ++vorbis.loaded;
105
106 return 0;
107 }
108
109 static void OGG_Unload(void)
110 {
111 if (vorbis.loaded == 0) {
112 return;
113 }
114 if (vorbis.loaded == 1) {
115 #ifdef OGG_DYNAMIC
116 SDL_UnloadObject(vorbis.handle);
117 #endif
118 }
119 --vorbis.loaded;
120 }
121
122
123 typedef struct {
124 SDL_RWops *src;
125 int freesrc;
126 int play_count;
127 int volume;
128 OggVorbis_File vf;
129 vorbis_info vi;
130 int section;
131 SDL_AudioStream *stream;
132 char *buffer;
133 int buffer_size;
134 int loop;
135 ogg_int64_t loop_start;
136 ogg_int64_t loop_end;
137 ogg_int64_t loop_len;
138 ogg_int64_t channels;
139 } OGG_music;
140
141
142 static int set_ov_error(const char *function, int error)
143 {
144 #define HANDLE_ERROR_CASE(X) case X: Mix_SetError("%s: %s", function, #X); break;
145 switch (error) {
146 HANDLE_ERROR_CASE(OV_FALSE);
147 HANDLE_ERROR_CASE(OV_EOF);
148 HANDLE_ERROR_CASE(OV_HOLE);
149 HANDLE_ERROR_CASE(OV_EREAD);
150 HANDLE_ERROR_CASE(OV_EFAULT);
151 HANDLE_ERROR_CASE(OV_EIMPL);
152 HANDLE_ERROR_CASE(OV_EINVAL);
153 HANDLE_ERROR_CASE(OV_ENOTVORBIS);
154 HANDLE_ERROR_CASE(OV_EBADHEADER);
155 HANDLE_ERROR_CASE(OV_EVERSION);
156 HANDLE_ERROR_CASE(OV_ENOTAUDIO);
157 HANDLE_ERROR_CASE(OV_EBADPACKET);
158 HANDLE_ERROR_CASE(OV_EBADLINK);
159 HANDLE_ERROR_CASE(OV_ENOSEEK);
160 default:
161 Mix_SetError("%s: unknown error %d\n", function, error);
162 break;
163 }
164 return -1;
51165 }
52166
53167 static size_t sdl_read_func(void *ptr, size_t size, size_t nmemb, void *datasource)
65179 return (long)SDL_RWtell((SDL_RWops*)datasource);
66180 }
67181
182 static int OGG_Seek(void *context, double time);
183 static void OGG_Delete(void *context);
184
185 static int OGG_UpdateSection(OGG_music *music)
186 {
187 vorbis_info *vi;
188
189 vi = vorbis.ov_info(&music->vf, -1);
190 if (!vi) {
191 Mix_SetError("ov_info returned NULL");
192 return -1;
193 }
194
195 if (vi->channels == music->vi.channels && vi->rate == music->vi.rate) {
196 return 0;
197 }
198 SDL_memcpy(&music->vi, vi, sizeof(*vi));
199
200 if (music->buffer) {
201 SDL_free(music->buffer);
202 music->buffer = NULL;
203 }
204
205 if (music->stream) {
206 SDL_FreeAudioStream(music->stream);
207 music->stream = NULL;
208 }
209
210 music->stream = SDL_NewAudioStream(AUDIO_S16, vi->channels, (int)vi->rate,
211 music_spec.format, music_spec.channels, music_spec.freq);
212 if (!music->stream) {
213 return -1;
214 }
215
216 music->buffer_size = music_spec.samples * sizeof(Sint16) * vi->channels;
217 music->buffer = (char *)SDL_malloc(music->buffer_size);
218 if (!music->buffer) {
219 return -1;
220 }
221 return 0;
222 }
223
68224 /* Load an OGG stream from an SDL_RWops object */
69 OGG_music *OGG_new_RW(SDL_RWops *src, int freesrc)
225 static void *OGG_CreateFromRW(SDL_RWops *src, int freesrc)
70226 {
71227 OGG_music *music;
72228 ov_callbacks callbacks;
73
74 if ( !Mix_Init(MIX_INIT_OGG) ) {
75 return(NULL);
76 }
77
78 SDL_memset(&callbacks, 0, sizeof(callbacks));
229 vorbis_comment *vc;
230 int isLoopLength = 0, i;
231 ogg_int64_t fullLength;
232
233 music = (OGG_music *)SDL_calloc(1, sizeof *music);
234 if (!music) {
235 SDL_OutOfMemory();
236 return NULL;
237 }
238 music->src = src;
239 music->volume = MIX_MAX_VOLUME;
240 music->section = -1;
241 music->loop = -1;
242 music->loop_start = -1;
243 music->loop_end = 0;
244 music->loop_len = 0;
245
246 SDL_zero(callbacks);
79247 callbacks.read_func = sdl_read_func;
80248 callbacks.seek_func = sdl_seek_func;
81249 callbacks.tell_func = sdl_tell_func;
82250
83 music = (OGG_music *)SDL_malloc(sizeof *music);
84 if ( music ) {
85 /* Initialize the music structure */
86 SDL_memset(music, 0, (sizeof *music));
87 music->src = src;
88 music->freesrc = freesrc;
89 OGG_stop(music);
90 OGG_setvolume(music, MIX_MAX_VOLUME);
91 music->section = -1;
92
93 if ( vorbis.ov_open_callbacks(src, &music->vf, NULL, 0, callbacks) < 0 ) {
94 SDL_SetError("Not an Ogg Vorbis audio stream");
95 SDL_free(music);
96 return(NULL);
97 }
251 if (vorbis.ov_open_callbacks(src, &music->vf, NULL, 0, callbacks) < 0) {
252 SDL_SetError("Not an Ogg Vorbis audio stream");
253 SDL_free(music);
254 return NULL;
255 }
256
257 if (OGG_UpdateSection(music) < 0) {
258 OGG_Delete(music);
259 return NULL;
260 }
261
262 vc = vorbis.ov_comment(&music->vf, -1);
263 for (i = 0; i < vc->comments; i++) {
264 char *param = SDL_strdup(vc->user_comments[i]);
265 char *argument = param;
266 char *value = SDL_strchr(param, '=');
267 if (value == NULL) {
268 value = param + SDL_strlen(param);
269 } else {
270 *(value++) = '\0';
271 }
272
273 if (SDL_strcasecmp(argument, "LOOPSTART") == 0)
274 music->loop_start = SDL_strtoull(value, NULL, 0);
275 else if (SDL_strcasecmp(argument, "LOOPLENGTH") == 0) {
276 music->loop_len = SDL_strtoull(value, NULL, 0);
277 isLoopLength = 1;
278 } else if (SDL_strcasecmp(argument, "LOOPEND") == 0) {
279 isLoopLength = 0;
280 music->loop_end = SDL_strtoull(value, NULL, 0);
281 }
282 SDL_free(param);
283 }
284
285 if (isLoopLength == 1) {
286 music->loop_end = music->loop_start + music->loop_len;
98287 } else {
99 SDL_OutOfMemory();
100 return(NULL);
101 }
102 return(music);
288 music->loop_len = music->loop_end - music->loop_start;
289 }
290
291 fullLength = vorbis.ov_pcm_total(&music->vf, -1);
292 if (((music->loop_start >= 0) || (music->loop_end > 0)) &&
293 ((music->loop_start < music->loop_end) || (music->loop_end == 0)) &&
294 (music->loop_start < fullLength) &&
295 (music->loop_end <= fullLength)) {
296 if (music->loop_start < 0) music->loop_start = 0;
297 if (music->loop_end == 0) music->loop_end = fullLength;
298 music->loop = 1;
299 }
300
301 music->freesrc = freesrc;
302 return music;
303 }
304
305 /* Set the volume for an OGG stream */
306 static void OGG_SetVolume(void *context, int volume)
307 {
308 OGG_music *music = (OGG_music *)context;
309 music->volume = volume;
103310 }
104311
105312 /* Start playback of a given OGG stream */
106 void OGG_play(OGG_music *music)
107 {
108 music->playing = 1;
109 }
110
111 /* Return non-zero if a stream is currently playing */
112 int OGG_playing(OGG_music *music)
113 {
114 return(music->playing);
115 }
116
117 /* Read some Ogg stream data and convert it for output */
118 static void OGG_getsome(OGG_music *music)
119 {
313 static int OGG_Play(void *context, int play_count)
314 {
315 OGG_music *music = (OGG_music *)context;
316 music->play_count = play_count;
317 return OGG_Seek(music, 0.0);
318 }
319
320 /* Play some of a stream previously started with OGG_play() */
321 static int OGG_GetSome(void *context, void *data, int bytes, SDL_bool *done)
322 {
323 OGG_music *music = (OGG_music *)context;
324 SDL_bool looped = SDL_FALSE;
325 int filled, amount, result;
120326 int section;
121 int len;
122 char data[4096];
123 SDL_AudioCVT *cvt;
124
327 ogg_int64_t pcmPos;
328
329 filled = SDL_AudioStreamGet(music->stream, data, bytes);
330 if (filled != 0) {
331 return filled;
332 }
333
334 if (!music->play_count) {
335 /* All done */
336 *done = SDL_TRUE;
337 return 0;
338 }
339
340 section = music->section;
125341 #ifdef OGG_USE_TREMOR
126 len = vorbis.ov_read(&music->vf, data, sizeof(data), &section);
127 #else
128 len = vorbis.ov_read(&music->vf, data, sizeof(data), 0, 2, 1, &section);
129 #endif
130 if ( len <= 0 ) {
131 if ( len == 0 ) {
132 music->playing = 0;
133 }
134 return;
135 }
136 cvt = &music->cvt;
137 if ( section != music->section ) {
138 vorbis_info *vi;
139
140 vi = vorbis.ov_info(&music->vf, -1);
141 SDL_BuildAudioCVT(cvt, AUDIO_S16, vi->channels, vi->rate,
142 mixer.format,mixer.channels,mixer.freq);
143 if ( cvt->buf ) {
144 SDL_free(cvt->buf);
145 }
146 cvt->buf = (Uint8 *)SDL_malloc(sizeof(data)*cvt->len_mult);
342 amount = vorbis.ov_read(&music->vf, music->buffer, music->buffer_size, &section);
343 #else
344 amount = (int)vorbis.ov_read(&music->vf, music->buffer, music->buffer_size, 0, 2, 1, &section);
345 #endif
346 if (amount < 0) {
347 set_ov_error("ov_read", amount);
348 return -1;
349 }
350
351 if (section != music->section) {
147352 music->section = section;
148 }
149 if ( cvt->buf ) {
150 SDL_memcpy(cvt->buf, data, len);
151 if ( cvt->needed ) {
152 cvt->len = len;
153 SDL_ConvertAudio(cvt);
353 if (OGG_UpdateSection(music) < 0) {
354 return -1;
355 }
356 }
357
358 pcmPos = vorbis.ov_pcm_tell(&music->vf);
359 if ((music->loop == 1) && (pcmPos >= music->loop_end)) {
360 amount -= (int)((pcmPos - music->loop_end) * music->channels) * sizeof(Sint16);
361 result = vorbis.ov_pcm_seek(&music->vf, music->loop_start);
362 if (result < 0) {
363 set_ov_error("ov_pcm_seek", result);
364 return -1;
365 }
366 looped = SDL_TRUE;
367 }
368
369 if (amount > 0) {
370 if (SDL_AudioStreamPut(music->stream, music->buffer, amount) < 0) {
371 return -1;
372 }
373 } else if (!looped) {
374 if (music->play_count == 1) {
375 music->play_count = 0;
376 SDL_AudioStreamFlush(music->stream);
154377 } else {
155 cvt->len_cvt = len;
156 }
157 music->len_available = music->cvt.len_cvt;
158 music->snd_available = music->cvt.buf;
159 } else {
160 SDL_SetError("Out of memory");
161 music->playing = 0;
162 }
163 }
164
165 /* Play some of a stream previously started with OGG_play() */
166 int OGG_playAudio(OGG_music *music, Uint8 *snd, int len)
167 {
168 int mixable;
169
170 while ( (len > 0) && music->playing ) {
171 if ( ! music->len_available ) {
172 OGG_getsome(music);
173 }
174 mixable = len;
175 if ( mixable > music->len_available ) {
176 mixable = music->len_available;
177 }
178 if ( music->volume == MIX_MAX_VOLUME ) {
179 SDL_memcpy(snd, music->snd_available, mixable);
180 } else {
181 SDL_MixAudio(snd, music->snd_available, mixable,
182 music->volume);
183 }
184 music->len_available -= mixable;
185 music->snd_available += mixable;
186 len -= mixable;
187 snd += mixable;
188 }
189
190 return len;
191 }
192
193 /* Stop playback of a stream previously started with OGG_play() */
194 void OGG_stop(OGG_music *music)
195 {
196 music->playing = 0;
378 int play_count = -1;
379 if (music->play_count > 0) {
380 play_count = (music->play_count - 1);
381 }
382 if (OGG_Play(music, play_count) < 0) {
383 return -1;
384 }
385 }
386 }
387 return 0;
388 }
389 static int OGG_GetAudio(void *context, void *data, int bytes)
390 {
391 OGG_music *music = (OGG_music *)context;
392 return music_pcm_getaudio(context, data, bytes, music->volume, OGG_GetSome);
393 }
394
395 /* Jump (seek) to a given position (time is in seconds) */
396 static int OGG_Seek(void *context, double time)
397 {
398 OGG_music *music = (OGG_music *)context;
399 int result;
400 #ifdef OGG_USE_TREMOR
401 result = vorbis.ov_time_seek(&music->vf, (ogg_int64_t)(time * 1000.0));
402 #else
403 result = vorbis.ov_time_seek(&music->vf, time);
404 #endif
405 if (result < 0) {
406 return set_ov_error("ov_time_seek", result);
407 }
408 return 0;
197409 }
198410
199411 /* Close the given OGG stream */
200 void OGG_delete(OGG_music *music)
201 {
202 if ( music ) {
203 if ( music->cvt.buf ) {
204 SDL_free(music->cvt.buf);
205 }
206 if ( music->freesrc ) {
207 SDL_RWclose(music->src);
208 }
209 vorbis.ov_clear(&music->vf);
210 SDL_free(music);
211 }
212 }
213
214 /* Jump (seek) to a given position (time is in seconds) */
215 void OGG_jump_to_time(OGG_music *music, double time)
216 {
217 #ifdef OGG_USE_TREMOR
218 vorbis.ov_time_seek( &music->vf, (ogg_int64_t)(time * 1000.0) );
219 #else
220 vorbis.ov_time_seek( &music->vf, time );
221 #endif
222 }
223
224 #endif /* OGG_MUSIC */
412 static void OGG_Delete(void *context)
413 {
414 OGG_music *music = (OGG_music *)context;
415 vorbis.ov_clear(&music->vf);
416 if (music->stream) {
417 SDL_FreeAudioStream(music->stream);
418 }
419 if (music->buffer) {
420 SDL_free(music->buffer);
421 }
422 if (music->freesrc) {
423 SDL_RWclose(music->src);
424 }
425 SDL_free(music);
426 }
427
428 Mix_MusicInterface Mix_MusicInterface_OGG =
429 {
430 "OGG",
431 MIX_MUSIC_OGG,
432 MUS_OGG,
433 SDL_FALSE,
434 SDL_FALSE,
435
436 OGG_Load,
437 NULL, /* Open */
438 OGG_CreateFromRW,
439 NULL, /* CreateFromFile */
440 OGG_SetVolume,
441 OGG_Play,
442 NULL, /* IsPlaying */
443 OGG_GetAudio,
444 OGG_Seek,
445 NULL, /* Pause */
446 NULL, /* Resume */
447 NULL, /* Stop */
448 OGG_Delete,
449 NULL, /* Close */
450 OGG_Unload,
451 };
452
453 #endif /* MUSIC_OGG */
454
455 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
1818 3. This notice may not be removed or altered from any source distribution.
1919 */
2020
21 /* $Id$ */
22
23 #ifdef OGG_MUSIC
24
2521 /* This file supports Ogg Vorbis music streams */
2622
27 #if defined(OGG_HEADER)
28 #include OGG_HEADER
29 #elif defined(OGG_USE_TREMOR)
30 #include <tremor/ivorbisfile.h>
31 #else
32 #include <vorbis/vorbisfile.h>
33 #endif
23 #include "music.h"
3424
35 typedef struct {
36 SDL_RWops *src;
37 int freesrc;
38 int playing;
39 int volume;
40 OggVorbis_File vf;
41 int section;
42 SDL_AudioCVT cvt;
43 int len_available;
44 Uint8 *snd_available;
45 } OGG_music;
25 extern Mix_MusicInterface Mix_MusicInterface_OGG;
4626
47 /* Initialize the Ogg Vorbis player, with the given mixer settings
48 This function returns 0, or -1 if there was an error.
49 */
50 extern int OGG_init(SDL_AudioSpec *mixer);
51
52 /* Set the volume for an OGG stream */
53 extern void OGG_setvolume(OGG_music *music, int volume);
54
55 /* Load an OGG stream from an SDL_RWops object */
56 extern OGG_music *OGG_new_RW(SDL_RWops *src, int freesrc);
57
58 /* Start playback of a given OGG stream */
59 extern void OGG_play(OGG_music *music);
60
61 /* Return non-zero if a stream is currently playing */
62 extern int OGG_playing(OGG_music *music);
63
64 /* Play some of a stream previously started with OGG_play() */
65 extern int OGG_playAudio(OGG_music *music, Uint8 *stream, int len);
66
67 /* Stop playback of a stream previously started with OGG_play() */
68 extern void OGG_stop(OGG_music *music);
69
70 /* Close the given OGG stream */
71 extern void OGG_delete(OGG_music *music);
72
73 /* Jump (seek) to a given position (time is in seconds) */
74 extern void OGG_jump_to_time(OGG_music *music, double time);
75
76 #endif /* OGG_MUSIC */
27 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef MUSIC_MP3_SMPEG
22
23 #include "SDL_loadso.h"
24
25 #include "music_smpeg.h"
26
27 #if SDL_VERSION_ATLEAST(2, 0, 0)
28 /* Forward declaration for SDL 2.0 because struct is not available there but
29 still used in a file included with smpeg.h. May not compile if missing. */
30 typedef struct SDL_Overlay SDL_Overlay;
31 #endif
32
33 #include "smpeg.h"
34
35 typedef struct {
36 int loaded;
37 void *handle;
38 void (*SMPEG_actualSpec)(SMPEG *mpeg, SDL_AudioSpec *spec);
39 void (*SMPEG_delete)(SMPEG* mpeg);
40 void (*SMPEG_enableaudio)(SMPEG* mpeg, int enable);
41 void (*SMPEG_enablevideo)(SMPEG* mpeg, int enable);
42 SMPEG* (*SMPEG_new_rwops)(SDL_RWops *src, SMPEG_Info* info, int freesrc, int sdl_audio);
43 void (*SMPEG_play)(SMPEG* mpeg);
44 int (*SMPEG_playAudio)(SMPEG *mpeg, Uint8 *stream, int len);
45 void (*SMPEG_rewind)(SMPEG* mpeg);
46 void (*SMPEG_setvolume)(SMPEG* mpeg, int volume);
47 void (*SMPEG_skip)(SMPEG* mpeg, float seconds);
48 SMPEGstatus (*SMPEG_status)(SMPEG* mpeg);
49 void (*SMPEG_stop)(SMPEG* mpeg);
50 } smpeg_loader;
51
52 static smpeg_loader smpeg = {
53 0, NULL
54 };
55
56 #ifdef SMPEG_DYNAMIC
57 #define FUNCTION_LOADER(FUNC, SIG) \
58 smpeg.FUNC = (SIG) SDL_LoadFunction(smpeg.handle, #FUNC); \
59 if (smpeg.FUNC == NULL) { SDL_UnloadObject(smpeg.handle); return -1; }
60 #else
61 #define FUNCTION_LOADER(FUNC, SIG) \
62 smpeg.FUNC = FUNC;
63 #endif
64
65 static int SMPEG_Load(void)
66 {
67 if (smpeg.loaded == 0) {
68 #ifdef SMPEG_DYNAMIC
69 smpeg.handle = SDL_LoadObject(SMPEG_DYNAMIC);
70 if (smpeg.handle == NULL) {
71 return -1;
72 }
73 #elif defined(__MACOSX__)
74 extern SMPEG* SMPEG_new_rwops(SDL_RWops*, SMPEG_Info*, int, int) __attribute__((weak_import));
75 if (SMPEG_new_rwops == NULL)
76 {
77 /* Missing weakly linked framework */
78 Mix_SetError("Missing smpeg2.framework");
79 return -1;
80 }
81 #endif
82 FUNCTION_LOADER(SMPEG_actualSpec, void (*)(SMPEG *, SDL_AudioSpec *))
83 FUNCTION_LOADER(SMPEG_delete, void (*)(SMPEG*))
84 FUNCTION_LOADER(SMPEG_enableaudio, void (*)(SMPEG*, int))
85 FUNCTION_LOADER(SMPEG_enablevideo, void (*)(SMPEG*, int))
86 FUNCTION_LOADER(SMPEG_new_rwops, SMPEG* (*)(SDL_RWops *, SMPEG_Info*, int, int))
87 FUNCTION_LOADER(SMPEG_play, void (*)(SMPEG*))
88 FUNCTION_LOADER(SMPEG_playAudio, int (*)(SMPEG *, Uint8 *, int))
89 FUNCTION_LOADER(SMPEG_rewind, void (*)(SMPEG*))
90 FUNCTION_LOADER(SMPEG_setvolume, void (*)(SMPEG*, int))
91 FUNCTION_LOADER(SMPEG_skip, void (*)(SMPEG*, float))
92 FUNCTION_LOADER(SMPEG_status, SMPEGstatus (*)(SMPEG*))
93 FUNCTION_LOADER(SMPEG_stop, void (*)(SMPEG*))
94 }
95 ++smpeg.loaded;
96
97 return 0;
98 }
99
100 static void SMPEG_Unload(void)
101 {
102 if (smpeg.loaded == 0) {
103 return;
104 }
105 if (smpeg.loaded == 1) {
106 #ifdef SMPEG_DYNAMIC
107 SDL_UnloadObject(smpeg.handle);
108 #endif
109 }
110 --smpeg.loaded;
111 }
112
113
114 typedef struct
115 {
116 SMPEG *mp3;
117 SDL_RWops *src;
118 int freesrc;
119 } SMPEG_Music;
120
121 static void *SMPEG_CreateFromRW(SDL_RWops *src, int freesrc)
122 {
123 SMPEG_Music *music;
124 SMPEG_Info info;
125
126 music = (SMPEG_Music *)SDL_calloc(1, sizeof(*music));
127 if (!music) {
128 SDL_OutOfMemory();
129 return NULL;
130 }
131 music->src = src;
132
133 music->mp3 = smpeg.SMPEG_new_rwops(src, &info, SDL_FALSE, 0);
134 if (!info.has_audio) {
135 Mix_SetError("MPEG file does not have any audio stream.");
136 smpeg.SMPEG_delete(music->mp3);
137 SDL_free(music);
138 return NULL;
139 }
140 smpeg.SMPEG_actualSpec(mp3, &music_spec);
141
142 music->freesrc = freesrc;
143 return music;
144 }
145
146 static void SMPEG_SetVolume(void *context, int volume)
147 {
148 SMPEG_Music *music = (SMPEG_Music *)context;
149 smpeg.SMPEG_setvolume(music->mp3,(int)(((float)volume/(float)MIX_MAX_VOLUME)*100.0));
150 }
151
152 static int SMPEG_Play(void *context)
153 {
154 SMPEG_Music *music = (SMPEG_Music *)context;
155 smpeg.SMPEG_enableaudio(music->mp3, 1);
156 smpeg.SMPEG_enablevideo(music->mp3, 0);
157 smpeg.SMPEG_rewind(music->mp3);
158 smpeg.SMPEG_play(music->mp3);
159 return 0;
160 }
161
162 static SDL_bool SMPEG_IsPlaying(void *context)
163 {
164 SMPEG_Music *music = (SMPEG_Music *)context;
165 return smpeg.SMPEG_status(music->mp3) == SMPEG_PLAYING ? SDL_TRUE : SDL_FALSE;
166 }
167
168 static int SMPEG_GetAudio(void *context, void *data, int bytes)
169 {
170 SMPEG_Music *music = (SMPEG_Music *)context;
171 Uint8 *stream = (Uint8 *)data;
172 int len = bytes;
173 int left = (len - smpeg.SMPEG_playAudio(music->mp3, stream, len));
174 if (left > 0) {
175 stream += (len - left);
176 return left;
177 }
178
179 static int SMPEG_Seek(void *context, double position)
180 {
181 SMPEG_Music *music = (SMPEG_Music *)context;
182 smpeg.SMPEG_rewind(music->mp3);
183 smpeg.SMPEG_play(music->mp3);
184 if (position > 0.0) {
185 smpeg.SMPEG_skip(music->mp3, (float)position);
186 }
187 return 0;
188 }
189
190 static void SMPEG_Stop(void *context)
191 {
192 SMPEG_Music *music = (SMPEG_Music *)context;
193 smpeg.SMPEG_stop(music->mp3);
194 }
195
196 static void SMPEG_Delete(void *context)
197 {
198 SMPEG_Music *music = (SMPEG_Music *)context;
199
200 smpeg.SMPEG_delete(music->mp3);
201
202 if (music->freesrc) {
203 SDL_RWclose(music->src);
204 }
205 SDL_free(music);
206 }
207
208 Mix_MusicInterface Mix_MusicInterface_SMPEG =
209 {
210 "SMPEG",
211 MIX_MUSIC_SMPEG,
212 MUS_MP3,
213 SDL_FALSE,
214 SDL_FALSE,
215
216 SMPEG_Load,
217 NULL, /* Open */
218 SMPEG_CreateFromRW,
219 NULL, /* CreateFromFile */
220 SMPEG_SetVolume,
221 SMPEG_Play,
222 SMPEG_IsPlaying,
223 SMPEG_GetAudio,
224 SMPEG_Seek,
225 NULL, /* Pause */
226 NULL, /* Resume */
227 SMPEG_Stop,
228 SMPEG_Delete,
229 NULL, /* Close */
230 SMPEG_Unload,
231 };
232
233 #endif /* MUSIC_MP3_SMPEG */
234
235 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* This file supports playing MP3 files with smpeg */
22
23 #include "music.h"
24
25 extern Mix_MusicInterface Mix_MusicInterface_SMPEG;
26
27 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* This file supports playing MIDI files with timidity */
22
23 #ifdef MUSIC_MID_TIMIDITY
24
25 #include "music_timidity.h"
26
27 #include "timidity/timidity.h"
28
29
30 typedef struct
31 {
32 int play_count;
33 MidiSong *song;
34 SDL_AudioStream *stream;
35 void *buffer;
36 Sint32 buffer_size;
37 } TIMIDITY_Music;
38
39
40 static int TIMIDITY_Seek(void *context, double position);
41 static void TIMIDITY_Delete(void *context);
42
43 static int TIMIDITY_Open(const SDL_AudioSpec *spec)
44 {
45 return Timidity_Init();
46 }
47
48 static void TIMIDITY_Close(void)
49 {
50 Timidity_Exit();
51 }
52
53 void *TIMIDITY_CreateFromRW(SDL_RWops *src, int freesrc)
54 {
55 TIMIDITY_Music *music;
56 SDL_AudioSpec spec;
57 SDL_bool need_stream = SDL_FALSE;
58
59 music = (TIMIDITY_Music *)SDL_calloc(1, sizeof(*music));
60 if (!music) {
61 SDL_OutOfMemory();
62 return NULL;
63 }
64
65 SDL_memcpy(&spec, &music_spec, sizeof(spec));
66 if (spec.channels > 2) {
67 need_stream = SDL_TRUE;
68 spec.channels = 2;
69 }
70 music->song = Timidity_LoadSong(src, &spec);
71 if (!music->song) {
72 TIMIDITY_Delete(music);
73 return NULL;
74 }
75
76 if (need_stream) {
77 music->stream = SDL_NewAudioStream(spec.format, spec.channels, spec.freq,
78 music_spec.format, music_spec.channels, music_spec.freq);
79 if (!music->stream) {
80 TIMIDITY_Delete(music);
81 return NULL;
82 }
83
84 music->buffer_size = spec.samples * (SDL_AUDIO_BITSIZE(spec.format) / 8) * spec.channels;
85 music->buffer = SDL_malloc(music->buffer_size);
86 if (!music->buffer) {
87 SDL_OutOfMemory();
88 TIMIDITY_Delete(music);
89 return NULL;
90 }
91 }
92
93 if (freesrc) {
94 SDL_RWclose(src);
95 }
96 return music;
97 }
98
99 static void TIMIDITY_SetVolume(void *context, int volume)
100 {
101 TIMIDITY_Music *music = (TIMIDITY_Music *)context;
102 Timidity_SetVolume(music->song, volume);
103 }
104
105 static int TIMIDITY_Play(void *context, int play_count)
106 {
107 TIMIDITY_Music *music = (TIMIDITY_Music *)context;
108 music->play_count = play_count;
109 Timidity_Start(music->song);
110 return TIMIDITY_Seek(music, 0.0);
111 }
112
113 static int TIMIDITY_GetSome(void *context, void *data, int bytes, SDL_bool *done)
114 {
115 TIMIDITY_Music *music = (TIMIDITY_Music *)context;
116 int filled, amount, expected;
117
118 if (music->stream) {
119 filled = SDL_AudioStreamGet(music->stream, data, bytes);
120 if (filled != 0) {
121 return filled;
122 }
123 }
124
125 if (!music->play_count) {
126 /* All done */
127 *done = SDL_TRUE;
128 return 0;
129 }
130
131 if (music->stream) {
132 expected = music->buffer_size;
133 amount = Timidity_PlaySome(music->song, music->buffer, music->buffer_size);
134 if (SDL_AudioStreamPut(music->stream, music->buffer, amount) < 0) {
135 return -1;
136 }
137 } else {
138 expected = bytes;
139 amount = Timidity_PlaySome(music->song, data, bytes);
140 }
141
142 if (amount < expected) {
143 if (music->play_count == 1) {
144 /* We didn't consume anything and we're done */
145 music->play_count = 0;
146 } else {
147 int play_count = -1;
148 if (music->play_count > 0) {
149 play_count = (music->play_count - 1);
150 }
151 if (TIMIDITY_Play(music, play_count) < 0) {
152 return -1;
153 }
154 }
155 }
156 if (music->stream) {
157 /* We'll pick it up from the stream next time around */
158 return 0;
159 } else {
160 /* We wrote output data */
161 return amount;
162 }
163 }
164 static int TIMIDITY_GetAudio(void *context, void *data, int bytes)
165 {
166 return music_pcm_getaudio(context, data, bytes, MIX_MAX_VOLUME, TIMIDITY_GetSome);
167 }
168
169 static int TIMIDITY_Seek(void *context, double position)
170 {
171 TIMIDITY_Music *music = (TIMIDITY_Music *)context;
172 Timidity_Seek(music->song, (Uint32)(position * 1000));
173 return 0;
174 }
175
176 static void TIMIDITY_Delete(void *context)
177 {
178 TIMIDITY_Music *music = (TIMIDITY_Music *)context;
179
180 if (music->song) {
181 Timidity_FreeSong(music->song);
182 }
183 if (music->stream) {
184 SDL_FreeAudioStream(music->stream);
185 }
186 if (music->buffer) {
187 SDL_free(music->buffer);
188 }
189 SDL_free(music);
190 }
191
192 Mix_MusicInterface Mix_MusicInterface_TIMIDITY =
193 {
194 "TIMIDITY",
195 MIX_MUSIC_TIMIDITY,
196 MUS_MID,
197 SDL_FALSE,
198 SDL_FALSE,
199
200 NULL, /* Load */
201 TIMIDITY_Open,
202 TIMIDITY_CreateFromRW,
203 NULL, /* CreateFromFile */
204 TIMIDITY_SetVolume,
205 TIMIDITY_Play,
206 NULL, /* IsPlaying */
207 TIMIDITY_GetAudio,
208 TIMIDITY_Seek,
209 NULL, /* Pause */
210 NULL, /* Resume */
211 NULL, /* Stop */
212 TIMIDITY_Delete,
213 TIMIDITY_Close,
214 NULL, /* Unload */
215 };
216
217 #endif /* MUSIC_MID_TIMIDITY */
218
219 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* This file supports playing MIDI files with timidity */
22
23 #include "music.h"
24
25 extern Mix_MusicInterface Mix_MusicInterface_TIMIDITY;
26
27 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 #ifdef MUSIC_WAV
22
23 /* This file supports streaming WAV files */
24
25 #include "music_wav.h"
26
27
28 typedef struct {
29 SDL_bool active;
30 Uint32 start;
31 Uint32 stop;
32 Uint32 initial_play_count;
33 Uint32 current_play_count;
34 } WAVLoopPoint;
35
36 typedef struct {
37 SDL_RWops *src;
38 SDL_bool freesrc;
39 SDL_AudioSpec spec;
40 int volume;
41 int play_count;
42 Sint64 start;
43 Sint64 stop;
44 Uint8 *buffer;
45 SDL_AudioStream *stream;
46 int numloops;
47 WAVLoopPoint *loops;
48 } WAV_Music;
49
50 /*
51 Taken with permission from SDL_wave.h, part of the SDL library,
52 available at: http://www.libsdl.org/
53 and placed under the same license as this mixer library.
54 */
55
56 /* WAVE files are little-endian */
57
58 /*******************************************/
59 /* Define values for Microsoft WAVE format */
60 /*******************************************/
61 #define RIFF 0x46464952 /* "RIFF" */
62 #define WAVE 0x45564157 /* "WAVE" */
63 #define FMT 0x20746D66 /* "fmt " */
64 #define DATA 0x61746164 /* "data" */
65 #define SMPL 0x6c706d73 /* "smpl" */
66 #define PCM_CODE 1
67 #define ADPCM_CODE 2
68 #define WAVE_MONO 1
69 #define WAVE_STEREO 2
70
71 typedef struct {
72 /* Not saved in the chunk we read:
73 Uint32 chunkID;
74 Uint32 chunkLen;
75 */
76 Uint16 encoding;
77 Uint16 channels; /* 1 = mono, 2 = stereo */
78 Uint32 frequency; /* One of 11025, 22050, or 44100 Hz */
79 Uint32 byterate; /* Average bytes per second */
80 Uint16 blockalign; /* Bytes per sample block */
81 Uint16 bitspersample; /* One of 8, 12, 16, or 4 for ADPCM */
82 } WaveFMT;
83
84 typedef struct {
85 Uint32 identifier;
86 Uint32 type;
87 Uint32 start;
88 Uint32 end;
89 Uint32 fraction;
90 Uint32 play_count;
91 } SampleLoop;
92
93 typedef struct {
94 /* Not saved in the chunk we read:
95 Uint32 chunkID;
96 Uint32 chunkLen;
97 */
98 Uint32 manufacturer;
99 Uint32 product;
100 Uint32 sample_period;
101 Uint32 MIDI_unity_note;
102 Uint32 MIDI_pitch_fraction;
103 Uint32 SMTPE_format;
104 Uint32 SMTPE_offset;
105 Uint32 sample_loops;
106 Uint32 sampler_data;
107 SampleLoop loops[1];
108 } SamplerChunk;
109
110 /*********************************************/
111 /* Define values for AIFF (IFF audio) format */
112 /*********************************************/
113 #define FORM 0x4d524f46 /* "FORM" */
114 #define AIFF 0x46464941 /* "AIFF" */
115 #define SSND 0x444e5353 /* "SSND" */
116 #define COMM 0x4d4d4f43 /* "COMM" */
117
118
119 /* Function to load the WAV/AIFF stream */
120 static SDL_bool LoadWAVMusic(WAV_Music *wave);
121 static SDL_bool LoadAIFFMusic(WAV_Music *wave);
122
123 static void WAV_Delete(void *context);
124
125 /* Load a WAV stream from the given RWops object */
126 static void *WAV_CreateFromRW(SDL_RWops *src, int freesrc)
127 {
128 WAV_Music *music;
129 Uint32 magic;
130 SDL_bool loaded = SDL_FALSE;
131
132 music = (WAV_Music *)SDL_calloc(1, sizeof(*music));
133 if (!music) {
134 SDL_OutOfMemory();
135 return NULL;
136 }
137 music->src = src;
138 music->volume = MIX_MAX_VOLUME;
139
140 magic = SDL_ReadLE32(src);
141 if (magic == RIFF || magic == WAVE) {
142 loaded = LoadWAVMusic(music);
143 } else if (magic == FORM) {
144 loaded = LoadAIFFMusic(music);
145 } else {
146 Mix_SetError("Unknown WAVE format");
147 }
148 if (!loaded) {
149 SDL_free(music);
150 return NULL;
151 }
152 music->buffer = (Uint8*)SDL_malloc(music->spec.size);
153 if (!music->buffer) {
154 WAV_Delete(music);
155 return NULL;
156 }
157 music->stream = SDL_NewAudioStream(
158 music->spec.format, music->spec.channels, music->spec.freq,
159 music_spec.format, music_spec.channels, music_spec.freq);
160 if (!music->stream) {
161 WAV_Delete(music);
162 return NULL;
163 }
164
165 music->freesrc = freesrc;
166 return music;
167 }
168
169 static void WAV_SetVolume(void *context, int volume)
170 {
171 WAV_Music *music = (WAV_Music *)context;
172 music->volume = volume;
173 }
174
175 /* Start playback of a given WAV stream */
176 static int WAV_Play(void *context, int play_count)
177 {
178 WAV_Music *music = (WAV_Music *)context;
179 int i;
180 for (i = 0; i < music->numloops; ++i) {
181 WAVLoopPoint *loop = &music->loops[i];
182 loop->active = SDL_TRUE;
183 loop->current_play_count = loop->initial_play_count;
184 }
185 music->play_count = play_count;
186 if (SDL_RWseek(music->src, music->start, RW_SEEK_SET) < 0) {
187 return -1;
188 }
189 return 0;
190 }
191
192 /* Play some of a stream previously started with WAV_Play() */
193 static int WAV_GetSome(void *context, void *data, int bytes, SDL_bool *done)
194 {
195 WAV_Music *music = (WAV_Music *)context;
196 Sint64 pos, stop;
197 WAVLoopPoint *loop;
198 Sint64 loop_start;
199 Sint64 loop_stop;
200 SDL_bool looped = SDL_FALSE;
201 int i;
202 int filled, amount, result;
203
204 filled = SDL_AudioStreamGet(music->stream, data, bytes);
205 if (filled != 0) {
206 return filled;
207 }
208
209 if (!music->play_count) {
210 /* All done */
211 *done = SDL_TRUE;
212 return 0;
213 }
214
215 pos = SDL_RWtell(music->src);
216 stop = music->stop;
217 loop = NULL;
218 for (i = 0; i < music->numloops; ++i) {
219 loop = &music->loops[i];
220 if (loop->active) {
221 const int bytes_per_sample = (SDL_AUDIO_BITSIZE(music->spec.format) / 8) * music->spec.channels;
222 loop_start = music->start + loop->start * bytes_per_sample;
223 loop_stop = music->start + (loop->stop + 1) * bytes_per_sample;
224 if (pos >= loop_start && pos < loop_stop)
225 {
226 stop = loop_stop;
227 break;
228 }
229 }
230 loop = NULL;
231 }
232
233 amount = music->spec.size;
234 if ((stop - pos) < amount) {
235 amount = (int)(stop - pos);
236 }
237 amount = (int)SDL_RWread(music->src, music->buffer, 1, amount);
238 if (amount > 0) {
239 result = SDL_AudioStreamPut(music->stream, music->buffer, amount);
240 if (result < 0) {
241 return -1;
242 }
243 } else {
244 /* We might be looping, continue */
245 }
246
247 if (loop && SDL_RWtell(music->src) >= stop) {
248 if (loop->current_play_count == 1) {
249 loop->active = SDL_FALSE;
250 } else {
251 if (loop->current_play_count > 0) {
252 --loop->current_play_count;
253 }
254 SDL_RWseek(music->src, loop_start, RW_SEEK_SET);
255 looped = SDL_TRUE;
256 }
257 }
258
259 if (!looped && SDL_RWtell(music->src) >= music->stop) {
260 if (music->play_count == 1) {
261 music->play_count = 0;
262 SDL_AudioStreamFlush(music->stream);
263 } else {
264 int play_count = -1;
265 if (music->play_count > 0) {
266 play_count = (music->play_count - 1);
267 }
268 if (WAV_Play(music, play_count) < 0) {
269 return -1;
270 }
271 }
272 }
273
274 /* We'll get called again in the case where we looped or have more data */
275 return 0;
276 }
277
278 static int WAV_GetAudio(void *context, void *data, int bytes)
279 {
280 WAV_Music *music = (WAV_Music *)context;
281 return music_pcm_getaudio(context, data, bytes, music->volume, WAV_GetSome);
282 }
283
284 /* Close the given WAV stream */
285 static void WAV_Delete(void *context)
286 {
287 WAV_Music *music = (WAV_Music *)context;
288
289 /* Clean up associated data */
290 if (music->loops) {
291 SDL_free(music->loops);
292 }
293 if (music->stream) {
294 SDL_FreeAudioStream(music->stream);
295 }
296 if (music->buffer) {
297 SDL_free(music->buffer);
298 }
299 if (music->freesrc) {
300 SDL_RWclose(music->src);
301 }
302 SDL_free(music);
303 }
304
305 static SDL_bool ParseFMT(WAV_Music *wave, Uint32 chunk_length)
306 {
307 SDL_AudioSpec *spec = &wave->spec;
308 WaveFMT *format;
309 Uint8 *data;
310 SDL_bool loaded = SDL_FALSE;
311
312 if (chunk_length < sizeof(*format)) {
313 Mix_SetError("Wave format chunk too small");
314 return SDL_FALSE;
315 }
316
317 data = (Uint8 *)SDL_malloc(chunk_length);
318 if (!data) {
319 Mix_SetError("Out of memory");
320 return SDL_FALSE;
321 }
322 if (!SDL_RWread(wave->src, data, chunk_length, 1)) {
323 Mix_SetError("Couldn't read %d bytes from WAV file", chunk_length);
324 return SDL_FALSE;
325 }
326 format = (WaveFMT *)data;
327
328 /* Decode the audio data format */
329 switch (SDL_SwapLE16(format->encoding)) {
330 case PCM_CODE:
331 /* We can understand this */
332 break;
333 default:
334 Mix_SetError("Unknown WAVE data format");
335 goto done;
336 }
337 spec->freq = SDL_SwapLE32(format->frequency);
338 switch (SDL_SwapLE16(format->bitspersample)) {
339 case 8:
340 spec->format = AUDIO_U8;
341 break;
342 case 16:
343 spec->format = AUDIO_S16;
344 break;
345 default:
346 Mix_SetError("Unknown PCM data format");
347 goto done;
348 }
349 spec->channels = (Uint8) SDL_SwapLE16(format->channels);
350 spec->samples = 4096; /* Good default buffer size */
351 /* SDL_CalculateAudioSpec */
352 spec->size = SDL_AUDIO_BITSIZE(spec->format) / 8;
353 spec->size *= spec->channels;
354 spec->size *= spec->samples;
355
356 loaded = SDL_TRUE;
357
358 done:
359 SDL_free(data);
360 return loaded;
361 }
362
363 static SDL_bool ParseDATA(WAV_Music *wave, Uint32 chunk_length)
364 {
365 wave->start = SDL_RWtell(wave->src);
366 wave->stop = wave->start + chunk_length;
367 SDL_RWseek(wave->src, chunk_length, RW_SEEK_CUR);
368 return SDL_TRUE;
369 }
370
371 static SDL_bool AddLoopPoint(WAV_Music *wave, Uint32 play_count, Uint32 start, Uint32 stop)
372 {
373 WAVLoopPoint *loop;
374 WAVLoopPoint *loops = SDL_realloc(wave->loops, (wave->numloops + 1)*sizeof(*wave->loops));
375 if (!loops) {
376 Mix_SetError("Out of memory");
377 return SDL_FALSE;
378 }
379
380 loop = &loops[ wave->numloops ];
381 loop->start = start;
382 loop->stop = stop;
383 loop->initial_play_count = play_count;
384 loop->current_play_count = play_count;
385
386 wave->loops = loops;
387 ++wave->numloops;
388 return SDL_TRUE;
389 }
390
391 static SDL_bool ParseSMPL(WAV_Music *wave, Uint32 chunk_length)
392 {
393 SamplerChunk *chunk;
394 Uint8 *data;
395 Uint32 i;
396 SDL_bool loaded = SDL_FALSE;
397
398 data = (Uint8 *)SDL_malloc(chunk_length);
399 if (!data) {
400 Mix_SetError("Out of memory");
401 return SDL_FALSE;
402 }
403 if (!SDL_RWread(wave->src, data, chunk_length, 1)) {
404 Mix_SetError("Couldn't read %d bytes from WAV file", chunk_length);
405 return SDL_FALSE;
406 }
407 chunk = (SamplerChunk *)data;
408
409 for (i = 0; i < SDL_SwapLE32(chunk->sample_loops); ++i) {
410 const Uint32 LOOP_TYPE_FORWARD = 0;
411 Uint32 loop_type = SDL_SwapLE32(chunk->loops[i].type);
412 if (loop_type == LOOP_TYPE_FORWARD) {
413 AddLoopPoint(wave, SDL_SwapLE32(chunk->loops[i].play_count), SDL_SwapLE32(chunk->loops[i].start), SDL_SwapLE32(chunk->loops[i].end));
414 }
415 }
416
417 loaded = SDL_TRUE;
418 SDL_free(data);
419 return loaded;
420 }
421
422 static SDL_bool LoadWAVMusic(WAV_Music *wave)
423 {
424 SDL_RWops *src = wave->src;
425 Uint32 chunk_type;
426 Uint32 chunk_length;
427 SDL_bool found_FMT = SDL_FALSE;
428 SDL_bool found_DATA = SDL_FALSE;
429
430 /* WAV magic header */
431 Uint32 wavelen;
432 Uint32 WAVEmagic;
433
434 /* Check the magic header */
435 wavelen = SDL_ReadLE32(src);
436 WAVEmagic = SDL_ReadLE32(src);
437
438 /* Read the chunks */
439 for (; ;) {
440 chunk_type = SDL_ReadLE32(src);
441 chunk_length = SDL_ReadLE32(src);
442
443 if (chunk_length == 0)
444 break;
445
446 switch (chunk_type)
447 {
448 case FMT:
449 found_FMT = SDL_TRUE;
450 if (!ParseFMT(wave, chunk_length))
451 return SDL_FALSE;
452 break;
453 case DATA:
454 found_DATA = SDL_TRUE;
455 if (!ParseDATA(wave, chunk_length))
456 return SDL_FALSE;
457 break;
458 case SMPL:
459 if (!ParseSMPL(wave, chunk_length))
460 return SDL_FALSE;
461 break;
462 default:
463 SDL_RWseek(src, chunk_length, RW_SEEK_CUR);
464 break;
465 }
466 }
467
468 if (!found_FMT) {
469 Mix_SetError("Bad WAV file (no FMT chunk)");
470 return SDL_FALSE;
471 }
472
473 if (!found_DATA) {
474 Mix_SetError("Bad WAV file (no DATA chunk)");
475 return SDL_FALSE;
476 }
477
478 return SDL_TRUE;
479 }
480
481 /* I couldn't get SANE_to_double() to work, so I stole this from libsndfile.
482 * I don't pretend to fully understand it.
483 */
484
485 static Uint32 SANE_to_Uint32 (Uint8 *sanebuf)
486 {
487 /* Negative number? */
488 if (sanebuf[0] & 0x80)
489 return 0;
490
491 /* Less than 1? */
492 if (sanebuf[0] <= 0x3F)
493 return 1;
494
495 /* Way too big? */
496 if (sanebuf[0] > 0x40)
497 return 0x4000000;
498
499 /* Still too big? */
500 if (sanebuf[0] == 0x40 && sanebuf[1] > 0x1C)
501 return 800000000;
502
503 return ((sanebuf[2] << 23) | (sanebuf[3] << 15) | (sanebuf[4] << 7) |
504 (sanebuf[5] >> 1)) >> (29 - sanebuf[1]);
505 }
506
507 static SDL_bool LoadAIFFMusic(WAV_Music *wave)
508 {
509 SDL_RWops *src = wave->src;
510 SDL_AudioSpec *spec = &wave->spec;
511 SDL_bool found_SSND = SDL_FALSE;
512 SDL_bool found_COMM = SDL_FALSE;
513
514 Uint32 chunk_type;
515 Uint32 chunk_length;
516 Sint64 next_chunk;
517
518 /* AIFF magic header */
519 Uint32 AIFFmagic;
520 /* SSND chunk */
521 Uint32 offset;
522 Uint32 blocksize;
523 /* COMM format chunk */
524 Uint16 channels = 0;
525 Uint32 numsamples = 0;
526 Uint16 samplesize = 0;
527 Uint8 sane_freq[10];
528 Uint32 frequency = 0;
529
530 /* Check the magic header */
531 chunk_length = SDL_ReadBE32(src);
532 AIFFmagic = SDL_ReadLE32(src);
533 if (AIFFmagic != AIFF) {
534 Mix_SetError("Unrecognized file type (not AIFF)");
535 return SDL_FALSE;
536 }
537
538 /* From what I understand of the specification, chunks may appear in
539 * any order, and we should just ignore unknown ones.
540 *
541 * TODO: Better sanity-checking. E.g. what happens if the AIFF file
542 * contains compressed sound data?
543 */
544 do {
545 chunk_type = SDL_ReadLE32(src);
546 chunk_length = SDL_ReadBE32(src);
547 next_chunk = SDL_RWtell(src) + chunk_length;
548
549 /* Paranoia to avoid infinite loops */
550 if (chunk_length == 0)
551 break;
552
553 switch (chunk_type) {
554 case SSND:
555 found_SSND = SDL_TRUE;
556 offset = SDL_ReadBE32(src);
557 blocksize = SDL_ReadBE32(src);
558 wave->start = SDL_RWtell(src) + offset;
559 break;
560
561 case COMM:
562 found_COMM = SDL_TRUE;
563
564 /* Read the audio data format chunk */
565 channels = SDL_ReadBE16(src);
566 numsamples = SDL_ReadBE32(src);
567 samplesize = SDL_ReadBE16(src);
568 SDL_RWread(src, sane_freq, sizeof(sane_freq), 1);
569 frequency = SANE_to_Uint32(sane_freq);
570 break;
571
572 default:
573 break;
574 }
575 } while ((!found_SSND || !found_COMM)
576 && SDL_RWseek(src, next_chunk, RW_SEEK_SET) != -1);
577
578 if (!found_SSND) {
579 Mix_SetError("Bad AIFF file (no SSND chunk)");
580 return SDL_FALSE;
581 }
582
583 if (!found_COMM) {
584 Mix_SetError("Bad AIFF file (no COMM chunk)");
585 return SDL_FALSE;
586 }
587
588 wave->stop = wave->start + channels * numsamples * (samplesize / 8);
589
590 /* Decode the audio data format */
591 SDL_memset(spec, 0, (sizeof *spec));
592 spec->freq = frequency;
593 switch (samplesize) {
594 case 8:
595 spec->format = AUDIO_S8;
596 break;
597 case 16:
598 spec->format = AUDIO_S16MSB;
599 break;
600 default:
601 Mix_SetError("Unknown samplesize in data format");
602 return SDL_FALSE;
603 }
604 spec->channels = (Uint8) channels;
605 spec->samples = 4096; /* Good default buffer size */
606
607 return SDL_TRUE;
608 }
609
610 Mix_MusicInterface Mix_MusicInterface_WAV =
611 {
612 "WAVE",
613 MIX_MUSIC_WAVE,
614 MUS_WAV,
615 SDL_FALSE,
616 SDL_FALSE,
617
618 NULL, /* Load */
619 NULL, /* Open */
620 WAV_CreateFromRW,
621 NULL, /* CreateFromFile */
622 WAV_SetVolume,
623 WAV_Play,
624 NULL, /* IsPlaying */
625 WAV_GetAudio,
626 NULL, /* Seek */
627 NULL, /* Pause */
628 NULL, /* Resume */
629 NULL, /* Stop */
630 WAV_Delete,
631 NULL, /* Close */
632 NULL, /* Unload */
633 };
634
635 #endif /* MUSIC_WAV */
636
637 /* vi: set ts=4 sw=4 expandtab: */
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* This file supports streaming WAV files */
22
23 #include "music.h"
24
25 extern Mix_MusicInterface Mix_MusicInterface_WAV;
26
27 /* vi: set ts=4 sw=4 expandtab: */
2121 #ifndef _NATIVE_MIDI_H_
2222 #define _NATIVE_MIDI_H_
2323
24 #include <SDL_rwops.h>
24 #include "SDL_rwops.h"
2525
2626 typedef struct _NativeMidiSong NativeMidiSong;
2727
28 int native_midi_detect();
28 int native_midi_detect(void);
2929 NativeMidiSong *native_midi_loadsong_RW(SDL_RWops *src, int freesrc);
3030 void native_midi_freesong(NativeMidiSong *song);
3131 void native_midi_start(NativeMidiSong *song, int loops);
32 void native_midi_stop();
33 int native_midi_active();
32 void native_midi_pause(void);
33 void native_midi_resume(void);
34 void native_midi_stop(void);
35 int native_midi_active(void);
3436 void native_midi_setvolume(int volume);
3537 const char *native_midi_error(void);
3638
2727 #include <string.h>
2828 #include <limits.h>
2929
30
31 /* The maximum number of midi tracks that we can handle
32 #define MIDI_TRACKS 32 */
33
30 /* The constant 'MThd' */
31 #define MIDI_MAGIC 0x4d546864
3432
3533 /* A single midi track as read from the midi file */
3634 typedef struct
229227 return NULL;
230228
231229 track = (MIDIEvent**) calloc(1, sizeof(MIDIEvent*) * mididata->nTracks);
232
233230 if (NULL == track)
231 {
232 free(head);
234233 return NULL;
234 }
235235
236236 /* First, convert all tracks to MIDIEvent lists */
237237 for (trackID = 0; trackID < mididata->nTracks; trackID++)
292292
293293 /* Make sure this is really a MIDI file */
294294 SDL_RWread(src, &ID, 1, 4);
295 if (BE_LONG(ID) != 'MThd')
295 if (BE_LONG(ID) != MIDI_MAGIC)
296296 return 0;
297297
298298 /* Header size must be 6 */
380380 *division = mididata->division;
381381
382382 eventList = MIDItoStream(mididata);
383
383 if (eventList == NULL)
384 {
385 free(mididata);
386 return NULL;
387 }
384388 for(trackID = 0; trackID < mididata->nTracks; trackID++)
385389 {
386390 if (mididata->track[trackID].data)
205205
206206 char lasterr[1024];
207207
208 int native_midi_detect()
208 int native_midi_detect(void)
209209 {
210210 status_t res = synth.EnableInput(true, false);
211211 return res == B_OK;
252252 delete song->store;
253253 delete song; song = 0;
254254 }
255
255256 void native_midi_start(NativeMidiSong *song, int loops)
256257 {
257258 native_midi_stop();
260261 song->store->Start();
261262 currentSong = song;
262263 }
263 void native_midi_stop()
264
265 void native_midi_pause(void)
266 {
267 }
268
269 void native_midi_resume(void)
270 {
271 }
272
273 void native_midi_stop(void)
264274 {
265275 if (currentSong == NULL) return;
266276 currentSong->store->Stop();
269279 usleep(1000);
270280 currentSong = NULL;
271281 }
272 int native_midi_active()
282
283 int native_midi_active(void)
273284 {
274285 if (currentSong == NULL) return 0;
275286 return currentSong->store->IsPlaying();
1919 */
2020 #include "SDL_config.h"
2121 #include "SDL_endian.h"
22 #include "../mixer.h"
2223
2324 #if __MACOS__ /*|| __MACOSX__ */
2425
8182
8283
8384 /* Check whether QuickTime is available */
84 int native_midi_detect()
85 int native_midi_detect(void)
8586 {
8687 /* TODO */
8788 return 1;
186187 assert (loops == 0);
187188
188189 SDL_PauseAudio(1);
189 SDL_UnlockAudio();
190 Mix_UnlockAudio();
190191
191192 /* First, stop the currently playing music */
192193 native_midi_stop();
236237 }
237238
238239 done:
239 SDL_LockAudio();
240 Mix_LockAudio();
240241 SDL_PauseAudio(0);
241242 }
242243
243 void native_midi_stop()
244 void native_midi_pause(void)
245 {
246 }
247
248 void native_midi_resume(void)
249 {
250 }
251
252 void native_midi_stop(void)
244253 {
245254 if (gTunePlayer == NULL)
246255 return;
252261 TuneUnroll(gTunePlayer);
253262 }
254263
255 int native_midi_active()
264 int native_midi_active(void)
256265 {
257266 if (gTunePlayer != NULL)
258267 {
3030 #include <AudioToolbox/AudioToolbox.h>
3131 #include <AvailabilityMacros.h>
3232
33 #include "SDL_endian.h"
3334 #include "../SDL_mixer.h"
34 #include "SDL_endian.h"
35 #include "../mixer.h"
3536 #include "native_midi.h"
3637
3738 /* Native Midi song */
148149 }
149150
150151
151 int native_midi_detect()
152 int native_midi_detect(void)
152153 {
153154 return 1; /* always available. */
154155 }
263264 return;
264265
265266 SDL_PauseAudio(1);
266 SDL_UnlockAudio();
267 Mix_UnlockAudio();
267268
268269 if (currentsong)
269270 MusicPlayerStop(currentsong->player);
281282 latched_volume++; /* just make this not match. */
282283 native_midi_setvolume(vol);
283284
284 SDL_LockAudio();
285 Mix_LockAudio();
285286 SDL_PauseAudio(0);
286287 }
287288
288 void native_midi_stop()
289 void native_midi_pause(void)
290 {
291 }
292
293 void native_midi_resume(void)
294 {
295 }
296
297 void native_midi_stop(void)
289298 {
290299 if (currentsong) {
291300 SDL_PauseAudio(1);
292 SDL_UnlockAudio();
301 Mix_UnlockAudio();
293302 MusicPlayerStop(currentsong->player);
294303 currentsong = NULL;
295 SDL_LockAudio();
304 Mix_LockAudio();
296305 SDL_PauseAudio(0);
297306 }
298307 }
299308
300 int native_midi_active()
309 int native_midi_active(void)
301310 {
302311 MusicTimeStamp currentTime = 0;
303312 if (currentsong == NULL)
188188 }
189189 }
190190
191 int native_midi_detect()
191 int native_midi_detect(void)
192192 {
193193 MMRESULT merr;
194194 HMIDISTRM MidiStream;
271271 }
272272 }
273273
274 void native_midi_stop()
274 void native_midi_pause(void)
275 {
276 if (!hMidiStream)
277 return;
278 midiStreamPause(hMidiStream);
279 }
280
281 void native_midi_resume(void)
282 {
283 if (!hMidiStream)
284 return;
285 midiStreamRestart(hMidiStream);
286 }
287
288 void native_midi_stop(void)
275289 {
276290 if (!hMidiStream)
277291 return;
281295 hMidiStream = NULL;
282296 }
283297
284 int native_midi_active()
298 int native_midi_active(void)
285299 {
286300 return currentsong->MusicPlaying;
287301 }
00 /*
11 PLAYMUS: A test application for the SDL mixer library.
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
1919 */
2020
2121 /* Quiet windows compiler warnings */
22 #define _CRT_SECURE_NO_WARNINGS
22 #define _CRT_SECURE_NO_WARNINGS
2323
2424 /* $Id$ */
2525
4545
4646 void CleanUp(int exitcode)
4747 {
48 if( Mix_PlayingMusic() ) {
48 if(Mix_PlayingMusic()) {
4949 Mix_FadeOutMusic(1500);
5050 SDL_Delay(1500);
5151 }
52 if ( music ) {
52 if (music) {
5353 Mix_FreeMusic(music);
5454 music = NULL;
5555 }
56 if ( audio_open ) {
56 if (audio_open) {
5757 Mix_CloseAudio();
5858 audio_open = 0;
5959 }
6363
6464 void Usage(char *argv0)
6565 {
66 fprintf(stderr, "Usage: %s [-i] [-l] [-8] [-r rate] [-c channels] [-b buffers] [-v N] [-rwops] <musicfile>\n", argv0);
66 SDL_Log("Usage: %s [-i] [-l] [-8] [-f32] [-r rate] [-c channels] [-b buffers] [-v N] [-rwops] <musicfile>\n", argv0);
6767 }
6868
6969 void Menu(void)
124124 audio_buffers = 4096;
125125
126126 /* Check command line usage */
127 for ( i=1; argv[i] && (*argv[i] == '-'); ++i ) {
128 if ( (strcmp(argv[i], "-r") == 0) && argv[i+1] ) {
127 for (i=1; argv[i] && (*argv[i] == '-'); ++i) {
128 if ((strcmp(argv[i], "-r") == 0) && argv[i+1]) {
129129 ++i;
130130 audio_rate = atoi(argv[i]);
131131 } else
132 if ( strcmp(argv[i], "-m") == 0 ) {
132 if (strcmp(argv[i], "-m") == 0) {
133133 audio_channels = 1;
134134 } else
135 if ( (strcmp(argv[i], "-c") == 0) && argv[i+1] ) {
135 if ((strcmp(argv[i], "-c") == 0) && argv[i+1]) {
136136 ++i;
137137 audio_channels = atoi(argv[i]);
138138 } else
139 if ( (strcmp(argv[i], "-b") == 0) && argv[i+1] ) {
139 if ((strcmp(argv[i], "-b") == 0) && argv[i+1]) {
140140 ++i;
141141 audio_buffers = atoi(argv[i]);
142142 } else
143 if ( (strcmp(argv[i], "-v") == 0) && argv[i+1] ) {
143 if ((strcmp(argv[i], "-v") == 0) && argv[i+1]) {
144144 ++i;
145145 audio_volume = atoi(argv[i]);
146146 } else
147 if ( strcmp(argv[i], "-l") == 0 ) {
147 if (strcmp(argv[i], "-l") == 0) {
148148 looping = -1;
149149 } else
150 if ( strcmp(argv[i], "-i") == 0 ) {
150 if (strcmp(argv[i], "-i") == 0) {
151151 interactive = 1;
152152 } else
153 if ( strcmp(argv[i], "-8") == 0 ) {
153 if (strcmp(argv[i], "-8") == 0) {
154154 audio_format = AUDIO_U8;
155155 } else
156 if ( strcmp(argv[i], "-rwops") == 0 ) {
156 if (strcmp(argv[i], "-f32") == 0) {
157 audio_format = AUDIO_F32;
158 } else
159 if (strcmp(argv[i], "-rwops") == 0) {
157160 rwops = 1;
158161 } else {
159162 Usage(argv[0]);
160163 return(1);
161164 }
162165 }
163 if ( ! argv[i] ) {
166 if (! argv[i]) {
164167 Usage(argv[0]);
165168 return(1);
166169 }
167170
168171 /* Initialize the SDL library */
169 if ( SDL_Init(SDL_INIT_AUDIO) < 0 ) {
170 fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
172 if (SDL_Init(SDL_INIT_AUDIO) < 0) {
173 SDL_Log("Couldn't initialize SDL: %s\n",SDL_GetError());
171174 return(255);
172175 }
173176
178181
179182 /* Open the audio device */
180183 if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) < 0) {
181 fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
184 SDL_Log("Couldn't open audio: %s\n", SDL_GetError());
182185 return(2);
183186 } else {
184187 Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
185 printf("Opened audio at %d Hz %d bit %s (%s), %d bytes audio buffer\n", audio_rate,
188 SDL_Log("Opened audio at %d Hz %d bit%s %s %d bytes audio buffer\n", audio_rate,
186189 (audio_format&0xFF),
190 (SDL_AUDIO_ISFLOAT(audio_format) ? " (float)" : ""),
187191 (audio_channels > 2) ? "surround" : (audio_channels > 1) ? "stereo" : "mono",
188 (audio_format&0x1000) ? "BE" : "LE",
189 audio_buffers );
192 audio_buffers);
190193 }
191194 audio_open = 1;
192195
200203 next_track = 0;
201204
202205 /* Load the requested music file */
203 if ( rwops ) {
206 if (rwops) {
204207 music = Mix_LoadMUS_RW(SDL_RWFromFile(argv[i], "rb"), SDL_TRUE);
205208 } else {
206209 music = Mix_LoadMUS(argv[i]);
207210 }
208 if ( music == NULL ) {
209 fprintf(stderr, "Couldn't load %s: %s\n",
211 if (music == NULL) {
212 SDL_Log("Couldn't load %s: %s\n",
210213 argv[i], SDL_GetError());
211214 CleanUp(2);
212215 }
213216
214217 /* Play and then exit */
215 printf("Playing %s\n", argv[i]);
218 SDL_Log("Playing %s\n", argv[i]);
216219 Mix_FadeInMusic(music,looping,2000);
217 while ( !next_track && (Mix_PlayingMusic() || Mix_PausedMusic()) ) {
220 while (!next_track && (Mix_PlayingMusic() || Mix_PausedMusic())) {
218221 if(interactive)
219222 Menu();
220223 else
225228
226229 /* If the user presses Ctrl-C more than once, exit. */
227230 SDL_Delay(500);
228 if ( next_track > 1 ) break;
231 if (next_track > 1) break;
229232
230233 i++;
231234 }
234237 /* Not reached, but fixes compiler warnings */
235238 return 0;
236239 }
240
241 /* vi: set ts=4 sw=4 expandtab: */
00 /*
11 PLAYWAVE: A test application for the SDL mixer library.
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2 Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
33
44 This software is provided 'as-is', without any express or implied
55 warranty. In no event will the authors be held liable for any damages
6464 static void output_test_warnings(void)
6565 {
6666 #if (defined TEST_MIX_CHANNELFINISHED)
67 fprintf(stderr, "Warning: TEST_MIX_CHANNELFINISHED is enabled in this binary...\n");
67 SDL_Log("Warning: TEST_MIX_CHANNELFINISHED is enabled in this binary...\n");
6868 #endif
6969 #if (defined TEST_MIX_PANNING)
70 fprintf(stderr, "Warning: TEST_MIX_PANNING is enabled in this binary...\n");
70 SDL_Log("Warning: TEST_MIX_PANNING is enabled in this binary...\n");
7171 #endif
7272 #if (defined TEST_MIX_VERSIONS)
73 fprintf(stderr, "Warning: TEST_MIX_VERSIONS is enabled in this binary...\n");
73 SDL_Log("Warning: TEST_MIX_VERSIONS is enabled in this binary...\n");
7474 #endif
7575 #if (defined TEST_MIX_DISTANCE)
76 fprintf(stderr, "Warning: TEST_MIX_DISTANCE is enabled in this binary...\n");
76 SDL_Log("Warning: TEST_MIX_DISTANCE is enabled in this binary...\n");
7777 #endif
7878 #if (defined TEST_MIX_POSITION)
79 fprintf(stderr, "Warning: TEST_MIX_POSITION is enabled in this binary...\n");
79 SDL_Log("Warning: TEST_MIX_POSITION is enabled in this binary...\n");
8080 #endif
8181 }
8282
9090 {
9191 int i, total;
9292
93 printf("Supported decoders...\n");
93 SDL_Log("Supported decoders...\n");
9494 total = Mix_GetNumChunkDecoders();
9595 for (i = 0; i < total; i++) {
96 fprintf(stderr, " - chunk decoder: %s\n", Mix_GetChunkDecoder(i));
96 SDL_Log(" - chunk decoder: %s\n", Mix_GetChunkDecoder(i));
9797 }
9898
9999 total = Mix_GetNumMusicDecoders();
100100 for (i = 0; i < total; i++) {
101 fprintf(stderr, " - music decoder: %s\n", Mix_GetMusicDecoder(i));
101 SDL_Log(" - music decoder: %s\n", Mix_GetMusicDecoder(i));
102102 }
103103 }
104104 #endif
108108 static void output_versions(const char *libname, const SDL_version *compiled,
109109 const SDL_version *linked)
110110 {
111 fprintf(stderr,
112 "This program was compiled against %s %d.%d.%d,\n"
111 SDL_Log("This program was compiled against %s %d.%d.%d,\n"
113112 " and is dynamically linked to %d.%d.%d.\n", libname,
114113 compiled->major, compiled->minor, compiled->patch,
115114 linked->major, linked->minor, linked->patch);
133132
134133 #ifdef TEST_MIX_CHANNELFINISHED /* rcg06072001 */
135134 static volatile int channel_is_done = 0;
136 static void channel_complete_callback(int chan)
135 static void SDLCALL channel_complete_callback (int chan)
137136 {
138137 Mix_Chunk *done_chunk = Mix_GetChunk(chan);
139 fprintf(stderr, "We were just alerted that Mixer channel #%d is done.\n", chan);
140 fprintf(stderr, "Channel's chunk pointer is (%p).\n", done_chunk);
141 fprintf(stderr, " Which %s correct.\n", (wave == done_chunk) ? "is" : "is NOT");
138 SDL_Log("We were just alerted that Mixer channel #%d is done.\n", chan);
139 SDL_Log("Channel's chunk pointer is (%p).\n", done_chunk);
140 SDL_Log(" Which %s correct.\n", (wave == done_chunk) ? "is" : "is NOT");
142141 channel_is_done = 1;
143142 }
144143 #endif
168167 if ((panningok) && (SDL_GetTicks() >= next_panning_update)) {
169168 panningok = Mix_SetPanning(0, leftvol, rightvol);
170169 if (!panningok) {
171 fprintf(stderr, "Mix_SetPanning(0, %d, %d) failed!\n",
170 SDL_Log("Mix_SetPanning(0, %d, %d) failed!\n",
172171 (int) leftvol, (int) rightvol);
173 fprintf(stderr, "Reason: [%s].\n", Mix_GetError());
172 SDL_Log("Reason: [%s].\n", Mix_GetError());
174173 }
175174
176175 if ((leftvol == 255) || (leftvol == 0)) {
177176 if (leftvol == 255)
178 printf("All the way in the left speaker.\n");
177 SDL_Log("All the way in the left speaker.\n");
179178 leftincr *= -1;
180179 }
181180
182181 if ((rightvol == 255) || (rightvol == 0)) {
183182 if (rightvol == 255)
184 printf("All the way in the right speaker.\n");
183 SDL_Log("All the way in the right speaker.\n");
185184 rightincr *= -1;
186185 }
187186
204203 if ((distanceok) && (SDL_GetTicks() >= next_distance_update)) {
205204 distanceok = Mix_SetDistance(0, distance);
206205 if (!distanceok) {
207 fprintf(stderr, "Mix_SetDistance(0, %d) failed!\n", (int) distance);
208 fprintf(stderr, "Reason: [%s].\n", Mix_GetError());
206 SDL_Log("Mix_SetDistance(0, %d) failed!\n", (int) distance);
207 SDL_Log("Reason: [%s].\n", Mix_GetError());
209208 }
210209
211210 if (distance == 0) {
212 printf("Distance at nearest point.\n");
211 SDL_Log("Distance at nearest point.\n");
213212 distincr *= -1;
214213 }
215214 else if (distance == 255) {
216 printf("Distance at furthest point.\n");
215 SDL_Log("Distance at furthest point.\n");
217216 distincr *= -1;
218217 }
219218
237236 if ((positionok) && (SDL_GetTicks() >= next_position_update)) {
238237 positionok = Mix_SetPosition(0, angle, distance);
239238 if (!positionok) {
240 fprintf(stderr, "Mix_SetPosition(0, %d, %d) failed!\n",
239 SDL_Log("Mix_SetPosition(0, %d, %d) failed!\n",
241240 (int) angle, (int) distance);
242 fprintf(stderr, "Reason: [%s].\n", Mix_GetError());
241 SDL_Log("Reason: [%s].\n", Mix_GetError());
243242 }
244243
245244 if (angle == 0) {
246 printf("Due north; now rotating clockwise...\n");
245 SDL_Log("Due north; now rotating clockwise...\n");
247246 angleincr = 1;
248247 }
249248
250249 else if (angle == 360) {
251 printf("Due north; now rotating counter-clockwise...\n");
250 SDL_Log("Due north; now rotating counter-clockwise...\n");
252251 angleincr = -1;
253252 }
254253
257256 if (distance < 0) {
258257 distance = 0;
259258 distincr = 3;
260 printf("Distance is very, very near. Stepping away by threes...\n");
259 SDL_Log("Distance is very, very near. Stepping away by threes...\n");
261260 } else if (distance > 255) {
262261 distance = 255;
263262 distincr = -3;
264 printf("Distance is very, very far. Stepping towards by threes...\n");
263 SDL_Log("Distance is very, very far. Stepping towards by threes...\n");
265264 }
266265
267266 angle += angleincr;
273272
274273 static void CleanUp(int exitcode)
275274 {
276 if ( wave ) {
275 if (wave) {
277276 Mix_FreeChunk(wave);
278277 wave = NULL;
279278 }
280 if ( audio_open ) {
279 if (audio_open) {
281280 Mix_CloseAudio();
282281 audio_open = 0;
283282 }
289288
290289 static void Usage(char *argv0)
291290 {
292 fprintf(stderr, "Usage: %s [-8] [-r rate] [-c channels] [-f] [-F] [-l] [-m] <wavefile>\n", argv0);
291 SDL_Log("Usage: %s [-8] [-f32] [-r rate] [-c channels] [-f] [-F] [-l] [-m] <wavefile>\n", argv0);
293292 }
294293
295294
349348 break;
350349
351350 default:
352 fprintf(stderr, "Unhandled format in sample flipping.\n");
351 SDL_Log("Unhandled format in sample flipping.\n");
353352 return;
354353 }
355354 }
377376 audio_channels = 2;
378377
379378 /* Check command line usage */
380 for ( i=1; argv[i] && (*argv[i] == '-'); ++i ) {
381 if ( (strcmp(argv[i], "-r") == 0) && argv[i+1] ) {
379 for (i=1; argv[i] && (*argv[i] == '-'); ++i) {
380 if ((strcmp(argv[i], "-r") == 0) && argv[i+1]) {
382381 ++i;
383382 audio_rate = atoi(argv[i]);
384383 } else
385 if ( strcmp(argv[i], "-m") == 0 ) {
384 if (strcmp(argv[i], "-m") == 0) {
386385 audio_channels = 1;
387386 } else
388 if ( (strcmp(argv[i], "-c") == 0) && argv[i+1] ) {
387 if ((strcmp(argv[i], "-c") == 0) && argv[i+1]) {
389388 ++i;
390389 audio_channels = atoi(argv[i]);
391390 } else
392 if ( strcmp(argv[i], "-l") == 0 ) {
391 if (strcmp(argv[i], "-l") == 0) {
393392 loops = -1;
394393 } else
395 if ( strcmp(argv[i], "-8") == 0 ) {
394 if (strcmp(argv[i], "-8") == 0) {
396395 audio_format = AUDIO_U8;
397396 } else
398 if ( strcmp(argv[i], "-f") == 0 ) { /* rcg06122001 flip stereo */
397 if (strcmp(argv[i], "-f32") == 0) {
398 audio_format = AUDIO_F32;
399 } else
400 if (strcmp(argv[i], "-f") == 0) { /* rcg06122001 flip stereo */
399401 reverse_stereo = 1;
400402 } else
401 if ( strcmp(argv[i], "-F") == 0 ) { /* rcg06172001 flip sample */
403 if (strcmp(argv[i], "-F") == 0) { /* rcg06172001 flip sample */
402404 reverse_sample = 1;
403405 } else {
404406 Usage(argv[0]);
405407 return(1);
406408 }
407409 }
408 if ( ! argv[i] ) {
410 if (! argv[i]) {
409411 Usage(argv[0]);
410412 return(1);
411413 }
412414
413415 /* Initialize the SDL library */
414 if ( SDL_Init(SDL_INIT_AUDIO) < 0 ) {
415 fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
416 if (SDL_Init(SDL_INIT_AUDIO) < 0) {
417 SDL_Log("Couldn't initialize SDL: %s\n",SDL_GetError());
416418 return(255);
417419 }
418420 #ifdef HAVE_SIGNAL_H
422424
423425 /* Open the audio device */
424426 if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, 4096) < 0) {
425 fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
427 SDL_Log("Couldn't open audio: %s\n", SDL_GetError());
426428 CleanUp(2);
427429 } else {
428430 Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
429 printf("Opened audio at %d Hz %d bit %s", audio_rate,
431 SDL_Log("Opened audio at %d Hz %d bit%s %s", audio_rate,
430432 (audio_format&0xFF),
433 (SDL_AUDIO_ISFLOAT(audio_format) ? " (float)" : ""),
431434 (audio_channels > 2) ? "surround" :
432435 (audio_channels > 1) ? "stereo" : "mono");
433 if ( loops ) {
434 printf(" (looping)\n");
436 if (loops) {
437 SDL_Log(" (looping)\n");
435438 } else {
436439 putchar('\n');
437440 }
448451
449452 /* Load the requested wave file */
450453 wave = Mix_LoadWAV(argv[i]);
451 if ( wave == NULL ) {
452 fprintf(stderr, "Couldn't load %s: %s\n",
454 if (wave == NULL) {
455 SDL_Log("Couldn't load %s: %s\n",
453456 argv[i], SDL_GetError());
454457 CleanUp(2);
455458 }
462465 Mix_ChannelFinished(channel_complete_callback);
463466 #endif
464467
465 if ( (!Mix_SetReverseStereo(MIX_CHANNEL_POST, reverse_stereo)) &&
466 (reverse_stereo) )
468 if ((!Mix_SetReverseStereo(MIX_CHANNEL_POST, reverse_stereo)) &&
469 (reverse_stereo))
467470 {
468 printf("Failed to set up reverse stereo effect!\n");
469 printf("Reason: [%s].\n", Mix_GetError());
471 SDL_Log("Failed to set up reverse stereo effect!\n");
472 SDL_Log("Reason: [%s].\n", Mix_GetError());
470473 }
471474
472475 /* Play and then exit */
498501
499502 /* end of playwave.c ... */
500503
504 /* vi: set ts=4 sw=4 expandtab: */
0 LOCAL_PATH := $(call my-dir)
1
2 include $(CLEAR_VARS)
3
4 LOCAL_MODULE := timidity
5
6 LOCAL_C_INCLUDES :=
7
8 LOCAL_CFLAGS :=
9
10 LOCAL_SRC_FILES += \
11 common.c \
12 instrum.c \
13 mix.c \
14 output.c \
15 playmidi.c \
16 readmidi.c \
17 resample.c \
18 tables.c \
19 timidity.c
20
21 LOCAL_SHARED_LIBRARIES := SDL2
22
23 include $(BUILD_STATIC_LIBRARY)
0 This version of TiMidity should contain all the fixes from the
1 September 25 2003 SDL_mixer CVS snapshot. In addition, I've made some
2 changes of my own, e.g.:
3
4 * All file access is done through SDL_RWops. This means the MIDI
5 stream no longer has to be a file. (The config file and instruments
6 still have to be though.)
7
8 * Replacing of TiMidity's endian-handling with SDL's.
9
10 * Removal of much unused or unnecessary code, such as
11
12 + The "hooks" for putting a user interface onto TiMidity.
13 + The antialias filter. It wasn't active, and even at 4 kHz I
14 couldn't hear any difference when activating it.
15 + Removed all traces of LOOKUP_HACK and LOOKUP_INTERPOLATION.
16 According to the code comments they weren't very good anyway.
17 ("degrades sound quality noticeably"). I also removed the
18 disclaimer about the "8-bit uLaw to 16-bit PCM and the 13-bit-PCM
19 to 8-bit uLaw tables" disclaimer, since I believe those were the
20 tables I removed.
21 + Removed LOOKUP_SINE since it was already commented out. I think we
22 can count on our target audience having math co-processors
23 nowadays.
24 + Removed USE_LDEXP since it wasn't being used and "it doesn't make
25 much of a difference either way".
26 + Removed decompress hack from open_file() since it didn't look very
27 portable.
28 + Removed heaps of unnecessary constants.
29 + Removed unused functions.
30 + Assume that LINEAR_INTERPOLATION is always used, so remove all
31 code dealing with it not being so. It's not that I think the
32 difference in audio quality is that great, but since it wouldn't
33 compile without code changes I assume no one's used it for quite
34 some time...
35 + Assume PRECALC_LOOPS is always defined. Judging by the comments it
36 may not make much of a difference either way, so why maintain two
37 versions of the same code?
38
39 * Moving several static globals into the MidiSong struct. This
40 includes sample rate, formate, etc. which are now all per-song.
41
42 * Moved some typedefs (e.g. MidiSong) to timidity.h for easy inclusion
43 into the MIDI decoder.
44
45 * Added free_pathlist().
46
47 * Replaced TiMidity's own 8, 16 and 32-bit types with SDL's.
48
49 * Made TiMidity look for its configuration file in both /etc and
50 /usr/local/lib/timidity. (Windows version remains unchanged.)
51
52 * Timidity_PlaySome() now takes three arguments. A MidiSong, a decode
53 buffer and decode buffer size in bytes. (MidiSong is a new argument,
54 and buffer size used to be in samples.)
55
56 In addition, it will return the number of bytes decoded.
57
58 * Added Timidity_Exit().
59
60 * Removed Timidity_Stop() and Timidity_Active(). Stopping playback
61 should be handled by SDL_sound, and Timidity_PlaySome() will return
62 0 when the MIDI stream is finished.
63
64 * Modified the ToneBank stuff to allow some data to be shared between
65 MidiSongs.
66
67 * The following files have been removed: controls.c, controls.h,
68 filter.c, filter.h, sdl_a.c, sdl_c.c
69
70 * config.h has been renamed as options.h to avoid confusion with the
71 automatically generated config.h for SDL_sound.
72
73 * Added support for loading DLS format instruments:
74 Timidity_LoadDLS(), Timidity_FreeDLS(), Timidity_LoadDLSSong()
75
76 * Added Timidity_Init_NoConfig()
9191
9292 - Use a smaller number of simultaneous voices.
9393
94 - Make sure you compiled with FAST_DECAY and PRECALC_LOOPS enabled
95 in config.h
96
97 - If you don't have hardware to compute sines, recompile with
98 LOOKUP_SINE enabled in config.h
99
100 - Recompile with LOOKUP_HACK enabled in config.h.
101
102 - Recompile with LINEAR_INTERPOLATION disabled in config.h.
103
104 - Recompile with DANGEROUS_RENICE enabled in config.h, and make
105 TiMidity setuid root. This will help only if you frequently play
106 music while other processes are running.
94 - Make sure you compiled with FAST_DECAY enabled in options.h
10795
10896 - Recompile with an Intel-optimized gcc for a 5-15%
10997 performance increase.
0 [This version of timidity has been stripped for simplicity in porting to SDL]
0 [This version of timidity has been stripped for simplicity in porting to SDL,
1 and then even further for SDL_sound]
12 ---------------------------------*-text-*---------------------------------
23
34 From http://www.cgs.fi/~tt/discontinued.html :
0 * I don't like the indentation style at all, but for the most part
1 I've left it alone.
2
3 * Much of the code looks ugly to me.
4
5 * The return value from SDL_RWread() is checked inconsistenly.
6
7 * Group the members of MidiSong into logical units, i.e. structs?
8
9 * The debug messages are probably a bit too noisy. I've removed one
10 particularly annoying one, but...
11
12 Some of them should be turned into error messages instead.
13
14 * Can the instrument handling be made more efficient? At the moment
15 different MidiSongs may separately load the same instrument.
16
17 Note that the MidiSong's audio format affects how the instrument is
18 loaded, so it's not as easy as just letting all MidiSongs share tone
19 and drum banks.
20
21 At the moment they do share the data that is simply read from the
22 config file, but that's just a quick hack to avoid having to read
23 the config file every time a MIDI song is loaded.
24
25 * Check if any of MidiStruct's members can safely be made into static
26 globals again.
27
28 * TiMidity++ adds a number of undocumented (?) extensions to the
29 configuration syntax. These are not implemented here. In particular,
30 the "map" keyword used by the "eawpats".
31
32 * The other decoders generally only read as much of the file as is
33 necessary. Could we do that in this decoder as well? (Currently it
34 seems to convert the entire file into MIDI events first.)
35
36 * Can it be optimized?
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 common.c
9 */
10
11 #if HAVE_CONFIG_H
12 # include <config.h>
13 #endif
714
815 #include <stdio.h>
916 #include <stdlib.h>
1017 #include <string.h>
1118
12 #include <errno.h>
13 #include "config.h"
19 #include "SDL.h"
20
21 #include "options.h"
1422 #include "common.h"
15 #include "output.h"
16 #include "ctrlmode.h"
1723
18 /* I guess "rb" should be right for any libc */
19 #define OPEN_MODE "rb"
24 /* The paths in this list will be tried whenever we're reading a file */
25 static PathList *pathlist = NULL; /* This is a linked list */
2026
21 char current_filename[PATH_MAX];
22
23 static PathList *pathlist=NULL;
24
25 /* Try to open a file for reading. If the filename ends in one of the
26 defined compressor extensions, pipe the file through the decompressor */
27 static FILE *try_to_open(const char *name, int decompress, int noise_mode)
27 /* This is meant to find and open files for reading */
28 SDL_RWops *open_file(const char *name)
2829 {
29 FILE *fp;
30
31 fp=fopen(name, OPEN_MODE); /* First just check that the file exists */
32
33 if (!fp)
34 return 0;
35
36 #ifdef DECOMPRESSOR_LIST
37 if (decompress)
38 {
39 int l,el;
40 static char *decompressor_list[] = DECOMPRESSOR_LIST, **dec;
41 const char *cp;
42 char tmp[PATH_MAX], tmp2[PATH_MAX], *cp2;
43 /* Check if it's a compressed file */
44 l=strlen(name);
45 for (dec=decompressor_list; *dec; dec+=2)
46 {
47 el=strlen(*dec);
48 if ((el>=l) || (strcmp(name+l-el, *dec)))
49 continue;
50
51 /* Yes. Close the file, open a pipe instead. */
52 fclose(fp);
53
54 /* Quote some special characters in the file name */
55 cp=name;
56 cp2=tmp2;
57 while (*cp)
58 {
59 switch(*cp)
60 {
61 case '\'':
62 case '\\':
63 case ' ':
64 case '`':
65 case '!':
66 case '"':
67 case '&':
68 case ';':
69 *cp2++='\\';
70 }
71 *cp2++=*cp++;
72 }
73 *cp2=0;
74
75 sprintf(tmp, *(dec+1), tmp2);
76 fp=popen(tmp, "r");
77 break;
78 }
79 }
80 #endif
81
82 return fp;
83 }
84
85 /* This is meant to find and open files for reading, possibly piping
86 them through a decompressor. */
87 FILE *open_file(const char *name, int decompress, int noise_mode)
88 {
89 FILE *fp;
90 PathList *plp;
91 int l;
30 SDL_RWops *rw;
9231
9332 if (!name || !(*name))
9433 {
95 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Attempted to open nameless file.");
34 SNDDBG(("Attempted to open nameless file.\n"));
9635 return 0;
9736 }
9837
99 if (pathlist==NULL) {
100 /* Generate path list */
101 #ifdef DEFAULT_PATH
102 add_to_pathlist(DEFAULT_PATH);
103 #endif
104 #ifdef DEFAULT_PATH1
105 add_to_pathlist(DEFAULT_PATH1);
106 #endif
107 #ifdef DEFAULT_PATH2
108 add_to_pathlist(DEFAULT_PATH2);
109 #endif
110 #ifdef DEFAULT_PATH3
111 add_to_pathlist(DEFAULT_PATH3);
112 #endif
113 }
114
11538 /* First try the given name */
11639
117 strncpy(current_filename, name, PATH_MAX - 1);
118 current_filename[PATH_MAX - 1]='\0';
40 SNDDBG(("Trying to open %s\n", name));
41 if ((rw = SDL_RWFromFile(name, "rb")))
42 return rw;
11943
120 ctl->cmsg(CMSG_INFO, VERB_DEBUG, "Trying to open %s", current_filename);
121 if ((fp=try_to_open(current_filename, decompress, noise_mode)))
122 return fp;
44 if (name[0] != PATH_SEP)
45 {
46 char current_filename[1024];
47 PathList *plp = pathlist;
48 size_t l;
12349
124 #ifdef ENOENT
125 if (noise_mode && (errno != ENOENT))
126 {
127 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
128 current_filename, strerror(errno));
129 return 0;
130 }
131 #endif
132
133 plp=pathlist;
134 if (name[0] != PATH_SEP)
13550 while (plp) /* Try along the path then */
13651 {
137 *current_filename=0;
138 l=strlen(plp->path);
52 *current_filename = 0;
53 l = strlen(plp->path);
13954 if(l)
14055 {
14156 strcpy(current_filename, plp->path);
142 if(current_filename[l-1]!=PATH_SEP)
143 strcat(current_filename, PATH_STRING);
57 if(current_filename[l - 1] != PATH_SEP)
58 {
59 current_filename[l] = PATH_SEP;
60 current_filename[l + 1] = '\0';
61 }
14462 }
14563 strcat(current_filename, name);
146 ctl->cmsg(CMSG_INFO, VERB_DEBUG, "Trying to open %s", current_filename);
147 if ((fp=try_to_open(current_filename, decompress, noise_mode)))
148 return fp;
149 #ifdef ENOENT
150 if (noise_mode && (errno != ENOENT))
151 {
152 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
153 current_filename, strerror(errno));
154 return 0;
155 }
156 #endif
157 plp=plp->next;
64 SNDDBG(("Trying to open %s\n", current_filename));
65 if ((rw = SDL_RWFromFile(current_filename, "rb")))
66 return rw;
67 plp = plp->next;
15868 }
69 }
15970
16071 /* Nothing could be opened. */
161
162 *current_filename=0;
163
164 if (noise_mode>=2)
165 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", name, strerror(errno));
166
72 SNDDBG(("Could not open %s\n", name));
16773 return 0;
168 }
169
170 /* This closes files opened with open_file */
171 void close_file(FILE *fp)
172 {
173 #ifdef DECOMPRESSOR_LIST
174 if (pclose(fp)) /* Any better ideas? */
175 #endif
176 fclose(fp);
177
178 strncpy(current_filename, "MIDI file", PATH_MAX - 1);
179 }
180
181 /* This is meant for skipping a few bytes in a file or fifo. */
182 void skip(FILE *fp, size_t len)
183 {
184 size_t c;
185 char tmp[PATH_MAX];
186 while (len>0)
187 {
188 c=len;
189 if (c>PATH_MAX) c=PATH_MAX;
190 len-=c;
191 if (c!=fread(tmp, 1, c, fp))
192 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: skip: %s",
193 current_filename, strerror(errno));
194 }
19574 }
19675
19776 /* This'll allocate memory or die. */
19877 void *safe_malloc(size_t count)
19978 {
20079 void *p;
201 if (count > (1<<21))
202 {
203 ctl->cmsg(CMSG_FATAL, VERB_NORMAL,
204 "Strange, I feel like allocating %d bytes. This must be a bug.",
205 count);
206 }
207 else if ((p=malloc(count)))
208 return p;
209 else
210 ctl->cmsg(CMSG_FATAL, VERB_NORMAL, "Sorry. Couldn't malloc %d bytes.", count);
21180
212 ctl->close();
213 exit(10);
214 return(NULL);
81 p = malloc(count);
82 if (p == NULL) {
83 SNDDBG(("Sorry. Couldn't malloc %d bytes.\n", count));
84 }
85
86 return p;
21587 }
21688
21789 /* This adds a directory to the path list */
21890 void add_to_pathlist(const char *s)
21991 {
220 PathList *plp=safe_malloc(sizeof(PathList));
221 strcpy((plp->path=safe_malloc(strlen(s)+1)),s);
222 plp->next=pathlist;
223 pathlist=plp;
92 PathList *plp = safe_malloc(sizeof(PathList));
93
94 if (plp == NULL)
95 return;
96
97 plp->path = safe_malloc(strlen(s) + 1);
98 if (plp->path == NULL)
99 {
100 free(plp);
101 return;
102 }
103
104 strcpy(plp->path, s);
105 plp->next = pathlist;
106 pathlist = plp;
224107 }
225108
226 /* Free memory associated to path list */
227109 void free_pathlist(void)
228110 {
229 PathList *plp, *next_plp;
111 PathList *plp = pathlist;
112 PathList *next;
230113
231 plp = pathlist;
232 while (plp) {
233 if (plp->path) {
234 free(plp->path);
235 plp->path=NULL;
114 while (plp)
115 {
116 next = plp->next;
117 free(plp->path);
118 free(plp);
119 plp = next;
236120 }
237 next_plp = plp->next;
238 free(plp);
239 plp = next_plp;
240 }
241 pathlist = NULL;
121 pathlist = NULL;
242122 }
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
77
8 #include <limits.h>
9
10 #ifndef PATH_MAX /* GNU Hurd doesn't limit path size, thus no PATH_MAX... */
11 #define PATH_MAX 1024 /* ...so we'll just impose an arbitrary limit. */
12 #endif
13
14 extern char *program_name, current_filename[];
15
16 extern FILE *msgfp;
17
18 extern int num_ochannels;
19
20 #define MULTICHANNEL_OUT
21 #define MAX_OUT_CHANNELS 6
8 common.h
9 */
2210
2311 typedef struct {
2412 char *path;
2513 void *next;
2614 } PathList;
2715
28 /* Noise modes for open_file */
29 #define OF_SILENT 0
30 #define OF_NORMAL 1
31 #define OF_VERBOSE 2
32
33 extern FILE *open_file(const char *name, int decompress, int noise_mode);
16 extern SDL_RWops *open_file(const char *name);
3417 extern void add_to_pathlist(const char *s);
18 extern void *safe_malloc(size_t count);
3519 extern void free_pathlist(void);
36 extern void close_file(FILE *fp);
37 extern void skip(FILE *fp, size_t len);
38 extern void *safe_malloc(size_t count);
+0
-226
timidity/config.h less more
0 /*
1 TiMidity -- Experimental MIDI to WAVE converter
2 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 /* This is for use with the SDL library */
9 #define SDL
10 #include "SDL_config.h"
11 #include "SDL_endian.h"
12
13 #define TIMIDITY_ERROR_SIZE 1024
14
15 /* When a patch file can't be opened, one of these extensions is
16 appended to the filename and the open is tried again.
17 */
18 #define PATCH_EXT_LIST { ".pat", 0 }
19
20 /* Acoustic Grand Piano seems to be the usual default instrument. */
21 #define DEFAULT_PROGRAM 0
22
23 /* 9 here is MIDI channel 10, which is the standard percussion channel.
24 Some files (notably C:\WINDOWS\CANYON.MID) think that 16 is one too.
25 On the other hand, some files know that 16 is not a drum channel and
26 try to play music on it. This is now a runtime option, so this isn't
27 a critical choice anymore. */
28 #define DEFAULT_DRUMCHANNELS (1<<9)
29
30 /* A somewhat arbitrary frequency range. The low end of this will
31 sound terrible as no lowpass filtering is performed on most
32 instruments before resampling. */
33 #define MIN_OUTPUT_RATE 4000
34 #define MAX_OUTPUT_RATE 65000
35
36 /* In percent. */
37 /* #define DEFAULT_AMPLIFICATION 70 */
38 /* #define DEFAULT_AMPLIFICATION 50 */
39 #define DEFAULT_AMPLIFICATION 30
40
41 /* Default sampling rate, default polyphony, and maximum polyphony.
42 All but the last can be overridden from the command line. */
43 #define DEFAULT_RATE 32000
44 /* #define DEFAULT_VOICES 32 */
45 /* #define MAX_VOICES 48 */
46 #define DEFAULT_VOICES 256
47 #define MAX_VOICES 256
48 #define MAXCHAN 16
49 /* #define MAXCHAN 64 */
50 #define MAXNOTE 128
51
52 /* 1000 here will give a control ratio of 22:1 with 22 kHz output.
53 Higher CONTROLS_PER_SECOND values allow more accurate rendering
54 of envelopes and tremolo. The cost is CPU time. */
55 #define CONTROLS_PER_SECOND 1000
56
57 /* Strongly recommended. This option increases CPU usage by half, but
58 without it sound quality is very poor. */
59 #define LINEAR_INTERPOLATION
60
61 /* This is an experimental kludge that needs to be done right, but if
62 you've got an 8-bit sound card, or cheap multimedia speakers hooked
63 to your 16-bit output device, you should definitely give it a try.
64
65 Defining LOOKUP_HACK causes table lookups to be used in mixing
66 instead of multiplication. We convert the sample data to 8 bits at
67 load time and volumes to logarithmic 7-bit values before looking up
68 the product, which degrades sound quality noticeably.
69
70 Defining LOOKUP_HACK should save ~20% of CPU on an Intel machine.
71 LOOKUP_INTERPOLATION might give another ~5% */
72 /* #define LOOKUP_HACK
73 #define LOOKUP_INTERPOLATION */
74
75 /* Make envelopes twice as fast. Saves ~20% CPU time (notes decay
76 faster) and sounds more like a GUS. There is now a command line
77 option to toggle this as well. */
78 /* #define FAST_DECAY */
79
80 /* How many bits to use for the fractional part of sample positions.
81 This affects tonal accuracy. The entire position counter must fit
82 in 32 bits, so with FRACTION_BITS equal to 12, the maximum size of
83 a sample is 1048576 samples (2 megabytes in memory). The GUS gets
84 by with just 9 bits and a little help from its friends...
85 "The GUS does not SUCK!!!" -- a happy user :) */
86 #define FRACTION_BITS 12
87
88 #define MAX_SAMPLE_SIZE (1 << (32-FRACTION_BITS))
89
90 typedef double FLOAT_T;
91
92 /* For some reason the sample volume is always set to maximum in all
93 patch files. Define this for a crude adjustment that may help
94 equalize instrument volumes. */
95 #define ADJUST_SAMPLE_VOLUMES
96
97 /* The number of samples to use for ramping out a dying note. Affects
98 click removal. */
99 #define MAX_DIE_TIME 20
100
101 /* On some machines (especially PCs without math coprocessors),
102 looking up sine values in a table will be significantly faster than
103 computing them on the fly. Uncomment this to use lookups. */
104 /* #define LOOKUP_SINE */
105
106 /* Shawn McHorse's resampling optimizations. These may not in fact be
107 faster on your particular machine and compiler. You'll have to run
108 a benchmark to find out. */
109 #define PRECALC_LOOPS
110
111 /* If calling ldexp() is faster than a floating point multiplication
112 on your machine/compiler/libm, uncomment this. It doesn't make much
113 difference either way, but hey -- it was on the TODO list, so it
114 got done. */
115 /* #define USE_LDEXP */
116
117 /**************************************************************************/
118 /* Anything below this shouldn't need to be changed unless you're porting
119 to a new machine with other than 32-bit, big-endian words. */
120 /**************************************************************************/
121
122 /* change FRACTION_BITS above, not these */
123 #define INTEGER_BITS (32 - FRACTION_BITS)
124 #define INTEGER_MASK (0xFFFFFFFF << FRACTION_BITS)
125 #define FRACTION_MASK (~ INTEGER_MASK)
126
127 /* This is enforced by some computations that must fit in an int */
128 #define MAX_CONTROL_RATIO 255
129
130 typedef unsigned int uint32;
131 typedef int int32;
132 typedef unsigned short uint16;
133 typedef short int16;
134 typedef unsigned char uint8;
135 typedef char int8;
136
137 /* Instrument files are little-endian, MIDI files big-endian, so we
138 need to do some conversions. */
139
140 #define XCHG_SHORT(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))
141 # define XCHG_LONG(x) ((((x)&0xFF)<<24) | \
142 (((x)&0xFF00)<<8) | \
143 (((x)&0xFF0000)>>8) | \
144 (((x)>>24)&0xFF))
145
146 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
147 #define LE_SHORT(x) x
148 #define LE_LONG(x) x
149 #define BE_SHORT(x) XCHG_SHORT(x)
150 #define BE_LONG(x) XCHG_LONG(x)
151 #else
152 #define BE_SHORT(x) x
153 #define BE_LONG(x) x
154 #define LE_SHORT(x) XCHG_SHORT(x)
155 #define LE_LONG(x) XCHG_LONG(x)
156 #endif
157
158 #define MAX_AMPLIFICATION 800
159
160 /* You could specify a complete path, e.g. "/etc/timidity.cfg", and
161 then specify the library directory in the configuration file. */
162 #define CONFIG_FILE "timidity.cfg"
163 #define CONFIG_FILE_ETC "/etc/timidity.cfg"
164 #define CONFIG_FILE_ETC_TIMIDITY_FREEPATS "/etc/timidity/freepats.cfg"
165
166 #if defined(__WIN32__) || defined(__OS2__)
167 #define DEFAULT_PATH "C:\\TIMIDITY"
168 #else
169 #define DEFAULT_PATH "/etc/timidity"
170 #define DEFAULT_PATH1 "/usr/share/timidity"
171 #define DEFAULT_PATH2 "/usr/local/share/timidity"
172 #define DEFAULT_PATH3 "/usr/local/lib/timidity"
173 #endif
174
175 /* These affect general volume */
176 #define GUARD_BITS 3
177 #define AMP_BITS (15-GUARD_BITS)
178
179 #ifdef LOOKUP_HACK
180 typedef int8 sample_t;
181 typedef uint8 final_volume_t;
182 # define FINAL_VOLUME(v) (~_l2u[v])
183 # define MIXUP_SHIFT 5
184 # define MAX_AMP_VALUE 4095
185 #else
186 typedef int16 sample_t;
187 typedef int32 final_volume_t;
188 # define FINAL_VOLUME(v) (v)
189 # define MAX_AMP_VALUE ((1<<(AMP_BITS+1))-1)
190 #endif
191
192 typedef int16 resample_t;
193
194 #ifdef USE_LDEXP
195 # define FSCALE(a,b) ldexp((a),(b))
196 # define FSCALENEG(a,b) ldexp((a),-(b))
197 #else
198 # define FSCALE(a,b) (float)((a) * (double)(1<<(b)))
199 # define FSCALENEG(a,b) (float)((a) * (1.0L / (double)(1<<(b))))
200 #endif
201
202 /* Vibrato and tremolo Choices of the Day */
203 #define SWEEP_TUNING 38
204 #define VIBRATO_AMPLITUDE_TUNING 1.0L
205 #define VIBRATO_RATE_TUNING 38
206 #define TREMOLO_AMPLITUDE_TUNING 1.0L
207 #define TREMOLO_RATE_TUNING 38
208
209 #define SWEEP_SHIFT 16
210 #define RATE_SHIFT 5
211
212 #define VIBRATO_SAMPLE_INCREMENTS 32
213
214 #ifndef PI
215 #define PI 3.14159265358979323846
216 #endif
217
218 /* The path separator (D.M.) */
219 #if defined(__WIN32__) || defined(__OS2__)
220 # define PATH_SEP '\\'
221 # define PATH_STRING "\\"
222 #else
223 # define PATH_SEP '/'
224 # define PATH_STRING "/"
225 #endif
+0
-26
timidity/ctrlmode.c less more
0 /*
1 TiMidity -- Experimental MIDI to WAVE converter
2 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 #include "config.h"
9 #include "ctrlmode.h"
10
11 #ifdef SDL
12 extern ControlMode sdl_control_mode;
13 # ifndef DEFAULT_CONTROL_MODE
14 # define DEFAULT_CONTROL_MODE &sdl_control_mode
15 # endif
16 #endif
17
18 ControlMode *ctl_list[]={
19 #ifdef SDL
20 &sdl_control_mode,
21 #endif
22 0
23 };
24
25 ControlMode *ctl=DEFAULT_CONTROL_MODE;
+0
-74
timidity/ctrlmode.h less more
0 /*
1 TiMidity -- Experimental MIDI to WAVE converter
2 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 /* Return values for ControlMode.read */
9
10 #define RC_ERROR -1
11 #define RC_NONE 0
12 #define RC_QUIT 1
13 #define RC_NEXT 2
14 #define RC_PREVIOUS 3 /* Restart this song at beginning, or the previous
15 song if we're less than a second into this one. */
16 #define RC_FORWARD 4
17 #define RC_BACK 5
18 #define RC_JUMP 6
19 #define RC_TOGGLE_PAUSE 7 /* Pause/continue */
20 #define RC_RESTART 8 /* Restart song at beginning */
21
22 #define RC_PAUSE 9 /* Really pause playing */
23 #define RC_CONTINUE 10 /* Continue if paused */
24 #define RC_REALLY_PREVIOUS 11 /* Really go to the previous song */
25 #define RC_CHANGE_VOLUME 12
26 #define RC_LOAD_FILE 13 /* Load a new midifile */
27 #define RC_TUNE_END 14 /* The tune is over, play it again sam? */
28
29 #define CMSG_INFO 0
30 #define CMSG_WARNING 1
31 #define CMSG_ERROR 2
32 #define CMSG_FATAL 3
33 #define CMSG_TRACE 4
34 #define CMSG_TIME 5
35 #define CMSG_TOTAL 6
36 #define CMSG_FILE 7
37 #define CMSG_TEXT 8
38
39 #define VERB_NORMAL 0
40 #define VERB_VERBOSE 1
41 #define VERB_NOISY 2
42 #define VERB_DEBUG 3
43 #define VERB_DEBUG_SILLY 4
44
45 typedef struct {
46 char *id_name, id_character;
47 int verbosity, trace_playing, opened;
48
49 int (*open)(int using_stdin, int using_stdout);
50 void (*pass_playing_list)(int number_of_files, char *list_of_files[]);
51 void (*close)(void);
52 int (*read)(int32 *valp);
53 int (*cmsg)(int type, int verbosity_level, char *fmt, ...);
54
55 void (*refresh)(void);
56 void (*reset)(void);
57 void (*file_name)(char *name);
58 void (*total_time)(int tt);
59 void (*current_time)(int ct);
60
61 void (*note)(int v);
62 void (*master_volume)(int mv);
63 void (*program)(int channel, int val); /* val<0 means drum set -val */
64 void (*volume)(int channel, int val);
65 void (*expression)(int channel, int val);
66 void (*panning)(int channel, int val);
67 void (*sustain)(int channel, int val);
68 void (*pitch_bend)(int channel, int val);
69
70 } ControlMode;
71
72 extern ControlMode *ctl_list[], *ctl;
73 extern char timidity_error[];
+0
-191
timidity/filter.c less more
0 /*
1 TiMidity -- Experimental MIDI to WAVE converter
2 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Perl Artistic License, available in COPYING.
6
7 filter.c: written by Vincent Pagel ( pagel@loria.fr )
8
9 implements fir antialiasing filter : should help when setting sample
10 rates as low as 8Khz.
11
12 April 95
13 - first draft
14
15 22/5/95
16 - modify "filter" so that it simulate leading and trailing 0 in the buffer
17 */
18
19 #include <stdio.h>
20 #include <string.h>
21 #include <math.h>
22 #include <stdlib.h>
23 #include "config.h"
24 #include "common.h"
25 #include "ctrlmode.h"
26 #include "instrum.h"
27 #include "filter.h"
28
29 /* bessel function */
30 static float ino(float x)
31 {
32 float y, de, e, sde;
33 int i;
34
35 y = x / 2;
36 e = 1.0;
37 de = 1.0;
38 i = 1;
39 do {
40 de = de * y / (float) i;
41 sde = de * de;
42 e += sde;
43 } while (!( (e * 1.0e-08 - sde > 0) || (i++ > 25) ));
44 return(e);
45 }
46
47 /* Kaiser Window (symetric) */
48 static void kaiser(float *w,int n,float beta)
49 {
50 float xind, xi;
51 int i;
52
53 xind = (float)((2*n - 1) * (2*n - 1));
54 for (i =0; i<n ; i++)
55 {
56 xi = (float)(i + 0.5);
57 w[i] = ino((float)(beta * sqrt((double)(1. - 4 * xi * xi / xind))))
58 / ino((float)beta);
59 }
60 }
61
62 /*
63 * fir coef in g, cuttoff frequency in fc
64 */
65 static void designfir(float *g , float fc)
66 {
67 int i;
68 float xi, omega, att, beta ;
69 float w[ORDER2];
70
71 for (i =0; i < ORDER2 ;i++)
72 {
73 xi = (float) (i + 0.5);
74 omega = (float)(PI * xi);
75 g[i] = (float)(sin( (double) omega * fc) / omega);
76 }
77
78 att = 40.; /* attenuation in db */
79 beta = (float) (exp(log((double)0.58417 * (att - 20.96)) * 0.4) + 0.07886
80 * (att - 20.96));
81 kaiser( w, ORDER2, beta);
82
83 /* Matrix product */
84 for (i =0; i < ORDER2 ; i++)
85 g[i] = g[i] * w[i];
86 }
87
88 /*
89 * FIR filtering -> apply the filter given by coef[] to the data buffer
90 * Note that we simulate leading and trailing 0 at the border of the
91 * data buffer
92 */
93 static void filter(sample_t *result,sample_t *data, int32 length,float coef[])
94 {
95 int32 sample,i,sample_window;
96 int16 peak = 0;
97 float sum;
98
99 /* Simulate leading 0 at the begining of the buffer */
100 for (sample = 0; sample < ORDER2 ; sample++ )
101 {
102 sum = 0.0;
103 sample_window= sample - ORDER2;
104
105 for (i = 0; i < ORDER ;i++)
106 sum += (float)(coef[i] *
107 ((sample_window<0)? 0.0 : data[sample_window++])) ;
108
109 /* Saturation ??? */
110 if (sum> 32767.) { sum=32767.; peak++; }
111 if (sum< -32768.) { sum=-32768; peak++; }
112 result[sample] = (sample_t) sum;
113 }
114
115 /* The core of the buffer */
116 for (sample = ORDER2; sample < length - ORDER + ORDER2 ; sample++ )
117 {
118 sum = 0.0;
119 sample_window= sample - ORDER2;
120
121 for (i = 0; i < ORDER ;i++)
122 sum += data[sample_window++] * coef[i];
123
124 /* Saturation ??? */
125 if (sum> 32767.) { sum=32767.; peak++; }
126 if (sum< -32768.) { sum=-32768; peak++; }
127 result[sample] = (sample_t) sum;
128 }
129
130 /* Simulate 0 at the end of the buffer */
131 for (sample = length - ORDER + ORDER2; sample < length ; sample++ )
132 {
133 sum = 0.0;
134 sample_window= sample - ORDER2;
135
136 for (i = 0; i < ORDER ;i++)
137 sum += (float)(coef[i] *
138 ((sample_window>=length)? 0.0 : data[sample_window++])) ;
139
140 /* Saturation ??? */
141 if (sum> 32767.) { sum=32767.; peak++; }
142 if (sum< -32768.) { sum=-32768; peak++; }
143 result[sample] = (sample_t) sum;
144 }
145
146 if (peak)
147 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
148 "Saturation %2.3f %%.", 100.0*peak/ (float) length);
149 }
150
151 /***********************************************************************/
152 /* Prevent aliasing by filtering any freq above the output_rate */
153 /* */
154 /* I don't worry about looping point -> they will remain soft if they */
155 /* were already */
156 /***********************************************************************/
157 void antialiasing(Sample *sp, int32 output_rate )
158 {
159 sample_t *temp;
160 int i;
161 float fir_symetric[ORDER];
162 float fir_coef[ORDER2];
163 float freq_cut; /* cutoff frequency [0..1.0] FREQ_CUT/SAMP_FREQ*/
164
165
166 ctl->cmsg(CMSG_INFO, VERB_NOISY, "Antialiasing: Fsample=%iKHz",
167 sp->sample_rate);
168
169 /* No oversampling */
170 if (output_rate>=sp->sample_rate)
171 return;
172
173 freq_cut= (float) output_rate / (float) sp->sample_rate;
174 ctl->cmsg(CMSG_INFO, VERB_NOISY, "Antialiasing: cutoff=%f%%",
175 freq_cut*100.);
176
177 designfir(fir_coef,freq_cut);
178
179 /* Make the filter symetric */
180 for (i = 0 ; i<ORDER2 ;i++)
181 fir_symetric[ORDER-1 - i] = fir_symetric[i] = fir_coef[ORDER2-1 - i];
182
183 /* We apply the filter we have designed on a copy of the patch */
184 temp = safe_malloc(sp->data_length);
185 memcpy(temp,sp->data,sp->data_length);
186
187 filter(sp->data,temp,sp->data_length/sizeof(sample_t),fir_symetric);
188
189 free(temp);
190 }
+0
-23
timidity/filter.h less more
0 /*
1 TiMidity -- Experimental MIDI to WAVE converter
2 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Perl Artistic License, available in COPYING.
6
7 filter.h : written by Vincent Pagel ( pagel@loria.fr )
8
9 implements fir antialiasing filter : should help when setting sample
10 rates as low as 8Khz.
11
12 */
13
14 /* Order of the FIR filter = 20 should be enough ! */
15 #define ORDER 20
16 #define ORDER2 ORDER/2
17
18 #ifndef PI
19 #define PI 3.14159265
20 #endif
21
22 extern void antialiasing(Sample *sp, int32 output_rate);
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 instrum.c
9
10 Code to load and unload GUS-compatible instrument patches.
11
12 */
13
14 #if HAVE_CONFIG_H
15 # include <config.h>
16 #endif
717
818 #include <stdio.h>
919 #include <string.h>
1020 #include <stdlib.h>
1121
12 #include "config.h"
22 #include "SDL.h"
23
24 #include "timidity.h"
25 #include "options.h"
1326 #include "common.h"
1427 #include "instrum.h"
15 #include "playmidi.h"
16 #include "output.h"
17 #include "ctrlmode.h"
1828 #include "resample.h"
1929 #include "tables.h"
20 #include "filter.h"
21
22 /* Some functions get aggravated if not even the standard banks are
23 available. */
24 static ToneBank standard_tonebank, standard_drumset;
25 ToneBank
26 *tonebank[MAXBANK]={&standard_tonebank},
27 *drumset[MAXBANK]={&standard_drumset};
28
29 /* This is a special instrument, used for all melodic programs */
30 InstrumentLayer *default_instrument=0;
31
32 /* This is only used for tracks that don't specify a program */
33 int default_program=DEFAULT_PROGRAM;
34
35 int antialiasing_allowed=0;
36 #ifdef FAST_DECAY
37 int fast_decay=1;
38 #else
39 int fast_decay=0;
40 #endif
41
42
43 int current_tune_number = 0;
44 int last_tune_purged = 0;
45 int current_patch_memory = 0;
46 int max_patch_memory = 60000000;
47
48 static void purge_as_required(void);
4930
5031 static void free_instrument(Instrument *ip)
5132 {
5233 Sample *sp;
5334 int i;
5435 if (!ip) return;
55
56 if (!ip->contents)
5736 for (i=0; i<ip->samples; i++)
5837 {
5938 sp=&(ip->sample[i]);
60 if (sp->data) free(sp->data);
39 free(sp->data);
6140 }
6241 free(ip->sample);
63
64 if (!ip->contents)
65 for (i=0; i<ip->right_samples; i++)
66 {
67 sp=&(ip->right_sample[i]);
68 if (sp->data) free(sp->data);
69 }
70 if (ip->right_sample)
71 free(ip->right_sample);
7242 free(ip);
7343 }
7444
75
76 static void free_layer(InstrumentLayer *lp)
77 {
78 InstrumentLayer *next;
79
80 current_patch_memory -= lp->size;
81
82 for (; lp; lp = next)
83 {
84 next = lp->next;
85 free_instrument(lp->instrument);
86 free(lp);
87 }
88 }
89
90 static void free_bank(int dr, int b)
45 static void free_bank(MidiSong *song, int dr, int b)
9146 {
9247 int i;
93 ToneBank *bank=((dr) ? drumset[b] : tonebank[b]);
94 for (i=0; i<MAXPROG; i++)
95 {
96 if (bank->tone[i].layer)
97 {
98 /* Not that this could ever happen, of course */
99 if (bank->tone[i].layer != MAGIC_LOAD_INSTRUMENT)
100 {
101 free_layer(bank->tone[i].layer);
102 bank->tone[i].layer=NULL;
103 bank->tone[i].last_used=-1;
104 }
105 }
106 if (bank->tone[i].name)
107 {
108 free(bank->tone[i].name);
109 bank->tone[i].name = NULL;
110 }
111 }
112 }
113
114
115 static void free_old_bank(int dr, int b, int how_old)
116 {
117 int i;
118 ToneBank *bank=((dr) ? drumset[b] : tonebank[b]);
119 for (i=0; i<MAXPROG; i++)
120 if (bank->tone[i].layer && bank->tone[i].last_used < how_old)
48 ToneBank *bank=((dr) ? song->drumset[b] : song->tonebank[b]);
49 for (i=0; i<MAXBANK; i++)
50 if (bank->instrument[i])
12151 {
122 if (bank->tone[i].layer != MAGIC_LOAD_INSTRUMENT)
123 {
124 ctl->cmsg(CMSG_INFO, VERB_DEBUG,
125 "Unloading %s %s[%d,%d] - last used %d.",
126 (dr)? "drum" : "inst", bank->tone[i].name,
127 i, b, bank->tone[i].last_used);
128 free_layer(bank->tone[i].layer);
129 bank->tone[i].layer=NULL;
130 bank->tone[i].last_used=-1;
131 }
52 /* Not that this could ever happen, of course */
53 if (bank->instrument[i] != MAGIC_LOAD_INSTRUMENT)
54 free_instrument(bank->instrument[i]);
55 bank->instrument[i]=0;
13256 }
13357 }
13458
135
136 int32 convert_envelope_rate_attack(uint8 rate, uint8 fastness)
137 {
138 int32 r;
139
140 r=3-((rate>>6) & 0x3);
141 r*=3;
142 r = (int32)(rate & 0x3f) << r; /* 6.9 fixed point */
59 static Sint32 convert_envelope_rate(MidiSong *song, Uint8 rate)
60 {
61 Sint32 r;
62
63 r = 3 - ((rate >> 6) & 0x3);
64 r *= 3;
65 r = (Sint32) (rate & 0x3f) << r; /* 6.9 fixed point */
14366
14467 /* 15.15 fixed point. */
145 return (((r * 44100) / play_mode->rate) * control_ratio)
146 << 10;
147 }
148
149 int32 convert_envelope_rate(uint8 rate)
150 {
151 int32 r;
152
153 r=3-((rate>>6) & 0x3);
154 r*=3;
155 r = (int32)(rate & 0x3f) << r; /* 6.9 fixed point */
156
157 /* 15.15 fixed point. */
158 return (((r * 44100) / play_mode->rate) * control_ratio)
159 << ((fast_decay) ? 10 : 9);
160 }
161
162 int32 convert_envelope_offset(uint8 offset)
68 r = ((r * 44100) / song->rate) * song->control_ratio;
69
70 #ifdef FAST_DECAY
71 return r << 10;
72 #else
73 return r << 9;
74 #endif
75 }
76
77 static Sint32 convert_envelope_offset(Uint8 offset)
16378 {
16479 /* This is not too good... Can anyone tell me what these values mean?
16580 Are they GUS-style "exponential" volumes? And what does that mean? */
16883 return offset << (7+15);
16984 }
17085
171 int32 convert_tremolo_sweep(uint8 sweep)
86 static Sint32 convert_tremolo_sweep(MidiSong *song, Uint8 sweep)
17287 {
17388 if (!sweep)
17489 return 0;
17590
17691 return
177 ((control_ratio * SWEEP_TUNING) << SWEEP_SHIFT) /
178 (play_mode->rate * sweep);
179 }
180
181 int32 convert_vibrato_sweep(uint8 sweep, int32 vib_control_ratio)
92 ((song->control_ratio * SWEEP_TUNING) << SWEEP_SHIFT) /
93 (song->rate * sweep);
94 }
95
96 static Sint32 convert_vibrato_sweep(MidiSong *song, Uint8 sweep,
97 Sint32 vib_control_ratio)
18298 {
18399 if (!sweep)
184100 return 0;
185101
186102 return
187 (int32) (FSCALE((double) (vib_control_ratio) * SWEEP_TUNING, SWEEP_SHIFT)
188 / (double)(play_mode->rate * sweep));
103 (Sint32) (FSCALE((double) (vib_control_ratio) * SWEEP_TUNING, SWEEP_SHIFT)
104 / (double)(song->rate * sweep));
189105
190106 /* this was overflowing with seashore.pat
191107
192108 ((vib_control_ratio * SWEEP_TUNING) << SWEEP_SHIFT) /
193 (play_mode->rate * sweep); */
194 }
195
196 int32 convert_tremolo_rate(uint8 rate)
109 (song->rate * sweep); */
110 }
111
112 static Sint32 convert_tremolo_rate(MidiSong *song, Uint8 rate)
197113 {
198114 return
199 ((SINE_CYCLE_LENGTH * control_ratio * rate) << RATE_SHIFT) /
200 (TREMOLO_RATE_TUNING * play_mode->rate);
201 }
202
203 int32 convert_vibrato_rate(uint8 rate)
115 ((SINE_CYCLE_LENGTH * song->control_ratio * rate) << RATE_SHIFT) /
116 (TREMOLO_RATE_TUNING * song->rate);
117 }
118
119 static Sint32 convert_vibrato_rate(MidiSong *song, Uint8 rate)
204120 {
205121 /* Return a suitable vibrato_control_ratio value */
206122 return
207 (VIBRATO_RATE_TUNING * play_mode->rate) /
123 (VIBRATO_RATE_TUNING * song->rate) /
208124 (rate * 2 * VIBRATO_SAMPLE_INCREMENTS);
209125 }
210126
211 static void reverse_data(int16 *sp, int32 ls, int32 le)
212 {
213 int16 s, *ep=sp+le;
127 static void reverse_data(Sint16 *sp, Sint32 ls, Sint32 le)
128 {
129 Sint16 s, *ep=sp+le;
214130 sp+=ls;
215131 le-=ls;
216132 le/=2;
232148 undefined.
233149
234150 TODO: do reverse loops right */
235 static InstrumentLayer *load_instrument(const char *name, int font_type, int percussion,
236 int panning, int amp, int cfg_tuning, int note_to_use,
151 static Instrument *load_instrument(MidiSong *song, char *name, int percussion,
152 int panning, int amp, int note_to_use,
237153 int strip_loop, int strip_envelope,
238 int strip_tail, int bank, int gm_num, int sf_ix)
239 {
240 InstrumentLayer *lp, *lastlp, *headlp = 0;
154 int strip_tail)
155 {
241156 Instrument *ip;
242 FILE *fp;
243 uint8 tmp[1024];
157 Sample *sp;
158 SDL_RWops *rw;
159 char tmp[1024];
244160 int i,j,noluck=0;
245 #ifdef PATCH_EXT_LIST
246161 static char *patch_ext[] = PATCH_EXT_LIST;
247 #endif
248 int sf2flag = 0;
249 int right_samples = 0;
250 int stereo_channels = 1, stereo_layer;
251 int vlayer_list[19][4], vlayer, vlayer_count = 0;
252162
253163 if (!name) return 0;
254164
255165 /* Open patch file */
256 if ((fp=open_file(name, 1, OF_NORMAL)) == NULL)
166 if ((rw=open_file(name)) == NULL)
257167 {
258168 noluck=1;
259 #ifdef PATCH_EXT_LIST
260169 /* Try with various extensions */
261170 for (i=0; patch_ext[i]; i++)
262171 {
263 if (strlen(name)+strlen(patch_ext[i])<PATH_MAX)
264 {
265 char path[PATH_MAX];
266 strcpy(path, name);
267 strcat(path, patch_ext[i]);
268 if ((fp=open_file(path, 1, OF_NORMAL)) != NULL)
172 if (strlen(name)+strlen(patch_ext[i])<1024)
173 {
174 strcpy(tmp, name);
175 strcat(tmp, patch_ext[i]);
176 if ((rw=open_file(tmp)) != NULL)
269177 {
270178 noluck=0;
271179 break;
272180 }
273181 }
274182 }
275 #endif
276183 }
277184
278185 if (noluck)
279186 {
280 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
281 "Instrument `%s' can't be found.", name);
187 SNDDBG(("Instrument `%s' can't be found.\n", name));
282188 return 0;
283189 }
284190
285 /*ctl->cmsg(CMSG_INFO, VERB_NOISY, "Loading instrument %s", current_filename);*/
191 SNDDBG(("Loading instrument %s\n", tmp));
286192
287193 /* Read some headers and do cursory sanity checks. There are loads
288194 of magic offsets. This could be rewritten... */
289195
290 if ((239 != fread(tmp, 1, 239, fp)) ||
196 if ((239 != SDL_RWread(rw, tmp, 1, 239)) ||
291197 (memcmp(tmp, "GF1PATCH110\0ID#000002", 22) &&
292198 memcmp(tmp, "GF1PATCH100\0ID#000002", 22))) /* don't know what the
293199 differences are */
294200 {
295 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: not an instrument", name);
201 SNDDBG(("%s: not an instrument\n", name));
202 SDL_RWclose(rw);
296203 return 0;
297204 }
298
299 /* patch layout:
300 * bytes: info: starts at offset:
301 * 22 id (see above) 0
302 * 60 copyright 22
303 * 1 instruments 82
304 * 1 voices 83
305 * 1 channels 84
306 * 2 number of waveforms 85
307 * 2 master volume 87
308 * 4 datasize 89
309 * 36 reserved, but now: 93
310 * 7 "SF2EXT\0" id 93
311 * 1 right samples 100
312 * 28 reserved 101
313 * 2 instrument number 129
314 * 16 instrument name 131
315 * 4 instrument size 147
316 * 1 number of layers 151
317 * 40 reserved 152
318 * 1 layer duplicate 192
319 * 1 layer number 193
320 * 4 layer size 194
321 * 1 number of samples 198
322 * 40 reserved 199
323 * 239
324 * THEN, for each sample, see below
325 */
326
327 if (!memcmp(tmp + 93, "SF2EXT", 6))
328 {
329 sf2flag = 1;
330 vlayer_count = tmp[152];
331 }
332
205
333206 if (tmp[82] != 1 && tmp[82] != 0) /* instruments. To some patch makers,
334207 0 means 1 */
335208 {
336 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
337 "Can't handle patches with %d instruments", tmp[82]);
209 SNDDBG(("Can't handle patches with %d instruments\n", tmp[82]));
210 SDL_RWclose(rw);
338211 return 0;
339212 }
340213
341214 if (tmp[151] != 1 && tmp[151] != 0) /* layers. What's a layer? */
342215 {
343 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
344 "Can't handle instruments with %d layers", tmp[151]);
216 SNDDBG(("Can't handle instruments with %d layers\n", tmp[151]));
217 SDL_RWclose(rw);
345218 return 0;
346219 }
347220
348
349 if (sf2flag && vlayer_count > 0) {
350 for (i = 0; i < 9; i++)
351 for (j = 0; j < 4; j++)
352 vlayer_list[i][j] = tmp[153+i*4+j];
353 for (i = 9; i < 19; i++)
354 for (j = 0; j < 4; j++)
355 vlayer_list[i][j] = tmp[199+(i-9)*4+j];
356 }
357 else {
358 for (i = 0; i < 19; i++)
359 for (j = 0; j < 4; j++)
360 vlayer_list[i][j] = 0;
361 vlayer_list[0][0] = 0;
362 vlayer_list[0][1] = 127;
363 vlayer_list[0][2] = tmp[198];
364 vlayer_list[0][3] = 0;
365 vlayer_count = 1;
366 }
367
368 lastlp = 0;
369
370 for (vlayer = 0; vlayer < vlayer_count; vlayer++) {
371
372 lp=(InstrumentLayer *)safe_malloc(sizeof(InstrumentLayer));
373 lp->size = sizeof(InstrumentLayer);
374 lp->lo = vlayer_list[vlayer][0];
375 lp->hi = vlayer_list[vlayer][1];
376 ip=(Instrument *)safe_malloc(sizeof(Instrument));
377 lp->size += sizeof(Instrument);
378 lp->instrument = ip;
379 lp->next = 0;
380
381 if (lastlp) lastlp->next = lp;
382 else headlp = lp;
383
384 lastlp = lp;
385
386 if (sf2flag) ip->type = INST_SF2;
387 else ip->type = INST_GUS;
388 ip->samples = vlayer_list[vlayer][2];
389 ip->sample = (Sample *)safe_malloc(sizeof(Sample) * ip->samples);
390 lp->size += sizeof(Sample) * ip->samples;
391 ip->left_samples = ip->samples;
392 ip->left_sample = ip->sample;
393 right_samples = vlayer_list[vlayer][3];
394 ip->right_samples = right_samples;
395 if (right_samples)
396 {
397 ip->right_sample = (Sample *)safe_malloc(sizeof(Sample) * right_samples);
398 lp->size += sizeof(Sample) * right_samples;
399 stereo_channels = 2;
400 }
401 else ip->right_sample = 0;
402 ip->contents = 0;
403
404 ctl->cmsg(CMSG_INFO, VERB_NOISY, "%s%s[%d,%d] %s(%d-%d layer %d of %d)",
405 (percussion)? " ":"", name,
406 (percussion)? note_to_use : gm_num, bank,
407 (right_samples)? "(2) " : "",
408 lp->lo, lp->hi, vlayer+1, vlayer_count);
409
410 for (stereo_layer = 0; stereo_layer < stereo_channels; stereo_layer++)
411 {
412 int sample_count = 0;
413
414 if (stereo_layer == 0) sample_count = ip->left_samples;
415 else if (stereo_layer == 1) sample_count = ip->right_samples;
416
417 for (i=0; i < sample_count; i++)
418 {
419 uint8 fractions;
420 int32 tmplong;
421 uint16 tmpshort;
422 uint16 sample_volume = 0;
423 uint8 tmpchar;
424 Sample *sp = 0;
425 uint8 sf2delay = 0;
221 ip=safe_malloc(sizeof(Instrument));
222 ip->samples = tmp[198];
223 ip->sample = safe_malloc(sizeof(Sample) * ip->samples);
224 for (i=0; i<ip->samples; i++)
225 {
226
227 Uint8 fractions;
228 Sint32 tmplong;
229 Uint16 tmpshort;
230 Uint8 tmpchar;
426231
427232 #define READ_CHAR(thing) \
428 if ((size_t)1 != fread(&tmpchar, 1, 1, fp)) goto fail; \
233 if (1 != SDL_RWread(rw, &tmpchar, 1, 1)) goto fail; \
429234 thing = tmpchar;
430235 #define READ_SHORT(thing) \
431 if ((size_t)1 != fread(&tmpshort, 2, 1, fp)) goto fail; \
432 thing = LE_SHORT(tmpshort);
236 if (1 != SDL_RWread(rw, &tmpshort, 2, 1)) goto fail; \
237 thing = SDL_SwapLE16(tmpshort);
433238 #define READ_LONG(thing) \
434 if ((size_t)1 != fread(&tmplong, 4, 1, fp)) goto fail; \
435 thing = LE_LONG(tmplong);
436
437 /*
438 * 7 sample name
439 * 1 fractions
440 * 4 length
441 * 4 loop start
442 * 4 loop end
443 * 2 sample rate
444 * 4 low frequency
445 * 4 high frequency
446 * 2 finetune
447 * 1 panning
448 * 6 envelope rates |
449 * 6 envelope offsets | 18 bytes
450 * 3 tremolo sweep, rate, depth |
451 * 3 vibrato sweep, rate, depth |
452 * 1 sample mode
453 * 2 scale frequency
454 * 2 scale factor
455 * 2 sample volume (??)
456 * 34 reserved
457 * Now: 1 delay
458 * 33 reserved
459 */
460 skip(fp, 7); /* Skip the wave name */
461
462 if (1 != fread(&fractions, 1, 1, fp))
239 if (1 != SDL_RWread(rw, &tmplong, 4, 1)) goto fail; \
240 thing = SDL_SwapLE32(tmplong);
241
242 SDL_RWseek(rw, 7, RW_SEEK_CUR); /* Skip the wave name */
243
244 if (1 != SDL_RWread(rw, &fractions, 1, 1))
463245 {
464246 fail:
465 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Error reading sample %d", i);
466 if (stereo_layer == 1)
467 {
468 for (j=0; j<i; j++)
469 free(ip->right_sample[j].data);
470 free(ip->right_sample);
471 i = ip->left_samples;
472 }
247 SNDDBG(("Error reading sample %d\n", i));
473248 for (j=0; j<i; j++)
474 free(ip->left_sample[j].data);
475 free(ip->left_sample);
249 free(ip->sample[j].data);
250 free(ip->sample);
476251 free(ip);
477 free(lp);
252 SDL_RWclose(rw);
478253 return 0;
479254 }
480255
481 if (stereo_layer == 0) sp=&(ip->left_sample[i]);
482 else if (stereo_layer == 1) sp=&(ip->right_sample[i]);
483
256 sp=&(ip->sample[i]);
257
484258 READ_LONG(sp->data_length);
485259 READ_LONG(sp->loop_start);
486260 READ_LONG(sp->loop_end);
488262 READ_LONG(sp->low_freq);
489263 READ_LONG(sp->high_freq);
490264 READ_LONG(sp->root_freq);
491 skip(fp, 2); /* Why have a "root frequency" and then "tuning"?? */
265 SDL_RWseek(rw, 2, RW_SEEK_CUR); /* Why have a "root frequency" and then
266 * "tuning"?? */
492267
493268 READ_CHAR(tmp[0]);
494269
495270 if (panning==-1)
496271 sp->panning = (tmp[0] * 8 + 4) & 0x7f;
497272 else
498 sp->panning=(uint8)(panning & 0x7F);
499
500 sp->resonance=0;
501 sp->cutoff_freq=0;
502 sp->reverberation=0;
503 sp->chorusdepth=0;
504 sp->exclusiveClass=0;
505 sp->keyToModEnvHold=0;
506 sp->keyToModEnvDecay=0;
507 sp->keyToVolEnvHold=0;
508 sp->keyToVolEnvDecay=0;
509
510 if (cfg_tuning)
511 {
512 double tune_factor = (double)(cfg_tuning)/1200.0;
513 tune_factor = pow(2.0, tune_factor);
514 sp->root_freq = (uint32)( tune_factor * (double)sp->root_freq );
515 }
273 sp->panning=(Uint8)(panning & 0x7F);
516274
517275 /* envelope, tremolo, and vibrato */
518 if (18 != fread(tmp, 1, 18, fp)) goto fail;
276 if (18 != SDL_RWread(rw, tmp, 1, 18)) goto fail;
519277
520278 if (!tmp[13] || !tmp[14])
521279 {
522280 sp->tremolo_sweep_increment=
523281 sp->tremolo_phase_increment=sp->tremolo_depth=0;
524 ctl->cmsg(CMSG_INFO, VERB_DEBUG, " * no tremolo");
282 SNDDBG((" * no tremolo\n"));
525283 }
526284 else
527285 {
528 sp->tremolo_sweep_increment=convert_tremolo_sweep(tmp[12]);
529 sp->tremolo_phase_increment=convert_tremolo_rate(tmp[13]);
286 sp->tremolo_sweep_increment=convert_tremolo_sweep(song, tmp[12]);
287 sp->tremolo_phase_increment=convert_tremolo_rate(song, tmp[13]);
530288 sp->tremolo_depth=tmp[14];
531 ctl->cmsg(CMSG_INFO, VERB_DEBUG,
532 " * tremolo: sweep %d, phase %d, depth %d",
289 SNDDBG((" * tremolo: sweep %d, phase %d, depth %d\n",
533290 sp->tremolo_sweep_increment, sp->tremolo_phase_increment,
534 sp->tremolo_depth);
291 sp->tremolo_depth));
535292 }
536293
537294 if (!tmp[16] || !tmp[17])
538295 {
539296 sp->vibrato_sweep_increment=
540297 sp->vibrato_control_ratio=sp->vibrato_depth=0;
541 ctl->cmsg(CMSG_INFO, VERB_DEBUG, " * no vibrato");
298 SNDDBG((" * no vibrato\n"));
542299 }
543300 else
544301 {
545 sp->vibrato_control_ratio=convert_vibrato_rate(tmp[16]);
302 sp->vibrato_control_ratio=convert_vibrato_rate(song, tmp[16]);
546303 sp->vibrato_sweep_increment=
547 convert_vibrato_sweep(tmp[15], sp->vibrato_control_ratio);
304 convert_vibrato_sweep(song, tmp[15], sp->vibrato_control_ratio);
548305 sp->vibrato_depth=tmp[17];
549 ctl->cmsg(CMSG_INFO, VERB_DEBUG,
550 " * vibrato: sweep %d, ctl %d, depth %d",
306 SNDDBG((" * vibrato: sweep %d, ctl %d, depth %d\n",
551307 sp->vibrato_sweep_increment, sp->vibrato_control_ratio,
552 sp->vibrato_depth);
308 sp->vibrato_depth));
553309
554310 }
555311
556312 READ_CHAR(sp->modes);
557 READ_SHORT(tmpshort);
558 sp->freq_center = (uint8)tmpshort;
559 READ_SHORT(sp->freq_scale);
560
561 if (sf2flag)
562 {
563 READ_SHORT(sample_volume);
564 READ_CHAR(sf2delay);
565 READ_CHAR(sp->exclusiveClass);
566 skip(fp, 32);
567 }
568 else
569 {
570 skip(fp, 36);
571 }
313
314 SDL_RWseek(rw, 40, RW_SEEK_CUR); /* skip the useless scale frequency, scale
315 factor (what's it mean?), and reserved
316 space */
572317
573318 /* Mark this as a fixed-pitch instrument if such a deed is desired. */
574319 if (note_to_use!=-1)
575 sp->note_to_use=(uint8)(note_to_use);
320 sp->note_to_use=(Uint8)(note_to_use);
576321 else
577322 sp->note_to_use=0;
578323
589334 (sp->modes & (MODES_SUSTAIN | MODES_LOOPING |
590335 MODES_PINGPONG | MODES_REVERSE)))
591336 {
592 ctl->cmsg(CMSG_INFO, VERB_DEBUG, " - Removing loop and/or sustain");
337 SNDDBG((" - Removing loop and/or sustain\n"));
593338 sp->modes &=~(MODES_SUSTAIN | MODES_LOOPING |
594339 MODES_PINGPONG | MODES_REVERSE);
595340 }
596341
597342 if (strip_envelope==1)
598343 {
599 if (sp->modes & MODES_ENVELOPE)
600 ctl->cmsg(CMSG_INFO, VERB_DEBUG, " - Removing envelope");
344 if (sp->modes & MODES_ENVELOPE) {
345 SNDDBG((" - Removing envelope\n"));
346 }
601347 sp->modes &= ~MODES_ENVELOPE;
602348 }
603349 else if (strip_envelope != 0)
608354 /* No loop? Then what's there to sustain? No envelope needed
609355 either... */
610356 sp->modes &= ~(MODES_SUSTAIN|MODES_ENVELOPE);
611 ctl->cmsg(CMSG_INFO, VERB_DEBUG,
612 " - No loop, removing sustain and envelope");
357 SNDDBG((" - No loop, removing sustain and envelope\n"));
613358 }
614359 else if (!memcmp(tmp, "??????", 6) || tmp[11] >= 100)
615360 {
616361 /* Envelope rates all maxed out? Envelope end at a high "offset"?
617362 That's a weird envelope. Take it out. */
618363 sp->modes &= ~MODES_ENVELOPE;
619 ctl->cmsg(CMSG_INFO, VERB_DEBUG,
620 " - Weirdness, removing envelope");
364 SNDDBG((" - Weirdness, removing envelope\n"));
621365 }
622366 else if (!(sp->modes & MODES_SUSTAIN))
623367 {
626370 envelope either... at least the Gravis ones. They're mostly
627371 drums. I think. */
628372 sp->modes &= ~MODES_ENVELOPE;
629 ctl->cmsg(CMSG_INFO, VERB_DEBUG,
630 " - No sustain, removing envelope");
631 }
632 }
633
634 sp->attenuation = 0;
635
636 for (j=ATTACK; j<DELAY; j++)
373 SNDDBG((" - No sustain, removing envelope\n"));
374 }
375 }
376
377 for (j=0; j<6; j++)
637378 {
638379 sp->envelope_rate[j]=
639 (j<3)? convert_envelope_rate_attack(tmp[j], 11) : convert_envelope_rate(tmp[j]);
380 convert_envelope_rate(song, tmp[j]);
640381 sp->envelope_offset[j]=
641382 convert_envelope_offset(tmp[6+j]);
642383 }
643 if (sf2flag)
644 {
645 if (sf2delay > 5) sf2delay = 5;
646 sp->envelope_rate[DELAY] = (int32)( (sf2delay*play_mode->rate) / 1000 );
647 }
648 else
649 {
650 sp->envelope_rate[DELAY]=0;
651 }
652 sp->envelope_offset[DELAY]=0;
653
654 for (j=ATTACK; j<DELAY; j++)
655 {
656 sp->modulation_rate[j]=sp->envelope_rate[j];
657 sp->modulation_offset[j]=sp->envelope_offset[j];
658 }
659 sp->modulation_rate[DELAY] = sp->modulation_offset[DELAY] = 0;
660 sp->modEnvToFilterFc=0;
661 sp->modEnvToPitch=0;
662 sp->lfo_sweep_increment = 0;
663 sp->lfo_phase_increment = 0;
664 sp->modLfoToFilterFc = 0;
665 sp->vibrato_delay = 0;
666384
667385 /* Then read the sample data */
668 if (sp->data_length/2 > MAX_SAMPLE_SIZE)
669 {
670 goto fail;
671 }
672 sp->data = (sample_t *)safe_malloc(sp->data_length + 1);
673 lp->size += sp->data_length + 1;
674
675 if (1 != fread(sp->data, sp->data_length, 1, fp))
386 sp->data = (sample_t *) safe_malloc(sp->data_length+4);
387 if (1 != SDL_RWread(rw, sp->data, sp->data_length, 1))
676388 goto fail;
677389
678390 if (!(sp->modes & MODES_16BIT)) /* convert to 16-bit data */
679391 {
680 int32 i=sp->data_length;
681 uint8 *cp=(uint8 *)(sp->data);
682 uint16 *tmp,*newdta;
683 tmp=newdta=(uint16 *)safe_malloc(sp->data_length*2 + 2);
684 while (i--)
685 *tmp++ = (uint16)(*cp++) << 8;
686 cp=(uint8 *)(sp->data);
687 sp->data = (sample_t *)newdta;
688 free(cp);
392 Sint32 k=sp->data_length;
393 Uint8 *cp=(Uint8 *)(sp->data);
394 Uint16 *tmp16,*new16;
689395 sp->data_length *= 2;
690396 sp->loop_start *= 2;
691397 sp->loop_end *= 2;
398 tmp16 = new16 = (Uint16 *) safe_malloc(sp->data_length+4);
399 while (k--)
400 *tmp16++ = (Uint16)(*cp++) << 8;
401 free(sp->data);
402 sp->data = (sample_t *)new16;
692403 }
693404 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
694405 else
695406 /* convert to machine byte order */
696407 {
697 int32 i=sp->data_length/2;
698 int16 *tmp=(int16 *)sp->data,s;
699 while (i--)
700 {
701 s=LE_SHORT(*tmp);
702 *tmp++=s;
408 Sint32 k=sp->data_length/2;
409 Sint16 *tmp16=(Sint16 *)sp->data,s;
410 while (k--)
411 {
412 s=SDL_SwapLE16(*tmp16);
413 *tmp16++=s;
703414 }
704415 }
705416 #endif
706417
707418 if (sp->modes & MODES_UNSIGNED) /* convert to signed data */
708419 {
709 int32 i=sp->data_length/2;
710 int16 *tmp=(int16 *)sp->data;
711 while (i--)
712 *tmp++ ^= 0x8000;
420 Sint32 k=sp->data_length/2;
421 Sint16 *tmp16=(Sint16 *)sp->data;
422 while (k--)
423 *tmp16++ ^= 0x8000;
713424 }
714425
715426 /* Reverse reverse loops and pass them off as normal loops */
716427 if (sp->modes & MODES_REVERSE)
717428 {
718 int32 t;
429 Sint32 t;
719430 /* The GUS apparently plays reverse loops by reversing the
720431 whole sample. We do the same because the GUS does not SUCK. */
721432
722 ctl->cmsg(CMSG_WARNING, VERB_NORMAL, "Reverse loop in %s", name);
723 reverse_data((int16 *)sp->data, 0, sp->data_length/2);
433 SNDDBG(("Reverse loop in %s\n", name));
434 reverse_data((Sint16 *)sp->data, 0, sp->data_length/2);
724435
725436 t=sp->loop_start;
726437 sp->loop_start=sp->data_length - sp->loop_end;
730441 sp->modes |= MODES_LOOPING; /* just in case */
731442 }
732443
733 /* If necessary do some anti-aliasing filtering */
734
735 if (antialiasing_allowed)
736 antialiasing(sp,play_mode->rate);
737
738444 #ifdef ADJUST_SAMPLE_VOLUMES
739445 if (amp!=-1)
740 sp->volume=(FLOAT_T)((amp) / 100.0);
741 else if (sf2flag)
742 sp->volume=(FLOAT_T)((sample_volume) / 255.0);
446 sp->volume=(float)((amp) / 100.0);
743447 else
744448 {
745449 /* Try to determine a volume scaling factor for the sample.
746450 This is a very crude adjustment, but things sound more
747451 balanced with it. Still, this should be a runtime option. */
748 uint32 i, numsamps=sp->data_length/2;
749 uint32 higher=0, highcount=0;
750 int16 maxamp=0,a;
751 int16 *tmp=(int16 *)sp->data;
752 i = numsamps;
753 while (i--)
754 {
755 a=*tmp++;
452 Sint32 k=sp->data_length/2;
453 Sint16 maxamp=0,a;
454 Sint16 *tmp16=(Sint16 *)sp->data;
455 while (k--)
456 {
457 a=*tmp16++;
756458 if (a<0) a=-a;
757459 if (a>maxamp)
758460 maxamp=a;
759461 }
760 tmp=(int16 *)sp->data;
761 i = numsamps;
762 while (i--)
763 {
764 a=*tmp++;
765 if (a<0) a=-a;
766 if (a > 3*maxamp/4)
767 {
768 higher += a;
769 highcount++;
770 }
771 }
772 if (highcount) higher /= highcount;
773 else higher = 10000;
774 sp->volume = (32768.0 * 0.875) / (double)higher ;
775 ctl->cmsg(CMSG_INFO, VERB_DEBUG, " * volume comp: %f", sp->volume);
462 sp->volume=(float)(32768.0 / maxamp);
463 SNDDBG((" * volume comp: %f\n", sp->volume));
776464 }
777465 #else
778466 if (amp!=-1)
782470 #endif
783471
784472 sp->data_length /= 2; /* These are in bytes. Convert into samples. */
785
786473 sp->loop_start /= 2;
787474 sp->loop_end /= 2;
788 sp->data[sp->data_length] = sp->data[sp->data_length-1];
475
476 /* initialize the added extra sample space (see the +4 bytes in
477 allocation) using the last actual sample: */
478 sp->data[sp->data_length] = sp->data[sp->data_length+1] = 0;
789479
790480 /* Then fractional samples */
791481 sp->data_length <<= FRACTION_BITS;
792482 sp->loop_start <<= FRACTION_BITS;
793483 sp->loop_end <<= FRACTION_BITS;
794
795 /* trim off zero data at end */
796 {
797 int ls = sp->loop_start>>FRACTION_BITS;
798 int le = sp->loop_end>>FRACTION_BITS;
799 int se = sp->data_length>>FRACTION_BITS;
800 while (se > 1 && !sp->data[se-1]) se--;
801 if (le > se) le = se;
802 if (ls >= le) sp->modes &= ~MODES_LOOPING;
803 sp->loop_end = le<<FRACTION_BITS;
804 sp->data_length = se<<FRACTION_BITS;
805 }
806484
807485 /* Adjust for fractional loop points. This is a guess. Does anyone
808486 know what "fractions" really stands for? */
814492 /* If this instrument will always be played on the same note,
815493 and it's not looped, we can resample it now. */
816494 if (sp->note_to_use && !(sp->modes & MODES_LOOPING))
817 pre_resample(sp);
818
819 #ifdef LOOKUP_HACK
820 /* Squash the 16-bit data into 8 bits. */
821 {
822 uint8 *gulp,*ulp;
823 int16 *swp;
824 int l=sp->data_length >> FRACTION_BITS;
825 gulp=ulp=safe_malloc(l+1);
826 swp=(int16 *)sp->data;
827 while(l--)
828 *ulp++ = (*swp++ >> 8) & 0xFF;
829 free(sp->data);
830 sp->data=(sample_t *)gulp;
831 }
832 #endif
833
495 pre_resample(song, sp);
496
834497 if (strip_tail==1)
835498 {
836499 /* Let's not really, just say we did. */
837 ctl->cmsg(CMSG_INFO, VERB_DEBUG, " - Stripping tail");
500 SNDDBG((" - Stripping tail\n"));
838501 sp->data_length = sp->loop_end;
839502 }
840 } /* end of sample loop */
841 } /* end of stereo layer loop */
842 } /* end of vlayer loop */
843
844
845 close_file(fp);
846 return headlp;
847 }
848
849 static int fill_bank(int dr, int b)
503 }
504
505 SDL_RWclose(rw);
506 return ip;
507 }
508
509 static int fill_bank(MidiSong *song, int dr, int b)
850510 {
851511 int i, errors=0;
852 ToneBank *bank=((dr) ? drumset[b] : tonebank[b]);
512 ToneBank *bank=((dr) ? song->drumset[b] : song->tonebank[b]);
853513 if (!bank)
854514 {
855 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
856 "Huh. Tried to load instruments in non-existent %s %d",
857 (dr) ? "drumset" : "tone bank", b);
515 SNDDBG(("Huh. Tried to load instruments in non-existent %s %d\n",
516 (dr) ? "drumset" : "tone bank", b));
858517 return 0;
859518 }
860 for (i=0; i<MAXPROG; i++)
861 {
862 if (bank->tone[i].layer==MAGIC_LOAD_INSTRUMENT)
519 for (i=0; i<MAXBANK; i++)
520 {
521 if (bank->instrument[i]==MAGIC_LOAD_INSTRUMENT)
863522 {
864523 if (!(bank->tone[i].name))
865524 {
866 ctl->cmsg(CMSG_WARNING, (b!=0) ? VERB_VERBOSE : VERB_NORMAL,
867 "No instrument mapped to %s %d, program %d%s",
525 SNDDBG(("No instrument mapped to %s %d, program %d%s\n",
868526 (dr)? "drum set" : "tone bank", b, i,
869 (b!=0) ? "" : " - this instrument will not be heard");
527 (b!=0) ? "" : " - this instrument will not be heard"));
870528 if (b!=0)
871529 {
872530 /* Mark the corresponding instrument in the default
873531 bank / drumset for loading (if it isn't already) */
874532 if (!dr)
875533 {
876 if (!(standard_tonebank.tone[i].layer))
877 standard_tonebank.tone[i].layer=
534 if (!(song->tonebank[0]->instrument[i]))
535 song->tonebank[0]->instrument[i] =
878536 MAGIC_LOAD_INSTRUMENT;
879537 }
880538 else
881539 {
882 if (!(standard_drumset.tone[i].layer))
883 standard_drumset.tone[i].layer=
540 if (!(song->drumset[0]->instrument[i]))
541 song->drumset[0]->instrument[i] =
884542 MAGIC_LOAD_INSTRUMENT;
885543 }
886544 }
887 bank->tone[i].layer=0;
545 bank->instrument[i] = 0;
888546 errors++;
889547 }
890 else if (!(bank->tone[i].layer=
891 load_instrument(bank->tone[i].name,
892 bank->tone[i].font_type,
548 else if (!(bank->instrument[i] =
549 load_instrument(song,
550 bank->tone[i].name,
893551 (dr) ? 1 : 0,
894552 bank->tone[i].pan,
895553 bank->tone[i].amp,
896 bank->tone[i].tuning,
897554 (bank->tone[i].note!=-1) ?
898 bank->tone[i].note :
899 ((dr) ? i : -1),
555 bank->tone[i].note :
556 ((dr) ? i : -1),
900557 (bank->tone[i].strip_loop!=-1) ?
901558 bank->tone[i].strip_loop :
902559 ((dr) ? 1 : -1),
903560 (bank->tone[i].strip_envelope != -1) ?
904561 bank->tone[i].strip_envelope :
905562 ((dr) ? 1 : -1),
906 bank->tone[i].strip_tail,
907 b,
908 ((dr) ? i + 128 : i),
909 bank->tone[i].sf_ix
910 )))
911 {
912 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
913 "Couldn't load instrument %s (%s %d, program %d)",
563 bank->tone[i].strip_tail )))
564 {
565 SNDDBG(("Couldn't load instrument %s (%s %d, program %d)\n",
914566 bank->tone[i].name,
915 (dr)? "drum set" : "tone bank", b, i);
567 (dr)? "drum set" : "tone bank", b, i));
916568 errors++;
917569 }
918 else
919 { /* it's loaded now */
920 bank->tone[i].last_used = current_tune_number;
921 current_patch_memory += bank->tone[i].layer->size;
922 purge_as_required();
923 if (current_patch_memory > max_patch_memory) {
924 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
925 "Not enough memory to load instrument %s (%s %d, program %d)",
926 bank->tone[i].name,
927 (dr)? "drum set" : "tone bank", b, i);
928 errors++;
929 free_layer(bank->tone[i].layer);
930 bank->tone[i].layer=0;
931 bank->tone[i].last_used=-1;
932 }
933 #if 0
934 if (check_for_rc()) {
935 free_layer(bank->tone[i].layer);
936 bank->tone[i].layer=0;
937 bank->tone[i].last_used=-1;
938 return 0;
939 }
940 #endif
941 }
942570 }
943571 }
944572 return errors;
945573 }
946574
947 static void free_old_instruments(int how_old)
575 int load_missing_instruments(MidiSong *song)
576 {
577 int i=MAXBANK,errors=0;
578 while (i--)
579 {
580 if (song->tonebank[i])
581 errors+=fill_bank(song,0,i);
582 if (song->drumset[i])
583 errors+=fill_bank(song,1,i);
584 }
585 return errors;
586 }
587
588 void free_instruments(MidiSong *song)
948589 {
949590 int i=MAXBANK;
950591 while(i--)
951592 {
952 if (tonebank[i])
953 free_old_bank(0, i, how_old);
954 if (drumset[i])
955 free_old_bank(1, i, how_old);
956 }
957 }
958
959 static void purge_as_required(void)
960 {
961 if (!max_patch_memory) return;
962
963 while (last_tune_purged < current_tune_number
964 && current_patch_memory > max_patch_memory)
965 {
966 last_tune_purged++;
967 free_old_instruments(last_tune_purged);
968 }
969 }
970
971
972 int load_missing_instruments(void)
973 {
974 int i=MAXBANK,errors=0;
975 while (i--)
976 {
977 if (tonebank[i])
978 errors+=fill_bank(0,i);
979 if (drumset[i])
980 errors+=fill_bank(1,i);
981 }
982 current_tune_number++;
983 return errors;
984 }
985
986 void free_instruments(void)
987 {
988 int i=128;
989 while(i--)
990 {
991 if (tonebank[i])
992 free_bank(0,i);
993 if (drumset[i])
994 free_bank(1,i);
995 }
996 }
997
998 int set_default_instrument(const char *name)
999 {
1000 InstrumentLayer *lp;
1001 /* if (!(lp=load_instrument(name, 0, -1, -1, -1, 0, 0, 0))) */
1002 if (!(lp=load_instrument(name, FONT_NORMAL, 0, -1, -1, 0, -1, -1, -1, -1, 0, -1, -1)))
593 if (song->tonebank[i])
594 free_bank(song, 0, i);
595 if (song->drumset[i])
596 free_bank(song, 1, i);
597 }
598 }
599
600 int set_default_instrument(MidiSong *song, char *name)
601 {
602 Instrument *ip;
603 if (!(ip=load_instrument(song, name, 0, -1, -1, -1, 0, 0, 0)))
1003604 return -1;
1004 if (default_instrument)
1005 free_layer(default_instrument);
1006 default_instrument=lp;
1007 default_program=SPECIAL_PROGRAM;
605 song->default_instrument = ip;
606 song->default_program = SPECIAL_PROGRAM;
1008607 return 0;
1009608 }
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
77
8 instrum.h
89
9 typedef struct {
10 int32
11 loop_start, loop_end, data_length,
12 sample_rate, low_freq, high_freq, root_freq;
13 uint8
14 root_tune, fine_tune;
15 int32
16 envelope_rate[7], envelope_offset[7],
17 modulation_rate[7], modulation_offset[7];
18 FLOAT_T
19 volume, resonance,
20 modEnvToFilterFc, modEnvToPitch, modLfoToFilterFc;
21 sample_t *data;
22 int32
23 tremolo_sweep_increment, tremolo_phase_increment,
24 lfo_sweep_increment, lfo_phase_increment,
25 vibrato_sweep_increment, vibrato_control_ratio,
26 cutoff_freq;
27 uint8
28 reverberation, chorusdepth,
29 tremolo_depth, vibrato_depth,
30 modes;
31 uint8
32 attenuation, freq_center;
33 int8
34 panning, note_to_use, exclusiveClass;
35 int16
36 scale_tuning, keyToModEnvHold, keyToModEnvDecay,
37 keyToVolEnvHold, keyToVolEnvDecay;
38 int32
39 freq_scale, vibrato_delay;
40 } Sample;
10 */
4111
4212 /* Bits in modes: */
4313 #define MODES_16BIT (1<<0)
4717 #define MODES_REVERSE (1<<4)
4818 #define MODES_SUSTAIN (1<<5)
4919 #define MODES_ENVELOPE (1<<6)
50 #define MODES_FAST_RELEASE (1<<7)
5120
52 #if 0
53 typedef struct {
54 int samples;
55 Sample *sample;
56 } Instrument;
57 #endif
58
59 #define INST_GUS 0
60 #define INST_SF2 1
61
62 typedef struct {
63 int type;
64 int samples;
65 Sample *sample;
66 int left_samples;
67 Sample *left_sample;
68 int right_samples;
69 Sample *right_sample;
70 unsigned char *contents;
71 } Instrument;
72
73
74 typedef struct _InstrumentLayer {
75 uint8 lo, hi;
76 int size;
77 Instrument *instrument;
78 struct _InstrumentLayer *next;
79 } InstrumentLayer;
80
81 struct cfg_type {
82 int font_code;
83 int num;
84 const char *name;
85 };
86
87 #define FONT_NORMAL 0
88 #define FONT_FFF 1
89 #define FONT_SBK 2
90 #define FONT_TONESET 3
91 #define FONT_DRUMSET 4
92 #define FONT_PRESET 5
93
94
95 typedef struct {
96 char *name;
97 InstrumentLayer *layer;
98 int font_type, sf_ix, last_used, tuning;
99 int note, amp, pan, strip_loop, strip_envelope, strip_tail;
100 } ToneBankElement;
101
102 #if 0
103 typedef struct {
104 char *name;
105 Instrument *instrument;
106 int note, amp, pan, strip_loop, strip_envelope, strip_tail;
107 } ToneBankElement;
108 #endif
10921 /* A hack to delay instrument loading until after reading the
11022 entire MIDI file. */
111 #define MAGIC_LOAD_INSTRUMENT ((InstrumentLayer *)(-1))
112
113 #define MAXPROG 128
114 #define MAXBANK 130
115 #define SFXBANK (MAXBANK-1)
116 #define SFXDRUM1 (MAXBANK-2)
117 #define SFXDRUM2 (MAXBANK-1)
118 #define XGDRUM 1
119
120 #if 0
121 typedef struct {
122 ToneBankElement tone[128];
123 } ToneBank;
124 #endif
125
126 typedef struct {
127 char *name;
128 ToneBankElement tone[MAXPROG];
129 } ToneBank;
130
131
132 extern char *sf_file;
133
134 extern ToneBank *tonebank[], *drumset[];
135
136 #if 0
137 extern Instrument *default_instrument;
138 #endif
139 extern InstrumentLayer *default_instrument;
140 extern int default_program;
141 extern int antialiasing_allowed;
142 extern int fast_decay;
143 extern int free_instruments_afterwards;
23 #define MAGIC_LOAD_INSTRUMENT ((Instrument *) (-1))
14424
14525 #define SPECIAL_PROGRAM -1
14626
147 extern int load_missing_instruments(void);
148 extern void free_instruments(void);
149 extern void end_soundfont(void);
150 extern int set_default_instrument(const char *name);
151
152
153 extern int32 convert_tremolo_sweep(uint8 sweep);
154 extern int32 convert_vibrato_sweep(uint8 sweep, int32 vib_control_ratio);
155 extern int32 convert_tremolo_rate(uint8 rate);
156 extern int32 convert_vibrato_rate(uint8 rate);
157
158 extern int init_soundfont(char *fname, int oldbank, int newbank, int level);
159 extern InstrumentLayer *load_sbk_patch(const char *name, int gm_num, int bank, int percussion,
160 int panning, int amp, int note_to_use, int sf_ix);
161 extern int current_tune_number;
162 extern int max_patch_memory;
163 extern int current_patch_memory;
164 #define XMAPMAX 800
165 extern int xmap[XMAPMAX][5];
166 extern void pcmap(int *b, int *v, int *p, int *drums);
167
27 extern int load_missing_instruments(MidiSong *song);
28 extern void free_instruments(MidiSong *song);
29 extern int set_default_instrument(MidiSong *song, char *name);
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 mix.c */
9
10 #if HAVE_CONFIG_H
11 # include <config.h>
12 #endif
713
814 #include <math.h>
915 #include <stdio.h>
1016 #include <stdlib.h>
1117
12 #include "config.h"
13 #include "common.h"
18 #include "SDL.h"
19
20 #include "timidity.h"
21 #include "options.h"
1422 #include "instrum.h"
1523 #include "playmidi.h"
1624 #include "output.h"
17 #include "ctrlmode.h"
1825 #include "tables.h"
1926 #include "resample.h"
2027 #include "mix.h"
2128
2229 /* Returns 1 if envelope runs out */
23 int recompute_envelope(int v)
30 int recompute_envelope(MidiSong *song, int v)
2431 {
2532 int stage;
2633
27 stage = voice[v].envelope_stage;
34 stage = song->voice[v].envelope_stage;
2835
2936 if (stage>5)
3037 {
3138 /* Envelope ran out. */
32 int tmp=(voice[v].status == VOICE_DIE); /* Already displayed as dead */
33 voice[v].status = VOICE_FREE;
34 if(!tmp)
35 ctl->note(v);
39 song->voice[v].status = VOICE_FREE;
3640 return 1;
3741 }
3842
39 if (voice[v].sample->modes & MODES_ENVELOPE)
40 {
41 if (voice[v].status==VOICE_ON || voice[v].status==VOICE_SUSTAINED)
43 if (song->voice[v].sample->modes & MODES_ENVELOPE)
44 {
45 if (song->voice[v].status==VOICE_ON || song->voice[v].status==VOICE_SUSTAINED)
4246 {
4347 if (stage>2)
4448 {
4549 /* Freeze envelope until note turns off. Trumpets want this. */
46 voice[v].envelope_increment=0;
50 song->voice[v].envelope_increment=0;
4751 return 0;
4852 }
4953 }
5054 }
51 voice[v].envelope_stage=stage+1;
52
53 if (voice[v].envelope_volume==voice[v].sample->envelope_offset[stage])
54 return recompute_envelope(v);
55 voice[v].envelope_target=voice[v].sample->envelope_offset[stage];
56 voice[v].envelope_increment = voice[v].sample->envelope_rate[stage];
57 if (voice[v].envelope_target<voice[v].envelope_volume)
58 voice[v].envelope_increment = -voice[v].envelope_increment;
55 song->voice[v].envelope_stage=stage+1;
56
57 if (song->voice[v].envelope_volume==song->voice[v].sample->envelope_offset[stage] ||
58 (stage > 2 && song->voice[v].envelope_volume <
59 song->voice[v].sample->envelope_offset[stage]))
60 return recompute_envelope(song, v);
61 song->voice[v].envelope_target = song->voice[v].sample->envelope_offset[stage];
62 song->voice[v].envelope_increment = song->voice[v].sample->envelope_rate[stage];
63 if (song->voice[v].envelope_target < song->voice[v].envelope_volume)
64 song->voice[v].envelope_increment = -song->voice[v].envelope_increment;
5965 return 0;
6066 }
6167
62 void apply_envelope_to_amp(int v)
63 {
64 FLOAT_T lamp=voice[v].left_amp, ramp, lramp, rramp, ceamp, lfeamp;
65 int32 la,ra, lra, rra, cea, lfea;
66 if (voice[v].panned == PANNED_MYSTERY)
67 {
68 lramp=voice[v].lr_amp;
69 ramp=voice[v].right_amp;
70 ceamp=voice[v].ce_amp;
71 rramp=voice[v].rr_amp;
72 lfeamp=voice[v].lfe_amp;
73
74 if (voice[v].tremolo_phase_increment)
75 {
76 FLOAT_T tv = voice[v].tremolo_volume;
77 lramp *= tv;
78 lamp *= tv;
79 ceamp *= tv;
80 ramp *= tv;
81 rramp *= tv;
82 lfeamp *= tv;
83 }
84 if (voice[v].sample->modes & MODES_ENVELOPE)
85 {
86 FLOAT_T ev = (FLOAT_T)vol_table[voice[v].envelope_volume>>23];
87 lramp *= ev;
88 lamp *= ev;
89 ceamp *= ev;
90 ramp *= ev;
91 rramp *= ev;
92 lfeamp *= ev;
93 }
94
95 la = (int32)FSCALE(lamp,AMP_BITS);
96 ra = (int32)FSCALE(ramp,AMP_BITS);
97 lra = (int32)FSCALE(lramp,AMP_BITS);
98 rra = (int32)FSCALE(rramp,AMP_BITS);
99 cea = (int32)FSCALE(ceamp,AMP_BITS);
100 lfea = (int32)FSCALE(lfeamp,AMP_BITS);
68 void apply_envelope_to_amp(MidiSong *song, int v)
69 {
70 float lamp = song->voice[v].left_amp, ramp;
71 Sint32 la,ra;
72 if (song->voice[v].panned == PANNED_MYSTERY)
73 {
74 ramp = song->voice[v].right_amp;
75 if (song->voice[v].tremolo_phase_increment)
76 {
77 lamp *= song->voice[v].tremolo_volume;
78 ramp *= song->voice[v].tremolo_volume;
79 }
80 if (song->voice[v].sample->modes & MODES_ENVELOPE)
81 {
82 lamp *= (float)vol_table[song->voice[v].envelope_volume>>23];
83 ramp *= (float)vol_table[song->voice[v].envelope_volume>>23];
84 }
85
86 la = (Sint32)FSCALE(lamp,AMP_BITS);
10187
102 if (la>MAX_AMP_VALUE) la=MAX_AMP_VALUE;
103 if (ra>MAX_AMP_VALUE) ra=MAX_AMP_VALUE;
104 if (lra>MAX_AMP_VALUE) lra=MAX_AMP_VALUE;
105 if (rra>MAX_AMP_VALUE) rra=MAX_AMP_VALUE;
106 if (cea>MAX_AMP_VALUE) cea=MAX_AMP_VALUE;
107 if (lfea>MAX_AMP_VALUE) lfea=MAX_AMP_VALUE;
108
109 voice[v].lr_mix=FINAL_VOLUME(lra);
110 voice[v].left_mix=FINAL_VOLUME(la);
111 voice[v].ce_mix=FINAL_VOLUME(cea);
112 voice[v].right_mix=FINAL_VOLUME(ra);
113 voice[v].rr_mix=FINAL_VOLUME(rra);
114 voice[v].lfe_mix=FINAL_VOLUME(lfea);
115 }
116 else
117 {
118 if (voice[v].tremolo_phase_increment)
119 lamp *= voice[v].tremolo_volume;
120 if (voice[v].sample->modes & MODES_ENVELOPE)
121 lamp *= (FLOAT_T)vol_table[voice[v].envelope_volume>>23];
122
123 la = (int32)FSCALE(lamp,AMP_BITS);
124
12588 if (la>MAX_AMP_VALUE)
12689 la=MAX_AMP_VALUE;
12790
128 voice[v].left_mix=FINAL_VOLUME(la);
129 }
130 }
131
132 static int update_envelope(int v)
133 {
134 voice[v].envelope_volume += voice[v].envelope_increment;
91 ra = (Sint32)FSCALE(ramp,AMP_BITS);
92 if (ra>MAX_AMP_VALUE)
93 ra=MAX_AMP_VALUE;
94
95 song->voice[v].left_mix = la;
96 song->voice[v].right_mix = ra;
97 }
98 else
99 {
100 if (song->voice[v].tremolo_phase_increment)
101 lamp *= song->voice[v].tremolo_volume;
102 if (song->voice[v].sample->modes & MODES_ENVELOPE)
103 lamp *= (float)vol_table[song->voice[v].envelope_volume>>23];
104
105 la = (Sint32)FSCALE(lamp,AMP_BITS);
106
107 if (la>MAX_AMP_VALUE)
108 la=MAX_AMP_VALUE;
109
110 song->voice[v].left_mix = la;
111 }
112 }
113
114 static int update_envelope(MidiSong *song, int v)
115 {
116 song->voice[v].envelope_volume += song->voice[v].envelope_increment;
135117 /* Why is there no ^^ operator?? */
136 if (((voice[v].envelope_increment < 0) &&
137 (voice[v].envelope_volume <= voice[v].envelope_target)) ||
138 ((voice[v].envelope_increment > 0) &&
139 (voice[v].envelope_volume >= voice[v].envelope_target)))
140 {
141 voice[v].envelope_volume = voice[v].envelope_target;
142 if (recompute_envelope(v))
118 if (((song->voice[v].envelope_increment < 0) &&
119 (song->voice[v].envelope_volume <= song->voice[v].envelope_target)) ||
120 ((song->voice[v].envelope_increment > 0) &&
121 (song->voice[v].envelope_volume >= song->voice[v].envelope_target)))
122 {
123 song->voice[v].envelope_volume = song->voice[v].envelope_target;
124 if (recompute_envelope(song, v))
143125 return 1;
144126 }
145127 return 0;
146128 }
147129
148 static void update_tremolo(int v)
149 {
150 int32 depth=voice[v].sample->tremolo_depth<<7;
151
152 if (voice[v].tremolo_sweep)
130 static void update_tremolo(MidiSong *song, int v)
131 {
132 Sint32 depth = song->voice[v].sample->tremolo_depth << 7;
133
134 if (song->voice[v].tremolo_sweep)
153135 {
154136 /* Update sweep position */
155137
156 voice[v].tremolo_sweep_position += voice[v].tremolo_sweep;
157 if (voice[v].tremolo_sweep_position>=(1<<SWEEP_SHIFT))
158 voice[v].tremolo_sweep=0; /* Swept to max amplitude */
138 song->voice[v].tremolo_sweep_position += song->voice[v].tremolo_sweep;
139 if (song->voice[v].tremolo_sweep_position >= (1 << SWEEP_SHIFT))
140 song->voice[v].tremolo_sweep=0; /* Swept to max amplitude */
159141 else
160142 {
161143 /* Need to adjust depth */
162 depth *= voice[v].tremolo_sweep_position;
144 depth *= song->voice[v].tremolo_sweep_position;
163145 depth >>= SWEEP_SHIFT;
164146 }
165147 }
166148
167 voice[v].tremolo_phase += voice[v].tremolo_phase_increment;
168
169 /* if (voice[v].tremolo_phase >= (SINE_CYCLE_LENGTH<<RATE_SHIFT))
170 voice[v].tremolo_phase -= SINE_CYCLE_LENGTH<<RATE_SHIFT; */
171
172 voice[v].tremolo_volume = (FLOAT_T)
173 (1.0 - FSCALENEG((sine(voice[v].tremolo_phase >> RATE_SHIFT) + 1.0)
149 song->voice[v].tremolo_phase += song->voice[v].tremolo_phase_increment;
150
151 /* if (song->voice[v].tremolo_phase >= (SINE_CYCLE_LENGTH<<RATE_SHIFT))
152 song->voice[v].tremolo_phase -= SINE_CYCLE_LENGTH<<RATE_SHIFT; */
153
154 song->voice[v].tremolo_volume = (float)
155 (1.0 - FSCALENEG((sine(song->voice[v].tremolo_phase >> RATE_SHIFT) + 1.0)
174156 * depth * TREMOLO_AMPLITUDE_TUNING,
175157 17));
176158
179161 }
180162
181163 /* Returns 1 if the note died */
182 static int update_signal(int v)
183 {
184 if (voice[v].envelope_increment && update_envelope(v))
164 static int update_signal(MidiSong *song, int v)
165 {
166 if (song->voice[v].envelope_increment && update_envelope(song, v))
185167 return 1;
186168
187 if (voice[v].tremolo_phase_increment)
188 update_tremolo(v);
189
190 apply_envelope_to_amp(v);
169 if (song->voice[v].tremolo_phase_increment)
170 update_tremolo(song, v);
171
172 apply_envelope_to_amp(song, v);
191173 return 0;
192174 }
193175
194 #ifdef LOOKUP_HACK
195 # define MIXATION(a) *lp++ += mixup[(a<<8) | (uint8)s];
196 #else
197 # define MIXATION(a) *lp++ += (a)*s;
198 #endif
199
200 #define MIXSKIP lp++
201 #define MIXMAX(a,b) *lp++ += ((a>b)?a:b) * s
202 #define MIXCENT(a,b) *lp++ += (a/2+b/2) * s
203 #define MIXHALF(a) *lp++ += (a>>1)*s;
204
205 static void mix_mystery_signal(resample_t *sp, int32 *lp, int v, int count)
206 {
207 Voice *vp = voice + v;
208 final_volume_t
209 left_rear=vp->lr_mix,
176 #define MIXATION(a) *lp++ += (a)*s;
177
178 static void mix_mystery_signal(MidiSong *song, sample_t *sp, Sint32 *lp, int v,
179 int count)
180 {
181 Voice *vp = song->voice + v;
182 final_volume_t
210183 left=vp->left_mix,
211 center=vp->ce_mix,
212 right=vp->right_mix,
213 right_rear=vp->rr_mix,
214 lfe=vp->lfe_mix;
184 right=vp->right_mix;
215185 int cc;
216 resample_t s;
186 sample_t s;
217187
218188 if (!(cc = vp->control_counter))
219189 {
220 cc = control_ratio;
221 if (update_signal(v))
190 cc = song->control_ratio;
191 if (update_signal(song, v))
222192 return; /* Envelope ran out */
223
224 left_rear = vp->lr_mix;
225 left = vp->left_mix;
226 center = vp->ce_mix;
227 right = vp->right_mix;
228 right_rear = vp->rr_mix;
229 lfe = vp->lfe_mix;
193 left = vp->left_mix;
194 right = vp->right_mix;
230195 }
231196
232197 while (count)
236201 while (cc--)
237202 {
238203 s = *sp++;
239 MIXATION(left);
240 MIXATION(right);
241 if (num_ochannels >= 4) {
242 MIXATION(left_rear);
243 MIXATION(right_rear);
244 }
245 if (num_ochannels == 6) {
246 MIXATION(center);
247 MIXATION(lfe);
248 }
249 }
250 cc = control_ratio;
251 if (update_signal(v))
204 MIXATION(left);
205 MIXATION(right);
206 }
207 cc = song->control_ratio;
208 if (update_signal(song, v))
252209 return; /* Envelope ran out */
253 left_rear = vp->lr_mix;
254210 left = vp->left_mix;
255 center = vp->ce_mix;
256211 right = vp->right_mix;
257 right_rear = vp->rr_mix;
258 lfe = vp->lfe_mix;
259212 }
260213 else
261214 {
263216 while (count--)
264217 {
265218 s = *sp++;
266 MIXATION(left);
267 MIXATION(right);
268 if (num_ochannels >= 4) {
269 MIXATION(left_rear);
270 MIXATION(right_rear);
271 }
272 if (num_ochannels == 6) {
273 MIXATION(center);
274 MIXATION(lfe);
275 }
219 MIXATION(left);
220 MIXATION(right);
276221 }
277222 return;
278223 }
279224 }
280225
281 static void mix_center_signal(resample_t *sp, int32 *lp, int v, int count)
282 {
283 Voice *vp = voice + v;
226 static void mix_center_signal(MidiSong *song, sample_t *sp, Sint32 *lp, int v,
227 int count)
228 {
229 Voice *vp = song->voice + v;
284230 final_volume_t
285231 left=vp->left_mix;
286232 int cc;
287 resample_t s;
233 sample_t s;
288234
289235 if (!(cc = vp->control_counter))
290236 {
291 cc = control_ratio;
292 if (update_signal(v))
237 cc = song->control_ratio;
238 if (update_signal(song, v))
293239 return; /* Envelope ran out */
294240 left = vp->left_mix;
295241 }
301247 while (cc--)
302248 {
303249 s = *sp++;
304 if (num_ochannels == 2) {
305 MIXATION(left);
306 MIXATION(left);
307 }
308 else if (num_ochannels == 4) {
309 MIXATION(left);
310 MIXSKIP;
311 MIXATION(left);
312 MIXSKIP;
313 }
314 else if (num_ochannels == 6) {
315 MIXSKIP;
316 MIXSKIP;
317 MIXSKIP;
318 MIXSKIP;
319 MIXATION(left);
320 MIXATION(left);
321 }
322 }
323 cc = control_ratio;
324 if (update_signal(v))
250 MIXATION(left);
251 MIXATION(left);
252 }
253 cc = song->control_ratio;
254 if (update_signal(song, v))
325255 return; /* Envelope ran out */
326256 left = vp->left_mix;
327257 }
331261 while (count--)
332262 {
333263 s = *sp++;
334 if (num_ochannels == 2) {
335 MIXATION(left);
336 MIXATION(left);
337 }
338 else if (num_ochannels == 4) {
339 MIXATION(left);
340 MIXSKIP;
341 MIXATION(left);
342 MIXSKIP;
343 }
344 else if (num_ochannels == 6) {
345 MIXSKIP;
346 MIXSKIP;
347 MIXSKIP;
348 MIXSKIP;
349 MIXATION(left);
350 MIXATION(left);
351 }
264 MIXATION(left);
265 MIXATION(left);
352266 }
353267 return;
354268 }
355269 }
356270
357 static void mix_single_left_signal(resample_t *sp, int32 *lp, int v, int count)
358 {
359 Voice *vp = voice + v;
271 static void mix_single_signal(MidiSong *song, sample_t *sp, Sint32 *lp, int v,
272 int count)
273 {
274 Voice *vp = song->voice + v;
360275 final_volume_t
361276 left=vp->left_mix;
362277 int cc;
363 resample_t s;
278 sample_t s;
364279
365280 if (!(cc = vp->control_counter))
366281 {
367 cc = control_ratio;
368 if (update_signal(v))
282 cc = song->control_ratio;
283 if (update_signal(song, v))
369284 return; /* Envelope ran out */
370285 left = vp->left_mix;
371286 }
377292 while (cc--)
378293 {
379294 s = *sp++;
380 if (num_ochannels == 2) {
381 MIXATION(left);
382 MIXSKIP;
383 }
384 if (num_ochannels >= 4) {
385 MIXHALF(left);
386 MIXSKIP;
387 MIXATION(left);
388 MIXSKIP;
389 }
390 if (num_ochannels == 6) {
391 MIXSKIP;
392 MIXATION(left);
393 }
394 }
395 cc = control_ratio;
396 if (update_signal(v))
295 MIXATION(left);
296 lp++;
297 }
298 cc = song->control_ratio;
299 if (update_signal(song, v))
397300 return; /* Envelope ran out */
398301 left = vp->left_mix;
399302 }
403306 while (count--)
404307 {
405308 s = *sp++;
406 if (num_ochannels == 2) {
407 MIXATION(left);
408 MIXSKIP;
409 }
410 if (num_ochannels >= 4) {
411 MIXHALF(left);
412 MIXSKIP;
413 MIXATION(left);
414 MIXSKIP;
415 }
416 if (num_ochannels == 6) {
417 MIXSKIP;
418 MIXATION(left);
419 }
309 MIXATION(left);
310 lp++;
420311 }
421312 return;
422313 }
423314 }
424315
425 static void mix_single_right_signal(resample_t *sp, int32 *lp, int v, int count)
426 {
427 Voice *vp = voice + v;
316 static void mix_mono_signal(MidiSong *song, sample_t *sp, Sint32 *lp, int v,
317 int count)
318 {
319 Voice *vp = song->voice + v;
428320 final_volume_t
429321 left=vp->left_mix;
430322 int cc;
431 resample_t s;
323 sample_t s;
432324
433325 if (!(cc = vp->control_counter))
434326 {
435 cc = control_ratio;
436 if (update_signal(v))
327 cc = song->control_ratio;
328 if (update_signal(song, v))
437329 return; /* Envelope ran out */
438330 left = vp->left_mix;
439331 }
445337 while (cc--)
446338 {
447339 s = *sp++;
448 if (num_ochannels == 2) {
449 MIXSKIP;
450 MIXATION(left);
451 }
452 if (num_ochannels >= 4) {
453 MIXSKIP;
454 MIXHALF(left);
455 MIXSKIP;
456 MIXATION(left);
457 } if (num_ochannels == 6) {
458 MIXSKIP;
459 MIXATION(left);
460 }
461 }
462 cc = control_ratio;
463 if (update_signal(v))
340 MIXATION(left);
341 }
342 cc = song->control_ratio;
343 if (update_signal(song, v))
464344 return; /* Envelope ran out */
465345 left = vp->left_mix;
466346 }
470350 while (count--)
471351 {
472352 s = *sp++;
473 if (num_ochannels == 2) {
474 MIXSKIP;
475 MIXATION(left);
476 }
477 if (num_ochannels >= 4) {
478 MIXSKIP;
479 MIXHALF(left);
480 MIXSKIP;
481 MIXATION(left);
482 } if (num_ochannels == 6) {
483 MIXSKIP;
484 MIXATION(left);
485 }
353 MIXATION(left);
486354 }
487355 return;
488356 }
489357 }
490358
491 static void mix_mono_signal(resample_t *sp, int32 *lp, int v, int count)
492 {
493 Voice *vp = voice + v;
494 final_volume_t
495 left=vp->left_mix;
496 int cc;
497 resample_t s;
498
499 if (!(cc = vp->control_counter))
500 {
501 cc = control_ratio;
502 if (update_signal(v))
503 return; /* Envelope ran out */
504 left = vp->left_mix;
505 }
506
507 while (count)
508 if (cc < count)
509 {
510 count -= cc;
511 while (cc--)
512 {
513 s = *sp++;
514 MIXATION(left);
515 }
516 cc = control_ratio;
517 if (update_signal(v))
518 return; /* Envelope ran out */
519 left = vp->left_mix;
520 }
521 else
522 {
523 vp->control_counter = cc - count;
524 while (count--)
525 {
526 s = *sp++;
527 MIXATION(left);
528 }
529 return;
530 }
531 }
532
533 static void mix_mystery(resample_t *sp, int32 *lp, int v, int count)
534 {
535 final_volume_t
536 left_rear=voice[v].lr_mix,
537 left=voice[v].left_mix,
538 center=voice[v].ce_mix,
539 right=voice[v].right_mix,
540 right_rear=voice[v].rr_mix,
541 lfe=voice[v].lfe_mix;
542 resample_t s;
543
544 while (count--)
545 {
546 s = *sp++;
547 MIXATION(left);
548 MIXATION(right);
549 if (num_ochannels >= 4) {
550 MIXATION(left_rear);
551 MIXATION(right_rear);
552 }
553 if (num_ochannels == 6) {
554 MIXATION(center);
555 MIXATION(lfe);
556 }
557 }
558 }
559
560 static void mix_center(resample_t *sp, int32 *lp, int v, int count)
561 {
562 final_volume_t
563 left=voice[v].left_mix;
564 resample_t s;
565
566 while (count--)
567 {
568 s = *sp++;
569 if (num_ochannels == 2) {
570 MIXATION(left);
571 MIXATION(left);
572 }
573 else if (num_ochannels == 4) {
574 MIXATION(left);
575 MIXATION(left);
576 MIXSKIP;
577 MIXSKIP;
578 }
579 else if (num_ochannels == 6) {
580 MIXSKIP;
581 MIXSKIP;
582 MIXSKIP;
583 MIXSKIP;
584 MIXATION(left);
585 MIXATION(left);
586 }
587 }
588 }
589
590 static void mix_single_left(resample_t *sp, int32 *lp, int v, int count)
591 {
592 final_volume_t
593 left=voice[v].left_mix;
594 resample_t s;
595
596 while (count--)
597 {
598 s = *sp++;
599 if (num_ochannels == 2) {
600 MIXATION(left);
601 MIXSKIP;
602 }
603 if (num_ochannels >= 4) {
604 MIXHALF(left);
605 MIXSKIP;
606 MIXATION(left);
607 MIXSKIP;
608 }
609 if (num_ochannels == 6) {
610 MIXSKIP;
611 MIXATION(left);
612 }
613 }
614 }
615 static void mix_single_right(resample_t *sp, int32 *lp, int v, int count)
616 {
617 final_volume_t
618 left=voice[v].left_mix;
619 resample_t s;
620
621 while (count--)
622 {
623 s = *sp++;
624 if (num_ochannels == 2) {
625 MIXSKIP;
626 MIXATION(left);
627 }
628 if (num_ochannels >= 4) {
629 MIXSKIP;
630 MIXHALF(left);
631 MIXSKIP;
632 MIXATION(left);
633 }
634 if (num_ochannels == 6) {
635 MIXSKIP;
636 MIXATION(left);
637 }
638 }
639 }
640
641 static void mix_mono(resample_t *sp, int32 *lp, int v, int count)
642 {
643 final_volume_t
644 left=voice[v].left_mix;
645 resample_t s;
359 static void mix_mystery(MidiSong *song, sample_t *sp, Sint32 *lp, int v, int count)
360 {
361 final_volume_t
362 left = song->voice[v].left_mix,
363 right = song->voice[v].right_mix;
364 sample_t s;
646365
647366 while (count--)
648367 {
649368 s = *sp++;
650369 MIXATION(left);
370 MIXATION(right);
371 }
372 }
373
374 static void mix_center(MidiSong *song, sample_t *sp, Sint32 *lp, int v, int count)
375 {
376 final_volume_t
377 left = song->voice[v].left_mix;
378 sample_t s;
379
380 while (count--)
381 {
382 s = *sp++;
383 MIXATION(left);
384 MIXATION(left);
385 }
386 }
387
388 static void mix_single(MidiSong *song, sample_t *sp, Sint32 *lp, int v, int count)
389 {
390 final_volume_t
391 left = song->voice[v].left_mix;
392 sample_t s;
393
394 while (count--)
395 {
396 s = *sp++;
397 MIXATION(left);
398 lp++;
399 }
400 }
401
402 static void mix_mono(MidiSong *song, sample_t *sp, Sint32 *lp, int v, int count)
403 {
404 final_volume_t
405 left = song->voice[v].left_mix;
406 sample_t s;
407
408 while (count--)
409 {
410 s = *sp++;
411 MIXATION(left);
651412 }
652413 }
653414
654415 /* Ramp a note out in c samples */
655 static void ramp_out(resample_t *sp, int32 *lp, int v, int32 c)
656 {
657
658 /* should be final_volume_t, but uint8 gives trouble. */
659 int32 left_rear, left, center, right, right_rear, lfe, li, ri;
660
661 resample_t s = 0; /* silly warning about uninitialized s */
662
663 /* Fix by James Caldwell */
664 if ( c == 0 ) c = 1;
665
666 left = voice[v].left_mix;
667 li = -(left/c);
668 if (!li) li = -1;
416 static void ramp_out(MidiSong *song, sample_t *sp, Sint32 *lp, int v, Sint32 c)
417 {
418
419 /* should be final_volume_t, but Uint8 gives trouble. */
420 Sint32 left, right, li, ri;
421
422 sample_t s=0; /* silly warning about uninitialized s */
423
424 left=song->voice[v].left_mix;
425 li=-(left/c);
426 if (!li) li=-1;
669427
670428 /* printf("Ramping out: left=%d, c=%d, li=%d\n", left, c, li); */
671429
672 if (!(play_mode->encoding & PE_MONO))
673 {
674 if (voice[v].panned==PANNED_MYSTERY)
675 {
676 left_rear = voice[v].lr_mix;
677 center=voice[v].ce_mix;
678 right=voice[v].right_mix;
679 right_rear = voice[v].rr_mix;
680 lfe = voice[v].lfe_mix;
681
430 if (!(song->encoding & PE_MONO))
431 {
432 if (song->voice[v].panned==PANNED_MYSTERY)
433 {
434 right=song->voice[v].right_mix;
682435 ri=-(right/c);
683436 while (c--)
684437 {
685 left_rear += li; if (left_rear<0) left_rear=0;
686 left += li; if (left<0) left=0;
687 center += li; if (center<0) center=0;
688 right += ri; if (right<0) right=0;
689 right_rear += ri; if (right_rear<0) right_rear=0;
690 lfe += li; if (lfe<0) lfe=0;
438 left += li;
439 if (left<0)
440 left=0;
441 right += ri;
442 if (right<0)
443 right=0;
691444 s=*sp++;
692 MIXATION(left);
693 MIXATION(right);
694 if (num_ochannels >= 4) {
695 MIXATION(left_rear);
696 MIXATION(right_rear);
697 }
698 if (num_ochannels == 6) {
699 MIXATION(center);
700 MIXATION(lfe);
701 }
702 }
703 }
704 else if (voice[v].panned==PANNED_CENTER)
445 MIXATION(left);
446 MIXATION(right);
447 }
448 }
449 else if (song->voice[v].panned==PANNED_CENTER)
705450 {
706451 while (c--)
707452 {
709454 if (left<0)
710455 return;
711456 s=*sp++;
712 if (num_ochannels == 2) {
713 MIXATION(left);
714 MIXATION(left);
715 }
716 else if (num_ochannels == 4) {
717 MIXATION(left);
718 MIXATION(left);
719 MIXSKIP;
720 MIXSKIP;
721 }
722 else if (num_ochannels == 6) {
723 MIXSKIP;
724 MIXSKIP;
725 MIXSKIP;
726 MIXSKIP;
727 MIXATION(left);
728 MIXATION(left);
729 }
730 }
731 }
732 else if (voice[v].panned==PANNED_LEFT)
457 MIXATION(left);
458 MIXATION(left);
459 }
460 }
461 else if (song->voice[v].panned==PANNED_LEFT)
733462 {
734463 while (c--)
735464 {
738467 return;
739468 s=*sp++;
740469 MIXATION(left);
741 MIXSKIP;
742 if (num_ochannels >= 4) {
743 MIXATION(left);
744 MIXSKIP;
745 } if (num_ochannels == 6) {
746 MIXATION(left);
747 MIXATION(left);
748 }
749 }
750 }
751 else if (voice[v].panned==PANNED_RIGHT)
470 lp++;
471 }
472 }
473 else if (song->voice[v].panned==PANNED_RIGHT)
752474 {
753475 while (c--)
754476 {
756478 if (left<0)
757479 return;
758480 s=*sp++;
759 MIXSKIP;
481 lp++;
760482 MIXATION(left);
761 if (num_ochannels >= 4) {
762 MIXSKIP;
763 MIXATION(left);
764 } if (num_ochannels == 6) {
765 MIXATION(left);
766 MIXATION(left);
767 }
768483 }
769484 }
770485 }
785500
786501 /**************** interface function ******************/
787502
788 void mix_voice(int32 *buf, int v, int32 c)
789 {
790 Voice *vp=voice+v;
791 int32 count=c;
792 resample_t *sp;
793 if (c<0) return;
503 void mix_voice(MidiSong *song, Sint32 *buf, int v, Sint32 c)
504 {
505 Voice *vp = song->voice + v;
506 sample_t *sp;
794507 if (vp->status==VOICE_DIE)
795508 {
796 if (count>=MAX_DIE_TIME)
797 count=MAX_DIE_TIME;
798 sp=resample_voice(v, &count);
799 ramp_out(sp, buf, v, count);
509 if (c>=MAX_DIE_TIME)
510 c=MAX_DIE_TIME;
511 sp=resample_voice(song, v, &c);
512 if(c > 0)
513 ramp_out(song, sp, buf, v, c);
800514 vp->status=VOICE_FREE;
801515 }
802516 else
803517 {
804 sp=resample_voice(v, &count);
805 if (count<0) return;
806 if (play_mode->encoding & PE_MONO)
518 sp=resample_voice(song, v, &c);
519 if (song->encoding & PE_MONO)
807520 {
808521 /* Mono output. */
809522 if (vp->envelope_increment || vp->tremolo_phase_increment)
810 mix_mono_signal(sp, buf, v, count);
523 mix_mono_signal(song, sp, buf, v, c);
811524 else
812 mix_mono(sp, buf, v, count);
525 mix_mono(song, sp, buf, v, c);
813526 }
814527 else
815528 {
816529 if (vp->panned == PANNED_MYSTERY)
817530 {
818531 if (vp->envelope_increment || vp->tremolo_phase_increment)
819 mix_mystery_signal(sp, buf, v, count);
532 mix_mystery_signal(song, sp, buf, v, c);
820533 else
821 mix_mystery(sp, buf, v, count);
534 mix_mystery(song, sp, buf, v, c);
822535 }
823536 else if (vp->panned == PANNED_CENTER)
824537 {
825538 if (vp->envelope_increment || vp->tremolo_phase_increment)
826 mix_center_signal(sp, buf, v, count);
539 mix_center_signal(song, sp, buf, v, c);
827540 else
828 mix_center(sp, buf, v, count);
541 mix_center(song, sp, buf, v, c);
829542 }
830543 else
831544 {
832545 /* It's either full left or full right. In either case,
833546 every other sample is 0. Just get the offset right: */
547 if (vp->panned == PANNED_RIGHT) buf++;
834548
835549 if (vp->envelope_increment || vp->tremolo_phase_increment)
836 {
837 if (vp->panned == PANNED_RIGHT)
838 mix_single_right_signal(sp, buf, v, count);
839 else mix_single_left_signal(sp, buf, v, count);
840 }
550 mix_single_signal(song, sp, buf, v, c);
841551 else
842 {
843 if (vp->panned == PANNED_RIGHT)
844 mix_single_right(sp, buf, v, count);
845 else mix_single_left(sp, buf, v, count);
846 }
847 }
848 }
849 }
850 }
552 mix_single(song, sp, buf, v, c);
553 }
554 }
555 }
556 }
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
77
8 extern void mix_voice(int32 *buf, int v, int32 c);
9 extern int recompute_envelope(int v);
10 extern void apply_envelope_to_amp(int v);
8 mix.h
9
10 */
11
12 extern void mix_voice(MidiSong *song, Sint32 *buf, int v, Sint32 c);
13 extern int recompute_envelope(MidiSong *song, int v);
14 extern void apply_envelope_to_amp(MidiSong *song, int v);
0 /*
1 TiMidity -- Experimental MIDI to WAVE converter
2 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 /* When a patch file can't be opened, one of these extensions is
9 appended to the filename and the open is tried again.
10 */
11 #define PATCH_EXT_LIST { ".pat", 0 }
12
13 /* Acoustic Grand Piano seems to be the usual default instrument. */
14 #define DEFAULT_PROGRAM 0
15
16 /* 9 here is MIDI channel 10, which is the standard percussion channel.
17 Some files (notably C:\WINDOWS\CANYON.MID) think that 16 is one too.
18 On the other hand, some files know that 16 is not a drum channel and
19 try to play music on it. This is now a runtime option, so this isn't
20 a critical choice anymore. */
21 #define DEFAULT_DRUMCHANNELS (1<<9)
22
23 /* In percent. */
24 #define DEFAULT_AMPLIFICATION 70
25
26 /* Default polyphony */
27 /* #define DEFAULT_VOICES 32 */
28 #define DEFAULT_VOICES 256
29
30 /* 1000 here will give a control ratio of 22:1 with 22 kHz output.
31 Higher CONTROLS_PER_SECOND values allow more accurate rendering
32 of envelopes and tremolo. The cost is CPU time. */
33 #define CONTROLS_PER_SECOND 1000
34
35 /* Make envelopes twice as fast. Saves ~20% CPU time (notes decay
36 faster) and sounds more like a GUS. There is now a command line
37 option to toggle this as well. */
38 #define FAST_DECAY
39
40 /* How many bits to use for the fractional part of sample positions.
41 This affects tonal accuracy. The entire position counter must fit
42 in 32 bits, so with FRACTION_BITS equal to 12, the maximum size of
43 a sample is 1048576 samples (2 megabytes in memory). The GUS gets
44 by with just 9 bits and a little help from its friends...
45 "The GUS does not SUCK!!!" -- a happy user :) */
46 #define FRACTION_BITS 12
47
48 /* For some reason the sample volume is always set to maximum in all
49 patch files. Define this for a crude adjustment that may help
50 equalize instrument volumes. */
51 #define ADJUST_SAMPLE_VOLUMES
52
53 /* The number of samples to use for ramping out a dying note. Affects
54 click removal. */
55 #define MAX_DIE_TIME 20
56
57 /**************************************************************************/
58 /* Anything below this shouldn't need to be changed unless you're porting
59 to a new machine with other than 32-bit, big-endian words. */
60 /**************************************************************************/
61
62 /* change FRACTION_BITS above, not these */
63 #define INTEGER_MASK (0xFFFFFFFF << FRACTION_BITS)
64 #define FRACTION_MASK (~ INTEGER_MASK)
65
66 /* This is enforced by some computations that must fit in an int */
67 #define MAX_CONTROL_RATIO 255
68
69 #define MAX_AMPLIFICATION 800
70
71 /* You could specify a complete path, e.g. "/etc/timidity.cfg", and
72 then specify the library directory in the configuration file. */
73 #define CONFIG_FILE "timidity.cfg"
74 #define CONFIG_FILE_ETC "/etc/timidity.cfg"
75 #define CONFIG_FILE_ETC_TIMIDITY_FREEPATS "/etc/timidity/freepats.cfg"
76
77 #if defined(__WIN32__) || defined(__OS2__)
78 #define DEFAULT_PATH "C:\\TIMIDITY"
79 #else
80 #define DEFAULT_PATH "/etc/timidity"
81 #define DEFAULT_PATH1 "/usr/share/timidity"
82 #define DEFAULT_PATH2 "/usr/local/share/timidity"
83 #define DEFAULT_PATH3 "/usr/local/lib/timidity"
84 #endif
85
86 /* These affect general volume */
87 #define GUARD_BITS 3
88 #define AMP_BITS (15-GUARD_BITS)
89
90 #define MAX_AMP_VALUE ((1<<(AMP_BITS+1))-1)
91
92 #define FSCALE(a,b) (float)((a) * (double)(1<<(b)))
93 #define FSCALENEG(a,b) (float)((a) * (1.0L / (double)(1<<(b))))
94
95 /* Vibrato and tremolo Choices of the Day */
96 #define SWEEP_TUNING 38
97 #define VIBRATO_AMPLITUDE_TUNING 1.0L
98 #define VIBRATO_RATE_TUNING 38
99 #define TREMOLO_AMPLITUDE_TUNING 1.0L
100 #define TREMOLO_RATE_TUNING 38
101
102 #define SWEEP_SHIFT 16
103 #define RATE_SHIFT 5
104
105 #ifndef PI
106 #define PI 3.14159265358979323846
107 #endif
108
109 /* The path separator (D.M.) */
110 #if defined(__WIN32__) || defined(__OS2__)
111 # define PATH_SEP '\\'
112 #else
113 # define PATH_SEP '/'
114 #endif
115
116 #define SNDDBG(X)
0 /*
0 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
77
8 #include "config.h"
9 #include "output.h"
10 #include "tables.h"
8 output.c
9
10 Audio output (to file / device) functions.
11 */
1112
12
13 #ifdef SDL
14 extern PlayMode sdl_play_mode;
15 #define DEFAULT_PLAY_MODE &sdl_play_mode
13 #if HAVE_CONFIG_H
14 # include <config.h>
1615 #endif
1716
18 PlayMode *play_mode_list[] = {
19 #ifdef DEFAULT_PLAY_MODE
20 DEFAULT_PLAY_MODE,
21 #endif
22 0
23 };
17 #include "SDL.h"
2418
25 #ifdef DEFAULT_PLAY_MODE
26 PlayMode *play_mode=DEFAULT_PLAY_MODE;
27 #endif
19 #include "options.h"
20 #include "output.h"
2821
2922 /*****************************************************************/
3023 /* Some functions to convert signed 32-bit data to other formats */
3124
32 void s32tos8(void *dp, int32 *lp, int32 c)
25 void s32tos8(void *dp, Sint32 *lp, Sint32 c)
3326 {
34 int8 *cp=(int8 *)(dp);
35 int32 l;
27 Sint8 *cp=(Sint8 *)(dp);
28 Sint32 l;
3629 while (c--)
3730 {
3831 l=(*lp++)>>(32-8-GUARD_BITS);
3932 if (l>127) l=127;
4033 else if (l<-128) l=-128;
41 *cp++ = (int8) (l);
34 *cp++ = (Sint8) (l);
4235 }
4336 }
4437
45 void s32tou8(void *dp, int32 *lp, int32 c)
38 void s32tou8(void *dp, Sint32 *lp, Sint32 c)
4639 {
47 uint8 *cp=(uint8 *)(dp);
48 int32 l;
40 Uint8 *cp=(Uint8 *)(dp);
41 Sint32 l;
4942 while (c--)
5043 {
5144 l=(*lp++)>>(32-8-GUARD_BITS);
5245 if (l>127) l=127;
5346 else if (l<-128) l=-128;
54 *cp++ = 0x80 ^ ((uint8) l);
47 *cp++ = 0x80 ^ ((Uint8) l);
5548 }
5649 }
5750
58 void s32tos16(void *dp, int32 *lp, int32 c)
51 void s32tos16(void *dp, Sint32 *lp, Sint32 c)
5952 {
60 int16 *sp=(int16 *)(dp);
61 int32 l;
53 Sint16 *sp=(Sint16 *)(dp);
54 Sint32 l;
6255 while (c--)
6356 {
6457 l=(*lp++)>>(32-16-GUARD_BITS);
6558 if (l > 32767) l=32767;
6659 else if (l<-32768) l=-32768;
67 *sp++ = (int16)(l);
60 *sp++ = (Sint16)(l);
6861 }
6962 }
7063
71 void s32tou16(void *dp, int32 *lp, int32 c)
64 void s32tou16(void *dp, Sint32 *lp, Sint32 c)
7265 {
73 uint16 *sp=(uint16 *)(dp);
74 int32 l;
66 Uint16 *sp=(Uint16 *)(dp);
67 Sint32 l;
7568 while (c--)
7669 {
7770 l=(*lp++)>>(32-16-GUARD_BITS);
7871 if (l > 32767) l=32767;
7972 else if (l<-32768) l=-32768;
80 *sp++ = 0x8000 ^ (uint16)(l);
73 *sp++ = 0x8000 ^ (Uint16)(l);
8174 }
8275 }
8376
84 void s32tos16x(void *dp, int32 *lp, int32 c)
77 void s32tos16x(void *dp, Sint32 *lp, Sint32 c)
8578 {
86 int16 *sp=(int16 *)(dp);
87 int32 l;
79 Sint16 *sp=(Sint16 *)(dp);
80 Sint32 l;
8881 while (c--)
8982 {
9083 l=(*lp++)>>(32-16-GUARD_BITS);
9184 if (l > 32767) l=32767;
9285 else if (l<-32768) l=-32768;
93 *sp++ = XCHG_SHORT((int16)(l));
86 *sp++ = SDL_Swap16((Sint16)(l));
9487 }
9588 }
9689
97 void s32tou16x(void *dp, int32 *lp, int32 c)
90 void s32tou16x(void *dp, Sint32 *lp, Sint32 c)
9891 {
99 uint16 *sp=(uint16 *)(dp);
100 int32 l;
92 Uint16 *sp=(Uint16 *)(dp);
93 Sint32 l;
10194 while (c--)
10295 {
10396 l=(*lp++)>>(32-16-GUARD_BITS);
10497 if (l > 32767) l=32767;
10598 else if (l<-32768) l=-32768;
106 *sp++ = XCHG_SHORT(0x8000 ^ (uint16)(l));
99 *sp++ = SDL_Swap16(0x8000 ^ (Uint16)(l));
107100 }
108101 }
109102
110 void s32toulaw(void *dp, int32 *lp, int32 c)
103 void s32tof32(void *dp, Sint32 *lp, Sint32 c)
111104 {
112 uint8 *up=(uint8 *)(dp);
113 int32 l;
105 float *sp=(float *)(dp);
114106 while (c--)
115107 {
116 l=(*lp++)>>(32-13-GUARD_BITS);
117 if (l > 4095) l=4095;
118 else if (l<-4096) l=-4096;
119 *up++ = _l2u[l];
108 *sp++ = (float)(*lp++) / 2147483647.0f;
120109 }
121110 }
111
112 void s32tos32(void *dp, Sint32 *lp, Sint32 c)
113 {
114 Sint32 *sp=(Sint32 *)(dp);
115 while (c--)
116 {
117 *sp++ = (*lp++);
118 }
119 }
120
121 void s32tos32x(void *dp, Sint32 *lp, Sint32 c)
122 {
123 Sint32 *sp=(Sint32 *)(dp);
124 while (c--)
125 {
126 *sp++ = SDL_Swap32(*lp++);
127 }
128 }
0 /*
0 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 output.h
9
10 */
711
812 /* Data format encoding bits */
913
1014 #define PE_MONO 0x01 /* versus stereo */
1115 #define PE_SIGNED 0x02 /* versus unsigned */
1216 #define PE_16BIT 0x04 /* versus 8-bit */
13 #define PE_ULAW 0x08 /* versus linear */
14 #define PE_BYTESWAP 0x10 /* versus the other way */
17 #define PE_32BIT 0x08 /* versus 8-bit or 16-bit */
1518
16 typedef struct {
17 int32 rate, encoding;
18 char *id_name;
19 } PlayMode;
20
21 extern PlayMode *play_mode_list[], *play_mode;
22 extern int init_buffers(int kbytes);
23
24 /* Conversion functions -- These overwrite the int32 data in *lp with
19 /* Conversion functions -- These overwrite the Sint32 data in *lp with
2520 data in another format */
2621
27 /* The size of the output buffers */
28 extern int AUDIO_BUFFER_SIZE;
29
30 /* Actual copy function */
31 extern void (*s32tobuf)(void *dp, int32 *lp, int32 c);
32
3322 /* 8-bit signed and unsigned*/
34 extern void s32tos8(void *dp, int32 *lp, int32 c);
35 extern void s32tou8(void *dp, int32 *lp, int32 c);
23 extern void s32tos8(void *dp, Sint32 *lp, Sint32 c);
24 extern void s32tou8(void *dp, Sint32 *lp, Sint32 c);
3625
3726 /* 16-bit */
38 extern void s32tos16(void *dp, int32 *lp, int32 c);
39 extern void s32tou16(void *dp, int32 *lp, int32 c);
27 extern void s32tos16(void *dp, Sint32 *lp, Sint32 c);
28 extern void s32tou16(void *dp, Sint32 *lp, Sint32 c);
4029
4130 /* byte-exchanged 16-bit */
42 extern void s32tos16x(void *dp, int32 *lp, int32 c);
43 extern void s32tou16x(void *dp, int32 *lp, int32 c);
31 extern void s32tos16x(void *dp, Sint32 *lp, Sint32 c);
32 extern void s32tou16x(void *dp, Sint32 *lp, Sint32 c);
4433
45 /* uLaw (8 bits) */
46 extern void s32toulaw(void *dp, int32 *lp, int32 c);
34 /* 32-bit */
35 extern void s32tof32(void *dp, Sint32 *lp, Sint32 c);
36 extern void s32tos32(void *dp, Sint32 *lp, Sint32 c);
37
38 /* byte-exchanged 32-bit */
39 extern void s32tos32x(void *dp, Sint32 *lp, Sint32 c);
4740
4841 /* little-endian and big-endian specific */
4942 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
43 #define s32tos16l s32tos16
44 #define s32tos16b s32tos16x
5045 #define s32tou16l s32tou16
5146 #define s32tou16b s32tou16x
52 #define s32tos16l s32tos16
53 #define s32tos16b s32tos16x
47 #define s32tos32l s32tos32
48 #define s32tos32b s32tos32x
5449 #else
50 #define s32tos16l s32tos16x
51 #define s32tos16b s32tos16
5552 #define s32tou16l s32tou16x
5653 #define s32tou16b s32tou16
57 #define s32tos16l s32tos16x
58 #define s32tos16b s32tos16
54 #define s32tos32l s32tos32x
55 #define s32tos32b s32tos32
5956 #endif
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 playmidi.c -- random stuff in need of rearrangement
9
10 */
11
12 #if HAVE_CONFIG_H
13 # include <config.h>
14 #endif
715
816 #include <stdio.h>
917 #include <stdlib.h>
1018 #include <string.h>
1119
12 #include <SDL_rwops.h>
13
14 #include "config.h"
15 #include "common.h"
20 #include "SDL.h"
21
22 #include "timidity.h"
23 #include "options.h"
1624 #include "instrum.h"
1725 #include "playmidi.h"
18 #include "readmidi.h"
1926 #include "output.h"
2027 #include "mix.h"
21 #include "ctrlmode.h"
22 #include "timidity.h"
23
2428 #include "tables.h"
2529
26
27 static int opt_expression_curve = 2;
28 static int opt_volume_curve = 2;
29 static int opt_stereo_surround = 0;
30
31
32 Channel channel[MAXCHAN];
33 Voice voice[MAX_VOICES];
34 signed char drumvolume[MAXCHAN][MAXNOTE];
35 signed char drumpanpot[MAXCHAN][MAXNOTE];
36 signed char drumreverberation[MAXCHAN][MAXNOTE];
37 signed char drumchorusdepth[MAXCHAN][MAXNOTE];
38
39 int
40 voices=DEFAULT_VOICES;
41
42 int32
43 control_ratio=0,
44 amplification=DEFAULT_AMPLIFICATION;
45
46 FLOAT_T
47 master_volume;
48
49 int32 drumchannels=DEFAULT_DRUMCHANNELS;
50 int adjust_panning_immediately=0;
51
52 struct _MidiSong {
53 int32 samples;
54 MidiEvent *events;
55 };
56 static int midi_playing = 0;
57 static int32 lost_notes, cut_notes;
58 static int32 *buffer_pointer;
59 static int32 buffered_count;
60 extern int32 *common_buffer;
61 extern resample_t *resample_buffer; /* to free it on Timidity_Close */
62
63 static MidiEvent *event_list, *current_event;
64 static int32 sample_count, current_sample;
65
66 int GM_System_On=0;
67 int XG_System_On=0;
68 int GS_System_On=0;
69 int XG_System_reverb_type;
70 int XG_System_chorus_type;
71 int XG_System_variation_type;
72
73
74 static void adjust_amplification(void)
30 static void adjust_amplification(MidiSong *song)
7531 {
76 master_volume = (FLOAT_T)(amplification) / (FLOAT_T)100.0;
77 master_volume /= 2;
78 }
79
80
81 static void adjust_master_volume(int32 vol)
82 {
83 master_volume = (double)(vol*amplification) / 1638400.0L;
84 master_volume /= 2;
85 }
86
87
88 static void reset_voices(void)
32 song->master_volume = (float)(song->amplification) / (float)100.0;
33 }
34
35 static void reset_voices(MidiSong *song)
8936 {
9037 int i;
9138 for (i=0; i<MAX_VOICES; i++)
92 voice[i].status=VOICE_FREE;
39 song->voice[i].status=VOICE_FREE;
9340 }
9441
9542 /* Process the Reset All Controllers event */
96 static void reset_controllers(int c)
97 {
98 channel[c].volume=90; /* Some standard says, although the SCC docs say 0. */
99 channel[c].expression=127; /* SCC-1 does this. */
100 channel[c].sustain=0;
101 channel[c].pitchbend=0x2000;
102 channel[c].pitchfactor=0; /* to be computed */
103
104 channel[c].reverberation = 0;
105 channel[c].chorusdepth = 0;
106 }
107
108 static void redraw_controllers(int c)
109 {
110 ctl->volume(c, channel[c].volume);
111 ctl->expression(c, channel[c].expression);
112 ctl->sustain(c, channel[c].sustain);
113 ctl->pitch_bend(c, channel[c].pitchbend);
114 }
115
116 static void reset_midi(void)
43 static void reset_controllers(MidiSong *song, int c)
44 {
45 song->channel[c].volume=90; /* Some standard says, although the SCC docs say 0. */
46 song->channel[c].expression=127; /* SCC-1 does this. */
47 song->channel[c].sustain=0;
48 song->channel[c].pitchbend=0x2000;
49 song->channel[c].pitchfactor=0; /* to be computed */
50 }
51
52 static void reset_midi(MidiSong *song)
11753 {
11854 int i;
11955 for (i=0; i<MAXCHAN; i++)
12056 {
121 reset_controllers(i);
57 reset_controllers(song, i);
12258 /* The rest of these are unaffected by the Reset All Controllers event */
123 channel[i].program=default_program;
124 channel[i].panning=NO_PANNING;
125 channel[i].pitchsens=2;
126 channel[i].bank=0; /* tone bank or drum set */
127 channel[i].harmoniccontent=64,
128 channel[i].releasetime=64,
129 channel[i].attacktime=64,
130 channel[i].brightness=64,
131 channel[i].sfx=0;
132 }
133 reset_voices();
134 }
135
136 static void select_sample(int v, Instrument *ip)
137 {
138 int32 f, cdiff, diff, midfreq;
59 song->channel[i].program=song->default_program;
60 song->channel[i].panning=NO_PANNING;
61 song->channel[i].pitchsens=2;
62 song->channel[i].bank=0; /* tone bank or drum set */
63 }
64 reset_voices(song);
65 }
66
67 static void select_sample(MidiSong *song, int v, Instrument *ip, int vel)
68 {
69 Sint32 f, cdiff, diff;
13970 int s,i;
14071 Sample *sp, *closest;
14172
14475
14576 if (s==1)
14677 {
147 voice[v].sample=sp;
78 song->voice[v].sample=sp;
14879 return;
14980 }
15081
151 f=voice[v].orig_frequency;
82 f=song->voice[v].orig_frequency;
83 for (i=0; i<s; i++)
84 {
85 if (sp->low_freq <= f && sp->high_freq >= f)
86 {
87 song->voice[v].sample=sp;
88 return;
89 }
90 sp++;
91 }
92
15293 /*
15394 No suitable sample found! We'll select the sample whose root
15495 frequency is closest to the one we want. (Actually we should
15798
15899 cdiff=0x7FFFFFFF;
159100 closest=sp=ip->sample;
160 midfreq = (sp->low_freq + sp->high_freq) / 2;
161101 for(i=0; i<s; i++)
162102 {
163103 diff=sp->root_freq - f;
164 /* But the root freq. can perfectly well lie outside the keyrange
165 * frequencies, so let's try:
166 */
167 /* diff=midfreq - f; */
168104 if (diff<0) diff=-diff;
169105 if (diff<cdiff)
170106 {
173109 }
174110 sp++;
175111 }
176 voice[v].sample=closest;
112 song->voice[v].sample=closest;
177113 return;
178114 }
179115
180
181
182 static void select_stereo_samples(int v, InstrumentLayer *lp)
183 {
184 Instrument *ip;
185 InstrumentLayer *nlp, *bestvel;
186 int diffvel, midvel, mindiff;
187
188 /* select closest velocity */
189 bestvel = lp;
190 mindiff = 500;
191 for (nlp = lp; nlp; nlp = nlp->next) {
192 midvel = (nlp->hi + nlp->lo)/2;
193 if (!midvel) diffvel = 127;
194 else if (voice[v].velocity < nlp->lo || voice[v].velocity > nlp->hi)
195 diffvel = 200;
196 else diffvel = voice[v].velocity - midvel;
197 if (diffvel < 0) diffvel = -diffvel;
198 if (diffvel < mindiff) {
199 mindiff = diffvel;
200 bestvel = nlp;
201 }
202 }
203 ip = bestvel->instrument;
204
205 if (ip->right_sample) {
206 ip->sample = ip->right_sample;
207 ip->samples = ip->right_samples;
208 select_sample(v, ip);
209 voice[v].right_sample = voice[v].sample;
210 }
211 else voice[v].right_sample = 0;
212 ip->sample = ip->left_sample;
213 ip->samples = ip->left_samples;
214 select_sample(v, ip);
215 }
216
217
218 static void recompute_freq(int v)
116 static void recompute_freq(MidiSong *song, int v)
219117 {
220118 int
221 sign=(voice[v].sample_increment < 0), /* for bidirectional loops */
222 pb=channel[voice[v].channel].pitchbend;
119 sign=(song->voice[v].sample_increment < 0), /* for bidirectional loops */
120 pb=song->channel[song->voice[v].channel].pitchbend;
223121 double a;
224122
225 if (!voice[v].sample->sample_rate)
123 if (!song->voice[v].sample->sample_rate)
226124 return;
227125
228 if (voice[v].vibrato_control_ratio)
126 if (song->voice[v].vibrato_control_ratio)
229127 {
230128 /* This instrument has vibrato. Invalidate any precomputed
231129 sample_increments. */
232130
233131 int i=VIBRATO_SAMPLE_INCREMENTS;
234132 while (i--)
235 voice[v].vibrato_sample_increment[i]=0;
133 song->voice[v].vibrato_sample_increment[i]=0;
236134 }
237135
238136 if (pb==0x2000 || pb<0 || pb>0x3FFF)
239 voice[v].frequency=voice[v].orig_frequency;
137 song->voice[v].frequency = song->voice[v].orig_frequency;
240138 else
241139 {
242140 pb-=0x2000;
243 if (!(channel[voice[v].channel].pitchfactor))
141 if (!(song->channel[song->voice[v].channel].pitchfactor))
244142 {
245143 /* Damn. Somebody bent the pitch. */
246 int32 i=pb*channel[voice[v].channel].pitchsens;
144 Sint32 i=pb*song->channel[song->voice[v].channel].pitchsens;
247145 if (pb<0)
248146 i=-i;
249 channel[voice[v].channel].pitchfactor=
250 (FLOAT_T)(bend_fine[(i>>5) & 0xFF] * bend_coarse[i>>13]);
147 song->channel[song->voice[v].channel].pitchfactor=
148 (float)(bend_fine[(i>>5) & 0xFF] * bend_coarse[i>>13]);
251149 }
252150 if (pb>0)
253 voice[v].frequency=
254 (int32)(channel[voice[v].channel].pitchfactor *
255 (double)(voice[v].orig_frequency));
151 song->voice[v].frequency=
152 (Sint32)(song->channel[song->voice[v].channel].pitchfactor *
153 (double)(song->voice[v].orig_frequency));
256154 else
257 voice[v].frequency=
258 (int32)((double)(voice[v].orig_frequency) /
259 channel[voice[v].channel].pitchfactor);
260 }
261
262 a = FSCALE(((double)(voice[v].sample->sample_rate) *
263 (double)(voice[v].frequency)) /
264 ((double)(voice[v].sample->root_freq) *
265 (double)(play_mode->rate)),
155 song->voice[v].frequency=
156 (Sint32)((double)(song->voice[v].orig_frequency) /
157 song->channel[song->voice[v].channel].pitchfactor);
158 }
159
160 a = FSCALE(((double)(song->voice[v].sample->sample_rate) *
161 (double)(song->voice[v].frequency)) /
162 ((double)(song->voice[v].sample->root_freq) *
163 (double)(song->rate)),
266164 FRACTION_BITS);
267165
268166 if (sign)
269167 a = -a; /* need to preserve the loop direction */
270168
271 voice[v].sample_increment = (int32)(a);
272 }
273
274 static int expr_curve[128] = {
275 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11,
276 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15,
277 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 22,
278 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31,
279 32, 32, 33, 34, 35, 35, 36, 37, 38, 39, 39, 40, 41, 42, 43, 44,
280 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 59, 60, 61, 63,
281 64, 65, 67, 68, 70, 71, 73, 75, 76, 78, 80, 82, 83, 85, 87, 89,
282 91, 93, 95, 97, 99, 102, 104, 106, 109, 111, 113, 116, 118, 121,
283 124, 127
284 };
285
286 static int panf(int pan, int speaker, int separation)
287 {
288 int val;
289 val = abs(pan - speaker);
290 val = (val * 127) / separation;
291 val = 127 - val;
292 if (val < 0) val = 0;
293 if (val > 127) val = 127;
294 return expr_curve[val];
295 }
296
297
298 static int vcurve[128] = {
299 0,0,18,29,36,42,47,51,55,58,
300 60,63,65,67,69,71,73,74,76,77,
301 79,80,81,82,83,84,85,86,87,88,
302 89,90,91,92,92,93,94,95,95,96,
303 97,97,98,99,99,100,100,101,101,102,
304 103,103,104,104,105,105,106,106,106,107,
305 107,108,108,109,109,109,110,110,111,111,
306 111,112,112,112,113,113,114,114,114,115,
307 115,115,116,116,116,116,117,117,117,118,
308 118,118,119,119,119,119,120,120,120,120,
309 121,121,121,122,122,122,122,123,123,123,
310 123,123,124,124,124,124,125,125,125,125,
311 126,126,126,126,126,127,127,127
312 };
313
314 static void recompute_amp(int v)
315 {
316 int32 tempamp;
317 int chan = voice[v].channel;
318 int panning = voice[v].panning;
319 int vol = channel[chan].volume;
320 int expr = channel[chan].expression;
321 int vel = vcurve[voice[v].velocity];
322 FLOAT_T curved_expression, curved_volume;
323
324 if (channel[chan].kit)
325 {
326 int note = voice[v].sample->note_to_use;
327 if (note>0 && drumvolume[chan][note]>=0) vol = drumvolume[chan][note];
328 if (note>0 && drumpanpot[chan][note]>=0) panning = drumpanpot[chan][note];
329 }
330
331 if (opt_expression_curve == 2) curved_expression = 127.0 * vol_table[expr];
332 else if (opt_expression_curve == 1) curved_expression = 127.0 * expr_table[expr];
333 else curved_expression = (FLOAT_T)expr;
334
335 if (opt_volume_curve == 2) curved_volume = 127.0 * vol_table[vol];
336 else if (opt_volume_curve == 1) curved_volume = 127.0 * expr_table[vol];
337 else curved_volume = (FLOAT_T)vol;
338
339 tempamp= (int32)((FLOAT_T)vel * curved_volume * curved_expression); /* 21 bits */
169 song->voice[v].sample_increment = (Sint32)(a);
170 }
171
172 static void recompute_amp(MidiSong *song, int v)
173 {
174 Sint32 tempamp;
340175
341176 /* TODO: use fscale */
342177
343 if (num_ochannels > 1)
344 {
345 if (panning > 60 && panning < 68)
346 {
347 voice[v].panned=PANNED_CENTER;
348
349 if (num_ochannels == 6) voice[v].left_amp =
350 FSCALENEG((double) (tempamp) * voice[v].sample->volume *
351 master_volume, 20);
352 else voice[v].left_amp=
353 FSCALENEG((double)(tempamp) * voice[v].sample->volume *
354 master_volume, 21);
355 }
356 else if (panning<5)
357 {
358 voice[v].panned = PANNED_LEFT;
359
360 voice[v].left_amp=
361 FSCALENEG((double)(tempamp) * voice[v].sample->volume * master_volume,
178 tempamp= (song->voice[v].velocity *
179 song->channel[song->voice[v].channel].volume *
180 song->channel[song->voice[v].channel].expression); /* 21 bits */
181
182 if (!(song->encoding & PE_MONO))
183 {
184 if (song->voice[v].panning > 60 && song->voice[v].panning < 68)
185 {
186 song->voice[v].panned=PANNED_CENTER;
187
188 song->voice[v].left_amp=
189 FSCALENEG((double)(tempamp) * song->voice[v].sample->volume * song->master_volume,
190 21);
191 }
192 else if (song->voice[v].panning<5)
193 {
194 song->voice[v].panned = PANNED_LEFT;
195
196 song->voice[v].left_amp=
197 FSCALENEG((double)(tempamp) * song->voice[v].sample->volume * song->master_volume,
362198 20);
363199 }
364 else if (panning>123)
365 {
366 voice[v].panned = PANNED_RIGHT;
367
368 voice[v].left_amp= /* left_amp will be used */
369 FSCALENEG((double)(tempamp) * voice[v].sample->volume * master_volume,
200 else if (song->voice[v].panning>123)
201 {
202 song->voice[v].panned = PANNED_RIGHT;
203
204 song->voice[v].left_amp= /* left_amp will be used */
205 FSCALENEG((double)(tempamp) * song->voice[v].sample->volume * song->master_volume,
370206 20);
371207 }
372208 else
373209 {
374 FLOAT_T refv = (double)(tempamp) * voice[v].sample->volume * master_volume;
375 int wide_panning = 64;
376
377 if (num_ochannels == 4) wide_panning = 95;
378
379 voice[v].panned = PANNED_MYSTERY;
380 voice[v].lfe_amp = FSCALENEG(refv * 64, 27);
381
382 switch (num_ochannels)
383 {
384 case 2:
385 voice[v].lr_amp = 0;
386 voice[v].left_amp = FSCALENEG(refv * (128-panning), 27);
387 voice[v].ce_amp = 0;
388 voice[v].right_amp = FSCALENEG(refv * panning, 27);
389 voice[v].rr_amp = 0;
390 break;
391 case 4:
392 voice[v].lr_amp = FSCALENEG(refv * panf(panning, 0, wide_panning), 27);
393 voice[v].left_amp = FSCALENEG(refv * panf(panning, 32, wide_panning), 27);
394 voice[v].ce_amp = 0;
395 voice[v].right_amp = FSCALENEG(refv * panf(panning, 95, wide_panning), 27);
396 voice[v].rr_amp = FSCALENEG(refv * panf(panning, 128, wide_panning), 27);
397 break;
398 case 6:
399 voice[v].lr_amp = FSCALENEG(refv * panf(panning, 0, wide_panning), 27);
400 voice[v].left_amp = FSCALENEG(refv * panf(panning, 32, wide_panning), 27);
401 voice[v].ce_amp = FSCALENEG(refv * panf(panning, 64, wide_panning), 27);
402 voice[v].right_amp = FSCALENEG(refv * panf(panning, 95, wide_panning), 27);
403 voice[v].rr_amp = FSCALENEG(refv * panf(panning, 128, wide_panning), 27);
404 break;
405 }
406
407 }
408 }
409 else
410 {
411 voice[v].panned=PANNED_CENTER;
412
413 voice[v].left_amp=
414 FSCALENEG((double)(tempamp) * voice[v].sample->volume * master_volume,
210 song->voice[v].panned = PANNED_MYSTERY;
211
212 song->voice[v].left_amp=
213 FSCALENEG((double)(tempamp) * song->voice[v].sample->volume * song->master_volume,
214 27);
215 song->voice[v].right_amp = song->voice[v].left_amp * (song->voice[v].panning);
216 song->voice[v].left_amp *= (float)(127 - song->voice[v].panning);
217 }
218 }
219 else
220 {
221 song->voice[v].panned = PANNED_CENTER;
222
223 song->voice[v].left_amp=
224 FSCALENEG((double)(tempamp) * song->voice[v].sample->volume * song->master_volume,
415225 21);
416226 }
417227 }
418228
419
420 #define NOT_CLONE 0
421 #define STEREO_CLONE 1
422 #define REVERB_CLONE 2
423 #define CHORUS_CLONE 3
424
425
426 /* just a variant of note_on() */
427 static int vc_alloc(int j)
428 {
429 int i=voices;
229 static void start_note(MidiSong *song, MidiEvent *e, int i)
230 {
231 Instrument *ip;
232 int j;
233
234 if (ISDRUMCHANNEL(song, e->channel))
235 {
236 if (!(ip=song->drumset[song->channel[e->channel].bank]->instrument[e->a]))
237 {
238 if (!(ip=song->drumset[0]->instrument[e->a]))
239 return; /* No instrument? Then we can't play. */
240 }
241 if (ip->samples != 1)
242 {
243 SNDDBG(("Strange: percussion instrument with %d samples!",
244 ip->samples));
245 }
246
247 if (ip->sample->note_to_use) /* Do we have a fixed pitch? */
248 song->voice[i].orig_frequency = freq_table[(int)(ip->sample->note_to_use)];
249 else
250 song->voice[i].orig_frequency = freq_table[e->a & 0x7F];
251
252 /* drums are supposed to have only one sample */
253 song->voice[i].sample = ip->sample;
254 }
255 else
256 {
257 if (song->channel[e->channel].program == SPECIAL_PROGRAM)
258 ip=song->default_instrument;
259 else if (!(ip=song->tonebank[song->channel[e->channel].bank]->
260 instrument[song->channel[e->channel].program]))
261 {
262 if (!(ip=song->tonebank[0]->instrument[song->channel[e->channel].program]))
263 return; /* No instrument? Then we can't play. */
264 }
265
266 if (ip->sample->note_to_use) /* Fixed-pitch instrument? */
267 song->voice[i].orig_frequency = freq_table[(int)(ip->sample->note_to_use)];
268 else
269 song->voice[i].orig_frequency = freq_table[e->a & 0x7F];
270 select_sample(song, i, ip, e->b);
271 }
272
273 song->voice[i].status = VOICE_ON;
274 song->voice[i].channel = e->channel;
275 song->voice[i].note = e->a;
276 song->voice[i].velocity = e->b;
277 song->voice[i].sample_offset = 0;
278 song->voice[i].sample_increment = 0; /* make sure it isn't negative */
279
280 song->voice[i].tremolo_phase = 0;
281 song->voice[i].tremolo_phase_increment = song->voice[i].sample->tremolo_phase_increment;
282 song->voice[i].tremolo_sweep = song->voice[i].sample->tremolo_sweep_increment;
283 song->voice[i].tremolo_sweep_position = 0;
284
285 song->voice[i].vibrato_sweep = song->voice[i].sample->vibrato_sweep_increment;
286 song->voice[i].vibrato_sweep_position = 0;
287 song->voice[i].vibrato_control_ratio = song->voice[i].sample->vibrato_control_ratio;
288 song->voice[i].vibrato_control_counter = song->voice[i].vibrato_phase = 0;
289 for (j=0; j<VIBRATO_SAMPLE_INCREMENTS; j++)
290 song->voice[i].vibrato_sample_increment[j] = 0;
291
292 if (song->channel[e->channel].panning != NO_PANNING)
293 song->voice[i].panning = song->channel[e->channel].panning;
294 else
295 song->voice[i].panning = song->voice[i].sample->panning;
296
297 recompute_freq(song, i);
298 recompute_amp(song, i);
299 if (song->voice[i].sample->modes & MODES_ENVELOPE)
300 {
301 /* Ramp up from 0 */
302 song->voice[i].envelope_stage = 0;
303 song->voice[i].envelope_volume = 0;
304 song->voice[i].control_counter = 0;
305 recompute_envelope(song, i);
306 apply_envelope_to_amp(song, i);
307 }
308 else
309 {
310 song->voice[i].envelope_increment = 0;
311 apply_envelope_to_amp(song, i);
312 }
313 }
314
315 static void kill_note(MidiSong *song, int i)
316 {
317 song->voice[i].status = VOICE_DIE;
318 }
319
320 /* Only one instance of a note can be playing on a single channel. */
321 static void note_on(MidiSong *song)
322 {
323 int i = song->voices, lowest=-1;
324 Sint32 lv=0x7FFFFFFF, v;
325 MidiEvent *e = song->current_event;
430326
431327 while (i--)
432328 {
433 if (i == j) continue;
434 if (voice[i].status & VOICE_FREE) {
435 return i;
436 }
437 }
438 return -1;
439 }
440
441 static void kill_note(int i);
442
443 static void kill_others(int i)
444 {
445 int j=voices;
446
447 if (!voice[i].sample->exclusiveClass) return;
448
449 while (j--)
450 {
451 if (voice[j].status & (VOICE_FREE|VOICE_OFF|VOICE_DIE)) continue;
452 if (i == j) continue;
453 if (voice[i].channel != voice[j].channel) continue;
454 if (voice[j].sample->note_to_use)
455 {
456 if (voice[j].sample->exclusiveClass != voice[i].sample->exclusiveClass) continue;
457 kill_note(j);
458 }
459 }
460 }
461
462
463 static void clone_voice(Instrument *ip, int v, MidiEvent *e, int clone_type, int variationbank)
464 {
465 int w, played_note, chorus=0, reverb=0, milli;
466 int chan = voice[v].channel;
467
468 if (clone_type == STEREO_CLONE) {
469 if (!voice[v].right_sample && variationbank != 3) return;
470 if (variationbank == 6) return;
471 }
472
473 if (channel[chan].kit) {
474 reverb = drumreverberation[chan][voice[v].note];
475 chorus = drumchorusdepth[chan][voice[v].note];
476 }
477 else {
478 reverb = channel[chan].reverberation;
479 chorus = channel[chan].chorusdepth;
480 }
481
482 if (clone_type == REVERB_CLONE) chorus = 0;
483 else if (clone_type == CHORUS_CLONE) reverb = 0;
484 else if (clone_type == STEREO_CLONE) reverb = chorus = 0;
485
486 if (reverb > 127) reverb = 127;
487 if (chorus > 127) chorus = 127;
488
489 if (clone_type == CHORUS_CLONE) {
490 if (variationbank == 32) chorus = 30;
491 else if (variationbank == 33) chorus = 60;
492 else if (variationbank == 34) chorus = 90;
493 }
494
495 chorus /= 2; /* This is an ad hoc adjustment. */
496
497 if (!reverb && !chorus && clone_type != STEREO_CLONE) return;
498
499 if ( (w = vc_alloc(v)) < 0 ) return;
500
501 voice[w] = voice[v];
502 if (clone_type==STEREO_CLONE) voice[v].clone_voice = w;
503 voice[w].clone_voice = v;
504 voice[w].clone_type = clone_type;
505
506 voice[w].sample = voice[v].right_sample;
507 voice[w].velocity= e->b;
508
509 milli = play_mode->rate/1000;
510
511 if (clone_type == STEREO_CLONE) {
512 int left, right, leftpan, rightpan;
513 int panrequest = voice[v].panning;
514 if (variationbank == 3) {
515 voice[v].panning = 0;
516 voice[w].panning = 127;
517 }
518 else {
519 if (voice[v].sample->panning > voice[w].sample->panning) {
520 left = w;
521 right = v;
522 }
523 else {
524 left = v;
525 right = w;
526 }
527 #define INSTRUMENT_SEPARATION 12
528 leftpan = panrequest - INSTRUMENT_SEPARATION / 2;
529 rightpan = leftpan + INSTRUMENT_SEPARATION;
530 if (leftpan < 0) {
531 leftpan = 0;
532 rightpan = leftpan + INSTRUMENT_SEPARATION;
533 }
534 if (rightpan > 127) {
535 rightpan = 127;
536 leftpan = rightpan - INSTRUMENT_SEPARATION;
537 }
538 voice[left].panning = leftpan;
539 voice[right].panning = rightpan;
540 voice[right].echo_delay = 20 * milli;
541 }
542 }
543
544 voice[w].volume = voice[w].sample->volume;
545
546 if (reverb) {
547 if (opt_stereo_surround) {
548 if (voice[w].panning > 64) voice[w].panning = 127;
549 else voice[w].panning = 0;
550 }
551 else {
552 if (voice[v].panning < 64) voice[w].panning = 64 + reverb/2;
553 else voice[w].panning = 64 - reverb/2;
554 }
555
556 /* try 98->99 for melodic instruments ? (bit much for percussion) */
557 voice[w].volume *= vol_table[(127-reverb)/8 + 98];
558
559 voice[w].echo_delay += reverb * milli;
560 voice[w].envelope_rate[DECAY] *= 2;
561 voice[w].envelope_rate[RELEASE] /= 2;
562
563 if (XG_System_reverb_type >= 0) {
564 int subtype = XG_System_reverb_type & 0x07;
565 int rtype = XG_System_reverb_type >>3;
566 switch (rtype) {
567 case 0: /* no effect */
568 break;
569 case 1: /* hall */
570 if (subtype) voice[w].echo_delay += 100 * milli;
571 break;
572 case 2: /* room */
573 voice[w].echo_delay /= 2;
574 break;
575 case 3: /* stage */
576 voice[w].velocity = voice[v].velocity;
577 break;
578 case 4: /* plate */
579 voice[w].panning = voice[v].panning;
580 break;
581 case 16: /* white room */
582 voice[w].echo_delay = 0;
583 break;
584 case 17: /* tunnel */
585 voice[w].echo_delay *= 2;
586 voice[w].velocity /= 2;
587 break;
588 case 18: /* canyon */
589 voice[w].echo_delay *= 2;
590 break;
591 case 19: /* basement */
592 voice[w].velocity /= 2;
593 break;
594 default: break;
595 }
596 }
597 }
598 played_note = voice[w].sample->note_to_use;
599 if (!played_note) {
600 played_note = e->a & 0x7f;
601 if (variationbank == 35) played_note += 12;
602 else if (variationbank == 36) played_note -= 12;
603 else if (variationbank == 37) played_note += 7;
604 else if (variationbank == 36) played_note -= 7;
605 }
606 #if 0
607 played_note = ( (played_note - voice[w].sample->freq_center) * voice[w].sample->freq_scale ) / 1024 +
608 voice[w].sample->freq_center;
609 #endif
610 voice[w].note = played_note;
611 voice[w].orig_frequency = freq_table[played_note];
612
613 if (chorus) {
614 if (opt_stereo_surround) {
615 if (voice[v].panning < 64) voice[w].panning = voice[v].panning + 32;
616 else voice[w].panning = voice[v].panning - 32;
617 }
618
619 if (!voice[w].vibrato_control_ratio) {
620 voice[w].vibrato_control_ratio = 100;
621 voice[w].vibrato_depth = 6;
622 voice[w].vibrato_sweep = 74;
623 }
624 voice[w].volume *= 0.40;
625 voice[v].volume = voice[w].volume;
626 recompute_amp(v);
627 apply_envelope_to_amp(v);
628 voice[w].vibrato_sweep = chorus/2;
629 voice[w].vibrato_depth /= 2;
630 if (!voice[w].vibrato_depth) voice[w].vibrato_depth = 2;
631 voice[w].vibrato_control_ratio /= 2;
632 voice[w].echo_delay += 30 * milli;
633
634 if (XG_System_chorus_type >= 0) {
635 int subtype = XG_System_chorus_type & 0x07;
636 int chtype = 0x0f & (XG_System_chorus_type >> 3);
637 switch (chtype) {
638 case 0: /* no effect */
639 break;
640 case 1: /* chorus */
641 chorus /= 3;
642 if(channel[ voice[w].channel ].pitchbend + chorus < 0x2000)
643 voice[w].orig_frequency =
644 (uint32)( (FLOAT_T)voice[w].orig_frequency * bend_fine[chorus] );
645 else voice[w].orig_frequency =
646 (uint32)( (FLOAT_T)voice[w].orig_frequency / bend_fine[chorus] );
647 if (subtype) voice[w].vibrato_depth *= 2;
648 break;
649 case 2: /* celeste */
650 voice[w].orig_frequency += (voice[w].orig_frequency/128) * chorus;
651 break;
652 case 3: /* flanger */
653 voice[w].vibrato_control_ratio = 10;
654 voice[w].vibrato_depth = 100;
655 voice[w].vibrato_sweep = 8;
656 voice[w].echo_delay += 200 * milli;
657 break;
658 case 4: /* symphonic : cf Children of the Night /128 bad, /1024 ok */
659 voice[w].orig_frequency += (voice[w].orig_frequency/512) * chorus;
660 voice[v].orig_frequency -= (voice[v].orig_frequency/512) * chorus;
661 recompute_freq(v);
662 break;
663 case 8: /* phaser */
664 break;
665 default:
666 break;
667 }
668 }
669 else {
670 chorus /= 3;
671 if(channel[ voice[w].channel ].pitchbend + chorus < 0x2000)
672 voice[w].orig_frequency =
673 (uint32)( (FLOAT_T)voice[w].orig_frequency * bend_fine[chorus] );
674 else voice[w].orig_frequency =
675 (uint32)( (FLOAT_T)voice[w].orig_frequency / bend_fine[chorus] );
676 }
677 }
678 #if 0
679 voice[w].loop_start = voice[w].sample->loop_start;
680 voice[w].loop_end = voice[w].sample->loop_end;
681 #endif
682 voice[w].echo_delay_count = voice[w].echo_delay;
683 if (reverb) voice[w].echo_delay *= 2;
684
685 recompute_freq(w);
686 recompute_amp(w);
687 if (voice[w].sample->modes & MODES_ENVELOPE)
688 {
689 /* Ramp up from 0 */
690 voice[w].envelope_stage=ATTACK;
691 voice[w].modulation_stage=ATTACK;
692 voice[w].envelope_volume=0;
693 voice[w].modulation_volume=0;
694 voice[w].control_counter=0;
695 voice[w].modulation_counter=0;
696 recompute_envelope(w);
697 /*recompute_modulation(w);*/
698 }
699 else
700 {
701 voice[w].envelope_increment=0;
702 voice[w].modulation_increment=0;
703 }
704 apply_envelope_to_amp(w);
705 }
706
707
708 static void xremap(int *banknumpt, int *this_notept, int this_kit) {
709 int i, newmap;
710 int banknum = *banknumpt;
711 int this_note = *this_notept;
712 int newbank, newnote;
713
714 if (!this_kit) {
715 if (banknum == SFXBANK && tonebank[SFXBANK]) return;
716 if (banknum == SFXBANK && tonebank[120]) *banknumpt = 120;
717 return;
718 }
719
720 if (this_kit != 127 && this_kit != 126) return;
721
722 for (i = 0; i < XMAPMAX; i++) {
723 newmap = xmap[i][0];
724 if (!newmap) return;
725 if (this_kit == 127 && newmap != XGDRUM) continue;
726 if (this_kit == 126 && newmap != SFXDRUM1) continue;
727 if (xmap[i][1] != banknum) continue;
728 if (xmap[i][3] != this_note) continue;
729 newbank = xmap[i][2];
730 newnote = xmap[i][4];
731 if (newbank == banknum && newnote == this_note) return;
732 if (!drumset[newbank]) return;
733 if (!drumset[newbank]->tone[newnote].layer) return;
734 if (drumset[newbank]->tone[newnote].layer == MAGIC_LOAD_INSTRUMENT) return;
735 *banknumpt = newbank;
736 *this_notept = newnote;
737 return;
738 }
739 }
740
741
742 static void start_note(MidiEvent *e, int i)
743 {
744 InstrumentLayer *lp;
745 Instrument *ip;
746 int j, banknum, ch=e->channel;
747 int played_note, drumpan=NO_PANNING;
748 int32 rt;
749 int attacktime, releasetime, decaytime, variationbank;
750 int brightness = channel[ch].brightness;
751 int harmoniccontent = channel[ch].harmoniccontent;
752 int this_note = e->a;
753 int this_velocity = e->b;
754 int drumsflag = channel[ch].kit;
755 int this_prog = channel[ch].program;
756
757 if (channel[ch].sfx) banknum=channel[ch].sfx;
758 else banknum=channel[ch].bank;
759
760 voice[i].velocity=this_velocity;
761
762 if (XG_System_On) xremap(&banknum, &this_note, drumsflag);
763 /* if (current_config_pc42b) pcmap(&banknum, &this_note, &this_prog, &drumsflag); */
764
765 if (drumsflag)
766 {
767 if (!(lp=drumset[banknum]->tone[this_note].layer))
768 {
769 if (!(lp=drumset[0]->tone[this_note].layer))
770 return; /* No instrument? Then we can't play. */
771 }
772 ip = lp->instrument;
773 if (ip->type == INST_GUS && ip->samples != 1)
774 {
775 ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
776 "Strange: percussion instrument with %d samples!", ip->samples);
777 }
778
779 if (ip->sample->note_to_use) /* Do we have a fixed pitch? */
780 {
781 voice[i].orig_frequency=freq_table[(int)(ip->sample->note_to_use)];
782 drumpan=drumpanpot[ch][(int)ip->sample->note_to_use];
783 }
784 else
785 voice[i].orig_frequency=freq_table[this_note & 0x7F];
786
787 }
788 else
789 {
790 if (channel[ch].program==SPECIAL_PROGRAM)
791 lp=default_instrument;
792 else if (!(lp=tonebank[channel[ch].bank]->
793 tone[channel[ch].program].layer))
794 {
795 if (!(lp=tonebank[0]->tone[this_prog].layer))
796 return; /* No instrument? Then we can't play. */
797 }
798 ip = lp->instrument;
799 if (ip->sample->note_to_use) /* Fixed-pitch instrument? */
800 voice[i].orig_frequency=freq_table[(int)(ip->sample->note_to_use)];
801 else
802 voice[i].orig_frequency=freq_table[this_note & 0x7F];
803 }
804
805 select_stereo_samples(i, lp);
806
807 voice[i].starttime = e->time;
808 played_note = voice[i].sample->note_to_use;
809
810 if (!played_note || !drumsflag) played_note = this_note & 0x7f;
811 #if 0
812 played_note = ( (played_note - voice[i].sample->freq_center) * voice[i].sample->freq_scale ) / 1024 +
813 voice[i].sample->freq_center;
814 #endif
815 voice[i].status=VOICE_ON;
816 voice[i].channel=ch;
817 voice[i].note=played_note;
818 voice[i].velocity=this_velocity;
819 voice[i].sample_offset=0;
820 voice[i].sample_increment=0; /* make sure it isn't negative */
821
822 voice[i].tremolo_phase=0;
823 voice[i].tremolo_phase_increment=voice[i].sample->tremolo_phase_increment;
824 voice[i].tremolo_sweep=voice[i].sample->tremolo_sweep_increment;
825 voice[i].tremolo_sweep_position=0;
826
827 voice[i].vibrato_sweep=voice[i].sample->vibrato_sweep_increment;
828 voice[i].vibrato_sweep_position=0;
829 voice[i].vibrato_depth=voice[i].sample->vibrato_depth;
830 voice[i].vibrato_control_ratio=voice[i].sample->vibrato_control_ratio;
831 voice[i].vibrato_control_counter=voice[i].vibrato_phase=0;
832 voice[i].vibrato_delay = voice[i].sample->vibrato_delay;
833
834 kill_others(i);
835
836 for (j=0; j<VIBRATO_SAMPLE_INCREMENTS; j++)
837 voice[i].vibrato_sample_increment[j]=0;
838
839
840 attacktime = channel[ch].attacktime;
841 releasetime = channel[ch].releasetime;
842 decaytime = 64;
843 variationbank = channel[ch].variationbank;
844
845 switch (variationbank) {
846 case 8:
847 attacktime = 64+32;
848 break;
849 case 12:
850 decaytime = 64-32;
851 break;
852 case 16:
853 brightness = 64+16;
854 break;
855 case 17:
856 brightness = 64+32;
857 break;
858 case 18:
859 brightness = 64-16;
860 break;
861 case 19:
862 brightness = 64-32;
863 break;
864 case 20:
865 harmoniccontent = 64+16;
866 break;
867 #if 0
868 case 24:
869 voice[i].modEnvToFilterFc=2.0;
870 voice[i].sample->cutoff_freq = 800;
871 break;
872 case 25:
873 voice[i].modEnvToFilterFc=-2.0;
874 voice[i].sample->cutoff_freq = 800;
875 break;
876 case 27:
877 voice[i].modLfoToFilterFc=2.0;
878 voice[i].lfo_phase_increment=109;
879 voice[i].lfo_sweep=122;
880 voice[i].sample->cutoff_freq = 800;
881 break;
882 case 28:
883 voice[i].modLfoToFilterFc=-2.0;
884 voice[i].lfo_phase_increment=109;
885 voice[i].lfo_sweep=122;
886 voice[i].sample->cutoff_freq = 800;
887 break;
888 #endif
889 default:
890 break;
891 }
892
893
894 for (j=ATTACK; j<MAXPOINT; j++)
895 {
896 voice[i].envelope_rate[j]=voice[i].sample->envelope_rate[j];
897 voice[i].envelope_offset[j]=voice[i].sample->envelope_offset[j];
898 }
899
900 voice[i].echo_delay=voice[i].envelope_rate[DELAY];
901 voice[i].echo_delay_count = voice[i].echo_delay;
902
903 if (attacktime!=64)
904 {
905 rt = voice[i].envelope_rate[ATTACK];
906 rt = rt + ( (64-attacktime)*rt ) / 100;
907 if (rt > 1000) voice[i].envelope_rate[ATTACK] = rt;
908 }
909 if (releasetime!=64)
910 {
911 rt = voice[i].envelope_rate[RELEASE];
912 rt = rt + ( (64-releasetime)*rt ) / 100;
913 if (rt > 1000) voice[i].envelope_rate[RELEASE] = rt;
914 }
915 if (decaytime!=64)
916 {
917 rt = voice[i].envelope_rate[DECAY];
918 rt = rt + ( (64-decaytime)*rt ) / 100;
919 if (rt > 1000) voice[i].envelope_rate[DECAY] = rt;
920 }
921
922 if (channel[ch].panning != NO_PANNING)
923 voice[i].panning=channel[ch].panning;
924 else
925 voice[i].panning=voice[i].sample->panning;
926 if (drumpan != NO_PANNING)
927 voice[i].panning=drumpan;
928
929 if (variationbank == 1) {
930 int pan = voice[i].panning;
931 int disturb = 0;
932 /* If they're close up (no reverb) and you are behind the pianist,
933 * high notes come from the right, so we'll spread piano etc. notes
934 * out horizontally according to their pitches.
935 */
936 if (this_prog < 21) {
937 int n = voice[i].velocity - 32;
938 if (n < 0) n = 0;
939 if (n > 64) n = 64;
940 pan = pan/2 + n;
941 }
942 /* For other types of instruments, the music sounds more alive if
943 * notes come from slightly different directions. However, instruments
944 * do drift around in a sometimes disconcerting way, so the following
945 * might not be such a good idea.
946 */
947 else disturb = (voice[i].velocity/32 % 8) +
948 (voice[i].note % 8); /* /16? */
949
950 if (pan < 64) pan += disturb;
951 else pan -= disturb;
952 if (pan < 0) pan = 0;
953 else if (pan > 127) pan = 127;
954 voice[i].panning = pan;
955 }
956
957 recompute_freq(i);
958 recompute_amp(i);
959 if (voice[i].sample->modes & MODES_ENVELOPE)
960 {
961 /* Ramp up from 0 */
962 voice[i].envelope_stage=ATTACK;
963 voice[i].envelope_volume=0;
964 voice[i].control_counter=0;
965 recompute_envelope(i);
966 }
967 else
968 {
969 voice[i].envelope_increment=0;
970 }
971 apply_envelope_to_amp(i);
972
973 voice[i].clone_voice = -1;
974 voice[i].clone_type = NOT_CLONE;
975
976 clone_voice(ip, i, e, STEREO_CLONE, variationbank);
977 clone_voice(ip, i, e, CHORUS_CLONE, variationbank);
978 clone_voice(ip, i, e, REVERB_CLONE, variationbank);
979
980 ctl->note(i);
981 }
982
983 static void kill_note(int i)
984 {
985 voice[i].status=VOICE_DIE;
986 if (voice[i].clone_voice >= 0)
987 voice[ voice[i].clone_voice ].status=VOICE_DIE;
988 ctl->note(i);
989 }
990
991
992 /* Only one instance of a note can be playing on a single channel. */
993 static void note_on(MidiEvent *e)
994 {
995 int i=voices, lowest=-1;
996 int32 lv=0x7FFFFFFF, v;
997
329 if (song->voice[i].status == VOICE_FREE)
330 lowest=i; /* Can't get a lower volume than silence */
331 else if (song->voice[i].channel==e->channel &&
332 (song->voice[i].note==e->a || song->channel[song->voice[i].channel].mono))
333 kill_note(song, i);
334 }
335
336 if (lowest != -1)
337 {
338 /* Found a free voice. */
339 start_note(song,e,lowest);
340 return;
341 }
342
343 /* Look for the decaying note with the lowest volume */
344 i = song->voices;
998345 while (i--)
999346 {
1000 if (voice[i].status == VOICE_FREE)
1001 lowest=i; /* Can't get a lower volume than silence */
1002 else if (voice[i].channel==e->channel &&
1003 (voice[i].note==e->a || channel[voice[i].channel].mono))
1004 kill_note(i);
1005 }
1006
1007 if (lowest != -1)
1008 {
1009 /* Found a free voice. */
1010 start_note(e,lowest);
1011 return;
1012 }
1013
1014 #if 0
1015 /* Look for the decaying note with the lowest volume */
1016 i=voices;
1017 while (i--)
1018 {
1019 if (voice[i].status & ~(VOICE_ON | VOICE_DIE | VOICE_FREE))
1020 {
1021 v=voice[i].left_mix;
1022 if ((voice[i].panned==PANNED_MYSTERY) && (voice[i].right_mix>v))
1023 v=voice[i].right_mix;
347 if ((song->voice[i].status != VOICE_ON) &&
348 (song->voice[i].status != VOICE_DIE))
349 {
350 v = song->voice[i].left_mix;
351 if ((song->voice[i].panned == PANNED_MYSTERY)
352 && (song->voice[i].right_mix > v))
353 v = song->voice[i].right_mix;
1024354 if (v<lv)
1025355 {
1026356 lv=v;
1028358 }
1029359 }
1030360 }
1031 #endif
1032
1033 /* Look for the decaying note with the lowest volume */
1034 if (lowest==-1)
1035 {
1036 i=voices;
1037 while (i--)
1038 {
1039 if ( (voice[i].status & ~(VOICE_ON | VOICE_DIE | VOICE_FREE)) &&
1040 (!voice[i].clone_type))
1041 {
1042 v=voice[i].left_mix;
1043 if ((voice[i].panned==PANNED_MYSTERY) && (voice[i].right_mix>v))
1044 v=voice[i].right_mix;
1045 if (v<lv)
1046 {
1047 lv=v;
1048 lowest=i;
1049 }
1050 }
1051 }
1052 }
1053361
1054362 if (lowest != -1)
1055363 {
1056 int cl = voice[lowest].clone_voice;
1057
1058364 /* This can still cause a click, but if we had a free voice to
1059365 spare for ramping down this note, we wouldn't need to kill it
1060366 in the first place... Still, this needs to be fixed. Perhaps
1061367 we could use a reserve of voices to play dying notes only. */
1062
1063 if (cl >= 0) {
1064 if (voice[cl].clone_type==STEREO_CLONE ||
1065 (!voice[cl].clone_type && voice[lowest].clone_type==STEREO_CLONE))
1066 voice[cl].status=VOICE_FREE;
1067 else if (voice[cl].clone_voice==lowest) voice[cl].clone_voice=-1;
1068 }
1069
1070 cut_notes++;
1071 voice[lowest].status=VOICE_FREE;
1072 ctl->note(lowest);
1073 start_note(e,lowest);
1074 }
1075 else
1076 lost_notes++;
1077 }
1078
1079 static void finish_note(int i)
1080 {
1081 if (voice[i].sample->modes & MODES_ENVELOPE)
368
369 song->cut_notes++;
370 song->voice[lowest].status=VOICE_FREE;
371 start_note(song,e,lowest);
372 }
373 else
374 song->lost_notes++;
375 }
376
377 static void finish_note(MidiSong *song, int i)
378 {
379 if (song->voice[i].sample->modes & MODES_ENVELOPE)
1082380 {
1083381 /* We need to get the envelope out of Sustain stage */
1084 voice[i].envelope_stage=3;
1085 voice[i].status=VOICE_OFF;
1086 recompute_envelope(i);
1087 apply_envelope_to_amp(i);
1088 ctl->note(i);
382 song->voice[i].envelope_stage = 3;
383 song->voice[i].status = VOICE_OFF;
384 recompute_envelope(song, i);
385 apply_envelope_to_amp(song, i);
1089386 }
1090387 else
1091388 {
1092389 /* Set status to OFF so resample_voice() will let this voice out
1093390 of its loop, if any. In any case, this voice dies when it
1094391 hits the end of its data (ofs>=data_length). */
1095 voice[i].status=VOICE_OFF;
1096 }
1097
1098 { int v;
1099 if ( (v=voice[i].clone_voice) >= 0)
392 song->voice[i].status = VOICE_OFF;
393 }
394 }
395
396 static void note_off(MidiSong *song)
397 {
398 int i = song->voices;
399 MidiEvent *e = song->current_event;
400
401 while (i--)
402 if (song->voice[i].status == VOICE_ON &&
403 song->voice[i].channel == e->channel &&
404 song->voice[i].note == e->a)
1100405 {
1101 voice[i].clone_voice = -1;
1102 finish_note(v);
1103 }
1104 }
1105 }
1106
1107 static void note_off(MidiEvent *e)
1108 {
1109 int i=voices, v;
1110 while (i--)
1111 if (voice[i].status==VOICE_ON &&
1112 voice[i].channel==e->channel &&
1113 voice[i].note==e->a)
1114 {
1115 if (channel[e->channel].sustain)
406 if (song->channel[e->channel].sustain)
1116407 {
1117 voice[i].status=VOICE_SUSTAINED;
1118
1119 if ( (v=voice[i].clone_voice) >= 0)
1120 {
1121 if (voice[v].status == VOICE_ON)
1122 voice[v].status=VOICE_SUSTAINED;
1123 }
1124
1125 ctl->note(i);
408 song->voice[i].status = VOICE_SUSTAINED;
1126409 }
1127410 else
1128 finish_note(i);
411 finish_note(song, i);
1129412 return;
1130413 }
1131414 }
1132415
1133416 /* Process the All Notes Off event */
1134 static void all_notes_off(int c)
1135 {
1136 int i=voices;
1137 ctl->cmsg(CMSG_INFO, VERB_DEBUG, "All notes off on channel %d", c);
417 static void all_notes_off(MidiSong *song)
418 {
419 int i = song->voices;
420 int c = song->current_event->channel;
421
422 SNDDBG(("All notes off on channel %d", c));
1138423 while (i--)
1139 if (voice[i].status==VOICE_ON &&
1140 voice[i].channel==c)
424 if (song->voice[i].status == VOICE_ON &&
425 song->voice[i].channel == c)
1141426 {
1142 if (channel[c].sustain)
1143 {
1144 voice[i].status=VOICE_SUSTAINED;
1145 ctl->note(i);
1146 }
427 if (song->channel[c].sustain)
428 song->voice[i].status = VOICE_SUSTAINED;
1147429 else
1148 finish_note(i);
430 finish_note(song, i);
1149431 }
1150432 }
1151433
1152434 /* Process the All Sounds Off event */
1153 static void all_sounds_off(int c)
1154 {
1155 int i=voices;
435 static void all_sounds_off(MidiSong *song)
436 {
437 int i = song->voices;
438 int c = song->current_event->channel;
439
1156440 while (i--)
1157 if (voice[i].channel==c &&
1158 voice[i].status != VOICE_FREE &&
1159 voice[i].status != VOICE_DIE)
441 if (song->voice[i].channel == c &&
442 song->voice[i].status != VOICE_FREE &&
443 song->voice[i].status != VOICE_DIE)
1160444 {
1161 kill_note(i);
445 kill_note(song, i);
1162446 }
1163447 }
1164448
1165 static void adjust_pressure(MidiEvent *e)
1166 {
1167 int i=voices;
449 static void adjust_pressure(MidiSong *song)
450 {
451 MidiEvent *e = song->current_event;
452 int i = song->voices;
453
1168454 while (i--)
1169 if (voice[i].status==VOICE_ON &&
1170 voice[i].channel==e->channel &&
1171 voice[i].note==e->a)
455 if (song->voice[i].status == VOICE_ON &&
456 song->voice[i].channel == e->channel &&
457 song->voice[i].note == e->a)
1172458 {
1173 voice[i].velocity=e->b;
1174 recompute_amp(i);
1175 apply_envelope_to_amp(i);
459 song->voice[i].velocity = e->b;
460 recompute_amp(song, i);
461 apply_envelope_to_amp(song, i);
1176462 return;
1177463 }
1178464 }
1179465
1180 static void adjust_panning(int c)
1181 {
1182 int i=voices;
466 static void drop_sustain(MidiSong *song)
467 {
468 int i = song->voices;
469 int c = song->current_event->channel;
470
1183471 while (i--)
1184 if ((voice[i].channel==c) &&
1185 (voice[i].status==VOICE_ON || voice[i].status==VOICE_SUSTAINED))
472 if (song->voice[i].status == VOICE_SUSTAINED && song->voice[i].channel == c)
473 finish_note(song, i);
474 }
475
476 static void adjust_pitchbend(MidiSong *song)
477 {
478 int c = song->current_event->channel;
479 int i = song->voices;
480
481 while (i--)
482 if (song->voice[i].status != VOICE_FREE && song->voice[i].channel == c)
1186483 {
1187 if (voice[i].clone_type != NOT_CLONE) continue;
1188 voice[i].panning=channel[c].panning;
1189 recompute_amp(i);
1190 apply_envelope_to_amp(i);
484 recompute_freq(song, i);
1191485 }
1192486 }
1193487
1194 static void drop_sustain(int c)
1195 {
1196 int i=voices;
488 static void adjust_volume(MidiSong *song)
489 {
490 int c = song->current_event->channel;
491 int i = song->voices;
492
1197493 while (i--)
1198 if (voice[i].status==VOICE_SUSTAINED && voice[i].channel==c)
1199 finish_note(i);
1200 }
1201
1202 static void adjust_pitchbend(int c)
1203 {
1204 int i=voices;
1205 while (i--)
1206 if (voice[i].status!=VOICE_FREE && voice[i].channel==c)
494 if (song->voice[i].channel == c &&
495 (song->voice[i].status==VOICE_ON || song->voice[i].status==VOICE_SUSTAINED))
1207496 {
1208 recompute_freq(i);
497 recompute_amp(song, i);
498 apply_envelope_to_amp(song, i);
1209499 }
1210500 }
1211501
1212 static void adjust_volume(int c)
1213 {
1214 int i=voices;
1215 while (i--)
1216 if (voice[i].channel==c &&
1217 (voice[i].status==VOICE_ON || voice[i].status==VOICE_SUSTAINED))
1218 {
1219 recompute_amp(i);
1220 apply_envelope_to_amp(i);
1221 }
1222 }
1223
1224 static void seek_forward(int32 until_time)
1225 {
1226 reset_voices();
1227 while (current_event->time < until_time)
1228 {
1229 switch(current_event->type)
502 static void seek_forward(MidiSong *song, Sint32 until_time)
503 {
504 reset_voices(song);
505 while (song->current_event->time < until_time)
506 {
507 switch(song->current_event->type)
1230508 {
1231509 /* All notes stay off. Just handle the parameter changes. */
1232510
1233511 case ME_PITCH_SENS:
1234 channel[current_event->channel].pitchsens=
1235 current_event->a;
1236 channel[current_event->channel].pitchfactor=0;
512 song->channel[song->current_event->channel].pitchsens =
513 song->current_event->a;
514 song->channel[song->current_event->channel].pitchfactor = 0;
1237515 break;
1238516
1239517 case ME_PITCHWHEEL:
1240 channel[current_event->channel].pitchbend=
1241 current_event->a + current_event->b * 128;
1242 channel[current_event->channel].pitchfactor=0;
518 song->channel[song->current_event->channel].pitchbend =
519 song->current_event->a + song->current_event->b * 128;
520 song->channel[song->current_event->channel].pitchfactor = 0;
1243521 break;
1244522
1245523 case ME_MAINVOLUME:
1246 channel[current_event->channel].volume=current_event->a;
1247 break;
1248
1249 case ME_MASTERVOLUME:
1250 adjust_master_volume(current_event->a + (current_event->b <<7));
524 song->channel[song->current_event->channel].volume =
525 song->current_event->a;
1251526 break;
1252527
1253528 case ME_PAN:
1254 channel[current_event->channel].panning=current_event->a;
529 song->channel[song->current_event->channel].panning =
530 song->current_event->a;
1255531 break;
1256532
1257533 case ME_EXPRESSION:
1258 channel[current_event->channel].expression=current_event->a;
534 song->channel[song->current_event->channel].expression =
535 song->current_event->a;
1259536 break;
1260537
1261538 case ME_PROGRAM:
1262 /* if (ISDRUMCHANNEL(current_event->channel)) */
1263 if (channel[current_event->channel].kit)
539 if (ISDRUMCHANNEL(song, song->current_event->channel))
1264540 /* Change drum set */
1265 channel[current_event->channel].bank=current_event->a;
541 song->channel[song->current_event->channel].bank =
542 song->current_event->a;
1266543 else
1267 channel[current_event->channel].program=current_event->a;
544 song->channel[song->current_event->channel].program =
545 song->current_event->a;
1268546 break;
1269547
1270548 case ME_SUSTAIN:
1271 channel[current_event->channel].sustain=current_event->a;
549 song->channel[song->current_event->channel].sustain =
550 song->current_event->a;
1272551 break;
1273552
1274
1275 case ME_REVERBERATION:
1276 channel[current_event->channel].reverberation=current_event->a;
1277 break;
1278
1279 case ME_CHORUSDEPTH:
1280 channel[current_event->channel].chorusdepth=current_event->a;
1281 break;
1282
1283 case ME_HARMONICCONTENT:
1284 channel[current_event->channel].harmoniccontent=current_event->a;
1285 break;
1286
1287 case ME_RELEASETIME:
1288 channel[current_event->channel].releasetime=current_event->a;
1289 break;
1290
1291 case ME_ATTACKTIME:
1292 channel[current_event->channel].attacktime=current_event->a;
1293 break;
1294
1295 case ME_BRIGHTNESS:
1296 channel[current_event->channel].brightness=current_event->a;
1297 break;
1298
1299 case ME_TONE_KIT:
1300 if (current_event->a==SFX_BANKTYPE)
1301 {
1302 channel[current_event->channel].sfx=SFXBANK;
1303 channel[current_event->channel].kit=0;
1304 }
1305 else
1306 {
1307 channel[current_event->channel].sfx=0;
1308 channel[current_event->channel].kit=current_event->a;
1309 }
1310 break;
1311
1312
1313553 case ME_RESET_CONTROLLERS:
1314 reset_controllers(current_event->channel);
554 reset_controllers(song, song->current_event->channel);
1315555 break;
1316556
1317557 case ME_TONE_BANK:
1318 channel[current_event->channel].bank=current_event->a;
558 song->channel[song->current_event->channel].bank =
559 song->current_event->a;
1319560 break;
1320561
1321562 case ME_EOT:
1322 current_sample=current_event->time;
563 song->current_sample = song->current_event->time;
1323564 return;
1324565 }
1325 current_event++;
1326 }
1327 /*current_sample=current_event->time;*/
1328 if (current_event != event_list)
1329 current_event--;
1330 current_sample=until_time;
1331 }
1332
1333 static void skip_to(int32 until_time)
1334 {
1335 if (current_sample > until_time)
1336 current_sample=0;
1337
1338 reset_midi();
1339 buffered_count=0;
1340 buffer_pointer=common_buffer;
1341 current_event=event_list;
566 song->current_event++;
567 }
568 /*song->current_sample=song->current_event->time;*/
569 if (song->current_event != song->events)
570 song->current_event--;
571 song->current_sample=until_time;
572 }
573
574 static void skip_to(MidiSong *song, Sint32 until_time)
575 {
576 if (song->current_sample > until_time)
577 song->current_sample = 0;
578
579 reset_midi(song);
580 song->buffered_count = 0;
581 song->buffer_pointer = song->common_buffer;
582 song->current_event = song->events;
1342583
1343584 if (until_time)
1344 seek_forward(until_time);
1345 ctl->reset();
1346 }
1347
1348 static int apply_controls(void)
1349 {
1350 int rc, i, did_skip=0;
1351 int32 val;
1352 /* ASCII renditions of CD player pictograms indicate approximate effect */
1353 do
1354 switch(rc=ctl->read(&val))
1355 {
1356 case RC_QUIT: /* [] */
1357 case RC_LOAD_FILE:
1358 case RC_NEXT: /* >>| */
1359 case RC_REALLY_PREVIOUS: /* |<< */
1360 return rc;
1361
1362 case RC_CHANGE_VOLUME:
1363 if (val>0 || amplification > -val)
1364 amplification += val;
1365 else
1366 amplification=0;
1367 if (amplification > MAX_AMPLIFICATION)
1368 amplification=MAX_AMPLIFICATION;
1369 adjust_amplification();
1370 for (i=0; i<voices; i++)
1371 if (voice[i].status != VOICE_FREE)
1372 {
1373 recompute_amp(i);
1374 apply_envelope_to_amp(i);
1375 }
1376 ctl->master_volume(amplification);
1377 break;
1378
1379 case RC_PREVIOUS: /* |<< */
1380 if (current_sample < 2*play_mode->rate)
1381 return RC_REALLY_PREVIOUS;
1382 return RC_RESTART;
1383
1384 case RC_RESTART: /* |<< */
1385 skip_to(0);
1386 did_skip=1;
1387 break;
1388
1389 case RC_JUMP:
1390 if (val >= sample_count)
1391 return RC_NEXT;
1392 skip_to(val);
1393 return rc;
1394
1395 case RC_FORWARD: /* >> */
1396 if (val+current_sample >= sample_count)
1397 return RC_NEXT;
1398 skip_to(val+current_sample);
1399 did_skip=1;
1400 break;
1401
1402 case RC_BACK: /* << */
1403 if (current_sample > val)
1404 skip_to(current_sample-val);
1405 else
1406 skip_to(0); /* We can't seek to end of previous song. */
1407 did_skip=1;
1408 break;
1409 }
1410 while (rc!= RC_NONE);
1411
1412 /* Advertise the skip so that we stop computing the audio buffer */
1413 if (did_skip)
1414 return RC_JUMP;
1415 else
1416 return rc;
1417 }
1418
1419 static void do_compute_data(uint32 count)
585 seek_forward(song, until_time);
586 }
587
588 static void do_compute_data(MidiSong *song, Sint32 count)
1420589 {
1421590 int i;
1422 if (!count) return; /* (gl) */
1423 memset(buffer_pointer, 0, count * num_ochannels * 4);
1424 for (i=0; i<voices; i++)
1425 {
1426 if(voice[i].status != VOICE_FREE)
1427 {
1428 if (!voice[i].sample_offset && voice[i].echo_delay_count)
1429 {
1430 if ((uint32)voice[i].echo_delay_count >= count) voice[i].echo_delay_count -= count;
1431 else
1432 {
1433 mix_voice(buffer_pointer+voice[i].echo_delay_count, i, count-voice[i].echo_delay_count);
1434 voice[i].echo_delay_count = 0;
1435 }
1436 }
1437 else mix_voice(buffer_pointer, i, count);
1438 }
1439 }
1440 current_sample += count;
1441 }
1442
591 memset(song->buffer_pointer, 0,
592 (song->encoding & PE_MONO) ? (count * 4) : (count * 8));
593 for (i = 0; i < song->voices; i++)
594 {
595 if(song->voice[i].status != VOICE_FREE)
596 mix_voice(song, song->buffer_pointer, i, count);
597 }
598 song->current_sample += count;
599 }
1443600
1444601 /* count=0 means flush remaining buffered data to output device, then
1445602 flush the device itself */
1446 static int compute_data(void *stream, int32 count)
1447 {
1448 int rc, channels;
1449
1450 if ( play_mode->encoding & PE_MONO )
603 static void compute_data(MidiSong *song, void *stream, Sint32 count)
604 {
605 int channels;
606
607 if ( song->encoding & PE_MONO )
1451608 channels = 1;
1452609 else
1453 channels = num_ochannels;
610 channels = 2;
1454611
1455612 if (!count)
1456613 {
1457 if (buffered_count)
1458 s32tobuf(stream, common_buffer, channels*buffered_count);
1459 buffer_pointer=common_buffer;
1460 buffered_count=0;
1461 return RC_NONE;
1462 }
1463
1464 while ((count+buffered_count) >= AUDIO_BUFFER_SIZE)
1465 {
1466 do_compute_data(AUDIO_BUFFER_SIZE-buffered_count);
1467 count -= AUDIO_BUFFER_SIZE-buffered_count;
1468 s32tobuf(stream, common_buffer, channels*AUDIO_BUFFER_SIZE);
1469 buffer_pointer=common_buffer;
1470 buffered_count=0;
1471
1472 ctl->current_time(current_sample);
1473 if ((rc=apply_controls())!=RC_NONE)
1474 return rc;
614 if (song->buffered_count)
615 song->write(stream, song->common_buffer, channels * song->buffered_count);
616 song->buffer_pointer = song->common_buffer;
617 song->buffered_count = 0;
618 return;
619 }
620
621 while ((count + song->buffered_count) >= song->buffer_size)
622 {
623 do_compute_data(song, song->buffer_size - song->buffered_count);
624 count -= song->buffer_size - song->buffered_count;
625 song->write(stream, song->common_buffer, channels * song->buffer_size);
626 song->buffer_pointer = song->common_buffer;
627 song->buffered_count = 0;
1475628 }
1476629 if (count>0)
1477630 {
1478 do_compute_data(count);
1479 buffered_count += count;
1480 buffer_pointer += count * channels;
1481 }
1482 return RC_NONE;
1483 }
1484
1485 int Timidity_PlaySome(void *stream, int samples)
1486 {
1487 int rc = RC_NONE;
1488 int32 end_sample;
1489
1490 if ( ! midi_playing ) {
1491 return RC_NONE;
1492 }
1493 end_sample = current_sample+samples;
1494 while ( current_sample < end_sample ) {
631 do_compute_data(song, count);
632 song->buffered_count += count;
633 song->buffer_pointer += (song->encoding & PE_MONO) ? count : count*2;
634 }
635 }
636
637 void Timidity_Start(MidiSong *song)
638 {
639 song->playing = 1;
640 adjust_amplification(song);
641 skip_to(song, 0);
642 }
643
644 void Timidity_Seek(MidiSong *song, Uint32 ms)
645 {
646 skip_to(song, (ms * song->rate) / 1000);
647 }
648
649 Uint32 Timidity_GetSongLength(MidiSong *song)
650 {
651 MidiEvent *last_event = &song->events[song->groomed_event_count - 1];
652 /* We want last_event->time * 1000 / song->rate */
653 Uint32 retvalue = (last_event->time / song->rate) * 1000;
654 retvalue += (last_event->time % song->rate) * 1000 / song->rate;
655 return retvalue;
656 }
657
658 int Timidity_PlaySome(MidiSong *song, void *stream, Sint32 len)
659 {
660 Sint32 start_sample, end_sample, samples;
661 int bytes_per_sample;
662
663 if (!song->playing)
664 return 0;
665
666 bytes_per_sample = 1;
667 bytes_per_sample *= ((song->encoding & PE_32BIT) ? 4 : ((song->encoding & PE_16BIT) ? 2 : 1));
668 bytes_per_sample *= ((song->encoding & PE_MONO) ? 1 : 2);
669 samples = len / bytes_per_sample;
670
671 start_sample = song->current_sample;
672 end_sample = song->current_sample+samples;
673 while ( song->current_sample < end_sample ) {
1495674 /* Handle all events that should happen at this time */
1496 while (current_event->time <= current_sample) {
1497 switch(current_event->type) {
675 while (song->current_event->time <= song->current_sample) {
676 switch(song->current_event->type) {
1498677
1499678 /* Effects affecting a single note */
1500679
1501680 case ME_NOTEON:
1502 current_event->a += channel[current_event->channel].transpose;
1503 if (!(current_event->b)) /* Velocity 0? */
1504 note_off(current_event);
681 if (!(song->current_event->b)) /* Velocity 0? */
682 note_off(song);
1505683 else
1506 note_on(current_event);
684 note_on(song);
1507685 break;
1508686
1509687 case ME_NOTEOFF:
1510 current_event->a += channel[current_event->channel].transpose;
1511 note_off(current_event);
688 note_off(song);
1512689 break;
1513690
1514691 case ME_KEYPRESSURE:
1515 adjust_pressure(current_event);
692 adjust_pressure(song);
1516693 break;
1517694
1518695 /* Effects affecting a single channel */
1519696
1520697 case ME_PITCH_SENS:
1521 channel[current_event->channel].pitchsens=current_event->a;
1522 channel[current_event->channel].pitchfactor=0;
698 song->channel[song->current_event->channel].pitchsens =
699 song->current_event->a;
700 song->channel[song->current_event->channel].pitchfactor = 0;
1523701 break;
1524702
1525703 case ME_PITCHWHEEL:
1526 channel[current_event->channel].pitchbend=
1527 current_event->a + current_event->b * 128;
1528 channel[current_event->channel].pitchfactor=0;
704 song->channel[song->current_event->channel].pitchbend =
705 song->current_event->a + song->current_event->b * 128;
706 song->channel[song->current_event->channel].pitchfactor = 0;
1529707 /* Adjust pitch for notes already playing */
1530 adjust_pitchbend(current_event->channel);
1531 ctl->pitch_bend(current_event->channel,
1532 channel[current_event->channel].pitchbend);
708 adjust_pitchbend(song);
1533709 break;
1534710
1535711 case ME_MAINVOLUME:
1536 channel[current_event->channel].volume=current_event->a;
1537 adjust_volume(current_event->channel);
1538 ctl->volume(current_event->channel, current_event->a);
1539 break;
1540
1541 case ME_MASTERVOLUME:
1542 adjust_master_volume(current_event->a + (current_event->b <<7));
1543 break;
1544
1545 case ME_REVERBERATION:
1546 channel[current_event->channel].reverberation=current_event->a;
1547 break;
1548
1549 case ME_CHORUSDEPTH:
1550 channel[current_event->channel].chorusdepth=current_event->a;
1551 break;
1552
712 song->channel[song->current_event->channel].volume =
713 song->current_event->a;
714 adjust_volume(song);
715 break;
716
1553717 case ME_PAN:
1554 channel[current_event->channel].panning=current_event->a;
1555 if (adjust_panning_immediately)
1556 adjust_panning(current_event->channel);
1557 ctl->panning(current_event->channel, current_event->a);
718 song->channel[song->current_event->channel].panning =
719 song->current_event->a;
1558720 break;
1559721
1560722 case ME_EXPRESSION:
1561 channel[current_event->channel].expression=current_event->a;
1562 adjust_volume(current_event->channel);
1563 ctl->expression(current_event->channel, current_event->a);
723 song->channel[song->current_event->channel].expression =
724 song->current_event->a;
725 adjust_volume(song);
1564726 break;
1565727
1566728 case ME_PROGRAM:
1567 /* if (ISDRUMCHANNEL(current_event->channel)) { */
1568 if (channel[current_event->channel].kit) {
729 if (ISDRUMCHANNEL(song, song->current_event->channel)) {
1569730 /* Change drum set */
1570 channel[current_event->channel].bank=current_event->a;
731 song->channel[song->current_event->channel].bank =
732 song->current_event->a;
1571733 }
1572734 else
1573 {
1574 channel[current_event->channel].program=current_event->a;
1575 }
1576 ctl->program(current_event->channel, current_event->a);
735 song->channel[song->current_event->channel].program =
736 song->current_event->a;
1577737 break;
1578738
1579739 case ME_SUSTAIN:
1580 channel[current_event->channel].sustain=current_event->a;
1581 if (!current_event->a)
1582 drop_sustain(current_event->channel);
1583 ctl->sustain(current_event->channel, current_event->a);
740 song->channel[song->current_event->channel].sustain =
741 song->current_event->a;
742 if (!song->current_event->a)
743 drop_sustain(song);
1584744 break;
1585745
1586746 case ME_RESET_CONTROLLERS:
1587 reset_controllers(current_event->channel);
1588 redraw_controllers(current_event->channel);
747 reset_controllers(song, song->current_event->channel);
1589748 break;
1590749
1591750 case ME_ALL_NOTES_OFF:
1592 all_notes_off(current_event->channel);
751 all_notes_off(song);
1593752 break;
1594753
1595754 case ME_ALL_SOUNDS_OFF:
1596 all_sounds_off(current_event->channel);
1597 break;
1598
1599 case ME_HARMONICCONTENT:
1600 channel[current_event->channel].harmoniccontent=current_event->a;
1601 break;
1602
1603 case ME_RELEASETIME:
1604 channel[current_event->channel].releasetime=current_event->a;
1605 break;
1606
1607 case ME_ATTACKTIME:
1608 channel[current_event->channel].attacktime=current_event->a;
1609 break;
1610
1611 case ME_BRIGHTNESS:
1612 channel[current_event->channel].brightness=current_event->a;
1613 break;
1614
755 all_sounds_off(song);
756 break;
757
1615758 case ME_TONE_BANK:
1616 channel[current_event->channel].bank=current_event->a;
1617 break;
1618
1619
1620 case ME_TONE_KIT:
1621 if (current_event->a==SFX_BANKTYPE)
1622 {
1623 channel[current_event->channel].sfx=SFXBANK;
1624 channel[current_event->channel].kit=0;
1625 }
1626 else
1627 {
1628 channel[current_event->channel].sfx=0;
1629 channel[current_event->channel].kit=current_event->a;
1630 }
1631 break;
1632
759 song->channel[song->current_event->channel].bank =
760 song->current_event->a;
761 break;
762
1633763 case ME_EOT:
1634764 /* Give the last notes a couple of seconds to decay */
1635 ctl->cmsg(CMSG_INFO, VERB_VERBOSE,
1636 "Playing time: ~%d seconds", current_sample/play_mode->rate+2);
1637 ctl->cmsg(CMSG_INFO, VERB_VERBOSE,
1638 "Notes cut: %d", cut_notes);
1639 ctl->cmsg(CMSG_INFO, VERB_VERBOSE,
1640 "Notes lost totally: %d", lost_notes);
1641 midi_playing = 0;
1642 return RC_TUNE_END;
765 SNDDBG(("Playing time: ~%d seconds\n",
766 song->current_sample/song->rate+2));
767 SNDDBG(("Notes cut: %d\n", song->cut_notes));
768 SNDDBG(("Notes lost totally: %d\n", song->lost_notes));
769 song->playing = 0;
770 return (song->current_sample - start_sample) * bytes_per_sample;
1643771 }
1644 current_event++;
1645 }
1646 if (current_event->time > end_sample)
1647 rc=compute_data(stream, end_sample-current_sample);
772 song->current_event++;
773 }
774 if (song->current_event->time > end_sample)
775 compute_data(song, stream, end_sample-song->current_sample);
1648776 else
1649 rc=compute_data(stream, current_event->time-current_sample);
1650 ctl->refresh();
1651 if ( (rc!=RC_NONE) && (rc!=RC_JUMP))
1652 break;
777 compute_data(song, stream, song->current_event->time-song->current_sample);
1653778 }
1654 return rc;
1655 }
1656
1657
1658 void Timidity_SetVolume(int volume)
779 return samples * bytes_per_sample;
780 }
781
782 void Timidity_SetVolume(MidiSong *song, int volume)
1659783 {
1660784 int i;
1661785 if (volume > MAX_AMPLIFICATION)
1662 amplification=MAX_AMPLIFICATION;
786 song->amplification = MAX_AMPLIFICATION;
1663787 else
1664788 if (volume < 0)
1665 amplification=0;
1666 else
1667 amplification=volume;
1668 adjust_amplification();
1669 for (i=0; i<voices; i++)
1670 if (voice[i].status != VOICE_FREE)
789 song->amplification = 0;
790 else
791 song->amplification = volume;
792 adjust_amplification(song);
793 for (i = 0; i < song->voices; i++)
794 if (song->voice[i].status != VOICE_FREE)
1671795 {
1672 recompute_amp(i);
1673 apply_envelope_to_amp(i);
796 recompute_amp(song, i);
797 apply_envelope_to_amp(song, i);
1674798 }
1675 ctl->master_volume(amplification);
1676 }
1677
1678 MidiSong *Timidity_LoadSong_RW(SDL_RWops *src, int freesrc)
1679 {
1680 MidiSong *song;
1681 int32 events;
1682
1683 /* Allocate memory for the song */
1684 song = (MidiSong *)safe_malloc(sizeof(*song));
1685 memset(song, 0, sizeof(*song));
1686
1687 strcpy(midi_name, "SDLrwops source");
1688
1689 song->events = read_midi_file(src, &events, &song->samples);
1690 if (song->events) {
1691 if (freesrc) {
1692 SDL_RWclose(src);
1693 }
1694 } else {
1695 free(song);
1696 song = NULL;
1697 }
1698 return(song);
1699 }
1700
1701 void Timidity_Start(MidiSong *song)
1702 {
1703 load_missing_instruments();
1704 adjust_amplification();
1705 sample_count = song->samples;
1706 event_list = song->events;
1707 lost_notes=cut_notes=0;
1708
1709 skip_to(0);
1710 midi_playing = 1;
1711 }
1712
1713 int Timidity_Active(void)
1714 {
1715 return(midi_playing);
1716 }
1717
1718 void Timidity_Stop(void)
1719 {
1720 midi_playing = 0;
1721 }
1722
1723 void Timidity_FreeSong(MidiSong *song)
1724 {
1725 if (free_instruments_afterwards)
1726 free_instruments();
1727
1728 free(song->events);
1729 free(song);
1730 }
1731
1732 void Timidity_Close(void)
1733 {
1734 if (resample_buffer) {
1735 free(resample_buffer);
1736 resample_buffer=NULL;
1737 }
1738 if (common_buffer) {
1739 free(common_buffer);
1740 common_buffer=NULL;
1741 }
1742 free_instruments();
1743 free_pathlist();
1744 }
1745
799 }
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
77
8 typedef struct {
9 int32 time;
10 uint8 channel, type, a, b;
11 } MidiEvent;
8 playmidi.h
9
10 */
1211
1312 /* Midi events */
1413 #define ME_NONE 0
3029 #define ME_TONE_BANK 15
3130
3231 #define ME_LYRIC 16
33 #define ME_TONE_KIT 17
34 #define ME_MASTERVOLUME 18
35 #define ME_CHANNEL_PRESSURE 19
36
37 #define ME_HARMONICCONTENT 71
38 #define ME_RELEASETIME 72
39 #define ME_ATTACKTIME 73
40 #define ME_BRIGHTNESS 74
41
42 #define ME_REVERBERATION 91
43 #define ME_CHORUSDEPTH 93
4432
4533 #define ME_EOT 99
4634
47
48 #define SFX_BANKTYPE 64
49
50 typedef struct {
51 int
52 bank, program, volume, sustain, panning, pitchbend, expression,
53 mono, /* one note only on this channel -- not implemented yet */
54 /* new stuff */
55 variationbank, reverberation, chorusdepth, harmoniccontent,
56 releasetime, attacktime, brightness, kit, sfx,
57 /* end new */
58 pitchsens;
59 FLOAT_T
60 pitchfactor; /* precomputed pitch bend factor to save some fdiv's */
61 char transpose;
62 char *name;
63 } Channel;
64
6535 /* Causes the instrument's default panning to be used. */
6636 #define NO_PANNING -1
67 /* envelope points */
68 #define MAXPOINT 7
69
70 typedef struct {
71 uint8
72 status, channel, note, velocity, clone_type;
73 Sample *sample;
74 Sample *left_sample;
75 Sample *right_sample;
76 int32 clone_voice;
77 int32
78 orig_frequency, frequency,
79 sample_offset, loop_start, loop_end;
80 int32
81 envelope_volume, modulation_volume;
82 int32
83 envelope_target, modulation_target;
84 int32
85 tremolo_sweep, tremolo_sweep_position, tremolo_phase,
86 lfo_sweep, lfo_sweep_position, lfo_phase,
87 vibrato_sweep, vibrato_sweep_position, vibrato_depth, vibrato_delay,
88 starttime, echo_delay_count;
89 int32
90 echo_delay,
91 sample_increment,
92 envelope_increment,
93 modulation_increment,
94 tremolo_phase_increment,
95 lfo_phase_increment;
96
97 final_volume_t left_mix, right_mix, lr_mix, rr_mix, ce_mix, lfe_mix;
98
99 FLOAT_T
100 left_amp, right_amp, lr_amp, rr_amp, ce_amp, lfe_amp,
101 volume, tremolo_volume, lfo_volume;
102 int32
103 vibrato_sample_increment[VIBRATO_SAMPLE_INCREMENTS];
104 int32
105 envelope_rate[MAXPOINT], envelope_offset[MAXPOINT];
106 int32
107 vibrato_phase, vibrato_control_ratio, vibrato_control_counter,
108 envelope_stage, modulation_stage, control_counter,
109 modulation_delay, modulation_counter, panning, panned;
110 } Voice;
11137
11238 /* Voice status options: */
11339 #define VOICE_FREE 0
12349 #define PANNED_CENTER 3
12450 /* Anything but PANNED_MYSTERY only uses the left volume */
12551
126 /* Envelope stages: */
127 #define ATTACK 0
128 #define HOLD 1
129 #define DECAY 2
130 #define RELEASE 3
131 #define RELEASEB 4
132 #define RELEASEC 5
133 #define DELAY 6
134
135 extern Channel channel[16];
136 extern Voice voice[MAX_VOICES];
137 extern signed char drumvolume[MAXCHAN][MAXNOTE];
138 extern signed char drumpanpot[MAXCHAN][MAXNOTE];
139 extern signed char drumreverberation[MAXCHAN][MAXNOTE];
140 extern signed char drumchorusdepth[MAXCHAN][MAXNOTE];
141
142 extern int32 control_ratio, amp_with_poly, amplification;
143 extern int32 drumchannels;
144 extern int adjust_panning_immediately;
145 extern int voices;
146
147 #define ISDRUMCHANNEL(c) ((drumchannels & (1<<(c))))
148
149 extern int GM_System_On;
150 extern int XG_System_On;
151 extern int GS_System_On;
152
153 extern int XG_System_reverb_type;
154 extern int XG_System_chorus_type;
155 extern int XG_System_variation_type;
156
157 extern int play_midi(MidiEvent *el, int32 events, int32 samples);
158 extern int play_midi_file(const char *fn);
159 extern void dumb_pass_playing_list(int number_of_files, char *list_of_files[]);
52 #define ISDRUMCHANNEL(s, c) (((s)->drumchannels & (1<<(c))))
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7 */
8
9 #if HAVE_CONFIG_H
10 # include <config.h>
11 #endif
712
813 #include <stdio.h>
914 #include <stdlib.h>
10 #include <errno.h>
1115 #include <string.h>
1216
13 #include <SDL_rwops.h>
14
15 #include "config.h"
17 #include "SDL.h"
18
19 #include "options.h"
20 #include "timidity.h"
1621 #include "common.h"
1722 #include "instrum.h"
1823 #include "playmidi.h"
19 #include "readmidi.h"
20 #include "output.h"
21 #include "ctrlmode.h"
22
23 int32 quietchannels=0;
24
25 static int midi_port_number;
26 char midi_name[FILENAME_MAX+1];
27
28 static int track_info, curr_track, curr_title_track;
29 static char title[128];
30
31 #if MAXCHAN <= 16
32 #define MERGE_CHANNEL_PORT(ch) ((int)(ch))
33 #else
34 #define MERGE_CHANNEL_PORT(ch) ((int)(ch) | (midi_port_number << 4))
35 #endif
36
37 /* to avoid some unnecessary parameter passing */
38 static MidiEventList *evlist;
39 static int32 event_count;
40 static SDL_RWops *rw;
41 static int32 at;
42
43 /* These would both fit into 32 bits, but they are often added in
44 large multiples, so it's simpler to have two roomy ints */
45 static int32 sample_increment, sample_correction; /*samples per MIDI delta-t*/
4624
4725 /* Computes how many (fractional) samples one MIDI delta-time unit contains */
48 static void compute_sample_increment(int32 tempo, int32 divisions)
26 static void compute_sample_increment(MidiSong *song, Sint32 tempo,
27 Sint32 divisions)
4928 {
5029 double a;
51 a = (double) (tempo) * (double) (play_mode->rate) * (65536.0/1000000.0) /
30 a = (double) (tempo) * (double) (song->rate) * (65536.0/1000000.0) /
5231 (double)(divisions);
5332
54 sample_correction = (int32)(a) & 0xFFFF;
55 sample_increment = (int32)(a) >> 16;
56
57 ctl->cmsg(CMSG_INFO, VERB_DEBUG, "Samples per delta-t: %d (correction %d)",
58 sample_increment, sample_correction);
33 song->sample_correction = (Sint32)(a) & 0xFFFF;
34 song->sample_increment = (Sint32)(a) >> 16;
35
36 SNDDBG(("Samples per delta-t: %d (correction %d)",
37 song->sample_increment, song->sample_correction));
5938 }
6039
6140 /* Read variable-length number (7 bits per byte, MSB first) */
62 static int32 getvl(void)
63 {
64 int32 l=0;
65 uint8 c;
41 static Sint32 getvl(SDL_RWops *rw)
42 {
43 Sint32 l=0;
44 Uint8 c;
6645 for (;;)
6746 {
68 SDL_RWread(rw,&c,1,1);
47 if (!SDL_RWread(rw, &c, 1, 1)) return l;
6948 l += (c & 0x7f);
7049 if (!(c & 0x80)) return l;
7150 l<<=7;
7251 }
7352 }
7453
75
76 static int sysex(uint32 len, uint8 *syschan, uint8 *sysa, uint8 *sysb, SDL_RWops *rw)
77 {
78 unsigned char *s=(unsigned char *)safe_malloc(len);
79 int id, model, ch, port, adhi, adlo, cd, dta, dtb, dtc;
80 if (len != (uint32)SDL_RWread(rw, s, 1, len))
81 {
82 free(s);
83 return 0;
84 }
85 if (len<5) { free(s); return 0; }
86 if (curr_track == curr_title_track && track_info > 1) title[0] = '\0';
87 id=s[0]; port=s[1]; model=s[2]; adhi=s[3]; adlo=s[4];
88 if (id==0x7e && port==0x7f && model==0x09 && adhi==0x01)
89 {
90 ctl->cmsg(CMSG_TEXT, VERB_VERBOSE, "GM System On", len);
91 GM_System_On=1;
92 free(s);
93 return 0;
94 }
95 ch = adlo & 0x0f;
96 *syschan=(uint8)ch;
97 if (id==0x7f && len==7 && port==0x7f && model==0x04 && adhi==0x01)
98 {
99 ctl->cmsg(CMSG_TEXT, VERB_DEBUG, "Master Volume %d", s[4]+(s[5]<<7));
100 *sysa = s[4];
101 *sysb = s[5];
102 free(s);
103 return ME_MASTERVOLUME;
104 /** return s[4]+(s[5]<<7); **/
105 }
106 if (len<8) { free(s); return 0; }
107 port &=0x0f;
108 ch = (adlo & 0x0f) | ((port & 0x03) << 4);
109 *syschan=(uint8)ch;
110 cd=s[5]; dta=s[6];
111 if (len >= 8) dtb=s[7];
112 else dtb=-1;
113 if (len >= 9) dtc=s[8];
114 else dtc=-1;
115 free(s);
116 if (id==0x43 && model==0x4c)
117 {
118 if (!adhi && !adlo && cd==0x7e && !dta)
119 {
120 ctl->cmsg(CMSG_TEXT, VERB_VERBOSE, "XG System On", len);
121 XG_System_On=1;
122 #ifdef tplus
123 vol_table = xg_vol_table;
124 #endif
125 }
126 else if (adhi == 2 && adlo == 1)
127 {
128 if (dtb==8) dtb=3;
129 switch (cd)
130 {
131 case 0x00:
132 XG_System_reverb_type=(dta<<3)+dtb;
133 break;
134 case 0x20:
135 XG_System_chorus_type=((dta-64)<<3)+dtb;
136 break;
137 case 0x40:
138 XG_System_variation_type=dta;
139 break;
140 case 0x5a:
141 /* dta==0 Insertion; dta==1 System */
142 break;
143 default: break;
144 }
145 }
146 else if (adhi == 8 && cd <= 40)
147 {
148 *sysa = dta & 0x7f;
149 switch (cd)
150 {
151 case 0x01: /* bank select MSB */
152 return ME_TONE_KIT;
153 break;
154 case 0x02: /* bank select LSB */
155 return ME_TONE_BANK;
156 break;
157 case 0x03: /* program number */
158 /** MIDIEVENT(d->at, ME_PROGRAM, lastchan, a, 0); **/
159 return ME_PROGRAM;
160 break;
161 case 0x08: /* */
162 /* d->channel[adlo&0x0f].transpose = (char)(dta-64); */
163 channel[ch].transpose = (char)(dta-64);
164 ctl->cmsg(CMSG_TEXT, VERB_DEBUG, "transpose channel %d by %d",
165 (adlo&0x0f)+1, dta-64);
166 break;
167 case 0x0b: /* volume */
168 return ME_MAINVOLUME;
169 break;
170 case 0x0e: /* pan */
171 return ME_PAN;
172 break;
173 case 0x12: /* chorus send */
174 return ME_CHORUSDEPTH;
175 break;
176 case 0x13: /* reverb send */
177 return ME_REVERBERATION;
178 break;
179 case 0x14: /* variation send */
180 break;
181 case 0x18: /* filter cutoff */
182 return ME_BRIGHTNESS;
183 break;
184 case 0x19: /* filter resonance */
185 return ME_HARMONICCONTENT;
186 break;
187 default: break;
188 }
189 }
190 return 0;
191 }
192 else if (id==0x41 && model==0x42 && adhi==0x12 && adlo==0x40)
193 {
194 if (dtc<0) return 0;
195 if (!cd && dta==0x7f && !dtb && dtc==0x41)
196 {
197 ctl->cmsg(CMSG_TEXT, VERB_VERBOSE, "GS System On", len);
198 GS_System_On=1;
199 #ifdef tplus
200 vol_table = gs_vol_table;
201 #endif
202 }
203 else if (dta==0x15 && (cd&0xf0)==0x10)
204 {
205 int chan=cd&0x0f;
206 if (!chan) chan=9;
207 else if (chan<10) chan--;
208 chan = MERGE_CHANNEL_PORT(chan);
209 channel[chan].kit=dtb;
210 }
211 else if (cd==0x01) switch(dta)
212 {
213 case 0x30:
214 switch(dtb)
215 {
216 case 0: XG_System_reverb_type=16+0; break;
217 case 1: XG_System_reverb_type=16+1; break;
218 case 2: XG_System_reverb_type=16+2; break;
219 case 3: XG_System_reverb_type= 8+0; break;
220 case 4: XG_System_reverb_type= 8+1; break;
221 case 5: XG_System_reverb_type=32+0; break;
222 case 6: XG_System_reverb_type=8*17; break;
223 case 7: XG_System_reverb_type=8*18; break;
224 }
225 break;
226 case 0x38:
227 switch(dtb)
228 {
229 case 0: XG_System_chorus_type= 8+0; break;
230 case 1: XG_System_chorus_type= 8+1; break;
231 case 2: XG_System_chorus_type= 8+2; break;
232 case 3: XG_System_chorus_type= 8+4; break;
233 case 4: XG_System_chorus_type= -1; break;
234 case 5: XG_System_chorus_type= 8*3; break;
235 case 6: XG_System_chorus_type= -1; break;
236 case 7: XG_System_chorus_type= -1; break;
237 }
238 break;
239 }
240 return 0;
241 }
242 return 0;
243 }
244
24554 /* Print a string from the file, followed by a newline. Any non-ASCII
24655 or unprintable characters will be converted to periods. */
247 static int dumpstring(int32 len, const char *label)
56 static int dumpstring(SDL_RWops *rw, Sint32 len, char *label)
24857 {
24958 signed char *s=safe_malloc(len+1);
250 if (len != (int32)SDL_RWread(rw, s, 1, len))
59 if (len != (Sint32) SDL_RWread(rw, s, 1, len))
25160 {
25261 free(s);
25362 return -1;
25867 if (s[len]<32)
25968 s[len]='.';
26069 }
261 ctl->cmsg(CMSG_TEXT, VERB_VERBOSE, "%s%s", label, s);
70 SNDDBG(("%s%s", label, s));
26271 free(s);
26372 return 0;
26473 }
27382
27483 /* Read a MIDI event, returning a freshly allocated element that can
27584 be linked to the event list */
276 static MidiEventList *read_midi_event(void)
277 {
278 static uint8 laststatus, lastchan;
279 static uint8 nrpn=0, rpn_msb[16], rpn_lsb[16]; /* one per channel */
280 uint8 me, type, a,b,c;
281 int32 len;
85 static MidiEventList *read_midi_event(MidiSong *song)
86 {
87 static Uint8 laststatus, lastchan;
88 static Uint8 nrpn=0, rpn_msb[16], rpn_lsb[16]; /* one per channel */
89 Uint8 me, type, a,b,c;
90 Sint32 len;
28291 MidiEventList *new;
28392
28493 for (;;)
28594 {
286 at+=getvl();
287 if (SDL_RWread(rw,&me,1,1)!=1)
288 {
289 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: read_midi_event: %s",
290 current_filename, strerror(errno));
95 song->at += getvl(song->rw);
96 if (SDL_RWread(song->rw, &me, 1, 1) != 1)
97 {
98 SNDDBG(("read_midi_event: SDL_RWread() failure\n"));
29199 return 0;
292100 }
293101
294102 if(me==0xF0 || me == 0xF7) /* SysEx event */
295103 {
296 int32 sret;
297 uint8 sysa=0, sysb=0, syschan=0;
298
299 len=getvl();
300 sret=sysex(len, &syschan, &sysa, &sysb, rw);
301 if (sret)
302 {
303 MIDIEVENT(at, sret, syschan, sysa, sysb);
304 }
104 len=getvl(song->rw);
105 SDL_RWseek(song->rw, len, RW_SEEK_CUR);
305106 }
306107 else if(me==0xFF) /* Meta event */
307108 {
308 SDL_RWread(rw,&type,1,1);
309 len=getvl();
109 SDL_RWread(song->rw, &type, 1, 1);
110 len=getvl(song->rw);
310111 if (type>0 && type<16)
311112 {
312113 static char *label[]={
313114 "Text event: ", "Text: ", "Copyright: ", "Track name: ",
314115 "Instrument: ", "Lyric: ", "Marker: ", "Cue point: "};
315 dumpstring(len, label[(type>7) ? 0 : type]);
116 dumpstring(song->rw, len, label[(type>7) ? 0 : type]);
316117 }
317118 else
318119 switch(type)
319120 {
320
321 case 0x21: /* MIDI port number */
322 if(len == 1)
323 {
324 SDL_RWread(rw,&midi_port_number,1,1);
325 if(midi_port_number == EOF)
326 {
327 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
328 "Warning: \"%s\": Short midi file.",
329 midi_name);
330 return 0;
331 }
332 midi_port_number &= 0x0f;
333 if (midi_port_number)
334 ctl->cmsg(CMSG_INFO, VERB_VERBOSE,
335 "(MIDI port number %d)", midi_port_number);
336 midi_port_number &= 0x03;
337 }
338 else SDL_RWseek(rw, len, RW_SEEK_CUR);
339 break;
340
341121 case 0x2F: /* End of Track */
342122 return MAGIC_EOT;
343123
344124 case 0x51: /* Tempo */
345 SDL_RWread(rw,&a,1,1); SDL_RWread(rw,&b,1,1); SDL_RWread(rw,&c,1,1);
346 MIDIEVENT(at, ME_TEMPO, c, a, b);
125 SDL_RWread(song->rw, &a, 1, 1);
126 SDL_RWread(song->rw, &b, 1, 1);
127 SDL_RWread(song->rw, &c, 1, 1);
128 MIDIEVENT(song->at, ME_TEMPO, c, a, b);
347129
348130 default:
349 ctl->cmsg(CMSG_INFO, VERB_DEBUG,
350 "(Meta event type 0x%02x, length %ld)", type, len);
351 SDL_RWseek(rw, len, RW_SEEK_CUR);
131 SNDDBG(("(Meta event type 0x%02x, length %d)\n", type, len));
132 SDL_RWseek(song->rw, len, RW_SEEK_CUR);
352133 break;
353134 }
354135 }
359140 {
360141 lastchan=a & 0x0F;
361142 laststatus=(a>>4) & 0x07;
362 SDL_RWread(rw,&a, 1,1);
143 SDL_RWread(song->rw, &a, 1, 1);
363144 a &= 0x7F;
364145 }
365146 switch(laststatus)
366147 {
367148 case 0: /* Note off */
368 SDL_RWread(rw,&b, 1,1);
149 SDL_RWread(song->rw, &b, 1, 1);
369150 b &= 0x7F;
370 MIDIEVENT(at, ME_NOTEOFF, lastchan, a,b);
151 MIDIEVENT(song->at, ME_NOTEOFF, lastchan, a,b);
371152
372153 case 1: /* Note on */
373 SDL_RWread(rw,&b, 1,1);
154 SDL_RWread(song->rw, &b, 1, 1);
374155 b &= 0x7F;
375 if (curr_track == curr_title_track && track_info > 1) title[0] = '\0';
376 MIDIEVENT(at, ME_NOTEON, lastchan, a,b);
377
156 MIDIEVENT(song->at, ME_NOTEON, lastchan, a,b);
378157
379158 case 2: /* Key Pressure */
380 SDL_RWread(rw,&b, 1,1);
159 SDL_RWread(song->rw, &b, 1, 1);
381160 b &= 0x7F;
382 MIDIEVENT(at, ME_KEYPRESSURE, lastchan, a, b);
161 MIDIEVENT(song->at, ME_KEYPRESSURE, lastchan, a, b);
383162
384163 case 3: /* Control change */
385 SDL_RWread(rw,&b, 1,1);
164 SDL_RWread(song->rw, &b, 1, 1);
386165 b &= 0x7F;
387166 {
388167 int control=255;
391170 case 7: control=ME_MAINVOLUME; break;
392171 case 10: control=ME_PAN; break;
393172 case 11: control=ME_EXPRESSION; break;
394 case 64: control=ME_SUSTAIN; break;
395
396 case 71: control=ME_HARMONICCONTENT; break;
397 case 72: control=ME_RELEASETIME; break;
398 case 73: control=ME_ATTACKTIME; break;
399 case 74: control=ME_BRIGHTNESS; break;
400 case 91: control=ME_REVERBERATION; break;
401 case 93: control=ME_CHORUSDEPTH; break;
402
173 case 64: control=ME_SUSTAIN; b = (b >= 64); break;
403174 case 120: control=ME_ALL_SOUNDS_OFF; break;
404175 case 121: control=ME_RESET_CONTROLLERS; break;
405176 case 123: control=ME_ALL_NOTES_OFF; break;
410181 Also, some MIDI files use 0 as some sort of
411182 continuous controller. This will cause lots of
412183 warnings about undefined tone banks. */
413 case 0: if (XG_System_On) control = ME_TONE_KIT; else control=ME_TONE_BANK; break;
414
415 case 32: if (XG_System_On) control = ME_TONE_BANK; break;
184 case 0: control=ME_TONE_BANK; break;
185 case 32:
186 if (b!=0) {
187 SNDDBG(("(Strange: tone bank change 0x%02x)\n", b));
188 }
189 #if 0 /* `Bank Select LSB' is not worked at GS. Please ignore it. */
190 else
191 control=ME_TONE_BANK;
192 #endif
193 break;
416194
417195 case 100: nrpn=0; rpn_msb[lastchan]=b; break;
418196 case 101: nrpn=0; rpn_lsb[lastchan]=b; break;
422200 case 6:
423201 if (nrpn)
424202 {
425 if (rpn_msb[lastchan]==1) switch (rpn_lsb[lastchan])
426 {
427 #ifdef tplus
428 case 0x08: control=ME_VIBRATO_RATE; break;
429 case 0x09: control=ME_VIBRATO_DEPTH; break;
430 case 0x0a: control=ME_VIBRATO_DELAY; break;
431 #endif
432 case 0x20: control=ME_BRIGHTNESS; break;
433 case 0x21: control=ME_HARMONICCONTENT; break;
434 /*
435 case 0x63: envelope attack rate
436 case 0x64: envelope decay rate
437 case 0x66: envelope release rate
438 */
439 }
440 else switch (rpn_msb[lastchan])
441 {
442 /*
443 case 0x14: filter cutoff frequency
444 case 0x15: filter resonance
445 case 0x16: envelope attack rate
446 case 0x17: envelope decay rate
447 case 0x18: pitch coarse
448 case 0x19: pitch fine
449 */
450 case 0x1a: drumvolume[lastchan][0x7f & rpn_lsb[lastchan]] = b; break;
451 case 0x1c:
452 if (!b) b=(int) (127.0*rand()/(RAND_MAX));
453 drumpanpot[lastchan][0x7f & rpn_lsb[lastchan]] = b;
454 break;
455 case 0x1d: drumreverberation[lastchan][0x7f & rpn_lsb[lastchan]] = b; break;
456 case 0x1e: drumchorusdepth[lastchan][0x7f & rpn_lsb[lastchan]] = b; break;
457 /*
458 case 0x1f: variation send level
459 */
460 }
461
462 ctl->cmsg(CMSG_INFO, VERB_DEBUG,
463 "(Data entry (MSB) for NRPN %02x,%02x: %ld)",
464 rpn_msb[lastchan], rpn_lsb[lastchan],
465 b);
203 SNDDBG(("(Data entry (MSB) for NRPN %02x,%02x: %d)\n",
204 rpn_msb[lastchan], rpn_lsb[lastchan], b));
466205 break;
467206 }
468207
474213
475214 case 0x7F7F: /* RPN reset */
476215 /* reset pitch bend sensitivity to 2 */
477 MIDIEVENT(at, ME_PITCH_SENS, lastchan, 2, 0);
216 MIDIEVENT(song->at, ME_PITCH_SENS, lastchan, 2, 0);
478217
479218 default:
480 ctl->cmsg(CMSG_INFO, VERB_DEBUG,
481 "(Data entry (MSB) for RPN %02x,%02x: %ld)",
482 rpn_msb[lastchan], rpn_lsb[lastchan],
483 b);
219 SNDDBG(("(Data entry (MSB) for RPN %02x,%02x: %d)\n",
220 rpn_msb[lastchan], rpn_lsb[lastchan], b));
484221 break;
485222 }
486223 break;
487224
488225 default:
489 ctl->cmsg(CMSG_INFO, VERB_DEBUG,
490 "(Control %d: %d)", a, b);
226 SNDDBG(("(Control %d: %d)\n", a, b));
491227 break;
492228 }
493229 if (control != 255)
494230 {
495 MIDIEVENT(at, control, lastchan, b, 0);
231 MIDIEVENT(song->at, control, lastchan, b, 0);
496232 }
497233 }
498234 break;
499235
500236 case 4: /* Program change */
501237 a &= 0x7f;
502 MIDIEVENT(at, ME_PROGRAM, lastchan, a, 0);
238 MIDIEVENT(song->at, ME_PROGRAM, lastchan, a, 0);
503239
504240 case 5: /* Channel pressure - NOT IMPLEMENTED */
505241 break;
506242
507243 case 6: /* Pitch wheel */
508 SDL_RWread(rw,&b, 1,1);
244 SDL_RWread(song->rw, &b, 1, 1);
509245 b &= 0x7F;
510 MIDIEVENT(at, ME_PITCHWHEEL, lastchan, a, b);
246 MIDIEVENT(song->at, ME_PITCHWHEEL, lastchan, a, b);
511247
512248 default:
513 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
514 "*** Can't happen: status 0x%02X, channel 0x%02X",
515 laststatus, lastchan);
249 SNDDBG(("*** Can't happen: status 0x%02X, channel 0x%02X\n",
250 laststatus, lastchan));
516251 break;
517252 }
518253 }
525260
526261 /* Read a midi track into the linked list, either merging with any previous
527262 tracks or appending to them. */
528 static int read_track(int append)
263 static int read_track(MidiSong *song, int append)
529264 {
530265 MidiEventList *meep;
531266 MidiEventList *next, *new;
532 int32 len;
267 Sint32 len;
533268 Sint64 next_pos, pos;
534269 char tmp[4];
535270
536 meep=evlist;
271 meep = song->evlist;
537272 if (append && meep)
538273 {
539274 /* find the last event in the list */
540275 for (; meep->next; meep=meep->next)
541276 ;
542 at=meep->event.time;
277 song->at = meep->event.time;
543278 }
544279 else
545 at=0;
280 song->at=0;
546281
547282 /* Check the formalities */
548 if ((SDL_RWread(rw,tmp,1,4) != 4) || (SDL_RWread(rw,&len,4,1) != 1))
549 {
550 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
551 "%s: Can't read track header.", current_filename);
283
284 if (SDL_RWread(song->rw, tmp, 1, 4) != 4 || SDL_RWread(song->rw, &len, 4, 1) != 1)
285 {
286 SNDDBG(("Can't read track header.\n"));
552287 return -1;
553288 }
554 len=BE_LONG(len);
555 next_pos = SDL_RWtell(rw) + len;
289 len=SDL_SwapBE32(len);
290 next_pos = SDL_RWtell(song->rw) + len;
556291 if (memcmp(tmp, "MTrk", 4))
557292 {
558 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
559 "%s: Corrupt MIDI file.", current_filename);
293 SNDDBG(("Corrupt MIDI file.\n"));
560294 return -2;
561295 }
562296
563297 for (;;)
564298 {
565 if (!(new=read_midi_event())) /* Some kind of error */
299 if (!(new=read_midi_event(song))) /* Some kind of error */
566300 return -2;
567301
568302 if (new==MAGIC_EOT) /* End-of-track Hack. */
569303 {
570 pos = SDL_RWtell(rw);
304 pos = SDL_RWtell(song->rw);
571305 if (pos < next_pos)
572 SDL_RWseek(rw, next_pos - pos, RW_SEEK_CUR);
306 SDL_RWseek(song->rw, next_pos - pos, RW_SEEK_CUR);
573307 return 0;
574308 }
575309
583317 new->next=next;
584318 meep->next=new;
585319
586 event_count++; /* Count the event. (About one?) */
320 song->event_count++; /* Count the event. (About one?) */
587321 meep=new;
588322 }
589323 }
590324
591325 /* Free the linked event list from memory. */
592 static void free_midi_list(void)
326 static void free_midi_list(MidiSong *song)
593327 {
594328 MidiEventList *meep, *next;
595 if (!(meep=evlist)) return;
329 if (!(meep = song->evlist)) return;
596330 while (meep)
597331 {
598332 next=meep->next;
599333 free(meep);
600334 meep=next;
601335 }
602 evlist=0;
603 }
604
605
606 static void xremap_percussion(int *banknumpt, int *this_notept, int this_kit) {
607 int i, newmap;
608 int banknum = *banknumpt;
609 int this_note = *this_notept;
610 int newbank, newnote;
611
612 if (this_kit != 127 && this_kit != 126) return;
613
614 for (i = 0; i < XMAPMAX; i++) {
615 newmap = xmap[i][0];
616 if (!newmap) return;
617 if (this_kit == 127 && newmap != XGDRUM) continue;
618 if (this_kit == 126 && newmap != SFXDRUM1) continue;
619 if (xmap[i][1] != banknum) continue;
620 if (xmap[i][3] != this_note) continue;
621 newbank = xmap[i][2];
622 newnote = xmap[i][4];
623 if (newbank == banknum && newnote == this_note) return;
624 if (!drumset[newbank]) return;
625 *banknumpt = newbank;
626 *this_notept = newnote;
627 return;
628 }
336 song->evlist=0;
629337 }
630338
631339 /* Allocate an array of MidiEvents and fill it from the linked list of
632340 events, marking used instruments for loading. Convert event times to
633341 samples: handle tempo changes. Strip unnecessary events from the list.
634342 Free the linked list. */
635 static MidiEvent *groom_list(int32 divisions,int32 *eventsp,int32 *samplesp)
343 static MidiEvent *groom_list(MidiSong *song, Sint32 divisions,Sint32 *eventsp,
344 Sint32 *samplesp)
636345 {
637346 MidiEvent *groomed_list, *lp;
638347 MidiEventList *meep;
639 int32 i, our_event_count, tempo, skip_this_event, new_value;
640 int32 sample_cum, samples_to_do, at, st, dt, counting_time;
641
642 int current_bank[MAXCHAN], current_banktype[MAXCHAN], current_set[MAXCHAN],
643 current_kit[MAXCHAN], current_program[MAXCHAN];
348 Sint32 i, our_event_count, tempo, skip_this_event, new_value;
349 Sint32 sample_cum, samples_to_do, at, st, dt, counting_time;
350
351 int current_bank[MAXCHAN], current_set[MAXCHAN], current_program[MAXCHAN];
644352 /* Or should each bank have its own current program? */
645 int dset, dnote, drumsflag, mprog;
646353
647354 for (i=0; i<MAXCHAN; i++)
648355 {
649356 current_bank[i]=0;
650 current_banktype[i]=0;
651357 current_set[i]=0;
652 current_kit[i]=channel[i].kit;
653 current_program[i]=default_program;
358 current_program[i]=song->default_program;
654359 }
655360
656361 tempo=500000;
657 compute_sample_increment(tempo, divisions);
362 compute_sample_increment(song, tempo, divisions);
658363
659364 /* This may allocate a bit more than we need */
660 groomed_list=lp=safe_malloc(sizeof(MidiEvent) * (event_count+1));
661 meep=evlist;
365 groomed_list=lp=safe_malloc(sizeof(MidiEvent) * (song->event_count+1));
366 meep=song->evlist;
662367
663368 our_event_count=0;
664369 st=at=sample_cum=0;
665370 counting_time=2; /* We strip any silence before the first NOTE ON. */
666371
667 for (i=0; i<event_count; i++)
372 for (i = 0; i < song->event_count; i++)
668373 {
669374 skip_this_event=0;
670 ctl->cmsg(CMSG_INFO, VERB_DEBUG_SILLY,
671 "%6d: ch %2d: event %d (%d,%d)",
672 meep->event.time, meep->event.channel + 1,
673 meep->event.type, meep->event.a, meep->event.b);
674375
675376 if (meep->event.type==ME_TEMPO)
676377 {
677 tempo=
678 meep->event.channel + meep->event.b * 256 + meep->event.a * 65536;
679 compute_sample_increment(tempo, divisions);
680378 skip_this_event=1;
681379 }
682380 else if (meep->event.channel >= MAXCHAN)
683 skip_this_event=1;
684 else if ((quietchannels & (1<<meep->event.channel)))
685 skip_this_event=1;
381 skip_this_event=1;
686382 else switch (meep->event.type)
687383 {
688384 case ME_PROGRAM:
689
690 if (current_kit[meep->event.channel])
691 {
692 if (current_kit[meep->event.channel]==126)
693 {
694 /* note request for 2nd sfx rhythm kit */
695 if (meep->event.a && drumset[SFXDRUM2])
696 {
697 current_kit[meep->event.channel]=125;
698 current_set[meep->event.channel]=SFXDRUM2;
699 new_value=SFXDRUM2;
700 }
701 else if (!meep->event.a && drumset[SFXDRUM1])
702 {
703 current_set[meep->event.channel]=SFXDRUM1;
704 new_value=SFXDRUM1;
705 }
706 else
707 {
708 ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
709 "XG SFX drum set is undefined");
710 skip_this_event=1;
711 break;
712 }
713 }
714 if (drumset[meep->event.a]) /* Is this a defined drumset? */
385 if (ISDRUMCHANNEL(song, meep->event.channel))
386 {
387 if (song->drumset[meep->event.a]) /* Is this a defined drumset? */
715388 new_value=meep->event.a;
716389 else
717390 {
718 ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
719 "Drum set %d is undefined", meep->event.a);
720 if (drumset[0])
721 new_value=meep->event.a=0;
722 else
723 {
724 skip_this_event=1;
725 break;
726 }
391 SNDDBG(("Drum set %d is undefined\n", meep->event.a));
392 new_value=meep->event.a=0;
727393 }
728394 if (current_set[meep->event.channel] != new_value)
729395 current_set[meep->event.channel]=new_value;
744410 case ME_NOTEON:
745411 if (counting_time)
746412 counting_time=1;
747
748 drumsflag = current_kit[meep->event.channel];
749
750 if (drumsflag) /* percussion channel? */
751 {
752 dset = current_set[meep->event.channel];
753 dnote=meep->event.a;
754 if (XG_System_On) xremap_percussion(&dset, &dnote, drumsflag);
755
756 /*if (current_config_pc42b) pcmap(&dset, &dnote, &mprog, &drumsflag);*/
757
758 if (drumsflag)
759 {
413 if (ISDRUMCHANNEL(song, meep->event.channel))
414 {
760415 /* Mark this instrument to be loaded */
761 if (!(drumset[dset]->tone[dnote].layer))
762 {
763 drumset[dset]->tone[dnote].layer=
416 if (!(song->drumset[current_set[meep->event.channel]]
417 ->instrument[meep->event.a]))
418 song->drumset[current_set[meep->event.channel]]
419 ->instrument[meep->event.a] = MAGIC_LOAD_INSTRUMENT;
420 }
421 else
422 {
423 if (current_program[meep->event.channel]==SPECIAL_PROGRAM)
424 break;
425 /* Mark this instrument to be loaded */
426 if (!(song->tonebank[current_bank[meep->event.channel]]
427 ->instrument[current_program[meep->event.channel]]))
428 song->tonebank[current_bank[meep->event.channel]]
429 ->instrument[current_program[meep->event.channel]] =
764430 MAGIC_LOAD_INSTRUMENT;
765 }
766 else drumset[dset]->tone[dnote].last_used
767 = current_tune_number;
768 if (!channel[meep->event.channel].name) channel[meep->event.channel].name=
769 drumset[dset]->name;
770 }
771 }
772
773 if (!drumsflag) /* not percussion */
774 {
775 int chan=meep->event.channel;
776 int banknum;
777
778 if (current_banktype[chan]) banknum=SFXBANK;
779 else banknum=current_bank[chan];
780
781 mprog = current_program[chan];
782
783 if (mprog==SPECIAL_PROGRAM)
784 break;
785
786 if (XG_System_On && banknum==SFXBANK && !tonebank[SFXBANK] && tonebank[120])
787 banknum = 120;
788
789 /*if (current_config_pc42b) pcmap(&banknum, &dnote, &mprog, &drumsflag);*/
790
791 if (drumsflag)
792 {
793 /* Mark this instrument to be loaded */
794 if (!(drumset[dset]->tone[dnote].layer))
795 {
796 drumset[dset]->tone[dnote].layer=MAGIC_LOAD_INSTRUMENT;
797 }
798 else drumset[dset]->tone[dnote].last_used = current_tune_number;
799 if (!channel[meep->event.channel].name) channel[meep->event.channel].name=
800 drumset[dset]->name;
801 }
802 if (!drumsflag)
803 {
804 /* Mark this instrument to be loaded */
805 if (!(tonebank[banknum]->tone[mprog].layer))
806 {
807 tonebank[banknum]->tone[mprog].layer=MAGIC_LOAD_INSTRUMENT;
808 }
809 else tonebank[banknum]->tone[mprog].last_used = current_tune_number;
810 if (!channel[meep->event.channel].name) channel[meep->event.channel].name=
811 tonebank[banknum]->tone[mprog].name;
812 }
813431 }
814432 break;
815433
816 case ME_TONE_KIT:
817 if (!meep->event.a || meep->event.a == 127)
818 {
819 new_value=meep->event.a;
820 if (current_kit[meep->event.channel] != new_value)
821 current_kit[meep->event.channel]=new_value;
822 else
823 skip_this_event=1;
824 break;
825 }
826 else if (meep->event.a == 126)
827 {
828 if (drumset[SFXDRUM1]) /* Is this a defined tone bank? */
829 new_value=meep->event.a;
830 else
831 {
832 ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
833 "XG rhythm kit %d is undefined", meep->event.a);
834 skip_this_event=1;
835 break;
836 }
837 current_set[meep->event.channel]=SFXDRUM1;
838 current_kit[meep->event.channel]=new_value;
839 break;
840 }
841 else if (meep->event.a != SFX_BANKTYPE)
842 {
843 ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
844 "XG kit %d is impossible", meep->event.a);
434 case ME_TONE_BANK:
435 if (ISDRUMCHANNEL(song, meep->event.channel))
436 {
845437 skip_this_event=1;
846438 break;
847439 }
848
849 if (current_kit[meep->event.channel])
850 {
851 skip_this_event=1;
852 break;
853 }
854 if (tonebank[SFXBANK] || tonebank[120]) /* Is this a defined tone bank? */
855 new_value=SFX_BANKTYPE;
856 else
857 {
858 ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
859 "XG Sfx bank is undefined");
860 skip_this_event=1;
861 break;
862 }
863 if (current_banktype[meep->event.channel]!=new_value)
864 current_banktype[meep->event.channel]=new_value;
865 else
866 skip_this_event=1;
867 break;
868
869 case ME_TONE_BANK:
870 if (current_kit[meep->event.channel])
871 {
872 skip_this_event=1;
873 break;
874 }
875 if (XG_System_On && meep->event.a > 0 && meep->event.a < 48) {
876 channel[meep->event.channel].variationbank=meep->event.a;
877 ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
878 "XG variation bank %d", meep->event.a);
879 new_value=meep->event.a=0;
880 }
881 else if (tonebank[meep->event.a]) /* Is this a defined tone bank? */
440 if (song->tonebank[meep->event.a]) /* Is this a defined tone bank? */
882441 new_value=meep->event.a;
883442 else
884443 {
885 ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
886 "Tone bank %d is undefined", meep->event.a);
444 SNDDBG(("Tone bank %d is undefined\n", meep->event.a));
887445 new_value=meep->event.a=0;
888446 }
889
890447 if (current_bank[meep->event.channel]!=new_value)
891448 current_bank[meep->event.channel]=new_value;
892449 else
893450 skip_this_event=1;
894451 break;
895
896 case ME_HARMONICCONTENT:
897 channel[meep->event.channel].harmoniccontent=meep->event.a;
898 break;
899 case ME_BRIGHTNESS:
900 channel[meep->event.channel].brightness=meep->event.a;
901 break;
902
903452 }
904453
905454 /* Recompute time in samples*/
906455 if ((dt=meep->event.time - at) && !counting_time)
907456 {
908 samples_to_do=sample_increment * dt;
909 sample_cum += sample_correction * dt;
457 samples_to_do = song->sample_increment * dt;
458 sample_cum += song->sample_correction * dt;
910459 if (sample_cum & 0xFFFF0000)
911460 {
912461 samples_to_do += ((sample_cum >> 16) & 0xFFFF);
915464 st += samples_to_do;
916465 }
917466 else if (counting_time==1) counting_time=0;
467 if (meep->event.type==ME_TEMPO)
468 {
469 tempo=
470 meep->event.channel + meep->event.b * 256 + meep->event.a * 65536;
471 compute_sample_increment(song, tempo, divisions);
472 }
918473 if (!skip_this_event)
919474 {
920475 /* Add the event to the list */
930485 lp->time=st;
931486 lp->type=ME_EOT;
932487 our_event_count++;
933 free_midi_list();
934
488 free_midi_list(song);
489
935490 *eventsp=our_event_count;
936491 *samplesp=st;
937492 return groomed_list;
938493 }
939494
940 MidiEvent *read_midi_file(SDL_RWops *mrw, int32 *count, int32 *sp)
941 {
942 int32 len, divisions;
943 int16 format, tracks, divisions_tmp;
495 MidiEvent *read_midi_file(MidiSong *song, Sint32 *count, Sint32 *sp)
496 {
497 Sint32 len, divisions;
498 Sint16 format, tracks, divisions_tmp;
944499 int i;
945500 char tmp[4];
946501
947 rw = mrw;
948 event_count=0;
949 at=0;
950 evlist=0;
951
952 GM_System_On=GS_System_On=XG_System_On=0;
953 /* vol_table = def_vol_table; */
954 XG_System_reverb_type=XG_System_chorus_type=XG_System_variation_type=0;
955 memset(&drumvolume,-1,sizeof(drumvolume));
956 memset(&drumchorusdepth,-1,sizeof(drumchorusdepth));
957 memset(&drumreverberation,-1,sizeof(drumreverberation));
958 memset(&drumpanpot,NO_PANNING,sizeof(drumpanpot));
959
960 for (i=0; i<MAXCHAN; i++)
961 {
962 if (ISDRUMCHANNEL(i)) channel[i].kit = 127;
963 else channel[i].kit = 0;
964 channel[i].brightness = 64;
965 channel[i].harmoniccontent = 64;
966 channel[i].variationbank = 0;
967 channel[i].chorusdepth = 0;
968 channel[i].reverberation = 0;
969 channel[i].transpose = 0;
970 }
971
972 past_riff:
973
974 if ((SDL_RWread(rw,tmp,1,4) != 4) || (SDL_RWread(rw,&len,4,1) != 1))
975 {
976 /* if (ferror(fp))
977 {
978 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", current_filename,
979 strerror(errno));
980 }
981 else*/
982 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
983 "%s: Not a MIDI file!", current_filename);
502 song->event_count=0;
503 song->at=0;
504 song->evlist=0;
505
506 if (SDL_RWread(song->rw, tmp, 1, 4) != 4 || SDL_RWread(song->rw, &len, 4, 1) != 1)
507 {
508 SNDDBG(("Not a MIDI file!\n"));
984509 return 0;
985510 }
986 len=BE_LONG(len);
987
988 if (!memcmp(tmp, "RIFF", 4))
989 {
990 SDL_RWread(rw,tmp,1,12);
991 goto past_riff;
992 }
511 len=SDL_SwapBE32(len);
993512 if (memcmp(tmp, "MThd", 4) || len < 6)
994513 {
995 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
996 "%s: Not a MIDI file!", current_filename);
514 SNDDBG(("Not a MIDI file!\n"));
997515 return 0;
998516 }
999517
1000 SDL_RWread(rw,&format, 2, 1);
1001 SDL_RWread(rw,&tracks, 2, 1);
1002 SDL_RWread(rw,&divisions_tmp, 2, 1);
1003 format=BE_SHORT(format);
1004 tracks=BE_SHORT(tracks);
1005 track_info = tracks;
1006 curr_track = 0;
1007 curr_title_track = -1;
1008 divisions_tmp=BE_SHORT(divisions_tmp);
518 SDL_RWread(song->rw, &format, 2, 1);
519 SDL_RWread(song->rw, &tracks, 2, 1);
520 SDL_RWread(song->rw, &divisions_tmp, 2, 1);
521 format=SDL_SwapBE16(format);
522 tracks=SDL_SwapBE16(tracks);
523 divisions_tmp=SDL_SwapBE16(divisions_tmp);
1009524
1010525 if (divisions_tmp<0)
1011526 {
1012527 /* SMPTE time -- totally untested. Got a MIDI file that uses this? */
1013528 divisions=
1014 (int32)(-(divisions_tmp/256)) * (int32)(divisions_tmp & 0xFF);
1015 }
1016 else divisions=(int32)(divisions_tmp);
529 (Sint32)(-(divisions_tmp/256)) * (Sint32)(divisions_tmp & 0xFF);
530 }
531 else divisions=(Sint32)(divisions_tmp);
1017532
1018533 if (len > 6)
1019534 {
1020 ctl->cmsg(CMSG_WARNING, VERB_NORMAL,
1021 "%s: MIDI file header size %ld bytes",
1022 current_filename, len);
1023 SDL_RWseek(rw, len-6, RW_SEEK_CUR); /* skip the excess */
535 SNDDBG(("MIDI file header size %u bytes", len));
536 SDL_RWseek(song->rw, len-6, RW_SEEK_CUR); /* skip the excess */
1024537 }
1025538 if (format<0 || format >2)
1026539 {
1027 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
1028 "%s: Unknown MIDI file format %d", current_filename, format);
540 SNDDBG(("Unknown MIDI file format %d\n", format));
1029541 return 0;
1030542 }
1031 ctl->cmsg(CMSG_INFO, VERB_VERBOSE,
1032 "Format: %d Tracks: %d Divisions: %d", format, tracks, divisions);
543 if (tracks<1)
544 {
545 SNDDBG(("Bad number of tracks %d\n", tracks));
546 return 0;
547 }
548 if (format==0 && tracks!=1)
549 {
550 SNDDBG(("%d tracks with Type-0 MIDI (must be 1.)\n", tracks));
551 return 0;
552 }
553 SNDDBG(("Format: %d Tracks: %d Divisions: %d\n",
554 format, tracks, divisions));
1033555
1034556 /* Put a do-nothing event first in the list for easier processing */
1035 evlist=safe_malloc(sizeof(MidiEventList));
1036 evlist->event.time=0;
1037 evlist->event.type=ME_NONE;
1038 evlist->next=0;
1039 event_count++;
557 song->evlist=safe_malloc(sizeof(MidiEventList));
558 memset(song->evlist, 0, sizeof(MidiEventList));
559 song->event_count++;
1040560
1041561 switch(format)
1042562 {
1043563 case 0:
1044 if (read_track(0))
1045 {
1046 free_midi_list();
564 if (read_track(song, 0))
565 {
566 free_midi_list(song);
1047567 return 0;
1048568 }
1049 else curr_track++;
1050569 break;
1051570
1052571 case 1:
1053572 for (i=0; i<tracks; i++)
1054 if (read_track(0))
573 if (read_track(song, 0))
1055574 {
1056 free_midi_list();
575 free_midi_list(song);
1057576 return 0;
1058577 }
1059578 break;
1060579
1061580 case 2: /* We simply play the tracks sequentially */
1062581 for (i=0; i<tracks; i++)
1063 if (read_track(1))
582 if (read_track(song, 1))
1064583 {
1065 free_midi_list();
584 free_midi_list(song);
1066585 return 0;
1067586 }
1068 else curr_track++;
1069587 break;
1070588 }
1071 return groom_list(divisions, count, sp);
1072 }
589 return groom_list(song, divisions, count, sp);
590 }
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
77
8 typedef struct {
9 MidiEvent event;
10 void *next;
11 } MidiEventList;
8 readmidi.h
9
10 */
1211
13 extern int32 quietchannels;
14
15 extern MidiEvent *read_midi_file(SDL_RWops *mrw, int32 *count, int32 *sp);
16
17 extern char midi_name[FILENAME_MAX+1];
12 extern MidiEvent *read_midi_file(MidiSong *song, Sint32 *count, Sint32 *sp);
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 resample.c
9 */
10
11 #if HAVE_CONFIG_H
12 # include <config.h>
13 #endif
714
815 #include <math.h>
916 #include <stdio.h>
1017 #include <stdlib.h>
1118
12 #include "config.h"
19 #include "SDL.h"
20
21 #include "timidity.h"
22 #include "options.h"
1323 #include "common.h"
1424 #include "instrum.h"
1525 #include "playmidi.h"
16 #include "output.h"
17 #include "ctrlmode.h"
1826 #include "tables.h"
1927 #include "resample.h"
2028
21 #ifdef LINEAR_INTERPOLATION
22 # if defined(LOOKUP_HACK) && defined(LOOKUP_INTERPOLATION)
23 # define RESAMPLATION \
24 v1=src[ofs>>FRACTION_BITS];\
25 v2=src[(ofs>>FRACTION_BITS)+1];\
26 *dest++ = (resample_t)(v1 + (iplookup[(((v2-v1)<<5) & 0x03FE0) | \
27 ((ofs & FRACTION_MASK) >> (FRACTION_BITS-5))]));
28 # else
29 # define RESAMPLATION \
30 v1=src[ofs>>FRACTION_BITS];\
31 v2=src[(ofs>>FRACTION_BITS)+1];\
32 *dest++ = (resample_t)(v1 + (((v2-v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS));
33 # endif
34 # define INTERPVARS sample_t v1, v2
35 #else
36 /* Earplugs recommended for maximum listening enjoyment */
37 # define RESAMPLATION *dest++ = src[ofs>>FRACTION_BITS];
38 # define INTERPVARS
39 #endif
40
41 #define FINALINTERP if (ofs == le) *dest++=src[ofs>>FRACTION_BITS];
42 /* So it isn't interpolation. At least it's final. */
43
44 extern resample_t *resample_buffer;
29 #define PRECALC_LOOP_COUNT(start, end, incr) (((end) - (start) + (incr) - 1) / (incr))
4530
4631 /*************** resampling with fixed increment *****************/
4732
48 static resample_t *rs_plain(int v, int32 *countptr)
33 static sample_t *rs_plain(MidiSong *song, int v, Sint32 *countptr)
4934 {
5035
5136 /* Play sample until end, then free the voice. */
5237
53 INTERPVARS;
38 sample_t v1, v2;
5439 Voice
55 *vp=&voice[v];
56 resample_t
57 *dest=resample_buffer;
40 *vp=&(song->voice[v]);
5841 sample_t
42 *dest=song->resample_buffer,
5943 *src=vp->sample->data;
60 int32
44 Sint32
6145 ofs=vp->sample_offset,
6246 incr=vp->sample_increment,
6347 le=vp->sample->data_length,
6448 count=*countptr;
65
66 #ifdef PRECALC_LOOPS
67 int32 i, j;
49 Sint32 i, j;
6850
6951 if (incr<0) incr = -incr; /* In case we're coming out of a bidir loop */
7052
7153 /* Precalc how many times we should go through the loop.
7254 NOTE: Assumes that incr > 0 and that ofs <= le */
73 i = (le - ofs) / incr + 1;
55 i = PRECALC_LOOP_COUNT(ofs, le, incr);
7456
7557 if (i > count)
7658 {
7961 }
8062 else count -= i;
8163
82 for(j = 0; j < i; j++)
83 {
84 RESAMPLATION;
64 for (j = 0; j < i; j++)
65 {
66 v1 = src[ofs >> FRACTION_BITS];
67 v2 = src[(ofs >> FRACTION_BITS)+1];
68 *dest++ = v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS);
8569 ofs += incr;
8670 }
8771
8872 if (ofs >= le)
8973 {
90 FINALINTERP;
74 if (ofs == le)
75 *dest++ = src[(ofs>>FRACTION_BITS)-1]/2;
9176 vp->status=VOICE_FREE;
92 ctl->note(v);
9377 *countptr-=count+1;
9478 }
95
96 #else /* PRECALC_LOOPS */
97 while (count--)
98 {
99 RESAMPLATION;
100 ofs += incr;
101 if (ofs >= le)
102 {
103 FINALINTERP;
104 vp->status=VOICE_FREE;
105 ctl->note(v);
106 *countptr-=count+1;
107 break;
108 }
109 }
110 #endif /* PRECALC_LOOPS */
11179
11280 vp->sample_offset=ofs; /* Update offset */
113 return resample_buffer;
114 }
115
116 static resample_t *rs_loop(Voice *vp, int32 count)
81 return song->resample_buffer;
82 }
83
84 static sample_t *rs_loop(MidiSong *song, Voice *vp, Sint32 count)
11785 {
11886
11987 /* Play sample until end-of-loop, skip back and continue. */
12088
121 INTERPVARS;
122 int32
89 sample_t v1, v2;
90 Sint32
12391 ofs=vp->sample_offset,
12492 incr=vp->sample_increment,
12593 le=vp->sample->loop_end,
12694 ll=le - vp->sample->loop_start;
127 resample_t
128 *dest=resample_buffer;
12995 sample_t
96 *dest=song->resample_buffer,
13097 *src=vp->sample->data;
131
132 #ifdef PRECALC_LOOPS
133 int32 i;
134
135 if (ofs < 0 || le < 0) return resample_buffer;
136
98 Sint32 i, j;
99
137100 while (count)
138101 {
139 if (ofs >= le)
140 /* NOTE: Assumes that ll > incr and that incr > 0. */
102 while (ofs >= le)
141103 ofs -= ll;
142104 /* Precalc how many times we should go through the loop */
143 i = (le - ofs) / incr + 1;
105 i = PRECALC_LOOP_COUNT(ofs, le, incr);
144106 if (i > count)
145107 {
146108 i = count;
147109 count = 0;
148110 }
149111 else count -= i;
150 if (i > 0)
151 while (i--)
152 {
153 RESAMPLATION;
112 for (j = 0; j < i; j++)
113 {
114 v1 = src[ofs >> FRACTION_BITS];
115 v2 = src[(ofs >> FRACTION_BITS)+1];
116 *dest++ = v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS);
154117 ofs += incr;
155118 }
156119 }
157 #else
158 while (count--)
159 {
160 RESAMPLATION;
161 ofs += incr;
162 if (ofs>=le)
163 ofs -= ll; /* Hopefully the loop is longer than an increment. */
164 }
165 #endif
166120
167121 vp->sample_offset=ofs; /* Update offset */
168 return resample_buffer;
169 }
170
171 static resample_t *rs_bidir(Voice *vp, int32 count)
172 {
173 INTERPVARS;
174 int32
122 return song->resample_buffer;
123 }
124
125 static sample_t *rs_bidir(MidiSong *song, Voice *vp, Sint32 count)
126 {
127 sample_t v1, v2;
128 Sint32
175129 ofs=vp->sample_offset,
176130 incr=vp->sample_increment,
177131 le=vp->sample->loop_end,
178132 ls=vp->sample->loop_start;
179 resample_t
180 *dest=resample_buffer;
181133 sample_t
134 *dest=song->resample_buffer,
182135 *src=vp->sample->data;
183
184 #ifdef PRECALC_LOOPS
185 int32
186 le2 = le<<1,
136 Sint32
137 le2 = le<<1,
187138 ls2 = ls<<1,
188 i;
139 i, j;
189140 /* Play normally until inside the loop region */
190141
191 if (ofs <= ls)
142 if (incr > 0 && ofs < ls)
192143 {
193144 /* NOTE: Assumes that incr > 0, which is NOT always the case
194145 when doing bidirectional looping. I have yet to see a case
195146 where both ofs <= ls AND incr < 0, however. */
196 i = (ls - ofs) / incr + 1;
147 i = PRECALC_LOOP_COUNT(ofs, ls, incr);
197148 if (i > count)
198149 {
199150 i = count;
200151 count = 0;
201152 }
202153 else count -= i;
203 while (i--)
204 {
205 RESAMPLATION;
154 for (j = 0; j < i; j++)
155 {
156 v1 = src[ofs >> FRACTION_BITS];
157 v2 = src[(ofs >> FRACTION_BITS)+1];
158 *dest++ = v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS);
206159 ofs += incr;
207160 }
208161 }
212165 while(count)
213166 {
214167 /* Precalc how many times we should go through the loop */
215 i = ((incr > 0 ? le : ls) - ofs) / incr + 1;
168 i = PRECALC_LOOP_COUNT(ofs, incr > 0 ? le : ls, incr);
216169 if (i > count)
217170 {
218171 i = count;
219172 count = 0;
220173 }
221174 else count -= i;
222 while (i--)
223 {
224 RESAMPLATION;
175 for (j = 0; j < i; j++)
176 {
177 v1 = src[ofs >> FRACTION_BITS];
178 v2 = src[(ofs >> FRACTION_BITS)+1];
179 *dest++ = v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS);
225180 ofs += incr;
226181 }
227182 if (ofs>=le)
237192 }
238193 }
239194
240 #else /* PRECALC_LOOPS */
241 /* Play normally until inside the loop region */
242
243 if (ofs < ls)
244 {
245 while (count--)
246 {
247 RESAMPLATION;
248 ofs += incr;
249 if (ofs>=ls)
250 break;
251 }
252 }
253
254 /* Then do the bidirectional looping */
255
256 if (count>0)
257 while (count--)
258 {
259 RESAMPLATION;
260 ofs += incr;
261 if (ofs>=le)
262 {
263 /* fold the overshoot back in */
264 ofs = le - (ofs - le);
265 incr = -incr;
266 }
267 else if (ofs <= ls)
268 {
269 ofs = ls + (ls - ofs);
270 incr = -incr;
271 }
272 }
273 #endif /* PRECALC_LOOPS */
274195 vp->sample_increment=incr;
275196 vp->sample_offset=ofs; /* Update offset */
276 return resample_buffer;
197 return song->resample_buffer;
277198 }
278199
279200 /*********************** vibrato versions ***************************/
289210 return phase-VIBRATO_SAMPLE_INCREMENTS/2;
290211 }
291212
292 static int32 update_vibrato(Voice *vp, int sign)
293 {
294 int32 depth;
213 static Sint32 update_vibrato(MidiSong *song, Voice *vp, int sign)
214 {
215 Sint32 depth;
295216 int phase, pb;
296217 double a;
297218
328249 a = FSCALE(((double)(vp->sample->sample_rate) *
329250 (double)(vp->frequency)) /
330251 ((double)(vp->sample->root_freq) *
331 (double)(play_mode->rate)),
252 (double)(song->rate)),
332253 FRACTION_BITS);
333254
334255 pb=(int)((sine(vp->vibrato_phase *
345266
346267 /* If the sweep's over, we can store the newly computed sample_increment */
347268 if (!vp->vibrato_sweep)
348 vp->vibrato_sample_increment[phase]=(int32) a;
269 vp->vibrato_sample_increment[phase]=(Sint32) a;
349270
350271 if (sign)
351272 a = -a; /* need to preserve the loop direction */
352273
353 return (int32) a;
354 }
355
356 static resample_t *rs_vib_plain(int v, int32 *countptr)
274 return (Sint32) a;
275 }
276
277 static sample_t *rs_vib_plain(MidiSong *song, int v, Sint32 *countptr)
357278 {
358279
359280 /* Play sample until end, then free the voice. */
360281
361 INTERPVARS;
362 Voice *vp=&voice[v];
363 resample_t
364 *dest=resample_buffer;
282 sample_t v1, v2;
283 Voice *vp=&(song->voice[v]);
365284 sample_t
285 *dest=song->resample_buffer,
366286 *src=vp->sample->data;
367 int32
287 Sint32
368288 le=vp->sample->data_length,
369289 ofs=vp->sample_offset,
370290 incr=vp->sample_increment,
381301 if (!cc--)
382302 {
383303 cc=vp->vibrato_control_ratio;
384 incr=update_vibrato(vp, 0);
385 }
386 RESAMPLATION;
304 incr=update_vibrato(song, vp, 0);
305 }
306 v1 = src[ofs >> FRACTION_BITS];
307 v2 = src[(ofs >> FRACTION_BITS)+1];
308 *dest++ = v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS);
387309 ofs += incr;
388310 if (ofs >= le)
389311 {
390 FINALINTERP;
312 if (ofs == le)
313 *dest++ = src[(ofs>>FRACTION_BITS)-1]/2;
391314 vp->status=VOICE_FREE;
392 ctl->note(v);
393315 *countptr-=count+1;
394316 break;
395317 }
398320 vp->vibrato_control_counter=cc;
399321 vp->sample_increment=incr;
400322 vp->sample_offset=ofs; /* Update offset */
401 return resample_buffer;
402 }
403
404 static resample_t *rs_vib_loop(Voice *vp, int32 count)
323 return song->resample_buffer;
324 }
325
326 static sample_t *rs_vib_loop(MidiSong *song, Voice *vp, Sint32 count)
405327 {
406328
407329 /* Play sample until end-of-loop, skip back and continue. */
408330
409 INTERPVARS;
410 int32
331 sample_t v1, v2;
332 Sint32
411333 ofs=vp->sample_offset,
412334 incr=vp->sample_increment,
413335 le=vp->sample->loop_end,
414336 ll=le - vp->sample->loop_start;
415 resample_t
416 *dest=resample_buffer;
417337 sample_t
338 *dest=song->resample_buffer,
418339 *src=vp->sample->data;
419340 int
420341 cc=vp->vibrato_control_counter;
421
422 #ifdef PRECALC_LOOPS
423 int32 i;
342 Sint32 i, j;
424343 int
425344 vibflag=0;
426345
427346 while (count)
428347 {
429348 /* Hopefully the loop is longer than an increment */
430 if(ofs >= le)
349 while(ofs >= le)
431350 ofs -= ll;
432351 /* Precalc how many times to go through the loop, taking
433352 the vibrato control ratio into account this time. */
434 i = (le - ofs) / incr + 1;
353 i = PRECALC_LOOP_COUNT(ofs, le, incr);
435354 if(i > count) i = count;
436355 if(i > cc)
437356 {
440359 }
441360 else cc -= i;
442361 count -= i;
443 while(i--)
444 {
445 RESAMPLATION;
362 for (j = 0; j < i; j++)
363 {
364 v1 = src[ofs >> FRACTION_BITS];
365 v2 = src[(ofs >> FRACTION_BITS)+1];
366 *dest++ = v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS);
446367 ofs += incr;
447368 }
448369 if(vibflag)
449370 {
450371 cc = vp->vibrato_control_ratio;
451 incr = update_vibrato(vp, 0);
372 incr = update_vibrato(song, vp, 0);
452373 vibflag = 0;
453374 }
454375 }
455
456 #else /* PRECALC_LOOPS */
457 while (count--)
458 {
459 if (!cc--)
460 {
461 cc=vp->vibrato_control_ratio;
462 incr=update_vibrato(vp, 0);
463 }
464 RESAMPLATION;
465 ofs += incr;
466 if (ofs>=le)
467 ofs -= ll; /* Hopefully the loop is longer than an increment. */
468 }
469 #endif /* PRECALC_LOOPS */
470376
471377 vp->vibrato_control_counter=cc;
472378 vp->sample_increment=incr;
473379 vp->sample_offset=ofs; /* Update offset */
474 return resample_buffer;
475 }
476
477 static resample_t *rs_vib_bidir(Voice *vp, int32 count)
478 {
479 INTERPVARS;
480 int32
380 return song->resample_buffer;
381 }
382
383 static sample_t *rs_vib_bidir(MidiSong *song, Voice *vp, Sint32 count)
384 {
385 sample_t v1, v2;
386 Sint32
481387 ofs=vp->sample_offset,
482388 incr=vp->sample_increment,
483389 le=vp->sample->loop_end,
484390 ls=vp->sample->loop_start;
485 resample_t
486 *dest=resample_buffer;
487391 sample_t
392 *dest=song->resample_buffer,
488393 *src=vp->sample->data;
489394 int
490395 cc=vp->vibrato_control_counter;
491
492 #ifdef PRECALC_LOOPS
493 int32
396 Sint32
494397 le2=le<<1,
495398 ls2=ls<<1,
496 i;
399 i, j;
497400 int
498401 vibflag = 0;
499402
500403 /* Play normally until inside the loop region */
501 while (count && (ofs <= ls))
502 {
503 i = (ls - ofs) / incr + 1;
404 while (count && incr > 0 && ofs < ls)
405 {
406 i = PRECALC_LOOP_COUNT(ofs, ls, incr);
504407 if (i > count) i = count;
505408 if (i > cc)
409 {
410 i = cc;
411 vibflag = 1;
412 }
413 else cc -= i;
414 count -= i;
415 for (j = 0; j < i; j++)
416 {
417 v1 = src[ofs >> FRACTION_BITS];
418 v2 = src[(ofs >> FRACTION_BITS)+1];
419 *dest++ = v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS);
420 ofs += incr;
421 }
422 if (vibflag)
423 {
424 cc = vp->vibrato_control_ratio;
425 incr = update_vibrato(song, vp, 0);
426 vibflag = 0;
427 }
428 }
429
430 /* Then do the bidirectional looping */
431
432 while (count)
433 {
434 /* Precalc how many times we should go through the loop */
435 i = PRECALC_LOOP_COUNT(ofs, incr > 0 ? le : ls, incr);
436 if(i > count) i = count;
437 if(i > cc)
506438 {
507439 i = cc;
508440 vibflag = 1;
511443 count -= i;
512444 while (i--)
513445 {
514 RESAMPLATION;
446 v1 = src[ofs >> FRACTION_BITS];
447 v2 = src[(ofs >> FRACTION_BITS)+1];
448 *dest++ = v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS);
515449 ofs += incr;
516450 }
517451 if (vibflag)
518452 {
519453 cc = vp->vibrato_control_ratio;
520 incr = update_vibrato(vp, 0);
521 vibflag = 0;
522 }
523 }
524
525 /* Then do the bidirectional looping */
526
527 while (count)
528 {
529 /* Precalc how many times we should go through the loop */
530 i = ((incr > 0 ? le : ls) - ofs) / incr + 1;
531 if(i > count) i = count;
532 if(i > cc)
533 {
534 i = cc;
535 vibflag = 1;
536 }
537 else cc -= i;
538 count -= i;
539 while (i--)
540 {
541 RESAMPLATION;
542 ofs += incr;
543 }
544 if (vibflag)
545 {
546 cc = vp->vibrato_control_ratio;
547 incr = update_vibrato(vp, (incr < 0));
454 incr = update_vibrato(song, vp, (incr < 0));
548455 vibflag = 0;
549456 }
550457 if (ofs >= le)
560467 }
561468 }
562469
563 #else /* PRECALC_LOOPS */
564 /* Play normally until inside the loop region */
565
566 if (ofs < ls)
567 {
568 while (count--)
569 {
570 if (!cc--)
571 {
572 cc=vp->vibrato_control_ratio;
573 incr=update_vibrato(vp, 0);
574 }
575 RESAMPLATION;
576 ofs += incr;
577 if (ofs>=ls)
578 break;
579 }
580 }
581
582 /* Then do the bidirectional looping */
583
584 if (count>0)
585 while (count--)
586 {
587 if (!cc--)
588 {
589 cc=vp->vibrato_control_ratio;
590 incr=update_vibrato(vp, (incr < 0));
591 }
592 RESAMPLATION;
593 ofs += incr;
594 if (ofs>=le)
595 {
596 /* fold the overshoot back in */
597 ofs = le - (ofs - le);
598 incr = -incr;
599 }
600 else if (ofs <= ls)
601 {
602 ofs = ls + (ls - ofs);
603 incr = -incr;
604 }
605 }
606 #endif /* PRECALC_LOOPS */
607
608470 vp->vibrato_control_counter=cc;
609471 vp->sample_increment=incr;
610472 vp->sample_offset=ofs; /* Update offset */
611 return resample_buffer;
612 }
613
614 resample_t *resample_voice(int v, int32 *countptr)
615 {
616 int32 ofs;
617 uint8 modes;
618 Voice *vp=&voice[v];
473 return song->resample_buffer;
474 }
475
476 sample_t *resample_voice(MidiSong *song, int v, Sint32 *countptr)
477 {
478 Sint32 ofs;
479 Uint8 modes;
480 Voice *vp=&(song->voice[v]);
619481
620482 if (!(vp->sample->sample_rate))
621483 {
627489 {
628490 /* Note finished. Free the voice. */
629491 vp->status = VOICE_FREE;
630 ctl->note(v);
631492
632493 /* Let the caller know how much data we had left */
633494 *countptr = (vp->sample->data_length>>FRACTION_BITS) - ofs;
635496 else
636497 vp->sample_offset += *countptr << FRACTION_BITS;
637498
638 return (resample_t *)vp->sample->data+ofs;
499 return vp->sample->data+ofs;
639500 }
640501
641502 /* Need to resample. Use the proper function. */
648509 (vp->status==VOICE_ON || vp->status==VOICE_SUSTAINED)))
649510 {
650511 if (modes & MODES_PINGPONG)
651 return rs_vib_bidir(vp, *countptr);
512 return rs_vib_bidir(song, vp, *countptr);
652513 else
653 return rs_vib_loop(vp, *countptr);
514 return rs_vib_loop(song, vp, *countptr);
654515 }
655516 else
656 return rs_vib_plain(v, countptr);
517 return rs_vib_plain(song, v, countptr);
657518 }
658519 else
659520 {
662523 (vp->status==VOICE_ON || vp->status==VOICE_SUSTAINED)))
663524 {
664525 if (modes & MODES_PINGPONG)
665 return rs_bidir(vp, *countptr);
526 return rs_bidir(song, vp, *countptr);
666527 else
667 return rs_loop(vp, *countptr);
528 return rs_loop(song, vp, *countptr);
668529 }
669530 else
670 return rs_plain(v, countptr);
671 }
672 }
673
674 void pre_resample(Sample * sp)
531 return rs_plain(song, v, countptr);
532 }
533 }
534
535 void pre_resample(MidiSong *song, Sample *sp)
675536 {
676537 double a, xdiff;
677 int32 incr, ofs, newlen, count;
678 int16 *src = (int16 *) sp->data;
679 resample_t *newdata, *dest;
680 int16 v1, v2, v3, v4, *vptr;
538 Sint32 incr, ofs, newlen, count;
539 Sint16 *newdata, *dest, *src = (Sint16 *) sp->data, *vptr;
540 Sint32 v, v1, v2, v3, v4, v5, i;
541 #ifdef DEBUG_CHATTER
681542 static const char note_name[12][3] =
682543 {
683544 "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"
684545 };
685546
686 ctl->cmsg(CMSG_INFO, VERB_NOISY, " * pre-resampling for note %d (%s%d)",
687 sp->note_to_use,
688 note_name[sp->note_to_use % 12], (sp->note_to_use & 0x7F) / 12);
689
690 a = ((double) (sp->sample_rate) * freq_table[(int) (sp->note_to_use)]) /
691 ((double) (sp->root_freq) * play_mode->rate);
692 if (a <= 0) return;
693 newlen = (int32)(sp->data_length / a);
694 if (newlen < 0 || (newlen >> FRACTION_BITS) > MAX_SAMPLE_SIZE) return;
695 dest = newdata = safe_malloc(newlen >> (FRACTION_BITS - 1));
696
547 SNDDBG((" * pre-resampling for note %d (%s%d)\n",
548 sp->note_to_use,
549 note_name[sp->note_to_use % 12], (sp->note_to_use & 0x7F) / 12));
550 #endif
551
552 a = ((double) (sp->root_freq) * song->rate) /
553 ((double) (sp->sample_rate) * freq_table[(int) (sp->note_to_use)]);
554 if(sp->data_length * a >= 0x7fffffffL) { /* Too large to compute */
555 SNDDBG((" *** Can't pre-resampling for note %d\n", sp->note_to_use));
556 return;
557 }
558
559 newlen = (Sint32)(sp->data_length * a);
697560 count = (newlen >> FRACTION_BITS) - 1;
698561 ofs = incr = (sp->data_length - (1 << FRACTION_BITS)) / count;
699562
563 if((double)newlen + incr >= 0x7fffffffL) { /* Too large to compute */
564 SNDDBG((" *** Can't pre-resampling for note %d\n", sp->note_to_use));
565 return;
566 }
567
568 dest = newdata = (Sint16 *) safe_malloc((newlen >> (FRACTION_BITS - 1)) + 2);
569 if (!dest)
570 return;
571
700572 if (--count)
701573 *dest++ = src[0];
702574
703575 /* Since we're pre-processing and this doesn't have to be done in
704576 real-time, we go ahead and do the full sliding cubic interpolation. */
705 while (--count)
577 count--;
578 for(i = 0; i < count; i++)
706579 {
707580 vptr = src + (ofs >> FRACTION_BITS);
708 v1 = (vptr == src) ? *vptr : *(vptr - 1);
581 v1 = ((vptr>=src+1)? *(vptr - 1):0);
709582 v2 = *vptr;
710583 v3 = *(vptr + 1);
711584 v4 = *(vptr + 2);
585 v5 = v2 - v3;
712586 xdiff = FSCALENEG(ofs & FRACTION_MASK, FRACTION_BITS);
713 *dest++ = (int16)(v2 + (xdiff / 6.0) * (-2 * v1 - 3 * v2 + 6 * v3 - v4 +
714 xdiff * (3 * (v1 - 2 * v2 + v3) + xdiff * (-v1 + 3 * (v2 - v3) + v4))));
587 v = (Sint32)(v2 + xdiff * (1.0/6.0) * (3 * (v3 - v5) - 2 * v1 - v4 +
588 xdiff * (3 * (v1 - v2 - v5) + xdiff * (3 * v5 + v4 - v1))));
589 *dest++ = (Sint16)((v > 32767) ? 32767 : ((v < -32768) ? -32768 : v));
715590 ofs += incr;
716591 }
717592
719594 {
720595 v1 = src[ofs >> FRACTION_BITS];
721596 v2 = src[(ofs >> FRACTION_BITS) + 1];
722 *dest++ = (resample_t)(v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS));
597 *dest++ = (Sint16)(v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS));
723598 }
724599 else
725600 *dest++ = src[ofs >> FRACTION_BITS];
726601
602 *dest = *(dest - 1) / 2;
603 ++dest;
604 *dest = *(dest - 1) / 2;
605
727606 sp->data_length = newlen;
728 sp->loop_start = (int32)(sp->loop_start / a);
729 sp->loop_end = (int32)(sp->loop_end / a);
607 sp->loop_start = (Sint32)(sp->loop_start * a);
608 sp->loop_end = (Sint32)(sp->loop_end * a);
730609 free(sp->data);
731610 sp->data = (sample_t *) newdata;
732611 sp->sample_rate = 0;
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
77
8 extern resample_t *resample_voice(int v, int32 *countptr);
9 extern void pre_resample(Sample *sp);
8 resample.h
9 */
10
11 extern sample_t *resample_voice(MidiSong *song, int v, Sint32 *countptr);
12 extern void pre_resample(MidiSong *song, Sample *sp);
+0
-19
timidity/sdl_a.c less more
0 /*
1 TiMidity -- Experimental MIDI to WAVE converter
2 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 #include "config.h"
9 #include "output.h"
10
11 /* export the playback mode */
12
13 #define dpm sdl_play_mode
14
15 PlayMode dpm = {
16 DEFAULT_RATE, PE_16BIT|PE_SIGNED,
17 "SDL audio"
18 };
+0
-133
timidity/sdl_c.c less more
0 /*
1 TiMidity -- Experimental MIDI to WAVE converter
2 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <stdarg.h>
11
12 #include "config.h"
13 #include "common.h"
14 #include "output.h"
15 #include "ctrlmode.h"
16 #include "instrum.h"
17 #include "playmidi.h"
18
19 static void ctl_refresh(void);
20 static void ctl_total_time(int tt);
21 static void ctl_master_volume(int mv);
22 static void ctl_file_name(char *name);
23 static void ctl_current_time(int ct);
24 static void ctl_note(int v);
25 static void ctl_program(int ch, int val);
26 static void ctl_volume(int channel, int val);
27 static void ctl_expression(int channel, int val);
28 static void ctl_panning(int channel, int val);
29 static void ctl_sustain(int channel, int val);
30 static void ctl_pitch_bend(int channel, int val);
31 static void ctl_reset(void);
32 static int ctl_open(int using_stdin, int using_stdout);
33 static void ctl_close(void);
34 static int ctl_read(int32 *valp);
35 static int cmsg(int type, int verbosity_level, char *fmt, ...);
36
37 /**********************************/
38 /* export the interface functions */
39
40 #define ctl sdl_control_mode
41
42 ControlMode ctl=
43 {
44 "SDL interface", 's',
45 1,0,0,
46 ctl_open,NULL, ctl_close, ctl_read, cmsg,
47 ctl_refresh, ctl_reset, ctl_file_name, ctl_total_time, ctl_current_time,
48 ctl_note,
49 ctl_master_volume, ctl_program, ctl_volume,
50 ctl_expression, ctl_panning, ctl_sustain, ctl_pitch_bend
51 };
52
53 static int ctl_open(int using_stdin, int using_stdout)
54 {
55 ctl.opened=1;
56 return 0;
57 }
58
59 static void ctl_close(void)
60 {
61 ctl.opened=0;
62 }
63
64 static int ctl_read(int32 *valp)
65 {
66 return RC_NONE;
67 }
68
69 static int cmsg(int type, int verbosity_level, char *fmt, ...)
70 {
71 #ifdef GREGS_DEBUG
72 va_list ap;
73 int flag_newline = 1;
74 if ((type==CMSG_TEXT || type==CMSG_INFO || type==CMSG_WARNING) &&
75 ctl.verbosity<verbosity_level-1)
76 return 0;
77 if (*fmt == '~')
78 {
79 flag_newline = 0;
80 fmt++;
81 }
82 va_start(ap, fmt);
83 if (!ctl.opened)
84 {
85 vfprintf(stderr, fmt, ap);
86 if (flag_newline) fprintf(stderr, "\n");
87 }
88 else
89 {
90 vfprintf(stderr, fmt, ap);
91 if (flag_newline) fprintf(stderr, "\n");
92 }
93 va_end(ap);
94 if (!flag_newline) fflush(stderr);
95 return 0;
96 #else
97 va_list ap;
98 if ((type==CMSG_TEXT || type==CMSG_INFO || type==CMSG_WARNING) &&
99 ctl.verbosity<verbosity_level)
100 return 0;
101 va_start(ap, fmt);
102 SDL_vsnprintf(timidity_error, TIMIDITY_ERROR_SIZE, fmt, ap);
103 va_end(ap);
104 return 0;
105 #endif
106 }
107
108 static void ctl_refresh(void) { }
109
110 static void ctl_total_time(int tt) {}
111
112 static void ctl_master_volume(int mv) {}
113
114 static void ctl_file_name(char *name) {}
115
116 static void ctl_current_time(int ct) {}
117
118 static void ctl_note(int v) {}
119
120 static void ctl_program(int ch, int val) {}
121
122 static void ctl_volume(int channel, int val) {}
123
124 static void ctl_expression(int channel, int val) {}
125
126 static void ctl_panning(int channel, int val) {}
127
128 static void ctl_sustain(int channel, int val) {}
129
130 static void ctl_pitch_bend(int channel, int val) {}
131
132 static void ctl_reset(void) {}
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7 */
8
9 #if HAVE_CONFIG_H
10 # include <config.h>
11 #endif
712
813 #include <stdio.h>
9 #include "config.h"
10 #include "common.h"
14
15 #include "SDL.h"
16
1117 #include "tables.h"
12 #include "instrum.h"
13
14 int32 freq_table[128]=
18
19 const Sint32 freq_table[128]=
1520 {
1621 8176, 8662, 9177, 9723,
1722 10301, 10913, 11562, 12250,
5863 };
5964
6065 /* v=2.^((x/127-1) * 6) */
61 double vol_table[128] =
66 const double vol_table[128] =
6267 {
6368 0.015625, 0.016145143728351113, 0.016682602624583379, 0.017237953096759438,
6469 0.017811790741104401, 0.01840473098076444, 0.019017409725829021, 0.019650484055324921,
9499 0.90643012614631979, 0.93660445864574493, 0.96778327049280244, 1
95100 };
96101
97
98 /* v=2.^((x/127-1) * 4) */
99 FLOAT_T expr_table[128] = {
100 0.062500000000000000, 0.063879466007418617, 0.065289378838287213, 0.066730410498333517,
101 0.068203247825430205, 0.069708592816961873, 0.071247162964417632, 0.072819691595368496,
102 0.074426928222992794, 0.076069638903316056, 0.077748606600335793, 0.079464631559205010,
103 0.081218531687652529, 0.083011142945821639, 0.084843319744713291, 0.086715935353423396,
104 0.088629882315368322, 0.090586072873697340, 0.092585439406094330, 0.094628934869176312,
105 0.096717533252700480, 0.098852230043796174, 0.101034042701443255, 0.103264011141422821,
106 0.105543198231971461, 0.107872690300375454, 0.110253597650746091, 0.112687055093223104,
107 0.115174222484858521, 0.117716285282438229, 0.120314455107505686, 0.122969970323856051,
108 0.125684096627776631, 0.128458127651314785, 0.131293385578860888, 0.134191221777339997,
109 0.137153017440313080, 0.140180184246293943, 0.143274165031597039, 0.146436434478035005,
110 0.149668499815795553, 0.152971901541831212, 0.156348214154105547, 0.159799046902044661,
111 0.163326044553552957, 0.166930888178957210, 0.170615295952254331, 0.174381023970043153,
112 0.178229867088531585, 0.182163659779017467, 0.186184277002251486, 0.190293635102098180,
113 0.194493692718921724, 0.198786451723130919, 0.203173958169329677, 0.207658303271526207,
114 0.212241624399866963, 0.216926106099369798, 0.221713981131142046, 0.226607531536579865,
115 0.231609089725056033, 0.236721039585614190, 0.241945817623200610, 0.247285914119973582,
116 0.252743874322244710, 0.258322299653617804, 0.264023848954903828, 0.269851239751401739,
117 0.275807249548151001, 0.281894717153771790, 0.288116544033524102, 0.294475695692230921,
118 0.300975203087725074, 0.307618164075491973, 0.314407744885198681, 0.321347181629811129,
119 0.328439781848020751, 0.335688926080714045, 0.343098069482237422, 0.350670743467224599,
120 0.358410557393772644, 0.366321200283767356, 0.374406442581179333, 0.382670137949167655,
121 0.391116225106848792, 0.399748729706605410, 0.408571766252830038, 0.417589540063018294,
122 0.426806349272146446, 0.436226586881288292, 0.445854742851448105, 0.455695406243607215,
123 0.465753267406005200, 0.476033120209697069, 0.486539864333452310, 0.497278507599085373,
124 0.508254168358330150, 0.519472077932396359, 0.530937583105370092, 0.542656148672647887,
125 0.554633360045617918, 0.566874925913830707, 0.579386680965928047, 0.592174588670625557,
126 0.605244744119077360, 0.618603376929974136, 0.632256854218762432, 0.646211683632397893,
127 0.660474516451080240, 0.675052150758448599, 0.689951534681746304, 0.705179769703502823,
128 0.720744114046307338, 0.736651986132290215, 0.752910968118960744, 0.769528809513084777,
129 0.786513430864326790, 0.803872927540415394, 0.821615573585632974, 0.839749825664467098,
130 0.858284327092304622, 0.877227911955088646, 0.896589609319902503, 0.916378647538487301,
131 0.936604458645744820, 0.957276682855321193, 0.978405173154415220, 1.000000000000000000
132 };
133
134 double bend_fine[256] = {
102 const double bend_fine[256] = {
135103 1, 1.0002256593050698, 1.0004513695322617, 1.0006771306930664,
136104 1.0009029427989777, 1.0011288058614922, 1.0013547198921082, 1.0015806849023274,
137105 1.0018067009036538, 1.002032767907594, 1.0022588859256572, 1.0024850549693551,
198166 1.0585073227945128, 1.0587461848213857, 1.058985100749698, 1.0592240705916123
199167 };
200168
201 double bend_coarse[128] = {
169 const double bend_coarse[128] = {
202170 1, 1.0594630943592953, 1.122462048309373, 1.189207115002721,
203171 1.2599210498948732, 1.3348398541700344, 1.4142135623730951, 1.4983070768766815,
204172 1.5874010519681994, 1.681792830507429, 1.7817974362806785, 1.8877486253633868,
232200 1024, 1084.8902086239189, 1149.4011374687975, 1217.7480857627863,
233201 1290.1591550923506, 1366.8760106701147, 1448.1546878700494, 1534.2664467217226
234202 };
235
236 #ifdef LOOKUP_SINE
237 static double sine_table[257]=
238 {
239 0, 0.0061358846491544753, 0.012271538285719925, 0.01840672990580482,
240 0.024541228522912288, 0.030674803176636626, 0.036807222941358832, 0.04293825693494082,
241 0.049067674327418015, 0.055195244349689934, 0.061320736302208578, 0.067443919563664051,
242 0.073564563599667426, 0.079682437971430126, 0.085797312344439894, 0.091908956497132724,
243 0.098017140329560604, 0.10412163387205459, 0.11022220729388306, 0.11631863091190475,
244 0.1224106751992162, 0.12849811079379317, 0.13458070850712617, 0.14065823933284921,
245 0.14673047445536175, 0.15279718525844344, 0.15885814333386145, 0.16491312048996989,
246 0.17096188876030122, 0.17700422041214875, 0.18303988795514095, 0.18906866414980619,
247 0.19509032201612825, 0.2011046348420919, 0.20711137619221856, 0.21311031991609136,
248 0.2191012401568698, 0.22508391135979283, 0.23105810828067111, 0.2370236059943672,
249 0.24298017990326387, 0.24892760574572015, 0.25486565960451457, 0.26079411791527551,
250 0.26671275747489837, 0.27262135544994898, 0.27851968938505306, 0.28440753721127188,
251 0.29028467725446233, 0.29615088824362379, 0.30200594931922808, 0.30784964004153487,
252 0.31368174039889152, 0.31950203081601569, 0.32531029216226293, 0.33110630575987643,
253 0.33688985339222005, 0.34266071731199438, 0.34841868024943456, 0.35416352542049034,
254 0.35989503653498811, 0.36561299780477385, 0.37131719395183754, 0.37700741021641826,
255 0.38268343236508978, 0.38834504669882625, 0.3939920400610481, 0.39962419984564679,
256 0.40524131400498986, 0.41084317105790391, 0.41642956009763715, 0.42200027079979968,
257 0.42755509343028208, 0.43309381885315196, 0.43861623853852766, 0.4441221445704292,
258 0.44961132965460654, 0.45508358712634384, 0.46053871095824001, 0.46597649576796618,
259 0.47139673682599764, 0.47679923006332209, 0.48218377207912272, 0.487550160148436,
260 0.49289819222978404, 0.49822766697278187, 0.50353838372571758, 0.50883014254310699,
261 0.51410274419322166, 0.51935599016558964, 0.52458968267846895, 0.52980362468629461,
262 0.53499761988709715, 0.54017147272989285, 0.54532498842204646, 0.55045797293660481,
263 0.55557023301960218, 0.56066157619733603, 0.56573181078361312, 0.57078074588696726,
264 0.57580819141784534, 0.58081395809576453, 0.58579785745643886, 0.59075970185887416,
265 0.59569930449243336, 0.60061647938386897, 0.60551104140432555, 0.61038280627630948,
266 0.61523159058062682, 0.6200572117632891, 0.62485948814238634, 0.62963823891492698,
267 0.63439328416364549, 0.63912444486377573, 0.64383154288979139, 0.64851440102211244,
268 0.65317284295377676, 0.65780669329707864, 0.66241577759017178, 0.66699992230363747,
269 0.67155895484701833, 0.67609270357531592, 0.68060099779545302, 0.68508366777270036,
270 0.68954054473706683, 0.693971460889654, 0.69837624940897292, 0.7027547444572253,
271 0.70710678118654746, 0.71143219574521643, 0.71573082528381859, 0.72000250796138165,
272 0.72424708295146689, 0.7284643904482252, 0.73265427167241282, 0.73681656887736979,
273 0.74095112535495911, 0.74505778544146595, 0.74913639452345926, 0.75318679904361241,
274 0.75720884650648446, 0.76120238548426178, 0.76516726562245896, 0.76910333764557959,
275 0.77301045336273699, 0.77688846567323244, 0.78073722857209438, 0.78455659715557524,
276 0.78834642762660623, 0.79210657730021239, 0.79583690460888346, 0.79953726910790501,
277 0.80320753148064483, 0.80684755354379922, 0.81045719825259477, 0.8140363297059483,
278 0.81758481315158371, 0.82110251499110465, 0.82458930278502529, 0.8280450452577558,
279 0.83146961230254524, 0.83486287498638001, 0.83822470555483797, 0.84155497743689833,
280 0.84485356524970701, 0.84812034480329712, 0.8513551931052652, 0.85455798836540053,
281 0.85772861000027212, 0.86086693863776731, 0.8639728561215867, 0.86704624551569265,
282 0.87008699110871135, 0.87309497841829009, 0.8760700941954066, 0.87901222642863341,
283 0.88192126434835494, 0.88479709843093779, 0.88763962040285393, 0.89044872324475788,
284 0.89322430119551532, 0.89596624975618511, 0.89867446569395382, 0.90134884704602203,
285 0.90398929312344334, 0.90659570451491533, 0.90916798309052227, 0.91170603200542988,
286 0.91420975570353069, 0.9166790599210427, 0.91911385169005777, 0.9215140393420419,
287 0.92387953251128674, 0.92621024213831127, 0.92850608047321548, 0.93076696107898371,
288 0.93299279883473885, 0.9351835099389475, 0.93733901191257496, 0.93945922360218992,
289 0.94154406518302081, 0.94359345816196039, 0.94560732538052128, 0.94758559101774109,
290 0.94952818059303667, 0.95143502096900834, 0.95330604035419375, 0.95514116830577067,
291 0.95694033573220894, 0.9587034748958716, 0.96043051941556579, 0.96212140426904158,
292 0.96377606579543984, 0.9653944416976894, 0.96697647104485207, 0.96852209427441727,
293 0.97003125319454397, 0.97150389098625178, 0.97293995220556007, 0.97433938278557586,
294 0.97570213003852857, 0.97702814265775439, 0.97831737071962765, 0.97956976568544052,
295 0.98078528040323043, 0.98196386910955524, 0.98310548743121629, 0.98421009238692903,
296 0.98527764238894122, 0.98630809724459867, 0.98730141815785843, 0.98825756773074946,
297 0.98917650996478101, 0.99005821026229712, 0.99090263542778001, 0.99170975366909953,
298 0.99247953459870997, 0.9932119492347945, 0.99390697000235606, 0.99456457073425542,
299 0.99518472667219682, 0.99576741446765982, 0.996312612182778, 0.99682029929116567,
300 0.99729045667869021, 0.99772306664419164, 0.99811811290014918, 0.99847558057329477,
301 0.99879545620517241, 0.99907772775264536, 0.99932238458834954, 0.99952941750109314,
302 0.99969881869620425, 0.9998305817958234, 0.9999247018391445, 0.99998117528260111,
303 1
304 };
305
306 /*
307 looks up sin(2 * Pi * x / 1024)
308 */
309 FLOAT_T sine(int x)
310 {
311 int xx = x & 0xFF;
312 switch ((x>>8) & 0x03)
313 {
314 default: /* just to shut gcc up. */
315 case 0:
316 return sine_table[xx];
317 case 1:
318 return sine_table[0x100 - xx];
319 case 2:
320 return -sine_table[xx];
321 case 3:
322 return -sine_table[0x100 - xx];
323 }
324 }
325 #endif /* LOOKUP_SINE */
326
327 #ifdef LOOKUP_HACK
328 int16 _u2l[] =
329 {
330 -32256, -31228, -30200, -29172, -28143, -27115, -26087, -25059,
331 -24031, -23002, -21974, -20946, -19918, -18889, -17861, -16833,
332 -16062, -15548, -15033, -14519, -14005, -13491, -12977, -12463,
333 -11949, -11435, -10920, -10406, -9892, -9378, -8864, -8350,
334 -7964, -7707, -7450, -7193, -6936, -6679, -6422, -6165,
335 -5908, -5651, -5394, -5137, -4880, -4623, -4365, -4108,
336 -3916, -3787, -3659, -3530, -3402, -3273, -3144, -3016,
337 -2887, -2759, -2630, -2502, -2373, -2245, -2116, -1988,
338 -1891, -1827, -1763, -1698, -1634, -1570, -1506, -1441,
339 -1377, -1313, -1249, -1184, -1120, -1056, -992, -927,
340 -879, -847, -815, -783, -751, -718, -686, -654,
341 -622, -590, -558, -526, -494, -461, -429, -397,
342 -373, -357, -341, -325, -309, -293, -277, -261,
343 -245, -228, -212, -196, -180, -164, -148, -132,
344 -120, -112, -104, -96, -88, -80, -72, -64,
345 -56, -48, -40, -32, -24, -16, -8, 0,
346 32256, 31228, 30200, 29172, 28143, 27115, 26087, 25059,
347 24031, 23002, 21974, 20946, 19918, 18889, 17861, 16833,
348 16062, 15548, 15033, 14519, 14005, 13491, 12977, 12463,
349 11949, 11435, 10920, 10406, 9892, 9378, 8864, 8350,
350 7964, 7707, 7450, 7193, 6936, 6679, 6422, 6165,
351 5908, 5651, 5394, 5137, 4880, 4623, 4365, 4108,
352 3916, 3787, 3659, 3530, 3402, 3273, 3144, 3016,
353 2887, 2759, 2630, 2502, 2373, 2245, 2116, 1988,
354 1891, 1827, 1763, 1698, 1634, 1570, 1506, 1441,
355 1377, 1313, 1249, 1184, 1120, 1056, 992, 927,
356 879, 847, 815, 783, 751, 718, 686, 654,
357 622, 590, 558, 526, 494, 461, 429, 397,
358 373, 357, 341, 325, 309, 293, 277, 261,
359 245, 228, 212, 196, 180, 164, 148, 132,
360 120, 112, 104, 96, 88, 80, 72, 64,
361 56, 48, 40, 32, 24, 16, 8, 0
362 };
363
364 int32 *mixup;
365 #ifdef LOOKUP_INTERPOLATION
366 int8 *iplookup;
367 #endif
368
369 #endif
370
371 void init_tables(void)
372 {
373 #ifdef LOOKUP_HACK
374 int i,j,v;
375 mixup=safe_malloc(1<<(7+8+2)); /* Give your cache a workout! */
376
377 for (i=0; i<128; i++)
378 {
379 v=_u2l[255-i];
380 for (j=-128; j<128; j++)
381 {
382 mixup[ ((i & 0x7F)<<8) | (j & 0xFF)] =
383 (v * j) << MIXUP_SHIFT;
384 }
385 }
386
387 #ifdef LOOKUP_INTERPOLATION
388 iplookup=safe_malloc(1<<(9+5));
389 for (i=-256; i<256; i++)
390 for(j=0; j<32; j++)
391 iplookup[((i<<5) & 0x3FE0) | j] = (i * j)>>5;
392 /* I don't know. Quantum bits? Magick? */
393 #endif
394
395 #endif
396 }
397
398 uint8 _l2u_[] =
399 {
400 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
401 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
402 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
403 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
404 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
405 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
406 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
407 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
408 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
409 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
410 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
411 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
412 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
413 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
414 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
415 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
416 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
417 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
418 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
419 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
420 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
421 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
422 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
423 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
424 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
425 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
426 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
427 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
428 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
429 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
430 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
431 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
432 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
433 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
434 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
435 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
436 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
437 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
438 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
439 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
440 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
441 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
442 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
443 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
444 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
445 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
446 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
447 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
448 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
449 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
450 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
451 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
452 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
453 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
454 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
455 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
456 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
457 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
458 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
459 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
460 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
461 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
462 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
463 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
464 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
465 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
466 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
467 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
468 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
469 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
470 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
471 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
472 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
473 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
474 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
475 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
476 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
477 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
478 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
479 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
480 0x09, 0x09, 0x09, 0x09, 0x09, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
481 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
482 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
483 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
484 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
485 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
486 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
487 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
488 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B,
489 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B,
490 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B,
491 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B,
492 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B,
493 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B,
494 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B,
495 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B,
496 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
497 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
498 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
499 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
500 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
501 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
502 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
503 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
504 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D,
505 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D,
506 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D,
507 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D,
508 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D,
509 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D,
510 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D,
511 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D,
512 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E,
513 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E,
514 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E,
515 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E,
516 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E,
517 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E,
518 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E,
519 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E,
520 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
521 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
522 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
523 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
524 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
525 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
526 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
527 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
528 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
529 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
530 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
531 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
532 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
533 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
534 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
535 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
536 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
537 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
538 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
539 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
540 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13,
541 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13,
542 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13,
543 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13,
544 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14,
545 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14,
546 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14,
547 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14,
548 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
549 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
550 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
551 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
552 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16,
553 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16,
554 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16,
555 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16,
556 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
557 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
558 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
559 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
560 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
561 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
562 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
563 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
564 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19, 0x19,
565 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19,
566 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19,
567 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19,
568 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
569 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
570 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
571 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
572 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B,
573 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B,
574 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B,
575 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B,
576 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C,
577 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C,
578 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C,
579 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C,
580 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
581 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D,
582 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D,
583 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D,
584 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1E, 0x1E, 0x1E, 0x1E,
585 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E,
586 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E,
587 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E,
588 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
589 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
590 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
591 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
592 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x20, 0x20, 0x20, 0x20,
593 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
594 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x21, 0x21,
595 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21,
596 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x22, 0x22, 0x22,
597 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
598 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x23, 0x23, 0x23,
599 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23,
600 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x24, 0x24, 0x24,
601 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24,
602 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x25, 0x25, 0x25,
603 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
604 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x26, 0x26, 0x26,
605 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,
606 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x27, 0x27, 0x27,
607 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27,
608 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x28, 0x28,
609 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28,
610 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x29, 0x29,
611 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29,
612 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x2A, 0x2A,
613 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A,
614 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x2B, 0x2B,
615 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
616 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2C, 0x2C,
617 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C,
618 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2D, 0x2D,
619 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D,
620 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2E, 0x2E,
621 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E,
622 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2F, 0x2F,
623 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F,
624 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x30,
625 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31,
626 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32,
627 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x33,
628 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x34,
629 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x35,
630 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x36,
631 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37,
632 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x38,
633 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x39,
634 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x3A,
635 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3B,
636 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3C,
637 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3D,
638 0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0x3D,
639 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E,
640 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
641 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
642 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43,
643 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45,
644 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x47, 0x47, 0x47, 0x47, 0x47, 0x47, 0x47, 0x47,
645 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49,
646 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B,
647 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D,
648 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F,
649 0x50, 0x50, 0x50, 0x50, 0x51, 0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x52, 0x53, 0x53, 0x53, 0x53,
650 0x54, 0x54, 0x54, 0x54, 0x55, 0x55, 0x55, 0x55, 0x56, 0x56, 0x56, 0x56, 0x57, 0x57, 0x57, 0x57,
651 0x58, 0x58, 0x58, 0x58, 0x59, 0x59, 0x59, 0x59, 0x5A, 0x5A, 0x5A, 0x5A, 0x5B, 0x5B, 0x5B, 0x5B,
652 0x5C, 0x5C, 0x5C, 0x5C, 0x5D, 0x5D, 0x5D, 0x5D, 0x5E, 0x5E, 0x5E, 0x5E, 0x5F, 0x5F, 0x5F, 0x5F,
653 0x60, 0x60, 0x61, 0x61, 0x62, 0x62, 0x63, 0x63, 0x64, 0x64, 0x65, 0x65, 0x66, 0x66, 0x67, 0x67,
654 0x68, 0x68, 0x68, 0x69, 0x69, 0x6A, 0x6A, 0x6B, 0x6B, 0x6C, 0x6C, 0x6D, 0x6D, 0x6E, 0x6E, 0x6F,
655 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E,
656 0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8, 0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xF0,
657 0xEF, 0xEF, 0xEE, 0xEE, 0xED, 0xED, 0xEC, 0xEC, 0xEB, 0xEB, 0xEA, 0xEA, 0xE9, 0xE9, 0xE8, 0xE8,
658 0xE7, 0xE7, 0xE6, 0xE6, 0xE5, 0xE5, 0xE4, 0xE4, 0xE3, 0xE3, 0xE2, 0xE2, 0xE1, 0xE1, 0xE0, 0xE0,
659 0xDF, 0xDF, 0xDF, 0xDF, 0xDE, 0xDE, 0xDE, 0xDE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDC, 0xDC, 0xDC, 0xDC,
660 0xDB, 0xDB, 0xDB, 0xDB, 0xDA, 0xDA, 0xDA, 0xDA, 0xD9, 0xD9, 0xD9, 0xD9, 0xD8, 0xD8, 0xD8, 0xD8,
661 0xD7, 0xD7, 0xD7, 0xD7, 0xD6, 0xD6, 0xD6, 0xD6, 0xD5, 0xD5, 0xD5, 0xD5, 0xD4, 0xD4, 0xD4, 0xD4,
662 0xD3, 0xD3, 0xD3, 0xD3, 0xD2, 0xD2, 0xD2, 0xD2, 0xD1, 0xD1, 0xD1, 0xD1, 0xD0, 0xD0, 0xD0, 0xD0,
663 0xCF, 0xCF, 0xCF, 0xCF, 0xCF, 0xCF, 0xCF, 0xCF, 0xCE, 0xCE, 0xCE, 0xCE, 0xCE, 0xCE, 0xCE, 0xCE,
664 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,
665 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA,
666 0xC9, 0xC9, 0xC9, 0xC9, 0xC9, 0xC9, 0xC9, 0xC9, 0xC8, 0xC8, 0xC8, 0xC8, 0xC8, 0xC8, 0xC8, 0xC8,
667 0xC7, 0xC7, 0xC7, 0xC7, 0xC7, 0xC7, 0xC7, 0xC7, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
668 0xC5, 0xC5, 0xC5, 0xC5, 0xC5, 0xC5, 0xC5, 0xC5, 0xC4, 0xC4, 0xC4, 0xC4, 0xC4, 0xC4, 0xC4, 0xC4,
669 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC2, 0xC2, 0xC2, 0xC2, 0xC2, 0xC2, 0xC2,
670 0xC2, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0,
671 0xC0, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF,
672 0xBF, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE,
673 0xBE, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD,
674 0xBD, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC,
675 0xBC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB,
676 0xBB, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA,
677 0xBA, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9,
678 0xB9, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8,
679 0xB8, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7,
680 0xB7, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6,
681 0xB6, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5,
682 0xB5, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4,
683 0xB4, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3,
684 0xB3, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2,
685 0xB2, 0xB2, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1,
686 0xB1, 0xB1, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0,
687 0xB0, 0xB0, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF,
688 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF,
689 0xAF, 0xAF, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE,
690 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE,
691 0xAE, 0xAE, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD,
692 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD,
693 0xAD, 0xAD, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC,
694 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC,
695 0xAC, 0xAC, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB,
696 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB,
697 0xAB, 0xAB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
698 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
699 0xAA, 0xAA, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9,
700 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9,
701 0xA9, 0xA9, 0xA9, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8,
702 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8,
703 0xA8, 0xA8, 0xA8, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7,
704 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7,
705 0xA7, 0xA7, 0xA7, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6,
706 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6,
707 0xA6, 0xA6, 0xA6, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5,
708 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5,
709 0xA5, 0xA5, 0xA5, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4,
710 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4,
711 0xA4, 0xA4, 0xA4, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3,
712 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3,
713 0xA3, 0xA3, 0xA3, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2,
714 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2,
715 0xA2, 0xA2, 0xA2, 0xA2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1,
716 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1,
717 0xA1, 0xA1, 0xA1, 0xA1, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0,
718 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0,
719 0xA0, 0xA0, 0xA0, 0xA0, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F,
720 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F,
721 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F,
722 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F,
723 0x9F, 0x9F, 0x9F, 0x9F, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E,
724 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E,
725 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E,
726 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E,
727 0x9E, 0x9E, 0x9E, 0x9E, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D,
728 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D,
729 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D,
730 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D,
731 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C,
732 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C,
733 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C,
734 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9C,
735 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B,
736 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B,
737 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B,
738 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B,
739 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A,
740 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A,
741 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A,
742 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x9A,
743 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99,
744 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99,
745 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99,
746 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99,
747 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98,
748 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98,
749 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98,
750 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98,
751 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97,
752 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97,
753 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97,
754 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97,
755 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96,
756 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96,
757 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96,
758 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96,
759 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95,
760 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95,
761 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95,
762 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95,
763 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94,
764 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94,
765 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94,
766 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94,
767 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93,
768 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93,
769 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93,
770 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93,
771 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92,
772 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92,
773 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92,
774 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92,
775 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
776 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
777 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
778 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
779 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
780 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
781 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
782 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
783 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F,
784 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F,
785 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F,
786 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F,
787 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F,
788 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F,
789 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F,
790 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F,
791 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E,
792 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E,
793 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E,
794 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E,
795 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E,
796 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E,
797 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E,
798 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E,
799 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D,
800 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D,
801 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D,
802 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D,
803 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D,
804 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D,
805 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D,
806 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D,
807 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C,
808 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C,
809 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C,
810 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C,
811 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C,
812 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C,
813 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C,
814 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C,
815 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B,
816 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B,
817 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B,
818 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B,
819 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B,
820 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B,
821 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B,
822 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B,
823 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A,
824 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A,
825 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A,
826 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A,
827 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A,
828 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A,
829 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A,
830 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A,
831 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x89, 0x89, 0x89, 0x89, 0x89,
832 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89,
833 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89,
834 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89,
835 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89,
836 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89,
837 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89,
838 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89,
839 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x88, 0x88, 0x88, 0x88,
840 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
841 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
842 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
843 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
844 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
845 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
846 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
847 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x87, 0x87, 0x87,
848 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87,
849 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87,
850 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87,
851 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87,
852 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87,
853 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87,
854 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87,
855 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x86, 0x86, 0x86,
856 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86,
857 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86,
858 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86,
859 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86,
860 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86,
861 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86,
862 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86,
863 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x85, 0x85, 0x85,
864 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
865 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
866 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
867 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
868 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
869 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
870 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
871 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x84, 0x84,
872 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84,
873 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84,
874 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84,
875 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84,
876 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84,
877 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84,
878 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84,
879 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x83, 0x83,
880 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
881 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
882 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
883 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
884 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
885 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
886 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
887 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x82,
888 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
889 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
890 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
891 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
892 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
893 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
894 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
895 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x81,
896 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
897 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
898 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
899 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
900 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
901 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
902 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
903 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
904 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
905 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
906 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
907 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
908 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
909 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
910 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
911 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
912 };
913
914 uint8 *_l2u = _l2u_ + 4096;
915
916
917 /* $Id$ Greg Lee */
918 int xmap[XMAPMAX][5] = {
919 { SFXBANK, 0, 0, 120, 0 },
920 { SFXBANK, 0, 1, 120, 1 },
921 { SFXBANK, 0, 2, 120, 2 },
922 { SFXBANK, 0, 3, 120, 3 },
923 { SFXBANK, 0, 4, 120, 4 },
924 { SFXBANK, 0, 5, 120, 5 },
925 { SFXBANK, 0, 16, 120, 16 },
926 { SFXBANK, 0, 32, 120, 32 },
927 { SFXBANK, 0, 33, 120, 33 },
928 { SFXBANK, 0, 34, 120, 34 },
929 { SFXBANK, 0, 35, 120, 35 },
930 { SFXBANK, 0, 36, 120, 36 },
931 { SFXBANK, 0, 48, 120, 48 },
932 { SFXBANK, 0, 49, 120, 49 },
933 { SFXBANK, 0, 50, 120, 50 },
934 { SFXBANK, 0, 51, 120, 51 },
935 { SFXBANK, 0, 52, 120, 52 },
936 { SFXBANK, 0, 54, 120, 54 },
937 { SFXBANK, 0, 55, 120, 55 },
938 { SFXBANK, 0, 64, 120, 64 },
939 { SFXBANK, 0, 65, 120, 65 },
940 { SFXBANK, 0, 66, 120, 66 },
941 { SFXBANK, 0, 67, 120, 67 },
942 { SFXBANK, 0, 68, 120, 68 },
943 { SFXBANK, 0, 69, 120, 69 },
944 { SFXBANK, 0, 70, 120, 70 },
945 { SFXBANK, 0, 80, 120, 80 },
946 { SFXBANK, 0, 81, 120, 81 },
947 { SFXBANK, 0, 82, 120, 82 },
948 { SFXBANK, 0, 83, 120, 83 },
949 { SFXBANK, 0, 84, 120, 84 },
950 { SFXBANK, 0, 85, 120, 85 },
951 { SFXBANK, 0, 86, 120, 86 },
952 { SFXBANK, 0, 87, 120, 87 },
953 { SFXBANK, 0, 88, 120, 88 },
954 { SFXBANK, 0, 89, 120, 89 },
955 { SFXBANK, 0, 90, 120, 90 },
956 { SFXBANK, 0, 96, 120, 96 },
957 { SFXBANK, 0, 97, 120, 97 },
958 { SFXBANK, 0, 98, 120, 98 },
959 { SFXBANK, 0, 99, 120, 99 },
960 { SFXBANK, 0, 100, 120, 100 },
961 { SFXBANK, 0, 101, 120, 101 },
962 { SFXBANK, 0, 112, 120, 112 },
963 { SFXBANK, 0, 113, 120, 113 },
964 { SFXBANK, 0, 114, 120, 114 },
965 { SFXBANK, 0, 115, 120, 115 },
966 { SFXDRUM1, 0, 36, 121, 36 },
967 { SFXDRUM1, 0, 37, 121, 37 },
968 { SFXDRUM1, 0, 38, 121, 38 },
969 { SFXDRUM1, 0, 39, 121, 39 },
970 { SFXDRUM1, 0, 40, 121, 40 },
971 { SFXDRUM1, 0, 41, 121, 41 },
972 { SFXDRUM1, 0, 52, 121, 52 },
973 { SFXDRUM1, 0, 68, 121, 68 },
974 { SFXDRUM1, 0, 69, 121, 69 },
975 { SFXDRUM1, 0, 70, 121, 70 },
976 { SFXDRUM1, 0, 71, 121, 71 },
977 { SFXDRUM1, 0, 72, 121, 72 },
978 { SFXDRUM1, 0, 84, 121, 84 },
979 { SFXDRUM1, 0, 85, 121, 85 },
980 { SFXDRUM1, 0, 86, 121, 86 },
981 { SFXDRUM1, 0, 87, 121, 87 },
982 { SFXDRUM1, 0, 88, 121, 88 },
983 { SFXDRUM1, 0, 90, 121, 90 },
984 { SFXDRUM1, 0, 91, 121, 91 },
985 { SFXDRUM1, 1, 36, 122, 36 },
986 { SFXDRUM1, 1, 37, 122, 37 },
987 { SFXDRUM1, 1, 38, 122, 38 },
988 { SFXDRUM1, 1, 39, 122, 39 },
989 { SFXDRUM1, 1, 40, 122, 40 },
990 { SFXDRUM1, 1, 41, 122, 41 },
991 { SFXDRUM1, 1, 42, 122, 42 },
992 { SFXDRUM1, 1, 52, 122, 52 },
993 { SFXDRUM1, 1, 53, 122, 53 },
994 { SFXDRUM1, 1, 54, 122, 54 },
995 { SFXDRUM1, 1, 55, 122, 55 },
996 { SFXDRUM1, 1, 56, 122, 56 },
997 { SFXDRUM1, 1, 57, 122, 57 },
998 { SFXDRUM1, 1, 58, 122, 58 },
999 { SFXDRUM1, 1, 59, 122, 59 },
1000 { SFXDRUM1, 1, 60, 122, 60 },
1001 { SFXDRUM1, 1, 61, 122, 61 },
1002 { SFXDRUM1, 1, 62, 122, 62 },
1003 { SFXDRUM1, 1, 68, 122, 68 },
1004 { SFXDRUM1, 1, 69, 122, 69 },
1005 { SFXDRUM1, 1, 70, 122, 70 },
1006 { SFXDRUM1, 1, 71, 122, 71 },
1007 { SFXDRUM1, 1, 72, 122, 72 },
1008 { SFXDRUM1, 1, 73, 122, 73 },
1009 { SFXDRUM1, 1, 84, 122, 84 },
1010 { SFXDRUM1, 1, 85, 122, 85 },
1011 { SFXDRUM1, 1, 86, 122, 86 },
1012 { SFXDRUM1, 1, 87, 122, 87 },
1013 { XGDRUM, 0, 25, 40, 38 },
1014 { XGDRUM, 0, 26, 40, 40 },
1015 { XGDRUM, 0, 27, 40, 39 },
1016 { XGDRUM, 0, 28, 40, 30 },
1017 { XGDRUM, 0, 29, 0, 25 },
1018 { XGDRUM, 0, 30, 0, 85 },
1019 { XGDRUM, 0, 31, 0, 38 },
1020 { XGDRUM, 0, 32, 0, 37 },
1021 { XGDRUM, 0, 33, 0, 36 },
1022 { XGDRUM, 0, 34, 0, 38 },
1023 { XGDRUM, 0, 62, 0, 101 },
1024 { XGDRUM, 0, 63, 0, 102 },
1025 { XGDRUM, 0, 64, 0, 103 },
1026 { XGDRUM, 8, 25, 40, 38 },
1027 { XGDRUM, 8, 26, 40, 40 },
1028 { XGDRUM, 8, 27, 40, 39 },
1029 { XGDRUM, 8, 28, 40, 40 },
1030 { XGDRUM, 8, 29, 8, 25 },
1031 { XGDRUM, 8, 30, 8, 85 },
1032 { XGDRUM, 8, 31, 8, 38 },
1033 { XGDRUM, 8, 32, 8, 37 },
1034 { XGDRUM, 8, 33, 8, 36 },
1035 { XGDRUM, 8, 34, 8, 38 },
1036 { XGDRUM, 8, 62, 8, 101 },
1037 { XGDRUM, 8, 63, 8, 102 },
1038 { XGDRUM, 8, 64, 8, 103 },
1039 { XGDRUM, 16, 25, 40, 38 },
1040 { XGDRUM, 16, 26, 40, 40 },
1041 { XGDRUM, 16, 27, 40, 39 },
1042 { XGDRUM, 16, 28, 40, 40 },
1043 { XGDRUM, 16, 29, 16, 25 },
1044 { XGDRUM, 16, 30, 16, 85 },
1045 { XGDRUM, 16, 31, 16, 38 },
1046 { XGDRUM, 16, 32, 16, 37 },
1047 { XGDRUM, 16, 33, 16, 36 },
1048 { XGDRUM, 16, 34, 16, 38 },
1049 { XGDRUM, 16, 62, 16, 101 },
1050 { XGDRUM, 16, 63, 16, 102 },
1051 { XGDRUM, 16, 64, 16, 103 },
1052 { XGDRUM, 24, 25, 40, 38 },
1053 { XGDRUM, 24, 26, 40, 40 },
1054 { XGDRUM, 24, 27, 40, 39 },
1055 { XGDRUM, 24, 28, 24, 100 },
1056 { XGDRUM, 24, 29, 24, 25 },
1057 { XGDRUM, 24, 30, 24, 15 },
1058 { XGDRUM, 24, 31, 24, 38 },
1059 { XGDRUM, 24, 32, 24, 37 },
1060 { XGDRUM, 24, 33, 24, 36 },
1061 { XGDRUM, 24, 34, 24, 38 },
1062 { XGDRUM, 24, 62, 24, 101 },
1063 { XGDRUM, 24, 63, 24, 102 },
1064 { XGDRUM, 24, 64, 24, 103 },
1065 { XGDRUM, 24, 78, 0, 17 },
1066 { XGDRUM, 24, 79, 0, 18 },
1067 { XGDRUM, 25, 25, 40, 38 },
1068 { XGDRUM, 25, 26, 40, 40 },
1069 { XGDRUM, 25, 27, 40, 39 },
1070 { XGDRUM, 25, 28, 25, 100 },
1071 { XGDRUM, 25, 29, 25, 25 },
1072 { XGDRUM, 25, 30, 25, 15 },
1073 { XGDRUM, 25, 31, 25, 38 },
1074 { XGDRUM, 25, 32, 25, 37 },
1075 { XGDRUM, 25, 33, 25, 36 },
1076 { XGDRUM, 25, 34, 25, 38 },
1077 { XGDRUM, 25, 78, 0, 17 },
1078 { XGDRUM, 25, 79, 0, 18 },
1079 { XGDRUM, 32, 25, 40, 38 },
1080 { XGDRUM, 32, 26, 40, 40 },
1081 { XGDRUM, 32, 27, 40, 39 },
1082 { XGDRUM, 32, 28, 40, 40 },
1083 { XGDRUM, 32, 29, 32, 25 },
1084 { XGDRUM, 32, 30, 32, 85 },
1085 { XGDRUM, 32, 31, 32, 38 },
1086 { XGDRUM, 32, 32, 32, 37 },
1087 { XGDRUM, 32, 33, 32, 36 },
1088 { XGDRUM, 32, 34, 32, 38 },
1089 { XGDRUM, 32, 62, 32, 101 },
1090 { XGDRUM, 32, 63, 32, 102 },
1091 { XGDRUM, 32, 64, 32, 103 },
1092 { XGDRUM, 40, 25, 40, 38 },
1093 { XGDRUM, 40, 26, 40, 40 },
1094 { XGDRUM, 40, 27, 40, 39 },
1095 { XGDRUM, 40, 28, 40, 40 },
1096 { XGDRUM, 40, 29, 40, 25 },
1097 { XGDRUM, 40, 30, 40, 85 },
1098 { XGDRUM, 40, 31, 40, 39 },
1099 { XGDRUM, 40, 32, 40, 37 },
1100 { XGDRUM, 40, 33, 40, 36 },
1101 { XGDRUM, 40, 34, 40, 38 },
1102 { XGDRUM, 40, 38, 40, 39 },
1103 { XGDRUM, 40, 39, 0, 39 },
1104 { XGDRUM, 40, 40, 40, 38 },
1105 { XGDRUM, 40, 42, 0, 42 },
1106 { XGDRUM, 40, 46, 0, 46 },
1107 { XGDRUM, 40, 62, 40, 101 },
1108 { XGDRUM, 40, 63, 40, 102 },
1109 { XGDRUM, 40, 64, 40, 103 },
1110 { XGDRUM, 40, 87, 40, 87 }
1111 };
0 /*
0 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
77
8 #ifdef LOOKUP_SINE
9 extern FLOAT_T sine(int x);
10 #else
8 tables.h
9 */
10
1111 #include <math.h>
1212 #define sine(x) (sin((2*PI/1024.0) * (x)))
13 #endif
1413
1514 #define SINE_CYCLE_LENGTH 1024
16 extern int32 freq_table[];
17 extern double vol_table[];
18 extern double expr_table[];
19 extern double bend_fine[];
20 extern double bend_coarse[];
21 extern uint8 *_l2u; /* 13-bit PCM to 8-bit u-law */
22 extern uint8 _l2u_[]; /* used in LOOKUP_HACK */
23 #ifdef LOOKUP_HACK
24 extern int16 _u2l[];
25 extern int32 *mixup;
26 #ifdef LOOKUP_INTERPOLATION
27 extern int8 *iplookup;
28 #endif
29 #endif
30
31 extern void init_tables(void);
32
33 #define XMAPMAX 800
34 extern int xmap[XMAPMAX][5];
35
15 extern const Sint32 freq_table[];
16 extern const double vol_table[];
17 extern const double bend_fine[];
18 extern const double bend_coarse[];
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7 */
8
9 #if HAVE_CONFIG_H
10 # include <config.h>
11 #endif
712
813 #include <stdio.h>
914 #include <stdlib.h>
1015 #include <string.h>
1116
1217 #include "SDL.h"
13 #include "config.h"
18
19 #include "timidity.h"
20
21 #include "options.h"
1422 #include "common.h"
1523 #include "instrum.h"
1624 #include "playmidi.h"
1725 #include "readmidi.h"
1826 #include "output.h"
19 #include "ctrlmode.h"
20 #include "timidity.h"
2127
2228 #include "tables.h"
2329
24 void (*s32tobuf)(void *dp, int32 *lp, int32 c);
25 int free_instruments_afterwards=0;
26 static char def_instr_name[256]="";
27
28 int AUDIO_BUFFER_SIZE;
29 resample_t *resample_buffer=NULL;
30 int32 *common_buffer=NULL;
31 int num_ochannels;
30 ToneBank *master_tonebank[MAXBANK], *master_drumset[MAXBANK];
31
32 static char def_instr_name[256] = "";
3233
3334 #define MAXWORDS 10
35
36 /* Quick-and-dirty fgets() replacement. */
37
38 static char *RWgets(SDL_RWops *rw, char *s, int size)
39 {
40 int num_read = 0;
41 char *p = s;
42
43 --size;/* so that we nul terminate properly */
44
45 for (; num_read < size; ++p)
46 {
47 if (SDL_RWread(rw, p, 1, 1) != 1)
48 break;
49
50 num_read++;
51
52 /* Unlike fgets(), don't store newline. Under Windows/DOS we'll
53 * probably get an extra blank line for every line that's being
54 * read, but that should be ok.
55 */
56 if (*p == '\n' || *p == '\r')
57 {
58 *p = '\0';
59 return s;
60 }
61 }
62
63 *p = '\0';
64
65 return (num_read != 0) ? s : NULL;
66 }
3467
3568 static int read_config_file(const char *name)
3669 {
37 FILE *fp;
38 char tmp[PATH_MAX], *w[MAXWORDS], *cp;
70 SDL_RWops *rw;
71 char tmp[1024], *w[MAXWORDS], *cp;
3972 ToneBank *bank=0;
4073 int i, j, k, line=0, words;
4174 static int rcf_count=0;
4275
4376 if (rcf_count>50)
44 {
45 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
46 "Probable source loop in configuration files");
77 {
78 SNDDBG(("Probable source loop in configuration files\n"));
4779 return (-1);
48 }
49
50 if (!(fp=open_file(name, 1, OF_VERBOSE)))
80 }
81
82 if (!(rw=open_file(name)))
5183 return -1;
5284
53 while (fgets(tmp, sizeof(tmp), fp))
85 while (RWgets(rw, tmp, sizeof(tmp)))
5486 {
5587 line++;
56 w[words=0]=strtok(tmp, " \t\r\n\240");
57 if (!w[0] || (*w[0]=='#')) continue;
58 while (w[words] && (words < (MAXWORDS-1)))
59 {
60 w[++words]=strtok(0," \t\r\n\240");
61 if (w[words] && w[words][0]=='#') break;
62 }
63 if (!strcmp(w[0], "map")) continue;
64 if (!strcmp(w[0], "dir"))
88 words=0;
89 w[0]=strtok(tmp, " \t\240");
90 if (!w[0]) continue;
91
92 /* Originally the TiMidity++ extensions were prefixed like this */
93 if (strcmp(w[0], "#extension") == 0)
94 {
95 w[0]=strtok(0, " \t\240");
96 if (!w[0]) continue;
97 }
98
99 if (*w[0] == '#')
100 continue;
101
102 while (w[words] && *w[words] != '#' && (words < (MAXWORDS-1)))
103 w[++words]=strtok(0," \t\240");
104
105 /*
106 * TiMidity++ adds a number of extensions to the config file format.
107 * Many of them are completely irrelevant to SDL_sound, but at least
108 * we shouldn't choke on them.
109 *
110 * Unfortunately the documentation for these extensions is often quite
111 * vague, gramatically strange or completely absent.
112 */
113 if (
114 !strcmp(w[0], "comm") /* "comm" program second */
115 || !strcmp(w[0], "HTTPproxy") /* "HTTPproxy" hostname:port */
116 || !strcmp(w[0], "FTPproxy") /* "FTPproxy" hostname:port */
117 || !strcmp(w[0], "mailaddr") /* "mailaddr" your-mail-address */
118 || !strcmp(w[0], "opt") /* "opt" timidity-options */
119 )
120 {
121 /*
122 * + "comm" sets some kind of comment -- the documentation is too
123 * vague for me to understand at this time.
124 * + "HTTPproxy", "FTPproxy" and "mailaddr" are for reading data
125 * over a network, rather than from the file system.
126 * + "opt" specifies default options for TiMidity++.
127 *
128 * These are all quite useless for our version of TiMidity, so
129 * they can safely remain no-ops.
130 */
131 } else if (!strcmp(w[0], "timeout")) /* "timeout" program second */
132 {
133 /*
134 * Specifies a timeout value of the program. A number of seconds
135 * before TiMidity kills the note. This may be useful to implement
136 * later, but I don't see any urgent need for it.
137 */
138 SNDDBG(("FIXME: Implement \"timeout\" in TiMidity config.\n"));
139 } else if (!strcmp(w[0], "copydrumset") /* "copydrumset" drumset */
140 || !strcmp(w[0], "copybank")) /* "copybank" bank */
141 {
142 /*
143 * Copies all the settings of the specified drumset or bank to
144 * the current drumset or bank. May be useful later, but not a
145 * high priority.
146 */
147 SNDDBG(("FIXME: Implement \"%s\" in TiMidity config.\n", w[0]));
148 } else if (!strcmp(w[0], "undef")) /* "undef" progno */
149 {
150 /*
151 * Undefines the tone "progno" of the current tone bank (or
152 * drum set?). Not a high priority.
153 */
154 SNDDBG(("FIXME: Implement \"undef\" in TiMidity config.\n"));
155 } else if (!strcmp(w[0], "altassign")) /* "altassign" prog1 prog2 ... */
156 {
157 /*
158 * Sets the alternate assign for drum set. Whatever that's
159 * supposed to mean.
160 */
161 SNDDBG(("FIXME: Implement \"altassign\" in TiMidity config.\n"));
162 } else if (!strcmp(w[0], "soundfont")
163 || !strcmp(w[0], "font"))
164 {
165 /*
166 * I can't find any documentation for these, but I guess they're
167 * an alternative way of loading/unloading instruments.
168 *
169 * "soundfont" sf_file "remove"
170 * "soundfont" sf_file ["order=" order] ["cutoff=" cutoff]
171 * ["reso=" reso] ["amp=" amp]
172 * "font" "exclude" bank preset keynote
173 * "font" "order" order bank preset keynote
174 */
175 SNDDBG(("FIXME: Implmement \"%s\" in TiMidity config.\n", w[0]));
176 } else if (!strcmp(w[0], "progbase"))
177 {
178 /*
179 * The documentation for this makes absolutely no sense to me, but
180 * apparently it sets some sort of base offset for tone numbers.
181 * Why anyone would want to do this is beyond me.
182 */
183 SNDDBG(("FIXME: Implement \"progbase\" in TiMidity config.\n"));
184 } else if (!strcmp(w[0], "map")) /* "map" name set1 elem1 set2 elem2 */
185 {
186 /*
187 * This extension is the one we will need to implement, as it is
188 * used by the "eawpats". Unfortunately I cannot find any
189 * documentation whatsoever for it, but it looks like it's used
190 * for remapping one instrument to another somehow.
191 */
192 SNDDBG(("FIXME: Implement \"map\" in TiMidity config.\n"));
193 }
194
195 /* Standard TiMidity config */
196
197 else if (!strcmp(w[0], "dir"))
65198 {
66199 if (words < 2)
67 {
68 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
69 "%s: line %d: No directory given\n", name, line);
70 close_file(fp);
71 return -2;
72 }
200 {
201 SNDDBG(("%s: line %d: No directory given\n", name, line));
202 goto fail;
203 }
73204 for (i=1; i<words; i++)
74 add_to_pathlist(w[i]);
75 }
76 else if (!strcmp(w[0], "source"))
77 {
78 if (words < 2)
79 {
80 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
81 "%s: line %d: No file name given\n", name, line);
82 close_file(fp);
83 return -2;
84 }
85 for (i=1; i<words; i++)
86 {
87 rcf_count++;
88 read_config_file(w[i]);
89 rcf_count--;
90 }
91 }
92 else if (!strcmp(w[0], "default"))
93 {
94 if (words != 2)
95 {
96 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
97 "%s: line %d: Must specify exactly one patch name\n",
98 name, line);
99 close_file(fp);
100 return -2;
101 }
102 strncpy(def_instr_name, w[1], 255);
103 def_instr_name[255]='\0';
104 }
205 add_to_pathlist(w[i]);
206 }
207 else if (!strcmp(w[0], "source"))
208 {
209 if (words < 2)
210 {
211 SNDDBG(("%s: line %d: No file name given\n", name, line));
212 goto fail;
213 }
214 for (i=1; i<words; i++)
215 {
216 int status;
217 rcf_count++;
218 status = read_config_file(w[i]);
219 rcf_count--;
220 if (status != 0) {
221 SDL_RWclose(rw);
222 return status;
223 }
224 }
225 }
226 else if (!strcmp(w[0], "default"))
227 {
228 if (words != 2)
229 {
230 SNDDBG(("%s: line %d: Must specify exactly one patch name\n",
231 name, line));
232 goto fail;
233 }
234 strncpy(def_instr_name, w[1], 255);
235 def_instr_name[255]='\0';
236 }
105237 else if (!strcmp(w[0], "drumset"))
106 {
107 if (words < 2)
108 {
109 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
110 "%s: line %d: No drum set number given\n",
111 name, line);
112 close_file(fp);
113 return -2;
114 }
115 i=atoi(w[1]);
116 if (i<0 || i>127)
117 {
118 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
119 "%s: line %d: Drum set must be between 0 and 127\n",
120 name, line);
121 close_file(fp);
122 return -2;
123 }
124 if (!drumset[i])
125 {
126 drumset[i]=safe_malloc(sizeof(ToneBank));
127 memset(drumset[i], 0, sizeof(ToneBank));
128 }
129 bank=drumset[i];
130 }
238 {
239 if (words < 2)
240 {
241 SNDDBG(("%s: line %d: No drum set number given\n", name, line));
242 goto fail;
243 }
244 i=atoi(w[1]);
245 if (i<0 || i>(MAXBANK-1))
246 {
247 SNDDBG(("%s: line %d: Drum set must be between 0 and %d\n",
248 name, line, MAXBANK-1));
249 goto fail;
250 }
251 if (!master_drumset[i])
252 {
253 master_drumset[i] = safe_malloc(sizeof(ToneBank));
254 memset(master_drumset[i], 0, sizeof(ToneBank));
255 master_drumset[i]->tone = safe_malloc(128 * sizeof(ToneBankElement));
256 memset(master_drumset[i]->tone, 0, 128 * sizeof(ToneBankElement));
257 }
258 bank=master_drumset[i];
259 }
131260 else if (!strcmp(w[0], "bank"))
132 {
133 if (words < 2)
134 {
135 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
136 "%s: line %d: No bank number given\n",
137 name, line);
138 close_file(fp);
139 return -2;
140 }
141 i=atoi(w[1]);
142 if (i<0 || i>127)
143 {
144 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
145 "%s: line %d: Tone bank must be between 0 and 127\n",
146 name, line);
147 close_file(fp);
148 return -2;
149 }
150 if (!tonebank[i])
151 {
152 tonebank[i]=safe_malloc(sizeof(ToneBank));
153 memset(tonebank[i], 0, sizeof(ToneBank));
154 }
155 bank=tonebank[i];
156 }
157 else {
158 if ((words < 2) || (*w[0] < '0' || *w[0] > '9'))
159 {
160 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
161 "%s: line %d: syntax error\n", name, line);
162 continue;
163 }
164 i=atoi(w[0]);
165 if (i<0 || i>127)
166 {
167 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
168 "%s: line %d: Program must be between 0 and 127\n",
169 name, line);
170 close_file(fp);
171 return -2;
172 }
173 if (!bank)
174 {
175 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
176 "%s: line %d: Must specify tone bank or drum set "
177 "before assignment\n",
178 name, line);
179 close_file(fp);
180 return -2;
181 }
182 if (bank->tone[i].name)
183 free(bank->tone[i].name);
184 strcpy((bank->tone[i].name=safe_malloc(strlen(w[1])+1)),w[1]);
185 bank->tone[i].note=bank->tone[i].amp=bank->tone[i].pan=
186 bank->tone[i].strip_loop=bank->tone[i].strip_envelope=
261 {
262 if (words < 2)
263 {
264 SNDDBG(("%s: line %d: No bank number given\n", name, line));
265 goto fail;
266 }
267 i=atoi(w[1]);
268 if (i<0 || i>(MAXBANK-1))
269 {
270 SNDDBG(("%s: line %d: Tone bank must be between 0 and %d\n",
271 name, line, MAXBANK-1));
272 goto fail;
273 }
274 if (!master_tonebank[i])
275 {
276 master_tonebank[i] = safe_malloc(sizeof(ToneBank));
277 memset(master_tonebank[i], 0, sizeof(ToneBank));
278 master_tonebank[i]->tone = safe_malloc(128 * sizeof(ToneBankElement));
279 memset(master_tonebank[i]->tone, 0, 128 * sizeof(ToneBankElement));
280 }
281 bank=master_tonebank[i];
282 }
283 else
284 {
285 if ((words < 2) || (*w[0] < '0' || *w[0] > '9'))
286 {
287 SNDDBG(("%s: line %d: syntax error\n", name, line));
288 continue;
289 }
290 i=atoi(w[0]);
291 if (i<0 || i>127)
292 {
293 SNDDBG(("%s: line %d: Program must be between 0 and 127\n",
294 name, line));
295 goto fail;
296 }
297 if (!bank)
298 {
299 SNDDBG(("%s: line %d: Must specify tone bank or drum set before assignment\n",
300 name, line));
301 goto fail;
302 }
303 if (bank->tone[i].name)
304 free(bank->tone[i].name);
305 strcpy((bank->tone[i].name=safe_malloc(strlen(w[1])+1)),w[1]);
306 bank->tone[i].note=bank->tone[i].amp=bank->tone[i].pan=
307 bank->tone[i].strip_loop=bank->tone[i].strip_envelope=
187308 bank->tone[i].strip_tail=-1;
188309
189 for (j=2; j<words; j++)
190 {
191 if (!(cp=strchr(w[j], '=')))
192 {
193 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: bad patch option %s\n",
194 name, line, w[j]);
195 close_file(fp);
196 return -2;
197 }
198 *cp++=0;
199 if (!strcmp(w[j], "amp"))
200 {
201 k=atoi(cp);
202 if ((k<0 || k>MAX_AMPLIFICATION) || (*cp < '0' || *cp > '9'))
203 {
204 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
205 "%s: line %d: amplification must be between "
206 "0 and %d\n", name, line, MAX_AMPLIFICATION);
207 close_file(fp);
208 return -2;
209 }
210 bank->tone[i].amp=k;
211 }
212 else if (!strcmp(w[j], "note"))
213 {
214 k=atoi(cp);
215 if ((k<0 || k>127) || (*cp < '0' || *cp > '9'))
216 {
217 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
218 "%s: line %d: note must be between 0 and 127\n",
219 name, line);
220 close_file(fp);
221 return -2;
222 }
223 bank->tone[i].note=k;
224 }
225 else if (!strcmp(w[j], "pan"))
226 {
227 if (!strcmp(cp, "center"))
228 k=64;
229 else if (!strcmp(cp, "left"))
230 k=0;
231 else if (!strcmp(cp, "right"))
232 k=127;
233 else
234 k=((atoi(cp)+100) * 100) / 157;
235 if ((k<0 || k>127) ||
236 (k==0 && *cp!='-' && (*cp < '0' || *cp > '9')))
237 {
238 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
239 "%s: line %d: panning must be left, right, "
240 "center, or between -100 and 100\n",
241 name, line);
242 close_file(fp);
243 return -2;
244 }
245 bank->tone[i].pan=k;
246 }
247 else if (!strcmp(w[j], "keep"))
248 {
249 if (!strcmp(cp, "env"))
250 bank->tone[i].strip_envelope=0;
251 else if (!strcmp(cp, "loop"))
252 bank->tone[i].strip_loop=0;
253 else
254 {
255 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
256 "%s: line %d: keep must be env or loop\n", name, line);
257 close_file(fp);
258 return -2;
259 }
260 }
261 else if (!strcmp(w[j], "strip"))
262 {
263 if (!strcmp(cp, "env"))
264 bank->tone[i].strip_envelope=1;
265 else if (!strcmp(cp, "loop"))
266 bank->tone[i].strip_loop=1;
267 else if (!strcmp(cp, "tail"))
268 bank->tone[i].strip_tail=1;
269 else
270 {
271 ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
272 "%s: line %d: strip must be env, loop, or tail\n",
273 name, line);
274 close_file(fp);
275 return -2;
276 }
277 }
278 else
279 {
280 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: bad patch option %s\n",
281 name, line, w[j]);
282 close_file(fp);
283 return -2;
284 }
285 }
286 }
287 }
288 if (ferror(fp))
289 {
290 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Can't read from %s\n", name);
291 close_file(fp);
292 return -2;
293 }
294 close_file(fp);
310 for (j=2; j<words; j++)
311 {
312 if (!(cp=strchr(w[j], '=')))
313 {
314 SNDDBG(("%s: line %d: bad patch option %s\n", name, line, w[j]));
315 goto fail;
316 }
317 *cp++=0;
318 if (!strcmp(w[j], "amp"))
319 {
320 k=atoi(cp);
321 if ((k<0 || k>MAX_AMPLIFICATION) || (*cp < '0' || *cp > '9'))
322 {
323 SNDDBG(("%s: line %d: amplification must be between 0 and %d\n",
324 name, line, MAX_AMPLIFICATION));
325 goto fail;
326 }
327 bank->tone[i].amp=k;
328 }
329 else if (!strcmp(w[j], "note"))
330 {
331 k=atoi(cp);
332 if ((k<0 || k>127) || (*cp < '0' || *cp > '9'))
333 {
334 SNDDBG(("%s: line %d: note must be between 0 and 127\n",
335 name, line));
336 goto fail;
337 }
338 bank->tone[i].note=k;
339 }
340 else if (!strcmp(w[j], "pan"))
341 {
342 if (!strcmp(cp, "center"))
343 k=64;
344 else if (!strcmp(cp, "left"))
345 k=0;
346 else if (!strcmp(cp, "right"))
347 k=127;
348 else
349 k=((atoi(cp)+100) * 100) / 157;
350 if ((k<0 || k>127) || (k==0 && *cp!='-' && (*cp < '0' || *cp > '9')))
351 {
352 SNDDBG(("%s: line %d: panning must be left, right, center, or between -100 and 100\n",
353 name, line));
354 goto fail;
355 }
356 bank->tone[i].pan=k;
357 }
358 else if (!strcmp(w[j], "keep"))
359 {
360 if (!strcmp(cp, "env"))
361 bank->tone[i].strip_envelope=0;
362 else if (!strcmp(cp, "loop"))
363 bank->tone[i].strip_loop=0;
364 else
365 {
366 SNDDBG(("%s: line %d: keep must be env or loop\n", name, line));
367 goto fail;
368 }
369 }
370 else if (!strcmp(w[j], "strip"))
371 {
372 if (!strcmp(cp, "env"))
373 bank->tone[i].strip_envelope=1;
374 else if (!strcmp(cp, "loop"))
375 bank->tone[i].strip_loop=1;
376 else if (!strcmp(cp, "tail"))
377 bank->tone[i].strip_tail=1;
378 else
379 {
380 SNDDBG(("%s: line %d: strip must be env, loop, or tail\n",
381 name, line));
382 goto fail;
383 }
384 }
385 else
386 {
387 SNDDBG(("%s: line %d: bad patch option %s\n", name, line, w[j]));
388 goto fail;
389 }
390 }
391 }
392 }
393 SDL_RWclose(rw);
394 return 0;
395 fail:
396 SDL_RWclose(rw);
397 return -2;
398 }
399
400 int Timidity_Init_NoConfig()
401 {
402 /* Allocate memory for the standard tonebank and drumset */
403 master_tonebank[0] = safe_malloc(sizeof(ToneBank));
404 memset(master_tonebank[0], 0, sizeof(ToneBank));
405 master_tonebank[0]->tone = safe_malloc(128 * sizeof(ToneBankElement));
406 memset(master_tonebank[0]->tone, 0, 128 * sizeof(ToneBankElement));
407
408 master_drumset[0] = safe_malloc(sizeof(ToneBank));
409 memset(master_drumset[0], 0, sizeof(ToneBank));
410 master_drumset[0]->tone = safe_malloc(128 * sizeof(ToneBankElement));
411 memset(master_drumset[0]->tone, 0, 128 * sizeof(ToneBankElement));
412
295413 return 0;
296414 }
297415
298 int Timidity_Init(int rate, int format, int channels, int samples)
416 int Timidity_Init()
299417 {
300 const char *env = getenv("TIMIDITY_CFG");
418 const char *env = SDL_getenv("TIMIDITY_CFG");
419
420 /* !!! FIXME: This may be ugly, but slightly less so than requiring the
421 * default search path to have only one element. I think.
422 *
423 * We only need to include the likely locations for the config
424 * file itself since that file should contain any other directory
425 * that needs to be added to the search path.
426 */
427 #ifdef DEFAULT_PATH
428 add_to_pathlist(DEFAULT_PATH);
429 #endif
430 #ifdef DEFAULT_PATH1
431 add_to_pathlist(DEFAULT_PATH1);
432 #endif
433 #ifdef DEFAULT_PATH2
434 add_to_pathlist(DEFAULT_PATH2);
435 #endif
436 #ifdef DEFAULT_PATH3
437 add_to_pathlist(DEFAULT_PATH3);
438 #endif
439
440 Timidity_Init_NoConfig();
441
301442 if (!env || read_config_file(env)<0) {
302443 if (read_config_file(CONFIG_FILE)<0) {
303444 if (read_config_file(CONFIG_FILE_ETC)<0) {
307448 }
308449 }
309450 }
310
311 if (channels < 1 || channels == 3 || channels == 5 || channels > 6) return(-1);
312
313 num_ochannels = channels;
314
315 /* Set play mode parameters */
316 play_mode->rate = rate;
317 play_mode->encoding = 0;
318 if ( (format&0xFF) == 16 ) {
319 play_mode->encoding |= PE_16BIT;
320 }
321 if ( (format&0x8000) ) {
322 play_mode->encoding |= PE_SIGNED;
323 }
324 if ( channels == 1 ) {
325 play_mode->encoding |= PE_MONO;
326 }
327 switch (format) {
328 case AUDIO_S8:
329 s32tobuf = s32tos8;
330 break;
331 case AUDIO_U8:
332 s32tobuf = s32tou8;
333 break;
334 case AUDIO_S16LSB:
335 s32tobuf = s32tos16l;
336 break;
337 case AUDIO_S16MSB:
338 s32tobuf = s32tos16b;
339 break;
340 case AUDIO_U16LSB:
341 s32tobuf = s32tou16l;
342 break;
343 case AUDIO_U16MSB:
344 s32tobuf = s32tou16b;
345 break;
346 default:
347 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Unsupported audio format");
348 return(-1);
349 }
350 AUDIO_BUFFER_SIZE = samples;
351
352 /* Allocate memory for mixing (WARNING: Memory leak!) */
353 resample_buffer = safe_malloc(AUDIO_BUFFER_SIZE*sizeof(resample_t)+100);
354 common_buffer = safe_malloc(AUDIO_BUFFER_SIZE*num_ochannels*sizeof(int32));
355
356 init_tables();
357
358 if (ctl->open(0, 0)) {
359 ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Couldn't open %s\n", ctl->id_name);
360 return(-1);
361 }
362
363 if (!control_ratio) {
364 control_ratio = play_mode->rate / CONTROLS_PER_SECOND;
365 if(control_ratio<1)
366 control_ratio=1;
367 else if (control_ratio > MAX_CONTROL_RATIO)
368 control_ratio=MAX_CONTROL_RATIO;
369 }
451 return 0;
452 }
453
454 MidiSong *Timidity_LoadSong(SDL_RWops *rw, SDL_AudioSpec *audio)
455 {
456 MidiSong *song;
457 int i;
458
459 if (rw == NULL)
460 return NULL;
461
462 /* Allocate memory for the song */
463 song = (MidiSong *)safe_malloc(sizeof(*song));
464 memset(song, 0, sizeof(*song));
465
466 for (i = 0; i < MAXBANK; i++)
467 {
468 if (master_tonebank[i])
469 {
470 song->tonebank[i] = safe_malloc(sizeof(ToneBank));
471 memset(song->tonebank[i], 0, sizeof(ToneBank));
472 song->tonebank[i]->tone = master_tonebank[i]->tone;
473 }
474 if (master_drumset[i])
475 {
476 song->drumset[i] = safe_malloc(sizeof(ToneBank));
477 memset(song->drumset[i], 0, sizeof(ToneBank));
478 song->drumset[i]->tone = master_drumset[i]->tone;
479 }
480 }
481
482 song->amplification = DEFAULT_AMPLIFICATION;
483 song->voices = DEFAULT_VOICES;
484 song->drumchannels = DEFAULT_DRUMCHANNELS;
485
486 song->rw = rw;
487
488 song->rate = audio->freq;
489 song->encoding = 0;
490 if ((audio->format & 0xFF) == 16)
491 song->encoding |= PE_16BIT;
492 else if ((audio->format & 0xFF) == 32)
493 song->encoding |= PE_32BIT;
494 if (audio->format & 0x8000)
495 song->encoding |= PE_SIGNED;
496 if (audio->channels == 1)
497 song->encoding |= PE_MONO;
498 else if (audio->channels > 2) {
499 SDL_SetError("Surround sound not supported");
500 return NULL;
501 }
502 switch (audio->format) {
503 case AUDIO_S8:
504 song->write = s32tos8;
505 break;
506 case AUDIO_U8:
507 song->write = s32tou8;
508 break;
509 case AUDIO_S16LSB:
510 song->write = s32tos16l;
511 break;
512 case AUDIO_S16MSB:
513 song->write = s32tos16b;
514 break;
515 case AUDIO_U16LSB:
516 song->write = s32tou16l;
517 break;
518 case AUDIO_U16MSB:
519 song->write = s32tou16b;
520 break;
521 case AUDIO_S32LSB:
522 song->write = s32tos32l;
523 break;
524 case AUDIO_S32MSB:
525 song->write = s32tos32b;
526 break;
527 case AUDIO_F32SYS:
528 song->write = s32tof32;
529 break;
530 default:
531 SDL_SetError("Unsupported audio format");
532 return NULL;
533 }
534
535 song->buffer_size = audio->samples;
536 song->resample_buffer = safe_malloc(audio->samples * sizeof(sample_t));
537 song->common_buffer = safe_malloc(audio->samples * 2 * sizeof(Sint32));
538
539 song->control_ratio = audio->freq / CONTROLS_PER_SECOND;
540 if (song->control_ratio < 1)
541 song->control_ratio = 1;
542 else if (song->control_ratio > MAX_CONTROL_RATIO)
543 song->control_ratio = MAX_CONTROL_RATIO;
544
545 song->lost_notes = 0;
546 song->cut_notes = 0;
547
548 song->events = read_midi_file(song, &(song->groomed_event_count),
549 &song->samples);
550
551 /* The RWops can safely be closed at this point, but let's make that the
552 * responsibility of the caller.
553 */
554
555 /* Make sure everything is okay */
556 if (!song->events) {
557 free(song);
558 return(NULL);
559 }
560
561 song->default_instrument = 0;
562 song->default_program = DEFAULT_PROGRAM;
563
370564 if (*def_instr_name)
371 set_default_instrument(def_instr_name);
372 return(0);
565 set_default_instrument(song, def_instr_name);
566
567 load_missing_instruments(song);
568
569 return(song);
373570 }
374571
375 char timidity_error[TIMIDITY_ERROR_SIZE] = "";
376 const char *Timidity_Error(void)
572 void Timidity_FreeSong(MidiSong *song)
377573 {
378 return(timidity_error);
574 int i;
575
576 free_instruments(song);
577
578 for (i = 0; i < 128; i++)
579 {
580 if (song->tonebank[i])
581 free(song->tonebank[i]);
582 if (song->drumset[i])
583 free(song->drumset[i]);
584 }
585
586 free(song->common_buffer);
587 free(song->resample_buffer);
588 free(song->events);
589 free(song);
379590 }
380591
592 void Timidity_Exit(void)
593 {
594 int i, j;
595
596 for (i = 0; i < MAXBANK; i++)
597 {
598 if (master_tonebank[i])
599 {
600 ToneBankElement *e = master_tonebank[i]->tone;
601 if (e != NULL)
602 {
603 for (j = 0; j < 128; j++)
604 {
605 if (e[j].name != NULL)
606 free(e[j].name);
607 }
608 free(e);
609 }
610 free(master_tonebank[i]);
611 master_tonebank[i] = NULL;
612 }
613 if (master_drumset[i])
614 {
615 ToneBankElement *e = master_drumset[i]->tone;
616 if (e != NULL)
617 {
618 for (j = 0; j < 128; j++)
619 {
620 if (e[j].name != NULL)
621 free(e[j].name);
622 }
623 free(e);
624 }
625 free(master_drumset[i]);
626 master_drumset[i] = NULL;
627 }
628 }
629
630 free_pathlist();
631 }
00 /*
1
12 TiMidity -- Experimental MIDI to WAVE converter
23 Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the Perl Artistic License, available in COPYING.
6 */
7 */
78
8 typedef struct _MidiSong MidiSong;
9 #ifndef TIMIDITY_H
10 #define TIMIDITY_H
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
914
10 extern int Timidity_Init(int rate, int format, int channels, int samples);
11 extern const char *Timidity_Error(void);
12 extern void Timidity_SetVolume(int volume);
13 extern int Timidity_PlaySome(void *stream, int samples);
14 extern MidiSong *Timidity_LoadSong_RW(SDL_RWops *rw, int freerw);
15 typedef Sint16 sample_t;
16 typedef Sint32 final_volume_t;
17
18 #define VIBRATO_SAMPLE_INCREMENTS 32
19
20 /* Maximum polyphony. */
21 /* #define MAX_VOICES 48 */
22 #define MAX_VOICES 256
23 #define MAXCHAN 16
24 /* #define MAXCHAN 64 */
25 #define MAXBANK 128
26
27 typedef struct {
28 Sint32
29 loop_start, loop_end, data_length,
30 sample_rate, low_freq, high_freq, root_freq;
31 Sint32
32 envelope_rate[6], envelope_offset[6];
33 float
34 volume;
35 sample_t *data;
36 Sint32
37 tremolo_sweep_increment, tremolo_phase_increment,
38 vibrato_sweep_increment, vibrato_control_ratio;
39 Uint8
40 tremolo_depth, vibrato_depth,
41 modes;
42 Sint8
43 panning, note_to_use;
44 } Sample;
45
46 typedef struct {
47 int
48 bank, program, volume, sustain, panning, pitchbend, expression,
49 mono, /* one note only on this channel -- not implemented yet */
50 pitchsens;
51 /* chorus, reverb... Coming soon to a 300-MHz, eight-way superscalar
52 processor near you */
53 float
54 pitchfactor; /* precomputed pitch bend factor to save some fdiv's */
55 } Channel;
56
57 typedef struct {
58 Uint8
59 status, channel, note, velocity;
60 Sample *sample;
61 Sint32
62 orig_frequency, frequency,
63 sample_offset, sample_increment,
64 envelope_volume, envelope_target, envelope_increment,
65 tremolo_sweep, tremolo_sweep_position,
66 tremolo_phase, tremolo_phase_increment,
67 vibrato_sweep, vibrato_sweep_position;
68
69 final_volume_t left_mix, right_mix;
70
71 float
72 left_amp, right_amp, tremolo_volume;
73 Sint32
74 vibrato_sample_increment[VIBRATO_SAMPLE_INCREMENTS];
75 int
76 vibrato_phase, vibrato_control_ratio, vibrato_control_counter,
77 envelope_stage, control_counter, panning, panned;
78
79 } Voice;
80
81 typedef struct {
82 int samples;
83 Sample *sample;
84 } Instrument;
85
86 /* Shared data */
87 typedef struct {
88 char *name;
89 int note, amp, pan, strip_loop, strip_envelope, strip_tail;
90 } ToneBankElement;
91
92 typedef struct {
93 ToneBankElement *tone;
94 Instrument *instrument[128];
95 } ToneBank;
96
97 typedef struct {
98 Sint32 time;
99 Uint8 channel, type, a, b;
100 } MidiEvent;
101
102 typedef struct {
103 MidiEvent event;
104 void *next;
105 } MidiEventList;
106
107 typedef struct {
108 int playing;
109 SDL_RWops *rw;
110 Sint32 rate;
111 Sint32 encoding;
112 float master_volume;
113 Sint32 amplification;
114 ToneBank *tonebank[MAXBANK];
115 ToneBank *drumset[MAXBANK];
116 Instrument *default_instrument;
117 int default_program;
118 void (*write)(void *dp, Sint32 *lp, Sint32 c);
119 int buffer_size;
120 sample_t *resample_buffer;
121 Sint32 *common_buffer;
122 Sint32 *buffer_pointer;
123 /* These would both fit into 32 bits, but they are often added in
124 large multiples, so it's simpler to have two roomy ints */
125 /* samples per MIDI delta-t */
126 Sint32 sample_increment;
127 Sint32 sample_correction;
128 Channel channel[MAXCHAN];
129 Voice voice[MAX_VOICES];
130 int voices;
131 Sint32 drumchannels;
132 Sint32 buffered_count;
133 Sint32 control_ratio;
134 Sint32 lost_notes;
135 Sint32 cut_notes;
136 Sint32 samples;
137 MidiEvent *events;
138 MidiEvent *current_event;
139 MidiEventList *evlist;
140 Sint32 current_sample;
141 Sint32 event_count;
142 Sint32 at;
143 Sint32 groomed_event_count;
144 } MidiSong;
145
146 /* Some of these are not defined in timidity.c but are here for convenience */
147
148 extern int Timidity_Init(void);
149 extern int Timidity_Init_NoConfig(void);
150 extern void Timidity_SetVolume(MidiSong *song, int volume);
151 extern int Timidity_PlaySome(MidiSong *song, void *stream, Sint32 len);
152 extern MidiSong *Timidity_LoadSong(SDL_RWops *rw, SDL_AudioSpec *audio);
15153 extern void Timidity_Start(MidiSong *song);
16 extern int Timidity_Active(void);
17 extern void Timidity_Stop(void);
154 extern void Timidity_Seek(MidiSong *song, Uint32 ms);
155 extern Uint32 Timidity_GetSongLength(MidiSong *song); /* returns millseconds */
18156 extern void Timidity_FreeSong(MidiSong *song);
19 extern void Timidity_Close(void);
157 extern void Timidity_Exit(void);
158
159 #ifdef __cplusplus
160 }
161 #endif
162 #endif /* TIMIDITY_H */
88 //
99
1010 VS_VERSION_INFO VERSIONINFO
11 FILEVERSION 2,0,1,0
12 PRODUCTVERSION 2,0,1,0
11 FILEVERSION 2,0,2,0
12 PRODUCTVERSION 2,0,2,0
1313 FILEFLAGSMASK 0x3fL
1414 FILEFLAGS 0x0L
1515 FILEOS 0x40004L
2222 BEGIN
2323 VALUE "CompanyName", "\0"
2424 VALUE "FileDescription", "SDL_mixer\0"
25 VALUE "FileVersion", "2, 0, 1, 0\0"
25 VALUE "FileVersion", "2, 0, 2, 0\0"
2626 VALUE "InternalName", "SDL_mixer\0"
27 VALUE "LegalCopyright", "Copyright © 2016 Sam Lantinga\0"
27 VALUE "LegalCopyright", "Copyright © 2017 Sam Lantinga\0"
2828 VALUE "OriginalFilename", "SDL_mixer.dll\0"
2929 VALUE "ProductName", "Simple DirectMedia Layer\0"
30 VALUE "ProductVersion", "2, 0, 1, 0\0"
30 VALUE "ProductVersion", "2, 0, 2, 0\0"
3131 END
3232 END
3333 BLOCK "VarFileInfo"
+0
-628
wavestream.c less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* $Id$ */
22
23 /* This file supports streaming WAV files, without volume adjustment */
24
25 #include <stdlib.h>
26 #include <string.h>
27
28 #include "SDL_audio.h"
29 #include "SDL_mutex.h"
30 #include "SDL_rwops.h"
31 #include "SDL_endian.h"
32
33 #include "SDL_mixer.h"
34 #include "wavestream.h"
35
36 /*
37 Taken with permission from SDL_wave.h, part of the SDL library,
38 available at: http://www.libsdl.org/
39 and placed under the same license as this mixer library.
40 */
41
42 /* WAVE files are little-endian */
43
44 /*******************************************/
45 /* Define values for Microsoft WAVE format */
46 /*******************************************/
47 #define RIFF 0x46464952 /* "RIFF" */
48 #define WAVE 0x45564157 /* "WAVE" */
49 #define FMT 0x20746D66 /* "fmt " */
50 #define DATA 0x61746164 /* "data" */
51 #define SMPL 0x6c706d73 /* "smpl" */
52 #define PCM_CODE 1
53 #define ADPCM_CODE 2
54 #define WAVE_MONO 1
55 #define WAVE_STEREO 2
56
57 typedef struct {
58 /* Not saved in the chunk we read:
59 Uint32 chunkID;
60 Uint32 chunkLen;
61 */
62 Uint16 encoding;
63 Uint16 channels; /* 1 = mono, 2 = stereo */
64 Uint32 frequency; /* One of 11025, 22050, or 44100 Hz */
65 Uint32 byterate; /* Average bytes per second */
66 Uint16 blockalign; /* Bytes per sample block */
67 Uint16 bitspersample; /* One of 8, 12, 16, or 4 for ADPCM */
68 } WaveFMT;
69
70 typedef struct {
71 Uint32 identifier;
72 Uint32 type;
73 Uint32 start;
74 Uint32 end;
75 Uint32 fraction;
76 Uint32 play_count;
77 } SampleLoop;
78
79 typedef struct {
80 /* Not saved in the chunk we read:
81 Uint32 chunkID;
82 Uint32 chunkLen;
83 */
84 Uint32 manufacturer;
85 Uint32 product;
86 Uint32 sample_period;
87 Uint32 MIDI_unity_note;
88 Uint32 MIDI_pitch_fraction;
89 Uint32 SMTPE_format;
90 Uint32 SMTPE_offset;
91 Uint32 sample_loops;
92 Uint32 sampler_data;
93 SampleLoop loops[];
94 } SamplerChunk;
95
96 /*********************************************/
97 /* Define values for AIFF (IFF audio) format */
98 /*********************************************/
99 #define FORM 0x4d524f46 /* "FORM" */
100 #define AIFF 0x46464941 /* "AIFF" */
101 #define SSND 0x444e5353 /* "SSND" */
102 #define COMM 0x4d4d4f43 /* "COMM" */
103
104
105 /* Currently we only support a single stream at a time */
106 static WAVStream *music = NULL;
107
108 /* This is the format of the audio mixer data */
109 static SDL_AudioSpec mixer;
110 static int wavestream_volume = MIX_MAX_VOLUME;
111
112 /* Function to load the WAV/AIFF stream */
113 static SDL_bool LoadWAVStream(WAVStream *wave);
114 static SDL_bool LoadAIFFStream(WAVStream *wave);
115
116 /* Initialize the WAVStream player, with the given mixer settings
117 This function returns 0, or -1 if there was an error.
118 */
119 int WAVStream_Init(SDL_AudioSpec *mixerfmt)
120 {
121 mixer = *mixerfmt;
122 return(0);
123 }
124
125 void WAVStream_SetVolume(int volume)
126 {
127 wavestream_volume = volume;
128 }
129
130 /* Load a WAV stream from the given RWops object */
131 WAVStream *WAVStream_LoadSong_RW(SDL_RWops *src, int freesrc)
132 {
133 WAVStream *wave;
134 SDL_bool loaded = SDL_FALSE;
135
136 if (!mixer.format) {
137 Mix_SetError("WAV music output not started");
138 return(NULL);
139 }
140
141 wave = (WAVStream *)SDL_malloc(sizeof *wave);
142 if (wave) {
143 Uint32 magic;
144
145 SDL_zerop(wave);
146 wave->src = src;
147 wave->freesrc = freesrc;
148
149 magic = SDL_ReadLE32(src);
150 if (magic == RIFF || magic == WAVE) {
151 loaded = LoadWAVStream(wave);
152 } else if (magic == FORM) {
153 loaded = LoadAIFFStream(wave);
154 } else {
155 Mix_SetError("Unknown WAVE format");
156 }
157 if (!loaded) {
158 WAVStream_FreeSong(wave);
159 return(NULL);
160 }
161 SDL_BuildAudioCVT(&wave->cvt,
162 wave->spec.format, wave->spec.channels, wave->spec.freq,
163 mixer.format, mixer.channels, mixer.freq);
164 } else {
165 SDL_OutOfMemory();
166 return(NULL);
167 }
168 return(wave);
169 }
170
171 /* Start playback of a given WAV stream */
172 void WAVStream_Start(WAVStream *wave)
173 {
174 int i;
175 for (i = 0; i < wave->numloops; ++i) {
176 WAVLoopPoint *loop = &wave->loops[i];
177 loop->active = SDL_TRUE;
178 loop->current_play_count = loop->initial_play_count;
179 }
180 SDL_RWseek(wave->src, wave->start, RW_SEEK_SET);
181 music = wave;
182 }
183
184 /* Play some of a stream previously started with WAVStream_Start() */
185 static int PlaySome(Uint8 *stream, int len)
186 {
187 Sint64 pos, stop;
188 WAVLoopPoint *loop;
189 Sint64 loop_start;
190 Sint64 loop_stop;
191 int i;
192 int consumed;
193
194 pos = SDL_RWtell(music->src);
195 stop = music->stop;
196 loop = NULL;
197 for (i = 0; i < music->numloops; ++i) {
198 loop = &music->loops[i];
199 if (loop->active) {
200 const int bytes_per_sample = (SDL_AUDIO_BITSIZE(music->spec.format) / 8) * music->spec.channels;
201 loop_start = music->start + loop->start * bytes_per_sample;
202 loop_stop = music->start + (loop->stop + 1) * bytes_per_sample;
203 if (pos >= loop_start && pos < loop_stop)
204 {
205 stop = loop_stop;
206 break;
207 }
208 }
209 loop = NULL;
210 }
211
212 if (music->cvt.needed) {
213 int original_len;
214
215 original_len = (int)((double)len/music->cvt.len_ratio);
216 if (music->cvt.len != original_len) {
217 int worksize;
218 if (music->cvt.buf != NULL) {
219 SDL_free(music->cvt.buf);
220 }
221 worksize = original_len*music->cvt.len_mult;
222 music->cvt.buf=(Uint8 *)SDL_malloc(worksize);
223 if (music->cvt.buf == NULL) {
224 return 0;
225 }
226 music->cvt.len = original_len;
227 }
228 if ((stop - pos) < original_len) {
229 original_len = (int)(stop - pos);
230 }
231 original_len = SDL_RWread(music->src, music->cvt.buf, 1, original_len);
232 /* At least at the time of writing, SDL_ConvertAudio()
233 does byte-order swapping starting at the end of the
234 buffer. Thus, if we are reading 16-bit samples, we
235 had better make damn sure that we get an even
236 number of bytes, or we'll get garbage.
237 */
238 if ((music->cvt.src_format & 0x0010) && (original_len & 1)) {
239 original_len--;
240 }
241 music->cvt.len = original_len;
242 SDL_ConvertAudio(&music->cvt);
243 SDL_MixAudio(stream, music->cvt.buf, music->cvt.len_cvt, wavestream_volume);
244 consumed = music->cvt.len_cvt;
245 } else {
246 Uint8 *data;
247 if ((stop - pos) < len) {
248 len = (int)(stop - pos);
249 }
250 data = SDL_stack_alloc(Uint8, len);
251 if (data) {
252 len = SDL_RWread(music->src, data, 1, len);
253 SDL_MixAudio(stream, data, len, wavestream_volume);
254 SDL_stack_free(data);
255 }
256 consumed = len;
257 }
258
259 if (loop && SDL_RWtell(music->src) >= stop) {
260 if (loop->current_play_count == 1) {
261 loop->active = SDL_FALSE;
262 } else {
263 if (loop->current_play_count > 0) {
264 --loop->current_play_count;
265 }
266 SDL_RWseek(music->src, loop_start, RW_SEEK_SET);
267 }
268 }
269 return consumed;
270 }
271
272 int WAVStream_PlaySome(Uint8 *stream, int len)
273 {
274 if (!music)
275 return 0;
276
277 while ((SDL_RWtell(music->src) < music->stop) && (len > 0)) {
278 int consumed = PlaySome(stream, len);
279 if (!consumed)
280 break;
281
282 stream += consumed;
283 len -= consumed;
284 }
285 return len;
286 }
287
288 /* Stop playback of a stream previously started with WAVStream_Start() */
289 void WAVStream_Stop(void)
290 {
291 music = NULL;
292 }
293
294 /* Close the given WAV stream */
295 void WAVStream_FreeSong(WAVStream *wave)
296 {
297 if (wave) {
298 /* Clean up associated data */
299 if (wave->loops) {
300 SDL_free(wave->loops);
301 }
302 if (wave->cvt.buf) {
303 SDL_free(wave->cvt.buf);
304 }
305 if (wave->freesrc) {
306 SDL_RWclose(wave->src);
307 }
308 SDL_free(wave);
309 }
310 }
311
312 /* Return non-zero if a stream is currently playing */
313 int WAVStream_Active(void)
314 {
315 int active;
316
317 active = 0;
318 if (music && (SDL_RWtell(music->src) < music->stop)) {
319 active = 1;
320 }
321 return(active);
322 }
323
324 static SDL_bool ParseFMT(WAVStream *wave, Uint32 chunk_length)
325 {
326 SDL_RWops *src = wave->src;
327 SDL_AudioSpec *spec = &wave->spec;
328 WaveFMT *format;
329 Uint8 *data;
330 SDL_bool loaded = SDL_FALSE;
331
332 if (chunk_length < sizeof(*format)) {
333 Mix_SetError("Wave format chunk too small");
334 return SDL_FALSE;
335 }
336
337 data = (Uint8 *)SDL_malloc(chunk_length);
338 if (!data) {
339 Mix_SetError("Out of memory");
340 return SDL_FALSE;
341 }
342 if (!SDL_RWread(wave->src, data, chunk_length, 1)) {
343 Mix_SetError("Couldn't read %d bytes from WAV file", chunk_length);
344 return SDL_FALSE;
345 }
346 format = (WaveFMT *)data;
347
348 /* Decode the audio data format */
349 switch (SDL_SwapLE16(format->encoding)) {
350 case PCM_CODE:
351 /* We can understand this */
352 break;
353 default:
354 Mix_SetError("Unknown WAVE data format");
355 goto done;
356 }
357 spec->freq = SDL_SwapLE32(format->frequency);
358 switch (SDL_SwapLE16(format->bitspersample)) {
359 case 8:
360 spec->format = AUDIO_U8;
361 break;
362 case 16:
363 spec->format = AUDIO_S16;
364 break;
365 default:
366 Mix_SetError("Unknown PCM data format");
367 goto done;
368 }
369 spec->channels = (Uint8) SDL_SwapLE16(format->channels);
370 spec->samples = 4096; /* Good default buffer size */
371
372 loaded = SDL_TRUE;
373
374 done:
375 SDL_free(data);
376 return loaded;
377 }
378
379 static SDL_bool ParseDATA(WAVStream *wave, Uint32 chunk_length)
380 {
381 wave->start = SDL_RWtell(wave->src);
382 wave->stop = wave->start + chunk_length;
383 SDL_RWseek(wave->src, chunk_length, RW_SEEK_CUR);
384 return SDL_TRUE;
385 }
386
387 static SDL_bool AddLoopPoint(WAVStream *wave, Uint32 play_count, Uint32 start, Uint32 stop)
388 {
389 WAVLoopPoint *loop;
390 WAVLoopPoint *loops = SDL_realloc(wave->loops, (wave->numloops + 1)*sizeof(*wave->loops));
391 if (!loops) {
392 Mix_SetError("Out of memory");
393 return SDL_FALSE;
394 }
395
396 loop = &loops[ wave->numloops ];
397 loop->start = start;
398 loop->stop = stop;
399 loop->initial_play_count = play_count;
400 loop->current_play_count = play_count;
401
402 wave->loops = loops;
403 ++wave->numloops;
404 return SDL_TRUE;
405 }
406
407 static SDL_bool ParseSMPL(WAVStream *wave, Uint32 chunk_length)
408 {
409 SamplerChunk *chunk;
410 Uint8 *data;
411 int i;
412 SDL_bool loaded = SDL_FALSE;
413
414 data = (Uint8 *)SDL_malloc(chunk_length);
415 if (!data) {
416 Mix_SetError("Out of memory");
417 return SDL_FALSE;
418 }
419 if (!SDL_RWread(wave->src, data, chunk_length, 1)) {
420 Mix_SetError("Couldn't read %d bytes from WAV file", chunk_length);
421 return SDL_FALSE;
422 }
423 chunk = (SamplerChunk *)data;
424
425 for (i = 0; i < SDL_SwapLE32(chunk->sample_loops); ++i) {
426 const Uint32 LOOP_TYPE_FORWARD = 0;
427 Uint32 loop_type = SDL_SwapLE32(chunk->loops[i].type);
428 if (loop_type == LOOP_TYPE_FORWARD) {
429 AddLoopPoint(wave, SDL_SwapLE32(chunk->loops[i].play_count), SDL_SwapLE32(chunk->loops[i].start), SDL_SwapLE32(chunk->loops[i].end));
430 }
431 }
432
433 loaded = SDL_TRUE;
434
435 done:
436 SDL_free(data);
437 return loaded;
438 }
439
440 static SDL_bool LoadWAVStream(WAVStream *wave)
441 {
442 SDL_RWops *src = wave->src;
443 Uint32 chunk_type;
444 Uint32 chunk_length;
445 SDL_bool found_FMT = SDL_FALSE;
446 SDL_bool found_DATA = SDL_FALSE;
447
448 /* WAV magic header */
449 Uint32 wavelen;
450 Uint32 WAVEmagic;
451
452 /* Check the magic header */
453 wavelen = SDL_ReadLE32(src);
454 WAVEmagic = SDL_ReadLE32(src);
455
456 /* Read the chunks */
457 for (; ;) {
458 chunk_type = SDL_ReadLE32(src);
459 chunk_length = SDL_ReadLE32(src);
460
461 if (chunk_length == 0)
462 break;
463
464 switch (chunk_type)
465 {
466 case FMT:
467 found_FMT = SDL_TRUE;
468 if (!ParseFMT(wave, chunk_length))
469 return SDL_FALSE;
470 break;
471 case DATA:
472 found_DATA = SDL_TRUE;
473 if (!ParseDATA(wave, chunk_length))
474 return SDL_FALSE;
475 break;
476 case SMPL:
477 if (!ParseSMPL(wave, chunk_length))
478 return SDL_FALSE;
479 break;
480 default:
481 SDL_RWseek(src, chunk_length, RW_SEEK_CUR);
482 break;
483 }
484 }
485
486 if (!found_FMT) {
487 Mix_SetError("Bad WAV file (no FMT chunk)");
488 return SDL_FALSE;
489 }
490
491 if (!found_DATA) {
492 Mix_SetError("Bad WAV file (no DATA chunk)");
493 return SDL_FALSE;
494 }
495
496 return SDL_TRUE;
497 }
498
499 /* I couldn't get SANE_to_double() to work, so I stole this from libsndfile.
500 * I don't pretend to fully understand it.
501 */
502
503 static Uint32 SANE_to_Uint32 (Uint8 *sanebuf)
504 {
505 /* Negative number? */
506 if (sanebuf[0] & 0x80)
507 return 0;
508
509 /* Less than 1? */
510 if (sanebuf[0] <= 0x3F)
511 return 1;
512
513 /* Way too big? */
514 if (sanebuf[0] > 0x40)
515 return 0x4000000;
516
517 /* Still too big? */
518 if (sanebuf[0] == 0x40 && sanebuf[1] > 0x1C)
519 return 800000000;
520
521 return ((sanebuf[2] << 23) | (sanebuf[3] << 15) | (sanebuf[4] << 7) |
522 (sanebuf[5] >> 1)) >> (29 - sanebuf[1]);
523 }
524
525 static SDL_bool LoadAIFFStream(WAVStream *wave)
526 {
527 SDL_RWops *src = wave->src;
528 SDL_AudioSpec *spec = &wave->spec;
529 SDL_bool found_SSND = SDL_FALSE;
530 SDL_bool found_COMM = SDL_FALSE;
531
532 Uint32 chunk_type;
533 Uint32 chunk_length;
534 Sint64 next_chunk;
535
536 /* AIFF magic header */
537 Uint32 AIFFmagic;
538 /* SSND chunk */
539 Uint32 offset;
540 Uint32 blocksize;
541 /* COMM format chunk */
542 Uint16 channels = 0;
543 Uint32 numsamples = 0;
544 Uint16 samplesize = 0;
545 Uint8 sane_freq[10];
546 Uint32 frequency = 0;
547
548 /* Check the magic header */
549 chunk_length = SDL_ReadBE32(src);
550 AIFFmagic = SDL_ReadLE32(src);
551 if (AIFFmagic != AIFF) {
552 Mix_SetError("Unrecognized file type (not AIFF)");
553 return SDL_FALSE;
554 }
555
556 /* From what I understand of the specification, chunks may appear in
557 * any order, and we should just ignore unknown ones.
558 *
559 * TODO: Better sanity-checking. E.g. what happens if the AIFF file
560 * contains compressed sound data?
561 */
562 do {
563 chunk_type = SDL_ReadLE32(src);
564 chunk_length = SDL_ReadBE32(src);
565 next_chunk = SDL_RWtell(src) + chunk_length;
566
567 /* Paranoia to avoid infinite loops */
568 if (chunk_length == 0)
569 break;
570
571 switch (chunk_type) {
572 case SSND:
573 found_SSND = SDL_TRUE;
574 offset = SDL_ReadBE32(src);
575 blocksize = SDL_ReadBE32(src);
576 wave->start = SDL_RWtell(src) + offset;
577 break;
578
579 case COMM:
580 found_COMM = SDL_TRUE;
581
582 /* Read the audio data format chunk */
583 channels = SDL_ReadBE16(src);
584 numsamples = SDL_ReadBE32(src);
585 samplesize = SDL_ReadBE16(src);
586 SDL_RWread(src, sane_freq, sizeof(sane_freq), 1);
587 frequency = SANE_to_Uint32(sane_freq);
588 break;
589
590 default:
591 break;
592 }
593 } while ((!found_SSND || !found_COMM)
594 && SDL_RWseek(src, next_chunk, RW_SEEK_SET) != -1);
595
596 if (!found_SSND) {
597 Mix_SetError("Bad AIFF file (no SSND chunk)");
598 return SDL_FALSE;
599 }
600
601 if (!found_COMM) {
602 Mix_SetError("Bad AIFF file (no COMM chunk)");
603 return SDL_FALSE;
604 }
605
606 wave->stop = wave->start + channels * numsamples * (samplesize / 8);
607
608 /* Decode the audio data format */
609 SDL_memset(spec, 0, (sizeof *spec));
610 spec->freq = frequency;
611 switch (samplesize) {
612 case 8:
613 spec->format = AUDIO_S8;
614 break;
615 case 16:
616 spec->format = AUDIO_S16MSB;
617 break;
618 default:
619 Mix_SetError("Unknown samplesize in data format");
620 return SDL_FALSE;
621 }
622 spec->channels = (Uint8) channels;
623 spec->samples = 4096; /* Good default buffer size */
624
625 return SDL_TRUE;
626 }
627
+0
-69
wavestream.h less more
0 /*
1 SDL_mixer: An audio mixer library based on the SDL library
2 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19 */
20
21 /* $Id$ */
22
23 /* This file supports streaming WAV files */
24
25 typedef struct {
26 SDL_bool active;
27 Uint32 start;
28 Uint32 stop;
29 Uint32 initial_play_count;
30 Uint32 current_play_count;
31 } WAVLoopPoint;
32
33 typedef struct {
34 SDL_RWops *src;
35 SDL_bool freesrc;
36 SDL_AudioSpec spec;
37 Sint64 start;
38 Sint64 stop;
39 SDL_AudioCVT cvt;
40 int numloops;
41 WAVLoopPoint *loops;
42 } WAVStream;
43
44 /* Initialize the WAVStream player, with the given mixer settings
45 This function returns 0, or -1 if there was an error.
46 */
47 extern int WAVStream_Init(SDL_AudioSpec *mixer);
48
49 /* Unimplemented */
50 extern void WAVStream_SetVolume(int volume);
51
52 /* Load a WAV stream from an SDL_RWops object */
53 extern WAVStream *WAVStream_LoadSong_RW(SDL_RWops *src, int freesrc);
54
55 /* Start playback of a given WAV stream */
56 extern void WAVStream_Start(WAVStream *wave);
57
58 /* Play some of a stream previously started with WAVStream_Start() */
59 extern int WAVStream_PlaySome(Uint8 *stream, int len);
60
61 /* Stop playback of a stream previously started with WAVStream_Start() */
62 extern void WAVStream_Stop(void);
63
64 /* Close the given WAV stream */
65 extern void WAVStream_FreeSong(WAVStream *wave);
66
67 /* Return non-zero if a stream is currently playing */
68 extern int WAVStream_Active(void);