diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 00000000..771b4b3f
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,158 @@
+#
+# CMakeLists.txt
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+cmake_minimum_required(VERSION 2.6)
+project(MilkyTracker)
+
+# Lowercase project name for binaries and packaging
+string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
+
+# Additional CMake modules
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
+
+# Version number in format X.YY.ZZ
+set(VER_X 0)
+set(VER_YY 90)
+set(VER_ZZ 87)
+set(VER_FULL "${VER_X}.${VER_YY}.${VER_ZZ}")
+
+# Generate version header from the above
+configure_file(
+ ${PROJECT_SOURCE_DIR}/src/tracker/version.h.in
+ ${PROJECT_BINARY_DIR}/src/tracker/version.h
+)
+
+if(APPLE)
+ # Set variables for generating the Info.plist file
+ set(MACOSX_BUNDLE_BUNDLE_VERSION "${VER_FULL}")
+ set(MACOSX_BUNDLE_EXECUTABLE ${PROJECT_NAME})
+ set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.Titan.MilkyTracker")
+ set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "Application")
+ set(MACOSX_BUNDLE_ICON_FILE "carton")
+ set(MACOSX_BUNDLE_NAME ${PROJECT_NAME})
+ set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VER_FULL}")
+
+ # Carbon only required for HIToolbox/Events.h (virtual keycodes)
+ find_library(CARBON_LIBRARY Carbon)
+ find_library(COCOA_LIBRARY Cocoa)
+ find_library(CORE_AUDIO_LIBRARY CoreAudio)
+ find_library(CORE_FOUNDATION_LIBRARY CoreFoundation)
+ find_library(CORE_MIDI_LIBRARY CoreMIDI)
+ find_library(CORE_VIDEO_LIBRARY CoreVideo)
+ find_library(OPENGL_LIBRARY OpenGL)
+
+ # OS X MIDI support requires no external libraries
+ message(STATUS "Enabled MIDI support (Core MIDI)")
+ add_subdirectory(src/midi)
+elseif(WIN32)
+ # Visual C++ Compiler options
+ if(MSVC)
+ # Warn if platform toolset may not be targetting Windows XP upwards
+ if(NOT ${CMAKE_VS_PLATFORM_TOOLSET} MATCHES "xp")
+ message("WARNING:")
+ message("Your currently-selected platform toolset may generate")
+ message("executables which are incompatible with Windows XP.")
+ message("Please set your toolset to be one of v110_xp, v120_xp or")
+ message("v140_xp for VS2012, VS2013, and VS2015 respectively.")
+ message("You can do so with the '-T' argument to CMake, or by")
+ message("entering it in the CMake GUI.")
+ endif()
+
+ # Suppress secure string function warnings
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+
+ # Enable parallel compilation
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+
+ # Enable static linkage of the Microsoft Visual C/C++ Runtime
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MTd")
+ set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
+ set(
+ CMAKE_CXX_FLAGS_RELWITHDEBINFO
+ "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MTd"
+ )
+ set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT")
+ endif()
+
+ # Prevent Windows.h from clashing with the Standard Template Library so we
+ # can use std::min/std::max (see https://support.microsoft.com/kb/143208)
+ add_definitions(-DNOMINMAX)
+
+ # Windows MIDI support requires no external libraries
+ message(STATUS "Enabled MIDI support (WinMM)")
+ add_subdirectory(src/midi)
+else()
+ # Workaround for SDL bug #3295, which we might hit if the distro's SDL2
+ # package includes the sdl2-config.cmake file
+ # https://bugzilla.libsdl.org/show_bug.cgi?id=3295
+ cmake_policy(SET CMP0004 OLD)
+
+ find_package(SDL2 REQUIRED)
+endif()
+
+# Prefer static linkage under OS X for libraries located with find_package()
+if(APPLE)
+ set(SUFFIXES_ORIG ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+endif()
+
+# Under Windows we use Git Submodules to locate the decompression libraries
+if(UNIX)
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ find_package(ALSA)
+
+ # Linux MIDI support requires ALSA and RtMidi
+ if(ALSA_FOUND)
+ find_package(RTMIDI 2.1.0)
+ if(RTMIDI_FOUND)
+ message(STATUS "Enabled MIDI support (ALSA/RtMidi)")
+ add_subdirectory(src/midi)
+ else()
+ message("MIDI support disabled (RtMidi unavailable)")
+ endif()
+ else()
+ message("MIDI support disabled (ALSA unavailable)")
+ endif()
+ endif()
+
+ if(NOT APPLE)
+ find_package(JACK)
+ endif()
+ find_package(LHASA)
+ find_package(ZLIB)
+ find_package(ZZIPLIB)
+endif()
+
+# Restore library suffixes
+if(APPLE)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${SUFFIXES_ORIG})
+endif()
+
+add_subdirectory(src/compression)
+add_subdirectory(src/fx)
+add_subdirectory(src/milkyplay)
+add_subdirectory(src/ppui)
+add_subdirectory(src/tracker)
diff --git a/cmake/FindJACK.cmake b/cmake/FindJACK.cmake
new file mode 100644
index 00000000..6f709d8b
--- /dev/null
+++ b/cmake/FindJACK.cmake
@@ -0,0 +1,61 @@
+#
+# cmake/FindJACK.cmake
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+# - Try to find JACK
+# Once done this will define
+# JACK_FOUND - System has JACK
+# JACK_INCLUDE_DIRS - The JACK include directories
+# JACK_LIBRARIES - The libraries needed to use JACK
+# JACK_DEFINITIONS - Compiler switches required for using JACK
+# JACK_VERSION_STRING - The version of JACK
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_JACK QUIET jack)
+set(JACK_DEFINITIONS ${PC_JACK_CFLAGS_OTHER})
+
+find_path(
+ JACK_INCLUDE_DIR jack/jack.h
+ HINTS ${PC_JACK_INCLUDEDIR} ${PC_JACK_INCLUDE_DIRS}
+)
+
+find_library(JACK_LIBRARY NAMES jack
+ HINTS ${PC_JACK_LIBDIR} ${PC_JACK_LIBRARY_DIRS}
+)
+
+# Get version from pkg-config if possible
+if(PC_JACK_VERSION)
+ set(JACK_VERSION_STRING ${PC_JACK_VERSION})
+endif()
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(
+ JACK
+ REQUIRED_VARS JACK_LIBRARY JACK_INCLUDE_DIR
+ VERSION_VAR JACK_VERSION_STRING
+)
+
+mark_as_advanced(JACK_INCLUDE_DIR JACK_LIBRARY)
+
+if(JACK_FOUND)
+ set(JACK_LIBRARIES ${JACK_LIBRARY})
+ set(JACK_INCLUDE_DIRS ${JACK_INCLUDE_DIR})
+endif()
diff --git a/cmake/FindLHASA.cmake b/cmake/FindLHASA.cmake
new file mode 100644
index 00000000..42c1c600
--- /dev/null
+++ b/cmake/FindLHASA.cmake
@@ -0,0 +1,58 @@
+#
+# cmake/FindLHASA.cmake
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+# - Try to find lhasa
+# Once done this will define
+# LHASA_FOUND - System has zziplib
+# LHASA_INCLUDE_DIRS - The zziplib include directories
+# LHASA_LIBRARIES - The libraries needed to use zziplib
+# LHASA_DEFINITIONS - Compiler switches required for using zziplib
+# LHASA_VERSION_STRING - The version of zziplib
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_LHASA QUIET liblhasa)
+set(LHASA_DEFINITIONS ${PC_LHASA_CFLAGS_OTHER})
+
+find_path(
+ LHASA_INCLUDE_DIR lhasa.h
+ HINTS ${PC_LHASA_INCLUDEDIR} ${PC_LHASA_INCLUDE_DIRS}
+)
+
+find_library(
+ LHASA_LIBRARY NAMES lhasa
+ HINTS ${PC_LHASA_LIBDIR} ${PC_LHASA_LIBRARY_DIRS}
+)
+
+# Get version from pkg-config if possible
+set(LHASA_VERSION_STRING ${PC_LHASA_VERSION})
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(LHASA
+ REQUIRED_VARS LHASA_LIBRARY LHASA_INCLUDE_DIR
+ VERSION_VAR LHASA_VERSION_STRING)
+
+mark_as_advanced(LHASA_INCLUDE_DIR LHASA_LIBRARY)
+
+if(LHASA_FOUND)
+ set(LHASA_LIBRARIES ${LHASA_LIBRARY})
+ set(LHASA_INCLUDE_DIRS ${LHASA_INCLUDE_DIR})
+endif()
diff --git a/cmake/FindRTMIDI.cmake b/cmake/FindRTMIDI.cmake
new file mode 100644
index 00000000..8933faed
--- /dev/null
+++ b/cmake/FindRTMIDI.cmake
@@ -0,0 +1,73 @@
+#
+# cmake/FindRTMIDI.cmake
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+# - Try to find RtMidi
+# Once done this will define
+# RTMIDI_FOUND - System has RtMidi
+# RTMIDI_INCLUDE_DIRS - The RtMidi include directories
+# RTMIDI_LIBRARIES - The libraries needed to use RtMidi
+# RTMIDI_DEFINITIONS - Compiler switches required for using RtMidi
+# RTMIDI_VERSION_STRING - The version of RtMidin
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_RTMIDI QUIET rtmidi)
+set(RTMIDI_DEFINITIONS ${PC_RTMIDI_CFLAGS_OTHER})
+
+find_path(
+ RTMIDI_INCLUDE_DIR RtMidi.h
+ HINTS ${PC_RTMIDI_INCLUDEDIR} ${PC_RTMIDI_INCLUDE_DIRS}
+ PATH_SUFFIXES rtmidi
+)
+
+find_library(
+ RTMIDI_LIBRARY NAMES rtmidi
+ HINTS ${PC_RTMIDI_LIBDIR} ${PC_RTMIDI_LIBRARY_DIRS}
+)
+
+# Get version from pkg-config if possible, else scrape it from the header
+if(PC_RTMIDI_VERSION)
+ set(RTMIDI_VERSION_STRING ${PC_RTMIDI_VERSION})
+elseif(RTMIDI_INCLUDE_DIR AND EXISTS "${RTMIDI_INCLUDE_DIR}/RtMidi.h")
+ file(
+ STRINGS "${RTMIDI_INCLUDE_DIR}/RtMidi.h" RTMIDI_VERSION_LINE
+ REGEX "^// RtMidi: Version .*$"
+ )
+ string(
+ REGEX REPLACE "^.*Version (.*)$" "\\1" RTMIDI_VERSION_STRING
+ ${RTMIDI_VERSION_LINE}
+ )
+ unset(RTMIDI_VERSION_LINE)
+endif()
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(
+ RTMIDI
+ REQUIRED_VARS RTMIDI_LIBRARY RTMIDI_INCLUDE_DIR
+ VERSION_VAR RTMIDI_VERSION_STRING
+)
+
+mark_as_advanced(RTMIDI_INCLUDE_DIR RTMIDI_LIBRARY)
+
+if(RTMIDI_FOUND)
+ set(RTMIDI_LIBRARIES ${RTMIDI_LIBRARY})
+ set(RTMIDI_INCLUDE_DIRS ${RTMIDI_INCLUDE_DIR})
+endif()
diff --git a/cmake/FindSDL2.cmake b/cmake/FindSDL2.cmake
new file mode 100644
index 00000000..27c78f05
--- /dev/null
+++ b/cmake/FindSDL2.cmake
@@ -0,0 +1,104 @@
+# - Find SDL2 library and headers
+#
+# Find module for SDL 2.0 (http://www.libsdl.org/).
+# It defines the following variables:
+# SDL2_INCLUDE_DIRS - The location of the headers, e.g., SDL.h.
+# SDL2_LIBRARIES - The libraries to link against to use SDL2.
+# SDL2_FOUND - If false, do not try to use SDL2.
+# SDL2_VERSION_STRING - Human-readable string containing the version of SDL2.
+#
+# This module responds to the the flag:
+# SDL2_BUILDING_LIBRARY
+# If this is defined, then no SDL2_main will be linked in because
+# only applications need main().
+# Otherwise, it is assumed you are building an application and this
+# module will attempt to locate and set the the proper link flags
+# as part of the returned SDL2_LIBRARIES variable.
+#
+# Also defined, but not for general use are:
+# SDL2_INCLUDE_DIR - The directory that contains SDL.h.
+# SDL2_LIBRARY - The location of the SDL2 library.
+# SDL2MAIN_LIBRARY - The location of the SDL2main library.
+#
+
+#=============================================================================
+# Copyright 2013 Benjamin Eikel
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#=============================================================================
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_SDL2 QUIET sdl2)
+
+find_path(SDL2_INCLUDE_DIR
+ NAMES SDL.h
+ HINTS
+ ${PC_SDL2_INCLUDEDIR}
+ ${PC_SDL2_INCLUDE_DIRS}
+ PATH_SUFFIXES SDL2
+)
+
+find_library(SDL2_LIBRARY
+ NAMES SDL2
+ HINTS
+ ${PC_SDL2_LIBDIR}
+ ${PC_SDL2_LIBRARY_DIRS}
+ PATH_SUFFIXES x64 x86
+)
+
+if(NOT SDL2_BUILDING_LIBRARY)
+ find_library(SDL2MAIN_LIBRARY
+ NAMES SDL2main
+ HINTS
+ ${PC_SDL2_LIBDIR}
+ ${PC_SDL2_LIBRARY_DIRS}
+ PATH_SUFFIXES x64 x86
+ )
+endif()
+
+if(SDL2_INCLUDE_DIR AND EXISTS "${SDL2_INCLUDE_DIR}/SDL_version.h")
+ file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MINOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_PATCHLEVEL[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MAJOR "${SDL2_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MINOR "${SDL2_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_PATCH "${SDL2_VERSION_PATCH_LINE}")
+ set(SDL2_VERSION_STRING ${SDL2_VERSION_MAJOR}.${SDL2_VERSION_MINOR}.${SDL2_VERSION_PATCH})
+ unset(SDL2_VERSION_MAJOR_LINE)
+ unset(SDL2_VERSION_MINOR_LINE)
+ unset(SDL2_VERSION_PATCH_LINE)
+ unset(SDL2_VERSION_MAJOR)
+ unset(SDL2_VERSION_MINOR)
+ unset(SDL2_VERSION_PATCH)
+endif()
+
+set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
+set(SDL2_LIBRARIES ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY})
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(SDL2
+ REQUIRED_VARS SDL2_INCLUDE_DIR SDL2_LIBRARY
+ VERSION_VAR SDL2_VERSION_STRING)
+
+mark_as_advanced(SDL2_INCLUDE_DIR SDL2_LIBRARY)
diff --git a/cmake/FindZZIPLIB.cmake b/cmake/FindZZIPLIB.cmake
new file mode 100644
index 00000000..fa28bba9
--- /dev/null
+++ b/cmake/FindZZIPLIB.cmake
@@ -0,0 +1,72 @@
+#
+# cmake/FindZZIPLIB.cmake
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+# - Try to find zziplib
+# Once done this will define
+# ZZIPLIB_FOUND - System has zziplib
+# ZZIPLIB_INCLUDE_DIRS - The zziplib include directories
+# ZZIPLIB_LIBRARIES - The libraries needed to use zziplib
+# ZZIPLIB_DEFINITIONS - Compiler switches required for using zziplib
+# ZZIPLIB_VERSION_STRING - The version of zziplib
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_ZZIPLIB QUIET zziplib)
+set(ZZIPLIB_DEFINITIONS ${PC_ZZIPLIB_CFLAGS_OTHER})
+
+find_path(
+ ZZIPLIB_INCLUDE_DIR zzip/zzip.h
+ HINTS ${PC_ZZIPLIB_INCLUDEDIR} ${PC_ZZIPLIB_INCLUDE_DIRS}
+)
+
+find_library(
+ ZZIPLIB_LIBRARY NAMES zzip
+ HINTS ${PC_ZZIPLIB_LIBDIR} ${PC_ZZIPLIB_LIBRARY_DIRS}
+)
+
+# Get version from pkg-config if possible, else scrape it from the header
+if(PC_ZZIPLIB_VERSION)
+ set(ZZIPLIB_VERSION_STRING ${PC_ZZIPLIB_VERSION})
+elseif(ZZIPLIB_INCLUDE_DIR AND EXISTS "${ZZIPLIB_INCLUDE_DIR}/_config.h")
+ file(
+ STRINGS "${ZZIPLIB_INCLUDE_DIR}/_config.h" ZZIPLIB_VERSION_LINE
+ REGEX "^#define ZZIP_VERSION.*$"
+ )
+ string(
+ REGEX REPLACE "^.*ZZIP_VERSION.*\"([0-9.]+)\".*$" "\\1"
+ ZZIPLIB_VERSION_STRING ${ZZIPLIB_VERSION_LINE}
+ )
+ unset(ZZIPLIB_VERSION_LINE)
+endif()
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(
+ ZZIPLIB
+ REQUIRED_VARS ZZIPLIB_LIBRARY ZZIPLIB_INCLUDE_DIR
+ VERSION_VAR ZZIPLIB_VERSION_STRING
+)
+
+mark_as_advanced(ZZIPLIB_INCLUDE_DIR ZZIPLIB_LIBRARY)
+
+if(ZZIPLIB_FOUND)
+ set(ZZIPLIB_LIBRARIES ${ZZIPLIB_LIBRARY})
+ set(ZZIPLIB_INCLUDE_DIRS ${ZZIPLIB_INCLUDE_DIR})
+endif()
diff --git a/src/compression/CMakeLists.txt b/src/compression/CMakeLists.txt
new file mode 100644
index 00000000..c03ff5d3
--- /dev/null
+++ b/src/compression/CMakeLists.txt
@@ -0,0 +1,221 @@
+#
+# src/compression/CMakeLists.txt
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+set(
+ SOURCES
+ # AIFFWriter.m
+ Decompressor.cpp
+ DecompressorLZX.cpp
+ DecompressorPP20.cpp
+ DecompressorUMX.cpp
+ PP20.cpp
+ unlzx.cpp
+)
+
+set(
+ HEADERS
+ # AIFFWriter.h
+ Decompressor.h
+ DecompressorLZX.h
+ DecompressorPP20.h
+ DecompressorUMX.h
+ PP20.h
+ unlzx.h
+)
+
+# Under Windows, build sources from Git submodules if present
+if(WIN32)
+ if(EXISTS ${PROJECT_SOURCE_DIR}/src/compression/lhasa/lib/public/lhasa.h)
+ set(LHASA_FOUND ON)
+ set(LHASA_INCLUDE_DIRS lhasa/lib lhasa/lib/public)
+ set(LHASA_SOURCES
+ lhasa/lib/crc16.c
+ lhasa/lib/ext_header.c
+ lhasa/lib/lh1_decoder.c
+ lhasa/lib/lh5_decoder.c
+ lhasa/lib/lh6_decoder.c
+ lhasa/lib/lh7_decoder.c
+ lhasa/lib/lha_arch_unix.c
+ lhasa/lib/lha_arch_win32.c
+ lhasa/lib/lha_basic_reader.c
+ lhasa/lib/lha_decoder.c
+ lhasa/lib/lha_endian.c
+ lhasa/lib/lha_file_header.c
+ lhasa/lib/lha_input_stream.c
+ lhasa/lib/lha_reader.c
+ lhasa/lib/lhx_decoder.c
+ lhasa/lib/lz5_decoder.c
+ lhasa/lib/lzs_decoder.c
+ lhasa/lib/macbinary.c
+ lhasa/lib/null_decoder.c
+ lhasa/lib/pm1_decoder.c
+ lhasa/lib/pm2_decoder.c
+ )
+ set(LHASA_HEADERS
+ lhasa/lib/crc16.h
+ lhasa/lib/ext_header.h
+ lhasa/lib/lha_arch.h
+ lhasa/lib/lha_basic_reader.h
+ lhasa/lib/lha_decoder.h
+ lhasa/lib/lha_endian.h
+ lhasa/lib/lha_file_header.h
+ lhasa/lib/lha_input_stream.h
+ lhasa/lib/macbinary.h
+ lhasa/lib/public/lha_decoder.h
+ lhasa/lib/public/lha_file_header.h
+ lhasa/lib/public/lha_input_stream.h
+ lhasa/lib/public/lha_reader.h
+ lhasa/lib/public/lhasa.h
+ )
+ source_group(lhasa FILES ${LHASA_SOURCES} ${LHASA_HEADERS})
+ list(APPEND SOURCES ${LHASA_SOURCES})
+ list(APPEND HEADERS ${LHASA_HEADERS})
+ endif()
+
+ if(EXISTS ${PROJECT_SOURCE_DIR}/src/compression/zlib/generic/zlib.h)
+ set(ZLIB_FOUND ON)
+ set(ZLIB_INCLUDE_DIRS zlib/generic)
+ set(ZLIB_SOURCES
+ zlib/generic/adler32.c
+ zlib/generic/compress.c
+ zlib/generic/crc32.c
+ zlib/generic/deflate.c
+ zlib/generic/gzclose.c
+ zlib/generic/gzlib.c
+ zlib/generic/gzread.c
+ zlib/generic/gzwrite.c
+ zlib/generic/infback.c
+ zlib/generic/inffast.c
+ zlib/generic/inflate.c
+ zlib/generic/inftrees.c
+ zlib/generic/trees.c
+ zlib/generic/uncompr.c
+ zlib/generic/zutil.c
+ )
+ set(ZLIB_HEADERS
+ zlib/generic/crc32.h
+ zlib/generic/deflate.h
+ zlib/generic/gzguts.h
+ zlib/generic/inffast.h
+ zlib/generic/inffixed.h
+ zlib/generic/inflate.h
+ zlib/generic/inftrees.h
+ zlib/generic/trees.h
+ zlib/generic/zlib.h
+ zlib/generic/zutil.h
+ )
+ source_group(zlib FILES ${ZLIB_SOURCES} ${ZLIB_HEADERS})
+ list(APPEND SOURCES ${ZLIB_SOURCES})
+ list(APPEND HEADERS ${ZLIB_HEADERS})
+ endif()
+
+ if(EXISTS ${PROJECT_SOURCE_DIR}/src/compression/zziplib/generic/zzip/zzip.h)
+ set(ZZIPLIB_FOUND ON)
+ set(ZZIPLIB_INCLUDE_DIRS zziplib/generic)
+ set(ZZIPLIB_SOURCES
+ zziplib/generic/zzip/dir.c
+ zziplib/generic/zzip/err.c
+ zziplib/generic/zzip/fetch.c
+ zziplib/generic/zzip/file.c
+ zziplib/generic/zzip/fseeko.c
+ zziplib/generic/zzip/info.c
+ zziplib/generic/zzip/memdisk.c
+ zziplib/generic/zzip/mmapped.c
+ zziplib/generic/zzip/plugin.c
+ zziplib/generic/zzip/stat.c
+ zziplib/generic/zzip/write.c
+ zziplib/generic/zzip/zip.c
+ )
+ set(ZZIPLIB_HEADERS
+ zziplib/generic/zzip/__debug.h
+ zziplib/generic/zzip/__dirent.h
+ zziplib/generic/zzip/__fnmatch.h
+ zziplib/generic/zzip/__hints.h
+ zziplib/generic/zzip/__mmap.h
+ zziplib/generic/zzip/_msvc.h
+ zziplib/generic/zzip/autoconf.h
+ zziplib/generic/zzip/conf.h
+ zziplib/generic/zzip/fetch.h
+ zziplib/generic/zzip/file.h
+ zziplib/generic/zzip/format.h
+ zziplib/generic/zzip/fseeko.h
+ zziplib/generic/zzip/info.h
+ zziplib/generic/zzip/lib.h
+ zziplib/generic/zzip/memdisk.h
+ zziplib/generic/zzip/mmapped.h
+ zziplib/generic/zzip/plugin.h
+ zziplib/generic/zzip/stdint.h
+ zziplib/generic/zzip/types.h
+ zziplib/generic/zzip/write.h
+ zziplib/generic/zzip/zzip.h
+ zziplib/generic/zzip/zzip32.h
+ )
+ source_group(zziplib FILES ${ZZIPLIB_SOURCES} ${ZZIPLIB_HEADERS})
+ list(APPEND SOURCES ${ZZIPLIB_SOURCES})
+ list(APPEND HEADERS ${ZZIPLIB_HEADERS})
+ endif()
+endif()
+
+# Optional decompressors
+if(LHASA_FOUND)
+ message(STATUS "Enabled LHA decompressor")
+ list(APPEND SOURCES DecompressorLHA.cpp)
+ list(APPEND HEADERS DecompressorLHA.h)
+ include_directories(${LHASA_INCLUDE_DIRS})
+else()
+ message("LHA decompressor disabled (lhasa unavailable)")
+endif()
+
+if(ZLIB_FOUND)
+ message(STATUS "Enabled GZIP decompressor")
+ list(APPEND SOURCES DecompressorGZIP.cpp)
+ list(APPEND HEADERS DecompressorGZIP.h)
+ include_directories(${ZLIB_INCLUDE_DIRS})
+else()
+ message("GZIP decompressor disabled (zlib unvailable)")
+endif()
+
+if(ZLIB_FOUND AND ZZIPLIB_FOUND)
+ message(STATUS "Enabled ZIP decompressor")
+ list(APPEND SOURCES DecompressorZIP.cpp ZipExtractor.cpp zziplib/MyIO.cpp)
+ list(APPEND HEADERS DecompressorZIP.h ZipExtractor.h zziplib/MyIO.h)
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/compression/zziplib
+ ${ZZIPLIB_INCLUDE_DIRS}
+ )
+else()
+ if(NOT ZLIB_FOUND AND NOT ZZIPLIB_FOUND)
+ message("ZIP decompressor disabled (zlib and zziplib unavailble)")
+ elseif(ZZIPLIB_FOUND)
+ message("ZIP decompressor disabled (zlib unvailable)")
+ else()
+ message("ZIP decompressor disabled (zziplib unvailable)")
+ endif()
+endif()
+
+# Define this library as an object library; the objects will not be archived
+add_library(compression OBJECT ${SOURCES} ${HEADERS})
+
+include_directories(
+ ${PROJECT_SOURCE_DIR}/src/milkyplay
+ ${PROJECT_SOURCE_DIR}/src/ppui
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/posix
+)
diff --git a/src/fx/CMakeLists.txt b/src/fx/CMakeLists.txt
new file mode 100644
index 00000000..32c3d15f
--- /dev/null
+++ b/src/fx/CMakeLists.txt
@@ -0,0 +1,72 @@
+#
+# src/fx/CMakeLists.txt
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+set(SOURCES
+ Camera.cpp
+ Filter.cpp
+ Fire.cpp
+ Math3d.cpp
+ ParticleBlobs.cpp
+ ParticleEmitter.cpp
+ ParticleFX.cpp
+ ParticleFun.cpp
+ ParticleScene.cpp
+ Starfield.cpp
+ TCBSpline.cpp
+ TCBSplineTest.cpp
+ Texture.cpp
+ TexturedGrid.cpp
+ TexturedPlane.cpp
+ Twister.cpp
+ TwisterFX.cpp
+ fpmath.cpp
+)
+
+set(HEADERS
+ Camera.h
+ FXAbstract.h
+ FXInterface.h
+ Filter.h
+ Fire.h
+ Math3d.h
+ ParticleBlobs.h
+ ParticleEmitter.h
+ ParticleFX.h
+ ParticleFun.h
+ ParticleScene.h
+ PictureGlow.h
+ Starfield.h
+ TCBSpline.h
+ TCBSplineTest.h
+ Texture.h
+ TexturedGrid.h
+ TexturedPlane.h
+ Twister.h
+ TwisterFX.h
+ fpmath.h
+)
+
+include_directories(
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/posix
+ ${PROJECT_SOURCE_DIR}/src/ppui
+)
+
+add_library(fx ${SOURCES} ${HEADERS})
diff --git a/src/midi/CMakeLists.txt b/src/midi/CMakeLists.txt
new file mode 100644
index 00000000..67c79bea
--- /dev/null
+++ b/src/midi/CMakeLists.txt
@@ -0,0 +1,90 @@
+#
+# src/midi/CMakeLists.txt
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+set(HEADERS
+ MidiTools.h
+)
+
+# Add platform-specific sources and include paths
+if(APPLE)
+ set(
+ SOURCES
+ osx/MidiReceiver_CoreMIDI.mm
+ )
+ list(
+ APPEND HEADERS
+ osx/MidiReceiver_CoreMIDI.h
+ )
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/posix
+ )
+elseif(WIN32)
+ set(
+ SOURCES
+ win32/LongMsg.cpp
+ win32/MidiInDevice.cpp
+ win32/MidiReceiver_win32.cpp
+ win32/ShortMsg.cpp
+ )
+ list(
+ APPEND HEADERS
+ win32/LongMsg.h
+ win32/MIDIInDevice.h
+ win32/MIDIMsg.h
+ win32/MidiReceiver_win32.h
+ win32/ShortMsg.h
+ win32/midi.h
+ )
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/win32
+ )
+else()
+ set(
+ SOURCES
+ posix/MidiReceiver_pthread.cpp
+ )
+ list(
+ APPEND HEADERS
+ posix/MidiReceiver_pthread.h
+ )
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/posix
+ ${RTMIDI_INCLUDE_DIR}
+ )
+endif()
+
+include_directories(
+ ${PROJECT_SOURCE_DIR}/src/midi
+ ${PROJECT_SOURCE_DIR}/src/milkyplay
+ ${PROJECT_SOURCE_DIR}/src/ppui
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface
+ ${PROJECT_SOURCE_DIR}/src/tracker
+)
+
+add_library(midi ${SOURCES} ${HEADERS})
+
+if(APPLE)
+ target_link_libraries(midi ${CORE_MIDI_LIBRARY})
+elseif(WIN32)
+ target_link_libraries(midi winmm)
+else()
+ target_link_libraries(midi ${RTMIDI_LIBRARIES})
+endif()
diff --git a/src/milkyplay/CMakeLists.txt b/src/milkyplay/CMakeLists.txt
new file mode 100644
index 00000000..b3d9236d
--- /dev/null
+++ b/src/milkyplay/CMakeLists.txt
@@ -0,0 +1,229 @@
+#
+# src/milkyplay/CMakeLists.txt
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+set(
+ SOURCES
+ AudioDriverBase.cpp
+ AudioDriverManager.cpp
+ AudioDriver_NULL.cpp
+ AudioDriver_WAVWriter.cpp
+ ChannelMixer.cpp
+ ExporterXM.cpp
+ LittleEndian.cpp
+ Loader669.cpp
+ LoaderAMF.cpp
+ LoaderAMS.cpp
+ LoaderCBA.cpp
+ LoaderDBM.cpp
+ LoaderDIGI.cpp
+ LoaderDSM.cpp
+ LoaderDTM.cpp
+ LoaderFAR.cpp
+ LoaderGDM.cpp
+ LoaderIMF.cpp
+ LoaderIT.cpp
+ LoaderMDL.cpp
+ LoaderMOD.cpp
+ LoaderMTM.cpp
+ LoaderMXM.cpp
+ LoaderOKT.cpp
+ LoaderPLM.cpp
+ LoaderPSM.cpp
+ LoaderPTM.cpp
+ LoaderS3M.cpp
+ LoaderSTM.cpp
+ LoaderULT.cpp
+ LoaderUNI.cpp
+ LoaderXM.cpp
+ MasterMixer.cpp
+ PlayerBase.cpp
+ PlayerFAR.cpp
+ PlayerGeneric.cpp
+ PlayerIT.cpp
+ PlayerSTD.cpp
+ ResamplerFactory.cpp
+ SampleLoaderAIFF.cpp
+ SampleLoaderALL.cpp
+ SampleLoaderAbstract.cpp
+ SampleLoaderGeneric.cpp
+ SampleLoaderIFF.cpp
+ SampleLoaderWAV.cpp
+ XIInstrument.cpp
+ XMFile.cpp
+ XModule.cpp
+)
+
+set(
+ HEADERS
+ AudioDriverBase.h
+ AudioDriverManager.h
+ AudioDriver_COMPENSATE.h
+ AudioDriver_NULL.h
+ AudioDriver_WAVWriter.h
+ ChannelMixer.h
+ LittleEndian.h
+ Loaders.h
+ MasterMixer.h
+ MilkyPlay.h
+ MilkyPlayCommon.h
+ MilkyPlayResults.h
+ MilkyPlayTypes.h
+ Mixable.h
+ PlayerBase.h
+ PlayerFAR.h
+ PlayerGeneric.h
+ PlayerIT.h
+ PlayerSTD.h
+ ResamplerAmiga.h
+ ResamplerCubic.h
+ ResamplerFactory.h
+ ResamplerFast.h
+ ResamplerMacros.h
+ ResamplerSinc.h
+ SampleLoaderAIFF.h
+ SampleLoaderALL.h
+ SampleLoaderAbstract.h
+ SampleLoaderGeneric.h
+ SampleLoaderIFF.h
+ SampleLoaderWAV.h
+ XIInstrument.h
+ XMFile.h
+ XModule.h
+ computed-blep.h
+)
+
+# Add platform-specific sources, include paths and definitions
+if(APPLE)
+ list(APPEND SOURCES drivers/osx/AudioDriver_COREAUDIO.mm)
+ list(APPEND HEADERS drivers/osx/AudioDriver_COREAUDIO.h)
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/milkyplay/drivers/osx
+ )
+ message(STATUS "Enabled Core Audio support")
+elseif(WIN32)
+ # Basic WaveOut support
+ list(APPEND SOURCES drivers/windows/AudioDriver_MMSYSTEM.cpp)
+ list(APPEND HEADERS drivers/windows/AudioDriver_MMSYSTEM.h)
+ include_directories(${PROJECT_SOURCE_DIR}/src/milkyplay/drivers/windows)
+ message(STATUS "Enabled WaveOut support")
+
+ # Build sources from RtAudio Git submodule if present
+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/drivers/generic/rtaudio/RtAudio.cpp)
+ message(STATUS "Enabled RtAudio support")
+ list(
+ APPEND SOURCES
+ drivers/generic/AudioDriver_RTAUDIO.cpp
+ drivers/generic/rtaudio/include/asio.cpp
+ drivers/generic/rtaudio/include/asiodrivers.cpp
+ drivers/generic/rtaudio/include/asiolist.cpp
+ drivers/generic/rtaudio/include/iasiothiscallresolver.cpp
+ drivers/generic/rtaudio/RtAudio.cpp
+ drivers/generic/RtAudio4Impl.cpp
+ )
+ list(
+ APPEND HEADERS
+ drivers/generic/AudioDriver_RTAUDIO.h
+ drivers/generic/rtaudio/include/asio.h
+ drivers/generic/rtaudio/include/asiodrivers.h
+ drivers/generic/rtaudio/include/asiodrvr.h
+ drivers/generic/rtaudio/include/asiolist.h
+ drivers/generic/rtaudio/include/asiosys.h
+ drivers/generic/rtaudio/include/dsound.h
+ drivers/generic/rtaudio/include/FunctionDiscoveryKeys_devpkey.h
+ drivers/generic/rtaudio/include/ginclude.h
+ drivers/generic/rtaudio/include/iasiodrv.h
+ drivers/generic/rtaudio/include/iasiothiscallresolver.h
+ drivers/generic/rtaudio/include/soundcard.h
+ drivers/generic/rtaudio/RtAudio.h
+ )
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/milkyplay/drivers/generic
+ ${PROJECT_SOURCE_DIR}/src/milkyplay/drivers/generic/rtaudio
+ ${PROJECT_SOURCE_DIR}/src/milkyplay/drivers/generic/rtaudio/include
+ )
+ add_definitions(
+ -D__WINDOWS_DS__
+ -D__WINDOWS_ASIO__
+ -D__WINDOWS_WASAPI__
+ )
+ else()
+ add_definitions(-D__SKIPRTAUDIO__)
+ message("RtAudio support disabled (RtAudio unavailable)")
+ endif()
+else()
+ add_definitions(-DDRIVER_UNIX)
+
+ if(ALSA_FOUND)
+ list(APPEND SOURCES drivers/alsa/AudioDriver_ALSA.cpp)
+ list(APPEND HEADERS drivers/alsa/AudioDriver_ALSA.h)
+ add_definitions(-DHAVE_LIBASOUND)
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/milkyplay/drivers/alsa
+ ${ALSA_INCLUDE_DIRS}
+ )
+ message(STATUS "Enabled ALSA support")
+ endif()
+
+ if(JACK_FOUND)
+ list(APPEND SOURCES drivers/jack/AudioDriver_JACK.cpp)
+ list(APPEND HEADERS drivers/jack/AudioDriver_JACK.h)
+ add_definitions(-DHAVE_JACK_JACK_H)
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/milkyplay/drivers/jack
+ ${JACK_INCLUDE_DIRS}
+ )
+ message(STATUS "Enabled JACK support")
+ endif()
+
+ if(SDL2_FOUND)
+ list(APPEND SOURCES drivers/sdl/AudioDriver_SDL.cpp)
+ list(APPEND HEADERS drivers/sdl/AudioDriver_SDL.h)
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/milkyplay/drivers/sdl
+ ${SDL2_INCLUDE_DIRS}
+ )
+ message(STATUS "Enabled SDL2 support")
+ endif()
+endif()
+
+add_definitions(-DMILKYTRACKER)
+
+include_directories(
+ # Include the CMake-generated version header from the build directory
+ # (version string required when saving modules)
+ ${PROJECT_BINARY_DIR}/src/tracker
+ ${PROJECT_SOURCE_DIR}/src/milkyplay
+)
+
+add_library(milkyplay ${SOURCES} ${HEADERS})
+
+if(APPLE)
+ target_link_libraries(
+ milkyplay
+ ${COCOA_LIBRARY}
+ ${CORE_AUDIO_LIBRARY}
+ ${CORE_FOUNDATION_LIBRARY}
+ )
+elseif(WIN32)
+ target_link_libraries(milkyplay winmm dsound)
+else()
+ target_link_libraries(milkyplay ${CMAKE_DL_LIBS} ${ALSA_LIBRARIES})
+endif()
diff --git a/src/ppui/CMakeLists.txt b/src/ppui/CMakeLists.txt
new file mode 100644
index 00000000..e1100f1f
--- /dev/null
+++ b/src/ppui/CMakeLists.txt
@@ -0,0 +1,145 @@
+#
+# src/ppui/CMakeLists.txt
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+add_subdirectory(osinterface)
+
+set(
+ SOURCES
+ Button.cpp
+ CheckBox.cpp
+ Container.cpp
+ ContextMenu.cpp
+ Control.cpp
+ DialogBase.cpp
+ DialogFileSelector.cpp
+ Dictionary.cpp
+ DictionaryKey.cpp
+ Event.cpp
+ Font.cpp
+ Graphics_15BIT.cpp
+ Graphics_16BIT.cpp
+ Graphics_24bpp_generic.cpp
+ Graphics_32bpp_generic.cpp
+ Graphics_ARGB32.cpp
+ Graphics_BGR24.cpp
+ Graphics_BGR24_SLOW.cpp
+# Graphics_OGL.cpp
+ KeyboardBindingHandler.cpp
+ ListBox.cpp
+ ListBoxFileBrowser.cpp
+ Menu.cpp
+ MessageBoxContainer.cpp
+ PPUIConfig.cpp
+ RadioGroup.cpp
+ Screen.cpp
+ Scrollbar.cpp
+ Seperator.cpp
+ Slider.cpp
+ StaticText.cpp
+ Tools.cpp
+ TransparentContainer.cpp
+)
+
+set(
+ HEADERS
+ BasicTypes.h
+ Button.h
+ CheckBox.h
+ Container.h
+ ContextMenu.h
+ Control.h
+ DialogBase.h
+ DialogFileSelector.h
+ Dictionary.h
+ DictionaryKey.h
+ DisplayDeviceBase.h
+ Event.h
+ fastfill.h
+ Font.h
+ GraphicsAbstract.h
+ Graphics.h
+# Graphics_OGL.h
+ KeyBindings.h
+ KeyboardBindingHandler.h
+ ListBoxFileBrowser.h
+ ListBox.h
+ Menu.h
+ MessageBoxContainer.h
+ Object.h
+ PPPath.h
+ PPUIConfig.h
+ PPUI.h
+ RadioGroup.h
+ ScanCodes.h
+ Screen.h
+ ScrollBar.h
+ Seperator.h
+ SimpleVector.h
+ Singleton.h
+ Slider.h
+ StaticText.h
+ Tools.h
+ TransparentContainer.h
+ UndoStack.h
+ VirtualKeys.h
+)
+
+# Add platform-specific sources and include paths
+if(APPLE)
+ list(APPEND SOURCES cocoa/DisplayDevice_COCOA.mm)
+ list(APPEND HEADERS cocoa/DisplayDevice_COCOA.h)
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/posix
+ ${PROJECT_SOURCE_DIR}/src/tracker/cocoa
+ )
+elseif(WIN32)
+ list(APPEND SOURCES win32/DisplayDevice_WIN32.cpp)
+ list(APPEND HEADERS win32/DisplayDevice_WIN32.h)
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/win32
+ ${PROJECT_SOURCE_DIR}/src/milkyplay
+ )
+else()
+ list(APPEND SOURCES
+ sdl/DisplayDeviceFB_SDL.cpp
+ sdl/DisplayDevice_SDL.cpp
+ )
+ list(APPEND HEADERS
+ sdl/DisplayDeviceFB_SDL.h
+ sdl/DisplayDevice_SDL.h
+ )
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/posix
+ ${SDL2_INCLUDE_DIRS}
+ )
+endif()
+
+include_directories(
+ ${PROJECT_SOURCE_DIR}/src/ppui
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface
+)
+
+add_library(ppui ${SOURCES} ${HEADERS})
+
+target_link_libraries(
+ ppui
+ osinterface
+)
diff --git a/src/ppui/osinterface/CMakeLists.txt b/src/ppui/osinterface/CMakeLists.txt
new file mode 100644
index 00000000..b6d27eff
--- /dev/null
+++ b/src/ppui/osinterface/CMakeLists.txt
@@ -0,0 +1,110 @@
+#
+# src/ppui/osinterface/CMakeLists.txt
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+set(
+ SOURCES
+ PPPathFactory.cpp
+)
+
+set(
+ HEADERS
+ PPMessageBox.h
+ PPModalDialog.h
+ PPOpenPanel.h
+ PPPathFactory.h
+ PPQuitSaveAlert.h
+ PPSavePanel.h
+ PPSystem.h
+)
+
+# Add platform-specific sources and include paths
+if(APPLE)
+ list(APPEND SOURCES
+ cocoa/PPMessageBox_COCOA.mm
+ cocoa/PPOpenPanel_COCOA.mm
+ cocoa/PPQuitSaveAlert_COCOA.mm
+ cocoa/PPSavePanel_COCOA.mm
+ posix/PPMutex.cpp
+ posix/PPPath_POSIX.cpp
+ posix/PPSystem_POSIX.cpp
+ )
+ list(APPEND HEADERS
+ posix/PPMutex.h
+ posix/PPPath_POSIX.h
+ posix/PPSystemString_POSIX.h
+ posix/PPSystem_POSIX.h
+ )
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/posix
+ )
+elseif(WIN32)
+ list(APPEND SOURCES
+ win32/PPMessageBox_WIN32.cpp
+ win32/PPMutex.cpp
+ win32/PPOpenPanel_WIN32.cpp
+ win32/PPPath_WIN32.cpp
+ win32/PPQuitSaveAlert_WIN32.cpp
+ win32/PPSavePanel_WIN32.cpp
+ win32/PPSystem_WIN32.cpp
+ win32/WaitWindow_WIN32.cpp
+ )
+ list(APPEND HEADERS
+ win32/PPMutex.h
+ win32/PPPath_WIN32.h
+ win32/PPSystemString_WIN32.h
+ win32/PPSystem_WIN32.h
+ win32/WaitWindow_WIN32.h
+ )
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/milkyplay
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/win32
+ )
+else()
+ list(APPEND SOURCES
+ posix/PPPath_POSIX.cpp
+ posix/PPSystem_POSIX.cpp
+ sdl/PPMessageBox_SDL.cpp
+ sdl/PPMutex.cpp
+ sdl/PPOpenPanel_SDL.cpp
+ sdl/PPQuitSaveAlert_SDL.cpp
+ sdl/PPSavePanel_SDL.cpp
+ sdl/SDL_ModalLoop.cpp
+ )
+ list(APPEND HEADERS
+ posix/PPMutex.h
+ posix/PPPath_POSIX.h
+ posix/PPSystemString_POSIX.h
+ posix/PPSystem_POSIX.h
+ sdl/PPMutex.h
+ sdl/SDL_ModalLoop.h
+ )
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/posix
+ ${SDL2_INCLUDE_DIRS}
+ )
+endif()
+
+include_directories(
+ ${PROJECT_SOURCE_DIR}/src/ppui
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface
+)
+
+add_library(osinterface ${SOURCES} ${HEADERS})
diff --git a/src/tracker/CMakeLists.txt b/src/tracker/CMakeLists.txt
new file mode 100644
index 00000000..71395c11
--- /dev/null
+++ b/src/tracker/CMakeLists.txt
@@ -0,0 +1,395 @@
+#
+# src/tracker/CMakeLists.txt
+#
+# Copyright 2016 Dale Whinham
+#
+# This file is part of MilkyTracker.
+#
+# MilkyTracker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# MilkyTracker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with MilkyTracker. If not, see .
+#
+
+set(
+ SOURCES
+ AnimatedFXControl.cpp
+ ColorExportImport.cpp
+ ColorPaletteContainer.cpp
+ DialogChannelSelector.cpp
+ DialogEQ.cpp
+ DialogGroupSelection.cpp
+ DialogHandlers.cpp
+ DialogListBox.cpp
+ DialogPanning.cpp
+ DialogQuickChooseInstrument.cpp
+ DialogResample.cpp
+ DialogWithValues.cpp
+ DialogZap.cpp
+ EQConstants.cpp
+ EditorBase.cpp
+ EnvelopeContainer.cpp
+ EnvelopeEditor.cpp
+ EnvelopeEditorControl.cpp
+ Equalizer.cpp
+ FileExtProvider.cpp
+ FileIdentificator.cpp
+ GlobalColorConfig.cpp
+ InputControlListener.cpp
+ LogoBig.cpp
+ LogoSmall.cpp
+ ModuleEditor.cpp
+ ModuleServices.cpp
+ PatternEditor.cpp
+ PatternEditorClipBoard.cpp
+ PatternEditorControl.cpp
+ PatternEditorControlEventListener.cpp
+ PatternEditorControlKeyboard.cpp
+ PatternEditorControlTransposeHandler.cpp
+ PatternEditorTools.cpp
+ PatternTools.cpp
+ PeakLevelControl.cpp
+ Piano.cpp
+ PianoControl.cpp
+ PlayerController.cpp
+ PlayerLogic.cpp
+ PlayerMaster.cpp
+ RecPosProvider.cpp
+ RecorderLogic.cpp
+ ResamplerHelper.cpp
+ SampleEditor.cpp
+ SampleEditorControl.cpp
+ SampleEditorControlToolHandler.cpp
+ SampleEditorResampler.cpp
+ SamplePlayer.cpp
+ ScopesControl.cpp
+ SectionAbout.cpp
+ SectionAbstract.cpp
+ SectionAdvancedEdit.cpp
+ SectionDiskMenu.cpp
+ SectionHDRecorder.cpp
+ SectionInstruments.cpp
+ SectionOptimize.cpp
+ SectionQuickOptions.cpp
+ SectionSamples.cpp
+ SectionSettings.cpp
+ SectionSwitcher.cpp
+ SectionTranspose.cpp
+ SectionUpperLeft.cpp
+ SongLengthEstimator.cpp
+ SystemMessage.cpp
+ TabHeaderControl.cpp
+ TabManager.cpp
+ TabTitleProvider.cpp
+ TitlePageManager.cpp
+ ToolInvokeHelper.cpp
+ Tracker.cpp
+ TrackerConfig.cpp
+ TrackerInit.cpp
+ TrackerKeyboard.cpp
+ TrackerSettings.cpp
+ TrackerSettingsDatabase.cpp
+ TrackerShortCuts.cpp
+ TrackerShutDown.cpp
+ TrackerStartUp.cpp
+ TrackerUpdate.cpp
+ Undo.cpp
+ VRand.cpp
+ Zapper.cpp
+)
+
+set(
+ HEADERS
+ ${PROJECT_BINARY_DIR}/src/tracker/version.h
+ AnimatedFXControl.h
+ ColorExportImport.h
+ ColorPaletteContainer.h
+ ControlIDs.h
+ DialogChannelSelector.h
+ DialogEQ.h
+ DialogGroupSelection.h
+ DialogHandlers.h
+ DialogListBox.h
+ DialogPanning.h
+ DialogQuickChooseInstrument.h
+ DialogResample.h
+ DialogWithValues.h
+ DialogZap.h
+ EQConstants.h
+ EditModes.h
+ EditorBase.h
+ EnvelopeContainer.h
+ EnvelopeEditor.h
+ EnvelopeEditorControl.h
+ Equalizer.h
+ FileExtProvider.h
+ FileIdentificator.h
+ FileTypes.h
+ FilterParameters.h
+ GlobalColorConfig.h
+ InputControlListener.h
+ LogoBig.h
+ LogoSmall.h
+ ModuleEditor.h
+ ModuleServices.h
+ PatternEditor.h
+ PatternEditorControl.h
+ PatternEditorTools.h
+ PatternTools.h
+ PeakLevelControl.h
+ Piano.h
+ PianoControl.h
+ PlayerController.h
+ PlayerCriticalSection.h
+ PlayerLogic.h
+ PlayerMaster.h
+ RecPosProvider.h
+ RecorderLogic.h
+ ResamplerHelper.h
+ SIPButtons.h
+ SampleEditor.h
+ SampleEditorControl.h
+ SampleEditorControlLastValues.h
+ SampleEditorResampler.h
+ SamplePlayer.h
+ ScopesControl.h
+ SectionAbout.h
+ SectionAbstract.h
+ SectionAdvancedEdit.h
+ SectionDiskMenu.h
+ SectionHDRecorder.h
+ SectionInstruments.h
+ SectionOptimize.h
+ SectionQuickOptions.h
+ SectionSamples.h
+ SectionSettings.h
+ SectionSwitcher.h
+ SectionTranspose.h
+ SectionUpperLeft.h
+ SongLengthEstimator.h
+ SystemMessage.h
+ TabHeaderControl.h
+ TabManager.h
+ TabTitleProvider.h
+ TitlePageManager.h
+ ToolInvokeHelper.h
+ Tracker.h
+ TrackerConfig.h
+ TrackerSettingsDatabase.h
+ Undo.h
+ VRand.h
+ Zapper.h
+)
+
+include_directories(
+ # Include the CMake-generated version header from the build directory
+ ${PROJECT_BINARY_DIR}/src/tracker
+ ${PROJECT_SOURCE_DIR}/src/compression
+ ${PROJECT_SOURCE_DIR}/src/fx
+ ${PROJECT_SOURCE_DIR}/src/milkyplay
+ ${PROJECT_SOURCE_DIR}/src/ppui
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface
+ ${PROJECT_SOURCE_DIR}/src/ppui/sdl
+ ${PROJECT_SOURCE_DIR}/src/tracker
+)
+
+# Add the compression library.
+# The compression library is special in that each decompressor has a constructor
+# which statically self-registers the decompressor into a global decompressors
+# list. Because they are not each individually referenced in code, the linker
+# will discard them if they are archived into a static library. We could work
+# around it with compiler-specific flags such as GCC's --whole-archive or
+# Clang's --force_load, but instead we use this special CMake feature which lets
+# us easily pull in the individual objects without having to manually list them.
+list(APPEND SOURCES $)
+
+# Add platform-specific sources and include paths
+if(APPLE)
+ # If generating for Xcode, pass in the Interface Builder source as a
+ # resource and Xcode will take care of compiling it properly
+ if(${CMAKE_GENERATOR} STREQUAL "Xcode")
+ set_source_files_properties(
+ cocoa/resources/Application.xib
+ PROPERTIES
+ MACOSX_PACKAGE_LOCATION
+ Resources
+ )
+ endif()
+
+ # Application and document icons
+ file(
+ GLOB ICONS ${PROJECT_SOURCE_DIR}/resources/pictures/docicons/osx/*.icns
+ )
+ list(APPEND ICONS ${PROJECT_SOURCE_DIR}/resources/pictures/carton.icns)
+
+ # Ensure icons are copied to the correct bundle location
+ set_source_files_properties(
+ ${ICONS} PROPERTIES MACOSX_PACKAGE_LOCATION Resources
+ )
+
+ list(
+ APPEND SOURCES
+ ${ICONS}
+ cocoa/AppDelegate.mm
+ cocoa/MTKeyTranslator.mm
+ cocoa/MTTrackerView.mm
+ cocoa/main.mm
+ cocoa/resources/Application.xib
+ )
+ list(
+ APPEND HEADERS
+ cocoa/AppDelegate.h
+ cocoa/MTKeyTranslator.h
+ cocoa/MTTrackerView.h
+ )
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/midi/osx
+ ${PROJECT_SOURCE_DIR}/src/ppui/cocoa
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/posix
+ ${PROJECT_SOURCE_DIR}/src/tracker/cocoa
+ )
+elseif(WIN32)
+ list(
+ APPEND SOURCES
+ win32/PreferencesDialog.cpp
+ win32/ThreadTimer.cpp
+ win32/Win32_main.cpp
+ win32/Win32_resources.rc
+ )
+ list(
+ APPEND HEADERS
+ win32/PreferencesDialog.h
+ win32/ThreadTimer.h
+ win32/Win32_resource.h
+ )
+ include_directories(
+ ${PROJECT_SOURCE_DIR}/src/midi/win32
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/win32
+ ${PROJECT_SOURCE_DIR}/src/ppui/win32
+ )
+else()
+ list(
+ APPEND SOURCES
+ sdl/SDL_KeyTranslation.cpp
+ sdl/SDL_Main.cpp
+ )
+ list(
+ APPEND HEADERS
+ sdl/SDL_KeyTranslation.h
+ )
+ include_directories(
+ ${SDL2_INCLUDE_DIRS}
+ ${PROJECT_SOURCE_DIR}/src/ppui/osinterface/posix
+ )
+endif()
+
+add_definitions(-DMILKYTRACKER)
+
+# Set target names for the executables
+if(APPLE OR WIN32)
+ # OS X and Windows get a mixed-case binary name
+ set(TARGET_NAME ${PROJECT_NAME})
+else()
+ # Linux/other UNIX get a lower-case binary name
+ set(TARGET_NAME ${PROJECT_NAME_LOWER})
+endif()
+
+if(APPLE)
+ add_executable(${TARGET_NAME} MACOSX_BUNDLE ${SOURCES} ${HEADERS})
+
+ # Xcode can deal with Interface Builder xibs automatically - if we are not
+ # generating for Xcode, then we must manually compile and install any xibs
+ if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ # Locate ibtool
+ find_program(IBTOOL ibtool HINTS /usr/bin ${OSX_DEVELOPER_ROOT}/usr/bin)
+ if(IBTOOL STREQUAL "IBTOOL-NOTFOUND")
+ message(SEND_ERROR "Unable to find ibtool. Is Xcode installed?")
+ endif()
+
+ # The Interface Builder xib file to be compiled
+ set(
+ XIB_FILE
+ ${PROJECT_SOURCE_DIR}/src/tracker/cocoa/resources/Application.xib
+ )
+
+ # Destination for compiled xib
+ set(RESOURCES_DIR $/../Resources)
+
+ # Ensure the destination directory of the compiled xib exists
+ add_custom_command(
+ TARGET ${TARGET_NAME} PRE_BUILD COMMAND mkdir -p ${RESOURCES_DIR}
+ )
+
+ # Compile the xib file
+ add_custom_command(
+ TARGET ${TARGET_NAME} POST_BUILD COMMAND ${IBTOOL} --errors
+ --warnings --notices --output-format human-readable-text --compile
+ ${RESOURCES_DIR}/${MACOSX_BUNDLE_NSMAIN_NIB_FILE}.nib ${XIB_FILE}
+ COMMENT "Compiling ${XIB_FILE}"
+ )
+ endif()
+
+ # Pass in the Info.plist template, whose variables are defined in the
+ # top-level CMakeLists.txt
+ set_target_properties(
+ ${TARGET_NAME}
+ PROPERTIES
+ MACOSX_BUNDLE_INFO_PLIST
+ ${PROJECT_SOURCE_DIR}/src/tracker/cocoa/resources/Info.plist.in
+ )
+
+ # Enable ARC (automatic reference counting) for OS X build
+ set_property(
+ TARGET ${TARGET_NAME} APPEND_STRING PROPERTY COMPILE_FLAGS "-fobjc-arc"
+ )
+
+ target_link_libraries(
+ ${TARGET_NAME}
+ midi
+ ${CORE_VIDEO_LIBRARY}
+ ${OPENGL_LIBRARY}
+ )
+elseif(WIN32)
+ add_executable(${TARGET_NAME} WIN32 ${SOURCES} ${HEADERS})
+
+ target_link_libraries(${TARGET_NAME} midi)
+else()
+ add_executable(${TARGET_NAME} ${SOURCES} ${HEADERS})
+
+ target_link_libraries(${TARGET_NAME} ${SDL2_LIBRARIES})
+
+ if(ALSA_FOUND AND RTMIDI_FOUND)
+ add_definitions(-DHAVE_LIBASOUND)
+ target_link_libraries(${TARGET_NAME} midi ${RTMIDI_LIBRARIES})
+ endif()
+endif()
+
+if(UNIX)
+ if(ZLIB_FOUND)
+ target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES})
+ endif()
+
+ if(ZZIPLIB_FOUND)
+ target_link_libraries(${TARGET_NAME} ${ZZIPLIB_LIBRARIES})
+ endif()
+
+ if(LHASA_FOUND)
+ target_link_libraries(${TARGET_NAME} ${LHASA_LIBRARIES})
+ endif()
+endif()
+
+target_link_libraries(
+ ${TARGET_NAME}
+ fx
+ milkyplay
+ osinterface
+ ppui
+)
diff --git a/src/tracker/cocoa/MTKeyTranslator.h b/src/tracker/cocoa/MTKeyTranslator.h
index 0347ff3d..3fd3a934 100644
--- a/src/tracker/cocoa/MTKeyTranslator.h
+++ b/src/tracker/cocoa/MTKeyTranslator.h
@@ -22,7 +22,7 @@
// ------- Cocoa/OpenGL -------
#import
-#import
+#import
// ---------- Tracker ---------
#import "BasicTypes.h"
@@ -38,4 +38,4 @@ enum
@interface MTKeyTranslator : NSObject
+ (pp_uint16)toVK:(unsigned short) keyCode;
+ (pp_uint16)toSC:(unsigned short) keyCode;
-@end
\ No newline at end of file
+@end
diff --git a/src/tracker/cocoa/resources/Info.plist.in b/src/tracker/cocoa/resources/Info.plist.in
new file mode 100644
index 00000000..5d606fff
--- /dev/null
+++ b/src/tracker/cocoa/resources/Info.plist.in
@@ -0,0 +1,454 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleDocumentTypes
+
+
+ CFBundleTypeExtensions
+
+ MOD
+ mod
+
+ CFBundleTypeIconFile
+ MilkyTracker-Protracker-Module
+ CFBundleTypeName
+ Protracker Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ ULT
+ ult
+
+ CFBundleTypeIconFile
+ MilkyTracker-Ultratracker-Module
+ CFBundleTypeName
+ Ultratracker Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ PTM
+ ptm
+
+ CFBundleTypeIconFile
+ MilkyTracker-PolyTracker-Module
+ CFBundleTypeName
+ PolyTracker Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ MXM
+ mxm
+
+ CFBundleTypeIconFile
+ MilkyTracker-Cubic-Tiny-XM-Module
+ CFBundleTypeName
+ Cubic Tiny XM Modules
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ XM
+ xm
+
+ CFBundleTypeIconFile
+ MilkyTracker-Fasttracker-2-Extended-Module
+ CFBundleTypeName
+ Fasttracker 2 Extended Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ PLM
+ plm
+
+ CFBundleTypeIconFile
+ MilkyTracker-Disorder_Tracker-2-Module
+ CFBundleTypeName
+ Disorder Tracker 2 Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ GMC
+ gmc
+
+ CFBundleTypeIconFile
+ MilkyTracker-Game-Music-Creator-Module
+ CFBundleTypeName
+ Game Music Creator Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ DIGI
+ digi
+
+ CFBundleTypeIconFile
+ MilkyTracker-Digibooster-Module
+ CFBundleTypeName
+ Digibooster Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ DBM
+ dbm
+
+ CFBundleTypeIconFile
+ MilkyTracker-Digibooster-Pro-Module
+ CFBundleTypeName
+ Digibooster Pro Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ AMS
+ ams
+
+ CFBundleTypeIconFile
+ MilkyTracker-Velvet-Studio-Module
+ CFBundleTypeName
+ Velvet Studio / Extreme Tracker Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ MDL
+ mdl
+
+ CFBundleTypeIconFile
+ MilkyTracker-Digitracker-3.0-Module
+ CFBundleTypeName
+ Digitracker 3.0 Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ MTM
+ mtm
+
+ CFBundleTypeIconFile
+ MilkyTracker-Multitracker-Module
+ CFBundleTypeName
+ Multitracker Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ PSM
+ psm
+
+ CFBundleTypeIconFile
+ MilkyTracker-Epic-Megagames-MASI-Module
+ CFBundleTypeName
+ Epic Megagames MASI Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ S3M
+ s3m
+
+ CFBundleTypeIconFile
+ MilkyTracker-ScreamTracker-3-Module
+ CFBundleTypeName
+ ScreamTracker 3 Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ STM
+ stm
+
+ CFBundleTypeIconFile
+ MilkyTracker-ScreamTracker-2-Module
+ CFBundleTypeName
+ ScreamTracker 2 Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ IMF
+ imf
+
+ CFBundleTypeIconFile
+ MilkyTracker-Imago-Orpheus-Module
+ CFBundleTypeName
+ Imago Orpheus Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ OKT
+ okt
+ OKTA
+ okta
+
+ CFBundleTypeIconFile
+ MilkyTracker-Oktalyzer-Module
+ CFBundleTypeName
+ Oktalyzer Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ UNI
+ uni
+
+ CFBundleTypeIconFile
+ MilkyTracker-MikMod-Module
+ CFBundleTypeName
+ MikMod Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ DTM
+ dtm
+
+ CFBundleTypeIconFile
+ MilkyTracker-Digital-Tracker-Module
+ CFBundleTypeName
+ Digital Tracker / Digitrekker Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ AMF
+ amf
+
+ CFBundleTypeIconFile
+ MilkyTracker-Asylum-Music-Format-Module
+ CFBundleTypeName
+ Asylum Music Format Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ DSM
+ dsm
+
+ CFBundleTypeIconFile
+ MilkyTracker-Digisound-Interface-Kit-Module
+ CFBundleTypeName
+ Digisound Interface Kit Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ GDM
+ gdm
+
+ CFBundleTypeIconFile
+ MilkyTracker-General-Digimusic-Module
+ CFBundleTypeName
+ General Digimusic Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ FAR
+ far
+
+ CFBundleTypeIconFile
+ MilkyTracker-Farandole-Composer-Module
+ CFBundleTypeName
+ Farandole Composer Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ IT
+ it
+
+ CFBundleTypeIconFile
+ MilkyTracker-Impulse-Tracker-Module
+ CFBundleTypeName
+ Impulse Tracker Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ 669
+
+ CFBundleTypeIconFile
+ MilkyTracker-Composer-669-Module
+ CFBundleTypeName
+ Composer 669 Module
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ XI
+ xi
+
+ CFBundleTypeIconFile
+ MilkyTracker-Fasttracker-2-Extended-Instrument
+ CFBundleTypeName
+ Fasttracker 2 Extended Instrument
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ PAT
+ pat
+
+ CFBundleTypeIconFile
+ MilkyTracker-Gravis-Ultrasound-Patch
+ CFBundleTypeName
+ Gravis Ultrasound Patch
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ 8SVX
+ 8svx
+
+ CFBundleTypeIconFile
+ MilkyTracker-8SVX-Sample
+ CFBundleTypeName
+ 8SVX Sample
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ IFF
+ iff
+
+ CFBundleTypeIconFile
+ MilkyTracker-8SVX-Sample-IFF
+ CFBundleTypeName
+ 8SVX Sample
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ WAV
+ wav
+
+ CFBundleTypeIconFile
+ MilkyTracker-WAV-Sample
+ CFBundleTypeName
+ WAV Sample
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ XP
+ xp
+
+ CFBundleTypeIconFile
+ MilkyTracker-Fasttracker-2-Extended-Pattern
+ CFBundleTypeName
+ Fasttracker 2 Extended Pattern
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleTypeExtensions
+
+ XT
+ xt
+
+ CFBundleTypeIconFile
+ MilkyTracker-Fasttracker-2-Extended-Track
+ CFBundleTypeName
+ Fasttracker 2 Extended Track
+ CFBundleTypeRole
+ Editor
+
+
+ CFBundleExecutable
+ ${MACOSX_BUNDLE_EXECUTABLE}
+ CFBundleIconFile
+ ${MACOSX_BUNDLE_ICON_FILE}
+ CFBundleIdentifier
+ ${MACOSX_BUNDLE_GUI_IDENTIFIER}
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundlePackageType
+ APPL
+ CFBundleSignature
+ ????
+ CFBundleShortVersion
+ ${MACOSX_BUNDLE_SHORT_VERSION_STRING}
+ CFBundleVersion
+ ${MACOSX_BUNDLE_BUNDLE_VERSION}
+ CSResourcesFileMapped
+
+ LSApplicationCategoryType
+ public.app-category.music
+ NSMainNibFile
+ ${MACOSX_BUNDLE_NSMAIN_NIB_FILE}
+ NSPrincipalClass
+ NSApplication
+ NSSupportsAutomaticGraphicsSwitching
+
+
+
diff --git a/src/tracker/version.h.in b/src/tracker/version.h.in
new file mode 100644
index 00000000..fa174806
--- /dev/null
+++ b/src/tracker/version.h.in
@@ -0,0 +1,5 @@
+// 0xXYYZZ = X.YY.ZZ
+const int MILKYTRACKER_VERSION = 0x${VER_X}${VER_YY}${VER_ZZ};
+// Version string restricted to 20 chars for XM export!
+const char MILKYTRACKER_VERSION_STRING[] = "MilkyTracker ${VER_X}.${VER_YY}.${VER_ZZ}";
+// 012345678901234567890