Re: How do I play sound files in HTML5?

2017-10-07 Thread Kenji Kojima via use-livecode
John,
I will read the Dictionary/Guide well.

Thanks,
--
Kenji Kojima / 小島健治
http://kenjikojima.com


> On Oct 7, 2017, at 12:09 PM, JOHN PATTEN via use-livecode 
>  wrote:
> 
> In LiveCode under the Dictionary/Guide, there is a link in the Guide for 
> HTML5. At the bottom of that information is what is required in your html to 
> display the app. It is surprisingly little.
> 
> LiveCode actually creates an html page that contains, from what I can tell, a 
> considerable amount of html/code just to create the html layout (i.e. loader, 
> images, etc.)
> 
> Hope that helps!
> 
> John Patten
> SUSD
> 
> Sent from my iPad
> 
>> On Oct 7, 2017, at 8:59 AM, Kenji Kojima via use-livecode 
>> > wrote:
>> 
>> Hi, 
>> I used LC 9.0.0 (dp9). I could play a sound file. Thanks. 
>> 
>> It had a strange thing the result of 
>>   do tScript as “JavaScript” 
>>   was “execution error” though it played. 
>> http://kenjikojima.com/HTML5PlaySound/HTML5PlaySound.html 
>> >  >
>> 
>> How can I hide a black bold belt at the bottom? It’s very ugly. 
>> And I don’t need the LiveCode logo at the top left.
>> 
>> Thanks,
>> --
>> Kenji Kojima / 小島健治
>> http://kenjikojima.com
>> 
>> 
>> 
>> 
>>> On Oct 5, 2017, at 7:16 PM, hh via use-livecode 
>>>  wrote:
>>> 
>>> Hi,
>>> 
>>> do as "javascript" was introduced not before LC 9.0.0-dp4.
>>> 
>>> Get additional info here (=subforum HTML5):
>>> http://forums.livecode.com/viewtopic.php?p=155667#p155667.
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com 
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode 
>> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com 
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode 
> 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: How do I play sound files in HTML5?

2017-10-07 Thread JOHN PATTEN via use-livecode
In LiveCode under the Dictionary/Guide, there is a link in the Guide for HTML5. 
At the bottom of that information is what is required in your html to display 
the app. It is surprisingly little.

LiveCode actually creates an html page that contains, from what I can tell, a 
considerable amount of html/code just to create the html layout (i.e. loader, 
images, etc.)

Hope that helps!

John Patten
SUSD

Sent from my iPad

> On Oct 7, 2017, at 8:59 AM, Kenji Kojima via use-livecode 
>  wrote:
> 
> Hi, 
> I used LC 9.0.0 (dp9). I could play a sound file. Thanks. 
> 
> It had a strange thing the result of 
>do tScript as “JavaScript” 
>was “execution error” though it played. 
> http://kenjikojima.com/HTML5PlaySound/HTML5PlaySound.html 
> 
> 
> How can I hide a black bold belt at the bottom? It’s very ugly. 
> And I don’t need the LiveCode logo at the top left.
> 
> Thanks,
> --
> Kenji Kojima / 小島健治
> http://kenjikojima.com
> 
> 
> 
> 
>> On Oct 5, 2017, at 7:16 PM, hh via use-livecode 
>>  wrote:
>> 
>> Hi,
>> 
>> do as "javascript" was introduced not before LC 9.0.0-dp4.
>> 
>> Get additional info here (=subforum HTML5):
>> http://forums.livecode.com/viewtopic.php?p=155667#p155667.
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: How do I play sound files in HTML5?

2017-10-07 Thread Kenji Kojima via use-livecode
Hi, 
I used LC 9.0.0 (dp9). I could play a sound file. Thanks. 

It had a strange thing the result of 
do tScript as “JavaScript” 
was “execution error” though it played. 
http://kenjikojima.com/HTML5PlaySound/HTML5PlaySound.html 


How can I hide a black bold belt at the bottom? It’s very ugly. 
And I don’t need the LiveCode logo at the top left.

Thanks,
--
Kenji Kojima / 小島健治
http://kenjikojima.com




> On Oct 5, 2017, at 7:16 PM, hh via use-livecode 
>  wrote:
> 
> Hi,
> 
> do as "javascript" was introduced not before LC 9.0.0-dp4.
> 
> Get additional info here (=subforum HTML5):
> http://forums.livecode.com/viewtopic.php?p=155667#p155667.
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Segmented Control Bugs?

