The fabled realtime effects...

I've made it where you can enable and disable via experimentals:

EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK

You will notice that, as of now, the only effects currently set up for
realtime are VSTs.  Now that this is in, I will start converting the
rest.

As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects.  This isolates the effects from changes in Audacity and makes
it much easier to add new ones.

Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too.  There are quite a few VSTs for Linux if
you search for them.

The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me.  I'm not really sure it should
stay in as-is.  I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects.  It should probably
revert back to that idea.

You may notice that this DOES include the API work I did.  The realtime effects
were too tied to it and I didn't want to redo the whole thing.  As I mentioned
elsewhere, the API stuff may or may not be very future proof.

So, let the critter complaints commence.  I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly.  ;-))
This commit is contained in:
lllucius 2014-10-26 03:24:10 +00:00
parent 789824617c
commit 1eeb4d979a
85 changed files with 14177 additions and 7350 deletions

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.13.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
@ -85,7 +85,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
autotools/ar-lib autotools/compile autotools/config.guess \
autotools/config.rpath autotools/config.sub autotools/depcomp \
autotools/install-sh autotools/missing autotools/ltmain.sh \
$(top_srcdir)/autotools/ar-lib $(top_srcdir)/autotools/compile \
$(top_srcdir)/autotools/ar-lib \
$(top_srcdir)/autotools/config.guess \
$(top_srcdir)/autotools/config.rpath \
$(top_srcdir)/autotools/config.sub \
@ -355,6 +355,8 @@ LIBOBJS = @LIBOBJS@
LIBRESAMPLE_CFLAGS = @LIBRESAMPLE_CFLAGS@
LIBRESAMPLE_LIBS = @LIBRESAMPLE_LIBS@
LIBS = @LIBS@
LIBSAMPLERATE_SYSTEM_CFLAGS = @LIBSAMPLERATE_SYSTEM_CFLAGS@
LIBSAMPLERATE_SYSTEM_LIBS = @LIBSAMPLERATE_SYSTEM_LIBS@
LIBTOOL = @LIBTOOL@
LIBTWOLAME_CFLAGS = @LIBTWOLAME_CFLAGS@
LIBTWOLAME_LIBS = @LIBTWOLAME_LIBS@
@ -844,16 +846,10 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@ -895,10 +891,9 @@ distcheck: dist
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \

5
configure vendored
View File

@ -19702,6 +19702,8 @@ WX_LIBS=$($WX_CONFIG $wxconfigargs --libs)
ac_configure_args="$ac_configure_args --enable-static=yes --enable-shared=no"
CXXFLAGS="$CXXFLAGS -I\$(top_srcdir)/include"
subdirs="$subdirs lib-src/FileDialog"
@ -23812,8 +23814,7 @@ $as_echo "#define HAVE_GTK 1" >>confdefs.h
LIBS="$LIBS $GTK_LIBS"
fi
use_vst="no"
;;
;;
esac

View File

@ -322,6 +322,9 @@ dnl Pull in library Cflags and so on for the non-optional libraries
dnl All libraries in lib-src should build static libraries, but not shared ones.
ac_configure_args="$ac_configure_args --enable-static=yes --enable-shared=no"
dnl Include "external" headers
CXXFLAGS="$CXXFLAGS -I\$(top_srcdir)/include"
dnl Include FileDialog
AC_CONFIG_SUBDIRS([lib-src/FileDialog])
CXXFLAGS="$CXXFLAGS -I\$(top_srcdir)/lib-src/FileDialog"
@ -625,7 +628,7 @@ case "${host_os}" in
dnl VST support on platforms other than Mac OS and Windows not enabled for
dnl 2.0.6 release
use_vst="no"
dnl use_vst="no"
;;
esac

View File

@ -20,231 +20,3 @@ static const char * arrow_xpm[] = {
"....+....",
".........",
"........."};
static const char * empty_9x16_xpm[] = {
"9 16 2 1",
"# c #000000",
". c #FFFFFF",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
"........."};
/* XPM */
static const char * arrow15x15_xpm[] = {
"15 15 24 1",
" c None",
". c #FFFFFF",
"+ c #929292",
"@ c #000000",
"# c #9F9F9F",
"$ c #262626",
"% c #D8D8D8",
"& c #5F5F5F",
"* c #FEFEFE",
"= c #4F4F4F",
"- c #888888",
"; c #808080",
"> c #828282",
", c #2A2A2A",
"' c #7F7F7F",
") c #D5D5D5",
"! c #111111",
"~ c #646464",
"{ c #B8B8B8",
"] c #989898",
"^ c #3A3A3A",
"/ c #9B9B9B",
"( c #EDEDED",
"_ c #C9C9C9",
"...............",
"...............",
"...............",
"......+@+......",
"......#@@$%....",
"......#@@@@&*..",
"@@@@@@@@@@@@@#.",
"@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@=-",
";;;;>-=@@@@,').",
"......#@@!~{*..",
"......]@^/(....",
"......_;_......",
"...............",
"..............."};
/* XPM */
static const char * unchecked_xpm[] = {
"15 15 56 1",
" c None",
". c #FFFFFF",
"+ c #8E8F8F",
"@ c #F4F4F4",
"# c #AEB3B9",
"$ c #AFB4BA",
"% c #B4B9BD",
"& c #BBBEC1",
"* c #CBCFD5",
"= c #D0D3D8",
"- c #D5D8DC",
"; c #DBDDDF",
"> c #C1C3C5",
", c #CDD1D6",
"' c #D2D5DA",
") c #D8DBDE",
"! c #DDDFE1",
"~ c #E2E3E4",
"{ c #C6C7C8",
"] c #CDD1D7",
"^ c #D0D4D9",
"/ c #D4D7DB",
"( c #E1E2E3",
"_ c #E5E6E6",
": c #E8E8E8",
"< c #CCCDCD",
"[ c #B2B7BC",
"} c #DADCDF",
"| c #E0E1E3",
"1 c #ECECEC",
"2 c #EDEDED",
"3 c #D4D5D6",
"4 c #B8BBBF",
"5 c #E4E5E5",
"6 c #EAEAEA",
"7 c #EFEFEF",
"8 c #F2F2F2",
"9 c #DCDDDE",
"0 c #BCBFC2",
"a c #E3E4E5",
"b c #E9E9E9",
"c c #F5F5F5",
"d c #E1E2E2",
"e c #C2C4C6",
"f c #F0F0F0",
"g c #F6F6F6",
"h c #E6E6E6",
"i c #CACBCC",
"j c #D4D4D5",
"k c #DBDBDC",
"l c #E0E1E1",
"m c #E6E7E7",
"n c #EAEBEB",
"o c #EBECEC",
"p c #EBEBEC",
"q c #E9E9EA",
"...............",
".+++++++++++++.",
".+@@@@@@@@@@@+.",
".+@######$%&@+.",
".+@#****=-;>@+.",
".+@#**,')!~{@+.",
".+@#]^/;(_:<@+.",
".+@[-}|:1223@+.",
".+@4!5678889@+.",
".+@0ab28@c@d@+.",
".+@eb2f@gggh@+.",
".+@ijklmnopq@+.",
".+@@@@@@@@@@@+.",
".+++++++++++++.",
"..............."};
/* XPM */
static const char * checked_xpm[] = {
"15 15 70 1",
" c #FFFFFF",
". c #8E8F8F",
"+ c #F4F4F4",
"@ c #F8F8F8",
"# c #F9F9F9",
"$ c #F6F6F6",
"% c #AEB3B9",
"& c #C9CCD0",
"* c #76DB7E",
"= c #45CE4F",
"- c #DCDFE4",
"; c #F5F5F5",
"> c #CBCFD5",
", c #C9D3D2",
"' c #EBEFEF",
") c #2EAF37",
"! c #289730",
"~ c #9CE5A2",
"{ c #CDD1D6",
"] c #E0E2E6",
"^ c #90E196",
"/ c #3DB351",
"( c #E4EAE5",
"_ c #ADB5B7",
": c #D5D9DD",
"< c #DFE2E5",
"[ c #D5D8DC",
"} c #EFF5F1",
"| c #30B93A",
"1 c #289B31",
"2 c #A1E6A6",
"3 c #DBDCDC",
"4 c #C5C9CD",
"5 c #B3EAB7",
"6 c #87D693",
"7 c #E9F1EA",
"8 c #A0E5A5",
"9 c #299E32",
"0 c #33C23D",
"a c #D5D5D6",
"b c #CDF2D0",
"c c #3ACB45",
"d c #299A33",
"e c #BFE9C6",
"f c #33C43E",
"g c #2A9F32",
"h c #9BE4A0",
"i c #F5F7F5",
"j c #DCDDDE",
"k c #C8D4CC",
"l c #D0EFD5",
"m c #299C31",
"n c #32BD3C",
"o c #F7FAF9",
"p c #DFE4E0",
"q c #C6C8CA",
"r c #E5F0E9",
"s c #62D56A",
"t c #2BA233",
"u c #93E299",
"v c #F7F9F8",
"w c #E5E7E5",
"x c #CACBCC",
"y c #D9DBDA",
"z c #DEE3E8",
"A c #76C38B",
"B c #F2F3F6",
"C c #ECEDED",
"D c #EBEBEC",
"E c #E9E9EA",
" ",
" ............. ",
" .+++++++@#$+. ",
" .+%%%%%&*=-;. ",
" .+%>>>,')!~$. ",
" .+%>>{]^!/(+. ",
" .+_:<[}|123+. ",
" .+4567890@a+. ",
" .+bcdefghij+. ",
" .+klm9gno+p+. ",
" .+qrs9tuv$w+. ",
" .+xyzsABCDE+. ",
" .+++;#@;++++. ",
" ............. ",
" "};

42
images/Arrow15x15.xpm Normal file
View File

@ -0,0 +1,42 @@
/* XPM */
static const char * arrow15x15_xpm[] = {
"15 15 24 1",
" c None",
". c #FFFFFF",
"+ c #929292",
"@ c #000000",
"# c #9F9F9F",
"$ c #262626",
"% c #D8D8D8",
"& c #5F5F5F",
"* c #FEFEFE",
"= c #4F4F4F",
"- c #888888",
"; c #808080",
"> c #828282",
", c #2A2A2A",
"' c #7F7F7F",
") c #D5D5D5",
"! c #111111",
"~ c #646464",
"{ c #B8B8B8",
"] c #989898",
"^ c #3A3A3A",
"/ c #9B9B9B",
"( c #EDEDED",
"_ c #C9C9C9",
"...............",
"...............",
"...............",
"......+@+......",
"......#@@$%....",
"......#@@@@&*..",
"@@@@@@@@@@@@@#.",
"@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@=-",
";;;;>-=@@@@,').",
"......#@@!~{*..",
"......]@^/(....",
"......_;_......",
"...............",
"..............."};

88
images/Checked.xpm Normal file
View File

@ -0,0 +1,88 @@
/* XPM */
static const char * checked_xpm[] = {
"15 15 70 1",
" c #FFFFFF",
". c #8E8F8F",
"+ c #F4F4F4",
"@ c #F8F8F8",
"# c #F9F9F9",
"$ c #F6F6F6",
"% c #AEB3B9",
"& c #C9CCD0",
"* c #76DB7E",
"= c #45CE4F",
"- c #DCDFE4",
"; c #F5F5F5",
"> c #CBCFD5",
", c #C9D3D2",
"' c #EBEFEF",
") c #2EAF37",
"! c #289730",
"~ c #9CE5A2",
"{ c #CDD1D6",
"] c #E0E2E6",
"^ c #90E196",
"/ c #3DB351",
"( c #E4EAE5",
"_ c #ADB5B7",
": c #D5D9DD",
"< c #DFE2E5",
"[ c #D5D8DC",
"} c #EFF5F1",
"| c #30B93A",
"1 c #289B31",
"2 c #A1E6A6",
"3 c #DBDCDC",
"4 c #C5C9CD",
"5 c #B3EAB7",
"6 c #87D693",
"7 c #E9F1EA",
"8 c #A0E5A5",
"9 c #299E32",
"0 c #33C23D",
"a c #D5D5D6",
"b c #CDF2D0",
"c c #3ACB45",
"d c #299A33",
"e c #BFE9C6",
"f c #33C43E",
"g c #2A9F32",
"h c #9BE4A0",
"i c #F5F7F5",
"j c #DCDDDE",
"k c #C8D4CC",
"l c #D0EFD5",
"m c #299C31",
"n c #32BD3C",
"o c #F7FAF9",
"p c #DFE4E0",
"q c #C6C8CA",
"r c #E5F0E9",
"s c #62D56A",
"t c #2BA233",
"u c #93E299",
"v c #F7F9F8",
"w c #E5E7E5",
"x c #CACBCC",
"y c #D9DBDA",
"z c #DEE3E8",
"A c #76C38B",
"B c #F2F3F6",
"C c #ECEDED",
"D c #EBEBEC",
"E c #E9E9EA",
" ",
" ............. ",
" .+++++++@#$+. ",
" .+%%%%%&*=-;. ",
" .+%>>>,')!~$. ",
" .+%>>{]^!/(+. ",
" .+_:<[}|123+. ",
" .+4567890@a+. ",
" .+bcdefghij+. ",
" .+klm9gno+p+. ",
" .+qrs9tuv$w+. ",
" .+xyzsABCDE+. ",
" .+++;#@;++++. ",
" ............. ",
" "};

View File

@ -0,0 +1,105 @@
/* XPM */
static const char *Effects_xpm[] = {
"26 24 78 1",
" c None",
". c #FFFFFF",
"+ c #F2F2F2",
"@ c #A1A1A1",
"# c #555555",
"$ c #545454",
"% c #9B9B9B",
"& c #FDFDFD",
"* c #BDBDBD",
"= c #000000",
"- c #353535",
"; c #515151",
"> c #9F9F9F",
", c #FAFAFA",
"' c #1E1E1E",
") c #0D0D0D",
"! c #D7D7D7",
"~ c #3C3C3C",
"{ c #E7E7E7",
"] c #3F3F3F",
"^ c #262626",
"/ c #D0D0D0",
"( c #363636",
"_ c #8B8B8B",
": c #EBEBEB",
"< c #090909",
"[ c #DEDEDE",
"} c #5F5F5F",
"| c #464646",
"1 c #494949",
"2 c #565656",
"3 c #E8E8E8",
"4 c #F8F8F8",
"5 c #5C5C5C",
"6 c #3A3A3A",
"7 c #080808",
"8 c #535353",
"9 c #F3F3F3",
"0 c #181818",
"a c #FCFCFC",
"b c #030303",
"c c #E5E5E5",
"d c #A0A0A0",
"e c #848484",
"f c #E6E6E6",
"g c #2A2A2A",
"h c #444444",
"i c #878787",
"j c #909090",
"k c #505050",
"l c #696969",
"m c #B2B2B2",
"n c #B5B5B5",
"o c #D5D5D5",
"p c #575757",
"q c #E2E2E2",
"r c #7E7E7E",
"s c #5B5B5B",
"t c #525252",
"u c #101010",
"v c #FEFEFE",
"w c #292929",
"x c #AFAFAF",
"y c #A4A4A4",
"z c #F5F5F5",
"A c #F4F4F4",
"B c #282828",
"C c #F6F6F6",
"D c #4F4F4F",
"E c #A9A9A9",
"F c #323232",
"G c #ECECEC",
"H c #CFCFCF",
"I c #7D7D7D",
"J c #727272",
"K c #C9C9C9",
"L c #C7C7C7",
"M c #CECECE",
" ",
" ",
" +@#$% ",
" &*=-===; ",
" >==,'==) ",
" !==~ {]^/ ",
" (==_ ",
" :<==[ ",
" }#|===1#23 ",
" 45#6==78$59 ",
" 8==0a ",
" b==- cd)e fgh ",
" :===i j= klm ",
" n===o =pq ",
" r=== 's ",
" t==k u~ ",
" cvv w==x v4 5y7z ",
" }==A ==Bv =bC!=DE ",
" ===F>=', G H ",
" I====JA ",
" KLM ",
" ",
" ",
" "};

View File

@ -0,0 +1,9 @@
#include "down-9x16.xpm"
#include "fav-down-16x16.xpm"
#include "fav-up-16x16.xpm"
#include "power-off-16x16.xpm"
#include "power-on-16x16.xpm"
#include "remove-16x16.xpm"
#include "settings-down-16x16.xpm"
#include "settings-up-16x16.xpm"
#include "up-9x16.xpm"

View File

@ -0,0 +1,21 @@
/* XPM */
static const char *down_9x16_xpm[] = {
"9 16 2 1",
" c None",
". c #000000",
" ",
" ",
" ... ",
" ... ",
" ... ",
" ... ",
" ... ",
" ... ",
".........",
" ....... ",
" ..... ",
" ... ",
" . ",
" ",
" ",
" "};

View File

@ -0,0 +1,21 @@
/* XPM */
static const char *fav_down_16x16_xpm[] = {
"16 16 2 1",
" c None",
". c #000000",
" ",
" ..... ",
" ..... ",
" ... ",
" ... ",
" ... ",
" ... ",
" ..... ",
" ....... ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . "};

View File

@ -0,0 +1,21 @@
/* XPM */
static const char *fav_up_16x16_xpm[] = {
"16 16 2 1",
" c None",
". c #000000",
" ",
" ",
" ",
" ",
" . ",
" .. .. ",
" ........ ",
"............... ",
" ........ ",
" .. .. ",
" . ",
" ",
" ",
" ",
" ",
" "};

View File

@ -0,0 +1,23 @@
/* XPM */
static const char *power_off_16x16_xpm[] = {
"16 16 4 1",
" c None",
"a c #FF0000",
"b c #000000",
"c c #707070",
" aa aaaa aaaa ",
" a a a a ",
" a a aaa aaa ",
" a a a a ",
" aa a a ",
" ",
" ",
" bb ",
" bbbccc ",
" bbbccc ",
" cbbbcc ",
" ccbbbc ",
" cccbbb ",
" cccbbb ",
" bb ",
" "};

View File

@ -0,0 +1,23 @@
/* XPM */
static const char *power_on_16x16_xpm[] = {
"16 16 4 1",
" c None",
"a c #00FF00",
"b c #000000",
"c c #707070",
" aa a a ",
" a a aa a ",
" a a a a a ",
" a a a aa ",
" aa a a ",
" ",
" ",
" bb ",
" cccbbb ",
" cccbbb ",
" ccbbbc ",
" cbbbcc ",
" bbbccc ",
" bbbccc ",
" bb ",
" "};

View File

@ -0,0 +1,21 @@
/* XPM */
static const char *remove_16x16_xpm[] = {
"16 16 2 1",
" c None",
". c #FF0000",
" ",
" .... ",
" ........ ",
" .......... ",
" ............ ",
" .... .. ... ",
" .... .... ",
" ..... ..... ",
" ...... ...... ",
" .... .... ",
" .... .. .... ",
" ............ ",
" .......... ",
" ........ ",
" ...... ",
" "};

View File

@ -0,0 +1,22 @@
/* XPM */
static const char *settings_down_16x16_xpm[] = {
"16 16 3 1",
" c None",
". c #020202",
"+ c #010101",
" .+. ",
" +++ ",
" +++ ",
".. +++ .........",
" +++ ",
" .+. .+. ",
" +++ ",
"......... +++ ..",
"......... +++ ..",
" +++ ",
" .+. .+. ",
" +++ ",
" +++ ",
".. +++ .........",
" +++ ",
" .+. "};

View File

@ -0,0 +1,22 @@
/* XPM */
static const char *settings_up_16x16_xpm[] = {
"16 16 3 1",
" c None",
". c #020202",
"+ c #010101",
" .+. ",
" +++ ",
" +++ ",
"......... +++ ..",
" +++ ",
" .+. .+. ",
" +++ ",
".. +++ .........",
".. +++ .........",
" +++ ",
" .+. .+. ",
" +++ ",
" +++ ",
"......... +++ ..",
" +++ ",
" .+. "};

View File

@ -0,0 +1,21 @@
/* XPM */
static const char *up_9x16_xpm[] = {
"9 16 2 1",
" c None",
". c #000000",
" ",
" ",
" ",
" . ",
" ... ",
" ..... ",
" ....... ",
".........",
" ... ",
" ... ",
" ... ",
" ... ",
" ... ",
" ... ",
" ",
" "};

21
images/Empty9x16.xpm Normal file
View File

@ -0,0 +1,21 @@
/* XPM */
static const char * empty9x16_xpm[] = {
"9 16 2 1",
"# c #000000",
". c #FFFFFF",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
".........",
"........."};

74
images/Unchecked.xpm Normal file
View File

@ -0,0 +1,74 @@
/* XPM */
static const char * unchecked_xpm[] = {
"15 15 56 1",
" c None",
". c #FFFFFF",
"+ c #8E8F8F",
"@ c #F4F4F4",
"# c #AEB3B9",
"$ c #AFB4BA",
"% c #B4B9BD",
"& c #BBBEC1",
"* c #CBCFD5",
"= c #D0D3D8",
"- c #D5D8DC",
"; c #DBDDDF",
"> c #C1C3C5",
", c #CDD1D6",
"' c #D2D5DA",
") c #D8DBDE",
"! c #DDDFE1",
"~ c #E2E3E4",
"{ c #C6C7C8",
"] c #CDD1D7",
"^ c #D0D4D9",
"/ c #D4D7DB",
"( c #E1E2E3",
"_ c #E5E6E6",
": c #E8E8E8",
"< c #CCCDCD",
"[ c #B2B7BC",
"} c #DADCDF",
"| c #E0E1E3",
"1 c #ECECEC",
"2 c #EDEDED",
"3 c #D4D5D6",
"4 c #B8BBBF",
"5 c #E4E5E5",
"6 c #EAEAEA",
"7 c #EFEFEF",
"8 c #F2F2F2",
"9 c #DCDDDE",
"0 c #BCBFC2",
"a c #E3E4E5",
"b c #E9E9E9",
"c c #F5F5F5",
"d c #E1E2E2",
"e c #C2C4C6",
"f c #F0F0F0",
"g c #F6F6F6",
"h c #E6E6E6",
"i c #CACBCC",
"j c #D4D4D5",
"k c #DBDBDC",
"l c #E0E1E1",
"m c #E6E7E7",
"n c #EAEBEB",
"o c #EBECEC",
"p c #EBEBEC",
"q c #E9E9EA",
"...............",
".+++++++++++++.",
".+@@@@@@@@@@@+.",
".+@######$%&@+.",
".+@#****=-;>@+.",
".+@#**,')!~{@+.",
".+@#]^/;(_:<@+.",
".+@[-}|:1223@+.",
".+@4!5678889@+.",
".+@0ab28@c@d@+.",
".+@eb2f@gggh@+.",
".+@ijklmnopq@+.",
".+@@@@@@@@@@@+.",
".+++++++++++++.",
"..............."};

View File

@ -0,0 +1,88 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ConfigInterface.h
Leland Lucius
Copyright (c) 2014, Audacity Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
**********************************************************************/
#ifndef __AUDACITY_CONFIGINTERFACE_H__
#define __AUDACITY_CONFIGINTERFACE_H__
#include "audacity/Types.h"
class ConfigClientInterface
{
public:
virtual ~ConfigClientInterface() {};
virtual bool GetSharedConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval) = 0;
virtual bool GetSharedConfig(const wxString & group, const wxString & key, int & value, int defval) = 0;
virtual bool GetSharedConfig(const wxString & group, const wxString & key, bool & value, bool defval) = 0;
virtual bool GetSharedConfig(const wxString & group, const wxString & key, float & value, float defval) = 0;
virtual bool GetSharedConfig(const wxString & group, const wxString & key, double & value, double defval) = 0;
virtual bool GetSharedConfig(const wxString & group, const wxString & key, sampleCount & value, sampleCount defval) = 0;
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const wxString & value) = 0;
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const int & value) = 0;
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const bool & value) = 0;
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const float & value) = 0;
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const double & value) = 0;
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const sampleCount & value) = 0;
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval) = 0;
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, int & value, int defval) = 0;
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, bool & value, bool defval) = 0;
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, float & value, float defval) = 0;
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, double & value, double defval) = 0;
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, sampleCount & value, sampleCount defval) = 0;
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const wxString & value) = 0;
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const int & value) = 0;
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const bool & value) = 0;
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const float & value) = 0;
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const double & value) = 0;
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const sampleCount & value) = 0;
};
class ConfigHostInterface
{
public:
virtual ~ConfigHostInterface() {};
};
#endif // __AUDACITY_CONFIGINTERFACE_H__

View File

@ -0,0 +1,145 @@
/**********************************************************************
Audacity: A Digital Audio Editor
EffectInterface.h
Leland Lucius
Copyright (c) 2014, Audacity Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
**********************************************************************/
#ifndef __AUDACITY_EFFECTINTERFACE_H__
#define __AUDACITY_EFFECTINTERFACE_H__
#include <vector>
#include "audacity/Types.h"
#include "audacity/IdentInterface.h"
#include "audacity/ConfigInterface.h"
typedef enum EffectType
{
EffectTypeNone,
EffectTypeGenerate,
EffectTypeProcess,
EffectTypeAnalyze
} EffectType;
class EffectIdentInterface : public IdentInterface
{
public:
virtual ~EffectIdentInterface() {};
virtual EffectType GetType() = 0;
virtual wxString GetFamily() = 0;
// These should move to the "EffectClientInterface" class once all
// effects have bee converted.
virtual bool IsInteractive() = 0;
// I don't really like this, but couldn't think of a better way to force the
// effect to appear "above the line" in the menus.
virtual bool IsDefault() = 0;
// This will go away when all Effects have been updated to the new
// interface.
virtual bool IsLegacy() = 0;
// Whether the effect supports realtime processing (while audio is playing).
virtual bool IsRealtimeCapable() = 0;
};
class EffectHostInterface : public EffectIdentInterface,
public ConfigClientInterface
{
public:
virtual ~EffectHostInterface() {};
// Both of these are pretty much hacks until everything has been converted and
// it's decided if the client will display the interface or if that'll be done
// by the host.
virtual bool Apply() = 0;
virtual void Preview() = 0;
};
typedef float * pfloat;
typedef std::vector<pfloat> pvec;
class EffectClientInterface : public EffectIdentInterface
{
public:
virtual ~EffectClientInterface() {};
virtual void SetHost(EffectHostInterface *host) = 0;
virtual bool Startup() = 0;
virtual bool Shutdown() = 0;
virtual int GetAudioInCount() = 0;
virtual int GetAudioOutCount() = 0;
virtual int GetMidiInCount() = 0;
virtual int GetMidiOutCount() = 0;
virtual void SetSampleRate(sampleCount rate) = 0;
virtual sampleCount GetBlockSize(sampleCount maxBlockSize) = 0;
virtual sampleCount GetLatency() = 0;
virtual sampleCount GetTailSize() = 0;
virtual bool IsReady() = 0;
virtual bool ProcessInitialize() = 0;
virtual bool ProcessFinalize() = 0;
virtual sampleCount ProcessBlock(float **inbuf, float **outbuf, sampleCount size) = 0;
virtual bool RealtimeInitialize(int numChannels, float sampleRate) = 0;
virtual bool RealtimeFinalize() = 0;
virtual bool RealtimeSuspend() = 0;
virtual bool RealtimeResume() = 0;
virtual sampleCount RealtimeProcess(float **inbuf, float **outbuf, sampleCount size) = 0;
virtual bool ShowInterface(void *parent) = 0;
};
class EffectManagerInterface
{
public:
virtual ~EffectManagerInterface() {};
virtual void FindFilesInPathList(const wxString & pattern,
const wxArrayString & pathList,
wxArrayString & files,
int searchFlags) = 0;
};
#endif // __AUDACITY_EFFECTINTERFACE_H__

View File

@ -0,0 +1,60 @@
/**********************************************************************
Audacity: A Digital Audio Editor
IdentInterface.h
Leland Lucius
Copyright (c) 2014, Audacity Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
**********************************************************************/
#ifndef __AUDACITY_IDENTINTERFACE_H__
#define __AUDACITY_IDENTINTERFACE_H__
#include "audacity/Types.h"
class IdentInterface
{
public:
virtual ~IdentInterface() {};
virtual PluginID GetID() = 0;
virtual wxString GetPath() = 0;
virtual wxString GetName() = 0;
virtual wxString GetVendor() = 0;
virtual wxString GetVersion() = 0;
virtual wxString GetDescription() = 0;
};
#endif // __AUDACITY_IDENTINTERFACE_H__

View File

@ -0,0 +1,151 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ImporterInterface.h
Leland Lucius
Copyright (c) 2014, Audacity Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
**********************************************************************/
#ifndef __AUDACITY_IMPORTERINTERFACE_H__
#define __AUDACITY_IMPORTERINTERFACE_H__
#include "audacity/Types.h"
#include "audacity/ConfigInterface.h"
#include "audacity/IdentInterface.h"
// ============================================================================
//
// ImporterInterface class
//
// ============================================================================
class ImporterHostInterface;
class ImporterClientInterface;
class ImporterInterface : public IdentInterface
{
public:
virtual ~ImporterInterface() {};
// Get unique string ID of this plugin, usually it corresponds
// to the underlying library, i.e. "libsndfile", "libflac", "libav"
// These MUST NOT change across Audacity versions (but new IDs can
// be added).
virtual wxString GetPluginStringID() = 0;
// Get a description of the file type this importer can import.
// Examples: "Ogg Vorbis", "MP3", "Uncompressed PCM"
virtual wxString GetPluginFormatDescription() = 0;
// Get a list of extensions this plugin expects to be able to
// import. If a filename matches any of these extensions,
// this importer will get first dibs on importing it.
virtual wxArrayString GetSupportedExtensions() = 0;
virtual bool SupportsExtension(const wxString & extension) = 0;
// Create the client that will be used to import a file.
virtual ImporterClientInterface *CreateClient() = 0;
};
// ============================================================================
//
// ImporterHostInterface class
//
// ============================================================================
class ImporterHostInterface
{
public:
virtual ~ImporterHostInterface() {};
// Called by the client to add a new stream to the import.
virtual bool AddStream(int stream,
sampleFormat sampleformat,
float sampleRate,
int numChannels,
ChannelName *channelMap) = 0;
// Accepts interleaved samples from the client.
virtual bool PutSamples(int stream, sampleCount numSamples, samplePtr inBuffer) = 0;
// Accepts non-interleaved samples from the client.
virtual bool PutSamples(int stream, int channel, sampleCount numSamples, samplePtr inBuffer) = 0;
// The client will call this as the import progresses.
virtual bool UpdateProgress(float current, float total) = 0;
};
// ============================================================================
//
// ImporterClientInterface class
//
// ============================================================================
class ImporterClientInterface
{
public:
virtual ~ImporterClientInterface() {};
// Provides a pointer to the assocated host for this importer.
virtual void SetHost(ImporterHostInterface *host) = 0;
// Open the given file, returning true if it is a recognized
// format, false otherwise. This puts the importer into the open
// state.
virtual bool Open(const wxString & fileName) = 0;
// Do any processing necessary to close the file and release resources.
// This will be called only if Open() succeeded.
virtual void Close() = 0;
// This is similar to GetImporterDescription, but if possible the
// importer will return a more specific description of the
// specific file that is open.
virtual wxString GetFileDescription() = 0;
// Return stream descriptions list
virtual void GetStreamInfo(wxArrayString & streamInfo) = 0;
// Set stream "import/don't import" flag
virtual void SetStreamUsage(int streamID, bool use) = 0;
// do the actual import, creating whatever tracks are necessary with
// the TrackFactory and calling the progress callback every iteration
// through the importing loop
virtual bool Import() = 0;
};
#endif // __AUDACITY_IMPORTERINTERFACE_H__

