Processing WAV file sample data

2022-10-18 Thread Peter Reid via use-livecode
Hi

I'm developing a project that will manipulate WAV files. 

The source files will be in the following form: -
WAV stereo (2-ch), 48kHz, 16bit 16kbit, 2-15 secs duration, uncompressed

The output will be a series of chunks from the source files, each being
WAV mono (1,2,3,4 channels), 16kHz, as long as desired, uncompressed

Does anyone know of any LiveCode extensions that let you extract the sample 
data from existing WAV files and build new WAV files by combining existing  WAV 
files?

So I'm looking for something like:

WAV2bin - exports from original WAV to binary sample data

WAVproc - processes 1 or more binary sample data files

bin2WAV - converts sample data files to WAV

Note the chopping up of the WAV files should run under Linux (if possible), but 
Mac otherwise. Any further data manipulations must work under Linux , but Mac 
would be OK as a fallback.

Thanks

Peter
___
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 to use LiveCode

2022-03-01 Thread Peter Reid via use-livecode
Hi

I hit the same problem a little while ago and decided to try to dodge the issue 
as much as possible. My solution was to include the following guidance where 
appropriate:

Can't Open ...

Note that both Mac and Windows users may be asked to give permission to run the 
app for the first time. This is because we haven't gone through the processes 
to register the app with Apple and Microsoft - it's not worth the effort for 
limited distribution apps.

If you're unhappy about this or at all unsure that you trust our apps, don't 
use them! Otherwise, just do what's required once and you'll not be bothered 
again when you use the app from then onwards.

See "Can't Open Mac App.pdf  
"
 or "Can't Open Windows App.pdf  
"
 as appropriate for guidance.

Here's an example of how I provide this advice as part of a distribution web 
page:

https://www.reid-it.co.uk/downloads/down_bballs.htm 


For my purposes, the above covers my needs since my projects are almost always 
for a small number of users, often for in-house use only. If something like the 
above works for you, you're welcome to use my guidance sheets, either as is or 
with your own modifications.

Regards

Peter

___
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: Ghost in the Machine

2021-12-15 Thread Peter Reid via use-livecode
u can do that with a single 
> POST command.
> 
> Examine the source HTML. Look for the action URL.  Look at the input 
> names. Package up the input data as name-value pairs form-encoded, send 
> it to the URL via POST, and you're done.
> 
> -- 
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  
>  ambassa...@fourthworld.comhttp://www.FourthWorld.com
> 
> --
> 
> Message: 8
> Date: Mon, 13 Dec 2021 01:36:51 +
> From: Alex Tweedly 
> To: use-livecode@lists.runrev.com
> Subject: Re: Ghost in the Machine?
> Message-ID: <0fc4be03-ba78-c5e8-deca-fe4aca614...@tweedly.net>
> Content-Type: text/plain; charset=UTF-8; format=flowed
> 
> Peter,
> 
> I think the piece of info we are all missing (or guessing wrongly about) is:
> 
> the existing club membership system - is it a web-based system, or an app 
> that runs on your desktop.
> 
> We're all kind of assuming it's a web page, but I now suspect maybe it isn't.
> 
> If it is a web page - then the answers so far are all relevant, and should be 
> straightforward to try out.
> 
> [My suggestion re. the browser widget still feels like the "right official" 
> way to do it - but personally I'd look at the html and see if I could POST 
> the correct info - i.e. what Richard said :-)  ]
> 
> If it's a custom app, then it's a very different question - and I currently 
> have no idea. If so, please say a little bit more about the custom app, or 
> put up a screenshot / video somewhere.
> 
> Alex.
> 
> On 12/12/2021 18:29, Peter Reid via use-livecode wrote:
>> Thanks Alex, Dan & Tom for responding to this, but I suspect that I didn't 
>> explain things well enough, let me elaborate?
>> 
>> 1. Periodically we have small batches of new members joining a club. We have 
>> their details in a CSV file which we'd normally think of doing some kind of 
>> batch upload.
>> 
>> 2. However, the existing club membership system doesn't have a batch load 
>> facility only an on-screen form (such as the following) to be typed in:
>> 
>> +-+
>> |  Surname:[.]   Firstname(s):[...]   Initials:[..]  
>>  |
>> |
>>   | 
>> |Address:[.]   Town:[.]   Phone: [.] 
>>   |
>> |[.]   Postcode:[.]   Mobile:[.] 
>>   |
>> |
>>   |
>> |Email:[]   GiftAid:[x]   Payment:(o)Bank  ( )Chq
>>   |
>> +-+
>> 
>> 3. We want a way to upload a group of new members by 'driving' the input 
>> fields, i.e. our app would click into each field, checkbox, radiobox and 
>> 'type' in the details.
>> 
>> 4. We don't have access to the membership system's coding, it's one off the 
>> shelf. We just want do what we might have attempted some years ago, during 
>> the terminal/command line days! In those old days, we'd redirect the stdin, 
>> stdout, stderror.
>> 
>> So my query is really as follows:
>> a) is this kind of 'channel' redirection possible, can we send mouse clicks, 
>> type keys to enter text into fields etc?
>> b) has anyone done something like this?
>> c) does anyone have any methods and/or code they can let me have for this?
>> 
>> My overview of what's required is as follows (assuming no show-stoppers):
>> - I make an overlay map, transparent everywhere except where there are input 
>> fields ? this could be an actual map with "X"s over entry fields, spaces 
>> elsewhere, but might simply be a list of objects expressed as coordinate 
>> rectangles
>> - we take the name of a field, 'Surname' say, and lookup its location on the 
>> screen
>> - we position our virtual mouse to click into the location where the 
>> equivalent field can be found
>> - we enter its value as virtual keystrokes and click the 'tab' key to move 
>> to the next input object
>> 
>> Any idea whether this is possible and any code examples?!
>> 
>> Thanks.
>> 
>> Peter



___
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: Ghost in the Machine?

2021-12-12 Thread Peter Reid via use-livecode
Thanks Alex, Dan & Tom for responding to this, but I suspect that I didn't 
explain things well enough, let me elaborate…

1. Periodically we have small batches of new members joining a club. We have 
their details in a CSV file which we'd normally think of doing some kind of 
batch upload.

2. However, the existing club membership system doesn't have a batch load 
facility only an on-screen form (such as the following) to be typed in:

+-+
|  Surname:[.]   Firstname(s):[...]   Initials:[..] 
  |
|   
  | 
|   Address:[.]   Town:[.]   Phone: [.] 
  |
|   [.]   Postcode:[.]   Mobile:[.] 
  |
|   
  |
|   Email:[]   GiftAid:[x]   Payment:(o)Bank  ( )Chq
  |
+-+

3. We want a way to upload a group of new members by 'driving' the input 
fields, i.e. our app would click into each field, checkbox, radiobox and 'type' 
in the details.

4. We don't have access to the membership system's coding, it's one off the 
shelf. We just want do what we might have attempted some years ago, during the 
terminal/command line days! In those old days, we'd redirect the stdin, stdout, 
stderror.

So my query is really as follows:
a) is this kind of 'channel' redirection possible, can we send mouse clicks, 
type keys to enter text into fields etc?
b) has anyone done something like this? 
c) does anyone have any methods and/or code they can let me have for this?

My overview of what's required is as follows (assuming no show-stoppers):
- I make an overlay map, transparent everywhere except where there are input 
fields – this could be an actual map with "X"s over entry fields, spaces 
elsewhere, but might simply be a list of objects expressed as coordinate 
rectangles
- we take the name of a field, 'Surname' say, and lookup its location on the 
screen
- we position our virtual mouse to click into the location where the equivalent 
field can be found
- we enter its value as virtual keystrokes and click the 'tab' key to move to 
the next input object

Any idea whether this is possible and any code examples?!

Thanks.

Peter
___
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


Ghost in the Machine?

2021-12-08 Thread Peter Reid via use-livecode
I'm trying to provide an upload facility for an existing on-line club 
membership app. This app has a bulk loading facility for initial set up and is 
designed for whole database configuration. In addition the app provides a 
manual on-line form with 20+ fields making up a member's record.

Ideally my user would use a facility to upload 1 or more files with rows of 
details , each row containing a collection of all the inputs for my user to 
use. Sadly, there's no bulk loading facility, so the user has to type in most 
of the details from the membership form.

So here comes the 'Ghost' bit, is it possible to make an LC app that mimics 
keyboard and mouse inputs as if the user was there interacting with the on-line 
form? If I can do this my user would have a file of inputs which they could 
send to the membership database, sit back and watch the ghostly app 'type' and 
'mouse click' their way through completing the on-line form.

Any suggestions please?

Peter
--
Peter Reid
Loughborough, UK


___
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


Linux Speech Support?

2021-12-06 Thread Peter Reid via use-livecode
Has anyone managed to used text-to-speech for Linux? I'm using the latest LC 
9.6.5 stable release, building for Mac, Win64 and Linux64. The Mac and Win 
build OK but I get the following warning for the Linux build:

Linux x86-64, external No externals.txt config file found for Speech

The Linux app builds and runs OK except that the text-to-speech doesn't work. 
I've tried manually selecting inclusions but there's nothing appropriate. I've 
tried including Android speech support inclusions, just in case it might work 
with Linux; it doesn't.

So, general question - has anyone got text-to-speech (or speech-to-text) 
working with Linux? For speech in general there are the following inclusions:

Android Speech-to-text (all platforms are listed)
Speech Library (X, iOS, Android only)
Speech (X, Win only)

Any suggestions please?

Peter
--
Peter Reid
Loughborough, UK


___
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: matchChunk & matchText broken?

2021-08-15 Thread Peter Reid via use-livecode
Thanks Brian I didn't realise that was what was meant in the dictionary 
description! Now you've clarified things I can see how it should work, and it 
does!

> Today's Topics:
> 
>   1. PlayStore App Bundles. (Ralph DiMola)
>   2. matchChunk & matchText broken? (pr...@reidit.co.uk)
>   3. Re: matchChunk & matchText broken? (Brian Milby)
> 
> --
> 
> Message: 3
> Date: Fri, 13 Aug 2021 07:35:23 -0400
> From: Brian Milby 
> To: How to use LiveCode 
> Subject: Re: matchChunk & matchText broken?
> Message-ID: <986d6545-2ca3-4c30-b65f-d3ddb2b18...@milby7.com>
> Content-Type: text/plain; charset=utf-8
> 
> If the regularExpression includes a pair of parentheses, the position of the 
> substring matching the part of the regular expression inside the parentheses 
> is placed in the variables in the positionVarsList.
> 
> Sent from my iPhone
> 
>> On Aug 13, 2021, at 4:33 AM, Peter Reid via use-livecode 
>>  wrote:
>> 
>> ?Either I'm doing something wrong or both matchChunk and matchText are 
>> broken.
>> 
>> For example using matchChunk:
>> 
>> local tStartPos, tEndPos
>> put empty into tStartPos
>> put empty into tEndPos
>> 
>> put matchChunk("hello world how are you", "\ ho[a-z]", tStartPos, tEndPos) 
>> into itMatches
>> 
>> put itMatches & "|" & tStartPos & "|" & tEndPos & "|"
>> 
>> 
>> The output is:true|||- in other words a match is found but the 
>> positions are not being returned in the variables tStart and tEnd
>> 
>> I get the same behaviour from matchText, ie it correctly finds or not the 
>> patterns I'm looking for but I don't get the positions (matchChunk) or text 
>> (matchText).
>> 
>> These seem to be fairly fundamental and frequently used functions that 
>> should just work. Which is why I'm assuming that I'm doing something wrong!
>> 
>> Please can anyone correct me (or confirm the fault)?
>> 
>> Thanks
>> 
>> Peter
>> --
>> Peter Reid
>> Loughborough, UK


___
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


matchChunk & matchText broken?

2021-08-13 Thread Peter Reid via use-livecode
Either I'm doing something wrong or both matchChunk and matchText are broken.

For example using matchChunk:

local tStartPos, tEndPos
put empty into tStartPos
put empty into tEndPos

