Is there a way to tell if subtitles are switched on by reading a GPR?
Regards Trevor Harris
How can I tell if Subtitles are switched on
-
- Posts: 5
- Joined: Wed Apr 21, 2021 10:41 am
-
- Posts: 472
- Joined: Fri Mar 01, 2013 1:03 pm
- Contact:
Re: How can I tell if Subtitles are switched on
Hi Trevor,
Not GPR - PSR 17. Check help: Advanced -> PSR registers.
Not GPR - PSR 17. Check help: Advanced -> PSR registers.
Best regards,
Alexey Kolesnikov
Alexey Kolesnikov
-
- Posts: 5
- Joined: Wed Apr 21, 2021 10:41 am
Re: How can I tell if Subtitles are switched on
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.
-
- Posts: 472
- Joined: Fri Mar 01, 2013 1:03 pm
- Contact:
Re: How can I tell if Subtitles are switched on
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
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
Alexey Kolesnikov
-
- Posts: 5
- Joined: Wed Apr 21, 2021 10:41 am
Re: How can I tell if Subtitles are switched on
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
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
-
- Posts: 472
- Joined: Fri Mar 01, 2013 1:03 pm
- Contact:
Re: How can I tell if Subtitles are switched on
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:
Now subtitles are on (subtitles stream 1 is on) - switching off:
Now switching on (the same as in the p.1)
and than switching to track 2:
PS: I suppose that "track 2 off" will be 0x0FFF0002
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
Code: Select all
PSR[2] before off: -0x7000FFFF
selectSubtitleState(false)
PSR[2] after off: 0x0FFF0001
and than switching to track 2:
Code: Select all
PSR[2] before #2: -0x7000FFFF
selectSubtitleStream('Movie', 2, true, true)
PSR[2] after #2: -0x7000FFFE
Best regards,
Alexey Kolesnikov
Alexey Kolesnikov