[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GroovyRP to support new Media Player, disable auto start support. #35

Merged
merged 1 commit into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update GroovyRP to support new Media Player, disable auto start support.
  • Loading branch information
dsdude123 committed Jan 30, 2023
commit 3254601a0d12761d62756444c1ed644a4ec9069b
4 changes: 2 additions & 2 deletions GroovyRPCore/GrooveInfoFetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public TrackInfo GetTrackInfo()

public bool IsUsingAudio()
{
var grooveMusics = Process.GetProcessesByName("Music.UI");
var grooveMusics = Process.GetProcessesByName("Microsoft.Media.Player");
if (grooveMusics.Any())
{
AudioSessionManager2 sessionManager;
Expand All @@ -46,7 +46,7 @@ public bool IsUsingAudio()
using (var sessionControl = session.QueryInterface<AudioSessionControl2>())
{
var process = sessionControl.Process;
if (process != null && process.ProcessName.Equals("Music.UI"))
if (process != null && process.ProcessName.Equals("Microsoft.Media.Player"))
{
targetProcess = true;
}
Expand Down
33 changes: 20 additions & 13 deletions GroovyRPHelper/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private static void RegisterTask()
startupTrigger.Subscription = @"
<QueryList>
<Query Id='0' Path='Application'>
<Select Path='Application'>Event[System[Provider[@Name='ESENT'] and (Level=4 or Level=0) and (EventID=102)] and EventData[Data='Music.UI']]</Select>
<Select Path='Application'>Event[System[Provider[@Name='ESENT'] and (Level=4 or Level=0) and (EventID=102)] and EventData[Data='Microsoft.Media.Player']]</Select>
</Query>
</QueryList>
";
Expand All @@ -167,17 +167,24 @@ private static void UnregisterTask()
private static Config CreateConfiguration()
{
Config config = new Config();
DialogResult autoStartChoice = MessageBox.Show("Do you want to automatically start GroovyRP when Groove Music is opened?", "First Run Setup", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (autoStartChoice.Equals(DialogResult.Yes))
{
RegisterTask();
config.RunWhenGrooveMusicOpens = true;
}
else
{
UnregisterTask();
config.RunWhenGrooveMusicOpens = false;
}

/*
* The new media player no longer generates events needed to auto start GrovvyRP.
* Unfortinutely have no choice but to disable auto start support for now.
*/
UnregisterTask();
config.RunWhenGrooveMusicOpens = false;
//DialogResult autoStartChoice = MessageBox.Show("Do you want to automatically start GroovyRP when Groove Music is opened?", "First Run Setup", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
//if (autoStartChoice.Equals(DialogResult.Yes))
//{
// RegisterTask();
// config.RunWhenGrooveMusicOpens = true;
//}
//else
//{
// UnregisterTask();
// config.RunWhenGrooveMusicOpens = false;
//}

DialogResult hideChoice = MessageBox.Show("Do you want to run GroovyRP in the background when it is opened?", "First Run Setup", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (hideChoice.Equals(DialogResult.Yes))
Expand Down Expand Up @@ -240,7 +247,7 @@ private static void UpdateCheck(object Sender, EventArgs e)

public static void checkGrooveMusicStatus()
{
Process[] grooveMusics = Process.GetProcessesByName("Music.UI");
Process[] grooveMusics = Process.GetProcessesByName("Microsoft.Media.Player");
if (grooveMusics.Length < 1)
{
Environment.Exit(0);
Expand Down
2 changes: 1 addition & 1 deletion VersionInfo.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<VersionInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Version>1.0.0.0</Version>
<Version>1.1.0.0</Version>
</VersionInfo>