Ooops
July 26, 2021, 14:07:03

Author Topic: BlitzmaxNG hanging on zipstream  (Read 857 times)

Offline Derron

  • Hero Member
  • *****
  • Posts: 3613
Re: BlitzmaxNG hanging on zipstream
« Reply #15 on: July 01, 2021, 22:21:48 »
Code: BlitzMax
  1. SuperStrict
  2.  
  3. Framework Brl.StandardIO
  4. Import Brl.Audio 'TSound
  5. Import Brl.OggLoader 'to decode OGG
  6. Import Brl.IO
  7. Import Brl.RamStream
  8. Import Brl.FileSystem
  9.  
  10. Incbin "music.zip"
  11.  
  12.  
  13. MaxIO.Init()
  14. print "MountIncBin result: " + MaxIO.Mount("incbin::music.zip", "music")
  15. 'skip the "incbin::" then
  16. 'print "MountIncBin result: " + MaxIO.MountIncbin("music.zip", "music")
  17.  
  18. 'what files are now in "music" ?
  19. local files:string[] = loaddir(currentdir()+"/music")
  20. for local t:String=eachin files
  21.         print t
  22. next
  23.  
  24.  
  25. Local incbinZipOggStream:TStream = ReadStream("music/example.ogg")
  26. If incbinZipOggStream Then Print "loaded ogg stream from incbinned zip file"
  27. If Not incbinZipOggStream Then Print "failed loading ogg stream from incbinned zip file"
  28.  
  29. Local incbinZipOggSound:TSound = LoadSound(incbinZipOggStream)
  30. If incbinZipOggSound Then Print "loaded sound by stream from incbinned zip file"
  31. If Not incbinZipOggSound Then Print "failed loading sound by stream from incbinned zip file"
  32.  
  33. Local incbinZipTune:TSound = LoadSound("music/example.ogg")
  34. If incbinZipTune Then Print "loaded sound from incbinned zip file"
  35. If Not incbinZipTune Then Print "failed loading sound from incbinned zip file"
  36.  
  37. Print "DONE.
  38.  

Give this a try.


bye
Ron

Offline Ashmoor

  • Jr. Member
  • **
  • Posts: 91
Re: BlitzmaxNG hanging on zipstream
« Reply #16 on: July 02, 2021, 07:19:13 »
@Derron,

Your code seems to run fine on windows. Thanks. Is there any way to use a password protected zip file?


Offline Derron

  • Hero Member
  • *****
  • Posts: 3613
Re: BlitzmaxNG hanging on zipstream
« Reply #17 on: July 02, 2021, 08:29:19 »
Brl.io uses pub.physfs.

according to physfs:

Quote
- ZIP files may be password-protected. As the PkWare specs specify, each
file in the .zip may have a different password, so you call
PHYSFS_openRead(a, "file_that_i_want.txt$PASSWORD") to make it work.
Note that this is a wildly insecure way to protect your app's data, both
in how you'd have to manage passwords and that "traditional" PkWare
crypto is not really hardened anyhow. But if you have a basic
password-protected archive, PhysicsFS can get into it now!


maybe try it that way (appending "$yourpassword" to filenames which are inside the mounted zip or 7z ...)?


bye
Ron

Offline Ashmoor

  • Jr. Member
  • **
  • Posts: 91
Re: BlitzmaxNG hanging on zipstream
« Reply #18 on: July 02, 2021, 08:49:35 »
It seems to work. Thanks! :)

Offline Henri

  • Sr. Member
  • ****
  • Posts: 340
Re: BlitzmaxNG hanging on zipstream
« Reply #19 on: July 02, 2021, 12:15:54 »
Seems fairly simple.

Midimaster, did you have time to test Ron's code if that solves your issues ?

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Offline Midimaster

  • Sr. Member
  • ****
  • Posts: 329
    • Midimaster Music Education Software
Re: BlitzmaxNG hanging on zipstream
« Reply #20 on: July 02, 2021, 12:42:02 »
haven't tested it yet.

As I have to update the first three of 16 projects to BigSur as fast as possible (users are already waiting), I now use my workaround the next days, until the trouble on the hotline calmes down.

But them I would like to test it and add it to all my project. All 16 projects are using Koriolis Zipstream, so I need this professional solution.

And I will have some additional questions related to migration from BlitzMax 1.51 to BlitzMax NG. f.e. Building PDFs with Cairo does not work any more. At the moment I publish reduced versions without PDF features.

At the moment a lot of thanks to all the people supporting me. Also via E-Mails. This is a awesome community.

See my current project on PlayStore: 20Tracks-Audio-Player https://play.google.com/store/apps/details?id=midimaster.twentytrackd

Offline Henri

  • Sr. Member
  • ****
  • Posts: 340
Re: BlitzmaxNG hanging on zipstream
« Reply #21 on: July 02, 2021, 13:41:04 »
Fair enough.

Can you create a separate thread for the Cairo issue and I can take a look ?

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Offline Midimaster

  • Sr. Member
  • ****
  • Posts: 329
    • Midimaster Music Education Software
Re: BlitzmaxNG hanging on zipstream
« Reply #22 on: July 02, 2021, 13:54:37 »
of course i will start another thread... but relax... not this week...

At the moment I collect experiences with new MACs. Users reporting the behavior and I change the downloads continuously.

If you want to participate the test phase: here is a free version of Score-Trainer (app to learn notes):
http://www.midimaster.de/downloads/ScoreTrainerXXL.app.zip

known issues:
Menu-Help: The manual is not working -> App hangs DONE



of course there is also a version for Windows:
http://www.midimaster.de/downloads/InstallScoreTrainer.exe



« Last Edit: July 02, 2021, 14:34:20 by Midimaster »
See my current project on PlayStore: 20Tracks-Audio-Player https://play.google.com/store/apps/details?id=midimaster.twentytrackd

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal