Author Topic: Song title written to text file?  (Read 189 times)

0xc000007e

  • Posts: 3
Song title written to text file?
« on: 18 Jul '20 - 08:59 »
I love this player. It's the select few applications keeping me from going to Linux.

I would use window capture on OBS to get the song title but it does not work for me.

So I would love a way to show song title on OBS but I can't.

Is there a plugin or something?

saga

  • Posts: 2407
Re: Song title written to text file?
« Reply #1 on: 18 Jul '20 - 11:55 »
It can be done easily either using a plugin (like the XMPlay MSN or last.fm plugins), or using external software (by reading the window title). I did the latter many years ago using Visual Basic 6 and it was rather simple. No idea how hard or easy any of that would be with OBS though. Does it have a way of extracting window titles from arbitrary windows? If so, you can look for a window whose class name is "Winamp v1.x" and then read its title.

0xc000007e

  • Posts: 3
Re: Song title written to text file?
« Reply #2 on: 18 Jul '20 - 12:38 »
It appears getting the song from the title worked... but I can't get it to write it to a file for OBS to read it.
GetWindowText won't output to text file so that would not work.
Is there some software that does that?

0xc000007e

  • Posts: 3
Re: Song title written to text file?
« Reply #3 on: 18 Jul '20 - 15:50 »
So there was no software to do that... so I made a batch file for it!

Code: [Select]
@echo off
SetLocal EnableDelayedExpansion
:ree
for /f "delims=" %%a in ('tasklist /fi "imagename eq xmplay.exe" /fo list /v ^| find /i "window title:"') do @set pp=%%a
SET result=!pp:Window Title:=!
REM for /f "delims=" %%a in ('type ree.txt') do @set ree=%%a
if !result! NEQ !ree! (
REM echo !result!>ree.txt
for /f "delims=" %%a in ('echo !result!') do @set ree=%%a
<NUL set /p=!result!>temp.txt
echo modified
)
goto ree