[Playlist Loader] Add option to load more files
Add option to load every file in a folder when opening just one or more files in that folder. Signed-off-by: Christopher Snowhill <kode54@gmail.com>xcode15
parent
4e24c5b829
commit
14eb923529
|
@ -62,7 +62,8 @@ extern NSMutableDictionary<NSString *, AlbumArtwork *> *kArtworkDictionary;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)initDefaults {
|
- (void)initDefaults {
|
||||||
NSDictionary *defaultsDictionary = @{ @"readCueSheetsInFolders": @(YES) };
|
NSDictionary *defaultsDictionary = @{ @"readCueSheetsInFolders": @(YES),
|
||||||
|
@"addOtherFilesInFolders": @(NO) };
|
||||||
|
|
||||||
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsDictionary];
|
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsDictionary];
|
||||||
}
|
}
|
||||||
|
@ -338,8 +339,11 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
|
||||||
NSMutableArray *containedURLs = [NSMutableArray array];
|
NSMutableArray *containedURLs = [NSMutableArray array];
|
||||||
NSMutableArray *fileURLs = [NSMutableArray array];
|
NSMutableArray *fileURLs = [NSMutableArray array];
|
||||||
NSMutableArray *validURLs = [NSMutableArray array];
|
NSMutableArray *validURLs = [NSMutableArray array];
|
||||||
|
NSMutableArray *folderURLs = [NSMutableArray array];
|
||||||
NSDictionary *xmlData = nil;
|
NSDictionary *xmlData = nil;
|
||||||
|
|
||||||
|
BOOL addOtherFilesInFolder = [[NSUserDefaults standardUserDefaults] boolForKey:@"addOtherFilesInFolders"];
|
||||||
|
|
||||||
double progress;
|
double progress;
|
||||||
|
|
||||||
if(!urls) {
|
if(!urls) {
|
||||||
|
@ -367,6 +371,13 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
|
||||||
// Get subpaths
|
// Get subpaths
|
||||||
[[SandboxBroker sharedSandboxBroker] addFolderIfMissing:url];
|
[[SandboxBroker sharedSandboxBroker] addFolderIfMissing:url];
|
||||||
[expandedURLs addObjectsFromArray:[self fileURLsAtPath:[url path]]];
|
[expandedURLs addObjectsFromArray:[self fileURLsAtPath:[url path]]];
|
||||||
|
} else if(addOtherFilesInFolder) {
|
||||||
|
NSURL *folderUrl = [url URLByDeletingLastPathComponent];
|
||||||
|
if(![folderURLs containsObject:folderUrl]) {
|
||||||
|
[[SandboxBroker sharedSandboxBroker] requestFolderForFile:url];
|
||||||
|
[expandedURLs addObjectsFromArray:[self fileURLsAtPath:[folderUrl path]]];
|
||||||
|
[folderURLs addObject:folderUrl];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
[[SandboxBroker sharedSandboxBroker] addFileIfMissing:url];
|
[[SandboxBroker sharedSandboxBroker] addFileIfMissing:url];
|
||||||
[expandedURLs addObject:[NSURL fileURLWithPath:[url path]]];
|
[expandedURLs addObject:[NSURL fileURLWithPath:[url path]]];
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||||
<customView id="231" userLabel="PlaylistView">
|
<customView id="231" userLabel="PlaylistView">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="640" height="173"/>
|
<rect key="frame" x="0.0" y="0.0" width="640" height="201"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="310">
|
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="310">
|
||||||
<rect key="frame" x="18" y="75" width="602" height="18"/>
|
<rect key="frame" x="18" y="103" width="602" height="18"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
<buttonCell key="cell" type="check" title="Read CUE sheets when adding folders to playlist" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="311">
|
<buttonCell key="cell" type="check" title="Read CUE sheets when adding folders to playlist" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="311">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="261">
|
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="261">
|
||||||
<rect key="frame" x="18" y="99" width="180" height="35"/>
|
<rect key="frame" x="18" y="127" width="180" height="35"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="When opening file with ⇧ or ⌃⌘ held:" id="262">
|
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="When opening file with ⇧ or ⌃⌘ held:" id="262">
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
</textFieldCell>
|
</textFieldCell>
|
||||||
</textField>
|
</textField>
|
||||||
<textField verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="259">
|
<textField verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="259">
|
||||||
<rect key="frame" x="18" y="140" width="180" height="17"/>
|
<rect key="frame" x="18" y="168" width="180" height="17"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
<textFieldCell key="cell" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="When opening files:" id="260">
|
<textFieldCell key="cell" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="When opening files:" id="260">
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
</textFieldCell>
|
</textFieldCell>
|
||||||
</textField>
|
</textField>
|
||||||
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="247">
|
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="247">
|
||||||
<rect key="frame" x="201" y="133" width="423" height="26"/>
|
<rect key="frame" x="201" y="161" width="423" height="26"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" selectedItem="250" id="248">
|
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" selectedItem="250" id="248">
|
||||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="253">
|
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="253">
|
||||||
<rect key="frame" x="201" y="95" width="423" height="26"/>
|
<rect key="frame" x="201" y="123" width="423" height="26"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" inset="2" id="254">
|
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" inset="2" id="254">
|
||||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||||
|
@ -118,6 +118,17 @@
|
||||||
<binding destination="52" name="selectedObject" keyPath="values.openingFilesAlteredBehavior" previousBinding="308" id="309"/>
|
<binding destination="52" name="selectedObject" keyPath="values.openingFilesAlteredBehavior" previousBinding="308" id="309"/>
|
||||||
</connections>
|
</connections>
|
||||||
</popUpButton>
|
</popUpButton>
|
||||||
|
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RiU-1B-ZKm">
|
||||||
|
<rect key="frame" x="18" y="75" width="602" height="18"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
|
<buttonCell key="cell" type="check" title="Add other files in the same folder when adding a file" bezelStyle="regularSquare" imagePosition="left" inset="2" id="ws4-en-un8">
|
||||||
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
</buttonCell>
|
||||||
|
<connections>
|
||||||
|
<binding destination="52" name="value" keyPath="values.addOtherFilesInFolders" id="9V7-qF-e8q"/>
|
||||||
|
</connections>
|
||||||
|
</button>
|
||||||
</subviews>
|
</subviews>
|
||||||
<point key="canvasLocation" x="-151" y="-283.5"/>
|
<point key="canvasLocation" x="-151" y="-283.5"/>
|
||||||
</customView>
|
</customView>
|
||||||
|
|
|
@ -235,3 +235,6 @@
|
||||||
|
|
||||||
/* Class = "NSButtonCell"; title = "Enable FreeSurround stereo to surround upmixing"; ObjectID = "F0i-UK-6Nu"; */
|
/* Class = "NSButtonCell"; title = "Enable FreeSurround stereo to surround upmixing"; ObjectID = "F0i-UK-6Nu"; */
|
||||||
"F0i-UK-6Nu.title" = "Enable FreeSurround stereo to surround upmixing";
|
"F0i-UK-6Nu.title" = "Enable FreeSurround stereo to surround upmixing";
|
||||||
|
|
||||||
|
/* Class = "NSButtonCell"; title = "Add other files in the same folder when adding a file"; ObjectID = "ws4-en-un8"; */
|
||||||
|
"ws4-en-un8.title" = "Add other files in the same folder when adding a file";
|
||||||
|
|
|
@ -234,3 +234,6 @@
|
||||||
|
|
||||||
/* Class = "NSButtonCell"; title = "Enable FreeSurround stereo to surround upmixing"; ObjectID = "F0i-UK-6Nu"; */
|
/* Class = "NSButtonCell"; title = "Enable FreeSurround stereo to surround upmixing"; ObjectID = "F0i-UK-6Nu"; */
|
||||||
"F0i-UK-6Nu.title" = "Activar conversión de sonido estéreo a envolvente";
|
"F0i-UK-6Nu.title" = "Activar conversión de sonido estéreo a envolvente";
|
||||||
|
|
||||||
|
/* Class = "NSButtonCell"; title = "Add other files in the same folder when adding a file"; ObjectID = "ws4-en-un8"; */
|
||||||
|
"ws4-en-un8.title" = "Add other files in the same folder when adding a file";
|
||||||
|
|
|
@ -101,3 +101,5 @@
|
||||||
/* Class = "NSMenuItem"; title = "Delete Path"; ObjectID = "nva-pz-xSS"; */
|
/* Class = "NSMenuItem"; title = "Delete Path"; ObjectID = "nva-pz-xSS"; */
|
||||||
"nva-pz-xSS.title" = "usunąć ścieżkę";
|
"nva-pz-xSS.title" = "usunąć ścieżkę";
|
||||||
|
|
||||||
|
/* Class = "NSButtonCell"; title = "Add other files in the same folder when adding a file"; ObjectID = "ws4-en-un8"; */
|
||||||
|
"ws4-en-un8.title" = "Add other files in the same folder when adding a file";
|
||||||
|
|
|
@ -196,3 +196,6 @@
|
||||||
|
|
||||||
/* Class = "NSButtonCell"; title = "Enable FreeSurround stereo to surround upmixing"; ObjectID = "F0i-UK-6Nu"; */
|
/* Class = "NSButtonCell"; title = "Enable FreeSurround stereo to surround upmixing"; ObjectID = "F0i-UK-6Nu"; */
|
||||||
"F0i-UK-6Nu.title" = "Включить FreeSurround апмикс стерео в объемный звук";
|
"F0i-UK-6Nu.title" = "Включить FreeSurround апмикс стерео в объемный звук";
|
||||||
|
|
||||||
|
/* Class = "NSButtonCell"; title = "Add other files in the same folder when adding a file"; ObjectID = "ws4-en-un8"; */
|
||||||
|
"ws4-en-un8.title" = "Add other files in the same folder when adding a file";
|
||||||
|
|
Loading…
Reference in New Issue