Added now playing spam hotkey, currently format hard coded

CQTexperiment
Chris Moeller 2013-10-04 04:16:09 -07:00
parent a5d8401477
commit 7c5eaed629
11 changed files with 277 additions and 71 deletions

View File

@ -45,6 +45,7 @@
NDHotKeyEvent *playHotKey; NDHotKeyEvent *playHotKey;
NDHotKeyEvent *prevHotKey; NDHotKeyEvent *prevHotKey;
NDHotKeyEvent *nextHotKey; NDHotKeyEvent *nextHotKey;
NDHotKeyEvent *spamHotKey;
AppleRemote *remote; AppleRemote *remote;
BOOL remoteButtonHeld; /* true as long as the user holds the left,right,plus or minus on the remote control */ BOOL remoteButtonHeld; /* true as long as the user holds the left,right,plus or minus on the remote control */
@ -78,6 +79,7 @@ OSStatus handleHotKey(EventHandlerCallRef nextHandler,EventRef theEvent,void *us
- (void)clickPlay; - (void)clickPlay;
- (void)clickPrev; - (void)clickPrev;
- (void)clickNext; - (void)clickNext;
- (void)clickSpam;
- (IBAction)increaseFontSize:(id)sender; - (IBAction)increaseFontSize:(id)sender;
- (IBAction)decreaseFontSize:(id)sender; - (IBAction)decreaseFontSize:(id)sender;

View File

@ -359,6 +359,19 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
[userDefaultsValuesDict setObject:@"albumGainWithPeak" forKey:@"volumeScaling"]; [userDefaultsValuesDict setObject:@"albumGainWithPeak" forKey:@"volumeScaling"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeyPlayKeyCode"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeyPlayCharacter"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeyPlayModifiers"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeyNextKeyCode"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeyNextCharacter"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeyNextModifiers"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeyPreviousKeyCode"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeyPreviousCharacter"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeyPreviousModifiers"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeySpamKeyCode"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeySpamCharacter"];
[userDefaultsValuesDict setObject:[NSNumber numberWithInt:0] forKey:@"hotKeySpamModifiers"];
//Register and sync defaults //Register and sync defaults
[[NSUserDefaults standardUserDefaults] registerDefaults:userDefaultsValuesDict]; [[NSUserDefaults standardUserDefaults] registerDefaults:userDefaultsValuesDict];
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
@ -367,6 +380,8 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.hotKeyPlayKeyCode" options:0 context:nil]; [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.hotKeyPlayKeyCode" options:0 context:nil];
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.hotKeyPreviousKeyCode" options:0 context:nil]; [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.hotKeyPreviousKeyCode" options:0 context:nil];
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.hotKeyNextKeyCode" options:0 context:nil]; [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.hotKeyNextKeyCode" options:0 context:nil];
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self
forKeyPath:@"values.hotKeySpamKeyCode" options:0 context:nil];
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.remoteEnabled" options:0 context:nil]; [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.remoteEnabled" options:0 context:nil];
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.remoteOnlyOnActive" options:0 context:nil]; [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.remoteOnlyOnActive" options:0 context:nil];
@ -386,6 +401,9 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
else if ([keyPath isEqualToString:@"values.hotKeyNextKeyCode"]) { else if ([keyPath isEqualToString:@"values.hotKeyNextKeyCode"]) {
[self registerHotKeys]; [self registerHotKeys];
} }
else if ([keyPath isEqualToString:@"values.hotKeySpamKeyCode"]) {
[self registerHotKeys];
}
else if ([keyPath isEqualToString:@"values.remoteEnabled"] || [keyPath isEqualToString:@"values.remoteOnlyOnActive"]) { else if ([keyPath isEqualToString:@"values.remoteEnabled"] || [keyPath isEqualToString:@"values.remoteOnlyOnActive"]) {
if([[NSUserDefaults standardUserDefaults] boolForKey:@"remoteEnabled"]) { if([[NSUserDefaults standardUserDefaults] boolForKey:@"remoteEnabled"]) {
BOOL onlyOnActive = [[NSUserDefaults standardUserDefaults] boolForKey:@"remoteOnlyOnActive"]; BOOL onlyOnActive = [[NSUserDefaults standardUserDefaults] boolForKey:@"remoteOnlyOnActive"];
@ -405,33 +423,48 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
- (void)registerHotKeys - (void)registerHotKeys
{ {
[playHotKey release]; [playHotKey release];
if ([[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPlayKeyCode"] intValue]) {
playHotKey = [[NDHotKeyEvent alloc] playHotKey = [[NDHotKeyEvent alloc]
initWithKeyCode: [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPlayKeyCode"] intValue] initWithKeyCode: [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPlayKeyCode"] intValue]
character: [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPlayCharacter"] intValue] character: [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPlayCharacter"] intValue]
modifierFlags: [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPlayModifiers"] intValue] modifierFlags: [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPlayModifiers"] intValue]
]; ];
[playHotKey setTarget:self selector:@selector(clickPlay)];
[playHotKey setEnabled:YES];
}
[prevHotKey release]; [prevHotKey release];
if ([[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPreviousKeyCode"] intValue]) {
prevHotKey = [[NDHotKeyEvent alloc] prevHotKey = [[NDHotKeyEvent alloc]
initWithKeyCode: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyPreviousKeyCode"] initWithKeyCode: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyPreviousKeyCode"]
character: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyPreviousCharacter"] character: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyPreviousCharacter"]
modifierFlags: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyPreviousModifiers"] modifierFlags: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyPreviousModifiers"]
]; ];
[prevHotKey setTarget:self selector:@selector(clickPrev)];
[prevHotKey setEnabled:YES];
}
[nextHotKey release]; [nextHotKey release];
if ([[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyNextKeyCode"] intValue]) {
nextHotKey = [[NDHotKeyEvent alloc] nextHotKey = [[NDHotKeyEvent alloc]
initWithKeyCode: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyNextKeyCode"] initWithKeyCode: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyNextKeyCode"]
character: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyNextCharacter"] character: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyNextCharacter"]
modifierFlags: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyNextModifiers"] modifierFlags: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyNextModifiers"]
]; ];
[nextHotKey setTarget:self selector:@selector(clickNext)];
[nextHotKey setEnabled:YES];
}
[playHotKey setTarget:self selector:@selector(clickPlay)]; [spamHotKey release];
[prevHotKey setTarget:self selector:@selector(clickPrev)]; if ([[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeySpamKeyCode"] intValue]) {
[nextHotKey setTarget:self selector:@selector(clickNext)]; spamHotKey = [[NDHotKeyEvent alloc]
initWithKeyCode: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeySpamKeyCode"]
[playHotKey setEnabled:YES]; character: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeySpamCharacter"]
[prevHotKey setEnabled:YES]; modifierFlags: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeySpamModifiers"]
[nextHotKey setEnabled:YES]; ];
[spamHotKey setTarget:self selector:@selector(clickSpam)];
[spamHotKey setEnabled:YES];
}
} }
- (void)clickPlay - (void)clickPlay
@ -449,6 +482,11 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
[playbackController next:nil]; [playbackController next:nil];
} }
- (void)clickSpam
{
[playbackController spam];
}
- (void)changeFontSize:(float)size - (void)changeFontSize:(float)size
{ {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

View File

@ -63,6 +63,8 @@ extern NSDictionary * makeRGInfo(PlaylistEntry *pe);
- (void)seekBackward:(double)amount; - (void)seekBackward:(double)amount;
- (IBAction)fade:(id)sender; - (IBAction)fade:(id)sender;
- (IBAction)spam;
- (void)initDefaults; - (void)initDefaults;
- (void)audioFadeDown:(NSTimer *)audioTimer; - (void)audioFadeDown:(NSTimer *)audioTimer;
- (void)audioFadeUp:(NSTimer *)audioTimer; - (void)audioFadeUp:(NSTimer *)audioTimer;

View File

@ -170,6 +170,8 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
double pos = [audioPlayer amountPlayed]; double pos = [audioPlayer amountPlayed];
[self setPosition:pos]; [self setPosition:pos];
[[playlistController currentEntry] setCurrentPosition:pos];
} }
- (IBAction)seek:(id)sender - (IBAction)seek:(id)sender
@ -178,6 +180,16 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
[audioPlayer seekToTime:time]; [audioPlayer seekToTime:time];
[[playlistController currentEntry] setCurrentPosition:time];
}
- (IBAction)spam
{
NSPasteboard *pboard = [NSPasteboard generalPasteboard];
[pboard clearContents];
[pboard writeObjects:[NSArray arrayWithObjects:[[playlistController currentEntry] spam], nil]];
} }
- (IBAction)eventSeekForward:(id)sender - (IBAction)eventSeekForward:(id)sender
@ -514,6 +526,8 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
- (void)setPosition:(double)p - (void)setPosition:(double)p
{ {
position = p; position = p;
[[playlistController currentEntry] setCurrentPosition:p];
} }
- (double)position - (double)position

View File

@ -18,6 +18,9 @@
"RepeatButtonTooltip" = "Repeat mode"; "RepeatButtonTooltip" = "Repeat mode";
"FileButtonTooltip" = "File drawer"; "FileButtonTooltip" = "File drawer";
"replayGainAlbumGain" = "The volume level of playback output will be detected through enumeration, \
re";
"InvalidURLShort" = "Invalid URL"; "InvalidURLShort" = "Invalid URL";
"InvalidURLLong" = "The URL is not valid."; "InvalidURLLong" = "The URL is not valid.";

View File

@ -68,12 +68,12 @@
</textFieldCell> </textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections> <connections>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1913"/>
<binding destination="218" name="value" keyPath="arrangedObjects.index" id="1356"> <binding destination="218" name="value" keyPath="arrangedObjects.index" id="1356">
<dictionary key="options"> <dictionary key="options">
<integer key="NSConditionallySetsEditable" value="1"/> <integer key="NSConditionallySetsEditable" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1913"/>
</connections> </connections>
</tableColumn> </tableColumn>
<tableColumn identifier="status" editable="NO" width="20" minWidth="20" maxWidth="20" id="1798"> <tableColumn identifier="status" editable="NO" width="20" minWidth="20" maxWidth="20" id="1798">
@ -82,7 +82,7 @@
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell> </tableHeaderCell>
<imageCell key="dataCell" controlSize="small" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="E59717AB-CA52-4004-BC9D-131D5E3B8DF4" id="1801"> <imageCell key="dataCell" controlSize="small" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="F80A8C12-27F0-4575-9C0A-CE9017032213" id="1801">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
</imageCell> </imageCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
@ -109,12 +109,12 @@
<sortDescriptor key="sortDescriptorPrototype" selector="caseInsensitiveCompare:" sortKey="title"/> <sortDescriptor key="sortDescriptorPrototype" selector="caseInsensitiveCompare:" sortKey="title"/>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections> <connections>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1914"/>
<binding destination="218" name="value" keyPath="arrangedObjects.title" id="814"> <binding destination="218" name="value" keyPath="arrangedObjects.title" id="814">
<dictionary key="options"> <dictionary key="options">
<integer key="NSConditionallySetsEditable" value="1"/> <integer key="NSConditionallySetsEditable" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1914"/>
</connections> </connections>
</tableColumn> </tableColumn>
<tableColumn identifier="artist" editable="NO" width="90" minWidth="36" maxWidth="1000" id="391"> <tableColumn identifier="artist" editable="NO" width="90" minWidth="36" maxWidth="1000" id="391">
@ -131,12 +131,12 @@
<sortDescriptor key="sortDescriptorPrototype" selector="caseInsensitiveCompare:" sortKey="artist"/> <sortDescriptor key="sortDescriptorPrototype" selector="caseInsensitiveCompare:" sortKey="artist"/>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections> <connections>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1916"/>
<binding destination="218" name="value" keyPath="arrangedObjects.artist" id="815"> <binding destination="218" name="value" keyPath="arrangedObjects.artist" id="815">
<dictionary key="options"> <dictionary key="options">
<integer key="NSConditionallySetsEditable" value="1"/> <integer key="NSConditionallySetsEditable" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1916"/>
</connections> </connections>
</tableColumn> </tableColumn>
<tableColumn identifier="album" editable="NO" width="97" minWidth="39" maxWidth="1000" id="806"> <tableColumn identifier="album" editable="NO" width="97" minWidth="39" maxWidth="1000" id="806">
@ -153,12 +153,12 @@
<sortDescriptor key="sortDescriptorPrototype" selector="caseInsensitiveCompare:" sortKey="album"/> <sortDescriptor key="sortDescriptorPrototype" selector="caseInsensitiveCompare:" sortKey="album"/>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections> <connections>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1917"/>
<binding destination="218" name="value" keyPath="arrangedObjects.album" id="816"> <binding destination="218" name="value" keyPath="arrangedObjects.album" id="816">
<dictionary key="options"> <dictionary key="options">
<integer key="NSConditionallySetsEditable" value="1"/> <integer key="NSConditionallySetsEditable" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1917"/>
</connections> </connections>
</tableColumn> </tableColumn>
<tableColumn identifier="length" editable="NO" width="105.62009999999999" minWidth="40.62012" maxWidth="1000" id="807"> <tableColumn identifier="length" editable="NO" width="105.62009999999999" minWidth="40.62012" maxWidth="1000" id="807">
@ -174,12 +174,12 @@
</textFieldCell> </textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections> <connections>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1919"/>
<binding destination="218" name="value" keyPath="arrangedObjects.length" id="1658"> <binding destination="218" name="value" keyPath="arrangedObjects.length" id="1658">
<dictionary key="options"> <dictionary key="options">
<integer key="NSConditionallySetsEditable" value="1"/> <integer key="NSConditionallySetsEditable" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1919"/>
</connections> </connections>
</tableColumn> </tableColumn>
<tableColumn identifier="year" editable="NO" width="77" minWidth="10" maxWidth="1000" id="848"> <tableColumn identifier="year" editable="NO" width="77" minWidth="10" maxWidth="1000" id="848">
@ -195,8 +195,8 @@
</textFieldCell> </textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections> <connections>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1921"/>
<binding destination="218" name="value" keyPath="arrangedObjects.year" id="851"/> <binding destination="218" name="value" keyPath="arrangedObjects.year" id="851"/>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1921"/>
</connections> </connections>
</tableColumn> </tableColumn>
<tableColumn identifier="genre" editable="NO" width="83" minWidth="10" maxWidth="1000" id="849"> <tableColumn identifier="genre" editable="NO" width="83" minWidth="10" maxWidth="1000" id="849">
@ -213,8 +213,8 @@
<sortDescriptor key="sortDescriptorPrototype" selector="caseInsensitiveCompare:" sortKey="genre"/> <sortDescriptor key="sortDescriptorPrototype" selector="caseInsensitiveCompare:" sortKey="genre"/>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections> <connections>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1922"/>
<binding destination="218" name="value" keyPath="arrangedObjects.genre" id="852"/> <binding destination="218" name="value" keyPath="arrangedObjects.genre" id="852"/>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1922"/>
</connections> </connections>
</tableColumn> </tableColumn>
<tableColumn identifier="track" editable="NO" width="74" minWidth="4" maxWidth="1000" id="850"> <tableColumn identifier="track" editable="NO" width="74" minWidth="4" maxWidth="1000" id="850">
@ -230,8 +230,8 @@
</textFieldCell> </textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections> <connections>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1923"/>
<binding destination="218" name="value" keyPath="arrangedObjects.track" id="853"/> <binding destination="218" name="value" keyPath="arrangedObjects.track" id="853"/>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1923"/>
</connections> </connections>
</tableColumn> </tableColumn>
<tableColumn identifier="path" editable="NO" width="57" minWidth="10" maxWidth="3.4028229999999999e+38" hidden="YES" id="1712"> <tableColumn identifier="path" editable="NO" width="57" minWidth="10" maxWidth="3.4028229999999999e+38" hidden="YES" id="1712">
@ -247,12 +247,12 @@
</textFieldCell> </textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections> <connections>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1924"/>
<binding destination="218" name="value" keyPath="arrangedObjects.path" id="1788"> <binding destination="218" name="value" keyPath="arrangedObjects.path" id="1788">
<dictionary key="options"> <dictionary key="options">
<integer key="NSConditionallySetsEditable" value="1"/> <integer key="NSConditionallySetsEditable" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1924"/>
</connections> </connections>
</tableColumn> </tableColumn>
<tableColumn identifier="filename" editable="NO" width="57" minWidth="10" maxWidth="3.4028229999999999e+38" hidden="YES" id="1736"> <tableColumn identifier="filename" editable="NO" width="57" minWidth="10" maxWidth="3.4028229999999999e+38" hidden="YES" id="1736">
@ -268,12 +268,12 @@
</textFieldCell> </textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections> <connections>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1925"/>
<binding destination="218" name="value" keyPath="arrangedObjects.filename" id="1787"> <binding destination="218" name="value" keyPath="arrangedObjects.filename" id="1787">
<dictionary key="options"> <dictionary key="options">
<integer key="NSConditionallySetsEditable" value="1"/> <integer key="NSConditionallySetsEditable" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
<binding destination="1689" name="fontSize" keyPath="values.fontSize" id="1925"/>
</connections> </connections>
</tableColumn> </tableColumn>
</tableColumns> </tableColumns>
@ -333,6 +333,12 @@
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<connections> <connections>
<binding destination="218" name="predicate" keyPath="filterPredicate" id="1576">
<dictionary key="options">
<string key="NSDisplayName">All</string>
<string key="NSPredicateFormat">(title contains[cd] $value) OR (artist contains[cd] $value) OR (album contains[cd] $value) OR (genre contains[cd] $value)</string>
</dictionary>
</binding>
<binding destination="218" name="predicate2" keyPath="filterPredicate" previousBinding="1576" id="1578"> <binding destination="218" name="predicate2" keyPath="filterPredicate" previousBinding="1576" id="1578">
<dictionary key="options"> <dictionary key="options">
<string key="NSDisplayName">Title</string> <string key="NSDisplayName">Title</string>
@ -347,26 +353,20 @@
</binding> </binding>
<binding destination="218" name="predicate4" keyPath="filterPredicate" previousBinding="1580" id="1582"> <binding destination="218" name="predicate4" keyPath="filterPredicate" previousBinding="1580" id="1582">
<dictionary key="options"> <dictionary key="options">
<integer key="NSRaisesForNotApplicableKeys" value="1"/>
<integer key="NSValidatesImmediately" value="0"/> <integer key="NSValidatesImmediately" value="0"/>
<string key="NSPredicateFormat">artist contains[cd] $value</string>
<integer key="NSAlwaysPresentsApplicationModalAlerts" value="0"/> <integer key="NSAlwaysPresentsApplicationModalAlerts" value="0"/>
<string key="NSPredicateFormat">artist contains[cd] $value</string>
<string key="NSDisplayName">Album</string> <string key="NSDisplayName">Album</string>
<integer key="NSRaisesForNotApplicableKeys" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
<binding destination="218" name="predicate5" keyPath="filterPredicate" previousBinding="1582" id="1583"> <binding destination="218" name="predicate5" keyPath="filterPredicate" previousBinding="1582" id="1583">
<dictionary key="options"> <dictionary key="options">
<integer key="NSRaisesForNotApplicableKeys" value="1"/>
<integer key="NSValidatesImmediately" value="0"/> <integer key="NSValidatesImmediately" value="0"/>
<string key="NSPredicateFormat">genre contains[cd] $value</string>
<integer key="NSAlwaysPresentsApplicationModalAlerts" value="0"/> <integer key="NSAlwaysPresentsApplicationModalAlerts" value="0"/>
<string key="NSPredicateFormat">genre contains[cd] $value</string>
<string key="NSDisplayName">Genre</string> <string key="NSDisplayName">Genre</string>
</dictionary> <integer key="NSRaisesForNotApplicableKeys" value="1"/>
</binding>
<binding destination="218" name="predicate" keyPath="filterPredicate" id="1576">
<dictionary key="options">
<string key="NSDisplayName">All</string>
<string key="NSPredicateFormat">(title contains[cd] $value) OR (artist contains[cd] $value) OR (album contains[cd] $value) OR (genre contains[cd] $value)</string>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -383,7 +383,7 @@
<segmentedCell key="cell" state="on" alignment="left" style="automatic" trackingMode="momentary" id="1538"> <segmentedCell key="cell" state="on" alignment="left" style="automatic" trackingMode="momentary" id="1538">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<segments> <segments>
<segment toolTip="Previous" image="previous" width="24"/> <segment toolTip="Previous" image="previous" width="24" selected="YES"/>
<segment toolTip="Play" image="play" width="24" tag="1"/> <segment toolTip="Play" image="play" width="24" tag="1"/>
<segment toolTip="Next" image="next" width="24"/> <segment toolTip="Next" image="next" width="24"/>
</segments> </segments>
@ -408,13 +408,13 @@
</sliderCell> </sliderCell>
<connections> <connections>
<action selector="seek:" target="705" id="1597"/> <action selector="seek:" target="705" id="1597"/>
<binding destination="705" name="enabled" keyPath="seekable" id="2376"/>
<binding destination="1897" name="maxValue" keyPath="content.length" id="2377"> <binding destination="1897" name="maxValue" keyPath="content.length" id="2377">
<dictionary key="options"> <dictionary key="options">
<bool key="NSRaisesForNotApplicableKeys" value="NO"/> <bool key="NSRaisesForNotApplicableKeys" value="NO"/>
</dictionary> </dictionary>
</binding> </binding>
<binding destination="705" name="value" keyPath="position" previousBinding="2377" id="2378"/> <binding destination="705" name="value" keyPath="position" previousBinding="2377" id="2378"/>
<binding destination="705" name="enabled" keyPath="seekable" id="2376"/>
<outlet property="positionTextField" destination="1566" id="2385"/> <outlet property="positionTextField" destination="1566" id="2385"/>
</connections> </connections>
</slider> </slider>
@ -572,14 +572,14 @@
<toolbarItem implicitItemIdentifier="6F5A6C43-A09C-462A-AEE2-C86DC3C55128" label="Playback Buttons" paletteLabel="Playback Buttons" id="2272"> <toolbarItem implicitItemIdentifier="6F5A6C43-A09C-462A-AEE2-C86DC3C55128" label="Playback Buttons" paletteLabel="Playback Buttons" id="2272">
<nil key="toolTip"/> <nil key="toolTip"/>
<size key="minSize" width="80" height="24"/> <size key="minSize" width="80" height="24"/>
<size key="maxSize" width="80" height="24"/> <size key="maxSize" width="80" height="25"/>
<segmentedControl key="view" verticalHuggingPriority="750" id="2295" customClass="PlaybackButtons"> <segmentedControl key="view" verticalHuggingPriority="750" id="2295" customClass="PlaybackButtons">
<rect key="frame" x="9" y="14" width="80" height="24"/> <rect key="frame" x="9" y="14" width="80" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<segmentedCell key="cell" state="on" alignment="left" style="automatic" trackingMode="momentary" id="2296"> <segmentedCell key="cell" state="on" alignment="left" style="automatic" trackingMode="momentary" id="2296">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<segments> <segments>
<segment toolTip="Previous" image="previous" width="24"/> <segment toolTip="Previous" image="previous" width="24" selected="YES"/>
<segment toolTip="Play" image="play" width="24" tag="1"/> <segment toolTip="Play" image="play" width="24" tag="1"/>
<segment toolTip="Next" image="next" width="24"/> <segment toolTip="Next" image="next" width="24"/>
</segments> </segments>
@ -601,9 +601,9 @@
</sliderCell> </sliderCell>
<connections> <connections>
<action selector="seek:" target="705" id="2387"/> <action selector="seek:" target="705" id="2387"/>
<binding destination="705" name="enabled" keyPath="seekable" id="2384"/>
<binding destination="1897" name="maxValue" keyPath="content.length" id="2381"/> <binding destination="1897" name="maxValue" keyPath="content.length" id="2381"/>
<binding destination="705" name="value" keyPath="position" previousBinding="2381" id="2382"/> <binding destination="705" name="value" keyPath="position" previousBinding="2381" id="2382"/>
<binding destination="705" name="enabled" keyPath="seekable" id="2384"/>
<outlet property="positionTextField" destination="2291" id="2386"/> <outlet property="positionTextField" destination="2291" id="2386"/>
</connections> </connections>
</slider> </slider>
@ -685,7 +685,7 @@
<size key="minSize" width="24" height="25"/> <size key="minSize" width="24" height="25"/>
<size key="maxSize" width="24" height="25"/> <size key="maxSize" width="24" height="25"/>
<button key="view" verticalHuggingPriority="750" id="2430"> <button key="view" verticalHuggingPriority="750" id="2430">
<rect key="frame" x="23" y="14" width="24" height="25"/> <rect key="frame" x="29" y="14" width="24" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="info_off" imagePosition="only" alignment="center" borderStyle="border" id="2431"> <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="info_off" imagePosition="only" alignment="center" borderStyle="border" id="2431">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@ -1042,8 +1042,8 @@
<string key="NSValueTransformerName">NSIsNotNil</string> <string key="NSValueTransformerName">NSIsNotNil</string>
<integer key="NSNotApplicablePlaceholder" value="0"/> <integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNoSelectionPlaceholder" value="0"/> <integer key="NSNoSelectionPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/> <integer key="NSNullPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -1093,8 +1093,8 @@ CA
<string key="NSValueTransformerName">NSIsNotNil</string> <string key="NSValueTransformerName">NSIsNotNil</string>
<integer key="NSNotApplicablePlaceholder" value="0"/> <integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNoSelectionPlaceholder" value="0"/> <integer key="NSNoSelectionPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="1"/>
<integer key="NSNullPlaceholder" value="0"/> <integer key="NSNullPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -1128,13 +1128,13 @@ CA
<connections> <connections>
<binding destination="218" name="value" keyPath="repeat" id="1760"> <binding destination="218" name="value" keyPath="repeat" id="1760">
<dictionary key="options"> <dictionary key="options">
<integer key="NSAlwaysPresentsApplicationModalAlerts" value="0"/>
<integer key="NSConditionallySetsEnabled" value="0"/> <integer key="NSConditionallySetsEnabled" value="0"/>
<integer key="NSRaisesForNotApplicableKeys" value="1"/> <integer key="NSAlwaysPresentsApplicationModalAlerts" value="0"/>
<integer key="NSAllowsEditingMultipleValuesSelection" value="0"/>
<string key="NSValueTransformerName">RepeatAllTransformer</string> <string key="NSValueTransformerName">RepeatAllTransformer</string>
<integer key="NSConditionallySetsHidden" value="0"/> <integer key="NSConditionallySetsHidden" value="0"/>
<integer key="NSValidatesImmediately" value="0"/> <integer key="NSValidatesImmediately" value="0"/>
<integer key="NSAllowsEditingMultipleValuesSelection" value="0"/> <integer key="NSRaisesForNotApplicableKeys" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -1154,13 +1154,13 @@ CA
<connections> <connections>
<binding destination="218" name="value" keyPath="repeat" id="1763"> <binding destination="218" name="value" keyPath="repeat" id="1763">
<dictionary key="options"> <dictionary key="options">
<integer key="NSAlwaysPresentsApplicationModalAlerts" value="0"/>
<integer key="NSConditionallySetsEnabled" value="0"/> <integer key="NSConditionallySetsEnabled" value="0"/>
<integer key="NSRaisesForNotApplicableKeys" value="1"/> <integer key="NSAlwaysPresentsApplicationModalAlerts" value="0"/>
<integer key="NSAllowsEditingMultipleValuesSelection" value="0"/>
<string key="NSValueTransformerName">RepeatOneTransformer</string> <string key="NSValueTransformerName">RepeatOneTransformer</string>
<integer key="NSConditionallySetsHidden" value="0"/> <integer key="NSConditionallySetsHidden" value="0"/>
<integer key="NSValidatesImmediately" value="0"/> <integer key="NSValidatesImmediately" value="0"/>
<integer key="NSAllowsEditingMultipleValuesSelection" value="0"/> <integer key="NSRaisesForNotApplicableKeys" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -1172,13 +1172,13 @@ CA
<connections> <connections>
<binding destination="218" name="value" keyPath="repeat" id="1767"> <binding destination="218" name="value" keyPath="repeat" id="1767">
<dictionary key="options"> <dictionary key="options">
<integer key="NSAlwaysPresentsApplicationModalAlerts" value="0"/>
<integer key="NSConditionallySetsEnabled" value="0"/> <integer key="NSConditionallySetsEnabled" value="0"/>
<integer key="NSRaisesForNotApplicableKeys" value="1"/> <integer key="NSAlwaysPresentsApplicationModalAlerts" value="0"/>
<integer key="NSAllowsEditingMultipleValuesSelection" value="0"/>
<string key="NSValueTransformerName">RepeatNoneTransformer</string> <string key="NSValueTransformerName">RepeatNoneTransformer</string>
<integer key="NSConditionallySetsHidden" value="0"/> <integer key="NSConditionallySetsHidden" value="0"/>
<integer key="NSValidatesImmediately" value="0"/> <integer key="NSValidatesImmediately" value="0"/>
<integer key="NSAllowsEditingMultipleValuesSelection" value="0"/> <integer key="NSRaisesForNotApplicableKeys" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -1386,11 +1386,11 @@ Gw
<connections> <connections>
<binding destination="1897" name="title" keyPath="content.artist" id="2085"> <binding destination="1897" name="title" keyPath="content.artist" id="2085">
<dictionary key="options"> <dictionary key="options">
<integer key="NSRaisesForNotApplicableKeys" value="1"/> <string key="NSMultipleValuesPlaceholder"></string>
<string key="NSNotApplicablePlaceholder"></string> <string key="NSNotApplicablePlaceholder"></string>
<string key="NSNoSelectionPlaceholder"></string> <string key="NSNoSelectionPlaceholder"></string>
<string key="NSMultipleValuesPlaceholder"></string>
<string key="NSNullPlaceholder">Not Playing</string> <string key="NSNullPlaceholder">Not Playing</string>
<integer key="NSRaisesForNotApplicableKeys" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -1400,11 +1400,11 @@ Gw
<connections> <connections>
<binding destination="1897" name="title" keyPath="content.title" id="2083"> <binding destination="1897" name="title" keyPath="content.title" id="2083">
<dictionary key="options"> <dictionary key="options">
<integer key="NSRaisesForNotApplicableKeys" value="1"/> <string key="NSMultipleValuesPlaceholder"></string>
<string key="NSNotApplicablePlaceholder"></string> <string key="NSNotApplicablePlaceholder"></string>
<string key="NSNoSelectionPlaceholder"></string> <string key="NSNoSelectionPlaceholder"></string>
<string key="NSMultipleValuesPlaceholder"></string>
<string key="NSNullPlaceholder">Not Playing</string> <string key="NSNullPlaceholder">Not Playing</string>
<integer key="NSRaisesForNotApplicableKeys" value="1"/>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -1503,8 +1503,8 @@ Gw
<string key="NSValueTransformerName">NSIsNotNil</string> <string key="NSValueTransformerName">NSIsNotNil</string>
<integer key="NSNotApplicablePlaceholder" value="0"/> <integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNoSelectionPlaceholder" value="0"/> <integer key="NSNoSelectionPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/> <integer key="NSNullPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -1518,8 +1518,8 @@ Gw
<string key="NSValueTransformerName">NSIsNotNil</string> <string key="NSValueTransformerName">NSIsNotNil</string>
<integer key="NSNotApplicablePlaceholder" value="0"/> <integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNoSelectionPlaceholder" value="0"/> <integer key="NSNoSelectionPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/> <integer key="NSNullPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -1536,8 +1536,8 @@ Gw
<string key="NSValueTransformerName">NSIsNotNil</string> <string key="NSValueTransformerName">NSIsNotNil</string>
<integer key="NSNotApplicablePlaceholder" value="0"/> <integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNoSelectionPlaceholder" value="0"/> <integer key="NSNoSelectionPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/> <integer key="NSNullPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -1551,8 +1551,8 @@ Gw
<string key="NSValueTransformerName">NSIsNotNil</string> <string key="NSValueTransformerName">NSIsNotNil</string>
<integer key="NSNotApplicablePlaceholder" value="0"/> <integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNoSelectionPlaceholder" value="0"/> <integer key="NSNoSelectionPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/> <integer key="NSNullPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
</dictionary> </dictionary>
</binding> </binding>
</connections> </connections>
@ -1585,7 +1585,7 @@ Gw
<slider horizontalHuggingPriority="750" id="1612" customClass="VolumeSlider"> <slider horizontalHuggingPriority="750" id="1612" customClass="VolumeSlider">
<rect key="frame" x="43" y="39" width="15" height="120"/> <rect key="frame" x="43" y="39" width="15" height="120"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<sliderCell key="cell" controlSize="small" continuous="YES" alignment="left" maxValue="100" doubleValue="100" tickMarkPosition="right" sliderType="linear" id="1613"> <sliderCell key="cell" controlSize="small" continuous="YES" alignment="left" maxValue="100" doubleValue="100" tickMarkPosition="left" sliderType="linear" id="1613">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
</sliderCell> </sliderCell>
<connections> <connections>
@ -1642,7 +1642,7 @@ Gw
<customObject id="2434" customClass="FeedbackController"/> <customObject id="2434" customClass="FeedbackController"/>
</objects> </objects>
<resources> <resources>
<image name="E59717AB-CA52-4004-BC9D-131D5E3B8DF4" width="17" height="17"> <image name="F80A8C12-27F0-4575-9C0A-CE9017032213" width="17" height="17">
<mutableData key="keyedArchiveRepresentation"> <mutableData key="keyedArchiveRepresentation">
YnBsaXN0MDDUAQIDBAUGRkdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QDwcI YnBsaXN0MDDUAQIDBAUGRkdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QDwcI
ExQZHh8qKyw0NzpAQ1UkbnVsbNUJCgsMDQ4PEBESVk5TU2l6ZVYkY2xhc3NcTlNJbWFnZUZsYWdzVk5T ExQZHh8qKyw0NzpAQ1UkbnVsbNUJCgsMDQ4PEBESVk5TU2l6ZVYkY2xhc3NcTlNJbWFnZUZsYWdzVk5T

