Re: [QUIL] select-input and select-output?

2017-04-19 Thread Jay Porcasi
my 'implementation' is actually nothing more than a function that runs your 
code :-)
meaning that it relies on an AOT dependency in the project for the java 
class, which i don't mind in a personal project like mine, but probably 
wouldn't cut for Quil

moreover my initial goal was for the function to actually return the file 
path, but as the underlying code runs asynchronously, and after a few 
failed attempts with while loops, futures, promises... i had to rely on the 
'global' atom instead as in your example
which again is not a big deal for me bacause i actually have a map to keep 
all the current events, and so i treat the file path as an 'event' of 
sort (file-input-selected, file-output-selected.. and so on, containing the 
file path as string) because i prefer 'polling' my map at each 'frame' 
instead of the event driven way of doing stuff

the reason why i prefer 'polling' to 'event driven' would be probably a bit 
convoluted to explain here, but it allows me to work in a truly modular 
way, where i can just write a new module for any change i want to make to 
the app, be it deleting, modifying or adding a new feature
call it 'additive' programming if you want
makes it easy to go back to previous versions, or to try new ideas, and 
generally keeps me sane while coding :-)

each module has the same structure of the whole app (each with its own 
:setup, :update, :draw, etc.) and gets 'compiled' (by a macro) to a plain 
middleware

and Quil middleware functionality is pure genius


On Monday, April 17, 2017 at 5:07:56 AM UTC+7, Nikita Beloglazov wrote:
>
> Glad to hear you worked it out. Feel free to contribute your 
> implementation of select-input/output/folder to Quil. 
>
> Nikita
>
> On Sun, Apr 16, 2017 at 2:52 AM Jay Porcasi  > wrote:
>
>> hello Nikita,
>> your example worked great!
>> and i was able to 'abstract' it into a select-input function that i can 
>> call to set the file-path
>> hopefully it will be straightforward to do the same for select-output and 
>> select-folder
>> by the way it would be great if something like that was available in quil 
>> by default
>> thank you a lot for your help,
>> Jay
>>
>>
>> On Thursday, April 13, 2017 at 8:20:21 PM UTC+7, Jay Porcasi wrote:
>>>
>>> thank you Nikita!
>>>
>>> i will try your example to understand it better
>>>
>>> a simple file chooser that returns the file path as string is all i need 
>>> actually, i don't get all the complication in Processing of passing a 
>>> callback function but i guess it must be there for a reason
>>>
>>> cheers,
>>> Jay
>>>
>>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Clojure" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/clojure/R61OvE4jYEc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [QUIL] select-input and select-output?

2017-04-16 Thread Nikita Beloglazov
Glad to hear you worked it out. Feel free to contribute your implementation
of select-input/output/folder to Quil.

Nikita

On Sun, Apr 16, 2017 at 2:52 AM Jay Porcasi  wrote:

> hello Nikita,
> your example worked great!
> and i was able to 'abstract' it into a select-input function that i can
> call to set the file-path
> hopefully it will be straightforward to do the same for select-output and
> select-folder
> by the way it would be great if something like that was available in quil
> by default
> thank you a lot for your help,
> Jay
>
>
> On Thursday, April 13, 2017 at 8:20:21 PM UTC+7, Jay Porcasi wrote:
>>
>> thank you Nikita!
>>
>> i will try your example to understand it better
>>
>> a simple file chooser that returns the file path as string is all i need
>> actually, i don't get all the complication in Processing of passing a
>> callback function but i guess it must be there for a reason
>>
>> cheers,
>> Jay
>>
>> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/R61OvE4jYEc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [QUIL] select-input and select-output?

2017-04-16 Thread Jay Porcasi
hello Nikita,
your example worked great!
and i was able to 'abstract' it into a select-input function that i can 
call to set the file-path
hopefully it will be straightforward to do the same for select-output and 
select-folder
by the way it would be great if something like that was available in quil 
by default
thank you a lot for your help,
Jay

On Thursday, April 13, 2017 at 8:20:21 PM UTC+7, Jay Porcasi wrote:
>
> thank you Nikita!
>
> i will try your example to understand it better
>
> a simple file chooser that returns the file path as string is all i need 
> actually, i don't get all the complication in Processing of passing a 
> callback function but i guess it must be there for a reason
>
> cheers,
> Jay
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [QUIL] select-input and select-output?

2017-04-13 Thread Jay Porcasi
thank you Nikita!

i will try your example to understand it better

a simple file chooser that returns the file path as string is all i need 
actually, i don't get all the complication in Processing of passing a callback 
function but i guess it must be there for a reason

cheers,
Jay

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [QUIL] select-input and select-output?

2017-04-11 Thread Nikita Beloglazov
Hi Jay

No, there is no native support of selectInput() or selectOutput() in Quil. 
You can try calling Processing's methods directly using java interop. 
Though it's not straightforward. The problem is that when you call 
selectInput() you have to pass a name of callback function to be called. 
This name is just a string and Processing finds corresponding method using 
reflection and invokes it. To make it work we need to generate a class, 
let's say FileCallback which has method onFileSelected(). Then we need to 
pass instance of that class to selectInput() along with "onFileSelected" as 
callback name. 

Here is an 
example: https://gist.github.com/nbeloglazov/8a74fa3e6bbb44137df27c4a5201ad1e 
If you're not familiar with generating classes in clojure then check docs 
 it's non-trivial. 

Hope this helps,
Nikita

On Monday, April 10, 2017 at 8:49:09 PM UTC-7, Jay Porcasi wrote:
>
> hello,
>
> i'm looking for the Quil equivalents of Processing selectInput() and 
> selectOutput() but i can't find them
>
> if they're not there, what would be the best way to directly access the 
> corresponding Processing methods instead?
> or is there a different more convenient way to get the same functionality 
> of those methods?
>
> thanks for any suggestions in the right direction
> Jay
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[QUIL] select-input and select-output?

2017-04-10 Thread Jay Porcasi
hello,

i'm looking for the Quil equivalents of Processing selectInput() and 
selectOutput() but i can't find them

if they're not there, what would be the best way to directly access the 
corresponding Processing methods instead?
or is there a different more convenient way to get the same functionality 
of those methods?

thanks for any suggestions in the right direction
Jay

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.