Bug fixes: 1463532, 1463513

CQTexperiment
vspader 2006-04-04 01:08:21 +00:00
parent ee3c01aaed
commit 676b220430
20 changed files with 90 additions and 62 deletions

View File

@ -18,6 +18,8 @@
IBOutlet NSButton *infoButton; IBOutlet NSButton *infoButton;
IBOutlet NSButton *shuffleButton; IBOutlet NSButton *shuffleButton;
IBOutlet NSButton *repeatButton; IBOutlet NSButton *repeatButton;
IBOutlet NSDrawer *infoDrawer;
} }
- (IBAction)addFiles:(id)sender; - (IBAction)addFiles:(id)sender;
@ -28,6 +30,12 @@
- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo; - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo;
- (IBAction)donate:(id)sender;
- (IBAction)toggleInfoDrawer:(id)sender;
- (void)drawerDidOpen:(NSNotification *)notification;
- (void)drawerDidClose:(NSNotification *)notification;
//Fun stuff //Fun stuff
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag; - (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag;
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename; - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;

View File

@ -150,4 +150,26 @@
[theApplication replyToOpenOrPrint:NSApplicationDelegateReplySuccess]; [theApplication replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
} }
- (IBAction)toggleInfoDrawer:(id)sender
{
[mainWindow makeKeyAndOrderFront:self];
[infoDrawer toggle:self];
}
- (void)drawerDidOpen:(NSNotification *)notification
{
[infoButton setState:NSOnState];
}
- (void)drawerDidClose:(NSNotification *)notification
{
[infoButton setState:NSOffState];
}
- (IBAction)donate:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://sourceforge.net/project/project_donations.php?group_id=140003"]];
}
@end @end

View File

@ -1,5 +1,15 @@
0.05 0.05 alpha 2
---- ------------
Fixed dock menu connections, and menu connections for play/stop/next/prev.
Fixed bindings for tag/info drawer.
Volume settings are now consistent across songs.
Window remembers its location.
Info button now turns off when manually dragging the info drawer closed.
Fixed weirdness when displaying the info drawer after closing the window (via menu or keyboard shortcut). Performing Get info now makes the window visible.
Added a donation menu item. ($)
0.05 alpha 1
------------
Dragging to the dock icon now works in 10.3. Dragging to the dock icon now works in 10.3.
Selection now selects the first song added when adding new files. Selection now selects the first song added when adding new files.
Now seeds the random number generator for shuffle mode. Now seeds the random number generator for shuffle mode.
@ -12,6 +22,9 @@ Seekbar now updates the time field as you drag it, Simon Savary <savary (at) ori
French translation courtesy of Simon Savary <savary (at) oricom.ca> French translation courtesy of Simon Savary <savary (at) oricom.ca>
Window is now brought to the front when opening a playlist. Window is now brought to the front when opening a playlist.
Should work with 3rd party audio devices. Should work with 3rd party audio devices.
Gapless playback.
New core which should feature better performance.
New bugs and crashes!
0.04 0.04
---- ----

View File

@ -1,5 +1,7 @@
<html> <html>
<body> <body style="text-align:center;">
Cog is dedicated to satan. Some guys just get a bad rap. Cog is dedicated to snacos, the ungodly combination of snacks and tacos.
<br /><br />
This program has been made possible through donations from users like you.
</body> </body>
</html> </html>

Binary file not shown.

View File

