Changed year to an NSNumber. Fixed up taglib plugin. Tracks/Years with 0 now show up as nothing.
parent
16ccf5622d
commit
79cd625152
|
@ -79,6 +79,7 @@
|
||||||
17A8F6870D6A7FCA0095DA13 /* repeat_one.png in Resources */ = {isa = PBXBuildFile; fileRef = 17A8F6840D6A7FCA0095DA13 /* repeat_one.png */; };
|
17A8F6870D6A7FCA0095DA13 /* repeat_one.png in Resources */ = {isa = PBXBuildFile; fileRef = 17A8F6840D6A7FCA0095DA13 /* repeat_one.png */; };
|
||||||
17A8F71A0D6A89730095DA13 /* repeat_album.png in Resources */ = {isa = PBXBuildFile; fileRef = 17A8F7190D6A89730095DA13 /* repeat_album.png */; };
|
17A8F71A0D6A89730095DA13 /* repeat_album.png in Resources */ = {isa = PBXBuildFile; fileRef = 17A8F7190D6A89730095DA13 /* repeat_album.png */; };
|
||||||
17B6FA7F0D48225300C3BEF1 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17BF2B270CDD77EB007E1295 /* Sparkle.framework */; };
|
17B6FA7F0D48225300C3BEF1 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17BF2B270CDD77EB007E1295 /* Sparkle.framework */; };
|
||||||
|
17B7DD7D0D7CD10D00320E70 /* BlankZeroFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 17B7DD7C0D7CD10D00320E70 /* BlankZeroFormatter.m */; };
|
||||||
17BB5CED0B8A86010009ACB1 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CEC0B8A86010009ACB1 /* AudioToolbox.framework */; };
|
17BB5CED0B8A86010009ACB1 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CEC0B8A86010009ACB1 /* AudioToolbox.framework */; };
|
||||||
17BB5CF90B8A86350009ACB1 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CF60B8A86350009ACB1 /* AudioUnit.framework */; };
|
17BB5CF90B8A86350009ACB1 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CF60B8A86350009ACB1 /* AudioUnit.framework */; };
|
||||||
17BB5CFA0B8A86350009ACB1 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */; };
|
17BB5CFA0B8A86350009ACB1 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */; };
|
||||||
|
@ -593,6 +594,8 @@
|
||||||
17A8F6830D6A7FCA0095DA13 /* repeat_none.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_none.png; path = Images/repeat_none.png; sourceTree = "<group>"; };
|
17A8F6830D6A7FCA0095DA13 /* repeat_none.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_none.png; path = Images/repeat_none.png; sourceTree = "<group>"; };
|
||||||
17A8F6840D6A7FCA0095DA13 /* repeat_one.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_one.png; path = Images/repeat_one.png; sourceTree = "<group>"; };
|
17A8F6840D6A7FCA0095DA13 /* repeat_one.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_one.png; path = Images/repeat_one.png; sourceTree = "<group>"; };
|
||||||
17A8F7190D6A89730095DA13 /* repeat_album.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_album.png; path = Images/repeat_album.png; sourceTree = "<group>"; };
|
17A8F7190D6A89730095DA13 /* repeat_album.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_album.png; path = Images/repeat_album.png; sourceTree = "<group>"; };
|
||||||
|
17B7DD7B0D7CD10D00320E70 /* BlankZeroFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlankZeroFormatter.h; sourceTree = "<group>"; };
|
||||||
|
17B7DD7C0D7CD10D00320E70 /* BlankZeroFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlankZeroFormatter.m; sourceTree = "<group>"; };
|
||||||
17BB5CEC0B8A86010009ACB1 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
|
17BB5CEC0B8A86010009ACB1 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
|
||||||
17BB5CF60B8A86350009ACB1 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
|
17BB5CF60B8A86350009ACB1 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
|
||||||
17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
|
17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
|
||||||
|
@ -1237,6 +1240,8 @@
|
||||||
17A8F6360D6A7B0F0095DA13 /* RepeatTransformers.m */,
|
17A8F6360D6A7B0F0095DA13 /* RepeatTransformers.m */,
|
||||||
170B55920D6E5E7B006B9E92 /* StatusImageTransformer.h */,
|
170B55920D6E5E7B006B9E92 /* StatusImageTransformer.h */,
|
||||||
170B55930D6E5E7B006B9E92 /* StatusImageTransformer.m */,
|
170B55930D6E5E7B006B9E92 /* StatusImageTransformer.m */,
|
||||||
|
17B7DD7B0D7CD10D00320E70 /* BlankZeroFormatter.h */,
|
||||||
|
17B7DD7C0D7CD10D00320E70 /* BlankZeroFormatter.m */,
|
||||||
);
|
);
|
||||||
path = Playlist;
|
path = Playlist;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -1722,6 +1727,7 @@
|
||||||
171192BD0D691ED600FD76C5 /* PathWatcher.m in Sources */,
|
171192BD0D691ED600FD76C5 /* PathWatcher.m in Sources */,
|
||||||
17A8F6370D6A7B0F0095DA13 /* RepeatTransformers.m in Sources */,
|
17A8F6370D6A7B0F0095DA13 /* RepeatTransformers.m in Sources */,
|
||||||
170B55940D6E5E7B006B9E92 /* StatusImageTransformer.m in Sources */,
|
170B55940D6E5E7B006B9E92 /* StatusImageTransformer.m in Sources */,
|
||||||
|
17B7DD7D0D7CD10D00320E70 /* BlankZeroFormatter.m in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
//
|
||||||
|
// BlankZeroFormatter.h
|
||||||
|
// Cog
|
||||||
|
//
|
||||||
|
// Created by Vincent Spader on 3/3/08.
|
||||||
|
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
|
||||||
|
@interface BlankZeroFormatter : NSObject {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -0,0 +1,50 @@
|
||||||
|
//
|
||||||
|
// BlankZeroFormatter.m
|
||||||
|
// Cog
|
||||||
|
//
|
||||||
|
// Created by Vincent Spader on 3/3/08.
|
||||||
|
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "BlankZeroFormatter.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation BlankZeroFormatter
|
||||||
|
|
||||||
|
- (NSString *) stringForObjectValue:(id)object
|
||||||
|
{
|
||||||
|
NSString *result = nil;
|
||||||
|
int value;
|
||||||
|
|
||||||
|
if(nil == object || NO == [object isKindOfClass:[NSNumber class]]) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = [object intValue];
|
||||||
|
|
||||||
|
if (value)
|
||||||
|
result = [NSString stringWithFormat:@"%i", value];
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) getObjectValue:(id *)object forString:(NSString *)string errorDescription:(NSString **)error
|
||||||
|
{
|
||||||
|
if(NULL != object) {
|
||||||
|
*object = [NSNumber numberWithInt:[string intValue]];
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSAttributedString *) attributedStringForObjectValue:(id)object withDefaultAttributes:(NSDictionary *)attributes
|
||||||
|
{
|
||||||
|
NSAttributedString *result = nil;
|
||||||
|
|
||||||
|
result = [[NSAttributedString alloc] initWithString:[self stringForObjectValue:object] attributes:attributes];
|
||||||
|
return [result autorelease];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -29,7 +29,7 @@
|
||||||
NSString *album;
|
NSString *album;
|
||||||
NSString *title;
|
NSString *title;
|
||||||
NSString *genre;
|
NSString *genre;
|
||||||
NSString *year;
|
NSNumber *year;
|
||||||
NSNumber *track;
|
NSNumber *track;
|
||||||
|
|
||||||
long long totalFrames;
|
long long totalFrames;
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
@property(retain) NSString *album;
|
@property(retain) NSString *album;
|
||||||
@property(retain) NSString *title;
|
@property(retain) NSString *title;
|
||||||
@property(retain) NSString *genre;
|
@property(retain) NSString *genre;
|
||||||
@property(retain) NSString *year;
|
@property(retain) NSNumber *year;
|
||||||
@property(retain) NSNumber *track;
|
@property(retain) NSNumber *track;
|
||||||
|
|
||||||
@property long long totalFrames;
|
@property long long totalFrames;
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
#import "IndexFormatter.h"
|
#import "IndexFormatter.h"
|
||||||
#import "SecondsFormatter.h"
|
#import "SecondsFormatter.h"
|
||||||
|
#import "BlankZeroFormatter.h"
|
||||||
#import "PlaylistEntry.h"
|
#import "PlaylistEntry.h"
|
||||||
|
|
||||||
#import "CogAudio/Status.h"
|
#import "CogAudio/Status.h"
|
||||||
|
@ -53,6 +54,11 @@
|
||||||
NSFormatter *indexFormatter = [[IndexFormatter alloc] init];
|
NSFormatter *indexFormatter = [[IndexFormatter alloc] init];
|
||||||
[[[self tableColumnWithIdentifier:@"index"] dataCell] setFormatter:indexFormatter];
|
[[[self tableColumnWithIdentifier:@"index"] dataCell] setFormatter:indexFormatter];
|
||||||
[indexFormatter release];
|
[indexFormatter release];
|
||||||
|
|
||||||
|
NSFormatter *blankZeroFormatter = [[BlankZeroFormatter alloc] init];
|
||||||
|
[[[self tableColumnWithIdentifier:@"track"] dataCell] setFormatter:blankZeroFormatter];
|
||||||
|
[[[self tableColumnWithIdentifier:@"year"] dataCell] setFormatter:blankZeroFormatter];
|
||||||
|
[blankZeroFormatter release];
|
||||||
//end setting up formatters
|
//end setting up formatters
|
||||||
|
|
||||||
[self setVerticalMotionCanBeginDrag:YES];
|
[self setVerticalMotionCanBeginDrag:YES];
|
||||||
|
|
|
@ -37,23 +37,15 @@
|
||||||
|
|
||||||
if (!pArtist.isNull())
|
if (!pArtist.isNull())
|
||||||
lArtist = [NSString stringWithUTF8String:pArtist.toCString(true)];
|
lArtist = [NSString stringWithUTF8String:pArtist.toCString(true)];
|
||||||
else
|
|
||||||
lArtist = @"";
|
|
||||||
|
|
||||||
if (!pAlbum.isNull())
|
if (!pAlbum.isNull())
|
||||||
lAlbum = [NSString stringWithUTF8String:pAlbum.toCString(true)];
|
lAlbum = [NSString stringWithUTF8String:pAlbum.toCString(true)];
|
||||||
else
|
|
||||||
lAlbum = @"";
|
|
||||||
|
|
||||||
if (!pTitle.isNull())
|
if (!pTitle.isNull())
|
||||||
lTitle = [NSString stringWithUTF8String:pTitle.toCString(true)];
|
lTitle = [NSString stringWithUTF8String:pTitle.toCString(true)];
|
||||||
else
|
|
||||||
lTitle = @"";
|
|
||||||
|
|
||||||
if (!pGenre.isNull())
|
if (!pGenre.isNull())
|
||||||
lGenre = [NSString stringWithUTF8String:pGenre.toCString(true)];
|
lGenre = [NSString stringWithUTF8String:pGenre.toCString(true)];
|
||||||
else
|
|
||||||
lGenre = @"";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +54,7 @@
|
||||||
lTitle, @"title",
|
lTitle, @"title",
|
||||||
lAlbum, @"album",
|
lAlbum, @"album",
|
||||||
lGenre, @"genre",
|
lGenre, @"genre",
|
||||||
[[NSNumber numberWithInt: lYear] stringValue], @"year",
|
[NSNumber numberWithInt: lYear], @"year",
|
||||||
[NSNumber numberWithInt: lTrack], @"track",
|
[NSNumber numberWithInt: lTrack], @"track",
|
||||||
nil];
|
nil];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue