Sign In:     


Forum: General Discussion

Topic: Saving currently playing song to a file or virtual folder on demand
Hi all

Does anybody happen to know of a way to save the currently playing song title & artist to a file or virtual folder? I only want this to happen when a custom button is clicked, not for all songs. I can't see anything obvious in the scripting verb list but may well have missed it so any help is appreciated.
 

Posted Mon 17 Apr 23 @ 11:51 pm
I was looking some similar to push the current track to RDS encoder for FM Transmitter. (Stereotool can read a file to achieve that). I ended up with PowerShell. Still looking for better solution.

Line 3 reads the last line of tracklist.txt and saves it to CurTrack1.txt
Line 4 truncates the first 8 characters and saves to CurTrack2.txt
nb: VDJ saves to tracklist.txt after 45 sec of play, so I set the 'historyDelay' option to a lower value.

$notpressed = $true
while($notpressed){
(Get-Content C:\Users\Gebruiker\AppData\Local\VirtualDJ\History\tracklist.txt)[-1] | Out-File C:\Test\CurTrack1.txt
(Get-Content 'C:\Test\CurTrack1.txt' -raw) -replace '^........' | Set-Content 'C:\Test\CurTrack2.txt'
Get-Content -Path C:\Test\CurTrack1.txt
Get-Content -Path C:\Test\CurTrack2.txt
Start-Sleep -Seconds 5
}
 

@grooves I could make that for you.

@BertMulder probably for you too.
 

One could easily adapt the usual history created by VDJ ..
to only contain those tracks that you added manually, to history, with your button.
 

Thanks for your input guys, after a bit of thought it turned out to be really easy - I simply mapped a button to search for the currently playing track, prepended with some additional text, then a brief delay & then reset the search to show all tracks again (it was a bit flaky if I didn't include the delay before resetting but your mileage may vary). By setting the search log to record unfound songs, the song (with its prepended text) will never be found & so will be added to the log. @BertMulder, don't know if this will be any use to you but you may be able to adapt the concept to suit your needs.
 

Clever idea ! !