AutoHotkey Community

It is currently May 27th, 2012, 10:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: March 21st, 2008, 11:59 am 
Offline

Joined: July 12th, 2007, 10:24 pm
Posts: 103
Location: Hawaii, USA
Quote:
I can't respond to you directly since I've not had time to dig into Skan's lib. Sorry :(


No worries & thank you! :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2008, 2:21 pm 
Offline

Joined: December 4th, 2006, 10:35 am
Posts: 561
Location: Galil, Israel
majkinetor wrote:
Quote:
majkinetor : looks like it's exactly the purpose of skan's AxC : Pack and Unpack Binary files which offers the following functionnality :

Not in the manner I proposed. Its completely different project, looking similar at first glance


your idea is good.

under 10 min. to code...


read file into var,
convert to ascii85

regex per my prev. posted code (mod to include ` and % options in concat)

wrap in function name to return val as bin...

done.


or so it seems if understood the idea...

_________________
Joyce Jamce


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2008, 4:03 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Yes, exactly.
I would go ahead and create file system structure if possible similar to ScriptMerge.

Acctually, the concept generaly doesn't have so much benefits unless something similar to RAM drives is used.

To clearify this: lets say you have several files each of differnet type, so you may have some pictures, some sounds, some arbitrary binary data, and in most of the time it will need to have location on the HD, i.e. path that it can be accessed. But then to use resource.ahk you would need to unpack it in temporrary folder (existing solution for bitmaps is clearly not enough) which defets the purpose great deal. I would like to use resource.ahk as a file system, without temporary files.

While this is possible to do with something similar to RAM drives, or maybe even virtual folders (maybe I say), I am not sure how it can be done nor how much complexity it involves.

Actually, this would be abstraction of ScriptMerge. It would let you include arbitrary files into your ahk file, and use the resources in memory. It would also be possible to unpack everything back if you want to speed up things.

Would be very valuable IMO.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2008, 4:52 pm 
Offline

Joined: July 12th, 2007, 10:24 pm
Posts: 103
Location: Hawaii, USA
Trying to stay on topic here --- but can this actually be used to embed a .wav file, for instance in my AHK program, and play such file runtime? If so, how would I approach that code wise? :) Thank you so much for this thread Azerty, Majkinetor, to make me understand :)

I guess what I am asking is..... can a .WAV be referenced like a Image... without regenerating it to a file which would be useless to me but useful in the sense you would be sort of encapsulating all of the data before running final product. Best wishes, Sarah. :D

i.e.

IMAGES > PNG, GIF, JPG >>> Display directly from binary without creating File

.EXE, other assets must be regenerated to a file

.WAVE??? sounds??? can they be just played directly from binary or am I way off base? :roll: :P


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2008, 4:59 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
I wonder… If you embed hex encoded data in your AHK script instead of ascii85, when you compile it, the data gets compressed. Will it result in similar code sizes? Ascii85 could still have an advantage: less temporary memory.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2008, 5:40 pm 
Offline

Joined: December 19th, 2006, 2:14 pm
Posts: 72
Location: France
sarah : using PlaySound() API through DllCall() should do the trick using SND_MEMORY flag. See here. As for JPeG, BMP & al, browsing through the forum should help you find the trick (look at samples like hardcopy scripts, for instance, to see how to manipulate images in memory).

Laszlo : it should be tested, since ASCII (charset of 85 chars) is also compressible (though might be slightly less than pure hexa). It probably depends on the complexity of the source binary data, and results might differ from one test to another.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2008, 7:13 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
Sarah : using PlaySound() API through DllCall() should do the trick using SND_MEMORY flag. See here. As for JPeG, BMP & al, browsing through the forum should help you find the trick (look at samples like hardcopy scripts, for instance, to see how to manipulate images in memory).

Ye, there are solutions to each multimedia type, but they are specific and not uniformed. I am more interested in finding general solution. I see that Azerty don't have any interest in that, so it would probably have to be done by somebody else. Laszo's ideas about comiled executable definitely gives more attention to such approach, as you would be able to pack any of your resources in the 1 exe file.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2008, 11:52 pm 
Offline

Joined: December 19th, 2006, 2:14 pm
Posts: 72
Location: France
Majkinetor : yes, for now I'm not directly interested in this problem, since I've got my own, so I'm just trying to give useful clues to Sarah to help him (or perhaps her ?, sorry if I'm mistaken, you'll correct me in your next answer) find his way with the direct question he asks. As for most people here, I try to answer our direct needs and offer our solutions to the community

As for a general solution, I'm no expert in MM questions, but it looks to me like the only generic interface is MCI, which does not offer direct in-memory handling for now from what's I've rapidly browsed in MSDN.

Nonetheless, if you offer us a generic solution to handle in-memory MM data, we'll all be glad to use the library you might provide us if you've got a more profound interest in this precise topic.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 34 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group