View File

@ -39,6 +39,8 @@
float replayGainTrackPeak; float replayGainTrackPeak;
float volume; float volume;
double currentPosition;
long long totalFrames; long long totalFrames;
int bitrate; int bitrate;
int channels; int channels;
@ -58,12 +60,15 @@
+ (NSSet *)keyPathsForValuesAffectingFilename; + (NSSet *)keyPathsForValuesAffectingFilename;
+ (NSSet *)keyPathsForValuesAffectingStatus; + (NSSet *)keyPathsForValuesAffectingStatus;
+ (NSSet *)keyPathsForValuesAffectingStatusMessage; + (NSSet *)keyPathsForValuesAffectingStatusMessage;
+ (NSSet *)keyPathsForValuesAffectingSpam;
@property(readonly) NSString *display; @property(readonly) NSString *display;
@property(retain, readonly) NSNumber *length; @property(retain, readonly) NSNumber *length;
@property(readonly) NSString *path; @property(readonly) NSString *path;
@property(readonly) NSString *filename; @property(readonly) NSString *filename;
@property(readonly) NSString *spam;
@property int index; @property int index;
@property int shuffleIndex; @property int shuffleIndex;
@ -103,6 +108,8 @@
@property float replayGainTrackPeak; @property float replayGainTrackPeak;
@property float volume; @property float volume;
@property double currentPosition;
@property(retain) NSString *endian; @property(retain) NSString *endian;
@property BOOL seekable; @property BOOL seekable;

