UI changes

CQTexperiment
vspader 2006-04-28 23:19:14 +00:00
parent 55caf12d9f
commit 307c3fce7b
17 changed files with 206 additions and 34 deletions

View File

@ -50,7 +50,6 @@
- (void)awakeFromNib
{
// DBLog(@"AWAKe");
[playButton setToolTip:NSLocalizedString(@"PlayButtonTooltip", @"")];
[stopButton setToolTip:NSLocalizedString(@"StopButtonTooltip", @"")];
[prevButton setToolTip:NSLocalizedString(@"PrevButtonTooltip", @"")];

View File

@ -1,3 +1,7 @@
0.05
----
Wavpack length should be reported correctly.
0.05 alpha 6
-----------
Updated libsndfile to 1.0.15
@ -79,4 +83,4 @@ Misc UI fixes.
0.01
-----
Initial release.
Initial release.

View File

@ -11,6 +11,10 @@
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
8E30EF600A025FED00E45631 /* RoundBackgroundCell.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8E30EF5E0A025FED00E45631 /* RoundBackgroundCell.h */; };
8E30EF610A025FED00E45631 /* RoundBackgroundCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E30EF5F0A025FED00E45631 /* RoundBackgroundCell.m */; };
8E30EF640A025FFC00E45631 /* RoundBackgroundField.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8E30EF620A025FFC00E45631 /* RoundBackgroundField.h */; };
8E30EF650A025FFC00E45631 /* RoundBackgroundField.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E30EF630A025FFC00E45631 /* RoundBackgroundField.m */; };
8E75756909F31D5A0080F1EE /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E75751909F31D5A0080F1EE /* AppController.m */; };
8E75756A09F31D5A0080F1EE /* ClickField.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E75751C09F31D5A0080F1EE /* ClickField.m */; };
8E75756B09F31D5A0080F1EE /* InfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E75751E09F31D5A0080F1EE /* InfoView.m */; };
@ -49,7 +53,6 @@
8E75758D09F31D5A0080F1EE /* VirtualRingBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E75756809F31D5A0080F1EE /* VirtualRingBuffer.m */; };
8E7575A709F31D800080F1EE /* add_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E75758F09F31D800080F1EE /* add_blue.png */; };
8E7575A809F31D800080F1EE /* add_gray.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E75759009F31D800080F1EE /* add_gray.png */; };
8E7575A909F31D800080F1EE /* bground.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E75759109F31D800080F1EE /* bground.png */; };
8E7575AA09F31D800080F1EE /* info_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E75759209F31D800080F1EE /* info_blue.png */; };
8E7575AB09F31D800080F1EE /* info_gray.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E75759309F31D800080F1EE /* info_gray.png */; };
8E7575AC09F31D800080F1EE /* next_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E75759409F31D800080F1EE /* next_blue.png */; };
@ -66,8 +69,6 @@
8E7575B709F31D800080F1EE /* repeat_on.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E75759F09F31D800080F1EE /* repeat_on.png */; };
8E7575B809F31D800080F1EE /* shuffle_off.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E7575A009F31D800080F1EE /* shuffle_off.png */; };
8E7575B909F31D800080F1EE /* shuffle_on.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E7575A109F31D800080F1EE /* shuffle_on.png */; };
8E7575BA09F31D800080F1EE /* stop_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E7575A209F31D800080F1EE /* stop_blue.png */; };
8E7575BB09F31D800080F1EE /* stop_gray.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E7575A309F31D800080F1EE /* stop_gray.png */; };
8E7575BC09F31D800080F1EE /* volume_high.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E7575A409F31D800080F1EE /* volume_high.png */; };
8E7575BD09F31D800080F1EE /* volume_low.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E7575A509F31D800080F1EE /* volume_low.png */; };
8E7575BE09F31D800080F1EE /* wheel.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E7575A609F31D800080F1EE /* wheel.icns */; };
@ -142,6 +143,8 @@
8E757B5709F326710080F1EE /* OggFLAC.framework in CopyFiles */,
8E757B5809F326710080F1EE /* FAAD2.framework in CopyFiles */,
8E757B5909F326710080F1EE /* DecMPA.framework in CopyFiles */,
8E30EF600A025FED00E45631 /* RoundBackgroundCell.h in CopyFiles */,
8E30EF640A025FFC00E45631 /* RoundBackgroundField.h in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -158,6 +161,10 @@
32CA4F630368D1EE00C91783 /* Cog_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cog_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* Cog.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Cog.app; sourceTree = BUILT_PRODUCTS_DIR; };
8E30EF5E0A025FED00E45631 /* RoundBackgroundCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundBackgroundCell.h; sourceTree = "<group>"; };
8E30EF5F0A025FED00E45631 /* RoundBackgroundCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RoundBackgroundCell.m; sourceTree = "<group>"; };
8E30EF620A025FFC00E45631 /* RoundBackgroundField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundBackgroundField.h; sourceTree = "<group>"; };
8E30EF630A025FFC00E45631 /* RoundBackgroundField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RoundBackgroundField.m; sourceTree = "<group>"; };
8E75751309F31D130080F1EE /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/MainMenu.nib; sourceTree = "<group>"; };
8E75751809F31D5A0080F1EE /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; };
8E75751909F31D5A0080F1EE /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = "<group>"; };
@ -233,7 +240,6 @@
8E75756809F31D5A0080F1EE /* VirtualRingBuffer.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VirtualRingBuffer.m; sourceTree = "<group>"; };
8E75758F09F31D800080F1EE /* add_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = add_blue.png; sourceTree = "<group>"; };
8E75759009F31D800080F1EE /* add_gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = add_gray.png; sourceTree = "<group>"; };
8E75759109F31D800080F1EE /* bground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bground.png; sourceTree = "<group>"; };
8E75759209F31D800080F1EE /* info_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = info_blue.png; sourceTree = "<group>"; };
8E75759309F31D800080F1EE /* info_gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = info_gray.png; sourceTree = "<group>"; };
8E75759409F31D800080F1EE /* next_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = next_blue.png; sourceTree = "<group>"; };
@ -250,8 +256,6 @@
8E75759F09F31D800080F1EE /* repeat_on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = repeat_on.png; sourceTree = "<group>"; };
8E7575A009F31D800080F1EE /* shuffle_off.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = shuffle_off.png; sourceTree = "<group>"; };
8E7575A109F31D800080F1EE /* shuffle_on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = shuffle_on.png; sourceTree = "<group>"; };
8E7575A209F31D800080F1EE /* stop_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = stop_blue.png; sourceTree = "<group>"; };
8E7575A309F31D800080F1EE /* stop_gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = stop_gray.png; sourceTree = "<group>"; };
8E7575A409F31D800080F1EE /* volume_high.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = volume_high.png; sourceTree = "<group>"; };
8E7575A509F31D800080F1EE /* volume_low.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = volume_low.png; sourceTree = "<group>"; };
8E7575A609F31D800080F1EE /* wheel.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = wheel.icns; sourceTree = "<group>"; };
@ -414,6 +418,10 @@
8E75752009F31D5A0080F1EE /* TrackingCell.m */,
8E75752109F31D5A0080F1EE /* TrackingSlider.h */,
8E75752209F31D5A0080F1EE /* TrackingSlider.m */,
8E30EF5E0A025FED00E45631 /* RoundBackgroundCell.h */,
8E30EF5F0A025FED00E45631 /* RoundBackgroundCell.m */,
8E30EF620A025FFC00E45631 /* RoundBackgroundField.h */,
8E30EF630A025FFC00E45631 /* RoundBackgroundField.m */,
);
path = Custom;
sourceTree = "<group>";
@ -526,7 +534,6 @@
children = (
8E75758F09F31D800080F1EE /* add_blue.png */,
8E75759009F31D800080F1EE /* add_gray.png */,
8E75759109F31D800080F1EE /* bground.png */,
8E75759209F31D800080F1EE /* info_blue.png */,
8E75759309F31D800080F1EE /* info_gray.png */,
8E75759409F31D800080F1EE /* next_blue.png */,
@ -543,8 +550,6 @@
8E75759F09F31D800080F1EE /* repeat_on.png */,
8E7575A009F31D800080F1EE /* shuffle_off.png */,
8E7575A109F31D800080F1EE /* shuffle_on.png */,
8E7575A209F31D800080F1EE /* stop_blue.png */,
8E7575A309F31D800080F1EE /* stop_gray.png */,
8E7575A409F31D800080F1EE /* volume_high.png */,
8E7575A509F31D800080F1EE /* volume_low.png */,
8E7575A609F31D800080F1EE /* wheel.icns */,
@ -626,7 +631,6 @@
8E75758709F31D5A0080F1EE /* SOUNDTODO in Resources */,
8E7575A709F31D800080F1EE /* add_blue.png in Resources */,
8E7575A809F31D800080F1EE /* add_gray.png in Resources */,
8E7575A909F31D800080F1EE /* bground.png in Resources */,
8E7575AA09F31D800080F1EE /* info_blue.png in Resources */,
8E7575AB09F31D800080F1EE /* info_gray.png in Resources */,
8E7575AC09F31D800080F1EE /* next_blue.png in Resources */,
@ -643,8 +647,6 @@
8E7575B709F31D800080F1EE /* repeat_on.png in Resources */,
8E7575B809F31D800080F1EE /* shuffle_off.png in Resources */,
8E7575B909F31D800080F1EE /* shuffle_on.png in Resources */,
8E7575BA09F31D800080F1EE /* stop_blue.png in Resources */,
8E7575BB09F31D800080F1EE /* stop_gray.png in Resources */,
8E7575BC09F31D800080F1EE /* volume_high.png in Resources */,
8E7575BD09F31D800080F1EE /* volume_low.png in Resources */,
8E7575BE09F31D800080F1EE /* wheel.icns in Resources */,
@ -703,6 +705,8 @@
8E75758B09F31D5A0080F1EE /* DBLog.m in Sources */,
8E75758C09F31D5A0080F1EE /* Semaphore.m in Sources */,
8E75758D09F31D5A0080F1EE /* VirtualRingBuffer.m in Sources */,
8E30EF610A025FED00E45631 /* RoundBackgroundCell.m in Sources */,
8E30EF650A025FFC00E45631 /* RoundBackgroundField.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -1,10 +1,9 @@
/* ClickField */
#import <Cocoa/Cocoa.h>
#import "SoundController.h"
@interface ClickField : NSTextField
#import "RoundBackgroundField.h"
@interface ClickField : RoundBackgroundField
{
IBOutlet SoundController *soundController;
}
@end

View File

@ -8,8 +8,10 @@
- (void)mouseDown:(NSEvent *)theEvent
{
NSLog(@"MOUSING DOWN");
if([theEvent type] == NSLeftMouseDown)
{
// NSLog(@"SENDING ACTION: %@", [self action]);
[self sendAction:[self action] to:[self target]];
}
}

View File

@ -0,0 +1,16 @@
//
// RoundBackgroundCell.h
// Cog
//
// Created by Zaphod Beeblebrox on 4/28/06.
// Copyright 2006 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface RoundBackgroundCell : NSTextFieldCell {
NSBezierPath *path;
}
@end

