Write empty record to nowplaying when no track is onair

You have a question or need an advice about how to do something? Ask it here!
Post Reply
User avatar
hdradio
Posts: 625
Joined: 10 Apr 2012 17:36
Location: Crete, Hellas
Write empty record to nowplaying when no track is onair

Post by hdradio »

Bernd can you please advise me how to solve my following problem:
I have an RDS software that reads a "nowplaying.txt" file and sends that data to RDS encoder whenever a change to that file happens.
I am creating that file using the command at Playlist -> Track Play:
EXEC_WRITE_FILE G:\RDS\NowPlaying.txt|nu|${artist} - ${title}

The problem starts when the track ends and commercial (or any other) overlay plays.
The "nowplaying.txt" file still has the last song's title and the RDS shows that a song plays that is not true.
I am thinking to write an empty string using the command on overlay start. Is that correct ?

But what can I do on a live show? The track ends, the DJ starts talking but still the RDS shows the previous track info.

This question also goes to TuneIn API where it says that we send :
title: The name of the song
artist:The artist associated with the song
album:The name of the associated album
commercial:Set to true if the now playing broadcast is in commercial rather than a song

Here I suppose there is an easy solution as I can send a new command when an overlay starts playing.

Any thoughts ?
Last edited by hdradio on 04 Dec 2014 20:15, edited 1 time in total.
User avatar
hdradio
Posts: 625
Joined: 10 Apr 2012 17:36
Location: Crete, Hellas
Re: Write empty record to nowplaying when no track is onair

Post by hdradio »

Stupid me. :lol:
I can use the command on "OnTrackStop"

Edit:

hmmm :? a question here:
What is the execution turn while crossfading ?
a) track1 stop -> track2 start
or
b) track2 start -> track1 stop

If its a) is ok. But if it's b) there will be an empty "nowplaying.txt" file.

My short test here seems that a) is the case. Can you confirm it ?
Last edited by hdradio on 04 Dec 2014 20:40, edited 1 time in total.
User avatar
radio42
Site Admin
Posts: 8926
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Write empty record to nowplaying when no track is onair

Post by radio42 »

Yes.... ;-)

Or you might use the event "Scheduler.OnOverlayTrackPlay", if you want something specific there.
Or (if more general, and in line with your streaming title update) you might always use the "Streaming.OnSongTitleChange" event.
User avatar
hdradio
Posts: 625
Joined: 10 Apr 2012 17:36
Location: Crete, Hellas
Re: Write empty record to nowplaying when no track is onair

Post by hdradio »

I updated my post while you were writing your answer. Can you read my post above ?
User avatar
radio42
Site Admin
Posts: 8926
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Write empty record to nowplaying when no track is onair

Post by radio42 »

I guess you mean the order in which the OnTrackPlay resp. OnTrackStop events are triggered.
The "OnTrackPlay" event is triggered when the next track track starts to play, which is typically the case when the NEXT cue-point is reached.
The "OnTrackStop" event is triggered when the current track ends, which is typically the case when the CUE-OUT cue-point is reached.
As such it is mostly b) and NOT a).

That's why I mentioned the other commands to use above.
User avatar
hdradio
Posts: 625
Joined: 10 Apr 2012 17:36
Location: Crete, Hellas
Re: Write empty record to nowplaying when no track is onair

Post by hdradio »

I 've found why it was a) in my case. I had no parameters to the "OnTrackStop" command and probably it did not execute. :roll:

The "Streaming.OnSongTitleChange" fires also when a song ends ?
If not, how can I write an empty string to "nowplaying.txt" file when a track ends and a DJ starts talking ?
As I wrote in my first post I need an empty txt file if no track is playing.
User avatar
radio42
Site Admin
Posts: 8926
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Write empty record to nowplaying when no track is onair

Post by radio42 »

No, "Streaming.OnSongTitleChange" fires when something new starts playing and is also triggered from the overlay, or other players.

Not sure, if that is really your condition (empty file if nothing is playing), but here is what you can do...
You can check, if nothing is playing, when a track ends.
As such you execute a conditional commands:

OnTrackStop:
EXEC_COMMAND2 ${cplisplaying}|Equals(0)|SHOW_ALERT_WINDOW Nothing Is Currently Playing

You might then replace "SHOW_ALERT_WINDOW Nothing Is Currently Playing" with your effective command...
User avatar
hdradio
Posts: 625
Joined: 10 Apr 2012 17:36
Location: Crete, Hellas
Re: Write empty record to nowplaying when no track is onair

Post by hdradio »

Great. That's what I needed !
Thank you.

Post Reply