This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OSStatus TSAudioEngine::render(AudioUnitRenderActionFlags *ioActionFlags, | |
const AudioTimeStamp *inTimeStamp, | |
UInt32 inBusNumber, | |
UInt32 inNumberFrames, | |
AudioBufferList *ioData) { | |
OSStatus err = noErr; | |
for (int ii = 0; ii < ioData->mNumberBuffers; ++ii) { | |
vDSP_vclr(static_cast<float *>(ioData->mBuffers[ii].mData), 1, inNumberFrames); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Removes trailing whitespace from all source files in the current directory and its children. | |
# Note the `-i .bak` switch to sed. This will create a backup copy alongside any modified files | |
# like `Somefile.cpp.bak` Simply remove the `.bak` argument to `-i` to prevent the backup | |
# files from being generated | |
# | |
/usr/bin/find . -type f -and \( -name '*.m' -or -name '*.h' -or -name '*.mm' -or -name '*.cpp' -or -name '*.c' \) -and -print0 | xargs -0 sed -i .bak -E "s/[[:space:]]+$//" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AudioStreamBasicDescription outputStreamDesc; | |
outputStreamDesc.mSampleRate = 44100.; | |
outputStreamDesc.mBitsPerChannel = 32; | |
outputStreamDesc.mBytesPerFrame = 4; | |
outputStreamDesc.mBytesPerPacket = 4; | |
outputStreamDesc.mChannelsPerFrame = 2; | |
outputStreamDesc.mFormatFlags = kAudioFormatFlagIsFloat | kAudioFormatFlagIsNonInterleaved; | |
outputStreamDesc.mFormatID = kAudioFormatLinearPCM; | |
outputStreamDesc.mFramesPerPacket = 1; | |
outputStreamDesc.mReserved = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ESTrack *esTrack = [[ESTrack alloc] initWithFileName:fileName serviceName:serviceName]; | |
// artwork | |
iTunesArtwork *artwork = [track.artworks objectAtIndex:0]; | |
if (artwork) { | |
NSURL *artworkPath; | |
artworkPath = [self artworkPath:persistantID]; | |
[self cacheArtwork:artwork toPath:artworkPath]; | |
// end block; | |
esTrack.artworkName = [artworkPath lastPathComponent]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)getIPAddress | |
{ | |
NSString *address = @"error"; | |
struct ifaddrs *interfaces = NULL; | |
struct ifaddrs *temp_addr = NULL; | |
int success = 0; | |
// retrieve the current interfaces - returns 0 on success | |
success = getifaddrs(&interfaces); | |
if (success == 0) |
NewerOlder