View File

@ -0,0 +1,82 @@
//
// BLRoundedTableCell.m
//
// Created by Fraser Speirs on Wed Mar 17 2004.
//
// This code is placed in the public domain.
// It is based on ideas presented by Apple Computer
// in sample code via ADC, extended to suit the context of
// NSTableViewCell
#import "RoundBackgroundCell.h"
@implementation RoundBackgroundCell
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
NSRect labelRect = [self drawingRectForBounds:cellFrame];
float capRadius = NSHeight(labelRect) / 2.0;
// Next, we hack up a slightly different rect for the superclass
// to draw in. This shifts the text to the right out of the
// highlight curve and makes sure the text doesn't jump around
// when the selection changes
float widthIndent = 5.0;
float heightIndent = 2.0;
NSRect newRect = NSMakeRect(cellFrame.origin.x+widthIndent,
cellFrame.origin.y+heightIndent,
cellFrame.size.width-widthIndent,
cellFrame.size.height-heightIndent);
if([self isHighlighted]) {
[super drawInteriorWithFrame: newRect inView: controlView];
}
else {
[super drawInteriorWithFrame: newRect inView: controlView];
NSBezierPath *highlightPath = [[NSBezierPath alloc] init];
NSPoint startPoint = NSMakePoint(labelRect.origin.x+capRadius,
labelRect.origin.y+capRadius);
NSPoint endPoint = NSMakePoint((labelRect.origin.x-capRadius)+(labelRect.size.width),
labelRect.origin.y+capRadius);
[highlightPath appendBezierPathWithArcWithCenter: startPoint
radius: capRadius
startAngle: 90.0f
endAngle: 270.f
clockwise: NO];
[highlightPath appendBezierPathWithArcWithCenter: endPoint
radius: capRadius
startAngle: 270.0f
endAngle: 90.f
clockwise: NO];
[highlightPath closePath];
// Might want to change the text color here
// NSColor *originalTextColor = [self textColor];
if (highlightPath) {
[[self backgroundColor] set];
[highlightPath fill];
NSColor *strokeColor = [NSColor colorWithCalibratedHue:[[self backgroundColor] hueComponent] saturation:[[self backgroundColor] saturationComponent] brightness:[[self backgroundColor] brightnessComponent]-0.2 alpha:[[self backgroundColor] alphaComponent]];
[strokeColor set];
[highlightPath stroke];
[highlightPath release];
}
[super drawInteriorWithFrame: newRect inView: controlView];
// And change it back here
/*
if (originalTextColor) {
[self setTextColor:originalTextColor];
}
*/
}
}
@end

