Skip to content

Commit

Permalink
5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stax76 committed Oct 24, 2019
1 parent 08c1fe7 commit e0ed39b
Show file tree
Hide file tree
Showing 17 changed files with 1,145 additions and 226 deletions.
13 changes: 12 additions & 1 deletion Changelog.md
@@ -1,5 +1,16 @@

### 5.0

- changelog added to repo
- if no file is open message is shown
- file can be opened from menu: Open File...
- exclude setting added to hide defined parameters
- file can be saved from menu: Save File...
- exclude setting added to hide defined parameters
- encoding presentation can be disabled
- compact summary can be disabled
- file types for setup can be customized
- column width can be customized
- new settings dialog with proper UI controls and greatly improved usability
- some dialogs use task dialog instead of msg box
- about dialog added
- settings directory can either be AppData, Portable or Custom
10 changes: 10 additions & 0 deletions License.txt
@@ -0,0 +1,10 @@
MIT License

Copyright (c) 2002-2017 stax76

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and ssociated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 changes: 8 additions & 26 deletions README.md
Expand Up @@ -7,44 +7,26 @@ MediaInfo.NET is a alternative MediaInfo frontend.
## Features

- High DPI support
- A search/filter feature
- A tab bar showing each track in a dedicated tab
- Move to the next and previous file of the folder
- Search feature
- Tab bar showing each track in a dedicated tab
- Move to the next and previous file in the folder
- Raw view to show parameters as used in the MediaInfo API
- Dark User Interface
- Various settings to change the appearance
- Special presentation for encoding settings

## Installation

**Install the .NET Core 3.0 Runtime.**
**[Requires a installed .NET Core 3.0 and .NET Core desktop runtime.](https://dotnet.microsoft.com/download/dotnet-core/3.0/runtime)**

Run MediaInfo.NET and right-click to show the context menu, choose Install to register common file associations, File Explorer will then show a MediaInfo menu item in the context menu when a media file is right-clicked. For custom file extensions use [Open with++](https://github.com/stax76/OpenWithPlusPlus).

On a 32-Bit system download the DLL from the MediaInfo website, only the 64-Bit DLL is included.

## Usage

Open media files with the context menu in File Explorer or open files via drag & drop.
Open media files with the context menu in File Explorer or via drag & drop or from the app context menu.

The search feature allows to quickly find properties.

F11/F12 navigates to the previous or next file in the folder.

## Settings

### font

A monospaced font.

### raw-view

raw-view shows developers the parameter names as they are used in the MediaInfo API.

### Defaults

font = consolas
font-size = 14
window-width = 750
window-height = 550
center-screen = yes
raw-view = yes
word-wrap = no
F11/F12 navigates to the previous or next file in the folder.
33 changes: 33 additions & 0 deletions src/App.manifest
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">

<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>

<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
35 changes: 34 additions & 1 deletion src/App.xaml.cs
@@ -1,10 +1,43 @@
using System.Windows;
using System.IO;
using System.Windows;
using System.Windows.Threading;

namespace MediaInfoNET
{
public partial class App : Application
{
static AppSettings? _Settings;

public static AppSettings Settings {
get {
if (_Settings == null)
{
if (File.Exists(App.SettingsFile))
_Settings = XmlSerializerHelp.LoadXML<AppSettings>(App.SettingsFile);
else
{
_Settings = new AppSettings();
SaveSettings();
}
}

return _Settings;
}
}

public static string SettingsFile {
get => RegistryHelp.GetString(RegistryHelp.ApplicationKey, "SettingsFile");
set => RegistryHelp.SetValue(RegistryHelp.ApplicationKey, "SettingsFile", value);
}

public static void SaveSettings()
{
if (!Directory.Exists(Path.GetDirectoryName(App.SettingsFile)))
Directory.CreateDirectory(Path.GetDirectoryName(App.SettingsFile));

XmlSerializerHelp.SaveXML(App.SettingsFile, Settings);
}

public App()
{
DispatcherUnhandledException += App_DispatcherUnhandledException;
Expand Down
8 changes: 8 additions & 0 deletions src/Generic/AppHelp.cs
@@ -0,0 +1,8 @@
using System.Reflection;
using System.Linq;

class AppHelp
{
public static string ProductName { get; } = (Assembly.GetEntryAssembly()?.GetCustomAttributes(
typeof(AssemblyProductAttribute)).First() as AssemblyProductAttribute)?.Product ?? "";
}
File renamed without changes.
59 changes: 59 additions & 0 deletions src/Generic/RegistryHelp.cs
@@ -0,0 +1,59 @@
using Microsoft.Win32;
using System;

public class RegistryHelp
{
public static string ApplicationKey { get; } = @"HKCU\Software\" + AppHelp.ProductName;

public static void SetValue(string path, string? name, object value)
{
using (RegistryKey? regKey = GetRootKey(path).CreateSubKey(path.Substring(5), RegistryKeyPermissionCheck.ReadWriteSubTree))
regKey?.SetValue(name, value);
}

public static string GetString(string path, string? name, string defaultValue = "")
{
object? value = GetValue(path, name, defaultValue);
return value is string ? (string)value : defaultValue ;
}

public static bool GetBool(string path, string? name, bool defaultValue = false)
{
object? val = GetValue(path, name, defaultValue);
return val is bool ? (bool)val : defaultValue;
}

public static int GetInt(string path, string? name, int defaultValue = 0)
{
object? val = GetValue(path, name, defaultValue);
return val is int ? (int)val : defaultValue;
}

public static object? GetValue(string path, string? name, object? defaultValue = null)
{
using (RegistryKey? regKey = GetRootKey(path).OpenSubKey(path.Substring(5)))
return regKey == null ? defaultValue : regKey.GetValue(name, defaultValue);
}

public static void RemoveKey(string path)
{
GetRootKey(path).DeleteSubKeyTree(path.Substring(5), false);
}

public static void RemoveValue(string path, string name)
{
using (RegistryKey? regKey = GetRootKey(path).OpenSubKey(path.Substring(5), true))
regKey?.DeleteValue(name, false);
}

static RegistryKey GetRootKey(string path)
{
switch (path.Substring(0, 4))
{
case "HKLM": return Registry.LocalMachine;
case "HKCU": return Registry.CurrentUser;
case "HKCR": return Registry.ClassesRoot;
default: throw new Exception("unknown reg root");
}
}
}

0 comments on commit e0ed39b

Please sign in to comment.