diff --git a/AppController.m b/AppController.m index ca84b795b..6d20a7611 100644 --- a/AppController.m +++ b/AppController.m @@ -61,7 +61,6 @@ [shuffleButton setToolTip:@"Shuffle mode"]; [repeatButton setToolTip:@"Repeat mode"]; - NSString *filename = @"~/Library/Application Support/Cog/Default.playlist"; [playlistController loadPlaylist:[filename stringByExpandingTildeInPath]]; } diff --git a/Custom/ClickField.h b/Custom/ClickField.h new file mode 100644 index 000000000..a6505e35b --- /dev/null +++ b/Custom/ClickField.h @@ -0,0 +1,10 @@ +/* ClickField */ + +#import +#import "SoundController.h" + +@interface ClickField : NSTextField +{ + IBOutlet SoundController *soundController; +} +@end diff --git a/Custom/ClickField.m b/Custom/ClickField.m new file mode 100644 index 000000000..7e0e1fb2f --- /dev/null +++ b/Custom/ClickField.m @@ -0,0 +1,17 @@ +#import "ClickField.h" + +@implementation ClickField + +- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent { + return YES; +} + +- (void)mouseDown:(NSEvent *)theEvent +{ + if([theEvent type] == NSLeftMouseDown) + { + [soundController toggleShowTimeRemaining:self]; + } +} + +@end diff --git a/Custom/InfoView.h b/Custom/InfoView.h new file mode 100644 index 000000000..946850e29 --- /dev/null +++ b/Custom/InfoView.h @@ -0,0 +1,8 @@ +/* InfoView */ + +#import + +@interface InfoView : NSView +{ +} +@end diff --git a/Custom/InfoView.m b/Custom/InfoView.m new file mode 100644 index 000000000..959fc68ae --- /dev/null +++ b/Custom/InfoView.m @@ -0,0 +1,21 @@ +#import "InfoView.h" + +@implementation InfoView +/* +- (id)initWithFrame:(NSRect)frameRect +{ + if ((self = [super initWithFrame:frameRect]) != nil) { + // Add initialization code here + } + return self; +} + +- (void)drawRect:(NSRect)rect +{ +} +*/ +- (BOOL)isFlipped +{ + return YES; +} +@end diff --git a/Custom/TrackingCell.h b/Custom/TrackingCell.h new file mode 100644 index 000000000..d385c21c0 --- /dev/null +++ b/Custom/TrackingCell.h @@ -0,0 +1,14 @@ +/* TrackingCell */ + +#import + +@interface TrackingCell : NSSliderCell +{ + BOOL tracking; +} + +- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView; +- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)controlView mouseIsUp:(BOOL)flags; +- (BOOL)tracking; + +@end diff --git a/Custom/TrackingCell.m b/Custom/TrackingCell.m new file mode 100644 index 000000000..265789fe7 --- /dev/null +++ b/Custom/TrackingCell.m @@ -0,0 +1,27 @@ +#import "TrackingCell.h" + +@implementation TrackingCell + +- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView +{ +// DBLog(@"TRACKING"); + tracking = YES; + return [super startTrackingAt:startPoint inView:controlView]; + +} + +- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)controlView mouseIsUp:(BOOL)flag +{ +// DBLog(@"NOT TRACKING"); + tracking = NO; + + [super stopTracking:lastPoint at:stopPoint inView:controlView mouseIsUp:flag]; +} + +- (BOOL)tracking +{ + return tracking; +} + + +@end diff --git a/Custom/TrackingSlider.h b/Custom/TrackingSlider.h new file mode 100644 index 000000000..54087843e --- /dev/null +++ b/Custom/TrackingSlider.h @@ -0,0 +1,10 @@ +/* TrackingSlider */ + +#import + +@interface TrackingSlider : NSSlider +{ +} +-(BOOL)tracking; + +@end diff --git a/Custom/TrackingSlider.m b/Custom/TrackingSlider.m new file mode 100644 index 000000000..5427be3dc --- /dev/null +++ b/Custom/TrackingSlider.m @@ -0,0 +1,38 @@ +#import "TrackingSlider.h" +#import "TrackingCell.h" + +@implementation TrackingSlider + +- (id)initWithCoder:(NSCoder *)decoder +{ + self = [super initWithCoder:decoder]; + if (self) + { + if (![[self cell] isKindOfClass:[TrackingCell class]]) + { + TrackingCell *trackingCell; + trackingCell = [[TrackingCell alloc] init]; + + [trackingCell setAction:[[self cell] action]]; + [trackingCell setContinuous:[[self cell] isContinuous]]; + [trackingCell setTarget:[[self cell] target]]; + [self setCell:trackingCell]; + + [trackingCell release]; + } + } + + return self; +} + ++ (Class) cellClass +{ + return [TrackingCell class]; +} + +-(BOOL)tracking +{ + return [[self cell] tracking]; +} + +@end