View File

@ -0,0 +1,16 @@
//
// RoundBackgroundField.h
// Cog
//
// Created by Zaphod Beeblebrox on 4/28/06.
// Copyright 2006 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface RoundBackgroundField : NSTextField {
}
@end

View File

@ -0,0 +1,35 @@
//
// RoundBackgroundField.m
// Cog
//
// Created by Zaphod Beeblebrox on 4/28/06.
// Copyright 2006 __MyCompanyName__. All rights reserved.
//
#import "RoundBackgroundField.h"
#import "RoundBackgroundCell.h"
@implementation RoundBackgroundField
- (void)awakeFromNib
{
id cell = [[RoundBackgroundCell alloc] init];
id oldcell = [self cell];
[cell setBackgroundColor: [self backgroundColor]];
[cell setDrawsBackground: NO];
[cell setScrollable:[oldcell isScrollable]];
[cell setAlignment:[oldcell alignment]];
[cell setLineBreakMode:[oldcell lineBreakMode]];
[cell setAction: [oldcell action]];
[cell setTarget: [oldcell target]];
[cell setStringValue: [oldcell stringValue]];
[self setCell: cell];
[cell release];
}
@end

View File

@ -13,8 +13,8 @@
"PrevButtonTooltip" = "Previous";
"NextButtonTooltip" = "Next";
"TimeElapsed" = "Time Elapsed: %i:%02i";
"TimeRemaining" = "Time Remaining: %i:%02i";
"TimeElapsed" = "Time: %i:%02i";
"TimeRemaining" = "Time: -%i:%02i";
"AddButtonTooltip" = "Add files";
"RemoveButtonTooltip" = "Remove selected files";

