Removed debugging messages.
parent
5c8819db6c
commit
daba91b462
|
@ -252,7 +252,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
||||||
{
|
{
|
||||||
[playbackController stop:self];
|
[playbackController stop:self];
|
||||||
|
|
||||||
// DBLog(@"QUITTING");
|
|
||||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||||
NSString *folder = @"~/Library/Application Support/Cog/";
|
NSString *folder = @"~/Library/Application Support/Cog/";
|
||||||
|
|
||||||
|
@ -279,7 +278,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
||||||
|
|
||||||
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
||||||
{
|
{
|
||||||
DBLog(@"Adding path: %@", filename);
|
|
||||||
[playlistLoader addURLs:[NSArray arrayWithObject:[NSURL fileURLWithPath:filename]] sort:NO];
|
[playlistLoader addURLs:[NSArray arrayWithObject:[NSURL fileURLWithPath:filename]] sort:NO];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -333,7 +331,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
||||||
[infoButton setState:NSOffState];
|
[infoButton setState:NSOffState];
|
||||||
}
|
}
|
||||||
else if ([notification object] == fileDrawer) {
|
else if ([notification object] == fileDrawer) {
|
||||||
NSLog(@"CLOSED");
|
|
||||||
[fileButton setState:NSOffState];
|
[fileButton setState:NSOffState];
|
||||||
|
|
||||||
[mainWindow makeFirstResponder: playlistView];
|
[mainWindow makeFirstResponder: playlistView];
|
||||||
|
@ -407,7 +404,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
||||||
}
|
}
|
||||||
else if ([keyPath isEqualToString:@"values.remoteEnabled"] || [keyPath isEqualToString:@"values.remoteOnlyOnActive"]) {
|
else if ([keyPath isEqualToString:@"values.remoteEnabled"] || [keyPath isEqualToString:@"values.remoteOnlyOnActive"]) {
|
||||||
if([[NSUserDefaults standardUserDefaults] boolForKey:@"remoteEnabled"]) {
|
if([[NSUserDefaults standardUserDefaults] boolForKey:@"remoteEnabled"]) {
|
||||||
NSLog(@"Remote enabled...");
|
|
||||||
BOOL onlyOnActive = [[NSUserDefaults standardUserDefaults] boolForKey:@"remoteOnlyOnActive"];
|
BOOL onlyOnActive = [[NSUserDefaults standardUserDefaults] boolForKey:@"remoteOnlyOnActive"];
|
||||||
if (!onlyOnActive || [NSApp isActive]) {
|
if (!onlyOnActive || [NSApp isActive]) {
|
||||||
[remote startListening: self];
|
[remote startListening: self];
|
||||||
|
@ -417,7 +413,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NSLog(@"DISABLE REMOTE");
|
|
||||||
[remote stopListening: self];
|
[remote stopListening: self];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -425,8 +420,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
||||||
|
|
||||||
- (void)registerHotKeys
|
- (void)registerHotKeys
|
||||||
{
|
{
|
||||||
NSLog(@"REGISTERING HOTKEYS");
|
|
||||||
|
|
||||||
[playHotKey release];
|
[playHotKey release];
|
||||||
playHotKey = [[NDHotKeyEvent alloc]
|
playHotKey = [[NDHotKeyEvent alloc]
|
||||||
initWithKeyCode: [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPlayKeyCode"] intValue]
|
initWithKeyCode: [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPlayKeyCode"] intValue]
|
||||||
|
@ -464,13 +457,11 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
||||||
|
|
||||||
- (void)clickPrev
|
- (void)clickPrev
|
||||||
{
|
{
|
||||||
NSLog(@"PREV");
|
|
||||||
[prevButton performClick:nil];
|
[prevButton performClick:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)clickNext
|
- (void)clickNext
|
||||||
{
|
{
|
||||||
NSLog(@"NEXT");
|
|
||||||
[nextButton performClick:nil];
|
[nextButton performClick:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#import "PlaybackController.h"
|
#import "PlaybackController.h"
|
||||||
#import "PlaylistView.h"
|
#import "PlaylistView.h"
|
||||||
|
|
||||||
#import "DBLog.h"
|
|
||||||
#import "CogAudio/Status.h"
|
#import "CogAudio/Status.h"
|
||||||
|
|
||||||
#import "PlaylistController.h"
|
#import "PlaylistController.h"
|
||||||
|
@ -59,7 +58,6 @@
|
||||||
|
|
||||||
- (IBAction)playPauseResume:(id)sender
|
- (IBAction)playPauseResume:(id)sender
|
||||||
{
|
{
|
||||||
DBLog(@"PLAYING");
|
|
||||||
if (playbackStatus == kCogStatusStopped)
|
if (playbackStatus == kCogStatusStopped)
|
||||||
[self play:self];
|
[self play:self];
|
||||||
else
|
else
|
||||||
|
@ -68,7 +66,6 @@
|
||||||
|
|
||||||
- (IBAction)pauseResume:(id)sender
|
- (IBAction)pauseResume:(id)sender
|
||||||
{
|
{
|
||||||
// DBLog(@"Pause/Resume Sent!");
|
|
||||||
if (playbackStatus == kCogStatusPaused)
|
if (playbackStatus == kCogStatusPaused)
|
||||||
[self resume:self];
|
[self resume:self];
|
||||||
else
|
else
|
||||||
|
@ -77,7 +74,6 @@
|
||||||
|
|
||||||
- (IBAction)pause:(id)sender
|
- (IBAction)pause:(id)sender
|
||||||
{
|
{
|
||||||
// DBLog(@"Pause Sent!");
|
|
||||||
[audioPlayer pause];
|
[audioPlayer pause];
|
||||||
|
|
||||||
if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) {
|
if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) {
|
||||||
|
@ -87,7 +83,6 @@
|
||||||
|
|
||||||
- (IBAction)resume:(id)sender
|
- (IBAction)resume:(id)sender
|
||||||
{
|
{
|
||||||
// DBLog(@"Resume Sent!");
|
|
||||||
[audioPlayer resume];
|
[audioPlayer resume];
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,8 +93,6 @@
|
||||||
|
|
||||||
- (IBAction)stop:(id)sender
|
- (IBAction)stop:(id)sender
|
||||||
{
|
{
|
||||||
// DBLog(@"Stop Sent!");
|
|
||||||
|
|
||||||
[audioPlayer stop];
|
[audioPlayer stop];
|
||||||
|
|
||||||
if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) {
|
if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) {
|
||||||
|
@ -126,7 +119,6 @@
|
||||||
|
|
||||||
- (void)playEntry:(PlaylistEntry *)pe
|
- (void)playEntry:(PlaylistEntry *)pe
|
||||||
{
|
{
|
||||||
// DBLog(@"PlayEntry: %@ Sent!", [pe filename]);
|
|
||||||
if (playbackStatus != kCogStatusStopped)
|
if (playbackStatus != kCogStatusStopped)
|
||||||
[self stop:self];
|
[self stop:self];
|
||||||
|
|
||||||
|
@ -163,7 +155,6 @@
|
||||||
|
|
||||||
- (IBAction)prev:(id)sender
|
- (IBAction)prev:(id)sender
|
||||||
{
|
{
|
||||||
DBLog(@"CALLING");
|
|
||||||
if ([playlistController prev] == nil)
|
if ([playlistController prev] == nil)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -173,7 +164,6 @@
|
||||||
|
|
||||||
- (IBAction)seek:(id)sender
|
- (IBAction)seek:(id)sender
|
||||||
{
|
{
|
||||||
// DBLog(@"SEEKING?");
|
|
||||||
double time;
|
double time;
|
||||||
time = [positionSlider doubleValue];
|
time = [positionSlider doubleValue];
|
||||||
|
|
||||||
|
@ -191,11 +181,11 @@
|
||||||
[alt retain];
|
[alt retain];
|
||||||
if (img == nil)
|
if (img == nil)
|
||||||
{
|
{
|
||||||
DBLog(@"NIL IMAGE!!!");
|
NSLog(@"Error loading image!");
|
||||||
}
|
}
|
||||||
if (alt == nil)
|
if (alt == nil)
|
||||||
{
|
{
|
||||||
DBLog(@"NIL ALT");
|
NSLog(@"Error loading alt image...");
|
||||||
}
|
}
|
||||||
|
|
||||||
[playButton setImage:img];
|
[playButton setImage:img];
|
||||||
|
@ -298,7 +288,6 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DBLog(@"NEXT SONG: %@", [pe url]);
|
|
||||||
[player setNextStream:[pe url] withUserInfo:pe];
|
[player setNextStream:[pe url] withUserInfo:pe];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,7 +321,6 @@
|
||||||
|
|
||||||
if ([positionSlider tracking] == NO)
|
if ([positionSlider tracking] == NO)
|
||||||
{
|
{
|
||||||
// DBLog(@"Received pos update: %f", pos);
|
|
||||||
[positionSlider setDoubleValue:pos];
|
[positionSlider setDoubleValue:pos];
|
||||||
[self updateTimeField:pos];
|
[self updateTimeField:pos];
|
||||||
}
|
}
|
||||||
|
@ -345,7 +333,6 @@
|
||||||
int status = [s intValue];
|
int status = [s intValue];
|
||||||
if (status == kCogStatusStopped || status == kCogStatusPaused)
|
if (status == kCogStatusStopped || status == kCogStatusPaused)
|
||||||
{
|
{
|
||||||
DBLog(@"INVALIDATING");
|
|
||||||
if (positionTimer)
|
if (positionTimer)
|
||||||
{
|
{
|
||||||
[positionTimer invalidate];
|
[positionTimer invalidate];
|
||||||
|
|
|
@ -80,7 +80,6 @@
|
||||||
url = nextStream;
|
url = nextStream;
|
||||||
if (url == nil)
|
if (url == nil)
|
||||||
{
|
{
|
||||||
NSLog(@"End of playlist? Nothing left.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +95,7 @@
|
||||||
[self setShouldContinue:YES];
|
[self setShouldContinue:YES];
|
||||||
|
|
||||||
outputLaunched = NO;
|
outputLaunched = NO;
|
||||||
NSLog(@"Launching input thread!");
|
|
||||||
[bufferChain launchThreads];
|
[bufferChain launchThreads];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,12 +167,10 @@
|
||||||
{
|
{
|
||||||
[self setPlaybackStatus:kCogStatusPlaying];
|
[self setPlaybackStatus:kCogStatusPlaying];
|
||||||
if (outputLaunched == NO) {
|
if (outputLaunched == NO) {
|
||||||
NSLog(@"Launching output thread!");
|
|
||||||
[output launchThread];
|
[output launchThread];
|
||||||
outputLaunched = YES;
|
outputLaunched = YES;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NSLog(@"Resuming not launching");
|
|
||||||
[self setShouldContinue:YES];
|
[self setShouldContinue:YES];
|
||||||
[output resume];
|
[output resume];
|
||||||
}
|
}
|
||||||
|
@ -227,15 +224,12 @@
|
||||||
if ([chainQueue count] <= 0)
|
if ([chainQueue count] <= 0)
|
||||||
{
|
{
|
||||||
//End of playlist
|
//End of playlist
|
||||||
DBLog(@"STOPPED");
|
|
||||||
[self stop];
|
[self stop];
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// NSLog(@"SWAPPING BUFFERS");
|
|
||||||
[bufferChain release];
|
[bufferChain release];
|
||||||
|
|
||||||
DBLog(@"END OF INPUT PLAYED");
|
|
||||||
bufferChain = [chainQueue objectAtIndex:0];
|
bufferChain = [chainQueue objectAtIndex:0];
|
||||||
[bufferChain retain];
|
[bufferChain retain];
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@
|
||||||
|
|
||||||
- (void)launchThreads
|
- (void)launchThreads
|
||||||
{
|
{
|
||||||
DBLog(@"LAUNCHING THREAD FOR INPUT");
|
|
||||||
[inputNode launchThread];
|
[inputNode launchThread];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +96,6 @@
|
||||||
|
|
||||||
- (void)initialBufferFilled
|
- (void)initialBufferFilled
|
||||||
{
|
{
|
||||||
NSLog(@"Filled initial buffer!");
|
|
||||||
[controller launchOutputThread];
|
[controller launchOutputThread];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,6 @@ static OSStatus ACInputProc(AudioConverterRef inAudioConverter, UInt32* ioNumber
|
||||||
|
|
||||||
- (void)reset
|
- (void)reset
|
||||||
{
|
{
|
||||||
NSLog(@"RESETTING");
|
|
||||||
AudioConverterReset(converter);
|
AudioConverterReset(converter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +104,6 @@ static OSStatus ACInputProc(AudioConverterRef inAudioConverter, UInt32* ioNumber
|
||||||
|
|
||||||
- (void)setupWithInputFormat:(AudioStreamBasicDescription)inf outputFormat:(AudioStreamBasicDescription)outf
|
- (void)setupWithInputFormat:(AudioStreamBasicDescription)inf outputFormat:(AudioStreamBasicDescription)outf
|
||||||
{
|
{
|
||||||
NSLog(@"CREATING THE CONVERTER");
|
|
||||||
//Make the converter
|
//Make the converter
|
||||||
OSStatus stat = noErr;
|
OSStatus stat = noErr;
|
||||||
|
|
||||||
|
@ -135,20 +133,15 @@ static OSStatus ACInputProc(AudioConverterRef inAudioConverter, UInt32* ioNumber
|
||||||
kAudioConverterPropertyCalculateOutputBufferSize,
|
kAudioConverterPropertyCalculateOutputBufferSize,
|
||||||
&dataSize,
|
&dataSize,
|
||||||
(void*)&outputSize);
|
(void*)&outputSize);
|
||||||
NSLog(@"Output size: %i %i", outputSize, CHUNK_SIZE);
|
|
||||||
if (outputBuffer)
|
if (outputBuffer)
|
||||||
{
|
{
|
||||||
NSLog(@"FREEING");
|
|
||||||
free(outputBuffer);
|
free(outputBuffer);
|
||||||
NSLog(@"FREED");
|
|
||||||
}
|
}
|
||||||
outputBuffer = malloc(outputSize);
|
outputBuffer = malloc(outputSize);
|
||||||
|
|
||||||
|
//PrintStreamDesc(&inf);
|
||||||
NSLog(@"Converter setup!");
|
//PrintStreamDesc(&outf);
|
||||||
|
|
||||||
PrintStreamDesc(&inf);
|
|
||||||
PrintStreamDesc(&outf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
{
|
{
|
||||||
outputFormat = of;
|
outputFormat = of;
|
||||||
|
|
||||||
NSLog(@"Opening: %@", url);
|
|
||||||
decoder = [AudioDecoder audioDecoderForURL:url];
|
decoder = [AudioDecoder audioDecoderForURL:url];
|
||||||
[decoder retain];
|
[decoder retain];
|
||||||
|
|
||||||
|
@ -27,7 +26,6 @@
|
||||||
|
|
||||||
[self registerObservers];
|
[self registerObservers];
|
||||||
|
|
||||||
NSLog(@"Got decoder...%@", decoder);
|
|
||||||
if (decoder == nil)
|
if (decoder == nil)
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
|
@ -40,7 +38,6 @@
|
||||||
shouldContinue = YES;
|
shouldContinue = YES;
|
||||||
shouldSeek = NO;
|
shouldSeek = NO;
|
||||||
|
|
||||||
NSLog(@"OPENED");
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,8 +48,6 @@
|
||||||
options:(NSKeyValueObservingOptionNew)
|
options:(NSKeyValueObservingOptionNew)
|
||||||
context:NULL];
|
context:NULL];
|
||||||
|
|
||||||
NSLog(@"ADDED OBSERVER!!!");
|
|
||||||
|
|
||||||
[decoder addObserver:self
|
[decoder addObserver:self
|
||||||
forKeyPath:@"metadata"
|
forKeyPath:@"metadata"
|
||||||
options:(NSKeyValueObservingOptionNew)
|
options:(NSKeyValueObservingOptionNew)
|
||||||
|
@ -65,12 +60,9 @@
|
||||||
context:(void *)context
|
context:(void *)context
|
||||||
{
|
{
|
||||||
if ([keyPath isEqual:@"properties"]) {
|
if ([keyPath isEqual:@"properties"]) {
|
||||||
NSLog(@"Properties changed!");
|
|
||||||
//Setup converter!
|
//Setup converter!
|
||||||
[converter cleanUp];
|
[converter cleanUp];
|
||||||
NSLog(@"CLEANED UP");
|
|
||||||
[converter setupWithInputFormat:propertiesToASBD([decoder properties]) outputFormat:outputFormat];
|
[converter setupWithInputFormat:propertiesToASBD([decoder properties]) outputFormat:outputFormat];
|
||||||
NSLog(@"CREATED CONVERTED");
|
|
||||||
//Inform something of properties change
|
//Inform something of properties change
|
||||||
}
|
}
|
||||||
else if ([keyPath isEqual:@"metadata"]) {
|
else if ([keyPath isEqual:@"metadata"]) {
|
||||||
|
@ -83,13 +75,10 @@
|
||||||
int amountRead = 0, amountConverted = 0, amountInBuffer = 0;
|
int amountRead = 0, amountConverted = 0, amountInBuffer = 0;
|
||||||
void *inputBuffer = malloc(CHUNK_SIZE);
|
void *inputBuffer = malloc(CHUNK_SIZE);
|
||||||
|
|
||||||
NSLog(@"Playing file: %i", self);
|
|
||||||
|
|
||||||
while ([self shouldContinue] == YES && [self endOfStream] == NO)
|
while ([self shouldContinue] == YES && [self endOfStream] == NO)
|
||||||
{
|
{
|
||||||
if (shouldSeek == YES)
|
if (shouldSeek == YES)
|
||||||
{
|
{
|
||||||
NSLog(@"Actually seeking");
|
|
||||||
[decoder seekToTime:seekTime];
|
[decoder seekToTime:seekTime];
|
||||||
shouldSeek = NO;
|
shouldSeek = NO;
|
||||||
|
|
||||||
|
@ -114,7 +103,6 @@
|
||||||
[controller initialBufferFilled];
|
[controller initialBufferFilled];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"END OF FILE?! %i %i", amountRead, amountConverted);
|
|
||||||
endOfStream = YES;
|
endOfStream = YES;
|
||||||
[controller endOfInputReached];
|
[controller endOfInputReached];
|
||||||
break; //eof
|
break; //eof
|
||||||
|
@ -127,13 +115,10 @@
|
||||||
[converter cleanUp];
|
[converter cleanUp];
|
||||||
|
|
||||||
free(inputBuffer);
|
free(inputBuffer);
|
||||||
|
|
||||||
NSLog(@"CLOSED: %i", self);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)seek:(double)time
|
- (void)seek:(double)time
|
||||||
{
|
{
|
||||||
NSLog(@"SEEKING IN INPUTNODE");
|
|
||||||
seekTime = time;
|
seekTime = time;
|
||||||
shouldSeek = YES;
|
shouldSeek = YES;
|
||||||
[self resetBuffer];
|
[self resetBuffer];
|
||||||
|
|
|
@ -76,7 +76,6 @@
|
||||||
//Should be overwriten by subclass.
|
//Should be overwriten by subclass.
|
||||||
- (void)process
|
- (void)process
|
||||||
{
|
{
|
||||||
DBLog(@"WRONG PROCESS");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)threadEntry:(id)arg
|
- (void)threadEntry:(id)arg
|
||||||
|
@ -84,7 +83,6 @@
|
||||||
[self retain];
|
[self retain];
|
||||||
|
|
||||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||||
DBLog(@"In thread entry");
|
|
||||||
|
|
||||||
[self process];
|
[self process];
|
||||||
|
|
||||||
|
@ -105,20 +103,18 @@
|
||||||
|
|
||||||
if (availInput <= amount && [previousNode endOfStream] == YES)
|
if (availInput <= amount && [previousNode endOfStream] == YES)
|
||||||
{
|
{
|
||||||
NSLog(@"END OF NODE");
|
|
||||||
// NSLog(@"RELEASING: %i %i %i", availInput, [previousNode endOfStream], shouldContinue);
|
|
||||||
// [previousNode release];
|
// [previousNode release];
|
||||||
//If it is the outputNode, [soundController newInputChain];
|
//If it is the outputNode, [soundController newInputChain];
|
||||||
//else
|
//else
|
||||||
endOfStream = YES;
|
endOfStream = YES;
|
||||||
}
|
}
|
||||||
if (availInput <= 0) {
|
/* if (availInput <= 0) {
|
||||||
NSLog(@"BUFFER RAN DRY!");
|
NSLog(@"BUFFER RAN DRY!");
|
||||||
}
|
}
|
||||||
else if (availInput < amount) {
|
else if (availInput < amount) {
|
||||||
NSLog(@"BUFFER IN DANGER");
|
NSLog(@"BUFFER IN DANGER");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
amountToCopy = availInput;
|
amountToCopy = availInput;
|
||||||
if (amountToCopy > amount)
|
if (amountToCopy > amount)
|
||||||
{
|
{
|
||||||
|
@ -140,7 +136,6 @@
|
||||||
|
|
||||||
- (void)launchThread
|
- (void)launchThread
|
||||||
{
|
{
|
||||||
DBLog(@"THREAD LAUNCHED");
|
|
||||||
[NSThread detachNewThreadSelector:@selector(threadEntry:) toTarget:self withObject:nil];
|
[NSThread detachNewThreadSelector:@selector(threadEntry:) toTarget:self withObject:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
|
|
||||||
- (void)seek:(double)time
|
- (void)seek:(double)time
|
||||||
{
|
{
|
||||||
NSLog(@"SEEKING!");
|
|
||||||
[output pause];
|
[output pause];
|
||||||
|
|
||||||
amountPlayed = time*format.mBytesPerFrame*(format.mSampleRate/1000.0);
|
amountPlayed = time*format.mBytesPerFrame*(format.mSampleRate/1000.0);
|
||||||
|
@ -38,13 +37,11 @@
|
||||||
- (void)pause
|
- (void)pause
|
||||||
{
|
{
|
||||||
[output pause];
|
[output pause];
|
||||||
NSLog(@"PAUSED!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)resume
|
- (void)resume
|
||||||
{
|
{
|
||||||
[output resume];
|
[output resume];
|
||||||
NSLog(@"RESUMED");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (int)readData:(void *)ptr amount:(int)amount
|
- (int)readData:(void *)ptr amount:(int)amount
|
||||||
|
@ -57,15 +54,14 @@
|
||||||
n = [super readData:ptr amount:amount];
|
n = [super readData:ptr amount:amount];
|
||||||
if (endOfStream == YES)
|
if (endOfStream == YES)
|
||||||
{
|
{
|
||||||
NSLog(@"End of stream reached!");
|
|
||||||
amountPlayed = 0;
|
amountPlayed = 0;
|
||||||
[controller endOfInputPlayed]; //Updates shouldContinue appropriately?
|
[controller endOfInputPlayed]; //Updates shouldContinue appropriately?
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n == 0) {
|
/* if (n == 0) {
|
||||||
NSLog(@"Output Buffer dry!");
|
NSLog(@"Output Buffer dry!");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
amountPlayed += n;
|
amountPlayed += n;
|
||||||
|
|
||||||
[pool release];
|
[pool release];
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
|
static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
|
||||||
{
|
{
|
||||||
//NSLog(@"ASKING FOR DATA!");
|
|
||||||
OutputCoreAudio *output = (OutputCoreAudio *)inRefCon;
|
OutputCoreAudio *output = (OutputCoreAudio *)inRefCon;
|
||||||
OSStatus err = noErr;
|
OSStatus err = noErr;
|
||||||
void *readPointer = ioData->mBuffers[0].mData;
|
void *readPointer = ioData->mBuffers[0].mData;
|
||||||
|
@ -36,7 +35,6 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
|
|
||||||
if ([output->outputController shouldContinue] == NO)
|
if ([output->outputController shouldContinue] == NO)
|
||||||
{
|
{
|
||||||
//NSLog(@"STOPPING");
|
|
||||||
AudioOutputUnitStop(output->outputUnit);
|
AudioOutputUnitStop(output->outputUnit);
|
||||||
// [output stop];
|
// [output stop];
|
||||||
|
|
||||||
|
@ -48,7 +46,6 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
|
|
||||||
if ((amountRead < amountToRead) && [output->outputController endOfStream] == NO) //Try one more time! for track changes!
|
if ((amountRead < amountToRead) && [output->outputController endOfStream] == NO) //Try one more time! for track changes!
|
||||||
{
|
{
|
||||||
//NSLog(@"READING AGAIN! %i/%i", amountRead, amountToRead);
|
|
||||||
int amountRead2; //Use this since return type of readdata isnt known...may want to fix then can do a simple += to readdata
|
int amountRead2; //Use this since return type of readdata isnt known...may want to fix then can do a simple += to readdata
|
||||||
amountRead2 = [output->outputController readData:(readPointer+amountRead) amount:amountToRead-amountRead];
|
amountRead2 = [output->outputController readData:(readPointer+amountRead) amount:amountToRead-amountRead];
|
||||||
amountRead += amountRead2;
|
amountRead += amountRead2;
|
||||||
|
@ -65,12 +62,11 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||||
{
|
{
|
||||||
if ([keyPath isEqualToString:@"values.outputDevice"]) {
|
if ([keyPath isEqualToString:@"values.outputDevice"]) {
|
||||||
NSLog(@"CHANGED!");
|
|
||||||
NSDictionary *device = [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"outputDevice"];
|
NSDictionary *device = [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"outputDevice"];
|
||||||
|
|
||||||
NSNumber *deviceID = [device objectForKey:@"deviceID"];
|
NSNumber *deviceID = [device objectForKey:@"deviceID"];
|
||||||
|
|
||||||
NSLog(@"Selecting output device %d %@", [deviceID longValue], [device objectForKey:@"name"]);
|
|
||||||
[self setOutputDevice:[deviceID longValue]];
|
[self setOutputDevice:[deviceID longValue]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,7 +77,6 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
{
|
{
|
||||||
// Set the output device
|
// Set the output device
|
||||||
AudioDeviceID deviceID = outputDevice; //XXX use default if null
|
AudioDeviceID deviceID = outputDevice; //XXX use default if null
|
||||||
NSLog(@"Using output device %d", deviceID);
|
|
||||||
OSStatus err;
|
OSStatus err;
|
||||||
|
|
||||||
if (outputDevice == -1) {
|
if (outputDevice == -1) {
|
||||||
|
@ -91,12 +86,10 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
&deviceID);
|
&deviceID);
|
||||||
|
|
||||||
if (err != noErr) {
|
if (err != noErr) {
|
||||||
NSLog(@"THERES NO DEFAULT OUTPUT DEVICE! GARRRGGHHH");
|
NSLog(@"THERES NO DEFAULT OUTPUT DEVICE");
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"Default output device: %i", deviceID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,7 +101,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
sizeof(AudioDeviceID));
|
sizeof(AudioDeviceID));
|
||||||
|
|
||||||
if (err != noErr) {
|
if (err != noErr) {
|
||||||
NSLog(@"THERES NO OUTPUT DEVICE! AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!! %i", err);
|
NSLog(@"THERES NO OUTPUT DEVICE!!!!!! %i", err);
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
@ -143,8 +136,6 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
if (err != noErr)
|
if (err != noErr)
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
NSLog(@"SETUP");
|
|
||||||
|
|
||||||
UInt32 size = sizeof (AudioStreamBasicDescription);
|
UInt32 size = sizeof (AudioStreamBasicDescription);
|
||||||
Boolean outWritable;
|
Boolean outWritable;
|
||||||
//Gets the size of the Stream Format Property and if it is writable
|
//Gets the size of the Stream Format Property and if it is writable
|
||||||
|
@ -172,7 +163,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
// deviceFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
|
// deviceFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
|
||||||
deviceFormat.mBytesPerFrame = deviceFormat.mChannelsPerFrame*(deviceFormat.mBitsPerChannel/8);
|
deviceFormat.mBytesPerFrame = deviceFormat.mChannelsPerFrame*(deviceFormat.mBitsPerChannel/8);
|
||||||
deviceFormat.mBytesPerPacket = deviceFormat.mBytesPerFrame * deviceFormat.mFramesPerPacket;
|
deviceFormat.mBytesPerPacket = deviceFormat.mBytesPerFrame * deviceFormat.mFramesPerPacket;
|
||||||
// DBLog(@"stuff: %i %i %i %i", deviceFormat.mBitsPerChannel, deviceFormat.mBytesPerFrame, deviceFormat.mBytesPerPacket, deviceFormat.mFramesPerPacket);
|
|
||||||
err = AudioUnitSetProperty (outputUnit,
|
err = AudioUnitSetProperty (outputUnit,
|
||||||
kAudioUnitProperty_StreamFormat,
|
kAudioUnitProperty_StreamFormat,
|
||||||
kAudioUnitScope_Output,
|
kAudioUnitScope_Output,
|
||||||
|
@ -196,12 +187,9 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
|
|
||||||
[outputController setFormat:&deviceFormat];
|
[outputController setFormat:&deviceFormat];
|
||||||
|
|
||||||
DBLog(@"Audio output successfully initialized");
|
|
||||||
|
|
||||||
NSDictionary *device = [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"outputDevice"];
|
NSDictionary *device = [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"outputDevice"];
|
||||||
|
|
||||||
if (device) {
|
if (device) {
|
||||||
NSLog(@"THIS ONE");
|
|
||||||
BOOL ok = [self setOutputDevice:[[device objectForKey:@"deviceID"] longValue]];
|
BOOL ok = [self setOutputDevice:[[device objectForKey:@"deviceID"] longValue]];
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
//Ruh roh.
|
//Ruh roh.
|
||||||
|
@ -211,12 +199,9 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NSLog(@"THAT ONE");
|
|
||||||
|
|
||||||
[self setOutputDevice: -1];
|
[self setOutputDevice: -1];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"DONE SETTING UP");
|
|
||||||
return (err == noErr);
|
return (err == noErr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,13 +217,11 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
|
|
||||||
- (void)start
|
- (void)start
|
||||||
{
|
{
|
||||||
DBLog(@"START OUTPUT\n");
|
|
||||||
AudioOutputUnitStart(outputUnit);
|
AudioOutputUnitStart(outputUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)stop
|
- (void)stop
|
||||||
{
|
{
|
||||||
DBLog(@"STOP!");
|
|
||||||
if (outputUnit)
|
if (outputUnit)
|
||||||
{
|
{
|
||||||
AudioOutputUnitStop(outputUnit);
|
AudioOutputUnitStop(outputUnit);
|
||||||
|
@ -257,15 +240,12 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
|
|
||||||
- (void)pause
|
- (void)pause
|
||||||
{
|
{
|
||||||
NSLog(@"PAUSE");
|
|
||||||
AudioOutputUnitStop(outputUnit);
|
AudioOutputUnitStop(outputUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)resume
|
- (void)resume
|
||||||
{
|
{
|
||||||
NSLog(@"RESUME");
|
|
||||||
OSStatus err = AudioOutputUnitStart(outputUnit);
|
OSStatus err = AudioOutputUnitStart(outputUnit);
|
||||||
NSLog(@"Resume: %i", err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -85,7 +85,6 @@ static PluginController *sharedPluginController = nil;
|
||||||
|
|
||||||
NSString *pname;
|
NSString *pname;
|
||||||
|
|
||||||
NSLog(@"Loading plugins at %@, candidates: %@", path, dirContents);
|
|
||||||
while (pname = [dirEnum nextObject])
|
while (pname = [dirEnum nextObject])
|
||||||
{
|
{
|
||||||
NSString *ppath;
|
NSString *ppath;
|
||||||
|
@ -96,12 +95,10 @@ static PluginController *sharedPluginController = nil;
|
||||||
NSBundle *b = [NSBundle bundleWithPath:ppath];
|
NSBundle *b = [NSBundle bundleWithPath:ppath];
|
||||||
if (b)
|
if (b)
|
||||||
{
|
{
|
||||||
NSLog(@"Loaded bundle: %@", b);
|
|
||||||
Class plugin = [b principalClass];
|
Class plugin = [b principalClass];
|
||||||
NSLog(@"Candidate: %@", plugin);
|
|
||||||
if ([plugin respondsToSelector:@selector(pluginInfo)])
|
if ([plugin respondsToSelector:@selector(pluginInfo)])
|
||||||
{
|
{
|
||||||
NSLog(@"Responds to selector...");
|
|
||||||
//PluginInfo is a dictionary that contains keys/values like pluginClass,classType...ex: VorbisDecoder, Decoder
|
//PluginInfo is a dictionary that contains keys/values like pluginClass,classType...ex: VorbisDecoder, Decoder
|
||||||
NSDictionary *pluginInfo = [plugin pluginInfo];
|
NSDictionary *pluginInfo = [plugin pluginInfo];
|
||||||
NSEnumerator *e = [pluginInfo keyEnumerator];
|
NSEnumerator *e = [pluginInfo keyEnumerator];
|
||||||
|
@ -109,19 +106,15 @@ static PluginController *sharedPluginController = nil;
|
||||||
while (className = [e nextObject]) {
|
while (className = [e nextObject]) {
|
||||||
id pluginType = [pluginInfo objectForKey:className];
|
id pluginType = [pluginInfo objectForKey:className];
|
||||||
if ([pluginType isEqualToString:kCogDecoder]) {
|
if ([pluginType isEqualToString:kCogDecoder]) {
|
||||||
NSLog(@"DECODER");
|
|
||||||
[self setupDecoder:className];
|
[self setupDecoder:className];
|
||||||
}
|
}
|
||||||
else if ([pluginType isEqualToString:kCogMetadataReader]) {
|
else if ([pluginType isEqualToString:kCogMetadataReader]) {
|
||||||
NSLog(@"Metadata");
|
|
||||||
[self setupMetadataReader:className];
|
[self setupMetadataReader:className];
|
||||||
}
|
}
|
||||||
else if ([pluginType isEqualToString:kCogPropertiesReader]) {
|
else if ([pluginType isEqualToString:kCogPropertiesReader]) {
|
||||||
NSLog(@"Properties");
|
|
||||||
[self setupPropertiesReader:className];
|
[self setupPropertiesReader:className];
|
||||||
}
|
}
|
||||||
else if ([pluginType isEqualToString:kCogSource]) {
|
else if ([pluginType isEqualToString:kCogSource]) {
|
||||||
NSLog(@"Source");
|
|
||||||
[self setupSource:className];
|
[self setupSource:className];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -194,10 +187,10 @@ static PluginController *sharedPluginController = nil;
|
||||||
|
|
||||||
- (void)printPluginInfo
|
- (void)printPluginInfo
|
||||||
{
|
{
|
||||||
NSLog(@"Sources: %@", sources);
|
/* NSLog(@"Sources: %@", sources);
|
||||||
NSLog(@"Decoders: %@", decoders);
|
NSLog(@"Decoders: %@", decoders);
|
||||||
NSLog(@"Metadata Readers: %@", metadataReaders);
|
NSLog(@"Metadata Readers: %@", metadataReaders);
|
||||||
NSLog(@"Properties Readers: %@", propertiesReaders);
|
NSLog(@"Properties Readers: %@", propertiesReaders); */
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSDictionary *)sources
|
- (NSDictionary *)sources
|
||||||
|
|
|
@ -236,7 +236,7 @@ void *allocateVirtualBuffer(UInt32 bufferLength)
|
||||||
}
|
}
|
||||||
if (realAddress != originalAddress) {
|
if (realAddress != originalAddress) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
DBLog(@"allocateVirtualBuffer: vm_allocate 2nd time didn't return same address (%p vs %p)", originalAddress, realAddress);
|
NSLog(@"allocateVirtualBuffer: vm_allocate 2nd time didn't return same address (%p vs %p)", originalAddress, realAddress);
|
||||||
#endif
|
#endif
|
||||||
goto errorReturn;
|
goto errorReturn;
|
||||||
}
|
}
|
||||||
|
@ -252,13 +252,13 @@ void *allocateVirtualBuffer(UInt32 bufferLength)
|
||||||
}
|
}
|
||||||
if (!memoryEntry) {
|
if (!memoryEntry) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
DBLog(@"mach_make_memory_entry: returned memoryEntry of NULL");
|
NSLog(@"mach_make_memory_entry: returned memoryEntry of NULL");
|
||||||
#endif
|
#endif
|
||||||
goto errorReturn;
|
goto errorReturn;
|
||||||
}
|
}
|
||||||
if (memoryEntryLength != bufferLength) {
|
if (memoryEntryLength != bufferLength) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
DBLog(@"mach_make_memory_entry: size changed (from %0x to %0x)", bufferLength, memoryEntryLength);
|
NSLog(@"mach_make_memory_entry: size changed (from %0x to %0x)", bufferLength, memoryEntryLength);
|
||||||
#endif
|
#endif
|
||||||
goto errorReturn;
|
goto errorReturn;
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ void *allocateVirtualBuffer(UInt32 bufferLength)
|
||||||
}
|
}
|
||||||
if (virtualAddress != realAddress + bufferLength) {
|
if (virtualAddress != realAddress + bufferLength) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
DBLog(@"vm_map: didn't return correct address (%p vs %p)", realAddress + bufferLength, virtualAddress);
|
NSLog(@"vm_map: didn't return correct address (%p vs %p)", realAddress + bufferLength, virtualAddress);
|
||||||
#endif
|
#endif
|
||||||
goto errorReturn;
|
goto errorReturn;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
- (void)FeedbackErrorOccurred:(NSNotification *)aNotification
|
- (void)FeedbackErrorOccurred:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
DBLog(@"Error sending feedback");
|
NSLog(@"Error sending feedback");
|
||||||
|
|
||||||
[sendingIndicator stopAnimation:self];
|
[sendingIndicator stopAnimation:self];
|
||||||
|
|
||||||
|
@ -44,8 +44,6 @@
|
||||||
|
|
||||||
- (void)FeedbackSent:(NSNotification *)aNotification
|
- (void)FeedbackSent:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
// DBLog(@"Feedback Sent");
|
|
||||||
|
|
||||||
[sendingIndicator stopAnimation:self];
|
[sendingIndicator stopAnimation:self];
|
||||||
|
|
||||||
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
|
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
|
||||||
|
@ -58,8 +56,6 @@
|
||||||
|
|
||||||
- (IBAction)sendFeedback:(id)sender
|
- (IBAction)sendFeedback:(id)sender
|
||||||
{
|
{
|
||||||
// DBLog(@"Sending feedback...");
|
|
||||||
|
|
||||||
[sendingIndicator startAnimation:self];
|
[sendingIndicator startAnimation:self];
|
||||||
|
|
||||||
//Using this so that if its a bad connection, it doesnt sit there looking stupid..or should it
|
//Using this so that if its a bad connection, it doesnt sit there looking stupid..or should it
|
||||||
|
|
|
@ -43,7 +43,7 @@ NSString *encodeForURL(NSString *s)
|
||||||
NSURLResponse* response;
|
NSURLResponse* response;
|
||||||
NSData* resultData = [NSURLConnection sendSynchronousRequest:post returningResponse:&response error:&error];
|
NSData* resultData = [NSURLConnection sendSynchronousRequest:post returningResponse:&response error:&error];
|
||||||
NSString *resultString = [[[NSString alloc] initWithData:resultData encoding:NSASCIIStringEncoding] autorelease];
|
NSString *resultString = [[[NSString alloc] initWithData:resultData encoding:NSASCIIStringEncoding] autorelease];
|
||||||
DBLog(@"RESULT: %@", resultString);
|
//NSLog(@"RESULT: %@", resultString);
|
||||||
if ([resultString caseInsensitiveCompare:@"SUCCESS"] == NSOrderedSame)
|
if ([resultString caseInsensitiveCompare:@"SUCCESS"] == NSOrderedSame)
|
||||||
{
|
{
|
||||||
[self performSelectorOnMainThread:@selector(returnSuccess:) withObject:nil waitUntilDone:NO];
|
[self performSelectorOnMainThread:@selector(returnSuccess:) withObject:nil waitUntilDone:NO];
|
||||||
|
@ -58,7 +58,6 @@ NSString *encodeForURL(NSString *s)
|
||||||
|
|
||||||
- (void)sendFeedback: (NSString *)f subject:(NSString *)s message:(NSString *)m version:(NSString *)v
|
- (void)sendFeedback: (NSString *)f subject:(NSString *)s message:(NSString *)m version:(NSString *)v
|
||||||
{
|
{
|
||||||
// DBLog(@"Detaching thread for feedback");
|
|
||||||
if ([f isEqualToString:@""])
|
if ([f isEqualToString:@""])
|
||||||
{
|
{
|
||||||
f = @"Anonymous";
|
f = @"Anonymous";
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[[controller watcher] removePath:[self path]];
|
[[controller watcher] removePath:[self path]];
|
||||||
|
|
||||||
NSLog(@"DEALLOC: %@", self);
|
|
||||||
if (subpaths)
|
if (subpaths)
|
||||||
[subpaths release];
|
[subpaths release];
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
[watcher setDelegate:self];
|
[watcher setDelegate:self];
|
||||||
|
|
||||||
[self setRootPath: [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileDrawerRootPath"] ];
|
[self setRootPath: [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileDrawerRootPath"] ];
|
||||||
NSLog(@"AWAKENED");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
|
@ -29,8 +28,6 @@
|
||||||
[rootPath release];
|
[rootPath release];
|
||||||
[watcher release];
|
[watcher release];
|
||||||
|
|
||||||
NSLog(@"DEALLOCATING CONTROLLER");
|
|
||||||
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +200,6 @@
|
||||||
[url release];
|
[url release];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"Adding URLs: %@", urls);
|
|
||||||
[playlistLoader addURLs:urls sort:YES];
|
[playlistLoader addURLs:urls sort:YES];
|
||||||
[urls release];
|
[urls release];
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,13 +39,11 @@
|
||||||
//need to merge this and directorynode
|
//need to merge this and directorynode
|
||||||
- (void)processContents: (NSArray *)contents
|
- (void)processContents: (NSArray *)contents
|
||||||
{
|
{
|
||||||
NSLog(@"PROCESSING: %@", contents);
|
|
||||||
NSEnumerator *e = [contents objectEnumerator];
|
NSEnumerator *e = [contents objectEnumerator];
|
||||||
NSString *s;
|
NSString *s;
|
||||||
|
|
||||||
while (s = [e nextObject])
|
while (s = [e nextObject])
|
||||||
{
|
{
|
||||||
NSLog(@"STRING: %@", s);
|
|
||||||
/* if ([s characterAtIndex:0] == '.')
|
/* if ([s characterAtIndex:0] == '.')
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
@ -64,10 +62,9 @@
|
||||||
|
|
||||||
[[NSFileManager defaultManager] fileExistsAtPath:s isDirectory:&isDir];
|
[[NSFileManager defaultManager] fileExistsAtPath:s isDirectory:&isDir];
|
||||||
|
|
||||||
NSLog(@"IS IT ACCEPTABLE?");
|
|
||||||
if (!isDir && ![[controller acceptableFileTypes] containsObject:[s pathExtension]])
|
if (!isDir && ![[controller acceptableFileTypes] containsObject:[s pathExtension]])
|
||||||
continue;
|
continue;
|
||||||
NSLog(@"IS IT A FILE?");
|
|
||||||
if (isDir)
|
if (isDir)
|
||||||
newNode = [[DirectoryNode alloc] initWithPath: s controller:controller];
|
newNode = [[DirectoryNode alloc] initWithPath: s controller:controller];
|
||||||
else
|
else
|
||||||
|
@ -75,7 +72,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
[subpaths addObject:newNode];
|
[subpaths addObject:newNode];
|
||||||
NSLog(@"SUBPATHS IN PROCESS: %@", subpaths);
|
|
||||||
[newNode release];
|
[newNode release];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,7 +87,6 @@
|
||||||
NSString *rawQuery = [doc objectForKey:@"RawQuery"];
|
NSString *rawQuery = [doc objectForKey:@"RawQuery"];
|
||||||
NSArray *searchPaths = [[doc objectForKey:@"SearchCriteria"] objectForKey:@"CurrentFolderPath"];
|
NSArray *searchPaths = [[doc objectForKey:@"SearchCriteria"] objectForKey:@"CurrentFolderPath"];
|
||||||
|
|
||||||
NSLog(@"Query: %@", rawQuery);
|
|
||||||
// Ugh, Carbon from now on...
|
// Ugh, Carbon from now on...
|
||||||
MDQueryRef query = MDQueryCreate(kCFAllocatorDefault, (CFStringRef)rawQuery, NULL, NULL);
|
MDQueryRef query = MDQueryCreate(kCFAllocatorDefault, (CFStringRef)rawQuery, NULL, NULL);
|
||||||
|
|
||||||
|
@ -99,9 +95,7 @@
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(queryFinished:) name:(NSString*)kMDQueryDidFinishNotification object:(id)query];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(queryFinished:) name:(NSString*)kMDQueryDidFinishNotification object:(id)query];
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(queryUpdate:) name:(NSString*)kMDQueryDidUpdateNotification object:(id)query];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(queryUpdate:) name:(NSString*)kMDQueryDidUpdateNotification object:(id)query];
|
||||||
|
|
||||||
NSLog(@"PATHS: %@", searchPaths);
|
|
||||||
MDQueryExecute(query, kMDQueryWantsUpdates);
|
MDQueryExecute(query, kMDQueryWantsUpdates);
|
||||||
NSLog(@"QUERY FINISHED: %@", subpaths);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return subpaths;
|
return subpaths;
|
||||||
|
@ -139,7 +133,6 @@
|
||||||
MDItemRef item = (MDItemRef)MDQueryGetResultAtIndex(query, i);
|
MDItemRef item = (MDItemRef)MDQueryGetResultAtIndex(query, i);
|
||||||
|
|
||||||
NSString *itemPath = (NSString*)MDItemCopyAttribute(item, kMDItemPath);
|
NSString *itemPath = (NSString*)MDItemCopyAttribute(item, kMDItemPath);
|
||||||
NSLog(@"RESULT PATH: %@", itemPath);
|
|
||||||
|
|
||||||
[results addObject:itemPath];
|
[results addObject:itemPath];
|
||||||
|
|
||||||
|
@ -154,8 +147,6 @@
|
||||||
|
|
||||||
- (void)queryUpdate:(NSNotification *)notification
|
- (void)queryUpdate:(NSNotification *)notification
|
||||||
{
|
{
|
||||||
NSLog(@"QUERY UPDATE: %@", notification);
|
|
||||||
|
|
||||||
[subpaths removeAllObjects];
|
[subpaths removeAllObjects];
|
||||||
[self queryFinished: notification];
|
[self queryFinished: notification];
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,6 @@
|
||||||
|
|
||||||
- (void)removeObjectsAtArrangedObjectIndexes:(NSIndexSet *)indexes
|
- (void)removeObjectsAtArrangedObjectIndexes:(NSIndexSet *)indexes
|
||||||
{
|
{
|
||||||
NSLog(@"REMOVING");
|
|
||||||
NSArray *a = [[self arrangedObjects] objectsAtIndexes:indexes]; //Screw 10.3
|
NSArray *a = [[self arrangedObjects] objectsAtIndexes:indexes]; //Screw 10.3
|
||||||
|
|
||||||
if ([a containsObject:currentEntry])
|
if ([a containsObject:currentEntry])
|
||||||
|
@ -265,7 +264,6 @@
|
||||||
{
|
{
|
||||||
if (repeat == YES)
|
if (repeat == YES)
|
||||||
{
|
{
|
||||||
NSLog(@"Adding shuffled list to back!");
|
|
||||||
[self addShuffledListToBack];
|
[self addShuffledListToBack];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
{
|
{
|
||||||
[i retain];
|
[i retain];
|
||||||
[idx release];
|
[idx release];
|
||||||
NSLog(@"INDEX: %@", i);
|
|
||||||
idx = i;
|
idx = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,6 @@
|
||||||
|
|
||||||
- (NSString *)title
|
- (NSString *)title
|
||||||
{
|
{
|
||||||
// DBLog(@"HERE FUCK: %@", title);
|
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,8 +111,6 @@
|
||||||
|
|
||||||
- (NSArray *)urlsFromM3u:(NSString *)filename
|
- (NSArray *)urlsFromM3u:(NSString *)filename
|
||||||
{
|
{
|
||||||
NSLog(@"Loading playlist: %@", filename);
|
|
||||||
|
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
NSString *contents = [NSString stringWithContentsOfFile:filename encoding:NSUTF8StringEncoding error:&error];
|
NSString *contents = [NSString stringWithContentsOfFile:filename encoding:NSUTF8StringEncoding error:&error];
|
||||||
if (error || !contents) {
|
if (error || !contents) {
|
||||||
|
@ -140,13 +138,11 @@
|
||||||
{
|
{
|
||||||
NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:filename createFile:YES];
|
NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:filename createFile:YES];
|
||||||
if (!fileHandle) {
|
if (!fileHandle) {
|
||||||
NSLog(@"Error!");
|
NSLog(@"Error saving m3u!");
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
[fileHandle truncateFileAtOffset:0];
|
[fileHandle truncateFileAtOffset:0];
|
||||||
|
|
||||||
NSLog(@"Saving: %@", filename);
|
|
||||||
|
|
||||||
PlaylistEntry *pe;
|
PlaylistEntry *pe;
|
||||||
NSEnumerator *e = [[playlistController content] objectEnumerator];
|
NSEnumerator *e = [[playlistController content] objectEnumerator];
|
||||||
|
|
||||||
|
@ -263,7 +259,6 @@
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
index = 0;
|
index = 0;
|
||||||
|
|
||||||
NSLog(@"URLS: %@", urls);
|
|
||||||
NSEnumerator *urlEnumerator = [urls objectEnumerator];
|
NSEnumerator *urlEnumerator = [urls objectEnumerator];
|
||||||
NSURL *url;
|
NSURL *url;
|
||||||
while (url = [urlEnumerator nextObject])
|
while (url = [urlEnumerator nextObject])
|
||||||
|
@ -290,8 +285,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"Expanded URLs: %@", expandedURLs);
|
|
||||||
|
|
||||||
NSArray *sortedURLs;
|
NSArray *sortedURLs;
|
||||||
if (sort == YES)
|
if (sort == YES)
|
||||||
{
|
{
|
||||||
|
@ -306,8 +299,6 @@
|
||||||
sortedURLs = [expandedURLs copy];
|
sortedURLs = [expandedURLs copy];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"Sorted URLs: %@", expandedURLs);
|
|
||||||
|
|
||||||
urlEnumerator = [sortedURLs objectEnumerator];
|
urlEnumerator = [sortedURLs objectEnumerator];
|
||||||
while (url = [urlEnumerator nextObject])
|
while (url = [urlEnumerator nextObject])
|
||||||
{
|
{
|
||||||
|
@ -321,8 +312,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"All URLs: %@", allURLs);
|
|
||||||
|
|
||||||
urlEnumerator = [allURLs objectEnumerator];
|
urlEnumerator = [allURLs objectEnumerator];
|
||||||
while (url = [urlEnumerator nextObject])
|
while (url = [urlEnumerator nextObject])
|
||||||
{
|
{
|
||||||
|
@ -341,9 +330,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"Valid URLs: %@", validURLs);
|
|
||||||
|
|
||||||
|
|
||||||
//Create actual entries
|
//Create actual entries
|
||||||
int i;
|
int i;
|
||||||
NSMutableArray *entries = [NSMutableArray array];
|
NSMutableArray *entries = [NSMutableArray array];
|
||||||
|
|
|
@ -151,7 +151,7 @@
|
||||||
[self selectRow:row byExtendingSelection:NO];
|
[self selectRow:row byExtendingSelection:NO];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NSLog(@"Number of selected rows: %i", [self numberOfSelectedRows]);
|
|
||||||
if ([self numberOfSelectedRows] <=0)
|
if ([self numberOfSelectedRows] <=0)
|
||||||
{
|
{
|
||||||
//No rows are selected, so the table should be displayed with all items disabled
|
//No rows are selected, so the table should be displayed with all items disabled
|
||||||
|
@ -159,9 +159,8 @@
|
||||||
int i;
|
int i;
|
||||||
for (i=0;i<[tableViewMenu numberOfItems];i++) {
|
for (i=0;i<[tableViewMenu numberOfItems];i++) {
|
||||||
[[tableViewMenu itemAtIndex:i] setEnabled:NO];
|
[[tableViewMenu itemAtIndex:i] setEnabled:NO];
|
||||||
NSLog(@"Enabled: %@ %i", [[tableViewMenu itemAtIndex:i] title], [[tableViewMenu itemAtIndex:i] isEnabled]);
|
|
||||||
}
|
}
|
||||||
NSLog(@"All disabled!");
|
|
||||||
return [tableViewMenu autorelease];
|
return [tableViewMenu autorelease];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -176,7 +175,7 @@
|
||||||
unsigned int modifiers = [e modifierFlags] & (NSCommandKeyMask | NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask);
|
unsigned int modifiers = [e modifierFlags] & (NSCommandKeyMask | NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask);
|
||||||
NSString *characters = [e characters];
|
NSString *characters = [e characters];
|
||||||
unichar c;
|
unichar c;
|
||||||
NSLog(@"DOWN!");
|
|
||||||
if ([characters length] != 1) {
|
if ([characters length] != 1) {
|
||||||
[super keyDown:e];
|
[super keyDown:e];
|
||||||
|
|
||||||
|
@ -184,7 +183,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
c = [characters characterAtIndex:0];
|
c = [characters characterAtIndex:0];
|
||||||
NSLog(@"Modifiers: %i", modifiers);
|
|
||||||
if (modifiers == 0 && (c == NSDeleteCharacter || c == NSBackspaceCharacter || c == NSDeleteFunctionKey))
|
if (modifiers == 0 && (c == NSDeleteCharacter || c == NSBackspaceCharacter || c == NSDeleteFunctionKey))
|
||||||
{
|
{
|
||||||
[playlistController remove:self];
|
[playlistController remove:self];
|
||||||
|
@ -198,7 +196,6 @@
|
||||||
[playbackController play:self];
|
[playbackController play:self];
|
||||||
}
|
}
|
||||||
else if (modifiers == 0 && c == 0x1b) { //Escape
|
else if (modifiers == 0 && c == 0x1b) { //Escape
|
||||||
NSLog(@"ESCAPE!");
|
|
||||||
[playlistController clearFilterPredicate:self];
|
[playlistController clearFilterPredicate:self];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -40,7 +40,7 @@ int randint(int low, int high)
|
||||||
t = sum([a count]);
|
t = sum([a count]);
|
||||||
r = randint(1, t);
|
r = randint(1, t);
|
||||||
p = reverse_sum(r) - 1;
|
p = reverse_sum(r) - 1;
|
||||||
printf("%i, %i, %i, %i\n", [a count], t, r, p);
|
//printf("%i, %i, %i, %i\n", [a count], t, r, p);
|
||||||
|
|
||||||
[b insertObject:[a objectAtIndex:p] atIndex:0];
|
[b insertObject:[a objectAtIndex:p] atIndex:0];
|
||||||
[a removeObjectAtIndex:p];
|
[a removeObjectAtIndex:p];
|
||||||
|
|
|
@ -65,7 +65,6 @@
|
||||||
int l = [_socket receive:buffer amount:amount];
|
int l = [_socket receive:buffer amount:amount];
|
||||||
uint8_t *f;
|
uint8_t *f;
|
||||||
while(NULL == (f = (uint8_t *)strnstr((const char *)buffer, "\r\n\r\n", l))) {
|
while(NULL == (f = (uint8_t *)strnstr((const char *)buffer, "\r\n\r\n", l))) {
|
||||||
NSLog(@"LOOKING FOR HEADER! %i", f);
|
|
||||||
fwrite(buffer, 1,l, testFout);
|
fwrite(buffer, 1,l, testFout);
|
||||||
//Need to check for boundary conditions
|
//Need to check for boundary conditions
|
||||||
memmove(buffer, (uint8_t *)buffer + (l - delimeter_size), delimeter_size);
|
memmove(buffer, (uint8_t *)buffer + (l - delimeter_size), delimeter_size);
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
struct hostent *he;
|
struct hostent *he;
|
||||||
|
|
||||||
if (_fd < 0) {
|
if (_fd < 0) {
|
||||||
NSLog(@"%s\n", strerror(errno));
|
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +41,7 @@
|
||||||
memcpy(&sin.sin_addr, he->h_addr, 4);
|
memcpy(&sin.sin_addr, he->h_addr, 4);
|
||||||
|
|
||||||
if (connect(_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
|
if (connect(_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
|
||||||
NSLog(@"%s\n", strerror(errno));
|
NSLog(@"Error: %s\n", strerror(errno));
|
||||||
close(_fd);
|
close(_fd);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
|
@ -517,7 +517,6 @@ static inline signed int scale (mad_fixed_t sample)
|
||||||
channels = MAD_NCHANNELS(&_frame.header);
|
channels = MAD_NCHANNELS(&_frame.header);
|
||||||
bitsPerSample = 16;
|
bitsPerSample = 16;
|
||||||
|
|
||||||
NSLog(@"FORMAT CHANGED: %f", frequency);
|
|
||||||
[self willChangeValueForKey:@"properties"];
|
[self willChangeValueForKey:@"properties"];
|
||||||
[self didChangeValueForKey:@"properties"];
|
[self didChangeValueForKey:@"properties"];
|
||||||
|
|
||||||
|
@ -578,8 +577,6 @@ static inline signed int scale (mad_fixed_t sample)
|
||||||
|
|
||||||
_seekSkip = YES;
|
_seekSkip = YES;
|
||||||
|
|
||||||
NSLog(@"Seeking: %lf", seconds*1000.0);
|
|
||||||
|
|
||||||
return seconds*1000.0;
|
return seconds*1000.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
|
|
||||||
mpc_int32_t ReadProc(void *data, void *ptr, mpc_int32_t size)
|
mpc_int32_t ReadProc(void *data, void *ptr, mpc_int32_t size)
|
||||||
{
|
{
|
||||||
NSLog(@"MPC Read: %i", size);
|
|
||||||
MusepackDecoder *decoder = (MusepackDecoder *) data;
|
MusepackDecoder *decoder = (MusepackDecoder *) data;
|
||||||
|
|
||||||
return [[decoder source] read:ptr amount:size];
|
return [[decoder source] read:ptr amount:size];
|
||||||
|
@ -21,13 +20,12 @@ mpc_int32_t ReadProc(void *data, void *ptr, mpc_int32_t size)
|
||||||
mpc_bool_t SeekProc(void *data, mpc_int32_t offset)
|
mpc_bool_t SeekProc(void *data, mpc_int32_t offset)
|
||||||
{
|
{
|
||||||
MusepackDecoder *decoder = (MusepackDecoder *) data;
|
MusepackDecoder *decoder = (MusepackDecoder *) data;
|
||||||
NSLog(@"MPC Seek: %i", offset);
|
|
||||||
return [[decoder source] seek:offset whence:SEEK_SET];
|
return [[decoder source] seek:offset whence:SEEK_SET];
|
||||||
}
|
}
|
||||||
|
|
||||||
mpc_int32_t TellProc(void *data)
|
mpc_int32_t TellProc(void *data)
|
||||||
{
|
{
|
||||||
NSLog(@"MPC Tell");
|
|
||||||
MusepackDecoder *decoder = (MusepackDecoder *) data;
|
MusepackDecoder *decoder = (MusepackDecoder *) data;
|
||||||
|
|
||||||
return [[decoder source] tell];
|
return [[decoder source] tell];
|
||||||
|
@ -35,7 +33,6 @@ mpc_int32_t TellProc(void *data)
|
||||||
|
|
||||||
mpc_int32_t GetSizeProc(void *data)
|
mpc_int32_t GetSizeProc(void *data)
|
||||||
{
|
{
|
||||||
NSLog(@"MPC GetSize");
|
|
||||||
MusepackDecoder *decoder = (MusepackDecoder *) data;
|
MusepackDecoder *decoder = (MusepackDecoder *) data;
|
||||||
|
|
||||||
if ([[decoder source] seekable]) {
|
if ([[decoder source] seekable]) {
|
||||||
|
@ -55,7 +52,6 @@ mpc_int32_t GetSizeProc(void *data)
|
||||||
|
|
||||||
mpc_bool_t CanSeekProc(void *data)
|
mpc_bool_t CanSeekProc(void *data)
|
||||||
{
|
{
|
||||||
NSLog(@"MPC Canseek");
|
|
||||||
MusepackDecoder *decoder = (MusepackDecoder *) data;
|
MusepackDecoder *decoder = (MusepackDecoder *) data;
|
||||||
|
|
||||||
return [[decoder source] seekable];
|
return [[decoder source] seekable];
|
||||||
|
@ -71,7 +67,6 @@ mpc_bool_t CanSeekProc(void *data)
|
||||||
reader.get_size = GetSizeProc;
|
reader.get_size = GetSizeProc;
|
||||||
reader.canseek = CanSeekProc;
|
reader.canseek = CanSeekProc;
|
||||||
reader.data = self;
|
reader.data = self;
|
||||||
NSLog(@"%@", reader.data);
|
|
||||||
|
|
||||||
mpc_streaminfo_init(&info);
|
mpc_streaminfo_init(&info);
|
||||||
if (mpc_streaminfo_read(&info, &reader) != ERROR_CODE_OK)
|
if (mpc_streaminfo_read(&info, &reader) != ERROR_CODE_OK)
|
||||||
|
@ -94,8 +89,6 @@ mpc_bool_t CanSeekProc(void *data)
|
||||||
|
|
||||||
length = ((double)mpc_streaminfo_get_length_samples(&info)*1000.0)/frequency;
|
length = ((double)mpc_streaminfo_get_length_samples(&info)*1000.0)/frequency;
|
||||||
|
|
||||||
NSLog(@"Length: %lf", length);
|
|
||||||
|
|
||||||
[self willChangeValueForKey:@"properties"];
|
[self willChangeValueForKey:@"properties"];
|
||||||
[self didChangeValueForKey:@"properties"];
|
[self didChangeValueForKey:@"properties"];
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,6 @@
|
||||||
{
|
{
|
||||||
if(decoder)
|
if(decoder)
|
||||||
{
|
{
|
||||||
NSLog(@"Exiting decoder!");
|
|
||||||
decoder->exit();
|
decoder->exit();
|
||||||
delete decoder;
|
delete decoder;
|
||||||
decoder = NULL;
|
decoder = NULL;
|
||||||
|
|
|
@ -64,13 +64,11 @@ long sourceTell(void *datasource)
|
||||||
bitrate = (vi->bitrate_nominal/1000.0);
|
bitrate = (vi->bitrate_nominal/1000.0);
|
||||||
channels = vi->channels;
|
channels = vi->channels;
|
||||||
frequency = vi->rate;
|
frequency = vi->rate;
|
||||||
NSLog(@"INFO: %i", bitsPerSample);
|
|
||||||
|
|
||||||
seekable = ov_seekable(&vorbisRef);
|
seekable = ov_seekable(&vorbisRef);
|
||||||
|
|
||||||
length = ((double)ov_pcm_total(&vorbisRef, -1) * 1000.0)/frequency;
|
length = ((double)ov_pcm_total(&vorbisRef, -1) * 1000.0)/frequency;
|
||||||
|
|
||||||
NSLog(@"Ok to go WITH OGG. %i", seekable);
|
|
||||||
[self willChangeValueForKey:@"properties"];
|
[self willChangeValueForKey:@"properties"];
|
||||||
[self didChangeValueForKey:@"properties"];
|
[self didChangeValueForKey:@"properties"];
|
||||||
|
|
||||||
|
@ -91,7 +89,6 @@ long sourceTell(void *datasource)
|
||||||
channels = vi->channels;
|
channels = vi->channels;
|
||||||
frequency = vi->rate;
|
frequency = vi->rate;
|
||||||
|
|
||||||
NSLog(@"Format changed...");
|
|
||||||
[self willChangeValueForKey:@"properties"];
|
[self willChangeValueForKey:@"properties"];
|
||||||
[self didChangeValueForKey:@"properties"];
|
[self didChangeValueForKey:@"properties"];
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,6 @@ int32_t WriteBytesProc(void *ds, void *data, int32_t bcount)
|
||||||
void *sampleBuf = malloc(size*2);
|
void *sampleBuf = malloc(size*2);
|
||||||
|
|
||||||
numsamples = size/(bitsPerSample/8)/channels;
|
numsamples = size/(bitsPerSample/8)/channels;
|
||||||
// DBLog(@"NUM SAMPLES: %i %i", numsamples, size);
|
|
||||||
n = WavpackUnpackSamples(wpc, sampleBuf, numsamples);
|
n = WavpackUnpackSamples(wpc, sampleBuf, numsamples);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -59,7 +59,6 @@ extern CGError CGSSetGlobalHotKeyOperatingMode(CGSConnection connection,
|
||||||
|
|
||||||
- (BOOL)becomeFirstResponder
|
- (BOOL)becomeFirstResponder
|
||||||
{
|
{
|
||||||
NSLog(@"BECAME FIRST");
|
|
||||||
[self startObserving];
|
[self startObserving];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -94,7 +93,6 @@ extern CGError CGSSetGlobalHotKeyOperatingMode(CGSConnection connection,
|
||||||
|
|
||||||
- (void)mouseDown:(NSEvent *)theEvent
|
- (void)mouseDown:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
NSLog(@"MOUSE DOWN");
|
|
||||||
[self startObserving];
|
[self startObserving];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
/*- (void)windowDidBecomeKey:(id)notification
|
/*- (void)windowDidBecomeKey:(id)notification
|
||||||
{
|
{
|
||||||
if ([notification object] == [view window]) {
|
if ([notification object] == [view window]) {
|
||||||
NSLog(@"BECAME KEY: %@", notification);
|
|
||||||
[playHotKeyControl startObserving];
|
[playHotKeyControl startObserving];
|
||||||
[prevHotKeyControl startObserving];
|
[prevHotKeyControl startObserving];
|
||||||
[nextHotKeyControl startObserving];
|
[nextHotKeyControl startObserving];
|
||||||
|
@ -51,7 +50,6 @@
|
||||||
- (void)windowDidResignKey:(id)notification
|
- (void)windowDidResignKey:(id)notification
|
||||||
{
|
{
|
||||||
if ([notification object] == [view window]) {
|
if ([notification object] == [view window]) {
|
||||||
NSLog(@"RESIGNED KEY: %@", notification);
|
|
||||||
[playHotKeyControl stopObserving];
|
[playHotKeyControl stopObserving];
|
||||||
[prevHotKeyControl stopObserving];
|
[prevHotKeyControl stopObserving];
|
||||||
[nextHotKeyControl stopObserving];
|
[nextHotKeyControl stopObserving];
|
||||||
|
|
|
@ -13,14 +13,12 @@
|
||||||
|
|
||||||
- (void)awakeFromNib
|
- (void)awakeFromNib
|
||||||
{
|
{
|
||||||
NSLog(@"AWOKEN!");
|
|
||||||
[self setName:NSLocalizedStringFromTableInBundle(@"Output", nil, [NSBundle bundleForClass:[self class]], @"") ];
|
[self setName:NSLocalizedStringFromTableInBundle(@"Output", nil, [NSBundle bundleForClass:[self class]], @"") ];
|
||||||
[self setIcon:@"output"];
|
[self setIcon:@"output"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction) takeDeviceID:(id)sender
|
- (IBAction) takeDeviceID:(id)sender
|
||||||
{
|
{
|
||||||
NSLog(@"Taking thing: %@", [outputDevices selectedObjects]);
|
|
||||||
NSDictionary *device = [[outputDevices selectedObjects] objectAtIndex:0];
|
NSDictionary *device = [[outputDevices selectedObjects] objectAtIndex:0];
|
||||||
[[NSUserDefaults standardUserDefaults] setObject: device forKey:@"outputDevice"];
|
[[NSUserDefaults standardUserDefaults] setObject: device forKey:@"outputDevice"];
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,19 +4,16 @@
|
||||||
|
|
||||||
- (void)awakeFromNib
|
- (void)awakeFromNib
|
||||||
{
|
{
|
||||||
NSLog(@"initOutputDeviceList");
|
|
||||||
[self removeObjects:[self arrangedObjects]];
|
[self removeObjects:[self arrangedObjects]];
|
||||||
|
|
||||||
[self setSelectsInsertedObjects:NO];
|
[self setSelectsInsertedObjects:NO];
|
||||||
|
|
||||||
NSLog(@"OutputCoreAudio.setup()");
|
|
||||||
UInt32 propsize;
|
UInt32 propsize;
|
||||||
verify_noerr(AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &propsize, NULL));
|
verify_noerr(AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &propsize, NULL));
|
||||||
int nDevices = propsize / sizeof(AudioDeviceID);
|
int nDevices = propsize / sizeof(AudioDeviceID);
|
||||||
AudioDeviceID *devids = malloc(propsize);
|
AudioDeviceID *devids = malloc(propsize);
|
||||||
verify_noerr(AudioHardwareGetProperty(kAudioHardwarePropertyDevices, &propsize, devids));
|
verify_noerr(AudioHardwareGetProperty(kAudioHardwarePropertyDevices, &propsize, devids));
|
||||||
int i;
|
int i;
|
||||||
NSLog(@"Number of devices: %d", nDevices);
|
|
||||||
|
|
||||||
NSDictionary *defaultDevice = [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"outputDevice"];
|
NSDictionary *defaultDevice = [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"outputDevice"];
|
||||||
|
|
||||||
|
@ -24,7 +21,6 @@
|
||||||
char name[256];
|
char name[256];
|
||||||
UInt32 maxlen = 256;
|
UInt32 maxlen = 256;
|
||||||
verify_noerr(AudioDeviceGetProperty(devids[i], 0, false, kAudioDevicePropertyDeviceName, &maxlen, name));
|
verify_noerr(AudioDeviceGetProperty(devids[i], 0, false, kAudioDevicePropertyDeviceName, &maxlen, name));
|
||||||
NSLog(@"Device: %d %s", devids[i], name);
|
|
||||||
|
|
||||||
// Ignore devices that have no output channels:
|
// Ignore devices that have no output channels:
|
||||||
// This tells us the size of the buffer required to hold the information about the channels
|
// This tells us the size of the buffer required to hold the information about the channels
|
||||||
|
@ -44,7 +40,6 @@
|
||||||
if (defaultDevice) {
|
if (defaultDevice) {
|
||||||
if ([[defaultDevice objectForKey:@"deviceID"] isEqualToNumber:[deviceInfo objectForKey:@"deviceID"]]) {
|
if ([[defaultDevice objectForKey:@"deviceID"] isEqualToNumber:[deviceInfo objectForKey:@"deviceID"]]) {
|
||||||
[self setSelectedObjects:[NSArray arrayWithObject:deviceInfo]];
|
[self setSelectedObjects:[NSArray arrayWithObject:deviceInfo]];
|
||||||
NSLog(@"Selected default!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
|
|
||||||
- (PreferencePane *)remotePane
|
- (PreferencePane *)remotePane
|
||||||
{
|
{
|
||||||
NSLog(@"Localizations; %@", [[NSBundle mainBundle] localizations]);
|
|
||||||
return [PreferencePane preferencePaneWithView:remoteView name:NSLocalizedStringFromTableInBundle(@"Remote", nil, [NSBundle bundleForClass:[self class]], @"") icon:@"apple_remote"];
|
return [PreferencePane preferencePaneWithView:remoteView name:NSLocalizedStringFromTableInBundle(@"Remote", nil, [NSBundle bundleForClass:[self class]], @"") icon:@"apple_remote"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
if (!prefs) {
|
if (!prefs) {
|
||||||
// Determine path to the sample preference panes
|
// Determine path to the sample preference panes
|
||||||
NSString *pathToPanes = [[NSBundle mainBundle] resourcePath];
|
NSString *pathToPanes = [[NSBundle mainBundle] resourcePath];
|
||||||
NSLog(@"Loading preferences...%@", pathToPanes);
|
|
||||||
|
|
||||||
prefs = [[SS_PrefsController alloc] initWithPanesSearchPath:pathToPanes bundleExtension:@"preferencePane"];
|
prefs = [[SS_PrefsController alloc] initWithPanesSearchPath:pathToPanes bundleExtension:@"preferencePane"];
|
||||||
[prefs setDebug:YES];
|
[prefs setDebug:YES];
|
||||||
|
|
|
@ -658,7 +658,6 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc {
|
- (void) dealloc {
|
||||||
NSLog(@"Dealloc");
|
|
||||||
[applicationDelegate release];
|
[applicationDelegate release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,8 @@
|
||||||
|
|
||||||
- (void)mouseDown:(NSEvent *)theEvent
|
- (void)mouseDown:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
NSLog(@"MOUSING DOWN");
|
|
||||||
if([theEvent type] == NSLeftMouseDown)
|
if([theEvent type] == NSLeftMouseDown)
|
||||||
{
|
{
|
||||||
// NSLog(@"SENDING ACTION: %@", [self action]);
|
|
||||||
[self sendAction:[self action] to:[self target]];
|
[self sendAction:[self action] to:[self target]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView
|
- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView
|
||||||
{
|
{
|
||||||
// DBLog(@"TRACKING");
|
|
||||||
tracking = YES;
|
tracking = YES;
|
||||||
return [super startTrackingAt:startPoint inView:controlView];
|
return [super startTrackingAt:startPoint inView:controlView];
|
||||||
|
|
||||||
|
@ -12,7 +11,6 @@
|
||||||
|
|
||||||
- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)controlView mouseIsUp:(BOOL)flag
|
- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)controlView mouseIsUp:(BOOL)flag
|
||||||
{
|
{
|
||||||
// DBLog(@"NOT TRACKING");
|
|
||||||
tracking = NO;
|
tracking = NO;
|
||||||
|
|
||||||
[super stopTracking:lastPoint at:stopPoint inView:controlView mouseIsUp:flag];
|
[super stopTracking:lastPoint at:stopPoint inView:controlView mouseIsUp:flag];
|
||||||
|
|
Loading…
Reference in New Issue