Bookmark indicator does not appear
Posted: Thu Jul 13, 2023 4:08 am
Hello, I'm trying to increase the amount of bookmarks in my project, taking the example of the Timeline BookmarksBR UDF menu, I set it to 9 bookmark, the configuration is correct, it saves correctly, but the green mark icon does not appear, it only appears up to bookmark 4 ,from 5 onwards no, how to fix?
Config
public void UDF_UpdateTimeline() {
// On open = identical to ActionEverySecond
// THE FOLLOWING SECTION SHOULD BE MODIFIED WHEN THE TIMELINE POPUP MENU CHANGES IN LAYOUT
// In addition the if then else section must be modified if the UDV variables change their names.
// ++++ START USER MODIFIABLE SECTION ++++
// specify start of Timeline progress bar BarX and its length BarLength in pixels from left margin
int BarX = 335;
int BarLength = 1244;
// position settings vertically from top of screen for bookmark indicators and marker
int MarkerY = 889;
int IndicatorY = 908;
int MarkerWidth = 12; // point inverted triangle is in the middle
// +++ END USER MODIFIABLE SECTION ++++
int playlistID;
int nrBookmarks=0;
long RunningTime =0;
long time;
boolean OK;
// determine running time of current movie
OK = true;
playlistID = getPlaylistID();
// determine total running time of the movie - these are given values as User Defined Variables
// you cannot use the Java switch statement because that expects constants and UDV_xx are variables
// The playlistIDs are also UDV_yy variables, values are assigned in the First Play multiaction.
if (playlistID == UDV_playIDFILME)
{ RunningTime = UDV_timeFILME;}
// perform the rest only if movie is recognized
if (OK) {
// get current playing time movie in nano-seconds and display that time as hh:mm:ss
time = getMediaTime();
setText("F:PM_Timeline_popup.Timer", time2str(time));
// Set time progress bar through clipping area. Bar starts at BarX and has width BarLength pixels
time = getMediaTimeInSeconds();
time = time * BarLength / RunningTime + BarX;
setClipping("F:PM_Timeline_popup.Timeline", 0, 0, (int)time, 1079);
// Determine number of bookmarks present for that movie
nrBookmarks = getBookmarksCount(playlistID);
// Initially set all indicators off the timeline as if there are no bookmarks
// Note that this only works if the (dropdown menu)> Change Effects for the marker and bookmarks have
// "Move container" checked!
moveToXY("F:PM_Timeline_popup.Bookmark_1", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_2", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_3", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_4", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_5", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_6", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_7", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_8", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_9", 332, IndicatorY);
// no bookmarks - marker is at height MarkerY the bookmark indicators at IndicatorY
if (nrBookmarks < 1) {
setText("F:PM_Timeline_popup.Bookmark_Time", "VAZIO");
moveToXY("F:PM_Timeline_popup.Marker", 332, MarkerY);
}
// set the marker to the current bookmark
if (nrBookmarks > 0) {
setText("F:PM_Timeline_popup.Bookmark_Time", currentBookmarkText(playlistID));
time = currentBookmarkTime(playlistID);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Marker", (int)(time - MarkerWidth/2), MarkerY);
}
// position first bookmark
if (nrBookmarks >= 1) {
time = getBookmarkTime(playlistID, 1);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_1", (int)time, IndicatorY);
}
// position 2nd bookmark
if (nrBookmarks >= 2) {
time = getBookmarkTime(playlistID, 2);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_2", (int)time, IndicatorY);
}
// position 3rd bookmark
if (nrBookmarks >= 3) {
time = getBookmarkTime(playlistID, 3);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_3", (int)time, IndicatorY);
}
// position 4th bookmark
if (nrBookmarks == 4) {
time = getBookmarkTime(playlistID, 4);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_4", (int)time, IndicatorY);
}
// position 5th bookmark
if (nrBookmarks == 5) {
time = getBookmarkTime(playlistID, 5);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_5", (int)time, IndicatorY);
}
// position 6th bookmark
if (nrBookmarks == 6) {
time = getBookmarkTime(playlistID, 6);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_6", (int)time, IndicatorY);
}
// position 7th bookmark
if (nrBookmarks == 7) {
time = getBookmarkTime(playlistID, 7);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_7", (int)time, IndicatorY);
}
// position 8th bookmark
if (nrBookmarks == 8) {
time = getBookmarkTime(playlistID, 8);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_8", (int)time, IndicatorY);
}
// position 9th bookmark
if (nrBookmarks == 9) {
time = getBookmarkTime(playlistID, 9);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_9", (int)time, IndicatorY);
}
activateButtonEx("H:PM_Timeline_popup.Handler", "TimelineButton", false);
}
}
Config
public void UDF_UpdateTimeline() {
// On open = identical to ActionEverySecond
// THE FOLLOWING SECTION SHOULD BE MODIFIED WHEN THE TIMELINE POPUP MENU CHANGES IN LAYOUT
// In addition the if then else section must be modified if the UDV variables change their names.
// ++++ START USER MODIFIABLE SECTION ++++
// specify start of Timeline progress bar BarX and its length BarLength in pixels from left margin
int BarX = 335;
int BarLength = 1244;
// position settings vertically from top of screen for bookmark indicators and marker
int MarkerY = 889;
int IndicatorY = 908;
int MarkerWidth = 12; // point inverted triangle is in the middle
// +++ END USER MODIFIABLE SECTION ++++
int playlistID;
int nrBookmarks=0;
long RunningTime =0;
long time;
boolean OK;
// determine running time of current movie
OK = true;
playlistID = getPlaylistID();
// determine total running time of the movie - these are given values as User Defined Variables
// you cannot use the Java switch statement because that expects constants and UDV_xx are variables
// The playlistIDs are also UDV_yy variables, values are assigned in the First Play multiaction.
if (playlistID == UDV_playIDFILME)
{ RunningTime = UDV_timeFILME;}
// perform the rest only if movie is recognized
if (OK) {
// get current playing time movie in nano-seconds and display that time as hh:mm:ss
time = getMediaTime();
setText("F:PM_Timeline_popup.Timer", time2str(time));
// Set time progress bar through clipping area. Bar starts at BarX and has width BarLength pixels
time = getMediaTimeInSeconds();
time = time * BarLength / RunningTime + BarX;
setClipping("F:PM_Timeline_popup.Timeline", 0, 0, (int)time, 1079);
// Determine number of bookmarks present for that movie
nrBookmarks = getBookmarksCount(playlistID);
// Initially set all indicators off the timeline as if there are no bookmarks
// Note that this only works if the (dropdown menu)> Change Effects for the marker and bookmarks have
// "Move container" checked!
moveToXY("F:PM_Timeline_popup.Bookmark_1", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_2", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_3", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_4", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_5", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_6", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_7", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_8", 332, IndicatorY);
moveToXY("F:PM_Timeline_popup.Bookmark_9", 332, IndicatorY);
// no bookmarks - marker is at height MarkerY the bookmark indicators at IndicatorY
if (nrBookmarks < 1) {
setText("F:PM_Timeline_popup.Bookmark_Time", "VAZIO");
moveToXY("F:PM_Timeline_popup.Marker", 332, MarkerY);
}
// set the marker to the current bookmark
if (nrBookmarks > 0) {
setText("F:PM_Timeline_popup.Bookmark_Time", currentBookmarkText(playlistID));
time = currentBookmarkTime(playlistID);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Marker", (int)(time - MarkerWidth/2), MarkerY);
}
// position first bookmark
if (nrBookmarks >= 1) {
time = getBookmarkTime(playlistID, 1);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_1", (int)time, IndicatorY);
}
// position 2nd bookmark
if (nrBookmarks >= 2) {
time = getBookmarkTime(playlistID, 2);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_2", (int)time, IndicatorY);
}
// position 3rd bookmark
if (nrBookmarks >= 3) {
time = getBookmarkTime(playlistID, 3);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_3", (int)time, IndicatorY);
}
// position 4th bookmark
if (nrBookmarks == 4) {
time = getBookmarkTime(playlistID, 4);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_4", (int)time, IndicatorY);
}
// position 5th bookmark
if (nrBookmarks == 5) {
time = getBookmarkTime(playlistID, 5);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_5", (int)time, IndicatorY);
}
// position 6th bookmark
if (nrBookmarks == 6) {
time = getBookmarkTime(playlistID, 6);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_6", (int)time, IndicatorY);
}
// position 7th bookmark
if (nrBookmarks == 7) {
time = getBookmarkTime(playlistID, 7);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_7", (int)time, IndicatorY);
}
// position 8th bookmark
if (nrBookmarks == 8) {
time = getBookmarkTime(playlistID, 8);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_8", (int)time, IndicatorY);
}
// position 9th bookmark
if (nrBookmarks == 9) {
time = getBookmarkTime(playlistID, 9);
time = time / 1000000000L * BarLength / RunningTime + BarX;
moveToXY("F:PM_Timeline_popup.Bookmark_9", (int)time, IndicatorY);
}
activateButtonEx("H:PM_Timeline_popup.Handler", "TimelineButton", false);
}
}