View File

@ -0,0 +1,188 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ModuleInterface.h
Leland Lucius
Copyright (c) 2014, Audacity Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
**********************************************************************/
#ifndef __AUDACITY_MODULEINTERFACE_H__
#define __AUDACITY_MODULEINTERFACE_H__
#include "audacity/Types.h"
#include "audacity/IdentInterface.h"
#include "audacity/PluginInterface.h"
// ============================================================================
//
// Don't even think about adding module types, like effect, importer, etc. in
// here. The module interface should not have to change when new types of
// plugins are added to Audacity.
//
// In addition a single module may want to provide multiple plugin types.
// ============================================================================
// ============================================================================
//
// ModuleInterface class
//
// ============================================================================
class ModuleInterface : public IdentInterface
{
public:
virtual ~ModuleInterface() {};
// Called immediately after creation to give the instance a chance to
// initialize. Return "true" if initialziation was successful.
virtual bool Initialize() = 0;
// Called just prior to deletion to allow releasing any resources.
virtual void Terminate() = 0;
// Modules providing a single or static set of plugins may use
// AutoRegisterPlugins() to register those plugins.
virtual bool AutoRegisterPlugins(PluginManagerInterface & pluginManager) = 0;
// For modules providing an interface to other dynamically loaded plugins,
// the module returns a list of path names that will be presented to the
// user for enablement.
virtual wxArrayString FindPlugins(PluginManagerInterface & pluginManager) = 0;
// Once the user selects desired paths from FindPlugins(), a call to RegisterPlugin()
// will be made to request registration of that plugin. If the module must create
// an instance of the plugin to register it, then then instance should be deleted
// after registration.
virtual bool RegisterPlugin(PluginManagerInterface & pluginManager,
const wxString & path) = 0;
// When appropriate, CreateInstance() will be called to instantiate the plugins.
virtual void *CreateInstance(const PluginID & ID, const wxString & path) = 0;
};
// ============================================================================
//
// ModuleManagerInterface class
//
// ============================================================================
class ModuleManagerInterface
{
public:
virtual ~ModuleManagerInterface() {};
// Modules call this to register their interface
virtual void RegisterModule(ModuleInterface *module) = 0;
};
// ----------------------------------------------------------------------------
// The default entry point name and the name that will be searched for during
// load if the module has been built as a external library.
// ----------------------------------------------------------------------------
#define MODULE_ENTRY AudacityModule
// ----------------------------------------------------------------------------
// The module entry point prototype
// ----------------------------------------------------------------------------
typedef ModuleInterface *(*ModuleMain)(ModuleManagerInterface *moduleManager,
const wxString *path);
// ----------------------------------------------------------------------------
// If BUILDING_AUDACITY is defined during the current build, it is assumed
// that the module wishes to be embedded in the Audacity executable.
// ----------------------------------------------------------------------------
#if defined(BUILDING_AUDACITY)
// ----------------------------------------------------------------------------
// Since there may be multiple embedded modules, the module entry function will
// be declared static so as not to interfere with other modules during link.
// ----------------------------------------------------------------------------
#define DECLARE_MODULE_ENTRY(name) \
static ModuleInterface * name(ModuleManagerInterface *moduleManager, const wxString *path)
// ----------------------------------------------------------------------------
// This will create a class and instnace that will register the module entry
// point during Audacity startup. At the appropriate time, the entry point
// will be called to create the module instance.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Provides the base for embedded module registration. If used, a Register()
// method must be supplied explicitly.
// ----------------------------------------------------------------------------
#define DECLARE_BUILTIN_MODULE_BASE(name) \
extern void RegisterBuiltinModule(ModuleMain rtn); \
class name \
{ \
public: \
name() {Register();} \
void Register(); \
}; \
static name name ## _instance;
// ----------------------------------------------------------------------------
// Provides the full embedded module registration process. Nothing further is
// required (other than supplying the module entry point function).
// ----------------------------------------------------------------------------
#define DECLARE_BUILTIN_MODULE(name) \
DECLARE_BUILTIN_MODULE_BASE(name) \
void name::Register() \
{ \
RegisterBuiltinModule(MODULE_ENTRY); \
}
#else
// ----------------------------------------------------------------------------
// When building as an external module, the entry point must be declared with
// "C" linkage and whatever method is used to make the function externally
// visible.
// ----------------------------------------------------------------------------
#define DECLARE_MODULE_ENTRY(name) \
extern "C" __declspec(dllexport) \
ModuleInterface * name(ModuleManagerInterface *moduleManager, \
const wxString *path)
// ----------------------------------------------------------------------------
// Define these as empty will effectively remove the embedded registration
// functionality.
// ----------------------------------------------------------------------------
#define DECLARE_BUILTIN_MODULE_BASE(name)
#define DECLARE_BUILTIN_MODULE(name)
#endif
#endif // __AUDACITY_MODULEINTERFACE_H__

View File

@ -0,0 +1,96 @@
/**********************************************************************
Audacity: A Digital Audio Editor
PluginInterface.h
Leland Lucius
Copyright (c) 2014, Audacity Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
**********************************************************************/
#ifndef __AUDACITY_PLUGININTERFACE_H__
#define __AUDACITY_PLUGININTERFACE_H__
#include "audacity/Types.h"
#include "audacity/ConfigInterface.h"
#include "audacity/EffectInterface.h"
#include "audacity/IdentInterface.h"
#include "audacity/ImporterInterface.h"
class IdentInterface;
class EffectIdentInterface;
class PluginManagerInterface
{
public:
virtual ~PluginManagerInterface() {};
virtual void RegisterModulePlugin(IdentInterface *module) = 0;
virtual void RegisterEffectPlugin(IdentInterface *provider, EffectIdentInterface *effect) = 0;
virtual void RegisterImporterPlugin(IdentInterface *provider, ImporterInterface *importer) = 0;
virtual void FindFilesInPathList(const wxString & pattern,
const wxArrayString & pathList,
wxArrayString & files,
bool directories = false) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval = wxString()) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval = 0) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval = false) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval = 0.0) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval = 0.0) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, sampleCount & value, sampleCount defval = 0) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const sampleCount & value) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval = wxString()) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval = 0) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval = false) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval = 0.0) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval = 0.0) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, sampleCount & value, sampleCount defval = 0) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const sampleCount & value) = 0;
};
#endif // __AUDACITY_PLUGININTERFACE_H__

130
include/audacity/Types.h Normal file
View File

@ -0,0 +1,130 @@
/**********************************************************************
Audacity: A Digital Audio Editor
Types.h
Leland Lucius
Copyright (c) 2014, Audacity Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
**********************************************************************/
#ifndef __AUDACITY_TYPES_H__
#define __AUDACITY_TYPES_H__
#include <wx/string.h>
#include <wx/arrstr.h>
// ----------------------------------------------------------------------------
// TODO: I'd imagine this header may be replaced by other public headers. But,
// to try and minimize more changes to the base code, we can use this
// until proper public headers are created for the stuff in here.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// A native 64-bit integer...used when referring to any number of samples
// ----------------------------------------------------------------------------
#if (defined(__VISUALC__) && defined(__WIN32__))
typedef __int64 sampleCount;
#else
typedef long long sampleCount;
#endif
// ----------------------------------------------------------------------------
// Supported sample formats
// ----------------------------------------------------------------------------
typedef enum
{
int16Sample = 0x00020001,
int24Sample = 0x00040001,
floatSample = 0x0004000F
} sampleFormat;
// ----------------------------------------------------------------------------
// Provide the number of bytes a specific sample will take
// ----------------------------------------------------------------------------
#define SAMPLE_SIZE(SampleFormat) (SampleFormat >> 16)
// ----------------------------------------------------------------------------
// Generic pointer to sample data
// ----------------------------------------------------------------------------
typedef char *samplePtr;
// ----------------------------------------------------------------------------
// The type for plugin IDs
// ----------------------------------------------------------------------------
typedef wxString PluginID;
// ----------------------------------------------------------------------------
// Supported channel assignments
// ----------------------------------------------------------------------------
typedef enum
{
// Use to mark end of list
ChannelNameEOL = -1,
// The default channel assignment
ChannelNameMono,
// From this point, the channels follow the 22.2 surround sound format
ChannelNameFrontLeft,
ChannelNameFrontRight,
ChannelNameFrontCenter,
ChannelNameLowFrequency1,
ChannelNameBackLeft,
ChannelNameBackRight,
ChannelNameFrontLeftCenter,
ChannelNameFrontRightCenter,
ChannelNameBackCenter,
ChannelNameLowFrequency2,
ChannelNameSideLeft,
ChannelNameSideRight,
ChannelNameTopFrontLeft,
ChannelNameTopFrontRight,
ChannelNameTopFrontCenter,
ChannelNameTopCenter,
ChannelNameTopBackLeft,
ChannelNameTopBackRight,
ChannelNameTopSideLeft,
ChannelNameTopSideRight,
ChannelNameTopBackCenter,
ChannelNameBottomFrontCenter,
ChannelNameBottomFrontLeft,
ChannelNameBottomFrontRight,
} ChannelName;
// ----------------------------------------------------------------------------
// Convenience macro to suppress unused parameter warnings
// ----------------------------------------------------------------------------
#define AUNUSED(p)
#endif // __AUDACITY_TYPES_H__

View File

@ -35,29 +35,29 @@ INSTALL_DATA = ${INSTALL} -m 644
# We use $(mkdir_p).
# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
# ${SHELL} /home/yam/a/audacity/autotools/install-sh does not start with $(SHELL), so we add it.
# In automake >= 1.10, /usr/bin/mkdir -p is derived from ${MKDIR_P}, which is defined
# ${SHELL} /Users/yam/n/audacity/autotools/install-sh does not start with $(SHELL), so we add it.
# In automake >= 1.10, $(top_builddir)/autotools/install-sh -c -d is derived from ${MKDIR_P}, which is defined
# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
# versions, $(mkinstalldirs) and $(install_sh) are unused.
mkinstalldirs = $(SHELL) ${SHELL} /home/yam/a/audacity/autotools/install-sh -d
install_sh = $(SHELL) ${SHELL} /home/yam/a/audacity/autotools/install-sh
MKDIR_P = /usr/bin/mkdir -p
mkdir_p = /usr/bin/mkdir -p
mkinstalldirs = $(SHELL) ${SHELL} /Users/yam/n/audacity/autotools/install-sh -d
install_sh = $(SHELL) ${SHELL} /Users/yam/n/audacity/autotools/install-sh
MKDIR_P = ../autotools/install-sh -c -d
mkdir_p = $(top_builddir)/autotools/install-sh -c -d
GMSGFMT_ = /usr/bin/msgfmt
GMSGFMT_no = /usr/bin/msgfmt
GMSGFMT_yes = /usr/bin/msgfmt
GMSGFMT_ = /opt/local/bin/msgfmt
GMSGFMT_no = /opt/local/bin/msgfmt
GMSGFMT_yes = /opt/local/bin/msgfmt
GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
MSGFMT_ = /usr/bin/msgfmt
MSGFMT_no = /usr/bin/msgfmt
MSGFMT_yes = /usr/bin/msgfmt
MSGFMT_ = /opt/local/bin/msgfmt
MSGFMT_no = /opt/local/bin/msgfmt
MSGFMT_yes = /opt/local/bin/msgfmt
MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
XGETTEXT_ = /usr/bin/xgettext
XGETTEXT_no = /usr/bin/xgettext
XGETTEXT_yes = /usr/bin/xgettext
XGETTEXT_ = /opt/local/bin/xgettext
XGETTEXT_no = /opt/local/bin/xgettext
XGETTEXT_yes = /opt/local/bin/xgettext
XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
MSGMERGE = msgmerge
MSGMERGE_UPDATE = /usr/bin/msgmerge --update
MSGMERGE_UPDATE = /opt/local/bin/msgmerge --update
MSGINIT = msginit
MSGCONV = msgconv
MSGFILTER = msgfilter
@ -96,7 +96,7 @@ CATALOGS = @CATALOGS@
mv t-$@ $@
all: check-macro-version all-yes
all: check-macro-version all-no
all-yes: stamp-po
all-no:
@ -209,7 +209,7 @@ $(POFILES): $(srcdir)/$(DOMAIN).pot
install: install-exec install-data
install-exec:
install-data: install-data-yes
install-data: install-data-no
if test "$(PACKAGE)" = "gettext-tools"; then \
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
for file in $(DISTFILES.common) Makevars.template; do \
@ -267,7 +267,7 @@ install-strip: install
installdirs: installdirs-exec installdirs-data
installdirs-exec:
installdirs-data: installdirs-data-yes
installdirs-data: installdirs-data-no
if test "$(PACKAGE)" = "gettext-tools"; then \
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
else \
@ -311,7 +311,7 @@ installcheck:
uninstall: uninstall-exec uninstall-data
uninstall-exec:
uninstall-data: uninstall-data-yes
uninstall-data: uninstall-data-no
if test "$(PACKAGE)" = "gettext-tools"; then \
for file in $(DISTFILES.common) Makevars.template; do \
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \

View File

@ -476,6 +476,8 @@
280828550A75E0D0000002EF /* LabelDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 280828530A75E0D0000002EF /* LabelDialog.cpp */; };
2808285A0A75E0EA000002EF /* Grid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 280828580A75E0EA000002EF /* Grid.cpp */; };
2809C4B80BCB7E560006010F /* FileIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2809C4B60BCB7E560006010F /* FileIO.cpp */; };
280A8B4719F4403B0091DE70 /* ModuleManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 280A8B4519F4403B0091DE70 /* ModuleManager.cpp */; };
280A8B4A19F440880091DE70 /* EffectRack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 280A8B4819F440880091DE70 /* EffectRack.cpp */; };
28105D9C0AD09FB200BB4269 /* portmixer.h in Headers */ = {isa = PBXBuildFile; fileRef = 28105D9B0AD09FB200BB4269 /* portmixer.h */; };
28105DAA0AD09FC500BB4269 /* px_mac_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 28105DA00AD09FC500BB4269 /* px_mac_coreaudio.c */; };
28105DAB0AD09FC500BB4269 /* px_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 28105DA10AD09FC500BB4269 /* px_mixer.c */; };
@ -927,7 +929,6 @@
28A96DC30E28642300F3CE01 /* strparse.h in Headers */ = {isa = PBXBuildFile; fileRef = 28F3A4010E28289500729866 /* strparse.h */; };
28B3C5DC1833D23E0024BE6D /* libexpat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FADDEF1833C3C500BA4141 /* libexpat.a */; };
28B3C5DF1833D24E0024BE6D /* libexpat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FADDEF1833C3C500BA4141 /* libexpat.a */; };
28B6ED8F0DE3D1B50046F0F3 /* LoadModules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28B6ED8D0DE3D1B50046F0F3 /* LoadModules.cpp */; };
28B97B890FBF771A0076CF28 /* VSTEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28B97B850FBF771A0076CF28 /* VSTEffect.cpp */; };
28BD8AB1101DF4C700686679 /* BatchEvalCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28BD8AA9101DF4C600686679 /* BatchEvalCommand.cpp */; };
28BD8AB2101DF4C700686679 /* CommandDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28BD8AAA101DF4C600686679 /* CommandDirectory.cpp */; };
@ -1450,7 +1451,6 @@
ED663C3316543647007F53A5 /* SplashDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28501E9F0CEECEF80029ABAA /* SplashDialog.cpp */; };
ED663C3416543647007F53A5 /* LoadVamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28501E970CEECE910029ABAA /* LoadVamp.cpp */; };
ED663C3516543647007F53A5 /* VampEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28501E990CEECE920029ABAA /* VampEffect.cpp */; };
ED663C3616543647007F53A5 /* LoadModules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28B6ED8D0DE3D1B50046F0F3 /* LoadModules.cpp */; };
ED663C3716543647007F53A5 /* NonGuiThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 288052BC0DEA72F300671EA4 /* NonGuiThread.cpp */; };
ED663C3816543647007F53A5 /* HtmlWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28530C480DF2105200555C94 /* HtmlWindow.cpp */; };
ED663C3916543647007F53A5 /* ProgressDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28530C4A0DF2105200555C94 /* ProgressDialog.cpp */; };
@ -1778,7 +1778,6 @@
ED85B50B16A47353006DA21D /* SplashDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28501E9F0CEECEF80029ABAA /* SplashDialog.cpp */; };
ED85B50C16A47353006DA21D /* LoadVamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28501E970CEECE910029ABAA /* LoadVamp.cpp */; };
ED85B50D16A47353006DA21D /* VampEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28501E990CEECE920029ABAA /* VampEffect.cpp */; };
ED85B50E16A47353006DA21D /* LoadModules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28B6ED8D0DE3D1B50046F0F3 /* LoadModules.cpp */; };
ED85B50F16A47353006DA21D /* NonGuiThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 288052BC0DEA72F300671EA4 /* NonGuiThread.cpp */; };
ED85B51016A47353006DA21D /* HtmlWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28530C480DF2105200555C94 /* HtmlWindow.cpp */; };
ED85B51116A47353006DA21D /* ProgressDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28530C4A0DF2105200555C94 /* ProgressDialog.cpp */; };
@ -3150,6 +3149,17 @@
280828590A75E0EA000002EF /* Grid.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = Grid.h; sourceTree = "<group>"; tabWidth = 3; };
2809C4B60BCB7E560006010F /* FileIO.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = FileIO.cpp; sourceTree = "<group>"; tabWidth = 3; };
2809C4B70BCB7E560006010F /* FileIO.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = FileIO.h; sourceTree = "<group>"; tabWidth = 3; };
280A8B3E19F440160091DE70 /* ConfigInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConfigInterface.h; path = ../include/audacity/ConfigInterface.h; sourceTree = SOURCE_ROOT; };
280A8B3F19F440160091DE70 /* EffectInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EffectInterface.h; path = ../include/audacity/EffectInterface.h; sourceTree = SOURCE_ROOT; };
280A8B4019F440160091DE70 /* IdentInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IdentInterface.h; path = ../include/audacity/IdentInterface.h; sourceTree = SOURCE_ROOT; };
280A8B4119F440160091DE70 /* ImporterInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImporterInterface.h; path = ../include/audacity/ImporterInterface.h; sourceTree = SOURCE_ROOT; };
280A8B4219F440160091DE70 /* ModuleInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModuleInterface.h; path = ../include/audacity/ModuleInterface.h; sourceTree = SOURCE_ROOT; };
280A8B4319F440160091DE70 /* PluginInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginInterface.h; path = ../include/audacity/PluginInterface.h; sourceTree = SOURCE_ROOT; };
280A8B4419F440160091DE70 /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Types.h; path = ../include/audacity/Types.h; sourceTree = SOURCE_ROOT; };
280A8B4519F4403B0091DE70 /* ModuleManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleManager.cpp; sourceTree = "<group>"; };
280A8B4619F4403B0091DE70 /* ModuleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleManager.h; sourceTree = "<group>"; };
280A8B4819F440880091DE70 /* EffectRack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EffectRack.cpp; sourceTree = "<group>"; };
280A8B4919F440880091DE70 /* EffectRack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EffectRack.h; sourceTree = "<group>"; };
28105D9B0AD09FB200BB4269 /* portmixer.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = portmixer.h; sourceTree = "<group>"; tabWidth = 3; };
28105DA00AD09FC500BB4269 /* px_mac_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.c; path = px_mac_coreaudio.c; sourceTree = "<group>"; tabWidth = 3; };
28105DA10AD09FC500BB4269 /* px_mixer.c */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.c; path = px_mixer.c; sourceTree = "<group>"; tabWidth = 3; };
@ -3669,8 +3679,6 @@
28AA281F0F267A2D008AED9E /* tremolo.ny */ = {isa = PBXFileReference; explicitFileType = file; fileEncoding = 5; name = tremolo.ny; path = "../plug-ins/tremolo.ny"; sourceTree = SOURCE_ROOT; };
28AA28200F267A2D008AED9E /* vocalremover.ny */ = {isa = PBXFileReference; explicitFileType = file; fileEncoding = 5; name = vocalremover.ny; path = "../plug-ins/vocalremover.ny"; sourceTree = SOURCE_ROOT; };
28AA28210F267A2D008AED9E /* vocoder.ny */ = {isa = PBXFileReference; explicitFileType = file; fileEncoding = 5; name = vocoder.ny; path = "../plug-ins/vocoder.ny"; sourceTree = SOURCE_ROOT; };
28B6ED8D0DE3D1B50046F0F3 /* LoadModules.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = LoadModules.cpp; sourceTree = "<group>"; tabWidth = 3; };
28B6ED8E0DE3D1B50046F0F3 /* LoadModules.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = LoadModules.h; sourceTree = "<group>"; tabWidth = 3; };
28B97B850FBF771A0076CF28 /* VSTEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = VSTEffect.cpp; path = VST/VSTEffect.cpp; sourceTree = "<group>"; tabWidth = 3; };
28B97B860FBF771A0076CF28 /* VSTEffect.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = VSTEffect.h; path = VST/VSTEffect.h; sourceTree = "<group>"; tabWidth = 3; };
28BD8AA9101DF4C600686679 /* BatchEvalCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = BatchEvalCommand.cpp; sourceTree = "<group>"; tabWidth = 3; };
@ -4891,6 +4899,7 @@
17FC86F30994637C0061DC94 /* compile.txt */,
1790AFB109883B6D008A330A /* Products */,
287179EE0DF6383000E171DF /* Xcode Settings */,
280A8B3A19F43FE30091DE70 /* includes */,
17072F220988D4F4008541CC /* lib-src */,
286D30AC0F264B58004E6E4A /* locale */,
178CF4FE098953FB0056CE58 /* mac */,
@ -5020,8 +5029,6 @@
1790B0A209883BFD008A330A /* Languages.h */,
1790B0A309883BFD008A330A /* Legacy.cpp */,
1790B0A409883BFD008A330A /* Legacy.h */,
28B6ED8D0DE3D1B50046F0F3 /* LoadModules.cpp */,
28B6ED8E0DE3D1B50046F0F3 /* LoadModules.h */,
1865A9B41004490400946EE6 /* Lyrics.cpp */,
1865A9B51004490400946EE6 /* Lyrics.h */,
1865A9B61004490500946EE6 /* LyricsWindow.cpp */,
@ -5035,6 +5042,8 @@
1790B0AC09883BFD008A330A /* Mix.h */,
289E75081006D0BD00CEF79B /* MixerBoard.cpp */,
289E75091006D0BD00CEF79B /* MixerBoard.h */,
280A8B4519F4403B0091DE70 /* ModuleManager.cpp */,
280A8B4619F4403B0091DE70 /* ModuleManager.h */,
1790B0AF09883BFD008A330A /* NoteTrack.cpp */,
1790B0B009883BFD008A330A /* NoteTrack.h */,
EDF3B7AF1588C0D50032D35F /* Paulstretch.cpp */,
@ -5180,6 +5189,8 @@
ED3D7FED0DF73889000F43E3 /* EffectCategory.h */,
ED3D7FEE0DF73889000F43E3 /* EffectManager.cpp */,
ED3D7FEF0DF73889000F43E3 /* EffectManager.h */,
280A8B4819F440880091DE70 /* EffectRack.cpp */,
280A8B4919F440880091DE70 /* EffectRack.h */,
1790B01B09883BFD008A330A /* Equalization.cpp */,
1790B01C09883BFD008A330A /* Equalization.h */,
EDFCEBB318894B9E00C98E51 /* Equalization48x.cpp */,
@ -5571,6 +5582,28 @@
path = ../nyquist/rawwaves;
sourceTree = SOURCE_ROOT;
};
280A8B3A19F43FE30091DE70 /* includes */ = {
isa = PBXGroup;
children = (
280A8B3D19F440010091DE70 /* audacity */,
);
name = includes;
sourceTree = "<group>";
};
280A8B3D19F440010091DE70 /* audacity */ = {
isa = PBXGroup;
children = (
280A8B3E19F440160091DE70 /* ConfigInterface.h */,
280A8B3F19F440160091DE70 /* EffectInterface.h */,
280A8B4019F440160091DE70 /* IdentInterface.h */,
280A8B4119F440160091DE70 /* ImporterInterface.h */,
280A8B4219F440160091DE70 /* ModuleInterface.h */,
280A8B4319F440160091DE70 /* PluginInterface.h */,
280A8B4419F440160091DE70 /* Types.h */,
);
name = audacity;
sourceTree = "<group>";
};
28105D9A0AD09FB200BB4269 /* include */ = {
isa = PBXGroup;
children = (
@ -8937,7 +8970,6 @@
28501EA20CEECEF80029ABAA /* SplashDialog.cpp in Sources */,
28501EAA0CEED0670029ABAA /* LoadVamp.cpp in Sources */,
28501EAB0CEED0680029ABAA /* VampEffect.cpp in Sources */,
28B6ED8F0DE3D1B50046F0F3 /* LoadModules.cpp in Sources */,
288052C20DEA73F500671EA4 /* NonGuiThread.cpp in Sources */,
28530C4C0DF2105200555C94 /* HtmlWindow.cpp in Sources */,
28530C4D0DF2105200555C94 /* ProgressDialog.cpp in Sources */,
@ -9085,6 +9117,8 @@
28F67179197DFA1C00075C32 /* FormatClassifier.cpp in Sources */,
28F6717A197DFA1C00075C32 /* MultiFormatReader.cpp in Sources */,
28F6717B197DFA1C00075C32 /* SpecPowerMeter.cpp in Sources */,
280A8B4719F4403B0091DE70 /* ModuleManager.cpp in Sources */,
280A8B4A19F440880091DE70 /* EffectRack.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -9448,7 +9482,6 @@
ED663C3316543647007F53A5 /* SplashDialog.cpp in Sources */,
ED663C3416543647007F53A5 /* LoadVamp.cpp in Sources */,
ED663C3516543647007F53A5 /* VampEffect.cpp in Sources */,
ED663C3616543647007F53A5 /* LoadModules.cpp in Sources */,
ED663C3716543647007F53A5 /* NonGuiThread.cpp in Sources */,
ED663C3816543647007F53A5 /* HtmlWindow.cpp in Sources */,
ED663C3916543647007F53A5 /* ProgressDialog.cpp in Sources */,
@ -9759,7 +9792,6 @@
ED85B50B16A47353006DA21D /* SplashDialog.cpp in Sources */,
ED85B50C16A47353006DA21D /* LoadVamp.cpp in Sources */,
ED85B50D16A47353006DA21D /* VampEffect.cpp in Sources */,
ED85B50E16A47353006DA21D /* LoadModules.cpp in Sources */,
ED85B50F16A47353006DA21D /* NonGuiThread.cpp in Sources */,
ED85B51016A47353006DA21D /* HtmlWindow.cpp in Sources */,
ED85B51116A47353006DA21D /* ProgressDialog.cpp in Sources */,
@ -10419,7 +10451,7 @@
);
PRODUCT_NAME = Audacity;
SKIP_INSTALL = NO;
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/lib-src/libresample/include $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libvamp $(TOPLEVEL)/lib-src/libvorbis/include $(TOPLEVEL)/lib-src/portaudio-v19/include $(TOPLEVEL)/lib-src/portmixer/px_common $(TOPLEVEL)/lib-src/portsmf $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/include $(TOPLEVEL)/lib-src/twolame/libtwolame";
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/include $(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/lib-src/libresample/include $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libvamp $(TOPLEVEL)/lib-src/libvorbis/include $(TOPLEVEL)/lib-src/portaudio-v19/include $(TOPLEVEL)/lib-src/portmixer/px_common $(TOPLEVEL)/lib-src/portsmf $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/include $(TOPLEVEL)/lib-src/twolame/libtwolame";
};
name = "Debug Static";
};
@ -10441,7 +10473,7 @@
INFOPLIST_PREPROCESS = YES;
KEEP_PRIVATE_EXTERNS = YES;
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
TOPLEVEL = ..;
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-debug-static-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXDEBUG__ -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";
@ -10700,7 +10732,7 @@
INFOPLIST_PREPROCESS = YES;
KEEP_PRIVATE_EXTERNS = YES;
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
TOPLEVEL = ..;
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-debug-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXDEBUG__ -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";
@ -10770,7 +10802,7 @@
);
PRODUCT_NAME = Audacity;
SKIP_INSTALL = NO;
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/lib-src/libresample/include $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libvamp $(TOPLEVEL)/lib-src/libvorbis/include $(TOPLEVEL)/lib-src/portaudio-v19/include $(TOPLEVEL)/lib-src/portmixer/px_common $(TOPLEVEL)/lib-src/portsmf $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/include $(TOPLEVEL)/lib-src/twolame/libtwolame";
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/include $(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/lib-src/libresample/include $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libvamp $(TOPLEVEL)/lib-src/libvorbis/include $(TOPLEVEL)/lib-src/portaudio-v19/include $(TOPLEVEL)/lib-src/portmixer/px_common $(TOPLEVEL)/lib-src/portsmf $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/include $(TOPLEVEL)/lib-src/twolame/libtwolame";
};
name = "Debug Shared";
};
@ -11015,7 +11047,7 @@
INFOPLIST_PREPROCESS = YES;
KEEP_PRIVATE_EXTERNS = YES;
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
TOPLEVEL = ..;
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-release-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";
@ -11087,7 +11119,7 @@
);
PRODUCT_NAME = Audacity;
SKIP_INSTALL = NO;
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/lib-src/libresample/include $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libvamp $(TOPLEVEL)/lib-src/libvorbis/include $(TOPLEVEL)/lib-src/portaudio-v19/include $(TOPLEVEL)/lib-src/portmixer/px_common $(TOPLEVEL)/lib-src/portsmf $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/include $(TOPLEVEL)/lib-src/twolame/libtwolame";
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/include $(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/lib-src/libresample/include $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libvamp $(TOPLEVEL)/lib-src/libvorbis/include $(TOPLEVEL)/lib-src/portaudio-v19/include $(TOPLEVEL)/lib-src/portmixer/px_common $(TOPLEVEL)/lib-src/portsmf $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/include $(TOPLEVEL)/lib-src/twolame/libtwolame";
};
name = "Release Shared";
};
@ -11595,7 +11627,7 @@
);
PRODUCT_NAME = Audacity;
SKIP_INSTALL = NO;
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/lib-src/libresample/include $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libvamp $(TOPLEVEL)/lib-src/libvorbis/include $(TOPLEVEL)/lib-src/portaudio-v19/include $(TOPLEVEL)/lib-src/portmixer/px_common $(TOPLEVEL)/lib-src/portsmf $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/include $(TOPLEVEL)/lib-src/twolame/libtwolame";
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/include $(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/lib-src/libresample/include $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libvamp $(TOPLEVEL)/lib-src/libvorbis/include $(TOPLEVEL)/lib-src/portaudio-v19/include $(TOPLEVEL)/lib-src/portmixer/px_common $(TOPLEVEL)/lib-src/portsmf $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/include $(TOPLEVEL)/lib-src/twolame/libtwolame";
};
name = "Release Static";
};
@ -11621,7 +11653,7 @@
INFOPLIST_PREPROCESS = YES;
KEEP_PRIVATE_EXTERNS = YES;
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
TOPLEVEL = ..;
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-release-static-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";

View File

@ -214,6 +214,9 @@ from there. Audacity will look for a file called "Pause.png".
DEFINE_IMAGE( bmpSyncLockSelTile, wxImage(20, 22), wxT("SyncLockSelTile"));
DEFINE_IMAGE( bmpSyncLockIcon, wxImage(12, 12), wxT("SyncLockIcon"));
SET_THEME_FLAGS( resFlagNone );
DEFINE_IMAGE( bmpEditEffects, wxImage(21, 20), wxT("EditEffects"));
#if defined(EXPERIMENTAL_THEMING)
DEFINE_COLOUR( clrBlank, wxColour( 64, 64, 64), wxT("Blank"));
DEFINE_COLOUR( clrUnselected, wxColour( 30, 30, 30), wxT("Unselected"));

