Catching onAction events from an existing Kodi Window Id ?
#16
I've gotten most everything working now.  I have decided to stick with doModal() mode now since it working so well.  I've posted the code here:

SlideWindow class
manualSlides calling function

I've mapped out the main keyboard / remote controls like moving ahead / back 1, 10 or 25 slides.  I am not going to mess with any mouse controls.  That would require some type of playback control panel for them to click on and those would interfere with seeing the slides.  I suspect most Kodi users use remote controls or keyboards. 

It is working great.  I left a placeholder for info.  I think I can just add a new ControlLabel mapped to the info key.  I need to update the piclist dictionary to add more information like resolution, description and date taken.  These are all in Mezzmo but not in the dictionary / slideshow database temporary table.  

I was digging around Kodi's Wiki and found a slideshow multiimage control referenced for older versions but not in the Kodi 20 controls page.  I suspect the control is still around for an automatic slideshow. 


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#17
right on

looks good, i see how you moved the icontrol to init - very good idea
Reply
#18
(2023-09-21, 17:14)jepsizofye Wrote: right on

looks good, i see how you moved the icontrol to init - very good idea

I got an image information screen working now when you hit the info button or I key.  I added a ControlLabel and set it invisible on init.  The one downside of a ControlLabel is that there is no background so the text blends in with the image.  I tried to create another background control which was just a solid color image and then drop the ControlLabel on top of it so the text would have a nice background.  I couldn't get that to work because the solid background image kept covering the text.   I could have probably figured it out but found a better method.  Now when you hit the info button  I set the slide image a invisible, leaving just the information text on the screen.  Then when you hit info again it flips the situation by making the information text invisible and the slide image visible.  I've still got a bit of work to do to format the information text and then add the data to the piclist but it is working and I am very pleased with how it is turning out.

Thanks again for your help,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#19
(2023-09-21, 17:31)jbinkley60 Wrote: I couldn't get that to work because the solid background image kept covering the text.

not completely sure on this but it could be the order they are added which caused the layering issue

this is where i wish kodi supported modern HTML+CSS for skinning, i could whip up some excessively nice shit in a short amount of time

-----

i intended to try out some of your changes but it requires a bit more focus than i was afforded so it is still on my to-do list
Reply
#20
alright i had a moment to try these out, duplicated the relevant code to a standalone addon

i do have 2 notes

the first probably has to do with how i sent the piclist, mine is a static test dict array [{'url': 'http://'}]

when running ShowSlides i got an error for https://github.com/Conceiva/MezzmoKodiPl...er.py#L868

unable to parse json because the file was not quoted - "file":%s needed to be "file":"%s"

-----

the 2nd is more nitpick on automatic slides, when showing automatic it closed the first image then i saw the previous window for a split second before the second image came up and it was not as fluid as it is with manualSlides
Reply
#21
take a look, i made a couple adjustments for the info display

added a 25% transparent black png for a background image, moved it to the bottom and gave it a width of 1/3

python:
    def __init__(self, *args):
        xbmcgui.Window.__init__(self)
        self.slideIdx = self.piclength = 0
        self.infoflag = False
        self.piclist = []
        self.ititle = self.iwidth = self.iheight = self.idate = self.idesc = ''
        self.x = self.getWidth()
        self.y = self.getHeight()
        self.icontrol = xbmcgui.ControlImage(0, 0, self.x, self.y, "", 2)
        self.basepath = xbmcaddon.Addon('script.slideshow.test').getAddonInfo('path')
        self.blurimg = xbmcgui.ControlImage(int((self.x - int(self.x/3)) / 2), int(self.y-100), int(self.x/3), 200, os.path.join(self.basepath, 'resources/blacktrans.png'))
        self.infcontrol = xbmcgui.ControlLabel(int((self.x - int(self.x/3)) / 2), int(self.y-100), int(self.x/3), 200, '', 'font14', '0xFFFFFFFF')
        self.infcontrol.setVisible(False)
        self.blurimg.setVisible(False)
        self.addControl(self.icontrol)
        self.addControl(self.blurimg)
        self.addControl(self.infcontrol)
        pass

blurimg also needs the visibility change at the same time as the label in onAction, actionkey == 11

rough outline, could use some edge rounding perhaps

Image


-----

edit:

this is what i was going for but no css means 10x more work - https://developer.mozilla.org/en-US/docs...rop-filter
Reply
#22
(2023-09-22, 07:37)jepsizofye Wrote: alright i had a moment to try these out, duplicated the relevant code to a standalone addon

