Page 1 of 2

ListRequest error

Posted: Sat Sep 09, 2023 5:55 pm
by MH2
My project are a media player. I have this line:
ROD_Playbox_Player = ListRequest(({Width=350, Height=610}), "6. Rakt Over Disc-1978-2022-Playbox-Player", "Select show", {"None",
"1978-05-19.mp3",
"1978-05-26.mp3",
"1978-06-02.mp3", ...

The problem are that I want, is too set the size of the ListRequest too Width=350, Height=610.

I has try different combination, and the. program will compile, but shows error then error.

Re: ListRequest error

Posted: Sat Sep 09, 2023 6:28 pm
by plouf
your parameter are complete reversd in order, first is title then-> body then-> choices then-> parameter table

Code: Select all

ROD_Playbox_Player = ListRequest("Select show", 
			"6. Rakt Over Disc-1978-2022-Playbox-Player", 
			{"None",
			"1978-05-19.mp3",
			"1978-05-26.mp3",
			"1978-06-02.mp3"
			},
			{Width=350, Height=610}
			)


Re: ListRequest error

Posted: Sat Sep 09, 2023 6:38 pm
by MH2
/**************************************************************************/
/*** Version of Hollywood-MAL is at least version 10.0! ***/
/**************************************************************************/

@VERSION 10,0

/****************************************/
/*** Information about this app ***/
/****************************************/

@APPTITLE "ROD-Playbox-Player"
@APPVERSION "$VER: ROD-Playbox-Player V1.0.0 (2023.09.09)"
@APPCOPYRIGHT "(C) Copyright 1971-2071 by Magnus Hammarstrom"
@APPAUTHOR "Magnus Hammarstrom"
@APPDESCRIPTION "ROD-Playbox-Player - OSsys:MacOS HDD: ./Golden/ROD_GOLD/Media"

/***************************************/
/*** Display size and background PIX ***/
/***************************************/
@DISPLAY {X=52, Y=52, Borderless = True, DragRegion = {{X=0, Y=0, Width=616, Height=616}}}
@BGPIC 1, "./HD-BGP/5_playbox_round_616x616.png", {LoadAlpha = True}

/**************************/
/*** Keyboard Function ***/
/**************************/
Function
p_EventFunc(msg)
Switch(msg.action)
Case "OnKeyDown":

/***************/
/* Enter key 1 */
/***************/
/* Enter new key */
If msg.key= "1"
p_Show_ROD_Playbox_Player()
EndIf

/*****************/
/* Enter key ESC */
/* Exit program */
/*****************/
If msg.key="ESC"
End()
EndIf
EndSwitch
EndFunction
/********************************/
/*** End of keyboard function ***/
/********************************/

/****************/
/** 2023-09-09 **/
/**********************************************************************/
/* https://www.hollywood-mal.com/docs/html ... quest.html */
/**********************************************************************/
Function
p_Show_ROD_Playbox_Player()
ROD_Playbox_Player = ListRequest(({Width=600, Height=800}), "6. Rakt Over Disc-1978-2022-Playbox-Player", "Select show", {"None",
"1978-05-19.mp3",
"1978-05-19.mp3",
"1978-05-19.mp3",
"1978-05-19.mp3",
"1978_Clabbe_Tandberg_Station_Cazzette.mp3",
"1978-05-19.mp3",
"1978-05-19.mp3",
"1978-05-19.mp3",
"1978-05-19.mp3",
"1978_Clabbe_Tandberg_Station_Cazzette.mp3",
"1978-05-19.mp3",
"1978-05-19.mp3",
"1978-05-19.mp3",
"1978-05-19.mp3",
"1978-05-19.mp3",
"1978_Clabbe_Tandberg_Station_Cazzette.mp3"})
/**************************/
/*** ***/
/**************************/
If ROD_Playbox_Player = -1
Print("Rakt Over Disc - 1978-2022 - Playbox - Player")
ElseIf ROD_Playbox_Player =1 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978-05-19.mp3")
ElseIf ROD_Playbox_Player =2 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978-05-19.mp3")
ElseIf ROD_Playbox_Player =3 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978-05-19.mp3")
ElseIf ROD_Playbox_Player =4 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978-05-19.mp3")
ElseIf ROD_Playbox_Player =5 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978-05-19.mp3")
ElseIf ROD_Playbox_Player =6 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978_Clabbe_Tandberg_Station_Cazzette.mp3")
/**************************/
/*** ***/
/**************************/
Else
Print(" ")
EndIf
EndFunction

/**************************/
/*** EventHandler ***/
/**************************/

InstallEventHandler({OnKeyDown = p_EventFunc})


/**************************/
/*** EventHandler ***/
/**************************/

EscapeQuit(True)

/****************/
/* */
/****************/

Repeat
WaitEvent
Forever

/****************/
/* End program */
/****************/

/**********************/
/* The End 2023-09-09 */
/**********************/

Re: ListRequest error

Posted: Sat Sep 09, 2023 6:53 pm
by plouf
very helpfull you posted code
please always use code embed aka [code] and [/code], so code will be easily readable

also change ListRequest as i posted to you the fixed in post 2 and will compile..

Re: ListRequest error

Posted: Sat Sep 09, 2023 7:02 pm
by MH2
and if I want set the position?

Code: Select all

ROD_Playbox_Player = ListRequest("Select show", 
			"6. Rakt Over Disc-1978-2022-Playbox-Player", 
			{"None",
			"1978-05-19.mp3",
			"1978-05-26.mp3",
			"1978-06-02.mp3"
			},
			{X=52, Y=52}, {Width=350, Height=610}
			)
It will show error "Too many arguments for this function!"

Re: ListRequest error

Posted: Sat Sep 09, 2023 7:18 pm
by MH2
The code are bigger, I have only mad it smaler.

Code: Select all

/****************************************************************/
/***    Version of Hollywood-MAL is at least version 10.0!    ***/  
/****************************************************************/

@VERSION 10,0

/**********************************/
/*** Information about this app ***/
/**********************************/

@APPTITLE "ROD-Playbox-Player"
@APPVERSION "$VER: ROD-Playbox-Player V1.0.0 (2023.09.09)"
@APPCOPYRIGHT "(C) Copyright 1971-2071 by Magnus Hammarstrom"
@APPAUTHOR "Magnus Hammarstrom"
@APPDESCRIPTION "ROD-Playbox-Player - OSsys:MacOS HDD: ./Golden/ROD_GOLD/Media"

/***************************************/
/*** Display size and background PIX ***/
/***************************************/
@DISPLAY {X=52, Y=52, Borderless = True, DragRegion = {{X=0, Y=0, Width=616, Height=616}}}
@BGPIC 1, "./HD-BGP/5_playbox_round_616x616.png", {LoadAlpha = True}

/**************************/
/*** Keyboard Function  ***/
/**************************/
Function
    p_EventFunc(msg)
Switch(msg.action)
 Case "OnKeyDown":
	
/***************/
/* Enter key 1 */
/***************/
	/* Enter new key */
	If msg.key= "1"
	    p_Show_ROD_Playbox_Player()
	EndIf	
	
/*****************/
/* Enter key ESC */
/* Exit program  */
/*****************/
If msg.key="ESC"
 End()
  EndIf
   EndSwitch
EndFunction
/********************************/
/*** End of keyboard function ***/
/********************************/

/****************/
/** 2023-09-09 **/
/**********************************************************************/
/* https://www.hollywood-mal.com/docs/html/hollywood/ListRequest.html */
/**********************************************************************/
Function 
		p_Show_ROD_Playbox_Player()
ROD_Playbox_Player = ListRequest("6. Rakt Over Disc-1978-2022-Playbox-Player", "Select show", {"None",
 "1978-05-19.mp3",
 "1978-05-19.mp3",
 "1978-05-19.mp3",
 "1978-05-19.mp3",
 "1978_Clabbe_Tandberg_Station_Cazzette.mp3",
 "1978-05-19.mp3",
 "1978-05-19.mp3",
 "1978-05-19.mp3",
 "1978-05-19.mp3",
 "1978_Clabbe_Tandberg_Station_Cazzette.mp3",
 "1978-05-19.mp3",
 "1978-05-19.mp3",
 "1978-05-19.mp3",
 "1978-05-19.mp3",
 "1978-05-19.mp3",
 "1978_Clabbe_Tandberg_Station_Cazzette.mp3"}, {Width=1350, Height=1610})
/**************************/
/***                    ***/
/**************************/
If ROD_Playbox_Player = -1
 Print("Rakt Over Disc - 1978-2022 - Playbox - Player")
ElseIf ROD_Playbox_Player =1 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978-05-19.mp3")
ElseIf ROD_Playbox_Player =2 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978-05-19.mp3")
ElseIf ROD_Playbox_Player =3 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978-05-19.mp3")
ElseIf ROD_Playbox_Player =4 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978-05-19.mp3")
ElseIf ROD_Playbox_Player =5 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978-05-19.mp3")
ElseIf ROD_Playbox_Player =6 Execute("./Database/X64PLayer/macos/mpv ./Database/Golden/ROD_GOLD/Media/1978_Clabbe_Tandberg_Station_Cazzette.mp3")
/**************************/
/***                    ***/
/**************************/
Else
 Print("	")
EndIf
  EndFunction

/**************************/
/***    EventHandler    ***/
/**************************/

InstallEventHandler({OnKeyDown =  p_EventFunc})


/**************************/
/***    EventHandler    ***/
/**************************/

EscapeQuit(True)

/****************/
/*              */
/****************/

Repeat
	WaitEvent
Forever

/****************/
/* End program  */
/****************/

/**********************/
/* The End 2023-09-09 */
/**********************/

Re: ListRequest error

Posted: Sat Sep 09, 2023 7:47 pm
by plouf
yes the manual says it is 1 parameter (table) not two tables
so the correct way is to make it 1 table

Code: Select all

{X=52, Y=52,Width=350, Height=610}

Re: ListRequest error

Posted: Mon Sep 11, 2023 8:32 am
by MH2
The X and Y posistion do not work on MacOS. But on Windows are ok. I havent try on Linux 8-) .

Re: ListRequest error

Posted: Mon Sep 11, 2023 9:10 pm
by Juan Carlos
A little suggestion you don't forget include the plugins to play sound music formats, because sometime you have errors because the sound file isn't support without the plugin.

Re: ListRequest error

Posted: Tue Sep 12, 2023 2:14 pm
by MH2
Yes I know that. But my program are using mpv player, so there are no need of plugins (just now). My plan are too use the internal player in the future.