Add associations of file extensions with NDS files#6
Merged
Conversation
Move ".argv" file parsing to a single location (args.cpp) and use it for all path and argument conversions.
File extension handlers are files named "<type>.ext" where <type> specifies the file type to associate it with. The contents of *.ext files are argument lists (like .argv files) that point to an NDS file and provide optional arguments too. They are placed in the /nds directory. Handlers allow browsing for data files, which are then opened by the correct NDS file. For example, a file named "mp3.ext" containing "/nds/music-player.avi" will allow .mp3 files to be found and opened with music-player.avi. Another file named "m3u.ext" containing "/nds/music-player.avi --list" will let .m3u files be opened with music-player.avi, and the passed-in command line will be "/nds/music-player --list /path/to/file.m3u" (sans quotes).
Contributor
Author
|
Hi @WinterMute, have you had a chance to take a look at this? I realise things have been a bit chaotic with the DKP forum breach, so just making sure this doesn't slip through the cracks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following the feedback on #5, I've implemented proposal 3.
This pull request adds a way to associate file extensions (e.g.
.mp3or.m3u) with an NDS file that can open them. Extension files should be named like<type>.ext, where<type>is an extension likemp3orm3u, and placed in/nds. Their contents are formatted like.argvfiles, with the first argument pointing to the NDS file to open and all of the arguments passed to the NDS file. The name of the data file will be appended to the argument list. A relative path for the NDS file is resolved to the /nds/ directory.So, for example, with the following file layout:
Results in the following:
.mp3and.m3ufiles will appear in file listings./song1.mp3will result in music-player.nds being run with the arguments list/nds/music-player.ndsfat:/song1.mp3.song2.mp3will have the arguments list/nds/music-player.ndsfat:/music/song2.mp3./playlist.m3uwill also open music-player.nds but with the arguments list/nds/music-player.nds--listfat:/playlist.m3u.I've also done a bit of refactoring to make the implementation cleaner and easier.