Log in

View Full Version : Selected button does not show


srfscenar
12th February 2012, 13:59
Hi all!

And here I am again with this.
I have a project to which I have a top menu (not pop up) which has:
Play Movie
Chapters
Settings
Extras

Under Settings I have:
English Audio
German Audio
French Audio
English Subtitles
German Subtitles
French Subtitles
Subtitles OFF

What I haven't been able to do is this.
Every time I navigate to that page, and select the audio and the subtitles I want, the button changes to a tick sign so the user knows what he has selected.
All good till now which means that my dummy buttons for navigation works.
If I navigate OUT of that page, and go back in, that tick is gone UNTIL the user navigates over it.
What I mean, lets say that you select the French audio. If you navigate out of that page and then go back in, all the buttons are in inactive state but if I navigate with the down button to my French audio it automatically changes to the active button. Which is correct but it should have been activated it the moment I went to that page. I know there must be a dummy auto action button in that page that is automatically selected when you navigate to that page but what command needs to be inserted there?

What am I doing wrong?
I've been squeezing my brain but with no luck...
Any help (as detailed as possible) is more than welcome!

rik1138
13th February 2012, 21:01
Sounds like your navigation while on the page is going through dummy button(s). The button check if the stream is active or not, and moves the focus to the appropriate button.

But, when you enter the page you are not checking this state. You have to have a dummy button for entering the page that checks what audio/subtitle stream is active, and then sets those particular buttons with the check-mark graphic. Haven't done this in a while, but it might need to set the state of every button just to be safe... Set them all to the 'off' state, then set the one that's active to the 'on' state.

Hopefully that makes sense... :)

srfscenar
13th February 2012, 21:10
Thanks rik!
Yes, you are correct. I use dummy buttons for the navigation.
For this dummy button on the settings page for checking has to be selected by default right?
Do you have a command example of that particular button? That would help a lot.
I saw the sonic's template but to be honest I was quite lost.

rik1138
13th February 2012, 22:05
Thanks rik!
Yes, you are correct. I use dummy buttons for the navigation.
For this dummy button on the settings page for checking has to be selected by default right?
Do you have a command example of that particular button? That would help a lot.
I saw the sonic's template but to be honest I was quite lost.

Here's a screen shot of one way that I did it:
http://forum.doom9.org/attachment.php?attachmentid=12702&d=1329166547