View File

@ -28,12 +28,7 @@
};
SUPERCLASS = NSObject;
},
{
CLASS = ClickField;
LANGUAGE = ObjC;
OUTLETS = {soundController = SoundController; };
SUPERCLASS = NSTextField;
},
{CLASS = ClickField; LANGUAGE = ObjC; SUPERCLASS = RoundBackgroundField; },
{
CLASS = DNDArrayController;
LANGUAGE = ObjC;
@ -101,6 +96,7 @@
};
SUPERCLASS = NSTableView;
},
{CLASS = RoundBackgroundField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; },
{
ACTIONS = {
changeVolume = id;

View File

@ -3,15 +3,15 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>69 473 617 240 0 0 1024 746 </string>
<string>42 324 617 240 0 0 1024 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>235 637 346 44 0 0 1024 746 </string>
<string>649 654 346 44 0 0 1024 746 </string>
<key>463</key>
<string>336 385 352 268 0 0 1024 746 </string>
<string>336 384 352 268 0 0 1024 746 </string>
<key>513</key>
<string>143 464 125 137 0 0 1024 746 </string>
<string>639 190 125 137 0 0 1024 746 </string>
</dict>
<key>IBFramework Version</key>
<string>443.0</string>
@ -29,9 +29,9 @@
<key>IBOpenObjects</key>
<array>
<integer>21</integer>
<integer>29</integer>
<integer>513</integer>
<integer>463</integer>
<integer>29</integer>
<integer>823</integer>
</array>
<key>IBSystem Version</key>
<string>8I127</string>

Binary file not shown.

View File

@ -13,8 +13,8 @@
"PrevButtonTooltip" = "Morceau précédent";
"NextButtonTooltip" = "Morceau suivant";
"TimeElapsed" = "Temps écoulé: %i:%02i";
"TimeRemaining" = "Temps restant: %i:%02i";
"TimeElapsed" = "Temps: %i:%02i";
"TimeRemaining" = "Temps: -%i:%02i";
"AddButtonTooltip" = "Ajouter des fichiers";
"RemoveButtonTooltip" = "Retirer les fichiers sélectionnés";

Binary file not shown.

View File

@ -12,6 +12,23 @@
@implementation PlaylistView
- (void)awakeFromNib
{
id c;
NSControlSize s = NSSmallControlSize;
NSEnumerator *oe = [[self tableColumns] objectEnumerator];
NSFont *f = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:s]];
[self setRowHeight:[f defaultLineHeightForFont]];
//Resize the fonts
while (c = [oe nextObject])
{
[[c dataCell] setControlSize:s];
[[c dataCell] setFont:f];
}
}
- (BOOL)acceptsFirstResponder
{
return YES;

View File

@ -63,6 +63,8 @@
}
n *= (bitsPerSample/8)*channels;
free(sampleBuf);
return n;
}