Add project files.

This commit is contained in:
Joshua Askharoun
2022-03-03 08:14:05 -06:00
parent cfa6f93211
commit 1198cc8a66
967 changed files with 118389 additions and 0 deletions
@@ -0,0 +1,126 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.Audio.SoundData
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Data;
using Microsoft.Iris.Library;
using Microsoft.Iris.Render;
using Microsoft.Iris.Render.Extensions;
using System;
namespace Microsoft.Iris.RenderAPI.Audio
{
internal class SoundData : ISoundData, IDisposable
{
private string _stSource;
private Resource _soundResource;
private uint _openCount;
private bool _fStreamLoading;
private bool _fStreamAvailable;
private ExtensionsApi.HSpSound _soundHandle;
private ExtensionsApi.SoundInformation _soundInfo;
internal SoundData(string stSource, Resource soundResource)
{
_stSource = stSource;
_soundResource = soundResource;
_fStreamAvailable = false;
_fStreamLoading = false;
}
~SoundData() => Dispose(false);
public void Dispose()
{
GC.SuppressFinalize(this);
Dispose(true);
}
protected virtual void Dispose(bool fInDispose)
{
int num = fInDispose ? 1 : 0;
if (!(_soundHandle != ExtensionsApi.HSpSound.NULL))
return;
SoundLoader.DisposeData(_soundHandle, _soundInfo);
_soundHandle = ExtensionsApi.HSpSound.NULL;
}
internal bool IsAvailable => _soundHandle != ExtensionsApi.HSpSound.NULL;
public bool Load()
{
bool flag = false;
if (_openCount == 0U && !_fStreamAvailable && !_fStreamLoading)
{
_fStreamLoading = true;
_soundResource.Acquire(new ResourceAcquisitionCompleteHandler(OnContentLoadComplete));
}
if (_soundHandle != ExtensionsApi.HSpSound.NULL)
flag = true;
else if (_fStreamAvailable)
{
if (_soundResource.Status == ResourceStatus.Available)
{
ExtensionsApi.HSpSound soundDataHandle;
ExtensionsApi.SoundInformation soundDataInfo;
SoundLoader.FromMemory(_soundResource.Buffer, (int)_soundResource.Length, out soundDataHandle, out soundDataInfo);
_soundHandle = soundDataHandle;
_soundInfo = soundDataInfo;
flag = true;
}
}
else
flag = false;
++_openCount;
return flag;
}
public void Unload()
{
--_openCount;
if (_openCount != 0U)
return;
if (_fStreamAvailable)
{
_soundResource.Free(new ResourceAcquisitionCompleteHandler(OnContentLoadComplete));
_fStreamAvailable = false;
}
if (!(_soundHandle != ExtensionsApi.HSpSound.NULL))
return;
SoundLoader.DisposeData(_soundHandle, _soundInfo);
_soundHandle = ExtensionsApi.HSpSound.NULL;
}
public static string GetCacheKey(string stSource) => InvariantString.Format("SND|{0}", stSource);
SoundDataFormat ISoundData.Format => (SoundDataFormat)_soundInfo.Header.wFormatTag;
uint ISoundData.ChannelCount => _soundInfo.Header.nChannels;
uint ISoundData.SampleRate => _soundInfo.Header.nSamplesPerSec;
uint ISoundData.SampleSize => _soundInfo.Header.wBitsPerSample;
uint ISoundData.SampleCount => _soundInfo.Header.cbDataSize * 8U / _soundInfo.Header.wBitsPerSample;
IntPtr ISoundData.AcquireContent()
{
if (Load())
return _soundInfo.Data.rgData;
throw new InvalidOperationException("Sound data isn't available");
}
void ISoundData.ReleaseContent() => Unload();
private void OnContentLoadComplete(Resource resource)
{
_fStreamLoading = false;
if (_soundResource.Status == ResourceStatus.Error)
_fStreamAvailable = false;
else
_fStreamAvailable = true;
}
}
}
@@ -0,0 +1,109 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.Audio.SoundManager
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Data;
using Microsoft.Iris.Library;
using Microsoft.Iris.Render;
using Microsoft.Iris.Session;
using System;
using System.Collections.Generic;
namespace Microsoft.Iris.RenderAPI.Audio
{
internal class SoundManager : IDisposable
{
private UISession _uiSession;
private IRenderSession _renderSession;
private Dictionary<string, SoundManager.SoundContent> _dictContent;
private SystemSoundEventTable _systemSoundEventTable;
internal SoundManager(UISession uiSession, IRenderSession renderSession)
{
_uiSession = uiSession;
_renderSession = renderSession;
_dictContent = new Dictionary<string, SoundManager.SoundContent>(InvariantString.OrdinalComparer);
}
~SoundManager() => Dispose(false);
public void Dispose()
{
GC.SuppressFinalize(this);
Dispose(true);
}
protected virtual void Dispose(bool fInDispose)
{
if (fInDispose && _dictContent != null)
{
foreach (SoundManager.SoundContent soundContent in _dictContent.Values)
{
if (soundContent.soundBuffer != null)
soundContent.soundBuffer.UnregisterUsage(this);
if (soundContent.soundData != null)
{
soundContent.soundData.Unload();
soundContent.soundData.Dispose();
}
}
_dictContent.Clear();
}
_dictContent = null;
_renderSession = null;
_uiSession = null;
}
internal string GetSystemSoundEventSource(SystemSoundEvent systemSoundEvent)
{
if (_systemSoundEventTable == null)
_systemSoundEventTable = new SystemSoundEventTable();
string filePath = _systemSoundEventTable.GetFilePath(systemSoundEvent);
return string.IsNullOrEmpty(filePath) ? null : string.Format("file://{0}", filePath);
}
public void SetVolume(float flVolume)
{
if (_renderSession.SoundDevice == null)
return;
_renderSession.SoundDevice.Volume = flVolume;
}
public void SetMute(bool fMute)
{
if (_renderSession.SoundDevice == null)
return;
_renderSession.SoundDevice.Mute = fMute;
}
internal ISoundBuffer GetSoundBuffer(string source)
{
bool flag = false;
string cacheKey = SoundData.GetCacheKey(source);
SoundManager.SoundContent soundContent;
if (!_dictContent.TryGetValue(cacheKey, out soundContent))
{
Resource resource = ResourceManager.Instance.GetResource(source);
if (resource == null)
return null;
soundContent = new SoundManager.SoundContent();
soundContent.soundData = new SoundData(cacheKey, resource);
soundContent.soundData.Load();
flag = true;
}
if (soundContent.soundBuffer == null && soundContent.soundData.IsAvailable && _renderSession.SoundDevice != null)
soundContent.soundBuffer = _renderSession.SoundDevice.CreateSoundBuffer(this, soundContent.soundData);
if (flag)
_dictContent[cacheKey] = soundContent;
return soundContent.soundBuffer;
}
private class SoundContent
{
public SoundData soundData;
public ISoundBuffer soundBuffer;
}
}
}
@@ -0,0 +1,42 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.Audio.SystemSoundEvent
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.RenderAPI.Audio
{
internal enum SystemSoundEvent
{
None,
Asterisk,
CloseProgram,
CriticalBatteryAlarm,
CriticalStop,
DefaultBeep,
DeviceConnect,
DeviceDisconnect,
DeviceFailedToConnect,
Exclamation,
ExitWindows,
LowBatteryAlarm,
Maximize,
MenuCommand,
MenuPopup,
Minimize,
NewFaxNotification,
NewMailNotification,
OpenProgram,
PrintComplete,
ProgramError,
Question,
RestoreDown,
RestoreUp,
Select,
ShowToolbarBand,
StartWindows,
SystemNotification,
WindowsLogoff,
WindowsLogon,
}
}
@@ -0,0 +1,83 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.Audio.SystemSoundEventTable
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Debug;
namespace Microsoft.Iris.RenderAPI.Audio
{
internal class SystemSoundEventTable
{
private static readonly string s_RegistryParentKey = "AppEvents\\Schemes\\Apps\\.Default";
private Map<SystemSoundEvent, SystemSoundEventTable.SystemSound> m_systemSoundDictionary;
public SystemSoundEventTable()
{
m_systemSoundDictionary = new Map<SystemSoundEvent, SystemSoundEventTable.SystemSound>();
Add(SystemSoundEvent.Asterisk, "SystemAsterisk");
Add(SystemSoundEvent.CloseProgram, "CloseProgram");
Add(SystemSoundEvent.CriticalBatteryAlarm, "CriticalBatteryAlarm");
Add(SystemSoundEvent.CriticalStop, "SystemHand");
Add(SystemSoundEvent.DefaultBeep, ".Default");
Add(SystemSoundEvent.DeviceConnect, "DeviceConnect");
Add(SystemSoundEvent.DeviceDisconnect, "DeviceDisconnect");
Add(SystemSoundEvent.DeviceFailedToConnect, "DeviceFail");
Add(SystemSoundEvent.Exclamation, "SystemExclamation");
Add(SystemSoundEvent.ExitWindows, "SystemExit");
Add(SystemSoundEvent.LowBatteryAlarm, "LowBatteryAlarm");
Add(SystemSoundEvent.Maximize, "Maximize");
Add(SystemSoundEvent.MenuCommand, "MenuCommand");
Add(SystemSoundEvent.MenuPopup, "MenuPopup");
Add(SystemSoundEvent.Minimize, "Minimize");
Add(SystemSoundEvent.NewFaxNotification, "FaxBeep");
Add(SystemSoundEvent.NewMailNotification, "MailBeep");
Add(SystemSoundEvent.OpenProgram, "Open");
Add(SystemSoundEvent.PrintComplete, "PrintComplete");
Add(SystemSoundEvent.ProgramError, "AppGPFault");
Add(SystemSoundEvent.Question, "SystemQuestion");
Add(SystemSoundEvent.RestoreDown, "RestoreDown");
Add(SystemSoundEvent.RestoreUp, "RestoreUp");
Add(SystemSoundEvent.Select, "CCSelect");
Add(SystemSoundEvent.ShowToolbarBand, "ShowBand");
Add(SystemSoundEvent.StartWindows, "SystemStart");
Add(SystemSoundEvent.SystemNotification, "SystemNotification");
Add(SystemSoundEvent.WindowsLogoff, "WindowsLogoff");
Add(SystemSoundEvent.WindowsLogon, "WindowsLogon");
Refresh();
}
public void Refresh()
{
RegistryKey registryKey1 = RegistryKey.Open(RegistryKey.HKEY_CURRENT_USER, s_RegistryParentKey);
if (registryKey1 == null)
return;
foreach (SystemSoundEventTable.SystemSound systemSound in m_systemSoundDictionary.Values)
{
RegistryKey registryKey2 = registryKey1.OpenSubKey(systemSound.RegistrySubKey + "\\.Current");
if (registryKey2 != null)
{
registryKey2.ReadString(null, out systemSound.FilePath);
registryKey2.Close();
}
}
registryKey1.Close();
}
public string GetFilePath(SystemSoundEvent systemSoundEvent) => m_systemSoundDictionary[systemSoundEvent].FilePath;
private void Add(SystemSoundEvent systemSoundEvent, string registrySubKey) => m_systemSoundDictionary.Add(systemSoundEvent, new SystemSoundEventTable.SystemSound()
{
Event = systemSoundEvent,
RegistrySubKey = registrySubKey
});
internal class SystemSound
{
public SystemSoundEvent Event;
public string RegistrySubKey;
public string FilePath;
}
}
}
@@ -0,0 +1,51 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.Drawing.Dib
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.OS;
using Microsoft.Iris.Render;
using System;
namespace Microsoft.Iris.RenderAPI.Drawing
{
internal sealed class Dib : IDisposable
{
private IntPtr m_hdib;
private IntPtr m_prgbData;
private Size m_sizePxl;
public Dib(IntPtr hdib, IntPtr prgbData, Size sizePxl)
{
m_hdib = hdib;
m_prgbData = prgbData;
m_sizePxl = sizePxl;
}
~Dib() => Dispose(false);
public void Dispose()
{
GC.SuppressFinalize(this);
Dispose(true);
}
private void Dispose(bool fInDispose)
{
if (!(m_hdib != IntPtr.Zero))
return;
NativeApi.SpFreeDib(m_hdib);
m_hdib = IntPtr.Zero;
m_prgbData = IntPtr.Zero;
}
public Size ContentSize => m_sizePxl;
public int Stride => m_sizePxl.Width * 4;
public ImageFormat ImageFormat => ImageFormat.A8R8G8B8;
internal IntPtr Data => m_prgbData;
}
}
@@ -0,0 +1,205 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.Drawing.EdgeFade
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Drawing;
using Microsoft.Iris.Render;
using Microsoft.Iris.Session;
using System;
namespace Microsoft.Iris.RenderAPI.Drawing
{
internal class EdgeFade
{
private IGradient _minFadeGradient;
private IGradient _maxFadeGradient;
private float _fadeSizeValue;
private float _fadeAmountValue;
private float _minOffsetValue;
private float _maxOffsetValue;
private Orientation _orientation;
private Color _maskColor;
public EdgeFade()
{
_orientation = Orientation.Horizontal;
_maskColor = Color.FromArgb(byte.MaxValue, 0, 0, 0);
_fadeAmountValue = 1f;
}
public void Dispose() => DisposeGradients();
private void DisposeGradients()
{
if (_minFadeGradient != null)
{
_minFadeGradient.UnregisterUsage(this);
_minFadeGradient = null;
}
if (_maxFadeGradient == null)
return;
_maxFadeGradient.UnregisterUsage(this);
_maxFadeGradient = null;
}
public float FadeSize
{
get => _fadeSizeValue;
set
{
if (_fadeSizeValue == (double)value)
return;
_fadeSizeValue = value;
UpdateFades(true);
}
}
public float FadeAmount
{
get => _fadeAmountValue;
set
{
if (value < 0.0 || value > 1.0)
throw new ArgumentOutOfRangeException(nameof(value), value, "FadeAmount must be between 0.0 and 1.0.");
if (_fadeAmountValue == (double)value)
return;
_fadeAmountValue = value;
UpdateFades(true);
}
}
public float MinOffset
{
get => _minOffsetValue;
set
{
if (_minOffsetValue == (double)value)
return;
_minOffsetValue = value;
UpdateFades(true);
}
}
public float MaxOffset
{
get => _maxOffsetValue;
set
{
if (_maxOffsetValue == (double)value)
return;
_maxOffsetValue = value;
UpdateFades(true);
}
}
public Orientation Orientation
{
get => _orientation;
set
{
if (_orientation == value)
return;
_orientation = value;
UpdateFades(false);
}
}
public Color ColorMask
{
get => _maskColor;
set
{
if (!(_maskColor != value))
return;
_maskColor = value;
UpdateFades(false);
}
}
internal void ApplyGradients(
IVisualContainer visContainer,
IRenderSession renderSession,
bool minFlag,
bool maxFlag)
{
visContainer.RemoveAllGradients();
CreateFades(renderSession);
UpdateFades(true);
if (minFlag && _minFadeGradient != null)
visContainer.AddGradient(_minFadeGradient);
if (!maxFlag || _maxFadeGradient == null)
return;
visContainer.AddGradient(_maxFadeGradient);
}
internal bool NeedFades => _fadeSizeValue != 0.0 && _fadeAmountValue != 0.0;
private void CreateFades(IRenderSession renderSession)
{
if (!NeedFades)
return;
if (_minFadeGradient == null)
{
_minFadeGradient = renderSession.CreateGradient(this);
_minFadeGradient.Orientation = _orientation;
_minFadeGradient.ColorMask = _maskColor.RenderConvert();
}
if (_maxFadeGradient != null)
return;
_maxFadeGradient = renderSession.CreateGradient(this);
_maxFadeGradient.Orientation = _orientation;
_maxFadeGradient.ColorMask = _maskColor.RenderConvert();
}
private void UpdateFades(bool isOffsetChange)
{
if (!NeedFades)
{
DisposeGradients();
}
else
{
if (_minFadeGradient == null)
return;
_minFadeGradient.Orientation = _orientation;
_maxFadeGradient.Orientation = _orientation;
_minFadeGradient.ColorMask = _maskColor.RenderConvert();
_maxFadeGradient.ColorMask = _maskColor.RenderConvert();
if (!isOffsetChange)
return;
_minFadeGradient.Clear();
_maxFadeGradient.Clear();
float flValue1 = 1f;
float flValue2 = 1f - _fadeAmountValue;
float flPosition1;
float flPosition2;
if (!UISession.Default.IsRtl || _orientation == Orientation.Vertical)
{
flPosition1 = _minOffsetValue;
flPosition2 = _maxOffsetValue;
}
else
{
flPosition1 = -_maxOffsetValue;
flPosition2 = -_minOffsetValue;
}
if (FadeSize > 0.0)
{
_minFadeGradient.AddValue(flPosition1, flValue2, RelativeSpace.Min);
_minFadeGradient.AddValue(flPosition1 + FadeSize, flValue1, RelativeSpace.Min);
_maxFadeGradient.AddValue(flPosition2 - FadeSize, flValue1, RelativeSpace.Max);
_maxFadeGradient.AddValue(flPosition2, flValue2, RelativeSpace.Max);
}
else
{
_minFadeGradient.AddValue(flPosition1 + FadeSize, flValue2, RelativeSpace.Min);
_minFadeGradient.AddValue(flPosition1, flValue1, RelativeSpace.Min);
_maxFadeGradient.AddValue(flPosition2, flValue1, RelativeSpace.Max);
_maxFadeGradient.AddValue(flPosition2 - FadeSize, flValue2, RelativeSpace.Max);
}
}
}
}
}
@@ -0,0 +1,71 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.Drawing.PointF
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Render;
using System;
using System.Globalization;
using System.Text;
namespace Microsoft.Iris.RenderAPI.Drawing
{
internal struct PointF
{
private float x;
private float y;
public static readonly PointF Zero = new PointF(0.0f, 0.0f);
public PointF(float x, float y)
{
this.x = x;
this.y = y;
}
internal bool IsZero => X == 0.0 && Y == 0.0;
public float X
{
get => x;
set => x = value;
}
public float Y
{
get => y;
set => y = value;
}
public static PointF operator +(PointF pt, Size sz) => new PointF(pt.X + sz.Width, pt.Y + sz.Height);
public static PointF operator +(PointF pt, SizeF sz) => new PointF(pt.X + sz.Width, pt.Y + sz.Height);
public static PointF operator -(PointF pt, Size sz) => new PointF(pt.X - sz.Width, pt.Y - sz.Height);
public static PointF operator -(PointF pt, SizeF sz) => new PointF(pt.X - sz.Width, pt.Y - sz.Height);
public static SizeF operator -(PointF pt1, PointF pt2) => new SizeF(pt1.X - pt2.X, pt1.Y - pt2.Y);
public static bool operator ==(PointF left, PointF right) => left.X == (double)right.X && left.Y == (double)right.Y;
public static bool operator !=(PointF left, PointF right) => !(left == right);
public Point ToPoint() => new Point((int)x, (int)y);
public override bool Equals(object obj) => obj is PointF pointF && pointF.X == (double)X && pointF.Y == (double)Y;
public override int GetHashCode() => x.GetHashCode() ^ y.GetHashCode();
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder(32);
stringBuilder.Append("(X=");
stringBuilder.Append(X.ToString(NumberFormatInfo.InvariantInfo));
stringBuilder.Append(", Y=");
stringBuilder.Append(Y.ToString(NumberFormatInfo.InvariantInfo));
stringBuilder.Append(")");
return stringBuilder.ToString();
}
}
}
@@ -0,0 +1,205 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.Drawing.RectangleF
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Library;
using Microsoft.Iris.Render;
using System;
using System.Globalization;
using System.Text;
namespace Microsoft.Iris.RenderAPI.Drawing
{
[Serializable]
internal struct RectangleF
{
public static readonly RectangleF Zero = new RectangleF(0.0f, 0.0f, 0.0f, 0.0f);
private float x;
private float y;
private float width;
private float height;
public RectangleF(float x, float y, float width, float height)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
public RectangleF(PointF location, SizeF size)
{
x = location.X;
y = location.Y;
width = size.Width;
height = size.Height;
}
public RectangleF(Point location, Microsoft.Iris.Render.Size size)
{
x = location.X;
y = location.Y;
width = size.Width;
height = size.Height;
}
public static RectangleF FromLTRB(float left, float top, float right, float bottom) => new RectangleF(left, top, right - left, bottom - top);
public static RectangleF FromRectangle(Rectangle r) => new RectangleF(r.X, r.Y, r.Width, r.Height);
public PointF Location
{
get => new PointF(X, Y);
set
{
X = value.X;
Y = value.Y;
}
}
public SizeF Size
{
get => new SizeF(Width, Height);
set
{
Width = value.Width;
Height = value.Height;
}
}
public float X
{
get => x;
set => x = value;
}
public float Y
{
get => y;
set => y = value;
}
public float Width
{
get => width;
set => width = value;
}
public float Height
{
get => height;
set => height = value;
}
public float Left => X;
public float Top => Y;
public float Right => X + Width;
public float Bottom => Y + Height;
public bool IsEmpty => Math2.WithinEpsilon(width, 0.0f) || Math2.WithinEpsilon(height, 0.0f);
public override bool Equals(object obj) => obj is RectangleF rectangleF && rectangleF.X == (double)X && (rectangleF.Y == (double)Y && rectangleF.Width == (double)Width) && rectangleF.Height == (double)Height;
public static bool operator ==(RectangleF left, RectangleF right) => left.X == (double)right.X && left.Y == (double)right.Y && left.Width == (double)right.Width && left.Height == (double)right.Height;
public static bool operator !=(RectangleF left, RectangleF right) => !(left == right);
public bool Contains(float x, float y) => X <= (double)x && x < X + (double)Width && Y <= (double)y && y < Y + (double)Height;
public bool Contains(PointF pt) => Contains(pt.X, pt.Y);
public bool Contains(RectangleF rect) => X <= (double)rect.X && rect.X + (double)rect.Width <= X + (double)Width && Y <= (double)rect.Y && rect.Y + (double)rect.Height <= Y + (double)Height;
public override int GetHashCode() => (int)(uint)X ^ ((int)(uint)Y << 13 | (int)((uint)Y >> 19)) ^ ((int)(uint)Width << 26 | (int)((uint)Width >> 6)) ^ ((int)(uint)Height << 7 | (int)((uint)Height >> 25));
public void Inflate(float x, float y)
{
X -= x;
Y -= y;
Width += 2f * x;
Height += 2f * y;
}
public void Inflate(SizeF size) => Inflate(size.Width, size.Height);
public static RectangleF Inflate(RectangleF rect, float x, float y)
{
RectangleF rectangleF = rect;
rectangleF.Inflate(x, y);
return rectangleF;
}
public void Intersect(RectangleF rect)
{
RectangleF rectangleF = Intersect(rect, this);
X = rectangleF.X;
Y = rectangleF.Y;
Width = rectangleF.Width;
Height = rectangleF.Height;
}
public static RectangleF Intersect(RectangleF a, RectangleF b)
{
float x = Math.Max(a.X, b.X);
float num1 = Math.Min(a.X + a.Width, b.X + b.Width);
float y = Math.Max(a.Y, b.Y);
float num2 = Math.Min(a.Y + a.Height, b.Y + b.Height);
return num1 >= (double)x && num2 >= (double)y ? new RectangleF(x, y, num1 - x, num2 - y) : Zero;
}
public bool IntersectsWith(RectangleF rect) => Left < (double)rect.Right && Top < (double)rect.Bottom && Right > (double)rect.Left && Bottom > (double)rect.Top;
public static RectangleF Union(RectangleF a, RectangleF b)
{
float x = Math.Min(a.X, b.X);
float num1 = Math.Max(a.X + a.Width, b.X + b.Width);
float y = Math.Min(a.Y, b.Y);
float num2 = Math.Max(a.Y + a.Height, b.Y + b.Height);
return new RectangleF(x, y, num1 - x, num2 - y);
}
public void Offset(PointF pos) => Offset(pos.X, pos.Y);
public void Offset(float x, float y)
{
X += x;
Y += y;
}
public static RectangleF Offset(RectangleF rect, PointF pos)
{
rect.Offset(pos);
return rect;
}
public PointF TopLeft => new PointF(Left, Top);
public PointF TopRight => new PointF(Right, Top);
public PointF BottomLeft => new PointF(Left, Bottom);
public PointF BottomRight => new PointF(Right, Bottom);
public PointF Center => new PointF(x + width / 2f, y + height / 2f);
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder(128);
stringBuilder.Append("(X=");
stringBuilder.Append(X.ToString(NumberFormatInfo.InvariantInfo));
stringBuilder.Append(", Y=");
stringBuilder.Append(Y.ToString(NumberFormatInfo.InvariantInfo));
stringBuilder.Append(", Width=");
stringBuilder.Append(Width.ToString(NumberFormatInfo.InvariantInfo));
stringBuilder.Append(", Height=");
stringBuilder.Append(Height.ToString(NumberFormatInfo.InvariantInfo));
stringBuilder.Append(")");
return stringBuilder.ToString();
}
}
}
@@ -0,0 +1,96 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.Drawing.SizeF
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using System;
using System.Globalization;
using System.Text;
namespace Microsoft.Iris.RenderAPI.Drawing
{
[Serializable]
internal struct SizeF
{
private float width;
private float height;
public static readonly SizeF Zero = new SizeF(0.0f, 0.0f);
public SizeF(SizeF size)
{
width = size.width;
height = size.height;
}
public SizeF(PointF pt)
{
width = pt.X;
height = pt.Y;
}
public SizeF(float width, float height)
{
this.width = width;
this.height = height;
}
public static SizeF operator +(SizeF sz1, SizeF sz2) => new SizeF(sz1.Width + sz2.Width, sz1.Height + sz2.Height);
public static SizeF operator -(SizeF sz1, SizeF sz2) => new SizeF(sz1.Width - sz2.Width, sz1.Height - sz2.Height);
public static bool operator ==(SizeF sz1, SizeF sz2) => sz1.Width == (double)sz2.Width && sz1.Height == (double)sz2.Height;
public static bool operator !=(SizeF sz1, SizeF sz2) => !(sz1 == sz2);
public PointF ToPointF() => new PointF(Width, Height);
internal bool IsZero => Width == 0.0 && Height == 0.0;
public float Width
{
get => width;
set => width = value;
}
public float Height
{
get => height;
set => height = value;
}
public void Scale(float flScale)
{
Width *= flScale;
Height *= flScale;
}
public static SizeF Scale(SizeF size, float flScale)
{
SizeF sizeF = size;
sizeF.Scale(flScale);
return sizeF;
}
public override bool Equals(object obj) => obj is SizeF sizeF && sizeF.Width == (double)Width && sizeF.Height == (double)Height;
public bool Equals(SizeF comp) => comp.Width == (double)Width && comp.Height == (double)Height;
public override int GetHashCode() => width.GetHashCode() ^ height.GetHashCode();
public static SizeF Min(SizeF sz1, SizeF sz2) => new SizeF(Math.Min(sz1.Width, sz2.Width), Math.Min(sz1.Height, sz2.Height));
public static SizeF Max(SizeF sz1, SizeF sz2) => new SizeF(Math.Max(sz1.Width, sz2.Width), Math.Max(sz1.Height, sz2.Height));
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder(32);
stringBuilder.Append("(Width=");
stringBuilder.Append(Width.ToString(NumberFormatInfo.InvariantInfo));
stringBuilder.Append(", Height=");
stringBuilder.Append(Height.ToString(NumberFormatInfo.InvariantInfo));
stringBuilder.Append(")");
return stringBuilder.ToString();
}
}
}
+42
View File
@@ -0,0 +1,42 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.HRESULT
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using System;
using System.Globalization;
using System.Runtime.InteropServices;
namespace Microsoft.Iris.RenderAPI
{
internal struct HRESULT
{
public int hr;
public HRESULT(int hr) => this.hr = hr;
public static bool operator ==(HRESULT hrA, HRESULT hrB) => hrA.hr == hrB.hr;
public static bool operator !=(HRESULT hrA, HRESULT hrB) => hrA.hr != hrB.hr;
public override bool Equals(object oCompare) => oCompare is HRESULT hresult && hr == hresult.hr;
public override int GetHashCode() => hr;
public override string ToString() => "hr:" + hr.ToString("X", CultureInfo.InvariantCulture);
public bool IsError() => hr < 0;
public bool IsSuccess() => hr >= 0;
public void HandleError()
{
if (!IsError())
return;
Marshal.ThrowExceptionForHR(hr);
}
public int Int => hr;
}
}
+93
View File
@@ -0,0 +1,93 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.Memory
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using System;
namespace Microsoft.Iris.RenderAPI
{
internal static class Memory
{
public static unsafe bool IsOverlap(IntPtr pvA, int cbA, IntPtr pvB, int cbB)
{
byte* pointer1 = (byte*)pvA.ToPointer();
byte* pointer2 = (byte*)pvB.ToPointer();
if (pointer1 >= pointer2 && pointer1 < pointer2 + cbB)
return true;
return pointer2 >= pointer1 && pointer2 < pointer1 + cbA;
}
public static unsafe void Zero(IntPtr pvDest, int cbZero)
{
uint* pointer = (uint*)pvDest.ToPointer();
int num1 = cbZero / 4;
int num2 = num1;
while (num2-- > 0)
*pointer++ = 0U;
byte* numPtr = (byte*)pointer;
int num3 = cbZero - num1 * 4;
while (num3-- > 0)
*numPtr++ = 0;
}
public static unsafe void Copy(IntPtr pvDest, IntPtr pvSrc, int cbCopy)
{
uint* pointer1 = (uint*)pvDest.ToPointer();
uint* pointer2 = (uint*)pvSrc.ToPointer();
int num1 = cbCopy / 4;
int num2 = num1;
while (num2-- > 0)
*pointer1++ = *pointer2++;
byte* numPtr1 = (byte*)pointer1;
byte* numPtr2 = (byte*)pointer2;
int num3 = cbCopy - num1 * 4;
while (num3-- > 0)
*numPtr1++ = *numPtr2++;
}
public static unsafe void ConvertEndian(
IntPtr pvDest,
IntPtr pvSrc,
int cbConvert,
int cUnitBits)
{
switch (cUnitBits)
{
case 16:
uint* pointer1 = (uint*)pvDest.ToPointer();
uint* pointer2 = (uint*)pvSrc.ToPointer();
int num1 = cbConvert / 4;
while (num1-- > 0)
{
uint num2 = *pointer2++;
*pointer1++ = (uint)((int)((num2 & 4278190080U) >> 8) | ((int)num2 & 16711680) << 8 | (int)((num2 & 65280U) >> 8) | ((int)num2 & byte.MaxValue) << 8);
}
if (cbConvert % 4 == 0)
break;
ushort* numPtr1 = (ushort*)pointer1;
ushort* numPtr2 = (ushort*)pointer1;
ushort* numPtr3 = numPtr2 + 2;
ushort num3 = *numPtr2;
ushort* numPtr4 = numPtr1;
ushort* numPtr5 = numPtr4 + 2;
int num4 = (ushort)((num3 & 65280) >> 8 | (num3 & byte.MaxValue) << 8);
*numPtr4 = (ushort)num4;
break;
case 32:
uint* pointer3 = (uint*)pvDest.ToPointer();
uint* pointer4 = (uint*)pvSrc.ToPointer();
int num5 = cbConvert / 4;
while (num5-- > 0)
{
uint num2 = *pointer4++;
*pointer3++ = (uint)((int)((num2 & 4278190080U) >> 24) | (int)((num2 & 16711680U) >> 8) | ((int)num2 & 65280) << 8 | ((int)num2 & byte.MaxValue) << 24);
}
break;
}
}
public static uint ConvertEndian(uint src) => (uint)((int)((src & 4278190080U) >> 24) | (int)((src & 16711680U) >> 8) | ((int)src & 65280) << 8 | ((int)src & byte.MaxValue) << 24);
}
}
@@ -0,0 +1,93 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.RenderException
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
namespace Microsoft.Iris.RenderAPI
{
[Serializable]
internal class RenderException : InvalidOperationException
{
private const int ErrorPrefix = -2147221504;
private RenderException.ErrorCode m_code;
public RenderException()
{
}
public RenderException(string stReason)
: base(stReason)
{
}
public RenderException(string stReason, Exception innerException)
: base(stReason, innerException)
{
}
protected RenderException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
public RenderException(RenderException.ErrorCode code) => m_code = code;
public RenderException(RenderException.ErrorCode code, string stReason)
: base(stReason)
=> m_code = code;
public RenderException.ErrorCode Error => m_code;
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("m_code", m_code);
}
public enum ErrorCode
{
OutOfKernelResources = -2147221503, // 0x80040001
OutOfGdiResources = -2147221502, // 0x80040002
Generic = -2147221494, // 0x8004000A
Busy = -2147221493, // 0x8004000B
Unusable = -2147221492, // 0x8004000C
NoContext = -2147221484, // 0x80040014
InvalidContext = -2147221474, // 0x8004001E
ReadOnlyContext = -2147221473, // 0x8004001F
ThreadingAlreadySet = -2147221472, // 0x80040020
CannotUseStandardMessaging = -2147221471, // 0x80040021
BadCoordinateMap = -2147221464, // 0x80040028
CannotFindMsgID = -2147221454, // 0x80040032
NotBuffered = -2147221444, // 0x8004003C
StartDestroy = -2147221434, // 0x80040046
ObjectLocked = -2147221433, // 0x80040047
InvalidOperation = -2147221432, // 0x80040048
NotInitialized = -2147221424, // 0x80040050
NotFound = -2147221414, // 0x8004005A
IdAlreadyUsed = -2147221413, // 0x8004005B
FileNotFound = -2147221412, // 0x8004005C
OutOfRange = -2147221411, // 0x8004005D
MismatchedTypes = -2147221404, // 0x80040064
CannotLoadGdiplus = -2147221394, // 0x8004006E
CannotLoadDirect3D = -2147221393, // 0x8004006F
ClassAlreadyRegistered = -2147221384, // 0x80040078
MessageNotFound = -2147221383, // 0x80040079
MessageNotImplemented = -2147221382, // 0x8004007A
ClassNotImplemented = -2147221381, // 0x8004007B
MessageFailed = -2147221380, // 0x8004007C
MessageData = -2147221379, // 0x8004007D
NoContent = -2147221374, // 0x80040082
NoStorage = -2147221373, // 0x80040083
GenericWin32 = -2147221364, // 0x8004008C
GenericGdiPlus = -2147221363, // 0x8004008D
GenericDriver = -2147221362, // 0x8004008E
UnableToConnect = -2147221354, // 0x80040096
}
}
}
+101
View File
@@ -0,0 +1,101 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.RendererApi
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Security;
namespace Microsoft.Iris.RenderAPI
{
[SuppressUnmanagedCodeSecurity]
internal sealed class RendererApi
{
public static void IFC(HRESULT hr)
{
if (hr.Int >= 0)
return;
RenderException.ErrorCode code = (RenderException.ErrorCode)hr.Int;
switch (hr.Int)
{
case -2147221503:
case -2147221502:
throw new OutOfMemoryException();
case -2147221494:
throw new RenderException(code, "Generic failure.");
case -2147221493:
throw new RenderException(code, "The object is in a \"busy\" state and is not available to process the request.");
case -2147221492:
throw new RenderException(code, "The object is not in a usable state to process the request.");
case -2147221484:
throw new RenderException(code, "The Context has not been initialized.");
case -2147221474:
throw new RenderException(code, "The object was used in the incorrect context.");
case -2147221473:
throw new RenderException(code, "The Context has been marked to only allow read-only operations. For example, this may be in the middle of a read-only callback.");
case -2147221472:
throw new RenderException(code, "The threading model has already be determined by a previous call to SpInit() and can no longer be changed.");
case -2147221471:
throw new RenderException(code, "Unable to use the IGMM_STANDARD messaging model because it is either unsupported or cannot be installed.");
case -2147221464:
throw new RenderException(code, "Can not mix an invalid coordinate mapping, for example having a non-relative child of a relative parent.");
case -2147221454:
throw new RenderException(code, "Could not find a MSGID for one of the requested messages. This will be represented by a '0' in the MSGID field for that message.");
case -2147221444:
throw new RenderException(code, "The operation is not legal because the specified Gadget does not have a GS_BUFFERED style.");
case -2147221434:
throw new RenderException(code, "The specific Gadget has started the destruction and can not be be modified in this manner.");
case -2147221433:
throw new RenderException(code, "The specific object is locked and may not be modified.");
case -2147221432:
throw new InvalidOperationException("The operation is not supported.");
case -2147221424:
throw new RenderException(code, "The specified optional component has not yet been initialized with InitGadgetComponent().");
case -2147221414:
throw new RenderException(code, "The specified object was not found.");
case -2147221413:
throw new RenderException(code, "The ObjectID is already in use.");
case -2147221412:
throw new FileNotFoundException("The specified file could not be found");
case -2147221411:
throw new ArgumentOutOfRangeException("", "The argument is out of range");
case -2147221404:
throw new RenderException(code, "The specified parmeters are mismatched for the current object state.");
case -2147221394:
throw new RenderException(code, "GDI+ was unable to be loaded. It may not be installed on the system or may not be properly initialized.");
case -2147221393:
throw new RenderException(code, "Direct3D was unable to be loaded. It may not be installed on the system or may not be properly initialized.");
case -2147221384:
throw new RenderException(code, "The specified class was already registered.");
case -2147221383:
throw new RenderException(code, "The specified message was not found during class registration.");
case -2147221382:
throw new RenderException(code, "The specified message was not implemented during class registration.");
case -2147221381:
throw new RenderException(code, "The implementation of the specific class has not yet been registered.");
case -2147221380:
throw new RenderException(code, "Sending the message failed.");
case -2147221379:
throw new RenderException(code, "The message data is too large.");
case -2147221374:
throw new RenderException(code, "The specified object does not have any content.");
case -2147221373:
throw new RenderException(code, "The specified object is not properly setup to store the data.");
case -2147221364:
throw new RenderException(code, "Generic failure from Win32 that did not SetLastError().");
case -2147221363:
throw new RenderException(code, "Generic failure from GDI+.");
case -2147221362:
throw new RenderException(code, "Generic failure from driver or rendering.");
case -2147221354:
throw new RenderException(code, "Unable to connect to remote renderer.");
default:
Marshal.ThrowExceptionForHR(hr.Int);
break;
}
}
}
}
@@ -0,0 +1,21 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.VideoPlayback.BasicVideoGeometry
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.RenderAPI.Drawing;
using System;
namespace Microsoft.Iris.RenderAPI.VideoPlayback
{
[Serializable]
internal struct BasicVideoGeometry
{
public RectangleF[] arrcfSrcVideo;
public RectangleF[] arrcfDestView;
public RectangleF[] arrcfBorders;
public RectangleF rcfSrcVideoBounds;
public RectangleF rcfDestViewBounds;
}
}
@@ -0,0 +1,30 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.VideoPlayback.BasicVideoPresentation
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.RenderAPI.Drawing;
namespace Microsoft.Iris.RenderAPI.VideoPlayback
{
internal class BasicVideoPresentation
{
private BasicVideoGeometry m_geometry;
internal BasicVideoPresentation(BasicVideoGeometry geometry) => m_geometry = geometry;
public RectangleF DisplayedSource => m_geometry.rcfSrcVideoBounds;
public RectangleF DisplayedDestination => m_geometry.rcfDestViewBounds;
public BasicVideoGeometry GetGeometry() => new BasicVideoGeometry()
{
arrcfSrcVideo = (RectangleF[])m_geometry.arrcfSrcVideo.Clone(),
arrcfDestView = (RectangleF[])m_geometry.arrcfDestView.Clone(),
arrcfBorders = (RectangleF[])m_geometry.arrcfBorders.Clone(),
rcfSrcVideoBounds = m_geometry.rcfSrcVideoBounds,
rcfDestViewBounds = m_geometry.rcfDestViewBounds
};
}
}
@@ -0,0 +1,23 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.VideoPlayback.IUIVideoPortal
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Render;
using Microsoft.Iris.Session;
using System;
namespace Microsoft.Iris.RenderAPI.VideoPlayback
{
internal interface IUIVideoPortal : ITrackableUIElement
{
Rectangle LogicalContentRect { get; }
void OnStreamChange(bool fFormatChanged);
void OnRevokeStream();
event EventHandler PortalChange;
}
}
@@ -0,0 +1,17 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.VideoPlayback.IUIVideoStream
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.RenderAPI.VideoPlayback
{
internal interface IUIVideoStream
{
void RegisterPortal(IUIVideoPortal portal);
void RevokePortal(IUIVideoPortal portal);
BasicVideoPresentation GetPresentation(IUIVideoPortal portal);
}
}
@@ -0,0 +1,115 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.VideoPlayback.LinearVideoStretch
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.RenderAPI.Drawing;
using System;
namespace Microsoft.Iris.RenderAPI.VideoPlayback
{
internal static class LinearVideoStretch
{
public static readonly VideoZoomHandler ShrinkToFit = new VideoZoomHandler(ComputeShrinkToFitZoom);
public static readonly VideoZoomHandler GrowToFit = new VideoZoomHandler(ComputeGrowToFitZoom);
public static readonly VideoZoomHandler StretchToFill = new VideoZoomHandler(ComputeStretchToFillZoom);
private static void ComputeShrinkToFitZoom(
RectangleF rcfBoundSrcVideoPxl,
RectangleF rcfBoundDestViewPxl,
out RectangleF[] arrcfOutputSrcVideoPxl,
out RectangleF[] arrcfOutputDestViewPxl)
{
RectangleF rectangleF1;
RectangleF rectangleF2;
if (rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width < (double)(rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height))
{
float num1 = rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width;
float height = rcfBoundSrcVideoPxl.Height * num1;
float num2 = rcfBoundDestViewPxl.Height - height;
rectangleF1 = rcfBoundSrcVideoPxl;
rectangleF2 = new RectangleF(rcfBoundDestViewPxl.X, rcfBoundDestViewPxl.Y + num2 / 2f, rcfBoundDestViewPxl.Width, height);
}
else
{
float num1 = rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height;
float width = rcfBoundSrcVideoPxl.Width * num1;
float num2 = rcfBoundDestViewPxl.Width - width;
rectangleF1 = rcfBoundSrcVideoPxl;
rectangleF2 = new RectangleF(rcfBoundDestViewPxl.X + num2 / 2f, rcfBoundDestViewPxl.Y, width, rcfBoundDestViewPxl.Height);
}
arrcfOutputSrcVideoPxl = new RectangleF[1]
{
rectangleF1
};
arrcfOutputDestViewPxl = new RectangleF[1]
{
rectangleF2
};
}
private static void ComputeGrowToFitZoom(
RectangleF rcfBoundSrcVideoPxl,
RectangleF rcfBoundDestViewPxl,
out RectangleF[] arrcfOutputSrcVideoPxl,
out RectangleF[] arrcfOutputDestViewPxl)
{
ApplyPillarboxAdjustment(ref rcfBoundSrcVideoPxl, rcfBoundDestViewPxl);
RectangleF rectangleF1;
RectangleF rectangleF2;
if (rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width < (double)(rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height))
{
float num1 = rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height;
float width = rcfBoundDestViewPxl.Width / num1;
float num2 = rcfBoundSrcVideoPxl.Width - width;
rectangleF1 = new RectangleF(rcfBoundSrcVideoPxl.X + num2 / 2f, rcfBoundSrcVideoPxl.Y, width, rcfBoundSrcVideoPxl.Height);
rectangleF2 = rcfBoundDestViewPxl;
}
else
{
float num1 = rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width;
float height = rcfBoundDestViewPxl.Height / num1;
float num2 = rcfBoundSrcVideoPxl.Height - height;
rectangleF1 = new RectangleF(rcfBoundSrcVideoPxl.X, rcfBoundSrcVideoPxl.Y + num2 / 2f, rcfBoundSrcVideoPxl.Width, height);
rectangleF2 = rcfBoundDestViewPxl;
}
arrcfOutputSrcVideoPxl = new RectangleF[1]
{
rectangleF1
};
arrcfOutputDestViewPxl = new RectangleF[1]
{
rectangleF2
};
}
private static void ComputeStretchToFillZoom(
RectangleF rcfBoundSrcVideoPxl,
RectangleF rcfBoundDestViewPxl,
out RectangleF[] arrcfOutputSrcVideoPxl,
out RectangleF[] arrcfOutputDestViewPxl)
{
ApplyPillarboxAdjustment(ref rcfBoundSrcVideoPxl, rcfBoundDestViewPxl);
arrcfOutputSrcVideoPxl = new RectangleF[1]
{
rcfBoundSrcVideoPxl
};
arrcfOutputDestViewPxl = new RectangleF[1]
{
rcfBoundDestViewPxl
};
}
internal static void ApplyPillarboxAdjustment(
ref RectangleF rcfBoundSrcVideoPxl,
RectangleF rcfBoundDestViewPxl)
{
if (Math.Abs(rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width - rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height) >= 0.1 || rcfBoundDestViewPxl.Width / (double)rcfBoundDestViewPxl.Height <= 1.5 || rcfBoundSrcVideoPxl.Width / (double)rcfBoundSrcVideoPxl.Height <= 1.5)
return;
float num = (float)(rcfBoundSrcVideoPxl.Height * 4.0 / 3.0);
rcfBoundSrcVideoPxl.X += (float)((rcfBoundSrcVideoPxl.Width - (double)num) / 2.0);
rcfBoundSrcVideoPxl.Width = num;
}
}
}
@@ -0,0 +1,16 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.VideoPlayback.VideoDisplayMode
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.RenderAPI.VideoPlayback
{
internal enum VideoDisplayMode
{
Inset,
FullPreScene,
FullInScene,
Animating,
}
}
@@ -0,0 +1,15 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.RenderAPI.VideoPlayback.VideoOverscanMode
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.RenderAPI.VideoPlayback
{
internal enum VideoOverscanMode
{
NoOverscan,
ValidContent,
InvalidContent,
}
}

Some files were not shown because too many files have changed in this diff Show More