Skip to content

Enhancements#26

Open
IDisposable wants to merge 1 commit intoMikeMoolenaar:developfrom
IDisposable:feat/add-flags
Open

Enhancements#26
IDisposable wants to merge 1 commit intoMikeMoolenaar:developfrom
IDisposable:feat/add-flags

Conversation

@IDisposable
Copy link
Copy Markdown

Add parsing and display of all audio flags.
Added Next/Previous button.
Fuller Audio Track decoding.
Enable ReadyToRun for all environments.

};

string json = mkvFile.ToString();
string json = mkvFile.ToString().Replace("\r\n", "\n");
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes problems where the build environment serialization uses CR/LF instead of just LF

"flagDefaultByteNumber": 0,
"flagForced": true,
"flagForcedByteNumber": 0,
"flagHearingImpaired": false,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
public int flagDefaultByteNumber { get; set; }
public bool flagForced { get; set; }
public int flagForcedByteNumber { get; set; }
public bool flagHearingImpaired { get; set; }
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" />
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lazy-load of the rest of the media information

@@ -1,57 +0,0 @@
using System;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the dialog bigger because the audio formats list is much wider.

</StackLayout>

<DynamicLayout Spacing="0,10">
<StackLayout Spacing="5" HorizontalContentAlignment="Center">
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storing a map of the changes to each file

string[] filePaths = fileDialog.Filenames.ToArray();

mkvContainer = new MkvFilesContainer(filePaths);
if (mkvContainer.MkFilesRejected.Count > 0)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to force the audio formats to match.


var currentFile = mkvFiles[currentFileIndex];

MatroskaReader.LoadMediaInfoForFile(currentFile);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lazy-load


appliedConfigs[currentFile.filePath] = (dropdownAudio.SelectedKey, dropdownSubtitles.SelectedKey);

mkvFiles[currentFileIndex] = MatroskaReader.ReadMkvFiles([currentFile.filePath])[0];
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reload after saving.

@@ -0,0 +1,81 @@
using System;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test utility to dump the data that MediaInfo gathers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant