Reputation: 138
I am only just beginning to look at programming and I thought it would be cool to try and add some custom Cortana commands to my Windows 10 computer. I found a really helpful tutorial on how to do so, and now I have just about all the code together for the simple project. Now, I just would like to know, how would I, in Visual Studio in C#, open a Grove Music Playlist?
I have a shortcut to it pinned to start, but I have no clue how to open it, or even where the actual playlist file is stored. The only reason I could get it pinned to start in the first place is that there is an option to do so in the Grove Music app.
Here is some example code for what happens in the case of specified voice commands that I got from the tutorial:
/*
{<command name from VCD>, (Action)(async () => {
<code that runs when that commmand is called>
})}
*/
{"OpenFile", (Action)(async () => {
StorageFile file = await Package.Current.InstalledLocation.GetFileAsync(@"Test.txt");
await Launcher.LaunchFileAsync(file);
})},
So, does anyone know what code I would add in to run a specified playlist?
Upvotes: 0
Views: 1483
Reputation: 44086
Groove is a service with clients. See Groove Service, for example. When you're thinking about opening a playlist "file", there's no guarantee that the file even exists locally on the machine. If it does, it's probably somewhere in the groove client's private app data store.
But that's OK! You don't need it anyway because you're working with an app that can also be a client of the groove service and get all the same tools that the native groove app is leveraging! At the lowest level, you can use the Groove REST Api to work with the service.
In your question you mention that you're pretty new to programming, so maybe going directly against the REST API is more trouble than it's worth. There's a .Net SDK that is also published which you can use to interact with groove.
And this is only the start after about 2 minutes of web searching. Have fun exploring what the API provides! :)
Upvotes: 1