This commit is contained in:
TinyHerm committed 2026-11-24 23:40:08 +03:00
commit 1c7a8cf25f
579 files changed
+83196

No files matched your search

@@ -0,0 +1,39 @@
using System.Diagnostics;
namespace VibranceHud.Music;
internal sealed class SpotifyWindowTitleSource : INowPlayingSource
{
public string? SpotifyWindowTitle()
{
Process[] processesByName;
try
{
processesByName = Process.GetProcessesByName("Spotify");
}
catch
{
return null;
}
string text = null;
Process[] array = processesByName;
foreach (Process process in array)
{
try
{
if (text == null && !string.IsNullOrWhiteSpace(process.MainWindowTitle))
{
text = process.MainWindowTitle;
}
}
catch
{
}
finally
{
process.Dispose();
}
}
return text;
}
}