put matchChunk("hello world how are you", "\ ho[a-z]", tStartPos, tEndPos) into 
itMatches

put itMatches & "|" & tStartPos & "|" & tEndPos & "|"


The output is:  true||| - in other words a match is found but the positions are 
not being returned in the variables tStart and tEnd

I get the same behaviour from matchText, ie it correctly finds or not the 
patterns I'm looking for but I don't get the positions (matchChunk) or text 
(matchText).

These seem to be fairly fundamental and frequently used functions that should 
just work. Which is why I'm assuming that I'm doing something wrong!

Please can anyone correct me (or confirm the fault)?

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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


Unreliable File Deletion

2021-03-27 Thread Peter Reid via use-livecode
Hi

Has anyone had problems with file deletion by LC under Windows 10?

According to the docs the following commands should delete a file:

delete file pathname

open file pathname for write

Also the shell() command sequence:

put UnixToWinPath(pFile) into pWinFile
put "del " & quote & pWinFile & quote into tCmd
set the hideConsoleWindows to true
put shell(tCmd) into tRes

With various versions of LC including the latest 9.6.2 RC3 I get the following 
behaviour:

1. The file is deleted correctly.

2. The file appears to be deleted but any new version written to the same 
folder is actually the old version.

3. The deletion fails with a failure comment returned in the Result.

4. The deletion seems to work but the next attempt to save a file of the same 
name fails, reported by the Result.

I'm getting this problem when tested on a brand new up-to-date virtual Windows 
10 Home 64-bit and a similar PC laptop. It's not a problem on the Mac.

Any ideas please?

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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


Unreliable File Deletion

2021-03-27 Thread Peter Reid via use-livecode
Hi

Has anyone had problems with file deletion by LC under Windows 10?

According to the docs the following commands should delete a file:

delete file pathname

open file pathname for write

Also the shell() command sequence:

put UnixToWinPath(pFile) into pWinFile
put "del " & quote & pWinFile & quote into tCmd
set the hideConsoleWindows to true
put shell(tCmd) into tRes

With various versions of LC including the latest 9.6.2 RC3 I get the following 
behaviour:

1. The file is deleted correctly.

2. The file appears to be deleted but any new version written to the same 
folder is actually the old version.

3. The deletion fails with a failure comment returned in the Result.

4. The deletion seems to work but the next attempt to save a file of the same 
name fails, reported by the Result.

I'm getting this problem when tested on a brand new up-to-date virtual Windows 
10 Home 64-bit and a similar PC laptop. It's not a problem on the Mac.

Any ideas please?

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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: ICS Generation

2020-10-03 Thread Peter Reid via use-livecode
Thanks all for the leads/links to Bill Vlahos' and Andre Garzia's developments, 
both look very interesting. I think Andre's vObject library looks to fit my 
needs better as it doesn't rely on other scripting technology such as 
AppleScript. I'll report back to the list how I get on with my very modest iCal 
support.

Peter
--
Peter Reid
Loughborough, UK

> On 2 Oct 2020, at 5:00pm, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 6
> Date: Thu, 1 Oct 2020 23:22:25 +0200
> From: matthias_livecode_150...@m-r-d.de
> To: How to use LiveCode 
> Subject: Re: ICS Generation
> Message-ID: <1c63c7d4-b66e-4f1f-a88d-dfdf810d6...@m-r-d.de>
> Content-Type: text/plain; charset=us-ascii
> 
> I am not sure if this is what you are looking for, but in this forum post 
> Bill Vlahos wrote about a stack he wrote
> http://forums.livecode.com/viewtopic.php?f=108=25046
> 
> Here's the direct link to his GitHub repo
> https://github.com/bvlahos/Scripting-Calendars 
> 
> 
> Regards,
> Matthias
> 
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
> 
> --
> 
> Message: 7
> Date: Fri, 2 Oct 2020 00:17:11 +0200
> From: matthias_livecode_150...@m-r-d.de
> To: How to use LiveCode 
> Subject: Re: ICS Generation
> Message-ID: 
> Content-Type: text/plain; charset=us-ascii
> 
> And heres a link to Andre Garzias post about an iCalendar library he created 
> and shared through GitHub
> http://forums.livecode.com/viewtopic.php?t=32187
> 
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code


___
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


ICS Generation

2020-10-01 Thread Peter Reid via use-livecode
Has anyone got a calendar library for LiveCode? I'm developing an app, part of 
which exports a handful of events to do with ordering regular medication. I'd 
like to export an ICS format file containing 3 all-day events titled something 
like the following:

1. MEDS RUN-OUT TODAY
2. COLLECT MEDS
3. ORDER NEXT MEDS

What I'm looking for is either a full calendar library that I can use to 
generate such a ICS file, or the minimalist version, ie just enough calendar 
support to generate this minimal ICS file - nothing more complex.

Anyone know of anything suitable?

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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: Atom Editor Help

2020-05-15 Thread Peter Reid via use-livecode
Hi

The reason I'm considering Atom is because I often help people on both Macs and 
PCs with regex type enquiries and it would be easier for me if I could settle 
on a single tool instead of having to be proficient in 2 or more tools (I do 
some Linux as well). If BBedit were at least PC as well as Mac, I'd happily 
stick with it!

Cheers

Peter
--
Peter Reid
Loughborough, UK

> On 15 May 2020, at 5:00pm, use-livecode-requ...@lists.runrev.com wrote:
> 
> Subject: Re: Atom Editor Help
> Message-ID: <7c085b5f-6fdd-4ef6-9bf3-6c09a576d...@edison.tech 
> <mailto:7c085b5f-6fdd-4ef6-9bf3-6c09a576d...@edison.tech>>
> Content-Type: text/plain; charset="utf-8"
> 
> 
> Before you give up on BBedit, try to get in touch with Thierry on the forums. 
> He is a master of Regex and has a system of macros to make it work tightly 
> with BBedit to replace the IDE.
> 
> http://forums.livecode.com/viewtopic.php?f=7=33891=190832=bbedit#p190832
>  
> <http://forums.livecode.com/viewtopic.php?f=7=33891=190832=bbedit#p190832>
> 
> 
> On May 14 2020, at 11:28 pm, Peter Reid via use-livecode  
> mailto:use-livecode@lists.runrev.com>>  wrote:
> 
>> 
>> 
>> Hi, I?ve noticed that several of the LiveCode staff use the Atom text 
>> editor. Until now I?ve used BBEdit on the Mac and Notepad++ on the PC. I?m 
>> thinking of switching to Atom but need to be sure it can everything I need. 
>> For example, I have a typical piece of pre-process manipulation of text data 
>> that involves using several regular expressions. I?ve tried to find a macro 
>> in Atom that applies a series of find  &  replacement actions but have 
>> failed to find a solution. Can anyone provide a template macro for this?
>> 
>> 
>> Thanks
>> 
>> 
>> Peter

___
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


Atom Editor Help

2020-05-14 Thread Peter Reid via use-livecode
Hi, I’ve noticed that several of the LiveCode staff use the Atom text editor. 
Until now I’ve used BBEdit on the Mac and Notepad++ on the PC. I’m thinking of 
switching to Atom but need to be sure it can everything I need. For example, I 
have a typical piece of pre-process manipulation of text data that involves 
using several regular expressions. I’ve tried to find a macro in Atom that 
applies a series of find & replacement actions but have failed to find a 
solution. Can anyone provide a template macro for this?

Thanks 

Peter

___
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


Automating User Input

2020-01-31 Thread Peter Reid via use-livecode
I'm writing an app that needs to complete a couple of forms that are being 
displayed by a browser as if the user was doing it interactively. This is to 
save the user from having to enter complex medical terms. If the user were to 
interact directly with the browser, they could press the tab key repeatedly to 
move from file to field, checkbox to checkbox etc. I'd like my app to do the 
same tabbing etc. instead of my user who could sit back and watch the form 
being completed interactively!

Any idea whether this is possible and if so how?

Thanks.

Peter
--
Peter Reid
Loughborough, UK


___
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: A Windows 10 WTF

2019-12-24 Thread Peter Reid via use-livecode
Hi Tom

I'm not sure about Windows 10 behaviour but I had a similar problem with 
Windows 7. It seemed that my LC app was not releasing the processor long enough 
to handle basic user I/O. The solution was to add the following to all my tight 
loops:

wait 0 milliseconds with messages

The 'with messages' is the key element, this made the LC app hand back control 
to Windows to handle other system activities. I add this line to all my loops 
when running under Windows. Give this a try and let me know whether this helps.

Peter
--
Peter Reid
Loughborough, UK

> On 23 Dec 2019, at 5:00pm, use-livecode-requ...@lists.runrev.com wrote:
> 
> Date: Mon, 23 Dec 2019 10:42:31 -0500
> From: Tom Glod mailto:t...@makeshyft.com>>
> To: How to use LiveCode  >
> Subject: a windows 10 wtf
> Message-ID:
>>
> Content-Type: text/plain; charset="UTF-8"
> 
> Hi Peeeps,
> 
> So I have a standalone running 24/7 that was built with LiveCode.
> 
> When I use Livecode the IDE to work on the application (that I am also
> running as a standalone), and the IDE locks up for whatever reason...being
> busy or whatever. my standalone application also locks up (window
> become unresponsive).  As soon as the IDE is responsive again, so is my
> standalone window.
> 
> I have a 4 core machine...and nothing else seems to be locking up just
> the IDE and the standalone.
> 
> Why is the OS insisting on the 2 processes sharing a core?
> 
> Has anyone come across this before?
> 
> Happy Holidays and Merry Christmas to all those who celebrate it.
> 
> -- 
> Tom Glod
> Founder & Developer
> MakeShyft R.D.A (www.makeshyft.com )
> Office:226-706-9339
> Mobile:226-706-9793

___
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


Building Android Apps

2019-10-09 Thread Peter Reid via use-livecode
I've been building Android apps using my iMac for some time. However, yesterday 
I started to get an error message "Failure [INSTALL_FAILED_VERSION_DOWNGRADE]" 
when I try to build an Android standalone app. Any ideas what's causing this 
and how to fix it?

Separately I'd like to be able to build Android apps on my 15in MacBook Pro so 
I can do on-the-fly fixes when out and about. However I can't find up-to-date 
instructions for installing Android support. Some searches produce various 
suggestions including LiveCode tutorials about setting up a Mac to work with 
LiveCode and Android but they all seem to be out of date and contradict each 
other. In addition there's no advice for how to get to a clean state of Java 
and Android.

Can anyone point to up-to-date details for setting up a Mac to create Android 
apps with minimal installation of supporting technologies, both as a clean 
set-up and how to clean up JDK and SDK support if necessary?

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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: OT: Catalina - the end of ad hoc & in-house development?

2019-09-10 Thread Peter Reid via use-livecode
I've been reading the responses to my original posting with interest. My 
thoughts are as follows:

1. Matthias Rebbe's tutorial and helper stack seem to be excellent and appear 
to be the best way of complying with Apple's requirements, for now. Let's hope 
that Matthias can maintain this as Apple move the goalposts over time! If 
Matthias is unable to sustain these aids I'd hope that the LC mothership would 
adopt them.

2. A lot of the apps I develop are used by immediate friends and family (and a 
tiny circle of customers). They are private developments for use in closed 
communities. Apple have no right to be involved in these and the extended 
development cycle caused by their involvement is just unnecessary pain.

3. If Apple's measures really did provide bullet-proof protection the pain 
could be justified given the gain. However we know that this protection process 
is continuous and it becomes more and more onerous over time whilst still 
providing partial protection for a limited time.

4. If the Apple measures were a simple switchable setting I could switch them 
off whilst I check the user experience for a new user. Then I could switch the 
features back on to see the fully Apple-ised experience. As it is now, using 
the current Catalina beta on my development Mac, I see no blocking or warnings. 
So I've no way of testing the user experience on my development Mac. I have to 
find another Mac to act as my newbie user. Even then if such a Mac has been a 
previous newbie, how do you neutralise it to relive the newbie experience?

