We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Running processing applications within Quartz
Page Index Toggle Pages: 1
Running processing applications within Quartz (Read 1878 times)
Running processing applications within Quartz
Mar 19th, 2009, 12:43pm
 
Hi,

Our third-year students in comp sci at Queen Mary, University of London have just submitted their Interaction Design project, under the form of a Processing application. Some of these are really nice and we want to have 10 of these applications on display on the plasma screens we have throughout the department. These screens are managed by a Mac, and the display is controlled by Quartz. I was wondering whether it was possible to load the programs within Quartz in sequence, so that each of them would run for e.g. 10 minutes.

Does anyone know if that's possible? I suppose that it could be possible also to combine all the codes into one big application that would control which app to play, but that would be a lot easier if Quartz was able to deal with each program independantly.

Thanks,
Jean-Baptiste
Re: Running processing applications within Quartz
Reply #1 - Mar 19th, 2009, 3:46pm
 
I thought that Quartz was the Apple's display system, a bit like QuickTime. I don't see how it can sequence applications. Perhaps it can do more than I know.

Anyway, if you don't have a better method, you can have a look at my answer Re: Sequencing, display update, and functions.
It shows how I transformed two (simple) sketches to run them sequentially for a given amount of time.
Not sure if it can help you, but maybe it can give ideas.
Re: Running processing applications within Quartz
Reply #2 - Mar 19th, 2009, 6:21pm
 
Thank you for that, this is a brilliant idea!
I'm going to try this out, I doubt that Quartz is able to load my processing standalone applications.
Re: Running processing applications within Quartz
Reply #3 - Mar 25th, 2009, 12:09pm
 
Hi!

OSx has an application called Quartz Composer, it utilises patches to create some amazing stuff.

One of the patches accepts java code. I would personally like to be able to paste in the converted (end result) java into here to be able to run processing within a Quarts app, though I don't think it can run all Java code (for security reasons I think)...

Anyway, I think this is what the op was about.
Re: Running processing applications within Quartz
Reply #4 - Mar 25th, 2009, 2:59pm
 
Aaah, thanks. That's the problem of truncating application name (like lot of people saying Outlook for Outlook Express, a very different beast).

Note that you can export your sketch, it will output a .jar file. Either you can use that in Quartz Composer, or you can open it (like a .zip file) to get the .class files.
You can even get the generated .java files in the temp dir of your system...
Re: Running processing applications within Quartz
Reply #5 - Mar 25th, 2009, 5:38pm
 
Hi,

Just to let you know, we have solved the problem of displaying several applets in random turns. We haven't used Quartz at all in the end, but loaded the applets in Safari and reload the page every 30 seconds. There was some problems with the memory allocation but after a bit of tweaking it worked quite well. Some 10 applets now take turn and are on display.

I can post the html code here if anyone is interested.

best,
Jean-Baptiste
Re: Running processing applications within Quartz
Reply #6 - Mar 25th, 2009, 6:04pm
 
i would be interested in the code...
Re: Running processing applications within Quartz
Reply #7 - Mar 27th, 2009, 3:33am
 
Here is the code for the page (includes php and html)

<?php

$applets = array('info1' => array ( 'archive' => 'applet1.jar',
                                            'classid' => 'applet1.class',
                                            'author'=> 'Author2',
                                            'title' => 'Demonstration 1),
                 'info2' => array ( 'archive' => 'applet2.jar' ,
                                    'classid' => 'applet2.class',
                                    'author'=>'Author2',
                                    'title' => 'Demonstration 2'),
                 'info3' => array ( 'archive' => 'applet3.jar' ,
                                    'classid' => 'applet3.class',
                                    'author'=>'Author3',
                                    'title' => 'Demonstration 3'));

$keys = array_keys($applets);
$nth = array_rand($keys, 1);
$key = $keys[$nth];
$mychoice = $applets[$key];
$archive =  'applets/' . $key . '/' . $mychoice['archive'];
$archive = preg_replace('/\,/',",applets/$key/",$archive);
$classid = 'java:' . $mychoice['classid'];
?>
<html>
<head>
 <meta http-equiv="refresh" content="30">
 <title>Interaction Design 2009</title>
</head>
<body bgcolor="#000000">
 <p>&nbsp;</p>
 <center>
 <object classid="<?php echo $classid;?>"
   type="application/x-java-applet"
   archive="<?php echo $archive;?>"
   width="800" height="600"
   standby="Loading Processing software..." >
   <param name="archive" value="<?php echo $archive;?>" />
   <param name="mayscript" value="true" />
   <param name="scriptable" value="true" />
   <param name="image" value="loading.gif" />
   <param name="boxmessage" value="Loading Processing software..." />
   <param name="boxbgcolor" value="#FFFFFF" />
   <param name="test_string" value="outer" />
 </object>
</center>
<p style="align: center; color: white; font-family: sans-serif;">
</body>
</html>
Page Index Toggle Pages: 1