View File

@ -7,6 +7,7 @@
// //
#import "PlaylistEntry.h" #import "PlaylistEntry.h"
#import "SecondsFormatter.h"
@implementation PlaylistEntry @implementation PlaylistEntry
@ -45,6 +46,8 @@
@synthesize replayGainTrackPeak; @synthesize replayGainTrackPeak;
@synthesize volume; @synthesize volume;
@synthesize currentPosition;
@synthesize endian; @synthesize endian;
@synthesize seekable; @synthesize seekable;
@ -83,6 +86,11 @@
return [NSSet setWithObjects:@"current", @"queued", @"queuePosition", @"error", @"errorMessage", @"stopAfter", nil]; return [NSSet setWithObjects:@"current", @"queued", @"queuePosition", @"error", @"errorMessage", @"stopAfter", nil];
} }
+ (NSSet *)keyPathsForValuesAffectingSpam
{
return [NSSet setWithObjects:@"artist", @"title", @"album", @"track", @"totalFrames", @"currentPosition", @"bitrate", nil];
}
- (NSString *)description - (NSString *)description
{ {
return [NSString stringWithFormat:@"PlaylistEntry %i:(%@)", self.index, self.URL]; return [NSString stringWithFormat:@"PlaylistEntry %i:(%@)", self.index, self.URL];
@ -140,6 +148,86 @@
} }
} }
@dynamic spam;
- (NSString *)spam
{
BOOL hasBitrate = (self.bitrate != 0);
BOOL hasArtist = (self.artist != nil) && (![self.artist isEqualToString:@""]);
BOOL hasAlbum = (self.album != nil) && (![self.album isEqualToString:@""]);
BOOL hasTrack = (self.track != 0);
BOOL hasLength = (self.totalFrames != 0);
BOOL hasCurrentPosition = (self.currentPosition != 0) && (self.current);
BOOL hasExtension = NO;
BOOL hasTitle = (title != nil) && (![title isEqualToString:@""]);
NSMutableString * filename = [NSMutableString stringWithString:[self filename]];
NSRange dotPosition = [filename rangeOfString:@"." options:NSBackwardsSearch];
NSString * extension = nil;
if (dotPosition.length > 0) {
dotPosition.location++;
dotPosition.length = [filename length] - dotPosition.location;
extension = [filename substringWithRange:dotPosition];
dotPosition.location--;
dotPosition.length++;
[filename deleteCharactersInRange:dotPosition];
hasExtension = YES;
}
NSMutableArray * elements = [NSMutableArray array];
if (hasExtension) {
[elements addObject:@"["];
[elements addObject:[extension uppercaseString]];
if (hasBitrate) {
[elements addObject:@"@"];
[elements addObject:[NSString stringWithFormat:@"%u", self.bitrate / 1000]];
[elements addObject:@"kbps"];
}
[elements addObject:@"] "];
}
if (hasArtist) {
[elements addObject:self.artist];
[elements addObject:@" - "];
}
if (hasAlbum) {
[elements addObject:@"["];
[elements addObject:self.album];
if (hasTrack) {
[elements addObject:@" #"];
[elements addObject:[NSString stringWithFormat:@"%@", self.track]];
}
[elements addObject:@"] "];
}
if (hasTitle) {
[elements addObject:title];
}
else {
[elements addObject:filename];
}
if (hasCurrentPosition || hasLength) {
SecondsFormatter *secondsFormatter = [[SecondsFormatter alloc] init];
[elements addObject:@" ("];
if (hasCurrentPosition) {
[elements addObject:[secondsFormatter stringForObjectValue:[NSNumber numberWithFloat:currentPosition]]];
}
if (hasLength) {
if (hasCurrentPosition) {
[elements addObject:@" / "];
}
[elements addObject:[secondsFormatter stringForObjectValue:[self length]]];
}
[elements addObject:@")"];
[secondsFormatter release];
}
return [elements componentsJoinedByString:@""];
}
@dynamic length; @dynamic length;
- (NSNumber *)length - (NSNumber *)length
{ {

View File

@ -22,15 +22,16 @@
<outlet property="nextHotKeyControl" destination="28" id="36"/> <outlet property="nextHotKeyControl" destination="28" id="36"/>
<outlet property="playHotKeyControl" destination="16" id="34"/> <outlet property="playHotKeyControl" destination="16" id="34"/>
<outlet property="prevHotKeyControl" destination="27" id="35"/> <outlet property="prevHotKeyControl" destination="27" id="35"/>
<outlet property="spamHotKeyControl" destination="2Eh-AY-mzV" id="B2t-Ar-T97"/>
<outlet property="view" destination="11" id="12"/> <outlet property="view" destination="11" id="12"/>
</connections> </connections>
</customObject> </customObject>
<customView id="11" userLabel="HotKeyView"> <customView id="11" userLabel="HotKeyView">
<rect key="frame" x="0.0" y="0.0" width="432" height="109"/> <rect key="frame" x="0.0" y="0.0" width="432" height="131"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<button verticalHuggingPriority="750" id="30"> <button verticalHuggingPriority="750" id="30">
<rect key="frame" x="175" y="12" width="64" height="32"/> <rect key="frame" x="175" y="34" width="64" height="32"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<buttonCell key="cell" type="push" title="Edit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="204"> <buttonCell key="cell" type="push" title="Edit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="204">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@ -40,8 +41,19 @@
<action selector="grabNextHotKey:" target="6" id="33"/> <action selector="grabNextHotKey:" target="6" id="33"/>
</connections> </connections>
</button> </button>
<button verticalHuggingPriority="750" id="KcI-9g-270">
<rect key="frame" x="175" y="9" width="64" height="32"/>
<autoresizingMask key="autoresizingMask"/>
<buttonCell key="cell" type="push" title="Edit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="6zz-ME-x1V">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="grabSpamHotKey:" target="6" id="wyh-q1-p3g"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="29"> <button verticalHuggingPriority="750" id="29">
<rect key="frame" x="175" y="37" width="64" height="32"/> <rect key="frame" x="175" y="59" width="64" height="32"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<buttonCell key="cell" type="push" title="Edit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="203"> <buttonCell key="cell" type="push" title="Edit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="203">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@ -52,7 +64,7 @@
</connections> </connections>
</button> </button>
<textField verticalHuggingPriority="750" id="28" customClass="HotKeyControl"> <textField verticalHuggingPriority="750" id="28" customClass="HotKeyControl">
<rect key="frame" x="91" y="20" width="82" height="19"/> <rect key="frame" x="91" y="42" width="82" height="19"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="202"> <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="202">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
@ -63,8 +75,20 @@
<action selector="hotKeyChanged:" target="6" id="38"/> <action selector="hotKeyChanged:" target="6" id="38"/>
</connections> </connections>
</textField> </textField>
<textField verticalHuggingPriority="750" id="2Eh-AY-mzV" customClass="HotKeyControl">
<rect key="frame" x="91" y="17" width="82" height="19"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="A8w-Tx-TAd">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<action selector="hotKeyChanged:" target="6" id="WrA-Jp-1SV"/>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="27" customClass="HotKeyControl"> <textField verticalHuggingPriority="750" id="27" customClass="HotKeyControl">
<rect key="frame" x="91" y="45" width="82" height="19"/> <rect key="frame" x="91" y="67" width="82" height="19"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="201"> <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="201">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
@ -76,34 +100,34 @@
</connections> </connections>
</textField> </textField>
<textField verticalHuggingPriority="750" id="26"> <textField verticalHuggingPriority="750" id="26">
<rect key="frame" x="40" y="22" width="44" height="17"/> <rect key="frame" x="42" y="44" width="44" height="17"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Next:" id="200"> <textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Next:" id="200">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField verticalHuggingPriority="750" id="25"> <textField verticalHuggingPriority="750" id="25">
<rect key="frame" x="17" y="47" width="69" height="17"/> <rect key="frame" x="17" y="69" width="69" height="17"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Previous:" id="199"> <textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Previous:" id="199">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField verticalHuggingPriority="750" id="24"> <textField verticalHuggingPriority="750" id="24">
<rect key="frame" x="45" y="72" width="39" height="17"/> <rect key="frame" x="47" y="94" width="39" height="17"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Play:" id="198"> <textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Play:" id="198">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
<button verticalHuggingPriority="750" id="17"> <button verticalHuggingPriority="750" id="17">
<rect key="frame" x="175" y="62" width="64" height="32"/> <rect key="frame" x="175" y="84" width="64" height="32"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<buttonCell key="cell" type="push" title="Edit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="197"> <buttonCell key="cell" type="push" title="Edit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="197">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@ -115,7 +139,7 @@
</connections> </connections>
</button> </button>
<textField verticalHuggingPriority="750" id="16" customClass="HotKeyControl"> <textField verticalHuggingPriority="750" id="16" customClass="HotKeyControl">
<rect key="frame" x="91" y="70" width="82" height="19"/> <rect key="frame" x="91" y="92" width="82" height="19"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="196"> <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="196">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
@ -127,6 +151,15 @@
<outlet property="nextKeyView" destination="17" id="22"/> <outlet property="nextKeyView" destination="17" id="22"/>
</connections> </connections>
</textField> </textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="eid-M4-6Cs">
<rect key="frame" x="24" y="19" width="62" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Spam:" id="SMd-GA-jrH">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews> </subviews>
</customView> </customView>
<customView id="43" userLabel="RemoteView"> <customView id="43" userLabel="RemoteView">

View File

@ -14,11 +14,13 @@
IBOutlet HotKeyControl *playHotKeyControl; IBOutlet HotKeyControl *playHotKeyControl;
IBOutlet HotKeyControl *prevHotKeyControl; IBOutlet HotKeyControl *prevHotKeyControl;
IBOutlet HotKeyControl *nextHotKeyControl; IBOutlet HotKeyControl *nextHotKeyControl;
IBOutlet HotKeyControl *spamHotKeyControl;
} }
- (IBAction) grabPlayHotKey:(id)sender; - (IBAction) grabPlayHotKey:(id)sender;
- (IBAction) grabPrevHotKey:(id)sender; - (IBAction) grabPrevHotKey:(id)sender;
- (IBAction) grabNextHotKey:(id)sender; - (IBAction) grabNextHotKey:(id)sender;
- (IBAction) grabSpamHotKey:(id)sender;
- (IBAction) hotKeyChanged:(id)sender; - (IBAction) hotKeyChanged:(id)sender;

