Index: gs2-extensions/music-ir/trunk/CASCADE-MAKE.bat
===================================================================
--- gs2-extensions/music-ir/trunk/CASCADE-MAKE.bat	(revision 22243)
+++ gs2-extensions/music-ir/trunk/CASCADE-MAKE.bat	(revision 22243)
@@ -0,0 +1,66 @@
+@echo off
+
+pushd "%CD%"
+CD /D "%~dp0"
+
+call cascade-make/lib/cascade-lib.bat
+
+:: Guaranteed that GSDLOS has now been set
+
+
+:: Make sure can find javac
+
+:: Remove any quotes from around JAVA_HOME
+if defined JAVA_HOME set JAVA_HOME=%JAVA_HOME:"=%
+
+
+if "%JAVA_HOME%" == "" (
+  echo Testing for Java compiler ...
+
+  javac -version 2>nul
+  if ERRORLEVEL 1 (
+    echo ... failed to find 'javac'
+    cmd /c exit -4
+    goto:EOF
+  ) else (
+    echo ... found it
+  )
+) else (
+
+  :: Good chance it's in the path already => don't want to see any output
+  javac -version 2>nul
+  if ERRORLEVEL 1 (
+    echo Setting path to include "%JAVA_HOME%\bin"
+    set "PATH=%JAVA_HOME%\bin;%PATH%"
+  )
+)
+
+
+for /D %%d IN ("%GSDLOS%" "lib\java") do (
+  if not exist "%GEXT_MUSICIR_INSTALLED%\%%d" (
+    echo Creating %GEXT_MUSICIR_INSTALLED%\%%d
+    mkdir "%GEXT_MUSICIR_INSTALLED%\%%d"
+  )
+)
+
+set dirlist=build-srcpack
+
+for /D %%d IN (%dirlist%) do (
+  echo Running %%d\CASCADE-MAKE.bat %*
+
+  (cd %%d && call CASCADE-MAKE.bat %* && cd ..)
+  
+  if ERRORLEVEL 1 (
+    echo Error encountered running %%d\CASCADE-MAKE.bat
+    cmd /c exit 1
+    goto:EOF
+  )
+)
+
+
+if  %install% == 1 (
+  type README.txt
+)
+
+
+
Index: gs2-extensions/music-ir/trunk/README.txt
===================================================================
--- gs2-extensions/music-ir/trunk/README.txt	(revision 22243)
+++ gs2-extensions/music-ir/trunk/README.txt	(revision 22243)
@@ -0,0 +1,3 @@
+
+Music-IR extension to Greenstone, based on jAudio from McGill University
+
Index: gs2-extensions/music-ir/trunk/build-srcpack/CASCADE-MAKE.bat
===================================================================
--- gs2-extensions/music-ir/trunk/build-srcpack/CASCADE-MAKE.bat	(revision 22243)
+++ gs2-extensions/music-ir/trunk/build-srcpack/CASCADE-MAKE.bat	(revision 22243)
@@ -0,0 +1,14 @@
+@echo off
+
+for /D %%d IN (packages) do (
+  echo   Running %%d\CASCADE-MAKE.bat %*
+
+  (cd %%d && call CASCADE-MAKE.bat %* && cd ..)
+
+  if ERRORLEVEL 1 (
+    echo   Error encountered running %%d\CASCADE-MAKE.bat
+    cmd /c exit 1
+    goto:EOF
+  )
+)
+
Index: gs2-extensions/music-ir/trunk/build-srcpack/CASCADE-MAKE.sh
===================================================================
--- gs2-extensions/music-ir/trunk/build-srcpack/CASCADE-MAKE.sh	(revision 22243)
+++ gs2-extensions/music-ir/trunk/build-srcpack/CASCADE-MAKE.sh	(revision 22243)
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+
+for d in packages ; do
+  echo "  Running $d/CASCADE-MAKE.sh $*"
+
+  (cd $d; ./CASCADE-MAKE.sh $*)
+
+  if [ $? != 0 ] ; then
+    echo "  Error encountered running $d/CASCADE-MAKE.sh"
+    exit 1
+  fi
+done
+
Index: gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE.bat
===================================================================
--- gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE.bat	(revision 22243)
+++ gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE.bat	(revision 22243)
@@ -0,0 +1,15 @@
+@echo off
+
+for /D %%d IN (JAUDIO) do (
+  echo     Running CASCADE-MAKE\%%d.bat %*
+
+  call CASCADE-MAKE\%%d.bat %*
+
+  if ERRORLEVEL 1 (
+    echo     Error encountered running CASCADE-MAKE\%%d.bat
+    cmd /c exit 1
+    goto:EOF
+  )
+)
+
+
Index: gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE.sh
===================================================================
--- gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE.sh	(revision 22243)
+++ gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE.sh	(revision 22243)
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+
+for d in JAUDIO ; do
+  echo "    Running CASCADE-MAKE/$d.sh $*"
+
+  ./CASCADE-MAKE/$d.sh $*
+
+  if [ $? != 0 ] ; then
+    echo "  Error encountered running CASCADE-MAKE/$d.sh"
+    exit 1
+  fi
+done
+
+
Index: gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE/JAUDIO.bat
===================================================================
--- gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE/JAUDIO.bat	(revision 22243)
+++ gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE/JAUDIO.bat	(revision 22243)
@@ -0,0 +1,36 @@
+@echo off
+
+set package=jAudio0.4
+set version=-cvs-06052010
+
+set progname=%0
+
+call ..\..\cascade-make\lib\cascade-lib.bat
+
+
+set prefix=%GEXTVIDEO_INSTALLED%\%GSDLOS%
+
+REM opt_run_untar $force_untar $auto_untar $package $version
+
+if %compile% == 1 (
+  cd %package%%version% 
+  set "classpath=.;jAudioFeatureExtractor;tritonus_remaining-0.3.6.jar;tritonus_share-0.3.6.jar;xerces.jar;jhall.jar;mp3plugin.jar" 
+
+  set auxfiles=jAudioFeatureExtractor\AudioFeatures\*.java
+
+  echo       Compiling Java source files
+  javac -classpath %classpath% %auxfiles%
+  javac -classpath %classpath% jAudioFE.java
+
+  cd ..
+  
+)
+
+
+
+REM opt_run_make $compile   $package "$version"
+REM opt_run_make $install   $package "$version" "install"
+REM opt_run_make $clean     $package "$version" "clean"
+
+REM opt_run_tarclean $tarclean $package $version
+
Index: gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE/JAUDIO.sh
===================================================================
--- gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE/JAUDIO.sh	(revision 22243)
+++ gs2-extensions/music-ir/trunk/build-srcpack/packages/CASCADE-MAKE/JAUDIO.sh	(revision 22243)
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+package=jAudio0.4
+version=-cvs-06052010
+
+progname=$0
+
+source ../../cascade-make/lib/cascade-lib.bash GEXT_MUSICIR ../.. $*
+
+prefix=$GEXT_MUSICIR_INSTALLED
+
+
+opt_run_untar $force_untar $auto_untar $package $version
+if [ -d "$package" ] ; then
+  mv "$package" "$package$version"
+fi
+
+if [ $compile = "1" ] ; then
+  cd $package$version 
+  classpath=".:jAudioFeatureExtractor:tritonus_remaining-0.3.6.jar:tritonus_share-0.3.6.jar:xerces.jar:jhall.jar:mp3plugin.jar" 
+
+  auxfiles="jAudioFeatureExtractor/AudioFeatures/*.java"
+
+  which cygpath 2>&1 > /dev/null
+  if [ $? = "0" ] ; then
+    classpath=`cygpath -pw "$classpath"`
+    auxfiles=`cygpath -w "$auxfiles"`
+  fi
+
+  echo "      Compiling Java source files"
+  javac -classpath "$classpath" $auxfiles
+  javac -classpath "$classpath" jAudioFE.java
+
+  cd ..
+  
+fi
+
+if [ $install = "1" ] ; then
+  cd $package$version 
+
+  /bin/rm -f jaudio.jar
+
+  jarcp=`ls *.jar | tr '\n' ' '`
+
+  echo "Manifest-Version: 1.0" > Manifest.txt && \
+  echo "Main-Class: jAudioFE" >> Manifest.txt && \
+  echo "Class-Path: $jarcp plugin" >> Manifest.txt
+
+  class_files=`find . -name "*.class" -print`
+
+  which cygpath 2>&1 >/dev/null
+  if [ $? = "0" ] ; then
+    class_files=`cygpath -w $class_files`
+  fi
+
+  echo "      Bundling Java classes (and related files) into jaudio.jar"
+
+  jar cfm jaudio.jar Manifest.txt $class_files \
+     jAudioFeatureExtractor org \
+     features \
+     help JavaHelpSearch \
+     Map.jhm Sample.hs SampleIndex.xml SampleTOC.xml \
+  && \
+  /bin/cp *.jar $GEXT_MUSICIR/lib/java/. \
+
+  echo "Configuring features.xml"
+
+  plugin_home="$GEXT_MUSICIR/lib/java"
+  which cygpath 2>&1 >/dev/null
+  if [ $? = "0" ] ; then
+    plugin_home=`cygpath -w "$plugin_home"`
+    plugin_home=`echo "$plugin_home" | sed 's@\\\\@\\\\\\\\@g'`
+  fi
+
+
+  cat ../etc/features.xml.in \
+    | sed -e "s@\*\*pluginhome\*\*@$plugin_home@g" \
+    > $GEXT_MUSICIR/lib/java/features.xml
+
+  if [ ! -d "$GEXT_MUSICIR/lib/java/plugin" ] ; then
+    echo "Creating $GEXT_MUSICIR/lib/java/plugin"
+    mkdir "$GEXT_MUSICIR/lib/java/plugin"
+  fi
+
+  cd ..
+fi
+
+#opt_run_make $clean     $package $version "clean"
+#opt_run_make $distclean $package $version "distclean"
+
+opt_run_tarclean $tarclean $package $version
Index: gs2-extensions/music-ir/trunk/build-srcpack/packages/etc/features.xml.in
===================================================================
--- gs2-extensions/music-ir/trunk/build-srcpack/packages/etc/features.xml.in	(revision 22243)
+++ gs2-extensions/music-ir/trunk/build-srcpack/packages/etc/features.xml.in	(revision 22243)
@@ -0,0 +1,116 @@
+<?xml version="1.0"?>
+<!DOCTYPE featureList [
+	<!ELEMENT featureList (pluginFolder?,feature+,aggregator*)>
+	<!ELEMENT pluginFolder (#PCDATA)>
+	<!ELEMENT feature (class , on?)>
+	<!ELEMENT class (#PCDATA) >
+	<!ELEMENT on EMPTY>
+	<!ELEMENT aggregator (#PCDATA)>
+]>
+
+<featureList>
+        <pluginFolder>file://**pluginhome**</pluginFolder>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.MagnitudeSpectrum</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.PowerSpectrum</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.FFTBinFrequencies</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.SpectralCentroid</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.SpectralRolloffPoint</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.SpectralFlux</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.Compactness</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.SpectralVariability</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.RMS</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.FractionOfLowEnergyWindows</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.ZeroCrossings</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.BeatHistogram</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.BeatHistogramLabels</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.StrongestBeat</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.BeatSum</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.StrengthOfStrongestBeat</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.StrongestFrequencyViaZeroCrossings</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.StrongestFrequencyViaSpectralCentroid</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.StrongestFrequencyViaFFTMax</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.MFCC</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.LPC</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.Moments</class>
+		<on/>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.PeakFinder</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.HarmonicSpectralCentroid</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.HarmonicSpectralFlux</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.HarmonicSpectralSmoothness</class>
+	</feature>
+	<feature>
+		<class>jAudioFeatureExtractor.AudioFeatures.RelativeDifferenceFunction</class>
+	</feature>
+	<feature>
+	  <class>jAudioFeatureExtractor.AudioFeatures.AreaMoments</class>
+	</feature>
+	<aggregator>jAudioFeatureExtractor.Aggregators.Mean</aggregator>
+	<aggregator>jAudioFeatureExtractor.Aggregators.StandardDeviation</aggregator>
+	<aggregator>jAudioFeatureExtractor.Aggregators.AreaMoments</aggregator>
+	<aggregator>jAudioFeatureExtractor.Aggregators.MFCC</aggregator>
+	<aggregator>jAudioFeatureExtractor.Aggregators.MultipleFeatureHistogram</aggregator>
+</featureList>
Index: gs2-extensions/music-ir/trunk/setup.bash
===================================================================
--- gs2-extensions/music-ir/trunk/setup.bash	(revision 22243)
+++ gs2-extensions/music-ir/trunk/setup.bash	(revision 22243)
@@ -0,0 +1,39 @@
+
+extdesc="the Digital Music Information Retrieval Extension"
+
+full_setup=`pwd`/${BASH_SOURCE}
+fulldir=${full_setup%/*}
+
+source cascade-make/lib/cascade-lib.bash
+
+if [ "x$GEXT_MUSICIR" = "x" ] ; then
+  export GEXT_MUSICIR=$fulldir
+  export GEXT_MUSICIR_INSTALLED=$GEXT_MUSICIR/$GSDLOS
+  export GEXT_MUSICIR_LIBJAVA=$GEXT_MUSICIR/lib/java
+
+
+  export PATH=$GEXT_MUSICIR_INSTALLED/bin:$GEXT_MUSICIR/bin/script:$PATH
+
+  if [ "x$LD_LIBRARY_PATH" = "x" ] ; then
+    export LD_LIBRARY_PATH=$GEXT_MUSICIR_INSTALLED/lib
+  else
+    export LD_LIBRARY_PATH=$GEXT_MUSICIR_INSTALLED/lib:$LD_LIBRARY_PATH
+  fi
+  if [ "x$DYLD_LIBRARY_PATH" = "x" ] ; then
+    export DYLD_LIBRARY_PATH=$GEXT_MUSICIR_INSTALLED/lib
+  else
+    export DYLD_LIBRARY_PATH=$GEXT_MUSICIR_INSTALLED/lib:$DYLD_LIBRARY_PATH
+  fi
+
+  extdir=${GEXT_MUSICIR##*/}
+
+  if [ "x$GSDLEXTS" = "x" ] ; then
+    export GSDLEXTS=$extdir
+  else 
+    export GSDLEXTS=$GSDLEXTS:$extdir
+  fi
+
+  echo "+Your environment is now setup for $extdesc"
+else
+  echo "+Your environment is already setup for $extdesc"
+fi
Index: gs2-extensions/music-ir/trunk/setup.bat
===================================================================
--- gs2-extensions/music-ir/trunk/setup.bat	(revision 22243)
+++ gs2-extensions/music-ir/trunk/setup.bat	(revision 22243)
@@ -0,0 +1,57 @@
+@echo off
+pushd "%CD%"
+CD /D "%~dp0"
+set GSDLLANG=en
+set extdesc=the Music IR Extension
+
+if "%OS%" == "Windows_NT" goto WinNT
+if "%OS%" == "" goto Win95
+if "%GSDLLANG%" == "en" echo Setup failed - your PATH has not been set
+if "%GSDLLANG%" == "es" echo No se pudo realizar la configuraci¢n - no se ha establecido la RUTA.
+if "%GSDLLANG%" == "fr" echo Echc de l'installation - votre variable PATH n'a pas t ajuste
+if "%GSDLLANG%" == "ru" echo áâ ­®¢ª  ­¥ ã€ « áì -  ­¥ ¡ë« ãáâ ­®¢«¥­
+goto End
+
+:WinNT
+set GEXT_MUSICIR=%CD%
+set GEXT_MUSICIR_INSTALLED=%GEXT_MUSICIR%\windows
+
+set PATH=%GEXT_MUSICIR_INSTALLED%\bin;%GEXT_MUSICIR%\bin\script;%PATH%
+
+set GS_CP_SET=yes
+goto Success
+
+:Win95
+if "%1" == "SetEnv" goto Win95Env
+REM We'll invoke a second copy of the command processor to make
+REM sure there's enough environment space
+COMMAND /E:2048 /K %0 SetEnv
+goto End
+
+:Win95Env
+set GEXT_MUSICIR=%CD%
+set PATH=%GEXT_MUSICIR_INSTALLED%\bin;%GEXT_MUSICIR%\bin\script;%PATH%
+set GS_CP_SET=yes
+goto Success
+
+:Success
+
+set fulldir="%~dp0"
+
+:: strip off everything up to (and including) ext dir
+set extdir=%fulldir:*ext\=%
+
+:: remove trailing slash
+set extdir=%extdir:\=%
+
+if "%GSDLEXTS%" == "" (
+  set GSDLEXTS=%extdir%
+) else (
+  set GSDLEXTS=%GSDLEXTS%:%extdir%
+)
+
+echo +Your environment is now setup for %extdesc%
+
+:End
+
+popd
