mirror of
https://github.com/cookiengineer/audacity
synced 2026-04-20 05:00:50 +02:00
Locate and position the current Audacity source code, and clear a variety of old junk out of the way into junk-branches
This commit is contained in:
24
scripts/dot-emacs
Normal file
24
scripts/dot-emacs
Normal file
@@ -0,0 +1,24 @@
|
||||
;;
|
||||
;; The following commands should be added to your .emacs file to support
|
||||
;; Audacity's recommended indentation style.
|
||||
;;
|
||||
|
||||
(defun audacity-c++-indent-setup ()
|
||||
; Set basic offset to 3 spaces
|
||||
(setq c-basic-offset 3)
|
||||
; Don't ever insert tabs when auto-formatting files. Use only spaces.
|
||||
(setq indent-tabs-mode nil))
|
||||
|
||||
(add-hook 'c++-mode-hook 'audacity-c++-indent-setup)
|
||||
(add-hook 'c-mode-hook 'audacity-c++-indent-setup)
|
||||
|
||||
;;
|
||||
;; Other items you may wish to add to your .emacs file
|
||||
;;
|
||||
|
||||
(setq line-number-mode 1)
|
||||
(setq tab-width 3)
|
||||
(setq default-tab-width 3)
|
||||
|
||||
;; arch-tag: e98088ea-9ff0-4031-bfc0-1d2a30eab3de
|
||||
|
||||
88
scripts/mac_release_build
Executable file
88
scripts/mac_release_build
Executable file
@@ -0,0 +1,88 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f mac_release_build ]
|
||||
then
|
||||
echo 'You must execute this script from the base Audacity directory'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
plugs='gverb_1216.so hard_limiter_1413.so sc4_1882.so'
|
||||
for plug in $plugs
|
||||
do
|
||||
if [ ! -f plug-ins/$plug ]
|
||||
then
|
||||
echo "Missing plugin: $plug"
|
||||
echo
|
||||
echo "You must copy the following to the plug-ins directory before building:"
|
||||
echo
|
||||
echo $plugs
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
#
|
||||
# Build it
|
||||
#
|
||||
cd mac
|
||||
xcodebuild -configuration 'Release Static'
|
||||
cd ..
|
||||
|
||||
# Setup
|
||||
VERSION=`awk '/^#define+ AUDACITY_VERSION / {print $3}' src/Audacity.h`
|
||||
RELEASE=`awk '/^#define+ AUDACITY_RELEASE / {print $3}' src/Audacity.h`
|
||||
REVISION=`awk '/^#define+ AUDACITY_REVISION / {print $3}' src/Audacity.h`
|
||||
|
||||
if [ ! -z "$SUFFIX" ]
|
||||
then
|
||||
SUFFIX="-$SUFFIX"
|
||||
fi
|
||||
|
||||
VERSION=$VERSION.$RELEASE.$REVISION$SUFFIX
|
||||
|
||||
VOL="Audacity $VERSION"
|
||||
DMG="audacity-macosx-ub-$VERSION"
|
||||
|
||||
# Preclean
|
||||
rm -rf "$DMG" "$DMG.dmg" TMP.dmg
|
||||
|
||||
# Create structure
|
||||
mkdir "$DMG"
|
||||
|
||||
# Copy directories
|
||||
SUBDIRS="Audacity.app Languages nyquist plug-ins modules"
|
||||
for SUBDIR in $SUBDIRS
|
||||
do
|
||||
cp -pR "mac/build/Release Static/$SUBDIR" "$DMG"
|
||||
done
|
||||
|
||||
# Retrieve and Copy help
|
||||
cd scripts/mw2html_audacity
|
||||
./wiki2htm.sh
|
||||
cd ../..
|
||||
mkdir "$DMG/help"
|
||||
mv "help/manual" "$DMG/help/"
|
||||
|
||||
# Strip binary
|
||||
strip "$DMG/Audacity.app/Contents/MacOS/"*
|
||||
|
||||
# Install misc files
|
||||
cp -pR README.txt LICENSE.txt "$DMG"
|
||||
|
||||
# Create and mount the image
|
||||
hdiutil create -ov -srcdir "$DMG" -fs HFS+ -volname "$VOL" TMP.dmg
|
||||
|
||||
# Compress and prepare for Internet delivery
|
||||
hdiutil convert TMP.dmg -format UDZO -imagekey zlib-level=9 -o "$DMG.dmg"
|
||||
hdiutil internet-enable -yes "$DMG.dmg"
|
||||
|
||||
# Cleanup
|
||||
rm TMP.dmg
|
||||
|
||||
# Move DMG to parent
|
||||
mv *.dmg ..
|
||||
|
||||
# Create the zip version
|
||||
zip -r9 "../$DMG.zip" "$DMG"
|
||||
|
||||
exit
|
||||
65
scripts/mailman-discard.pl
Executable file
65
scripts/mailman-discard.pl
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
# Mailman-discard
|
||||
# Written by Dominic Mazzoni, 2003
|
||||
# Released into the Public Domain
|
||||
# NO WARRANTY
|
||||
|
||||
print "This script uses 'curl' to connect to Sourceforge's mailman server\n";
|
||||
print "and discard all of the pending messages in a mailbox. This is\n";
|
||||
print "useful when an account gets hit with a virus or lots of spam.\n";
|
||||
print "\n";
|
||||
print "Note that ALL pending messages are discarded, with no notice sent\n";
|
||||
print "to anyone! You CANNOT recover messages after running this script!\n";
|
||||
print "";
|
||||
|
||||
print "Enter Sourceforge list name (such as 'audacity-devel'): ";
|
||||
$list = <STDIN>;
|
||||
|
||||
print "Enter list password (warning, not hidden): ";
|
||||
$pass = <STDIN>;
|
||||
chop $pass;
|
||||
|
||||
print "Logging in and getting info...\n";
|
||||
|
||||
$out = `curl --data 'adminpw=$pass' --dump-header cookiefile https://lists.sourceforge.net/lists/admindb/$list`;
|
||||
|
||||
$data = "";
|
||||
|
||||
@lines = split("\n", $out);
|
||||
|
||||
$count = 0;
|
||||
foreach $line (@lines) {
|
||||
if ($line =~ 'INPUT name="([0-9]+)" type="RADIO" value="3"') {
|
||||
$count++;
|
||||
if ($data eq "") {
|
||||
$data = "$1=3";
|
||||
}
|
||||
else {
|
||||
$data = "$data&$1=3";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($count == 0) {
|
||||
print "Couldn't find any messages to discard!\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
print "Discarding $count messages from $list\n";
|
||||
|
||||
$out = `curl --cookie cookiefile --data '$data' https://lists.sourceforge.net/lists/admindb/$list`;
|
||||
|
||||
@lines = split("\n", $out);
|
||||
|
||||
foreach $line (@lines) {
|
||||
if ($line =~ 'no pending requests') {
|
||||
print "Success!\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
print "Done, but couldn't verify success.";
|
||||
|
||||
# arch-tag: dc81de17-0bcb-4131-988e-3a3dad0e8e8d
|
||||
|
||||
57
scripts/makeindex.pl
Executable file
57
scripts/makeindex.pl
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env perl
|
||||
print "Rebuilding the index file for wxhelp...\n";
|
||||
chdir "../help/wxhelp";
|
||||
@files = glob("*.htm");
|
||||
|
||||
open OF, ">audacity.hhk";
|
||||
print OF <<ENDF;
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
<html>
|
||||
<head>
|
||||
Index
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<ul>
|
||||
|
||||
ENDF
|
||||
|
||||
foreach $f (@files) {
|
||||
if ($f ne "credits.htm") {
|
||||
open IF, "$f";
|
||||
@lines = <IF>;
|
||||
close IF;
|
||||
foreach $l (@lines) {
|
||||
if ($l =~ "<b>([^<]*)</b>") {
|
||||
$phrase = $1;
|
||||
@words = split(" ", $phrase);
|
||||
if (@words <= 5 && $phrase ne "Audacity") {
|
||||
$dict{$phrase} = $f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach $d (keys %dict) {
|
||||
$f = $dict{$d};
|
||||
print OF "\t<li><object type=\"text/sitemap\">\n";
|
||||
print OF "\t\t<param name=\"Name\" value=\"$d\">\n";
|
||||
print OF "\t\t<param name=\"Local\" value=\"$f\">\n";
|
||||
print OF "\t</object>\n";
|
||||
};
|
||||
|
||||
print OF <<ENDF;
|
||||
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
ENDF
|
||||
|
||||
close OF;
|
||||
|
||||
# arch-tag: 89455395-07c3-4a9a-a359-063d7b5883e6
|
||||
|
||||
112
scripts/maketarball
Executable file
112
scripts/maketarball
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# Copyright 2003, 2004, 2005 Dominic Mazzoni and Matt Brubeck
|
||||
# Distributed under the GNU General Public License 2.0.
|
||||
# See the file LICENSE.txt for details.
|
||||
|
||||
print "maketarball 1.3.0 -- make Audacity distribution tarball\n";
|
||||
|
||||
unless(-f "src/Audacity.h") {
|
||||
print "Must be run from Audacity directory\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
# find version number
|
||||
open(HEADER, "src/Audacity.h");
|
||||
@lines = <HEADER>;
|
||||
$lines = join " ", @lines;
|
||||
$lines =~ /AUDACITY_VERSION_STRING "([0-9\-.a-z]*)"/;
|
||||
$version = $1;
|
||||
print "version set to $version...\n";
|
||||
close(HEADER);
|
||||
|
||||
print "making copy of source directory...\n";
|
||||
`cp -r . ../audacity-src-$version`;
|
||||
chdir "../audacity-src-$version";
|
||||
|
||||
print "making distclean...\n";
|
||||
`make distclean`;
|
||||
|
||||
print "removing CVS directories...\n";
|
||||
`find . -name "CVS" -exec rm -rf '{}' \\; 2> /dev/null`;
|
||||
`find . -name ".cvsignore" -exec rm -rf '{}' \\; 2> /dev/null`;
|
||||
|
||||
print "removing emacs temp files...\n";
|
||||
`find . -name "*~" -exec rm -rf '{}' \\; 2> /dev/null`;
|
||||
|
||||
print "removing executable and other intermediate files...\n";
|
||||
`rm -rf audacity .depend obj config.cache config.status config.log Makefile`;
|
||||
|
||||
print "removing bugs and todo lists\n";
|
||||
`rm -f bugs.txt todo.txt`;
|
||||
|
||||
print "removing scripts...\n";
|
||||
`rm -rf scripts`;
|
||||
|
||||
print "removing libraries that should be installed locally...\n";
|
||||
`rm -rf lib-src/libogg lib-src/libvorbis lib-src/libmad lib-src/id3lib`;
|
||||
`rm -rf lib-src/libid3tag`;
|
||||
`rm -rf lib-src/iAVC lib-src/libsamplerate`;
|
||||
`rm -rf lib-src/wave++ lib-src/libflac`;
|
||||
`rm -rf lib-src/twolame`;
|
||||
|
||||
print "removing qa\n";
|
||||
`rm -rf qa`;
|
||||
|
||||
print "removing doxygen files (unfinished)\n";
|
||||
`rm audacity.dox`;
|
||||
|
||||
print "removing webbrowser help files\n";
|
||||
`rm -rf help/webbrowser`;
|
||||
|
||||
print "removing unused portaudio-v19 dirs\n";
|
||||
`rm -rf lib-src/portaudio-v19/docs`;
|
||||
`rm -rf lib-src/portaudio-v19/pa_asio`;
|
||||
`rm -rf lib-src/portaudio-v19/pa_sgi`;
|
||||
`rm -rf lib-src/portaudio-v19/pa_mac_sm`;
|
||||
`rm -f lib-src/portaudio-v19/pa_tests/debug*`;
|
||||
|
||||
print "removing wxstd locale files (since they should come with wxWidgets)\n";
|
||||
`rm -rf locale/wxstd`;
|
||||
|
||||
print "removing Nyquist plug-ins that are just for show\n";
|
||||
`rm -f plug-ins/analyze.ny plug-ins/fadein.ny plug-ins/fadeout.ny`;
|
||||
`rm -f plug-ins/beat.ny plug-ins/undcbias.ny`;
|
||||
|
||||
print "Giving VC++ project/workspace files DOS line endings\n";
|
||||
@projfiles = split("\n", `find . -name "*.ds?"`);
|
||||
foreach $f (@projfiles) {
|
||||
print `unix2dos "$f"`;
|
||||
}
|
||||
|
||||
print "Changing Windows header so that it doesn't build with\n";
|
||||
print "support for libmad, libid3tag, libtwolame or libvorbis by default.\n";
|
||||
print "\n";
|
||||
|
||||
open FP, ">>win/configwin.h";
|
||||
print FP "\n\n";
|
||||
print FP "// The Audacity source tarball does NOT come with\n";
|
||||
print FP "// libmad, libid3tag, libtwolame, libogg, or libvorbis.\n";
|
||||
print FP "\n";
|
||||
print FP "// Delete the following lines if you install them manually.\n";
|
||||
print FP "\n";
|
||||
print FP "#undef MP3SUPPORT\n";
|
||||
print FP "#undef USE_LIBID3TAG\n";
|
||||
print FP "#undef USE_LIBMAD\n";
|
||||
print FP "#undef USE_LIBVORBIS\n";
|
||||
print FP "#undef USE_LIBTWOLAME\n";
|
||||
close FP;
|
||||
|
||||
#print "Using the VC++ workspace that doesn't depend on libmad, libid3tag,\n";
|
||||
#print "libogg, libvorbis, libsamplerate, or libflac.\n";
|
||||
#print "\n";
|
||||
#TODO: Update this to use .vcproj/.sln files?
|
||||
#
|
||||
#`cp win/audacity-nomp3ogg.dsw win/audacity.dsw`;
|
||||
#`rm win/audacity-nomp3ogg.dsw`;
|
||||
|
||||
#print "making tarball audacity-src-$version.tgz...\n";
|
||||
chdir "..";
|
||||
#`tar zcf audacity-src-$version.tgz audacity-src-$version`;
|
||||
|
||||
print "done.\n";
|
||||
410
scripts/maketarball.sh
Executable file
410
scripts/maketarball.sh
Executable file
@@ -0,0 +1,410 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2003, 2004, 2005 Dominic Mazzoni and Matt Brubeck
|
||||
# Distributed under the GNU General Public License 2.0.
|
||||
# See the file LICENSE.txt for details.
|
||||
# Re-written in Bash by Richard Ash 2006
|
||||
|
||||
function myrmrvf {
|
||||
# a replacement for rm -rvf that has it's output controlled
|
||||
# by the value of the first argument
|
||||
# setting it to 1 makes it verbose, to anything else makes it quiet
|
||||
if [ $1 -eq 1 ]
|
||||
then #verbose mode
|
||||
shift
|
||||
echo "rm -rf $*"
|
||||
rm -rf $*
|
||||
else
|
||||
# quietly
|
||||
shift
|
||||
rm -rf $*
|
||||
fi
|
||||
}
|
||||
|
||||
function myrmvf {
|
||||
# a replacement for rm -vf that has it's output controlled
|
||||
# by the value of the first argument
|
||||
# setting it to 1 makes it verbose, to anything else makes it quiet
|
||||
if [ $1 -eq 1 ]
|
||||
then #verbose mode
|
||||
shift
|
||||
echo "rm -f $*"
|
||||
rm -f $*
|
||||
else
|
||||
# quietly
|
||||
shift
|
||||
rm -f $*
|
||||
fi
|
||||
}
|
||||
|
||||
function myfindrm {
|
||||
# search the file tree removing files that match the specified pattern in
|
||||
# the second argument, with output controlled by the value of the first
|
||||
# argument.
|
||||
# setting it to 1 makes it verbose, to anything else makes it quiet
|
||||
if [ $1 -eq 1 ]; then
|
||||
find . -name "$2" -print -delete
|
||||
else
|
||||
find . -name "$2" -delete
|
||||
fi
|
||||
}
|
||||
|
||||
function updsln {
|
||||
# removes unwanted projects from the Windows solution
|
||||
# setting it to 1 makes it verbose, to anything else makes it quiet
|
||||
if [ $1 -eq 1 ]
|
||||
then #verbose mode
|
||||
shift
|
||||
echo "sed -e '/$*/,/EndProject/d' win/audacity.sln >win/audacity.sln.new"
|
||||
sed -e "/$*/,/EndProject/d" win/audacity.sln >win/audacity.sln.new
|
||||
echo "mv win/audacity.sln.new win/audacity.sln"
|
||||
mv win/audacity.sln.new win/audacity.sln
|
||||
else
|
||||
# quietly
|
||||
shift
|
||||
sed -e "/$*/,/EndProject/d" win/audacity.sln >win/audacity.sln.new
|
||||
mv win/audacity.sln.new win/audacity.sln
|
||||
fi
|
||||
}
|
||||
|
||||
function cleanfulltree {
|
||||
# does the clean-up op on the full source tree prior to building the full
|
||||
# tarball
|
||||
printf "making distclean... "
|
||||
if [ $1 -eq 1 ]; then
|
||||
make distclean;
|
||||
else
|
||||
make distclean 2>/dev/null > /dev/null;
|
||||
fi
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing CVS directories... ";
|
||||
find . -depth -name 'CVS' -execdir rm -rf '{}' ';'
|
||||
# -depth is needed to avoid find trying to examine directories it has just
|
||||
# deleted.
|
||||
# The sort of quotes used is critical!
|
||||
myfindrm $1 ".cvsignore"
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing vim / emacs temp files... ";
|
||||
myfindrm $1 "*~"
|
||||
printf "\nremoving CVS conflict files... ";
|
||||
myfindrm $1 ".#*"
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing executable and other intermediate files... ";
|
||||
myrmvf $1 audacity src/.depend src/.gchdepend
|
||||
myfindrm $1 config.status
|
||||
myfindrm $1 config.log
|
||||
myfindrm $1 Makefile
|
||||
myfindrm $1 config.cache
|
||||
find . -depth -name 'autom4te.cache' -execdir rm -rf '{}' ';'
|
||||
myfindrm $1 aclocal.m4
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing executable bit from source files... ";
|
||||
if [ $1 -eq 1 ]; then
|
||||
find . -name '*.cpp' -executable -execdir chmod ugo-x '{}' ';' -print
|
||||
find . -name '*.h' -executable -execdir chmod ugo-x '{}' ';' -print
|
||||
else
|
||||
find . -name '*.cpp' -executable -execdir chmod ugo-x '{}' ';'
|
||||
find . -name '*.h' -executable -execdir chmod ugo-x '{}' ';'
|
||||
fi
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing orphaned symlinks in lib-src/ ... ";
|
||||
myrmvf $1 lib-src/*.a
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing doxygen output files ... ";
|
||||
myrmrvf $1 dox
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing unused libraries from CVS tree ..."
|
||||
myrmrvf $1 lib-src/iAVC lib-src/id3lib ;
|
||||
myrmrvf $1 lib-src/portaudio lib-src/portburn lib-src/rtaudio;
|
||||
myrmrvf $1 lib-src/wave++;
|
||||
printf "Done\n"
|
||||
}
|
||||
|
||||
# remove all the things we have in CVS for convenience rather than being
|
||||
# necessary
|
||||
function slimtree {
|
||||
printf "removing todo lists ... ";
|
||||
myrmvf $1 todo.txt
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing scripts and tests ... ";
|
||||
myrmrvf $1 scripts tests
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing libraries that should be installed locally..."
|
||||
myrmrvf $1 lib-src/expat lib-src/libflac lib-src/libid3tag;
|
||||
myrmrvf $1 lib-src/liblrdf lib-src/libmad lib-src/libogg lib-src/libraptor;
|
||||
myrmrvf $1 lib-src/libsamplerate lib-src/libsndfile;
|
||||
myrmrvf $1 lib-src/libvorbis lib-src/redland lib-src/slv2 lib-src/soundtouch;
|
||||
myrmrvf $1 lib-src/twolame;
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing qa ... ";
|
||||
myrmrvf $1 qa
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing unused portaudio-v19 directories ... ";
|
||||
myrmrvf $1 lib-src/portaudio-v19/docs
|
||||
myrmrvf $1 lib-src/portaudio-v19/pa_asio
|
||||
myrmrvf $1 lib-src/portaudio-v19/pa_sgi
|
||||
myrmrvf $1 lib-src/portaudio-v19/pa_mac_sm
|
||||
myrmrvf $1 lib-src/portaudio-v19/test
|
||||
myrmrvf $1 lib-src/portaudio-v19/testcvs
|
||||
printf "Done\n"
|
||||
|
||||
printf "removing wxstd locale files (since they come with wxWidgets)\n";
|
||||
myrmrvf $1 locale/wxstd
|
||||
|
||||
printf "removing Nyquist plug-ins that are just for show ... "
|
||||
myrmvf $1 plug-ins/analyze.ny plug-ins/fadein.ny plug-ins/fadeout.ny
|
||||
myrmvf $1 plug-ins/undcbias.ny
|
||||
printf "Done\n"
|
||||
}
|
||||
|
||||
# fix Windows being fussy about line endings
|
||||
function fixendings {
|
||||
printf "Giving VC++ project/workspace files DOS line endings ... "
|
||||
if [ $1 -eq 1 ]; then
|
||||
for file in `find . \( -name '*.ds?' -print \) -or \( -name '*.vcproj' -print \) -or \( -name '*.sln' -print \)`
|
||||
do
|
||||
unix2dos "$file"
|
||||
done
|
||||
else
|
||||
for file in `find . \( -name '*.ds?' -print \) -or \( -name '*.vcproj' -print \) -or \( -name '*.sln' -print \)`
|
||||
do
|
||||
unix2dos "$file" > /dev/null 2>/dev/null
|
||||
done
|
||||
fi
|
||||
printf "Done\n"
|
||||
}
|
||||
|
||||
function fixwinforslim {
|
||||
printf "Changing Windows header so that it doesn't try to build with\n";
|
||||
printf "support for optional libraries by default.\n";
|
||||
|
||||
echo "" >> "win/configwin.h"
|
||||
echo "// The Audacity source tarball does NOT come with" >> "win/configwin.h"
|
||||
echo "// any optional libraries." >> "win/configwin.h"
|
||||
echo "" >> "win/configwin.h"
|
||||
echo "// Delete the following lines if you install them manually." >> "win/configwin.h"
|
||||
echo "" >> "win/configwin.h"
|
||||
echo "#undef MP3SUPPORT" >> "win/configwin.h"
|
||||
echo "#undef USE_FFMPEG" >> "win/configwin.h"
|
||||
echo "#undef USE_LIBFLAC" >> "win/configwin.h"
|
||||
echo "#undef USE_LIBID3TAG" >> "win/configwin.h"
|
||||
echo "#undef USE_LIBLRDF" >> "win/configwin.h"
|
||||
echo "#undef USE_LIBMAD" >> "win/configwin.h"
|
||||
echo "#undef USE_LIBSAMPLERATE" >> "win/configwin.h"
|
||||
echo "#undef USE_LIBTWOLAME" >> "win/configwin.h"
|
||||
echo "#undef USE_LIBVORBIS" >> "win/configwin.h"
|
||||
echo "#undef USE_SLV2" >> "win/configwin.h"
|
||||
echo "#undef USE_SOUNDTOUCH" >> "win/configwin.h"
|
||||
echo "#undef EXPERIMENTAL_SCOREALIGN" >> "win/configwin.h"
|
||||
|
||||
|
||||
printf "removing unwanted projects from VC++ solution\n"
|
||||
updsln $mode libflac
|
||||
updsln $mode libflac++
|
||||
updsln $mode libid3tag
|
||||
updsln $mode libmad
|
||||
updsln $mode liblrdf
|
||||
updsln $mode librdf
|
||||
updsln $mode libsamplerate
|
||||
updsln $mode twolame
|
||||
updsln $mode libvorbis
|
||||
updsln $mode libogg
|
||||
updsln $mode raptor
|
||||
updsln $mode rasqal
|
||||
updsln $mode slv2
|
||||
updsln $mode soundtouch
|
||||
updsln $mode libscorealign
|
||||
}
|
||||
|
||||
echo "Maketarball 2.1.0 -- make an Audacity distribution tarball"
|
||||
|
||||
# check number of arguments, if not one then print a usage message
|
||||
if [ $# == 1 ]; then
|
||||
:
|
||||
# carry on, looks like they know what they are doing
|
||||
else
|
||||
echo "Script to make directory trees for audacity source tarballs"
|
||||
echo "Usage: $0 <mode>"
|
||||
echo "Where mode is either \"quiet\" or \"verbose\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$1" = "quiet" ]; then
|
||||
mode=0
|
||||
elif [ "$1" = "verbose" ]; then
|
||||
mode=1
|
||||
else
|
||||
echo "The argument to $0 must be either \"quiet\" or \"verbose\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "src/Audacity.h" ]
|
||||
then :
|
||||
# a null body - we will just carry straight on
|
||||
else
|
||||
echo "$0 must be run from top-level audacity directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The script relies on make working, so Makefiles need to be present. This
|
||||
# means that configure must have been run on the sources. In general it doesn't
|
||||
# matter what options, but the generation of a Makefile in lib-src/ in
|
||||
# particular is important. Check that lib-src/Makefile is present and newer than
|
||||
# lib-src/Makefile.in before continuing
|
||||
|
||||
# Mac OS X also has problems if libsndfile isn't configured with automake
|
||||
# dependency turned off, so we should check that libsndfile is clean, and ask
|
||||
# for reconfiguration if not.
|
||||
reconf=0
|
||||
if [[ -f "lib-src/Makefile" ]] ; then
|
||||
# we have a Makefile - is it new enough?
|
||||
t2=$(date +%s -r "lib-src/Makefile")
|
||||
t1=$(date +%s -r "lib-src/Makefile.in")
|
||||
if [[ $t1 -gt $t2 ]] ; then
|
||||
# not new enough, reconfigure
|
||||
reconf=1
|
||||
fi
|
||||
else
|
||||
# if no Makefile, definitly need to configure
|
||||
reconf=1
|
||||
fi
|
||||
|
||||
if [[ -f "lib-src/libsndfile/Makefile" ]] ; then
|
||||
# has a Makefile - is it newer than .am? (this is an automake package)
|
||||
t2=$(date +%s -r "lib-src/libsndfile/Makefile")
|
||||
t1=$(date +%s -r "lib-src/libsndfile/Makefile.am")
|
||||
if [[ $t1 -gt $t2 ]] ; then
|
||||
# not new enough, reconfigure
|
||||
reconf=1
|
||||
fi
|
||||
else
|
||||
# if no Makefile, need to configure libsndfile to get it built enough for
|
||||
# Mac systems to complete the job
|
||||
reconf=1
|
||||
fi
|
||||
|
||||
# these are the arguments we will pass to configure when it is run
|
||||
configargs="--enable-maintainer-mode --with-libsndfile=local --with-lib-preference=\"local system\""
|
||||
|
||||
if [[ x"$reconf" = x1 ]] ; then
|
||||
echo "Your Makefiles are out of date or missing. (Re)running configure to"
|
||||
echo "create up-to-date Makefiles before building tarballs..."
|
||||
echo " ./configure ${configargs}"
|
||||
fi
|
||||
|
||||
# if we are in silent mode, then redirect the output of configure
|
||||
if [ $mode -eq 1 ]; then
|
||||
$SHELL -c "./configure ${configargs}"
|
||||
else
|
||||
$SHELL -c "./configure ${configargs}" > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
# The version number is stored in a C++ header as a set of #defines. Trying to
|
||||
# parse this with another language (as was done first with Perl and then with
|
||||
# awk) is always going to be fragile, so we use a C++ pre-processor (which
|
||||
# strangely enough we are pretty much garunteed to have) to do it. Essentially
|
||||
# we have a trivial bit of C++ code stored in-line in this script which is fed
|
||||
# through the pre-processor to get the version string components where we can
|
||||
# find them.
|
||||
|
||||
echo -n "Getting program version... "
|
||||
# first off, find out what C++ pre-processor configure has found for us to use
|
||||
# (because we want the same one that will be used to build Audacity). This is a
|
||||
# neat trick using the config.status script left behind after configure has
|
||||
# been run
|
||||
cppprog="$(echo '@CXX@' | ./config.status --file=-)"
|
||||
|
||||
# now create a temporary directory where out source file will live
|
||||
cppdir="$(mktemp -d mktarball.XXXXXXXXXXX)"
|
||||
cppfile="${cppdir}/ver.cpp"
|
||||
# create the test source file
|
||||
cat > "${cppfile}" << EOFCPP
|
||||
#include "$(pwd)/src/Audacity.h"
|
||||
AUDACITY_VERSION
|
||||
AUDACITY_RELEASE
|
||||
AUDACITY_REVISION
|
||||
AUDACITY_SUFFIX
|
||||
EOFCPP
|
||||
|
||||
# pre-process the source (to get macros expanded) and parse the result
|
||||
major_version=$(${cppprog} "${cppfile}" -E | tail -n 4 | head -n 1)
|
||||
minor_version=$(${cppprog} "${cppfile}" -E | tail -n 3 | head -n 1)
|
||||
micro_version=$(${cppprog} "${cppfile}" -E | tail -n 2 | head -n 1)
|
||||
# this gets the text out of the wxT("") macro it is already wrapped in
|
||||
version_suffix=$(${cppprog} "${cppfile}" -E | tail -n 1 | cut -d\" -f 2)
|
||||
# see if the suffix contains a compiler date macro
|
||||
${cppprog} "${cppfile}" -E | tail -n 1 | grep -v -q '__TDATE__'
|
||||
version_date=$?
|
||||
|
||||
if [[ ${version_date} -ne 0 ]] ; then
|
||||
# need to suffix the date on to the suffix string
|
||||
version_suffix="${version_suffix}$(date "+%Y%m%d")"
|
||||
fi
|
||||
# remove that temp directory and the associated files
|
||||
rm -fr "${cppdir}"
|
||||
|
||||
version="${major_version}.${minor_version}.${micro_version}${version_suffix}"
|
||||
echo "${version}"
|
||||
# completes previous echo -n call
|
||||
|
||||
# capture some directory information, we'll want it later
|
||||
sourcedir="$(pwd)" # where the sources are
|
||||
cd ..
|
||||
topdir="$(pwd)" # one level up where the tarballs come out
|
||||
tarname="audacity-src-${version}" # the directory we will find inside tarballs
|
||||
tardir="${topdir}/${tarname}" # absolute tar directory
|
||||
|
||||
printf "making copy of source directory... "
|
||||
cd "${sourcedir}" # go to sources dir
|
||||
cp -r . "${tardir}"
|
||||
cd "${tardir}"
|
||||
printf "Done\n"
|
||||
|
||||
# now clean out the directory of all the things we don't need in either the full
|
||||
# or the slimmed tarball, prior to building the full source tarball
|
||||
cleanfulltree $mode;
|
||||
|
||||
# fix line endings issues caused by this being on *nix and CVS messing with
|
||||
# line endings on the fly
|
||||
fixendings $mode;
|
||||
|
||||
# Tar up that lot as the full source tarball
|
||||
cd "${topdir}"
|
||||
printf "Creating full source tarball .... "
|
||||
tar cf "audacity-fullsrc-${version}.tar" "${tarname}"
|
||||
printf "Done\n"
|
||||
|
||||
printf "Compressing full source tarball in the background .... "
|
||||
bzip2 "audacity-fullsrc-${version}.tar" &
|
||||
cd "${tardir}"
|
||||
|
||||
# now we have the full source tarball, lets slim it down to the bits that
|
||||
# you actually need to build audacity on a shared library system with the
|
||||
# relevant libraries installed on the system (e.g. Linux distros)
|
||||
slimtree $mode;
|
||||
|
||||
# Fix up windows builds for the slimmed state of the tarball
|
||||
fixwinforslim ${mode}
|
||||
|
||||
# Tar up that lot as the slim source tarball
|
||||
cd "${topdir}"
|
||||
printf "Creating minimal source tarball .... "
|
||||
tar cf "audacity-minsrc-${version}.tar" "${tarname}"
|
||||
printf "Done\n"
|
||||
|
||||
printf "Compressing minimal source tarball .... "
|
||||
bzip2 "audacity-minsrc-${version}.tar"
|
||||
|
||||
cd "${tardir}"
|
||||
printf "Done\n"
|
||||
59
scripts/mkdmg
Executable file
59
scripts/mkdmg
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Prepare a disk image
|
||||
#
|
||||
|
||||
#
|
||||
SUFFIX=$1
|
||||
TYPE=$2
|
||||
|
||||
# Setup
|
||||
VERSION=`awk '/^#define+ AUDACITY_VERSION / {print $3}' src/Audacity.h`
|
||||
RELEASE=`awk '/^#define+ AUDACITY_RELEASE / {print $3}' src/Audacity.h`
|
||||
REVISION=`awk '/^#define+ AUDACITY_REVISION / {print $3}' src/Audacity.h`
|
||||
|
||||
if [ -z "$SUFFIX" ]
|
||||
then
|
||||
SUFFIX=`grep '^#define AUDACITY_SUFFIX ' src/Audacity.h | cut -d '"' -f 2`
|
||||
fi
|
||||
|
||||
if [ ! -z "$TYPE" ]
|
||||
then
|
||||
TYPE="-$TYPE"
|
||||
fi
|
||||
|
||||
VERSION=$VERSION.$RELEASE.$REVISION$SUFFIX
|
||||
|
||||
VOL="Audacity $VERSION"
|
||||
DMG="audacity-macosx$TYPE-$VERSION"
|
||||
|
||||
# Preclean
|
||||
rm -rf "$DMG" "$DMG.dmg" TMP.dmg
|
||||
|
||||
# Create structure
|
||||
mkdir "$DMG"
|
||||
|
||||
# Copy directories
|
||||
SUBDIRS="Audacity.app Languages nyquist plug-ins"
|
||||
for SUBDIR in $SUBDIRS
|
||||
do
|
||||
cp -pR "mac/build/Release Static/$SUBDIR" "$DMG"
|
||||
done
|
||||
|
||||
# Strip binary
|
||||
strip "$DMG/Audacity.app/Contents/MacOS/"*
|
||||
|
||||
# Install misc files
|
||||
cp -pR README.txt LICENSE.txt "$DMG"
|
||||
|
||||
# Create and mount the image
|
||||
hdiutil create -ov -srcdir "$DMG" -fs HFS+ -volname "$VOL" TMP.dmg
|
||||
|
||||
# Compress and prepare for Internet delivery
|
||||
hdiutil convert TMP.dmg -format UDZO -imagekey zlib-level=9 -o "$DMG.dmg"
|
||||
hdiutil internet-enable -yes "$DMG.dmg"
|
||||
|
||||
# Cleanup
|
||||
rm TMP.dmg
|
||||
|
||||
exit
|
||||
1
scripts/mw2html_audacity/.cvsignore
Normal file
1
scripts/mw2html_audacity/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
*.pyc
|
||||
1
scripts/mw2html_audacity/footer.html
Normal file
1
scripts/mw2html_audacity/footer.html
Normal file
@@ -0,0 +1 @@
|
||||
<div align="center"><ul id="f_list"><li>Dump created on %DATE% - <a href="%ONLINEURL%">Check current version of this page</a>.</li></ul></div>
|
||||
1536
scripts/mw2html_audacity/htmldata.py
Normal file
1536
scripts/mw2html_audacity/htmldata.py
Normal file
File diff suppressed because it is too large
Load Diff
1086
scripts/mw2html_audacity/mw2html.py
Normal file
1086
scripts/mw2html_audacity/mw2html.py
Normal file
File diff suppressed because it is too large
Load Diff
9
scripts/mw2html_audacity/sidebar.html
Normal file
9
scripts/mw2html_audacity/sidebar.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<div class="portlet">
|
||||
<h5>Help Location</h5>
|
||||
<div class="pBody">
|
||||
<ul>
|
||||
<li><a href="index.html">Local manual in use</a></li>
|
||||
<li><a href="http://audacityteam.org/manual/index.php">Internet manual</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
6
scripts/mw2html_audacity/wiki2htm.bat
Normal file
6
scripts/mw2html_audacity/wiki2htm.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
python mw2html.py http://manual.audacityteam.org ..\..\help\temp -s
|
||||
rmdir /S /Q ..\..\help\manual
|
||||
mkdir ..\..\help\manual
|
||||
xcopy ..\..\help\temp\manual.audacityteam.org ..\..\help\manual\ /E /C /Y /Q
|
||||
rmdir /S /Q ..\..\help\temp
|
||||
|
||||
10
scripts/mw2html_audacity/wiki2htm.sh
Executable file
10
scripts/mw2html_audacity/wiki2htm.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
helpdir="../../help/manual"
|
||||
tmpdir_="../../help/temp"
|
||||
srcuri="http://manual.audacityteam.org"
|
||||
|
||||
mkdir -p "${tmpdir_}"
|
||||
python mw2html.py "${srcuri}" "${tmpdir_}" -s
|
||||
mv "${tmpdir_}/manual.audacityteam.org" "${helpdir}"
|
||||
rm -r "${tmpdir_}"
|
||||
493
scripts/pipe-test.pl
Executable file
493
scripts/pipe-test.pl
Executable file
@@ -0,0 +1,493 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
# Test script for communicating with audacity via mod-script-pipe
|
||||
# Audacity should be running first, with the scripting plugin loaded.
|
||||
#
|
||||
# Note that currently, some menu commands require the project to be focused for
|
||||
# them to work. Further information and a list of known problems is available
|
||||
# on the 'Scripting' page of the Audacity wiki.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Time::HiRes qw( gettimeofday tv_interval );
|
||||
use List::Util qw( max );
|
||||
|
||||
# Where should screenshots and exported tracks be saved?
|
||||
our $home = $ENV{HOME};
|
||||
our $screenshotDir = $home.'/pipetest/';
|
||||
our $effectTestDir = $home.'/pipetest/';
|
||||
|
||||
# Variables for pipe names
|
||||
our $Name;
|
||||
our $UID;
|
||||
our $ToSrvName;
|
||||
our $FromSrvName;
|
||||
|
||||
# For timing
|
||||
our $t0;
|
||||
|
||||
# TODO: Maybe get the pipe names from audacity?
|
||||
if ($^O eq 'MSWin32') {
|
||||
$Name = 'Srv';
|
||||
$ToSrvName = '\\\\.\\pipe\\To'.$Name.'Pipe';
|
||||
$FromSrvName = '\\\\.\\pipe\\From'.$Name.'Pipe';
|
||||
} elsif ($^O eq 'linux') {
|
||||
$UID = $<;
|
||||
$ToSrvName = '/tmp/audacity_script_pipe.to.'.$UID;
|
||||
$FromSrvName = '/tmp/audacity_script_pipe.from.'.$UID;
|
||||
} elsif ($^O eq 'darwin') {
|
||||
$UID = $<;
|
||||
$ToSrvName = '/tmp/audacity_script_pipe.to.'.$UID;
|
||||
$FromSrvName = '/tmp/audacity_script_pipe.from.'.$UID;
|
||||
}
|
||||
|
||||
# Open pipes
|
||||
sub startUp{
|
||||
open( TO_SRV, "+<$ToSrvName" )
|
||||
or die "Could not open $ToSrvName";
|
||||
open( FROM_SRV, "+<$FromSrvName" )
|
||||
or die "Could not open $FromSrvName";
|
||||
|
||||
# The next 'magic incantation' causes TO_SRV to be flushed every time we
|
||||
# write something to it.
|
||||
select((select(TO_SRV),$|=1)[0]);
|
||||
}
|
||||
|
||||
# Close pipes
|
||||
sub finish{
|
||||
print "Done. Press return to end.";
|
||||
<>;
|
||||
close TO_SRV;
|
||||
close FROM_SRV;
|
||||
}
|
||||
|
||||
# Subroutines for measuring how long a command takes to complete
|
||||
sub startTiming{
|
||||
$t0 = [gettimeofday];
|
||||
}
|
||||
sub stopTiming{
|
||||
my $elapsed = tv_interval ( $t0, [gettimeofday] );
|
||||
print "[Total time for command: $elapsed seconds.]\n";
|
||||
}
|
||||
|
||||
# Write a command to the pipe
|
||||
sub sendCommand{
|
||||
my $command = shift;
|
||||
if ($^O eq 'MSWin32') {
|
||||
print TO_SRV "$command
|
||||
|
||||
\r\n\0";
|
||||
} else {
|
||||
# Don't explicitly send \0 on Linux or reads after the first one fail...
|
||||
print TO_SRV "$command\n";
|
||||
}
|
||||
print "[$command]\n";
|
||||
}
|
||||
|
||||
# Send (and time) a command, and print responses
|
||||
sub doCommand{
|
||||
startTiming();
|
||||
sendCommand(shift);
|
||||
|
||||
my @resps = getResponses();
|
||||
map { print "$_\n"; } @resps;
|
||||
|
||||
stopTiming();
|
||||
print "\n";
|
||||
return @resps;
|
||||
}
|
||||
|
||||
# Return an array of all responses
|
||||
sub getResponses{
|
||||
my $resp;
|
||||
my @responses;
|
||||
|
||||
while($resp = <FROM_SRV>) {
|
||||
chomp($resp);
|
||||
last if ($resp eq '');
|
||||
push(@responses, $resp);
|
||||
}
|
||||
|
||||
return @responses;
|
||||
}
|
||||
|
||||
# Get the value of a preference
|
||||
sub getPref{
|
||||
my $name = shift;
|
||||
sendCommand("GetPreference: PrefName=$name");
|
||||
my @resps = getResponses();
|
||||
return shift(@resps);
|
||||
}
|
||||
|
||||
# Set the value of a preference
|
||||
sub setPref{
|
||||
my $name = shift;
|
||||
my $val = shift;
|
||||
doCommand("SetPreference: PrefName=$name PrefValue=$val");
|
||||
}
|
||||
|
||||
# Send a screenshot command
|
||||
sub screenshot{
|
||||
my $filePath = shift;
|
||||
my $captureMode = shift;
|
||||
my $background = shift;
|
||||
doCommand("Screenshot: FilePath=$filePath CaptureMode=$captureMode Background=$background");
|
||||
}
|
||||
|
||||
# Send a menu command
|
||||
sub menuCommand{
|
||||
my $commandName = shift;
|
||||
doCommand("MenuCommand: CommandName=$commandName");
|
||||
}
|
||||
|
||||
# Send a command which requests a list of all available menu commands
|
||||
sub getMenuCommands{
|
||||
doCommand("GetAllMenuCommands: ShowStatus=0");
|
||||
}
|
||||
|
||||
sub showMenuStatus{
|
||||
sendCommand("GetAllMenuCommands: ShowStatus=1");
|
||||
my @resps = getResponses();
|
||||
map { print "$_\n"; } @resps;
|
||||
}
|
||||
|
||||
# Send a string that should be a syntax error
|
||||
sub syntaxError{
|
||||
doCommand("CommandWithNoColon foo bar");
|
||||
}
|
||||
|
||||
# Send a command that doesn't exist
|
||||
sub noSuchCommand{
|
||||
doCommand("NoSuchCommand: myParam=3");
|
||||
}
|
||||
|
||||
sub parameterTest{
|
||||
# Set a non-existent parameter
|
||||
doCommand("GetAllMenuCommands: blah=2");
|
||||
# Parameter with no '='
|
||||
doCommand("MenuCommand: CommandName");
|
||||
}
|
||||
|
||||
# See what happens when commands have extra spaces in various places
|
||||
sub extraSpaces{
|
||||
doCommand("Help: CommandName=Help");
|
||||
doCommand("Help : CommandName=Help");
|
||||
doCommand("Help: CommandName =Help");
|
||||
doCommand("Help: CommandName= Help");
|
||||
doCommand("Help: CommandName=Help ");
|
||||
}
|
||||
|
||||
# Test whether we can fall back to batch mode
|
||||
sub batchFallback{
|
||||
doCommand( "Echo: Delay=1.0 Decay=0.5" );
|
||||
}
|
||||
|
||||
# Send lots of commands quickly
|
||||
sub stressTest{
|
||||
my $n = 0;
|
||||
while($n < 600){
|
||||
getMenuCommands();
|
||||
++$n;
|
||||
}
|
||||
}
|
||||
|
||||
# Get help on a command
|
||||
sub help{
|
||||
my $cmdName = shift;
|
||||
doCommand("Help: CommandName=$cmdName");
|
||||
}
|
||||
|
||||
# Get help on all of the listed commands
|
||||
sub fullHelp{
|
||||
my @cmds = qw(BatchCommand CompareAudio MenuCommand GetAllMenuCommands GetTrackInfo Help Message Screenshot Select SetTrackInfo);
|
||||
foreach my $cmd (@cmds){
|
||||
help($cmd);
|
||||
}
|
||||
}
|
||||
|
||||
# From script, this works like an 'echo'
|
||||
sub message{
|
||||
my $msg = shift;
|
||||
doCommand("Message: MessageString=$msg");
|
||||
}
|
||||
|
||||
# Send a CompareAudio command with a given threshold
|
||||
sub compareAudio{
|
||||
my $threshold = shift;
|
||||
my @resps = doCommand("CompareAudio: Threshold=$threshold");
|
||||
shift(@resps);
|
||||
return @resps;
|
||||
}
|
||||
|
||||
# Delete all tracks
|
||||
sub deleteAll{
|
||||
doCommand("Select: Mode=All");
|
||||
menuCommand("RemoveTracks");
|
||||
}
|
||||
|
||||
# A test of the CompareAudio command
|
||||
sub compareTest{
|
||||
deleteAll();
|
||||
|
||||
menuCommand("NewAudioTrack");
|
||||
doCommand("Chirp:");
|
||||
menuCommand("NewAudioTrack");
|
||||
doCommand("Chirp:");
|
||||
|
||||
my $j = 0;
|
||||
while($j < 3)
|
||||
{
|
||||
my $i = 0;
|
||||
while($i < 6){
|
||||
doCommand("Select: Mode=Range StartTime=5.0 EndTime=8.0 FirstTrack=0 LastTrack=0");
|
||||
|
||||
doCommand("Amplify: Ratio=0.95");
|
||||
doCommand("Select: Mode=All");
|
||||
compareAudio(0.4 - 0.1*$j);
|
||||
++$i;
|
||||
}
|
||||
++$j;
|
||||
}
|
||||
}
|
||||
|
||||
# Print some info returned by the GetTrackInfo command
|
||||
sub getTrackInfo{
|
||||
my $trackID = shift;
|
||||
sendCommand("GetTrackInfo: Type=Name TrackIndex=0");
|
||||
my @resps = getResponses();
|
||||
my $name = shift(@resps);
|
||||
sendCommand("GetTrackInfo: Type=StartTime TrackIndex=0");
|
||||
@resps = getResponses();
|
||||
my $startTime = shift(@resps);
|
||||
sendCommand("GetTrackInfo: Type=EndTime TrackIndex=0");
|
||||
@resps = getResponses();
|
||||
my $endTime = shift(@resps);
|
||||
|
||||
print " Name: $name\n";
|
||||
print "StartTime: $startTime\n";
|
||||
print " EndTime: $endTime\n";
|
||||
}
|
||||
|
||||
# Assortment of different tests
|
||||
sub fullTest{
|
||||
syntaxError();
|
||||
extraSpaces();
|
||||
menuCommand("NewStereoTrack");
|
||||
#screenshot($screenshotDir, "window", "None"); # (Slow)
|
||||
doCommand("Select: Mode=All");
|
||||
getMenuCommands();
|
||||
menuCommand("NewAudioTrack");
|
||||
batchFallback();
|
||||
help("Screenshot");
|
||||
message("Hello!");
|
||||
getTrackInfo(0);
|
||||
deleteAll();
|
||||
}
|
||||
|
||||
# Play for three seconds, then stop
|
||||
sub playAndStop{
|
||||
menuCommand("Play");
|
||||
sleep(3.0);
|
||||
menuCommand("Stop");
|
||||
}
|
||||
|
||||
# Select part of a stereo track
|
||||
sub selectRegion{
|
||||
my $track = shift;
|
||||
my $start = shift;
|
||||
my $end = shift;
|
||||
my $t1 = $track + 1;
|
||||
doCommand("Select: Mode=Range FirstTrack=$track LastTrack=$t1 StartTime=$start EndTime=$end");
|
||||
}
|
||||
|
||||
# Run testing on the effects that use the ClearAndPaste method
|
||||
# Allows the user to check whether effects transform time correctly
|
||||
sub testClearAndPasters{
|
||||
|
||||
# Which effects to test, and with what parameters
|
||||
my @clearAndPasters = (
|
||||
"Unchanged:", # control: nonexistent command, so does nothing
|
||||
# (so 'batch command not recognised' isn't an error)
|
||||
"Noise:", # generate
|
||||
"NoiseRemoval:", # misc clear&paste
|
||||
"ChangeSpeed: Percentage=-10.0", # misc clear&paste
|
||||
"ChangeSpeed: Percentage=40.0", # misc clear&paste
|
||||
"ChangeTempo: Percentage=-20.0", # soundtouch
|
||||
"ChangeTempo: Percentage=80.0", # soundtouch
|
||||
"ChangePitch: Percentage=25.0", # soundtouch
|
||||
"ChangePitch: Percentage=-80.0", # soundtouch
|
||||
"TimeScale: RateStart=-80.0 RateEnd=150.0 HalfStepsStart=-5.0 HalfStepsEnd=8.0 PreAnalyze=no", # SBSMS
|
||||
); # nyquist can't be called currently
|
||||
|
||||
# Allow time for user to give the project window focus (workaround for menu
|
||||
# command problem)
|
||||
sleep(1.0);
|
||||
deleteAll();
|
||||
my $len = 20.0;
|
||||
|
||||
# Since there aren't proper generator commands yet, we use the preferences
|
||||
# to control the duration
|
||||
my $origDuration = getPref("/CsPresets/NoiseGen_Duration");
|
||||
setPref("/CsPresets/NoiseGen_Duration", $len);
|
||||
|
||||
# For each effect to test:
|
||||
# * Create some stereo noise, and chop two pieces out of it
|
||||
# * Add some labels, then apply the effect
|
||||
# @splits determines where the splits are
|
||||
my @splits = map {$_ * $len} (0.999, 0.2, 0.5, 0.6, 0.8, 0.1, 0.9);
|
||||
my $trackNum = 0;
|
||||
foreach my $effect (@clearAndPasters) {
|
||||
menuCommand("NewStereoTrack");
|
||||
selectRegion($trackNum, 0.0, $splits[0]);
|
||||
doCommand("Noise:");
|
||||
selectRegion($trackNum, $splits[1], $splits[2]);
|
||||
menuCommand("SplitDelete");
|
||||
menuCommand("AddLabel");
|
||||
selectRegion($trackNum, $splits[3], $splits[4]);
|
||||
menuCommand("SplitDelete");
|
||||
menuCommand("AddLabel");
|
||||
|
||||
# Apply the effect
|
||||
selectRegion($trackNum, $splits[5], $splits[6]);
|
||||
doCommand($effect);
|
||||
|
||||
# Make and set the track name
|
||||
my @splat = split(':', $effect);
|
||||
my $name = $splat[0];
|
||||
doCommand("SetTrackInfo: TrackIndex=$trackNum Type=Name Name=$name");
|
||||
doCommand("Select: Mode=None");
|
||||
|
||||
$trackNum = $trackNum + 3;
|
||||
}
|
||||
|
||||
# Set duration back to what it was before
|
||||
setPref("/CsPresets/NoiseGen_Duration", $origDuration);
|
||||
}
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Effect testing #
|
||||
###############################################################################
|
||||
|
||||
# A list of effects to test (could be got from Audacity in future)
|
||||
sub getEffects{
|
||||
|
||||
# (These ones will need special handling)
|
||||
# AutoDuck
|
||||
# Repair
|
||||
# NoiseRemoval
|
||||
|
||||
# TimeScale (disabled because it's so slow)
|
||||
|
||||
my @effects = qw(
|
||||
Amplify
|
||||
BassBoost
|
||||
ChangePitch
|
||||
ChangeSpeed
|
||||
ChangeTempo
|
||||
ClickRemoval
|
||||
Compressor
|
||||
Echo
|
||||
Equalization
|
||||
FadeIn
|
||||
FadeOut
|
||||
Invert
|
||||
Leveller
|
||||
Normalize
|
||||
Phaser
|
||||
Repeat
|
||||
Reverse
|
||||
TruncateSilence
|
||||
Wahwah
|
||||
);
|
||||
return @effects;
|
||||
}
|
||||
|
||||
# Create a chirp for an effect to be applied to
|
||||
sub generateBase{
|
||||
my $genCmd = "Chirp";
|
||||
my $duration = 30.0;
|
||||
menuCommand("NewAudioTrack");
|
||||
doCommand("$genCmd:");
|
||||
my $desc = $genCmd . "-" . $duration . "s";
|
||||
return $desc;
|
||||
}
|
||||
|
||||
# Apply an effect and save the results (for use as reference output)
|
||||
sub saveEffectResults{
|
||||
my $dirname = shift;
|
||||
my $effect = shift;
|
||||
deleteAll();
|
||||
|
||||
my $filename = $dirname . "/" . generateBase() . "-" . $effect . ".wav";
|
||||
doCommand($effect);
|
||||
|
||||
printHeading("Exporting to $filename\n");
|
||||
doCommand("Export: Mode=All Filename=$filename Channels=1");
|
||||
}
|
||||
|
||||
# Apply an effect and compare the result to reference output
|
||||
sub doEffectTest{
|
||||
my $dirname = shift;
|
||||
my $effect = shift;
|
||||
|
||||
deleteAll();
|
||||
my $filename = $dirname . "/" . generateBase() . "-" . $effect . ".wav";
|
||||
doCommand("SetTrackInfo: TrackIndex=0 Type=Name Name=$effect");
|
||||
doCommand($effect);
|
||||
doCommand("Import: Filename=$filename");
|
||||
doCommand("Select: Mode=All");
|
||||
my @result = compareAudio(0.001);
|
||||
return @result;
|
||||
}
|
||||
|
||||
# Export reference copies of the effects in the list
|
||||
sub exportEffects{
|
||||
my $exportDir = shift;
|
||||
my @effects = getEffects();
|
||||
foreach my $effect (@effects) {
|
||||
saveEffectResults($exportDir, $effect);
|
||||
}
|
||||
}
|
||||
|
||||
# Test each of the effects in the list
|
||||
sub testEffects{
|
||||
my $referenceDir = shift;
|
||||
my %results = ();
|
||||
|
||||
my @effects = getEffects();
|
||||
foreach my $effect (@effects) {
|
||||
printHeading("Testing effect: $effect");
|
||||
my @res = doEffectTest($referenceDir, $effect);
|
||||
$results{ $effect }[0] = $res[0];
|
||||
$results{ $effect }[1] = $res[1];
|
||||
}
|
||||
|
||||
# Print out table of results
|
||||
my $padLength = max(map { length($_) } @effects);
|
||||
|
||||
printHeading("Test results");
|
||||
print "Effect name\tSamples\tSeconds\n\n";
|
||||
for my $effect (keys %results) {
|
||||
my $padded = sprintf("%-${padLength}s", $effect);
|
||||
my $badSamples = $results{ $effect }[0];
|
||||
my $badSeconds = $results{ $effect }[1];
|
||||
print "$padded\t$badSamples\t$badSeconds\n";
|
||||
}
|
||||
}
|
||||
|
||||
# Print text with ascii lines above and below
|
||||
sub printHeading{
|
||||
my $msg = shift;
|
||||
my $line = "-" x length($msg);
|
||||
print "$line\n$msg\n$line\n\n";
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
startUp();
|
||||
|
||||
# Send some test commands
|
||||
|
||||
exportEffects($effectTestDir);
|
||||
testEffects($effectTestDir);
|
||||
40
scripts/reindent
Executable file
40
scripts/reindent
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
sub mydie {
|
||||
my $message = shift;
|
||||
print "ERROR: $message\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
print "reindent - reformat specified files to match Audacity guidelines.\n";
|
||||
|
||||
# check for indent and correct version
|
||||
|
||||
$indent = `which indent`;
|
||||
chomp $indent;
|
||||
|
||||
-x $indent || mydie "GNU indent must be installed and in your path";
|
||||
|
||||
$version = `$indent --version`;
|
||||
($major, $minor, $subminor) = ($version =~ /(\d+)\.(\d+)\.(\d+)/);
|
||||
|
||||
if($major < 2 ||
|
||||
($major == 2 && $minor < 2) ||
|
||||
($major == 2 && $minor == 2 && $subminor < 4)) {
|
||||
|
||||
mydie "GNU indent must be at least version 2.2.6 (found: $major.$minor.$subminor)";
|
||||
}
|
||||
|
||||
mydie "no files specified" unless @ARGV;
|
||||
|
||||
# everything checks out, proceed...
|
||||
|
||||
foreach my $file (@ARGV) {
|
||||
mydie "file \"$file\" does not exist" unless -e $file;
|
||||
print "indenting $file...\n";
|
||||
system("$indent -kr -nut -i3 -nsob $file");
|
||||
system("rm $file~");
|
||||
}
|
||||
|
||||
# arch-tag: b30b2ac9-5f36-4226-8b79-cb8ebfb908e1
|
||||
|
||||
Reference in New Issue
Block a user