@ -4,16 +4,18 @@
ACTIONS = { ACTIONS = {
addFiles = id; addFiles = id;
delEntries = id; delEntries = id;
donate = id;
loadPlaylist = id; loadPlaylist = id;
savePlaylist = id; savePlaylist = id;
savePlaylistAs = id; savePlaylistAs = id;
showInfo = id; toggleInfoDrawer = id;
}; };
CLASS = AppController; CLASS = AppController;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = { OUTLETS = {
addButton = NSButton; addButton = NSButton;
infoButton = NSButton; infoButton = NSButton;
infoDrawer = NSDrawer;
mainWindow = NSPanel; mainWindow = NSPanel;
nextButton = NSButton; nextButton = NSButton;
playButton = NSButton; playButton = NSButton;

View File

@ -3,15 +3,15 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>48 89 617 240 0 0 1024 746 </string> <string>91 411 617 240 0 0 1024 746 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>29</key> <key>29</key>
<string>243 676 346 44 0 0 1024 746 </string> <string>235 637 346 44 0 0 1024 746 </string>
<key>463</key> <key>463</key>
<string>336 385 352 268 0 0 1024 746 </string> <string>336 385 352 268 0 0 1024 746 </string>
<key>513</key> <key>513</key>
<string>475 157 109 106 0 0 1024 746 </string> <string>85 528 109 106 0 0 1024 746 </string>
</dict> </dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>443.0</string> <string>443.0</string>
@ -28,6 +28,7 @@
<integer>3</integer> <integer>3</integer>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>513</integer>
<integer>463</integer> <integer>463</integer>
<integer>29</integer> <integer>29</integer>
<integer>21</integer> <integer>21</integer>

Binary file not shown.

View File

@ -87,7 +87,7 @@
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>wheel</string> <string>wheel</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.badahol.cog</string> <string>com.vspader.cog</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
@ -95,7 +95,7 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>0.05</string> <string>0.05 alpha 1</string>
<key>NSAppleScriptEnabled</key> <key>NSAppleScriptEnabled</key>
<string>YES</string> <string>YES</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>

View File

@ -27,6 +27,8 @@
int playbackStatus; int playbackStatus;
float currentVolume;
BOOL showTimeRemaining; BOOL showTimeRemaining;
} }

View File

