Skip to Content
It is currently January 28th, 2022, 2:00 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: September 1st, 2021, 3:26 pm 
Offline
Junior User
Junior User

Joined: August 10th, 2007, 12:11 pm
Posts: 68
Location: Kansas City, MO
Hello, it's been a while since I have been on here. Good to see a lot of "regulars" still hang out!...

Doesn't look like Spacial is really supporting this forum any more... I see a lot of broken images, and the server running it doesn't seem to be "secure," according to my browser.... At least it still seems to be functioning, and for that, I'm grateful!

I'm interested in a PAL script that would apply a clockwheel (.cwf) to schedule a minimum of 24 hours-worth of music, then save the result as an m3u playlist file.

Does something along these lines exist already? If not, I would be willing to pay someone to create one for me.

Thanks in advance,
John

_________________
John Dutton, Operations Director
KC Cafe Radio
http://www.kccaferadio.com


Top
 Profile  
Reply with quote  
PostPosted: September 2nd, 2021, 5:36 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8299
Location: Cologne (Germany)
kccafe wrote:
Doesn't look like Spacial is really supporting this forum any more... I see a lot of broken images, and the server running it doesn't seem to be "secure," according to my browser.... At least it still seems to be functioning, and for that, I'm grateful!

It's not a "secure" connection (as in HTTPS/TLS/SSL), but other than that it's as secure as it has always been.
If you're on an open WiFi, others in the same WiFi can see which password you sent to the server, but the Spacial forum isn't really that interesting unless of course you use the same password for everything.

kccafe wrote:
I'm interested in a PAL script that would apply a clockwheel (.cwf) to schedule a minimum of 24 hours-worth of music, then save the result as an m3u playlist file.

You can't schedule that far in advance unless you don't care about repeat rules. These are evaluated at the time of selection and don't take the queue into account.

The only way to make that happen correctly is play for 24hrs straight from that clockwheel and then take the entries from the last 24hrs of history into a playlist file.
I don't think anything like that exists, because it's kinda against the core principles of how scheduling in SAM works, though.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: September 2nd, 2021, 10:21 am 
Offline
Junior User
Junior User

Joined: August 10th, 2007, 12:11 pm
Posts: 68
Location: Kansas City, MO
Thanks Benedikt, I was hoping you would chime in on this! :)

I was wondering about how artist and title repeat rules would be applied under my scenario.... I have thought about saving the history list as an alternarive, so let me ask this.... Is there any way to have a PAL script that "grabs" the previous 24 hours of the history list and save it as an m3u file?

What I am trying to do is create a rotation of music for a 3rd party service that would not be connected with my live stream.

_________________
John Dutton, Operations Director
KC Cafe Radio
http://www.kccaferadio.com


Top
 Profile  
Reply with quote  
PostPosted: September 2nd, 2021, 11:22 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8299
Location: Cologne (Germany)
Sure, that can be done.
M3U is one of the most basic playlist formats around (in it's most basic version, the playlist doesn't have any metadata and simply lists one filename/path per line)

Example from Wikipedia:
Code:
Alternative\Band - Song.mp3
Classical\Other Band - New Song.mp3
Stuff.mp3
D:\More Music\Foo.mp3
..\Other Music\Bar.mp3
http://www.example.com:8000/Listen.mp3
http://www.example.com/~user/Mine.mp3


Assuming you don't have any repetitions you could pretty much use the example from the PAL Script Reference with only 2 minor modifications:
Code:
var D : DateTime;
var Q : TDataSet;

// The example looks for songs played in the last 20 minutes
D := T['-24:00:00'];
Q := Query('SELECT * FROM songlist WHERE date_played >= :time ORDER BY date_played DESC',[D],False);

Q.First;
while not Q.EOF do
begin
// Do not write to console
// WriteLn(Q['filename']);
// Instead append the title to the playlist.m3u file, but add a newline character to the end to make a line break after that entry
AppendStringToFile('playlist.m3u', Q['filename'] + Chr(10));
Q.Next;
end;
 
Q.Free;


^^ The above code is untested. You'll have to figure out if it works and maybe if it needs adjustments yourself.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: November 24th, 2021, 2:07 pm 
Offline
Junior User
Junior User

Joined: August 10th, 2007, 12:11 pm
Posts: 68
Location: Kansas City, MO
If I want a unique filename for each day based on the "DateTime" variable [D]. how would I incorporate that into the PAL to generate the filename (in the form of "playlist[DateTime].m3u"?

_________________
John Dutton, Operations Director
KC Cafe Radio
http://www.kccaferadio.com


Top
 Profile  
Reply with quote  
PostPosted: November 25th, 2021, 10:29 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8299
Location: Cologne (Germany)
See this line:
Code:
AppendStringToFile('playlist.m3u', Q['filename'] + Chr(10));


Just switch out the 'playlist.m3u' for a string that incorporates your preferred date variable.
Note: DateTime is an object, not a string. To get the current date as a string, you first need to call DateToStr(Now) and then use the result of that.

You need to perform string concatenation as well, see the second part of the above code Q['filename'] + Chr(10) for an example of that. (In the example I combined the filename property of the Q object with the result of the Chr(10) function by simply adding them together.

You can do the same with static strings. i.e.: 'playlist'+DateToStr(Now)+'.m3u'

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group