diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d0f70ca..a78d0cc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,26 +12,30 @@ jobs: - name: Set version number shell: pwsh run: | - $version = "0.1.0" - echo $version - echo "VERSION_NUMBER=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append + $versionNumber = "2.0.0" + $versionSuffix = "beta.1" + $infoVersion = "$versionNumber-$versionSuffix" + echo $infoVersion + echo "VERSION_NUMBER=$versionNumber" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append + echo "VERSION_SUFFIX=$versionSuffix" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append + echo "INFO_VERSION=$infoVersion" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append - uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 7.0.x - name: Publish for win-x64 - run: dotnet publish KaddaOK.AvaloniaApp.Windows/KaddaOK.AvaloniaApp.Windows.csproj /p:Version=${{ env.VERSION_NUMBER }}.0 /p:Configuration=Release /p:RuntimeIdentifier=win-x64 /p:PublishSingleFile=true /p:PublishDir=${{ github.workspace }}/publish + run: dotnet publish KaddaOK.AvaloniaApp.Windows/KaddaOK.AvaloniaApp.Windows.csproj /p:VersionPrefix=${{ env.VERSION_NUMBER }} /p:VersionSuffix=${{ env.VERSION_SUFFIX }} /p:Configuration=Release /p:RuntimeIdentifier=win-x64 /p:PublishSingleFile=true /p:PublishDir=${{ github.workspace }}/publish - name: Zip for win-x64 shell: pwsh - run: Compress-Archive -Path ${{ github.workspace }}/publish/* -DestinationPath KaddaOKTools_win-x64_${{ env.VERSION_NUMBER }}.zip + run: Compress-Archive -Path ${{ github.workspace }}/publish/* -DestinationPath KaddaOKTools_win-x64_${{ env.INFO_VERSION }}.zip - name: Upload win-x64 Artifact uses: actions/upload-artifact@v4 with: - name: KaddaOKTools_win-x64_${{ env.VERSION_NUMBER }} - path: KaddaOKTools_win-x64_${{ env.VERSION_NUMBER }}.zip + name: KaddaOKTools_win-x64_${{ env.INFO_VERSION }} + path: KaddaOKTools_win-x64_${{ env.INFO_VERSION }}.zip - name: Create Release uses: ncipollo/release-action@v1.13.0 with: - artifacts: "KaddaOKTools_win-x64_${{ env.VERSION_NUMBER }}.zip" - tag: ${{ env.VERSION_NUMBER }} + artifacts: "KaddaOKTools_win-x64_${{ env.INFO_VERSION }}.zip" + tag: ${{ env.INFO_VERSION }} diff --git a/KaddaOK.AvaloniaApp.Tests/ViewModels/EditLinesViewModelTests.cs b/KaddaOK.AvaloniaApp.Tests/ViewModels/EditLinesViewModelTests.cs index 0970b81..d0eee17 100644 --- a/KaddaOK.AvaloniaApp.Tests/ViewModels/EditLinesViewModelTests.cs +++ b/KaddaOK.AvaloniaApp.Tests/ViewModels/EditLinesViewModelTests.cs @@ -1,7 +1,9 @@ using System.Collections.ObjectModel; +using Avalonia.Input; using FluentAvalonia.Core; using KaddaOK.AvaloniaApp.Models; using KaddaOK.AvaloniaApp.ViewModels; +using KaddaOK.AvaloniaApp.Views; using KaddaOK.Library; using NAudio.Wave; @@ -26,6 +28,13 @@ private static KaraokeProcess GetNewCurrentProcess() => } }; + public class DummyEditLinesView : IEditLinesView + { + public bool Focus(NavigationMethod method = NavigationMethod.Unspecified, KeyModifiers keyModifiers = KeyModifiers.None) + { + return true; + } + } public class MoveLineToPrevious { [Fact] @@ -33,7 +42,8 @@ public void ShouldMergeLines() { var currentProcess = GetNewCurrentProcess(); - var viewModel = new EditLinesViewModel(currentProcess, new LineSplitter(), new WordMerger(), new MinMaxFloatWaveStreamSampler()); + var viewModel = new EditLinesViewModel(currentProcess, new LineSplitter(), new WordMerger(), new MinMaxFloatWaveStreamSampler()) + { EditLinesView = new DummyEditLinesView() }; viewModel.MoveLineToPrevious(currentProcess.ChosenLines!.Last()); @@ -47,7 +57,8 @@ public void ShouldAddSpaceToPreviousWordWhenMergingLines() { var currentProcess = GetNewCurrentProcess(); - var viewModel = new EditLinesViewModel(currentProcess, new LineSplitter(), new WordMerger(), new MinMaxFloatWaveStreamSampler()); + var viewModel = new EditLinesViewModel(currentProcess, new LineSplitter(), new WordMerger(), new MinMaxFloatWaveStreamSampler()) + { EditLinesView = new DummyEditLinesView()}; viewModel.MoveLineToPrevious(currentProcess.ChosenLines!.Last()); diff --git a/KaddaOK.AvaloniaApp.Windows/KaddaOK.AvaloniaApp.Windows.csproj b/KaddaOK.AvaloniaApp.Windows/KaddaOK.AvaloniaApp.Windows.csproj index 0b7a8ef..d70fcf5 100644 --- a/KaddaOK.AvaloniaApp.Windows/KaddaOK.AvaloniaApp.Windows.csproj +++ b/KaddaOK.AvaloniaApp.Windows/KaddaOK.AvaloniaApp.Windows.csproj @@ -12,6 +12,8 @@ true app.manifest KaddaOKTools + 0.0.0 + dev diff --git a/KaddaOK.AvaloniaApp/App.axaml b/KaddaOK.AvaloniaApp/App.axaml index f484f1a..5496234 100644 --- a/KaddaOK.AvaloniaApp/App.axaml +++ b/KaddaOK.AvaloniaApp/App.axaml @@ -123,11 +123,20 @@ + + + + + \ No newline at end of file diff --git a/KaddaOK.AvaloniaApp/App.axaml.cs b/KaddaOK.AvaloniaApp/App.axaml.cs index 3eeca92..34179c5 100644 --- a/KaddaOK.AvaloniaApp/App.axaml.cs +++ b/KaddaOK.AvaloniaApp/App.axaml.cs @@ -25,7 +25,7 @@ public override void Initialize() KaraokeProcess = new KaraokeProcess { - KaraokeSource = InitialKaraokeSource.AzureSpeechService + KaraokeSource = InitialKaraokeSource.NotSelected }; services.AddSingleton(KaraokeProcess); @@ -53,6 +53,8 @@ public override void Initialize() services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); // Build the service provider ServiceProvider = services.BuildServiceProvider(); diff --git a/KaddaOK.AvaloniaApp/Controls/Dialogs/EditSyllableTextDialog.axaml b/KaddaOK.AvaloniaApp/Controls/Dialogs/EditSyllableTextDialog.axaml index 166fb8e..d8ac381 100644 --- a/KaddaOK.AvaloniaApp/Controls/Dialogs/EditSyllableTextDialog.axaml +++ b/KaddaOK.AvaloniaApp/Controls/Dialogs/EditSyllableTextDialog.axaml @@ -12,16 +12,17 @@