Page 2 of 2

Re: Select Aspect ratio in menu

Posted: Tue Jul 19, 2022 11:51 am
by Markus1970
No worries so it's best to stick with the udf script I have above (the modified one for 4:3 and 16:9 ) and use that in a popup menu or assign to a button etc.

Re: Select Aspect ratio in menu

Posted: Sat Jul 23, 2022 1:05 pm
by Markus1970
Finally found some time to look into the UDF, the scripts above can you not just put that in a Java script and refer to it from there.
I looked at the user guide and it says go to properties/ function and create a udf from there, but looks like I can't just copy and paste , as I'm not a Java guy I'm abit lost.

Re: Select Aspect ratio in menu

Posted: Sat Jul 23, 2022 3:28 pm
by Markus1970
So I have two movie
4x3
16x9
and i created two playlists (the 1 symbol was auto generated)
4x3 1
16x9 1

I than copied and pasted the script below as a UDF in properties/function.

I am only getting the Audio not the subtitles as with the Black/white UDF in the guide https://blu-disc.net/download/user_guid ... rd_mx.pdf page 289

Code: Select all

public void UDF_SwitchAspect() {

int PlaylistID;

int AudioID;
long Playtime;

PlaylistID = getPlaylistID();

AudioID = getCurrentAudioID();

if (PlaylistID ='4x3 1')
 {PlaylistID = '16x9 1';}
else {PlaylistID = '4x3 1';}

Playtime = getMediaTime();

playVideoFrom(PlaylistID, Playtime);

selectAudioStream(PlaylistID, AudioID,
true);

}

I than in a popmenu used a button to asign the udf i created from the context menu.

Upon generating a preview i get this one error.
15:51:49 - [ERROR]
15:51:49 - [state] Compiling: step 3...
MediaManagement.java:185: incompatible types
found : int
required: boolean
if (PlaylistID =4)
^
1 error
Kind of stuck at this point

Re: Select Aspect ratio in menu

Posted: Sat Jul 23, 2022 4:28 pm
by Markus1970
Right im getting there ,fixed the code and I don't get any errors.

Code: Select all

public void UDF_SwitchAspect() {

int PlaylistID;
int AudioID;

long Playtime;

PlaylistID = getPlaylistID();
AudioID = getCurrentAudioID();

if (PlaylistID == '4x3 1')
        {PlaylistID = '16x9 1';}
else {PlaylistID = '4x3 1';}

Playtime = getMediaTime();

playVideoFrom(PlaylistID, Playtime);

selectAudioStream(PlaylistID, AudioID,
true);

}
This generates no errors but it does not function in the simulation.

ie it does not switch from the 4x3 to the 16x9 movie playlist.

I have a item in the popup menu which upon pressing enter runs the UDF , manager.UDF_SwitchAspect();

Re: Select Aspect ratio in menu

Posted: Sat Jul 23, 2022 8:07 pm
by Alexey Kolesnikov
The only issue I see here - switching audio after play video may not work, because it switches it back on video start and this operation is asynchronous.

So, for me this works:

Code: Select all

public void UDF_SwitchAspect() {
  int PlaylistID = getPlaylistID();
  int AudioID = getCurrentAudioID();
  long Playtime = getMediaTime();

  if (PlaylistID == '4x3 1') {
    PlaylistID = '16x9 1';
  } else {
    PlaylistID = '4x3 1';
  }

  selectAudioStream(PlaylistID, AudioID, false);
  playVideoFrom(PlaylistID, Playtime);
}
I assigned a script

Code: Select all

manager.UDF_SwitchAspect();
to the Red button for both playlists and everything works fine on PowerDVD

Re: Select Aspect ratio in menu

Posted: Sun Jul 24, 2022 8:05 am
by Markus1970
That's great I'll give it a shot later .

So you need to test in powerdvd this operation not in the simulation.

Re: Select Aspect ratio in menu

Posted: Sun Jul 24, 2022 8:33 am
by Alexey Kolesnikov
Simulation is intended for menu simulation only. It may not work with some code related to video playing.