Okay, it's in a .ZIP file since the attachment thing is reporting that every JPG, BMP and PNG I try to upload is not a valid image file... I might just being doing something wrong, but at least it accepted the .ZIP file. :rolleyes: It's just a .JPG of one of my command sequences. (Moderator help on that one? Some reason it's not recognizing images?)

Aud[ID:1] contains the currently active audio stream number. The first 6 commands will set the 'on' graphic according to that number, the next six will then place make the highlighted button the one that matches the current stream (which may not be required for your project, just the way this one was built).

The last command is just a fail-safe to prevent a crash in the even there's some other number in Aud... Always a good idea, the last command of any sequence should never be conditional, but absolute just in case, and it should do something that doesn't really look wrong (in this case, it highlights the option for going to subtitles, but it could also just go to the top audio option... No one would think twice about it.)

srfscenar
14th February 2012, 14:20
Aud[ID:1] contains the currently active audio stream number. The first 6 commands will set the 'on' graphic according to that number, the next six will then place make the highlighted button the one that matches the current stream (which may not be required for your project, just the way this one was built).

The last command is just a fail-safe to prevent a crash in the even there's some other number in Aud... Always a good idea, the last command of any sequence should never be conditional, but absolute just in case, and it should do something that doesn't really look wrong (in this case, it highlights the option for going to subtitles, but it could also just go to the top audio option... No one would think twice about it.)

rik thank you so much.
It worked perfectly!

Now I got another question, where do you put the PSR checking commands?
Assuming the user inserts the disc for the first time i have it load by default the 1st audio and no subtitles, so the default activated buttons in this case are the English audio button and the Subtitles OFF button.
Now, if the user goes into the movie and change the audio and subtitle, where do I check that so next time he goes back in the settings page, the appropriate buttons are highlighted?
Tell me if these are the correct commands:
for audio
Move (GPR)"Aud"[ID:1] (PSR)"Primary Audio"[ID:1]
and for PG check
Move (GPR)"Sub"[ID:2] (PSR)"PG TextST.....stream"[ID:2]
which commands loads the value of the current PSR to the appropriate GPR. Then when you enter the settings page it should check the updated GPR value and load the correct button.

Please tell me if those are the correct commands and where should I put them? In the dummy button on top of the others?

Thanks!

rik1138
14th February 2012, 21:36
Audio is easy (what you have posted is fine). Subtitles are more work...

There's two things you have to check for:
Are subtitles on?
If yes, what stream is active? (some clients might even want to know what stream is active even if it's off...)

So, you need two GPRs: (This is how I do it, at least)
SubsOn (0 = no, 1 = yes)
Subs (the stream #)
This info (and a lot of other info) is stored in PSR 2, so you can't just 'store' it... You have to take it apart...

Here's the commands:
Move (GPR)SubsOn[ID:5] 0 (Sets this to off at first, then I start doing checks.)
if ( (PSR)PG TextST stream and PiP PG TextST stream[ID:2] & 0x80000000 ) Move (GPR)SubsOn[ID:5] 1 (This checks of subs are on or not)
Move (GPR)Subs[ID:2] (PSR)PG TextST stream and PiP PG TextST stream[ID:2] (Store PSR 2 in your Subs GPR)
And (GPR)Subs[ID:2] 0x000000FF (Strip off the un-needed info from PSR 2, just leaving the sub stream #)

So you set SubsOn to Off
Then you do a check to see if subs are really on, if they are, store a 1
Then you store PSR 2 into your Subs GPR
Perform an 'And' operation with 0x000000FF to get just the subtitle stream information.

This needs to be checked anytime you leave the feature, or open the PopUp menu (and when you enter the audio/subs menu of the PopUp, just to be safe). So, do it in these locations (or some variation that hits all combinations):
1- As the 'pre-commands' of the Top Menu background video, but ONLY if coming from the feature (so you have store a GPR when playing the feature).
2- As part of the first commands when entering the PopUp menu (dummy 'entry' button on first Page of PopUp)
3- As part of the first commands when entering the Audio/subtitles pages of the PopUp menu (dummy 'entry' button for the first of these pages, if more than one). This is because you can surf audio/subtitles while the PopUp is open, just a little extra security so the highlights are more accurate. If they surf after this point, to bad... :cool:
4- As part of the commands to launch any bonus piece of video from the PopUp menu (especially if it's designed to return to the feature after playing). Again, since they can surf while the PopUp is open, best to do one more check here...

One important thing:
Your TopMenu background video needs to have the same number of audio and subtitle streams as your feature video, or you will loose this information when TopMenu'ing out of your feature.

If every piece of video on your disc has the exact same audio and subtitle streams/languages, none of this is really necessary other than doing the highlight thing on the menus. But most discs (studio discs at least) have less available streams on the bonus content, so all of this tracking is necessary...

If you need to reset the streams when going back into the feature, you need two commands:
Set Aud/Sub to the GPRs, with Subtitle display Off
If SubsOn = 1, Set subtitle display to On
This can be done as a 'Post command' on a bonus piece before executing a 'Resume'. Even if the bonus has different streams than the feature, it will still work.

It can be a pain to get it all right, and if you have thorough QC, they'll find a way to screw it up that you will have to fix... :rolleyes: But once you do it for the first time, it's just a lot of copy/pasting in future projects (or just re-using the project itself). I have a list of certain GPRs that store certain values, and those NEVER change. Every project gets the same GPRs, so if I have to copy/paste code from project to project, it will always work.

srfscenar
15th February 2012, 21:48
Thank you again rik!
I will check all those info and let you know!

srfscenar
19th February 2012, 16:41
rik hi again!

Everything worked perfectly! Thank you very much!
One last question that just came up...

If the user while he watches the feature, he decide to disable the subs, how do we make it so when he enters the settings page, the "SubtitlesOFF" button gets activated?

rik1138
20th February 2012, 07:57
rik hi again!

Everything worked perfectly! Thank you very much!
One last question that just came up...

If the user while he watches the feature, he decide to disable the subs, how do we make it so when he enters the settings page, the "SubtitlesOFF" button gets activated?

If you are using the code I provided above, check the GPR 'SubsOn' first. If that's set to zero, you activate your Subtitles Off button. (If SubsOn is set to 1, then subtitles are turned on, so follow the normal logic for activating the appropriate button.)

srfscenar
20th February 2012, 08:11
Thats what I thought too but for some reason it did not work.
I'll recheck the project...