5. The $100 charge each year is inexcusable. Basically Apple are saying "We'll 
make any app development more tedious unless you pay up $100 every year.". Even 
the development of the simplest app, to be used as a temporary tool by a couple 
of friends will be blighted by warnings,  etc. if you don't pay $100 per year 
and jump through the hoops! Apple are deliberately making life more difficult 
and charging us $100 a year for the privilege!

6. I wonder how much developer time world-wide is wasted jumping through 
Apple's hoops, especially those developers without the benefit of LC and 
Matthias' tools?

7. If a new-to-LC developer wants to do the usual "Hello World" trivial 1st app 
(making an executable standalone app), they have to understand code-signing, 
notarising and stapling, DMG/ZIP creation and be signed/paid-up Apple 
developers.

Thanks to Matthias, you're a life/sanity saver, but I still find the prospects 
as an app developer rather depressing!

Peter
--
Peter Reid
Loughborough, UK


___
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


OT: Catalina - the end of ad hoc & in-house development?

2019-09-07 Thread Peter Reid via use-livecode
I've been using LiveCode as my development platform since 1999. Practically all 
the apps I've developed have been for in-house use by my family, friends and 
customers - all very low numbers of copies distributed in an informal manner. 
I've no interest in App Store distribution and the users of my apps trust me 
such that they do not need my apps to be "approved" by Apple. What's more 
important to them is how quickly I can release new apps and new versions of 
existing apps.

Up to and including macOS Mojave my users can run my apps with the minor 
inconvenience of having to right-click an app and approve its use, just once. 
With macOS Catalina, if I understand things, it's not so simple, instead these 
are the options:

1. Code-sign and notarise my apps – I'm not interested in this for my kind of 
apps which are essentially in-house/at home developments.

2. Using an active Internet connection, go through the right-click technique as 
now not just once, but EVERY time the app is opened.

In the past the 'Security & Privacy' General tab had a 3rd option for the 
setting 'Allow apps downloaded from:' which allowed you to install and use apps 
from any source. It seems that this is not possible with Catalina.

So with Catalina my users will need an Internet connection and will have to go 
through the right-click authorisation process every time they open one of my 
apps.

More seriously, it is becoming increasingly difficult to recommend the 
combination of the Mac plus LiveCode for app development. Up to now I've done 
all my app development on Mac+LC, even where the target platform is Windows or 
Android or Linux – I find it's simply faster, less error-prone and more 
pleasant with the Mac. However, from Catalina onwards even simple little 
utility apps, created for short-term use, will be tedious when opening or you 
have to learn about the complexity of code-signing and notarising and accept 
slower development cycles due to the need for Apple's approval!

This is quite depressing, especially since I abandoned iOS development due to 
Apple's distribution restrictions.

Back when the iPad 2 had just been released I developed for one of my customers 
an app to support health & safety audits for a national UK retail chain. The 
app took me 15 days to develop in total. As a result of being able to field a 
team of 10-20 staff with iPads running my app, my customer was able to carry 
out 350 half-day H audits for 3 years. However I was unable to roll-out this 
app to other customers as the ad hoc distribution method I was using was 
limited to 100 iPads per year and the App Store was not appropriate for this 
type of app.

As a result of the limitations Apple impose on tablet app distribution, 
recently I developed a speech-aid app just for small Android tablets and larger 
phones. I have not made an iOS app. This app is low volume (in terms of number 
of users) and requires significant personalising in order to be effective for 
its users (typically they are stroke victims). I chose to deliver the app on 
Android because of the facility to use developer mode and because of price – 
Android 7in tablet plus minimal add-ons: £80, Apple iPad plus add-ons: £320. 
Some of my users of this app already have an iPad but they are having to buy a 
cheap Android tablet. Like the Mac and Catalina, the iPad and iOS is driving 
away potential app developers due to Apple's rigid control of the delivery 
mechanisms.

Maybe I'm wrong, Catalina will be OK – if I am wrong, please correct me!

Regards

Peter
--
Peter Reid
Loughborough, UK


___
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


Using A Browser for TTS?

2019-01-06 Thread Peter Reid via use-livecode
A while ago I asked whether there was any way to do Text-To-Speech (TTS) for 
Android. Unfortunately there were no replies.  Since then I came across a 
browser JavaScript API that seems to provide speech synthesis:

Here's a sample HTML that plays through my default browser on my Mac:

-





TTS Generator



var u = new SpeechSynthesisUtterance();
u.text = '[PHRASE]';
u.lang = 'en-GB';
u.rate = [RATE];
u.name = "[VOICE]";
speechSynthesis.speak(u);


Generating speech for:
Hello, how are you?



-

The method is as follows:

1. Create an HTML file with the above content, replacing the [...] elements 
with specific text.

2. Use 'launch' to open the HTML file in the Android tablet's default browser 
(Firefox works well) that synthesises and plays the phrase:

launch url [path to HTML file]

3. Wait for speech to finish (I calculate an approx. duration based on the 
number of characters spoken)

4. Bring my app to the front or quit browser - DON'T KNOW HOW TO DO THIS!

Note that I tried using a browser widget to play the HTML/phrase but it is 
silent on the Android tablet (it speaks OK on the Mac).

My questions are:

Q1. Is there a simpler way of getting TTS for Android?

Q2. How can I make my app the front app and/or how can I quit another app?

Q3. How can I get the list of voices available on an Android tablet?

Q4. When will LiveCode fully support TTS and STT across Mac, Win, iOS and 
Android?!

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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


FYI: How to reliably identify an Android Tablet microSD Card

2018-12-19 Thread Peter Reid via use-livecode
FYI

I've managed to put together some code that reliably locates the microSD card 
in 4 very different Android-based tablets. The approach involves 3 different 
methods:

1. Search for a known folder on the SD card starting in the standard "/mnt" 
folder using a breadth-first search strategy.

2. Search for a known folder on the SD card starting in the less standard 
"/storage" folder using a breadth-first search strategy.

3. Search for a known folder using full paths that are used by specific 
manufacturers. These look as though they should be located by method 1. (they 
are all paths from "/mnt") but sometimes fail 1. however they work if the full 
path is specified!

Here's my code for "findSDcard"...



on findSDcard
   constant \
  cSDcardRoot1 = "/mnt/ext_sdcard/Android/data/com.myorg.myapp/files", \
  cSDcardRoot2 = "/mnt/sdcard2/Android/data/com.myorg.myapp/files", \
  cSDcardRoot3 = "/mnt/m_external_sd/Android/data/com.myorg.myapp/files", \
  cSDcardRoot4 = "/mnt/sdcard/Android/data/com.myorg.myapp/files", \
  cSDcardRoot5 = "/mnt/extSdCard/Android/data/com.myorg.myapp/files", \
  cSDcardRoot6 = "/mnt/external_sd/Android/data/com.myorg.myapp/files", \
  cSDcardRoot7 = "/mnt/SDCard/Android/data/com.myorg.myapp/files"
  
global gDataPath -- /myapp-data
global gSDcard -- path to app's data folder

   set wholeMatches to true
   put empty into gSDcard
   put (char 2 to -1 of gDataPath) into tTargetFolderName
   if the platform is "android" then
  put "/mnt" into tDeviceRoot
  if there is a folder tDeviceRoot then
 -- search in standard /mnt folders:
 put empty into tFoundPath
 folderExists tTargetFolderName, tDeviceRoot, tFoundPath
 if tFoundPath is not empty then
put tFoundPath into gSDcard
 end if
  end if
  if gSDcard is empty then
 -- try non-standard /storage folders:
 if there is a folder "/storage" then
-- search in non-standard /storage folders:
put "/storage" into tDeviceRoot
put empty into tFoundPath
folderExists tTargetFolderName, tDeviceRoot, tFoundPath
if tFoundPath is not empty then
   put tFoundPath into gSDcard 
end if
 end if
  end if
  if gSDcard is empty then
 -- try bespoke SD locations:
 if there is a folder cSDcardRoot1 then
put cSDcardRoot1 into gSDcard-- Huawei
 else if there is a folder cSDcardRoot2 then
put cSDcardRoot2 into gSDcard-- Amazon
 else if there is a folder cSDcardRoot3 then
put cSDcardRoot3 into gSDcard-- Lenovo
 else if there is a folder cSDcardRoot4 then
put cSDcardRoot4 into gSDcard-- Fusion
 else if there is a folder cSDcardRoot5 then
put cSDcardRoot5 into gSDcard-- ??
 else if there is a folder cSDcardRoot6 then
put cSDcardRoot6 into gSDcard-- ??
 else if there is a folder cSDcardRoot7 then
put cSDcardRoot7 into gSDcard-- Hudl?
 end if
  end if
   end if
end findSDcard

on folderExists pFolderName, pRootPath, @pFoundPath
   constant cNoDotsRegex = "^\..*"
   
   -- breadth-first search for a given folder
   put empty into pPath
   if there is a folder pRootPath then
  put empty into tSubFolders
  put folders(pRootPath) into tFolderList
  filter lines of tFolderList without regex cNoDotsRegex
  repeat for each line tFolder in tFolderList
 if tFolder = pFolderName then
-- found it:
put pRootPath into pFoundPath
exit folderExists
 else
-- add sub-folder to list for checking:
put pRootPath & "/" & tFolder & return after tSubFolders
 end if
  end repeat
  if tSubFolders is empty then
 exit folderExists
  end if
  repeat for each line tSubFolder in tSubFolders
 folderExists pFolderName, tSubFolder, pFoundPath
 if pFoundPath is not empty then
exit folderExists
 end if
  end repeat
   end if
end folderExists