i do have 2 notes

the first probably has to do with how i sent the piclist, mine is a static test dict array [{'url': 'http://'}]

when running ShowSlides i got an error for https://github.com/Conceiva/MezzmoKodiPl...er.py#L868

unable to parse json because the file was not quoted - "file":%s needed to be "file":"%s"

-----

the 2nd is more nitpick on automatic slides, when showing automatic it closed the first image then i saw the previous window for a split second before the second image came up and it was not as fluid as it is with manualSlides

The quotes are handled by the picurl function found here when creating the playitem variable here. .  Ironically it is the picurl function which caused me to add the strip function to the manual slideshow since I am not using JSON the and quotes are not needed.  What I really need to do in the manual section is remove both picurl and strip.  I had forgotten when I was troubleshooting this that picurl was there for the JSON variable. 

Yeah, the flickering is a bit annoying using JSON.  After doing this manual slideshow I may now rewrite it as a modal window class (or reuse this new one with some additional variables for manual / automatic).  That was some of my thinking with the original timer inside a modal window question.  


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#23
(2023-09-22, 09:02)jepsizofye Wrote: take a look, i made a couple adjustments for the info display

added a 25% transparent black png for a background image, moved it to the bottom and gave it a width of 1/3

Yeah, I am sure this is what I tried but I likely missed something. One thing in this approach, as you mention,  is the layering.  We would have three layers in top of each other: an image on top of an image with a label on top of the images.   Let me take another run at this method, now that I have it working making the main image invisible.  I can then test which one I like better.  I've never done CSS coding nor much HTML 5 coding either.  One of these days I'll add them to my list, if I ever fully retire Smile


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#24
(2023-09-22, 09:02)jepsizofye Wrote: take a look, i made a couple adjustments for the info display

added a 25% transparent black png for a background image, moved it to the bottom and gave it a width of 1/3

I took another run at this today and figured out the issue, the proverbial "order is important".  Basically the order of the addControl statements determines the layering.  I had lines 687 and 688 reversed which put the background image on top of the information label, which is what I was seeing. 

Here's a sample now:

Image


I like how Mezzmo pulls all of the image data out of the images, if the camera stores it.

One downside of this approach is that Mezzmo allows for huge descriptions which could overrun the backdrop image size.  I am not going to worry about that now, unless someone complains.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#25
(2023-09-22, 09:57)jbinkley60 Wrote: Yeah, the flickering is a bit annoying using JSON.  After doing this manual slideshow I may now rewrite it as a modal window class

a small idea for this, simply automate the manual slide with a timer

move the onAction code to a new function, def onSlideAction(self, actionId) then def onAction(self, action): actionkey = action.getId(); self.onSlideAction(actionkey)

so that if you want to automate the slide you can create the window and a timer can call the new function slwindow.onSlideAction(2)

unless you can figure out how to send a subclass of action but that seems to be even more code
 
(2023-09-22, 10:06)jbinkley60 Wrote: We would have three layers in top of each other: an image on top of an image with a label on top of the images.   Let me take another run at this method, now that I have it working making the main image invisible.  I can then test which one I like better.  I've never done CSS coding nor much HTML 5 coding either.  One of these days I'll add them to my list, if I ever fully retire Smile

the 'ideal' way to do this, which i do not want to recommend, is an actual .xml based window then everything can be positioned and formatted
the issue i have with that is i run my skin with 4K resolution in the addon.xml and opening a model window from a .xml is limited to 1080i (its in the source code for kodi, nobody ever thought it needed to be higher i guess)
with your positioning code (that i copied from github yesterday) the offsets were off on the info panel, it centered it near the upper left corner
also due to my use of a higher resolution, which is likely single use and edge case anyway but in future-proofing who's to say skins won't start adopting 4K resolutions

addon.xml from my modded Estuary

xml:
<res width="3840" height="2160" aspect="16:9" default="true" folder="xml" />

-----

i do think i may have overdone it with the transparent png, you can set a color's opacity with the first 2 of the color code and the box you have will likely be able to be transparent simply with 90 00 00 00 as a color

i applied that method to my skin as well, which is why i gravitated towards it - https://forum.kodi.tv/showthread.php?tid=372204

-----

