Changed UI things.

CQTexperiment
vspader 2005-06-30 17:46:07 +00:00
parent 7987b3dcf7
commit bbb62c9060
8 changed files with 42 additions and 33 deletions

View File

@ -1,6 +1,12 @@
0.05 0.05
---- ----
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.
Now seeds the random number for shuffle mode.
Redesigned UI thanks to Julian Mayer <julianmayer (at) mac.com>.
If nothing is selected when the user presses play, the first song is played.
Double-clicking when out of focus now behaves as expected.
Now has a simple dock menu courtesy of Nathanael Weldon <nathanael (at) mailblocks.com>.
0.04 0.04
---- ----
@ -13,13 +19,13 @@ Added volume slider.
Fixed autopositioning of the volume slider. Fixed autopositioning of the volume slider.
Fixed crash when dragging/dropping files to the playlist. Fixed crash when dragging/dropping files to the playlist.
0.0.3 0.03
----- -----
Fixed bug where Default.playlist referred to non-existent files, resulting in a crash. Fixed bug where Default.playlist referred to non-existent files, resulting in a crash.
Clicking on the time display will now alternate between current time, and time to go. Clicking on the time display will now alternate between current time, and time to go.
Now makes ham. Now makes ham.
0.0.2 0.02
----- -----
Awesomized id3v2 and tagging support courtesy of TagLib. Awesomized id3v2 and tagging support courtesy of TagLib.
Dramatically improved performance of monkeys audio codec. Dramatically improved performance of monkeys audio codec.
@ -31,6 +37,6 @@ Fixed play button so it now plays the currently selected song if no song is play
Changed info panel to a drawer. Changed info panel to a drawer.
Misc UI fixes. Misc UI fixes.
0.0.1 0.01
----- -----
Initial release. Initial release.

View File

@ -1,5 +1,5 @@
<html> <html>
<body> <body>
This release of Cog is dedicated to all those hungry bug-finders out there. You rock. Cog is dedicated to satan. Some guys just get a bad rap.
</body> </body>
</html> </html>

View File

@ -11,7 +11,7 @@
<key>463</key> <key>463</key>
<string>356 394 312 249 0 0 1024 746 </string> <string>356 394 312 249 0 0 1024 746 </string>
<key>513</key> <key>513</key>
<string>475 157 180 156 0 0 1024 746 </string> <string>475 157 109 106 0 0 1024 746 </string>
</dict> </dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>439.0</string> <string>439.0</string>
@ -21,9 +21,9 @@
</array> </array>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>463</integer>
<integer>21</integer> <integer>21</integer>
<integer>513</integer> <integer>513</integer>
<integer>463</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>8B15</string> <string>8B15</string>

Binary file not shown.

View File

@ -130,6 +130,9 @@
if (shuffle == YES) if (shuffle == YES)
[self generateShuffleList]; [self generateShuffleList];
[self setSelectionIndex:index];
return count; return count;
} }

View File

@ -21,6 +21,11 @@
return YES; return YES;
} }
- (BOOL)acceptsFirstMouse:(NSEvent *)mouseDownEvent
{
return NO;
}
- (void)mouseDown:(NSEvent *)e - (void)mouseDown:(NSEvent *)e
{ {
// DBLog(@"MOUSE DOWN"); // DBLog(@"MOUSE DOWN");

View File

@ -47,6 +47,9 @@
- (IBAction)prev:(id)sender; - (IBAction)prev:(id)sender;
- (IBAction)seek:(id)sender; - (IBAction)seek:(id)sender;
- (void)updateTimeField:(double)pos;
- (void)playEntryAtIndex:(int)i; - (void)playEntryAtIndex:(int)i;
- (void)playEntry:(PlaylistEntry *)pe; - (void)playEntry:(PlaylistEntry *)pe;

View File

@ -24,8 +24,6 @@
- (void)awakeFromNib - (void)awakeFromNib
{ {
[timeField setFont:[NSFont systemFontOfSize:18]];
sendPort = [NSPort port]; sendPort = [NSPort port];
if (sendPort) if (sendPort)
{ {
@ -93,6 +91,9 @@
- (IBAction)play:(id)sender - (IBAction)play:(id)sender
{ {
if ([playlistView selectedRow] == -1)
[playlistView selectRow:0 byExtendingSelection:NO];
[self playEntryAtIndex:[playlistView selectedRow]]; [self playEntryAtIndex:[playlistView selectedRow]];
} }
@ -132,10 +133,7 @@
time = [positionSlider doubleValue]; time = [positionSlider doubleValue];
[self sendPortMessage:kCogSeekMessage withData:&time ofSize:(sizeof(double))]; [self sendPortMessage:kCogSeekMessage withData:&time ofSize:(sizeof(double))];
int sec = (int)(time/1000.0); [self updateTimeField:time];
NSString *text;
text = [NSString stringWithFormat:@"%i:%02i", sec/60, sec%60];
[timeField setStringValue:text];
} }
- (void)sendPortMessage:(int)msgid - (void)sendPortMessage:(int)msgid
@ -213,23 +211,28 @@
[self sendPortMessage:kCogSetVolumeMessage withData:&v ofSize:sizeof(float)]; [self sendPortMessage:kCogSetVolumeMessage withData:&v ofSize:sizeof(float)];
} }
- (IBAction)toggleShowTimeRemaining:(id)sender
- (void)updateTimeField:(double)pos
{ {
NSString *text; NSString *text;
showTimeRemaining = !showTimeRemaining;
if (showTimeRemaining == NO) if (showTimeRemaining == NO)
{ {
int sec = (int)([positionSlider doubleValue]/1000.0); int sec = (int)(pos/1000.0);
text = [NSString stringWithFormat:@"%i:%02i", sec/60, sec%60]; text = [NSString stringWithFormat:@"Time Elapsed: %i:%02i", sec/60, sec%60];
} }
else else
{ {
int sec = (int)(([positionSlider maxValue] - [positionSlider doubleValue])/1000.0); int sec = (int)(([positionSlider maxValue] - pos)/1000.0);
text = [NSString stringWithFormat:@"%i:%02i", sec/60, sec%60]; text = [NSString stringWithFormat:@"Time Remaining: %i:%02i", sec/60, sec%60];
} }
[timeField setStringValue:text]; [timeField setStringValue:text];
}
- (IBAction)toggleShowTimeRemaining:(id)sender
{
showTimeRemaining = !showTimeRemaining;
[self updateTimeField:[positionSlider doubleValue]];
} }
- (void)handlePortMessage:(NSPortMessage *)portMessage - (void)handlePortMessage:(NSPortMessage *)portMessage
@ -271,7 +274,7 @@
{ {
waitingForPlay = NO; waitingForPlay = NO;
[playlistController next]; [playlistController next];
[timeField setStringValue:@"0:00"]; [self updateTimeField:0.0f];
} }
} }
else if (message == kCogBitrateUpdateMessage) else if (message == kCogBitrateUpdateMessage)
@ -311,18 +314,7 @@
[positionSlider setDoubleValue:pos]; [positionSlider setDoubleValue:pos];
} }
NSString *text; [self updateTimeField:pos];
if (showTimeRemaining == NO)
{
int sec = (int)(pos/1000.0);
text = [NSString stringWithFormat:@"%i:%02i", sec/60, sec%60];
}
else
{
int sec = (int)(([positionSlider maxValue] - pos)/1000.0);
text = [NSString stringWithFormat:@"%i:%02i", sec/60, sec%60];
}
[timeField setStringValue:text];
} }
else if (message == kCogStatusUpdateMessage) else if (message == kCogStatusUpdateMessage)
{ {