Note that the above was necessary because specialFolderPath("external 
documents") doesn't work reliably across the 4 Android-based tablets I'm trying 
to support.

If anyone has a more elegant or succinct method, please let me know.  In the 
meantime you're welcome to use the above code.

Peter
--
Peter Reid
Loughborough, UK

> On 28 Nov 2018, at 11:49am, Peter Reid  wrote:
> 
> I've got an app running on an Android 8.1 7in tablet which uses a microSD 
> card for its RW data storage. I've tried using:
> 
>   specialFolderPath("external documents")
> 
> which the docs describe as follows:
> 
>   • "external documents": The folder on the primary shared/external 
> storage device where application-specific data can be placed
> but this doesn't point to 

Android Text-To-Speech?

2018-12-18 Thread Peter Reid via use-livecode
Has anyone got a way of doing text-to-speech for Android? We have revSpeak for 
desktop/laptop but not for Android deployment. Any solutions please?

Peter
--
Peter Reid
Loughborough, UK


___
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


How to reliably identify an Android Tablet microSD Card

2018-11-28 Thread Peter Reid via use-livecode
I've got an app running on an Android 8.1 7in tablet which uses a microSD card 
for its RW data storage. I've tried using:

specialFolderPath("external documents")

which the docs describe as follows:

• "external documents": The folder on the primary shared/external 
storage device where application-specific data can be placed
but this doesn't point to the microSD.

Instead I'm having to try to pause the app and then search around for the 
microSD.  So far I've found 7 different locations for the microSD, depending on 
the model of tablet:

1. /mnt/ext_sdcard/Android/data/com.reidit.myapp/files

2. /mnt/sdcard2/Android/data/com.reidit.myapp/files

3. /mnt/m_external_sd/Android/data/com.reidit.myapp/files

4. /mnt/sdcard/Android/data/com.reidit.myapp/files

5. /mnt/extSdCard/Android/data/com.reidit.myapp/files

6. /mnt/external_sd/Android/data/com.reidit.myapp/files

7. /mnt/SDCard/Android/data/com.reidit.myapp/files

where the ../files folder is located in the microSD filing system as follows:

/Android
/data
/com.reidit.myapp
/files

Whenever I try to install my app on a different Android tablet, I have to go 
hunting for the exact filing system for the 1st part of the microSD:

/mnt//

The tail of /Android/data/com.reidit.myapp/files seems to be consistent. It 
seems that the only variable is the  part.

However, I have 2 tablets (Android 5.1 and Android 8.1) where I haven't been 
able to locate the microSD card at all!

Any suggestions about how to reliably locate the microSD card in an Android 
tablet?

Peter
--
Peter Reid
Loughborough, UK


___
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

Reading PDF Form Data in LiveCode?

2018-10-10 Thread Peter Reid via use-livecode
Does anyone have any code or suggestions for reading the data from PDF forms? I 
have several hundred form fields in 5 different design forms in PDF format that 
I need to extract. The data is mainly text fields but may include a few 
checkboxes and radio buttons. Any thoughts please?

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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


Android text-to-Speech?

2018-08-31 Thread Peter Reid via use-livecode
Does anyone have a way of converting text to speech for Android, i.e. the 
equivalent to revSpeak for Android (& iOS)?

I came across a suggestion that involved Google's translation service but this 
doesn't seem to work now and I'd prefer it if I didn't have to use a Google 
service.

revSpeak works for Mac and Windows, it's a pity that it doesn't work for 
Android and iOS.

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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


Emergency Help?

2018-05-03 Thread Peter Reid via use-livecode
Hi

What's the news about Sean, has anyone made contact with him and has he 
accepted the help?  I'm asking as I'm about to make a donation and I'd like to 
be sure that this will get through to him before I proceed.

Thanks

Peter
--
Peter Reid
Loughborough, UK

> On 2 May 2018, at 7:37pm, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 10
> Date: Wed, 2 May 2018 19:14:10 +0100
> From: Lagi Pittas >
> To: How to use LiveCode  >
> Subject: Re: URGENT: MergGoogle no longer works on iOS: CLIENTS VERY
>   UNHAPPY
> Message-ID:
>    >
> Content-Type: text/plain; charset="UTF-8"
> 
> Hi All
> 
> I have set it up - but I want to have the money go directly to Sean
> 
> Ive just read that if I put seans email address in it will send him an
> invite so he will be the only one able to withdraw funds.
> 
> I am waiting his acceptance but I think we can add to it without him
> accepting -I HAVE NO WAY OF WITHDRAWING MONEY FROM THIS ACCOUNT.
> 
> 
> https://www.gofundme.com/scemergency 
> 

___
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: Stupid Question Again - Proportional Scaling

2018-03-18 Thread Peter Reid via use-livecode
nd preOpenStack
> 
> I'm probably missing something obvious, but can anyone help please?!
> 
> Thanks
> 
> Peter
> --
> Peter Reid
> Loughborough, UK
> 
> --
> 
> Message: 10
> Date: Sun, 18 Mar 2018 01:04:19 -0500
> From: "J. Landman Gay" <jac...@hyperactivesw.com>
> To: How to use LiveCode <use-livecode@lists.runrev.com>
> Subject: Re: Stupid Question Again - Proportional Scaling
> Message-ID: <82c5cec5-1b64-6690-60e0-dfce7a178...@hyperactivesw.com>
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> On 3/17/18 12:14 PM, Peter Reid via use-livecode wrote:
>> I have a sub-stack that contains an image.  I want the user to be able
>> to drag the corners and edges of the sub-stack window to make the window
>> and its image larger or smaller, but the window and image must maintain
>> their original aspect ratio ? no stretching, no empty borders etc.
> 
> 
> I wish we had a way to determine when a stack resize is finished. The 
> best I could do is run a "send" loop to check the mouse state. Maybe 
> someone else knows a better way. It doesn't seem possible to change the 
> stack size within a resizeStack handler, which makes sense, so the 
> adjustment has to be done afterward.
> 
> I think this sort of does what you want, but there's a "snap" at the end 
> when the stack adjusts to the new image size. It accomodates images of 
> any orientation.
> 
> 
> constant kImgName = "coinSet"
> 
> on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
>   put the formattedWidth of img kImgName into tFWidth
>   put the formattedHeight of img kImgName into tFHeight
>   if tFHeight > tFWidth then
> resizeToHeight tFHeight,tFWidth
>   else
> resizeToWidth tFHeight,tFWidth
>   end if
>   checkResizeDone
> end resizeStack
> 
> on resizeToHeight tOrigImgHeight,tOrigImgWidth
>   put the height of this cd/tOrigImgHeight  into tRatio
>   put (tOrigImgWidth * tRatio) into tNewWidth
>   put (tOrigImgHeight * tRatio) into tNewHeight
>   set the rect of img kImgName to 0,0,tNewWidth,tNewHeight
> end resizeToHeight
> 
> on resizeToWidth tOrigImgHeight,tOrigImgWidth
>   put the width of this cd into tW
>   put tW/tOrigImgWidth into tRatio
>   put (tOrigImgWidth * tRatio) into tNewWidth
>   put (tOrigImgHeight * tRatio) into tNewHeight
>   set the rect of img kImgName to 0,0,tNewWidth,tNewHeight
> end resizeToWidth
> 
> on checkResizeDone
>   if the mouse is up then
> set the rect of this stack to \
>   (globalLoc(the topleft of img kImgName) & globalLoc(the 
> bottomright of img kImgName))
>   else
> send "checkResizeDone" to me in 100 milliseconds
>   end if
> end checkResizeDone
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> --
> 
> Message: 11
> Date: Sun, 18 Mar 2018 07:13:55 +0100
> From: hh <h...@hyperhh.de>
> To: use-livecode@lists.runrev.com
> Subject: Re: Stupid Question Again - Proportional Scaling
> Message-ID: <b74d143d-82b2-4198-98f3-acd5dc38f...@hyperhh.de>
> Content-Type: text/plain; charset=us-ascii
> 
> For proportional resizing a stack window
> hold the shiftkey down when resizing.
> 
> --
> 
> Message: 12
> Date: Sun, 18 Mar 2018 07:26:05 +0100
> From: hh <h...@hyperhh.de>
> To: use-livecode@lists.runrev.com
> Subject: Re: Stupid Question Again - Proportional Scaling
> Message-ID: <5be02282-3168-480e-8675-f45458671...@hyperhh.de>
> Content-Type: text/plain; charset=us-ascii
> 
> [Sorry lost above half of my answer.]
> 
> You could try the following with user's interaction:
> 
> For proportional resizing a stack window
> hold the shiftkey down when resizing.
> 
> And in card's script add
> 
> on resizestack w,h
>  set rect of img 1 to (0,0,w,h)
> end resizestack
> 
> --
> 
> Message: 13
> Date: Sun, 18 Mar 2018 02:11:10 -0500
> From: "J. Landman Gay" <jac...@hyperactivesw.com>
> To: How to use LiveCode <use-livecode@lists.runrev.com>
> Subject: Re: Stupid Question Again - Proportional Scaling
> Message-ID: <baf88d2c-d354-6dec-b1ca-98c2912f8...@hyperactivesw.com>
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> On 3/18/18 1:26 AM, hh via use-livecode wrote:
>> [Sorry lost above half of my answer.]
>> 
>> You could try the following with user's interaction:
>> 
>> For proportional resizing a stack window
>> hold the shiftkey down when resizing.
>> 
>> And in card's script add
>> 
>> on resizestack w,h
>>   set rect of img 1 to (0,0,w,h)
>> end resizestack
> 
> If Peter doesn't mind instructing his users to use the shift key, this 
> would be a good solution.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com


___
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


Stupid Question Again - Proportional Scaling

2018-03-17 Thread Peter Reid via use-livecode
I know it's possible and I know it's simple really, but I can't remember 
it/figure it out!

I have a sub-stack that contains an image.  I want the user to be able to drag 
the corners and edges of the sub-stack window to make the window and its image 
larger or smaller, but the window and image must maintain their original aspect 
ratio – no stretching, no empty borders etc.  I've tried the following in the 
card script:

global gImageRatio

on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
   propSizeImage "coinSet", gImageRatio
   pass resizeStack
end resizeStack

on propSizeImage pImageName, @pImageRatio
   put the width of this stack into propWidth
   set the width of image pImageName to propWidth 
   put propWidth div pImageRatio into propHeight
   put the width of image pImageName into tWidth
   put the height of image pImageName into tHeight
   if propHeight > tHeight then
  put tHeight into propH
  put tHeight * pImageRatio into propW
   else if propHeight < tHeight then
  put propHeight into propH
  put propH * pImageRatio into propW
   else
  put tWidth into propW
  put tHeight into propH
   end if
   set the height of image pImageName to propH 
   set the width of image pImageName to propW 
   set the height of this stack to propH 
   set the width of this stack to propW
   set the topLeft of image pImageName to 0,0
end propSizeImage

with the following initialisation in the stack script:

global gImageRatio

on preOpenStack
   put the width of image "CoinSet" / the height of image "CoinSet" into 
gImageRatio
end preOpenStack

I'm probably missing something obvious, but can anyone help please?!

Thanks

Peter
--
Peter Reid
Loughborough, UK



___
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

Size of screen diagonal?

2018-02-28 Thread Peter Reid via use-livecode
I'm developing a desktop app for Mac & PC that displays photos of coins. I'd 
like to display them at real size but I can't find the properties for the 
current screen (i.e. the one that my app is running on.  I can get the screen 
colour depth, resolution, scaling factor, etc. but not the physical size on the 
screen such as "27 inch diagonal" or physical px per inch.

Can anyone tell me how to get this info, either using just LiveCode or via 
Mac/PC shell/command scripts?

Thanks

Pete
--
Peter Reid
Loughborough, UK


___
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: Problem pasting from Livecode to Mac Mail

2018-01-12 Thread Peter Reid via use-livecode
Sorry, forgot to change Subject in previous posting...

Hi Richard

I found this problem was particularly annoying when trying to extract info from 
vCards exported from Contacts on the Mac, so I developed a tiny app in LC 
called vCardClipper.

I've put together a web page about this app together with download links to a 
Mac App and the source code.  Here's the link to this web page, help yourself:

https://www.reid-it.co.uk/downloads/downvcclip.htm

The key is to paste HTML format text into Mail replacing RETURN with "" and 
replacing spaces with "". The code is in the following handler (which is 
in the stack script):

on loadClipboard pPlainText, pPasteMode
   -- pPasteMode: HTML or text
   set itemDelimiter to "."
   put item 1 of the version into tLCversion
   lock the clipboard
   if tLCversion >= "8" then
  -- for LC 8.x or later:
  set the fullClipboardData to empty
  switch pPasteMode
 case "HTML"
put pPlainText into tHTMLtext
replace return with "" in tHTMLtext
replace space with "" in tHTMLtext
set the fullClipboardData["HTML"] to "" & tHTMLtext & ""
break
 case "text"
set the fullClipboardData["text"] to pPlainText
break
  end switch
   else
  -- for LC 7.x or earlier:
  switch pPasteMode
 case "HTML"
put pPlainText into tHTMLtext
replace return with "" in tHTMLtext
replace space with "" in tHTMLtext
set the clipboardData["HTML"] to "" & tHTMLtext & ""
break
 case "text"
set the clipboardData["text"] to pPlainText
break
  end switch
   end if
   unlock the clipboard
end loadClipboard


Peter
--
Peter Reid
Loughborough, UK

> On 10 Jan 2018, at 9:38am, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 5
> Date: Tue, 9 Jan 2018 10:09:51 -0800
> From: Richard Burkett 
> To: use-livecode@lists.runrev.com
> Subject: Problem pasting from Livecode to Mac Mail
> Message-ID: 
> Content-Type: text/plain; charset=utf-8
> 
> Does anyone have a solution to this problem: I set the clipboard in LiveCode 
> to the text of a field or variable that has returns after each line. When I 
> paste that into Mac Mail, the text appears double-spaced as if it has two 
> returns, but clearly there is just one (or a combination of CR and LF?). I?ve 
> tried all the keys for setting the clipboard and also writing a script to 
> delete line feeds, or CR characters, but nothing works. It?s either no 
> returns, or what appears to be double-spaced returns. 
> 
> If I paste the text first into Text Edit, then copy it, and paste into Mac 
> Mail it?s fine - single line spacing. What?s LiveCode adding to each line 
> that causes Mac Mail to show the pasted text as double spaced? Is there a way 
> to filter/remove that?
> 
> Richard Burkett
> richard.burk...@sbcglobal.net



___
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: use-livecode Digest, Vol 172, Issue 19

2018-01-10 Thread Peter Reid via use-livecode
Hi Richard

I found this problem was particularly annoying, especially when trying to 
extract info from vCards exported from Contacts on the Mac, so I developed a 
tiny app in LC called vCard Clipper.

I've put together a web page about this app together with download links to a 
Mac App and the source code.  Here's the link to this web page, help yourself:

https://www.reid-it.co.uk/downloads/downvcclip.htm 


Peter
--
Peter Reid
Loughborough, UK

> On 10 Jan 2018, at 9:38am, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 5
> Date: Tue, 9 Jan 2018 10:09:51 -0800
> From: Richard Burkett  >
> To: use-livecode@lists.runrev.com 
> Subject: Problem pasting from Livecode to Mac Mail
> Message-ID:  >
> Content-Type: text/plain; charset=utf-8
> 
> Does anyone have a solution to this problem: I set the clipboard in LiveCode 
> to the text of a field or variable that has returns after each line. When I 
> paste that into Mac Mail, the text appears double-spaced as if it has two 
> returns, but clearly there is just one (or a combination of CR and LF?). I?ve 
> tried all the keys for setting the clipboard and also writing a script to 
> delete line feeds, or CR characters, but nothing works. It?s either no 
> returns, or what appears to be double-spaced returns. 
> 
> If I paste the text first into Text Edit, then copy it, and paste into Mac 
> Mail it?s fine - single line spacing. What?s LiveCode adding to each line 
> that causes Mac Mail to show the pasted text as double spaced? Is there a way 
> to filter/remove that?
> 
> Richard Burkett
> richard.burk...@sbcglobal.net 
___
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: Aphasia

2017-12-28 Thread Peter Reid via use-livecode
Hi David

Thanks for the feedback.  You may be right, I'm just going on the description 
given by the family.  As I've replied to Richmond, I'm not a medic.  
Nevertheless, I'll continue anyway as the family are very positive about it and 
how it helps them engage with the problem as a whole family. I don't really 
mind if the result is a placebo effect, just as long as the family feel it is 
of some benefit.

But you're correct in general, I should make sure I'm coding towards the 
correct target!

Peter
--
Peter Reid
Loughborough, UK

> Date: Thu, 28 Dec 2017 09:04:07 +
> From: David Glasgow 
> To: How to use LiveCode 
> Subject: "Aphasia" (was Re: use-livecode Digest, Vol 171, Issue 44)
> 
> Unfortunately, it is all rather more complicated than either Richmond or 
> Peter suggest. There are many more contributing areas than Brocas, and what 
> Peter describes doesn't appear to be aphasia at all, but rather a pathology 
> of semantics or word finding. 
> 
> It's not possible to be more specific without more information, and my advice 
> would be to speak with a neuropsychologist before coding. You could spend a 
> lot of time comparing wavs and coming up with a solution to the wrong 
> problem. 
> 
> Best wishes 
> 
> David Glasgow
> Sent from my iBrain via iFingers & iPad


___
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: Audio Processing in LiveCode

2017-12-28 Thread Peter Reid via use-livecode
Hi Richmond

My aim is to provide a trainer app to help the person improve their speaking 
(i.e. NOT 2 at this stage). This is what the family wanted and they (including 
the sufferer) are happy with its function and intended purpose so far.

However, I'm not a medic, so I accept what you say.  Nevertheless, I'll 
continue anyway as the family are very positive about it and how it helps them 
engage with the problem as a whole family. I don't really mind if the result is 
a placebo effect, just as long as the family feel it is of some benefit.

Thanks.

Peter
--
Peter Reid
Loughborough, UK

> Date: Thu, 28 Dec 2017 10:26:43 +0200
> From: Richmond Mathewson 
> To: How to use LiveCode 
> Subject: Re: use-livecode Digest, Vol 171, Issue 44
> 
> If we start to unpack your post we can come to a slightly simpler 
> conclusion than what you set out as your goal initially.
> 
> 1. Is your main idea to have a program where the device can "do the 
> talking" for the patient?
> 
> 2. As the "owner" of a 94 year old Mother-in-law who suffers from some 
> sort of selective dementia I realise that
> pointing out to her that her hallucinations are hallucinations (rather 
> than reality) is both an uphill struggle
> and causes her a lot of distress: oddly enough she's far happier inside 
> the comfort zone of her hallucinations.
> 
> If "Granny" suffers from Aphasia she has permanent damage in the Broca's 
> Area of her brain, normally due to
> a stroke: this cannot be sorted out, unfortunately.
> 
> She could, also, suffer from a type of dementia that has similar 
> symptoms to aphasia.
> 
> Doesn't really matter which; the end result is just as bad and bl**dy 
> awful for all concerned.
> 
> If you are going for #1 then there is absolutely no need for any 
> speech-recognition stuff or comparison
> between recorded sounds and those on the device.
> 
> Richmond.


___
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: Audio Processing in LiveCode

2017-12-28 Thread Peter Reid via use-livecode
Thanks Phil, I'm sorry to hear of Mark's demise.

I've grabbed Mark's libraries and will take a look at them for use in general, 
with acknowledgements as appropriate.

Peter
--
Peter Reid
Loughborough, UK

> Date: Wed, 27 Dec 2017 20:10:08 -0800
> From: Phil Davis <rev...@pdslabs.net>
> To: Peter Reid via use-livecode <use-livecode@lists.runrev.com>
> Subject: Re: use-livecode Digest, Vol 171, Issue 44
> 
> This Mark Smith was a list member who passed away in 2012. There is/was 
> another Mark Smith on this list after that.
> 
> Mark created several fine code libraries. We see inquiries here about 
> his stuff every now and then, so I just added a page to my web site 
> where you can download them:
> 
>http://www.pdslabs.net/the-mark-smith-collection/
> 
> If you have a lib of his that isn't listed on this page, please feel 
> free to forward it to me and I'll add it.
> 
> FWIW, my set includes his 'AudioWaveformMin1.0.rev.zip' file.
> 
> Phil Davis
> 


___
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: use-livecode Digest, Vol 171, Issue 44

2017-12-27 Thread Peter Reid via use-livecode
Hi Marc, Paul, Phil, Rick and Richmond

Thanks for your various thoughts.

To put a bit more flesh on this, here's what I'm developing and why...

In the first instance I'm doing this development for a friend who's grandmother 
suffers from aphasia (saying completely the wrong word).  The idea is that her 
family can put together sets of words where each word is spoken by the app 
whilst displaying a relevant picture and optionally a short video clip 
illustrating the correct mouth shape when saying the word.  The app displays 
the word in a very large font with a picture, then the app says the word (with 
the option to see a mouth shape video clip).  The user responds by trying to 
say the same word and (the thing I can't do yet!) the app gives the user a 
percentage score that represents how closely the user matched the sample word. 
If the user's score is above a variable threshold, the user sees a smiley face, 
otherwise a sad face!

I tried contacting Mark Smith as suggested by Paul but his email address 
m...@maseurope.net no longer works.

So far I have everything working apart from the comparison of 2 WAV files, in 
particular the following is working:

- the app checks for the presence of a micro SD card as the source of a 
collection of word packs
- a word pack consists of a collection of words in sound (WAV) and picture 
(JPG) form, optionally with supporting video clips (MP4)
- the app lets the user select a word pack at start up and loads the pack into 
RW file space
- the user taps a large arrow icon to go forwards/backwards through the chosen 
list of words
- for each word, the word is displayed in a large font at the top of the 
landscape screen, with its associated picture occupying the lower half of the 
screen
- as the word is displayed, it is spoken
- the user can tap a microphone icon and record their attempt at the word
- currently I simulate the comparison of the 2 WAV files
- the app gives a percentage score and displays a smiley or sad face accordingly

To be honest, my main aim is to help a friend.  At this stage I'm not looking 
beyond this, so licensing, etc. is not on the horizon at the moment.

Thanks again

Peter
--
Peter Reid
Loughborough, UK


___
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


Voice Comparison in LiveCode?

2017-12-27 Thread Peter Reid via use-livecode
i'm developing an app for cheap Android tablets (e.g. Amazon Fire 7in) that 
allows a user to practice speaking a set of words.  The app plays a sample of a 
word and the user then tries to say the same word.  So far the app can play 
sample words and capture the user's attempts for the same words.  The sample 
words and user attempts are uncompressed WAV files.

I'm trying to find the code to do the comparison of 2 WAV files.  Ideally, the 
code will be in the following formats (best first):

1. LiveCode
2. Pseudocode
3. Other code (Python, Java, C++ etc.)
4. Academic papers

I'm considering 2 general methods:

a. Compare 2 voice clips directly
b. Convert 2 voice clips to text (using voice-to-text) and then compare the 
words in text format

Note that Ali Lloyd from the LiveCode team has developed various things to 
help.  However I've hit problems as follows:

a. Ali has wrapped a standard Android sound library that compares 2 WAV files 
and gives a percentage match. However the comparison is either far too 
forgiving or far too strict, i.e. highly unreliable.

b. Ali has wrapped a standard Android voice-to-text library which works well 
with the devices he's tried it on.  However, the Amazon tablets do not support 
this Android library!

Given the two developments from Ali both relied on preformed blackbox code 
(Android Java libraries), i may have to implement a comparison algorithm from 
scratch. A solution that's completely in LiveCode would have several benefits:

i. it may work!
ii. it may work cross-platform
iii. it may be understandable!

General reading around this subject produces recommendations such as using FFTs 
(Fast Fourier Transforms), MFCCs (Mel Frequency Cepstral Coefficient), etc. but 
I can't find anything that gives an end-to-end method, from sound in to 
comparative score out!

Any help with this would be gratefully received!

Peter
--
Peter Reid
Loughborough, UK


___
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: Slow Opening IDE

2017-11-15 Thread Peter Reid via use-livecode
Hi Matthias

Brilliant, perfect diagnosis!  I've just added the log file to the exclusion 
list for Intego (didn't bother deleting it) and now LC opens instantly!!

This probably explains other slow opening issues with other apps, so it's 
really useful info.

Many thanks.

Peter
--
Peter Reid
Loughborough, UK

> On 15 Nov 2017, at 11:00am, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 13
> Date: Wed, 15 Nov 2017 11:13:56 +0100
> From: Matthias Rebbe <matthias_livecode_150...@m-r-d.de>
> To: How to use LiveCode <use-livecode@lists.runrev.com>
> Subject: Re: Slow Opening IDE
> Message-ID: <c33234d8-a8c9-4a89-a317-4b749e413...@m-r-d.de>
> Content-Type: text/plain; charset=utf-8
> 
> Hi Peter,
> 
> i noticed such behaviour also in the past. In my case it was the combination 
> of my Antivirus Software from Intego and a really big Livecode logfile
> ~/Library/Logs/RunRev/LiveCodeToolsLog.txt
> 
> Along with the files from /Applications/LiveCode X.X.X, there was a huge 
> amount of scans from my Antivirus Real-Time Scanner on this single file 
> during the opening of LiveCode applications:
> 
> Solution: I?ve excluded that file in my AV settings  from realtime scanning 
> and deleted that file.
> 
> Maybe this is cause also on your system, if you have AV software running. 
> 
> The problem is, this file is increasing its size with every start of 
> Livecode. My current file is now 32MB.
> 
> I?ve already reported this to the bugbase in May 2016  and it was confirmed. 
> bug 17748 <http://quality.livecode.com/show_bug.cgi?id=17748>
> 
> Regards,
> Matthias
> 
> 
>> Am 15.11.2017 um 10:43 schrieb Peter Reid via use-livecode 
>> <use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>>:
>> 
>> Please can anyone tell me how to reset LC to a clean startup state?
>> 
>> I use the Business Editions of LC 9,0,0-dp10, 8.1.7 and 8.8.1-rc1 on a Mac 
>> (10.12.6).  Recently opening LC has become much slower. Typically from 
>> initial click to open, until the splash pop-up is now taking several 
>> minutes.  Previously, this took considerably less than a minute.
>> 
>> This feels like a local settings/prefs problem as the problem only occurs in 
>> my normal account on the Mac - other accounts see the IDE appear relatively 
>> speedily.
>> 
>> I have tried throwing away as many prefs at I can find and I've tried clean 
>> installs and re-registring LC, but nothing seems to work.
>> 
>> Any ideas please?
>> 
>> Thanks
>> 
>> Peter
>> --
>> Peter Reid
>> Loughborough, UK
>> 


___
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


Slow Opening IDE

2017-11-15 Thread Peter Reid via use-livecode
Please can anyone tell me how to reset LC to a clean startup state?

I use the Business Editions of LC 9,0,0-dp10, 8.1.7 and 8.8.1-rc1 on a Mac 
(10.12.6).  Recently opening LC has become much slower. Typically from initial 
click to open, until the splash pop-up is now taking several minutes.  
Previously, this took considerably less than a minute.

This feels like a local settings/prefs problem as the problem only occurs in my 
normal account on the Mac - other accounts see the IDE appear relatively 
speedily.

I have tried throwing away as many prefs at I can find and I've tried clean 
installs and re-registring LC, but nothing seems to work.

Any ideas please?

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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


mobilePlaySoundOnChannel bug?

2017-11-04 Thread Peter Reid via use-livecode
I'm using LC 9.0.0-dp10 on a Mac to develop an app for an Android/Amazon Fire 7 
tablet (FireOS 5.1.x). As the app launches it prompts the user to select a set 
of files from the microSD card plugged into the tablet. The selected set of 
files are copied to the specialFolderPath("documents") area.  Some of these 
files are short sound clips that are played using the mobilePlaySoundOnChannel 
command. As and when required the user can trigger the initial prompt to select 
a different set of files from the microSD card.

If the user repeatedly chooses different sets of files, the app is OK as long 
as the mobilePlaySoundOnChannel is not run.  However, any use of this command 
leads to a filing system error! If I try to create new folders in the app 
having run the mobilePlaySoundOnChannel command, I get an error where the 
creation date of the new folder is January 1970 and I can't create files within 
such a folder. I end up having to close and re-open the app for it to work 
again.

With the mobilePlaySoundOnChannel command commented-out, the app runs fine 
(apart from the missing sound), with the user able to change sets of files as 
often as they want. With the mobilePlaySoundOnChannel command active, the app 
is OK until the user changes the set of files.  From then onwards 1 of the key 
folders has the above problem.  The files/folders are as follows:

set->
backups->
filea.html
fileb.html
filec.html
captures->
voice1.wav
voice2.wav
media->
filea.html
fileb.html
filec.html
pics->
pic1.jpg
pic2.jpg
sounds->
clip1.wav
clip2.wav

The only folder affected by the error is "sounds", all the other folders and 
files are created OK (as copies from the SD card). I've tried renaming "sounds" 
to "audio" and "audioClips", but it's always this folder with WAV files in it.

I've spent many hours chasing this problem, thinking it was an Android filing 
system issue. Only after thinking differently did I investigate and discover an 
absolute reproducible association with the mobilePlaySoundOnChannel command!

I found a previous bug report that may be relevant, which implies the problem 
was in LC 8.x.x and has been fixed. So I thought I'd try my app with LC 8.1.7 
STABLE.  Unfortunately my app requires an add-on developed by Ali LLoyd - 
Android Audio Recording which I can't get to compile within LC 8.1.7!! The 
specific compilation errors are:

5:03 PM: Error: on line 25 ():
5:03 PM: Error: on line 27 ():
5:03 PM: Error: /Users/peter/Documents/Android Audio Recordings/Android 
Audio Recordings
v3/androidaudiorecorder.lcb:25:1: error: Unable to find imported module 
'com.livecode.java'

/Users/peter/Documents/Android Audio Recordings/Android Audio 
Recordings v3/androidaudiorecorder.lcb:27:7:
error: Parsing error: syntax error

and I've no idea how to fix this!?

So, please can anyone either advise me how to work around the apparent 
mobilePlaySoundOnChannel command bug in LC 9 or advise me how I can fix the 
compilation error to try my app with LC 8.1.7?

Thanks for any help and thanks to others for related help given previously - I 
intend to summarise the collected solutions once I've got past this current 
show stopper.

Peter
--
Peter Reid
Loughborough, UK


___
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


Remote Debugger Frustrations

2017-10-31 Thread Peter Reid via use-livecode
How are people getting on with the remote debugger facility? I'm finding it 
very useful but also frustrating for the following reasons:

1. It's SLOW. I'm running LC 9 on an iMac with a 4GHz quad i7 processor and 
24GB RAM connected by USB to an Amazon Fire 7 tablet, yet each step through the 
script in the debugger takes several seconds.

2. It's difficult to stop to make changes. Clicking the stop debugging button 
often doesn't work or takes a long time to react and even when apparently 
stopped it's still making everything slow.

3. Often it steps through the script as it was just before the latest change, 
i.e. it doesn't take into account the latest script edits.

4. It can be difficult to change break points during remote debugging.

5. The only way that guarantees a clean run is to quit LC and start again.

6. A partial reset can be achieved by the following:
a. having clicked 'stop debugging'...
b. open & close Standalone Application Settings
c. click Test, which prompts for Save
d. click Save and the remote build & install starts
e. however, the above doesn't always recognise script changes.

I find the Remote Debugger to be very helpful. BUT, if only there was a quick 
reliable way of stopping, editing the script and continuing/restarting.  
Currently the run-check-edit-rerun cycle is far too slow and error prone using 
the remote debugger.

Any thoughts or advice from other users of the Remote Debugger?

Peter
--
Peter Reid
Loughborough, UK


___
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


Android Filing System using LC9

2017-10-30 Thread Peter Reid via use-livecode
I've investigated further the way the Android filing system seems to be 
available to LC 9.0.0-dp10. As I reported previously, I have found several 
anomalies.

Here's what I've found, (with my app being identified as "com.reidit.aphtrain" 
in the examples):

1. The internal storage area pointed to by specialFolderPath("engine") or 
specialFolderPath("resources") is Read-Only (RO) and contains any files & 
folder specified in Standalone settings to be included in the Copy Files 
section.  Specifically, the path returned by "engine"/"resources" is:

/data/app/com.reidit.aphtrain-2/base.apk

This can be accessed RO reliably and seems to be the correct behaviour.

2. The internal storage area pointed to by specialFolderPath("documents") is 
Read-Write (RW) and can be used as such. However, the path returned by 
"documents" is INCORRECT:

/data/data/com.reidit.aphtrain/files

The correct path should be:

/Android/data/com.reidit.aphtrain/files

If I replace the leading "data" with "Android", the path works fully with RW 
access.

3. If I pre-load files & folders onto a microSD card on my computer, I have to 
place them in a path such as:

/Android/com.reidit.aphtrain/

Such files & folders are Read-Only in the tablet and accessible using the 
following path:

/storage/sdcard1/Android/com.reidit.aphtrain/

It seems that Android 5 or later (FireOS 5 in my case) locks down SD cards. 
They used to be fully RW but are now treated as mainly RO apart from an area 
for the app to use. If I get the path from specialFolderPath("external 
documents"), the path gives me Read-Write access to the following area:

/storage/emulated/0/Android/data/com.reidit.aphtrain/files/

During the running of the app, the above path works fully for RW access but 
doesn't show any of the pre-loaded files & folders.  However, If I connect the 
microSD card to my computer again, this area is NOT VISIBLE!

In summary, we seem to have the following available in LC 9:

WHERE   SPECIAL ACCESS  TABLET? MAC?PATH
1. internal "engine"RO  Yes No  
/data/app/com.reidit.aphtrain-2/base.apk

2. internal "documents" RW  ERROR   No  
/data/data/com.reidit.aphtrain/files

3. internal "documents"*RW  Yes No  
/Android/data/com.reidit.aphtrain/files

4. external "external doc"  RW  Yes NO  
/storage/emulated/0/Android/data/com.reidit.aphtrain/files

5. external "external doc"* RO  Yes Yes 
/storage/sdcard1/Android/com.reidit.aphtrain

The result of the above is that it is difficult creating files & folders on the 
fly that you can get out of the tablet afterwards such that they can be read on 
a computer!

Can anyone confirm my findings and make recommendations?

Also, specialFolderPath("documents") seems to have a BUG as it delivers the 
wrong path (in LC 9.0.0-dp9/10).

Thanks

Peter


___
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


Android Filing System?

2017-10-27 Thread Peter Reid via use-livecode
Please can someone explain the Android filing system as seen by LC 9.  I'm 
developing an app that loads some files & folders with the app initially, but 
then changes some or all of this data.  In addition, the app will read and 
write files & folders to the SD card plugged into the Android tablet.

From the LC dictionary, I have the following:
-
An Android application is installed on the device as a ZIP package.
This means that any assets that are included are not available as separate 
files in the device's native file system. In order to manage this, LiveCode 
"virtualizes" the asset files you include, allowing read-only access with all 
the standard LiveCode file and folder handling commands and functions. To 
access the assets you have included with your application, use file names 
relative to specialFolderPath("engine").

The following folderIdentifier values are supported:

• "documents": The folder where application-specific data can be placed 
(typically valuable)
• "cache": The folder where transient application-specific data can be 
placed (typically not valuable)
• "temporary": Same as "cache"
• "engine": The (virtual) folder containing the application's LiveCode 
engine and other resources that were copied into the application at build time
• "resources": Same as "engine".
• "external documents": The folder on the primary shared/external 
storage device where application-specific data can be placed
• "external cache": The folder on the primary shared/external storage 
device where transient application-specific data can be placed
• "external temporary": same as "external cache"

Note: If using any external folderIdentifier values, ensure you have the 'Write 
External Storage' permission checked in the application standalone settings
-

The above implies that access to the internal filing system is read-only, even 
for the "documents" special folder and that the only filing system that I can 
write to is the external one on the SD card.  Is this correct?

I'm trying to carry out the following sequence of actions:

1. A collection of folders & files are setup in the internal filing system as 
part of the app ("documents" say).

2. The user can use the default folders & files created above, or they can 
choose a different set of folders & files to be copied from the SD card into 
the internal filing system, replacing some or all of the initial default set.

3. During general use of the app, the user will record their voice several 
times.  These recordings should be stored on both the internal and SD card 
filing systems.

What I'm finding is that my file and folder paths are not reliable and that 
most attempts to write anywhere fail due to being read-only.

Any help with this please?

Peter
--
Peter Reid
Loughborough, UK


___
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

Android Sound Capture in WAV format

2017-10-17 Thread Peter Reid via use-livecode
Since Ali got sound capture for Android working, I'm trying to see if it's 
possible to output the sound in WAV format instead of MP4 format. I'm trying to 
compare 2 sounds (1 prepared previously against 1 captured on the Android 
device) and it seems to be easier to compare them if they are both uncompressed 
WAV files.  Looking at the various parameters in the library, I can't see how 
to set it up to output in uncompressed WAV format. Here is the initialisation 
code I'm using:

androidRecorderSetRecordInput "Mic"
androidRecorderSetRecordCompressionType "AMR NB"
androidRecorderSetRecordFormat "ThreeGPP"

I can't see which alternatives for CompressionType (AMR NB) and Format 
(ThreeGPP) will give me uncompressed WAV files. Am I missing something or does 
the library need updating to support WAV (if this is possible)?

Peter
--
Peter Reid
Loughborough, UK

> On 16 Sep 2017, at 11:00am, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 1
> Date: Fri, 15 Sep 2017 11:53:17 +
> From: Ali Lloyd 
> To: How to use LiveCode 
> Subject: Re: Android Audio Playback & Recording
> Message-ID:
>   
> Content-Type: text/plain; charset="UTF-8"
> 
> Hi All,
> Firstly thanks to Peter Reid for discovering that the foreign bindings in
> that blog post were out of date! I have updated the blog accordingly. I
> took the liberty of tidying up the LCB code, and adding docs and a sample
> stack - you can check them out here (for now)
> https://github.com/livecode/livecode/pull/5941/files
> 
> The library should be included in 9.0 DP 9.
> 
> Cheers,
> Ali
> 


___
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


Comparing 2 Spoken words, FFT function in LiveCode?

2017-10-16 Thread Peter Reid via use-livecode
Does anyone know of an implementation of an FFT function written in LiveCode?  
I've tried joneslib but this doesn't include FFT. I'm hoping to use FFTs as 
part of my attempt to compare 2 short sound clips of people speaking a single 
word.  I'm trying to judge whether a single word spoken by 2 different people 
is the same word or not. Any advice or code that might help with this would be 
most welcome.

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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: use-livecode Digest, Vol 169, Issue 18

2017-10-12 Thread Peter Reid via use-livecode
I agree that the redundant indexing is an expensive approach, however I have 
found that this abnormal structure of a repeat for each loop can be a lot 
faster than the other loop forms in some circumstances.

I can't find the reference that first highlighted to me the lack of guaranteed 
sequence of chunks, but I've assumed this was a restriction for some time. It 
would be great if this is incorrect as I've got some heavyweight looping in 
several of my apps that would benefit from this!

Can anyone from LiveCode give a definitive answer to this please?

Peter
--
Peter Reid
Loughborough, UK

> On 12 Oct 2017, at 4:36pm, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 17
> Date: Thu, 12 Oct 2017 08:35:50 -0700
> From: Richard Gaskin 
> To: use-livecode@lists.runrev.com
> Subject: Re: Atkinson dither algorithm & 'for each' loop
> Message-ID: 
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> Peter Reid wrote:
> 
>> One note of caution regarding the use of the "repeat for each" loop,
>> whilst you will get a loop iteration for every value in the collection
>> (fldhexa3 in your example), you are not guaranteed the order in which
>> they will occur.
> 
> Maybe I misunderstand, but are you thinking of arrays there?
> 
> With string containers a "repeat for each" expression should parse from 
> beginning to end, sequentially.
> 
> Any exception to that would be prohibitively unpredictable, and should 
> be reported as a bug.
> 
> 
>> The following adjusted loop guarantees the sequence at the expense of
>> speed:
>> 
>>  put 1 into i
>>  repeat for each word theWord in fldhexa3
>> put word i of fldhexa3 into theWord
> 
> The speed lost there appears to be the result of a redundancy, and a 
> particularly expensive one:
> 
> We love the convenience of chunk expressions, but in loops we want to 
> remain mindful of "  of " because satisfying 
> such expressions will require the engine to start from the beginning of 
> the container, examine every character and counting delimiters, until it 
> reaches the number of such delimiters specified in "".
> 
> So the "repeat" line above parses the chunk value into theWord, but then 
> the next line ignores that that's already happened and reassigns the 
> same theWord value using an expression that requires then engine to 
> count words from the beginning of fldhexa3 each time through the loop.
> 
> 
> With this specific algo I believe there may be further benefits in using 
> a chunk type other than word (based on a a hunch derived from word 
> chunks being parsed more flexibly than items or lines), and perhaps not 
> converting the binary data to hex at all, instead parsing bytes directly 
> with a "step 4" option in the loop to keep track of the four components 
> that define each pixel.
> 
> -- 
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  
>  ambassa...@fourthworld.comhttp://www.FourthWorld.com


___
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 & 'for each' loop

2017-10-12 Thread Peter Reid via use-livecode
One note of caution regarding the use of the "repeat for each" loop, whilst you 
will get a loop iteration for every value in the collection (fldhexa3 in your 
example), you are not guaranteed the order in which they will occur.  This 
doesn't matter in a lot of cases but does matter when the sequence is 
significant.  In the case of your example I believe sequence is critical, 
otherwise the pixels might appear to be scrambled!

The following adjusted loop guarantees the sequence at the expense of speed:

  put 1 into i
  repeat for each word theWord in fldhexa3
 put word i of fldhexa3 into theWord
 put 00 & theword & theword & theword after tVar2
 add 1 to i
  end repeat

The original "improved" loop reduces the run-time to 25%.  However, the 
"modified improved" loop only manages to reduce the original run-time to 50%.

The suggested loop above takes advantage of the "for each" mechanism to produce 
a set of iterations very rapidly but gets slowed by the need to guarantee 
sequence. I wonder whether the LC engine could impose strict sequence more 
effectively with a variant of the "for each" loop such as

  repeat for each sequenced word x in theCollection
 ...
  end repeat

My own tests, comparing the speed of the 4 common repeat loops, imply that the 
current "for each" form is hugely faster than the others.  I tested "repeat for 
each...", "repeat while...", "repeat until...", "repeat with..." and a 
simulated "repeat for each sequenced..." forms using a simple loop body that 
added lines of text one after another, e.g.

  put empty into tData
  repeat with i = 1 to tMaxI
put line i of tList & return after tData
  end repeat

I ran this test for 250,000 iterations for each type of loop, which produced 
the following timings:

  Starting test for 250,000 iterations...
  repeat for each... 0 mins 0 secs 111 millisecs
  repeat while... 0 mins 30 secs 569 millisecs
  repeat until... 0 mins 30 secs 379 millisecs
  repeat with... 0 mins 30 secs 341 millisecs
  repeat for each seq... 0 mins 30 secs 524 millisecs

As you can see, in this test the "repeat for each..." form was approx. 275 
times faster than the other forms.  Also the simulated "repeat for each 
sequenced..." form was no faster than the other forms.  This shows how variable 
the speed will be with the simulated "repeat for each sequenced...", depending 
on the details of the loop body.

If there was a "repeat for each sequenced..." form of loop in LC, any speed-up 
could be very beneficial even if the amount of speed-up was only 10 times 
faster!

Cheers

Peter
--
Peter Reid
Loughborough, UK

> On 9 Oct 2017, at 10:18am, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 12
> Date: Sat, 7 Oct 2017 15:53:44 +0200
> From: Malte Pfaff-Brill 
> To: use-livecode@lists.runrev.com
> Subject: Re: Atkinson dither algorithm  
> Message-ID: <42023b36-0a4e-4251-bb0c-9cd46de55...@derbrill.de>
> Content-Type: text/plain; charset=us-ascii
> 
> 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


Wrapping Android Speech-to-Text?

2017-09-17 Thread Peter Reid via use-livecode
Having got Android speech input working, how easy would it be to do a similar 
thing to wrap Android's speech-to-text facility?  I understand that it uses an 
on-line link to Google's voice input resources, which would be great for a 
number of purposes. Obviously, off-line would be better still, but on-line 
seems to be straightforward from my understanding of the following:

https://www.androidhive.info/2014/07/android-speech-to-text-tutorial/

I don't have the knowledge to take the above and wrap it for LC use, is anyone 
on the list able to do this?

Note that there's an equivalent tutorial for the reverse process, 
text-to-speech:

https://www.androidhive.info/2012/01/android-text-to-speech-tutorial/

How great would it be to build apps with LC that can communicate by voice (at 
least for Android devices)?!

Thanks

Peter
--
Peter Reid
71 Leconfield Road, Loughborough, Leics. LE11 3SP, UK
Tel: +44 (0)1509 268843
Mobile/Cell: 07778 632533
Email: pe...@reidit.net

> On 16 Sep 2017, at 11:00am, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 1
> Date: Fri, 15 Sep 2017 11:53:17 +
> From: Ali Lloyd 
> To: How to use LiveCode 
> Subject: Re: Android Audio Playback & Recording
> Message-ID:
>   
> Content-Type: text/plain; charset="UTF-8"
> 
> Hi All,
> Firstly thanks to Peter Reid for discovering that the foreign bindings in
> that blog post were out of date! I have updated the blog accordingly. I
> took the liberty of tidying up the LCB code, and adding docs and a sample
> stack - you can check them out here (for now)
> https://github.com/livecode/livecode/pull/5941/files
> 
> The library should be included in 9.0 DP 9.
> 
> Cheers,
> Ali



___
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: Android Audio Playback & Recording

2017-09-13 Thread Peter Reid via use-livecode
Hi Al

Thanks for the link, I had seen it previously but didn't understand how I could 
incorporate it into my app!  I've no experience with code-wrapping or creating 
lcb widgets, so I can't see how I proceed with what looks like a solution!!  
Any help, in simple steps, gratefully received.

Also, thanks for the links regarding the hard bit of comparing sounds. I've 
been thinking of doing this a different way, if possible - voice-to-text and 
then compare the text with the target text using some fuzzy matching. This 
could be another hard thing of course??

By the way (thanks BR) I did get the mobilePlaySoundOnChannel to work after 
fixing some code stupidity on my part. So I can play the clips OK.

Peter
--
Peter Reid
Loughborough, UK

> On 13 Sep 2017, at 11:00am, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 8
> Date: Tue, 12 Sep 2017 11:44:49 -0400
> From: Alejandro Tejada 
> To: use-livecode@lists.runrev.com
> Subject: Re: Android Audio Playback & Recording
> Message-ID:
>   

Re: Android Audio Playback & Recording

2017-09-12 Thread Peter Reid via use-livecode
Hi BR

More specifically, I'm developing an app to help aphasia sufferers to practice 
their pronunciation of simple everyday words.  The idea is that they will see 
the word in a large text size together with a picture to reinforce the meaning 
of the word.  They will hear the word pronounced by the tablet and then attempt 
to say the word themselves.  They will be able to repeatedly try to say the 
word until they get it right.

I have the basic UI flow working and I've written the app such that it consists 
of a companion app for the Mac/PC that loads the media (list of words, list of 
pictures and list of related sound clips) into background cards and custom 
properties.  The idea is that I can have a small collection of files & folders 
that become absorbed into the app by running it in the development environment 
prior to generating an APK for uploading into the tablet.  This way the app is 
self-contained, with flexible media already prepared for use.  This is working 
as well as the UI.

I have the following left to do in order to complete this app and get a copy 
delivered (pre-installed on a Fire 7 tablet) to an elderly relative of a friend:

1. Find a way of getting the Fire/Android to play an arbitrary sound clip 
(typically less than 2-3 secs). I've gone for WAV format initially but I can 
easily make them something else (MP3, AAC, OGG, etc). ANY IDEAS for this?

2. Find a way of getting the Fire/Android to record the sufferer's speech 
(probably less than 5-10 secs). ANY IDEAS for this?

3. Figure out how to compare the two sound clips (sample against user), or 
convert the user speech input into text for comparison with the original Word. 
Again, any good ideas would be welcome, but I'm prepared to do a bit of general 
research about this.

Points 1. and 2. above are potential showstoppers as the lack of either one 
stops this project in its tracks! Point 3. above still needs doing, but there 
are various ways of tackling this.

Thanks for any help with this.

Peter
--
Peter Reid
Loughborough, UK

> On 12 Sep 2017, at 11:00am, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 3
> Date: Tue, 12 Sep 2017 03:27:35 +
> From: Sannyasin Brahmanathaswami <bra...@hindu.org>
> To: How to use LiveCode <use-livecode@lists.runrev.com>
> Subject: Re: Android Audio Playback & Recording
> Message-ID: <ec9ea6ae-9a3c-40d5-8b2a-53f5ec255...@hindu.org>
> Content-Type: text/plain; charset="utf-8"
> 
> Aloha Peter
> 
> 
> I think we also want ot have the voice recognition option here so that we 
> could record short notes, or issue commands 
> 
> Maybe that is OT for your use case, but  I have some users interest in this.  
> 
> BR
> 
> 
> 
> On 9/10/17, 11:06 AM, "use-livecode on behalf of Peter Reid via use-livecode" 
> <use-livecode-boun...@lists.runrev.com on behalf of 
> use-livecode@lists.runrev.com> wrote:
> 
>Hi,
> 
>I'm making an app for Android in the form of an Amazon Fire 7 tablet (2017 
> version).  I'm doing the development with LC 9-dp8 and a Mac running macOS 
> 10.12.6.
> 
>A key part of this app requires the user to say a word or two, which will 
> be recorded by the tablet and saved for subsequent comparison with a speech 
> fragment played earlier.  What I'm looking for is the way to include the 
> output of a word or short phrase, as spoken text; followed by speech input 
> from the user, and then compared with the original speech recorded previously.
> 
>Andy suggestions please?
> 
>Thanks.
> 
>Peter
>--
>Peter Reid
>Loughborough, UK
> 
> 


___
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


Android Audio Playback & Recording

2017-09-10 Thread Peter Reid via use-livecode
Hi,

I'm making an app for Android in the form of an Amazon Fire 7 tablet (2017 
version).  I'm doing the development with LC 9-dp8 and a Mac running macOS 
10.12.6.

A key part of this app requires the user to say a word or two, which will be 
recorded by the tablet and saved for subsequent comparison with a speech 
fragment played earlier.  What I'm looking for is the way to include the output 
of a word or short phrase, as spoken text; followed by speech input from the 
user, and then compared with the original speech recorded previously.

Andy suggestions please?

Thanks.

Peter
--
Peter Reid
Loughborough, UK



___
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: Deploying to Android (Amazon Fire 7)

2017-09-05 Thread Peter Reid via use-livecode
Hi Jonathan, Colin & Jacqueline

Thanks for the various suggestions.

On my Mac, I have installed the Java SDK 8.144 and Android Studio 2.3.3 
together with Android File Transfer.  In LC 8.1.6 I have set up the reference 
to the Android SDK (/Users/peter/Library/Android/sdk/).  On my Amazon Fie 7 
tablet, I have enabled Developer mode and EDB debugging.

With this set-up I am able to build an APK app package and copy the APK to the 
Downloads folder on the tablet.  If I tap open the APK file it offers to 
install it, with 2 apparently active buttons - Cancel and Install (both in the 
same colour orange text). The screen correctly list the facilities the app will 
need access to.  However, only the Cancel responds to a tap, the Install does 
nothing and says nothing!

Any suggestions as to how I get over this last hurdle?

Thanks

Peter
--
Peter Reid
Loughborough, UK

> Message: 1
> Date: Tue, 5 Sep 2017 09:35:57 -0700
> From: Colin Holgate 
> To: How to use LiveCode 
> Subject: Re: Deploying to Android (Amazon Fire 7)
> Message-ID: <189a5025-6c44-46b3-990c-b03d810e8...@gmail.com>
> Content-Type: text/plain; charset=utf-8
> 
> I don?t know for sure if it?s still needed, but here are the steps I wrote 
> about, that were needed back then, to add Kindle Fire to ADB:
> 
> https://books.google.com/books?id=9lpx4JbMDrQC=PT120=PT120=colin+holgate+0x1949=bl=rPkJGT8NQf=PNo6PCRI1Hfl4d65-UTgRbpAgXg=en=X=0ahUKEwis1LjVvI7WAhVHw2MKHUPCBhMQ6AEIPjAF#v=onepage=colin%20holgate%200x1949=false
> 
> When that loads you may need to scroll up a few lines to the start of that 
> section.
> 
> --
> 
> Message: 10
> Date: Tue, 05 Sep 2017 12:25:31 -0500
> From: "J. Landman Gay" 
> To: How to use LiveCode 
> Subject: Re: Deploying to Android (Amazon Fire 7)
> Message-ID:
>   <15e53135af8.285b.5e131b4e58299f54a9f0b9c05d4f0...@hyperactivesw.com>
> Content-Type: text/plain; format=flowed; charset="us-ascii"
> 
> If you don't want to install Android File Transfer you can also use a cloud 
> service like Dropbox to move the apk to the device.
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com


>> Message: 1
>> Date: Tue, 5 Sep 2017 06:22:45 -0400
>> From: jonathandly...@gmail.com
>> To: How to use LiveCode 
>> Cc: Peter Reid 
>> Subject: Re: Deploying to Android (Amazon Fire 7)
>> Message-ID: <2b51de3a-c7c7-4db1-b18b-31e2bed3b...@gmail.com>
>> Content-Type: text/plain;charset=us-ascii
>> 
>> Hi Peter,
>> 
>> Are you able to produce the android standalone file?
>> 
>> I just copy that file to my android device and click on it to install it. I 
>> find it much easier than iOS.
>> 
>> Sent from my iPhone
>> 
>> --
>> 
>> Message: 2
>> Date: Tue, 5 Sep 2017 07:11:43 -0400
>> From: jonathandly...@gmail.com
>> To: How to use LiveCode 
>> Cc: Peter Reid 
>> Subject: Re: Deploying to Android (Amazon Fire 7)
>> Message-ID: <9e9ed30d-70c1-4185-8fe2-a7906d8fd...@gmail.com>
>> Content-Type: text/plain;charset=us-ascii
>> 
>> A few more pointers:
>> 
>> You need to have Android File Transfer installed on your Mac.
>> 
>> You need to put the android device into developer mode. You can find 
>> instructions for this online.
>> 
>> When you connect the device to a Mac you need to go into the settings in 
>> Android and change the setting for the connection from charging to file 
>> transfer.
>> 
>> After you are in developer mode and after you have set it to allow file 
>> transfers, drag the Android standalone file from your Mac finder app into a 
>> convenient folder in the Android File Transfer app.
>> 
>> In the Android device, open up the Amy Files app and click on the file you 
>> transferred. This will install the app. You can run it from there.
>> 
>> Sent from my iPhone
>> 
>> --
>> 
>> Message: 3
>> Date: Tue, 5 Sep 2017 07:14:06 -0400
>> From: jonathandly...@gmail.com
>> To: How to use LiveCode 
>> Subject: Re: Deploying to Android (Amazon Fire 7)
>> Message-ID: <84561ba2-5cfc-458e-8a71-4aab28c33...@gmail.com>
>> Content-Type: text/plain;charset=us-ascii
>> 
>> That last paragraph should say "My Files app" not "Amy Files app"
>> 
>> Sent from my iPhone
>> 

___
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


Deploying to Android (Amazon Fire 7)

2017-09-05 Thread Peter Reid via use-livecode
OK, I've been round the various circles (Lessons, Forum trails, etc.) but I'm 
completely confused!

On my Mac, I've tried installing Java SDK 8.144, Android Studio 2.3.3 and set 
up LC 8.1.6 to point at the Android root.  However, I can't see how I get to 
specify an Android device - a previous Android SDK had menu options for this, 
but the Studio doesn't seem to offer this without diving into a new project.

I'm a simple animal who needs a straightforward list of things to do in 
sequence.  I'm trying to do the following:

1. For me, install whatever I need to be able to develop Android apps on my Mac 
(macOS Sierra 10.12.6), with LiveCode 8.1.6 Business. 
2. For a friend running Windows 7 64-bit, install whatever they need to be able 
to develop Android apps with LiveCode 8.1.6 Community.

In both cases, the target device is the latest spec. Amazon Fire 7 Tablet 
(2017).  For my friend, this is their 1st go at programming and I've persuaded 
them to try LiveCode, with me setting it up for them and providing tutoring 
support.  Between us, we're hoping to develop a very simple app to help aged 
relatives and friends.

LiveCode emphasises ease and speed of development, which I agree with over the 
18 years I've used it (almost completely desktop/laptop developments).  
However, getting set up for mobile development is confusing, tedious and 
tortuous!

Please can someone give me 2 step-by-step guides for these 2 development 
facilities.

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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


Setting LD_LIBRARY_PATH

2017-04-16 Thread Peter Reid via use-livecode
Has anyone successfully set the environment variable LD_LIBRARY_PATH for 
Mac/Linux apps?  I've found that I can set the variable using:

put tValue into $LD_LIBRARY_PATH

and it appears to be set as far as the IDE is concerned.  However, if I use the 
shell command to display the value of this variable

put shell("printenv")
or
put shell("echo $LD_LIBRARY_PATH")

it's empty!

Similarly, if I try to set this in the shell script:

put shell("export LD_LIBRARY_PATH=" & quote & tValue & quote & return & 
"printenv")

it doesn't work either!

Other environment variables seem to be OK.

Any suggestions please?

Peter
--
Peter Reid
Loughborough, UK


___
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: use-livecode Digest, Vol 163, Issue 13

2017-04-06 Thread Peter Reid via use-livecode
Hi HH

Thanks for the advice, it was the paintCompression that caused the problem.  In 
the IDE it defaults to PNG but in the standalone it defaults to RLE instead.  
As I didn't set it, the value was the default for the environment!  I simply 
added:

set the paintCompression to png

to my preOpenStack handler and the problem was solved!

Thanks very much for solving this.

Peter
--
Peter Reid
Loughborough, UK

> On 6 Apr 2017, at 9:22pm, use-livecode-requ...@lists.runrev.com wrote:
> 
> Date: Thu, 6 Apr 2017 12:09:13 +0200
> From: hh >
> To: use-livecode@lists.runrev.com 
> Subject: Re: Standalone Magnify Problem
> Message-ID: <3af19fcf-001e-4dd6-a35c-ade7631c9...@hyperhh.de 
> >
> Content-Type: text/plain; charset=us-ascii
> 
>> Peter R. wrote:
>> I have it working fine when I'm in the development environment
>> but it's not working reliably in a standalone app. 
> 
> a) Did you already check to have the same paintcompression in both 
> environments?
> b) If you make such large images (why?) you may get a conflict with the 
> 8bit-coords
> limit. May be the standalone engine has still more of such limits included 
> for 
> 'formatted'-measurements than the IDE.
> c) Did you already check to have the same resizequality in both environments?
> ("best" may create an alphachannel)

