Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/Baballonia/ViewModels/SplitViewPane/HomePageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private void EyeImageUpdateHandler(Mat image)
return;


int channels = image.Channels();
var channels = image.Channels();
if (channels == 1)
{
var width = image.Width;
Expand Down Expand Up @@ -301,9 +301,9 @@ void UpdateBitmap(Mat image)
{
using var frameBuffer = _bitmap.Lock();

IntPtr srcPtr = image.Data;
IntPtr destPtr = frameBuffer.Address;
int size = image.Rows * image.Cols * image.ElemSize();
var srcPtr = image.Data;
var destPtr = frameBuffer.Address;
var size = image.Rows * image.Cols * image.ElemSize();

unsafe
{
Expand Down Expand Up @@ -619,7 +619,7 @@ private async Task StartCameraWithMaximization(CameraControllerModel model, bool
backend = "";


bool success = false;
var success = false;
switch (model.Camera)
{
case Camera.Face:
Expand All @@ -638,7 +638,11 @@ private async Task StartCameraWithMaximization(CameraControllerModel model, bool

if (success)
{
if (startMaximized)
// Only select the entire frame if and only if
// 1) This call originates from the UI, IE a user has requested it
// 2) The current camera differs from the previous (IE, an existing connection was interrupted)
var lastOpenedCameraName = _localSettings.ReadSetting<string>("LastOpened" + model.Name);
if (startMaximized && lastOpenedCameraName != model.DisplayAddress)
{
model.SelectWholeFrame();
}
Expand Down Expand Up @@ -705,7 +709,7 @@ private async Task RequestVRCalibration()

public Color GetBaseHighColor()
{
Color color = Colors.White;
var color = Colors.White;
switch (Application.Current!.ActualThemeVariant.ToString())
{
case "Light":
Expand Down
6 changes: 3 additions & 3 deletions src/Baballonia/Views/HomePageView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Baballonia.Views;

public partial class HomePageView : ViewBase
{
public static FilePickerFileType ONNXAll { get; } = new("ONNX Models")
private static readonly FilePickerFileType OnnxAll = new("ONNX Models")
{
Patterns = ["*.onnx"],
};
Expand Down Expand Up @@ -246,7 +246,7 @@ private async void RefreshDevices(object? sender, RoutedEventArgs e)
vm.RightCamera.UpdateCameraDropDown(friendlyNames);
vm.FaceCamera.UpdateCameraDropDown(friendlyNames);
}
catch (Exception exception)
catch (Exception)
{
}

Expand All @@ -263,7 +263,7 @@ private async void EyeModelLoad(object? sender, RoutedEventArgs e)
Title = "Select ONNX Model",
AllowMultiple = false,
SuggestedStartLocation = suggestedStartLocation, // Falls back to desktop if Models folder hasn't been created yet
FileTypeFilter = [ONNXAll]
FileTypeFilter = [OnnxAll]
})!;

if (file.Count == 0) return;
Expand Down