Braasileiro / PDRPC

Discord Rich Presence for Hatsune Miku: Project DIVA Mega Mix+.
https://gamebanana.com/mods/389105
GNU General Public License v3.0
9 stars 1 forks source link

Feature Request: Add function for exporting song info to other applications #7

Open MarcG2 opened 1 month ago

MarcG2 commented 1 month ago

Clone Hero, another rhythm game, has a feature that prints the currently playing song to text file. This function allows streamers to automatically display their current song. Though I use it to enhance my game utilities.

With your mod, I imagine you're already 95% of the way there to achieving similar functionality. I'd be very grateful if you could add it to your mod.
Or if you don't want to, any advice on how to leverage your code for getting current song data would be much appreciated.

Braasileiro commented 1 month ago

Hello! Could you show me an example of the structure of this text file, please?

MarcG2 commented 1 month ago

Hello! Could you show me an example of the structure of this text file, please?

In Clone Hero, by default it was a simple text file that listed song name, album, and then charter. But it can be configured to the user's liking. Go to this link a scroll down a bit to see how they implemented it. For this function to be good for streaming with OBS, I think you would need to have it configurable like they did it. https://wiki.clonehero.net/books/guides-and-tutorials/page/general-guides

For my use case, I'm doing my own text parser. So I would happy if you just printed all the available song data. I can just ignore the data I don't need. Be sure to set to set the text file encoding to UTF-8. Also, I don't think there's any need to show menu status in the text file like the mod does with Discord.

Attached is simple example of what the text file output might look like.

Current Song Output.txt

MarcG2 commented 1 month ago

So is this something you'll try adding? If not, then any advice on utilizing your song reading code would be appreciated.

Braasileiro commented 1 week ago

Sorry for the delay, my time has been short in recent months. I've published version 0.2.0 with the change, just activate it in the config.toml file. You can find the text file 'current_song_info.txt' in the mod folder.

I've updated the README and it shows the format in which the file is generated. Basically, it's all the information I display in RPC, but formatted for a text file.

I've updated the mod on GameBanana as well.

MarcG2 commented 1 week ago

Sweet! I'll test it out soon.

MarcG2 commented 3 days ago

I just tested it out.
Is there a way to get the song ID? I'd really like to be able to distinguish between multiple versions of the same song.

Also you'll need to make some adjustments for it to useful for OBS streaming. It's not my use case. But I'm sure there's one or two people on the planet who'd appreciate the feature. To my understanding, OBS will continuously display the text file's contents until it's changed. So when the user backs out to the menu, it would be best to clear the file. It'd also be best to have some options for choosing which data gets output. In case a user only wanted to display the song's artist or something. If I was streaming, the one thing I'd want to display is the song's mod pack. (which I know, isn't available metadata)

In case it's not clear what I'm talking about, here's an example stream. The text on the top left when a song is playing is pulling from a text file. https://www.youtube.com/watch?v=go7v2KLkGQs