diff --git a/.forgejo/workflows/buildAndTest.yml b/.forgejo/workflows/buildAndTest.yml index 54274d95e..0a05b8277 100644 --- a/.forgejo/workflows/buildAndTest.yml +++ b/.forgejo/workflows/buildAndTest.yml @@ -27,7 +27,7 @@ jobs: build: runs-on: docker container: - image: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v4 + image: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v3 steps: - name: Clone yavsc run: | diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index de61bd43d..75c3becbd 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -52,7 +52,7 @@ jobs: release: runs-on: docker container: - image: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v4 + image: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v3 steps: - name: Clone du repo au tag demandé env: diff --git a/src/PostIt/Directory.Packages.props b/src/PostIt/Directory.Packages.props index c9e77bf1d..42d09cd55 100644 --- a/src/PostIt/Directory.Packages.props +++ b/src/PostIt/Directory.Packages.props @@ -16,7 +16,6 @@ - @@ -24,8 +23,6 @@ - - diff --git a/src/PostIt/PostIt/App.axaml.cs b/src/PostIt/PostIt/App.axaml.cs index 0c4f0a7ca..9a04ffd03 100644 --- a/src/PostIt/PostIt/App.axaml.cs +++ b/src/PostIt/PostIt/App.axaml.cs @@ -11,7 +11,6 @@ using PostIt.Services; using PostIt.ViewModels; using PostIt.Views; using PostIt.Helpers; -using System.Globalization; namespace PostIt; @@ -37,7 +36,6 @@ public partial class App : Application public override void Initialize() { AvaloniaXamlLoader.Load(this); - } public override void OnFrameworkInitializationCompleted() @@ -67,7 +65,7 @@ public partial class App : Application { singleViewPlatform.MainView = View = ServiceProvider!.GetRequiredService(); ConfigureRootView(View); - ApplyStettings(settings); + ApplyDarkMode(settings); } public void InitializeActivityLifetime(Settings settings, IActivityApplicationLifetime singleViewFactoryApplicationLifetime) @@ -76,7 +74,7 @@ public partial class App : Application () => { this.ConfigureRootView(ServiceProvider!.GetRequiredService()); - ApplyStettings(settings); + ApplyDarkMode(settings); return View!; }; } @@ -87,7 +85,7 @@ public partial class App : Application desktop.MainWindow = window; this.ConfigureRootView(window.MainView); - ApplyStettings(settings); + ApplyDarkMode(settings); } public void ConfigureRootView(MainView rootView) @@ -128,12 +126,10 @@ public partial class App : Application View = mainView ?? throw new ArgumentNullException(nameof(mainView)); } - private static void ApplyStettings(Settings settings) + private static void ApplyDarkMode(Settings settings) { - if (!string.IsNullOrWhiteSpace(settings.SelectedLanguage)) - Yavsc.Lang.Resources.Culture = new CultureInfo(settings.SelectedLanguage); - Current!.RequestedThemeVariant = - settings.DarkMode ? ThemeVariant.Dark : ThemeVariant.Light; + Application.Current!.RequestedThemeVariant = + settings.DarkMode ? ThemeVariant.Dark : ThemeVariant.Light; } /// diff --git a/src/PostIt/PostIt/Interfaces/IPCMProcessor.cs b/src/PostIt/PostIt/Interfaces/IPCMProcessor.cs deleted file mode 100644 index e8e61070e..000000000 --- a/src/PostIt/PostIt/Interfaces/IPCMProcessor.cs +++ /dev/null @@ -1,6 +0,0 @@ -using System; - -public interface IPCMProcessor : IDisposable -{ - void Process(short[] audioFrame); -} diff --git a/src/PostIt/PostIt/Lang/Resources.Designer.cs b/src/PostIt/PostIt/Lang/Resources.Designer.cs deleted file mode 100644 index 5537f5924..000000000 --- a/src/PostIt/PostIt/Lang/Resources.Designer.cs +++ /dev/null @@ -1,72 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Yavsc.Lang { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Yavsc.Lang.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Bienvenue dans PostIt!. - /// - public static string GreetingText { - get { - return ResourceManager.GetString("GreetingText", resourceCulture); - } - } - } -} diff --git a/src/PostIt/PostIt/Lang/Resources.en-EN.resx b/src/PostIt/PostIt/Lang/Resources.en-EN.resx deleted file mode 100644 index 6128bca8d..000000000 --- a/src/PostIt/PostIt/Lang/Resources.en-EN.resx +++ /dev/null @@ -1,5 +0,0 @@ - - - Welcome to PostIt! - - diff --git a/src/PostIt/PostIt/Lang/Resources.pt-PT.resx b/src/PostIt/PostIt/Lang/Resources.pt-PT.resx deleted file mode 100644 index 049c25316..000000000 --- a/src/PostIt/PostIt/Lang/Resources.pt-PT.resx +++ /dev/null @@ -1,5 +0,0 @@ - - - Bemvindo em PostIt! - - diff --git a/src/PostIt/PostIt/Lang/Resources.resx b/src/PostIt/PostIt/Lang/Resources.resx deleted file mode 100644 index ae18ff220..000000000 --- a/src/PostIt/PostIt/Lang/Resources.resx +++ /dev/null @@ -1,5 +0,0 @@ - - - Bienvenue dans PostIt! - - diff --git a/src/PostIt/PostIt/PostIt.csproj b/src/PostIt/PostIt/PostIt.csproj index 5057bde8c..9cdf71299 100644 --- a/src/PostIt/PostIt/PostIt.csproj +++ b/src/PostIt/PostIt/PostIt.csproj @@ -7,8 +7,6 @@ 1.1.0.0 1.1.0-estimate.1+364.Branch.feature-estimate.Sha.3d6ab6e72f9ba4ccfa250a1cce154b550281405e 1.1.0-estimate.1 - true - @@ -32,7 +30,6 @@ None All - @@ -40,25 +37,9 @@ - - - - - PublicResXFileCodeGenerator - Resources.Designer.cs - - - - - - True - True - Lang/Resources.resx - - - + \ No newline at end of file diff --git a/src/PostIt/PostIt/Services/AudioRecorder.cs b/src/PostIt/PostIt/Services/AudioRecorder.cs deleted file mode 100644 index 43e7f5c1b..000000000 --- a/src/PostIt/PostIt/Services/AudioRecorder.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Threading; -using Pv; - -public class AudioRecorder : IDisposable -{ - private int frameLength; - PvRecorder recorder; - - Thread thread; - short[] audioFrame; - IPCMProcessor processor; - - public bool processing { get; private set; } - - public AudioRecorder(IPCMProcessor processor, int frameLength=512, int deviceIndex = -1) - { - this.frameLength = frameLength; - this.recorder = PvRecorder.Create(frameLength: frameLength, deviceIndex: deviceIndex); - this.audioFrame = new short[frameLength]; - this.processor=processor; - } - - public static string [] GetAvailableDevices() - { - return PvRecorder.GetAvailableDevices(); - } - - public void Start() - { - recorder.Start(); - thread = new Thread(ThreadLoop); - thread.Start(); - } - - public void ThreadLoop() - { - while (recorder.IsRecording) - { - if (thread.ThreadState != ThreadState.Running) - { - break; - } - if (processing) - { - Thread.Sleep(10); - continue; - } - processing = true; - audioFrame = recorder.Read(); - processor.Process(audioFrame); - processing = false; - } - } - - public void Stop() - { - thread.Interrupt(); - thread.Join(); - recorder.Stop(); - thread = null; - } - public void Dispose() - { - recorder.Dispose(); - } -} diff --git a/src/PostIt/PostIt/ViewModels/Settings/Settings.cs b/src/PostIt/PostIt/ViewModels/Settings/Settings.cs index e92bf9385..5576f01cd 100644 --- a/src/PostIt/PostIt/ViewModels/Settings/Settings.cs +++ b/src/PostIt/PostIt/ViewModels/Settings/Settings.cs @@ -8,7 +8,6 @@ using System.IO; using System.Net.Http; using System.Text.Json; using System.Text.Json.Serialization; -using System.Globalization; [assembly: InternalsVisibleTo("PostIt.Tests")] @@ -45,7 +44,6 @@ public partial class Settings : ViewModelBase public partial StatusNotice ActionStatus { get; set; } = StatusNotice.Info("Pret."); - [JsonIgnore] public bool Loaded { get; private set; } = false; @@ -61,16 +59,8 @@ public partial class Settings : ViewModelBase /// . /// [ObservableProperty] - [JsonIgnore] public partial bool IsDirty { get; private set; } = false; - [JsonIgnore] - public override bool CanNavigateNext { get => false; protected set => throw new System.NotImplementedException(); } - - [JsonIgnore] - public override bool CanNavigatePrevious { get => true; protected set => throw new System.NotImplementedException(); } - - public string SelectedLanguage { get; internal set; } = CultureInfo.CurrentUICulture.Name; /// /// Guards every mutation of the observable state. [ObservableProperty] @@ -542,4 +532,7 @@ public partial class Settings : ViewModelBase /// partial void OnIsDirtyChanged(bool value) => SaveCommand.NotifyCanExecuteChanged(); + + public override bool CanNavigateNext { get => false; protected set => throw new System.NotImplementedException(); } + public override bool CanNavigatePrevious { get => true; protected set => throw new System.NotImplementedException(); } } diff --git a/src/PostIt/PostIt/Views/Layout/HomePage.axaml b/src/PostIt/PostIt/Views/Layout/HomePage.axaml index 4172cb159..31dd5851b 100644 --- a/src/PostIt/PostIt/Views/Layout/HomePage.axaml +++ b/src/PostIt/PostIt/Views/Layout/HomePage.axaml @@ -1,7 +1,6 @@ @@ -11,7 +10,7 @@ -