View File

@ -68,12 +68,12 @@ It handles initialization and termination by subclassing wxApp.
#include "commands/AppCommandEvent.h"
#include "effects/LoadEffects.h"
#include "effects/Contrast.h"
#include "effects/VST/VSTEffect.h"
#include "widgets/ASlider.h"
#include "FFmpeg.h"
#include "Internat.h"
#include "LangChoice.h"
#include "Languages.h"
#include "PluginManager.h"
#include "Prefs.h"
#include "Project.h"
#include "Screenshot.h"
@ -95,7 +95,7 @@ It handles initialization and termination by subclassing wxApp.
//temporarilly commented out till it is added to all projects
//#include "Profiler.h"
#include "LoadModules.h"
#include "ModuleManager.h"
#include "import/Import.h"
@ -274,7 +274,7 @@ void QuitAudacity(bool bForce)
LWSlider::DeleteSharedTipPanel();
ModuleManager::Dispatch(AppQuiting);
ModuleManager::Get().Dispatch(AppQuiting);
if (gParentFrame)
gParentFrame->Destroy();
@ -1008,6 +1008,7 @@ int AudacityApp::FilterEvent(wxEvent & event)
return -1;
}
#endif
#include "effects/VST/VSTEffect.h"
// The `main program' equivalent, creating the windows and returning the
// main frame
@ -1042,16 +1043,6 @@ bool AudacityApp::OnInit()
wxTheApp->SetVendorName(vendorName);
wxTheApp->SetAppName(appName);
#ifdef USE_VST // if no VST support, answer is always no
// Have we been started to check a plugin?
if (argc == 3 && wxStrcmp(argv[1], VSTCMDKEY) == 0) {
wxHandleFatalExceptions();
VSTEffect::Check(argv[2]);
return false;
}
#endif
// Unused strings that we want to be translated, even though
// we're not using them yet...
wxString future1 = _("Master Gain Control");
@ -1183,9 +1174,12 @@ bool AudacityApp::OnInit()
// Initialize the CommandHandler
InitCommandHandler();
// Initialize the ModuleManager, including loading found modules
ModuleManager::Initialize(*mCmdHandler);
// Initialize the PluginManager
PluginManager::Get().Initialize();
// Initialize the ModuleManager, including loading found modules
ModuleManager::Get().Initialize(*mCmdHandler);
#if !wxCHECK_VERSION(3, 0, 0)
FinishInits();
@ -1248,7 +1242,6 @@ void AudacityApp::FinishInits()
LoadEffects();
#ifdef __WXMAC__
// On the Mac, users don't expect a program to quit when you close the last window.
@ -1310,7 +1303,7 @@ void AudacityApp::FinishInits()
FFmpegStartup();
#endif
mImporter = new Importer;
Importer::Get().Initialize();
//
// Auto-recovery
@ -1474,7 +1467,7 @@ void AudacityApp::FinishInits()
gInited = true;
ModuleManager::Dispatch(AppInitialized);
ModuleManager::Get().Dispatch(AppInitialized);
mWindowRectAlreadySaved = FALSE;
}
@ -1823,8 +1816,7 @@ int AudacityApp::OnExit()
delete mIPCServ;
#endif
if (mImporter)
delete mImporter;
Importer::Get().Terminate();
if(gPrefs)
{
@ -1856,6 +1848,9 @@ int AudacityApp::OnExit()
DeinitAudioIO();
// Terminate the PluginManager (must be done before deleting the locale)
PluginManager::Get().Terminate();
if (mLocale)
delete mLocale;
delete mChecker;

View File

@ -194,8 +194,6 @@ class AudacityApp:public wxApp {
AudacityLogger *GetLogger();
Importer *mImporter;
#if defined(__WXGTK__)
/** \brief This flag is set true when in a keyboard event handler.
* Used to work around a hang issue with ibus (bug 154) */

View File

@ -43,6 +43,8 @@
#include <wx/mac/private.h>
#endif
#include "audacity/Types.h"
#include "AColor.h"
#include "AudacityApp.h"
#include "AudioIO.h"
@ -68,11 +70,9 @@
#include "ViewInfo.h"
#include "WaveTrack.h"
#include "widgets/ASlider.h"
#include "widgets/Ruler.h"
#include "xml/XMLTagHandler.h"
#include "widgets/ASlider.h"
#include "widgets/ProgressDialog.h"
#include "widgets/Ruler.h"
#include "xml/XMLTagHandler.h"
// PRL: These lines allow you to remove Project.h above.
// They must be included before the definition of macro new below.

View File

@ -1371,6 +1371,13 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
while( mAudioThreadShouldCallFillBuffersOnce == true )
wxMilliSleep( 50 );
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
if (mNumPlaybackChannels > 0)
{
EffectManager::Get().RealtimeInitialize(1, sampleRate);
}
#endif
#ifdef EXPERIMENTAL_MIDI_OUT
// if no playback, reset the midi time to zero to roughly sync
// with recording (or if recording is not going to happen, just
@ -1419,6 +1426,10 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
void AudioIO::StartStreamCleanup(bool bOnlyBuffers)
{
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
EffectManager::Get().RealtimeFinalize();
#endif
if(mPlaybackBuffers)
{
for( unsigned int i = 0; i < mPlaybackTracks.GetCount(); i++ )
@ -1600,6 +1611,11 @@ void AudioIO::StopStream()
if (mStopStreamCount != 1)
return;
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
// No longer need effects processing
EffectManager::Get().RealtimeFinalize();
#endif
//
// We got here in one of two ways:
//
@ -1827,6 +1843,20 @@ void AudioIO::StopStream()
void AudioIO::SetPaused(bool state)
{
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
if (state != mPaused)
{
if (state)
{
EffectManager::Get().RealtimeSuspend();
}
else
{
EffectManager::Get().RealtimeResume();
}
}
#endif
mPaused = state;
}
@ -3536,6 +3566,10 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
if (cut) // no samples to process, they've been discarded
continue;
#endif
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
EffectManager::Get().RealtimeProcessMono(tempFloats, len);
#endif
if (vt->GetChannel() == Track::LeftChannel ||
vt->GetChannel() == Track::MonoChannel)

View File

@ -15,6 +15,7 @@
#include "portaudio.h"
#include "Audacity.h"
#include "effects/Effect.h"
#include "Experimental.h"
#ifdef USE_MIDI

View File

@ -169,25 +169,24 @@ void BatchCommandDialog::OnItemSelected(wxListEvent &event)
mCommand->SetValue( command );
wxString params = BatchCommands::GetCurrentParamsFor( command );
mParameters->SetValue( params );
Effect * f = EffectManager::Get().GetEffectByIdentifier( command );
mEditParams->Enable( f != NULL );
PluginID ID = EffectManager::Get().GetEffectByIdentifier( command );
mEditParams->Enable( !ID.empty() );
}
void BatchCommandDialog::OnEditParams(wxCommandEvent & WXUNUSED(event))
{
wxString command = mCommand->GetValue();
wxString params = mParameters->GetValue();
Effect * f = EffectManager::Get().GetEffectByIdentifier( command );
if( f==NULL )
return;
BatchCommands::SetCurrentParametersFor( f, command, params );
if( BatchCommands::PromptForParamsFor( command, this ))
if (BatchCommands::SetCurrentParametersFor( command, params ))
{
// we've just prompted for the parameters, so the values
// that are current have changed.
params = BatchCommands::GetCurrentParamsFor( command );
mParameters->SetValue( params.Strip(wxString::trailing) );
mParameters->Refresh();
if( BatchCommands::PromptForParamsFor( command, this ))
{
// we've just prompted for the parameters, so the values
// that are current have changed.
params = BatchCommands::GetCurrentParamsFor( command );
mParameters->SetValue( params.Strip(wxString::trailing) );
mParameters->Refresh();
}
}
}

View File

@ -30,6 +30,7 @@ See also BatchCommandDialog and BatchProcessDialog.
#include "effects/EffectManager.h"
#include "FileNames.h"
#include "Internat.h"
#include "PluginManager.h"
#include "Prefs.h"
#include "Shuttle.h"
#include "export/ExportFLAC.h"
@ -264,9 +265,10 @@ wxArrayString BatchCommands::GetAllCommands()
AudacityProject *project = GetActiveProject();
if (!project)
{
return commands;
}
EffectArray * effects;
unsigned int i;
// CLEANSPEECH remnant
@ -276,18 +278,18 @@ wxArrayString BatchCommands::GetAllCommands()
}
// end CLEANSPEECH remnant
int additionalEffects=ADVANCED_EFFECT;
effects = EffectManager::Get().GetEffects(PROCESS_EFFECT | BUILTIN_EFFECT | PLUGIN_EFFECT | additionalEffects);
for(i=0; i<effects->GetCount(); i++) {
if ((*effects)[i]->SupportsChains()) {
command=(*effects)[i]->GetEffectIdentifier();
if (!command.IsEmpty()) {
PluginManager & pm = PluginManager::Get();
EffectManager & em = EffectManager::Get();
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect);
while (plug)
{
command = em.GetEffectIdentifier(plug->GetID());
if (!command.IsEmpty())
{
commands.Add( command);
}
}
plug = pm.GetNextPlugin(PluginTypeEffect);
}
delete effects;
/* This is for later in development: include the menu commands.
CommandManager * mManager = project->GetCommandManager();
@ -304,29 +306,25 @@ wxArrayString BatchCommands::GetAllCommands()
wxString BatchCommands::GetCurrentParamsFor(wxString command)
{
Effect * f = EffectManager::Get().GetEffectByIdentifier( command );
if( f==NULL )
return wxT("");// effect not found.
ShuttleCli shuttle;
shuttle.mbStoreInClient=false;
f->TransferParameters( shuttle );
if( shuttle.mParams.IsEmpty() )
return wxT("");// effect had no parameters.
const PluginID & ID = EffectManager::Get().GetEffectByIdentifier(command);
if( ID.empty() )
{
return wxEmptyString; // effect not found.
}
return shuttle.mParams;
return EffectManager::Get().GetEffectParameters(ID);
}
bool BatchCommands::PromptForParamsFor(wxString command, wxWindow *parent)
{
Effect * f = EffectManager::Get().GetEffectByIdentifier(command);
if( f==NULL )
return false;
const PluginID & ID = EffectManager::Get().GetEffectByIdentifier(command);
//mFactory = factory;
//mProjectRate = projectRate;
f->mParent = parent;
//mTracks = list;
return f->PromptUser();
if (ID.empty())
{
return false;
}
return EffectManager::Get().PromptUser(ID, parent);
}
double BatchCommands::GetEndTime()
@ -469,9 +467,9 @@ bool BatchCommands::ApplySpecialCommand(int WXUNUSED(iCommand), const wxString c
return WriteMp3File(filename, 56);
} else if (command == wxT("StereoToMono")) {
// StereoToMono is an effect masquerading as a menu item.
Effect * f = EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono"));
if (f != NULL) {
return ApplyEffectCommand(f, command, params);
const PluginID & ID = EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono"));
if (!ID.empty()) {
return ApplyEffectCommand(ID, command, params);
}
wxMessageBox(_("Stereo to Mono Effect not found"));
return false;
@ -514,15 +512,17 @@ bool BatchCommands::ApplySpecialCommand(int WXUNUSED(iCommand), const wxString c
}
// end CLEANSPEECH remnant
bool BatchCommands::SetCurrentParametersFor( Effect * f, const wxString command, const wxString params)
bool BatchCommands::SetCurrentParametersFor(const wxString command, const wxString params)
{
// transfer the parameters to the effect...
if( !params.IsEmpty() )
{
ShuttleCli shuttle;
shuttle.mParams = params;
shuttle.mbStoreInClient=true;
if( !f->TransferParameters( shuttle ))
const PluginID & ID = EffectManager::Get().GetEffectByIdentifier(command);
if (ID.empty())
{
return false;
}
if (!EffectManager::Get().SetEffectParameters(ID, params))
{
wxMessageBox(
wxString::Format(
@ -533,7 +533,7 @@ bool BatchCommands::SetCurrentParametersFor( Effect * f, const wxString command,
return true;
}
bool BatchCommands::ApplyEffectCommand( Effect * f, const wxString command, const wxString params)
bool BatchCommands::ApplyEffectCommand(const PluginID & ID, const wxString command, const wxString params)
{
//Possibly end processing here, if in batch-debug
if( ReportAndSkip(command, params))
@ -547,7 +547,7 @@ bool BatchCommands::ApplyEffectCommand( Effect * f, const wxString command, co
project->SelectAllIfNone();
// NOW actually apply the effect.
return project->OnEffect(ALL_EFFECTS | CONFIGURED_EFFECT , f, params, false);
return project->OnEffect(ALL_EFFECTS | CONFIGURED_EFFECT , ID, params, false);
}
bool BatchCommands::ApplyCommand(const wxString command, const wxString params)
@ -564,13 +564,16 @@ bool BatchCommands::ApplyCommand(const wxString command, const wxString params)
// end CLEANSPEECH remnant
// Test for an effect.
Effect * f = EffectManager::Get().GetEffectByIdentifier( command );
if( f!=NULL )
return ApplyEffectCommand( f, command, params );
const PluginID & ID = EffectManager::Get().GetEffectByIdentifier( command );
if (!ID.empty())
{
return ApplyEffectCommand(ID, command, params);
}
wxMessageBox(
wxString::Format(
_("Your batch command of %s was not recognized."), command.c_str() ));
return false;
}

View File

@ -28,7 +28,7 @@ class BatchCommands {
bool ApplyCommand( const wxString command, const wxString params );
bool ApplyCommandInBatchMode(const wxString & command, const wxString &params);
bool ApplySpecialCommand(int iCommand, const wxString command,const wxString params);
bool ApplyEffectCommand(Effect * f, const wxString command, const wxString params);
bool ApplyEffectCommand(const PluginID & ID, const wxString command, const wxString params);
bool ReportAndSkip( const wxString command, const wxString params );
void AbortBatch();
@ -41,7 +41,7 @@ class BatchCommands {
wxArrayString GetNames();
static bool PromptForParamsFor( wxString command, wxWindow *parent );
static wxString GetCurrentParamsFor( wxString command );
static bool SetCurrentParametersFor( Effect * f, const wxString command, const wxString params);
static bool SetCurrentParametersFor(const wxString command, const wxString params);
static wxArrayString GetAllCommands();
// These commands do depend on the command list.

View File

@ -39,6 +39,7 @@
#include "commands/CommandManager.h"
#include "effects/Effect.h"
#include "../images/Arrow.xpm"
#include "../images/Empty9x16.xpm"
#include "BatchCommands.h"
#include "UndoManager.h"
@ -211,12 +212,12 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
wxString all;
l.DeleteContents(true);
wxGetApp().mImporter->GetSupportedImportFormats(&l);
Importer::Get().GetSupportedImportFormats(&l);
for (FormatList::compatibility_iterator n = l.GetFirst(); n; n = n->GetNext()) {
Format *f = n->GetData();
wxString newfilter = f->formatName + wxT("|");
for (size_t i = 0; i < f->formatExtensions.GetCount(); i++) {
for (size_t i = 0; i < f->formatExtensions.size(); i++) {
if (!newfilter.Contains(wxT("*.") + f->formatExtensions[i] + wxT(";")))
newfilter += wxT("*.") + f->formatExtensions[i] + wxT(";");
if (!all.Contains(wxT("*.") + f->formatExtensions[i] + wxT(";")))
@ -271,7 +272,7 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
S.StartStatic(_("Applying..."), 1);
{
wxImageList *imageList = new wxImageList(9, 16);
imageList->Add(wxIcon(empty_9x16_xpm));
imageList->Add(wxIcon(empty9x16_xpm));
imageList->Add(wxIcon(arrow_xpm));
S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES |

View File

@ -175,4 +175,11 @@
// Module prefs provides a panel in prefs where users can choose which modules
// to enable.
#define EXPERIMENTAL_MODULE_PREFS
// Define to include realtime effects processing.
#define EXPERIMENTAL_REALTIME_EFFECTS
// Define to include the effects rack (such as it is).
#define EXPERIMENTAL_EFFECTS_RACK
#endif

View File

@ -167,7 +167,39 @@ wxString FileNames::PlugInDir()
wxString FileNames::PluginsCache()
{
return wxFileName( DataDir(), wxT("plugins.cfg") ).GetFullPath();
return wxFileName( DataDir(), wxT("pluginregistry.cfg") ).GetFullPath();
}
wxString FileNames::BaseDir()
{
wxFileName baseDir;
#if defined(__WXMAC__)
baseDir = PlatformCompatibility::GetExecutablePath();
// This removes (for instance) "Audacity.app/Contents/MacOSX/"
baseDir.RemoveLastDir();
baseDir.RemoveLastDir();
baseDir.RemoveLastDir();
#elif defined(__WXMSW__)
// Don't use wxStandardPaths::Get().GetDataDir() since it removes
// the "Debug" directory in debug builds.
baseDir = PlatformCompatibility::GetExecutablePath();
#else
// Linux goes into /*prefix*/share/audacity/
baseDir = wxStandardPaths::Get().GetDataDir();
#endif
return baseDir.GetPath();
}
wxString FileNames::ModulesDir()
{
wxFileName modulesDir(BaseDir(), wxEmptyString);
modulesDir.AppendDir(wxT("modules"));
return modulesDir.GetFullPath();
}
wxString FileNames::ThemeDir()

View File

@ -12,6 +12,7 @@
#define __AUDACITY_FILE_NAMES__
#include <wx/string.h>
#include "Audacity.h"
class wxFileName;
class wxArrayString;
@ -41,6 +42,9 @@ public:
static wxString NRPFile();
static wxString PluginsCache();
static wxString BaseDir();
static wxString ModulesDir();
/** \brief The user plug-in directory (not a system one)
*
* This returns the string path to where the user may have put plug-ins

View File

@ -30,6 +30,7 @@ undo memory so as to free up space.
#include <wx/textctrl.h>
#include "../images/Arrow.xpm"
#include "../images/Empty9x16.xpm"
#include "HistoryWindow.h"
#include "UndoManager.h"
#include "Project.h"
@ -58,7 +59,7 @@ HistoryWindow::HistoryWindow(AudacityProject *parent, UndoManager *manager):
mSelected = 0;
wxImageList *imageList = new wxImageList(9, 16);
imageList->Add(wxIcon(empty_9x16_xpm));
imageList->Add(wxIcon(empty9x16_xpm));
imageList->Add(wxIcon(arrow_xpm));
//------------------------- Main section --------------------

View File

@ -1,313 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
LoadModules.cpp
Dominic Mazzoni
James Crook
*******************************************************************//*!
\file LoadModules.cpp
\brief Based on LoadLadspa, this code loads pluggable Audacity
extension modules. It also has the code to (a) invoke a script
server and (b) invoke a function returning a replacement window,
i.e. an alternative to the usual interface, for Audacity.
*//*******************************************************************/
#include <wx/dynlib.h>
#include <wx/list.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <wx/string.h>
#include <wx/filename.h>
#include "Audacity.h"
#include "AudacityApp.h"
#include "Internat.h"
#include "commands/ScriptCommandRelay.h"
#include <NonGuiThread.h> // header from libwidgetextra
#ifdef EXPERIMENTAL_MODULE_PREFS
#include "Prefs.h"
#include "./prefs/ModulePrefs.h"
#endif
#include "LoadModules.h"
#include "widgets/MultiDialog.h"
#define initFnName "ExtensionModuleInit"
#define versionFnName "GetVersionString"
#define scriptFnName "RegScriptServerFunc"
#define mainPanelFnName "MainPanelFunc"
typedef wxWindow * pwxWindow;
typedef int (*tModuleInit)(int);
//typedef wxString (*tVersionFn)();
typedef wxChar * (*tVersionFn)();
typedef pwxWindow (*tPanelFn)(int);
// This variable will hold the address of a subroutine in
// a DLL that can hijack the normal panel.
static tPanelFn pPanelHijack=NULL;
// Next two commented out lines are handy when investigating
// strange DLL behaviour. Instead of dynamic linking,
// link the library which has the replacement panel statically.
// Give the address of the routine here.
// This is a great help in identifying missing
// symbols which otherwise cause a dll to unload after loading
// without an explanation as to why!
//extern wxWindow * MainPanelFunc( int i );
//tPanelFn pPanelHijack=&MainPanelFunc;
/// IF pPanelHijack has been found in a module DLL
/// THEN when this function is called we'll go and
/// create that window instead of the normal one.
wxWindow * MakeHijackPanel()
{
if( pPanelHijack == NULL )
return NULL;
return pPanelHijack(0);
}
// This variable will hold the address of a subroutine in a DLL that
// starts a thread and reads script commands.
static tpRegScriptServerFunc scriptFn;
Module::Module(const wxString & name)
{
mName = name;
mLib = new wxDynamicLibrary();
mDispatch = NULL;
}
Module::~Module()
{
delete mLib;
}
bool Module::Load()
{
if (mLib->IsLoaded()) {
if (mDispatch) {
return true;
}
return false;
}
if (!mLib->Load(mName, wxDL_LAZY)) {
return false;
}
// Check version string matches. (For now, they must match exactly)
tVersionFn versionFn = (tVersionFn)(mLib->GetSymbol(wxT(versionFnName)));
if (versionFn == NULL){
wxString ShortName = wxFileName( mName ).GetName();
wxMessageBox(wxString::Format(_("The module %s does not provide a version string.\nIt will not be loaded."), ShortName.c_str()), _("Module Unsuitable"));
wxLogMessage(wxString::Format(_("The module %s does not provide a version string. It will not be loaded."), mName.c_str()));
mLib->Unload();
return false;
}
wxString moduleVersion = versionFn();
if( !moduleVersion.IsSameAs(AUDACITY_VERSION_STRING)) {
wxString ShortName = wxFileName( mName ).GetName();
wxMessageBox(wxString::Format(_("The module %s is matched with Audacity version %s.\n\nIt will not be loaded."), ShortName.c_str(), moduleVersion.c_str()), _("Module Unsuitable"));
wxLogMessage(wxString::Format(_("The module %s is matched with Audacity version %s. It will not be loaded."), mName.c_str(), moduleVersion.c_str()));
mLib->Unload();
return false;
}
mDispatch = (fnModuleDispatch) mLib->GetSymbol(wxT(ModuleDispatchName));
if (!mDispatch) {
// Module does not provide a dispatch function...
// That can be OK, as long as we never try to call it.
return true;
}
// However if we do have it and it does not work,
// then the module is bad.
bool res = ((mDispatch(ModuleInitialize))!=0);
if (res) {
return true;
}
mDispatch = NULL;
return false;
}
void Module::Unload()
{
if (mLib->IsLoaded()) {
mDispatch(ModuleTerminate);
}
mLib->Unload();
}
int Module::Dispatch(ModuleDispatchTypes type)
{
if (mLib->IsLoaded())
if( mDispatch != NULL )
return mDispatch(type);
return 0;
}
void * Module::GetSymbol(wxString name)
{
return mLib->GetSymbol(name);
}
//
// Module Manager
//
ModuleManager *ModuleManager::mInstance;
bool ModuleManager::OnInit()
{
mInstance = this;
return true;
}
void ModuleManager::OnExit()
{
size_t cnt = mModules.GetCount();
for (size_t ndx = 0; ndx < cnt; ndx++) {
delete (Module *) mModules[ndx];
}
mModules.Clear();
}
void ModuleManager::Initialize(CommandHandler &cmdHandler)
{
wxArrayString audacityPathList = wxGetApp().audacityPathList;
wxArrayString pathList;
wxArrayString files;
wxString pathVar;
size_t i;
// Code from LoadLadspa that might be useful in load modules.
pathVar = wxGetenv(wxT("AUDACITY_MODULES_PATH"));
if (pathVar != wxT(""))
wxGetApp().AddMultiPathsToPathList(pathVar, pathList);
for (i = 0; i < audacityPathList.GetCount(); i++) {
wxString prefix = audacityPathList[i] + wxFILE_SEP_PATH;
wxGetApp().AddUniquePathToPathList(prefix + wxT("modules"),
pathList);
}
#if defined(__WXMSW__)
wxGetApp().FindFilesInPathList(wxT("*.dll"), pathList, files);
#else
wxGetApp().FindFilesInPathList(wxT("*.so"), pathList, files);
#endif
for (i = 0; i < files.GetCount(); i++) {
// As a courtesy to some modules that might be bridges to
// open other modules, we set the current working
// directory to be the module's directory.
wxString saveOldCWD = ::wxGetCwd();
wxString prefix = ::wxPathOnly(files[i]);
::wxSetWorkingDirectory(prefix);
#ifdef EXPERIMENTAL_MODULE_PREFS
int iModuleStatus = ModulePrefs::GetModuleStatus( files[i] );
if( iModuleStatus == kModuleDisabled )
continue;
if( iModuleStatus == kModuleFailed )
continue;
// New module? You have to go and explicitly enable it.
if( iModuleStatus == kModuleNew ){
// To ensure it is noted in config file and so
// appears on modules page.
ModulePrefs::SetModuleStatus( files[i], kModuleNew);
continue;
}
if( iModuleStatus == kModuleAsk )
#endif
// JKC: I don't like prompting for the plug-ins individually
// I think it would be better to show the module prefs page,
// and let the user decide for each one.
{
wxString ShortName = wxFileName( files[i] ).GetName();
wxString msg;
msg.Printf(_("Module \"%s\" found."), ShortName.c_str());
msg += _("\n\nOnly use modules from trusted sources");
const wxChar *buttons[] = {_("Yes"), _("No"), NULL}; // could add a button here for 'yes and remember that', and put it into the cfg file. Needs more thought.
int action;
action = ShowMultiDialog(msg, _("Audacity Module Loader"), buttons, _("Try and load this module?"), false);
#ifdef EXPERIMENTAL_MODULE_PREFS
// If we're not prompting always, accept the answer permanantly
if( iModuleStatus == kModuleNew ){
iModuleStatus = (action==1)?kModuleDisabled : kModuleEnabled;
ModulePrefs::SetModuleStatus( files[i], iModuleStatus );
}
#endif
if(action == 1){ // "No"
continue;
}
}
#ifdef EXPERIMENTAL_MODULE_PREFS
// Before attempting to load, we set the state to bad.
// That way, if we crash, we won't try again.
ModulePrefs::SetModuleStatus( files[i], kModuleFailed );
#endif
Module *module = new Module(files[i]);
if (module->Load()) // it will get rejected if there are version problems
{
mInstance->mModules.Add(module);
// We've loaded and initialised OK.
// So look for special case functions:
wxLogNull logNo; // Don't show wxWidgets errors if we can't do these. (Was: Fix bug 544.)
// (a) for scripting.
if( scriptFn == NULL )
scriptFn = (tpRegScriptServerFunc)(module->GetSymbol(wxT(scriptFnName)));
// (b) for hijacking the entire Audacity panel.
if( pPanelHijack==NULL )
{
pPanelHijack = (tPanelFn)(module->GetSymbol(wxT(mainPanelFnName)));
}
#ifdef EXPERIMENTAL_MODULE_PREFS
// Loaded successfully, restore the status.
ModulePrefs::SetModuleStatus( files[i], iModuleStatus);
#endif
}
else {
// No need to save status, as we already set kModuleFailed.
delete module;
}
::wxSetWorkingDirectory(saveOldCWD);
}
// After loading all the modules, we may have a registered scripting function.
if(scriptFn)
{
ScriptCommandRelay::SetCommandHandler(cmdHandler);
ScriptCommandRelay::SetRegScriptServerFunc(scriptFn);
NonGuiThread::StartChild(&ScriptCommandRelay::Run);
}
}
int ModuleManager::Dispatch(ModuleDispatchTypes type)
{
size_t cnt = mInstance->mModules.GetCount();
for (size_t ndx = 0; ndx < cnt; ndx++) {
Module *module = (Module *)mInstance->mModules[ndx];
module->Dispatch(type);
}
return 0;
}
IMPLEMENT_DYNAMIC_CLASS(ModuleManager, wxModule);

View File

@ -1,79 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
LoadModules.h
Dominic Mazzoni
James Crook
**********************************************************************/
#ifndef __AUDACITY_LOADMODULES_H__
#define __AUDACITY_LOADMODULES_H__
#include <wx/dynlib.h>
#include <wx/module.h>
class CommandHandler;
wxWindow * MakeHijackPanel();
//
// Module Manager
//
// wxPluginManager would be MUCH better, but it's an "undocumented" framework.
//
#define ModuleDispatchName "ModuleDispatch"
typedef enum
{
ModuleInitialize,
ModuleTerminate,
AppInitialized,
AppQuiting,
ProjectInitialized,
ProjectClosing,
MenusRebuilt
} ModuleDispatchTypes;
typedef int (*fnModuleDispatch)(ModuleDispatchTypes type);
class Module
{
public:
Module(const wxString & name);
virtual ~Module();
bool Load();
void Unload();
int Dispatch(ModuleDispatchTypes type);
void * GetSymbol(wxString name);
private:
wxString mName;
wxDynamicLibrary *mLib;
fnModuleDispatch mDispatch;
};
class ModuleManager:public wxModule
{
public:
ModuleManager() {};
virtual ~ModuleManager() {};
virtual bool OnInit();
virtual void OnExit();
static void Initialize(CommandHandler &cmdHandler);
static int Dispatch(ModuleDispatchTypes type);
private:
static ModuleManager *mInstance;
wxArrayPtrVoid mModules;
DECLARE_DYNAMIC_CLASS(ModuleManager);
};
#endif /* __AUDACITY_LOADMODULES_H__ */

View File

@ -149,8 +149,6 @@ audacity_SOURCES = \
Languages.h \
Legacy.cpp \
Legacy.h \
LoadModules.cpp \
LoadModules.h \
Lyrics.cpp \
Lyrics.h \
LyricsWindow.cpp \
@ -164,6 +162,8 @@ audacity_SOURCES = \
Mix.h \
MixerBoard.cpp \
MixerBoard.h \
ModuleManager.cpp \
ModuleManager.h \
PitchName.cpp \
PitchName.h \
PlatformCompatibility.cpp \
@ -318,6 +318,8 @@ audacity_SOURCES = \
effects/EffectCategory.h \
effects/EffectManager.cpp \
effects/EffectManager.h \
effects/EffectRack.cpp \
effects/EffectRack.h \
effects/Equalization.cpp \
effects/Equalization.h \
effects/Equalization48x.cpp \

View File

@ -299,10 +299,10 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
ImageManipulation.h InterpolateAudio.cpp InterpolateAudio.h \
LabelDialog.cpp LabelDialog.h LabelTrack.cpp LabelTrack.h \
LangChoice.cpp LangChoice.h Languages.cpp Languages.h \
Legacy.cpp Legacy.h LoadModules.cpp LoadModules.h Lyrics.cpp \
Lyrics.h LyricsWindow.cpp LyricsWindow.h MacroMagic.h \
Matrix.cpp Matrix.h Menus.cpp Menus.h Mix.cpp Mix.h \
MixerBoard.cpp MixerBoard.h PitchName.cpp PitchName.h \
Legacy.cpp Legacy.h Lyrics.cpp Lyrics.h LyricsWindow.cpp \
LyricsWindow.h MacroMagic.h Matrix.cpp Matrix.h Menus.cpp \
Menus.h Mix.cpp Mix.h MixerBoard.cpp MixerBoard.h \
ModuleManager.cpp ModuleManager.h PitchName.cpp PitchName.h \
PlatformCompatibility.cpp PlatformCompatibility.h \
PluginManager.cpp PluginManager.h Printing.cpp Printing.h \
Profiler.cpp Profiler.h Project.cpp Project.h RealFFTf.cpp \
@ -363,6 +363,7 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
effects/Echo.h effects/Effect.cpp effects/Effect.h \
effects/EffectCategory.cpp effects/EffectCategory.h \
effects/EffectManager.cpp effects/EffectManager.h \
effects/EffectRack.cpp effects/EffectRack.h \
effects/Equalization.cpp effects/Equalization.h \
effects/Equalization48x.cpp effects/Equalization48x.h \
effects/Fade.cpp effects/Fade.h effects/FindClipping.cpp \
@ -538,10 +539,10 @@ am_audacity_OBJECTS = $(am__objects_1) audacity-AboutDialog.$(OBJEXT) \
audacity-InterpolateAudio.$(OBJEXT) \
audacity-LabelDialog.$(OBJEXT) audacity-LabelTrack.$(OBJEXT) \
audacity-LangChoice.$(OBJEXT) audacity-Languages.$(OBJEXT) \
audacity-Legacy.$(OBJEXT) audacity-LoadModules.$(OBJEXT) \
audacity-Lyrics.$(OBJEXT) audacity-LyricsWindow.$(OBJEXT) \
audacity-Matrix.$(OBJEXT) audacity-Menus.$(OBJEXT) \
audacity-Mix.$(OBJEXT) audacity-MixerBoard.$(OBJEXT) \
audacity-Legacy.$(OBJEXT) audacity-Lyrics.$(OBJEXT) \
audacity-LyricsWindow.$(OBJEXT) audacity-Matrix.$(OBJEXT) \
audacity-Menus.$(OBJEXT) audacity-Mix.$(OBJEXT) \
audacity-MixerBoard.$(OBJEXT) audacity-ModuleManager.$(OBJEXT) \
audacity-PitchName.$(OBJEXT) \
audacity-PlatformCompatibility.$(OBJEXT) \
audacity-PluginManager.$(OBJEXT) audacity-Printing.$(OBJEXT) \
@ -602,6 +603,7 @@ am_audacity_OBJECTS = $(am__objects_1) audacity-AboutDialog.$(OBJEXT) \
effects/audacity-Effect.$(OBJEXT) \
effects/audacity-EffectCategory.$(OBJEXT) \
effects/audacity-EffectManager.$(OBJEXT) \
effects/audacity-EffectRack.$(OBJEXT) \
effects/audacity-Equalization.$(OBJEXT) \
effects/audacity-Equalization48x.$(OBJEXT) \
effects/audacity-Fade.$(OBJEXT) \
@ -1163,10 +1165,10 @@ audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.cpp \
ImageManipulation.h InterpolateAudio.cpp InterpolateAudio.h \
LabelDialog.cpp LabelDialog.h LabelTrack.cpp LabelTrack.h \
LangChoice.cpp LangChoice.h Languages.cpp Languages.h \
Legacy.cpp Legacy.h LoadModules.cpp LoadModules.h Lyrics.cpp \
Lyrics.h LyricsWindow.cpp LyricsWindow.h MacroMagic.h \
Matrix.cpp Matrix.h Menus.cpp Menus.h Mix.cpp Mix.h \
MixerBoard.cpp MixerBoard.h PitchName.cpp PitchName.h \
Legacy.cpp Legacy.h Lyrics.cpp Lyrics.h LyricsWindow.cpp \
LyricsWindow.h MacroMagic.h Matrix.cpp Matrix.h Menus.cpp \
Menus.h Mix.cpp Mix.h MixerBoard.cpp MixerBoard.h \
ModuleManager.cpp ModuleManager.h PitchName.cpp PitchName.h \
PlatformCompatibility.cpp PlatformCompatibility.h \
PluginManager.cpp PluginManager.h Printing.cpp Printing.h \
Profiler.cpp Profiler.h Project.cpp Project.h RealFFTf.cpp \
@ -1227,6 +1229,7 @@ audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.cpp \
effects/Echo.h effects/Effect.cpp effects/Effect.h \
effects/EffectCategory.cpp effects/EffectCategory.h \
effects/EffectManager.cpp effects/EffectManager.h \
effects/EffectRack.cpp effects/EffectRack.h \
effects/Equalization.cpp effects/Equalization.h \
effects/Equalization48x.cpp effects/Equalization48x.h \
effects/Fade.cpp effects/Fade.h effects/FindClipping.cpp \
@ -1599,6 +1602,8 @@ effects/audacity-EffectCategory.$(OBJEXT): effects/$(am__dirstamp) \
effects/$(DEPDIR)/$(am__dirstamp)
effects/audacity-EffectManager.$(OBJEXT): effects/$(am__dirstamp) \
effects/$(DEPDIR)/$(am__dirstamp)
effects/audacity-EffectRack.$(OBJEXT): effects/$(am__dirstamp) \
effects/$(DEPDIR)/$(am__dirstamp)
effects/audacity-Equalization.$(OBJEXT): effects/$(am__dirstamp) \
effects/$(DEPDIR)/$(am__dirstamp)
effects/audacity-Equalization48x.$(OBJEXT): effects/$(am__dirstamp) \
@ -2000,13 +2005,13 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-LangChoice.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-Languages.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-Legacy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-LoadModules.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-Lyrics.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-LyricsWindow.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-Matrix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-Menus.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-Mix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-MixerBoard.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-ModuleManager.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-NoteTrack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-PitchName.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-PlatformCompatibility.Po@am__quote@
@ -2107,6 +2112,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@effects/$(DEPDIR)/audacity-Effect.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@effects/$(DEPDIR)/audacity-EffectCategory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@effects/$(DEPDIR)/audacity-EffectManager.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@effects/$(DEPDIR)/audacity-EffectRack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@effects/$(DEPDIR)/audacity-Equalization.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@effects/$(DEPDIR)/audacity-Equalization48x.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@effects/$(DEPDIR)/audacity-Fade.Po@am__quote@
@ -2991,20 +2997,6 @@ audacity-Legacy.obj: Legacy.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-Legacy.obj `if test -f 'Legacy.cpp'; then $(CYGPATH_W) 'Legacy.cpp'; else $(CYGPATH_W) '$(srcdir)/Legacy.cpp'; fi`
audacity-LoadModules.o: LoadModules.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-LoadModules.o -MD -MP -MF $(DEPDIR)/audacity-LoadModules.Tpo -c -o audacity-LoadModules.o `test -f 'LoadModules.cpp' || echo '$(srcdir)/'`LoadModules.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-LoadModules.Tpo $(DEPDIR)/audacity-LoadModules.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LoadModules.cpp' object='audacity-LoadModules.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-LoadModules.o `test -f 'LoadModules.cpp' || echo '$(srcdir)/'`LoadModules.cpp
audacity-LoadModules.obj: LoadModules.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-LoadModules.obj -MD -MP -MF $(DEPDIR)/audacity-LoadModules.Tpo -c -o audacity-LoadModules.obj `if test -f 'LoadModules.cpp'; then $(CYGPATH_W) 'LoadModules.cpp'; else $(CYGPATH_W) '$(srcdir)/LoadModules.cpp'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-LoadModules.Tpo $(DEPDIR)/audacity-LoadModules.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LoadModules.cpp' object='audacity-LoadModules.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-LoadModules.obj `if test -f 'LoadModules.cpp'; then $(CYGPATH_W) 'LoadModules.cpp'; else $(CYGPATH_W) '$(srcdir)/LoadModules.cpp'; fi`
audacity-Lyrics.o: Lyrics.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-Lyrics.o -MD -MP -MF $(DEPDIR)/audacity-Lyrics.Tpo -c -o audacity-Lyrics.o `test -f 'Lyrics.cpp' || echo '$(srcdir)/'`Lyrics.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-Lyrics.Tpo $(DEPDIR)/audacity-Lyrics.Po
@ -3089,6 +3081,20 @@ audacity-MixerBoard.obj: MixerBoard.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-MixerBoard.obj `if test -f 'MixerBoard.cpp'; then $(CYGPATH_W) 'MixerBoard.cpp'; else $(CYGPATH_W) '$(srcdir)/MixerBoard.cpp'; fi`
audacity-ModuleManager.o: ModuleManager.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-ModuleManager.o -MD -MP -MF $(DEPDIR)/audacity-ModuleManager.Tpo -c -o audacity-ModuleManager.o `test -f 'ModuleManager.cpp' || echo '$(srcdir)/'`ModuleManager.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-ModuleManager.Tpo $(DEPDIR)/audacity-ModuleManager.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ModuleManager.cpp' object='audacity-ModuleManager.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-ModuleManager.o `test -f 'ModuleManager.cpp' || echo '$(srcdir)/'`ModuleManager.cpp
audacity-ModuleManager.obj: ModuleManager.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-ModuleManager.obj -MD -MP -MF $(DEPDIR)/audacity-ModuleManager.Tpo -c -o audacity-ModuleManager.obj `if test -f 'ModuleManager.cpp'; then $(CYGPATH_W) 'ModuleManager.cpp'; else $(CYGPATH_W) '$(srcdir)/ModuleManager.cpp'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-ModuleManager.Tpo $(DEPDIR)/audacity-ModuleManager.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ModuleManager.cpp' object='audacity-ModuleManager.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-ModuleManager.obj `if test -f 'ModuleManager.cpp'; then $(CYGPATH_W) 'ModuleManager.cpp'; else $(CYGPATH_W) '$(srcdir)/ModuleManager.cpp'; fi`
audacity-PitchName.o: PitchName.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-PitchName.o -MD -MP -MF $(DEPDIR)/audacity-PitchName.Tpo -c -o audacity-PitchName.o `test -f 'PitchName.cpp' || echo '$(srcdir)/'`PitchName.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-PitchName.Tpo $(DEPDIR)/audacity-PitchName.Po
@ -4125,6 +4131,20 @@ effects/audacity-EffectManager.obj: effects/EffectManager.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o effects/audacity-EffectManager.obj `if test -f 'effects/EffectManager.cpp'; then $(CYGPATH_W) 'effects/EffectManager.cpp'; else $(CYGPATH_W) '$(srcdir)/effects/EffectManager.cpp'; fi`
effects/audacity-EffectRack.o: effects/EffectRack.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT effects/audacity-EffectRack.o -MD -MP -MF effects/$(DEPDIR)/audacity-EffectRack.Tpo -c -o effects/audacity-EffectRack.o `test -f 'effects/EffectRack.cpp' || echo '$(srcdir)/'`effects/EffectRack.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) effects/$(DEPDIR)/audacity-EffectRack.Tpo effects/$(DEPDIR)/audacity-EffectRack.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='effects/EffectRack.cpp' object='effects/audacity-EffectRack.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o effects/audacity-EffectRack.o `test -f 'effects/EffectRack.cpp' || echo '$(srcdir)/'`effects/EffectRack.cpp
effects/audacity-EffectRack.obj: effects/EffectRack.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT effects/audacity-EffectRack.obj -MD -MP -MF effects/$(DEPDIR)/audacity-EffectRack.Tpo -c -o effects/audacity-EffectRack.obj `if test -f 'effects/EffectRack.cpp'; then $(CYGPATH_W) 'effects/EffectRack.cpp'; else $(CYGPATH_W) '$(srcdir)/effects/EffectRack.cpp'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) effects/$(DEPDIR)/audacity-EffectRack.Tpo effects/$(DEPDIR)/audacity-EffectRack.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='effects/EffectRack.cpp' object='effects/audacity-EffectRack.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o effects/audacity-EffectRack.obj `if test -f 'effects/EffectRack.cpp'; then $(CYGPATH_W) 'effects/EffectRack.cpp'; else $(CYGPATH_W) '$(srcdir)/effects/EffectRack.cpp'; fi`
effects/audacity-Equalization.o: effects/Equalization.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT effects/audacity-Equalization.o -MD -MP -MF effects/$(DEPDIR)/audacity-Equalization.Tpo -c -o effects/audacity-Equalization.o `test -f 'effects/Equalization.cpp' || echo '$(srcdir)/'`effects/Equalization.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) effects/$(DEPDIR)/audacity-Equalization.Tpo effects/$(DEPDIR)/audacity-Equalization.Po

View File

@ -74,7 +74,8 @@ simplifies construction of menu items.
#include "MixerBoard.h"
#include "Internat.h"
#include "FileFormats.h"
#include "LoadModules.h"
#include "ModuleManager.h"
#include "PluginManager.h"
#include "Prefs.h"
#include "Printing.h"
#ifdef USE_MIDI
@ -143,6 +144,7 @@ AudacityProjectCommandFunctor::AudacityProjectCommandFunctor(AudacityProject *pr
mCommandFunction = commandFunction;
mCommandKeyFunction = NULL;
mCommandListFunction = NULL;
mCommandPluginFunction = NULL;
}
AudacityProjectCommandFunctor::AudacityProjectCommandFunctor(AudacityProject *project,
@ -152,6 +154,7 @@ AudacityProjectCommandFunctor::AudacityProjectCommandFunctor(AudacityProject *pr
mCommandFunction = NULL;
mCommandKeyFunction = commandFunction;
mCommandListFunction = NULL;
mCommandPluginFunction = NULL;
}
AudacityProjectCommandFunctor::AudacityProjectCommandFunctor(AudacityProject *project,
@ -161,8 +164,22 @@ AudacityProjectCommandFunctor::AudacityProjectCommandFunctor(AudacityProject *pr
mCommandFunction = NULL;
mCommandKeyFunction = NULL;
mCommandListFunction = commandFunction;
mCommandPluginFunction = NULL;
}
AudacityProjectCommandFunctor::AudacityProjectCommandFunctor(AudacityProject *project,
audCommandPluginFunction commandFunction,
const PluginID & pluginID)
{
mProject = project;
mCommandFunction = NULL;
mCommandKeyFunction = NULL;
mCommandListFunction = NULL;
mCommandPluginFunction = commandFunction;
mPluginID = pluginID;
}
#if defined(EFFECT_CATEGORIES)
AudacityProjectCommandFunctor::AudacityProjectCommandFunctor(AudacityProject *project,
audCommandListFunction commandFunction,
wxArrayInt explicitIndices)
@ -171,13 +188,19 @@ AudacityProjectCommandFunctor::AudacityProjectCommandFunctor(AudacityProject *pr
mCommandFunction = NULL;
mCommandKeyFunction = NULL;
mCommandListFunction = commandFunction;
mCommandPluginFunction = NULL;
mExplicitIndices = explicitIndices;
}
#endif
void AudacityProjectCommandFunctor::operator()(int index, const wxEvent * evt)
{
if (mCommandListFunction && mExplicitIndices.GetCount() > 0)
if (mCommandPluginFunction)
(mProject->*(mCommandPluginFunction)) (mPluginID);
#if defined(EFFECT_CATEGORIES)
else if (mCommandListFunction && mExplicitIndices.GetCount() > 0)
(mProject->*(mCommandListFunction)) (mExplicitIndices[index]);
#endif
else if (mCommandListFunction)
(mProject->*(mCommandListFunction)) (index);
else if (mCommandKeyFunction)
@ -186,9 +209,14 @@ void AudacityProjectCommandFunctor::operator()(int index, const wxEvent * evt)
(mProject->*(mCommandFunction)) ();
}
#define FN(X) new AudacityProjectCommandFunctor(this, &AudacityProject:: X )
#define FNI(X, I) new AudacityProjectCommandFunctor(this, &AudacityProject:: X, I)
#define FNS(X, S) new AudacityProjectCommandFunctor(this, &AudacityProject:: X, S)
static bool SortPlugs(const PluginDescriptor *a, const PluginDescriptor *b)
{
return a->GetMenuName() < b->GetMenuName();
}
/// CreateMenusAndCommands builds the menus, and also rebuilds them after
/// changes in configured preferences - for example changes in key-bindings
@ -832,6 +860,15 @@ void AudacityProject::CreateMenusAndCommands()
c->EndMenu();
// All of this is a bit hacky until we can get more things connected into
// the plugin manager...sorry! :-(
wxArrayString defaults;
PluginManager & pm = PluginManager::Get();
const PluginDescriptor *plug;
bool needsep;
//////////////////////////////////////////////////////////////////////////
// Generate Menu
//////////////////////////////////////////////////////////////////////////
@ -839,29 +876,49 @@ void AudacityProject::CreateMenusAndCommands()
c->BeginMenu(_("&Generate"));
c->SetDefaultFlags(AudioIONotBusyFlag, AudioIONotBusyFlag);
typedef std::set<const PluginDescriptor *, bool (*)(const PluginDescriptor *, const PluginDescriptor *)> SortedPlugs;
SortedPlugs defaultplugs(SortPlugs);
SortedPlugs extraplugs(SortPlugs);
#ifndef EFFECT_CATEGORIES
effects = em.GetEffects(INSERT_EFFECT | BUILTIN_EFFECT);
if (effects->GetCount()) {
names.Clear();
for (size_t i = 0; i < effects->GetCount(); i++) {
names.Add((*effects)[i]->GetEffectName());
plug = pm.GetFirstPluginForEffectType(EffectTypeGenerate);
while (plug) {
if (plug->IsEffectDefault()) {
defaultplugs.insert(plug);
}
c->AddItemList(wxT("Generate"), names, FN(OnGenerateEffect));
}
delete effects;
effects = em.GetEffects(INSERT_EFFECT | PLUGIN_EFFECT);
if (effects->GetCount()) {
c->AddSeparator();
names.Clear();
for (size_t i = 0; i < effects->GetCount(); i++) {
names.Add((*effects)[i]->GetEffectName());
else {
extraplugs.insert(plug);
}
c->AddItemList(wxT("GeneratePlugin"), names, FN(OnGeneratePlugin), true);
plug = pm.GetNextPluginForEffectType(EffectTypeGenerate);
}
delete effects;
for (SortedPlugs::iterator iter = defaultplugs.begin(); iter != defaultplugs.end(); iter++)
{
const PluginDescriptor *plug = *iter;
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
int flags = plug->IsEffectRealtimeCapable() ?
AudioIONotBusyFlag :
TracksExistFlag;
#else
int flags = TracksExistFlag;
#endif
c->AddItem(plug->GetName(),
plug->GetMenuName(),
FNS(OnEffect, plug->GetID()));
}
needsep = true;
for (SortedPlugs::iterator iter = extraplugs.begin(); iter != extraplugs.end(); iter++)
{
const PluginDescriptor *plug = *iter;
if (needsep) {
c->AddSeparator();
needsep = false;
}
c->AddItem(plug->GetName(),
plug->GetMenuName(),
FNS(OnEffect, plug->GetID()));
}
#else
int flags;
@ -887,7 +944,7 @@ void AudacityProject::CreateMenusAndCommands()
EffectSet::const_iterator iter;
for (iter = unsorted.begin(); iter != unsorted.end(); ++iter) {
names.Add((*iter)->GetEffectName());
indices.Add((*iter)->GetID());
indices.Add((*iter)->GetEffectID());
}
c->AddItemList(wxT("Generate"), names,
FNI(OnProcessAny, indices), true);
@ -903,12 +960,11 @@ void AudacityProject::CreateMenusAndCommands()
/////////////////////////////////////////////////////////////////////////////
c->BeginMenu(_("Effe&ct"));
c->SetDefaultFlags(AudioIONotBusyFlag | TimeSelectedFlag | WaveTracksSelectedFlag,
AudioIONotBusyFlag | TimeSelectedFlag | WaveTracksSelectedFlag);
wxString buildMenuLabel;
if (mLastEffectType != 0) {
buildMenuLabel.Printf(_("Repeat %s"), mLastEffect->GetEffectName().c_str());
buildMenuLabel.Printf(_("Repeat %s"),
EffectManager::Get().GetEffectName(mLastEffect).c_str());
}
else
buildMenuLabel.Printf(_("Repeat Last Effect"));
@ -925,30 +981,57 @@ void AudacityProject::CreateMenusAndCommands()
// effects at all in the menu when EFFECT_CATEGORIES is undefined
#ifndef EFFECT_CATEGORIES
effects = em.GetEffects(PROCESS_EFFECT | BUILTIN_EFFECT | additionalEffects);
if (effects->GetCount()) {
names.Clear();
for (size_t i = 0; i < effects->GetCount(); i++) {
names.Add((*effects)[i]->GetEffectName());
defaultplugs.clear();
extraplugs.clear();
plug = pm.GetFirstPluginForEffectType(EffectTypeProcess);
while (plug) {
if (plug->IsEffectDefault()) {
defaultplugs.insert(plug);
}
c->AddItemList(wxT("Effect"), names, FN(OnProcessEffect));
}
delete effects;
effects = em.GetEffects(PROCESS_EFFECT | PLUGIN_EFFECT);
if (effects->GetCount()) {
c->AddSeparator();
names.Clear();
for (size_t i = 0; i < effects->GetCount(); i++) {
names.Add((*effects)[i]->GetEffectName());
else {
extraplugs.insert(plug);
}
c->AddItemList(wxT("EffectPlugin"), names, FN(OnProcessPlugin), true);
plug = pm.GetNextPluginForEffectType(EffectTypeProcess);
}
delete effects;
c->EndMenu();
for (SortedPlugs::iterator iter = defaultplugs.begin(); iter != defaultplugs.end(); iter++)
{
const PluginDescriptor *plug = *iter;
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
int flags = plug->IsEffectRealtimeCapable() ?
TracksExistFlag :
AudioIONotBusyFlag | TimeSelectedFlag | WaveTracksSelectedFlag;
#else
int flags = AudioIONotBusyFlag | TimeSelectedFlag | WaveTracksSelectedFlag;
#endif
c->AddItem(plug->GetName(),
plug->GetMenuName(),
FNS(OnEffect, plug->GetID()),
flags,
flags);
}
needsep = true;
for (SortedPlugs::iterator iter = extraplugs.begin(); iter != extraplugs.end(); iter++)
{
const PluginDescriptor *plug = *iter;
if (needsep) {
c->AddSeparator();
needsep = false;
}
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
int flags = plug->IsEffectRealtimeCapable() ?
TracksExistFlag :
AudioIONotBusyFlag | TimeSelectedFlag | WaveTracksSelectedFlag;
#else
int flags = AudioIONotBusyFlag | TimeSelectedFlag | WaveTracksSelectedFlag;
#endif
c->AddItem(plug->GetName(),
plug->GetMenuName(),
FNS(OnEffect, plug->GetID()),
flags,
flags);
}
#else
int flags = PROCESS_EFFECT | BUILTIN_EFFECT | PLUGIN_EFFECT | ADVANCED_EFFECT;
// The categories form a DAG, so we start at the roots (the categories
@ -968,15 +1051,16 @@ void AudacityProject::CreateMenusAndCommands()
EffectSet::const_iterator iter;
for (iter = unsorted.begin(); iter != unsorted.end(); ++iter) {
names.Add((*iter)->GetEffectName());
indices.Add((*iter)->GetID());
indices.Add((*iter)->GetEffectID());
}
c->AddItemList(wxT("Effect"), names, FNI(OnProcessAny, indices), true);
c->EndSubMenu();
}
c->EndMenu();
#endif
c->EndMenu();
//////////////////////////////////////////////////////////////////////////
// Analyze Menu
//////////////////////////////////////////////////////////////////////////
@ -991,28 +1075,57 @@ void AudacityProject::CreateMenusAndCommands()
AudioIONotBusyFlag | WaveTracksSelectedFlag | TimeSelectedFlag);
#ifndef EFFECT_CATEGORIES
effects = em.GetEffects(ANALYZE_EFFECT | BUILTIN_EFFECT);
if (effects->GetCount()) {
names.Clear();
for (size_t i = 0; i < effects->GetCount(); i++) {
names.Add((*effects)[i]->GetEffectName());
defaultplugs.clear();
extraplugs.clear();
plug = pm.GetFirstPluginForEffectType(EffectTypeAnalyze);
while (plug) {
if (plug->IsEffectDefault()) {
defaultplugs.insert(plug);
}
c->AddItemList(wxT("Analyze"), names, FN(OnAnalyzeEffect));
}
delete effects;
effects = em.GetEffects(ANALYZE_EFFECT | PLUGIN_EFFECT);
if (effects->GetCount()) {
c->AddSeparator();
names.Clear();
for (size_t i = 0; i < effects->GetCount(); i++) {
names.Add((*effects)[i]->GetEffectName());
else {
extraplugs.insert(plug);
}
c->AddItemList(wxT("AnalyzePlugin"), names, FN(OnAnalyzePlugin), true);
plug = pm.GetNextPluginForEffectType(EffectTypeAnalyze);
}
delete effects;
for (SortedPlugs::iterator iter = defaultplugs.begin(); iter != defaultplugs.end(); iter++)
{
const PluginDescriptor *plug = *iter;
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
int flags = plug->IsEffectRealtimeCapable() ?
TracksExistFlag :
AudioIONotBusyFlag | TimeSelectedFlag | WaveTracksSelectedFlag;
#else
int flags = AudioIONotBusyFlag | TimeSelectedFlag | WaveTracksSelectedFlag;
#endif
c->AddItem(plug->GetName(),
plug->GetMenuName(),
FNS(OnEffect, plug->GetID()),
flags,
flags);
}
needsep = true;
for (SortedPlugs::iterator iter = extraplugs.begin(); iter != extraplugs.end(); iter++)
{
const PluginDescriptor *plug = *iter;
if (needsep) {
c->AddSeparator();
needsep = false;
}
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
int flags = plug->IsEffectRealtimeCapable() ?
TracksExistFlag :
AudioIONotBusyFlag | TimeSelectedFlag | WaveTracksSelectedFlag;
#else
int flags = AudioIONotBusyFlag | TimeSelectedFlag | WaveTracksSelectedFlag;
#endif
c->AddItem(plug->GetName(),
plug->GetMenuName(),
FNS(OnEffect, plug->GetID()),
flags,
flags);
}
#else
flags = ANALYZE_EFFECT | BUILTIN_EFFECT | PLUGIN_EFFECT;
@ -1036,7 +1149,7 @@ void AudacityProject::CreateMenusAndCommands()
EffectSet::const_iterator iter;
for (iter = unsorted.begin(); iter != unsorted.end(); ++iter) {
names.Add((*iter)->GetEffectName());
indices.Add((*iter)->GetID());
indices.Add((*iter)->GetEffectID());
}
c->AddItemList(wxT("Analyze"), names,
FNI(OnProcessAny, indices), true);
@ -1272,7 +1385,7 @@ void AudacityProject::AddEffectsToMenu(CommandManager* c,
EffectSet::const_iterator iter;
for (iter = effects.begin(); iter != effects.end(); ++iter) {
names.Add((*iter)->GetEffectName());
indices.Add((*iter)->GetID());
indices.Add((*iter)->GetEffectID());
}
c->AddItemList(wxT("Effects"), names, FNI(OnProcessAny, indices), true);
}
@ -1377,7 +1490,7 @@ void AudacityProject::RebuildMenuBar()
CreateMenusAndCommands();
ModuleManager::Dispatch(MenusRebuilt);
ModuleManager::Get().Dispatch(MenusRebuilt);
}
void AudacityProject::RebuildOtherMenus()
@ -1484,7 +1597,7 @@ wxUint32 AudacityProject::GetUpdateFlags()
if (mUndoManager.UnsavedChanges())
flags |= UnsavedChangesFlag;
if (mLastEffect != NULL)
if (!mLastEffect.empty())
flags |= HasLastEffectFlag;
if (mUndoManager.UndoAvailable())
@ -2638,27 +2751,7 @@ void AudacityProject::OnZeroCrossing()
// Effect Menus
//
void AudacityProject::OnEffect(int type, int index)
{
EffectArray *effects;
Effect *f = NULL;
effects = EffectManager::Get().GetEffects(type);
f = (*effects)[index];
delete effects;
if (!f)
return;
//TIDY-ME: Effect Type parameters serve double duty.
// The type parameter is over used.
// It is being used:
// (a) to filter the list of effects
// (b) to specify whether to prompt for parameters.
OnEffect( type, f );
}
/// OnEffect() takes an Effect and executes it.
/// OnEffect() takes a PluginID and has the EffectManager execute the assocated effect.
///
/// At the moment flags are used only to indicate
/// whether to prompt for parameters or whether to
@ -2673,7 +2766,7 @@ void AudacityProject::OnEffect(int type, int index)
/// DanH: I've added the third option as a temporary measure. I think this
/// should eventually be done by having effects as Command objects.
bool AudacityProject::OnEffect(int type,
Effect * f,
const PluginID & ID,
wxString params,
bool saveState)
{
@ -2697,7 +2790,7 @@ bool AudacityProject::OnEffect(int type,
if (count == 0) {
// No tracks were selected...
if (f->GetEffectFlags() & INSERT_EFFECT) {
if (type & INSERT_EFFECT) {
// Create a new track for the generated audio...
newTrack = mTrackFactory->NewWaveTrack();
mTracks->Add(newTrack);
@ -2709,12 +2802,15 @@ bool AudacityProject::OnEffect(int type,
}
}
if (f->DoEffect(this, type, mRate, mTracks, mTrackFactory,
&mViewInfo.selectedRegion, params)) {
EffectManager & em = EffectManager::Get();
if (em.DoEffect(ID, this, type, mRate, mTracks, mTrackFactory,
&mViewInfo.selectedRegion, params))
{
if (saveState)
{
wxString longDesc = f->GetEffectDescription();
wxString shortDesc = f->GetEffectName();
wxString longDesc = em.GetEffectDescription(ID);
wxString shortDesc = em.GetEffectName(ID);
if (shortDesc.Length() > 3 && shortDesc.Right(3)==wxT("..."))
shortDesc = shortDesc.Left(shortDesc.Length()-3);
@ -2723,8 +2819,8 @@ bool AudacityProject::OnEffect(int type,
// Only remember a successful effect, don't rmemeber insert,
// or analyze effects.
if ((f->GetEffectFlags() & (INSERT_EFFECT | ANALYZE_EFFECT))==0) {
mLastEffect = f;
if ((type & (INSERT_EFFECT | ANALYZE_EFFECT))==0) {
mLastEffect = ID;
mLastEffectType = type;
wxString lastEffectDesc;
/* i18n-hint: %s will be the name of the effect which will be
@ -2737,7 +2833,7 @@ bool AudacityProject::OnEffect(int type,
//The following automatically re-zooms after sound was generated.
// IMO, it was disorienting, removing to try out without re-fitting
//mchinen:12/14/08 reapplying for generate effects
if ( f->GetEffectFlags() & INSERT_EFFECT)
if ( type & INSERT_EFFECT)
{
if (count == 0 || (clean && mViewInfo.selectedRegion.t0() == 0.0))
OnZoomFit();
@ -2761,36 +2857,79 @@ bool AudacityProject::OnEffect(int type,
return true;
}
void AudacityProject::OnGenerateEffect(int index)
void AudacityProject::OnEffect(const PluginID & pluginID)
{
OnEffect(BUILTIN_EFFECT | INSERT_EFFECT, index);
PluginManager & pm = PluginManager::Get();
const PluginDescriptor *plug = pm.GetPlugin(pluginID);
int type;
switch (plug->GetEffectType())
{
case EffectTypeGenerate:
type = INSERT_EFFECT;
break;
case EffectTypeProcess:
type = PROCESS_EFFECT;
break;
case EffectTypeAnalyze:
type = ANALYZE_EFFECT;
break;
}
type |= plug->IsEffectDefault() ? BUILTIN_EFFECT : PLUGIN_EFFECT;
OnEffect(type, pluginID);
}
void AudacityProject::OnGeneratePlugin(int index)
// Warning...complete hackage ahead
void AudacityProject::OnEffect(const PluginID & pluginID, bool configured)
{
OnEffect(PLUGIN_EFFECT | INSERT_EFFECT, index);
PluginManager & pm = PluginManager::Get();
const PluginDescriptor *plug = pm.GetPlugin(pluginID);
int type;
switch (plug->GetEffectType())
{
case EffectTypeGenerate:
type = INSERT_EFFECT;
break;
case EffectTypeProcess:
type = PROCESS_EFFECT;
break;
case EffectTypeAnalyze:
type = ANALYZE_EFFECT;
break;
}
type |= plug->IsEffectDefault() ? BUILTIN_EFFECT : PLUGIN_EFFECT;
type |= configured ? CONFIGURED_EFFECT : 0;
OnStop();
SelectAllIfNone();
OnEffect(type, pluginID);
}
void AudacityProject::OnRepeatLastEffect(int WXUNUSED(index))
{
if (mLastEffect != NULL) {
if (!mLastEffect.empty()) {
// Setting the CONFIGURED_EFFECT bit prevents
// prompting for parameters.
OnEffect(mLastEffectType | CONFIGURED_EFFECT, mLastEffect);
}
}
#ifdef EFFECT_CATEGORIES
void AudacityProject::OnProcessAny(int index)
{
Effect* e = EffectManager::Get().GetEffect(index);
OnEffect(ALL_EFFECTS, e);
}
void AudacityProject::OnProcessEffect(int index)
{
int additionalEffects=ADVANCED_EFFECT;
OnEffect(BUILTIN_EFFECT | PROCESS_EFFECT | additionalEffects, index);
}
#endif
void AudacityProject::OnStereoToMono(int WXUNUSED(index))
{
@ -2798,21 +2937,6 @@ void AudacityProject::OnStereoToMono(int WXUNUSED(index))
EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono")));
}
void AudacityProject::OnProcessPlugin(int index)
{
OnEffect(PLUGIN_EFFECT | PROCESS_EFFECT, index);
}
void AudacityProject::OnAnalyzeEffect(int index)
{
OnEffect(BUILTIN_EFFECT | ANALYZE_EFFECT, index);
}
void AudacityProject::OnAnalyzePlugin(int index)
{
OnEffect(PLUGIN_EFFECT | ANALYZE_EFFECT, index);
}
//
// File Menu
//

View File

@ -343,16 +343,13 @@ void OnEditLabels();
// Effect Menu
bool OnEffect(int type, Effect * f, wxString params = wxEmptyString, bool saveState = true);
void OnEffect(int type, int index);
void OnGenerateEffect(int index);
void OnGeneratePlugin(int index);
bool OnEffect(int type, const PluginID & ID, wxString params = wxEmptyString, bool saveState = true);
void OnEffect(const PluginID & pluginID);
void OnEffect(const PluginID & pluginID, bool configured = false);
void OnRepeatLastEffect(int index);
#ifdef EFFECT_CATEGORIES
void OnProcessAny(int index);
void OnProcessEffect(int index);
void OnProcessPlugin(int index);
void OnAnalyzeEffect(int index);
void OnAnalyzePlugin(int index);
#endif
void OnApplyChain();
void OnEditChains();
void OnStereoToMono(int index);

609
src/ModuleManager.cpp Normal file
View File

@ -0,0 +1,609 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ModuleManager.cpp
Dominic Mazzoni
James Crook
*******************************************************************//*!
\file ModuleManager.cpp
\brief Based on LoadLadspa, this code loads pluggable Audacity
extension modules. It also has the code to (a) invoke a script
server and (b) invoke a function returning a replacement window,
i.e. an alternative to the usual interface, for Audacity.
*//*******************************************************************/
#include <wx/dynlib.h>
#include <wx/list.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <wx/string.h>
#include <wx/filename.h>
#include "Audacity.h"
#include "AudacityApp.h"
#include "FileNames.h"
#include "Internat.h"
#include "PluginManager.h"
#include "commands/ScriptCommandRelay.h"
#include <NonGuiThread.h> // header from libwidgetextra
#include "audacity/PluginInterface.h"
#ifdef EXPERIMENTAL_MODULE_PREFS
#include "Prefs.h"
#include "./prefs/ModulePrefs.h"
#endif
#include "ModuleManager.h"
#include "widgets/MultiDialog.h"
#define initFnName "ExtensionModuleInit"
#define versionFnName "GetVersionString"
#define scriptFnName "RegScriptServerFunc"
#define mainPanelFnName "MainPanelFunc"
typedef wxWindow * pwxWindow;
typedef int (*tModuleInit)(int);
//typedef wxString (*tVersionFn)();
typedef wxChar * (*tVersionFn)();
typedef pwxWindow (*tPanelFn)(int);
// This variable will hold the address of a subroutine in
// a DLL that can hijack the normal panel.
static tPanelFn pPanelHijack=NULL;
// Next two commented out lines are handy when investigating
// strange DLL behaviour. Instead of dynamic linking,
// link the library which has the replacement panel statically.
// Give the address of the routine here.
// This is a great help in identifying missing
// symbols which otherwise cause a dll to unload after loading
// without an explanation as to why!
//extern wxWindow * MainPanelFunc( int i );
//tPanelFn pPanelHijack=&MainPanelFunc;
/// IF pPanelHijack has been found in a module DLL
/// THEN when this function is called we'll go and
/// create that window instead of the normal one.
wxWindow * MakeHijackPanel()
{
if( pPanelHijack == NULL )
return NULL;
return pPanelHijack(0);
}
// This variable will hold the address of a subroutine in a DLL that
// starts a thread and reads script commands.
static tpRegScriptServerFunc scriptFn;
Module::Module(const wxString & name)
{
mName = name;
mLib = new wxDynamicLibrary();
mDispatch = NULL;
}
Module::~Module()
{
delete mLib;
}
bool Module::Load()
{
if (mLib->IsLoaded()) {
if (mDispatch) {
return true;
}
return false;
}
if (!mLib->Load(mName, wxDL_LAZY)) {
return false;
}
// Check version string matches. (For now, they must match exactly)
tVersionFn versionFn = (tVersionFn)(mLib->GetSymbol(wxT(versionFnName)));
if (versionFn == NULL){
wxString ShortName = wxFileName( mName ).GetName();
wxMessageBox(wxString::Format(_("The module %s does not provide a version string.\nIt will not be loaded."), ShortName.c_str()), _("Module Unsuitable"));
wxLogMessage(wxString::Format(_("The module %s does not provide a version string. It will not be loaded."), mName.c_str()));
mLib->Unload();
return false;
}
wxString moduleVersion = versionFn();
if( !moduleVersion.IsSameAs(AUDACITY_VERSION_STRING)) {
wxString ShortName = wxFileName( mName ).GetName();
wxMessageBox(wxString::Format(_("The module %s is matched with Audacity version %s.\n\nIt will not be loaded."), ShortName.c_str(), moduleVersion.c_str()), _("Module Unsuitable"));
wxLogMessage(wxString::Format(_("The module %s is matched with Audacity version %s. It will not be loaded."), mName.c_str(), moduleVersion.c_str()));
mLib->Unload();
return false;
}
mDispatch = (fnModuleDispatch) mLib->GetSymbol(wxT(ModuleDispatchName));
if (!mDispatch) {
// Module does not provide a dispatch function...
// That can be OK, as long as we never try to call it.
return true;
}
// However if we do have it and it does not work,
// then the module is bad.
bool res = ((mDispatch(ModuleInitialize))!=0);
if (res) {
return true;
}
mDispatch = NULL;
return false;
}
void Module::Unload()
{
if (mLib->IsLoaded()) {
mDispatch(ModuleTerminate);
}
mLib->Unload();
}
int Module::Dispatch(ModuleDispatchTypes type)
{
if (mLib->IsLoaded())
if( mDispatch != NULL )
return mDispatch(type);
return 0;
}
void * Module::GetSymbol(wxString name)
{
return mLib->GetSymbol(name);
}
// ============================================================================
//
// ModuleManager
//
// ============================================================================
// The one and only ModuleManager
ModuleManager ModuleManager::mInstance;
// Provide builtin modules a means to identify themselves
static wxArrayPtrVoid *Builtins = NULL;
void RegisterBuiltinModule(ModuleMain moduleMain)
{
static bool allocated = false;
if (!allocated)
{
Builtins = new wxArrayPtrVoid;
allocated = true;
}
Builtins->Add((void *)moduleMain);
return;
}
// ----------------------------------------------------------------------------
// Creation/Destruction
// ----------------------------------------------------------------------------
ModuleManager::ModuleManager()
{
}
ModuleManager::~ModuleManager()
{
size_t cnt = mModules.GetCount();
for (size_t ndx = 0; ndx < cnt; ndx++) {
delete (Module *) mModules[ndx];
}
mModules.Clear();
for (ModuleMap::iterator iter = mDynModules.begin(); iter != mDynModules.end(); iter++)
{
ModuleInterface *mod = iter->second;
delete mod;
}
mDynModules.clear();
}
// static
void ModuleManager::Initialize(CommandHandler &cmdHandler)
{
wxArrayString audacityPathList = wxGetApp().audacityPathList;
wxArrayString pathList;
wxArrayString files;
wxString pathVar;
size_t i;
// Code from LoadLadspa that might be useful in load modules.
pathVar = wxGetenv(wxT("AUDACITY_MODULES_PATH"));
if (pathVar != wxT(""))
wxGetApp().AddMultiPathsToPathList(pathVar, pathList);
for (i = 0; i < audacityPathList.GetCount(); i++) {
wxString prefix = audacityPathList[i] + wxFILE_SEP_PATH;
wxGetApp().AddUniquePathToPathList(prefix + wxT("modules"),
pathList);
}
#if defined(__WXMSW__)
wxGetApp().FindFilesInPathList(wxT("*.dll"), pathList, files);
#else
wxGetApp().FindFilesInPathList(wxT("*.so"), pathList, files);
#endif
for (i = 0; i < files.GetCount(); i++) {
// As a courtesy to some modules that might be bridges to
// open other modules, we set the current working
// directory to be the module's directory.
wxString saveOldCWD = ::wxGetCwd();
wxString prefix = ::wxPathOnly(files[i]);
::wxSetWorkingDirectory(prefix);
#ifdef EXPERIMENTAL_MODULE_PREFS
int iModuleStatus = ModulePrefs::GetModuleStatus( files[i] );
if( iModuleStatus == kModuleDisabled )
continue;
if( iModuleStatus == kModuleFailed )
continue;
// New module? You have to go and explicitly enable it.
if( iModuleStatus == kModuleNew ){
// To ensure it is noted in config file and so
// appears on modules page.
ModulePrefs::SetModuleStatus( files[i], kModuleNew);
continue;
}
if( iModuleStatus == kModuleAsk )
#endif
// JKC: I don't like prompting for the plug-ins individually
// I think it would be better to show the module prefs page,
// and let the user decide for each one.
{
wxString ShortName = wxFileName( files[i] ).GetName();
wxString msg;
msg.Printf(_("Module \"%s\" found."), ShortName.c_str());
msg += _("\n\nOnly use modules from trusted sources");
const wxChar *buttons[] = {_("Yes"), _("No"), NULL}; // could add a button here for 'yes and remember that', and put it into the cfg file. Needs more thought.
int action;
action = ShowMultiDialog(msg, _("Audacity Module Loader"), buttons, _("Try and load this module?"), false);
#ifdef EXPERIMENTAL_MODULE_PREFS
// If we're not prompting always, accept the answer permanantly
if( iModuleStatus == kModuleNew ){
iModuleStatus = (action==1)?kModuleDisabled : kModuleEnabled;
ModulePrefs::SetModuleStatus( files[i], iModuleStatus );
}
#endif
if(action == 1){ // "No"
continue;
}
}
#ifdef EXPERIMENTAL_MODULE_PREFS
// Before attempting to load, we set the state to bad.
// That way, if we crash, we won't try again.
ModulePrefs::SetModuleStatus( files[i], kModuleFailed );
#endif
Module *module = new Module(files[i]);
if (module->Load()) // it will get rejected if there are version problems
{
Get().mModules.Add(module);
// We've loaded and initialised OK.
// So look for special case functions:
wxLogNull logNo; // Don't show wxWidgets errors if we can't do these. (Was: Fix bug 544.)
// (a) for scripting.
if( scriptFn == NULL )
scriptFn = (tpRegScriptServerFunc)(module->GetSymbol(wxT(scriptFnName)));
// (b) for hijacking the entire Audacity panel.
if( pPanelHijack==NULL )
{
pPanelHijack = (tPanelFn)(module->GetSymbol(wxT(mainPanelFnName)));
}
#ifdef EXPERIMENTAL_MODULE_PREFS
// Loaded successfully, restore the status.
ModulePrefs::SetModuleStatus( files[i], iModuleStatus);
#endif
}
else {
// No need to save status, as we already set kModuleFailed.
delete module;
}
::wxSetWorkingDirectory(saveOldCWD);
}
// After loading all the modules, we may have a registered scripting function.
if(scriptFn)
{
ScriptCommandRelay::SetCommandHandler(cmdHandler);
ScriptCommandRelay::SetRegScriptServerFunc(scriptFn);
NonGuiThread::StartChild(&ScriptCommandRelay::Run);
}
}
// static
int ModuleManager::Dispatch(ModuleDispatchTypes type)
{
size_t cnt = Get().mModules.GetCount();
for (size_t ndx = 0; ndx < cnt; ndx++) {
Module *module = (Module *)Get().mModules[ndx];
module->Dispatch(type);
}
return 0;
}
// ============================================================================
//
// Return reference to singleton
//
// (Thread-safe...no active threading during construction or after destruction)
// ============================================================================
ModuleManager & ModuleManager::Get()
{
return mInstance;
}
void ModuleManager::InitializeBuiltins()
{
PluginManager & pm = PluginManager::Get();
if (!Builtins)
{
return;
}
for (size_t i = 0, cnt = Builtins->GetCount(); i < cnt; i++)
{
ModuleMain audacityMain = (ModuleMain) (*Builtins)[i];
ModuleInterface *module = audacityMain(this, NULL);
mDynModules[module->GetID()] = module;
module->Initialize();
// First, we need to remember it
pm.RegisterModulePlugin(module);
// Now, allow the module to auto-register children
module->AutoRegisterPlugins(pm);
}
}
// static
void ModuleManager::EarlyInit()
{
InitializeBuiltins();
}
bool ModuleManager::DiscoverProviders(wxArrayString & providers)
{
wxArrayString provList;
wxArrayString pathList;
// Code from LoadLadspa that might be useful in load modules.
wxString pathVar = wxString::FromUTF8(getenv("AUDACITY_MODULES_PATH"));
if (pathVar != wxT(""))
{
wxGetApp().AddMultiPathsToPathList(pathVar, pathList);
}
else
{
wxGetApp().AddUniquePathToPathList(FileNames::ModulesDir(), pathList);
}
#if defined(__WXMSW__)
wxGetApp().FindFilesInPathList(wxT("*.dll"), pathList, provList);
#elif defined(__WXMAC__)
wxGetApp().FindFilesInPathList(wxT("*.dylib"), pathList, provList);
#else
wxGetApp().FindFilesInPathList(wxT("*.so"), pathList, provList);
#endif
for (int i = 0, cnt = provList.GetCount(); i < cnt; i++)
{
wxPrintf(wxT("provider %s\n"), provList[i].c_str());
providers.push_back(provList[i]);
}
return true;
}
bool ModuleManager::DiscoverProvider(const wxString & path)
{
ModuleInterface *module = LoadModule(path);
if (module)
{
PluginManager & pm = PluginManager::Get();
// First, we need to remember it
pm.RegisterModulePlugin(module);
// Now, allow the module to auto-register children
module->AutoRegisterPlugins(pm);
// UnloadModule(module);
}
return true;
}
ModuleInterface *ModuleManager::LoadModule(const wxString & path)
{
wxDynamicLibrary *lib = new wxDynamicLibrary();
if (lib->Load(path, wxDL_NOW))
{
bool success = false;
ModuleMain audacityMain = (ModuleMain) lib->GetSymbol(wxSTRINGIZE_T(MODULE_ENTRY),
&success);
if (success && audacityMain)
{
ModuleInterface *module = audacityMain(this, &path);
if (module)
{
if (module->Initialize())
{
mDynModules[module->GetID()] = module;
mLibs[module] = lib;
return module;
}
module->Terminate();
delete module;
}
}
lib->Unload();
}
delete lib;
return NULL;
}
void ModuleManager::UnloadModule(ModuleInterface *module)
{
if (module)
{
const PluginID & modID = module->GetID();
module->Terminate();
delete module;
mDynModules.erase(modID);
if (mLibs.find(module) != mLibs.end())
{
mLibs[module]->Unload();
mLibs.erase(module);
}
}
}
void ModuleManager::InitializePlugins()
{
InitializeBuiltins();
// Look for dynamic modules here
for (ModuleMap::iterator iter = mDynModules.begin(); iter != mDynModules.end(); iter++)
{
ModuleInterface *mod = iter->second;
mod->Initialize();
}
}
void ModuleManager::RegisterModule(ModuleInterface *module)
{
wxString id = module->GetID();
if (mDynModules.find(id) != mDynModules.end())
{
// TODO: Should we complain about a duplicate registeration????
return;
}
mDynModules[id] = module;
PluginManager::Get().RegisterModulePlugin(module);
}
void ModuleManager::FindAllPlugins(PluginIDList & providers, wxArrayString & paths)
{
PluginManager & pm = PluginManager::Get();
wxArrayString modIDs;
wxArrayString modPaths;
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeModule);
while (plug)
{
modIDs.push_back(plug->GetID());
modPaths.push_back(plug->GetPath());
plug = pm.GetNextPlugin(PluginTypeModule);
}
for (size_t i = 0, cnt = modIDs.size(); i < cnt; i++)
{
PluginID providerID = modIDs[i];
ModuleInterface *module =
static_cast<ModuleInterface *>(CreateProviderInstance(providerID, modPaths[i]));
wxArrayString newpaths = module->FindPlugins(pm);
for (size_t i = 0, cnt = newpaths.size(); i < cnt; i++)
{
providers.push_back(providerID);
paths.push_back(newpaths[i]);
}
}
}
wxArrayString ModuleManager::FindPluginsForProvider(const PluginID & providerID,
const wxString & path)
{
// Instantiate if it hasn't already been done
if (mDynModules.find(providerID) == mDynModules.end())
{
// If it couldn't be created, just give up and return an empty list
if (!CreateProviderInstance(providerID, path))
{
return wxArrayString();
}
}
return mDynModules[providerID]->FindPlugins(PluginManager::Get());
}
bool ModuleManager::RegisterPlugin(const PluginID & providerID, const wxString & path)
{
if (mDynModules.find(providerID) == mDynModules.end())
{
return false;
}
return mDynModules[providerID]->RegisterPlugin(PluginManager::Get(), path);
}
bool ModuleManager::IsProviderBuiltin(const PluginID & providerID)
{
return mModuleMains.find(providerID) != mModuleMains.end();
}
void *ModuleManager::CreateProviderInstance(const PluginID & providerID,
const wxString & path)
{
if (path.empty() && mDynModules.find(providerID) != mDynModules.end())
{
return mDynModules[providerID];
}
return LoadModule(path);
}
void *ModuleManager::CreateInstance(const PluginID & providerID,
const PluginID & ID,
const wxString & path)
{
if (mDynModules.find(providerID) == mDynModules.end())
{
return NULL;
}
return mDynModules[providerID]->CreateInstance(ID, path);
}

118
src/ModuleManager.h Normal file
View File

@ -0,0 +1,118 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ModuleManager.h
Dominic Mazzoni
James Crook
**********************************************************************/
#ifndef __AUDACITY_MODULEMANAGER_H__
#define __AUDACITY_MODULEMANAGER_H__
#include <wx/dynlib.h>
#include <map>
#include <vector>
#include "audacity/ModuleInterface.h"
class CommandHandler;
wxWindow * MakeHijackPanel();
//
// Module Manager
//
// wxPluginManager would be MUCH better, but it's an "undocumented" framework.
//
#define ModuleDispatchName "ModuleDispatch"
typedef enum
{
ModuleInitialize,
ModuleTerminate,
AppInitialized,
AppQuiting,
ProjectInitialized,
ProjectClosing,
MenusRebuilt
} ModuleDispatchTypes;
typedef int (*fnModuleDispatch)(ModuleDispatchTypes type);
class Module
{
public:
Module(const wxString & name);
virtual ~Module();
bool Load();
void Unload();
int Dispatch(ModuleDispatchTypes type);
void * GetSymbol(wxString name);
private:
wxString mName;
wxDynamicLibrary *mLib;
fnModuleDispatch mDispatch;
};
typedef std::map<wxString, ModuleMain *> ModuleMainMap;
typedef std::map<wxString, ModuleInterface *> ModuleMap;
typedef std::map<ModuleInterface *, wxDynamicLibrary *> LibraryMap;
class ModuleManager : public ModuleManagerInterface
{
public:
ModuleManager();
virtual ~ModuleManager();
// -------------------------------------------------------------------------
// ModuleManagerInterface implementation
// -------------------------------------------------------------------------
virtual void RegisterModule(ModuleInterface *module);
// -------------------------------------------------------------------------
// ModuleManager implementation
// -------------------------------------------------------------------------
static ModuleManager & Get();
void Initialize(CommandHandler & cmdHandler);
int Dispatch(ModuleDispatchTypes type);
void EarlyInit();
// PluginManager use
bool DiscoverProviders(wxArrayString & providers);
bool DiscoverProvider(const wxString & path);
void FindAllPlugins(PluginIDList & providers, wxArrayString & paths);
wxArrayString FindPluginsForProvider(const PluginID & provider, const wxString & path);
bool RegisterPlugin(const PluginID & provider, const wxString & path);
void InitializePlugins();
bool IsProviderBuiltin(const PluginID & provider);
void *CreateProviderInstance(const PluginID & ID, const wxString & path);
void *CreateInstance(const PluginID & provider, const PluginID & ID, const wxString & path);
private:
void InitializeBuiltins();
ModuleInterface *LoadModule(const wxString & path);
void UnloadModule(ModuleInterface *module);
private:
static ModuleManager mInstance;
ModuleMainMap mModuleMains;
ModuleMap mDynModules;
LibraryMap mLibs;
wxArrayPtrVoid mModules;
};
#endif /* __AUDACITY_MODULEMANAGER_H__ */

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,13 @@
#include <wx/fileconf.h>
#include <wx/string.h>
#include <map>
#include "audacity/EffectInterface.h"
#include "audacity/ImporterInterface.h"
#include "audacity/ModuleInterface.h"
#include "audacity/PluginInterface.h"
///////////////////////////////////////////////////////////////////////////////
//
// PluginManager
@ -24,50 +31,238 @@
typedef enum
{
PluginTypeAll,
PluginTypeVST,
PluginTypeLadspa
PluginTypeNone,
PluginTypeEffect,
PluginTypeExporter,
PluginTypeImporter,
PluginTypeModule,
} PluginType;
class PluginManager
// TODO: Convert this to multiple derived classes
class PluginDescriptor
{
public:
public:
PluginDescriptor();
virtual ~PluginDescriptor();
void *GetInstance();
void SetInstance(void *instance);
PluginType GetPluginType() const;
void SetPluginType(PluginType type);
// All plugins
const wxString & GetID() const;
const wxString & GetPath() const;
const wxString & GetName() const;
const wxString & GetVersion() const;
const wxString & GetVendor() const;
const wxString & GetDescription() const;
const wxString & GetProviderID() const;
const wxString & GetDateTime() const;
bool IsEnabled() const;
void SetID(const PluginID & ID);
void SetPath(const wxString & path);
void SetName(const wxString & name);
void SetVersion(const wxString & version);
void SetVendor(const wxString & vendor);
void SetDescription(const wxString & description);
void SetProviderID(const PluginID & providerID);
void SetDateTime(const wxString & dateTime);
void SetEnabled(bool enable);
wxString GetMenuName() const;
// Effect plugins only
EffectType GetEffectType() const;
const wxString & GetEffectFamily() const;
bool IsEffectDefault() const;
bool IsEffectInteractive() const;
bool IsEffectLegacy() const;
bool IsEffectRealtimeCapable() const;
void SetEffectType(EffectType type);
void SetEffectFamily(const wxString & family);
void SetEffectDefault(bool dflt);
void SetEffectInteractive(bool interactive);
void SetEffectLegacy(bool legacy);
void SetEffectRealtimeCapable(bool realtime);
// Importer plugins only
const wxString & GetImporterIdentifier() const;
const wxString & GetImporterFilterDescription() const;
const wxArrayString & GetImporterExtensions() const;
void SetImporterIdentifier(const wxString & identifier);
void SetImporterFilterDescription(const wxString & filterDesc);
void SetImporterExtensions(const wxArrayString & extensions);
private:
// Common
void *mInstance;
PluginType mPluginType;
wxString mID;
wxString mPath;
wxString mName;
wxString mVersion;
wxString mVendor;
wxString mDescription;
wxString mProviderID;
wxString mDateTime;
bool mEnabled;
// Effects
wxString mEffectFamily;
EffectType mEffectType;
bool mEffectInteractive;
bool mEffectDefault;
bool mEffectLegacy;
bool mEffectRealtimeCapable;
// Importers
wxString mImporterIdentifier;
wxString mImporterFilterDesc;
wxArrayString mImporterExtensions;
};
//WX_DECLARE_STRING_HASH_MAP(PluginDescriptor, PluginMap);
typedef std::map<PluginID, PluginDescriptor> PluginMap;
typedef wxArrayString PluginIDList;
class PluginManager : public PluginManagerInterface
{
public:
PluginManager();
virtual ~PluginManager();
void Open();
void Close();
// PluginManagerInterface implementation
static PluginManager & Get(bool refresh = false);
void RegisterModulePlugin(IdentInterface *module);
void RegisterEffectPlugin(IdentInterface *provider, EffectIdentInterface *effect);
void RegisterImporterPlugin(IdentInterface *provider, ImporterInterface *importer);
wxString Read(const wxString & key, const wxString & def);
long Read(const wxString & key, long def);
void FindFilesInPathList(const wxString & pattern,
const wxArrayString & pathList,
wxArrayString & files,
bool directories = false);
void Write(const wxString & key, const wxString & val);
void Write(const wxString & key, long val);
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval = _T(""));
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval = 0);
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval = false);
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval = 0.0);
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval = 0.0);
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, sampleCount & value, sampleCount defval = 0);
bool HasType(const wxString & type);
void PurgeType(const wxString & type);
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value);
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value);
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value);
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value);
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value);
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const sampleCount & value);
int GetPluginCount(const wxString & type);
wxString GetPlugin(const wxString & type, int index);
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval = _T(""));
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval = 0);
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval = false);
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval = 0.0);
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval = 0.0);
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, sampleCount & value, sampleCount defval = 0);
wxString GetFirstPlugin(const wxString & type);
wxString GetNextPlugin(const wxString & type);
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value);
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value);
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value);
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value);
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value);
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const sampleCount & value);
bool IsRegistered(const wxString & type, const wxString & path);
// PluginManager implementation
void Initialize();
void Terminate();
static PluginManager & Get();
bool HasType(PluginType type);
void PurgeType(PluginType type);
int GetPluginCount(PluginType type);
const PluginDescriptor *GetPlugin(const PluginID & ID);
const PluginDescriptor *GetFirstPlugin(PluginType type);
const PluginDescriptor *GetNextPlugin(PluginType type);
const PluginDescriptor *GetFirstPluginForProvider(const PluginID & ID);
const PluginDescriptor *GetNextPluginForProvider(const PluginID & ID);
const PluginDescriptor *GetFirstPluginForEffectType(EffectType type);
const PluginDescriptor *GetNextPluginForEffectType(EffectType type);
const PluginDescriptor *GetFirstPluginForEffectFamily(const PluginID & ID);
const PluginDescriptor *GetNextPluginForEffectFamily(const PluginID & ID);
bool IsRegistered(const PluginID & ID);
void RegisterPlugin(const wxString & type, const wxString & path);
bool IsPluginEnabled(const wxString & type, const wxString & path);
void EnablePlugin(const wxString & type, const wxString & path, bool enable);
bool IsPluginEnabled(const PluginID & ID);
void EnablePlugin(const PluginID & ID, bool enable);
const wxString & GetName(const PluginID & ID);
void *GetInstance(const PluginID & ID);
void SetInstance(const PluginID & ID, void *instance); // TODO: Remove after conversion
//
const PluginID & RegisterLegacyEffectPlugin(EffectIdentInterface *effect);
void CheckForUpdates();
private:
void Load();
void LoadGroup(const wxChar *group, PluginType type);
void Save();
void SaveGroup(const wxChar *group, PluginType type);
void RemoveMissing();
wxArrayString IsNewOrUpdated(const wxArrayString & paths);
PluginDescriptor & CreatePlugin(IdentInterface *ident, PluginType type);
wxString GetDateTime(const wxString & path);
bool GetConfig(const wxString & key, wxString & value, const wxString & defval = L"");
bool GetConfig(const wxString & key, int & value, int defval = 0);
bool GetConfig(const wxString & key, bool & value, bool defval = false);
bool GetConfig(const wxString & key, float & value, float defval = 0.0);
bool GetConfig(const wxString & key, double & value, double defval = 0.0);
bool GetConfig(const wxString & key, sampleCount & value, sampleCount defval = 0);
bool SetConfig(const wxString & key, const wxString & value);
bool SetConfig(const wxString & key, const int & value);
bool SetConfig(const wxString & key, const bool & value);
bool SetConfig(const wxString & key, const float & value);
bool SetConfig(const wxString & key, const double & value);
bool SetConfig(const wxString & key, const sampleCount & value);
wxString SharedKey(const PluginID & ID, const wxString & group, const wxString & key);
wxString PrivateKey(const PluginID & ID, const wxString & group, const wxString & key);
private:
static PluginManager mInstance;
bool IsDirty();
void SetDirty(bool dirty = true);
wxFileConfig *mConfig;
bool mDirty;
int mCurrentIndex;
PluginMap mPlugins;
PluginMap::iterator mPluginsIter;
};
#endif /* __AUDACITY_LOADMODULES_H__ */
#endif /* __AUDACITY_PLUGINMANAGER_H__ */

View File

@ -134,7 +134,7 @@ scroll information. It also has some status flags.
#ifdef EXPERIMENTAL_OD_FLAC
#include "ondemand/ODDecodeFlacTask.h"
#endif
#include "LoadModules.h"
#include "ModuleManager.h"
#include "Theme.h"
#include "AllThemeResources.h"
@ -509,7 +509,7 @@ AudacityProject *CreateNewAudacityProject()
// and add the shortcut keys to the tooltips.
p->GetControlToolBar()->RegenerateToolsTooltips();
ModuleManager::Dispatch(ProjectInitialized);
ModuleManager::Get().Dispatch(ProjectInitialized);
p->Show(true);
@ -765,7 +765,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
mRecordingRecoveryHandler(NULL),
mImportedDependencies(false),
mWantSaveCompressed(false),
mLastEffect(NULL),
mLastEffect(wxEmptyString),
mLastEffectType(0),
mTimerRecordCanceled(false),
mMenuClose(false)
@ -1960,7 +1960,7 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event)
}
}
ModuleManager::Dispatch(ProjectClosing);
ModuleManager::Get().Dispatch(ProjectClosing);
// Stop the timer since there's no need to update anything anymore
delete mTimer;
@ -2152,7 +2152,7 @@ wxArrayString AudacityProject::ShowOpenDialog(wxString extraformat, wxString ext
// Construct the filter
l.DeleteContents(true);
wxGetApp().mImporter->GetSupportedImportFormats(&l);
Importer::Get().GetSupportedImportFormats(&l);
for (FormatList::compatibility_iterator n = l.GetFirst(); n; n = n->GetNext()) {
/* this loop runs once per supported _format_ */
@ -2160,7 +2160,7 @@ wxArrayString AudacityProject::ShowOpenDialog(wxString extraformat, wxString ext
wxString newfilter = f->formatName + wxT("|");
// bung format name into string plus | separator
for (size_t i = 0; i < f->formatExtensions.GetCount(); i++) {
for (size_t i = 0; i < f->formatExtensions.size(); i++) {
/* this loop runs once per valid _file extension_ for file containing
* the current _format_ */
if (!newfilter.Contains(wxT("*.") + f->formatExtensions[i] + wxT(";")))
@ -3521,7 +3521,7 @@ bool AudacityProject::Import(wxString fileName, WaveTrackArray* pTrackArray /*=
int numTracks;
wxString errorMessage=wxT("");
numTracks = wxGetApp().mImporter->Import(fileName,
numTracks = Importer::Get().Import(fileName,
mTrackFactory,
&newTracks,
mTags,

View File

@ -563,7 +563,7 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
wxArrayString mStrOtherNamesArray; // used to make sure compressed file names are unique
// Last effect applied to this project
Effect *mLastEffect;
PluginID mLastEffect;
int mLastEffectType;
// The screenshot class needs to access internals
@ -577,13 +577,13 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
// Are we currently closing as the result of a menu command?
bool mMenuClose;
public:
DECLARE_EVENT_TABLE()
};
typedef void (AudacityProject::*audCommandFunction)();
typedef void (AudacityProject::*audCommandKeyFunction)(const wxEvent *);
typedef void (AudacityProject::*audCommandListFunction)(int);
typedef void (AudacityProject::*audCommandPluginFunction)(const PluginID &);
// Previously this was in menus.cpp, and the declaration of the
// command functor was not visible anywhere else.
@ -596,16 +596,27 @@ public:
audCommandKeyFunction commandFunction);
AudacityProjectCommandFunctor(AudacityProject *project,
audCommandListFunction commandFunction);
AudacityProjectCommandFunctor(AudacityProject *project,
audCommandPluginFunction commandFunction,
const PluginID & pluginID);
#if defined(EFFECT_CATEGORIES)
AudacityProjectCommandFunctor(AudacityProject *project,
audCommandListFunction commandFunction,
wxArrayInt explicitIndices);
#endif
virtual void operator()(int index = 0, const wxEvent *evt = NULL);
private:
AudacityProject *mProject;
audCommandFunction mCommandFunction;
audCommandKeyFunction mCommandKeyFunction;
audCommandListFunction mCommandListFunction;
audCommandPluginFunction mCommandPluginFunction;
PluginID mPluginID;
#if defined(EFFECT_CATEGORIES)
wxArrayInt mExplicitIndices;
#endif
};
#endif

View File

@ -14,30 +14,34 @@
#include "Audacity.h"
#include <wx/defs.h>
#include "audacity/Types.h"
//
// Definitions / Meta-Information
//
#if 0
// Moved to audacity/types.h
typedef enum {
int16Sample = 0x00020001,
int24Sample = 0x00040001,
floatSample = 0x0004000F
} sampleFormat;
/** \brief Return the size (in memory) of one sample (bytes) */
#define SAMPLE_SIZE(SampleFormat) (SampleFormat >> 16)
#endif
// Used to determine how to fill in empty areas of audio.
typedef enum {
fillZero = 0,
fillTwo = 2
}fillFormat;
/** \brief Return the size (in memory) of one sample (bytes) */
#define SAMPLE_SIZE(SampleFormat) (SampleFormat >> 16)
/** \brief Return the size on disk of one uncompressed sample (bytes) */
#define SAMPLE_SIZE_DISK(SampleFormat) ((SampleFormat == int24Sample) ? \
3 : SAMPLE_SIZE(SampleFormat) )
typedef char *samplePtr;
const wxChar *GetSampleFormatStr(sampleFormat format);
//

View File

@ -19,8 +19,13 @@
#include "xml/XMLWriter.h"
#include "ondemand/ODTaskThread.h"
#include "audacity/Types.h"
#if 0
// Moved to "audacity/types.h"
typedef wxLongLong_t sampleCount; /** < A native 64-bit integer type, because
32-bit integers may not be enough */
#endif
class BlockFile;
class DirManager;

View File

@ -2170,6 +2170,12 @@ wxSizer *CreateStdButtonSizer(wxWindow *parent, long buttons, wxButton *extra)
bs->AddButton( new wxButton( parent, wxID_NO ) );
}
if( buttons & eApplyButton )
{
b = new wxButton( parent, wxID_APPLY );
bs->AddButton( b );
}
if( buttons & eHelpButton )
{
bs->AddButton( new wxButton( parent, wxID_HELP ) );
@ -2187,7 +2193,7 @@ wxSizer *CreateStdButtonSizer(wxWindow *parent, long buttons, wxButton *extra)
if( buttons & eDefaultsButton )
{
bs->Add(new wxButton( parent, eDefaultsID, _("&Defaults") ) );
bs->Add(new wxButton( parent, eDefaultsID, _("&Defaults") ), 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
bs->Add( 20, 0 );
}

View File

@ -335,7 +335,8 @@ enum
ePreviewButton = 0x0020,
eDebugButton = 0x0040,
eDefaultsButton= 0x0080,
ePreviewDryButton = 0x0100
ePreviewDryButton = 0x0100,
eApplyButton = 0x0200,
};
enum

File diff suppressed because it is too large Load Diff

View File

@ -91,6 +91,7 @@ CommandManager. It holds the callback for one command.
#include "CommandManager.h"
#include "Keyboard.h"
#include "../PluginManager.h"
#include "../effects/EffectManager.h"
// On wxGTK, there may be many many many plugins, but the menus don't automatically
@ -1072,7 +1073,8 @@ bool CommandManager::HandleTextualCommand(wxString & Str, wxUint32 flags, wxUint
unsigned int i;
// Linear search for now...
for(i=0; i<mCommandList.GetCount(); i++) {
for (i = 0; i < mCommandList.GetCount(); i++)
{
if (!mCommandList[i]->multi)
{
if( Str.IsSameAs( mCommandList[i]->name ))
@ -1086,23 +1088,23 @@ bool CommandManager::HandleTextualCommand(wxString & Str, wxUint32 flags, wxUint
// instead we only try the effects.
AudacityProject * proj = GetActiveProject();
if( !proj )
{
return false;
bool result = false;
int effectFlags = ALL_EFFECTS | CONFIGURED_EFFECT;
EffectArray *effects = EffectManager::Get().GetEffects(effectFlags);
if (effects) {
for(i=0; i<effects->GetCount(); i++) {
wxString effectName = (*effects)[i]->GetEffectName();
if( Str.IsSameAs( effectName ))
{
result = proj->OnEffect( effectFlags, (*effects)[i] );
break;
}
}
delete effects;
}
return result;
PluginManager & pm = PluginManager::Get();
EffectManager & em = EffectManager::Get();
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect);
while (plug)
{
if (em.GetEffectName(plug->GetID()).IsSameAs(Str))
{
return proj->OnEffect( ALL_EFFECTS | CONFIGURED_EFFECT, plug->GetID());
}
plug = pm.GetNextPlugin(PluginTypeEffect);
}
return false;
}
void CommandManager::GetCategories(wxArrayString &cats)

View File

@ -20,6 +20,8 @@
#include "../AudacityApp.h"
#include "../xml/XMLTagHandler.h"
#include "audacity/Types.h"
class AUDACITY_DLL_API CommandFunctor
{
public:

View File

@ -15,7 +15,7 @@
\class ScriptCommandRelay
\brief ScriptCommandRelay is just a way to move some of the scripting-specific
code out of LoadModules.
code out of ModuleManager.
*//*******************************************************************/

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,9 @@
class wxDialog;
class wxWindow;
#include "audacity/ConfigInterface.h"
#include "audacity/EffectInterface.h"
#include "../Experimental.h"
#include "../WaveTrack.h"
#include "../Shuttle.h"
@ -59,7 +62,8 @@ class TimeWarper;
//and so can just drop the steps we don't want?
#define SKIP_EFFECT_MILLISECOND 99999
class AUDACITY_DLL_API Effect {
class AUDACITY_DLL_API Effect : public EffectHostInterface
{
//
// public methods
//
@ -67,10 +71,71 @@ class AUDACITY_DLL_API Effect {
// apply the effect to one or more tracks.
//
public:
// The constructor is called once by each subclass at the beginning of the program.
// Avoid allocating memory or doing time-consuming processing here.
Effect();
Effect(EffectClientInterface *client);
virtual ~Effect();
// IdentInterface implementation
virtual PluginID GetID();
virtual wxString GetPath();
virtual wxString GetName();
virtual wxString GetVendor();
virtual wxString GetVersion();
virtual wxString GetDescription();
// EffectIdentInterface implementation
virtual EffectType GetType();
virtual wxString GetFamily();
virtual bool IsInteractive();
virtual bool IsDefault();
virtual bool IsLegacy();
virtual bool IsRealtimeCapable();
// EffectHostInterface implementation
virtual bool Apply();
virtual void Preview();
// ConfigClientInterface implementation
virtual bool GetSharedConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval = wxEmptyString);
virtual bool GetSharedConfig(const wxString & group, const wxString & key, int & value, int defval = 0);
virtual bool GetSharedConfig(const wxString & group, const wxString & key, bool & value, bool defval = false);
virtual bool GetSharedConfig(const wxString & group, const wxString & key, float & value, float defval = 0.0);
virtual bool GetSharedConfig(const wxString & group, const wxString & key, double & value, double defval = 0.0);
virtual bool GetSharedConfig(const wxString & group, const wxString & key, sampleCount & value, sampleCount defval = 0);
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const wxString & value);
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const int & value);
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const bool & value);
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const float & value);
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const double & value);
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const sampleCount & value);
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval = wxEmptyString);
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, int & value, int defval = 0);
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, bool & value, bool defval = false);
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, float & value, float defval = 0.0);
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, double & value, double defval = 0.0);
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, sampleCount & value, sampleCount defval = 0);
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const wxString & value);
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const int & value);
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const bool & value);
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const float & value);
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const double & value);
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const sampleCount & value);
// Effect implementation
// Each subclass of Effect should override this method.
// This name will go in the menu bar;
// append "..." if your effect pops up a dialog
virtual wxString GetEffectName() = 0;
virtual wxString GetEffectName();
// Each subclass of Effect should override this method.
// This should return the category of this effect, which
@ -82,7 +147,7 @@ class AUDACITY_DLL_API Effect {
// Previously optional. Now required to identify effects for Chain support.
// Each subclass of Effect should override this method.
// This should be human-readable, but should NOT be translated. Use wxT(""), not _("").
virtual wxString GetEffectIdentifier() = 0;
virtual wxString GetEffectIdentifier();
// Each subclass of Effect should override this method.
// This name will go in the progress dialog, but can be used
@ -90,7 +155,7 @@ class AUDACITY_DLL_API Effect {
// For example, if the effect is "Filter", the action is
// "Filtering", or if the effect is "Bass Boost", the action
// is "Boosting Bass Frequencies".
virtual wxString GetEffectAction() = 0;
virtual wxString GetEffectAction();
// Each subclass of Effect should override this method.
// This description will go in the History state.
@ -133,7 +198,7 @@ class AUDACITY_DLL_API Effect {
// The Effect class fully implements the Preview method for you.
// Only override it if you need to do preprocessing or cleanup.
virtual void Preview(bool dryOnly = false);
virtual void Preview(bool dryOnly);
// Most effects just use the previewLength, but time-stretching/compressing
// effects need to use a different input length, so override this method.
@ -141,8 +206,13 @@ class AUDACITY_DLL_API Effect {
// Get an unique ID assigned to each registered effect.
// The first effect will have ID zero.
int GetID() {
return mID;
int GetEffectID() {
return mEffectID;
}
// Set an unique ID assigned to each registered effect.
void SetEffectID(int id) {
mEffectID = id;
}
// Returns true on success. Will only operate on tracks that
@ -163,6 +233,13 @@ class AUDACITY_DLL_API Effect {
// important for sorting.
static wxString StripAmpersand(const wxString& str);
// Realtime Effect Processing
bool RealtimeInitialize(int numChannels, float sampleRate);
bool RealtimeFinalize();
bool RealtimeSuspend();
bool RealtimeResume();
sampleCount RealtimeProcess(float **inbuf, float **outbuf, sampleCount size);
//
// protected virtual methods
//
@ -170,26 +247,18 @@ class AUDACITY_DLL_API Effect {
// do its processing.
//
protected:
// The constructor is called once by each subclass at the beginning of the program.
// Avoid allocating memory or doing time-consuming processing here.
Effect();
virtual ~Effect();
// Called once each time an effect is called. Perform any initialization;
// make sure that the effect can be performed on the selected tracks and
// return false otherwise
virtual bool Init() {
return true;
}
virtual bool Init();
// If necessary, open a dialog to get parameters from the user.
// This method will not always be called (for example if a user
// repeats an effect) but if it is called, it will be called
// after Init.
virtual bool PromptUser() {
return true;
}
virtual bool PromptUser();
virtual bool PromptUser(wxWindow *parent);
// Check whether effect should be skipped
// Typically this is only useful in automation, for example
// detecting that zero noise reduction is to be done,
@ -198,12 +267,10 @@ class AUDACITY_DLL_API Effect {
virtual bool CheckWhetherSkipEffect() { return false; }
// Actually do the effect here.
virtual bool Process() = 0;
virtual bool Process();
// clean up any temporary memory
virtual void End() {
}
virtual void End();
//
// protected data
@ -293,8 +360,17 @@ class AUDACITY_DLL_API Effect {
// Used only by the base Effect class
//
private:
void CommonInit();
void CountWaveTracks();
// Driver for client effects
bool ProcessTrack(int count,
WaveTrack *left,
WaveTrack *right,
sampleCount leftStart,
sampleCount rightStart,
sampleCount len);
//
// private data
//
@ -307,14 +383,26 @@ class AUDACITY_DLL_API Effect {
int mNumTracks; //v This is really mNumWaveTracks, per CountWaveTracks() and GetNumWaveTracks().
int mNumGroups;
int mID;
int mEffectID;
friend class BatchCommands;// so can call PromptUser.
friend class EffectManager;// so it can delete effects and access mID.
// For client driver
EffectClientInterface *mClient;
int mNumAudioIn;
int mNumAudioOut;
float **mInBuffer;
float **mOutBuffer;
float **mInBufPos;
float **mOutBufPos;
sampleCount mBufferSize;
sampleCount mBlockSize;
int mNumChannels;
friend class EffectManager;// so it can call PromptUser in support of batch commands.
friend class EffectRack;
};
// Base dialog for generate effect
#define ID_EFFECT_PREVIEW ePreviewID
@ -350,4 +438,3 @@ double TrapDouble(double x, double min, double max);
long TrapLong(long x, long min, long max);
#endif

View File

@ -9,28 +9,183 @@
**********************************************************************/
#include <iostream>
#include <wx/stopwatch.h>
#include <wx/tokenzr.h>
#include "../Experimental.h"
#if defined(EXPERIMENTAL_EFFECTS_RACK)
#include "EffectRack.h"
#endif
#include "EffectManager.h"
// ============================================================================
//
// Initialisations for static class members
// Create singleton and return reference
//
EffectManager& EffectManager::Get() {
// (Thread-safe...no active threading during construction or after destruction)
// ============================================================================
EffectManager & EffectManager::Get()
{
static EffectManager em;
return em;
}
EffectManager::EffectManager()
: mNumEffects(0)
{
#ifdef EFFECT_CATEGORIES
mCategories = new CategoryMap();
mRootCategories = new CategorySet();
mUnsorted = new EffectSet();
// Create effect category graph. These categories and relationships
// are taken from revision 2 of lv2.ttl, loaders for other plugin systems
// (such as LADSPA/LRDF) should map their categories to these ones when
// applicable. Individual LADSPA/LRDF and LV2 plugins can add new
// categories and make them subcategories of the existing ones, but not
// add subcategory relationships between these categories.
//
// We need some persistent, global identifiers for categories - LRDF
// and LV2 uses URI strings so we do that too. The URIs here are the
// same ones as in lv2.ttl. Category identifiers in other plugin systems
// must be mapped to URIs by their loaders.
#define LV2PREFIX "http://lv2plug.in/ns/lv2core#"
typedef EffectCategory* CatPtr;
CatPtr gen = AddCategory(wxT(LV2PREFIX) wxT("GeneratorPlugin"),
_("Generator"));
CatPtr inst = AddCategory(wxT(LV2PREFIX) wxT("InstrumentPlugin"),
/* i18n-hint: (noun).*/
_("Instrument"));
CatPtr osc = AddCategory(wxT(LV2PREFIX) wxT("OscillatorPlugin"),
_("Oscillator"));
CatPtr util = AddCategory(wxT(LV2PREFIX) wxT("UtilityPlugin"),
_("Utility"));
CatPtr conv = AddCategory(wxT(LV2PREFIX) wxT("ConverterPlugin"),
_("Converter"));
CatPtr anal = AddCategory(wxT(LV2PREFIX) wxT("AnalyserPlugin"),
_("Analyser"));
CatPtr mix = AddCategory(wxT(LV2PREFIX) wxT("MixerPlugin"),
_("Mixer"));
CatPtr sim = AddCategory(wxT(LV2PREFIX) wxT("SimulatorPlugin"),
_("Simulator"));
CatPtr del = AddCategory(wxT(LV2PREFIX) wxT("DelayPlugin"),
_("Delay"));
CatPtr mod = AddCategory(wxT(LV2PREFIX) wxT("ModulatorPlugin"),
_("Modulator"));
CatPtr rev = AddCategory(wxT(LV2PREFIX) wxT("ReverbPlugin"),
_("Reverb"));
CatPtr phas = AddCategory(wxT(LV2PREFIX) wxT("PhaserPlugin"),
_("Phaser"));
CatPtr flng = AddCategory(wxT(LV2PREFIX) wxT("FlangerPlugin"),
_("Flanger"));
CatPtr chor = AddCategory(wxT(LV2PREFIX) wxT("ChorusPlugin"),
_("Chorus"));
CatPtr flt = AddCategory(wxT(LV2PREFIX) wxT("FilterPlugin"),
_("Filter"));
CatPtr lp = AddCategory(wxT(LV2PREFIX) wxT("LowpassPlugin"),
_("Lowpass"));
CatPtr bp = AddCategory(wxT(LV2PREFIX) wxT("BandpassPlugin"),
_("Bandpass"));
CatPtr hp = AddCategory(wxT(LV2PREFIX) wxT("HighpassPlugin"),
_("Highpass"));
CatPtr comb = AddCategory(wxT(LV2PREFIX) wxT("CombPlugin"),
_("Comb"));
CatPtr alp = AddCategory(wxT(LV2PREFIX) wxT("AllpassPlugin"),
_("Allpass"));
CatPtr eq = AddCategory(wxT(LV2PREFIX) wxT("EQPlugin"),
_("Equaliser"));
CatPtr peq = AddCategory(wxT(LV2PREFIX) wxT("ParaEQPlugin"),
_("Parametric"));
CatPtr meq = AddCategory(wxT(LV2PREFIX) wxT("MultiEQPlugin"),
_("Multiband"));
CatPtr spec = AddCategory(wxT(LV2PREFIX) wxT("SpectralPlugin"),
_("Spectral Processor"));
CatPtr ptch = AddCategory(wxT(LV2PREFIX) wxT("PitchPlugin"),
_("Pitch Shifter"));
CatPtr amp = AddCategory(wxT(LV2PREFIX) wxT("AmplifierPlugin"),
_("Amplifier"));
CatPtr dist = AddCategory(wxT(LV2PREFIX) wxT("DistortionPlugin"),
_("Distortion"));
CatPtr shp = AddCategory(wxT(LV2PREFIX) wxT("WaveshaperPlugin"),
_("Waveshaper"));
CatPtr dyn = AddCategory(wxT(LV2PREFIX) wxT("DynamicsPlugin"),
_("Dynamics Processor"));
CatPtr cmp = AddCategory(wxT(LV2PREFIX) wxT("CompressorPlugin"),
_("Compressor"));
CatPtr exp = AddCategory(wxT(LV2PREFIX) wxT("ExpanderPlugin"),
_("Expander"));
CatPtr lim = AddCategory(wxT(LV2PREFIX) wxT("LimiterPlugin"),
_("Limiter"));
CatPtr gate = AddCategory(wxT(LV2PREFIX) wxT("GatePlugin"),
_("Gate"));
AddCategoryParent(inst, gen);
AddCategoryParent(osc, gen);
AddCategoryParent(conv, util);
AddCategoryParent(anal, util);
AddCategoryParent(mix, util);
AddCategoryParent(rev, sim);
AddCategoryParent(rev, del);
AddCategoryParent(phas, mod);
AddCategoryParent(flng, mod);
AddCategoryParent(chor, mod);
AddCategoryParent(lp, flt);
AddCategoryParent(bp, flt);
AddCategoryParent(hp, flt);
AddCategoryParent(comb, flt);
AddCategoryParent(alp, flt);
AddCategoryParent(eq, flt);
AddCategoryParent(peq, eq);
AddCategoryParent(meq, eq);
AddCategoryParent(ptch, spec);
AddCategoryParent(shp, dist);
AddCategoryParent(cmp, dyn);
AddCategoryParent(exp, dyn);
AddCategoryParent(lim, dyn);
AddCategoryParent(gate, dyn);
// We also add a couple of categories for internal use. These are not
// in lv2.ttl.
#define ATEAM "http://audacityteam.org/namespace#"
CatPtr nrm = AddCategory(wxT(ATEAM) wxT("NoiseRemoval"),
_("Noise Removal"));
CatPtr pnt = AddCategory(wxT(ATEAM) wxT("PitchAndTempo"),
_("Pitch and Tempo"));
CatPtr tim = AddCategory(wxT(ATEAM) wxT("TimelineChanger"),
_("Timeline Changer"));
CatPtr aTim = AddCategory(wxT(ATEAM) wxT("TimeAnalyser"),
_("Time"));
CatPtr onst = AddCategory(wxT(ATEAM) wxT("OnsetDetector"),
_("Onsets"));
AddCategoryParent(nrm, util);
AddCategoryParent(tim, util);
AddCategoryParent(aTim, anal);
AddCategoryParent(onst, aTim);
// We freeze the internal subcategory relations between the categories
// added so far so LADSPA/LRDF or other category systems don't ruin
// our hierarchy.
FreezeCategories();
#endif
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
mRealtimeMutex.Lock();
mRealtimeEffects = NULL;
mRealtimeCount = 0;
mRealtimeActive = false;
mRealtimeSuspended = false;
mRealtimeMutex.Unlock();
mRealtimeLatency = 0;
#endif
#if defined(EXPERIMENTAL_EFFECTS_RACK)
mRack = NULL;
#endif
}
@ -45,28 +200,31 @@ EffectManager::~EffectManager()
delete mRootCategories;
delete mCategories;
#endif
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
if (mRealtimeEffects)
{
delete [] mRealtimeEffects;
}
#endif
#if defined(EXPERIMENTAL_EFFECTS_RACK)
// wxWidgets has already destroyed the rack since it was derived from wxFrame. So
// no need to delete it here.
#endif
}
void EffectManager::RegisterEffect(Effect *f, int NewFlags)
{
f->mID = mNumEffects;
mNumEffects++;
if( NewFlags != 0)
f->SetEffectFlags( NewFlags );
f->SetEffectID(mNumEffects++);
// Insert the effect into the list in alphabetical order
// A linear search is good enough as long as there are
// only a few dozen or even a few hundred effects.
wxString name = Effect::StripAmpersand(f->GetEffectName());
int len = mEffects.GetCount();
int i;
for(i=0; i<len; i++)
if (name.CmpNoCase(Effect::StripAmpersand(mEffects[i]->GetEffectName())) < 0) {
mEffects.Insert(f, i);
break;
}
if (i==len)
mEffects.Add(f);
if( NewFlags != 0)
{
f->SetEffectFlags( NewFlags );
}
// This will go away after all effects have been converted
mEffectPlugins.Add(PluginManager::Get().RegisterLegacyEffectPlugin(f));
#ifdef EFFECT_CATEGORIES
// Add the effect in the right categories
@ -88,11 +246,6 @@ void EffectManager::RegisterEffect(Effect *f, int NewFlags)
void EffectManager::UnregisterEffects()
{
for(int i=0; i<mNumEffects; i++)
delete mEffects[i];
mEffects.clear();
#ifdef EFFECT_CATEGORIES
mUnsorted->clear();
@ -102,47 +255,352 @@ void EffectManager::UnregisterEffects()
#endif
}
int EffectManager::GetNumEffects()
bool EffectManager::DoEffect(const PluginID & ID,
wxWindow *parent,
int flags,
double projectRate,
TrackList *list,
TrackFactory *factory,
SelectedRegion *selectedRegion,
wxString params)
{
return mNumEffects;
}
Effect *EffectManager::GetEffect(int ID)
{
for(int i=0; i<mNumEffects; i++)
if (mEffects[i]->mID == ID)
return mEffects[i];
return NULL;
}
Effect* EffectManager::GetEffectByIdentifier(const wxString strTarget, const int kFlags /*= ALL_EFFECTS*/)
{
if( strTarget == wxT("") ) // set GetEffectIdentifier to wxT("") to not show an effect in Batch mode
return NULL;
for (unsigned int i = 0; i < mEffects.GetCount(); i++)
Effect *effect = GetEffect(ID);
if (!effect)
{
int nFlags = mEffects[i]->GetEffectFlags();
if (((nFlags & kFlags) == nFlags) && strTarget.IsSameAs(mEffects[i]->GetEffectIdentifier()))
return mEffects[i];
return false;
}
return NULL;
#if defined(EXPERIMENTAL_REALTIME_EFFECTS) && defined(EXPERIMENTAL_EFFECTS_RACK)
if (effect->IsRealtimeCapable())
{
GetRack()->Add(effect);
}
#endif
return effect->DoEffect(parent,
flags,
projectRate,
list,
factory,
selectedRegion,
params);
}
EffectArray *EffectManager::GetEffects(int flags /* = ALL_EFFECTS */)
wxString EffectManager::GetEffectName(const PluginID & ID)
{
EffectArray *results = new EffectArray();
int len = mEffects.GetCount();
for(int i=0; i<len; i++) {
int g = mEffects[i]->GetEffectFlags();
if ((flags & g) == g)
results->Add(mEffects[i]);
}
return results;
return PluginManager::Get().GetName(ID);
}
wxString EffectManager::GetEffectIdentifier(const PluginID & ID)
{
wxString name = (PluginManager::Get().GetName(ID));
// Get rid of leading and trailing white space
name.Trim(true).Trim(false);
if (name == wxEmptyString)
{
return name;
}
wxStringTokenizer st(name, wxT(" "));
wxString id;
// CamelCase the name
while (st.HasMoreTokens())
{
wxString tok = st.GetNextToken();
id += tok.Left(1).MakeUpper() + tok.Mid(1).MakeLower();
}
return id;
}
wxString EffectManager::GetEffectDescription(const PluginID & ID)
{
Effect *effect = GetEffect(ID);
if (effect)
{
return effect->GetEffectDescription();
}
return wxEmptyString;
}
wxString EffectManager::GetEffectParameters(const PluginID & ID)
{
Effect *effect = GetEffect(ID);
if (effect)
{
ShuttleCli shuttle;
shuttle.mbStoreInClient = false;
effect->TransferParameters(shuttle);
return shuttle.mParams;
}
return wxEmptyString;
}
bool EffectManager::SetEffectParameters(const PluginID & ID, const wxString & params)
{
Effect *effect = GetEffect(ID);
if (effect)
{
ShuttleCli shuttle;
shuttle.mParams = params;
shuttle.mbStoreInClient=true;
return effect->TransferParameters(shuttle);
}
return false;
}
bool EffectManager::PromptUser(const PluginID & ID, wxWindow *parent)
{
Effect *effect = GetEffect(ID);
bool result = false;
if (effect)
{
result = effect->PromptUser(parent);
}
return result;
}
#if defined(EXPERIMENTAL_EFFECTS_RACK)
EffectRack *EffectManager::GetRack()
{
if (!mRack)
{
mRack = new EffectRack();
}
return mRack;
}
void EffectManager::ShowRack()
{
GetRack()->Show();
}
#endif
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
void EffectManager::RealtimeInitialize(int numChannels, float sampleRate)
{
mRealtimeMutex.Lock();
for (int i = 0; i < mRealtimeCount; i++)
{
mRealtimeEffects[i]->RealtimeInitialize(numChannels, sampleRate);
}
mRealtimeMutex.Unlock();
mRealtimeActive = true;
RealtimeResume();
}
void EffectManager::RealtimeFinalize()
{
RealtimeSuspend();
mRealtimeActive = false;
mRealtimeLatency = 0;
mRealtimeMutex.Lock();
for (int i = 0; i < mRealtimeCount; i++)
{
mRealtimeEffects[i]->RealtimeFinalize();
}
mRealtimeMutex.Unlock();
}
void EffectManager::RealtimeSuspend()
{
mRealtimeSuspended = true;
mRealtimeMutex.Lock();
for (int i = 0; i < mRealtimeCount; i++)
{
mRealtimeEffects[i]->RealtimeSuspend();
}
mRealtimeMutex.Unlock();
}
void EffectManager::RealtimeResume()
{
mRealtimeMutex.Lock();
for (int i = 0; i < mRealtimeCount; i++)
{
mRealtimeEffects[i]->RealtimeResume();
}
mRealtimeMutex.Unlock();
mRealtimeSuspended = false;
}
void EffectManager::RealtimeProcessMono(float *buffer, sampleCount numSamples)
{
// Can be suspended because of the audio stream being paused or because effects
// have been suspended.
if (mRealtimeSuspended)
{
return;
}
wxMilliClock_t start = wxGetLocalTimeMillis();
float *ib = (float *) alloca(sizeof(float) * numSamples);
float *ob = (float *) alloca(sizeof(float) * numSamples);
memcpy(ib, buffer, sizeof(float) * numSamples);
float *ibuf[1] = {ib};
float *obuf[1] = {ob};
mRealtimeMutex.Lock();
for (int i = 0; i < mRealtimeCount; i++)
{
mRealtimeEffects[i]->RealtimeProcess(ibuf, obuf, numSamples);
float *tbuf[1] = {ibuf[0]};
ibuf[0] = obuf[0];
obuf[0] = tbuf[0];
}
mRealtimeMutex.Unlock();
memcpy(buffer, ibuf[0], sizeof(float) * numSamples);
mRealtimeLatency = (int) (wxGetLocalTimeMillis() - start).GetValue();
}
void EffectManager::RealtimeProcessStereo(float *buffer, sampleCount numSamples)
{
// Can be suspended because of the audio stream being paused or because effects
// have been suspended.
if (mRealtimeSuspended)
{
return;
}
wxMilliClock_t start = wxGetLocalTimeMillis();
float *ilc = (float *) alloca(sizeof(float) * numSamples);
float *irc = (float *) alloca(sizeof(float) * numSamples);
float *olc = (float *) alloca(sizeof(float) * numSamples);
float *orc = (float *) alloca(sizeof(float) * numSamples);
for (int opos = 0, ipos = 0; opos < numSamples; opos++, ipos += 2)
{
ilc[opos] = buffer[ipos];
irc[opos] = buffer[ipos+1];
}
float *ibuf[2] = {ilc, irc};
float *obuf[2] = {olc, orc};
mRealtimeMutex.Lock();
for (int i = 0; i < mRealtimeCount; i++)
{
mRealtimeEffects[i]->RealtimeProcess(ibuf, obuf, numSamples);
float *tbuf[2] = {ibuf[0], ibuf[1]};
ibuf[0] = obuf[0];
ibuf[1] = obuf[1];
obuf[0] = tbuf[0];
obuf[1] = tbuf[1];
}
mRealtimeMutex.Unlock();
for (int opos = 0, ipos = 0; ipos < numSamples; ipos++, opos += 2)
{
buffer[opos] = ibuf[0][ipos] > 1.0 ? 1.0 : ibuf[0][ipos];
buffer[opos+1] = ibuf[1][ipos] > 1.0 ? 1.0 : ibuf[1][ipos];
}
mRealtimeLatency = (int) (wxGetLocalTimeMillis() - start).GetValue();
}
int EffectManager::GetRealtimeLatency()
{
return mRealtimeLatency;
}
void EffectManager::SetRealtime(const EffectArray & effects)
{
Effect **rteffects = new Effect *[effects.GetCount()];
if (rteffects)
{
for (int i = 0, cnt = effects.GetCount(); i < cnt; i++)
{
rteffects[i] = effects[i];
}
mRealtimeMutex.Lock();
Effect **rtold = mRealtimeEffects;
mRealtimeEffects = rteffects;
mRealtimeCount = effects.GetCount();
mRealtimeMutex.Unlock();
if (rtold)
{
delete [] rtold;
}
}
}
#endif
Effect *EffectManager::GetEffect(const PluginID & ID)
{
Effect *effect;
// TODO: This is temporary and should be redone when all effects are converted
if (mEffectPlugins.Index(wxString(ID)) == wxNOT_FOUND)
{
// This will instantiate the effect client if it hasn't already been done
EffectClientInterface *client = static_cast<EffectClientInterface *>(PluginManager::Get().GetInstance(ID));
if (client)
{
effect = new Effect(client);
if (effect)
{
effect->SetEffectID(mNumEffects++);
PluginManager::Get().SetInstance(ID, effect);
mEffectPlugins.Add(ID);
}
return effect;
}
return NULL;
}
return static_cast<Effect *>(PluginManager::Get().GetInstance(ID));
}
const PluginID & EffectManager::GetEffectByIdentifier(const wxString & strTarget)
{
if (strTarget == wxEmptyString) // set GetEffectIdentifier to wxT("") to not show an effect in Batch mode
{
return PluginID(wxEmptyString);
}
PluginManager & pm = PluginManager::Get();
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect);
while (plug)
{
if (GetEffectIdentifier(plug->GetID()).IsSameAs(strTarget))
{
return plug->GetID();
}
plug = pm.GetNextPlugin(PluginTypeEffect);
}
return PluginID(wxEmptyString);
}
#ifdef EFFECT_CATEGORIES

View File

@ -18,12 +18,15 @@ effects.
*//*******************************************************************/
#ifndef __AUDACITY_EFFECTMANAGER__
#define __AUDACITY_EFFECTMANAGER__
#include <map>
#include <string>
#include <vector>
#include "audacity/EffectInterface.h"
#include "../PluginManager.h"
#include "Effect.h"
#ifdef EFFECT_CATEGORIES
@ -32,8 +35,15 @@ effects.
WX_DEFINE_USER_EXPORTED_ARRAY(Effect *, EffectArray, class AUDACITY_DLL_API);
#if defined(EXPERIMENTAL_EFFECTS_RACK)
class EffectRack;
#endif
class AUDACITY_DLL_API EffectManager {
class AUDACITY_DLL_API EffectManager
{
#if defined(EXPERIMENTAL_EFFECTS_RACK)
friend class EffectRack;
#endif
public:
@ -60,18 +70,45 @@ class AUDACITY_DLL_API EffectManager {
/** Unregister all effects. */
void UnregisterEffects();
/** Return an effect by its numerical ID. */
Effect *GetEffect(int ID);
/** Run an effect given the plugin ID */
// Returns true on success. Will only operate on tracks that
// have the "selected" flag set to true, which is consistent with
// Audacity's standard UI.
bool DoEffect(const PluginID & ID,
wxWindow *parent,
int flags,
double projectRate,
TrackList *list,
TrackFactory *factory,
SelectedRegion *selectedRegion,
wxString params);
Effect* GetEffectByIdentifier(const wxString strTarget, const int kFlags = ALL_EFFECTS);
wxString GetEffectName(const PluginID & ID);
wxString GetEffectIdentifier(const PluginID & ID);
wxString GetEffectDescription(const PluginID & ID);
/** Return the number of registered effects. */
int GetNumEffects();
/** Support for batch commands */
wxString GetEffectParameters(const PluginID & ID);
bool SetEffectParameters(const PluginID & ID, const wxString & params);
bool PromptUser(const PluginID & ID, wxWindow *parent);
/** Returns a sorted array of effects, which may be filtered
using the flags parameter. The caller should dispose
of the array when done. */
EffectArray *GetEffects(int flags = ALL_EFFECTS);
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
// Realtime effect processing
void RealtimeInitialize(int numChannels, float sampleRate);
void RealtimeFinalize();
void RealtimeSuspend();
void RealtimeResume();
void RealtimeProcessMono(float *buffer, sampleCount numSamples);
void RealtimeProcessStereo(float *buffer, sampleCount numSamples);
void SetRealtime(const EffectArray & mActive);
int GetRealtimeLatency();
#endif
#if defined(EXPERIMENTAL_EFFECTS_RACK)
void ShowRack();
#endif
const PluginID & GetEffectByIdentifier(const wxString & strTarget);
#ifdef EFFECT_CATEGORIES
@ -104,10 +141,31 @@ class AUDACITY_DLL_API EffectManager {
#endif
private:
/** Return an effect by its ID. */
Effect *GetEffect(const PluginID & ID);
#if defined(EXPERIMENTAL_EFFECTS_RACK)
EffectRack *GetRack();
#endif
private:
wxArrayString mEffectPlugins;
EffectArray mEffects;
int mNumEffects;
#if defined(EXPERIMENTAL_EFFECTS_RACK)
EffectRack *mRack;
#endif
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
wxMutex mRealtimeMutex;
Effect **mRealtimeEffects;
int mRealtimeCount;
int mRealtimeLatency;
bool mRealtimeActive;
bool mRealtimeSuspended;
#endif
#ifdef EFFECT_CATEGORIES
// This maps URIs to EffectCategory pointers for all added categories.
// It is needed for fast lookup and easy deletion.
@ -121,7 +179,6 @@ class AUDACITY_DLL_API EffectManager {
// are placed in.
EffectSet *mUnsorted;
#endif
};

537
src/effects/EffectRack.cpp Normal file
View File

@ -0,0 +1,537 @@
/**********************************************************************
Audacity: A Digital Audio Editor
EffectRack.cpp
Leland Lucius
Audacity(R) is copyright (c) 1999-2008 Audacity Team.
License: GPL v2. See License.txt.
**********************************************************************/
#include "../Experimental.h"
#if defined(EXPERIMENTAL_EFFECTS_RACK)
#include <wx/access.h>
#include <wx/defs.h>
#include <wx/button.h>
#include <wx/dcmemory.h>
#include <wx/frame.h>
#include <wx/image.h>
#include <wx/imaglist.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/stattext.h>
#include <wx/timer.h>
#include <wx/tglbtn.h>
#include "EffectManager.h"
#include "EffectRack.h"
#include "../Prefs.h"
#include "../Project.h"
#include "../widgets/AButton.h"
#include "../../images/EffectRack/EffectRack.h"
#define COL_POWER 0
#define COL_EDITOR 1
#define COL_UP 2
#define COL_DOWN 3
#define COL_FAV 4
#define COL_REMOVE 5
#define COL_NAME 6
#define NUMCOLS 7
#define ID_BASE 20000
#define ID_RANGE 100
#define ID_POWER (ID_BASE + (COL_POWER * ID_RANGE))
#define ID_EDITOR (ID_BASE + (COL_EDITOR * ID_RANGE))
#define ID_UP (ID_BASE + (COL_UP * ID_RANGE))
#define ID_DOWN (ID_BASE + (COL_DOWN * ID_RANGE))
#define ID_FAV (ID_BASE + (COL_FAV * ID_RANGE))
#define ID_REMOVE (ID_BASE + (COL_REMOVE * ID_RANGE))
#define ID_NAME (ID_BASE + (COL_NAME * ID_RANGE))
BEGIN_EVENT_TABLE(EffectRack, wxFrame)
EVT_CLOSE(EffectRack::OnClose)
EVT_TIMER(wxID_ANY, EffectRack::OnTimer)
EVT_BUTTON(wxID_APPLY, EffectRack::OnApply)
EVT_TOGGLEBUTTON(wxID_CLEAR, EffectRack::OnBypass)
EVT_COMMAND_RANGE(ID_REMOVE, ID_REMOVE + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnRemove)
EVT_COMMAND_RANGE(ID_POWER, ID_POWER + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnPower)
EVT_COMMAND_RANGE(ID_EDITOR, ID_EDITOR + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnEditor)
EVT_COMMAND_RANGE(ID_UP, ID_UP + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnUp)
EVT_COMMAND_RANGE(ID_DOWN, ID_DOWN + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnDown)
EVT_COMMAND_RANGE(ID_FAV, ID_FAV + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnFav)
END_EVENT_TABLE()
EffectRack::EffectRack()
: wxFrame(GetActiveProject(),
wxID_ANY,
_("Effects Rack"),
wxDefaultPosition,
wxDefaultSize,
wxSYSTEM_MENU |
wxCLOSE_BOX |
wxCAPTION |
// wxSIMPLE_BORDER |
wxFRAME_NO_TASKBAR |
wxFRAME_FLOAT_ON_PARENT)
{
mBypassing = false;
mNumEffects = 0;
mLastLatency = 0;
mTimer.SetOwner(this);
mRemovePushed = CreateImage(remove_16x16_xpm, false, true);
mRemoveRaised = CreateImage(remove_16x16_xpm, true, true);
mPowerPushed = CreateImage(power_on_16x16_xpm, false, false);
mPowerRaised = CreateImage(power_off_16x16_xpm, true, false);
mFavPushed = CreateImage(fav_down_16x16_xpm, false, false);
mFavRaised = CreateImage(fav_up_16x16_xpm, true, false);
mSettingsPushed = CreateImage(settings_up_16x16_xpm, false, true);
mSettingsRaised = CreateImage(settings_down_16x16_xpm, true, true);
mUpDisabled = CreateImage(up_9x16_xpm, true, true);
mUpPushed = CreateImage(up_9x16_xpm, false, true);
mUpRaised = CreateImage(up_9x16_xpm, true, true);
mDownDisabled = CreateImage(down_9x16_xpm, true, true);
mDownPushed = CreateImage(down_9x16_xpm, false, true);
mDownRaised = CreateImage(down_9x16_xpm, true, true);
wxBoxSizer *bs = new wxBoxSizer(wxVERTICAL);
mPanel = new wxPanel(this, wxID_ANY);
bs->Add(mPanel, 1, wxEXPAND);
SetSizer(bs);
wxBoxSizer *hs = new wxBoxSizer(wxHORIZONTAL);
hs->Add(new wxButton(mPanel, wxID_APPLY, _("&Apply")), 0, wxALIGN_LEFT);
hs->AddStretchSpacer();
mLatency = new wxStaticText(mPanel, wxID_ANY, _("Latency: 0"));
hs->Add(mLatency, 0, wxALIGN_CENTER);
hs->AddStretchSpacer();
hs->Add(new wxToggleButton(mPanel, wxID_CLEAR, _("&Bypass")), 0, wxALIGN_RIGHT);
bs = new wxBoxSizer(wxVERTICAL);
bs->Add(hs, 0, wxEXPAND);
bs->Add(new wxStaticLine(mPanel, wxID_ANY), 0, wxEXPAND);
mMainSizer = new wxFlexGridSizer(7);
mMainSizer->AddGrowableCol(6);
mMainSizer->SetHGap(0);
mMainSizer->SetVGap(0);
bs->Add(mMainSizer, 1, wxEXPAND);
mPanel->SetSizer(bs);
wxString oldPath = gPrefs->GetPath();
gPrefs->SetPath(wxT("/EffectsRack"));
size_t cnt = gPrefs->GetNumberOfEntries();
gPrefs->SetPath(oldPath);
EffectManager & em = EffectManager::Get();
for (size_t i = 0; i < cnt; i++)
{
wxString slot;
gPrefs->Read(wxString::Format(wxT("/EffectsRack/Slot%02d"), i), &slot);
Effect *effect = em.GetEffect(slot.AfterFirst(wxT(',')).c_str());
if (effect)
{
Add(effect, slot.BeforeFirst(wxT(',')) == wxT("1"), true);
}
}
Fit();
}
EffectRack::~EffectRack()
{
gPrefs->DeleteGroup(wxT("/EffectsRack"));
for (size_t i = 0, cnt = mEffects.GetCount(); i < cnt; i++)
{
wxSizerItem *si;
si = mMainSizer->GetItem(i * NUMCOLS + COL_FAV);
AButton *fav = static_cast<AButton *>(si->GetWindow());
if (fav && fav->IsDown())
{
si = mMainSizer->GetItem(i * NUMCOLS + COL_POWER);
AButton *power = static_cast<AButton *>(si->GetWindow());
Effect *effect = mEffects[i];
gPrefs->Write(wxString::Format(wxT("/EffectsRack/Slot%02d"), i),
wxString::Format(wxT("%d,%s"),
power->IsDown(),
effect->GetID().c_str()));
}
}
}
void EffectRack::Add(Effect *effect, bool active, bool favorite)
{
if (mEffects.Index(effect) != wxNOT_FOUND)
{
return;
}
AButton *ab;
ab = new AButton(mPanel,
ID_POWER + mNumEffects,
wxDefaultPosition,
wxDefaultSize,
mPowerRaised,
mPowerRaised,
mPowerPushed,
mPowerPushed,
true);
ab->SetToolTip(_("Set effect active state"));
if (active)
{
ab->PushDown();
}
else
{
ab->PopUp();
}
mMainSizer->Add(ab, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
ab = new AButton(mPanel,
ID_EDITOR + mNumEffects,
wxDefaultPosition,
wxDefaultSize,
mSettingsRaised,
mSettingsRaised,
mSettingsPushed,
mSettingsPushed,
false);
ab->SetToolTip(_("Open/close effect editor"));
ab->PopUp();
mMainSizer->Add(ab, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
ab = new AButton(mPanel,
ID_UP + mNumEffects,
wxDefaultPosition,
wxDefaultSize,
mUpRaised,
mUpRaised,
mUpPushed,
mUpDisabled,
false);
ab->SetToolTip(_("Move effect up in the rack"));
ab->PopUp();
mMainSizer->Add(ab, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
ab = new AButton(mPanel,
ID_DOWN + mNumEffects,
wxDefaultPosition,
wxDefaultSize,
mDownRaised,
mDownRaised,
mDownPushed,
mDownDisabled,
false);
ab->SetToolTip(_("Move effect down in the rack"));
ab->PopUp();
mMainSizer->Add(ab, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
ab = new AButton(mPanel,
ID_FAV + mNumEffects,
wxDefaultPosition,
wxDefaultSize,
mFavRaised,
mFavRaised,
mFavPushed,
mFavPushed,
true);
ab->SetToolTip(_("Mark effect as a favorite"));
if (favorite)
{
ab->PushDown();
}
else
{
ab->PopUp();
}
mMainSizer->Add(ab, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
ab = new AButton(mPanel,
ID_REMOVE + mNumEffects,
wxDefaultPosition,
wxDefaultSize,
mRemoveRaised,
mRemoveRaised,
mRemovePushed,
mRemovePushed,
false);
ab->SetToolTip(_("Remove effect from the rack"));
ab->PopUp();
mMainSizer->Add(ab, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
wxStaticText *text = new wxStaticText(mPanel, ID_NAME + mNumEffects, effect->GetName());
text->SetToolTip(_("Name of the effect"));
mMainSizer->Add(text, 0, wxEXPAND | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5);
mMainSizer->Layout();
SetSize(GetMinSize());
Fit();
Update();
mEffects.Add(effect);
mNumEffects++;
if (!mTimer.IsRunning())
{
mTimer.Start(1000);
}
if (active)
{
UpdateActive();
}
}
void EffectRack::OnClose(wxCloseEvent & evt)
{
Show(false);
evt.Veto();
}
void EffectRack::OnTimer(wxTimerEvent & AUNUSED(evt))
{
int latency = EffectManager::Get().GetRealtimeLatency();
if (latency != mLastLatency)
{
mLatency->SetLabel(wxString::Format(_("Latency: %4d"), latency));
mLatency->Refresh();
mLastLatency = latency;
}
}
void EffectRack::OnApply(wxCommandEvent & AUNUSED(evt))
{
AudacityProject *project = GetActiveProject();
for (size_t i = 0, cnt = mEffects.GetCount(); i < cnt; i++)
{
AButton *btn = static_cast<AButton *>(FindWindowById(ID_POWER + i));
if (btn->IsDown())
{
project->OnEffect(mEffects[i]->GetID(), true);
btn->PopUp();
btn->Refresh();
}
}
UpdateActive();
}
void EffectRack::OnBypass(wxCommandEvent & evt)
{
mBypassing = evt.GetInt() != 0;
UpdateActive();
}
void EffectRack::OnPower(wxCommandEvent & evt)
{
evt.Skip();
UpdateActive();
}
void EffectRack::OnEditor(wxCommandEvent & evt)
{
AButton *btn = static_cast<AButton *>(evt.GetEventObject());
btn->PopUp();
evt.Skip();
int index = GetEffectIndex(btn);
if (index < 0)
{
return;
}
mEffects[index]->PromptUser(GetParent());
}
void EffectRack::OnUp(wxCommandEvent & evt)
{
AButton *btn = static_cast<AButton *>(evt.GetEventObject());
btn->PopUp();
evt.Skip();
int index = GetEffectIndex(btn);
if (index <= 0)
{
return;
}
MoveRowUp(index);
}
void EffectRack::OnDown(wxCommandEvent & evt)
{
AButton *btn = static_cast<AButton *>(evt.GetEventObject());
btn->PopUp();
evt.Skip();
size_t index = GetEffectIndex(btn);
if (index < 0 || index == (mMainSizer->GetChildren().GetCount() / NUMCOLS) - 1)
{
return;
}
MoveRowUp(index + 1);
}
void EffectRack::OnFav(wxCommandEvent & evt)
{
evt.Skip();
}
void EffectRack::OnRemove(wxCommandEvent & evt)
{
AButton *btn = static_cast<AButton *>(evt.GetEventObject());
btn->PopUp();
evt.Skip();
int index = GetEffectIndex(btn);
if (index < 0)
{
return;
}
mEffects.RemoveAt(index);
if (mEffects.GetCount() == 0)
{
if (mTimer.IsRunning())
{
mTimer.Stop();
}
}
index *= NUMCOLS;
for (int i = 0; i < NUMCOLS; i++)
{
delete mMainSizer->GetItem(index)->GetWindow();
}
mMainSizer->Layout();
Fit();
UpdateActive();
}
wxImage EffectRack::CreateImage(const char *xpm[], bool up, bool pusher)
{
wxMemoryDC dc;
wxBitmap pic(xpm);
wxBitmap mod(pic.GetWidth() + 6, pic.GetHeight() + 6);
dc.SelectObject(mod);
#if defined( __WXGTK__ )
wxColour newColour = wxSystemSettings::GetColour( wxSYS_COLOUR_BACKGROUND );
#else
wxColour newColour = wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE );
#endif
dc.SetBackground(wxBrush(newColour));
dc.Clear();
int offset = 3;
if (pusher)
{
if (!up)
{
offset += 1;
}
}
dc.DrawBitmap(pic, offset, offset, true);
dc.SelectObject(wxNullBitmap);
return mod.ConvertToImage();
}
int EffectRack::GetEffectIndex(wxWindow *win)
{
int col = (win->GetId() - ID_BASE) / ID_RANGE;
int row;
int cnt = mMainSizer->GetChildren().GetCount() / NUMCOLS;
for (row = 0; row < cnt; row++)
{
wxSizerItem *si = mMainSizer->GetItem((row * NUMCOLS) + col);
if (si->GetWindow() == win)
{
break;
}
}
if (row == cnt)
{
return -1;
}
return row;
}
void EffectRack::MoveRowUp(int row)
{
Effect *effect = mEffects[row];
mEffects.RemoveAt(row);
mEffects.Insert(effect, row - 1);
row *= NUMCOLS;
for (int i = 0; i < NUMCOLS; i++)
{
wxSizerItem *si = mMainSizer->GetItem(row + NUMCOLS - 1);
wxWindow *w = si->GetWindow();
int flags = si->GetFlag();
int border = si->GetBorder();
int prop = si->GetProportion();
mMainSizer->Detach(row + NUMCOLS - 1);
mMainSizer->Insert(row - NUMCOLS, w, prop, flags, border);
}
mMainSizer->Layout();
Refresh();
UpdateActive();
}
void EffectRack::UpdateActive()
{
mActive.clear();
if (!mBypassing)
{
for (size_t i = 0, cnt = mEffects.GetCount(); i < cnt; i++)
{
wxSizerItem *si = mMainSizer->GetItem(i * NUMCOLS + COL_POWER);
AButton *power = static_cast<AButton *>(si->GetWindow());
if (power && power->IsDown())
{
mActive.Add(mEffects[i]);
}
}
}
EffectManager::Get().SetRealtime(mActive);
}
#endif

94
src/effects/EffectRack.h Normal file
View File

@ -0,0 +1,94 @@
/**********************************************************************
Audacity: A Digital Audio Editor
EffectRack.h
Leland Lucius
Audacity(R) is copyright (c) 1999-2008 Audacity Team.
License: GPL v2. See License.txt.
**********************************************************************/
#ifndef __AUDACITY_EFFECTRACK_H__
#define __AUDACITY_EFFECTRACK_H__
#include "../Experimental.h"
#if defined(EXPERIMENTAL_EFFECTS_RACK)
#include <wx/access.h>
#include <wx/defs.h>
#include <wx/frame.h>
#include <wx/image.h>
#include <wx/panel.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/timer.h>
#include "EffectManager.h"
class EffectRack : public wxFrame
{
public:
EffectRack();
virtual ~EffectRack();
void Add(Effect *effect, bool active = true, bool favorite = false);
private:
wxImage CreateImage(const char *xpm[], bool up, bool pusher);
int GetEffectIndex(wxWindow *win);
void MoveRowUp(int row);
void UpdateActive();
void OnClose(wxCloseEvent & evt);
void OnTimer(wxTimerEvent & evt);
void OnApply(wxCommandEvent & evt);
void OnBypass(wxCommandEvent & evt);
void OnPower(wxCommandEvent & evt);
void OnEditor(wxCommandEvent & evt);
void OnUp(wxCommandEvent & evt);
void OnDown(wxCommandEvent & evt);
void OnFav(wxCommandEvent & evt);
void OnRemove(wxCommandEvent & evt);
private:
wxStaticText *mLatency;
int mLastLatency;
wxImage mRemovePushed;
wxImage mRemoveRaised;
wxImage mPowerPushed;
wxImage mPowerRaised;
wxImage mFavPushed;
wxImage mFavRaised;
wxImage mSettingsPushed;
wxImage mSettingsRaised;
wxImage mUpPushed;
wxImage mUpRaised;
wxImage mUpDisabled;
wxImage mDownPushed;
wxImage mDownRaised;
wxImage mDownDisabled;
int mNumEffects;
wxTimer mTimer;
wxPanel *mPanel;
wxFlexGridSizer *mMainSizer;
EffectArray mEffects;
EffectArray mActive;
bool mBypassing;
DECLARE_EVENT_TABLE()
};
#endif
#endif // __AUDACITY_EFFECTRACK_H__

View File

@ -62,10 +62,6 @@
#include "audiounits/LoadAudioUnits.h"
#endif
#ifdef USE_VST
#include "VST/VSTEffect.h"
#endif
#ifdef USE_LADSPA
#include "ladspa/LoadLadspa.h"
#endif
@ -289,12 +285,6 @@ void LoadEffects()
}
#endif
#ifdef USE_VST
if (gPrefs->Read(wxT("/VST/Enable"), true)) {
RegisterVSTEffects();
}
#endif
#ifdef USE_LV2
if (gPrefs->Read(wxT("/LV2/Enable"), true)) {
LoadLV2Plugins();

File diff suppressed because it is too large Load Diff

View File

@ -8,83 +8,133 @@
**********************************************************************/
#include "../../Audacity.h"
#if USE_VST
#include "../Effect.h"
#include "audacity/EffectInterface.h"
#include "audacity/ModuleInterface.h"
#include "audacity/PluginInterface.h"
#include "aeffectx.h"
#define VSTCMDKEY wxT("-checkvst")
#define VSTPLUGINTYPE wxT("VST")
#define VSTCMDKEY L"-checkvst"
#define VSTPLUGINTYPE L"VST"
#define audacityVSTID CCONST('a', 'u', 'D', 'y');
typedef intptr_t (*dispatcherFn)(AEffect * effect, int opCode,
int index, intptr_t value, void *ptr,
typedef intptr_t (*dispatcherFn)(AEffect * effect,
int opCode,
int index,
intptr_t value,
void *ptr,
float opt);
typedef void (*processFn)(AEffect * effect, float **inputs,
float **outputs, int sampleframes);
typedef void (*processFn)(AEffect * effect,
float **inputs,
float **outputs,
int sampleframes);
typedef void (*setParameterFn)(AEffect * effect, int index,
typedef void (*setParameterFn)(AEffect * effect,
int index,
float parameter);
typedef float (*getParameterFn)(AEffect * effect, int index);
typedef float (*getParameterFn)(AEffect * effect,
int index);
typedef AEffect *(*vstPluginMain)(audioMasterCallback audioMaster);
class VSTEffectTimer;
class VSTEffectDialog;
class VSTEffect:public Effect
class VSTEffect : public EffectClientInterface
{
public:
VSTEffect(const wxString & path);
virtual ~VSTEffect();
virtual wxString GetEffectName();
// IdentInterface implementation
virtual PluginID GetID();
virtual wxString GetPath();
virtual wxString GetName();
virtual wxString GetVendor();
virtual wxString GetVersion();
virtual wxString GetDescription();
virtual wxString GetEffectIdentifier();
// EffectIdentInterface implementation
virtual EffectType GetType();
virtual wxString GetFamily();
virtual bool IsInteractive();
virtual bool IsDefault();
virtual bool IsLegacy();
virtual bool IsRealtimeCapable();
virtual std::set<wxString> GetEffectCategories();
// EffectClientInterface implementation
virtual void SetHost(EffectHostInterface *host);
virtual bool Startup();
virtual bool Shutdown();
virtual wxString GetEffectAction();
virtual int GetAudioInCount();
virtual int GetAudioOutCount();
virtual bool Init();
virtual int GetMidiInCount();
virtual int GetMidiOutCount();
virtual bool PromptUser();
virtual sampleCount GetLatency();
virtual sampleCount GetTailSize();
virtual bool Process();
virtual void SetSampleRate(sampleCount rate);
virtual sampleCount GetBlockSize(sampleCount maxBlockSize);
virtual void End();
virtual bool IsReady();
virtual bool ProcessInitialize();
virtual bool ProcessFinalize();
virtual sampleCount ProcessBlock(float **inbuf, float **outbuf, sampleCount size);
virtual bool RealtimeInitialize(int numChannels, float sampleRate);
virtual bool RealtimeFinalize();
virtual bool RealtimeSuspend();
virtual bool RealtimeResume();
virtual sampleCount RealtimeProcess(float **inbuf, float **outbuf, sampleCount size);
virtual bool ShowInterface(void *parent);
// VSTEffect implementation
// VST plugin -> host callback
static intptr_t AudioMaster(AEffect *effect,
int32_t opcode,
int32_t index,
intptr_t value,
void * ptr,
float opt);
void OnTimer();
private:
// Plugin loading and unloading
bool Load();
void Unload();
// Plugin probing
// Parameter loading and saving
void LoadParameters(const wxString & group);
void SaveParameters(const wxString & group);
static int Scan();
static void Check(const wxChar *fname);
static void ScanOnePlugin( const wxString & file );
static int ShowPluginListDialog( const wxArrayString & files );
static void ShowProgressDialog( const wxString & longest, const wxArrayString & files );
// Base64 encoding and decoding
static wxString b64encode(const void *in, int len);
static int b64decode(wxString in, void *out);
// Utility methods
int GetChannels();
VstTimeInfo *GetTimeInfo();
float GetSampleRate();
int GetProcessLevel();
void SetBufferDelay(int samples);
int NeedIdle();
void NeedIdle();
void NeedEditIdle(bool state);
void UpdateDisplay();
void SizeWindow(int w, int h);
void PowerOn();
void PowerOff();
void InterfaceClosed();
int GetString(wxString & outstr, int opcode, int index = 0);
wxString GetString(int opcode, int index = 0);
@ -93,54 +143,93 @@ class VSTEffect:public Effect
// VST methods
intptr_t callDispatcher(int opcode, int index, intptr_t value, void *ptr, float opt);
void callProcess(float **inputs, float **outputs, int sampleframes);
void callProcessReplacing(float **inputs, float **outputs, int sampleframes);
void callSetParameter(int index, float parameter);
float callGetParameter(int index);
private:
bool ProcessStereo(int count,
WaveTrack *left,
WaveTrack *right,
sampleCount lstart,
sampleCount rstart,
sampleCount len);
EffectHostInterface *mHost;
PluginID mID;
wxString mPath;
int mAudioIns;
int mAudioOuts;
int mMidiIns;
int mMidiOuts;
float mSampleRate;
sampleCount mUserBlockSize;
wxString mName;
wxString mVendor;
wxString mDescription;
int mVersion;
bool mInteractive;
bool mReady;
#if defined(__WXMAC__)
// Cheating a little ... type is really CFBundle
void *mBundleRef;
// Cheating a little ... type is really CFBundleRefNum
int mResource;
void *mBundleRef; // Cheating a little ... type is really CFBundle
int mResource; // Cheating a little ... type is really CFBundle
#endif
void *mModule;
AEffect *mAEffect;
VSTEffectDialog *mDlg;
wxString mVendor;
wxString mName;
VstTimeInfo mTimeInfo;
bool mUseBufferDelay;
int mBufferDelay;
int mBufferSize;
sampleCount mBlockSize;
sampleCount mWTBlockSize;
float **mInBuffer;
float **mOutBuffer;
int mInputs;
int mOutputs;
int mChannels;
int mProcessLevel;
bool mHasPower;
bool mWantsIdle;
bool mWantsEditIdle;
wxCRIT_SECT_DECLARE_MEMBER(mDispatcherLock);
VSTEffectTimer *mTimer;
int mTimerGuard;
friend class VSTEffectDialog;
friend class VSTEffectsModule;
};
void RegisterVSTEffects();
class VSTEffectsModule : public ModuleInterface
{
public:
VSTEffectsModule(ModuleManagerInterface *moduleManager, const wxString *path);
virtual ~VSTEffectsModule();
// IdentInterface implementatino
virtual wxString GetID();
virtual wxString GetPath();
virtual wxString GetName();
virtual wxString GetVendor();
virtual wxString GetVersion();
virtual wxString GetDescription();
// ModuleInterface implementation
virtual bool Initialize();
virtual void Terminate();
virtual bool AutoRegisterPlugins(PluginManagerInterface & pm);
virtual wxArrayString FindPlugins(PluginManagerInterface & pm);
virtual bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path);
virtual void *CreateInstance(const PluginID & ID, const wxString & path);
// VSTEffectModule implementation
static void Check(const wxChar *path);
private:
ModuleManagerInterface *mModMan;
wxString mPath;
};
#endif // USE_VST

View File

@ -107,6 +107,7 @@ const int effEditOpen = 14;
const int effEditClose = 15;
const int effEditIdle = 19;
const int effEditTop = 20;
const int effIdentify = 22; // from http://www.asseca.org/vst-24-specs/efIdentify.html
const int effGetChunk = 23; // from Ardour
const int effSetChunk = 24; // from Ardour
const int effProcessEvents = 25;
@ -277,8 +278,7 @@ public:
void *user;
// Id 48-4b
int32_t uniqueID;
// Don't know 4c-4f
char unknown1[4];
int32_t version;
// processReplacing 50-53
void (* processReplacing)( AEffect * , float * * , float * * , int );

View File

@ -113,7 +113,7 @@ AudioUnitEffect::~AudioUnitEffect()
wxString AudioUnitEffect::GetEffectName()
{
return mName;
return mName + wxT("...");
}
std::set<wxString> AudioUnitEffect::GetEffectCategories()

View File

@ -66,7 +66,33 @@ WX_DEFINE_LIST(UnusableImportPluginList);
WX_DEFINE_LIST(FormatList);
WX_DEFINE_OBJARRAY(ExtImportItems);
// ============================================================================
//
// Return reference to singleton
//
// (Thread-safe...no active threading during construction or after destruction)
// ============================================================================
Importer Importer::mInstance;
Importer & Importer::Get()
{
return mInstance;
}
Importer::Importer()
{
mExtImportItems = NULL;
}
Importer::~Importer()
{
if (mExtImportItems != NULL)
{
delete mExtImportItems;
mExtImportItems = NULL;
}
}
bool Importer::Initialize()
{
mImportPluginList = new ImportPluginList;
mUnusableImportPluginList = new UnusableImportPluginList;
@ -92,17 +118,19 @@ Importer::Importer()
#endif
ReadImportItems();
return true;
}
Importer::~Importer()
bool Importer::Terminate()
{
WriteImportItems();
mImportPluginList->DeleteContents(true);
delete mImportPluginList;
mUnusableImportPluginList->DeleteContents(true);//JKC
delete mUnusableImportPluginList;
if (this->mExtImportItems != NULL)
delete this->mExtImportItems;
return true;
}
void Importer::GetSupportedImportFormats(FormatList *formatList)

View File

@ -92,6 +92,17 @@ public:
Importer();
~Importer();
/**
* Return instance reference
*/
static Importer & Get();
/**
* Initialization/Termination
*/
bool Initialize();
bool Terminate();
/**
* Fills @formatList with a list of supported import formats
*/
@ -136,6 +147,7 @@ public:
wxString &errorMessage);
private:
static Importer mInstance;
ExtImportItems *mExtImportItems;
ImportPluginList *mImportPluginList;

View File

@ -23,6 +23,7 @@
#include "../AudacityApp.h"
#include "../Languages.h"
#include "../PluginManager.h"
#include "../Prefs.h"
#include "../ShuttleGui.h"
@ -133,7 +134,19 @@ void EffectsPrefs::PopulateOrExchange(ShuttleGui & S)
}
S.EndStatic();
#endif
}
void EffectsPrefs::SetState(const wxString & family, const wxString & key)
{
PluginManager & pm = PluginManager::Get();
bool state = gPrefs->Read(wxT("/Nyquist/Enable"), true);
const PluginDescriptor *plug = pm.GetFirstPluginForEffectFamily(family);
while (plug)
{
pm.EnablePlugin(plug->GetID(), state);
plug = pm.GetNextPluginForEffectFamily(family);
}
}
bool EffectsPrefs::Apply()
@ -141,5 +154,25 @@ bool EffectsPrefs::Apply()
ShuttleGui S(this, eIsSavingToPrefs);
PopulateOrExchange(S);
#ifdef USE_NYQUIST
SetState(wxT("Nyquist"), wxT("/Nyquist/Enable"));
#endif
#ifdef USE_LADSPA
SetState(wxT("Ladspa"), wxT("/Ladspa/Enable"));
#endif
#ifdef USE_LV2
SetState(wxT("LV2"), wxT("/LV2/Enable"));
#endif
#ifdef USE_AUDIO_UNITS
SetState(wxT("AudioUnit"), wxT("/AudioUnits/Enable"));
#endif
#ifdef USE_VAMP
SetState(wxT("VAMP"), wxT("/VAMP/Enable"));
#endif
return true;
}

View File

@ -32,6 +32,7 @@ class EffectsPrefs:public PrefsPanel
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void SetState(const wxString & family, const wxString & key);
};
#endif

View File

@ -134,7 +134,7 @@ void ExtImportPrefs::PopulateOrExchange(ShuttleGui & S)
PluginList->InsertColumn (0, _("Importer order"));
PluginList->SetDropTarget (dragtarget2);
ExtImportItems *items = wxGetApp().mImporter->GetImportItems();
ExtImportItems *items = Importer::Get().GetImportItems();
for (unsigned int i = 0; i < items->Count(); i++)
AddItemToTable (i, &(*items)[i]);
if (items->Count() > 0)
@ -200,7 +200,7 @@ void ExtImportPrefs::SwapPluginRows (int row1, int row2)
long d, d2;
ImportPlugin *ip1, *ip2;
ExtImportItems *items = wxGetApp().mImporter->GetImportItems();
ExtImportItems *items = Importer::Get().GetImportItems();
ExtImportItem *item = &(*items)[last_selected];
t = PluginList->GetItemText (row1);
@ -249,7 +249,7 @@ bool ExtImportPrefs::DoOnPluginKeyDown (int code)
if (last_selected == -1)
return false;
ExtImportItems *items = wxGetApp().mImporter->GetImportItems();
ExtImportItems *items = Importer::Get().GetImportItems();
ExtImportItem *item = &(*items)[last_selected];
if (code == WXK_UP && itemIndex == 0)
@ -296,7 +296,7 @@ void ExtImportPrefs::SwapRows (int row1, int row2)
row1 = row2;
row2 = t;
}
ExtImportItems *items = wxGetApp().mImporter->GetImportItems();
ExtImportItems *items = Importer::Get().GetImportItems();
t1 = items->Detach(row1);
t2 = items->Detach(row1);
items->Insert (t1, row1);
@ -399,7 +399,7 @@ void ExtImportPrefs::OnRuleTableSelectRange (wxGridRangeSelectEvent& event)
void ExtImportPrefs::DoOnRuleTableSelect (int toprow)
{
ExtImportItems *items = wxGetApp().mImporter->GetImportItems();
ExtImportItems *items = Importer::Get().GetImportItems();
if (toprow < 0 || toprow > (int)items->GetCount())
{
@ -451,7 +451,7 @@ void ExtImportPrefs::OnRuleTableEdit (wxGridEvent& event)
{
int row = event.GetRow();
int col = event.GetCol();
ExtImportItems *items = wxGetApp().mImporter->GetImportItems();
ExtImportItems *items = Importer::Get().GetImportItems();
ExtImportItem *item = &(*items)[row];
RuleTable->SaveEditControlValue();
@ -460,7 +460,7 @@ void ExtImportPrefs::OnRuleTableEdit (wxGridEvent& event)
bool askedAboutSpaces = false;
wxArrayString vals;
wxString delims(wxT(":"));
wxGetApp().mImporter->StringToList (val, delims, vals);
Importer::Get().StringToList (val, delims, vals);
switch (col)
{
case 0:
@ -554,8 +554,8 @@ void ExtImportPrefs::AddItemToTable (int index, ExtImportItem *item)
void ExtImportPrefs::OnAddRule(wxCommandEvent& WXUNUSED(event))
{
ExtImportItems *items = wxGetApp().mImporter->GetImportItems();
ExtImportItem *item = wxGetApp().mImporter->CreateDefaultImportItem();
ExtImportItems *items = Importer::Get().GetImportItems();
ExtImportItem *item = Importer::Get().CreateDefaultImportItem();
items->Add (item);
AddItemToTable (RuleTable->GetNumberRows (), item);
@ -568,7 +568,7 @@ void ExtImportPrefs::OnDelRule(wxCommandEvent& WXUNUSED(event))
{
if (last_selected < 0)
return;
ExtImportItems *items = wxGetApp().mImporter->GetImportItems();
ExtImportItems *items = Importer::Get().GetImportItems();
int msgres = wxMessageBox (_("Do you really want to delete selected rule?"),
_("Rule deletion confirmation"), wxYES_NO, RuleTable);

View File

@ -175,6 +175,12 @@ void EditToolBar::Populate()
mButtons[ETBSyncLockID]->PushDown();
#endif
#if defined(EXPERIMENTAL_EFFECTS_RACK)
AddSeparator();
AddButton(bmpEditEffects, bmpEditEffects, bmpEditEffects, ETBEffectsID,
_("Show Effects Rack"), true);
#endif
RegenerateTooltips();
}
@ -206,6 +212,10 @@ void EditToolBar::RegenerateTooltips()
mButtons[ETBZoomOutID]->SetToolTip(_("Zoom Out"));
mButtons[ETBZoomSelID]->SetToolTip(_("Fit Selection"));
mButtons[ETBZoomFitID]->SetToolTip(_("Fit Project"));
#if defined(EXPERIMENTAL_EFFECTS_RACK)
mButtons[ETBEffectsID]->SetToolTip(_("Open Effects Rack"));
#endif
#endif
}
@ -263,6 +273,11 @@ void EditToolBar::OnButton(wxCommandEvent &event)
case ETBZoomFitID:
p->OnZoomFit();
break;
#if defined(EXPERIMENTAL_EFFECTS_RACK)
case ETBEffectsID:
EffectManager::Get().ShowRack();
break;
#endif
}
SetButton(false, mButtons[id]);

View File

@ -51,6 +51,10 @@ enum {
ETBZoomSelID,
ETBZoomFitID,
#if defined(EXPERIMENTAL_EFFECTS_RACK)
ETBEffectsID,
#endif
ETBNumButtons
};

View File

@ -409,7 +409,7 @@ void AButton::Click()
{
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
GetEventHandler()->AddPendingEvent(event);
}
void AButton::SetShift(bool shift)

View File

@ -1030,7 +1030,7 @@ ProgressDialog::ProgressDialog(const wxString & title, const wxString & message,
#if defined(__WXGTK__)
// Under GTK, when applying any effect that prompts the user, it's more than
// like that FindFocus() will return NULL. So, make sure something has focus.
// likely that FindFocus() will return NULL. So, make sure something has focus.
if (GetParent()) {
GetParent()->SetFocus();
}
@ -1245,11 +1245,34 @@ ProgressDialog::~ProgressDialog()
}
#endif
if (mHadFocus) {
// Restore saved focus, but only if the window still exists.
//
// It is possible that it was a deferred deletion and it was deleted since
// we captured the focused window. So, we need to verify that the window
// still exists by searching all of the wxWidgets windows. It's the only
// sure way.
if (mHadFocus && SearchForWindow(wxTopLevelWindows, mHadFocus)) {
mHadFocus->SetFocus();
}
}
//
// Recursivaly search the window list for the given window.
//
bool ProgressDialog::SearchForWindow(const wxWindowList & list, const wxWindow *searchfor)
{
wxWindowList::compatibility_iterator node = list.GetFirst();
while (node) {
wxWindow *win = node->GetData();
if (win == searchfor || SearchForWindow(win->GetChildren(), searchfor)) {
return true;
}
node = node->GetNext();
}
return false;
}
//
// Show/Hide the dialog
//

View File

@ -83,6 +83,8 @@ class AUDACITY_DLL_API ProgressDialog:public wxDialog
bool mStop;
private:
bool SearchForWindow(const wxWindowList & list, const wxWindow *searchfor);
wxWindow *mHadFocus;
wxStaticText *mMessage;
wxWindowDisabler *mDisable;

View File

@ -92,7 +92,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<AdditionalIncludeDirectories>$(WXWIN)\lib\vc_dll\mswu;$(WXWIN)\include;..\..;..\..\..\lib-src\expat\lib;..\..\..\lib-src\FileDialog;..\..\..\lib-src\FileDialog\win;..\..\..\lib-src\ffmpeg\win32;..\..\..\lib-src\ffmpeg;..\..\..\lib-src\lib-widget-extra;..\..\..\lib-src\libflac\include;..\..\..\lib-src\libid3tag;..\..\..\lib-src\libmad\msvc++;..\..\..\lib-src\libmad;..\..\..\lib-src\libnyquist;..\..\..\lib-src\libogg\include;..\..\..\lib-src\libresample\include;..\..\..\lib-src\libsamplerate\src;..\..\..\lib-src\libscorealign;..\libsndfile;..\..\..\lib-src\libsoxr\src;..\..\..\lib-src\libvamp;..\..\..\lib-src\libvorbis\include;..\..\..\lib-src\portaudio-v19\include;..\..\..\lib-src\portmixer\include;..\..\..\lib-src\portsmf;..\..\..\lib-src\sbsms\include;..\..\..\lib-src\soundtouch\include;..\..\..\lib-src\twolame\libtwolame;..\..\..\lib-src\portmidi\pm_common;..\..\..\lib-src\portmidi\pm_win;..\..\..\lib-src\portmidi\porttime;..\..\..\lib-src\lv2\lilv;..\..\..\lib-src\lv2\lv2;..\..\..\lib-src\lame;$(GSTREAMER_SDK)\include\gstreamer-1.0;$(GSTREAMER_SDK)\include\glib-2.0;$(GSTREAMER_SDK)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(WXWIN)\lib\vc_dll\mswu;$(WXWIN)\include;..\..;..\..\..\include;..\..\..\lib-src\expat\lib;..\..\..\lib-src\FileDialog;..\..\..\lib-src\FileDialog\win;..\..\..\lib-src\ffmpeg\win32;..\..\..\lib-src\ffmpeg;..\..\..\lib-src\lib-widget-extra;..\..\..\lib-src\libflac\include;..\..\..\lib-src\libid3tag;..\..\..\lib-src\libmad\msvc++;..\..\..\lib-src\libmad;..\..\..\lib-src\libnyquist;..\..\..\lib-src\libogg\include;..\..\..\lib-src\libresample\include;..\..\..\lib-src\libsamplerate\src;..\..\..\lib-src\libscorealign;..\libsndfile;..\..\..\lib-src\libsoxr\src;..\..\..\lib-src\libvamp;..\..\..\lib-src\libvorbis\include;..\..\..\lib-src\portaudio-v19\include;..\..\..\lib-src\portmixer\include;..\..\..\lib-src\portsmf;..\..\..\lib-src\sbsms\include;..\..\..\lib-src\soundtouch\include;..\..\..\lib-src\twolame\libtwolame;..\..\..\lib-src\portmidi\pm_common;..\..\..\lib-src\portmidi\pm_win;..\..\..\lib-src\portmidi\porttime;..\..\..\lib-src\lv2\lilv;..\..\..\lib-src\lv2\lv2;..\..\..\lib-src\lame;$(GSTREAMER_SDK)\include\gstreamer-1.0;$(GSTREAMER_SDK)\include\glib-2.0;$(GSTREAMER_SDK)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BUILDING_AUDACITY;FLAC__NO_DLL;XML_STATIC;__STDC_CONSTANT_MACROS;WXUSINGDLL;__WXMSW__;NDEBUG;WIN32;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@ -123,7 +123,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='wx3-Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<AdditionalIncludeDirectories>$(WXWIN3)\lib\vc_dll\mswu;$(WXWIN3)\include;..\..;..\..\..\lib-src\expat\lib;..\..\..\lib-src\FileDialog;..\..\..\lib-src\FileDialog\win;..\..\..\lib-src\ffmpeg\win32;..\..\..\lib-src\ffmpeg;..\..\..\lib-src\lib-widget-extra;..\..\..\lib-src\libflac\include;..\..\..\lib-src\libid3tag;..\..\..\lib-src\libmad\msvc++;..\..\..\lib-src\libmad;..\..\..\lib-src\libnyquist;..\..\..\lib-src\libogg\include;..\..\..\lib-src\libresample\include;..\..\..\lib-src\libsamplerate\src;..\..\..\lib-src\libscorealign;..\libsndfile;..\..\..\lib-src\libsoxr\src;..\..\..\lib-src\libvamp;..\..\..\lib-src\libvorbis\include;..\..\..\lib-src\portaudio-v19\include;..\..\..\lib-src\portmixer\include;..\..\..\lib-src\portsmf;..\..\..\lib-src\sbsms\include;..\..\..\lib-src\soundtouch\include;..\..\..\lib-src\twolame\libtwolame;..\..\..\lib-src\portmidi\pm_common;..\..\..\lib-src\portmidi\pm_win;..\..\..\lib-src\portmidi\porttime;..\..\..\lib-src\lv2\lilv;..\..\..\lib-src\lv2\lv2;..\..\..\lib-src\lame;$(GSTREAMER_SDK)\include\gstreamer-1.0;$(GSTREAMER_SDK)\include\glib-2.0;$(GSTREAMER_SDK)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(WXWIN3)\lib\vc_dll\mswu;$(WXWIN3)\include;..\..;..\..\..\include;..\..\..\lib-src\expat\lib;..\..\..\lib-src\FileDialog;..\..\..\lib-src\FileDialog\win;..\..\..\lib-src\ffmpeg\win32;..\..\..\lib-src\ffmpeg;..\..\..\lib-src\lib-widget-extra;..\..\..\lib-src\libflac\include;..\..\..\lib-src\libid3tag;..\..\..\lib-src\libmad\msvc++;..\..\..\lib-src\libmad;..\..\..\lib-src\libnyquist;..\..\..\lib-src\libogg\include;..\..\..\lib-src\libresample\include;..\..\..\lib-src\libsamplerate\src;..\..\..\lib-src\libscorealign;..\libsndfile;..\..\..\lib-src\libsoxr\src;..\..\..\lib-src\libvamp;..\..\..\lib-src\libvorbis\include;..\..\..\lib-src\portaudio-v19\include;..\..\..\lib-src\portmixer\include;..\..\..\lib-src\portsmf;..\..\..\lib-src\sbsms\include;..\..\..\lib-src\soundtouch\include;..\..\..\lib-src\twolame\libtwolame;..\..\..\lib-src\portmidi\pm_common;..\..\..\lib-src\portmidi\pm_win;..\..\..\lib-src\portmidi\porttime;..\..\..\lib-src\lv2\lilv;..\..\..\lib-src\lv2\lv2;..\..\..\lib-src\lame;$(GSTREAMER_SDK)\include\gstreamer-1.0;$(GSTREAMER_SDK)\include\glib-2.0;$(GSTREAMER_SDK)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BUILDING_AUDACITY;FLAC__NO_DLL;XML_STATIC;__STDC_CONSTANT_MACROS;WXUSINGDLL;__WXMSW__;NDEBUG;WIN32;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@ -155,7 +155,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(WXWIN)\lib\vc_dll\mswud;$(WXWIN)\include;..\..;..\..\..\lib-src\expat\lib;..\..\..\lib-src\FileDialog;..\..\..\lib-src\FileDialog\win;..\..\..\lib-src\lib-widget-extra;..\..\..\lib-src\libflac\include;..\..\..\lib-src\libid3tag;..\..\..\lib-src\libmad\msvc++;..\..\..\lib-src\libmad;..\..\..\lib-src\libnyquist;..\..\..\lib-src\libogg\include;..\..\..\lib-src\libresample\include;..\..\..\lib-src\libsamplerate\src;..\..\..\lib-src\libscorealign;..\libsndfile;..\..\..\lib-src\libsoxr\src;..\..\..\lib-src\libvamp;..\..\..\lib-src\libvorbis\include;..\..\..\lib-src\portaudio-v19\include;..\..\..\lib-src\portmixer\include;..\..\..\lib-src\portsmf;..\..\..\lib-src\sbsms\include;..\..\..\lib-src\soundtouch\include;..\..\..\lib-src\twolame\libtwolame;..\..\..\lib-src\portmidi\pm_common;..\..\..\lib-src\portmidi\pm_win;..\..\..\lib-src\portmidi\porttime;..\..\..\lib-src\ffmpeg\win32;..\..\..\lib-src\ffmpeg;..\..\..\lib-src\lv2\lilv;..\..\..\lib-src\lv2\lv2;..\..\..\lib-src\lame;&amp;quot;$(GSTREAMER_SDK)\include\gstreamer-1.0;$(GSTREAMER_SDK)\include\glib-2.0;$(GSTREAMER_SDK)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(WXWIN)\lib\vc_dll\mswud;$(WXWIN)\include;..\..;..\..\..\include;..\..\..\lib-src\expat\lib;..\..\..\lib-src\FileDialog;..\..\..\lib-src\FileDialog\win;..\..\..\lib-src\lib-widget-extra;..\..\..\lib-src\libflac\include;..\..\..\lib-src\libid3tag;..\..\..\lib-src\libmad\msvc++;..\..\..\lib-src\libmad;..\..\..\lib-src\libnyquist;..\..\..\lib-src\libogg\include;..\..\..\lib-src\libresample\include;..\..\..\lib-src\libsamplerate\src;..\..\..\lib-src\libscorealign;..\libsndfile;..\..\..\lib-src\libsoxr\src;..\..\..\lib-src\libvamp;..\..\..\lib-src\libvorbis\include;..\..\..\lib-src\portaudio-v19\include;..\..\..\lib-src\portmixer\include;..\..\..\lib-src\portsmf;..\..\..\lib-src\sbsms\include;..\..\..\lib-src\soundtouch\include;..\..\..\lib-src\twolame\libtwolame;..\..\..\lib-src\portmidi\pm_common;..\..\..\lib-src\portmidi\pm_win;..\..\..\lib-src\portmidi\porttime;..\..\..\lib-src\ffmpeg\win32;..\..\..\lib-src\ffmpeg;..\..\..\lib-src\lv2\lilv;..\..\..\lib-src\lv2\lv2;..\..\..\lib-src\lame;&amp;quot;$(GSTREAMER_SDK)\include\gstreamer-1.0;$(GSTREAMER_SDK)\include\glib-2.0;$(GSTREAMER_SDK)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BUILDING_AUDACITY;FLAC__NO_DLL;XML_STATIC;__STDC_CONSTANT_MACROS;WXUSINGDLL;__WXMSW__;__WXDEBUG__;_DEBUG;WIN32;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@ -191,7 +191,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='wx3-Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(WXWIN3)\lib\vc_dll\mswud;$(WXWIN3)\include;..\..;..\..\..\lib-src\expat\lib;..\..\..\lib-src\FileDialog;..\..\..\lib-src\FileDialog\win;..\..\..\lib-src\lib-widget-extra;..\..\..\lib-src\libflac\include;..\..\..\lib-src\libid3tag;..\..\..\lib-src\libmad\msvc++;..\..\..\lib-src\libmad;..\..\..\lib-src\libnyquist;..\..\..\lib-src\libogg\include;..\..\..\lib-src\libresample\include;..\..\..\lib-src\libsamplerate\src;..\..\..\lib-src\libscorealign;..\libsndfile;..\..\..\lib-src\libsoxr\src;..\..\..\lib-src\libvamp;..\..\..\lib-src\libvorbis\include;..\..\..\lib-src\portaudio-v19\include;..\..\..\lib-src\portmixer\include;..\..\..\lib-src\portsmf;..\..\..\lib-src\sbsms\include;..\..\..\lib-src\soundtouch\include;..\..\..\lib-src\twolame\libtwolame;..\..\..\lib-src\portmidi\pm_common;..\..\..\lib-src\portmidi\pm_win;..\..\..\lib-src\portmidi\porttime;..\..\..\lib-src\ffmpeg\win32;..\..\..\lib-src\ffmpeg;..\..\..\lib-src\lv2\lilv;..\..\..\lib-src\lv2\lv2;..\..\..\lib-src\lame;&amp;quot;$(GSTREAMER_SDK)\include\gstreamer-1.0;$(GSTREAMER_SDK)\include\glib-2.0;$(GSTREAMER_SDK)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(WXWIN3)\lib\vc_dll\mswud;$(WXWIN3)\include;..\..;..\..\..\include;..\..\..\lib-src\expat\lib;..\..\..\lib-src\FileDialog;..\..\..\lib-src\FileDialog\win;..\..\..\lib-src\lib-widget-extra;..\..\..\lib-src\libflac\include;..\..\..\lib-src\libid3tag;..\..\..\lib-src\libmad\msvc++;..\..\..\lib-src\libmad;..\..\..\lib-src\libnyquist;..\..\..\lib-src\libogg\include;..\..\..\lib-src\libresample\include;..\..\..\lib-src\libsamplerate\src;..\..\..\lib-src\libscorealign;..\libsndfile;..\..\..\lib-src\libsoxr\src;..\..\..\lib-src\libvamp;..\..\..\lib-src\libvorbis\include;..\..\..\lib-src\portaudio-v19\include;..\..\..\lib-src\portmixer\include;..\..\..\lib-src\portsmf;..\..\..\lib-src\sbsms\include;..\..\..\lib-src\soundtouch\include;..\..\..\lib-src\twolame\libtwolame;..\..\..\lib-src\portmidi\pm_common;..\..\..\lib-src\portmidi\pm_win;..\..\..\lib-src\portmidi\porttime;..\..\..\lib-src\ffmpeg\win32;..\..\..\lib-src\ffmpeg;..\..\..\lib-src\lv2\lilv;..\..\..\lib-src\lv2\lv2;..\..\..\lib-src\lame;&amp;quot;$(GSTREAMER_SDK)\include\gstreamer-1.0;$(GSTREAMER_SDK)\include\glib-2.0;$(GSTREAMER_SDK)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BUILDING_AUDACITY;FLAC__NO_DLL;XML_STATIC;__STDC_CONSTANT_MACROS;WXUSINGDLL;__WXMSW__;__WXDEBUG__;_DEBUG;WIN32;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@ -247,6 +247,7 @@
<ClCompile Include="..\..\..\src\DeviceManager.cpp" />
<ClCompile Include="..\..\..\src\DirManager.cpp" />
<ClCompile Include="..\..\..\src\Dither.cpp" />
<ClCompile Include="..\..\..\src\effects\EffectRack.cpp" />
<ClCompile Include="..\..\..\src\Envelope.cpp" />
<ClCompile Include="..\..\..\src\FFmpeg.cpp" />
<ClCompile Include="..\..\..\src\FFT.cpp" />
@ -268,7 +269,6 @@
<ClCompile Include="..\..\..\src\LangChoice.cpp" />
<ClCompile Include="..\..\..\src\Languages.cpp" />
<ClCompile Include="..\..\..\src\Legacy.cpp" />
<ClCompile Include="..\..\..\src\LoadModules.cpp" />
<ClCompile Include="..\..\..\src\Lyrics.cpp" />
<ClCompile Include="..\..\..\src\LyricsWindow.cpp" />
<ClCompile Include="..\..\..\src\Matrix.cpp" />
@ -276,6 +276,7 @@
<ClCompile Include="..\..\..\src\Mix.cpp" />
<ClCompile Include="..\..\..\src\MixerBoard.cpp" />
<ClCompile Include="..\..\..\lib-src\lib-widget-extra\NonGuiThread.cpp" />
<ClCompile Include="..\..\..\src\ModuleManager.cpp" />
<ClCompile Include="..\..\..\src\NoteTrack.cpp" />
<ClCompile Include="..\..\..\src\PitchName.cpp" />
<ClCompile Include="..\..\..\src\PlatformCompatibility.cpp" />
@ -493,6 +494,13 @@
<ClCompile Include="..\..\..\src\effects\lv2\LV2PortGroup.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\audacity\ConfigInterface.h" />
<ClInclude Include="..\..\..\include\audacity\EffectInterface.h" />
<ClInclude Include="..\..\..\include\audacity\IdentInterface.h" />
<ClInclude Include="..\..\..\include\audacity\ImporterInterface.h" />
<ClInclude Include="..\..\..\include\audacity\ModuleInterface.h" />
<ClInclude Include="..\..\..\include\audacity\PluginInterface.h" />
<ClInclude Include="..\..\..\include\audacity\Types.h" />
<ClInclude Include="..\..\..\src\AboutDialog.h" />
<ClInclude Include="..\..\..\src\AColor.h" />
<ClInclude Include="..\..\..\src\AllThemeResources.h" />
@ -508,10 +516,12 @@
<ClInclude Include="..\..\..\src\BlockFile.h" />
<ClInclude Include="..\..\..\src\CaptureEvents.h" />
<ClInclude Include="..\..\..\src\commands\OpenSaveCommands.h" />
<ClInclude Include="..\..\..\src\effects\EffectRack.h" />
<ClInclude Include="..\..\..\src\import\FormatClassifier.h" />
<ClInclude Include="..\..\..\src\import\ImportGStreamer.h" />
<ClInclude Include="..\..\..\src\import\MultiFormatReader.h" />
<ClInclude Include="..\..\..\src\import\SpecPowerMeter.h" />
<ClInclude Include="..\..\..\src\ModuleManager.h" />
<ClInclude Include="..\..\..\src\SseMathFuncs.h" />
<ClInclude Include="..\..\..\src\widgets\HelpSystem.h" />
<ClInclude Include="..\..\configwin.h" />
@ -537,7 +547,6 @@
<ClInclude Include="..\..\..\src\LangChoice.h" />
<ClInclude Include="..\..\..\src\Languages.h" />
<ClInclude Include="..\..\..\src\Legacy.h" />
<ClInclude Include="..\..\..\src\LoadModules.h" />
<ClInclude Include="..\..\..\src\Lyrics.h" />
<ClInclude Include="..\..\..\src\LyricsWindow.h" />
<ClInclude Include="..\..\..\src\MacroMagic.h" />

View File

@ -61,6 +61,12 @@
<Filter Include="src/effects/lv2">
<UniqueIdentifier>{cfbc5496-9828-4c04-8e02-35a5e81cf092}</UniqueIdentifier>
</Filter>
<Filter Include="includes">
<UniqueIdentifier>{ce332b42-4385-473c-ad9c-f385ea2e6c73}</UniqueIdentifier>
</Filter>
<Filter Include="includes\audacity">
<UniqueIdentifier>{2bfa6793-371a-4d2e-b3f4-fb033a0c5729}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\AboutDialog.cpp">
@ -165,9 +171,6 @@
<ClCompile Include="..\..\..\src\Legacy.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\LoadModules.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\Lyrics.cpp">
<Filter>src</Filter>
</ClCompile>
@ -822,6 +825,12 @@
<ClCompile Include="..\..\..\src\import\MultiFormatReader.cpp">
<Filter>src/import</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\ModuleManager.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\effects\EffectRack.cpp">
<Filter>src/effects</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\src\AboutDialog.h">
@ -935,9 +944,6 @@
<ClInclude Include="..\..\..\src\Legacy.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\LoadModules.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\Lyrics.h">
<Filter>src</Filter>
</ClInclude>
@ -1616,6 +1622,33 @@
<ClInclude Include="..\..\..\src\import\MultiFormatReader.h">
<Filter>src/import</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\audacity\ConfigInterface.h">
<Filter>includes\audacity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\audacity\EffectInterface.h">
<Filter>includes\audacity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\audacity\IdentInterface.h">
<Filter>includes\audacity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\audacity\ImporterInterface.h">
<Filter>includes\audacity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\audacity\ModuleInterface.h">
<Filter>includes\audacity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\audacity\PluginInterface.h">
<Filter>includes\audacity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\audacity\Types.h">
<Filter>includes\audacity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\ModuleManager.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\effects\EffectRack.h">
<Filter>src/effects</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="..\..\audacity.ico">