else if msg.isRemoteKeyPressed()
onscreenphoto = msg.GetIndex()
curr_photo = photolist[onscreenphoto]
if msg.GetIndex() = 10
DisplayInfomenu(6, curr_photo)
end if
"RokuMarkn" wrote:
Take out both the assignment to onscreenphoto and curr_photo under isRemoteKeyPressed. Those are set under isPlaybackPosition and should not be changed in isRemoteKeyPressed.
--Mark
Type Mismatch. (runtime error &h18) in ...g:/source/mediarsstoolkit.brs(270)
270: Function DisplayInfomenu(infotype As Object, curr_photo As Object)
Function DisplayInfomenu(infotype As Integer, curr_photo As Object)
"RokuMarkn" wrote:
I think I introduced this bug because I thought that infotype was an AA. It looks like it's an integer? If so, change the function definition to
Function DisplayInfomenu(infotype As Integer, curr_photo As Object)
--Mark
Function DisplayInfomenu(infotype As Object, curr_photo As Object)
infomenu = createobject("romessagedialog")
infomenu.setmessageport(createobject("romessageport"))
infomenu.enableoverlay(true)
if (infotype = 6)
infomenu.setTitle(curr_photo.GetTitle())
infomenu.settext( " Assembled Photography Slideshow" + chr(10) + + chr(10) + "Right Arrow to skip forward, Left Arrow to skip backwards, Play/Pause to stop or resume. Up Arrow to return to Home Page." )
infomenu.addbutton(3,"Music")
infomenu.addbutton(4,"Done")
infomenu.setfocusedmenuitem(1) ' 2nd button
else
infomenu.setTitle("TEMP TITLE")
infomenu.settext("TEMP TEXT")
infomenu.addbutton(4,"done")
infomenu.setfocusedmenuitem(1) ' 2nd button
endif
infomenu.show()
while true
msg = wait(0,infomenu.getmessageport())
if msg.isscreenclosed() return 0
if msg.isButtonInfo() return 0 ' Info pressed again, dismiss the info overlay
if msg.isbuttonpressed()
button = msg.getindex()
print "Info Button ";button;" pressed"
if button = 4
return button
endif
if msg.isbuttonpressed()
button = msg.getindex()
print "Info Button ";button;" pressed"
if button = 3
AudioPlay()
return 0
end if
end if
endif
end while
end function
"RokuMarkn" wrote:
The function you quoted in your last post still has both defined as Object. Please try it the way I wrote it, with infotype as Integer and curr_photo as Object.
--Mark
Function DisplayInfomenu(infotype As Integer, curr_photo As Object)
infomenu = createobject("romessagedialog")
infomenu.setmessageport(createobject("romessageport"))
infomenu.enableoverlay(true)
if (infotype = 6)
infomenu.setTitle(curr_photo.GetTitle())
infomenu.settext( " Assembled Photography Slideshow" + chr(10) + + chr(10) + "Right Arrow to skip forward, Left Arrow to skip backwards, Play/Pause to stop or resume. Up Arrow to return to Home Page." )
infomenu.addbutton(3,"Music")
infomenu.addbutton(4,"Done")
infomenu.setfocusedmenuitem(1) ' 2nd button
else
infomenu.setTitle("TEMP TITLE")
infomenu.settext("TEMP TEXT")
infomenu.addbutton(4,"done")
infomenu.setfocusedmenuitem(1) ' 2nd button
endif
infomenu.show()
while true
msg = wait(0,infomenu.getmessageport())
if msg.isscreenclosed() return 0
if msg.isButtonInfo() return 0 ' Info pressed again, dismiss the info overlay
if msg.isbuttonpressed()
button = msg.getindex()
print "Info Button ";button;" pressed"
if button = 4
return button
endif
if msg.isbuttonpressed()
button = msg.getindex()
print "Info Button ";button;" pressed"
if button = 3
AudioPlay()
return 0
end if
end if
endif
end while
end function
Type Mismatch. (runtime error &h18) in ...g:/source/mediarsstoolkit.brs(268)
268: Function DisplayInfomenu(infotype As Integer, curr_photo As Object)
Backtrace:
Function displayinfomenu(infotype As Integer, curr_photo As <uninitialized>) As
file/line: /tmp/plugin/LDCAAAmLxswl...g:/source/mediarsstoolkit.brs(269)
Function displayslideshow(slideshow As , photolist As ) As
file/line: /tmp/plugin/LDCAAAmLxswl...g:/source/mediarsstoolkit.brs(228)
Function displayredzplace() As
file/line: /tmp/plugin/LDCAAAmLxswl...g:/source/mediarsstoolkit.brs(68)
Function uitkdopostermenu(posterdata As , screen As , onselect_callback As ) As Integer
file/line: /tmp/plugin/LDCAAAmLxswl/pkg:/source/uitoolkit.brs(96)
Function main() As
file/line: /tmp/plugin/LDCAAAmLxswl/pkg:/source/main.brs(60)
Local Variables:
infotype &h0002 Integer val:6
curr_photo &h0000 <uninitialized> val:Uninitialized
global &h0020 rotINTERFACE:ifGlobal
m &h0010 bsc:roAssociativeArray, refcnt=4
infomenu &h0000 <uninitialized> val:Uninitialized
msg &h0000 <uninitialized> val:Uninitialized
button &h0000 <uninitialized> val:Uninitialized
"RokuMarkn" wrote:
Can you post the calling function?
--Mark
Sub DisplaySlideShow(slideshow, photolist)
screenFacade = CreateObject("roPosterScreen")
screenFacade.show()
screenFacade.showMessage("Loading...")
print "in DisplaySlideShow"
'using SetContentList()
contentArray = CreateObject("roArray", photolist.Count(), true)
for each photo in photolist
print "---- new DisplaySlideShow photolist loop ----"
url = photo.GetURL()
if url<>invalid then
aa = CreateObject("roAssociativeArray")
aa.Url = url
contentArray.Push(aa)
print "PRELOAD TITLE: ";photo.GetTitle()
end if
next
slideshow.SetContentList(contentArray)
'this is an alternate technique for adding content using AddContent():
'aa = CreateObject("roAssociativeArray")
'for each photo in photolist
'print "---- new DisplaySlideShow photolist loop ----"
'url = photo.GetURL()
'if url<>invalid then
' aa.Url = url
' slideshow.AddContent(aa)
' print "PRELOAD TITLE: ";photo.GetTitle()
'end if
'next
btn_more_from_author = 0
btn_similar = 1
btn_bookmark = 2
btn_hide = 13
screenFacade.close()
waitformsg:
msg = wait(0, m.port)
print "DisplaySlideShow: class of msg: ";type(msg); " type:";msg.gettype()
'for each x in msg:print x;"=";msg[x]:next
if msg <> invalid then 'invalid is timed-out
if type(msg) = "roSlideShowEvent" then
if msg.isScreenClosed() then
return
else if msg.isButtonPressed() then
print "Menu button pressed: " + Stri(msg.GetIndex())
'example button usage during pause:
'if msg.GetIndex() = btn_hide slideshow.ClearButtons()
else if msg.isPlaybackPosition() then
onscreenphoto = msg.GetIndex()
curr_photo = photolist[onscreenphoto]
print "slideshow display: " + Stri(msg.GetIndex())
canvas = CreateObject( "roImageCanvas" )
fontReg = CreateObject("roFontRegistry")
fontReg.Register("pkg:/fonts/caps.otf")
font = fontReg.Get("caps",28,50,true)
bgRect = {
Color: "#00000000",
TargetRect: { x: 55, y: 10, w: 280, h: 50 }
}
text = {
Text: curr_photo.GetTitle(),
TextAttrs:{Color:"#960404", Font:font,
HAlign:"Left", VAlign:"VCenter", Direction:"LeftToRight"}
TargetRect: bgRect.TargetRect
}
canvas.SetLayer( 0, [ bgRect, text ] )
canvas.Show()
Sleep( 2500 )
canvas.Close()
else if msg.isRemoteKeyPressed()
if msg.GetIndex() = 10
DisplayInfomenu(6, curr_photo)
end if
endif
else if msg.isRemoteKeyPressed() then
print "Button pressed: " + Stri(msg.GetIndex())
else if msg.isRequestSucceeded() then
print "preload succeeded: " + Stri(msg.GetIndex())
elseif msg.isRequestFailed() then
print "preload failed: " + Stri(msg.GetIndex())
elseif msg.isRequestInterrupted() then
print "preload interrupted" + Stri(msg.GetIndex())
elseif msg.isPaused() then
print "paused"
'example button usage during pause:
'buttons will only be shown in when the slideshow is paused
'slideshow.AddButton(btn_more_from_author, "more photos from this author")
'slideshow.AddButton(btn_similar, "similar")
'slideshow.AddButton(btn_bookmark, curr_photo.GetTitle())
'slideshow.AddButton(btn_hide, "hide buttons")
elseif msg.isResumed() then
print "resumed"
'example button usage during pause:
'slideshow.ClearButtons()
end if
end if
goto waitformsg
DisplayInfomenu(infotype, curr_photo)
End Sub