@ -22,13 +22,13 @@
- (void)awakeFromNib - (void)awakeFromNib
{ {
currentVolume = 100.0;
} }
- (IBAction)playPauseResume:(id)sender - (IBAction)playPauseResume:(id)sender
{ {
NSLog(@"PLAYING"); DBLog(@"PLAYING");
if (playbackStatus == kCogStatusStopped) if (playbackStatus == kCogStatusStopped)
[self play:self]; [self play:self];
else else
@ -87,24 +87,25 @@
if (playbackStatus != kCogStatusStopped) if (playbackStatus != kCogStatusStopped)
[self stop:self]; [self stop:self];
NSLog(@"LENGTH: %lf", [pe length]); DBLog(@"LENGTH: %lf", [pe length]);
[positionSlider setMaxValue:[pe length]]; [positionSlider setMaxValue:[pe length]];
[positionSlider setDoubleValue:0.0f]; [positionSlider setDoubleValue:0.0f];
[self updateTimeField:0.0f]; [self updateTimeField:0.0f];
[soundController play:[pe filename]]; [soundController play:[pe filename]];
[soundController setVolume:currentVolume];
} }
- (IBAction)next:(id)sender - (IBAction)next:(id)sender
{ {
NSLog(@"CALLING: %i %i", playbackStatus, kCogStatusStopped); DBLog(@"CALLING: %i %i", playbackStatus, kCogStatusStopped);
if ([playlistController next] == NO) if ([playlistController next] == NO)
return; return;
if (playbackStatus != kCogStatusStopped) if (playbackStatus != kCogStatusStopped)
{ {
NSLog(@"STOPPING"); DBLog(@"STOPPING");
[self stop:self]; [self stop:self];
[self playEntry:[playlistController currentEntry]]; [self playEntry:[playlistController currentEntry]];
} }
@ -112,7 +113,7 @@
- (IBAction)prev:(id)sender - (IBAction)prev:(id)sender
{ {
NSLog(@"CALLING"); DBLog(@"CALLING");
if ([playlistController prev] == nil) if ([playlistController prev] == nil)
return; return;
@ -129,7 +130,7 @@
double time; double time;
time = [positionSlider doubleValue]; time = [positionSlider doubleValue];
// if ([sender tracking] == NO) // check if user stopped sliding before playing audio if ([sender tracking] == NO) // check if user stopped sliding before playing audio
[soundController seekToTime:time]; [soundController seekToTime:time];
[self updateTimeField:time]; [self updateTimeField:time];
@ -156,8 +157,9 @@
- (IBAction)changeVolume:(id)sender - (IBAction)changeVolume:(id)sender
{ {
float v = (float)[sender doubleValue]; currentVolume = (float)[sender doubleValue];
[soundController setVolume:v];
[soundController setVolume:currentVolume];
} }
@ -193,7 +195,7 @@
[soundController setNextSong:nil]; [soundController setNextSong:nil];
else else
{ {
NSLog(@"NEXT SONG: %@", [pe filename]); DBLog(@"NEXT SONG: %@", [pe filename]);
[soundController setNextSong:[pe filename]]; [soundController setNextSong:[pe filename]];
} }
} }
@ -233,7 +235,7 @@
int status = [s intValue]; int status = [s intValue];
if (status == kCogStatusStopped || status == kCogStatusPaused) if (status == kCogStatusStopped || status == kCogStatusPaused)
{ {
NSLog(@"INVALIDATING"); DBLog(@"INVALIDATING");
if (positionTimer) if (positionTimer)
{ {
[positionTimer invalidate]; [positionTimer invalidate];

View File

@ -121,7 +121,6 @@ NSString *MovedRowsType = @"MOVED_ROWS_TYPE";
- (NSIndexSet *)indexSetFromRows:(NSArray *)rows - (NSIndexSet *)indexSetFromRows:(NSArray *)rows
{ {
NSLog(@"HELLO");
NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet]; NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet];
NSEnumerator *rowEnumerator = [rows objectEnumerator]; NSEnumerator *rowEnumerator = [rows objectEnumerator];
NSNumber *idx; NSNumber *idx;

View File

@ -260,7 +260,6 @@
- (PlaylistEntry *)entryAtOffset:(int)offset - (PlaylistEntry *)entryAtOffset:(int)offset
{ {
NSLog(@"SHUFFLE: %i", offset);
if (shuffle == YES) if (shuffle == YES)
{ {
int i = shuffleIndex; int i = shuffleIndex;

View File

@ -219,11 +219,11 @@
-(void)readTags -(void)readTags
{ {
TagLib_File *tagFile = taglib_file_new((const char *)[filename UTF8String]); TagLib_File *tagFile = taglib_file_new((const char *)[filename UTF8String]);
NSLog(@"Does it have a file? %i %s", tagFile, (const char *)[filename UTF8String]); DBLog(@"Does it have a file? %i %s", tagFile, (const char *)[filename UTF8String]);
if (tagFile) if (tagFile)
{ {
TagLib_Tag *tag = taglib_file_tag(tagFile); TagLib_Tag *tag = taglib_file_tag(tagFile);
NSLog(@"Does it have a tag? %i", tag); DBLog(@"Does it have a tag? %i", tag);
if (tag) if (tag)
{ {

28
README
View File

@ -1,28 +1,10 @@
--------------------------------------------------------------------------- Cog is released under the GPL. See COPYING for details.
10.3 USERS!!!
If you are using 10.3.8 or below, I'd like to hear from you. I'm trying to The libraries folder contains various decoding and tagging libraries, which i have created Xcode projects for, and possibly modified to make compile on OS X. The various libraries are under each of their own licenses.
support all 10.3 systems, as I heard some people have had troubles with
10.3.9, and won't upgrade to it.
I can only fix this if people who actually run those systems wish to help
me debug Cog. Thanks!
---------------------------------------------------------------------------
Cog is released under the GPL. See COPYING for details. All Cog code is copyrighted by me, and is licensed under the GPL.
The libraries folder contains various decoding and tagging If you would like the photoshop sources for the various icons and graphics, please send me an email, and I will be happy to get them to you.
libraries, which i have created Xcode projects for, and possibly modified
to make compile on OS X. The various libraries are under each of their own
licenses.
Please note that vulgar language may be contained in the source code. Share and enjoy.
It is rated M for mature by the ESRB, the MPAA, and whatever else deems it
unsuitable for virgin ears.
All Cog code is copyrighted by me, and is licensed under the GPL.
If you would like the photoshop sources for the various icons and
graphics, please send me an email, and I will be happy to get them to you.
Share and enjoy.
--Vincent Spader (vspader@users.sf.net) --Vincent Spader (vspader@users.sf.net)

View File

@ -42,7 +42,7 @@
if (amountRead <= 0) if (amountRead <= 0)
{ {
endOfStream = YES; endOfStream = YES;
NSLog(@"END OF INPUT WAS REACHED"); DBLog(@"END OF INPUT WAS REACHED");
[controller endOfInputReached]; [controller endOfInputReached];
break; //eof break; //eof
} }

View File

@ -33,7 +33,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
if ([output->outputController shouldContinue] == NO) if ([output->outputController shouldContinue] == NO)
{ {
NSLog(@"STOPPING"); DBLog(@"STOPPING");
AudioOutputUnitStop(output->outputUnit); AudioOutputUnitStop(output->outputUnit);
// [output stop]; // [output stop];
@ -58,7 +58,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
- (BOOL)setup - (BOOL)setup
{ {
NSLog(@"SETUP"); DBLog(@"SETUP");
if (outputUnit) if (outputUnit)
[self stop]; [self stop];
@ -153,13 +153,13 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
- (void)start - (void)start
{ {
NSLog(@"START OUTPUT\n"); DBLog(@"START OUTPUT\n");
AudioOutputUnitStart(outputUnit); AudioOutputUnitStart(outputUnit);
} }
- (void)stop - (void)stop
{ {
NSLog(@"STOP!"); DBLog(@"STOP!");
if (outputUnit) if (outputUnit)
{ {
AudioOutputUnitStop(outputUnit); AudioOutputUnitStop(outputUnit);

View File

@ -52,11 +52,11 @@
// NSLog(@"N: %i %i", n, endOfStream); // NSLog(@"N: %i %i", n, endOfStream);
if (endOfStream == YES) if (endOfStream == YES)
{ {
NSLog(@"End of stream reached: %i", endOfStream); DBLog(@"End of stream reached: %i", endOfStream);
amountPlayed = 0; amountPlayed = 0;
[controller endOfInputPlayed]; //Updates shouldContinue appropriately? [controller endOfInputPlayed]; //Updates shouldContinue appropriately?
NSLog(@"End of stream reached: %i", endOfStream); DBLog(@"End of stream reached: %i", endOfStream);
// return (n + [self readData:ptr amount:(amount-n)]); // return (n + [self readData:ptr amount:(amount-n)]);
} }

View File

@ -127,7 +127,7 @@
{ {
[delegate delegateRequestNextSong:[chainQueue count]]; [delegate delegateRequestNextSong:[chainQueue count]];
NSLog(@"END OF INPUT REACHED"); DBLog(@"END OF INPUT REACHED");
if (nextSong == nil) if (nextSong == nil)
return; return;
@ -149,7 +149,7 @@
if ([chainQueue count] <= 0) if ([chainQueue count] <= 0)
{ {
//End of playlist //End of playlist
NSLog(@"STOPPED"); DBLog(@"STOPPED");
[self stop]; [self stop];
return; return;
@ -157,7 +157,7 @@
// NSLog(@"SWAPPING BUFFERS"); // NSLog(@"SWAPPING BUFFERS");
[bufferChain release]; [bufferChain release];
NSLog(@"END OF INPUT PLAYED"); DBLog(@"END OF INPUT PLAYED");
bufferChain = [chainQueue objectAtIndex:0]; bufferChain = [chainQueue objectAtIndex:0];
[bufferChain retain]; [bufferChain retain];

View File

@ -65,10 +65,6 @@
return total; return total;
} }
- (void)dealloc
{
NSLog(@"DEALLOCATING VORBIS");
}
- (void)close - (void)close
{ {
ov_clear(&vorbisRef); ov_clear(&vorbisRef);