Implemented new Syntrax/JayTrax Module decoder.
parent
bd93d120a0
commit
3c75c03b70
|
@ -191,6 +191,7 @@
|
|||
83E5E54D18087CA5001F3284 /* miniModeOnTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 83E5E54B18087CA5001F3284 /* miniModeOnTemplate.pdf */; };
|
||||
83E6B7621816136F00D4576D /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83E6B759181612FD00D4576D /* Sparkle.framework */; };
|
||||
83E6B7651816178200D4576D /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83E6B759181612FD00D4576D /* Sparkle.framework */; };
|
||||
83EEAB241C965C56002761C5 /* Syntrax.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83EEAAFA1C9651D8002761C5 /* Syntrax.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
83F9D8071A884C54007ABEC2 /* SilenceDecoder.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83F9D7F61A884B46007ABEC2 /* SilenceDecoder.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
||||
|
@ -614,6 +615,20 @@
|
|||
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
|
||||
remoteInfo = Sparkle;
|
||||
};
|
||||
83EEAAF91C9651D8002761C5 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 83EEAAF51C9651D8002761C5 /* Syntrax.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 832FF2F81C96508E0076D662;
|
||||
remoteInfo = Syntrax;
|
||||
};
|
||||
83EEAB251C965C61002761C5 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 83EEAAF51C9651D8002761C5 /* Syntrax.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 832FF2F71C96508E0076D662;
|
||||
remoteInfo = Syntrax;
|
||||
};
|
||||
83F9D7F51A884B46007ABEC2 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 83F9D7F11A884B44007ABEC2 /* SilenceDecoder.xcodeproj */;
|
||||
|
@ -681,6 +696,7 @@
|
|||
dstPath = "";
|
||||
dstSubfolderSpec = 13;
|
||||
files = (
|
||||
83EEAB241C965C56002761C5 /* Syntrax.bundle in CopyFiles */,
|
||||
83F9D8071A884C54007ABEC2 /* SilenceDecoder.bundle in CopyFiles */,
|
||||
836F5BF91A357A01002730CC /* sidplay.bundle in CopyFiles */,
|
||||
839BD010196521E600947767 /* BASSMODS.bundle in CopyFiles */,
|
||||
|
@ -985,6 +1001,7 @@
|
|||
83E5E54A18087CA5001F3284 /* miniModeOffTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = miniModeOffTemplate.pdf; path = Images/miniModeOffTemplate.pdf; sourceTree = "<group>"; };
|
||||
83E5E54B18087CA5001F3284 /* miniModeOnTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = miniModeOnTemplate.pdf; path = Images/miniModeOnTemplate.pdf; sourceTree = "<group>"; };
|
||||
83E6B750181612FD00D4576D /* Sparkle.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Sparkle.xcodeproj; path = Frameworks/Sparkle/Sparkle.xcodeproj; sourceTree = "<group>"; };
|
||||
83EEAAF51C9651D8002761C5 /* Syntrax.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Syntrax.xcodeproj; path = Plugins/Syntrax/Syntrax.xcodeproj; sourceTree = "<group>"; };
|
||||
83F9D7F11A884B44007ABEC2 /* SilenceDecoder.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SilenceDecoder.xcodeproj; path = Plugins/SilenceDecoder/SilenceDecoder.xcodeproj; sourceTree = "<group>"; };
|
||||
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
8E07AB760AAC930B00A4B32F /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PreferencesController.h; path = Preferences/PreferencesController.h; sourceTree = "<group>"; };
|
||||
|
@ -1270,6 +1287,7 @@
|
|||
17B619FF0B909ED400BC003F /* PlugIns */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
83EEAAF51C9651D8002761C5 /* Syntrax.xcodeproj */,
|
||||
835CBC7118DA79F80087A03E /* modplay.xcodeproj */,
|
||||
8360EF0017F92B23005208A4 /* HighlyComplete.xcodeproj */,
|
||||
B09E94300D747F7B0064F138 /* FFMPEG.xcodeproj */,
|
||||
|
@ -1730,6 +1748,14 @@
|
|||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
83EEAAF61C9651D8002761C5 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
83EEAAFA1C9651D8002761C5 /* Syntrax.bundle */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
83F9D7F21A884B44007ABEC2 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -1870,6 +1896,7 @@
|
|||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
83EEAB261C965C61002761C5 /* PBXTargetDependency */,
|
||||
83F9D8061A884C33007ABEC2 /* PBXTargetDependency */,
|
||||
836F5BEE1A3579F5002730CC /* PBXTargetDependency */,
|
||||
839BD012196521FD00947767 /* PBXTargetDependency */,
|
||||
|
@ -2039,6 +2066,10 @@
|
|||
ProductGroup = 83E6B751181612FD00D4576D /* Products */;
|
||||
ProjectRef = 83E6B750181612FD00D4576D /* Sparkle.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 83EEAAF61C9651D8002761C5 /* Products */;
|
||||
ProjectRef = 83EEAAF51C9651D8002761C5 /* Syntrax.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 17C808B10C3BD1C5005707C4 /* Products */;
|
||||
ProjectRef = 17C808B00C3BD1C5005707C4 /* TagLib.xcodeproj */;
|
||||
|
@ -2281,6 +2312,13 @@
|
|||
remoteRef = 83E6B760181612FD00D4576D /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
83EEAAFA1C9651D8002761C5 /* Syntrax.bundle */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = Syntrax.bundle;
|
||||
remoteRef = 83EEAAF91C9651D8002761C5 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
83F9D7F61A884B46007ABEC2 /* SilenceDecoder.bundle */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
|
@ -2641,6 +2679,11 @@
|
|||
name = Sparkle;
|
||||
targetProxy = 83E6B7631816138800D4576D /* PBXContainerItemProxy */;
|
||||
};
|
||||
83EEAB261C965C61002761C5 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = Syntrax;
|
||||
targetProxy = 83EEAB251C965C61002761C5 /* PBXContainerItemProxy */;
|
||||
};
|
||||
83F9D8061A884C33007ABEC2 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = SilenceDecoder;
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2016 Christopher Snowhill. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,400 @@
|
|||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "file.h"
|
||||
|
||||
size_t filesize;
|
||||
|
||||
Song* File_loadSong(const char *path)
|
||||
{
|
||||
Song *synSong;
|
||||
FILE *f;
|
||||
uint8_t *buffer;
|
||||
size_t size;
|
||||
|
||||
if (!(f = fopen(path, "rb"))) return NULL;
|
||||
|
||||
fseek(f, 0, SEEK_END);
|
||||
size = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
|
||||
if (!(buffer = (uint8_t *) malloc(size))) {
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fread(buffer, 1, size, f) != size) {
|
||||
free(buffer);
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
synSong = File_loadSongMem(buffer, size);
|
||||
|
||||
free(buffer);
|
||||
|
||||
return synSong;
|
||||
}
|
||||
|
||||
uint16_t get_le16(const void *p)
|
||||
{
|
||||
return (((const uint8_t*)p)[0]) +
|
||||
(((const uint8_t*)p)[1]) * 0x100;
|
||||
}
|
||||
|
||||
uint32_t get_le32(const void *p)
|
||||
{
|
||||
return (((const uint8_t*)p)[0]) +
|
||||
(((const uint8_t*)p)[1]) * 0x100 +
|
||||
(((const uint8_t*)p)[2]) * 0x10000 +
|
||||
(((const uint8_t*)p)[3]) * 0x1000000;
|
||||
}
|
||||
|
||||
static long File_readHeader(SongHeader *h, const uint8_t *buffer, size_t size)
|
||||
{
|
||||
if (size < 52) return -1;
|
||||
|
||||
h->version = get_le16(buffer);
|
||||
h->UNK00 = get_le16(buffer + 2);
|
||||
h->patNum = get_le32(buffer + 4);
|
||||
h->subsongNum = get_le32(buffer + 8);
|
||||
h->instrNum = get_le32(buffer + 12);
|
||||
h->UNK01 = get_le32(buffer + 16);
|
||||
h->UNK02 = get_le16(buffer + 20);
|
||||
h->UNK03 = get_le16(buffer + 22);
|
||||
h->UNK04 = get_le16(buffer + 24);
|
||||
h->UNK05 = get_le16(buffer + 26);
|
||||
h->UNK06 = get_le16(buffer + 28);
|
||||
h->UNK07 = get_le16(buffer + 30);
|
||||
h->UNK08 = get_le16(buffer + 32);
|
||||
h->UNK09 = get_le16(buffer + 34);
|
||||
h->UNK0A = get_le16(buffer + 36);
|
||||
h->UNK0B = get_le16(buffer + 38);
|
||||
h->UNK0C = get_le16(buffer + 40);
|
||||
h->UNK0D = get_le16(buffer + 42);
|
||||
h->UNK0E = get_le16(buffer + 44);
|
||||
h->UNK0F = get_le16(buffer + 46);
|
||||
h->UNK10 = get_le16(buffer + 48);
|
||||
h->UNK11 = get_le16(buffer + 50);
|
||||
|
||||
return 52;
|
||||
}
|
||||
|
||||
static long File_readSubSong(Subsong *subSong, const uint8_t *buffer, size_t size)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
if (size < 16564) return -1;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
subSong->UNK00[i] = get_le32(buffer + i * 4);
|
||||
|
||||
for (i = 0; i < SE_MAXCHANS; i++)
|
||||
subSong->mutedChans[i] = buffer[64 + i];
|
||||
|
||||
subSong->tempo = get_le32(buffer + 80);
|
||||
subSong->groove = get_le32(buffer + 84);
|
||||
subSong->startPosCoarse = get_le32(buffer + 88);
|
||||
subSong->startPosFine = get_le32(buffer + 92);
|
||||
subSong->endPosCoarse = get_le32(buffer + 96);
|
||||
subSong->endPosFine = get_le32(buffer + 100);
|
||||
subSong->loopPosCoarse = get_le32(buffer + 104);
|
||||
subSong->loopPosFine = get_le32(buffer + 108);
|
||||
subSong->isLooping = get_le16(buffer + 112);
|
||||
|
||||
memcpy(subSong->m_Name, buffer + 114, 32);
|
||||
subSong->m_Name[32] = '\0';
|
||||
|
||||
subSong->channelNumber = get_le16(buffer + 146);
|
||||
subSong->delayTime = get_le16(buffer + 148);
|
||||
|
||||
for (i = 0; i < SE_MAXCHANS; i++)
|
||||
subSong->chanDelayAmt[i] = buffer[150 + i];
|
||||
|
||||
subSong->amplification = get_le16(buffer + 166);
|
||||
|
||||
subSong->UNK01 = get_le16(buffer + 168);
|
||||
subSong->UNK02 = get_le16(buffer + 170);
|
||||
subSong->UNK03 = get_le16(buffer + 172);
|
||||
subSong->UNK04 = get_le16(buffer + 174);
|
||||
subSong->UNK05 = get_le16(buffer + 176);
|
||||
subSong->UNK06 = get_le16(buffer + 178);
|
||||
|
||||
for (i = 0; i < SE_MAXCHANS; i++) {
|
||||
for (j = 0; j < 0x100; j++) {
|
||||
subSong->orders[i][j].patIndex = get_le16(buffer + 180 + i * 1024 + j * 4);
|
||||
subSong->orders[i][j].patLen = get_le16(buffer + 180 + i * 1024 + j * 4 + 2);
|
||||
}
|
||||
}
|
||||
|
||||
return 16564;
|
||||
}
|
||||
|
||||
long File_readRow(Row *r, const uint8_t *buffer, size_t size)
|
||||
{
|
||||
if (size < 5) return -1;
|
||||
|
||||
r->note = buffer[0];
|
||||
r->dest = buffer[1];
|
||||
r->instr = buffer[2];
|
||||
r->spd = buffer[3];
|
||||
r->command = buffer[4];
|
||||
|
||||
return 5;
|
||||
}
|
||||
|
||||
static long File_readInstrumentEffect(InstrumentEffect *effect, const uint8_t *buffer, size_t size)
|
||||
{
|
||||
if (size < 40) return -1;
|
||||
|
||||
effect->destWave = get_le32(buffer);
|
||||
effect->srcWave1 = get_le32(buffer + 4);
|
||||
effect->srcWave2 = get_le32(buffer + 8);
|
||||
effect->oscWave = get_le32(buffer + 12);
|
||||
effect->variable1 = get_le32(buffer + 16);
|
||||
effect->variable2 = get_le32(buffer + 20);
|
||||
effect->fxSpeed = get_le32(buffer + 24);
|
||||
effect->oscSpeed = get_le32(buffer + 28);
|
||||
effect->effectType = get_le32(buffer + 32);
|
||||
effect->oscSelect = buffer[36];
|
||||
effect->resetEffect = buffer[37];
|
||||
effect->UNK00 = get_le16(buffer + 38);
|
||||
|
||||
return 40;
|
||||
}
|
||||
|
||||
static long File_readInstrument(Instrument *instr, const uint8_t *buffer, size_t size)
|
||||
{
|
||||
int i, j;
|
||||
long sizeRead;
|
||||
|
||||
if (size < 8712) return -1;
|
||||
|
||||
instr->version = get_le16(buffer);
|
||||
|
||||
memcpy(instr->name, buffer + 2, 32);
|
||||
instr->name[32] = '\0';
|
||||
|
||||
instr->waveform = get_le16(buffer + 34);
|
||||
instr->wavelength = get_le16(buffer + 36);
|
||||
instr->masterVolume = get_le16(buffer + 38);
|
||||
instr->amWave = get_le16(buffer + 40);
|
||||
instr->amSpeed = get_le16(buffer + 42);
|
||||
instr->amLoopPoint = get_le16(buffer + 44);
|
||||
instr->finetune = get_le16(buffer + 46);
|
||||
instr->fmWave = get_le16(buffer + 48);
|
||||
instr->fmSpeed = get_le16(buffer + 50);
|
||||
instr->fmLoopPoint = get_le16(buffer + 52);
|
||||
instr->fmDelay = get_le16(buffer + 54);
|
||||
instr->arpIndex = get_le16(buffer + 56);
|
||||
|
||||
for (i = 0; i < SE_MAXCHANS; i++)
|
||||
instr->m_ResetWave[i] = buffer[58 + i];
|
||||
|
||||
instr->panWave = get_le16(buffer + 74);
|
||||
instr->panSpeed = get_le16(buffer + 76);
|
||||
instr->panLoopPoint = get_le16(buffer + 78);
|
||||
instr->UNK00 = get_le16(buffer + 80);
|
||||
instr->UNK01 = get_le16(buffer + 82);
|
||||
instr->UNK02 = get_le16(buffer + 84);
|
||||
instr->UNK03 = get_le16(buffer + 86);
|
||||
instr->UNK04 = get_le16(buffer + 88);
|
||||
instr->UNK05 = get_le16(buffer + 90);
|
||||
|
||||
buffer += 92; size -= 92;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
sizeRead = File_readInstrumentEffect(&instr->effects[i], buffer, size);
|
||||
if (sizeRead < 0) return -1;
|
||||
buffer += sizeRead; size -= sizeRead;
|
||||
}
|
||||
|
||||
memcpy(instr->smpFullImportPath, buffer, 192);
|
||||
instr->smpFullImportPath[192] = '\0';
|
||||
|
||||
buffer += 192; size -= 192;
|
||||
|
||||
instr->UNK06 = get_le32(buffer);
|
||||
instr->UNK07 = get_le32(buffer + 4);
|
||||
instr->UNK08 = get_le32(buffer + 8);
|
||||
instr->UNK09 = get_le32(buffer + 12);
|
||||
instr->UNK0A = get_le32(buffer + 16);
|
||||
instr->UNK0B = get_le32(buffer + 20);
|
||||
instr->UNK0C = get_le32(buffer + 24);
|
||||
instr->UNK0D = get_le32(buffer + 28);
|
||||
instr->UNK0E = get_le32(buffer + 32);
|
||||
instr->UNK0F = get_le32(buffer + 36);
|
||||
instr->UNK10 = get_le32(buffer + 40);
|
||||
instr->UNK11 = get_le32(buffer + 44);
|
||||
instr->UNK12 = get_le16(buffer + 48);
|
||||
|
||||
buffer += 50; size -= 50;
|
||||
|
||||
instr->shareSmpDataFromInstr = get_le16(buffer);
|
||||
instr->hasLoop = get_le16(buffer + 2);
|
||||
instr->hasBidiLoop = get_le16(buffer + 4);
|
||||
|
||||
buffer += 6; size -= 6;
|
||||
|
||||
instr->smpStartPoint = get_le32(buffer);
|
||||
instr->smpLoopPoint = get_le32(buffer + 4);
|
||||
instr->smpEndPoint = get_le32(buffer + 8);
|
||||
instr->hasSample = get_le32(buffer + 12);
|
||||
instr->smpLength = get_le32(buffer + 16);
|
||||
|
||||
buffer += 20; size -= 20;
|
||||
|
||||
for (i = 0; i < SE_MAXCHANS; i++) {
|
||||
for (j = 0; j < 0x100; j++) {
|
||||
instr->synthBuffers[i][j] = get_le16(buffer + i * 512 + j * 2);
|
||||
}
|
||||
}
|
||||
|
||||
return 8712;
|
||||
}
|
||||
|
||||
Song* File_loadSongMem(const uint8_t *buffer, size_t size)
|
||||
{
|
||||
int i, j, k;
|
||||
int songVer;
|
||||
Subsong *subs;
|
||||
Order *orderCol;
|
||||
Order *order;
|
||||
Row *row;
|
||||
Instrument *instr;
|
||||
Song *synSong;
|
||||
long sizeRead;
|
||||
|
||||
synSong = (Song *) calloc(1, sizeof(Song));
|
||||
if (!synSong) return NULL;
|
||||
|
||||
/*
|
||||
//unused vars
|
||||
int8_t _local5[] = [0, 0, 0, 0, 0, 0];
|
||||
bool _local2 = false;
|
||||
int _local7 = 0;
|
||||
bool _local8 = true;
|
||||
*/
|
||||
|
||||
sizeRead = File_readHeader(&synSong->h, buffer, size);
|
||||
if (sizeRead < 0) goto FAIL;
|
||||
buffer += sizeRead; size -= sizeRead;
|
||||
|
||||
songVer = synSong->h.version;
|
||||
if ((songVer >= 3456) && (songVer <= 3457)){
|
||||
if (synSong->h.subsongNum > 0){
|
||||
synSong->subsongs = (Subsong *) malloc(synSong->h.subsongNum *sizeof(Subsong));
|
||||
if (!synSong->subsongs) goto FAIL;
|
||||
|
||||
for (i = 0; i < synSong->h.subsongNum; i++) {
|
||||
sizeRead = File_readSubSong(synSong->subsongs + i, buffer, size);
|
||||
if (sizeRead < 0) goto FAIL;
|
||||
buffer += sizeRead; size -= sizeRead;
|
||||
}
|
||||
|
||||
synSong->rows = (Row *) malloc(synSong->h.patNum * 64 *sizeof(Row));
|
||||
if (!synSong->rows) goto FAIL;
|
||||
|
||||
for (i = 0, j = synSong->h.patNum * 64; i < j; i++) {
|
||||
sizeRead = File_readRow(synSong->rows + i, buffer, size);
|
||||
if (sizeRead < 0) goto FAIL;
|
||||
buffer += sizeRead; size -= sizeRead;
|
||||
}
|
||||
|
||||
synSong->patNameSizes = (uint32_t *) malloc(synSong->h.patNum * sizeof(uint32_t));
|
||||
if (!synSong->patNameSizes) goto FAIL;
|
||||
synSong->patternNames = calloc(sizeof(char *), synSong->h.patNum);
|
||||
if (!synSong->patternNames) goto FAIL;
|
||||
|
||||
for (i = 0; i < synSong->h.patNum; i++) {
|
||||
if (size < 4) goto FAIL;
|
||||
j = synSong->patNameSizes[i] = get_le32(buffer);
|
||||
buffer += 4; size -= 4;
|
||||
|
||||
if (size < j) goto FAIL;
|
||||
|
||||
synSong->patternNames[i] = malloc(j + sizeof(char));
|
||||
if (!synSong->patternNames[i]) goto FAIL;
|
||||
|
||||
memcpy(synSong->patternNames[i], buffer, j);
|
||||
synSong->patternNames[i][j] = '\0';
|
||||
|
||||
buffer += j; size -= j;
|
||||
}
|
||||
|
||||
synSong->instruments = malloc(synSong->h.instrNum * sizeof(Instrument));
|
||||
if (!synSong->instruments) goto FAIL;
|
||||
synSong->samples = calloc(sizeof(int16_t *), synSong->h.instrNum);
|
||||
if (!synSong->samples) goto FAIL;
|
||||
|
||||
for (i = 0; i < synSong->h.instrNum; i++) {
|
||||
instr = &synSong->instruments[i];
|
||||
sizeRead = File_readInstrument(instr, buffer, size);
|
||||
if (sizeRead < 0) goto FAIL;
|
||||
buffer += sizeRead; size -= sizeRead;
|
||||
|
||||
if (songVer == 3456){
|
||||
instr->shareSmpDataFromInstr = 0;
|
||||
instr->hasLoop = 0;
|
||||
instr->hasBidiLoop = 0;
|
||||
instr->smpStartPoint = 0;
|
||||
instr->smpLoopPoint = 0;
|
||||
instr->smpEndPoint = 0;
|
||||
if (instr->hasSample){
|
||||
instr->smpStartPoint = 0;
|
||||
instr->smpEndPoint = (instr->smpLength / 2);
|
||||
instr->smpLoopPoint = 0;
|
||||
}
|
||||
}
|
||||
if (instr->hasSample){
|
||||
//instr->smpLength is in bytes, I think
|
||||
if (size < instr->smpLength) goto FAIL;
|
||||
synSong->samples[i] = malloc(instr->smpLength);
|
||||
if (!synSong->samples[i]) goto FAIL;
|
||||
memcpy(synSong->samples[i], buffer, instr->smpLength);
|
||||
buffer += instr->smpLength; size -= instr->smpLength;
|
||||
} else {
|
||||
synSong->samples[i] = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
memcpy(synSong->arpTable, buffer, 0x100);
|
||||
buffer += 0x100; size -= 0x100;
|
||||
} else goto FAIL;
|
||||
} else goto FAIL;
|
||||
|
||||
return synSong;
|
||||
|
||||
FAIL:
|
||||
File_freeSong(synSong);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void File_freeSong(Song *synSong)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (synSong) {
|
||||
if (synSong->subsongs) free(synSong->subsongs);
|
||||
if (synSong->rows) free(synSong->rows);
|
||||
if (synSong->patNameSizes) free(synSong->patNameSizes);
|
||||
if (synSong->patternNames) {
|
||||
for (i = 0; i < synSong->h.patNum; i++) {
|
||||
if (synSong->patternNames[i]) free(synSong->patternNames[i]);
|
||||
}
|
||||
free(synSong->patternNames);
|
||||
}
|
||||
if (synSong->instruments) free(synSong->instruments);
|
||||
if (synSong->samples) {
|
||||
for (i = 0; i < synSong->h.instrNum; i++) {
|
||||
if (synSong->samples[i]) free(synSong->samples[i]);
|
||||
}
|
||||
free(synSong->samples);
|
||||
}
|
||||
free(synSong);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef FILE_H
|
||||
#define FILE_H
|
||||
|
||||
#include "syntrax.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
Song* File_loadSong(const char *path);
|
||||
Song* File_loadSongMem(const uint8_t *buffer, size_t size);
|
||||
|
||||
void File_freeSong(Song *synSong);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,379 @@
|
|||
#include "resampler.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Copyright (C) 2004-2008 Shay Green.
|
||||
Copyright (C) 2015 Christopher Snowhill. This module is free software; you
|
||||
can redistribute it and/or modify it under the terms of the GNU Lesser
|
||||
General Public License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version. This
|
||||
module 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 Lesser General Public License for more
|
||||
details. You should have received a copy of the GNU Lesser General Public
|
||||
License along with this module; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#undef PI
|
||||
#define PI 3.1415926535897932384626433832795029
|
||||
|
||||
enum { imp_scale = 0x7FFF };
|
||||
typedef int16_t imp_t;
|
||||
typedef int32_t imp_off_t; /* for max_res of 512 and impulse width of 32, end offsets must be 32 bits */
|
||||
|
||||
#if RESAMPLER_BITS == 16
|
||||
typedef int32_t intermediate_t;
|
||||
#elif RESAMPLER_BITS == 32
|
||||
typedef int64_t intermediate_t;
|
||||
#endif
|
||||
|
||||
static void gen_sinc( double rolloff, int width, double offset, double spacing, double scale,
|
||||
int count, imp_t* out )
|
||||
{
|
||||
double angle;
|
||||
|
||||
double const maxh = 256;
|
||||
double const step = PI / maxh * spacing;
|
||||
double const to_w = maxh * 2 / width;
|
||||
double const pow_a_n = pow( rolloff, maxh );
|
||||
scale /= maxh * 2;
|
||||
angle = (count / 2 - 1 + offset) * -step;
|
||||
|
||||
while ( count-- )
|
||||
{
|
||||
double w;
|
||||
*out++ = 0;
|
||||
w = angle * to_w;
|
||||
if ( fabs( w ) < PI )
|
||||
{
|
||||
double rolloff_cos_a = rolloff * cos( angle );
|
||||
double num = 1 - rolloff_cos_a -
|
||||
pow_a_n * cos( maxh * angle ) +
|
||||
pow_a_n * rolloff * cos( (maxh - 1) * angle );
|
||||
double den = 1 - rolloff_cos_a - rolloff_cos_a + rolloff * rolloff;
|
||||
double sinc = scale * num / den - scale;
|
||||
|
||||
out [-1] = (imp_t) (cos( w ) * sinc + sinc);
|
||||
}
|
||||
angle += step;
|
||||
}
|
||||
}
|
||||
|
||||
enum { width = 32 };
|
||||
enum { stereo = 2 };
|
||||
enum { max_res = 512 };
|
||||
enum { min_width = (width < 4 ? 4 : width) };
|
||||
enum { adj_width = min_width / 4 * 4 + 2 };
|
||||
enum { write_offset = adj_width * stereo };
|
||||
|
||||
enum { buffer_size = 128 };
|
||||
|
||||
typedef struct _resampler
|
||||
{
|
||||
int width_;
|
||||
int rate_;
|
||||
int inptr;
|
||||
int infilled;
|
||||
int outptr;
|
||||
int outfilled;
|
||||
|
||||
int latency;
|
||||
|
||||
imp_t const* imp;
|
||||
imp_t impulses [max_res * (adj_width + 2 * (sizeof(imp_off_t) / sizeof(imp_t)))];
|
||||
sample_t buffer_in[buffer_size * stereo * 2];
|
||||
sample_t buffer_out[buffer_size * stereo];
|
||||
} resampler;
|
||||
|
||||
void * resampler_create()
|
||||
{
|
||||
resampler *r = (resampler *) malloc(sizeof(resampler));
|
||||
if (r) resampler_clear(r);
|
||||
return r;
|
||||
}
|
||||
|
||||
void * resampler_dup(const void *_r)
|
||||
{
|
||||
void *_t = (resampler *) malloc(sizeof(resampler));
|
||||
if (_t) resampler_dup_inplace(_t, _r);
|
||||
return _t;
|
||||
}
|
||||
|
||||
void resampler_dup_inplace(void *_t, const void *_r)
|
||||
{
|
||||
const resampler *r = (const resampler *)_r;
|
||||
resampler *t = (resampler *)_t;
|
||||
if (r && t)
|
||||
{
|
||||
memcpy(t, r, sizeof(resampler));
|
||||
t->imp = t->impulses + (r->imp - r->impulses);
|
||||
}
|
||||
else if (t)
|
||||
{
|
||||
resampler_clear(t);
|
||||
}
|
||||
}
|
||||
|
||||
void resampler_destroy(void *r)
|
||||
{
|
||||
free(r);
|
||||
}
|
||||
|
||||
void resampler_clear(void *_r)
|
||||
{
|
||||
resampler * r = (resampler *)_r;
|
||||
r->width_ = adj_width;
|
||||
r->inptr = 0;
|
||||
r->infilled = 0;
|
||||
r->outptr = 0;
|
||||
r->outfilled = 0;
|
||||
r->latency = 0;
|
||||
r->imp = r->impulses;
|
||||
|
||||
resampler_set_rate(r, 1.0);
|
||||
}
|
||||
|
||||
void resampler_set_rate( void *_r, double new_factor )
|
||||
{
|
||||
int step; //const
|
||||
double filter; //const
|
||||
double fraction, pos;
|
||||
int n;
|
||||
|
||||
resampler *rs = (resampler *)_r;
|
||||
imp_t* out;
|
||||
|
||||
double const rolloff = 0.999;
|
||||
double const gain = 1.0;
|
||||
|
||||
/* determine number of sub-phases that yield lowest error */
|
||||
double ratio_ = 0.0;
|
||||
int res = -1;
|
||||
{
|
||||
double least_error = 2;
|
||||
double pos = 0;
|
||||
int r;
|
||||
for ( r = 1; r <= max_res; r++ )
|
||||
{
|
||||
double nearest, error;
|
||||
pos += new_factor;
|
||||
nearest = floor( pos + 0.5 );
|
||||
error = fabs( pos - nearest );
|
||||
if ( error < least_error )
|
||||
{
|
||||
res = r;
|
||||
ratio_ = nearest / res;
|
||||
least_error = error;
|
||||
}
|
||||
}
|
||||
}
|
||||
rs->rate_ = ratio_;
|
||||
|
||||
/* how much of input is used for each output sample */
|
||||
step = stereo * (int) floor( ratio_ );
|
||||
fraction = fmod( ratio_, 1.0 );
|
||||
|
||||
filter = (ratio_ < 1.0) ? 1.0 : 1.0 / ratio_;
|
||||
pos = 0.0;
|
||||
/*int input_per_cycle = 0;*/
|
||||
out = rs->impulses;
|
||||
|
||||
for ( n = res; --n >= 0; )
|
||||
{
|
||||
int cur_step;
|
||||
|
||||
gen_sinc( rolloff, (int) (rs->width_ * filter + 1) & ~1, pos, filter,
|
||||
(double)(imp_scale * gain * filter), (int) rs->width_, out );
|
||||
out += rs->width_;
|
||||
|
||||
cur_step = step;
|
||||
pos += fraction;
|
||||
if ( pos >= 0.9999999 )
|
||||
{
|
||||
pos -= 1.0;
|
||||
cur_step += stereo;
|
||||
}
|
||||
|
||||
((imp_off_t*)out)[0] = (cur_step - rs->width_ * 2 + 4) * sizeof (sample_t);
|
||||
((imp_off_t*)out)[1] = 2 * sizeof (imp_t) + 2 * sizeof (imp_off_t);
|
||||
out += 2 * (sizeof(imp_off_t) / sizeof(imp_t));
|
||||
/*input_per_cycle += cur_step;*/
|
||||
}
|
||||
/* last offset moves back to beginning of impulses*/
|
||||
((imp_off_t*)out) [-1] -= (char*) out - (char*) rs->impulses;
|
||||
|
||||
rs->imp = rs->impulses;
|
||||
}
|
||||
|
||||
int resampler_get_free(void *_r)
|
||||
{
|
||||
resampler *r = (resampler *)_r;
|
||||
return buffer_size * stereo - r->infilled;
|
||||
}
|
||||
|
||||
int resampler_get_min_fill(void *_r)
|
||||
{
|
||||
resampler *r = (resampler *)_r;
|
||||
const int min_needed = write_offset + stereo;
|
||||
const int latency = r->latency ? 0 : adj_width;
|
||||
int min_free = min_needed - r->infilled - latency;
|
||||
return min_free < 0 ? 0 : min_free;
|
||||
}
|
||||
|
||||
void resampler_write_pair(void *_r, sample_t ls, sample_t rs)
|
||||
{
|
||||
resampler *r = (resampler *)_r;
|
||||
|
||||
if (!r->latency)
|
||||
{
|
||||
int i;
|
||||
for ( i = 0; i < adj_width / 2; ++i)
|
||||
{
|
||||
r->buffer_in[r->inptr + 0] = 0;
|
||||
r->buffer_in[r->inptr + 1] = 0;
|
||||
r->buffer_in[buffer_size * stereo + r->inptr + 0] = 0;
|
||||
r->buffer_in[buffer_size * stereo + r->inptr + 1] = 0;
|
||||
r->inptr = (r->inptr + stereo) % (buffer_size * stereo);
|
||||
r->infilled += stereo;
|
||||
}
|
||||
r->latency = 1;
|
||||
}
|
||||
|
||||
if (r->infilled < buffer_size * stereo)
|
||||
{
|
||||
r->buffer_in[r->inptr + 0] = ls;
|
||||
r->buffer_in[r->inptr + 1] = rs;
|
||||
r->buffer_in[buffer_size * stereo + r->inptr + 0] = ls;
|
||||
r->buffer_in[buffer_size * stereo + r->inptr + 1] = rs;
|
||||
r->inptr = (r->inptr + stereo) % (buffer_size * stereo);
|
||||
r->infilled += stereo;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER) || defined(__GNUC__)
|
||||
#define restrict __restrict
|
||||
#endif
|
||||
|
||||
static const sample_t * resampler_inner_loop( resampler *r, sample_t** out_,
|
||||
sample_t const* out_end, sample_t const in [], int in_size )
|
||||
{
|
||||
in_size -= write_offset;
|
||||
if ( in_size > 0 )
|
||||
{
|
||||
sample_t* restrict out = *out_;
|
||||
sample_t const* const in_end = in + in_size;
|
||||
imp_t const* imp = r->imp;
|
||||
|
||||
do
|
||||
{
|
||||
int n;
|
||||
/* accumulate in extended precision*/
|
||||
int pt = imp [0];
|
||||
intermediate_t l = (intermediate_t)pt * (intermediate_t)(in [0]);
|
||||
intermediate_t r = (intermediate_t)pt * (intermediate_t)(in [1]);
|
||||
if ( out >= out_end )
|
||||
break;
|
||||
for ( n = (adj_width - 2) / 2; n; --n )
|
||||
{
|
||||
pt = imp [1];
|
||||
l += (intermediate_t)pt * (intermediate_t)(in [2]);
|
||||
r += (intermediate_t)pt * (intermediate_t)(in [3]);
|
||||
|
||||
/* pre-increment more efficient on some RISC processors*/
|
||||
imp += 2;
|
||||
pt = imp [0];
|
||||
r += (intermediate_t)pt * (intermediate_t)(in [5]);
|
||||
in += 4;
|
||||
l += (intermediate_t)pt * (intermediate_t)(in [0]);
|
||||
}
|
||||
pt = imp [1];
|
||||
l += (intermediate_t)pt * (intermediate_t)(in [2]);
|
||||
r += (intermediate_t)pt * (intermediate_t)(in [3]);
|
||||
|
||||
/* these two "samples" after the end of the impulse give the
|
||||
* proper offsets to the next input sample and next impulse */
|
||||
in = (sample_t const*) ((char const*) in + ((imp_off_t*)(&imp [2]))[0]); /* some negative value */
|
||||
imp = (imp_t const*) ((char const*) imp + ((imp_off_t*)(&imp [2]))[1]); /* small positive or large negative */
|
||||
|
||||
out [0] = (sample_t) (l >> 15);
|
||||
out [1] = (sample_t) (r >> 15);
|
||||
out += 2;
|
||||
}
|
||||
while ( in < in_end );
|
||||
|
||||
r->imp = imp;
|
||||
*out_ = out;
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
#undef restrict
|
||||
|
||||
static int resampler_wrapper( resampler *r, sample_t out [], int* out_size,
|
||||
sample_t const in [], int in_size )
|
||||
{
|
||||
sample_t* out_ = out;
|
||||
int result = resampler_inner_loop( r, &out_, out + *out_size, in, in_size ) - in;
|
||||
|
||||
*out_size = out_ - out;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void resampler_fill( resampler *r )
|
||||
{
|
||||
while (!r->outfilled && r->infilled)
|
||||
{
|
||||
int inread;
|
||||
|
||||
int writepos = ( r->outptr + r->outfilled ) % (buffer_size * stereo);
|
||||
int writesize = (buffer_size * stereo) - writepos;
|
||||
if ( writesize > ( buffer_size * stereo - r->outfilled ) )
|
||||
writesize = buffer_size * stereo - r->outfilled;
|
||||
inread = resampler_wrapper(r, &r->buffer_out[writepos], &writesize, &r->buffer_in[buffer_size * stereo + r->inptr - r->infilled], r->infilled);
|
||||
r->infilled -= inread;
|
||||
r->outfilled += writesize;
|
||||
if (!inread)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int resampler_get_avail(void *_r)
|
||||
{
|
||||
resampler *r = (resampler *)_r;
|
||||
if (r->outfilled < stereo && r->infilled >= r->width_)
|
||||
resampler_fill( r );
|
||||
return r->outfilled;
|
||||
}
|
||||
|
||||
static void resampler_read_pair_internal( resampler *r, sample_t *ls, sample_t *rs, int advance )
|
||||
{
|
||||
if (r->outfilled < stereo)
|
||||
resampler_fill( r );
|
||||
if (r->outfilled < stereo)
|
||||
{
|
||||
*ls = 0;
|
||||
*rs = 0;
|
||||
return;
|
||||
}
|
||||
*ls = r->buffer_out[r->outptr + 0];
|
||||
*rs = r->buffer_out[r->outptr + 1];
|
||||
if (advance)
|
||||
{
|
||||
r->outptr = (r->outptr + 2) % (buffer_size * stereo);
|
||||
r->outfilled -= stereo;
|
||||
}
|
||||
}
|
||||
|
||||
void resampler_read_pair( void *_r, sample_t *ls, sample_t *rs )
|
||||
{
|
||||
resampler *r = (resampler *)_r;
|
||||
resampler_read_pair_internal(r, ls, rs, 1);
|
||||
}
|
||||
|
||||
void resampler_peek_pair( void *_r, sample_t *ls, sample_t *rs )
|
||||
{
|
||||
resampler *r = (resampler *)_r;
|
||||
resampler_read_pair_internal(r, ls, rs, 0);
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
#ifndef _RESAMPLER_H_
|
||||
#define _RESAMPLER_H_
|
||||
|
||||
/* Copyright (C) 2004-2008 Shay Green.
|
||||
Copyright (C) 2015 Christopher Snowhill. This module is free software; you
|
||||
can redistribute it and/or modify it under the terms of the GNU Lesser
|
||||
General Public License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version. This
|
||||
module 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 Lesser General Public License for more
|
||||
details. You should have received a copy of the GNU Lesser General Public
|
||||
License along with this module; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#define RESAMPLER_BITS 32
|
||||
#define RESAMPLER_DECORATE syntrax
|
||||
|
||||
#ifdef RESAMPLER_DECORATE
|
||||
#undef PASTE
|
||||
#undef EVALUATE
|
||||
#define PASTE(a,b) a ## b
|
||||
#define EVALUATE(a,b) PASTE(a,b)
|
||||
#define resampler_create EVALUATE(RESAMPLER_DECORATE,_resampler_create)
|
||||
#define resampler_dup EVALUATE(RESAMPLER_DECORATE,_resampler_dup)
|
||||
#define resampler_dup_inplace EVALUATE(RESAMPLER_DECORATE,_resampler_dup_inplace)
|
||||
#define resampler_destroy EVALUATE(RESAMPLER_DECORATE,_resampler_destroy)
|
||||
#define resampler_clear EVALUATE(RESAMPLER_DECORATE,_resampler_clear)
|
||||
#define resampler_set_rate EVALUATE(RESAMPLER_DECORATE,_resampler_set_rate)
|
||||
#define resampler_get_free EVALUATE(RESAMPLER_DECORATE,_resampler_get_free)
|
||||
#define resampler_get_min_fill EVALUATE(RESAMPLER_DECORATE,_resampler_get_min_fill)
|
||||
#define resampler_write_pair EVALUATE(RESAMPLER_DECORATE,_resampler_write_pair)
|
||||
#define resampler_get_avail EVALUATE(RESAMPLER_DECORATE,_resampler_get_avail)
|
||||
#define resampler_read_pair EVALUATE(RESAMPLER_DECORATE,_resampler_read_pair)
|
||||
#define resampler_peek_pair EVALUATE(RESAMPLER_DECORATE,_resampler_peek_pair)
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if RESAMPLER_BITS == 16
|
||||
typedef int16_t sample_t;
|
||||
#elif RESAMPLER_BITS == 32
|
||||
typedef int32_t sample_t;
|
||||
#else
|
||||
#error Choose a bit depth!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void * resampler_create();
|
||||
void * resampler_dup(const void *);
|
||||
void resampler_dup_inplace(void *, const void *);
|
||||
void resampler_destroy(void *);
|
||||
|
||||
void resampler_clear(void *);
|
||||
|
||||
void resampler_set_rate( void *, double new_factor );
|
||||
|
||||
int resampler_get_free(void *);
|
||||
int resampler_get_min_fill(void *);
|
||||
|
||||
void resampler_write_pair(void *, sample_t ls, sample_t rs);
|
||||
|
||||
int resampler_get_avail(void *);
|
||||
|
||||
void resampler_read_pair( void *, sample_t *ls, sample_t *rs );
|
||||
void resampler_peek_pair( void *, sample_t *ls, sample_t *rs );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,365 @@
|
|||
#ifndef SYNTRAX_H
|
||||
#define SYNTRAX_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
//----------------------------typedefs-------------------------
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
typedef unsigned uint;
|
||||
#ifndef __cplusplus
|
||||
typedef enum { false, true } bool;
|
||||
#endif
|
||||
|
||||
//----------------------------defines--------------------------
|
||||
#define SE_NROFEFFECTS 18
|
||||
#define SE_MAXCHANS 16
|
||||
#define SE_NROFFINETUNESTEPS 16
|
||||
|
||||
#define SE_OVERLAP 100
|
||||
|
||||
#define BUFFERLENGTH 4096
|
||||
#define CHANNELS 2
|
||||
#define BITRATE 16
|
||||
#define RESAMPLE_POINTS 4
|
||||
|
||||
//some constants for controlling stuff
|
||||
//I've no idea what the abreviations stand for
|
||||
#define SE_PM_SONG 0
|
||||
#define SE_PM_PATTERN 1
|
||||
|
||||
|
||||
//---------------------------structures------------------------
|
||||
//player structs
|
||||
//don't pack these
|
||||
typedef struct
|
||||
{
|
||||
int wavelength;
|
||||
int gainDelay;
|
||||
int delta;
|
||||
int freq;
|
||||
int isSample;
|
||||
int isPlayingBackward;
|
||||
int smpLoopEnd;
|
||||
int PPMXBYLQ; //unused
|
||||
int gain;
|
||||
const int16_t *waveBuff;
|
||||
int hasBidiLoop;
|
||||
int synthPos;
|
||||
int gainRight;
|
||||
int smpLoopStart;
|
||||
int bkpSynthPos;
|
||||
int sampPos;
|
||||
int gainLeft;
|
||||
int hasLoop;
|
||||
int smpLength;
|
||||
int gainDelayRight;
|
||||
int gainDelayLeft;
|
||||
int hasLooped;
|
||||
void * resampler[2];
|
||||
int last_delta;
|
||||
} Voice;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int VMBNMTNBQU;
|
||||
int TIPUANVVR;
|
||||
double MDTMBBIQHRQ;
|
||||
double YLKJB;
|
||||
double DQVLFV;
|
||||
int MFATTMREMVP;
|
||||
double ILHG;
|
||||
double RKF;
|
||||
int SPYK;
|
||||
int QOMCBTRPXF;
|
||||
int ABJGHAUY;
|
||||
} VoiceEffect;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int JOEEPJCI;
|
||||
int BNWIGU;
|
||||
int isPlayingBackward;
|
||||
int ELPHLDR;
|
||||
int panning;
|
||||
int TVORFCC;
|
||||
int EYRXAB; //rather unused
|
||||
int UHYDBDDI;
|
||||
int XESAWSO;
|
||||
int hasBidiLoop;
|
||||
int fmDelay;
|
||||
int volume;
|
||||
int ACKCWV;
|
||||
int sampPos;
|
||||
int insNum;
|
||||
uint8_t EQMIWERPIF;
|
||||
int freq;
|
||||
int HFRLJCG;
|
||||
int VNVJPDIWAJQ;
|
||||
int hasLoop;
|
||||
int LJHG;
|
||||
const int16_t *sampleBuffer;
|
||||
//SQUASH effect overflows into next buffer
|
||||
//SE_MAXCHANS * 0x100 + 1 must be allocated
|
||||
int16_t synthBuffers[SE_MAXCHANS][0x100];
|
||||
int16_t OVERFLOW_DUMMY;
|
||||
int smpLoopStart;
|
||||
int smpLoopEnd;
|
||||
int hasLooped;
|
||||
VoiceEffect effects[4];
|
||||
} TuneChannel;
|
||||
|
||||
|
||||
//data structs
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t destWave;
|
||||
uint32_t srcWave1;
|
||||
uint32_t srcWave2;
|
||||
uint32_t oscWave;
|
||||
uint32_t variable1;
|
||||
uint32_t variable2;
|
||||
uint32_t fxSpeed;
|
||||
uint32_t oscSpeed;
|
||||
uint32_t effectType;
|
||||
int8_t oscSelect;
|
||||
int8_t resetEffect;
|
||||
int16_t UNK00;
|
||||
} InstrumentEffect;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int16_t version;
|
||||
char name[33];
|
||||
int16_t waveform;
|
||||
int16_t wavelength;
|
||||
int16_t masterVolume;
|
||||
int16_t amWave;
|
||||
int16_t amSpeed;
|
||||
int16_t amLoopPoint;
|
||||
int16_t finetune;
|
||||
int16_t fmWave;
|
||||
int16_t fmSpeed;
|
||||
int16_t fmLoopPoint;
|
||||
int16_t fmDelay;
|
||||
int16_t arpIndex;
|
||||
uint8_t m_ResetWave[SE_MAXCHANS];
|
||||
int16_t panWave;
|
||||
int16_t panSpeed;
|
||||
int16_t panLoopPoint;
|
||||
int16_t UNK00;
|
||||
int16_t UNK01;
|
||||
int16_t UNK02;
|
||||
int16_t UNK03;
|
||||
int16_t UNK04;
|
||||
int16_t UNK05;
|
||||
InstrumentEffect effects[4];
|
||||
//why do we even need to store a full path?
|
||||
//only filename appears to be used.
|
||||
char smpFullImportPath[193];
|
||||
uint32_t UNK06;
|
||||
uint32_t UNK07;
|
||||
uint32_t UNK08;
|
||||
uint32_t UNK09;
|
||||
uint32_t UNK0A;
|
||||
uint32_t UNK0B;
|
||||
uint32_t UNK0C;
|
||||
uint32_t UNK0D;
|
||||
uint32_t UNK0E;
|
||||
uint32_t UNK0F;
|
||||
uint32_t UNK10;
|
||||
uint32_t UNK11;
|
||||
int16_t UNK12;
|
||||
int16_t shareSmpDataFromInstr; //0 is off
|
||||
int16_t hasLoop;
|
||||
int16_t hasBidiLoop;
|
||||
uint32_t smpStartPoint;
|
||||
uint32_t smpLoopPoint;
|
||||
uint32_t smpEndPoint;
|
||||
uint32_t hasSample;
|
||||
uint32_t smpLength;
|
||||
int16_t synthBuffers[SE_MAXCHANS][0x100];
|
||||
} Instrument;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t note;
|
||||
uint8_t dest;
|
||||
uint8_t instr;
|
||||
int8_t spd;
|
||||
uint8_t command;
|
||||
} Row;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t patIndex; //0 means empty
|
||||
uint16_t patLen;
|
||||
} Order;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t UNK00[16];
|
||||
//UNK00 is used for something. No idea what.
|
||||
//There is a sequence to the data in it.
|
||||
//zeroing it out with hex editor doesn't seem to break stuff with Jaytrax
|
||||
//it could as well be uninitialized memory
|
||||
uint8_t mutedChans[SE_MAXCHANS];
|
||||
uint32_t tempo;
|
||||
uint32_t groove;
|
||||
uint32_t startPosCoarse;
|
||||
uint32_t startPosFine;
|
||||
uint32_t endPosCoarse;
|
||||
uint32_t endPosFine;
|
||||
uint32_t loopPosCoarse;
|
||||
uint32_t loopPosFine;
|
||||
int16_t isLooping;
|
||||
char m_Name[33];
|
||||
int16_t channelNumber;
|
||||
uint16_t delayTime;
|
||||
uint8_t chanDelayAmt[SE_MAXCHANS];
|
||||
int16_t amplification;
|
||||
int16_t UNK01;
|
||||
int16_t UNK02;
|
||||
int16_t UNK03;
|
||||
int16_t UNK04;
|
||||
int16_t UNK05;
|
||||
int16_t UNK06;
|
||||
//if my eyes don't deceive me, this actually happens
|
||||
//waste of space
|
||||
Order orders[SE_MAXCHANS][0x100];
|
||||
} Subsong;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t version;
|
||||
uint16_t UNK00;
|
||||
uint32_t patNum;
|
||||
uint32_t subsongNum;
|
||||
uint32_t instrNum;
|
||||
uint32_t UNK01;
|
||||
int16_t UNK02;
|
||||
int16_t UNK03;
|
||||
int16_t UNK04;
|
||||
int16_t UNK05;
|
||||
int16_t UNK06;
|
||||
int16_t UNK07;
|
||||
int16_t UNK08;
|
||||
int16_t UNK09;
|
||||
int16_t UNK0A;
|
||||
int16_t UNK0B;
|
||||
int16_t UNK0C;
|
||||
int16_t UNK0D;
|
||||
int16_t UNK0E;
|
||||
int16_t UNK0F;
|
||||
int16_t UNK10;
|
||||
int16_t UNK11;
|
||||
} SongHeader;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SongHeader h;
|
||||
int8_t arpTable[0x100];
|
||||
|
||||
Row *rows;
|
||||
//we don't know what maximum pat name length should be
|
||||
//in fact this is probably a buffer overflow target in Syntrax(app crashed on too long name, from UI);
|
||||
uint32_t *patNameSizes;
|
||||
char **patternNames;
|
||||
Instrument *instruments;
|
||||
Subsong *subsongs;
|
||||
int16_t **samples;
|
||||
} Song;
|
||||
|
||||
|
||||
typedef struct Player
|
||||
{
|
||||
int16_t *silentBuffer;
|
||||
uint8_t m_LastNotes[SE_MAXCHANS];
|
||||
|
||||
uint32_t *freqTable;
|
||||
int16_t *dynamorphTable;
|
||||
|
||||
const Song *synSong;
|
||||
TuneChannel *tuneChannels;
|
||||
Voice *voices;
|
||||
|
||||
int SAMPLEFREQUENCY;
|
||||
|
||||
int samplesPerBeat;
|
||||
int otherSamplesPerBeat;
|
||||
int someCounter;
|
||||
int channelNumber;
|
||||
int sePmSong;
|
||||
int16_t *overlapBuff;
|
||||
int16_t *delayBufferR;
|
||||
int16_t *delayBufferL;
|
||||
|
||||
int bkpDelayPos;
|
||||
int delayPos;
|
||||
int gainPos;
|
||||
int overlapPos;
|
||||
|
||||
int ISWLKT;
|
||||
int WDTECTE;
|
||||
int PQV;
|
||||
int AMVM;
|
||||
int DONGS;
|
||||
uint8_t posCoarse;
|
||||
int AMYGPFQCHSW;
|
||||
int posFine;
|
||||
int8_t mutedChans[SE_MAXCHANS];
|
||||
|
||||
int selectedSubsong;
|
||||
Subsong curSubsong;
|
||||
|
||||
//local pointers to song structures
|
||||
const Row *rows;
|
||||
const char ** patternNames;
|
||||
Instrument *instruments;
|
||||
const Subsong *subsongs;
|
||||
const int8_t *arpTable;
|
||||
const int16_t **samples;
|
||||
|
||||
uint bufflen;
|
||||
|
||||
uint loopCount;
|
||||
} Player;
|
||||
|
||||
|
||||
//---------------------------prototypes------------------------
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
Player * playerCreate(int sampleFrequency);
|
||||
void playerDestroy(Player *);
|
||||
|
||||
int loadSong(Player *, const Song *);
|
||||
void initSubsong(Player *, int num);
|
||||
|
||||
void mixChunk(Player *, int16_t *outBuff, uint playbackBufferSize);
|
||||
|
||||
void playInstrument(Player *, int chanNum, int instrNum, int note); //could be handy dandy
|
||||
|
||||
bool playerGetSongEnded(Player *);
|
||||
uint playerGetLoopCount(Player *);
|
||||
|
||||
typedef struct _stmi
|
||||
{
|
||||
unsigned char coarse;
|
||||
unsigned char fine;
|
||||
unsigned char channelsPlaying;
|
||||
const char *subsongName;
|
||||
int selectedSubs;
|
||||
int totalSubs;
|
||||
} syntrax_info;
|
||||
|
||||
void playerGetInfo(Player *, syntrax_info *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,304 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
83EEAB071C965247002761C5 /* file.c in Sources */ = {isa = PBXBuildFile; fileRef = 83EEAB011C965247002761C5 /* file.c */; };
|
||||
83EEAB081C965247002761C5 /* file.h in Headers */ = {isa = PBXBuildFile; fileRef = 83EEAB021C965247002761C5 /* file.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
83EEAB091C965247002761C5 /* resampler.c in Sources */ = {isa = PBXBuildFile; fileRef = 83EEAB031C965247002761C5 /* resampler.c */; };
|
||||
83EEAB0A1C965247002761C5 /* resampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 83EEAB041C965247002761C5 /* resampler.h */; };
|
||||
83EEAB0B1C965247002761C5 /* syntrax.c in Sources */ = {isa = PBXBuildFile; fileRef = 83EEAB051C965247002761C5 /* syntrax.c */; };
|
||||
83EEAB0C1C965247002761C5 /* syntrax.h in Headers */ = {isa = PBXBuildFile; fileRef = 83EEAB061C965247002761C5 /* syntrax.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
832FF31B1C96511E0076D662 /* Syntrax_c.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Syntrax_c.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
832FF3201C96511E0076D662 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
83EEAB011C965247002761C5 /* file.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = file.c; sourceTree = "<group>"; };
|
||||
83EEAB021C965247002761C5 /* file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = file.h; sourceTree = "<group>"; };
|
||||
83EEAB031C965247002761C5 /* resampler.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resampler.c; sourceTree = "<group>"; };
|
||||
83EEAB041C965247002761C5 /* resampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resampler.h; sourceTree = "<group>"; };
|
||||
83EEAB051C965247002761C5 /* syntrax.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = syntrax.c; sourceTree = "<group>"; };
|
||||
83EEAB061C965247002761C5 /* syntrax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = syntrax.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
832FF3171C96511E0076D662 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
832FF3111C96511E0076D662 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
832FF31D1C96511E0076D662 /* Syntrax-c */,
|
||||
832FF31C1C96511E0076D662 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
832FF31C1C96511E0076D662 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
832FF31B1C96511E0076D662 /* Syntrax_c.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
832FF31D1C96511E0076D662 /* Syntrax-c */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
83EEAB011C965247002761C5 /* file.c */,
|
||||
83EEAB021C965247002761C5 /* file.h */,
|
||||
83EEAB031C965247002761C5 /* resampler.c */,
|
||||
83EEAB041C965247002761C5 /* resampler.h */,
|
||||
83EEAB051C965247002761C5 /* syntrax.c */,
|
||||
83EEAB061C965247002761C5 /* syntrax.h */,
|
||||
832FF3201C96511E0076D662 /* Info.plist */,
|
||||
);
|
||||
path = "Syntrax-c";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
832FF3181C96511E0076D662 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
83EEAB0C1C965247002761C5 /* syntrax.h in Headers */,
|
||||
83EEAB081C965247002761C5 /* file.h in Headers */,
|
||||
83EEAB0A1C965247002761C5 /* resampler.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
832FF31A1C96511E0076D662 /* Syntrax_c */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 832FF3231C96511E0076D662 /* Build configuration list for PBXNativeTarget "Syntrax_c" */;
|
||||
buildPhases = (
|
||||
832FF3161C96511E0076D662 /* Sources */,
|
||||
832FF3171C96511E0076D662 /* Frameworks */,
|
||||
832FF3181C96511E0076D662 /* Headers */,
|
||||
832FF3191C96511E0076D662 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Syntrax_c;
|
||||
productName = "Syntrax-c";
|
||||
productReference = 832FF31B1C96511E0076D662 /* Syntrax_c.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
832FF3121C96511E0076D662 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0720;
|
||||
ORGANIZATIONNAME = "Christopher Snowhill";
|
||||
TargetAttributes = {
|
||||
832FF31A1C96511E0076D662 = {
|
||||
CreatedOnToolsVersion = 7.2.1;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 832FF3151C96511E0076D662 /* Build configuration list for PBXProject "Syntrax_c" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 832FF3111C96511E0076D662;
|
||||
productRefGroup = 832FF31C1C96511E0076D662 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
832FF31A1C96511E0076D662 /* Syntrax_c */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
832FF3191C96511E0076D662 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
832FF3161C96511E0076D662 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
83EEAB071C965247002761C5 /* file.c in Sources */,
|
||||
83EEAB0B1C965247002761C5 /* syntrax.c in Sources */,
|
||||
83EEAB091C965247002761C5 /* resampler.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
832FF3211C96511E0076D662 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
832FF3221C96511E0076D662 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
832FF3241C96511E0076D662 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_VERSION = A;
|
||||
INFOPLIST_FILE = "Syntrax-c/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cogx.Syntrax-c";
|
||||
PRODUCT_NAME = Syntrax_c;
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
832FF3251C96511E0076D662 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_VERSION = A;
|
||||
INFOPLIST_FILE = "Syntrax-c/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cogx.Syntrax-c";
|
||||
PRODUCT_NAME = Syntrax_c;
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
832FF3151C96511E0076D662 /* Build configuration list for PBXProject "Syntrax_c" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
832FF3211C96511E0076D662 /* Debug */,
|
||||
832FF3221C96511E0076D662 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
832FF3231C96511E0076D662 /* Build configuration list for PBXNativeTarget "Syntrax_c" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
832FF3241C96511E0076D662 /* Debug */,
|
||||
832FF3251C96511E0076D662 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 832FF3121C96511E0076D662 /* Project object */;
|
||||
}
|
|
@ -0,0 +1,356 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
83EEAB0F1C965324002761C5 /* jxsDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 83EEAB0E1C965324002761C5 /* jxsDecoder.m */; };
|
||||
83EEAB111C965348002761C5 /* Syntrax_c.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83EEAB101C965348002761C5 /* Syntrax_c.framework */; };
|
||||
83EEAB1E1C965835002761C5 /* jxsContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 83EEAB1D1C965835002761C5 /* jxsContainer.m */; };
|
||||
83EEAB211C965A4F002761C5 /* jxsMetadataReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 83EEAB201C965A4F002761C5 /* jxsMetadataReader.m */; };
|
||||
83EEAB231C965C32002761C5 /* Syntrax_c.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83EEAB171C96537A002761C5 /* Syntrax_c.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
83EEAB161C96537A002761C5 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 83EEAB121C965379002761C5 /* Syntrax_c.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 832FF31B1C96511E0076D662;
|
||||
remoteInfo = Syntrax_c;
|
||||
};
|
||||
83EEAB181C965384002761C5 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 83EEAB121C965379002761C5 /* Syntrax_c.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 832FF31A1C96511E0076D662;
|
||||
remoteInfo = Syntrax_c;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
83EEAB221C965C27002761C5 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
83EEAB231C965C32002761C5 /* Syntrax_c.framework in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
832FF2F81C96508E0076D662 /* Syntrax.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Syntrax.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
832FF2FB1C96508E0076D662 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
83EEAB0D1C965324002761C5 /* jxsDecoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jxsDecoder.h; sourceTree = "<group>"; };
|
||||
83EEAB0E1C965324002761C5 /* jxsDecoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = jxsDecoder.m; sourceTree = "<group>"; };
|
||||
83EEAB101C965348002761C5 /* Syntrax_c.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Syntrax_c.framework; path = "../../../../../Library/Developer/Xcode/DerivedData/Cog-gnnabzpuhvwhikcgqtwgtiebzjli/Build/Products/Debug/Syntrax_c.framework"; sourceTree = "<group>"; };
|
||||
83EEAB121C965379002761C5 /* Syntrax_c.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Syntrax_c.xcodeproj; path = "../../Frameworks/Syntrax-c/Syntrax_c.xcodeproj"; sourceTree = "<group>"; };
|
||||
83EEAB1A1C9653AA002761C5 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../../Audio/Plugin.h; sourceTree = "<group>"; };
|
||||
83EEAB1B1C9653C3002761C5 /* PlaylistController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlaylistController.h; path = ../../../Playlist/PlaylistController.h; sourceTree = "<group>"; };
|
||||
83EEAB1C1C965835002761C5 /* jxsContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jxsContainer.h; sourceTree = "<group>"; };
|
||||
83EEAB1D1C965835002761C5 /* jxsContainer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = jxsContainer.m; sourceTree = "<group>"; };
|
||||
83EEAB1F1C965A4F002761C5 /* jxsMetadataReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jxsMetadataReader.h; sourceTree = "<group>"; };
|
||||
83EEAB201C965A4F002761C5 /* jxsMetadataReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = jxsMetadataReader.m; sourceTree = "<group>"; };
|
||||
83EEAB271C965D2E002761C5 /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = ../../../Utils/Logging.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
832FF2F51C96508E0076D662 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
83EEAB111C965348002761C5 /* Syntrax_c.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
832FF2EF1C96508E0076D662 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
832FF2FA1C96508E0076D662 /* Syntrax */,
|
||||
832FF3101C9650E50076D662 /* Frameworks */,
|
||||
832FF2F91C96508E0076D662 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
832FF2F91C96508E0076D662 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
832FF2F81C96508E0076D662 /* Syntrax.bundle */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
832FF2FA1C96508E0076D662 /* Syntrax */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
83EEAB271C965D2E002761C5 /* Logging.h */,
|
||||
83EEAB1B1C9653C3002761C5 /* PlaylistController.h */,
|
||||
83EEAB1A1C9653AA002761C5 /* Plugin.h */,
|
||||
83EEAB1C1C965835002761C5 /* jxsContainer.h */,
|
||||
83EEAB1D1C965835002761C5 /* jxsContainer.m */,
|
||||
83EEAB0D1C965324002761C5 /* jxsDecoder.h */,
|
||||
83EEAB0E1C965324002761C5 /* jxsDecoder.m */,
|
||||
83EEAB1F1C965A4F002761C5 /* jxsMetadataReader.h */,
|
||||
83EEAB201C965A4F002761C5 /* jxsMetadataReader.m */,
|
||||
832FF2FB1C96508E0076D662 /* Info.plist */,
|
||||
);
|
||||
path = Syntrax;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
832FF3101C9650E50076D662 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
83EEAB121C965379002761C5 /* Syntrax_c.xcodeproj */,
|
||||
83EEAB101C965348002761C5 /* Syntrax_c.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
83EEAB131C965379002761C5 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
83EEAB171C96537A002761C5 /* Syntrax_c.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
832FF2F71C96508E0076D662 /* Syntrax */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 832FF2FE1C96508E0076D662 /* Build configuration list for PBXNativeTarget "Syntrax" */;
|
||||
buildPhases = (
|
||||
832FF2F41C96508E0076D662 /* Sources */,
|
||||
832FF2F51C96508E0076D662 /* Frameworks */,
|
||||
832FF2F61C96508E0076D662 /* Resources */,
|
||||
83EEAB221C965C27002761C5 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
83EEAB191C965384002761C5 /* PBXTargetDependency */,
|
||||
);
|
||||
name = Syntrax;
|
||||
productName = Syntrax;
|
||||
productReference = 832FF2F81C96508E0076D662 /* Syntrax.bundle */;
|
||||
productType = "com.apple.product-type.bundle";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
832FF2F01C96508E0076D662 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0720;
|
||||
ORGANIZATIONNAME = "Christopher Snowhill";
|
||||
TargetAttributes = {
|
||||
832FF2F71C96508E0076D662 = {
|
||||
CreatedOnToolsVersion = 7.2.1;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 832FF2F31C96508E0076D662 /* Build configuration list for PBXProject "Syntrax" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 832FF2EF1C96508E0076D662;
|
||||
productRefGroup = 832FF2F91C96508E0076D662 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = 83EEAB131C965379002761C5 /* Products */;
|
||||
ProjectRef = 83EEAB121C965379002761C5 /* Syntrax_c.xcodeproj */;
|
||||
},
|
||||
);
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
832FF2F71C96508E0076D662 /* Syntrax */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
83EEAB171C96537A002761C5 /* Syntrax_c.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = Syntrax_c.framework;
|
||||
remoteRef = 83EEAB161C96537A002761C5 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
832FF2F61C96508E0076D662 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
832FF2F41C96508E0076D662 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
83EEAB0F1C965324002761C5 /* jxsDecoder.m in Sources */,
|
||||
83EEAB211C965A4F002761C5 /* jxsMetadataReader.m in Sources */,
|
||||
83EEAB1E1C965835002761C5 /* jxsContainer.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
83EEAB191C965384002761C5 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = Syntrax_c;
|
||||
targetProxy = 83EEAB181C965384002761C5 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
832FF2FC1C96508E0076D662 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
832FF2FD1C96508E0076D662 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
832FF2FF1C96508E0076D662 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
INFOPLIST_FILE = Syntrax/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cogx.Syntrax;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
832FF3001C96508E0076D662 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
INFOPLIST_FILE = Syntrax/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cogx.Syntrax;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
832FF2F31C96508E0076D662 /* Build configuration list for PBXProject "Syntrax" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
832FF2FC1C96508E0076D662 /* Debug */,
|
||||
832FF2FD1C96508E0076D662 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
832FF2FE1C96508E0076D662 /* Build configuration list for PBXNativeTarget "Syntrax" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
832FF2FF1C96508E0076D662 /* Debug */,
|
||||
832FF3001C96508E0076D662 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 832FF2F01C96508E0076D662 /* Project object */;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2016 Christopher Snowhill. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// jxsContainer.h
|
||||
// Syntrax-c
|
||||
//
|
||||
// Created by Christopher Snowhill on 03/14/16.
|
||||
// Copyright 2016 __NoWork, Inc__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#import "Plugin.h"
|
||||
|
||||
@interface jxsContainer : NSObject <CogContainer> {
|
||||
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,105 @@
|
|||
//
|
||||
// jxsContainer.m
|
||||
// Syntrax-c
|
||||
//
|
||||
// Created by Christopher Snowhill on 03/14/16.
|
||||
// Copyright 2016 __NoWork, Inc__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Syntrax_c/syntrax.h>
|
||||
#import <Syntrax_c/file.h>
|
||||
|
||||
#import "jxsContainer.h"
|
||||
#import "jxsDecoder.h"
|
||||
|
||||
#import "Logging.h"
|
||||
|
||||
@implementation jxsContainer
|
||||
|
||||
+ (NSArray *)fileTypes
|
||||
{
|
||||
return [jxsDecoder fileTypes];
|
||||
}
|
||||
|
||||
+ (NSArray *)mimeTypes
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (float)priority
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
+ (NSArray *)urlsForContainerURL:(NSURL *)url
|
||||
{
|
||||
if ([url fragment]) {
|
||||
// input url already has fragment defined - no need to expand further
|
||||
return [NSMutableArray arrayWithObject:url];
|
||||
}
|
||||
|
||||
id audioSourceClass = NSClassFromString(@"AudioSource");
|
||||
id<CogSource> source = [audioSourceClass audioSourceForURL:url];
|
||||
|
||||
if (![source open:url])
|
||||
return 0;
|
||||
|
||||
if (![source seekable])
|
||||
return 0;
|
||||
|
||||
[source seek:0 whence:SEEK_END];
|
||||
long size = [source tell];
|
||||
[source seek:0 whence:SEEK_SET];
|
||||
|
||||
void * data = malloc(size);
|
||||
[source read:data amount:size];
|
||||
|
||||
Song * synSong = File_loadSongMem(data, size);
|
||||
if (!synSong)
|
||||
{
|
||||
ALog(@"Open failed for file: %@", [url absoluteString]);
|
||||
free(data);
|
||||
return NO;
|
||||
}
|
||||
|
||||
free(data);
|
||||
|
||||
Player * synPlayer = playerCreate(44100);
|
||||
if (!synPlayer)
|
||||
{
|
||||
ALog(@"Failed to create Syntrax-c player for file: %@", [url absoluteString]);
|
||||
File_freeSong(synSong);
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (loadSong(synPlayer, synSong) < 0)
|
||||
{
|
||||
ALog(@"Load failed for file: %@", [url absoluteString]);
|
||||
playerDestroy(synPlayer);
|
||||
File_freeSong(synSong);
|
||||
return NO;
|
||||
}
|
||||
|
||||
NSMutableArray *tracks = [NSMutableArray array];
|
||||
|
||||
syntrax_info info;
|
||||
|
||||
playerGetInfo(synPlayer, &info);
|
||||
|
||||
playerDestroy(synPlayer);
|
||||
File_freeSong(synSong);
|
||||
|
||||
int i;
|
||||
int subsongs = info.totalSubs;
|
||||
if ( subsongs ) {
|
||||
for (i = 0; i < subsongs; i++)
|
||||
{
|
||||
[tracks addObject:[NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:@"#%i", i]]];
|
||||
}
|
||||
}
|
||||
|
||||
return tracks;
|
||||
}
|
||||
|
||||
|
||||
@end
|
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// jxsDecoder.h
|
||||
// Syntrax-c
|
||||
//
|
||||
// Created by Christopher Snowhill on 03/14/16.
|
||||
// Copyright 2016 __NoWork, Inc__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#import <Syntrax_c/file.h>
|
||||
#import <Syntrax_c/syntrax.h>
|
||||
|
||||
#import "Plugin.h"
|
||||
|
||||
@interface jxsDecoder : NSObject <CogDecoder> {
|
||||
Song *synSong;
|
||||
Player *synPlayer;
|
||||
int track_num;
|
||||
|
||||
long framesLength;
|
||||
long totalFrames;
|
||||
long framesRead;
|
||||
}
|
||||
@end
|
|
@ -0,0 +1,239 @@
|
|||
//
|
||||
// jxsDecoder.m
|
||||
// Syntrax-c
|
||||
//
|
||||
// Created by Christopher Snowhill on 03/14/16.
|
||||
// Copyright 2016 __NoWork, Inc__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "jxsDecoder.h"
|
||||
|
||||
#import "Logging.h"
|
||||
|
||||
#import "PlaylistController.h"
|
||||
|
||||
@implementation jxsDecoder
|
||||
|
||||
BOOL probe_length( Song * synSong, unsigned long * intro_length, unsigned long * loop_length, unsigned int subsong )
|
||||
{
|
||||
Player * synPlayer = playerCreate(44100);
|
||||
|
||||
if (loadSong(synPlayer, synSong) < 0)
|
||||
return NO;
|
||||
|
||||
initSubsong(synPlayer, subsong);
|
||||
|
||||
unsigned long length_total = 0;
|
||||
unsigned long length_saved;
|
||||
|
||||
const long length_safety = 44100 * 60 * 30;
|
||||
|
||||
while ( !playerGetSongEnded(synPlayer) && playerGetLoopCount(synPlayer) < 1 && length_total < length_safety )
|
||||
{
|
||||
mixChunk(synPlayer, NULL, 512);
|
||||
length_total += 512;
|
||||
}
|
||||
|
||||
if ( !playerGetSongEnded(synPlayer) && playerGetLoopCount(synPlayer) < 1 )
|
||||
{
|
||||
*loop_length = 0;
|
||||
*intro_length = 44100 * 60 * 3;
|
||||
playerDestroy(synPlayer);
|
||||
return YES;
|
||||
}
|
||||
|
||||
length_saved = length_total;
|
||||
|
||||
while ( !playerGetSongEnded(synPlayer) && playerGetLoopCount(synPlayer) < 2 )
|
||||
{
|
||||
mixChunk(synPlayer, NULL, 512);
|
||||
length_total += 512;
|
||||
}
|
||||
|
||||
playerDestroy(synPlayer);
|
||||
|
||||
*loop_length = length_total - length_saved;
|
||||
*intro_length = length_saved - *loop_length;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)open:(id<CogSource>)s
|
||||
{
|
||||
[s seek:0 whence:SEEK_END];
|
||||
size_t size = [s tell];
|
||||
[s seek:0 whence:SEEK_SET];
|
||||
|
||||
void * data = malloc(size);
|
||||
[s read:data amount:size];
|
||||
|
||||
if ([[[s url] fragment] length] == 0)
|
||||
track_num = 0;
|
||||
else
|
||||
track_num = [[[s url] fragment] intValue];
|
||||
|
||||
synSong = File_loadSongMem(data, size);
|
||||
if (!synSong)
|
||||
return NO;
|
||||
|
||||
free(data);
|
||||
|
||||
unsigned long intro_length, loop_length;
|
||||
|
||||
if ( !probe_length(synSong, &intro_length, &loop_length, track_num) )
|
||||
return NO;
|
||||
|
||||
framesLength = intro_length + loop_length * 2;
|
||||
totalFrames = framesLength + 44100 * 8;
|
||||
|
||||
[self willChangeValueForKey:@"properties"];
|
||||
[self didChangeValueForKey:@"properties"];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)decoderInitialize
|
||||
{
|
||||
synPlayer = playerCreate(44100);
|
||||
if (!synPlayer)
|
||||
return NO;
|
||||
|
||||
if (loadSong(synPlayer, synSong) < 0)
|
||||
return NO;
|
||||
|
||||
initSubsong(synPlayer, track_num);
|
||||
|
||||
framesRead = 0;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)decoderShutdown
|
||||
{
|
||||
if ( synPlayer )
|
||||
{
|
||||
playerDestroy(synPlayer);
|
||||
synPlayer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSDictionary *)properties
|
||||
{
|
||||
return [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:0], @"bitrate",
|
||||
[NSNumber numberWithFloat:44100], @"sampleRate",
|
||||
[NSNumber numberWithDouble:totalFrames], @"totalFrames",
|
||||
[NSNumber numberWithInt:16], @"bitsPerSample",
|
||||
[NSNumber numberWithBool:NO], @"floatingPoint",
|
||||
[NSNumber numberWithInt:2], @"channels",
|
||||
[NSNumber numberWithBool:YES], @"seekable",
|
||||
@"host", @"endian",
|
||||
nil];
|
||||
}
|
||||
|
||||
- (int)readAudio:(void *)buf frames:(UInt32)frames
|
||||
{
|
||||
BOOL repeat_one = IsRepeatOneSet();
|
||||
|
||||
if ( synPlayer && playerGetSongEnded(synPlayer) )
|
||||
return 0;
|
||||
|
||||
if ( !repeat_one && framesRead >= totalFrames )
|
||||
return 0;
|
||||
|
||||
if ( !synPlayer )
|
||||
{
|
||||
if ( ![self decoderInitialize] )
|
||||
return 0;
|
||||
}
|
||||
|
||||
int total = 0;
|
||||
while ( total < frames ) {
|
||||
int framesToRender = 512;
|
||||
if ( !repeat_one && framesToRender > totalFrames - framesRead )
|
||||
framesToRender = (int)(totalFrames - framesRead);
|
||||
if ( framesToRender > frames - total )
|
||||
framesToRender = frames - total;
|
||||
|
||||
int16_t * sampleBuf = ( int16_t * ) buf + total * 2;
|
||||
|
||||
mixChunk(synPlayer, sampleBuf, framesToRender);
|
||||
|
||||
if ( !repeat_one && framesRead + framesToRender > framesLength ) {
|
||||
long fadeStart = ( framesLength > framesRead ) ? framesLength : framesRead;
|
||||
long fadeEnd = ( framesRead + framesToRender < totalFrames ) ? framesRead + framesToRender : totalFrames;
|
||||
const long fadeTotal = totalFrames - framesLength;
|
||||
for ( long fadePos = fadeStart; fadePos < fadeEnd; ++fadePos ) {
|
||||
const long scale = ( fadeTotal - ( fadePos - framesLength ) );
|
||||
const long offset = fadePos - framesRead;
|
||||
int16_t * samples = sampleBuf + offset * 2;
|
||||
samples[ 0 ] = (int16_t)(samples[ 0 ] * scale / fadeTotal);
|
||||
samples[ 1 ] = (int16_t)(samples[ 1 ] * scale / fadeTotal);
|
||||
}
|
||||
|
||||
framesToRender = (int)(fadeEnd - framesRead);
|
||||
}
|
||||
|
||||
if ( !framesToRender )
|
||||
break;
|
||||
|
||||
total += framesToRender;
|
||||
framesRead += framesToRender;
|
||||
|
||||
if ( playerGetSongEnded(synPlayer) )
|
||||
break;
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
- (long)seek:(long)frame
|
||||
{
|
||||
if ( frame < framesRead || !synPlayer )
|
||||
{
|
||||
[self decoderShutdown];
|
||||
if ( ![self decoderInitialize] )
|
||||
return 0;
|
||||
}
|
||||
|
||||
while ( framesRead < frame )
|
||||
{
|
||||
int frames_todo = INT_MAX;
|
||||
if ( frames_todo > frame - framesRead )
|
||||
frames_todo = (int)( frame - framesRead );
|
||||
mixChunk(synPlayer, NULL, frames_todo);
|
||||
framesRead += frames_todo;
|
||||
}
|
||||
|
||||
framesRead = frame;
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
- (void)close
|
||||
{
|
||||
[self decoderShutdown];
|
||||
|
||||
if (synSong)
|
||||
{
|
||||
File_freeSong(synSong);
|
||||
synSong = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSArray *)fileTypes
|
||||
{
|
||||
return [NSArray arrayWithObjects:@"jxs", nil];
|
||||
}
|
||||
|
||||
+ (NSArray *)mimeTypes
|
||||
{
|
||||
return [NSArray arrayWithObjects:@"audio/x-jxs", nil];
|
||||
}
|
||||
|
||||
+ (float)priority
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// jxsMetadataReader.h
|
||||
// Syntrax-c
|
||||
//
|
||||
// Created by Christopher Snowhill on 03/14/16.
|
||||
// Copyright 2016 __NoWork, Inc__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#import "Plugin.h"
|
||||
|
||||
@interface jxsMetadataReader : NSObject <CogMetadataReader> {
|
||||
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,102 @@
|
|||
//
|
||||
// jxsMetadataReader.m
|
||||
// Syntrax-c
|
||||
//
|
||||
// Created by Christopher Snowhill on 03/14/16.
|
||||
// Copyright 2016 __NoWork, Inc__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "jxsMetadataReader.h"
|
||||
#import "jxsDecoder.h"
|
||||
|
||||
#import <Syntrax_c/syntrax.h>
|
||||
#import <Syntrax_c/file.h>
|
||||
|
||||
#import "Logging.h"
|
||||
|
||||
@implementation jxsMetadataReader
|
||||
|
||||
+ (NSArray *)fileTypes
|
||||
{
|
||||
return [jxsDecoder fileTypes];
|
||||
}
|
||||
|
||||
+ (NSArray *)mimeTypes
|
||||
{
|
||||
return [jxsDecoder mimeTypes];
|
||||
}
|
||||
|
||||
+ (float)priority
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
+ (NSDictionary *)metadataForURL:(NSURL *)url
|
||||
{
|
||||
id audioSourceClass = NSClassFromString(@"AudioSource");
|
||||
id<CogSource> source = [audioSourceClass audioSourceForURL:url];
|
||||
|
||||
if (![source open:url])
|
||||
return 0;
|
||||
|
||||
if (![source seekable])
|
||||
return 0;
|
||||
|
||||
[source seek:0 whence:SEEK_END];
|
||||
long size = [source tell];
|
||||
[source seek:0 whence:SEEK_SET];
|
||||
|
||||
void * data = malloc(size);
|
||||
[source read:data amount:size];
|
||||
|
||||
Song * synSong = File_loadSongMem(data, size);
|
||||
if (!synSong)
|
||||
{
|
||||
ALog(@"Open failed for file: %@", [url absoluteString]);
|
||||
free(data);
|
||||
return NO;
|
||||
}
|
||||
|
||||
free(data);
|
||||
|
||||
Player * synPlayer = playerCreate(44100);
|
||||
if (!synPlayer)
|
||||
{
|
||||
ALog(@"Failed to create player for file: %@", [url absoluteString]);
|
||||
File_freeSong(synSong);
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (loadSong(synPlayer, synSong) < 0)
|
||||
{
|
||||
ALog(@"Load failed for file: %@", [url absoluteString]);
|
||||
playerDestroy(synPlayer);
|
||||
File_freeSong(synSong);
|
||||
return NO;
|
||||
}
|
||||
|
||||
int track_num;
|
||||
if ([[url fragment] length] == 0)
|
||||
track_num = 0;
|
||||
else
|
||||
track_num = [[url fragment] intValue];
|
||||
|
||||
initSubsong(synPlayer, track_num);
|
||||
|
||||
syntrax_info info;
|
||||
playerGetInfo(synPlayer, &info);
|
||||
|
||||
playerDestroy(synPlayer);
|
||||
File_freeSong(synSong);
|
||||
|
||||
//Some titles are all spaces?!
|
||||
NSString *title = [[NSString stringWithUTF8String: info.subsongName] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
|
||||
|
||||
if (title == nil) {
|
||||
title = @"";
|
||||
}
|
||||
|
||||
return [NSDictionary dictionaryWithObject:title forKey:@"title"];
|
||||
}
|
||||
|
||||
@end
|
Loading…
Reference in New Issue