|
@@ -1,7 +1,4 @@
|
|
|
-using System.CodeDom;
|
|
|
using System.ComponentModel;
|
|
|
-using System.Diagnostics;
|
|
|
-using System.IO;
|
|
|
using System.Text;
|
|
|
using System.Threading.Channels;
|
|
|
using Bmp.Core.Common.EventBus;
|
|
@@ -15,7 +12,6 @@ using Bmp.Core.Playback.Inputs;
|
|
|
using Bmp.WinForms.SaveLoad;
|
|
|
using Bmp.WinForms.SaveLoad.Models;
|
|
|
using EnumsNET;
|
|
|
-using Microsoft.Extensions.Logging.Abstractions;
|
|
|
using NAudio.Wave;
|
|
|
using AsioOut = Bmp.Core.Lite.Playback.Outputs.NAudioASIO.AsioOut;
|
|
|
|
|
@@ -33,8 +29,8 @@ namespace Bmp.WinForms
|
|
|
private readonly Channel<string> _pendingAddToList = Channel.CreateUnbounded<string>();
|
|
|
|
|
|
private readonly ILogger<MainForm> _logger;
|
|
|
- private readonly IEventBus? _eventBus;
|
|
|
- private readonly SaveLoadService? _saveLoadService;
|
|
|
+ private readonly IEventBus _eventBus;
|
|
|
+ private readonly SaveLoadService _saveLoadService;
|
|
|
|
|
|
private bool _isRunning;
|
|
|
|
|
@@ -81,7 +77,7 @@ namespace Bmp.WinForms
|
|
|
string? balloonTitle = null;
|
|
|
string? balloonContent = null;
|
|
|
|
|
|
- bool? flagPlayOk = null;
|
|
|
+ var flagPlayOk = false;
|
|
|
|
|
|
try
|
|
|
{
|
|
@@ -149,7 +145,8 @@ namespace Bmp.WinForms
|
|
|
//TODO: 消息机制 警告 无法获取元数据
|
|
|
}
|
|
|
|
|
|
- flagPlayOk = await PlayAsync();
|
|
|
+ Play();
|
|
|
+ flagPlayOk = true;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -161,7 +158,7 @@ namespace Bmp.WinForms
|
|
|
finally
|
|
|
{
|
|
|
MainPanel.Enabled = true;
|
|
|
- if (flagPlayOk == null)
|
|
|
+ if (flagPlayOk == false)
|
|
|
{
|
|
|
item.SubItems[StateColumnHeader.Index].Text = finalState;
|
|
|
if (balloonShow)
|
|
@@ -184,10 +181,10 @@ namespace Bmp.WinForms
|
|
|
|
|
|
private async Task ReloadSource()
|
|
|
{
|
|
|
- _inputSource = await Task.Run(() => InputSourceProvider.CreateWaveStream(_currentListViewItem!.Name, _saveLoadService?.State?.DecodeDsdToPcm == true));
|
|
|
+ _inputSource = await Task.Run(() => InputSourceProvider.CreateWaveStream(_currentListViewItem!.Name, _saveLoadService.State.DecodeDsdToPcm == true));
|
|
|
}
|
|
|
|
|
|
- private async Task DeInitOutputDeviceAsync()
|
|
|
+ private void DeInitOutputDevice()
|
|
|
{
|
|
|
var local = _outputDevice;
|
|
|
_outputDevice = null;
|
|
@@ -207,13 +204,13 @@ namespace Bmp.WinForms
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private async Task<bool> ReInitOutputDevice()
|
|
|
+ private bool ReInitOutputDevice()
|
|
|
{
|
|
|
- await DeInitOutputDeviceAsync();
|
|
|
+ DeInitOutputDevice();
|
|
|
|
|
|
var finalState = EMOJI_PLAY_BIG;
|
|
|
|
|
|
- bool balloonShow = false;
|
|
|
+ var balloonShow = false;
|
|
|
ToolTipIcon? balloonIcon = null;
|
|
|
string? balloonTitle = null;
|
|
|
string? balloonContent = null;
|
|
@@ -223,7 +220,7 @@ namespace Bmp.WinForms
|
|
|
if (_inputSource is DsdAudioStream)
|
|
|
{
|
|
|
_nativeDsd = true;
|
|
|
- if (_saveLoadService?.State?.SelectedDsdAsioOutputDeviceId == null)
|
|
|
+ if (_saveLoadService.State.SelectedDsdAsioOutputDeviceId == null)
|
|
|
{
|
|
|
finalState = EMOJI_X;
|
|
|
balloonShow = true;
|
|
@@ -235,9 +232,8 @@ namespace Bmp.WinForms
|
|
|
}
|
|
|
|
|
|
var allDevices = OutputDeviceProvider.GetAllSupportedDevices();
|
|
|
- IOutputDeviceInfo? selectedDevice = null;
|
|
|
|
|
|
- selectedDevice = allDevices.FirstOrDefault(p => p.Id == _saveLoadService?.State?.SelectedDsdAsioOutputDeviceId);
|
|
|
+ var selectedDevice = allDevices.FirstOrDefault(p => p.Id == _saveLoadService.State.SelectedDsdAsioOutputDeviceId);
|
|
|
|
|
|
if (selectedDevice == null)
|
|
|
{
|
|
@@ -256,7 +252,7 @@ namespace Bmp.WinForms
|
|
|
else
|
|
|
{
|
|
|
_nativeDsd = false;
|
|
|
- if (_saveLoadService?.State?.SelectedPcmOutputDeviceId == null)
|
|
|
+ if (_saveLoadService.State.SelectedPcmOutputDeviceId == null)
|
|
|
{
|
|
|
//TODO: 消息机制 错误 未指定输出设备
|
|
|
|
|
@@ -270,9 +266,8 @@ namespace Bmp.WinForms
|
|
|
}
|
|
|
|
|
|
var allDevices = OutputDeviceProvider.GetAllSupportedDevices();
|
|
|
- IOutputDeviceInfo? selectedDevice = null;
|
|
|
|
|
|
- selectedDevice = allDevices.FirstOrDefault(p => p.Id == _saveLoadService.State.SelectedPcmOutputDeviceId);
|
|
|
+ var selectedDevice = allDevices.FirstOrDefault(p => p.Id == _saveLoadService.State.SelectedPcmOutputDeviceId);
|
|
|
|
|
|
if (selectedDevice == null)
|
|
|
{
|
|
@@ -355,7 +350,7 @@ namespace Bmp.WinForms
|
|
|
private async Task StopAsync()
|
|
|
{
|
|
|
_playbackState = UIPlaybackState.Stopped;
|
|
|
- await DeInitOutputDeviceAsync();
|
|
|
+ DeInitOutputDevice();
|
|
|
|
|
|
if (_inputSource != null) await _inputSource.DisposeAsync();
|
|
|
_inputSource = null;
|
|
@@ -368,31 +363,18 @@ namespace Bmp.WinForms
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private async Task<bool> PlayAsync()
|
|
|
+ private void Play()
|
|
|
{
|
|
|
- if (_inputSource == null) return false;
|
|
|
+ if (_inputSource == null) return;
|
|
|
+ if (ReInitOutputDevice() == false) return;
|
|
|
+ _outputDevice!.Play();
|
|
|
_playbackState = UIPlaybackState.Playing;
|
|
|
- if (await ReInitOutputDevice())
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- _outputDevice!.Play();
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- //TODO: 消息机制 错误 播放失败
|
|
|
- Console.WriteLine(e);
|
|
|
- _playbackState = UIPlaybackState.Error;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return _playbackState == UIPlaybackState.Playing;
|
|
|
}
|
|
|
|
|
|
- private async Task PauseAsync()
|
|
|
+ private void Pause()
|
|
|
{
|
|
|
_playbackState = UIPlaybackState.Paused;
|
|
|
- await DeInitOutputDeviceAsync();
|
|
|
+ DeInitOutputDevice();
|
|
|
}
|
|
|
|
|
|
private async Task TrackPrevAsync()
|
|
@@ -440,20 +422,16 @@ namespace Bmp.WinForms
|
|
|
|
|
|
private void SaveState()
|
|
|
{
|
|
|
- if (_saveLoadService == null) return;
|
|
|
- if (_saveLoadService.State != null)
|
|
|
- {
|
|
|
- _saveLoadService.State.FormPosition = Location;
|
|
|
- _saveLoadService.State.FormSize = Size;
|
|
|
+ _saveLoadService.State.FormPosition = Location;
|
|
|
+ _saveLoadService.State.FormSize = Size;
|
|
|
|
|
|
- _saveLoadService.State.Playlist = MainListView.Items.Cast<ListViewItem>().Select(p => new SaveLoadPlaylistItem
|
|
|
- {
|
|
|
- Path = p.Name,
|
|
|
- Title = p.SubItems[TitleColumnHeader.Index].Text,
|
|
|
- Duration = p.SubItems[DurColumnHeader.Index].Text,
|
|
|
- ToolTip = p.ToolTipText
|
|
|
- }).ToArray();
|
|
|
- }
|
|
|
+ _saveLoadService.State.Playlist = MainListView.Items.Cast<ListViewItem>().Select(p => new SaveLoadPlaylistItem
|
|
|
+ {
|
|
|
+ Path = p.Name,
|
|
|
+ Title = p.SubItems[TitleColumnHeader.Index].Text,
|
|
|
+ Duration = p.SubItems[DurColumnHeader.Index].Text,
|
|
|
+ ToolTip = p.ToolTipText
|
|
|
+ }).ToArray();
|
|
|
|
|
|
_saveLoadService.Save();
|
|
|
}
|
|
@@ -510,8 +488,8 @@ namespace Bmp.WinForms
|
|
|
ctx.Items.Add("-");
|
|
|
|
|
|
var allSupportedDevices = OutputDeviceProvider.GetAllSupportedDevices();
|
|
|
- var selectedPcmDevice = allSupportedDevices.FirstOrDefault(p => p.Id == _saveLoadService?.State?.SelectedPcmOutputDeviceId);
|
|
|
- var selectedDsdDevice = allSupportedDevices.FirstOrDefault(p => p.Id == _saveLoadService?.State?.SelectedDsdAsioOutputDeviceId);
|
|
|
+ var selectedPcmDevice = allSupportedDevices.FirstOrDefault(p => p.Id == _saveLoadService.State.SelectedPcmOutputDeviceId);
|
|
|
+ var selectedDsdDevice = allSupportedDevices.FirstOrDefault(p => p.Id == _saveLoadService.State.SelectedDsdAsioOutputDeviceId);
|
|
|
|
|
|
var pcmOutputSelect = new ToolStripMenuItem($"PCM 输出{(selectedPcmDevice == null ? "(未选择)" : "")}");
|
|
|
ctx.Items.Add(pcmOutputSelect);
|
|
@@ -520,11 +498,10 @@ namespace Bmp.WinForms
|
|
|
ctx.Items.Add(dsdOutputSelect);
|
|
|
|
|
|
var dsdToPcm = new ToolStripMenuItem("软解码成PCM");
|
|
|
- if (_saveLoadService?.State?.DecodeDsdToPcm == true) dsdToPcm.CheckState = CheckState.Indeterminate;
|
|
|
+ if (_saveLoadService.State.DecodeDsdToPcm) dsdToPcm.CheckState = CheckState.Indeterminate;
|
|
|
dsdOutputSelect.DropDownItems.Add(dsdToPcm);
|
|
|
dsdToPcm.Click += delegate
|
|
|
{
|
|
|
- if (_saveLoadService?.State == null) return;
|
|
|
_saveLoadService.State.DecodeDsdToPcm = true;
|
|
|
_saveLoadService.State.SelectedDsdAsioOutputDeviceId = null;
|
|
|
ShowSettingContextMenu();
|
|
@@ -538,7 +515,6 @@ namespace Bmp.WinForms
|
|
|
if (selectedPcmDevice == deviceInfo) pcmDeviceItem.CheckState = CheckState.Indeterminate;
|
|
|
pcmDeviceItem.Click += delegate
|
|
|
{
|
|
|
- if (_saveLoadService?.State == null) return;
|
|
|
_saveLoadService.State.SelectedPcmOutputDeviceId = deviceInfo.Id;
|
|
|
_saveLoadService.State.OutputDeviceLatency = null;
|
|
|
ShowSettingContextMenu();
|
|
@@ -553,7 +529,6 @@ namespace Bmp.WinForms
|
|
|
|
|
|
dsdDeviceItem.Click += delegate
|
|
|
{
|
|
|
- if (_saveLoadService?.State == null) return;
|
|
|
_saveLoadService.State.SelectedDsdAsioOutputDeviceId = deviceInfo.Id;
|
|
|
_saveLoadService.State.DecodeDsdToPcm = false;
|
|
|
ShowSettingContextMenu();
|
|
@@ -574,14 +549,13 @@ namespace Bmp.WinForms
|
|
|
const int mulCount = 4;
|
|
|
|
|
|
var defaultLatency = selectedPcmDevice.Latency;
|
|
|
- var selectedLatency = _saveLoadService?.State?.OutputDeviceLatency ?? defaultLatency;
|
|
|
+ var selectedLatency = _saveLoadService.State.OutputDeviceLatency ?? defaultLatency;
|
|
|
|
|
|
- var latencyMenu = new ToolStripMenuItem("PCM 输出缓冲大小:" + (_saveLoadService.State?.OutputDeviceLatency ?? defaultLatency));
|
|
|
+ var latencyMenu = new ToolStripMenuItem("PCM 输出缓冲大小:" + (_saveLoadService.State.OutputDeviceLatency ?? defaultLatency));
|
|
|
ctx.Items.Add(latencyMenu);
|
|
|
|
|
|
void SetLatency(int latency)
|
|
|
{
|
|
|
- if (_saveLoadService.State == null) return;
|
|
|
_saveLoadService.State.OutputDeviceLatency = latency;
|
|
|
ShowSettingContextMenu();
|
|
|
//ShowSettingContextMenu(ctx.Items.IndexOf(latencyMenu));
|
|
@@ -622,7 +596,7 @@ namespace Bmp.WinForms
|
|
|
|
|
|
if (selectedDsdDevice == null)
|
|
|
{
|
|
|
- if (_saveLoadService?.State?.DecodeDsdToPcm == false)
|
|
|
+ if (_saveLoadService.State.DecodeDsdToPcm == false)
|
|
|
{
|
|
|
ctx.Items.Add("(未选择 DSD 输出设备)").Enabled = false;
|
|
|
}
|
|
@@ -682,29 +656,23 @@ namespace Bmp.WinForms
|
|
|
|
|
|
MainListView.Items.Clear();
|
|
|
|
|
|
- if (_saveLoadService != null)
|
|
|
+ if (_saveLoadService.State.FormPosition.HasValue) Location = _saveLoadService.State.FormPosition.Value;
|
|
|
+ Application.DoEvents();
|
|
|
+ if (_saveLoadService.State.FormSize.HasValue) Size = _saveLoadService.State.FormSize.Value;
|
|
|
+
|
|
|
+ if (_saveLoadService.State.Playlist != null)
|
|
|
{
|
|
|
- if (_saveLoadService.State != null)
|
|
|
+ foreach (var playlistItem in _saveLoadService.State.Playlist)
|
|
|
{
|
|
|
- if (_saveLoadService.State.FormPosition.HasValue) Location = _saveLoadService.State.FormPosition.Value;
|
|
|
- Application.DoEvents();
|
|
|
- if (_saveLoadService.State.FormSize.HasValue) Size = _saveLoadService.State.FormSize.Value;
|
|
|
-
|
|
|
- if (_saveLoadService.State.Playlist != null)
|
|
|
- {
|
|
|
- foreach (var playlistItem in _saveLoadService.State.Playlist)
|
|
|
- {
|
|
|
- var item = new ListViewItem();
|
|
|
- for (var i = 0; i < MainListView.Columns.Count - 1; i++) item.SubItems.Add("");
|
|
|
+ var item = new ListViewItem();
|
|
|
+ for (var i = 0; i < MainListView.Columns.Count - 1; i++) item.SubItems.Add("");
|
|
|
|
|
|
- item.Name = playlistItem.Path;
|
|
|
- item.SubItems[TitleColumnHeader.Index].Text = playlistItem.Title;
|
|
|
- item.SubItems[DurColumnHeader.Index].Text = playlistItem.Duration;
|
|
|
- item.ToolTipText = playlistItem.ToolTip;
|
|
|
+ item.Name = playlistItem.Path;
|
|
|
+ item.SubItems[TitleColumnHeader.Index].Text = playlistItem.Title;
|
|
|
+ item.SubItems[DurColumnHeader.Index].Text = playlistItem.Duration;
|
|
|
+ item.ToolTipText = playlistItem.ToolTip;
|
|
|
|
|
|
- MainListView.Items.Add(item);
|
|
|
- }
|
|
|
- }
|
|
|
+ MainListView.Items.Add(item);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -802,23 +770,25 @@ namespace Bmp.WinForms
|
|
|
{
|
|
|
MainListView.InsertionMark.Index = -1;
|
|
|
|
|
|
- if (e.Data?.GetDataPresent(typeof(ListViewItem[])) == true)
|
|
|
+ if (e.Data?.GetDataPresent(typeof(ListViewItem[])) == true
|
|
|
+ && e.Data.GetData(typeof(ListViewItem[])) is ListViewItem[] items && items.Length > 0)
|
|
|
{
|
|
|
- var items = e.Data.GetData(typeof(ListViewItem[])) as ListViewItem[];
|
|
|
-
|
|
|
var point = MainListView.PointToClient(new Point(e.X, e.Y));
|
|
|
|
|
|
var targetIndex = MainListView.InsertionMark.NearestIndex(point);
|
|
|
- //BUG: when move down index -= 1?
|
|
|
+
|
|
|
+ var isMoveDown = items[0].Index < targetIndex;
|
|
|
+ if (isMoveDown) --targetIndex;
|
|
|
+
|
|
|
if (targetIndex >= 0 && targetIndex < MainListView.Items.Count)
|
|
|
{
|
|
|
- foreach (var item in items!)
|
|
|
+ foreach (var item in items)
|
|
|
{
|
|
|
MainListView.Items.Remove(item);
|
|
|
}
|
|
|
targetIndex = Math.Min(targetIndex, MainListView.Items.Count);
|
|
|
|
|
|
- for (int i = 0; i < items.Length; i++)
|
|
|
+ for (var i = 0; i < items.Length; i++)
|
|
|
{
|
|
|
MainListView.Items.Insert(targetIndex + i, items[i]);
|
|
|
}
|
|
@@ -862,7 +832,7 @@ namespace Bmp.WinForms
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void MainContextMenu_Opening(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
+ private void MainContextMenu_Opening(object sender, CancelEventArgs e)
|
|
|
{
|
|
|
MainContextMenu.Items.Clear();
|
|
|
var moveTop = new ToolStripMenuItem("置顶");
|
|
@@ -900,7 +870,7 @@ namespace Bmp.WinForms
|
|
|
var selectedItems = MainListView.SelectedItems.Cast<ListViewItem>().ToArray();
|
|
|
var targetIndex = 0;
|
|
|
foreach (var item in selectedItems) MainListView.Items.Remove(item);
|
|
|
- for (int i = 0; i < selectedItems.Length; i++) MainListView.Items.Insert(targetIndex + i, selectedItems[i]);
|
|
|
+ for (var i = 0; i < selectedItems.Length; i++) MainListView.Items.Insert(targetIndex + i, selectedItems[i]);
|
|
|
};
|
|
|
|
|
|
moveUp.Click += delegate
|
|
@@ -908,14 +878,14 @@ namespace Bmp.WinForms
|
|
|
var selectedItems = MainListView.SelectedItems.Cast<ListViewItem>().ToArray();
|
|
|
var targetIndex = selectedItems[0].Index - 1;
|
|
|
foreach (var item in selectedItems) MainListView.Items.Remove(item);
|
|
|
- for (int i = 0; i < selectedItems.Length; i++) MainListView.Items.Insert(targetIndex + i, selectedItems[i]);
|
|
|
+ for (var i = 0; i < selectedItems.Length; i++) MainListView.Items.Insert(targetIndex + i, selectedItems[i]);
|
|
|
};
|
|
|
|
|
|
moveDown.Click += delegate
|
|
|
{
|
|
|
var selectedItems = MainListView.SelectedItems.Cast<ListViewItem>().ToArray();
|
|
|
- ListViewItem nextItem = null;
|
|
|
- for (int i = selectedItems[0].Index; i < MainListView.Items.Count; i++)
|
|
|
+ ListViewItem? nextItem = null;
|
|
|
+ for (var i = selectedItems[0].Index; i < MainListView.Items.Count; i++)
|
|
|
{
|
|
|
if (MainListView.Items[i].Selected == false)
|
|
|
{
|
|
@@ -931,7 +901,7 @@ namespace Bmp.WinForms
|
|
|
var targetIndex = nextItem.Index + 1;
|
|
|
|
|
|
if (targetIndex > MainListView.Items.Count) targetIndex = MainListView.Items.Count;
|
|
|
- for (int i = 0; i < selectedItems.Length; i++) MainListView.Items.Insert(targetIndex + i, selectedItems[i]);
|
|
|
+ for (var i = 0; i < selectedItems.Length; i++) MainListView.Items.Insert(targetIndex + i, selectedItems[i]);
|
|
|
};
|
|
|
|
|
|
moveBottom.Click += delegate
|
|
@@ -939,12 +909,12 @@ namespace Bmp.WinForms
|
|
|
var selectedItems = MainListView.SelectedItems.Cast<ListViewItem>().ToArray();
|
|
|
foreach (var item in selectedItems) MainListView.Items.Remove(item);
|
|
|
var targetIndex = MainListView.Items.Count;
|
|
|
- for (int i = 0; i < selectedItems.Length; i++) MainListView.Items.Insert(targetIndex + i, selectedItems[i]);
|
|
|
+ for (var i = 0; i < selectedItems.Length; i++) MainListView.Items.Insert(targetIndex + i, selectedItems[i]);
|
|
|
};
|
|
|
|
|
|
clearSelected.Click += delegate
|
|
|
{
|
|
|
- foreach (ListViewItem selectedItem in MainListView.SelectedItems.Cast<ListViewItem>().ToArray()) MainListView.Items.Remove(selectedItem);
|
|
|
+ foreach (var selectedItem in MainListView.SelectedItems.Cast<ListViewItem>().ToArray()) MainListView.Items.Remove(selectedItem);
|
|
|
};
|
|
|
|
|
|
clearAll.Click += delegate
|
|
@@ -957,13 +927,13 @@ namespace Bmp.WinForms
|
|
|
|
|
|
private void SettingButton_Click(object sender, EventArgs e) => ShowSettingContextMenu();
|
|
|
|
|
|
- private void StopButton_Click(object sender, EventArgs e) => StopAsync();
|
|
|
+ private async void StopButton_Click(object sender, EventArgs e) => await StopAsync();
|
|
|
|
|
|
private async void PlayButton_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
if (_playbackState == UIPlaybackState.Paused)
|
|
|
{
|
|
|
- await PlayAsync();
|
|
|
+ Play();
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -971,7 +941,7 @@ namespace Bmp.WinForms
|
|
|
if (selectedItem != null) await LoadItemAsync(selectedItem);
|
|
|
}
|
|
|
|
|
|
- private async void PauseButton_Click(object sender, EventArgs e) => await PauseAsync();
|
|
|
+ private void PauseButton_Click(object sender, EventArgs e) => Pause();
|
|
|
|
|
|
private async void PrevButton_Click(object sender, EventArgs e) => await TrackPrevAsync();
|
|
|
|
|
@@ -1009,6 +979,9 @@ namespace Bmp.WinForms
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ //参数
|
|
|
if (_inputSource != null)
|
|
|
{
|
|
|
sb.Append(" | ");
|
|
@@ -1051,6 +1024,7 @@ namespace Bmp.WinForms
|
|
|
: $"/{Math.Floor((float)sampleRate / 100) / 10.0:0.0}{unit}Hz");
|
|
|
}
|
|
|
|
|
|
+ //输出设备
|
|
|
if (_selectedOutputDevice != null && _playbackState == UIPlaybackState.Playing)
|
|
|
{
|
|
|
sb.Append(" | ");
|
|
@@ -1070,6 +1044,12 @@ namespace Bmp.WinForms
|
|
|
sb.Append($"{_selectedOutputDevice.DisplayName}");
|
|
|
}
|
|
|
|
|
|
+ //解码器 格式编码
|
|
|
+ if (_inputSource is IHaveDecoderInfo dn)
|
|
|
+ {
|
|
|
+ sb.Append($" | {dn.DecoderName} {dn.FileFormat}");
|
|
|
+ }
|
|
|
+
|
|
|
StatusBarLabel.Text = sb.ToString();
|
|
|
}
|
|
|
|
|
@@ -1096,7 +1076,7 @@ namespace Bmp.WinForms
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- await PauseAsync();
|
|
|
+ Pause();
|
|
|
|
|
|
_playbackState = UIPlaybackState.Seeking;
|
|
|
|
|
@@ -1123,7 +1103,7 @@ namespace Bmp.WinForms
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- await PlayAsync();
|
|
|
+ Play();
|
|
|
}
|
|
|
catch (Exception exception)
|
|
|
{
|