Cleaning up and various changes for 0.0.4

CQTexperiment
vspader 2005-06-29 15:53:00 +00:00
parent c7ce4c7501
commit 04643f6d08
9 changed files with 145 additions and 1 deletions

View File

@ -61,7 +61,6 @@
[shuffleButton setToolTip:@"Shuffle mode"];
[repeatButton setToolTip:@"Repeat mode"];
NSString *filename = @"~/Library/Application Support/Cog/Default.playlist";
[playlistController loadPlaylist:[filename stringByExpandingTildeInPath]];
}

10
Custom/ClickField.h Normal file
View File

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

17
Custom/ClickField.m Normal file
View File

@ -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

8
Custom/InfoView.h Normal file
View File

@ -0,0 +1,8 @@
/* InfoView */
#import <Cocoa/Cocoa.h>
@interface InfoView : NSView
{
}
@end

21
Custom/InfoView.m Normal file
View File

@ -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

14
Custom/TrackingCell.h Normal file
View File

@ -0,0 +1,14 @@
/* TrackingCell */
#import <Cocoa/Cocoa.h>
@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

27
Custom/TrackingCell.m Normal file
View File

@ -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

10
Custom/TrackingSlider.h Normal file
View File

@ -0,0 +1,10 @@
/* TrackingSlider */
#import <Cocoa/Cocoa.h>
@interface TrackingSlider : NSSlider
{
}
-(BOOL)tracking;
@end

38
Custom/TrackingSlider.m Normal file
View File

@ -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