-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #810 from maiko3tattun/0826_IncreaseCrossfade
Add Lengthen crossfades in batch menu
- Loading branch information
Showing
6 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Window xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
x:Class="OpenUtau.App.Views.SliderDialog" | ||
Title="SliderDialog" Height="120" Width="300" WindowStartupLocation="CenterOwner" | ||
ExtendClientAreaToDecorationsHint="False"> | ||
<StackPanel VerticalAlignment="Center" Margin="{Binding $parent.WindowDecorationMargin}"> | ||
<StackPanel Orientation="Horizontal" Spacing="10" Margin="10" HorizontalAlignment="Center"> | ||
<Slider Name="Slider" Width="150" | ||
Classes="fader" TickPlacement="BottomRight" IsSnapToTickEnabled="true" | ||
Value="50" Minimum="0" Maximum="100" TickFrequency="1"/> | ||
<TextBlock Name="TextBlock" Width="20" /> | ||
</StackPanel> | ||
<Button Name="OkButton" Content="OK" Click="OkButtonClick" | ||
Margin="10" HorizontalAlignment="Center" MinWidth="100" /> | ||
</StackPanel> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using Avalonia.Controls; | ||
using Avalonia.Input; | ||
using Avalonia.Interactivity; | ||
using ReactiveUI; | ||
|
||
namespace OpenUtau.App.Views { | ||
public partial class SliderDialog : Window { | ||
public Action<double>? onFinish; | ||
|
||
public SliderDialog() { | ||
InitializeComponent(); | ||
} | ||
public SliderDialog(string title, double value, double min, double max, double tick) { | ||
InitializeComponent(); | ||
Title = title; | ||
Slider.Value = value; | ||
Slider.Minimum = min; | ||
Slider.Maximum = max; | ||
Slider.TickFrequency = tick; | ||
|
||
this.WhenAnyValue(d => d.Slider.Value) | ||
.Subscribe(value => { | ||
TextBlock.Text = value.ToString(); | ||
}); | ||
} | ||
|
||
private void OkButtonClick(object? sender, RoutedEventArgs e) { | ||
Finish(); | ||
} | ||
|
||
private void Finish() { | ||
if (onFinish != null) { | ||
onFinish.Invoke(Slider.Value); | ||
} | ||
Close(); | ||
} | ||
|
||
protected override void OnKeyDown(KeyEventArgs e) { | ||
if (e.Key == Key.Escape) { | ||
e.Handled = true; | ||
Close(); | ||
} else if (e.Key == Key.Enter) { | ||
e.Handled = true; | ||
Finish(); | ||
} else { | ||
base.OnKeyDown(e); | ||
} | ||
} | ||
} | ||
} |