Java code Current subtitles and audio

Blu-ray and UHD Authoring
Post Reply
rickemail
Posts: 28
Joined: Fri Jun 25, 2021 9:33 pm

Java code Current subtitles and audio

Post by rickemail »

hello, could you provide me with the java code to put the current subtitle and current audio in the popup menu as soon as I activate the popup,I wanted to use the code in the UDFs function

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

Re: Java code Current subtitles and audio

Post by Alexey Kolesnikov »

Hello.

What do you mean in "to put in the popup menu"? Highlight the current audio/subtitle somehow? Select the appropriate button?
This depends on your menu - code will contain buttons and menus names (check the help "Advanced" -> "Script (java)" -> "Name conversion" for details).

Anyway, the easiest way to get something in java code is to create an appropriate action (assign it to any button) and then select "Script (java)" from the actions menu: this command will be converted in to the java code.
Best regards,
Alexey Kolesnikov

rickemail
Posts: 28
Joined: Fri Jun 25, 2021 9:33 pm

Re: Java code Current subtitles and audio

Post by rickemail »

an example of the paramount menu, when you press Pause, it appears and shows the current audio and the current subtitle, in image 02 when I activate another subtitle, it appears in this menu, you can put this function in the bookmark menu in the UDF function to display the audio and subtitles active?
Attachments
02.jpg
02.jpg (232.74 KiB) Viewed 13393 times
01.jpg
01.jpg (211.03 KiB) Viewed 13393 times

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

Re: Java code Current subtitles and audio

Post by Alexey Kolesnikov »

There are no such "functions". You need to create a menu with images (or texts) for all languages and move them inside/outside the screen depending on what should be visible.
For example, create a menu that contains images that say "English", "German" for audio and "On", "Off" for subtitles and use action "Settings and Properties" -> "Set object property" -> "Move to" before opening this menu to move some of them outside the screen, some inside.
Then you can convert this into the Java using the "Script (java)" action and put into the UDF.
This will be something like (depending on names, menu structure, etc...):

Code: Select all

if (manager.getCurrentAudioID() == 1) {
  manager.moveToXY("F:PM_Bookmark.SoundEnglish.Normal", 50, 1000);
  manager.moveToXY("F:PM_Bookmark.SoundGerman.Normal", 50, -1000);
  ...
}
...
Best regards,
Alexey Kolesnikov

rickemail
Posts: 28
Joined: Fri Jun 25, 2021 9:33 pm

Re: Java code Current subtitles and audio

Post by rickemail »

Thanks, worked, could you provide me the java code on how to use the "manager.getPlaybackRate" function for FF/RWD/Pause/Next/Prev in "Action every second"

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

Re: Java code Current subtitles and audio

Post by Alexey Kolesnikov »

1 means played
0 means pause
positive means forward (so for forward it just returns the current speed that may be any number like 2, 10, ...)
negative means rewind (the same as above, but negative: -2, -10, ...)
Best regards,
Alexey Kolesnikov

Post Reply