How can I tell if Subtitles are switched on

Blu-ray and UHD Authoring
Post Reply
trevorjharris
Posts: 5
Joined: Wed Apr 21, 2021 10:41 am

How can I tell if Subtitles are switched on

Post by trevorjharris »

Is there a way to tell if subtitles are switched on by reading a GPR?
Regards Trevor Harris

Alexey Kolesnikov
Posts: 401
Joined: Fri Mar 01, 2013 1:03 pm
Contact:

Re: How can I tell if Subtitles are switched on

Post by Alexey Kolesnikov »

Hi Trevor,
Not GPR - PSR 17. Check help: Advanced -> PSR registers.
Best regards,
Alexey Kolesnikov

trevorjharris
Posts: 5
Joined: Wed Apr 21, 2021 10:41 am

Re: How can I tell if Subtitles are switched on

Post by trevorjharris »

I cannot see how I can check the psr value in the switch command. I assume that the three byte are zero if subtitles are turned off.

Alexey Kolesnikov
Posts: 401
Joined: Fri Mar 01, 2013 1:03 pm
Contact:

Re: How can I tell if Subtitles are switched on

Post by Alexey Kolesnikov »

Sorry, I was wrong about PSR[17]. The current subtitles is in the PSR[2].
The code that checks if subtitles is on: (getPSR(2) & 0x80000000) != 0. This means that the leftmost bit is responsible for this.
Thus, to check that subtitles are on in a SWITCH you can use the Custom condition: PSR(2) < 2147483648L & PSR(2) > 0
Best regards,
Alexey Kolesnikov

trevorjharris
Posts: 5
Joined: Wed Apr 21, 2021 10:41 am

Re: How can I tell if Subtitles are switched on

Post by trevorjharris »

Hi
I tested PSR(2) and found it was set to 0x8fff0001 if subtitles are on and 0x0fff0001 if off. I could not get your test PSR(2) < 2147483648L & PSR(2) > 0 to work. I think it is because int is signed and so I found PSR(2) < 0 works.

I want to turn subtitles on from a popup. I tried manager.selectSubtitleState(true); but this did not work.

I also tried adding a second subtitle track but PowerDVD and my Blu-ray player did not detect the second subtitle.

Regards Trevor

Alexey Kolesnikov
Posts: 401
Joined: Fri Mar 01, 2013 1:03 pm
Contact:

Re: How can I tell if Subtitles are switched on

Post by Alexey Kolesnikov »

Hi

Frankly, I never worked with PSR[2] :) Always worked via Java functions.

Just checked with debug log.

Subtitles are off by default - switching on:

Code: Select all

PSR[2] before on:   0x0FFF0001
selectSubtitleState(true)
PSR[2] after on:   -0x7000FFFF
Now subtitles are on (subtitles stream 1 is on) - switching off:

Code: Select all

PSR[2] before off: -0x7000FFFF
selectSubtitleState(false)
PSR[2] after off:   0x0FFF0001
Now switching on (the same as in the p.1)
and than switching to track 2:

Code: Select all

PSR[2] before #2:  -0x7000FFFF
selectSubtitleStream('Movie', 2, true, true)
PSR[2] after #2:   -0x7000FFFE
PS: I suppose that "track 2 off" will be 0x0FFF0002
Best regards,
Alexey Kolesnikov

Post Reply