[WIP] Add basic writers for going from List<SubtitleItem> --> Stream #31
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.
#25 mentioned you'd be open to a PR for adding writers, and since I'm writing some for our project anyways, I decided to submit it upstream for others to use.
Currently I've implemented the SSA writer with both sync and async methods. I moved the consts from
SsaParser.cs
into a new util class (SsaFormatConstants.cs
) so that I didn't have to have duplicates in the writer. I'm writing to a stream since our usecase requires that over a file (since it's serving over the network), but it shouldn't be to difficult to either create methods that do write to a file, or just have the user write the stream to the file themselves.I'm only familiar with (and our service only requires) SSA and SRT writers, so it's likely that's all I'll add support for.
I'll get the SRT writer finished up asap so this can actually be merged, but let me know if you have any concerns, or need me to change anything. If you're interested, I may also submit another PR with some more additions, like the option to strip out formatting codes from SSA (again, I'll be doing this anyways since we require it, might as well upstream it if you want it).