Fixed bug where dialogs would lose focus when the dock icon is clicked.

Fixed bug where playback would not resume when seeking to the end of a file.
Fixed bug where seek bar is enabled on launch.
CQTexperiment
vspader 2007-07-05 23:08:10 +00:00
parent bd21d71b2a
commit a2b9db5f58
7 changed files with 26 additions and 19 deletions

View File

@ -271,8 +271,8 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag
{
// if (flag == NO)
[mainWindow makeKeyAndOrderFront:self];
if (flag == NO)
[mainWindow makeKeyAndOrderFront:self];
return NO;
}

View File

@ -54,6 +54,7 @@
{
currentVolume = 100.0;
[volumeSlider setDoubleValue:pow(10.0, log10(0.5)/4.0)*[volumeSlider maxValue]];
[positionSlider setEnabled:NO];
}
- (IBAction)playPauseResume:(id)sender

View File

@ -174,6 +174,7 @@
}
else {
NSLog(@"Resuming not launching");
[self setShouldContinue:YES];
[output resume];
}
}

View File

@ -38,11 +38,13 @@
- (void)pause
{
[output pause];
NSLog(@"PAUSED!");
}
- (void)resume
{
[output resume];
NSLog(@"RESUMED");
}
- (int)readData:(void *)ptr amount:(int)amount

View File

@ -27,6 +27,7 @@
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;
OSStatus err = noErr;
void *readPointer = ioData->mBuffers[0].mData;
@ -35,7 +36,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
if ([output->outputController shouldContinue] == NO)
{
DBLog(@"STOPPING");
//NSLog(@"STOPPING");
AudioOutputUnitStop(output->outputUnit);
// [output stop];
@ -47,7 +48,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
if ((amountRead < amountToRead) && [output->outputController endOfStream] == NO) //Try one more time! for track changes!
{
NSLog(@"READING AGAIN! %i/%i", amountRead, amountToRead);
//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
amountRead2 = [output->outputController readData:(readPointer+amountRead) amount:amountToRead-amountRead];
amountRead += amountRead2;
@ -56,7 +57,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
ioData->mBuffers[0].mDataByteSize = amountRead;
ioData->mBuffers[0].mNumberChannels = output->deviceFormat.mChannelsPerFrame;
// NSLog(@"Amount read for output: (%i) %i %i/%i", ioData->mNumberBuffers, ioData->mBuffers[0].mNumberChannels, amountRead, amountToRead);
//NSLog(@"Amount read for output: (%i) %i %i/%i", ioData->mNumberBuffers, ioData->mBuffers[0].mNumberChannels, amountRead, amountToRead);
return err;
}
@ -243,6 +244,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
AudioOutputUnitStop(outputUnit);
AudioUnitUninitialize (outputUnit);
CloseComponent(outputUnit);
outputUnit = NULL;
}
}
@ -262,7 +264,8 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
- (void)resume
{
NSLog(@"RESUME");
AudioOutputUnitStart(outputUnit);
OSStatus err = AudioOutputUnitStart(outputUnit);
NSLog(@"Resume: %i", err);
}
@end

View File

@ -7,20 +7,20 @@
<key>IBEditorPositions</key>
<dict>
<key>1063</key>
<string>549 810 136 68 0 0 1440 878 </string>
<string>650 960 136 68 0 0 1680 1028 </string>
<key>1156</key>
<string>633 402 241 366 0 0 1440 878 </string>
<string>719 529 241 366 0 0 1680 1028 </string>
<key>1324</key>
<string>664 542 137 182 0 0 1440 878 </string>
<string>786 659 137 182 0 0 1680 1028 </string>
<key>29</key>
<string>128 827 383 44 0 0 1440 878 </string>
<string>157 976 383 44 0 0 1680 1028 </string>
<key>463</key>
<string>583 512 341 145 0 0 1440 878 </string>
<string>669 640 341 145 0 0 1680 1028 </string>
<key>513</key>
<string>320 525 131 168 0 0 1440 878 </string>
<string>379 636 131 168 0 0 1680 1028 </string>
</dict>
<key>IBFramework Version</key>
<string>443.0</string>
<string>446.1</string>
<key>IBLockedObjects</key>
<array>
<integer>484</integer>
@ -34,16 +34,16 @@
<integer>4</integer>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>21</integer>
<integer>513</integer>
<integer>268</integer>
<integer>463</integer>
<integer>1156</integer>
<integer>1063</integer>
<integer>29</integer>
<integer>1156</integer>
<integer>1324</integer>
<integer>513</integer>
<integer>21</integer>
<integer>463</integer>
</array>
<key>IBSystem Version</key>
<string>8P2137</string>
<string>8R2218</string>
</dict>
</plist>

Binary file not shown.