Commit b66d02a6 authored by bret curtis's avatar bret curtis

Imported Upstream version 0.3.2

parent ef761a92
# compiled objects #
*.o
*.so
*.dll
# logs and other texts #
*.log
# OS generated files #
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
# Eclipse
.cproject
.preferences.xml
.project
.settings/
# config files
include/config.h
......@@ -2,9 +2,13 @@ language: c
compiler:
- gcc
- clang
env:
- BUILD_TYPE=Debug
- BUILD_TYPE=Release
branches:
only:
- master
- wildmidi-0.3
before_install:
- pwd
- git submodule update --init --recursive
......@@ -22,15 +26,9 @@ before_script:
- cd -
- mkdir debug
- cd debug
- cmake ..
- cd -
- mkdir release
- cd release
- cmake -D CMAKE_BUILD_TYPE=Release ..
- cd -
- cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
script:
- make -j2 -C ./debug
- make -j2 -C ./release
- make -j2
#after_script:
# - ./runtests
......
......@@ -3,31 +3,45 @@ PROJECT(wildmidi)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
# Version
set (WILDMIDI_VERSION_MAJOR 0)
set (WILDMIDI_VERSION_MINOR 3)
set (WILDMIDI_VERSION_RELEASE 0)
set (WILDMIDI_VERSION "${WILDMIDI_VERSION_MAJOR}.${WILDMIDI_VERSION_MINOR}.${WILDMIDI_VERSION_RELEASE}")
SET(VERSION_MAJOR 0)
SET(VERSION_MINOR 3)
SET(VERSION_RELEASE 2)
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}")
SET(SOVERSION 1.0.2)
# Find Macros
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Set a default build type if none was specified
if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
IF(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
MESSAGE(STATUS "Setting build type to 'Debug' as none was specified.")
SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()
ENDIF()
SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
# Are we linking against libwildmidi statically?
option(WILDMIDI_STATIC "Link WildMIDI to the static libwildmidi library" FALSE)
# Set our optoins
OPTION(WANT_PLAYER "Build WildMIDI player in addition to the libraries" ON)
OPTION(WANT_STATIC "Link WildMIDI to the static libwildmidi library" OFF)
OPTION(WANT_ALSA "Include ALSA (Advanced Linux Sound Architecture) support" ON)
OPTION(WANT_OSS "Include OSS (Open Sound System) support" OFF)
OPTION(WANT_COREAUDIO "Include CoreAudio support (Driver support for Mac OS X" OFF)
IF(WANT_OSS)
SET(WANT_ALSA OFF)
ENDIF(WANT_OSS)
# Compiler specific settings
if(CMAKE_COMPILER_IS_GNUCC)
add_definitions( -std=c99 -D_POSIX_C_SOURCE=200809L -pedantic -Wall -Wextra -W )
IF(CMAKE_COMPILER_IS_GNUCC)
ADD_DEFINITIONS( -std=c99 -D_POSIX_C_SOURCE=200809L -pedantic -Wall -Wextra -W )
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_DEFINITIONS( -ggdb3 -O0)
ELSEIF(CMAKE_BUILD_TYPE STREQUAL "Release")
ADD_DEFINITIONS( -O3)
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
# default config locaiton
......@@ -36,19 +50,17 @@ SET(WILDMIDI_CFG "wildmidi.cfg")
# UNIX-like environments
IF(NOT WIN32 AND NOT APPLE)
# go looking for available sound packages
find_package(ALSA)
if(ALSA_FOUND)
add_definitions( -DHAVE_ALSA=1 )
else(ALSA_FOUND)
find_package(OSS)
if(OSS_FOUND)
add_definitions( -DHAVE_LINUX_SOUNDCARD_H=1 )
endif()
endif()
# go looking for available sound packages for WildMIDI player
IF(WANT_PLAYER AND WANT_ALSA)
FIND_PACKAGE(ALSA REQUIRED)
ELSEIF(WANT_PLAYER AND WANT_OSS)
FIND_PACKAGE(OSS REQUIRED)
ELSE(WANT_PLAYER AND WANT_ALSA)
MESSAGE(FATAL_ERROR "You must choose either ALSA or OSS.")
ENDIF(WANT_PLAYER AND WANT_ALSA)
# find our math lib
find_library(M_LIBRARY m)
FIND_LIBRARY(M_LIBRARY m REQUIRED)
# set our default linux config
SET(WILDMIDI_CFG "/etc/wildmidi/wildmidi.cfg")
......@@ -62,28 +74,28 @@ IF(NOT WIN32 AND NOT APPLE)
ENDIF(NOT WIN32 AND NOT APPLE)
IF (APPLE)
FIND_LIBRARY(COREAUDIO_LIBRARY CoreAudio)
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation )
IF (WANT_PLAYER AND WANT_COREAUDIO)
FIND_LIBRARY(COREAUDIO_LIBRARY CoreAudio REQUIRED)
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation REQUIRED)
ENDIF(WANT_PLAYER AND WANT_COREAUDIO)
ENDIF (APPLE)
IF (WIN32)
LINK_LIBRARIES(winmm)
ENDIF (WIN32)
#add_definitions( -static )
# ######### General setup ##########
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} include ${ALSA_INCLUDE_DIR})
if (APPLE)
set(APP_BUNDLE_NAME "${CMAKE_PROJECT_NAME}.app")
set(APP_BUNDLE_DIR "${wildmidi_BINARY_DIR}/${APP_BUNDLE_NAME}")
endif (APPLE)
IF (APPLE)
SET(APP_BUNDLE_NAME "${CMAKE_PROJECT_NAME}.app")
SET(APP_BUNDLE_DIR "${wildmidi_BINARY_DIR}/${APP_BUNDLE_NAME}")
ENDIF (APPLE)
if (APPLE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${APP_BUNDLE_DIR}/Contents/MacOS")
else (APPLE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${wildmidi_BINARY_DIR}")
endif (APPLE)
IF (APPLE)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${APP_BUNDLE_DIR}/Contents/MacOS")
ELSE (APPLE)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${wildmidi_BINARY_DIR}")
ENDIF (APPLE)
add_subdirectory(src)
\ No newline at end of file
ADD_SUBDIRECTORY(src)
dir /usr/share/midi/freepats
# Automatically generated on Sun Feb 19 19:22:39 EST 2006
# by http://freepats.opensrc.org/mkcfg.sh.txt
drumset 0
25 Drum_000/025_Snare_Roll.pat
26 Drum_000/026_Snap.pat
27 Drum_000/027_High_Q.pat
31 Drum_000/031_Sticks.pat
32 Drum_000/032_Square_Click.pat
33 Drum_000/033_Metronome_Click.pat
34 Drum_000/034_Metronome_Bell.pat
35 Drum_000/035_Kick_1.pat amp=100
36 Drum_000/036_Kick_2.pat amp=100
37 Drum_000/037_Stick_Rim.pat
38 Drum_000/038_Snare_1.pat
39 Drum_000/039_Clap_Hand.pat amp=100
40 Drum_000/040_Snare_2.pat
41 Drum_000/041_Tom_Low_2.pat amp=100
42 Drum_000/042_Hi-Hat_Closed.pat
43 Drum_000/043_Tom_Low_1.pat amp=100
44 Drum_000/044_Hi-Hat_Pedal.pat
45 Drum_000/045_Tom_Mid_2.pat amp=100
46 Drum_000/046_Hi-Hat_Open.pat
47 Drum_000/047_Tom_Mid_1.pat amp=100
48 Drum_000/048_Tom_High_2.pat amp=100
49 Drum_000/049_Cymbal_Crash_1.pat
50 Drum_000/050_Tom_High_1.pat amp=100
51 Drum_000/051_Cymbal_Ride_1.pat
52 Drum_000/052_Cymbal_Chinese.pat
53 Drum_000/053_Cymbal_Ride_Bell.pat amp=100
54 Drum_000/054_Tombourine.pat
55 Drum_000/055_Cymbal_Splash.pat
56 Drum_000/056_Cow_Bell.pat
57 Drum_000/057_Cymbal_Crash_2.pat
58 Drum_000/058_Vibra-Slap.pat
59 Drum_000/059_Cymbal_Ride_2.pat
60 Drum_000/060_Bongo_High.pat
61 Drum_000/061_Bongo_Low.pat
62 Drum_000/062_Conga_High_1_Mute.pat
63 Drum_000/063_Conga_High_2_Open.pat
64 Drum_000/064_Conga_Low.pat
65 Drum_000/065_Timbale_High.pat
66 Drum_000/066_Timbale_Low.pat
67 Drum_000/067_Agogo_High.pat
68 Drum_000/068_Agogo_Low.pat
69 Drum_000/069_Cabasa.pat amp=100
70 Drum_000/070_Maracas.pat
71 Drum_000/071_Whistle_1_High_Short.pat
72 Drum_000/072_Whistle_2_Low_Long.pat
73 Drum_000/073_Guiro_1_Short.pat
74 Drum_000/074_Guiro_2_Long.pat
75 Drum_000/075_Claves.pat amp=100
76 Drum_000/076_Wood_Block_1_High.pat
77 Drum_000/077_Wood_Block_2_Low.pat
78 Drum_000/078_Cuica_1_Mute.pat amp=100
79 Drum_000/079_Cuica_2_Open.pat amp=100
80 Drum_000/080_Triangle_1_Mute.pat
81 Drum_000/081_Triangle_2_Open.pat
82 Drum_000/082_Shaker.pat
84 Drum_000/084_Belltree.pat
bank 0
0 Tone_000/000_Acoustic_Grand_Piano.pat amp=120 pan=center
1 Tone_000/001_Acoustic_Brite_Piano.pat
2 Tone_000/002_Electric_Grand_Piano.pat
4 Tone_000/004_Electric_Piano_1_Rhodes.pat
5 Tone_000/005_Electric_Piano_2_Chorused_Yamaha_DX.pat
6 Tone_000/006_Harpsichord.pat
7 Tone_000/007_Clavinet.pat
8 Tone_000/008_Celesta.pat
9 Tone_000/009_Glockenspiel.pat
13 Tone_000/013_Xylophone.pat
14 Tone_000/014_Tubular_Bells.pat
15 Tone_000/015_Dulcimer.pat
16 Tone_000/016_Hammond_Organ.pat
19 Tone_000/019_Church_Organ.pat
21 Tone_000/021_Accordion.pat
23 Tone_000/023_Tango_Accordion.pat
24 Tone_000/024_Nylon_Guitar.pat
25 Tone_000/025_Steel_Guitar.pat
26 Tone_000/026_Jazz_Guitar.pat
27 Tone_000/027_Clean_Electric_Guitar.pat
28 Tone_000/028_Muted_Electric_Guitar.pat
29 Tone_000/029_Overdriven_Guitar.pat
30 Tone_000/030_Distortion_Guitar.pat
32 Tone_000/032_Acoustic_Bass.pat
33 Tone_000/033_Finger_Bass.pat
34 Tone_000/034_Pick_Bass.pat
35 Tone_000/035_Fretless_Bass.pat
36 Tone_000/036_Slap_Bass_1.pat
37 Tone_000/037_Slap_Bass_2.pat
38 Tone_000/038_Synth_Bass_1.pat
40 Tone_000/040_Violin.pat
42 Tone_000/042_Cello.pat
44 Tone_000/044_Tremolo_Strings.pat
45 Tone_000/045_Pizzicato_Strings.pat
46 Tone_000/046_Harp.pat
47 Tone_000/047_Timpani.pat
48 Tone_000/048_String_Ensemble_1_Marcato.pat
53 Tone_000/053_Voice_Oohs.pat
56 Tone_000/056_Trumpet.pat
57 Tone_000/057_Trombone.pat
58 Tone_000/058_Tuba.pat
59 Tone_000/059_Muted_Trumpet.pat
60 Tone_000/060_French_Horn.pat
61 Tone_000/061_Brass_Section.pat
64 Tone_000/064_Soprano_Sax.pat
65 Tone_000/065_Alto_Sax.pat
66 Tone_000/066_Tenor_Sax.pat
67 Tone_000/067_Baritone_Sax.pat
68 Tone_000/068_Oboe.pat
69 Tone_000/069_English_Horn.pat
70 Tone_000/070_Bassoon.pat
71 Tone_000/071_Clarinet.pat
72 Tone_000/072_Piccolo.pat
73 Tone_000/073_Flute.pat
74 Tone_000/074_Recorder.pat
75 Tone_000/075_Pan_Flute.pat
76 Tone_000/076_Bottle_Blow.pat
79 Tone_000/079_Ocarina.pat
80 Tone_000/080_Square_Wave.pat
84 Tone_000/084_Charang.pat
88 Tone_000/088_New_Age.pat
94 Tone_000/094_Halo_Pad.pat
95 Tone_000/095_Sweep_Pad.pat
98 Tone_000/098_Crystal.pat
101 Tone_000/101_Goblins--Unicorn.pat
102 Tone_000/102_Echo_Voice.pat
104 Tone_000/104_Sitar.pat
114 Tone_000/114_Steel_Drums.pat
115 Tone_000/115_Wood_Block.pat
120 Tone_000/120_Guitar_Fret_Noise.pat
122 Tone_000/122_Seashore.pat
125 Tone_000/125_Helicopter.pat
......@@ -10,27 +10,29 @@
# See documentation on how to write CMake scripts at
# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
include(LibFindMacros)
INCLUDE(LibFindMacros)
INCLUDE(CheckIncludeFiles)
libfind_pkg_check_modules(ALSA_PKGCONF alsa)
LIBFIND_PKG_CHECK_MODULES(ALSA_PKGCONF alsa)
find_path(ALSA_INCLUDE_DIR
FIND_PATH(ALSA_INCLUDE_DIR
NAMES alsa/version.h
PATHS ${ALSA_PKGCONF_INCLUDE_DIRS}
)
CHECK_INCLUDE_FILES(alsa/version.h HAVE_ALSA_H)
find_library(ALSA_LIBRARY
FIND_LIBRARY(ALSA_LIBRARY
NAMES asound
PATHS ${ALSA_PKGCONF_LIBRARY_DIRS}
)
# Extract the version number
IF(ALSA_INCLUDE_DIR)
file(READ "${ALSA_INCLUDE_DIR}/alsa/version.h" _ALSA_VERSION_H_CONTENTS)
string(REGEX REPLACE ".*#define SND_LIB_VERSION_STR[ \t]*\"([^\n]*)\".*" "\\1" ALSA_VERSION "${_ALSA_VERSION_H_CONTENTS}")
FILE(READ "${ALSA_INCLUDE_DIR}/alsa/version.h" _ALSA_VERSION_H_CONTENTS)
STRING(REGEX REPLACE ".*#define SND_LIB_VERSION_STR[ \t]*\"([^\n]*)\".*" "\\1" ALSA_VERSION "${_ALSA_VERSION_H_CONTENTS}")
ENDIF(ALSA_INCLUDE_DIR)
set(ALSA_PROCESS_INCLUDES ALSA_INCLUDE_DIR)
set(ALSA_PROCESS_LIBS ALSA_LIBRARY)
libfind_process(ALSA)
SET(ALSA_PROCESS_INCLUDES ALSA_INCLUDE_DIR)
SET(ALSA_PROCESS_LIBS ALSA_LIBRARY)
LIBFIND_PROCESS(ALSA)
......@@ -5,7 +5,13 @@
# OSS_FOUND - True if Oss found.
include(LibFindMacros)
INCLUDE(LibFindMacros)
INCLUDE(CheckIncludeFiles)
MESSAGE(STATUS "Looking for OSS...")
CHECK_INCLUDE_FILES(linux/soundcard.h HAVE_LINUX_SOUNDCARD_H)
CHECK_INCLUDE_FILES(sys/soundcard.h HAVE_SYS_SOUNDCARD_H)
CHECK_INCLUDE_FILES(machine/soundcard.h HAVE_MACHINE_SOUNDCARD_H)
FIND_PATH(LINUX_OSS_INCLUDE_DIR "linux/soundcard.h"
"/usr/include" "/usr/local/include"
......@@ -24,19 +30,16 @@ SET(OSS_FOUND FALSE)
IF(LINUX_OSS_INCLUDE_DIR)
SET(OSS_FOUND TRUE)
SET(OSS_INCLUDE_DIR ${LINUX_OSS_INCLUDE_DIR})
SET(HAVE_LINUX_SOUNDCARD_H 1)
ENDIF()
IF(SYS_OSS_INCLUDE_DIR)
SET(OSS_FOUND TRUE)
SET(OSS_INCLUDE_DIR ${SYS_OSS_INCLUDE_DIR})
SET(HAVE_SYS_SOUNDCARD_H 1)
ENDIF()
IF(MACHINE_OSS_INCLUDE_DIR)
SET(OSS_FOUND TRUE)
SET(OSS_INCLUDE_DIR ${MACHINE_OSS_INCLUDE_DIR})
SET(HAVE_MACHINE_SOUNDCARD_H 1)
ENDIF()
MARK_AS_ADVANCED (
......@@ -48,7 +51,7 @@ MARK_AS_ADVANCED (
)
IF(OSS_FOUND)
MESSAGE(STATUS "Found OSS headers...")
ENDIF()
libfind_pkg_check_modules(OSS_PKGCONF oss)
MESSAGE(STATUS "Found OSS headers.")
ELSE(OSS_FOUND)
FATAL_ERROR(STATUS "Could not find OSS headers!")
ENDIF()
\ No newline at end of file
/* include/config.h. Generated from config.h.cmake by configure. */
/* Name of package */
#define PACKAGE "wildmidi"
/* Define to the home page for this package. */
#define PACKAGE_URL "http://www.mindwerks.net/projects/wildmidi/"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "https://github.com/psi29a/wildmidi/issues"
/* Define to the full name of this package. */
#define PACKAGE_NAME "WildMidi"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "WildMidi 0.3.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "wildmidi"
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.3.0"
/* Version number of package */
#define VERSION "0.3.0"
/* Define this to the location of the wildmidi config file */
#define WILDMIDI_CFG "/etc/wildmidi/wildmidi.cfg"
/* Set our global defines here */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
/* Define this if the GCC __builtin_expect keyword is available */
#ifndef __builtin_expect
#define __builtin_expect(x,c) x
#endif
#ifndef inline
#define inline __inline
#endif
......@@ -13,16 +13,16 @@
#define PACKAGE_NAME "WildMidi"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "WildMidi @WILDMIDI_VERSION@"
#define PACKAGE_STRING "WildMidi @VERSION@"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "wildmidi"
/* Define to the version of this package. */
#define PACKAGE_VERSION "@WILDMIDI_VERSION@"
#define PACKAGE_VERSION "@VERSION@"
/* Version number of package */
#define VERSION "@WILDMIDI_VERSION@"
#define VERSION "@VERSION@"
/* Define this to the location of the wildmidi config file */
#define WILDMIDI_CFG "@WILDMIDI_CFG@"
......@@ -39,4 +39,10 @@
#ifndef inline
#define inline __inline
#endif
\ No newline at end of file
#endif
/* Define our audio drivers */
#cmakedefine HAVE_ALSA_H
#cmakedefine HAVE_LINUX_SOUNDCARD_H
#cmakedefine HAVE_SYS_SOUNDCARD_H
#cmakedefine HAVE_MACHINE_SOUNDCARD_H
\ No newline at end of file
# Setup up our config file
configure_file ("${CMAKE_SOURCE_DIR}/include/config.h.cmake" "${CMAKE_SOURCE_DIR}/include/config.h")
CONFIGURE_FILE ("${CMAKE_SOURCE_DIR}/include/config.h.cmake" "${CMAKE_SOURCE_DIR}/include/config.h")
# Setup our wildmidi library that we link to
SET(wildmidi_library_SRCS
......@@ -25,6 +25,8 @@ ADD_LIBRARY(wildmidi_static STATIC
${wildmidi_library_SRCS}
)
INSTALL(TARGETS wildmidi_static DESTINATION lib)
TARGET_LINK_LIBRARIES(wildmidi_static
${ALSA_LIBRARY}
${OSS_LIBRARY}
......@@ -37,16 +39,21 @@ IF(WIN32)
SET(LIBRARY_DYN_NAME "wildmidi_dynamic")
SET(LIBRARY_STATIC_NAME "wildmidi_static")
ELSE(WIN32)
SET(LIBRARY_DYN_NAME "WildMidi")
SET(LIBRARY_STATIC_NAME "WildMidi")
SET(LIBRARY_DYN_NAME "wildmidi")
SET(LIBRARY_STATIC_NAME "wildmidi")
ENDIF(WIN32)
SET_TARGET_PROPERTIES(wildmidi_static PROPERTIES OUTPUT_NAME ${LIBRARY_STATIC_NAME} CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(wildmidi_static PROPERTIES
OUTPUT_NAME ${LIBRARY_STATIC_NAME} CLEAN_DIRECT_OUTPUT 1
)
ADD_LIBRARY(wildmidi_dynamic SHARED
${wildmidi_library_SRCS}
)
INSTALL(TARGETS wildmidi_dynamic DESTINATION lib)
INSTALL(FILES ../include/wildmidi_lib.h DESTINATION include)
TARGET_LINK_LIBRARIES(wildmidi_dynamic
${ALSA_LIBRARY}
${OSS_LIBRARY}
......@@ -55,25 +62,29 @@ TARGET_LINK_LIBRARIES(wildmidi_dynamic
${COREFOUNDATION_LIBRARY}
)
SET_TARGET_PROPERTIES(wildmidi_dynamic PROPERTIES OUTPUT_NAME ${LIBRARY_DYN_NAME}-${WILDMIDI_VERSION} CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(wildmidi_dynamic PROPERTIES
SOVERSION ${SOVERSION}
OUTPUT_NAME ${LIBRARY_DYN_NAME} CLEAN_DIRECT_OUTPUT 1
)
# Set our default and then look at the possible locations
SET(WILDMIDILIB "${CMAKE_BINARY_DIR}/lib${LIBRARY_DYN_NAME}.so")
IF(WILDMIDI_STATIC)
IF(WANT_STATIC)
SET(WILDMIDILIB "${CMAKE_BINARY_DIR}/lib${LIBRARY_STATIC_NAME}.a")
ENDIF(WILDMIDI_STATIC)
ENDIF(WANT_STATIC)
IF(MSVC)
SET(GETOPT getopt.c getopt_long.c)
SET(WILDMIDILIB "${CMAKE_BINARY_DIR}\\${CMAKE_BUILD_TYPE}\\${LIBRARY_DYN_NAME}.lib")
IF(WILDMIDI_STATIC)
IF(WANT_STATIC)
SET(WILDMIDILIB "${CMAKE_BINARY_DIR}\\${CMAKE_BUILD_TYPE}\\${LIBRARY_STATIC_NAME}.lib")
ENDIF(WILDMIDI_STATIC)
ENDIF(WANT_STATIC)
ELSEIF(CMAKE_GENERATOR STREQUAL "Xcode")
SET(WILDMIDILIB "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/libwildmidi.dylib")
IF(WILDMIDI_STATIC)
IF(WANT_STATIC)
SET(WILDMIDILIB "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/libwildmidi.a")
ENDIF(WILDMIDI_STATIC)
ENDIF(WANT_STATIC)
ENDIF(MSVC)
# Setup our wildmidi player
......@@ -86,30 +97,33 @@ ADD_EXECUTABLE(wildmidi
${wildmidi_executable_SRCS}
)
ADD_DEPENDENCIES(wildmidi wildmidi_static wildmidi_dynamic)
ADD_DEPENDENCIES(wildmidi wildmidi_static wildmidi_dynamic)
TARGET_LINK_LIBRARIES(wildmidi
${WILDMIDILIB}
${M_LIBRARY}
${ALSA_LIBRARY}
${COREAUDIO_LIBRARY}
${COREFOUNDATION_LIBRARY}
)
# add install target:
IF (UNIX AND NOT APPLE)
SET(legacy_target "lib${LIBRARY_DYN_NAME}-${WILDMIDI_VERSION}.so")
SET(legacy_link "lib${LIBRARY_DYN_NAME}.so")
EXECUTE_PROCESS(COMMAND ln -sf ${legacy_target} ${legacy_link})
INSTALL(FILES ${CMAKE_BINARY_DIR}/${legacy_link} DESTINATION lib)
# set legacy soversion
SET(legacy_target "lib${LIBRARY_DYN_NAME}.so.${SOVERSION}")
SET(legacy_link "lib${LIBRARY_DYN_NAME}.so.1")
EXECUTE_PROCESS(COMMAND ln -sf ${legacy_target} ${legacy_link})
INSTALL(TARGETS wildmidi_static DESTINATION lib)
INSTALL(TARGETS wildmidi_dynamic DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/${legacy_link} DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/libWildMidi.so.1 DESTINATION lib)
INSTALL(TARGETS wildmidi DESTINATION bin)
# install our libraries
INSTALL(TARGETS wildmidi_static DESTINATION "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
INSTALL(TARGETS wildmidi_dynamic DESTINATION "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
# install our player if asked for
IF(WANT_PLAYER)
INSTALL(TARGETS wildmidi DESTINATION bin)
ENDIF(WANT_PLAYER)
# install supporting man pages and headers
INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/wildmidi_lib.h DESTINATION include)
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/docs/man/ DESTINATION share/man)
ENDIF (UNIX AND NOT APPLE)
\ No newline at end of file
......@@ -51,7 +51,7 @@ int msleep(unsigned long millisec);
#include <io.h>
#include "getopt_long.h"
#else
# ifdef HAVE_ALSA
# ifdef HAVE_ALSA_H
# include <alsa/asoundlib.h>
# else
# ifdef HAVE_SYS_SOUNDCARD_H
......@@ -420,7 +420,7 @@ close_mm_output ( void ) {
}
#else
#ifdef HAVE_ALSA
#ifdef HAVE_ALSA_H
void *buffer;
int bps;
......@@ -667,7 +667,7 @@ static int write_oss_output(char * output_data, int output_size) {
if ((count.ptr < counter) || (count.ptr >= (counter + 4))) {
break;
}
usleep(500);
msleep(5);
}
if (count.ptr < counter) {
free_size = max_buffer - counter;
......@@ -694,7 +694,7 @@ static void close_oss_output(void) {
audio_fd = -1;
}
#endif // HAVE_ALSA
#endif // HAVE_ALSA_H
#endif
static struct option const long_options[] = { { "version", 0, 0, 'v' }, {
......@@ -870,7 +870,7 @@ int main(int argc, char **argv) {
#if (defined _WIN32) || (defined __CYGWIN__)
if (open_mm_output() == -1) {
#else
#ifdef HAVE_ALSA
#ifdef HAVE_ALSA_H
if (open_alsa_output() == -1) {
#elif (defined HAVE_SYS_SOUNDCARD_H) || (defined HAVE_LINUX_SOUNDCARD_H) || (defined HAVE_MACHINE_SOUNDCARD_H)
if (open_oss_output() == -1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment