diff --git a/PlaybackController.m b/PlaybackController.m index 6e061b576..9fd12de4a 100644 --- a/PlaybackController.m +++ b/PlaybackController.m @@ -188,6 +188,8 @@ else { int sec = (int)(([positionSlider maxValue] - pos)/1000.0); + if (sec < 0) + sec = 0; text = [NSString stringWithFormat:NSLocalizedString(@"TimeRemaining", @""), sec/60, sec%60]; } [timeField setStringValue:text]; diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index b2b67a121..2eceaf366 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -250,10 +250,7 @@ PlaylistEntry* pe; while (pe = [enumerator nextObject]) { - NSLog(@"Updating :%i", pe); - NSLog(@"Updating :%@", pe); tt += [pe length]; - NSLog(@"UpdateD"); } int sec = (int)(tt/1000.0); diff --git a/Sound/SoundFile/CoreAudioFile.m b/Sound/SoundFile/CoreAudioFile.m index 09cc7048b..dd9f19a92 100644 --- a/Sound/SoundFile/CoreAudioFile.m +++ b/Sound/SoundFile/CoreAudioFile.m @@ -106,7 +106,7 @@ OSStatus writeFunc(void * inRefCon, SInt64 inPosition, ByteCount requestCount, c { OSStatus err; -#ifdef _USE_WRAPPER_ +#ifdef _USE_WRAPPER_ // Open the input file _inFd = fopen(filename, "r"); if (!_inFd) @@ -177,7 +177,23 @@ OSStatus writeFunc(void * inRefCon, SInt64 inPosition, ByteCount requestCount, c err = ExtAudioFileDispose(_in); return NO; } - + +#ifdef _USE_WRAPPER_ + SInt64 totalBytes; + + size = sizeof(totalBytes); + err = AudioFileGetProperty(_audioID, kAudioFilePropertyAudioDataByteCount, &size, &totalBytes); + if(err != noErr) { + [self close]; + return NO; + } + + bitRate = ((totalBytes*8)/((totalFrames)/asbd.mSampleRate))/1000.0; +#else + //Is there a way to get bitrate with extAudioFile? + bitRate = 0; +#endif + // Set our properties bitsPerSample = asbd.mBitsPerChannel; channels = asbd.mChannelsPerFrame; @@ -189,7 +205,6 @@ OSStatus writeFunc(void * inRefCon, SInt64 inPosition, ByteCount requestCount, c } totalSize = totalFrames * channels * (bitsPerSample / 8); - bitRate = 0; // Set output format AudioStreamBasicDescription result;