2017-10-07 Thread Brian Milby via use-livecode
I've posted a PR that should address this issue:
https://github.com/livecode/livecode/pull/6044
I created a stack with a segmented control with a substack with a segmented
control.  As you described, the hiliteChanged message was dispatched for
both controls upon opening the stack.  In my case, I observed the substack
message coming first and then the parent stack message.  If you would like
assistance testing to see if the change corrects your situation, let me
know (there should just be 2 files that need to be replaced in your DP9
install).

On Thu, Oct 5, 2017 at 3:50 PM, panagiotis merakos via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Brahmanathaswami,
>
> What you see is a bug, see this report:
>
> http://quality.livecode.com/show_bug.cgi?id=20509
>
> Best,
> Panos
> --
>
> On Thu, Oct 5, 2017 at 9:45 PM, Sannyasin Brahmanathaswami via use-livecode
>  wrote:
>
> > LC team: Thanks for getting the docs fixed… can we go back on point?
> >
> > Bug still stands
> >
> > The segmented still seems to be "globally enabled" and "hears" the
> > hilitedChanged msg from "across the universe"
> >
> > -- when card is opened even though no handler is checking that property
> > -- even from a top stack A when the stack with the segmentedcontrol is a
> > substack B which is still open "behind"
> > -- clicking on a widget on the top stack A (with hilited checked) .. the
> > segmentedControl in substack B  which has a script like this
> >
> > on hiliteChanged
> >put the hilitedItemNames of me into tName
> >put tName into sPreviousSelection
> >answer tName with "OK"
> > #DoSomething
> > end hiliteChanged
> >
> > fires.. and you get the answer dialog.
> >
> > I just wanted to see if that was an oddity I had created or if this is
> > what you see also. (anybody)
> >
> >
> > On 10/3/17, 10:18 AM, "use-livecode on behalf of Ali Lloyd via
> > use-livecode"  > use-livecode@lists.runrev.com> wrote:
> >
> > Oh, looks like the docs for the segmented control have become mangled
> > somehow... perhaps a mis-merge.
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Atkinson dither algorithm

2017-10-07 Thread Alejandro Tejada via use-livecode
Hi Malte,

Malte Brill wrote:
> I already posted on the forums, but for completeness also here:
> a lot can be done by replacing repeat with with repeat for each where you
can.
>
> --repeat with i = 1 to the number of words of fldhexa3
> --put 00 & word i of fldhexa3 & word i of fldhexa3 & word i of
fldhexa3 after tVar2
> --end repeat
>
> repeat for each word theWord in fldhexa3
>  put 00 & theword & theword & theword after tVar2
> end repeat

This change reduced the time in a 25%!
Wonderful. Thanks a lot Malte :-D

> I always use strict compile mode, therefore I added the needed variable
> declarations and noticed you use startTime as a variablename, which is a
> reserved keyword. That is not a good idea.  (I noticed, because I managed
to
> freeze liveCode where I fixed only half of the use of startTime. Booom.)

startTime is a property of media players, so I am surprised that
LiveCode do not warn me about this. :-o

Also, I will try others less complex and simpler dithering algorithms as
Floyd-Steinberg and Sierra Lite to measure total time differences.

http://www.tannerhelland.com/4660/dithering-eleven-algorithms-source-code/

Malte, Thanks again for taking a look and improve this code!
Have a nice weekend!

Al
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Atkinson dither algorithm

2017-10-07 Thread Malte Pfaff-Brill via use-livecode
Hi Al,

I already posted on the forums, but for completeness also here:

a lot can be done by replacing repeat with with repeat for each where you can.

 --repeat with i = 1 to the number of words of fldhexa3
   --   put 00 & word i of fldhexa3 & word i of fldhexa3 & word i of 
fldhexa3 after tVar2
   --end repeat

   repeat for each word theWord in fldhexa3
  put 00 & theword & theword & theword after tVar2
   end repeat


A sidenode:

I always use strict compile mode, therefore I added the needed variable 
declarations and noticed you use startTime as a variablename, which is a 
reserved keyword. That is not a good idea.  (I noticed, because I managed to 
freeze liveCode where I fixed only half of the use of startTime. Booom.)

Cheers,

malte
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Slack library?

2017-10-07 Thread Ben Rubinstein via use-livecode
Has anyone interfaced with Slack using LiveCode?  If so, any tips, experience, 
or code to share?


Many thanks,

Ben

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Atkinson dither algorithm

2017-10-07 Thread Alejandro Tejada via use-livecode
I have posted a demo stack in the forums:
https://forums.livecode.com/viewtopic.php?f=10=29935

Have a nice weekend!
Al

On Sat, Oct 7, 2017 at 1:52 AM, Alejandro Tejada 
wrote:

> Hi All,
>
> I am stuck trying to make this code for Bill Atkinson
> dithering algorithm much more faster.
> Any ways to speed this code?
> Follow the recipe and watch out for lines broken
> by mail character length limit.
>
> Recipe:
>
> 1) Import an small image (200x200 pixels) and
> name it as "Image" (you could import a small
> transparent png or a small jpg image)
>
> 2) Optionally, create a scrollbar type slider
> with a range between 0 and 255.
> Set the name of this scrollbar as "ThresholdDither"
> and move the slider to 127 or 0 or 255.
>
> 3) Paste the following script in a button and
> click on it to run this code:
>
> on mouseUp
>
>put the millisecs into startTime
>set the cursor to busy
>
>put the alphadata of img "Image" into tAlphaData
>put the imagedata of img "Image" into tVar
>-- img "Image" could be a grayscale image
>-- where all 3 channels: Red, Green, Blue
>-- are identical or a color image where only
>-- the red channel is used
>
>delete char 1 of tVar
>-- the first char of the imagedata is part
>-- of the alphadata or maskdata
>repeat with i = 1 to length(tVar) step 4
>   put chartonum(char i of tVar) & space after fldhex
>end repeat
>delete last char of fldhex -- a space
>-- fldhex now contains a single channel of the RGB image
>-- converted to numbers between 0 and 255
>
>put the number of words of fldhex into lenghtofldhex
>put the width of img "Image" into tImageWidth
>put the height of img "Image" into tImageHeight
>
>repeat with i = 1 to lenghtofldhex step tImageWidth
>-- We need as many words per line, as pixels contains
>-- the image width (because each pixel is represented
>-- by a word and this word is number between 0 and 255)
>
>put word i to ( i + ((tImageWidth) - 1)) of fldhex & cr after fldhexa2
>end repeat
>
>put empty into fldhex
>delete last char of fldhexa2
>-- deleting the last cr character
>
>put the number of lines of fldhexa2 into sYsize
>put the number of words of line 1 of fldhexa2 into sXsize
>
>// get the scrollbar value
>-- tThreshold is a value between 0 and 255
>if existence(sb the "ThresholdDither") then
>put thumbPos of sb the "ThresholdDither" into tThreshold
>else
>put 127 into tThreshold
>end if
>
>repeat with tY = 1 to sYsize
>   repeat with tX = 1 to sXsize
>
>  put tX into tPixelPosition
>
>  put word (tPixelPosition) of line tY of fldhexa2 into
> tOldPixelValue
>
>  if round(tOldPixelValue) <= tThreshold then
> put 0 into tNewPixelValue
>  else
> put 255 into tNewPixelValue
>  end if
>
>  put (tOldPixelValue - tNewPixelValue)/8 into tDifusionError
>
>  -- Atkinson dither add the diffusion error
>  -- to 6 adjacent pixels
>  -- x o o
>  --  o o o
>  -- o
>
>  put tNewPixelValue & space after fldhexa3
>
>
> if tPixelPosition < sXsize then
>put tDifusionError + word (tPixelPosition + 1) of line tY
> of fldhexa2 into word (tPixelPosition + 1) of line tY of fldhexa2
>
>
>   if tPixelPosition < (sXsize-1) then
>   put tDifusionError + word (tPixelPosition + 2) of line
> tY of fldhexa2 into word (tPixelPosition + 2) of line tY of fldhexa2
>end if
>
>
> end if
>
>
> if tY < sYsize then
>
>
>if tPixelPosition > 1 then
>   put tDifusionError + word (tPixelPosition - 1) of line
> tY + 1 of fldhexa2 into word (tPixelPosition - 1) of line tY + 1 of fldhexa2
>end if
>
>
>put tDifusionError + word (tPixelPosition) of line tY + 1
> of fldhexa2 into word (tPixelPosition) of line tY + 1 of fldhexa2
>
>
>if tPixelPosition < sXsize then
>   put tDifusionError + word (tPixelPosition + 1)  of line
> tY + 1 of fldhexa2 into word (tPixelPosition + 1) of line tY + 1 of fldhexa2
>end if
>
>
>if tY < (sYsize - 1) then
>   put tDifusionError + word (tPixelPosition) of line tY +
> 2 of fldhexa2 into word (tPixelPosition) of line tY + 2 of fldhexa2
>end if
>
>
> end if
>
>   end repeat
>end repeat
>
>replace "0" with "00" in fldhexa3
>replace "255" with "FF" in fldhexa3
>
>repeat with i = 1 to the number of words of fldhexa3
>   put 00 & word i of fldhexa3 & word i of fldhexa3 & word i of
> fldhexa3 after tVar2
>end repeat
>put binaryEncode("H*",tVar2) into tVar3
>
>create img
>set the height of it to the height of img "Image"
>set the width of it to the width of img