Question about scripting restrictions

You have a question or need an advice about how to do something? Ask it here!
Post Reply
Thijmen
Posts: 111
Joined: 16 Jul 2019 20:19
Question about scripting restrictions

Post by Thijmen »

Hi there,

I wonder how the scripting restrictions is being saved on a track.
I have several hundreds of tracks I want to change for NOT picked when month.
So, I figured I created a small script for it, since mass-tagging for these restrictions is not possible yet.

There is the TXXX:PFRestrictions which looks like this:

Code: Select all

"00:00:00|00:00:00|0|1023|00010101|00010101|True|$0"
I assume some bitshifting is being done to generate the 1023, (which is every month but november and december).
Am I right here? Can you elaborate a bit on these values?
User avatar
radio42
Site Admin
Posts: 8975
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Question about scripting restrictions

Post by radio42 »

The PFRestriction has a minimum of 8 values or more - according the editor values separated by '|':
1. TimeStart (hh:mm:ss)
2. TimeEnd (hh:mm:ss)
3. Days (combined flags, see below, OR)
4. Months (combined flags, see below, OR)
5. DateStart (yyyyMMdd)
6. DateEnd (yyyyMMdd)
7. DateRepeated (if True, the year in the previous date range is ignored)
8. optional list of RuleSets (also separated by '|')
8./N. '$'+NoRepeatDays (do not repeat in #days; prefixed by a $ char)

Days:
Sunday = 1,
Monday = 2,
Tuesday = 4,
Wednesday = 8,
Thursday = 16,
Friday = 32,
Saturday = 64

Months:
January = 1,
February = 2,
March = 4,
April = 8,
May = 16,
June = 32,
July = 64,
August = 128,
September = 256,
October = 512,
November = 1024,
December = 2048

In your example 1024 = November, where as November OR January would be 1025; November OR December would be 3072.

The RuleSetList is optional, e.g. the PFRestriction value might look like this:

Code: Select all

// No RuleSetLIst given (not played in Nov. or Dec.; not repeated within 2 days):
00:00:00|00:00:00|0|3072|00010101|00010101|True|$2
// 2 RuleSets given (only played between 13.11. and 26.12.):
00:00:00|00:00:00|0|0|20241227|20241113|True|MyRuleSet1|MyRuleSet2|$0
Thijmen
Posts: 111
Joined: 16 Jul 2019 20:19
Re: Question about scripting restrictions

Post by Thijmen »

Thanks Bernd! I think I can solve my challenge with ruleset. In the example below I've applied a ruleset:

Code: Select all

"00:00:00|00:00:00|0|0|00010101|00010101|True|MYRULESET|ANOTHERRULESET|$0"
I assume the rulesets are until |$0?
Thijmen
Posts: 111
Joined: 16 Jul 2019 20:19
Re: Question about scripting restrictions

Post by Thijmen »

And am I right this is saved under IPFR in WAV?
User avatar
radio42
Site Admin
Posts: 8975
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Question about scripting restrictions

Post by radio42 »

The $0 is coming from the last NoRepeatDays value.
If you want to tag your MP3s do it according to the ID3v2 specs, which I cannot explain here - there are many official pages.
Yes, the entire ‚ProppFrexx’ meta data xml string is saved in the Riff Info block ‚IPFD‘ of a wav file. Whereas the ‚PFRestrictions‘ are saved in ‚IPFR‘ block of the Riff Info chunk.
Thijmen
Posts: 111
Joined: 16 Jul 2019 20:19
Re: Question about scripting restrictions

Post by Thijmen »

Would it be possible to add support for the restrictions and such to EXEC_TAG_FILE in the future?
User avatar
radio42
Site Admin
Posts: 8975
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Question about scripting restrictions

Post by radio42 »

I will think about it - but you would have to format the content yourself and it would be on your own risk!
Thijmen
Posts: 111
Joined: 16 Jul 2019 20:19
Re: Question about scripting restrictions

Post by Thijmen »

Yes, that's fine :) I wonder how this would work, since the | is already a separator for EXEC_TAG_FILE. Perhaps;

Code: Select all

EXEC_TAG_FILE_RESTRICTIONS file.mp3|00:00:00|00:00:00|0|1023|00010101|00010101|True|RULESETA|RULESETB
Perhaps that works?
User avatar
radio42
Site Admin
Posts: 8975
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Question about scripting restrictions

Post by radio42 »

I will let you know, once I thought about it...
Thijmen
Posts: 111
Joined: 16 Jul 2019 20:19
Re: Question about scripting restrictions

Post by Thijmen »

Cool - this would solve a lot of work for me :-) Since I find it dangerous to alter the tracks myself (especially with different file formats, like flac, wav, mp3 etc), I would like Proppfrexx to handle this as it's source of truth.

Post Reply