2508281330
清理已未使用註解function
This commit is contained in:
parent
2b25b14047
commit
9e44419710
@ -336,7 +336,7 @@ namespace OverlayFormObj
|
||||
topLeftLabel.Text = text;
|
||||
topLeftLabel.Visible = true; // 確保標籤顯示
|
||||
Console.WriteLine($"更新顯示: {text}");
|
||||
Console.WriteLine(topLeftLabel.Location);
|
||||
// Console.WriteLine(topLeftLabel.Location);
|
||||
}
|
||||
|
||||
private void InitializeTopRightLabel()
|
||||
|
@ -1,12 +1,8 @@
|
||||
|
||||
|
||||
namespace DualScreenDemo
|
||||
{
|
||||
public class PromotionsAndMenuPanel : Panel
|
||||
{
|
||||
//public ImagePanel prevPagePanel;
|
||||
public ImagePanel currentPagePanel;
|
||||
//public ImagePanel nextPagePanel;
|
||||
|
||||
private List<Image> promotionsAndMenuImages;
|
||||
private const int ImagesPerPage = 1;
|
||||
@ -34,25 +30,17 @@ namespace DualScreenDemo
|
||||
|
||||
private void InitializePages()
|
||||
{
|
||||
//prevPagePanel = new ImagePanel();
|
||||
currentPagePanel = new ImagePanel();
|
||||
// nextPagePanel = new ImagePanel();
|
||||
|
||||
// PrimaryForm.ResizeAndPositionControl(prevPagePanel, -1440, 0, 1440, 900);
|
||||
PrimaryForm.ResizeAndPositionControl(currentPagePanel, 0, 0, 1440, 900);
|
||||
// PrimaryForm.ResizeAndPositionControl(nextPagePanel, 1440, 0, 1440, 900);
|
||||
|
||||
//this.Controls.Add(prevPagePanel);
|
||||
this.Controls.Add(currentPagePanel);
|
||||
//this.Controls.Add(nextPagePanel);
|
||||
}
|
||||
|
||||
public void LoadImages(List<Image> images)
|
||||
{
|
||||
promotionsAndMenuImages = images;
|
||||
//LoadPage(currentPageIndex - 1);
|
||||
LoadPage(currentPageIndex);
|
||||
//LoadPage(currentPageIndex + 1);
|
||||
}
|
||||
|
||||
private void LoadPage(int pageIndex)
|
||||
@ -77,11 +65,6 @@ namespace DualScreenDemo
|
||||
|
||||
private ImagePanel IdentifyTargetPanel(int pageIndex)
|
||||
{
|
||||
//if (pageIndex == currentPageIndex - 1)
|
||||
// return prevPagePanel;
|
||||
// else if (pageIndex == currentPageIndex + 1)
|
||||
// return nextPagePanel;
|
||||
// else
|
||||
return currentPagePanel;
|
||||
}
|
||||
|
||||
@ -173,9 +156,7 @@ namespace DualScreenDemo
|
||||
if (currentPageIndex > 0)
|
||||
{
|
||||
currentPageIndex--;
|
||||
//LoadPage(currentPageIndex - 1);
|
||||
LoadPage(currentPageIndex);
|
||||
//LoadPage(currentPageIndex + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -190,9 +171,7 @@ namespace DualScreenDemo
|
||||
if (currentPageIndex < (promotionsAndMenuImages.Count - 1) / ImagesPerPage)
|
||||
{
|
||||
currentPageIndex++;
|
||||
//LoadPage(currentPageIndex - 1);
|
||||
LoadPage(currentPageIndex);
|
||||
//LoadPage(currentPageIndex + 1);
|
||||
}
|
||||
else {
|
||||
|
||||
|
@ -15,7 +15,7 @@ namespace DualScreenDemo.Services
|
||||
{
|
||||
Core.Initialize();
|
||||
_libVLC = new LibVLC(
|
||||
// "--verbose=-1",
|
||||
"--verbose=-1",
|
||||
// enableDebugLogs: true,
|
||||
"--audio-time-stretch",
|
||||
"--vout=automatic",
|
||||
@ -115,39 +115,6 @@ namespace DualScreenDemo.Services
|
||||
public void Stop() => _mediaPlayer.Stop();
|
||||
#endregion
|
||||
|
||||
#region Audio
|
||||
public List<TrackDescription> GetAudioTracks()
|
||||
{
|
||||
var result = new List<TrackDescription>();
|
||||
var media = _mediaPlayer.Media;
|
||||
|
||||
if (media == null) return result;
|
||||
|
||||
//if (!media.IsParsed)
|
||||
// media.Parse(MediaParseOptions.ParseLocal);
|
||||
|
||||
//var tracks = media.Tracks;
|
||||
// if (tracks == null) return result;
|
||||
|
||||
// foreach (var track in tracks.Where(t => t.TrackType == TrackType.Audio))
|
||||
// {
|
||||
// result.Add(new TrackDescription
|
||||
// {
|
||||
// Id = track.Id,
|
||||
// Name = !string.IsNullOrEmpty(track.Language) ? track.Language : $"Audio Track {track.Id}"
|
||||
// });
|
||||
// }
|
||||
return result;
|
||||
}
|
||||
|
||||
public void SetAudioTrack(int trackIndex)
|
||||
{
|
||||
var audioTracks = GetAudioTracks();
|
||||
if (trackIndex < 0 || trackIndex >= audioTracks.Count) return;
|
||||
//_mediaPlayer.SetAudioTrack(audioTracks[trackIndex].Id);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Volume
|
||||
public void SetVolume(int volume) => _mediaPlayer.SetVolume(volume);
|
||||
public int GetVolume() => _mediaPlayer.Volume;
|
||||
|
@ -123,8 +123,6 @@ namespace DualScreenDemo
|
||||
}
|
||||
else
|
||||
{
|
||||
// _mediaService0.SetVideoOutput(PrimaryForm.Instance.videoPanel.Handle, PrimaryForm.Instance.videoPanel.Width, PrimaryForm.Instance.videoPanel.Height);
|
||||
//_mediaService1.SetVideoOutput(this.Handle, secondMonitor.Bounds.Width, secondMonitor.Bounds.Height);
|
||||
this.Controls.Add(PrimaryForm.Instance.videoView1);
|
||||
PrimaryForm.Instance.videoView1.MediaPlayer = _mediaService1.Player;
|
||||
PrimaryForm.Instance.videoView0.MediaPlayer = _mediaService0.Player;
|
||||
@ -348,12 +346,13 @@ namespace DualScreenDemo
|
||||
try
|
||||
{
|
||||
string pathToPlay = song.getFile();
|
||||
//同步畫面播放器載入media設置參數
|
||||
_mediaService0.LoadMedia(pathToPlay, 0);
|
||||
_mediaService0.Player.Media.AddOption(":no-audio");
|
||||
_mediaService0.Player.AspectRatio = "8:5";
|
||||
// _mediaService0.Player.Scale = 1.5f;
|
||||
//影片畫面播放器載入media設置聲道
|
||||
_mediaService1.LoadMedia(pathToPlay, song.isPublicSong ? 0 : 1);
|
||||
|
||||
//公播時註銷原唱按鈕事件
|
||||
if (song.isPublicSong)
|
||||
{
|
||||
PrimaryForm.Instance.originalSongButton.Click -= PrimaryForm.Instance.OriginalSongButton_Click;
|
||||
@ -363,13 +362,13 @@ namespace DualScreenDemo
|
||||
PrimaryForm.Instance.originalSongButton.Click -= PrimaryForm.Instance.OriginalSongButton_Click;
|
||||
PrimaryForm.Instance.originalSongButton.Click += PrimaryForm.Instance.OriginalSongButton_Click;
|
||||
}
|
||||
|
||||
isVocalRemoved = true;
|
||||
if (isMuted) { Mute(true); }
|
||||
|
||||
// 音量處理
|
||||
SetVolume(100 + song.getBasic().getDbChange());
|
||||
Task.Run(() => Thread.Sleep(100));
|
||||
Console.WriteLine(_mediaService1.GetVolume());
|
||||
if (isSyncToPrimaryMonitor) SyncToPrimaryMonitor();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
@ -498,12 +497,10 @@ namespace DualScreenDemo
|
||||
{
|
||||
if (isMuted)
|
||||
{
|
||||
// _mediaService0.Mute(true);
|
||||
_mediaService1.Mute(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// _ToggleVocalRemoval(isVocalRemoved);
|
||||
_mediaService1.Mute(false);
|
||||
}
|
||||
return isMuted;
|
||||
@ -524,7 +521,6 @@ namespace DualScreenDemo
|
||||
{
|
||||
if (isVocalRemoved)
|
||||
{
|
||||
|
||||
_mediaService1.Player.Select(TrackType.Audio, "audio/2");
|
||||
|
||||
isVocalRemoved = false;
|
||||
@ -535,7 +531,6 @@ namespace DualScreenDemo
|
||||
// _mediaService1.Player.Select(TrackType.Audio, "audio/3");
|
||||
isVocalRemoved = true;
|
||||
}
|
||||
// isVocalRemoved = _ToggleVocalRemoval(!isVocalRemoved);
|
||||
OverlayForm.MainForm.ShowTopRightLabelTime(isVocalRemoved ? "無人聲" : "有人聲");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user