View File

@ -33,6 +33,12 @@
[playHotKeyControl setModifierFlags: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyPlayModifiers"] ]; [playHotKeyControl setModifierFlags: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyPlayModifiers"] ];
[playHotKeyControl updateStringValue]; [playHotKeyControl updateStringValue];
[spamHotKeyControl setKeyCode: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeySpamKeyCode"] ];
[spamHotKeyControl setCharacter: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeySpamCharacter"] ];
[spamHotKeyControl setModifierFlags: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeySpamModifiers"] ];
[spamHotKeyControl updateStringValue];
} }
- (NSString *)title - (NSString *)title
@ -60,6 +66,7 @@
[playHotKeyControl stopObserving]; [playHotKeyControl stopObserving];
[prevHotKeyControl stopObserving]; [prevHotKeyControl stopObserving];
[nextHotKeyControl stopObserving]; [nextHotKeyControl stopObserving];
[spamHotKeyControl stopObserving];
} }
} }
@ -78,6 +85,11 @@
[nextHotKeyControl startObserving]; [nextHotKeyControl startObserving];
} }
- (IBAction) grabSpamHotKey:(id)sender
{
[spamHotKeyControl startObserving];
}
- (IBAction) hotKeyChanged:(id)sender - (IBAction) hotKeyChanged:(id)sender
{ {
if (sender == playHotKeyControl) { if (sender == playHotKeyControl) {
@ -95,6 +107,11 @@
[[NSUserDefaults standardUserDefaults] setInteger:[nextHotKeyControl modifierFlags] forKey:@"hotKeyNextModifiers"]; [[NSUserDefaults standardUserDefaults] setInteger:[nextHotKeyControl modifierFlags] forKey:@"hotKeyNextModifiers"];
[[NSUserDefaults standardUserDefaults] setInteger:[nextHotKeyControl keyCode] forKey:@"hotKeyNextKeyCode"]; [[NSUserDefaults standardUserDefaults] setInteger:[nextHotKeyControl keyCode] forKey:@"hotKeyNextKeyCode"];
} }
else if (sender == spamHotKeyControl) {
[[NSUserDefaults standardUserDefaults] setInteger:[spamHotKeyControl character] forKey:@"hotKeySpamCharacter"];
[[NSUserDefaults standardUserDefaults] setInteger:[spamHotKeyControl modifierFlags] forKey:@"hotKeySpamModifiers"];
[[NSUserDefaults standardUserDefaults] setInteger:[spamHotKeyControl keyCode] forKey:@"hotKeySpamKeyCode"];
}
[sender stopObserving]; [sender stopObserving];
} }