mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-12-12 02:00:27 +08:00
Compare commits
5 Commits
copilot/fi
...
copilot/ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99b11a08be | ||
|
|
897cfa5804 | ||
|
|
d7edd92204 | ||
|
|
cbf3e566d9 | ||
|
|
f41fb0a68e |
Submodule QuickLook.Common updated: da24be3fc9...709f26fa38
@@ -30,7 +30,7 @@
|
||||
HWND hMsgWnd;
|
||||
HANDLE hGetResultEvent;
|
||||
|
||||
PCHAR pXmlBuffer;
|
||||
PCHAR pXmlBuffer = nullptr;
|
||||
|
||||
void DOpus::GetSelected(PWCHAR buffer)
|
||||
{
|
||||
@@ -72,9 +72,12 @@ void DOpus::GetSelected(PWCHAR buffer)
|
||||
|
||||
WaitForSingleObject(hGetResultEvent, 2000);
|
||||
|
||||
ParseXmlBuffer(buffer);
|
||||
|
||||
delete[] pXmlBuffer;
|
||||
if (pXmlBuffer != nullptr)
|
||||
{
|
||||
ParseXmlBuffer(buffer);
|
||||
delete[] pXmlBuffer;
|
||||
pXmlBuffer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void DOpus::ParseXmlBuffer(PWCHAR buffer)
|
||||
@@ -88,6 +91,9 @@ void DOpus::ParseXmlBuffer(PWCHAR buffer)
|
||||
* ...
|
||||
*/
|
||||
|
||||
if (pXmlBuffer == nullptr)
|
||||
return;
|
||||
|
||||
using namespace rapidxml;
|
||||
|
||||
xml_document<> doc;
|
||||
|
||||
@@ -351,7 +351,7 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan
|
||||
|
||||
private void ChangeVolume(double delta)
|
||||
{
|
||||
LinearVolume += delta;
|
||||
LinearVolume = Math.Max(0d, Math.Min(1d, LinearVolume + delta));
|
||||
}
|
||||
|
||||
private void TogglePlayPause(object sender, EventArgs e)
|
||||
@@ -385,16 +385,16 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan
|
||||
UpdateMeta(path, info);
|
||||
|
||||
// detect rotation
|
||||
double.TryParse(info?.Get(StreamKind.Video, 0, "Rotation"), out var rotation);
|
||||
_ = double.TryParse(info?.Get(StreamKind.Video, 0, "Rotation"), out var rotation);
|
||||
// Correct rotation: on some machine the value "90" becomes "90000" by some reason
|
||||
if (rotation > 360)
|
||||
if (rotation > 360d)
|
||||
rotation /= 1e3;
|
||||
if (Math.Abs(rotation) > 0.1)
|
||||
mediaElement.LayoutTransform = new RotateTransform(rotation, 0.5, 0.5);
|
||||
if (Math.Abs(rotation) > 0.1d)
|
||||
mediaElement.LayoutTransform = new RotateTransform(rotation, 0.5d, 0.5d);
|
||||
|
||||
mediaElement.Source = new Uri(path);
|
||||
// old plugin use an int-typed "Volume" config key ranged from 0 to 100. Let's use a new one here.
|
||||
LinearVolume = SettingHelper.Get("VolumeDouble", 1d, "QuickLook.Plugin.VideoViewer");
|
||||
LinearVolume = Math.Max(0d, Math.Min(1d, SettingHelper.Get("VolumeDouble", 1d, "QuickLook.Plugin.VideoViewer")));
|
||||
|
||||
mediaElement.Play();
|
||||
}
|
||||
|
||||
@@ -64,6 +64,8 @@ public partial class ViewerWindow : Window
|
||||
Topmost = SettingHelper.Get("Topmost", false);
|
||||
buttonTop.Tag = Topmost ? "Top" : "Auto";
|
||||
|
||||
ShowInTaskbar = SettingHelper.Get("ShowInTaskbar", false);
|
||||
|
||||
buttonTop.Click += (_, _) =>
|
||||
{
|
||||
Topmost = !Topmost;
|
||||
|
||||
Reference in New Issue
Block a user