[Menu] Add Stop after Selection to context menu
Since the existing code already supports setting any arbitrary track as a stopping point, add a menu interface to toggle Stop After for any track in the playlist. Stop After will be removed from the given track after it has been played. Stop After will not be remembered on disk. Signed-off-by: Christopher Snowhill <kode54@gmail.com>swiftingly
parent
aabd9431f1
commit
05f17ea950
|
@ -2136,6 +2136,12 @@ Gw
|
|||
</binding>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Stop after Selection" id="omb-wi-loX">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="stopAfterSelection:" target="218" id="ZRy-Mw-4cY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="2047"/>
|
||||
<menuItem title="Search for Artist" id="2045">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
|
|
|
@ -1455,6 +1455,19 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
|
|||
[self.tableView reloadDataForRowIndexes:refreshSet columnIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, columns)]];
|
||||
}
|
||||
|
||||
- (IBAction)stopAfterSelection:(id)sender {
|
||||
NSMutableIndexSet *refreshSet = [[NSMutableIndexSet alloc] init];
|
||||
|
||||
for(PlaylistEntry *pe in [self selectedObjects]) {
|
||||
pe.stopAfter = !pe.stopAfter;
|
||||
[refreshSet addIndex:pe.index];
|
||||
}
|
||||
|
||||
// Refresh entire row of all affected items to update tooltips
|
||||
unsigned long columns = [[self.tableView tableColumns] count];
|
||||
[self.tableView reloadDataForRowIndexes:refreshSet columnIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, columns)]];
|
||||
}
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
||||
SEL action = [menuItem action];
|
||||
|
||||
|
|
Loading…
Reference in New Issue