this problem is really hard to describe, cannot paste all the code which contains the problem.
I have written a class called "ControllerManager", which makes it even more convenient to use some of the CP5 Controllers, performs some auto-layout and enables Serialisation. All the controllers of a single ControllerManager are pooled in a ControllerGroup. Each ControllerGroup contains an own instance of ControlP5.
To give you an idea how it works:
cm = new ControllerManager("foo", this, controlWindow);
// add a Slider which can be addressed with "SIZE", current value: 10, min: 0, max: 20
"controlWindow" is an instance of a class called "PseudoWindow", which just gives some offset and size Infos about where the controllers should actually be displayed.
There is another class called "GraphElement", each instance containing his own ControllerManager to control some Parameters. During Runtime, it is possible to select a certain GraphElement to edit it with the Controllers managed by the ControllerManager.
The Problem is: When a controller Group of any ControllerManager is shown (= the controllers are visible and can be changed...), it will take sth. like 50 % of CPU Performance when the frameRate is 30! EDIT: If no ControllerManager is selected (= no Controllers are visible, all Controllers have got the "hideControllers" Message), the CPU performance is fine.
I already tried a lot to isolate the problem without success:
- The problem appears even when there is only a single Instance of the ControllerManager
- I commented out the ControllListener, no effect on performance
- I commented out all the logic which enables Serialisation, no effect on performance
EDIT: if the Controllers aren't pooled in a group, no effect on performance
I found out, if i did not add any Controllers to the Manager, there is no performance problem. So, just an empty ControllerGroup is displayed.
I know it is an imposition, but has anybody of you an idea where to search to solve the problem?
I'm thinking about to rewrite the ControllerManager with G4P, but, the current implementation works perfect besides the performance problem...
The apache commons lib comes with the javadoc as a jar.
I simply can add the javadoc by selecting this file in the Ant Library Manager with Javadoc -> add zip/folder.
But, for example, ControlP5 does not contain such a jar file. It just contains the javadoc as html-files in the reference folder.
If i select this reference folder, the javadoc cannot be found. If i do Javadoc -> add url and select the url of the
online reference it does not work either.
What can i do to integrate the javadoc in such a case?
I just switched from the Processing IDE to Netbeans.
I found it quite usefull to create an ant library with all the libs i need to develope. I simply selected ALL libs which are placed in the Processing2.app/Contents/Resources/Java/core/library directory, because i don't know which ones are really necessary.
Does it have any disadvantages to do so?
EDIT: this topic touches also the contributed libraries. Would like to select all the libs i sometimes need in my ant library...
I tried to write multi-window sketches and tried to do that with
com.shigeodayo.pframe.PFrame
and
org.gicentre.utils.multisketch
It came out that both trials eat lots of cpu perfomance. Even if there is almost nothing hapening in the sletches, they consume sth. like 30 % of my macbook cpu performance.
Perhaps, Processing just isn't the right language to write multi-window applications?
i'm just working on an animation editor which should have separate windows for movie, controls and timeline.
I'm using the Pframe library for the multi-window stuff.
This code works fine in Processing 1.5, but only with the OPENGL renderer:
If i try to execute this code in Processing 2.0, it shows very strange behaviour. No matter if the OPENGL or the P2D renderer is used, the controlWindow has sometimes the right size, sometimes not. The timeline Window has never the right size.
Does anybody have some experiences working with PFrame in Processing 2.0? Are there some known bugs? Or is there something wrong with opengl in Processing 2.0?
I would love to do everything in 2.0...
I'm also confused about the opengl library. There is no opengl folder in my libraries folder. And in Processing 2.0 i even don't have to import it to use it. So it seems to be "built in" somehow. But it is not listed at the "included libraries"
here. I even don't know the version of OPENGL i'm using. Any idea?
EDIT: The output of the program which i want to record is produced by an array of AudioPlayers.
I see that AudioPlayer implements recordable, so it should be possible to record a single AudioPlayer, which is not the solution of the problem...
Anyway, i am looking for a solution to record any audio-output, no matter how it was produced...
EDIT: Oops, i posted this in the Core Library Questions, sorry, this was a mistake.
Hello,
i'm writing a sketch which is loading random mp3-files from the data folder. The files are loaded and played with Minims AudioPlayer. I need to know the duration of each loaded file in milliseconds...
When the sketch is running locally, this gives the actual duration of a file and everything works fine:
currentFileLen = player.getMetaData().length();
But, if the sketch is running on my website, it gives not the duration of the whole file but (presumably) the duration of the buffers content.
How can i find out the actual duration of each file when the sketch is running online as an applet?
when i have a Papplet which uses keyPressed() and want to open it with firefox, very often the key-commands don't work.
Apparently this happens frequently, when other or the same Papplet have been opened before, or when something else has been focussed meanwhile.
When i restart firefox, it works again...
I use firefox 6.01, but this problem appeared with older versions as well.
Operation System: OSX 10.6.7
with an old safari-version this problem does not apear.
Does anyone know the same problem and/or has an idea what's the reason?
thanks
nossek
EDIT: if you want to get a link to an example, please PM
I tried to do some static imports in Processing as i know them from java.
But when i try to import a class with just static methods, and i use the static-modifier, Processing says "i don't know the package".
When i leave out the static modifier, the import works, but of course without the benefits of static imports (no need to write the classname to use the methods...)
there are a lot of postings related to this kind of problem but i don't get it, sorry!
For testing purposes, i wrote and exported a package with a simple java-class in eclipse.
I have put the package here:
Processing -> libraries -> TestLib -> library -> TestLib.jar
actually the structure is the same as other external libraries i can use successfully. (ControlP5 for instance..)
but when i try to use my library like this:
import TestLib.*;
The well known errormessage "The package ... does not exist..." appears.
It also says:
"As of release 1.0, libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder."
but even when i put the TestLib.jar into the sketch folder (which wouldn't be an elegant solution anyway), it does not work.
Any idea what could be wrong?
Many thanks in advance
nossek
Edit:
okay, now i have put the jar file into a folder named "code" inside the sketch-folder - this works even wtihout the import-statement.
But: this is not a very nice solution, because if i use a library in several sketches and i change the implementation of the library, i have to update all the sketch folders of sketches which use that library...