Conversation
| }; | ||
|
|
||
| string json = mkvFile.ToString(); | ||
| string json = mkvFile.ToString().Replace("\r\n", "\n"); |
There was a problem hiding this comment.
Fixes problems where the build environment serialization uses CR/LF instead of just LF
| "flagDefaultByteNumber": 0, | ||
| "flagForced": true, | ||
| "flagForcedByteNumber": 0, | ||
| "flagHearingImpaired": false, |
There was a problem hiding this comment.
Updated to match new Track properties
Add parsing and display of all audio flags. Added Next/Previous button. Fuller Audio Track decoding. Enable ReadyToRun for all environments.
99374dd to
19c5e9a
Compare
| public int flagDefaultByteNumber { get; set; } | ||
| public bool flagForced { get; set; } | ||
| public int flagForcedByteNumber { get; set; } | ||
| public bool flagHearingImpaired { get; set; } |
There was a problem hiding this comment.
Decoding these other flags for the dropdown
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="NEbml" Version="1.1.0.5"/> | ||
| <PackageReference Include="MediaInfo.Wrapper.Core" Version="21.9.3" /> |
There was a problem hiding this comment.
MediaInfo.Wrapper.Core gets us a lot more decoding.
| var seekList = new List<Seek>(); | ||
|
|
||
| using var fileStream = File.Open(filePath, FileMode.Open); | ||
| using var fileStream = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.Read); |
There was a problem hiding this comment.
Allows FileShare.Read keeps us from breaking while we (or someone else) has the file open for read-only access.
| return mkvFiles; | ||
| } | ||
|
|
||
| public static void LoadMediaInfoForFile(MkvFile mkvFile) |
There was a problem hiding this comment.
Lazy-load of the rest of the media information
| @@ -1,57 +0,0 @@ | |||
| using System; | |||
There was a problem hiding this comment.
We no longer force all files to have the same set of audio formats because we handle them one-at-a-time
| Title="MkvDefaultTrackChanger" | ||
| MinimumSize="300,450" | ||
| Size="300, 450" | ||
| MinimumSize="500,550" |
There was a problem hiding this comment.
Make the dialog bigger because the audio formats list is much wider.
| </StackLayout> | ||
|
|
||
| <DynamicLayout Spacing="0,10"> | ||
| <StackLayout Spacing="5" HorizontalContentAlignment="Center"> |
There was a problem hiding this comment.
Add current file and Next/Previous buttons.
| <DynamicLayout Spacing="0,5"> | ||
| <Label TextAlignment="Center">Audio</Label> | ||
| <DropDown x:Name="dropdownAudio" Enabled="false" Width="200" SelectedKeyChanged="OnDropdownSelectionChanged"></DropDown> | ||
| <Label x:Name="lblCurrentAudio" Text="" TextAlignment="Center" Font="SystemFont=Default, Size=8" TextColor="#666"></Label> |
There was a problem hiding this comment.
Show what the current audio selected is.
| int currentFileIndex; | ||
| OpenFileDialog fileDialog; | ||
| private (string audio, string subtitles)? appliedConfig; | ||
| private Dictionary<string, (string audio, string subtitles)> appliedConfigs; |
There was a problem hiding this comment.
Storing a map of the changes to each file
| string[] filePaths = fileDialog.Filenames.ToArray(); | ||
|
|
||
| mkvContainer = new MkvFilesContainer(filePaths); | ||
| if (mkvContainer.MkFilesRejected.Count > 0) |
There was a problem hiding this comment.
We don't need to force the audio formats to match.
|
|
||
| var currentFile = mkvFiles[currentFileIndex]; | ||
|
|
||
| MatroskaReader.LoadMediaInfoForFile(currentFile); |
|
|
||
| appliedConfigs[currentFile.filePath] = (dropdownAudio.SelectedKey, dropdownSubtitles.SelectedKey); | ||
|
|
||
| mkvFiles[currentFileIndex] = MatroskaReader.ReadMkvFiles([currentFile.filePath])[0]; |
| @@ -0,0 +1,81 @@ | |||
| using System; | |||
There was a problem hiding this comment.
Test utility to dump the data that MediaInfo gathers.
Add parsing and display of all audio flags.
Added Next/Previous button.
Fuller Audio Track decoding.
Enable ReadyToRun for all environments.