Now Playing

You have a question or need an advice about how to do something? Ask it here!
Post Reply
DennisdeWit
Posts: 35
Joined: 10 Mar 2013 14:22
Now Playing

Post by DennisdeWit »

Feeling quiet stupid, because I know I have read somewhere how to do it, but forgot.

I want to make a kind of "Now Playing" thing. It just has to write the song that's playing now in ARTIST - TITLE format into a simple txt file. That's all. How do I figure this out?

Thanks, Dennis
User avatar
radio42
Site Admin
Posts: 8348
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Now Playing

Post by radio42 »

Something like this:
viewtopic.php?f=8&t=710

In addition:
ProppFrexx has an event mechanism through which you can almost implement anything you need.
If you open the general settings and go to the 'Events/Commands' section you will see a tree list ordered in categories with a lot of predefined system events.
You might now assign any control-command to any of these events - eg. you might use the 'Playlist.OnTrackPlay' event.
For example you can assign the 'EXEC_WRITE_FILE', 'EXEC_SEND_HTTP_GET' or 'EXEC_SEND_HTTP_POST' etc. control-command to such event.
Within the control-commands you might now use any of the defined macros (see the user manual appendix for all available macros and control-commands).
This allows you to update your web-site with eg. the currently playing song info.

Or you might use the following:
The EXEC_WRITE_PLAYLISTFILE control-command can be used to generate a playlist file (eg. html) out of the playback history based on a template file.
The template file might contain macros (see user manual appendix) which are replaced ar runtime with the entries of the playback history in order to generate the final playlist file.
You might then for example upload this generated playlist file to your web-site.
It is most appropriate to use the control-command(s) in the global Streaming event section's "OnSongTitleChanged" event as this event is fired every time a song title changes (note, that it is not necessary to have a streaming server actually configured or started in order that this event is being fired), eg. like this:

Code: Select all

EXEC_WRITE_PLAYLISTFILE C:\Test\test.html|C:\Test\template.html
EXEC_UPLOAD_FILE C:\Test\test.html|ftp://yourftp/folder/test.html|username|password
These commands will first generate a playlist file test.html based on the given template.html and then upload this file to an FTP-Server.
The template file might eg. contain the following content:

Code: Select all

<HTML>
 <BODY>
 <p>Previous5: ${05trackname} at ${05playedat}</p>
 <p>Previous4: ${04trackname} at ${04playedat}</p>
 <p>Previous3: ${03trackname} at ${03playedat}</p>
 <p>Previous2: ${02trackname} at ${02playedat}</p>
 <p>Current: ${01trackname} at ${01playedat}</p>
 <p>Next: ${nexttrackname}</p>
 </BODY>
</HTML>
DennisdeWit
Posts: 35
Joined: 10 Mar 2013 14:22
Re: Now Playing

Post by DennisdeWit »

Yep, it works!

But now I want to voicetrack. I just dragged in two songs, and right clicked 'Voice Track', no dialogue is coming. Help?
User avatar
radio42
Site Admin
Posts: 8348
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Now Playing

Post by radio42 »

You must right-click on the first track and then select 'Voice Tracking...'
XTended
Re: Now Playing

Post by XTended »

Hi Bernd,

Nice topic!
I already works within my site, but can I generate a php file of it, so I can include it in another php file?
User avatar
radio42
Site Admin
Posts: 8348
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Now Playing

Post by radio42 »

Yes, when working with a template file it doesn't matter, if it is an html or php file.
It basically replaces the macros is any text file.
XTended
Re: Now Playing

Post by XTended »

Thanks Bernd!
XTended
Re: Now Playing

Post by XTended »

Just another question about the topic "now playing"; php works good now.
But I saw yesterday with the written html file that there will be more written and I don't know if that is a bug.

What does this mean "" ?

<div class="unit whole bck-black" id="widget-nowplaying">

<p>Previous5: Blof - Iedereen Is Van De Wereld at 13:41:24</p>
<p>Previous4: De Dijk - Dansen Op De Vulkaan ...live at 13:47:14</p>
<p>Previous3: Advert: - Advert: at 13:52:58</p>
<p>Previous2: Noodweer - In De Disco (12 inch versie) at 13:54:56</p>
<p>Current: Erasure - Victim Of Love (12 inch mix) at 14:02:22</p>
<p>Next: ABBA - Voulez-Vous</p>

</div>

This is the code I created:

EXEC_WRITE_PLAYLISTFILE D:\Test\widget-nowplaying.php|D:\Test\template.php
EXEC_UPLOAD_FILE D:\Test\widget-nowplaying.php|ftp://server87.hosting2go.nl/httpdocs/t ... mypassword
XTended
Re: Now Playing

Post by XTended »

I viewed the file with Homesite. Just did the same with Notepad and than the code is gone.
About who created the template file, me. Just like you said yesterday, you can do it also with php ;-)
Topic closed cause it works.
User avatar
radio42
Site Admin
Posts: 8348
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Now Playing

Post by radio42 »

I don't know...probably some unicode bom header...where/when is that coming from, who did create the template file, with what editor are you looking at this file... and how did you create your template file with...?

Post Reply