___
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


Standalone Magnify Problem

2017-04-05 Thread Peter Reid via use-livecode
I'm following an approach published sometime ago 
(http://forums.livecode.com/viewtopic.php?f=7=8288 
) to provide a floating 
magnifier over the top of quite a large image.  I have it working fine when I'm 
in the development environment but it's not working reliably in a standalone 
app.  Here's a summary of what I'm doing:

- I generate images of 1,000 x 1,000 pixels, created using the export snapshot 
facility
- my app lets the user select a magnification factor in the range 4-16 times 
the original
- I scale-up a copy of the image (making an image of 16,000 x 16,000 say) and 
magnify this scaled copy
- I present the magnified view through a group using the hScroll/vScroll and 
formattedHeight/formattedWidth properties

The above works well when in the development environment.  When it's a 
standalone app I get various incorrect behaviours:

- the magnified view is all white, or all black
- the magnified view is of the wrong part of the image
- it sometimes works in the Mac standalone but not the Windows standalone

I have built the standalone using lc 8.1.2, lc 8.1.3, lc 8.1.4-rc1 and lc 
9.0.0-dp6.  In all cases I have tried building using automatic inclusions and 
manual inclusion selection, but none of this makes it work in the standalone!  
For manual selection I tried inluding every option available for Mac & Windows 
irrespective of whether I needed it or not.  However, even when I include 
"everything", it still doesn't work in the standalones!

The problems imply the lack of some inclusion and/or memory issues.  Has anyone 
come across this and, if so do you have a solution?!

Thanks.

Peter
--
Peter Reid
Loughborough, UK


___
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


Colour Manipulation

2017-03-18 Thread Peter Reid via use-livecode
I've got an app that allows the user to display an image using a variable 
number of colours (2-24 colours).  In addition, the user can specify upper and 
lower thresholds so that all pixels below a specified value are displayed using 
a colour such as black and all pixels with values above a specified value are 
displayed using a colour such as red.  Pixels with values between the 
thresholds are displayed using the specified colour range of 2-24 colours. The 
images can consist of up to 8-10 million pixels, they are rectangular and can 
be in a landscape or portrait orientation.

Whilst I have this working the code that manages the changing of the number and 
use of colours in an image is rather slow.  This is despite me using the 
"repeat for each" loop structure and lock the screen wherever possible to get 
the maximum speed!

Does anyone have any clever algorithms, code, add-ons, etc. that can do this 
kind of thing in a flash?!

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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