Skip to content

Commit

Permalink
Initial version of audio API
Browse files Browse the repository at this point in the history
Bug: eclipse-archived#584
Also-By: Kelly Davis <kdavis@mozilla.com>
Signed-off-by: Harald Kuhn <harald.kuhn@gmail.com>
  • Loading branch information
hkuhn42 authored and cdjackson committed Mar 28, 2016
1 parent fe88a84 commit e5c556e
Show file tree
Hide file tree
Showing 15 changed files with 550 additions and 1 deletion.
7 changes: 7 additions & 0 deletions bundles/io/org.eclipse.smarthome.io.audio/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
33 changes: 33 additions & 0 deletions bundles/io/org.eclipse.smarthome.io.audio/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.smarthome.io.audio</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
13 changes: 13 additions & 0 deletions bundles/io/org.eclipse.smarthome.io.audio/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Eclipse SmartHome Audio I/O Bundle
Bundle-SymbolicName: org.eclipse.smarthome.io.audio
Bundle-Vendor: Eclipse.org/SmartHome
Bundle-Version: 0.8.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ClassPath: .
Import-Package: org.slf4j
Service-Component: OSGI-INF/*.xml,
Export-Package: org.eclipse.smarthome.io.audio
Bundle-ActivationPolicy: lazy

6 changes: 6 additions & 0 deletions bundles/io/org.eclipse.smarthome.io.audio/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
output.. = target/classes
bin.includes = META-INF/,\
.,\
OSGI-INF/,\
ESH-INF/
source.. = src/main/java/
23 changes: 23 additions & 0 deletions bundles/io/org.eclipse.smarthome.io.audio/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<parent>
<groupId>org.eclipse.smarthome.bundles</groupId>
<artifactId>io</artifactId>
<version>0.8.0-SNAPSHOT</version>
</parent>

<properties>
<bundle.symbolicName>org.eclipse.smarthome.io.audio</bundle.symbolicName>
<bundle.namespace>org.eclipse.smarthome.io.audio</bundle.namespace>
</properties>

<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.smarthome.io</groupId>
<artifactId>org.eclipse.smarthome.io.audio</artifactId>

<name>Eclipse SmartHome Audio I/O</name>

<packaging>eclipse-plugin</packaging>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Copyright (c) 2014-2015 openHAB UG (haftungsbeschraenkt) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.smarthome.io.audio;

/**
* A collection of constants for commonly used audio codecs
*
* @author Harald Kuhn - Initial API
* @author Kelly Davis - Modified to match discussion in #584
*/
public class AudioCodec {
/**
* PCM Signed
*
* @see <a href="http://wiki.multimedia.cx/?title=PCM#PCM_Types">PCM Types</a>
*/
public static final String PCM_SIGNED = "PCM_SIGNED";

/**
* PCM Unsigned
*
* @see <a href="http://wiki.multimedia.cx/?title=PCM#PCM_Types">PCM Types</a>
*/
public static final String PCM_UNSIGNED = "PCM_UNSIGNED";

/**
* MP3 Codec
*
* @see <a href="http://wiki.multimedia.cx/index.php?title=MP3">MP3 Codec</a>
*/
public static final String MP3 = "MP3";

/**
* Vorbis Codec
*
* @see <a href="http://xiph.org/vorbis/doc/">Vorbis</a>
*/
public static final String VORBIS = "VORBIS";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Copyright (c) 2014-2015 openHAB UG (haftungsbeschraenkt) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.smarthome.io.audio;

/**
* A collection of constants for container formats
*
* @author Harald Kuhn - Initial API
* @author Kelly Davis - Modified to match discussion in #584
*/
public class AudioContainer {
/**
* {@link AudioCodec} encoded data without any container header or footer,
* e.g. MP3 is a non-container format
*/
public static final String NONE = "NONE";

/**
* Microsofts wave container format
*
* @see <a href="http://bit.ly/1TUW93t">WAV Format</a>
* @see <a href="http://bit.ly/1oRMKOt">Supported codecs</a>
* @see <a href="http://bit.ly/1TUWSlk">RIFF container format</a>
*/
public static final String WAVE = "WAVE";


/**
* OGG container format
*
* @see <a href="http://bit.ly/1oRMWNE">OGG</a>
*/
public static final String OGG = "OGG";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* Copyright (c) 2014-2015 openHAB UG (haftungsbeschraenkt) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.smarthome.io.audio;

/**
* General purpose audio exception
*
* @author Harald Kuhn - Initial API
* @author Kelly Davis - Modified to match discussion in #584
*/
public class AudioException extends Exception {

private static final long serialVersionUID = 1L;

/**
* Constructs a new exception with null as its detail message.
*/
public AudioException() {
super();
}

/**
* Constructs a new exception with the specified detail message and cause.
*
* @param message Detail message
* @param cause The cause
*/
public AudioException(String message, Throwable cause) {
super(message, cause);
}

/**
* Constructs a new exception with the specified detail message.
*
* @param message Detail message
*/
public AudioException(String message) {
super(message);
}

/**
* Constructs a new exception with the specified cause.
*
* @param cause The cause
*/
public AudioException(Throwable cause) {
super(cause);
}
}
Loading

0 comments on commit e5c556e

Please sign in to comment.