Removed plugin
parent
41a32f0b9d
commit
cd8b728ca6
|
@ -159,7 +159,6 @@
|
|||
83D0380F24A40DFB004CF90F /* CogAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83D0380E24A40DF2004CF90F /* CogAssets.xcassets */; };
|
||||
83E5E54C18087CA5001F3284 /* miniModeOffTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 83E5E54A18087CA5001F3284 /* miniModeOffTemplate.pdf */; };
|
||||
83E5E54D18087CA5001F3284 /* miniModeOnTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 83E5E54B18087CA5001F3284 /* miniModeOnTemplate.pdf */; };
|
||||
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 = (); }; };
|
||||
|
@ -528,20 +527,6 @@
|
|||
remoteGlobalIDString = 8D5B49B6048680CD000E48DA;
|
||||
remoteInfo = "Shorten Plugin";
|
||||
};
|
||||
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 */;
|
||||
|
@ -649,7 +634,6 @@
|
|||
834F7F4520E4E51F00228DAB /* WavPack.bundle in CopyFiles */,
|
||||
834F7F4420E4E4FA00228DAB /* OpenMPT.bundle in CopyFiles */,
|
||||
834F7F4320E4E4ED00228DAB /* AdPlug.bundle in CopyFiles */,
|
||||
83EEAB241C965C56002761C5 /* Syntrax.bundle in CopyFiles */,
|
||||
83F9D8071A884C54007ABEC2 /* SilenceDecoder.bundle in CopyFiles */,
|
||||
836F5BF91A357A01002730CC /* sidplay.bundle in CopyFiles */,
|
||||
836FB5A718206F2500B3AD2D /* Hively.bundle in CopyFiles */,
|
||||
|
@ -927,7 +911,6 @@
|
|||
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>"; };
|
||||
83E5EFAC1FFEF78100659F0F /* OpenMPT.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OpenMPT.xcodeproj; path = Plugins/OpenMPT/OpenMPT.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>"; };
|
||||
|
@ -1178,7 +1161,6 @@
|
|||
17C808A70C3BD1BA005707C4 /* Shorten.xcodeproj */,
|
||||
8314D63B1A354DFE00EEE8E6 /* sidplay.xcodeproj */,
|
||||
83F9D7F11A884B44007ABEC2 /* SilenceDecoder.xcodeproj */,
|
||||
83EEAAF51C9651D8002761C5 /* Syntrax.xcodeproj */,
|
||||
17C808B00C3BD1C5005707C4 /* TagLib.xcodeproj */,
|
||||
836F6B2518BDB80D0095E648 /* vgmstream.xcodeproj */,
|
||||
17C808B70C3BD1D2005707C4 /* VorbisPlugin.xcodeproj */,
|
||||
|
@ -1582,14 +1564,6 @@
|
|||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
83EEAAF61C9651D8002761C5 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
83EEAAFA1C9651D8002761C5 /* Syntrax.bundle */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
83F9D7F21A884B44007ABEC2 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -1738,7 +1712,6 @@
|
|||
834F7F3620E4E4B400228DAB /* PBXTargetDependency */,
|
||||
834F7F3420E4E4B000228DAB /* PBXTargetDependency */,
|
||||
834F7F1F20E4E4AA00228DAB /* PBXTargetDependency */,
|
||||
83EEAB261C965C61002761C5 /* PBXTargetDependency */,
|
||||
83F9D8061A884C33007ABEC2 /* PBXTargetDependency */,
|
||||
836F5BEE1A3579F5002730CC /* PBXTargetDependency */,
|
||||
836FB5A618206F1500B3AD2D /* PBXTargetDependency */,
|
||||
|
@ -1898,10 +1871,6 @@
|
|||
ProductGroup = 83F9D7F21A884B44007ABEC2 /* Products */;
|
||||
ProjectRef = 83F9D7F11A884B44007ABEC2 /* SilenceDecoder.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 83EEAAF61C9651D8002761C5 /* Products */;
|
||||
ProjectRef = 83EEAAF51C9651D8002761C5 /* Syntrax.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 8303A30520E4E3D000951EF8 /* Products */;
|
||||
ProjectRef = 17C808B00C3BD1C5005707C4 /* TagLib.xcodeproj */;
|
||||
|
@ -2095,13 +2064,6 @@
|
|||
remoteRef = 83CA5B0220E4E395003E463A /* 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;
|
||||
|
@ -2448,11 +2410,6 @@
|
|||
name = "FFMPEG Plugin";
|
||||
targetProxy = 83BCB8DC17FC96FC00760340 /* PBXContainerItemProxy */;
|
||||
};
|
||||
83EEAB261C965C61002761C5 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = Syntrax;
|
||||
targetProxy = 83EEAB251C965C61002761C5 /* PBXContainerItemProxy */;
|
||||
};
|
||||
83F9D8061A884C33007ABEC2 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = SilenceDecoder;
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
<?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 © 2021 Christopher Snowhill. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,6 +0,0 @@
|
|||
enum loadErr {
|
||||
ERR_OK,
|
||||
ERR_MALLOC,
|
||||
ERR_BADSONG,
|
||||
ERR_FILEIO
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -1,264 +0,0 @@
|
|||
#ifndef JAYTRAX_H
|
||||
#define JAYTRAX_H
|
||||
|
||||
#define WANTEDOVERLAP (15) //wanted declick overlap length(in samples). Will be smaller than a song tick.
|
||||
#define MIXBUF_LEN (512) //temporary mixing buffer length
|
||||
#define SAMPSPOOLSIZE (0xFFF) //buffer for unrolling samples
|
||||
|
||||
enum INTERP_LIST {
|
||||
ITP_NONE,
|
||||
ITP_NEAREST,
|
||||
ITP_LINEAR,
|
||||
ITP_QUADRATIC,
|
||||
ITP_CUBIC,
|
||||
//ITP_BLEP,
|
||||
INTERP_COUNT
|
||||
};
|
||||
|
||||
enum SE_BUFTYPE {
|
||||
BUF_MAINL,
|
||||
BUF_MAINR,
|
||||
BUF_ECHOL,
|
||||
BUF_ECHOR,
|
||||
MIXBUF_NR
|
||||
};
|
||||
|
||||
enum SE_PLAYMODE {
|
||||
SE_PM_SONG = 0,
|
||||
SE_PM_PATTERN
|
||||
};
|
||||
|
||||
//in case of changing any of the below
|
||||
//please change jxs loader to account for changes
|
||||
#define SE_ORDERS_SUBSONG (256)
|
||||
#define SE_ROWS_PAT (64)
|
||||
#define SE_EFF_INST (4)
|
||||
#define SE_WAVES_INST (16)
|
||||
#define SE_SAMPS_WAVE (256)
|
||||
#define SE_ARPS_SONG (16)
|
||||
#define SE_STEPS_ARP (16)
|
||||
#define SE_NAMELEN (32)
|
||||
|
||||
#define SE_NROFCHANS (16) // number of chans replayer can take
|
||||
#define SE_NROFFINETUNESTEPS (16) // number of finetune scales
|
||||
#define SE_NROFEFFECTS (18) // number of available wave effects
|
||||
|
||||
typedef struct JT1Order JT1Order;
|
||||
struct JT1Order {
|
||||
int16_t patnr; // welk pattern spelen...
|
||||
int16_t patlen; // 0/16/32/48
|
||||
};
|
||||
|
||||
typedef struct JT1Row JT1Row;
|
||||
struct JT1Row {
|
||||
uint8_t srcnote;
|
||||
uint8_t dstnote;
|
||||
uint8_t inst;
|
||||
int8_t param;
|
||||
uint8_t script;
|
||||
};
|
||||
|
||||
typedef struct JT1Subsong JT1Subsong;
|
||||
struct JT1Subsong {
|
||||
uint8_t mute[SE_NROFCHANS]; // which channels are muted? (1=muted)
|
||||
int32_t songspd; // delay tussen de pattern-stepjes
|
||||
int32_t groove; // groove value... 0=nothing, 1 = swing, 2=shuffle
|
||||
int32_t songpos; // waar start song? (welke maat?)
|
||||
int32_t songstep; // welke patternpos offset? (1/64 van maat)
|
||||
int32_t endpos; // waar stopt song? (welke maat?)
|
||||
int32_t endstep; // welke patternpos offset? (1/64 van maat)
|
||||
int32_t looppos; // waar looped song? (welke maat?)
|
||||
int32_t loopstep; // welke patternpos offset? (1/64 van maat)
|
||||
int16_t songloop; // if true, the song loops inbetween looppos and endpos
|
||||
char name[SE_NAMELEN]; // name of subsong
|
||||
int16_t nrofchans; //nr of channels used
|
||||
uint16_t delaytime; // the delaytime (for the echo effect)
|
||||
uint8_t delayamount[SE_NROFCHANS]; // amount per channel for the echo-effect
|
||||
int16_t amplification; //extra amplification factor (20 to 1000)
|
||||
JT1Order orders[SE_NROFCHANS][SE_ORDERS_SUBSONG];
|
||||
};
|
||||
|
||||
typedef struct JT1Effect JT1Effect;
|
||||
struct JT1Effect {
|
||||
int32_t dsteffect;
|
||||
int32_t srceffect1;
|
||||
int32_t srceffect2;
|
||||
int32_t osceffect;
|
||||
int32_t effectvar1;
|
||||
int32_t effectvar2;
|
||||
int32_t effectspd;
|
||||
int32_t oscspd;
|
||||
int32_t effecttype;
|
||||
int8_t oscflg;
|
||||
int8_t reseteffect;
|
||||
};
|
||||
|
||||
// inst is the structure which has the entire instrument definition.
|
||||
typedef struct JT1Inst JT1Inst;
|
||||
struct JT1Inst {
|
||||
int16_t mugiversion;
|
||||
char instname[SE_NAMELEN];
|
||||
int16_t waveform;
|
||||
int16_t wavelength;
|
||||
int16_t mastervol;
|
||||
int16_t amwave;
|
||||
int16_t amspd;
|
||||
int16_t amlooppoint;
|
||||
int16_t finetune;
|
||||
int16_t fmwave;
|
||||
int16_t fmspd;
|
||||
int16_t fmlooppoint;
|
||||
int16_t fmdelay;
|
||||
int16_t arpeggio;
|
||||
int8_t resetwave[SE_WAVES_INST];
|
||||
int16_t panwave;
|
||||
int16_t panspd;
|
||||
int16_t panlooppoint;
|
||||
JT1Effect fx[SE_EFF_INST];
|
||||
char samplename[SE_NAMELEN];
|
||||
//ugly. Move samples into their own spot
|
||||
int16_t sharing; // sample sharing! sharing contains instr nr of shared sanpledata (0=no sharing)
|
||||
int16_t loopflg; //does the sample loop or play one/shot? (0=1shot)
|
||||
int16_t bidirecflg; // does the sample loop birdirectional? (0=no)
|
||||
int32_t startpoint;
|
||||
int32_t looppoint;
|
||||
int32_t endpoint;
|
||||
uint8_t hasSampData; // pointer naar de sample (mag 0 zijn)
|
||||
int32_t samplelength; // length of sample
|
||||
int16_t waves[SE_WAVES_INST * SE_SAMPS_WAVE];
|
||||
};
|
||||
|
||||
typedef struct JT1Song JT1Song;
|
||||
struct JT1Song {
|
||||
int16_t mugiversion;//version of mugician this song was saved with
|
||||
int32_t nrofpats; //aantal patterns beschikbaar
|
||||
int32_t nrofsongs; //aantal beschikbare subsongs
|
||||
int32_t nrofinst; //aantal gebruikte instruments
|
||||
|
||||
JT1Subsong** subsongs;
|
||||
JT1Row* patterns;
|
||||
char** patNames;
|
||||
JT1Inst** instruments;
|
||||
uint8_t** samples;
|
||||
int8_t arpTable[SE_ARPS_SONG * SE_STEPS_ARP];
|
||||
|
||||
};
|
||||
|
||||
//---------------------internal structs
|
||||
|
||||
// Chanfx is an internal structure which keeps track of the current effect parameters per active channel
|
||||
typedef struct JT1VoiceEffect JT1VoiceEffect;
|
||||
struct JT1VoiceEffect {
|
||||
int fxcnt1;
|
||||
int fxcnt2;
|
||||
int osccnt;
|
||||
double a0;
|
||||
double b1;
|
||||
double b2;
|
||||
double y1;
|
||||
double y2;
|
||||
int Vhp;
|
||||
int Vbp;
|
||||
int Vlp;
|
||||
};
|
||||
|
||||
// chandat is an internal structure which keeps track of the current instruemnts current variables per active channel
|
||||
typedef struct JT1Voice JT1Voice;
|
||||
struct JT1Voice {
|
||||
int32_t songpos;
|
||||
int32_t patpos;
|
||||
int32_t instrument;
|
||||
int32_t volcnt;
|
||||
int32_t pancnt;
|
||||
int32_t arpcnt;
|
||||
int32_t curnote;
|
||||
int32_t curfreq;
|
||||
int32_t curvol;
|
||||
int32_t curpan;
|
||||
int32_t bendadd; // for the pitchbend
|
||||
int32_t destfreq; // ...
|
||||
int32_t bendspd; // ...
|
||||
int32_t bendtonote;
|
||||
int32_t freqcnt;
|
||||
int32_t freqdel;
|
||||
uint8_t* sampledata;
|
||||
int32_t looppoint;
|
||||
int32_t endpoint;
|
||||
uint8_t loopflg;
|
||||
uint8_t bidirecflg;
|
||||
int32_t synthPos;
|
||||
int32_t samplepos;
|
||||
|
||||
//immediate render vars
|
||||
int16_t* wavePtr;
|
||||
int32_t waveLength;
|
||||
int32_t freqOffset;
|
||||
int16_t gainMainL;
|
||||
int16_t gainMainR;
|
||||
int16_t gainEchoL;
|
||||
int16_t gainEchoR;
|
||||
|
||||
JT1VoiceEffect fx[SE_WAVES_INST];
|
||||
int16_t waves[SE_WAVES_INST * SE_SAMPS_WAVE];
|
||||
};
|
||||
|
||||
typedef struct Interpolator Interpolator;
|
||||
struct Interpolator {
|
||||
uint8_t id;
|
||||
int16_t numTaps;
|
||||
int32_t (*fItp) (int16_t* buf, int32_t pos, int32_t sizeMask);
|
||||
char name[32];
|
||||
};
|
||||
|
||||
typedef struct JT1Player JT1Player;
|
||||
struct JT1Player {
|
||||
JT1Song* song;
|
||||
JT1Subsong* subsong;
|
||||
JT1Voice voices[SE_NROFCHANS];
|
||||
int32_t subsongNr;
|
||||
int16_t timeCnt; // Samplecounter which stores the njumber of samples before the next songparams are calculated (is reinited with timeSpd)
|
||||
int16_t timeSpd; // Sample accurate counter which indicates every how many samples the song should progress 1 tick. Is dependant on rendering frequency and BPM
|
||||
uint8_t playFlg; // 0 if playback is stopped, 1 if song is being played
|
||||
uint8_t pauseFlg; // 0 if playback is not paused, 1 if playback is paused
|
||||
int32_t playSpeed; // Actual delay in between notes
|
||||
int32_t patternDelay; // Current delay in between notes (resets with playSpeed)
|
||||
int32_t playPosition; // Current position in song (coarse)
|
||||
int32_t playStep; // Current position in song (fine)
|
||||
int32_t masterVolume; // Mastervolume of the replayer (256=max - 0=min)
|
||||
int16_t leftDelayBuffer[65536]; // buffer to simulate an echo on the left stereo channel
|
||||
int16_t rightDelayBuffer[65536]; // buffer to simulate an echo on the right stereo channel
|
||||
int16_t overlapBuffer[WANTEDOVERLAP*2]; // Buffer which stores overlap between waveforms to avoid clicks
|
||||
int16_t overlapCnt; // Used to store how much overlap we have already rendered
|
||||
uint16_t delayCnt; // Internal counter used for delay
|
||||
int32_t tempBuf[MIXBUF_LEN * MIXBUF_NR];
|
||||
Interpolator* itp;
|
||||
|
||||
int32_t playMode; // in which mode is the replayer? Song or patternmode?
|
||||
int32_t currentPattern; // Which pattern are we currently playing (In pattern play mode)
|
||||
int32_t patternLength; // Current length of a pattern (in pattern play mode)
|
||||
int32_t patternOffset; // Current play offset in the pattern (used for display)
|
||||
|
||||
int32_t loopCnt; // If song is meant to loop, the number of times the song has looped
|
||||
};
|
||||
|
||||
//---------------------API
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int jaytrax_loadSong(JT1Player* SELF, JT1Song* sng);
|
||||
void jaytrax_changeSubsong(JT1Player* SELF, int subsongnr);
|
||||
void jaytrax_stopSong(JT1Player* SELF);
|
||||
void jaytrax_pauseSong(JT1Player* SELF);
|
||||
void jaytrax_continueSong(JT1Player* SELF);
|
||||
void jaytrax_setInterpolation(JT1Player* SELF, uint8_t id);
|
||||
JT1Player* jaytrax_init(void);
|
||||
void jaytrax_free(JT1Player* SELF);
|
||||
void jaytrax_renderChunk(JT1Player* SELF, int16_t* renderbuf, int32_t nrofsamples, int32_t frequency);
|
||||
int32_t jaytrax_getLength(JT1Player* SELF, int subsongnr, int loopCnt, int frequency);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -1,359 +0,0 @@
|
|||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "jaytrax.h"
|
||||
#include "jxs.h"
|
||||
#include "ioutil.h"
|
||||
|
||||
struct memdata
|
||||
{
|
||||
const uint8_t* data;
|
||||
size_t remain;
|
||||
int error;
|
||||
};
|
||||
|
||||
void memread(void* buf, size_t size, size_t count, void* _data)
|
||||
{
|
||||
struct memdata* data = (struct memdata*)_data;
|
||||
size_t unread = 0;
|
||||
size *= count;
|
||||
if (size > data->remain)
|
||||
{
|
||||
unread = size - data->remain;
|
||||
size = data->remain;
|
||||
data->error = 1;
|
||||
}
|
||||
memcpy(buf, data->data, size);
|
||||
data->data += size;
|
||||
data->remain -= size;
|
||||
if (unread)
|
||||
memset(((uint8_t*)buf) + size, 0, unread);
|
||||
}
|
||||
|
||||
int memerror(void* _data)
|
||||
{
|
||||
struct memdata* data = (struct memdata*)_data;
|
||||
return data->error;
|
||||
}
|
||||
|
||||
void fileread(void* buf, size_t size, size_t count, void* _file)
|
||||
{
|
||||
FILE* file = (FILE*)_file;
|
||||
fread(buf, size, count, file);
|
||||
}
|
||||
|
||||
int fileerror(void* _file)
|
||||
{
|
||||
FILE* file = (FILE*)_file;
|
||||
return ferror(file);
|
||||
}
|
||||
|
||||
typedef void (*thereader)(void*, size_t, size_t, void*);
|
||||
typedef int (*theerror)(void*);
|
||||
|
||||
//---------------------JXS3457
|
||||
|
||||
static int struct_readHeader(JT1Song* dest, thereader reader, theerror iferror, void* fin) {
|
||||
|
||||
f_JT1Header t;
|
||||
|
||||
reader(&t, sizeof(f_JT1Header), 1, fin);
|
||||
dest->mugiversion = t.mugiversion;
|
||||
dest->nrofpats = t.nrofpats;
|
||||
dest->nrofsongs = t.nrofsongs;
|
||||
dest->nrofinst = t.nrofinst;
|
||||
return iferror(fin);
|
||||
}
|
||||
|
||||
static int struct_readSubsong(JT1Subsong* dest, size_t len, thereader reader, theerror iferror, void* fin) {
|
||||
uint32_t i, j, k;
|
||||
f_JT1Subsong t;
|
||||
|
||||
for (i=0; i < len; i++) {
|
||||
reader(&t, sizeof(f_JT1Subsong), 1, fin);
|
||||
for (j=0; j < J3457_CHANS_SUBSONG; j++) dest[i].mute[j] = t.mute[j];
|
||||
dest[i].songspd = t.songspd;
|
||||
dest[i].groove = t.groove;
|
||||
dest[i].songpos = t.songpos;
|
||||
dest[i].songstep = t.songstep;
|
||||
dest[i].endpos = t.endpos;
|
||||
dest[i].endstep = t.endstep;
|
||||
dest[i].looppos = t.looppos;
|
||||
dest[i].loopstep = t.loopstep;
|
||||
dest[i].songloop = t.songloop;
|
||||
memcpy(&dest[i].name, &t.name, 32);
|
||||
dest[i].nrofchans = t.nrofchans;
|
||||
dest[i].delaytime = t.delaytime;
|
||||
for (j=0; j < J3457_CHANS_SUBSONG; j++) {
|
||||
dest[i].delayamount[j] = t.delayamount[j];
|
||||
}
|
||||
dest[i].amplification = t.amplification;
|
||||
for (j=0; j < J3457_CHANS_SUBSONG; j++) {
|
||||
for (k=0; k < J3457_ORDERS_SUBSONG; k++) {
|
||||
dest[i].orders[j][k].patnr = t.orders[j][k].patnr;
|
||||
dest[i].orders[j][k].patlen = t.orders[j][k].patlen;
|
||||
}
|
||||
}
|
||||
}
|
||||
return iferror(fin);
|
||||
}
|
||||
|
||||
static int struct_readPat(JT1Row* dest, size_t len, thereader reader, theerror iferror, void* fin) {
|
||||
uint32_t i, j;
|
||||
f_JT1Row t[J3457_ROWS_PAT];
|
||||
|
||||
for (i=0; i < len; i++) {
|
||||
reader(&t, sizeof(f_JT1Row)*J3457_ROWS_PAT, 1, fin);
|
||||
for (j=0; j < J3457_ROWS_PAT; j++) {
|
||||
uint32_t off = i*J3457_ROWS_PAT + j;
|
||||
dest[off].srcnote = t[j].srcnote;
|
||||
dest[off].dstnote = t[j].dstnote;
|
||||
dest[off].inst = t[j].inst;
|
||||
dest[off].param = t[j].param;
|
||||
dest[off].script = t[j].script;
|
||||
}
|
||||
}
|
||||
return iferror(fin);
|
||||
}
|
||||
|
||||
static int struct_readInst(JT1Inst* dest, size_t len, thereader reader, theerror iferror, void* fin) {
|
||||
uint32_t i, j;
|
||||
f_JT1Inst t;
|
||||
for (i=0; i < len; i++) {
|
||||
reader(&t, sizeof(f_JT1Inst), 1, fin);
|
||||
dest[i].mugiversion = t.mugiversion;
|
||||
memcpy(&dest[i].instname, &t.instname, 32);
|
||||
dest[i].waveform = t.waveform;
|
||||
dest[i].wavelength = t.wavelength;
|
||||
dest[i].mastervol = t.mastervol;
|
||||
dest[i].amwave = t.amwave;
|
||||
dest[i].amspd = t.amspd;
|
||||
dest[i].amlooppoint = t.amlooppoint;
|
||||
dest[i].finetune = t.finetune;
|
||||
dest[i].fmwave = t.fmwave;
|
||||
dest[i].fmspd = t.fmspd;
|
||||
dest[i].fmlooppoint = t.fmlooppoint;
|
||||
dest[i].fmdelay = t.fmdelay;
|
||||
dest[i].arpeggio = t.arpeggio;
|
||||
for (j=0; j < J3457_WAVES_INST; j++) {
|
||||
dest[i].resetwave[j] = t.resetwave[j];
|
||||
}
|
||||
dest[i].panwave = t.panwave;
|
||||
dest[i].panspd = t.panspd;
|
||||
dest[i].panlooppoint = t.panlooppoint;
|
||||
for (j=0; j < J3457_EFF_INST; j++) {
|
||||
dest[i].fx[j].dsteffect = t.fx[j].dsteffect;
|
||||
dest[i].fx[j].srceffect1 = t.fx[j].srceffect1;
|
||||
dest[i].fx[j].srceffect2 = t.fx[j].srceffect2;
|
||||
dest[i].fx[j].osceffect = t.fx[j].osceffect;
|
||||
dest[i].fx[j].effectvar1 = t.fx[j].effectvar1;
|
||||
dest[i].fx[j].effectvar2 = t.fx[j].effectvar2;
|
||||
dest[i].fx[j].effectspd = t.fx[j].effectspd;
|
||||
dest[i].fx[j].oscspd = t.fx[j].oscspd;
|
||||
dest[i].fx[j].effecttype = t.fx[j].effecttype;
|
||||
dest[i].fx[j].oscflg = t.fx[j].oscflg;
|
||||
dest[i].fx[j].reseteffect = t.fx[j].reseteffect;
|
||||
}
|
||||
memcpy(&dest[i].samplename, &t.samplename, 192);
|
||||
//exFnameFromPath(&dest[i].samplename, &t.samplename, SE_NAMELEN);
|
||||
dest[i].sharing = t.sharing;
|
||||
dest[i].loopflg = t.loopflg;
|
||||
dest[i].bidirecflg = t.bidirecflg;
|
||||
dest[i].startpoint = t.startpoint;
|
||||
dest[i].looppoint = t.looppoint;
|
||||
dest[i].endpoint = t.endpoint;
|
||||
dest[i].hasSampData = t.hasSampData ? 1 : 0; //this was a sampdata pointer in original jaytrax
|
||||
dest[i].samplelength = t.samplelength;
|
||||
//memcpy(&dest[i].waves, &t.waves, J3457_WAVES_INST * J3457_SAMPS_WAVE * sizeof(int16_t));
|
||||
reader(&dest->waves, 2, J3457_WAVES_INST * J3457_SAMPS_WAVE, fin);
|
||||
}
|
||||
return iferror(fin);
|
||||
}
|
||||
|
||||
//---------------------JXS3458
|
||||
|
||||
/* Soon! */
|
||||
|
||||
//---------------------
|
||||
|
||||
static int jxsfile_readSongCb(thereader reader, theerror iferror, void* fin, JT1Song** sngOut) {
|
||||
#define FAIL(x) {error=(x); goto _ERR;}
|
||||
JT1Song* song;
|
||||
int i;
|
||||
int error;
|
||||
|
||||
//song
|
||||
if((song = (JT1Song*)calloc(1, sizeof(JT1Song)))) {
|
||||
int version;
|
||||
|
||||
if (struct_readHeader(song, reader, iferror, fin)) FAIL(ERR_BADSONG);
|
||||
//version magic
|
||||
version = song->mugiversion;
|
||||
if (version >= 3456 && version <= 3457) {
|
||||
int nrSubsongs = song->nrofsongs;
|
||||
int nrPats = song->nrofpats;
|
||||
int nrRows = J3457_ROWS_PAT * nrPats;
|
||||
int nrInst = song->nrofinst;
|
||||
|
||||
//subsongs
|
||||
if ((song->subsongs = (JT1Subsong**)calloc(nrSubsongs, sizeof(JT1Subsong*)))) {
|
||||
for (i=0; i < nrSubsongs; i++) {
|
||||
if ((song->subsongs[i] = (JT1Subsong*)calloc(1, sizeof(JT1Subsong)))) {
|
||||
if (struct_readSubsong(song->subsongs[i], 1, reader, iferror, fin)) FAIL(ERR_BADSONG);
|
||||
} else FAIL(ERR_MALLOC);
|
||||
}
|
||||
} else FAIL(ERR_MALLOC);
|
||||
|
||||
//patterns
|
||||
if ((song->patterns = (JT1Row*)calloc(nrRows, sizeof(JT1Row)))) {
|
||||
if (struct_readPat(song->patterns, nrPats, reader, iferror, fin)) FAIL(ERR_BADSONG);
|
||||
} else FAIL(ERR_MALLOC);
|
||||
|
||||
//pattern names. Length includes \0
|
||||
if ((song->patNames = (char**)calloc(nrPats, sizeof(char*)))) {
|
||||
for (i=0; i < nrPats; i++) {
|
||||
int32_t nameLen = 0;
|
||||
|
||||
reader(&nameLen, 4, 1, fin);
|
||||
if ((song->patNames[i] = (char*)calloc(nameLen, sizeof(char)))) {
|
||||
reader(song->patNames[i], nameLen, 1, fin);
|
||||
} else FAIL(ERR_MALLOC);
|
||||
}
|
||||
|
||||
if (iferror(fin)) FAIL(ERR_BADSONG);
|
||||
} else FAIL(ERR_MALLOC);
|
||||
|
||||
//instruments
|
||||
if ((song->instruments = (JT1Inst**)calloc(nrInst, sizeof(JT1Inst*)))) {
|
||||
if (!(song->samples = (uint8_t**)calloc(nrInst, sizeof(uint8_t*)))) FAIL(ERR_MALLOC);
|
||||
for (i=0; i < nrInst; i++) {
|
||||
if ((song->instruments[i] = (JT1Inst*)calloc(1, sizeof(JT1Inst)))) {
|
||||
JT1Inst* inst = song->instruments[i];
|
||||
if (struct_readInst(inst, 1, reader, iferror, fin)) FAIL(ERR_BADSONG);
|
||||
|
||||
//patch old instrument to new
|
||||
if (version == 3456) {
|
||||
inst->sharing = 0;
|
||||
inst->loopflg = 0;
|
||||
inst->bidirecflg = 0;
|
||||
inst->startpoint = 0;
|
||||
inst->looppoint = 0;
|
||||
inst->endpoint = 0;
|
||||
//silly place to put a pointer
|
||||
if (inst->hasSampData) {
|
||||
inst->startpoint=0;
|
||||
inst->endpoint=(inst->samplelength/2);
|
||||
inst->looppoint=0;
|
||||
}
|
||||
}
|
||||
|
||||
//sample data
|
||||
if (inst->hasSampData) {
|
||||
//inst->samplelength is in bytes, not samples
|
||||
if(!(song->samples[i] = (uint8_t*)calloc(inst->samplelength, sizeof(uint8_t)))) FAIL(ERR_MALLOC);
|
||||
reader(song->samples[i], 1, inst->samplelength, fin);
|
||||
if (iferror(fin)) FAIL(ERR_BADSONG);
|
||||
} else {
|
||||
song->samples[i] = NULL;
|
||||
}
|
||||
} else FAIL(ERR_MALLOC);
|
||||
}
|
||||
} else FAIL(ERR_MALLOC);
|
||||
|
||||
//arpeggio table
|
||||
reader(&song->arpTable, J3457_STEPS_ARP, J3457_ARPS_SONG, fin);
|
||||
|
||||
if (iferror(fin)) FAIL(ERR_BADSONG);
|
||||
} else if (version == 3458) {
|
||||
//Soon enough!
|
||||
FAIL(ERR_BADSONG);
|
||||
} else FAIL(ERR_BADSONG);
|
||||
} else FAIL(ERR_MALLOC);
|
||||
|
||||
*sngOut = song;
|
||||
return ERR_OK;
|
||||
#undef FAIL
|
||||
_ERR:
|
||||
jxsfile_freeSong(song);
|
||||
*sngOut = NULL;
|
||||
return error;
|
||||
}
|
||||
|
||||
int jxsfile_readSong(const char* path, JT1Song** sngOut) {
|
||||
char buf[BUFSIZ];
|
||||
FILE *fin;
|
||||
int error;
|
||||
|
||||
if (!(fin = fopen(path, "rb"))) return ERR_FILEIO;
|
||||
setbuf(fin, buf);
|
||||
|
||||
error = jxsfile_readSongCb(fileread, fileerror, fin, sngOut);
|
||||
|
||||
fclose(fin);
|
||||
return error;
|
||||
|
||||
_ERR:
|
||||
if (fin) fclose(fin);
|
||||
return error;
|
||||
}
|
||||
|
||||
int jxsfile_readSongMem(const uint8_t* data, size_t size, JT1Song** sngOut) {
|
||||
struct memdata fin;
|
||||
fin.data = data;
|
||||
fin.remain = size;
|
||||
fin.error = 0;
|
||||
|
||||
return jxsfile_readSongCb(memread, memerror, &fin, sngOut);
|
||||
}
|
||||
|
||||
void jxsfile_freeSong(JT1Song* song) {
|
||||
if (song) {
|
||||
int i;
|
||||
int nrSubsongs = song->nrofsongs;
|
||||
int nrPats = song->nrofpats;
|
||||
int nrInst = song->nrofinst;
|
||||
|
||||
if (song->subsongs) {
|
||||
|
||||
for (i=0; i < nrSubsongs; i++) {
|
||||
if (song->subsongs[i])
|
||||
free(song->subsongs[i]);
|
||||
}
|
||||
|
||||
free(song->subsongs);
|
||||
}
|
||||
|
||||
if (song->patterns) {
|
||||
free(song->patterns);
|
||||
}
|
||||
|
||||
if (song->patNames) {
|
||||
for (i=0; i < nrPats; i++) {
|
||||
if (song->patNames[i])
|
||||
free(song->patNames[i]);
|
||||
}
|
||||
|
||||
free(song->patNames);
|
||||
}
|
||||
|
||||
if (song->instruments && song->samples) {
|
||||
for (i=0; i < nrInst; i++) {
|
||||
if (song->instruments[i])
|
||||
free(song->instruments[i]);
|
||||
if (song->samples[i])
|
||||
free(song->samples[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (song->samples) {
|
||||
free(song->samples);
|
||||
}
|
||||
|
||||
if (song->instruments) {
|
||||
free(song->instruments);
|
||||
}
|
||||
|
||||
free(song);
|
||||
}
|
||||
}
|
|
@ -1,168 +0,0 @@
|
|||
#ifndef JXS_H
|
||||
#define JXS_H
|
||||
#include <stdint.h>
|
||||
#include "jaytrax.h"
|
||||
|
||||
#define J3457_CHANS_SUBSONG (16)
|
||||
#define J3457_ORDERS_SUBSONG (256)
|
||||
#define J3457_ROWS_PAT (64)
|
||||
#define J3457_EFF_INST (4)
|
||||
#define J3457_WAVES_INST (16)
|
||||
#define J3457_SAMPS_WAVE (256)
|
||||
#define J3457_ARPS_SONG (16)
|
||||
#define J3457_STEPS_ARP (16)
|
||||
|
||||
typedef struct f_JT1Order f_JT1Order;
|
||||
struct f_JT1Order {
|
||||
int16_t patnr; // welk pattern spelen...
|
||||
int16_t patlen; // 0/16/32/48
|
||||
} __attribute__((__packed__));
|
||||
|
||||
typedef struct f_JT1Row f_JT1Row;
|
||||
struct f_JT1Row {
|
||||
uint8_t srcnote;
|
||||
uint8_t dstnote;
|
||||
uint8_t inst;
|
||||
int8_t param;
|
||||
uint8_t script;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
typedef struct f_JT1Header f_JT1Header;
|
||||
struct f_JT1Header {
|
||||
int16_t mugiversion;//version of mugician this song was saved with
|
||||
int16_t PAD00;
|
||||
int32_t nrofpats; //aantal patterns beschikbaar
|
||||
int32_t nrofsongs; //aantal beschikbare subsongs
|
||||
int32_t nrofinst; //aantal gebruikte instruments
|
||||
int32_t PAD01;
|
||||
int16_t PAD02;
|
||||
int16_t PAD03;
|
||||
int16_t PAD04;
|
||||
int16_t PAD05;
|
||||
int16_t PAD06;
|
||||
int16_t PAD07;
|
||||
int16_t PAD08;
|
||||
int16_t PAD09;
|
||||
int16_t PAD0A;
|
||||
int16_t PAD0B;
|
||||
int16_t PAD0C;
|
||||
int16_t PAD0D;
|
||||
int16_t PAD0E;
|
||||
int16_t PAD0F;
|
||||
int16_t PAD10;
|
||||
int16_t PAD11;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
typedef struct f_JT1Subsong f_JT1Subsong;
|
||||
struct f_JT1Subsong {
|
||||
int32_t PAD00[J3457_CHANS_SUBSONG];
|
||||
uint8_t mute[J3457_CHANS_SUBSONG]; // which channels are muted? (1=muted)
|
||||
int32_t songspd; // delay tussen de pattern-stepjes
|
||||
int32_t groove; // groove value... 0=nothing, 1 = swing, 2=shuffle
|
||||
int32_t songpos; // waar start song? (welke maat?)
|
||||
int32_t songstep; // welke patternpos offset? (1/64 van maat)
|
||||
int32_t endpos; // waar stopt song? (welke maat?)
|
||||
int32_t endstep; // welke patternpos offset? (1/64 van maat)
|
||||
int32_t looppos; // waar looped song? (welke maat?)
|
||||
int32_t loopstep; // welke patternpos offset? (1/64 van maat)
|
||||
int16_t songloop; // if true, the song loops inbetween looppos and endpos
|
||||
char name[32]; // name of subsong
|
||||
int16_t nrofchans; //nr of channels used
|
||||
uint16_t delaytime; // the delaytime (for the echo effect)
|
||||
uint8_t delayamount[J3457_CHANS_SUBSONG]; // amount per channel for the echo-effect
|
||||
int16_t amplification; //extra amplification factor (20 to 1000)
|
||||
int16_t PAD01;
|
||||
int16_t PAD02;
|
||||
int16_t PAD03;
|
||||
int16_t PAD04;
|
||||
int16_t PAD05;
|
||||
int16_t PAD06;
|
||||
f_JT1Order orders[J3457_CHANS_SUBSONG][J3457_ORDERS_SUBSONG];
|
||||
} __attribute__((__packed__));
|
||||
|
||||
typedef struct f_JT1Effect f_JT1Effect;
|
||||
struct f_JT1Effect {
|
||||
int32_t dsteffect;
|
||||
int32_t srceffect1;
|
||||
int32_t srceffect2;
|
||||
int32_t osceffect;
|
||||
int32_t effectvar1;
|
||||
int32_t effectvar2;
|
||||
int32_t effectspd;
|
||||
int32_t oscspd;
|
||||
int32_t effecttype;
|
||||
int8_t oscflg;
|
||||
int8_t reseteffect;
|
||||
int16_t PAD00;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
// inst is the structure which has the entire instrument definition.
|
||||
typedef struct f_JT1Inst f_JT1Inst;
|
||||
struct f_JT1Inst {
|
||||
int16_t mugiversion;
|
||||
char instname[32];
|
||||
int16_t waveform;
|
||||
int16_t wavelength;
|
||||
int16_t mastervol;
|
||||
int16_t amwave;
|
||||
int16_t amspd;
|
||||
int16_t amlooppoint;
|
||||
int16_t finetune;
|
||||
int16_t fmwave;
|
||||
int16_t fmspd;
|
||||
int16_t fmlooppoint;
|
||||
int16_t fmdelay;
|
||||
int16_t arpeggio;
|
||||
int8_t resetwave[J3457_WAVES_INST];
|
||||
int16_t panwave;
|
||||
int16_t panspd;
|
||||
int16_t panlooppoint;
|
||||
int16_t PAD00;
|
||||
int16_t PAD01;
|
||||
int16_t PAD02;
|
||||
int16_t PAD03;
|
||||
int16_t PAD04;
|
||||
int16_t PAD05;
|
||||
f_JT1Effect fx[J3457_EFF_INST];
|
||||
char samplename[192]; // path naar de gebruikte sample (was _MAX_PATH lang... is nu getruncate naar 192)(in de toekomst nog kleiner?)
|
||||
int32_t PAD06;
|
||||
int32_t PAD07;
|
||||
int32_t PAD08;
|
||||
int32_t PAD09;
|
||||
int32_t PAD0A;
|
||||
int32_t PAD0B;
|
||||
int32_t PAD0C;
|
||||
int32_t PAD0D;
|
||||
int32_t PAD0E;
|
||||
int32_t PAD0F;
|
||||
int32_t PAD10;
|
||||
int32_t PAD11;
|
||||
int16_t PAD12;
|
||||
int16_t sharing; // sample sharing! sharing contains instr nr of shared sanpledata (0=no sharing)
|
||||
int16_t loopflg; //does the sample loop or play one/shot? (0=1shot)
|
||||
int16_t bidirecflg; // does the sample loop birdirectional? (0=no)
|
||||
int32_t startpoint;
|
||||
int32_t looppoint;
|
||||
int32_t endpoint;
|
||||
int32_t hasSampData; // pointer naar de sample (mag 0 zijn)
|
||||
int32_t samplelength; // length of sample
|
||||
//int16_t waves[J3457_WAVES_INST * J3457_SAMPS_WAVE];
|
||||
} __attribute__((__packed__));
|
||||
|
||||
//---------------------JXS3458
|
||||
|
||||
|
||||
//---------------------
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int jxsfile_readSong(const char* path, JT1Song** sngOut);
|
||||
int jxsfile_readSongMem(const uint8_t* data, size_t size, JT1Song** sngOut);
|
||||
void jxsfile_freeSong(JT1Song* song);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -1,213 +0,0 @@
|
|||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "mixcore.h"
|
||||
#include "jaytrax.h"
|
||||
|
||||
// ITP_[number of taps]_[input sample width]_[fractional precision]_[readable name]
|
||||
#define ITP_T02_S16_I08_LINEAR(P, F) (P[0]+(((P[1]-P[0])*F) >> 8))
|
||||
#define ITP_T03_S16_I15_QUADRA(P, F) (((((((((P[0] + P[2]) >> 1) - P[1]) * F) >> 16) + P[1]) - ((P[2] + P[0] + (P[0] << 1)) >> 2)) * F) >> 14) + P[0]
|
||||
#define ITP_T04_S16_I08_CUBIC(P, F) (P[1] + ((F*(P[2] - P[0] + ((F*(2 * P[0] - 5 * P[1] + 4 * P[2] - P[3] + ((F*(3 * (P[1] - P[2]) + P[3] - P[0]) + 0x80) >> 8)) + 0x80) >> 8)) + 0x100) >> 9))
|
||||
#define ITP_T04_SXX_F01_CUBIC(P, F) (P[1] + 0.5 * F*(P[2] - P[0] + F*(2.0 * P[0] - 5.0 * P[1] + 4.0 * P[2] - P[3] + F * (3.0 * (P[1] - P[2]) + P[3] - P[0]))))
|
||||
|
||||
|
||||
//---------------------interpolators
|
||||
#define GET_PT(x) buf[((pos + ((x)<<8)) & sizeMask)>>8]
|
||||
|
||||
static int32_t itpNone(int16_t* buf, int32_t pos, int32_t sizeMask) {
|
||||
return 0;(void)buf;(void)pos;(void)sizeMask;
|
||||
}
|
||||
|
||||
static int32_t itpNearest(int16_t* buf, int32_t pos, int32_t sizeMask) {
|
||||
return GET_PT(0);
|
||||
}
|
||||
|
||||
static int32_t itpLinear(int16_t* buf, int32_t pos, int32_t sizeMask) {
|
||||
int32_t p[2];
|
||||
int32_t frac = pos & 0xFF;
|
||||
|
||||
p[0] = GET_PT(0);
|
||||
p[1] = GET_PT(1);
|
||||
|
||||
return ITP_T02_S16_I08_LINEAR(p, frac);
|
||||
}
|
||||
|
||||
static int32_t itpQuad(int16_t* buf, int32_t pos, int32_t sizeMask) {
|
||||
int32_t p[3];
|
||||
int32_t frac = (pos & 0xFF)<<7;
|
||||
|
||||
p[0] = GET_PT(0);
|
||||
p[1] = GET_PT(1);
|
||||
p[2] = GET_PT(2);
|
||||
|
||||
return ITP_T03_S16_I15_QUADRA(p, frac);
|
||||
}
|
||||
|
||||
static int32_t itpCubic(int16_t* buf, int32_t pos, int32_t sizeMask) {
|
||||
int32_t p[4];
|
||||
int32_t frac = pos & 0xFF;
|
||||
|
||||
p[0] = GET_PT(0);
|
||||
p[1] = GET_PT(1);
|
||||
p[2] = GET_PT(2);
|
||||
p[3] = GET_PT(3);
|
||||
|
||||
return ITP_T04_S16_I08_CUBIC(p, frac);
|
||||
}
|
||||
|
||||
Interpolator interps[INTERP_COUNT] = {
|
||||
{ITP_NONE, 0, &itpNone, "None"},
|
||||
{ITP_NEAREST, 1, &itpNearest, "Nearest"},
|
||||
{ITP_LINEAR, 2, &itpLinear, "Linear"},
|
||||
{ITP_QUADRATIC, 3, &itpQuad, "Quadratic"},
|
||||
{ITP_CUBIC, 4, &itpCubic, "Cubic"},
|
||||
//{ITP_BLEP, -1, &mixSynthNearest, &mixSampNearest, "BLEP"} //BLEP needs variable amount of taps
|
||||
};
|
||||
|
||||
static void smpCpyFrw(int16_t* destination, const int16_t* source, int32_t num) {
|
||||
memcpy(destination, source, num * sizeof(int16_t));
|
||||
}
|
||||
|
||||
static void smpCpyRev(int16_t* destination, const int16_t* source, int32_t num) {
|
||||
for (int i=0; i < num; i++) {
|
||||
destination[i] = source[num-1 - i];
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------API
|
||||
|
||||
uint8_t jaymix_setInterp(Interpolator** out, uint8_t id) {
|
||||
for (int8_t i=0; i<INTERP_COUNT; i++) {
|
||||
if (interps[i].id == id) {
|
||||
*out = &interps[i];
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void jaymix_mixCore(JT1Player* SELF, int32_t numSamples) {
|
||||
int32_t tempBuf[MIXBUF_LEN];
|
||||
int32_t ic, is, doneSmp;
|
||||
int32_t* outBuf = &SELF->tempBuf[0];
|
||||
int32_t chanNr = SELF->subsong->nrofchans;
|
||||
|
||||
|
||||
assert(numSamples <= MIXBUF_LEN);
|
||||
memset(&outBuf[0], 0, numSamples * MIXBUF_NR * sizeof(int32_t));
|
||||
|
||||
|
||||
for (ic=0; ic < chanNr; ic++) {
|
||||
JT1Voice* vc = &SELF->voices[ic];
|
||||
int32_t (*fItp) (int16_t* buf, int pos, int sizeMask);
|
||||
int32_t loopLen = vc->endpoint - vc->looppoint;
|
||||
|
||||
doneSmp = 0;
|
||||
if (vc->sampledata) {
|
||||
|
||||
if (!vc->wavePtr) continue;
|
||||
if (vc->samplepos < 0) continue;
|
||||
fItp = SELF->itp->fItp;
|
||||
|
||||
while (doneSmp < numSamples) {
|
||||
int16_t tapArr[32] = {0};
|
||||
int32_t tapPos = vc->samplepos>>8;
|
||||
uint8_t tapDir = 0;
|
||||
|
||||
//slow, but better than nothing
|
||||
//also, not centered
|
||||
for (int i=0; i < SELF->itp->numTaps; i++) {
|
||||
tapArr[i] = vc->wavePtr[tapPos];
|
||||
|
||||
if (tapDir) { //backwards
|
||||
tapPos--;
|
||||
|
||||
if (tapPos < (vc->looppoint>>8)) {
|
||||
tapPos += 2;
|
||||
tapDir = 0;
|
||||
}
|
||||
} else { //forwards
|
||||
tapPos++;
|
||||
|
||||
if (tapPos >= (vc->endpoint>>8)) {
|
||||
if (vc->loopflg) { //has loop
|
||||
if(vc->bidirecflg) { //bidi
|
||||
tapPos -= 2;
|
||||
tapDir = 1;
|
||||
} else { //straight
|
||||
tapPos -= (loopLen>>8);
|
||||
}
|
||||
} else { //oneshot
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tempBuf[doneSmp++] = fItp(tapArr, vc->samplepos&0xFF, 0xFFFFFFFF); //vc->wavePtr[vc->samplepos>>8];
|
||||
vc->samplepos += vc->freqOffset;
|
||||
|
||||
|
||||
|
||||
if (vc->freqOffset < 0) { //backwards
|
||||
if (vc->samplepos < vc->looppoint) {
|
||||
vc->freqOffset *= -1;
|
||||
vc->samplepos += vc->freqOffset;
|
||||
}
|
||||
} else { //forwards
|
||||
if (vc->samplepos >= vc->endpoint) {
|
||||
if (vc->loopflg) { //has loop
|
||||
if(vc->bidirecflg) { //bidi
|
||||
vc->freqOffset *= -1;
|
||||
vc->samplepos += vc->freqOffset;
|
||||
} else { //straight
|
||||
vc->samplepos -= loopLen;
|
||||
}
|
||||
} else { //oneshot
|
||||
vc->samplepos = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else { //synth render
|
||||
int32_t nos;
|
||||
|
||||
if (!vc->wavePtr) {
|
||||
//original replayer plays through an empty wave
|
||||
vc->synthPos += vc->freqOffset * numSamples;
|
||||
vc->synthPos &= vc->waveLength;
|
||||
continue;
|
||||
}
|
||||
fItp = SELF->itp->fItp;
|
||||
|
||||
//loop unroll optimization
|
||||
nos = numSamples;
|
||||
if (nos&1) {
|
||||
tempBuf[doneSmp++] = fItp(vc->wavePtr, vc->synthPos, vc->waveLength);
|
||||
vc->synthPos += vc->freqOffset;
|
||||
vc->synthPos &= vc->waveLength;
|
||||
nos--;
|
||||
}
|
||||
for(is=0; is < nos; is+=2) {
|
||||
tempBuf[doneSmp++] = fItp(vc->wavePtr, vc->synthPos, vc->waveLength);
|
||||
vc->synthPos += vc->freqOffset;
|
||||
vc->synthPos &= vc->waveLength;
|
||||
tempBuf[doneSmp++] = fItp(vc->wavePtr, vc->synthPos, vc->waveLength);
|
||||
vc->synthPos += vc->freqOffset;
|
||||
vc->synthPos &= vc->waveLength;
|
||||
}
|
||||
}
|
||||
|
||||
for(is=0; is < doneSmp; is++) {
|
||||
int32_t samp, off;
|
||||
|
||||
samp = tempBuf[is];
|
||||
off = is * MIXBUF_NR;
|
||||
outBuf[off + BUF_MAINL] += (samp * vc->gainMainL)>>8;
|
||||
outBuf[off + BUF_MAINR] += (samp * vc->gainMainR)>>8;
|
||||
outBuf[off + BUF_ECHOL] += (samp * vc->gainEchoL)>>8;
|
||||
outBuf[off + BUF_ECHOR] += (samp * vc->gainEchoR)>>8;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#ifndef MIXCORE_H
|
||||
#define MIXCORE_H
|
||||
#include <stdint.h>
|
||||
#include "jaytrax.h"
|
||||
|
||||
#define CLAMP(x, low, high) (x = ((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
|
||||
//#define CLAMP16(x) if ((int16_t)(x) != x) x = 0x7FFF ^ (x >> 31) //fast 32 -> 16 bit clamp
|
||||
#define CLAMP16(x) (int16_t)(x) != x ? 0x7FFF ^ (x >> 31) : x //fast 32 -> 16 bit clamp
|
||||
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#define CHKPOS(VC) ((VC->samplepos >= 0) && ((VC->curdirecflg && ((VC->samplepos & 0xFFFFFF00) >= VC->looppoint)) || ((VC->samplepos & 0xFFFFFF00) < VC->endpoint)))
|
||||
|
||||
void jaymix_mixCore(JT1Player* SELF, int32_t numSamples);
|
||||
uint8_t jaymix_setInterp(Interpolator** out, uint8_t id);
|
||||
|
||||
#endif
|
|
@ -1,334 +0,0 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8398BF3D2769D28A0048F38A /* jaytrax.c in Sources */ = {isa = PBXBuildFile; fileRef = 8398BF3C2769D26D0048F38A /* jaytrax.c */; };
|
||||
8398BF3E2769D28D0048F38A /* jxs.c in Sources */ = {isa = PBXBuildFile; fileRef = 8398BF372769D26D0048F38A /* jxs.c */; };
|
||||
8398BF3F2769D2950048F38A /* mixcore.c in Sources */ = {isa = PBXBuildFile; fileRef = 8398BF392769D26D0048F38A /* mixcore.c */; };
|
||||
8398BF402769D2EE0048F38A /* mixcore.h in Headers */ = {isa = PBXBuildFile; fileRef = 8398BF362769D26D0048F38A /* mixcore.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
8398BF412769D2F50048F38A /* ioutil.h in Headers */ = {isa = PBXBuildFile; fileRef = 8398BF3A2769D26D0048F38A /* ioutil.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
8398BF422769D2F80048F38A /* jaytrax.h in Headers */ = {isa = PBXBuildFile; fileRef = 8398BF382769D26D0048F38A /* jaytrax.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
8398BF432769D2FD0048F38A /* jxs.h in Headers */ = {isa = PBXBuildFile; fileRef = 8398BF3B2769D26D0048F38A /* jxs.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>"; };
|
||||
8398BF362769D26D0048F38A /* mixcore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mixcore.h; sourceTree = "<group>"; };
|
||||
8398BF372769D26D0048F38A /* jxs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = jxs.c; sourceTree = "<group>"; };
|
||||
8398BF382769D26D0048F38A /* jaytrax.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = jaytrax.h; sourceTree = "<group>"; };
|
||||
8398BF392769D26D0048F38A /* mixcore.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mixcore.c; sourceTree = "<group>"; };
|
||||
8398BF3A2769D26D0048F38A /* ioutil.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ioutil.h; sourceTree = "<group>"; };
|
||||
8398BF3B2769D26D0048F38A /* jxs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = jxs.h; sourceTree = "<group>"; };
|
||||
8398BF3C2769D26D0048F38A /* jaytrax.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = jaytrax.c; 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 = (
|
||||
8398BF3A2769D26D0048F38A /* ioutil.h */,
|
||||
8398BF3C2769D26D0048F38A /* jaytrax.c */,
|
||||
8398BF382769D26D0048F38A /* jaytrax.h */,
|
||||
8398BF372769D26D0048F38A /* jxs.c */,
|
||||
8398BF3B2769D26D0048F38A /* jxs.h */,
|
||||
8398BF392769D26D0048F38A /* mixcore.c */,
|
||||
8398BF362769D26D0048F38A /* mixcore.h */,
|
||||
832FF3201C96511E0076D662 /* Info.plist */,
|
||||
);
|
||||
path = "Syntrax-c";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
832FF3181C96511E0076D662 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8398BF412769D2F50048F38A /* ioutil.h in Headers */,
|
||||
8398BF422769D2F80048F38A /* jaytrax.h in Headers */,
|
||||
8398BF432769D2FD0048F38A /* jxs.h in Headers */,
|
||||
8398BF402769D2EE0048F38A /* mixcore.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 = 1250;
|
||||
ORGANIZATIONNAME = "Christopher Snowhill";
|
||||
TargetAttributes = {
|
||||
832FF31A1C96511E0076D662 = {
|
||||
DevelopmentTeam = "";
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 832FF3151C96511E0076D662 /* Build configuration list for PBXProject "Syntrax_c" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
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 = (
|
||||
8398BF3D2769D28A0048F38A /* jaytrax.c in Sources */,
|
||||
8398BF3E2769D28D0048F38A /* jxs.c in Sources */,
|
||||
8398BF3F2769D2950048F38A /* mixcore.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
832FF3211C96511E0076D662 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
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.12;
|
||||
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_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
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.12;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
832FF3241C96511E0076D662 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
INFOPLIST_FILE = "Syntrax-c/Info.plist";
|
||||
INSTALL_PATH = "@loader_path/../Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cogx.Syntrax-c";
|
||||
PRODUCT_NAME = Syntrax_c;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
832FF3251C96511E0076D662 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
INFOPLIST_FILE = "Syntrax-c/Info.plist";
|
||||
INSTALL_PATH = "@loader_path/../Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cogx.Syntrax-c";
|
||||
PRODUCT_NAME = Syntrax_c;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
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 */;
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1250"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "832FF31A1C96511E0076D662"
|
||||
BuildableName = "Syntrax_c.framework"
|
||||
BlueprintName = "Syntrax_c"
|
||||
ReferencedContainer = "container:Syntrax_c.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "832FF31A1C96511E0076D662"
|
||||
BuildableName = "Syntrax_c.framework"
|
||||
BlueprintName = "Syntrax_c"
|
||||
ReferencedContainer = "container:Syntrax_c.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "832FF31A1C96511E0076D662"
|
||||
BuildableName = "Syntrax_c.framework"
|
||||
BlueprintName = "Syntrax_c"
|
||||
ReferencedContainer = "container:Syntrax_c.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
|
@ -1,384 +0,0 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8333B6751DCC49FF004C140D /* Syntrax_c.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83EEAB171C96537A002761C5 /* Syntrax_c.framework */; };
|
||||
83EEAB0F1C965324002761C5 /* jxsDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 83EEAB0E1C965324002761C5 /* jxsDecoder.m */; };
|
||||
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>"; };
|
||||
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 = (
|
||||
8333B6751DCC49FF004C140D /* 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 */,
|
||||
);
|
||||
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 = 1250;
|
||||
ORGANIZATIONNAME = "Christopher Snowhill";
|
||||
TargetAttributes = {
|
||||
832FF2F71C96508E0076D662 = {
|
||||
DevelopmentTeam = "";
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 832FF2F31C96508E0076D662 /* Build configuration list for PBXProject "Syntrax" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
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_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
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.12;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
832FF2FD1C96508E0076D662 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
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.12;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
832FF2FF1C96508E0076D662 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = Syntrax/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cogx.Syntrax;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SKIP_INSTALL = YES;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
832FF3001C96508E0076D662 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = Syntrax/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cogx.Syntrax;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
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 */;
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1250"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "832FF2F71C96508E0076D662"
|
||||
BuildableName = "Syntrax.bundle"
|
||||
BlueprintName = "Syntrax"
|
||||
ReferencedContainer = "container:Syntrax.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "832FF2F71C96508E0076D662"
|
||||
BuildableName = "Syntrax.bundle"
|
||||
BlueprintName = "Syntrax"
|
||||
ReferencedContainer = "container:Syntrax.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "832FF2F71C96508E0076D662"
|
||||
BuildableName = "Syntrax.bundle"
|
||||
BlueprintName = "Syntrax"
|
||||
ReferencedContainer = "container:Syntrax.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
|
@ -1,28 +0,0 @@
|
|||
<?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 © 2021 Christopher Snowhill. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,17 +0,0 @@
|
|||
//
|
||||
// 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
|
|
@ -1,85 +0,0 @@
|
|||
//
|
||||
// jxsContainer.m
|
||||
// Syntrax-c
|
||||
//
|
||||
// Created by Christopher Snowhill on 03/14/16.
|
||||
// Copyright 2016 __NoWork, Inc__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Syntrax_c/jxs.h>
|
||||
#import <Syntrax_c/jaytrax.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];
|
||||
|
||||
JT1Song * synSong;
|
||||
if (jxsfile_readSongMem(data, size, &synSong))
|
||||
{
|
||||
ALog(@"Open failed for file: %@", [url absoluteString]);
|
||||
free(data);
|
||||
return nil;
|
||||
}
|
||||
|
||||
free(data);
|
||||
|
||||
int i;
|
||||
int subsongs = synSong->nrofsongs;
|
||||
|
||||
jxsfile_freeSong(synSong);
|
||||
|
||||
NSMutableArray *tracks = [NSMutableArray array];
|
||||
|
||||
if ( subsongs ) {
|
||||
for (i = 0; i < subsongs; i++)
|
||||
{
|
||||
[tracks addObject:[NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:@"#%i", i]]];
|
||||
}
|
||||
}
|
||||
|
||||
return tracks;
|
||||
}
|
||||
|
||||
|
||||
@end
|
|
@ -1,25 +0,0 @@
|
|||
//
|
||||
// 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/jxs.h>
|
||||
#import <Syntrax_c/jaytrax.h>
|
||||
|
||||
#import "Plugin.h"
|
||||
|
||||
@interface jxsDecoder : NSObject <CogDecoder> {
|
||||
JT1Song *synSong;
|
||||
JT1Player *synPlayer;
|
||||
int track_num;
|
||||
|
||||
long framesLength;
|
||||
long totalFrames;
|
||||
long framesRead;
|
||||
}
|
||||
@end
|
|
@ -1,231 +0,0 @@
|
|||
//
|
||||
// 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
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
synSong = NULL;
|
||||
synPlayer = NULL;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (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];
|
||||
|
||||
if (jxsfile_readSongMem(data, size, &synSong))
|
||||
return NO;
|
||||
|
||||
free(data);
|
||||
|
||||
synPlayer = jaytrax_init();
|
||||
if (!synPlayer)
|
||||
return NO;
|
||||
|
||||
if (!jaytrax_loadSong(synPlayer, synSong))
|
||||
return NO;
|
||||
|
||||
framesLength = jaytrax_getLength(synPlayer, track_num, 2, 44100);
|
||||
totalFrames = framesLength + ((synPlayer->playFlg) ? 44100 * 8 : 0);
|
||||
|
||||
framesRead = 0;
|
||||
|
||||
[self willChangeValueForKey:@"properties"];
|
||||
[self didChangeValueForKey:@"properties"];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)decoderInitialize
|
||||
{
|
||||
jaytrax_changeSubsong(synPlayer, track_num);
|
||||
|
||||
uint8_t interp = ITP_CUBIC;
|
||||
NSString * resampling = [[NSUserDefaults standardUserDefaults] stringForKey:@"resampling"];
|
||||
if ([resampling isEqualToString:@"zoh"])
|
||||
interp = ITP_NEAREST;
|
||||
else if ([resampling isEqualToString:@"blep"])
|
||||
interp = ITP_NEAREST;
|
||||
else if ([resampling isEqualToString:@"linear"])
|
||||
interp = ITP_LINEAR;
|
||||
else if ([resampling isEqualToString:@"blam"])
|
||||
interp = ITP_LINEAR;
|
||||
else if ([resampling isEqualToString:@"cubic"])
|
||||
interp = ITP_CUBIC;
|
||||
else if ([resampling isEqualToString:@"sinc"])
|
||||
interp = ITP_CUBIC;
|
||||
|
||||
jaytrax_setInterpolation(synPlayer, interp);
|
||||
|
||||
framesRead = 0;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)decoderShutdown
|
||||
{
|
||||
if (synPlayer)
|
||||
{
|
||||
jaytrax_stopSong(synPlayer);
|
||||
}
|
||||
|
||||
framesRead = 0;
|
||||
}
|
||||
|
||||
- (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",
|
||||
@"Syntrax", @"codec",
|
||||
@"host", @"endian",
|
||||
nil];
|
||||
}
|
||||
|
||||
- (int)readAudio:(void *)buf frames:(UInt32)frames
|
||||
{
|
||||
BOOL repeat_one = IsRepeatOneSet();
|
||||
|
||||
if ( !repeat_one && framesRead >= totalFrames )
|
||||
return 0;
|
||||
|
||||
if ( !framesRead )
|
||||
{
|
||||
if ( ![self decoderInitialize] )
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( synPlayer && !synPlayer->playFlg )
|
||||
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;
|
||||
|
||||
jaytrax_renderChunk(synPlayer, sampleBuf, framesToRender, 44100);
|
||||
|
||||
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 ( !synPlayer->playFlg )
|
||||
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 );
|
||||
jaytrax_renderChunk(synPlayer, NULL, frames_todo, 44100);
|
||||
framesRead += frames_todo;
|
||||
}
|
||||
|
||||
framesRead = frame;
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
- (void)close
|
||||
{
|
||||
[self decoderShutdown];
|
||||
|
||||
if (synPlayer)
|
||||
{
|
||||
jaytrax_free(synPlayer);
|
||||
synPlayer = NULL;
|
||||
}
|
||||
|
||||
if (synSong)
|
||||
{
|
||||
jxsfile_freeSong(synSong);
|
||||
synSong = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self close];
|
||||
}
|
||||
|
||||
+ (NSArray *)fileTypes
|
||||
{
|
||||
return [NSArray arrayWithObjects:@"jxs", nil];
|
||||
}
|
||||
|
||||
+ (NSArray *)mimeTypes
|
||||
{
|
||||
return [NSArray arrayWithObjects:@"audio/x-jxs", nil];
|
||||
}
|
||||
|
||||
+ (float)priority
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,17 +0,0 @@
|
|||
//
|
||||
// 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
|
|
@ -1,99 +0,0 @@
|
|||
//
|
||||
// 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/jxs.h>
|
||||
#import <Syntrax_c/jaytrax.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];
|
||||
|
||||
JT1Song* synSong;
|
||||
if (jxsfile_readSongMem(data, size, &synSong))
|
||||
{
|
||||
ALog(@"Open failed for file: %@", [url absoluteString]);
|
||||
free(data);
|
||||
return nil;
|
||||
}
|
||||
|
||||
free(data);
|
||||
|
||||
JT1Player * synPlayer = jaytrax_init();
|
||||
if (!synPlayer)
|
||||
{
|
||||
ALog(@"Failed to create player for file: %@", [url absoluteString]);
|
||||
jxsfile_freeSong(synSong);
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (!jaytrax_loadSong(synPlayer, synSong))
|
||||
{
|
||||
ALog(@"Load failed for file: %@", [url absoluteString]);
|
||||
jaytrax_free(synPlayer);
|
||||
jxsfile_freeSong(synSong);
|
||||
return nil;
|
||||
}
|
||||
|
||||
int track_num;
|
||||
if ([[url fragment] length] == 0)
|
||||
track_num = 0;
|
||||
else
|
||||
track_num = [[url fragment] intValue];
|
||||
|
||||
jaytrax_changeSubsong(synPlayer, track_num);
|
||||
|
||||
//Some titles are all spaces?!
|
||||
NSString *title = [[NSString stringWithUTF8String: synPlayer->subsong->name] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
|
||||
|
||||
jaytrax_free(synPlayer);
|
||||
jxsfile_freeSong(synSong);
|
||||
|
||||
if (title == nil) {
|
||||
title = @"";
|
||||
}
|
||||
|
||||
return [NSDictionary dictionaryWithObject:title forKey:@"title"];
|
||||
}
|
||||
|
||||
@end
|
Loading…
Reference in New Issue