You can subscribe to this list here.
2007 |
Jan
(31) |
Feb
(54) |
Mar
(27) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: <ri...@us...> - 2007-03-01 07:46:51
|
Revision: 88 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=88&view=rev Author: rickles Date: 2007-02-28 23:46:51 -0800 (Wed, 28 Feb 2007) Log Message: ----------- Utility for XML parsing. Added Paths: ----------- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/ConfigHandler.java sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/SimpleElement.java sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/bundle.java sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/container.java sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/containertype.java Added: sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/ConfigHandler.java =================================================================== --- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/ConfigHandler.java (rev 0) +++ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/ConfigHandler.java 2007-03-01 07:46:51 UTC (rev 88) @@ -0,0 +1,81 @@ +package org.digivitality.techne.core.util; + +import org.xml.sax.*; +import org.xml.sax.helpers.*; +import java.util.*; +import java.lang.reflect.*; + +public class ConfigHandler extends DefaultHandler { + Stack stack = new Stack(); + SimpleElement element; + + public void startElement(String namespace, String localname, String qname, Attributes atts) + throws SAXException { + + SimpleElement element = null; + String key = null; + try { + element = (SimpleElement)Class.forName("org.digivitality.techne.core.util." + qname).newInstance(); + } catch (Exception e) {/*No class for element*/} + + for(int i=0; i<atts.getLength(); i++) { + element.setAttributeValue(atts.getQName(i), atts.getValue(i)); + } + + stack.push(element); + } + + public void endElement(String namespace, String localname, String qname) + throws SAXException { + + element = (SimpleElement)stack.pop(); + + if (!stack.empty()) { + try { + //System.out.println("qname: " + qname); + //System.out.println("stack object: " + stack.peek()); + //System.out.println("element: " + element); + setProperty(qname, stack.peek(), element ); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + public void characters(char[] ch, int start, int len) { + String text = new String(ch, start, len); + ((SimpleElement)(stack.peek())).addText(text); + } + + void setProperty(String name, Object target, Object value) throws SAXException { + //System.out.println("property: " + name); + //System.out.println("target: " + target.getClass()); + //System.out.println("value: " + value.getClass()); + Method method = null; + try { + method = target.getClass().getMethod( + "add" + name, new Class[] { value.getClass() } ); + // invoke the method + //System.out.println("Method to execute: " + method.toString()); + method.invoke(target, new Object[]{value}); + } catch (Exception e) {throw new SAXException(e.toString()); } + /* + if (method == null) { + try { + method = target.getClass().getMethod( + "set" + name, new Class[] { value.getClass()} ); + method.invoke(target.getClass().newInstance(), new Object[]{value}); + } catch (Exception e) {throw new SAXException(e.toString()); } + } + */ + if (method == null) { + throw new SAXException("No add method detected for " + target.getClass()); + } + + this.element = (SimpleElement)target; + } + + public SimpleElement getModel() { + return element; + } +} Added: sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/SimpleElement.java =================================================================== --- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/SimpleElement.java (rev 0) +++ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/SimpleElement.java 2007-03-01 07:46:51 UTC (rev 88) @@ -0,0 +1,26 @@ +package org.digivitality.techne.core.util; + +import java.util.HashMap; +import java.util.Map; + +public class SimpleElement { + + StringBuffer text = new StringBuffer(); + Map properties = new HashMap(); + + public void addText(String s) { + text.append(s); + } + + public String getText() { + return text.toString(); + } + + public void setAttributeValue(String key, String value) { + properties.put(key, value); + } + + public Map getProperties() { + return properties; + } +} Added: sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/bundle.java =================================================================== --- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/bundle.java (rev 0) +++ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/bundle.java 2007-03-01 07:46:51 UTC (rev 88) @@ -0,0 +1,14 @@ +package org.digivitality.techne.core.util; + +public class bundle extends SimpleElement { + + String url; + + public void seturl(String url) { + this.url = url; + } + + public String getusr() { + return url; + } +} Added: sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/container.java =================================================================== --- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/container.java (rev 0) +++ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/container.java 2007-03-01 07:46:51 UTC (rev 88) @@ -0,0 +1,18 @@ +package org.digivitality.techne.core.util; + +import java.util.ArrayList; +import java.util.List; + +public class container extends SimpleElement { + + List containerTypes = new ArrayList(); + + public void addcontainertype(containertype ct) { + //System.out.println("Adding containertype " + ct); + containerTypes.add(ct); + } + + public List getContainerTypes() { + return containerTypes; + } +} Added: sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/containertype.java =================================================================== --- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/containertype.java (rev 0) +++ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/util/containertype.java 2007-03-01 07:46:51 UTC (rev 88) @@ -0,0 +1,38 @@ +package org.digivitality.techne.core.util; + +import java.util.ArrayList; +import java.util.List; + +public class containertype extends SimpleElement { + + List bundles = new ArrayList(); + String value; + String base; + + public void addbundle(bundle b) { + bundles.add(b); + } + public List getBundles() { + return bundles; + } + + public void setbundles(List bundles) { + this.bundles = bundles; + } + + public void setvalue(String value) { + this.value = value; + } + + public String getvalue() { + return value; + } + + public void setbase(String base) { + this.base = base; + } + + public String getbase() { + return base; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2007-03-01 07:44:54
|
Revision: 87 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=87&view=rev Author: rickles Date: 2007-02-28 23:44:55 -0800 (Wed, 28 Feb 2007) Log Message: ----------- Set default container type to basic Modified Paths: -------------- sandbox/rickles/org.digivitality.techne.shell/src/org/digivitality/techne/shell/Shell.java Modified: sandbox/rickles/org.digivitality.techne.shell/src/org/digivitality/techne/shell/Shell.java =================================================================== --- sandbox/rickles/org.digivitality.techne.shell/src/org/digivitality/techne/shell/Shell.java 2007-02-28 19:25:17 UTC (rev 86) +++ sandbox/rickles/org.digivitality.techne.shell/src/org/digivitality/techne/shell/Shell.java 2007-03-01 07:44:55 UTC (rev 87) @@ -35,7 +35,7 @@ private static boolean FRAMEWORK_SET; private String profile = "Peter"; - private static String DEFAULT_CONTAINER_TYPE = "web"; + private static String DEFAULT_CONTAINER_TYPE = "basic"; protected static final Log logger = LogFactory.getLog(Shell.class); private boolean stopping = false; private ContainerFactory containerFactory; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-28 19:42:32
|
Revision: 86 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=86&view=rev Author: tonit Date: 2007-02-28 11:25:17 -0800 (Wed, 28 Feb 2007) Log Message: ----------- 1. using cleaner conversationPattern 2. using DailyRollingFileAppender Modified Paths: -------------- sandbox/rickles/org.digivitality.techne.core/conf/log4j.properties Modified: sandbox/rickles/org.digivitality.techne.core/conf/log4j.properties =================================================================== --- sandbox/rickles/org.digivitality.techne.core/conf/log4j.properties 2007-02-27 19:10:48 UTC (rev 85) +++ sandbox/rickles/org.digivitality.techne.core/conf/log4j.properties 2007-02-28 19:25:17 UTC (rev 86) @@ -1,19 +1,9 @@ -# For JBoss: Avoid to setup Log4J outside $JBOSS_HOME/server/default/deploy/log4j.xml! -# For all other servers: Comment out the Log4J listener in web.xml to activate Log4J. -#log4j.rootLogger=INFO, stdout, logfile -log4j.rootLogger=DEBUG, logfile +log4j.rootCategory=DEBUG,DR +log4j.appender.DR=org.apache.log4j.DailyRollingFileAppender +log4j.appender.DR.File=../log/techne.log +log4j.appender.DR.DatePattern='.'yyyy-MM-dd +log4j.appender.DR.layout=org.apache.log4j.PatternLayout +log4j.appender.DR.layout.ConversionPattern=%d{ISO8601} %10.20c %-5p %m%n -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n - -log4j.appender.logfile=org.apache.log4j.RollingFileAppender -log4j.appender.logfile.File=../log/techne.log -log4j.appender.logfile.MaxFileSize=512KB -# Keep three backup files. -log4j.appender.logfile.MaxBackupIndex=3 -# Pattern to output: date priority [category] - message -log4j.appender.logfile.layout=org.apache.log4j.PatternLayout -#log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n -log4j.appender.logfile.layout.ConversionPattern=|%p|%d|%m|%t|%c|%L|%n - +# specfic settings: +log4j.category.org.digivitality.shell=DEBUG This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-27 19:11:03
|
Revision: 85 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=85&view=rev Author: tonit Date: 2007-02-27 11:10:48 -0800 (Tue, 27 Feb 2007) Log Message: ----------- added doublecheck locking Modified Paths: -------------- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerFactory.java Modified: sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerFactory.java =================================================================== --- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerFactory.java 2007-02-27 18:59:06 UTC (rev 84) +++ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerFactory.java 2007-02-27 19:10:48 UTC (rev 85) @@ -1,8 +1,8 @@ package org.digivitality.techne.core; -import java.util.*; +import java.util.ArrayList; +import java.util.List; - public class ContainerFactory { // this will be replaced by techne.properties @@ -10,42 +10,46 @@ private int quantity; private List containerInstances = new ArrayList(); private static ContainerFactory instance; - + private ContainerFactory() { - + } - - public Object clone() throws CloneNotSupportedException - { - throw new CloneNotSupportedException("Cloning a singleton is not allowed."); - } - - static synchronized public ContainerFactory getInstance() - { - if (instance==null) { - instance = new ContainerFactory(); + + public Object clone() throws CloneNotSupportedException { + throw new CloneNotSupportedException( + "Cloning a singleton is not allowed."); + } + + static synchronized public ContainerFactory getInstance() { + if (instance == null) { + synchronized (ContainerFactory.class) { + if (instance == null) { + instance = new ContainerFactory(); + } + } } - return instance; + + return instance; } - + public void init() { if (quantity == 0) { quantity = DEFAULT_QUANTITY; } - for (int i = 0; i < quantity; i++ ) { + for (int i = 0; i < quantity; i++) { containerInstances.add(new ContainerIntanceImpl()); } } - + public void setQuantity(int parm) { this.quantity = parm; } - + public int getQuantity() { return containerInstances.size(); } - + public List getContainerInstances() { - return containerInstances; + return containerInstances; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-27 18:59:14
|
Revision: 84 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=84&view=rev Author: tonit Date: 2007-02-27 10:59:06 -0800 (Tue, 27 Feb 2007) Log Message: ----------- initally ported from techne.bat Added Paths: ----------- sandbox/rickles/org.digivitality.techne.core/bin/techne.sh Added: sandbox/rickles/org.digivitality.techne.core/bin/techne.sh =================================================================== --- sandbox/rickles/org.digivitality.techne.core/bin/techne.sh (rev 0) +++ sandbox/rickles/org.digivitality.techne.core/bin/techne.sh 2007-02-27 18:59:06 UTC (rev 84) @@ -0,0 +1,12 @@ +#!/bin/sh +# ----------------------------------------------------------------------------- +# Start Script for Techne Shell Prototype +# 2007/02/27 tonit: initially converted from techne.bat +# ----------------------------------------------------------------------------- +rm -R $HOME/.felix/* +BUNDLEDIR=../bundle +PROPDIR=../conf +BUNDLES=$BUNDLEDIR/org.apache.felix.shell-0.9.0-incubator-SNAPSHOT.jar +CLASSPATH=../classes:../../org.digivitality.techne.shell/classes:../lib/org.apache.felix.main-0.9.0-incubator-SNAPSHOT.jar:../lib/commons-logging-1.0.4.jar:../lib/log4j-1.2.9.jar:$BUNDLES:$PROPDIR +echo Launch VM.. +java -cp $CLASSPATH -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M -Dfelix.config.properties=file:../conf/config.properties org.digivitality.techne.core.Main Property changes on: sandbox/rickles/org.digivitality.techne.core/bin/techne.sh ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2007-02-26 07:57:49
|
Revision: 83 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=83&view=rev Author: rickles Date: 2007-02-25 23:57:48 -0800 (Sun, 25 Feb 2007) Log Message: ----------- Clean up code and initialize container factory. Modified Paths: -------------- sandbox/rickles/org.digivitality.techne.shell/src/org/digivitality/techne/shell/Shell.java Modified: sandbox/rickles/org.digivitality.techne.shell/src/org/digivitality/techne/shell/Shell.java =================================================================== --- sandbox/rickles/org.digivitality.techne.shell/src/org/digivitality/techne/shell/Shell.java 2007-02-26 07:56:05 UTC (rev 82) +++ sandbox/rickles/org.digivitality.techne.shell/src/org/digivitality/techne/shell/Shell.java 2007-02-26 07:57:48 UTC (rev 83) @@ -5,6 +5,7 @@ import java.io.*; import java.text.*; +import java.util.List; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -12,12 +13,15 @@ import org.apache.commons.logging.LogFactory; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkEvent; +import org.osgi.framework.FrameworkListener; import org.osgi.framework.ServiceReference; //import org.ungoverned.osgi.service.shell.ShellService; import org.apache.felix.shell.ShellService; import org.apache.felix.shell.impl.*; import org.apache.felix.framework.*; +import org.digivitality.techne.core.ContainerFactory; import org.digivitality.techne.launch.felix.*; /** @@ -27,21 +31,30 @@ * @author Rick Liton * */ -public class Shell { +public class Shell implements FrameworkListener { - static boolean FRAMEWORK_SET; + private static boolean FRAMEWORK_SET; private String profile = "Peter"; + private static String DEFAULT_CONTAINER_TYPE = "web"; protected static final Log logger = LogFactory.getLog(Shell.class); private boolean stopping = false; - Thread techneThread; - Thread frameworkThread; - FelixLauncher launcher; - FelixFrameworkThread felix; + private ContainerFactory containerFactory; + private Thread techneThread; + private Thread frameworkThread; + protected FelixLauncher launcher; + protected FelixFrameworkThread felix; //static ShellService shellService; - static Method executeCommand; - BundleContext context; + private static Method executeCommand; + private BundleContext context; + protected Shell container; + private List containerInstances; + public Shell() { + + } + public void init() { + container = this; System.out.println("\n===============================================================================\n"); System.out.println(" TTTTTTTTTTT EEEEEEEEE CCCCCCCCCC HHHHH HHHHH NNNNN NNNNN EEEEEEEEE"); System.out.println(" TTTTTTTTTTT EEEEEEEEE CCCCCCCCCC HHHHH HHHHH NNNNNN NNNNN EEEEEEEEE"); @@ -110,16 +123,16 @@ if (FRAMEWORK_SET) { out.print("Framework has already been set to Felix\n"); } else { + felix = new FelixFrameworkThread(); + frameworkThread = new Thread(felix); + frameworkThread.setPriority(1); + frameworkThread.start(); + try { - File file = new File("mytempfile"); - System.out.println("Where am i: " + file.getCanonicalPath()); + } catch (Exception e) { e.printStackTrace(); } - felix = new FelixFrameworkThread(); - frameworkThread = new Thread(felix); - frameworkThread.setPriority(1); - frameworkThread.start(); } } else if (line.equals("exit") || line.equals("quit") ) { stopping = true; @@ -163,18 +176,8 @@ } */ try { - Method m = Felix.class.getDeclaredMethod("getBundle", new Class[] { long.class }); - m.setAccessible(true); - Bundle systemBundle = (Bundle) m.invoke(launcher.getFelix(), new Object[] { new Long(0) }); - System.out.println("systemBundle superclass: " + systemBundle.getClass().getSuperclass().getName()); - Method getContext = systemBundle.getClass().getSuperclass().getDeclaredMethod("getContext", null); - getContext.setAccessible(true); - context = (BundleContext) getContext.invoke(systemBundle, null); - System.out.println("BundleContext: " + context); - //Class clazz = Class.forName("org.apache.felix.shell.ShellService"); - Object[] args = {line, in, out}; - + Object[] args = {line, in, out}; ServiceReference ref = context.getServiceReference(ShellService.class.getName()); if (ref!=null) { Object o = context.getService(ref); @@ -220,6 +223,7 @@ try { launcher = new FelixLauncher(); launcher.launch(); + setContainer(); System.out.print("techne> "); } catch (Exception e) { e.printStackTrace(); @@ -236,4 +240,36 @@ } */ } + + protected void setContainer() { + try { + Method m = Felix.class.getDeclaredMethod("getBundle", new Class[] { long.class }); + m.setAccessible(true); + Bundle systemBundle = (Bundle) m.invoke(launcher.getFelix(), new Object[] { new Long(0) }); + System.out.println("systemBundle superclass: " + systemBundle.getClass().getSuperclass().getName()); + Method getContext = systemBundle.getClass().getSuperclass().getDeclaredMethod("getContext", null); + getContext.setAccessible(true); + context = (BundleContext) getContext.invoke(systemBundle, null); + System.out.println("BundleContext: " + context); + containerFactory = ContainerFactory.getInstance(); + containerFactory.init(); + containerInstances = containerFactory.getContainerInstances(); + System.out.println("Available container instances: " + containerInstances.size()); + System.out.println("Container type: " + DEFAULT_CONTAINER_TYPE); + } catch (Exception e) { + e.printStackTrace(); + } + } + + protected Shell getContainer() { + System.out.println("Container: " + container); + return container; + } + + /* + * need to create a Techne event dispatcher later + */ + public void frameworkEvent(FrameworkEvent event) { + // will implement later + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2007-02-26 07:56:06
|
Revision: 82 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=82&view=rev Author: rickles Date: 2007-02-25 23:56:05 -0800 (Sun, 25 Feb 2007) Log Message: ----------- Implement container factory. Added Paths: ----------- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/interfaces/ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/interfaces/ContainerInstance.java Added: sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/interfaces/ContainerInstance.java =================================================================== --- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/interfaces/ContainerInstance.java (rev 0) +++ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/interfaces/ContainerInstance.java 2007-02-26 07:56:05 UTC (rev 82) @@ -0,0 +1,5 @@ +package org.digivitality.techne.core.interfaces; + +public interface ContainerInstance { + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2007-02-26 07:54:29
|
Revision: 81 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=81&view=rev Author: rickles Date: 2007-02-25 23:54:30 -0800 (Sun, 25 Feb 2007) Log Message: ----------- Implement container factory. Added Paths: ----------- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerFactory.java sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerIntanceImpl.java Added: sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerFactory.java =================================================================== --- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerFactory.java (rev 0) +++ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerFactory.java 2007-02-26 07:54:30 UTC (rev 81) @@ -0,0 +1,51 @@ +package org.digivitality.techne.core; + +import java.util.*; + + +public class ContainerFactory { + + // this will be replaced by techne.properties + private static int DEFAULT_QUANTITY = 3; + private int quantity; + private List containerInstances = new ArrayList(); + private static ContainerFactory instance; + + private ContainerFactory() { + + } + + public Object clone() throws CloneNotSupportedException + { + throw new CloneNotSupportedException("Cloning a singleton is not allowed."); + } + + static synchronized public ContainerFactory getInstance() + { + if (instance==null) { + instance = new ContainerFactory(); + } + return instance; + } + + public void init() { + if (quantity == 0) { + quantity = DEFAULT_QUANTITY; + } + for (int i = 0; i < quantity; i++ ) { + containerInstances.add(new ContainerIntanceImpl()); + } + } + + public void setQuantity(int parm) { + this.quantity = parm; + } + + public int getQuantity() { + return containerInstances.size(); + } + + public List getContainerInstances() { + return containerInstances; + } +} Added: sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerIntanceImpl.java =================================================================== --- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerIntanceImpl.java (rev 0) +++ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/core/ContainerIntanceImpl.java 2007-02-26 07:54:30 UTC (rev 81) @@ -0,0 +1,17 @@ +package org.digivitality.techne.core; + +import org.digivitality.techne.core.interfaces.ContainerInstance; + +public class ContainerIntanceImpl implements ContainerInstance { + + private int id; + private String instanceName; + + public int getId() { + return id; + } + + public String getInstanceName() { + return instanceName; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2007-02-26 07:53:26
|
Revision: 80 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=80&view=rev Author: rickles Date: 2007-02-25 23:53:26 -0800 (Sun, 25 Feb 2007) Log Message: ----------- Added dependencymanager. Modified Paths: -------------- sandbox/rickles/org.digivitality.techne.core/conf/config.properties Modified: sandbox/rickles/org.digivitality.techne.core/conf/config.properties =================================================================== --- sandbox/rickles/org.digivitality.techne.core/conf/config.properties 2007-02-26 07:52:27 UTC (rev 79) +++ sandbox/rickles/org.digivitality.techne.core/conf/config.properties 2007-02-26 07:53:26 UTC (rev 80) @@ -6,6 +6,7 @@ org.osgi.service.startlevel; version=1.0.0, \ org.osgi.service.url; version=1.0.0, \ org.apache.commons.logging, \ + org.digivitality.techne.core, \ ${jre-${java.specification.version}} #org.osgi.framework.bootdelegation=sun.*,com.sun.* @@ -15,7 +16,8 @@ file:../bundle/org.apache.felix.bundlerepository-0.9.0-incubator-SNAPSHOT.jar \ file:../bundle/org.osgi.compendium-0.9.0-incubator-SNAPSHOT.jar \ file:../bundle/javax.servlet-0.9.0-incubator-SNAPSHOT.jar \ - file:../bundle/org.apache.felix.http.jetty-0.8.0-SNAPSHOT.jar + file:../bundle/org.apache.felix.http.jetty-0.8.0-SNAPSHOT.jar \ + file:../bundle/org.apache.felix.dependencymanager-0.9.0-incubator-SNAPSHOT.jar felix.log.level=1 felix.startlevel.framework=1 felix.startlevel.bundle=1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2007-02-26 07:52:29
|
Revision: 79 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=79&view=rev Author: rickles Date: 2007-02-25 23:52:27 -0800 (Sun, 25 Feb 2007) Log Message: ----------- Added dependencymanager and fileinstaller bundles. Added Paths: ----------- sandbox/rickles/org.digivitality.techne.core/bundle/aQute.fileinstall-1.0.jar sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.dependencymanager-0.9.0-incubator-SNAPSHOT.jar Added: sandbox/rickles/org.digivitality.techne.core/bundle/aQute.fileinstall-1.0.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/bundle/aQute.fileinstall-1.0.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.dependencymanager-0.9.0-incubator-SNAPSHOT.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.dependencymanager-0.9.0-incubator-SNAPSHOT.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2007-02-26 07:51:16
|
Revision: 78 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=78&view=rev Author: rickles Date: 2007-02-25 23:51:17 -0800 (Sun, 25 Feb 2007) Log Message: ----------- Added audio example. Added Paths: ----------- sandbox/rickles/org.digivitality.techne.core/bin/load/techne.samples.audio.player-1.0.jar sandbox/rickles/org.digivitality.techne.core/bin/load/techne.samples.audio.samplemusic-1.0.jar sandbox/rickles/org.digivitality.techne.core/bin/load/techne.samples.audio.tui-1.0.jar Added: sandbox/rickles/org.digivitality.techne.core/bin/load/techne.samples.audio.player-1.0.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/bin/load/techne.samples.audio.player-1.0.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: sandbox/rickles/org.digivitality.techne.core/bin/load/techne.samples.audio.samplemusic-1.0.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/bin/load/techne.samples.audio.samplemusic-1.0.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: sandbox/rickles/org.digivitality.techne.core/bin/load/techne.samples.audio.tui-1.0.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/bin/load/techne.samples.audio.tui-1.0.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2007-02-25 04:06:17
|
Revision: 77 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=77&view=rev Author: rickles Date: 2007-02-24 20:06:18 -0800 (Sat, 24 Feb 2007) Log Message: ----------- Checking in the bundles. Added Paths: ----------- sandbox/rickles/org.digivitality.techne.core/bundle/javax.servlet-0.9.0-incubator-SNAPSHOT.jar sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.bundlerepository-0.9.0-incubator-SNAPSHOT.jar sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.log-0.9.0-incubator-SNAPSHOT.jar sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.scr-0.9.0-incubator-SNAPSHOT.jar sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.shell-0.9.0-incubator-SNAPSHOT.jar sandbox/rickles/org.digivitality.techne.core/bundle/org.osgi.compendium-0.9.0-incubator-SNAPSHOT.jar Added: sandbox/rickles/org.digivitality.techne.core/bundle/javax.servlet-0.9.0-incubator-SNAPSHOT.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/bundle/javax.servlet-0.9.0-incubator-SNAPSHOT.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.bundlerepository-0.9.0-incubator-SNAPSHOT.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.bundlerepository-0.9.0-incubator-SNAPSHOT.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.log-0.9.0-incubator-SNAPSHOT.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.log-0.9.0-incubator-SNAPSHOT.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.scr-0.9.0-incubator-SNAPSHOT.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.scr-0.9.0-incubator-SNAPSHOT.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.shell-0.9.0-incubator-SNAPSHOT.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/bundle/org.apache.felix.shell-0.9.0-incubator-SNAPSHOT.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: sandbox/rickles/org.digivitality.techne.core/bundle/org.osgi.compendium-0.9.0-incubator-SNAPSHOT.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/bundle/org.osgi.compendium-0.9.0-incubator-SNAPSHOT.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2007-02-25 03:57:53
|
Revision: 76 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=76&view=rev Author: rickles Date: 2007-02-24 19:57:53 -0800 (Sat, 24 Feb 2007) Log Message: ----------- Upgraded to Felix 0.90 Added Paths: ----------- sandbox/rickles/org.digivitality.techne.core/lib/org.apache.felix.main-0.9.0-incubator-SNAPSHOT.jar Added: sandbox/rickles/org.digivitality.techne.core/lib/org.apache.felix.main-0.9.0-incubator-SNAPSHOT.jar =================================================================== (Binary files differ) Property changes on: sandbox/rickles/org.digivitality.techne.core/lib/org.apache.felix.main-0.9.0-incubator-SNAPSHOT.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2007-02-25 03:55:33
|
Revision: 75 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=75&view=rev Author: rickles Date: 2007-02-24 19:55:29 -0800 (Sat, 24 Feb 2007) Log Message: ----------- Remove Felix shell-tui. Modified Paths: -------------- sandbox/rickles/org.digivitality.techne.core/conf/config.properties Modified: sandbox/rickles/org.digivitality.techne.core/conf/config.properties =================================================================== --- sandbox/rickles/org.digivitality.techne.core/conf/config.properties 2007-02-25 03:54:20 UTC (rev 74) +++ sandbox/rickles/org.digivitality.techne.core/conf/config.properties 2007-02-25 03:55:29 UTC (rev 75) @@ -11,13 +11,11 @@ #org.osgi.framework.bootdelegation=sun.*,com.sun.* felix.auto.start.1= \ - file:../bundle/org.apache.felix.shell-0.8.0-SNAPSHOT.jar \ - file:../bundle/org.apache.felix.shell.tui-0.8.0-SNAPSHOT.jar \ - file:../bundle/org.apache.felix.bundlerepository-0.8.0-SNAPSHOT.jar \ - file:../bundle/org.osgi.compendium-0.8.0-SNAPSHOT.jar \ - file:../bundle/javax.servlet-0.8.0-SNAPSHOT.jar \ - file:../bundle/org.apache.felix.http.jetty-0.8.0-SNAPSHOT.jar \ - file:load/org.digivitality.techne.service-1.0.0.jar + file:../bundle/org.apache.felix.shell-0.9.0-incubator-SNAPSHOT.jar \ + file:../bundle/org.apache.felix.bundlerepository-0.9.0-incubator-SNAPSHOT.jar \ + file:../bundle/org.osgi.compendium-0.9.0-incubator-SNAPSHOT.jar \ + file:../bundle/javax.servlet-0.9.0-incubator-SNAPSHOT.jar \ + file:../bundle/org.apache.felix.http.jetty-0.8.0-SNAPSHOT.jar felix.log.level=1 felix.startlevel.framework=1 felix.startlevel.bundle=1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2007-02-25 03:54:19
|
Revision: 74 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=74&view=rev Author: rickles Date: 2007-02-24 19:54:20 -0800 (Sat, 24 Feb 2007) Log Message: ----------- Upgrade to Felix 0.90 Modified Paths: -------------- sandbox/rickles/org.digivitality.techne.core/bin/techne.bat Modified: sandbox/rickles/org.digivitality.techne.core/bin/techne.bat =================================================================== --- sandbox/rickles/org.digivitality.techne.core/bin/techne.bat 2007-02-15 21:46:04 UTC (rev 73) +++ sandbox/rickles/org.digivitality.techne.core/bin/techne.bat 2007-02-25 03:54:20 UTC (rev 74) @@ -4,8 +4,8 @@ set BUNDLEDIR=../bundle set PROPDIR=../conf -set BUNDLES=%BUNDLEDIR%/org.apache.felix.shell-0.8.0-SNAPSHOT.jar; -set CLASSPATH=../classes;../../org.digivitality.techne.shell/classes;../lib/felix.jar;../lib/commons-logging-1.0.4.jar;../lib/log4j-1.2.9.jar;%BUNDLES%;%PROPDIR%; +set BUNDLES=%BUNDLEDIR%/org.apache.felix.shell-0.9.0-incubator-SNAPSHOT.jar; +set CLASSPATH=../classes;../../org.digivitality.techne.shell/classes;../lib/org.apache.felix.main-0.9.0-incubator-SNAPSHOT.jar;../lib/commons-logging-1.0.4.jar;../lib/log4j-1.2.9.jar;%BUNDLES%;%PROPDIR%; set DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=y -java -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M org.digivitality.techne.core.Main +java -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M -Dfelix.config.properties=file:../conf/config.properties org.digivitality.techne.core.Main This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-15 21:46:10
|
Revision: 73 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=73&view=rev Author: tonit Date: 2007-02-15 13:46:04 -0800 (Thu, 15 Feb 2007) Log Message: ----------- added deprecation comment. hint for new projects added. Modified Paths: -------------- sandbox/tonit/techne.audio/readme Modified: sandbox/tonit/techne.audio/readme =================================================================== --- sandbox/tonit/techne.audio/readme 2007-02-15 21:44:07 UTC (rev 72) +++ sandbox/tonit/techne.audio/readme 2007-02-15 21:46:04 UTC (rev 73) @@ -1,3 +1,23 @@ +DEPRECATED SINCE 15th of feb. 2007 +======================================== +Project splitted into multiple maven-bundle-plugin projects +called: +techne.samples.audio.player +techne.samples.audio.tui +techne.samples.audio.samplemusic +techne.samples.audio.itunes + +Requires bundles from org.apache.felix group: +maven-bundle-plugin (all) +org.osgi.core (all) +org.osgi.compendium (all) +org.apache.felix.shell (tui) + +The player component requires additionally the org.javazoom.jl project +(because there it is not listed on any maven2 repository mirror) + + + What is it ? ================== its a set of osgi bundles. They all make up a family of related bundles but yet communicating over small This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-15 21:44:14
|
Revision: 72 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=72&view=rev Author: tonit Date: 2007-02-15 13:44:07 -0800 (Thu, 15 Feb 2007) Log Message: ----------- Property Changed: ---------------- sandbox/tonit/techne.samples.audio.player/target/ Property changes on: sandbox/tonit/techne.samples.audio.player/target ___________________________________________________________________ Name: svn:ignore + target This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-15 21:38:30
|
Revision: 71 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=71&view=rev Author: tonit Date: 2007-02-15 13:38:25 -0800 (Thu, 15 Feb 2007) Log Message: ----------- Property Changed: ---------------- sandbox/tonit/org.javazoom.jl/ Property changes on: sandbox/tonit/org.javazoom.jl ___________________________________________________________________ Name: svn:ignore + target This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-15 21:37:02
|
Revision: 70 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=70&view=rev Author: tonit Date: 2007-02-15 13:37:01 -0800 (Thu, 15 Feb 2007) Log Message: ----------- transfered library to maven2/maven-bundle-plugin project because it is not listed on maven mirrors..:-( Added Paths: ----------- sandbox/tonit/org.javazoom.jl/.classpath sandbox/tonit/org.javazoom.jl/.project sandbox/tonit/org.javazoom.jl/pom.xml sandbox/tonit/org.javazoom.jl/src/ sandbox/tonit/org.javazoom.jl/src/main/ sandbox/tonit/org.javazoom.jl/src/main/java/ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/Converter.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/RiffFile.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/WaveFile.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/WaveFileObuffer.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/jlc.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/BitReserve.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/Bitstream.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/BitstreamErrors.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/BitstreamException.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/Control.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/Crc16.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/Decoder.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/DecoderErrors.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/DecoderException.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/Equalizer.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/FrameDecoder.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/Header.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/InputStreamSource.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/JavaLayerError.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/JavaLayerErrors.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/JavaLayerException.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/JavaLayerHook.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/JavaLayerUtils.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/LayerIDecoder.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/LayerIIDecoder.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/LayerIIIDecoder.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/Manager.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/Obuffer.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/OutputChannels.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/SampleBuffer.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/Source.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/SynthesisFilter.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/au2lin.ser sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/huffcodetab.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/l3reorder.ser sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/lin2au.ser sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/readme.txt sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/sfd.ser sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/AudioDevice.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/AudioDeviceBase.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/AudioDeviceFactory.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/FactoryRegistry.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/JavaSoundAudioDevice.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/JavaSoundAudioDeviceFactory.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/NullAudioDevice.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/Player.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/PlayerApplet.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/advanced/ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/advanced/AdvancedPlayer.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/advanced/PlaybackEvent.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/advanced/PlaybackListener.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/advanced/jlap.java sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/player/jlp.java sandbox/tonit/org.javazoom.jl/src/test/ sandbox/tonit/org.javazoom.jl/src/test/java/ sandbox/tonit/org.javazoom.jl/src/test/java/org/ sandbox/tonit/org.javazoom.jl/src/test/java/org/javazoom/ sandbox/tonit/org.javazoom.jl/src/test/java/org/javazoom/AppTest.java Added: sandbox/tonit/org.javazoom.jl/.classpath =================================================================== --- sandbox/tonit/org.javazoom.jl/.classpath (rev 0) +++ sandbox/tonit/org.javazoom.jl/.classpath 2007-02-15 21:37:01 UTC (rev 70) @@ -0,0 +1,7 @@ +<classpath> + <classpathentry kind="src" path="src/main/java"/> + <classpathentry kind="src" path="src/test/java" output="target/test-classes"/> + <classpathentry kind="output" path="target/classes"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/> +</classpath> \ No newline at end of file Added: sandbox/tonit/org.javazoom.jl/.project =================================================================== --- sandbox/tonit/org.javazoom.jl/.project (rev 0) +++ sandbox/tonit/org.javazoom.jl/.project 2007-02-15 21:37:01 UTC (rev 70) @@ -0,0 +1,13 @@ +<projectDescription> + <name>org.javazoom.jl</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> \ No newline at end of file Added: sandbox/tonit/org.javazoom.jl/pom.xml =================================================================== --- sandbox/tonit/org.javazoom.jl/pom.xml (rev 0) +++ sandbox/tonit/org.javazoom.jl/pom.xml 2007-02-15 21:37:01 UTC (rev 70) @@ -0,0 +1,18 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.javazoom</groupId> + <artifactId>org.javazoom.jl</artifactId> + <packaging>jar</packaging> + <version>1.0-SNAPSHOT</version> + <name>org.javazoom.jl</name> + <url>http://maven.apache.org</url> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> Added: sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/Converter.java =================================================================== --- sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/Converter.java (rev 0) +++ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/Converter.java 2007-02-15 21:37:01 UTC (rev 70) @@ -0,0 +1,411 @@ +/* + * 11/19/04 1.0 moved to LGPL. + * 12/12/99 Original verion. md...@te.... + *----------------------------------------------------------------------- + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *---------------------------------------------------------------------- + */ + +package javazoom.jl.converter; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; + +import javazoom.jl.decoder.Bitstream; +import javazoom.jl.decoder.Decoder; +import javazoom.jl.decoder.Header; +import javazoom.jl.decoder.JavaLayerException; +import javazoom.jl.decoder.Obuffer; + +/** + * The <code>Converter</code> class implements the conversion of + * an MPEG audio file to a .WAV file. To convert an MPEG audio stream, + * just create an instance of this class and call the convert() + * method, passing in the names of the input and output files. You can + * pass in optional <code>ProgressListener</code> and + * <code>Decoder.Params</code> objects also to customize the conversion. + * + * @author MDM 12/12/99 + * @since 0.0.7 + */ +public class Converter +{ + /** + * Creates a new converter instance. + */ + public Converter() + { + } + + public synchronized void convert(String sourceName, String destName) + throws JavaLayerException + { + convert(sourceName, destName, null, null); + } + + public synchronized void convert(String sourceName, String destName, + ProgressListener progressListener) + throws JavaLayerException + { + convert(sourceName, destName, progressListener, null); + } + + + public void convert(String sourceName, String destName, + ProgressListener progressListener, Decoder.Params decoderParams) + throws JavaLayerException + { + if (destName.length()==0) + destName = null; + try { + InputStream in = openInput(sourceName); + convert(in, destName, progressListener, decoderParams); + in.close(); + } catch(IOException ioe) { + throw new JavaLayerException(ioe.getLocalizedMessage(), ioe); + } + } + + public synchronized void convert(InputStream sourceStream, String destName, + ProgressListener progressListener, Decoder.Params decoderParams) + throws JavaLayerException + { + if (progressListener==null) + progressListener = PrintWriterProgressListener.newStdOut( + PrintWriterProgressListener.NO_DETAIL); + try { + if (!(sourceStream instanceof BufferedInputStream)) + sourceStream = new BufferedInputStream(sourceStream); + int frameCount = -1; + if (sourceStream.markSupported()) { + sourceStream.mark(-1); + frameCount = countFrames(sourceStream); + sourceStream.reset(); + } + progressListener.converterUpdate(ProgressListener.UPDATE_FRAME_COUNT, frameCount, 0); + + + Obuffer output = null; + Decoder decoder = new Decoder(decoderParams); + Bitstream stream = new Bitstream(sourceStream); + + if (frameCount==-1) + frameCount = Integer.MAX_VALUE; + + int frame = 0; + long startTime = System.currentTimeMillis(); + + try + { + for (; frame<frameCount; frame++) + { + try + { + Header header = stream.readFrame(); + if (header==null) + break; + + progressListener.readFrame(frame, header); + + if (output==null) + { + // REVIEW: Incorrect functionality. + // the decoder should provide decoded + // frequency and channels output as it may differ from + // the source (e.g. when downmixing stereo to mono.) + int channels = (header.mode()==Header.SINGLE_CHANNEL) ? 1 : 2; + int freq = header.frequency(); + output = new WaveFileObuffer(channels, freq, destName); + decoder.setOutputBuffer(output); + } + + Obuffer decoderOutput = decoder.decodeFrame(header, stream); + + // REVIEW: the way the output buffer is set + // on the decoder is a bit dodgy. Even though + // this exception should never happen, we test to be sure. + if (decoderOutput!=output) + throw new InternalError("Output buffers are different."); + + + progressListener.decodedFrame(frame, header, output); + + stream.closeFrame(); + + } + catch (Exception ex) + { + boolean stop = !progressListener.converterException(ex); + + if (stop) + { + throw new JavaLayerException(ex.getLocalizedMessage(), ex); + } + } + } + + } + finally + { + + if (output!=null) + output.close(); + } + + int time = (int)(System.currentTimeMillis()-startTime); + progressListener.converterUpdate(ProgressListener.UPDATE_CONVERT_COMPLETE, + time, frame); + } + catch (IOException ex) + { + throw new JavaLayerException(ex.getLocalizedMessage(), ex); + } + } + + + protected int countFrames(InputStream in) + { + return -1; + } + + + protected InputStream openInput(String fileName) + throws IOException + { + // ensure name is abstract path name + File file = new File(fileName); + InputStream fileIn = new FileInputStream(file); + BufferedInputStream bufIn = new BufferedInputStream(fileIn); + + return bufIn; + } + + + /** + * This interface is used by the Converter to provide + * notification of tasks being carried out by the converter, + * and to provide new information as it becomes available. + */ + + static public interface ProgressListener + { + public static final int UPDATE_FRAME_COUNT = 1; + + /** + * Conversion is complete. Param1 contains the time + * to convert in milliseconds. Param2 contains the number + * of MPEG audio frames converted. + */ + public static final int UPDATE_CONVERT_COMPLETE = 2; + + + /** + * Notifies the listener that new information is available. + * + * @param updateID Code indicating the information that has been + * updated. + * + * @param param1 Parameter whose value depends upon the update code. + * @param param2 Parameter whose value depends upon the update code. + * + * The <code>updateID</code> parameter can take these values: + * + * UPDATE_FRAME_COUNT: param1 is the frame count, or -1 if not known. + * UPDATE_CONVERT_COMPLETE: param1 is the conversion time, param2 + * is the number of frames converted. + */ + public void converterUpdate(int updateID, int param1, int param2); + + /** + * If the converter wishes to make a first pass over the + * audio frames, this is called as each frame is parsed. + */ + public void parsedFrame(int frameNo, Header header); + + /** + * This method is called after each frame has been read, + * but before it has been decoded. + * + * @param frameNo The 0-based sequence number of the frame. + * @param header The Header rerpesenting the frame just read. + */ + public void readFrame(int frameNo, Header header); + + /** + * This method is called after a frame has been decoded. + * + * @param frameNo The 0-based sequence number of the frame. + * @param header The Header rerpesenting the frame just read. + * @param o The Obuffer the deocded data was written to. + */ + public void decodedFrame(int frameNo, Header header, Obuffer o); + + /** + * Called when an exception is thrown during while converting + * a frame. + * + * @param t The <code>Throwable</code> instance that + * was thrown. + * + * @return <code>true</code> to continue processing, or false + * to abort conversion. + * + * If this method returns <code>false</code>, the exception + * is propagated to the caller of the convert() method. If + * <code>true</code> is returned, the exception is silently + * ignored and the converter moves onto the next frame. + */ + public boolean converterException(Throwable t); + + } + + + /** + * Implementation of <code>ProgressListener</code> that writes + * notification text to a <code>PrintWriter</code>. + */ + // REVIEW: i18n of text and order required. + static public class PrintWriterProgressListener implements ProgressListener + { + static public final int NO_DETAIL = 0; + + /** + * Level of detail typically expected of expert + * users. + */ + static public final int EXPERT_DETAIL = 1; + + /** + * Verbose detail. + */ + static public final int VERBOSE_DETAIL = 2; + + /** + * Debug detail. All frame read notifications are shown. + */ + static public final int DEBUG_DETAIL = 7; + + static public final int MAX_DETAIL = 10; + + private PrintWriter pw; + + private int detailLevel; + + static public PrintWriterProgressListener newStdOut(int detail) + { + return new PrintWriterProgressListener( + new PrintWriter(System.out, true), detail); + } + + public PrintWriterProgressListener(PrintWriter writer, int detailLevel) + { + this.pw = writer; + this.detailLevel = detailLevel; + } + + + public boolean isDetail(int detail) + { + return (this.detailLevel >= detail); + } + + public void converterUpdate(int updateID, int param1, int param2) + { + if (isDetail(VERBOSE_DETAIL)) + { + switch (updateID) + { + case UPDATE_CONVERT_COMPLETE: + // catch divide by zero errors. + if (param2==0) + param2 = 1; + + pw.println(); + pw.println("Converted "+param2+" frames in "+param1+" ms ("+ + (param1/param2)+" ms per frame.)"); + } + } + } + + public void parsedFrame(int frameNo, Header header) + { + if ((frameNo==0) && isDetail(VERBOSE_DETAIL)) + { + String headerString = header.toString(); + pw.println("File is a "+headerString); + } + else if (isDetail(MAX_DETAIL)) + { + String headerString = header.toString(); + pw.println("Prased frame "+frameNo+": "+headerString); + } + } + + public void readFrame(int frameNo, Header header) + { + if ((frameNo==0) && isDetail(VERBOSE_DETAIL)) + { + String headerString = header.toString(); + pw.println("File is a "+headerString); + } + else if (isDetail(MAX_DETAIL)) + { + String headerString = header.toString(); + pw.println("Read frame "+frameNo+": "+headerString); + } + } + + public void decodedFrame(int frameNo, Header header, Obuffer o) + { + if (isDetail(MAX_DETAIL)) + { + String headerString = header.toString(); + pw.println("Decoded frame "+frameNo+": "+headerString); + pw.println("Output: "+o); + } + else if (isDetail(VERBOSE_DETAIL)) + { + if (frameNo==0) + { + pw.print("Converting."); + pw.flush(); + } + + if ((frameNo % 10)==0) + { + pw.print('.'); + pw.flush(); + } + } + } + + public boolean converterException(Throwable t) + { + if (this.detailLevel>NO_DETAIL) + { + t.printStackTrace(pw); + pw.flush(); + } + return false; + } + + } + + +} \ No newline at end of file Added: sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/RiffFile.java =================================================================== --- sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/RiffFile.java (rev 0) +++ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/RiffFile.java 2007-02-15 21:37:01 UTC (rev 70) @@ -0,0 +1,495 @@ +/* + * 11/19/04 1.0 moved to LGPL. + * 02/23/99 JavaConversion by E.B + * Don Cross, April 1993. + * RIFF file format classes. + * See Chapter 8 of "Multimedia Programmer's Reference" in + * the Microsoft Windows SDK. + * + *----------------------------------------------------------------------- + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *---------------------------------------------------------------------- + */ + +package javazoom.jl.converter; + +import java.io.IOException; +import java.io.RandomAccessFile; + + +/** + * Class to manage RIFF files + */ +public class RiffFile +{ + class RiffChunkHeader + { + public int ckID = 0; // Four-character chunk ID + public int ckSize = 0; // Length of data in chunk + public RiffChunkHeader() + {} + } + + + // DDCRET + public static final int DDC_SUCCESS = 0; // The operation succeded + public static final int DDC_FAILURE = 1; // The operation failed for unspecified reasons + public static final int DDC_OUT_OF_MEMORY = 2; // Operation failed due to running out of memory + public static final int DDC_FILE_ERROR = 3; // Operation encountered file I/O error + public static final int DDC_INVALID_CALL = 4; // Operation was called with invalid parameters + public static final int DDC_USER_ABORT = 5; // Operation was aborted by the user + public static final int DDC_INVALID_FILE = 6; // File format does not match + + // RiffFileMode + public static final int RFM_UNKNOWN = 0; // undefined type (can use to mean "N/A" or "not open") + public static final int RFM_WRITE = 1; // open for write + public static final int RFM_READ = 2; // open for read + + private RiffChunkHeader riff_header; // header for whole file + protected int fmode; // current file I/O mode + protected RandomAccessFile file; // I/O stream to use + + /** + * Dummy Constructor + */ + public RiffFile() + { + file = null; + fmode = RFM_UNKNOWN; + riff_header = new RiffChunkHeader(); + + riff_header.ckID = FourCC("RIFF"); + riff_header.ckSize = 0; + } + + /** + * Return File Mode. + */ + public int CurrentFileMode() + {return fmode;} + + /** + * Open a RIFF file. + */ + public int Open(String Filename, int NewMode) + { + int retcode = DDC_SUCCESS; + + if ( fmode != RFM_UNKNOWN ) + { + retcode = Close(); + } + + if ( retcode == DDC_SUCCESS ) + { + switch ( NewMode ) + { + case RFM_WRITE: + try + { + file = new RandomAccessFile(Filename,"rw"); + + try + { + // Write the RIFF header... + // We will have to come back later and patch it! + byte[] br = new byte[8]; + br[0] = (byte) ((riff_header.ckID >>> 24) & 0x000000FF); + br[1] = (byte) ((riff_header.ckID >>> 16) & 0x000000FF); + br[2] = (byte) ((riff_header.ckID >>> 8) & 0x000000FF); + br[3] = (byte) (riff_header.ckID & 0x000000FF); + + byte br4 = (byte) ((riff_header.ckSize >>> 24)& 0x000000FF); + byte br5 = (byte) ((riff_header.ckSize >>> 16)& 0x000000FF); + byte br6 = (byte) ((riff_header.ckSize >>> 8)& 0x000000FF); + byte br7 = (byte) (riff_header.ckSize & 0x000000FF); + + br[4] = br7; + br[5] = br6; + br[6] = br5; + br[7] = br4; + + file.write(br,0,8); + fmode = RFM_WRITE; + } catch (IOException ioe) + { + file.close(); + fmode = RFM_UNKNOWN; + } + } catch (IOException ioe) + { + fmode = RFM_UNKNOWN; + retcode = DDC_FILE_ERROR; + } + break; + + case RFM_READ: + try + { + file = new RandomAccessFile(Filename,"r"); + try + { + // Try to read the RIFF header... + byte[] br = new byte[8]; + file.read(br,0,8); + fmode = RFM_READ; + riff_header.ckID = ((br[0]<<24)& 0xFF000000) | ((br[1]<<16)&0x00FF0000) | ((br[2]<<8)&0x0000FF00) | (br[3]&0x000000FF); + riff_header.ckSize = ((br[4]<<24)& 0xFF000000) | ((br[5]<<16)&0x00FF0000) | ((br[6]<<8)&0x0000FF00) | (br[7]&0x000000FF); + } catch (IOException ioe) + { + file.close(); + fmode = RFM_UNKNOWN; + } + } catch (IOException ioe) + { + fmode = RFM_UNKNOWN; + retcode = DDC_FILE_ERROR; + } + break; + default: + retcode = DDC_INVALID_CALL; + } + } + return retcode; + } + + /** + * Write NumBytes data. + */ + public int Write(byte[] Data, int NumBytes ) + { + if ( fmode != RFM_WRITE ) + { + return DDC_INVALID_CALL; + } + try + { + file.write(Data,0,NumBytes); + fmode = RFM_WRITE; + } + catch (IOException ioe) + { + return DDC_FILE_ERROR; + } + riff_header.ckSize += NumBytes; + return DDC_SUCCESS; + } + + + + /** + * Write NumBytes data. + */ + public int Write(short[] Data, int NumBytes ) + { + byte[] theData = new byte[NumBytes]; + int yc = 0; + for (int y = 0;y<NumBytes;y=y+2) + { + theData[y] = (byte) (Data[yc] & 0x00FF); + theData[y+1] =(byte) ((Data[yc++] >>> 8) & 0x00FF); + } + if ( fmode != RFM_WRITE ) + { + return DDC_INVALID_CALL; + } + try + { + file.write(theData,0,NumBytes); + fmode = RFM_WRITE; + } + catch (IOException ioe) + { + return DDC_FILE_ERROR; + } + riff_header.ckSize += NumBytes; + return DDC_SUCCESS; + } + + /** + * Write NumBytes data. + */ + public int Write(RiffChunkHeader Triff_header, int NumBytes ) + { + byte[] br = new byte[8]; + br[0] = (byte) ((Triff_header.ckID >>> 24) & 0x000000FF); + br[1] = (byte) ((Triff_header.ckID >>> 16) & 0x000000FF); + br[2] = (byte) ((Triff_header.ckID >>> 8) & 0x000000FF); + br[3] = (byte) (Triff_header.ckID & 0x000000FF); + + byte br4 = (byte) ((Triff_header.ckSize >>> 24)& 0x000000FF); + byte br5 = (byte) ((Triff_header.ckSize >>> 16)& 0x000000FF); + byte br6 = (byte) ((Triff_header.ckSize >>> 8)& 0x000000FF); + byte br7 = (byte) (Triff_header.ckSize & 0x000000FF); + + br[4] = br7; + br[5] = br6; + br[6] = br5; + br[7] = br4; + + if ( fmode != RFM_WRITE ) + { + return DDC_INVALID_CALL; + } + try + { + file.write(br,0,NumBytes); + fmode = RFM_WRITE; + } catch (IOException ioe) + { + return DDC_FILE_ERROR; + } + riff_header.ckSize += NumBytes; + return DDC_SUCCESS; + } + + /** + * Write NumBytes data. + */ + public int Write(short Data, int NumBytes ) + { + short theData = (short) ( ((Data>>>8)&0x00FF) | ((Data<<8)&0xFF00) ); + if ( fmode != RFM_WRITE ) + { + return DDC_INVALID_CALL; + } + try + { + file.writeShort(theData); + fmode = RFM_WRITE; + } catch (IOException ioe) + { + return DDC_FILE_ERROR; + } + riff_header.ckSize += NumBytes; + return DDC_SUCCESS; + } + /** + * Write NumBytes data. + */ + public int Write(int Data, int NumBytes ) + { + short theDataL = (short) ((Data>>>16)&0x0000FFFF); + short theDataR = (short) (Data&0x0000FFFF); + short theDataLI = (short) ( ((theDataL>>>8)&0x00FF) | ((theDataL<<8)&0xFF00) ); + short theDataRI = (short) ( ((theDataR>>>8)&0x00FF) | ((theDataR<<8)&0xFF00) ); + int theData = ((theDataRI<<16)&0xFFFF0000) | (theDataLI&0x0000FFFF); + if ( fmode != RFM_WRITE ) + { + return DDC_INVALID_CALL; + } + try + { + file.writeInt(theData); + fmode = RFM_WRITE; + } catch (IOException ioe) + { + return DDC_FILE_ERROR; + } + riff_header.ckSize += NumBytes; + return DDC_SUCCESS; + } + + + + /** + * Read NumBytes data. + */ + public int Read (byte[] Data, int NumBytes) + { + int retcode = DDC_SUCCESS; + try + { + file.read(Data,0,NumBytes); + } catch (IOException ioe) + { + retcode = DDC_FILE_ERROR; + } + return retcode; + } + + /** + * Expect NumBytes data. + */ + public int Expect(String Data, int NumBytes ) + { + byte target = 0; + int cnt = 0; + try + { + while ((NumBytes--) != 0) + { + target = file.readByte(); + if (target != Data.charAt(cnt++)) return DDC_FILE_ERROR; + } + } catch (IOException ioe) + { + return DDC_FILE_ERROR; + } + return DDC_SUCCESS; + } + + /** + * Close Riff File. + * Length is written too. + */ + public int Close() + { + int retcode = DDC_SUCCESS; + + switch ( fmode ) + { + case RFM_WRITE: + try + { + file.seek(0); + try + { + byte[] br = new byte[8]; + br[0] = (byte) ((riff_header.ckID >>> 24) & 0x000000FF); + br[1] = (byte) ((riff_header.ckID >>> 16) & 0x000000FF); + br[2] = (byte) ((riff_header.ckID >>> 8) & 0x000000FF); + br[3] = (byte) (riff_header.ckID & 0x000000FF); + + br[7] = (byte) ((riff_header.ckSize >>> 24)& 0x000000FF); + br[6] = (byte) ((riff_header.ckSize >>> 16)& 0x000000FF); + br[5] = (byte) ((riff_header.ckSize >>> 8)& 0x000000FF); + br[4] = (byte) (riff_header.ckSize & 0x000000FF); + file.write(br,0,8); + file.close(); + } catch (IOException ioe) + { + retcode = DDC_FILE_ERROR; + } + } catch (IOException ioe) + { + retcode = DDC_FILE_ERROR; + } + break; + + case RFM_READ: + try + { + file.close(); + } catch (IOException ioe) + { + retcode = DDC_FILE_ERROR; + } + break; + } + file = null; + fmode = RFM_UNKNOWN; + return retcode; + } + + /** + * Return File Position. + */ + public long CurrentFilePosition() + { + long position; + try + { + position = file.getFilePointer(); + } catch (IOException ioe) + { + position = -1; + } + return position; + } + + /** + * Write Data to specified offset. + */ + public int Backpatch (long FileOffset, RiffChunkHeader Data, int NumBytes ) + { + if (file == null) + { + return DDC_INVALID_CALL; + } + try + { + file.seek(FileOffset); + } catch (IOException ioe) + { + return DDC_FILE_ERROR; + } + return Write ( Data, NumBytes ); + } + + public int Backpatch (long FileOffset, byte[] Data, int NumBytes ) + { + if (file == null) + { + return DDC_INVALID_CALL; + } + try + { + file.seek(FileOffset); + } catch (IOException ioe) + { + return DDC_FILE_ERROR; + } + return Write ( Data, NumBytes ); + } + + + /** + * Seek in the File. + */ + protected int Seek(long offset) + { + int rc; + try + { + file.seek(offset); + rc = DDC_SUCCESS; + } catch (IOException ioe) + { + rc = DDC_FILE_ERROR; + } + return rc; + } + + /** + * Error Messages. + */ + private String DDCRET_String(int retcode) + { + switch ( retcode ) + { + case DDC_SUCCESS: return "DDC_SUCCESS"; + case DDC_FAILURE: return "DDC_FAILURE"; + case DDC_OUT_OF_MEMORY: return "DDC_OUT_OF_MEMORY"; + case DDC_FILE_ERROR: return "DDC_FILE_ERROR"; + case DDC_INVALID_CALL: return "DDC_INVALID_CALL"; + case DDC_USER_ABORT: return "DDC_USER_ABORT"; + case DDC_INVALID_FILE: return "DDC_INVALID_FILE"; + } + return "Unknown Error"; + } + + /** + * Fill the header. + */ + public static int FourCC(String ChunkName) + { + byte[] p = {0x20,0x20,0x20,0x20}; + ChunkName.getBytes(0,4,p,0); + int ret = (((p[0] << 24)& 0xFF000000) | ((p[1] << 16)&0x00FF0000) | ((p[2] << 8)&0x0000FF00) | (p[3]&0x000000FF)); + return ret; + } + +} Added: sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/WaveFile.java =================================================================== --- sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/WaveFile.java (rev 0) +++ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/WaveFile.java 2007-02-15 21:37:01 UTC (rev 70) @@ -0,0 +1,522 @@ +/* + * 11/19/04 1.0 moved to LGPL. + * 02/23/99 JavaConversion by E.B + * Don Cross, April 1993. + * RIFF file format classes. + * See Chapter 8 of "Multimedia Programmer's Reference" in + * the Microsoft Windows SDK. + * + *----------------------------------------------------------------------- + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *---------------------------------------------------------------------- + */ + +package javazoom.jl.converter; + +/** + * Class allowing WaveFormat Access + */ +public class WaveFile extends RiffFile +{ + public static final int MAX_WAVE_CHANNELS = 2; + + class WaveFormat_ChunkData + { + public short wFormatTag = 0; // Format category (PCM=1) + public short nChannels = 0; // Number of channels (mono=1, stereo=2) + public int nSamplesPerSec = 0; // Sampling rate [Hz] + public int nAvgBytesPerSec = 0; + public short nBlockAlign = 0; + public short nBitsPerSample = 0; + + public WaveFormat_ChunkData() + { + wFormatTag = 1; // PCM + Config(44100,(short)16,(short)1); + } + + public void Config (int NewSamplingRate, short NewBitsPerSample, short NewNumChannels) + { + nSamplesPerSec = NewSamplingRate; + nChannels = NewNumChannels; + nBitsPerSample = NewBitsPerSample; + nAvgBytesPerSec = (nChannels * nSamplesPerSec * nBitsPerSample) / 8; + nBlockAlign = (short) ((nChannels * nBitsPerSample) / 8); + } + } + + + class WaveFormat_Chunk + { + public RiffChunkHeader header; + public WaveFormat_ChunkData data; + + public WaveFormat_Chunk() + { + header = new RiffChunkHeader(); + data = new WaveFormat_ChunkData(); + header.ckID = FourCC("fmt "); + header.ckSize = 16; + } + + public int VerifyValidity() + { + boolean ret = header.ckID == FourCC("fmt ") && + + (data.nChannels == 1 || data.nChannels == 2) && + + data.nAvgBytesPerSec == ( data.nChannels * + data.nSamplesPerSec * + data.nBitsPerSample ) / 8 && + + data.nBlockAlign == ( data.nChannels * + data.nBitsPerSample ) / 8; + if (ret == true) return 1; + else return 0; + } + } + + public class WaveFileSample + { + public short[] chan; + + public WaveFileSample() + {chan = new short[WaveFile.MAX_WAVE_CHANNELS];} + } + + private WaveFormat_Chunk wave_format; + private RiffChunkHeader pcm_data; + private long pcm_data_offset = 0; // offset of 'pcm_data' in output file + private int num_samples = 0; + + + /** + * Constructs a new WaveFile instance. + */ + public WaveFile() + { + pcm_data = new RiffChunkHeader(); + wave_format = new WaveFormat_Chunk(); + pcm_data.ckID = FourCC("data"); + pcm_data.ckSize = 0; + num_samples = 0; + } + + /** + * + * + public int OpenForRead (String Filename) + { + // Verify filename parameter as best we can... + if (Filename == null) + { + return DDC_INVALID_CALL; + } + int retcode = Open ( Filename, RFM_READ ); + + if ( retcode == DDC_SUCCESS ) + { + retcode = Expect ( "WAVE", 4 ); + + if ( retcode == DDC_SUCCESS ) + { + retcode = Read(wave_format,24); + + if ( retcode == DDC_SUCCESS && !wave_format.VerifyValidity() ) + { + // This isn't standard PCM, so we don't know what it is! + retcode = DDC_FILE_ERROR; + } + + if ( retcode == DDC_SUCCESS ) + { + pcm_data_offset = CurrentFilePosition(); + + // Figure out number of samples from + // file size, current file position, and + // WAVE header. + retcode = Read (pcm_data, 8 ); + num_samples = filelength(fileno(file)) - CurrentFilePosition(); + num_samples /= NumChannels(); + num_samples /= (BitsPerSample() / 8); + } + } + } + return retcode; + }*/ + + /** + * + */ + public int OpenForWrite (String Filename, int SamplingRate, short BitsPerSample, short NumChannels) + { + // Verify parameters... + if ( (Filename==null) || + (BitsPerSample != 8 && BitsPerSample != 16) || + NumChannels < 1 || NumChannels > 2 ) + { + return DDC_INVALID_CALL; + } + + wave_format.data.Config ( SamplingRate, BitsPerSample, NumChannels ); + + int retcode = Open ( Filename, RFM_WRITE ); + + if ( retcode == DDC_SUCCESS ) + { + byte [] theWave = {(byte)'W',(byte)'A',(byte)'V',(byte)'E'}; + retcode = Write ( theWave, 4 ); + + if ( retcode == DDC_SUCCESS ) + { + // Ecriture de wave_format + retcode = Write (wave_format.header, 8); + retcode = Write (wave_format.data.wFormatTag, 2); + retcode = Write (wave_format.data.nChannels, 2); + retcode = Write (wave_format.data.nSamplesPerSec, 4); + retcode = Write (wave_format.data.nAvgBytesPerSec, 4); + retcode = Write (wave_format.data.nBlockAlign, 2); + retcode = Write (wave_format.data.nBitsPerSample, 2); + /* byte[] br = new byte[16]; + br[0] = (byte) ((wave_format.data.wFormatTag >> 8) & 0x00FF); + br[1] = (byte) (wave_format.data.wFormatTag & 0x00FF); + + br[2] = (byte) ((wave_format.data.nChannels >> 8) & 0x00FF); + br[3] = (byte) (wave_format.data.nChannels & 0x00FF); + + br[4] = (byte) ((wave_format.data.nSamplesPerSec >> 24)& 0x000000FF); + br[5] = (byte) ((wave_format.data.nSamplesPerSec >> 16)& 0x000000FF); + br[6] = (byte) ((wave_format.data.nSamplesPerSec >> 8)& 0x000000FF); + br[7] = (byte) (wave_format.data.nSamplesPerSec & 0x000000FF); + + br[8] = (byte) ((wave_format.data.nAvgBytesPerSec>> 24)& 0x000000FF); + br[9] = (byte) ((wave_format.data.nAvgBytesPerSec >> 16)& 0x000000FF); + br[10] = (byte) ((wave_format.data.nAvgBytesPerSec >> 8)& 0x000000FF); + br[11] = (byte) (wave_format.data.nAvgBytesPerSec & 0x000000FF); + + br[12] = (byte) ((wave_format.data.nBlockAlign >> 8) & 0x00FF); + br[13] = (byte) (wave_format.data.nBlockAlign & 0x00FF); + + br[14] = (byte) ((wave_format.data.nBitsPerSample >> 8) & 0x00FF); + br[15] = (byte) (wave_format.data.nBitsPerSample & 0x00FF); + retcode = Write (br, 16); */ + + + if ( retcode == DDC_SUCCESS ) + { + pcm_data_offset = CurrentFilePosition(); + retcode = Write ( pcm_data, 8 ); + } + } + } + + return retcode; + } + + /** + * + * + public int ReadSample ( short[] Sample ) + { + + }*/ + + /** + * + * + public int WriteSample( short[] Sample ) + { + int retcode = DDC_SUCCESS; + switch ( wave_format.data.nChannels ) + { + case 1: + switch ( wave_format.data.nBitsPerSample ) + { + case 8: + pcm_data.ckSize += 1; + retcode = Write ( Sample, 1 ); + break; + + case 16: + pcm_data.ckSize += 2; + retcode = Write ( Sample, 2 ); + break; + + default: + retcode = DDC_INVALID_CALL; + } + break; + + case 2: + switch ( wave_format.data.nBitsPerSample ) + { + case 8: + retcode = Write ( Sample, 1 ); + if ( retcode == DDC_SUCCESS ) + { + // &Sample[1] + retcode = Write (Sample, 1 ); + if ( retcode == DDC_SUCCESS ) + { + pcm_data.ckSize += 2; + } + } + break; + + case 16: + retcode = Write ( Sample, 2 ); + if ( retcode == DDC_SUCCESS ) + { + // &Sample[1] + retcode = Write (Sample, 2 ); + if ( retcode == DDC_SUCCESS ) + { + pcm_data.ckSize += 4; + } + } + break; + + default: + retcode = DDC_INVALID_CALL; + } + break; + + default: + retcode = DDC_INVALID_CALL; + } + + return retcode; + }*/ + + /** + * + * + public int SeekToSample ( long SampleIndex ) + { + if ( SampleIndex >= NumSamples() ) + { + return DDC_INVALID_CALL; + } + int SampleSize = (BitsPerSample() + 7) / 8; + int rc = Seek ( pcm_data_offset + 8 + + SampleSize * NumChannels() * SampleIndex ); + return rc; + }*/ + + /** + * Write 16-bit audio + */ + public int WriteData ( short[] data, int numData ) + { + int extraBytes = numData * 2; + pcm_data.ckSize += extraBytes; + return super.Write ( data, extraBytes ); + } + + /** + * Read 16-bit audio. + * + public int ReadData (short[] data, int numData) + {return super.Read ( data, numData * 2);} */ + + /** + * Write 8-bit audio. + * + public int WriteData ( byte[] data, int numData ) + { + pcm_data.ckSize += numData; + return super.Write ( data, numData ); + }*/ + + /** + * Read 8-bit audio. + * + public int ReadData ( byte[] data, int numData ) + {return super.Read ( data, numData );} */ + + + /** + * + * + public int ReadSamples (int num, int [] WaveFileSample) + { + + }*/ + + /** + * + * + public int WriteMonoSample ( short[] SampleData ) + { + switch ( wave_format.data.nBitsPerSample ) + { + case 8: + pcm_data.ckSize += 1; + return Write ( SampleData, 1 ); + + case 16: + pcm_data.ckSize += 2; + return Write ( SampleData, 2 ); + } + return DDC_INVALID_CALL; + }*/ + + /** + * + * + public int WriteStereoSample ( short[] LeftSample, short[] RightSample ) + { + int retcode = DDC_SUCCESS; + switch ( wave_format.data.nBitsPerSample ) + { + case 8: + retcode = Write ( LeftSample, 1 ); + if ( retcode == DDC_SUCCESS ) + { + retcode = Write ( RightSample, 1 ); + if ( retcode == DDC_SUCCESS ) + { + pcm_data.ckSize += 2; + } + } + break; + + case 16: + retcode = Write ( LeftSample, 2 ); + if ( retcode == DDC_SUCCESS ) + { + retcode = Write ( RightSample, 2 ); + if ( retcode == DDC_SUCCESS ) + { + pcm_data.ckSize += 4; + } + } + break; + + default: + retcode = DDC_INVALID_CALL; + } + return retcode; + }*/ + + /** + * + * + public int ReadMonoSample ( short[] Sample ) + { + int retcode = DDC_SUCCESS; + switch ( wave_format.data.nBitsPerSample ) + { + case 8: + byte[] x = {0}; + retcode = Read ( x, 1 ); + Sample[0] = (short)(x[0]); + break; + + case 16: + retcode = Read ( Sample, 2 ); + break; + + default: + retcode = DDC_INVALID_CALL; + } + return retcode; + }*/ + + /** + * + * + public int ReadStereoSample ( short[] LeftSampleData, short[] RightSampleData ) + { + int retcode = DDC_SUCCESS; + byte[] x = new byte[2]; + short[] y = new short[2]; + switch ( wave_format.data.nBitsPerSample ) + { + case 8: + retcode = Read ( x, 2 ); + L[0] = (short) ( x[0] ); + R[0] = (short) ( x[1] ); + break; + + case 16: + retcode = Read ( y, 4 ); + L[0] = (short) ( y[0] ); + R[0] = (short) ( y[1] ); + break; + + default: + retcode = DDC_INVALID_CALL; + } + return retcode; + }*/ + + + /** + * + */ + public int Close() + { + int rc = DDC_SUCCESS; + + if ( fmode == RFM_WRITE ) + rc = Backpatch ( pcm_data_offset, pcm_data, 8 ); + if ( rc == DDC_SUCCESS ) + rc = super.Close(); + return rc; + } + + // [Hz] + public int SamplingRate() + {return wave_format.data.nSamplesPerSec;} + + public short BitsPerSample() + {return wave_format.data.nBitsPerSample;} + + public short NumChannels() + {return wave_format.data.nChannels;} + + public int NumSamples() + {return num_samples;} + + + /** + * Open for write using another wave file's parameters... + */ + public int OpenForWrite (String Filename, WaveFile OtherWave ) + { + return OpenForWrite ( Filename, + OtherWave.SamplingRate(), + OtherWave.BitsPerSample(), + OtherWave.NumChannels() ); + } + + /** + * + */ + public long CurrentFilePosition() + { + return super.CurrentFilePosition(); + } + + /* public int FourCC(String ChunkName) + { + byte[] p = {0x20,0x20,0x20,0x20}; + ChunkName.getBytes(0,4,p,0); + int ret = (((p[0] << 24)& 0xFF000000) | ((p[1] << 16)&0x00FF0000) | ((p[2] << 8)&0x0000FF00) | (p[3]&0x000000FF)); + return ret; + }*/ + +} \ No newline at end of file Added: sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/WaveFileObuffer.java =================================================================== --- sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/WaveFileObuffer.java (rev 0) +++ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/WaveFileObuffer.java 2007-02-15 21:37:01 UTC (rev 70) @@ -0,0 +1,141 @@ +/* + * 11/19/04 1.0 moved to LGPL. + * + * 12/12/99 0.0.7 Renamed class, additional constructor arguments + * and larger write buffers. md...@te.... + * + * 15/02/99 Java Conversion by E.B ,jav...@ja... + * + *----------------------------------------------------------------------- + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *---------------------------------------------------------------------- + */ + +package javazoom.jl.converter; + +import javazoom.jl.decoder.Obuffer; + +/** + * Implements an Obuffer by writing the data to + * a file in RIFF WAVE format. + * + * @since 0.0 + */ + + +public class WaveFileObuffer extends Obuffer +{ + private short[] buffer; + private short[] bufferp; + private int channels; + private WaveFile outWave; + + /** + * Creates a new WareFileObuffer instance. + * + * @param number_of_channels + * The number of channels of audio data + * this buffer will receive. + * + * @param freq The sample frequency of the samples in the buffer. + * + * @param fileName The filename to write the data to. + */ + public WaveFileObuffer(int number_of_channels, int freq, String FileName) + { + if (FileName==null) + throw new NullPointerException("FileName"); + + buffer = new short[OBUFFERSIZE]; + bufferp = new short[MAXCHANNELS]; + channels = number_of_channels; + + for (int i = 0; i < number_of_channels; ++i) + bufferp[i] = (short)i; + + outWave = new WaveFile(); + + int rc = outWave.OpenForWrite (FileName,freq,(short)16,(short)channels); + } + + /** + * Takes a 16 Bit PCM sample. + */ + public void append(int channel, short value) + { + buffer[bufferp[channel]] = value; + bufferp[channel] += channels; + } + + /** + * Write the samples to the file (Random Acces). + */ + short[] myBuffer = new short[2]; + public void write_buffer(int val) + { + + int k = 0; + int rc = 0; + + rc = outWave.WriteData(buffer, bufferp[0]); + // REVIEW: handle RiffFile errors. + /* + for (int j=0;j<bufferp[0];j=j+2) + { + + //myBuffer[0] = (short)(((buffer[j]>>8)&0x000000FF) | ((buffer[j]<<8)&0x0000FF00)); + //myBuffer[1] = (short) (((buffer[j+1]>>8)&0x000000FF) | ((buffer[j+1]<<8)&0x0000FF00)); + myBuffer[0] = buffer[j]; + myBuffer[1] = buffer[j+1]; + rc = outWave.WriteData (myBuffer,2); + } + */ + for (int i = 0; i < channels; ++i) bufferp[i] = (short)i; + } + + public void close() + { + outWave.Close(); + } + + /** + * + */ + public void clear_buffer() + {} + + /** + * + */ + public void set_stop_flag() + {} + + /* + * Create STDOUT buffer + * + * + public static Obuffer create_stdout_obuffer(MPEG_Args maplay_args) + { + Obuffer thebuffer = null; + int mode = maplay_args.MPEGheader.mode(); + int which_channels = maplay_args.which_c; + if (mode == Header.single_channel || which_channels != MPEG_Args.both) + thebuffer = new FileObuffer(1,maplay_args.output_filename); + else + thebuffer = new FileObuffer(2,maplay_args.output_filename); + return(thebuffer); + } + */ +} Added: sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/jlc.java =================================================================== --- sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/jlc.java (rev 0) +++ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/converter/jlc.java 2007-02-15 21:37:01 UTC (rev 70) @@ -0,0 +1,216 @@ +/* + * 11/19/04 1.0 moved to LGPL. + * + * 29/01/00 Initial version. md...@te... + * + * 12/12/99 JavaLayer 0.0.7 md...@te... + * + * 14/02/99 MPEG_Args Based Class - E.B + * Adapted from javalayer and MPEG_Args. + * Doc'ed and integerated with JL converter. Removed + * Win32 specifics from original Maplay code. + *----------------------------------------------------------------------- + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *---------------------------------------------------------------------- + */ + +package javazoom.jl.converter; + +import java.io.PrintWriter; + +import javazoom.jl.decoder.Crc16; +import javazoom.jl.decoder.JavaLayerException; +import javazoom.jl.decoder.OutputChannels; + +/** + * The <code>jlc</code> class presents the JavaLayer + * Conversion functionality as a command-line program. + * + * @since 0.0.7 + */ +public class jlc +{ + + static public void main(String args[]) + { + String[] argv; + long start = System.currentTimeMillis(); + int argc = args.length + 1; + argv = new String[argc]; + argv[0] = "jlc"; + for(int i=0;i<args.length;i++) + argv[i+1] = args[i]; + + jlcArgs ma = new jlcArgs(); + if (!ma.processArgs(argv)) + System.exit(1); + + Converter conv = new Converter(); + + int detail = (ma.verbose_mode ? + ma.verbose_level : + Converter.PrintWriterProgressListener.NO_DETAIL); + + Converter.ProgressListener listener = + new Converter.PrintWriterProgressListener( + new PrintWriter(System.out, true), detail); + + try + { + conv.convert(ma.filename, ma.output_filename, listener); + } + catch (JavaLayerException ex) + { + System.err.println("Convertion failure: "+ex); + } + + System.exit(0); + } + + + /** + * Class to contain arguments for maplay. + */ + static class jlcArgs + { + // channel constants moved into OutputChannels class. + //public static final int both = 0; + //public static final int left = 1; + //public static final int right = 2; + //public static final int downmix = 3; + + public int which_c; + public int output_mode; + public boolean use_own_scalefactor; + public float scalefactor; + public String output_filename; + public String filename; + //public boolean stdout_mode; + public boolean verbose_mode; + public int verbose_level = 3; + + public jlcArgs() + { + which_c = OutputChannels.BOTH_CHANNELS; + use_own_scalefactor = false; + scalefactor = (float) 32768.0; + //stdout_mode = false; + verbose_mode = false; + } + + /** + * Process user arguments. + * + * Returns true if successful. + */ + public boolean processArgs(String[] argv) + { + filename = null; + Crc16[] crc; + crc = new Crc16[1]; + int i; + int argc = argv.length; + + //stdout_mode = false; + verbose_mode = false; + output_mode = OutputChannels.BOTH_CHANNELS; + output_filename = ""; + if (argc < 2 || argv[1].equals("-h")) + return Usage(); + + i = 1; + while (i < argc) + { + /* System.out.println("Option = "+argv[i]);*/ + if (argv[i].charAt(0) == '-') + { + if (argv[i].startsWith("-v")) + { + verbose_mode = true; + if (argv[i].length()>2) + { + try + { + String level = argv[i].substring(2); + verbose_level = Integer.parseInt(level); + } + catch (NumberFormatException ex) + { + System.err.println("Invalid verbose level. Using default."); + } + } + System.out.println("Verbose Activated (level "+verbose_level+")"); + } + /* else if (argv[i].equals("-s")) + ma.stdout_mode = true; */ + else if (argv[i].equals("-p")) + { + if (++i == argc) + { + System.out.println("Please specify an output filename after the -p option!"); + System.exit (1); + } + //output_mode = O_WAVEFILE; + output_filename = argv[i]; + } + /*else if (argv[i].equals("-f")) + { + if (++i == argc) + { + System.out.println("Please specify a new scalefactor after the -f option!"); + System.exit(1); + } + ma.use_own_scalefactor = true; + // ma.scalefactor = argv[i]; + }*/ + else return Usage(); + } + else + { + filename = argv[i]; + System.out.println("FileName = "+argv[i]); + if (filename == null) return Usage(); + } + i++; + } + if (filename == null) + return Usage(); + + return true; + } + + + /** + * Usage of JavaLayer. + */ + public boolean Usage() + { + System.out.println("JavaLayer Converter :"); + System.out.println(" -v[x] verbose mode. "); + System.out.println(" default = 2"); + /* System.out.println(" -s write u-law samples at 8 kHz rate to stdout"); + System.out.println(" -l decode only the left channel"); + System.out.println(" -r decode only the right channel"); + System.out.println(" -d downmix mode (layer III only)"); + System.out.println(" -s write pcm samples to stdout"); + System.out.println(" -d downmix mode (layer III only)");*/ + System.out.println(" -p name output as a PCM wave file"); + System.out.println(""); + System.out.println(" More info on http://www.javazoom.net"); + /* System.out.println(" -f ushort use this scalefactor instead of the default value 32768");*/ + return false; + } + }; +}; \ No newline at end of file Added: sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/BitReserve.java =================================================================== --- sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/BitReserve.java (rev 0) +++ sandbox/tonit/org.javazoom.jl/src/main/java/javazoom/jl/decoder/BitReserve.java 2007-02-15 21:37:01 UTC (rev 70) @@ -0,0 +1,223 @@ +/* + * 11/19/04 1.0 moved to LGPL. + * + * 12/12/99 0.0.7 Implementation stores single bits + * as ints for better performance. md...@te.... + * + * 02/28/99 0.0 Java Conversion by E.B, jav...@ja... + * + * Adapted from the public c code by Jeff Tsay. + * + *----------------------------------------------------------------------- + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *---------------------------------------------------------------------- + */ + +package javazoom.jl.decoder; + +/** + * Implementation of Bit Reservoir for Layer III. + * <p> + * The implementation stores single bits as a word in the buffer. If + * a bit is set, the corresponding word in the buffer will be non-zero. + * If a bit is clear, the corresponding word is zero. Although this + * may seem waseful, this can be a factor of two quicker than + * packing 8 bits to a byte and extracting. + * <p> + */ + +// REVIEW: there is no range checking, so buffer underflow or overflow +// can silently occur. +final class BitReserve +{ + /** + * Size of the internal buffer to store the reserved bits. + * Must be a power of 2. And x8, as each bit is stored as a single + ... [truncated message content] |
From: <to...@us...> - 2007-02-15 21:35:57
|
Revision: 69 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=69&view=rev Author: tonit Date: 2007-02-15 13:35:52 -0800 (Thu, 15 Feb 2007) Log Message: ----------- transfered library to maven2/maven-bundle-plugin project because it is not listed on maven mirrors..:-( Added Paths: ----------- sandbox/tonit/org.javazoom.jl/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-15 21:25:56
|
Revision: 68 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=68&view=rev Author: tonit Date: 2007-02-15 13:25:56 -0800 (Thu, 15 Feb 2007) Log Message: ----------- Property Changed: ---------------- sandbox/tonit/techne.samples.audio.player/ Property changes on: sandbox/tonit/techne.samples.audio.player ___________________________________________________________________ Name: svn:ignore + target This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-15 21:23:04
|
Revision: 67 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=67&view=rev Author: tonit Date: 2007-02-15 13:23:01 -0800 (Thu, 15 Feb 2007) Log Message: ----------- Property Changed: ---------------- sandbox/tonit/techne.samples.audio.tui/ Property changes on: sandbox/tonit/techne.samples.audio.tui ___________________________________________________________________ Name: svn:ignore + target This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-15 21:20:14
|
Revision: 66 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=66&view=rev Author: tonit Date: 2007-02-15 13:20:14 -0800 (Thu, 15 Feb 2007) Log Message: ----------- transfered project to maven2/maven-bundle-plugin project Added Paths: ----------- sandbox/tonit/techne.samples.audio.tui/.classpath sandbox/tonit/techne.samples.audio.tui/.project sandbox/tonit/techne.samples.audio.tui/pom.xml sandbox/tonit/techne.samples.audio.tui/src/ sandbox/tonit/techne.samples.audio.tui/src/main/ sandbox/tonit/techne.samples.audio.tui/src/main/java/ sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/ sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/audio/ sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/audio/tui/ sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/audio/tui/internal/ sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/audio/tui/internal/Activator.java sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/audio/tui/internal/PlayerControlCommand.java sandbox/tonit/techne.samples.audio.tui/src/test/ sandbox/tonit/techne.samples.audio.tui/src/test/java/ sandbox/tonit/techne.samples.audio.tui/src/test/java/techne/ sandbox/tonit/techne.samples.audio.tui/src/test/java/techne/AppTest.java Added: sandbox/tonit/techne.samples.audio.tui/.classpath =================================================================== --- sandbox/tonit/techne.samples.audio.tui/.classpath (rev 0) +++ sandbox/tonit/techne.samples.audio.tui/.classpath 2007-02-15 21:20:14 UTC (rev 66) @@ -0,0 +1,14 @@ +<classpath> + <classpathentry kind="src" path="src/main/java"/> + <classpathentry kind="src" path="src/test/java" output="target/test-classes"/> + <classpathentry kind="output" path="target/classes"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.foundation/0.9.0-incubator-SNAPSHOT/org.osgi.foundation-0.9.0-incubator-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.compendium/0.9.0-incubator-SNAPSHOT/org.osgi.compendium-0.9.0-incubator-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/techne/techne.samples.audio.player/1.0/techne.samples.audio.player-1.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/felix/javax.servlet/0.9.0-incubator-SNAPSHOT/javax.servlet-0.9.0-incubator-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/javazoom/org.javazoom.jl/1.0-SNAPSHOT/org.javazoom.jl-1.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.apache.felix.shell/0.9.0-incubator-SNAPSHOT/org.apache.felix.shell-0.9.0-incubator-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.core/0.9.0-incubator-SNAPSHOT/org.osgi.core-0.9.0-incubator-SNAPSHOT.jar"/> +</classpath> \ No newline at end of file Added: sandbox/tonit/techne.samples.audio.tui/.project =================================================================== --- sandbox/tonit/techne.samples.audio.tui/.project (rev 0) +++ sandbox/tonit/techne.samples.audio.tui/.project 2007-02-15 21:20:14 UTC (rev 66) @@ -0,0 +1,13 @@ +<projectDescription> + <name>techne.samples.audio.tui</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> \ No newline at end of file Added: sandbox/tonit/techne.samples.audio.tui/pom.xml =================================================================== --- sandbox/tonit/techne.samples.audio.tui/pom.xml (rev 0) +++ sandbox/tonit/techne.samples.audio.tui/pom.xml 2007-02-15 21:20:14 UTC (rev 66) @@ -0,0 +1,55 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">tui + <modelVersion>4.0.0</modelVersion> + <groupId>techne</groupId> + <artifactId>techne.samples.audio.tui</artifactId> + <packaging>bundle</packaging> + <version>1.0</version> + <name>techne.samples.audio.tui</name> + <url>http://maven.apache.org</url> + <dependencies> + <dependency> + <groupId>techne</groupId> + <artifactId>techne.samples.audio.player</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.osgi.core</artifactId> + <version>0.9.0-incubator-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.osgi.compendium</artifactId> + <version>0.9.0-incubator-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.apache.felix.shell</artifactId> + <version>0.9.0-incubator-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Bundle-SymbolicName>techne.samples.audio.tui</Bundle-SymbolicName> + <Private-Package>techne.audio.tui.internal</Private-Package> + <Bundle-Activator>techne.audio.tui.internal.Activator</Bundle-Activator> + <Service-Component>techne.audio.tui.internal.PlayerControlCommand;control=techne.audio.player.PlayerControl;provide:=org.apache.felix.shell.Command</Service-Component> + </instructions> + </configuration> + </plugin> + </plugins> + </build> +</project> Added: sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/audio/tui/internal/Activator.java =================================================================== --- sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/audio/tui/internal/Activator.java (rev 0) +++ sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/audio/tui/internal/Activator.java 2007-02-15 21:20:14 UTC (rev 66) @@ -0,0 +1,15 @@ +package techne.audio.tui.internal; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + public void start(BundleContext ctx) throws Exception { + System.out.println("Shell Support ON"); + } + + public void stop(BundleContext arg0) throws Exception { + System.out.println("Shell Support OFF"); + } +} Added: sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/audio/tui/internal/PlayerControlCommand.java =================================================================== --- sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/audio/tui/internal/PlayerControlCommand.java (rev 0) +++ sandbox/tonit/techne.samples.audio.tui/src/main/java/techne/audio/tui/internal/PlayerControlCommand.java 2007-02-15 21:20:14 UTC (rev 66) @@ -0,0 +1,57 @@ +package techne.audio.tui.internal; + +import java.io.PrintStream; +import java.util.StringTokenizer; + +import org.apache.felix.shell.Command; + +import techne.audio.player.PlayerControl; + +public class PlayerControlCommand implements Command { + private PlayerControl control; + + public void execute(String s, PrintStream out, PrintStream err) { + if (control != null) { + StringTokenizer st = new StringTokenizer(s, " "); + + st.nextToken(); // Ignore the command name. + if (st.hasMoreTokens()) { + String cmd = st.nextToken(); + if ("play".equals(cmd)) { + control.play(); + }else if ("stop".equals(cmd)) { + control.stop(); + }else if ("pause".equals(cmd)) { + control.pause(); + }else if ("state".equals(cmd)) { + out.println("Current state: " + control.getState()); + }else + { + out.println("Command " + cmd + " unknown"); + out.println(getUsage()); + } + }else { + out.println(getUsage()); + } + }else { + err.println("no PlayerControl instance assigned!"); + } + } + + public String getName() { + return "audio"; + } + + public String getShortDescription() { + return "Controls PlayerControl Service with felix shell"; + } + + public String getUsage() { + return "audio <play> or <stop> or <pause> or <state>"; + } + + public void setControl(PlayerControl control) { + this.control = control; + } + +} Added: sandbox/tonit/techne.samples.audio.tui/src/test/java/techne/AppTest.java =================================================================== --- sandbox/tonit/techne.samples.audio.tui/src/test/java/techne/AppTest.java (rev 0) +++ sandbox/tonit/techne.samples.audio.tui/src/test/java/techne/AppTest.java 2007-02-15 21:20:14 UTC (rev 66) @@ -0,0 +1,38 @@ +package techne; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-15 21:19:37
|
Revision: 65 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=65&view=rev Author: tonit Date: 2007-02-15 13:19:28 -0800 (Thu, 15 Feb 2007) Log Message: ----------- transfered project to maven2/maven-bundle-plugin project Added Paths: ----------- sandbox/tonit/techne.samples.audio.tui/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <to...@us...> - 2007-02-15 21:14:00
|
Revision: 64 http://techne-dev.svn.sourceforge.net/techne-dev/?rev=64&view=rev Author: tonit Date: 2007-02-15 13:13:59 -0800 (Thu, 15 Feb 2007) Log Message: ----------- transfered project to maven2/maven-bundle-plugin project Added Paths: ----------- sandbox/tonit/techne.samples.audio.samplemusic/.classpath sandbox/tonit/techne.samples.audio.samplemusic/.project sandbox/tonit/techne.samples.audio.samplemusic/pom.xml sandbox/tonit/techne.samples.audio.samplemusic/resources/ sandbox/tonit/techne.samples.audio.samplemusic/resources/TotallyFreeSong.mp3 sandbox/tonit/techne.samples.audio.samplemusic/src/ sandbox/tonit/techne.samples.audio.samplemusic/src/main/ sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/ sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/techne/ sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/techne/audio/ sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/techne/audio/samplemusic/ sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/techne/audio/samplemusic/Activator.java sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/techne/audio/samplemusic/SampleMusicSource.java sandbox/tonit/techne.samples.audio.samplemusic/src/test/ sandbox/tonit/techne.samples.audio.samplemusic/src/test/java/ sandbox/tonit/techne.samples.audio.samplemusic/src/test/java/techne/ sandbox/tonit/techne.samples.audio.samplemusic/src/test/java/techne/AppTest.java sandbox/tonit/techne.samples.audio.samplemusic/target/ Added: sandbox/tonit/techne.samples.audio.samplemusic/.classpath =================================================================== --- sandbox/tonit/techne.samples.audio.samplemusic/.classpath (rev 0) +++ sandbox/tonit/techne.samples.audio.samplemusic/.classpath 2007-02-15 21:13:59 UTC (rev 64) @@ -0,0 +1,13 @@ +<classpath> + <classpathentry kind="src" path="src/main/java"/> + <classpathentry kind="src" path="src/test/java" output="target/test-classes"/> + <classpathentry kind="output" path="target/classes"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.compendium/0.9.0-incubator-SNAPSHOT/org.osgi.compendium-0.9.0-incubator-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/javazoom/org.javazoom.jl/1.0-SNAPSHOT/org.javazoom.jl-1.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/felix/javax.servlet/0.9.0-incubator-SNAPSHOT/javax.servlet-0.9.0-incubator-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.apache.felix.shell/0.9.0-incubator-SNAPSHOT/org.apache.felix.shell-0.9.0-incubator-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.core/0.9.0-incubator-SNAPSHOT/org.osgi.core-0.9.0-incubator-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.foundation/0.9.0-incubator-SNAPSHOT/org.osgi.foundation-0.9.0-incubator-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/> +</classpath> \ No newline at end of file Added: sandbox/tonit/techne.samples.audio.samplemusic/.project =================================================================== --- sandbox/tonit/techne.samples.audio.samplemusic/.project (rev 0) +++ sandbox/tonit/techne.samples.audio.samplemusic/.project 2007-02-15 21:13:59 UTC (rev 64) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>techne.samples.audio.player</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: sandbox/tonit/techne.samples.audio.samplemusic/pom.xml =================================================================== --- sandbox/tonit/techne.samples.audio.samplemusic/pom.xml (rev 0) +++ sandbox/tonit/techne.samples.audio.samplemusic/pom.xml 2007-02-15 21:13:59 UTC (rev 64) @@ -0,0 +1,51 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>techne</groupId> + <artifactId>techne.samples.audio.samplemusic</artifactId> + <packaging>bundle</packaging> + <version>1.0</version> + <name>techne.samples.audio.samplemusic</name> + <url>http://maven.apache.org</url> + <dependencies> + <dependency> + <groupId>techne</groupId> + <artifactId>techne.samples.audio.player</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.osgi.core</artifactId> + <version>0.9.0-incubator-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.osgi.compendium</artifactId> + <version>0.9.0-incubator-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Bundle-SymbolicName>techne.samples.audio.samplemusic</Bundle-SymbolicName> + <Private-Package>techne.audio.samplemusic</Private-Package> + <Bundle-Activator>techne.audio.samplemusic.Activator</Bundle-Activator> + <Service-Component>techne.audio.samplemusic.SampleMusicSource;provide:=techne.audio.player.MusicSource</Service-Component> + <Include-Resource>resources/TotallyFreeSong.mp3</Include-Resource> + </instructions> + </configuration> + </plugin> + </plugins> + </build> +</project> Added: sandbox/tonit/techne.samples.audio.samplemusic/resources/TotallyFreeSong.mp3 =================================================================== (Binary files differ) Property changes on: sandbox/tonit/techne.samples.audio.samplemusic/resources/TotallyFreeSong.mp3 ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/techne/audio/samplemusic/Activator.java =================================================================== --- sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/techne/audio/samplemusic/Activator.java (rev 0) +++ sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/techne/audio/samplemusic/Activator.java 2007-02-15 21:13:59 UTC (rev 64) @@ -0,0 +1,16 @@ +package techne.audio.samplemusic; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + public void start(BundleContext ctx) throws Exception { + System.out.println("Loading samplemusic support for techne.audio"); + } + + public void stop(BundleContext arg0) throws Exception { + System.out.println("Removing samplemusic support for techne.audio"); + } + +} Added: sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/techne/audio/samplemusic/SampleMusicSource.java =================================================================== --- sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/techne/audio/samplemusic/SampleMusicSource.java (rev 0) +++ sandbox/tonit/techne.samples.audio.samplemusic/src/main/java/techne/audio/samplemusic/SampleMusicSource.java 2007-02-15 21:13:59 UTC (rev 64) @@ -0,0 +1,78 @@ +package techne.audio.samplemusic; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; + +import org.osgi.service.component.ComponentContext; + +import techne.audio.player.MusicSource; + +/** + * Provides a sample MusicSource. MP3 Files are included right in the bundle. + * + * Its Self-Contained (does not require network, local mp3s or itunes) + * + * @author tmenzel + * + */ +public class SampleMusicSource implements MusicSource { + + boolean repeat = false; + private URL url; + // count of next() requests + int count = 0; + + public SampleMusicSource() { + } + + public boolean hasNext() { + return (repeat || count == 0); + } + + public InputStream next() { + // double check locking to make this boring sample more educative ;-) + if (hasNext()) { + synchronized (this) { + if (hasNext()) { + count++; + try { + // you get always the same for this example either.. + System.out.println("MusicSource: giving " + + url.toExternalForm()); + return url.openConnection().getInputStream(); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + } + } + return null; + } + + public void setRepeat(boolean rep) { + this.repeat = rep; + } + + public InputStream current() { + try { + return url.openConnection().getInputStream(); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + + // Declarative Services methods.. + protected void activate(ComponentContext context) { + System.out.println("Started sample MusicSource for techne.audio"); + url = context.getBundleContext().getBundle().getResource( + "TotallyFreeSong.mp3"); + } + + public void deactivate(ComponentContext context) throws Exception { + System.out.println("Stopped sample MusicSource for techne.audio"); + } + +} Added: sandbox/tonit/techne.samples.audio.samplemusic/src/test/java/techne/AppTest.java =================================================================== --- sandbox/tonit/techne.samples.audio.samplemusic/src/test/java/techne/AppTest.java (rev 0) +++ sandbox/tonit/techne.samples.audio.samplemusic/src/test/java/techne/AppTest.java 2007-02-15 21:13:59 UTC (rev 64) @@ -0,0 +1,38 @@ +package techne; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |