Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b199d33f7a | ||
|
|
a7b6f79ee1 | ||
|
|
fc3c5ee3a7 | ||
|
|
ed71cb704f | ||
|
|
a9474b1c22 | ||
|
|
be3b31f7e6 |
35
README.md
35
README.md
@@ -54,6 +54,7 @@ Table of contents
|
|||||||
- Support of the same [CLI options](https://mpv.io/manual/master/#options) as mpv
|
- Support of the same [CLI options](https://mpv.io/manual/master/#options) as mpv
|
||||||
- DXVA2 video decoding acceleration
|
- DXVA2 video decoding acceleration
|
||||||
- OpenGL based video output capable of features loved by videophiles, such as video scaling with popular high quality algorithms, color management, frame timing, interpolation, HDR, and more
|
- OpenGL based video output capable of features loved by videophiles, such as video scaling with popular high quality algorithms, color management, frame timing, interpolation, HDR, and more
|
||||||
|
- Search feature powered by [Everything](https://www.voidtools.com) to find and play media
|
||||||
|
|
||||||
### Screenshots
|
### Screenshots
|
||||||
|
|
||||||
@@ -102,22 +103,24 @@ input.conf defines mpv's key and mouse bindings and mpv.net uses comments to def
|
|||||||
|
|
||||||
### Settings
|
### Settings
|
||||||
|
|
||||||
mpv.net shares the settings with mpv, settings can be edited in a settings dialog or in a config file called mpv.conf located in the config directory:
|
mpv.net is able to share the settings with mpv and mpv.net uses the same logic to decide from where the settings are loaded. The default location is:
|
||||||
|
|
||||||
```Text
|
```Text
|
||||||
C:\Users\%username%\AppData\Roaming\mpv\mpv.conf
|
C:\Users\%username%\AppData\Roaming\mpv\mpv.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
or in a portable setup at:
|
If a directory named portable_config next to the mpvnet.exe exists, all config will be loaded from this directory only.
|
||||||
|
|
||||||
```Text
|
```Text
|
||||||
<startup>\portable_config\mpv.conf
|
<startup>\portable_config\mpv.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
if it's missing mpv.net generates it with the following defaults:
|
In case there isn't any config folder mpv.net asks where to create it. If no mpv.conf file exists mpv.net generates it with the following defaults:
|
||||||
|
|
||||||
<https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpvConf.txt>
|
<https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpvConf.txt>
|
||||||
|
|
||||||
|
Config files located in the same directory as mpvnet.exe are loaded with lower priority. Some config files are loaded only once, which means that e.g. of 2 input.conf files located in two config directories, only the one from the directory with higher priority will be loaded.
|
||||||
|
|
||||||
### Scripting
|
### Scripting
|
||||||
|
|
||||||
[Scripting wiki page](https://github.com/stax76/mpv.net/wiki/Scripting)
|
[Scripting wiki page](https://github.com/stax76/mpv.net/wiki/Scripting)
|
||||||
@@ -188,7 +191,15 @@ mpv.net bugs and requests: <https://github.com/stax76/mpv.net/issues>
|
|||||||
|
|
||||||
### Changelog
|
### Changelog
|
||||||
|
|
||||||
### 3.5 (2019-??-??)
|
### 3.6
|
||||||
|
|
||||||
|
- playing files from rar archives caused an exception
|
||||||
|
- there was a bug that caused underscores beeing removed from input like MBTN_LEFT_DBL
|
||||||
|
- the search clear button in the input editor had a render issue in dark mode
|
||||||
|
- new search feature added to search and play media files, requires
|
||||||
|
[Everything](https://www.voidtools.com) to be installed. [Default Binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L29)
|
||||||
|
|
||||||
|
### 3.5
|
||||||
|
|
||||||
- when the main windows gets activated and the clipboard content starts with http
|
- when the main windows gets activated and the clipboard content starts with http
|
||||||
mpv.net will ask to play the URL, previously this was restricted to YouTube URLs
|
mpv.net will ask to play the URL, previously this was restricted to YouTube URLs
|
||||||
@@ -197,20 +208,8 @@ mpv.net bugs and requests: <https://github.com/stax76/mpv.net/issues>
|
|||||||
directory as config directory instead of creating default conf files in appdata
|
directory as config directory instead of creating default conf files in appdata
|
||||||
- renamed commands are handled now by migration code instead of being broken
|
- renamed commands are handled now by migration code instead of being broken
|
||||||
|
|
||||||
### 3.4 (2019-05-03)
|
### 3.4
|
||||||
|
|
||||||
- new feature added to manage file associations from within the app. It can be found in the menu at: Tools > Manage... [Default Binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L149)
|
- new feature added to manage file associations from within the app. It can be found in the menu at: Tools > Manage... [Default Binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L149)
|
||||||
- new zip download option added
|
- new zip download option added
|
||||||
- new x86 download option added
|
- new x86 download option added
|
||||||
|
|
||||||
### 3.3 (2019-05-01)
|
|
||||||
|
|
||||||
- dark mode support was added to the command palette and partly to the input editor
|
|
||||||
- a new icon was designed. [Website](https://mpv-net.github.io/mpv.net-web-site/)
|
|
||||||
- all windows (main, conf, input, about, command palette) can now be closed
|
|
||||||
by just pressing the Escape key
|
|
||||||
- new feature added to open recent files and URLs with the context menu. [Default Binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L33)
|
|
||||||
- the info command (i key) now works also for URLs
|
|
||||||
- CSScriptAddon add-on didn't load cs scripts from \<startup\>\\scripts
|
|
||||||
- error handling was improved by showing an improved message box that supports a text copy feature, a support link and text heading and text folding
|
|
||||||
- libmpv was updated
|
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DefineDebug>true</DefineDebug>
|
<DefineDebug>true</DefineDebug>
|
||||||
<DefineTrace>true</DefineTrace>
|
<DefineTrace>true</DefineTrace>
|
||||||
<OutputPath>..\mpv.net\bin\x86\Addons\CSScriptAddon\</OutputPath>
|
<OutputPath>..\..\mpv.net\bin\x86\Addons\CSScriptAddon\</OutputPath>
|
||||||
<NoWarn>42105,42106,42107,42353,42354,42355</NoWarn>
|
<NoWarn>42105,42106,42107,42353,42354,42355</NoWarn>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<OutputPath>..\mpv.net\bin\x86\Addons\RatingAddon\</OutputPath>
|
<OutputPath>..\..\mpv.net\bin\x86\Addons\RatingAddon\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
|||||||
@@ -31,9 +31,6 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="mpvnet">
|
|
||||||
<HintPath>..\..\mpv.net\bin\x64\mpvnet.exe</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.ComponentModel.Composition" />
|
<Reference Include="System.ComponentModel.Composition" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
@@ -48,5 +45,12 @@
|
|||||||
<Compile Include="TestAddon.cs" />
|
<Compile Include="TestAddon.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\mpv.net\mpv.net.csproj">
|
||||||
|
<Project>{1751f378-8edf-4b62-be6d-304c7c287089}</Project>
|
||||||
|
<Name>mpv.net</Name>
|
||||||
|
<Private>False</Private>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@@ -10,9 +10,6 @@ EndProject
|
|||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RatingAddon", "addons\RatingAddon\RatingAddon.csproj", "{55C88710-539D-4402-84C8-31694841C731}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RatingAddon", "addons\RatingAddon\RatingAddon.csproj", "{55C88710-539D-4402-84C8-31694841C731}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestAddon", "addons\TestAddon\TestAddon.csproj", "{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestAddon", "addons\TestAddon\TestAddon.csproj", "{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089} = {1751F378-8EDF-4B62-BE6D-304C7C287089}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
|||||||
@@ -91,6 +91,15 @@ namespace mpvnet
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void show_media_search(string[] args)
|
||||||
|
{
|
||||||
|
MainForm.Instance.Invoke(new Action(() => {
|
||||||
|
var w = new EverythingWindow();
|
||||||
|
new WindowInteropHelper(w).Owner = MainForm.Instance.Handle;
|
||||||
|
w.ShowDialog();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
public static void show_history(string[] args)
|
public static void show_history(string[] args)
|
||||||
{
|
{
|
||||||
var fp = mp.MpvConfFolder + "history.txt";
|
var fp = mp.MpvConfFolder + "history.txt";
|
||||||
|
|||||||
@@ -341,7 +341,12 @@ namespace mpvnet
|
|||||||
private void Mp_FileLoaded()
|
private void Mp_FileLoaded()
|
||||||
{
|
{
|
||||||
string path = mp.get_property_string("path");
|
string path = mp.get_property_string("path");
|
||||||
BeginInvoke(new Action(() => { Text = Path.GetFileName(path) + " - mpv.net " + Application.ProductVersion; }));
|
BeginInvoke(new Action(() => {
|
||||||
|
if (File.Exists(path) || path.StartsWith("http"))
|
||||||
|
Text = Path.GetFileName(path) + " - mpv.net " + Application.ProductVersion;
|
||||||
|
else
|
||||||
|
Text = "mpv.net " + Application.ProductVersion;
|
||||||
|
}));
|
||||||
if (RecentFiles.Contains(path)) RecentFiles.Remove(path);
|
if (RecentFiles.Contains(path)) RecentFiles.Remove(path);
|
||||||
RecentFiles.Insert(0, path);
|
RecentFiles.Insert(0, path);
|
||||||
if (RecentFiles.Count > 15) RecentFiles.RemoveAt(15);
|
if (RecentFiles.Count > 15) RecentFiles.RemoveAt(15);
|
||||||
|
|||||||
@@ -210,14 +210,14 @@ namespace mpvnet
|
|||||||
if (val.StartsWith("#")) continue;
|
if (val.StartsWith("#")) continue;
|
||||||
if (!val.Contains(" ")) continue;
|
if (!val.Contains(" ")) continue;
|
||||||
CommandItem item = new CommandItem();
|
CommandItem item = new CommandItem();
|
||||||
item.Input = val.Substring(0, val.IndexOf(" ")).Replace("_", "");
|
item.Input = val.Substring(0, val.IndexOf(" "));
|
||||||
|
if (item.Input == "_") item.Input = "";
|
||||||
val = val.Substring(val.IndexOf(" ") + 1);
|
val = val.Substring(val.IndexOf(" ") + 1);
|
||||||
|
|
||||||
if (val.Contains("#menu:"))
|
if (val.Contains("#menu:"))
|
||||||
{
|
{
|
||||||
item.Path = val.Substring(val.IndexOf("#menu:") + 6).Trim();
|
item.Path = val.Substring(val.IndexOf("#menu:") + 6).Trim();
|
||||||
val = val.Substring(0, val.IndexOf("#menu:"));
|
val = val.Substring(0, val.IndexOf("#menu:"));
|
||||||
|
|
||||||
if (item.Path.Contains(";"))
|
if (item.Path.Contains(";"))
|
||||||
item.Path = item.Path.Substring(item.Path.IndexOf(";") + 1).Trim();
|
item.Path = item.Path.Substring(item.Path.IndexOf(";") + 1).Trim();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("3.4.0.0")]
|
[assembly: AssemblyVersion("3.6.0.0")]
|
||||||
[assembly: AssemblyFileVersion("3.4.0.0")]
|
[assembly: AssemblyFileVersion("3.6.0.0")]
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
o script-message mpv.net open-files #menu: Open > Open Files...
|
o script-message mpv.net open-files #menu: Open > Open Files...
|
||||||
u script-message mpv.net open-url #menu: Open > Open URL...
|
u script-message mpv.net open-url #menu: Open > Open URL...
|
||||||
|
Ctrl+S script-message mpv.net show-media-search #menu: Open > Show media search...
|
||||||
_ ignore #menu: Open > -
|
_ ignore #menu: Open > -
|
||||||
Alt+a script-message mpv.net load-audio #menu: Open > Load external audio files...
|
Alt+a script-message mpv.net load-audio #menu: Open > Load external audio files...
|
||||||
Alt+s script-message mpv.net load-sub #menu: Open > Load external subtitle files...
|
Alt+s script-message mpv.net load-sub #menu: Open > Load external subtitle files...
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|||||||
23
mpv.net/Windows/EverythingWindow.xaml
Normal file
23
mpv.net/Windows/EverythingWindow.xaml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<Window x:Class="mpvnet.EverythingWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Media File Search" Height="300" Width="600" ResizeMode="NoResize"
|
||||||
|
WindowStartupLocation="CenterOwner" Loaded="Window_Loaded" FontSize="13">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBox Name="FilterTextBox" PreviewKeyDown="FilterTextBox_PreviewKeyDown" TextChanged="FilterTextBox_TextChanged"></TextBox>
|
||||||
|
<ListView Name="ListView" Grid.Row="1" MouseUp="ListView_MouseUp" PreviewKeyDown="ListView_PreviewKeyDown">
|
||||||
|
<ListView.ItemContainerStyle>
|
||||||
|
<Style TargetType="ListBoxItem">
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
|
||||||
|
</Style>
|
||||||
|
</ListView.ItemContainerStyle>
|
||||||
|
</ListView>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
168
mpv.net/Windows/EverythingWindow.xaml.cs
Normal file
168
mpv.net/Windows/EverythingWindow.xaml.cs
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Interop;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace mpvnet
|
||||||
|
{
|
||||||
|
public partial class EverythingWindow : Window
|
||||||
|
{
|
||||||
|
public EverythingWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
if (App.IsDarkMode)
|
||||||
|
{
|
||||||
|
ListView.Foreground = Brushes.White;
|
||||||
|
ListView.Background = Brushes.Black;
|
||||||
|
FilterTextBox.Foreground = Brushes.White;
|
||||||
|
FilterTextBox.Background = Brushes.Black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const int EVERYTHING_REQUEST_FILE_NAME = 0x00000001;
|
||||||
|
const int EVERYTHING_REQUEST_PATH = 0x00000002;
|
||||||
|
const int EVERYTHING_SORT_SIZE_DESCENDING = 6;
|
||||||
|
|
||||||
|
[DllImport("Everything.dll", CharSet = CharSet.Unicode)]
|
||||||
|
public static extern int Everything_SetSearch(string lpSearchString);
|
||||||
|
|
||||||
|
[DllImport("Everything.dll")]
|
||||||
|
public static extern void Everything_SetRequestFlags(UInt32 dwRequestFlags);
|
||||||
|
|
||||||
|
[DllImport("Everything.dll")]
|
||||||
|
public static extern void Everything_SetSort(UInt32 dwSortType);
|
||||||
|
|
||||||
|
[DllImport("Everything.dll", CharSet = CharSet.Unicode)]
|
||||||
|
public static extern bool Everything_Query(bool bWait);
|
||||||
|
|
||||||
|
[DllImport("Everything.dll", CharSet = CharSet.Unicode)]
|
||||||
|
public static extern void Everything_GetResultFullPathName(UInt32 nIndex, StringBuilder lpString, UInt32 nMaxCount);
|
||||||
|
|
||||||
|
[DllImport("Everything.dll")]
|
||||||
|
public static extern bool Everything_GetResultSize(UInt32 nIndex, out long lpFileSize);
|
||||||
|
|
||||||
|
[DllImport("Everything.dll")]
|
||||||
|
public static extern UInt32 Everything_GetNumResults();
|
||||||
|
|
||||||
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
HwndSource source = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle);
|
||||||
|
source.AddHook(new HwndSourceHook(WndProc));
|
||||||
|
Keyboard.Focus(FilterTextBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SelectFirst()
|
||||||
|
{
|
||||||
|
if (ListView.Items.Count > 0)
|
||||||
|
ListView.SelectedIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
|
||||||
|
{
|
||||||
|
if (msg == 0x200 /*WM_MOUSEMOVE*/ && Mouse.LeftButton != MouseButtonState.Pressed)
|
||||||
|
handled = true;
|
||||||
|
return IntPtr.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FilterTextBox_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
switch (e.Key)
|
||||||
|
{
|
||||||
|
case Key.Up:
|
||||||
|
{
|
||||||
|
int index = ListView.SelectedIndex;
|
||||||
|
index -= 1;
|
||||||
|
if (index < 0) index = 0;
|
||||||
|
ListView.SelectedIndex = index;
|
||||||
|
ListView.ScrollIntoView(ListView.SelectedItem);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Key.Down:
|
||||||
|
{
|
||||||
|
int index = ListView.SelectedIndex;
|
||||||
|
index += 1;
|
||||||
|
if (index > ListView.Items.Count - 1) index = ListView.Items.Count - 1;
|
||||||
|
ListView.SelectedIndex = index;
|
||||||
|
ListView.ScrollIntoView(ListView.SelectedItem);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Key.Escape:
|
||||||
|
Close();
|
||||||
|
break;
|
||||||
|
case Key.Enter:
|
||||||
|
Execute();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ListView_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Escape) Close();
|
||||||
|
if (e.Key == Key.Enter) Execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Execute()
|
||||||
|
{
|
||||||
|
if (ListView.SelectedItem != null)
|
||||||
|
mp.LoadFiles(ListView.SelectedItem as string);
|
||||||
|
Keyboard.Focus(FilterTextBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ListView_MouseUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
Execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FilterTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
{
|
||||||
|
string searchtext = FilterTextBox.Text;
|
||||||
|
Task.Run(() => Search(searchtext));
|
||||||
|
}
|
||||||
|
|
||||||
|
object LockObject = new object();
|
||||||
|
|
||||||
|
void Search(string searchtext)
|
||||||
|
{
|
||||||
|
lock (LockObject)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
List<string> items = new List<string>();
|
||||||
|
UInt32 i;
|
||||||
|
const int bufsize = 500;
|
||||||
|
StringBuilder buf = new StringBuilder(bufsize);
|
||||||
|
Everything_SetSearch(searchtext);
|
||||||
|
Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME | EVERYTHING_REQUEST_PATH);
|
||||||
|
Everything_SetSort(EVERYTHING_SORT_SIZE_DESCENDING);
|
||||||
|
Everything_Query(true);
|
||||||
|
for (i = 0; i < Everything_GetNumResults(); i++)
|
||||||
|
{
|
||||||
|
Everything_GetResultFullPathName(i, buf, bufsize);
|
||||||
|
string ext = Path.GetExtension(buf.ToString()).TrimStart('.').ToLower();
|
||||||
|
if (App.AudioTypes.Contains(ext) || App.VideoTypes.Contains(ext))
|
||||||
|
items.Add(buf.ToString());
|
||||||
|
if (items.Count > 100) break;
|
||||||
|
}
|
||||||
|
Application.Current.Dispatcher.Invoke(() => {
|
||||||
|
ListView.ItemsSource = items;
|
||||||
|
SelectFirst();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
Msg.ShowError("Search query failed.",
|
||||||
|
"The search feature depends on [Everything](https://www.voidtools.com) being installed.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,10 +30,19 @@ namespace mpvnet
|
|||||||
if (App.IsDarkMode)
|
if (App.IsDarkMode)
|
||||||
{
|
{
|
||||||
Foreground = Brushes.White;
|
Foreground = Brushes.White;
|
||||||
|
Foreground2 = Brushes.Silver;
|
||||||
Background = Brushes.Black;
|
Background = Brushes.Black;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Brush Foreground2 {
|
||||||
|
get { return (Brush)GetValue(Foreground2Property); }
|
||||||
|
set { SetValue(Foreground2Property, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty Foreground2Property =
|
||||||
|
DependencyProperty.Register("Foreground2", typeof(Brush), typeof(ConfWindow), new PropertyMetadata(Brushes.DarkSlateGray));
|
||||||
|
|
||||||
private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
CollectionView.Refresh();
|
CollectionView.Refresh();
|
||||||
|
|||||||
@@ -565,17 +565,15 @@ namespace mpvnet
|
|||||||
if (get_property_int("playlist-count") == 1)
|
if (get_property_int("playlist-count") == 1)
|
||||||
{
|
{
|
||||||
string path = get_property_string("path");
|
string path = get_property_string("path");
|
||||||
if (!Directory.Exists(Path.GetDirectoryName(path))) return;
|
if (!File.Exists(path)) return;
|
||||||
List<string> files = Directory.GetFiles(Path.GetDirectoryName(path)).ToList();
|
List<string> files = Directory.GetFiles(Path.GetDirectoryName(path)).ToList();
|
||||||
files = files.Where((file) => App.VideoTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower()) ||
|
files = files.Where((file) => App.VideoTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower()) ||
|
||||||
App.AudioTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower())).ToList();
|
App.AudioTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower())).ToList();
|
||||||
files.Sort(new StringLogicalComparer());
|
files.Sort(new StringLogicalComparer());
|
||||||
int index = files.IndexOf(path);
|
int index = files.IndexOf(path);
|
||||||
files.Remove(path);
|
files.Remove(path);
|
||||||
|
|
||||||
foreach (string i in files)
|
foreach (string i in files)
|
||||||
commandv("loadfile", i, "append");
|
commandv("loadfile", i, "append");
|
||||||
|
|
||||||
if (index > 0)
|
if (index > 0)
|
||||||
commandv("playlist-move", "0", (index + 1).ToString());
|
commandv("playlist-move", "0", (index + 1).ToString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,6 +146,10 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Windows\EverythingWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Include="Windows\CommandPaletteWindow.xaml">
|
<Page Include="Windows\CommandPaletteWindow.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -191,6 +195,9 @@
|
|||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="TaskDialog.cs" />
|
<Compile Include="TaskDialog.cs" />
|
||||||
|
<Compile Include="Windows\EverythingWindow.xaml.cs">
|
||||||
|
<DependentUpon>EverythingWindow.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Windows\CommandPaletteWindow.xaml.cs">
|
<Compile Include="Windows\CommandPaletteWindow.xaml.cs">
|
||||||
<DependentUpon>CommandPaletteWindow.xaml</DependentUpon>
|
<DependentUpon>CommandPaletteWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -245,7 +252,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Resources\inputConfHeader.txt" />
|
<Content Include="Resources\inputConfHeader.txt" />
|
||||||
<Content Include="screenshot.jpg" />
|
|
||||||
<Content Include="Resources\inputConf.txt" />
|
<Content Include="Resources\inputConf.txt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 497 KiB |
Reference in New Issue
Block a user