i adopted a 'web app' approach many years ago when the tides were turning and more and more could be done from a webpage / browser - i was also an early adopter of the XMLHttoRequest long before you could even have cross-origin headers
so my "go to" is comparable to a dynamic div pulling content using jquery and everything being nicely formatted with some css, add in some faux modal window divs and you have a kodi-like window
definitely recommend exploring this avenue if only for the sake of learning something interesting, css3 has added so much flexibility
admittedly though, i am not a guru on this subject and my web "design" skills are actually quite outdated
 
(2023-09-22, 12:54)jbinkley60 Wrote: I took another run at this today and figured out the issue, the proverbial "order is important".  Basically the order of the addControl statements determines the layering.  I had lines 687 and 688 reversed which put the background image on top of the information label, which is what I was seeing. 

Here's a sample now:

i suspected as much, you would have to imagine you are writing the xml and the order in which your code adds things is just like adding a new line to the xml file - looks good

 
(2023-09-22, 12:54)jbinkley60 Wrote: One downside of this approach is that Mezzmo allows for huge descriptions which could overrun the backdrop image size.  I am not going to worry about that now, unless someone complains.


since you know about this, perhaps it would be a good idea to cut the text intentionally when it will overrun and add the "..." so that it won't look unfinished if anyone does notice

the difference in a "broken" report vs a "it wont show all the info" report
Reply
#26
(2023-09-22, 17:56)jepsizofye Wrote: a small idea for this, simply automate the manual slide with a timer

move the onAction code to a new function, def onSlideAction(self, actionId) then def onAction(self, action): actionkey = action.getId(); self.onSlideAction(actionkey)

so that if you want to automate the slide you can create the window and a timer can call the new function slwindow.onSlideAction(2)

unless you can figure out how to send a subclass of action but that seems to be even more code

Ahead of you on this one with the same idea.  I tried this earlier today and had the same problem where the slides would sequence but only the last one would show.  I tried it with modal and nonmodal windows.  I suspect the issue may be that I am calling this from a context menu window vs. a normal Kodi window.   I might post the code and se if you can see anything I am missing.  

 
(2023-09-22, 17:56)jepsizofye Wrote: the 'ideal' way to do this, which i do not want to recommend, is an actual .xml based window then everything can be positioned and formatted the issue i have with that is i run my skin with 4K resolution in the addon.xml and opening a model window from a .xml is limited to 1080i (its in the source code for kodi, nobody ever thought it needed to be higher i guess) with your positioning code (that i copied from github yesterday) the offsets were off on the info panel, it centered it near the upper left corner also due to my use of a higher resolution, which is likely single use and edge case anyway but in future-proofing who's to say skins won't start adopting 4K resolutions

I'll test this on my 4K system too and see how it looks.  It may be too small.  I'll play around and see.
 
Quote:since you know about this, perhaps it would be a good idea to cut the text intentionally when it will overrun and add the "..." so that it won't look unfinished if anyone does notice

the difference in a "broken" report vs a "it wont show all the info" report
Yeah, the issue isn't characters but lines.  I'll need to see if / how I can count the lines in the description.  It might be tricky.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#27
right on

i rather like viewtype Wall with 12 posters across and 5 rows down, much easier to see all content fairly quickly when your collection is large

the physical size of posters on my display is  6.5" x 4.5" and from 15 feet away they are Mostly good, some get resized weird and have small text so they get illegible

-----

i should post a mod skin eventually but i feel most people want everything bigger instead of smaller
Reply
#28
here ... this is my "Home" screen on kodi, everything in 1 place for easy content consumption

Image
Reply
#29
and you get more real estate on the info screen ...

(ive been meaning to modify the info page for some time now though, expand and move things around so they are less squished together)

Image
Reply
#30
(2023-09-22, 22:44)jepsizofye Wrote: here ... this is my "Home" screen on kodi, everything in 1 place for easy content consumption

Nice looking screen.  Even though the Mezzmo Kodi addon does a full sync with Kodi's video database I generally don't use the native mode Kodi interface and use the Mezzmo addon List / GUI mode.  I have a set of powerful smart and active playlists which make it very easy to quickly find things across my entire library.  I could do similar with your approach, using favorites to the Mezzmo smart / active playlists.  Your homescreen is organized more like a typical streaming service and is visually very appealing.    One of these days I'll spend more time on the user interface but managing it across many Kodi systems isn't what I'd be up for since I manage everything centrally right now. 


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
Catching onAction events from an existing Kodi Window Id ?0