From 37f5151d4e9a1020392705fa28ae10c6fcb26697 Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Mon, 13 Oct 2014 02:36:01 -0300 Subject: [PATCH 01/11] Fix infinite recursion in sound library --- java/libraries/sound/src/processing/sound/Engine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/libraries/sound/src/processing/sound/Engine.java b/java/libraries/sound/src/processing/sound/Engine.java index 95b75eea6..df072fb3b 100644 --- a/java/libraries/sound/src/processing/sound/Engine.java +++ b/java/libraries/sound/src/processing/sound/Engine.java @@ -120,7 +120,7 @@ public class Engine { }; public static int[] soundFilePlayMono(float rate, float pos, float amp, float add, boolean loop, String path, float dur, int cue){ - return soundFilePlayMono(rate, pos, amp, add, loop, path, dur, cue); + return methCla.soundFilePlayMono(rate, pos, amp, add, loop, path, dur, cue); }; public static int[] soundFilePlayMulti(float rate, float amp, float add, boolean loop, String path, float dur, int cue){ From 84b2efd8f84d562d56769d6420306322428bd840 Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Mon, 13 Oct 2014 15:16:32 -0300 Subject: [PATCH 02/11] Use correct parameter types in FloatList methods --- core/src/processing/data/FloatList.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/processing/data/FloatList.java b/core/src/processing/data/FloatList.java index dd050e111..0238fe729 100644 --- a/core/src/processing/data/FloatList.java +++ b/core/src/processing/data/FloatList.java @@ -300,7 +300,7 @@ public class FloatList implements Iterable { // same as splice - public void insert(int index, int[] values) { + public void insert(int index, float[] values) { if (index < 0) { throw new IllegalArgumentException("insert() index cannot be negative: it was " + index); } @@ -328,7 +328,7 @@ public class FloatList implements Iterable { } - public void insert(int index, IntList list) { + public void insert(int index, FloatList list) { insert(index, list.values()); } From bb96d9388b95ca0611debb93ede4c79c22a7175a Mon Sep 17 00:00:00 2001 From: wirsing Date: Thu, 16 Oct 2014 18:00:18 -0700 Subject: [PATCH 03/11] fixed mp3 loading problem for osx and added failsafe if file is not existing. --- .../src/cpp/processing_sound_MethClaInterface.cpp | 1 + .../sound/src/processing/sound/SoundFile.java | 12 +++++++++--- java/libraries/sound/todo.txt | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/java/libraries/sound/src/cpp/processing_sound_MethClaInterface.cpp b/java/libraries/sound/src/cpp/processing_sound_MethClaInterface.cpp index ed3fb21ac..70b0b85d4 100644 --- a/java/libraries/sound/src/cpp/processing_sound_MethClaInterface.cpp +++ b/java/libraries/sound/src/cpp/processing_sound_MethClaInterface.cpp @@ -81,6 +81,7 @@ JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_engineNew (JNIEnv .addLibrary(methcla_plugins_tri) .addLibrary(methcla_plugins_pulse) .addLibrary(methcla_soundfile_api_libsndfile) + .addLibrary(methcla_soundfile_api_mpg123) .addLibrary(methcla_plugins_patch_cable) .addLibrary(methcla_plugins_sampler) .addLibrary(methcla_plugins_white_noise) diff --git a/java/libraries/sound/src/processing/sound/SoundFile.java b/java/libraries/sound/src/processing/sound/SoundFile.java index 491902871..a65d33487 100644 --- a/java/libraries/sound/src/processing/sound/SoundFile.java +++ b/java/libraries/sound/src/processing/sound/SoundFile.java @@ -1,5 +1,6 @@ package processing.sound; import processing.core.*; +import java.io.File; public class SoundFile implements SoundObject { @@ -14,8 +15,7 @@ public class SoundFile implements SoundObject { float m_add=0; int m_cue=0; float m_pos=0; - boolean m_loop; - + boolean m_loop; public SoundFile(PApplet theParent, String path) { this.parent = theParent; @@ -24,7 +24,13 @@ public class SoundFile implements SoundObject { m_engine.start(); methCla = new MethClaInterface(); m_filePath=theParent.dataPath(path); - m_info = m_engine.soundFileInfo(m_filePath); + File sample = new File(m_filePath); + if(sample.isFile() == true){ + m_info = m_engine.soundFileInfo(m_filePath); + } + else { + System.out.println("Error: Soundfile doesn't exist. Pleae check path"); + } } public int frames(){ diff --git a/java/libraries/sound/todo.txt b/java/libraries/sound/todo.txt index c6442b31c..7cfc290a8 100644 --- a/java/libraries/sound/todo.txt +++ b/java/libraries/sound/todo.txt @@ -13,6 +13,7 @@ + Fix problem of passing effects to Analyzers + Make audio input work - Use Patch Cables for signal splitting for effects + + Fix MP3 thing Features: + Compile Windows Version From 5e16238488f44159d12ed62097a4038d7c8f0da4 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 17 Oct 2014 10:57:58 -0400 Subject: [PATCH 04/11] remove warnings --- app/src/processing/app/WebServer.java | 4 ++-- app/src/processing/app/syntax/InputHandler.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/processing/app/WebServer.java b/app/src/processing/app/WebServer.java index 9061b50f7..abed4e091 100644 --- a/app/src/processing/app/WebServer.java +++ b/app/src/processing/app/WebServer.java @@ -370,7 +370,7 @@ outerloop: int ind = name.lastIndexOf('.'); String ct = null; if (ind > 0) { - ct = (String) map.get(name.substring(ind)); + ct = map.get(name.substring(ind)); } if (ct == null) { //System.err.println("unknown content type " + name.substring(ind)); @@ -417,7 +417,7 @@ outerloop: int ind = name.lastIndexOf('.'); String ct = null; if (ind > 0) { - ct = (String) map.get(name.substring(ind)); + ct = map.get(name.substring(ind)); } if (ct == null) { ct = "unknown/unknown"; diff --git a/app/src/processing/app/syntax/InputHandler.java b/app/src/processing/app/syntax/InputHandler.java index f6c07eb0f..7b6b014fb 100644 --- a/app/src/processing/app/syntax/InputHandler.java +++ b/app/src/processing/app/syntax/InputHandler.java @@ -140,7 +140,7 @@ public abstract class InputHandler extends KeyAdapter */ public static ActionListener getAction(String name) { - return (ActionListener)actions.get(name); + return actions.get(name); } /** From 3025fe7f40380cde0684496f490cecf8dbf2d2c2 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 17 Oct 2014 10:58:12 -0400 Subject: [PATCH 05/11] rewriting to remove deprecation and update --- .../app/platform/ThinkDifferent.java | 140 +++++++----------- 1 file changed, 52 insertions(+), 88 deletions(-) diff --git a/app/src/processing/app/platform/ThinkDifferent.java b/app/src/processing/app/platform/ThinkDifferent.java index 619510840..35a285538 100644 --- a/app/src/processing/app/platform/ThinkDifferent.java +++ b/app/src/processing/app/platform/ThinkDifferent.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-2013 The Processing Foundation + Copyright (c) 2012-2014 The Processing Foundation Copyright (c) 2007-2012 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or @@ -23,32 +23,28 @@ package processing.app.platform; import java.awt.event.*; +import java.io.File; import javax.swing.*; -import processing.app.About; -import processing.app.Base; -import processing.app.Toolkit; -import processing.app.Language; - import com.apple.eawt.*; +import com.apple.eawt.AppEvent.*; + +import processing.app.*; /** * Deal with issues related to thinking differently. This handles the basic * Mac OS X menu commands (and apple events) for open, about, prefs, etc. * - * Based on OSXAdapter.java from Apple DTS. - * * As of 0140, this code need not be built on platforms other than OS X, * because of the new platform structure which isolates through reflection. * - * This suppresses deprecation warnings because to use the new code, all users - * would be forced to use Java Update 3 on OS X 10.6, and Java Update 8 on - * OS X 10.5, which doesn't seem likely at the moment. + * Rewritten for 0232 to remove deprecation issues, per the message + * here. + * (We're able to do this now because we're dropping older Java versions.) */ -@SuppressWarnings("deprecation") -public class ThinkDifferent implements ApplicationListener { +public class ThinkDifferent { // pseudo-singleton model; no point in making multiple instances // of the EAWT application or our adapter @@ -57,26 +53,54 @@ public class ThinkDifferent implements ApplicationListener { private static Application application; // reference to the app where the existing quit, about, prefs code is - private Base base; + //private Base base; - static protected void init(Base base) { + static protected void init(final Base base) { if (application == null) { - //application = new com.apple.eawt.Application(); application = Application.getApplication(); } if (adapter == null) { - adapter = new ThinkDifferent(base); + adapter = new ThinkDifferent(); //base); } - application.addApplicationListener(adapter); - application.setEnabledAboutMenu(true); - application.setEnabledPreferencesMenu(true); - - // Set the menubar to be used when nothing else is open. http://j.mp/dkZmka - // Only available since Java for Mac OS X 10.6 Update 1, but removed - // dynamic loading code because that should be installed in 10.6.8, and - // we may be dropped 10.6 really soon anyway + application.setAboutHandler(new AboutHandler() { + public void handleAbout(AboutEvent ae) { + new About(null); + } + }); + + application.setPreferencesHandler(new PreferencesHandler() { + public void handlePreferences(PreferencesEvent arg0) { + base.handlePrefs(); + } + }); + + application.setOpenFileHandler(new OpenFilesHandler() { + public void openFiles(OpenFilesEvent event) { + for (File file : event.getFiles()) { + base.handleOpen(file.getAbsolutePath()); + } + } + }); + + application.setPrintFileHandler(new PrintFilesHandler() { + public void printFiles(PrintFilesEvent event) { + // TODO not yet implemented + } + }); + + application.setQuitHandler(new QuitHandler() { + public void handleQuitRequestWith(QuitEvent event, QuitResponse response) { + if (base.handleQuit()) { + response.performQuit(); + } else { + response.cancelQuit(); + } + } + }); + + // Set the menubar to be used when nothing else is open. JMenuBar defaultMenuBar = new JMenuBar(); JMenu fileMenu = buildFileMenu(base); defaultMenuBar.add(fileMenu); @@ -107,9 +131,9 @@ public class ThinkDifferent implements ApplicationListener { } - public ThinkDifferent(Base base) { - this.base = base; - } +// public ThinkDifferent(Base base) { +// this.base = base; +// } /** @@ -154,64 +178,4 @@ public class ThinkDifferent implements ApplicationListener { return fileMenu; } - - - // implemented handler methods. These are basically hooks into existing - // functionality from the main app, as if it came over from another platform. - public void handleAbout(ApplicationEvent ae) { - if (base != null) { - ae.setHandled(true); - new About(null); - } else { - throw new IllegalStateException("handleAbout: Base instance detached from listener"); - } - } - - - public void handlePreferences(ApplicationEvent ae) { - if (base != null) { - base.handlePrefs(); - ae.setHandled(true); - } else { - throw new IllegalStateException("handlePreferences: Base instance detached from listener"); - } - } - - - public void handleOpenApplication(ApplicationEvent ae) { - } - - - public void handleOpenFile(ApplicationEvent ae) { -// System.out.println("got open file event " + ae.getFilename()); - String filename = ae.getFilename(); - base.handleOpen(filename); - ae.setHandled(true); - } - - - public void handlePrintFile(ApplicationEvent ae) { - // TODO implement os x print handler here (open app, call handlePrint, quit) - } - - - public void handleQuit(ApplicationEvent ae) { - if (base != null) { - /* - / You MUST setHandled(false) if you want to delay or cancel the quit. - / This is important for cross-platform development -- have a universal quit - / routine that chooses whether or not to quit, so the functionality is identical - / on all platforms. This example simply cancels the AppleEvent-based quit and - / defers to that universal method. - */ - boolean result = base.handleQuit(); - ae.setHandled(result); - } else { - throw new IllegalStateException("handleQuit: Base instance detached from listener"); - } - } - - - public void handleReOpenApplication(ApplicationEvent arg0) { - } } From ce5daefffd9bf85a6f64a5013e7be1f392dd03f5 Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Mon, 20 Oct 2014 23:52:26 -0300 Subject: [PATCH 06/11] Use 1.7 as source and target Java version --- app/build.xml | 5 ++--- build/build.xml | 4 ++-- build/shared/tools/MovieMaker/build.xml | 4 ++-- core/build.xml | 2 +- java/libraries/dxf/build.xml | 4 ++-- java/libraries/glw/build.xml | 4 ++-- java/libraries/lwjgl/build.xml | 4 ++-- java/libraries/net/build.xml | 4 ++-- java/libraries/pdf/build.xml | 4 ++-- java/libraries/serial/build.xml | 4 ++-- java/libraries/sound/build.xml | 4 ++-- pdex/build.xml | 4 ++-- 12 files changed, 23 insertions(+), 24 deletions(-) diff --git a/app/build.xml b/app/build.xml index 4122ed0e8..dbec5d80b 100755 --- a/app/build.xml +++ b/app/build.xml @@ -65,9 +65,8 @@ - - - + @@ -943,7 +943,7 @@ remove the spaces for depth since it should be double dash, but screws up commen - + diff --git a/build/shared/tools/MovieMaker/build.xml b/build/shared/tools/MovieMaker/build.xml index 419914718..7261ece3a 100755 --- a/build/shared/tools/MovieMaker/build.xml +++ b/build/shared/tools/MovieMaker/build.xml @@ -8,8 +8,8 @@ - - - - - - - - - Date: Tue, 21 Oct 2014 00:00:18 -0300 Subject: [PATCH 08/11] Fix typo in spanish translation --- app/src/processing/app/languages/PDE_es.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/processing/app/languages/PDE_es.properties b/app/src/processing/app/languages/PDE_es.properties index d5e54b19b..b0167ce66 100644 --- a/app/src/processing/app/languages/PDE_es.properties +++ b/app/src/processing/app/languages/PDE_es.properties @@ -120,7 +120,7 @@ preferences.requires_restart = requiere reiniciar Processing preferences.sketchbook_location = Ubicación del sketchbook preferences.sketchbook_location.popup = Ubicación del sketchbook preferences.language = Idioma -preferences.editor_and_console_font = Fuenta de la consola y el editor +preferences.editor_and_console_font = Fuente de la consola y el editor preferences.editor_and_console_font.tip = \ Selecciona la fuente usada en el editor y la consola.
\ Sólo las fuentes con caracteres de ancho fijo pueden
\ From 0f930798ff3daad2c27b631be446f6978ccfc246 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Wed, 22 Oct 2014 18:56:01 -0400 Subject: [PATCH 09/11] update url --- app/src/processing/app/platform/LinuxPlatform.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/processing/app/platform/LinuxPlatform.java b/app/src/processing/app/platform/LinuxPlatform.java index 85d2b4e9a..3a905855d 100644 --- a/app/src/processing/app/platform/LinuxPlatform.java +++ b/app/src/processing/app/platform/LinuxPlatform.java @@ -41,24 +41,24 @@ public class LinuxPlatform extends Platform { (!javaVendor.contains("Sun") && !javaVendor.contains("Oracle")) || javaVM == null || !javaVM.contains("Java")) { Base.showWarning("Not fond of this Java VM", - "Processing requires Java 6 from Sun (i.e. the sun-java-jdk\n" + + "Processing requires Java 7 from Sun (i.e. the sun-java-jdk\n" + "package on Ubuntu). Other versions such as OpenJDK, IcedTea,\n" + "and GCJ are strongly discouraged. Among other things, you're\n" + "likely to run into problems with sketch window size and\n" + "placement. For more background, please read the wiki:\n" + - "http://wiki.processing.org/w/Supported_Platforms#Linux", null); + "https://github.com/processing/processing/wiki/Supported-Platforms#Linux", null); } - - // Set x11 WM_CLASS property which is used as the application + + // Set x11 WM_CLASS property which is used as the application // name by Gnome3 and other window managers. // https://github.com/processing/processing/issues/2534 try { Toolkit xToolkit = Toolkit.getDefaultToolkit(); - java.lang.reflect.Field awtAppClassNameField = + java.lang.reflect.Field awtAppClassNameField = xToolkit.getClass().getDeclaredField("awtAppClassName"); awtAppClassNameField.setAccessible(true); awtAppClassNameField.set(xToolkit, "Processing"); - + } catch(Exception e) { // In case the implementation details change e.printStackTrace(); From 897656c9b9bc634b406c4741c156b86b20529416 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Wed, 22 Oct 2014 18:56:43 -0400 Subject: [PATCH 10/11] ignore case on types, add category to javadoc --- core/src/processing/data/Table.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/processing/data/Table.java b/core/src/processing/data/Table.java index 6b89f5af7..c1e941f73 100644 --- a/core/src/processing/data/Table.java +++ b/core/src/processing/data/Table.java @@ -1479,11 +1479,12 @@ public class Table { /** * Set the data type for a column so that using it is more efficient. * @param column the column to change - * @param columnType One of int, long, float, double, or String. + * @param columnType One of int, long, float, double, string, or category. */ public void setColumnType(int column, String columnType) { + columnType = columnType.toLowerCase(); int type = -1; - if (columnType.equals("String")) { + if (columnType.equals("string")) { type = STRING; } else if (columnType.equals("int")) { type = INT; From 53e348b597b5bfa30803c2095be051791dbfd87c Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Wed, 22 Oct 2014 18:57:22 -0400 Subject: [PATCH 11/11] todo notes from pulls, etc --- core/todo.txt | 2 ++ todo.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/todo.txt b/core/todo.txt index 862e0d03f..b6cacd0a3 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -6,6 +6,8 @@ X Fix check in loadShader() X https://github.com/processing/processing/pull/2867 X Refined PShader uniform missing message fixes X https://github.com/processing/processing/pull/2869 +X Use correct parameter types in FloatList methods +X https://github.com/processing/processing/pull/2902 andres diff --git a/todo.txt b/todo.txt index 23e98d93a..b660656a4 100644 --- a/todo.txt +++ b/todo.txt @@ -13,6 +13,8 @@ X Migrate to unsynchronized data structures X https://github.com/processing/processing/pull/2863 X improve contrib manager localization X https://github.com/processing/processing/pull/2870 +X Fix infinite recursion in sound library +X https://github.com/processing/processing/pull/2897 _ Add support for localizing contributions _ https://github.com/processing/processing/pull/2833 _ Fix renaming from RGB to Rgb.java and others