Transparent ZIP Support For Storing Skins (1 Viewer)

c.hilding

Portal Member
November 17, 2006
40
0
ABANDONED ACCOUNT
Home Country
I'm glad you said you like it. Now I just hope someone throws together a proof-of-concept. It's not hard but I haven't coded C++ in years so I can't do it.

I also agree with your points about skinners, and that a skin folder should override a skin zip file, so that they can quickly make changes during skin development.
 

MJGraf

Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,478
    1,385
    Sounds like a great idea!

    Just one comment: If we have both access patterns with separate files overwriting the zipped files there should be a "skinner-mode" option in the configuration. When this is checked, MP searches for separate files first, if it is not checked, MP goes straight to the ZIP. Otherwise we would have a slow down again because MP would always have to look for separate files first and then go to the ZIP.

    Maybe it would also be an option to only once check if there are separate files, e.g. when starting up MP or changing the skin... OK, when I think of it, this seems to be the only senseful option - and I guess you programmers had this in mind already. If so, just ignore this comment...
     

    swifty

    Portal Pro
    January 6, 2006
    205
    10
    Home Country
    United Kingdom United Kingdom
    Sounds like a great idea!

    Just one comment: If we have both access patterns with separate files overwriting the zipped files there should be a "skinner-mode" option in the configuration. When this is checked, MP searches for separate files first, if it is not checked, MP goes straight to the ZIP. Otherwise we would have a slow down again because MP would always have to look for separate files first and then go to the ZIP.

    I like the sound of that!
    Hope someone implements this great idea!
     

    Harley

    Retired Team Member
  • Premium Supporter
  • May 7, 2004
    2,053
    1,993
    Germany
    Home Country
    Germany Germany
    Hi,

    why do we not use the way xbmc made it with a compressed texturefile ".xpr"

    That is realy the fastest way for gfx loadingtime.

    And for us skinners we can also use the normal mediafolder with the gfx.

    XBMC does work with this two ways as a long time.

    Greetings Harley
     

    c.hilding

    Portal Member
    November 17, 2006
    40
    0
    ABANDONED ACCOUNT
    Home Country
    Pinging this thread. Is anyone ready to step up and make a proof-of-concept? It will only take you an hour or two to get the engine down, from there it's just implementation details.
     

    c.hilding

    Portal Member
    November 17, 2006
    40
    0
    ABANDONED ACCOUNT
    Home Country
    Alright, how about I revive this thread again?

    When I Googled for "transparent zip library" I came up with several good results. It would be very interesting to implement zziplib as a C++ DLL that you load and access from inside the C#.NET of MediaPortal, or alternatively port it to C#.NET (however, that may be too tedious).

    zziplib has functions for reading a zip file as a folder structure and getting data into memory on the fly, which is exactly what we want!

    The zziplib library is intentionally lightweight, it offers the ability to easily extract data from files archived in a single zip file. Applications can bundle files into a single zip archive and access them. The implementation is based only on the (free) subset of compression with the zlib algorithm which is actually used by the zip/unzip tools.

    The library allows reading zip archives in a number of ways,

    archive mode:
    reading the zip directory and extracting files from it. This is the traditional mode as seen with unzip-utilities. Some extra unzip-utiles for transparent/magic mode are shipped as well.

    replacement mode:
    Use ZZIP_FILE / ZZIP_DIR pointers provided by zziplib and put them to work with routines originally developped to work with real directories and file handles. The API calls do follow traditional synopsis from posix/stdio.

    transparent mode:
    Use replacement handles and allow the open()-calls to automatically detect when a file is contained in a zip archive or when it is a real file in the file system. A filepath can be partly in a real filesystem and partly within the zip archive when one is seen.

    ext magic
    Use the same filepath to access either a zipped or real file - it looks for a real file and if there is none then every subdirectory of the path is checked, a ".zip" extension appended, and the zipped file transparently opened. This can speed up dat-file development dramatically.


    io/xor magic
    The access to the filesystem can be hooked up - examples are given for xor obfuscation which is great for game artwork and AI data. A small intro for SDLrwops usage is given as well.
     

    deebo

    Portal Pro
    April 19, 2006
    233
    3
    doesnt windows xp have native support for this?

    if you dont have a file handler for .zip explorer opens up a zip as a folder

    could be worth looking into
     

    c.hilding

    Portal Member
    November 17, 2006
    40
    0
    ABANDONED ACCOUNT
    Home Country
    doesnt windows xp have native support for this?

    if you dont have a file handler for .zip explorer opens up a zip as a folder

    could be worth looking into


    No, it would have to be a custom zip handler built-in into MediaPortal, or implemented as a .dll. :)

    As has already been said, zipped themes could actually load faster than regular themes, because MP wouldn't have to open hundreds of file handles to tiny little fragmented/spread out (physically) on the disk theme files to read the theme into memory from.

    And as for skin designers, they could still design skins quickly exactly the way they are used to, since a skin folder would have to take precedence over the existence of a .zip file, so they could keep working as usual until the skin is finished, which is when they would just zip the theme and distribute it.
     

    Users who are viewing this thread

    Top Bottom