1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-05 06:39:26 +02:00

Merge branch 'master' into scrubbing-temp

This commit is contained in:
Paul Licameli 2015-05-28 20:18:04 -04:00
commit 6e1f76d60d
14 changed files with 159 additions and 47 deletions

13
lib-src/mod-nyq-bench/NyqBench.cpp Normal file → Executable file
View File

@ -689,10 +689,6 @@ NyqBench::NyqBench(wxWindow * parent)
mScript = NULL;
mOutput = NULL;
// No need to delete...EffectManager will do it
mEffect = new NyquistEffect(wxT("===nyquistworker==="));
EffectManager::Get().RegisterEffect(mEffect);
mPath = gPrefs->Read(wxT("NyqBench/Path"), wxEmptyString);
mAutoLoad = (gPrefs->Read(wxT("NyqBench/AutoLoad"), 0L) != 0);
mAutoWrap = (gPrefs->Read(wxT("NyqBench/AutoWrap"), true) != 0);
@ -1353,6 +1349,10 @@ void NyqBench::OnLargeIcons(wxCommandEvent & e)
void NyqBench::OnGo(wxCommandEvent & e)
{
// No need to delete...EffectManager will do it
mEffect = new NyquistEffect(wxT("Nyquist Effect Workbench"));
const PluginID & ID = EffectManager::Get().RegisterEffect(mEffect);
mEffect->SetCommand(mScript->GetValue());
mEffect->RedirectOutput();
@ -1366,14 +1366,15 @@ void NyqBench::OnGo(wxCommandEvent & e)
mRunning = true;
UpdateWindowUI();
const PluginID & id = EffectManager::Get().GetEffectByIdentifier(mEffect->GetSymbol());
p->OnEffect(id);
p->OnEffect(ID);
mRunning = false;
UpdateWindowUI();
}
Raise();
EffectManager::Get().UnregisterEffect(ID);
}
void NyqBench::OnStop(wxCommandEvent & e)

0
lib-src/mod-nyq-bench/NyqBench.h Normal file → Executable file
View File

View File

@ -66,7 +66,7 @@
</ClCompile>
<Link>
<AdditionalDependencies>audacity.lib;wxbase28ud.lib;wxbase28ud_net.lib;wxmsw28ud_adv.lib;wxmsw28ud_core.lib;wxmsw28ud_html.lib;wxpngd.lib;wxzlibd.lib;wxjpegd.lib;wxtiffd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)modules\$(ProjectName).dll</OutputFile>
<OutputFile>..\..\win\$(ConfigurationName)\modules\$(ProjectName).dll</OutputFile>
<AdditionalLibraryDirectories>..\..\win/$(Configuration);$(WXWIN)\lib\vc_dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -91,7 +91,7 @@ copy "$(TargetPath)" "%25dest%25"
</ClCompile>
<Link>
<AdditionalDependencies>audacity.lib;wxbase28u.lib;wxbase28u_net.lib;wxmsw28u_adv.lib;wxmsw28u_core.lib;wxmsw28u_html.lib;wxpng.lib;wxzlib.lib;wxjpeg.lib;wxtiff.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)modules\$(ProjectName).dll</OutputFile>
<OutputFile>..\..\win\$(ConfigurationName)\modules\$(ProjectName).dll</OutputFile>
<AdditionalLibraryDirectories>../../win/$(Configuration);$(WXWIN)\lib\vc_dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>

View File

@ -11,7 +11,7 @@
isa = PBXAggregateTarget;
buildConfigurationList = 17072E890988BD58008541CC /* Build configuration list for PBXAggregateTarget "Configure" */;
buildPhases = (
17072E8C0988BD85008541CC /* ShellScript */,
17072E8C0988BD85008541CC /* Configure */,
);
dependencies = (
);
@ -6495,6 +6495,7 @@
1790AFAE09883B6D008A330A /* Frameworks */,
28032560131DAFAF0059D002 /* Copy nyquist */,
28032580131DB4960059D002 /* Copy plug-ins */,
28B4FD8E1B17A69D00E033A0 /* Install wxWidgets libs */,
288F0980131A400F0008E860 /* Install manual */,
282413DA131D52CE009FD931 /* Install plugins */,
2892CE28131AFB1900E1E17D /* Install miscellany */,
@ -6806,7 +6807,7 @@
/* End PBXRezBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
17072E8C0988BD85008541CC /* ShellScript */ = {
17072E8C0988BD85008541CC /* Configure */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -6814,6 +6815,7 @@
inputPaths = (
"$(TOPLEVEL)/Makefile.in",
);
name = Configure;
outputPaths = (
"$(TOPLEVEL)/Makefile",
);
@ -6851,6 +6853,7 @@
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "for (( i = 0; i < ${SCRIPT_INPUT_FILE_COUNT}; i++ ))\ndo\n in=\"$(eval echo \\${SCRIPT_INPUT_FILE_${i}})\"\n out=\"$(eval echo \\${SCRIPT_OUTPUT_FILE_${i}})\"\n cp -pPR \"${in}\" \"${out}\" && find \"${out}\" -name .svn -print0 | xargs -0 rm -rf\ndone\n";
showEnvVarsInLog = 0;
};
28032580131DB4960059D002 /* Copy plug-ins */ = {
isa = PBXShellScriptBuildPhase;
@ -6867,6 +6870,7 @@
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "for (( i = 0; i < ${SCRIPT_INPUT_FILE_COUNT}; i++ ))\ndo\n in=\"$(eval echo \\${SCRIPT_INPUT_FILE_${i}})\"\n out=\"$(eval echo \\${SCRIPT_OUTPUT_FILE_${i}})\"\n cp -pPR \"${in}\" \"${out}\" && find \"${out}\" -name .svn -print0 | xargs -0 rm -rf\ndone\n";
showEnvVarsInLog = 0;
};
282413D8131D51FC009FD931 /* Create dist */ = {
isa = PBXShellScriptBuildPhase;
@ -6881,6 +6885,7 @@
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
shellScript = "set -x\n\n# Setup\nVERSION=`awk '/^#define+ AUDACITY_VERSION / {print $3}' Info.plist.h`\nRELEASE=`awk '/^#define+ AUDACITY_RELEASE / {print $3}' Info.plist.h`\nREVISION=`awk '/^#define+ AUDACITY_REVISION / {print $3}' Info.plist.h`\nVERSION=$VERSION.$RELEASE.$REVISION\n\ncd \"${DSTROOT}\"\nchmod -RH \"${INSTALL_MODE_FLAG}\" \"${TARGET_BUILD_DIR}\"\nchown -RH \"${INSTALL_OWNER}:${INSTALL_GROUP}\" \"${TARGET_BUILD_DIR}\"\n\necho \"Audacity has been installed to: ${DSTROOT}\"\n\ncd ..\n\nVOL=\"Audacity $VERSION\"\nDMG=\"audacity-macosx-ub-$VERSION\"\n\n# Preclean\nrm -rf \"$DMG\" \"$DMG.dmg\" TMP.dmg\n\n# Create structure\nmkdir \"$DMG\"\ncp -pR \"${DSTROOT}/\" \"${DMG}\"\n\n#Add a custom icon for the DMG\n#cp -p mac/Resources/Audacity.icns \"${DMG}\"/.VolumeIcon.icns\n\n# Create and mount the image\nhdiutil create -ov -format UDRW -srcdir \"$DMG\" -fs HFS+ -volname \"$VOL\" TMP.dmg\n\n#Mount the DMG and store the name it was mounted with\nTITLE=`hdiutil attach TMP.dmg | grep \\/Volumes | sed \"s/^.*\\/Volumes\\///\"`\n\n#Set the custom icon flag\n#SetFile -a C /Volumes/\"$TITLE\"\n\n#Make our DMG look pretty and install the custom background image\necho '\n tell application \"Finder\"\n tell disk \"'${TITLE}'\"\n open\n set current view of container window to icon view\n set toolbar visible of container window to false\n set statusbar visible of container window to false\n set the bounds of container window to {400, 100, 1000, 550}\n set theViewOptions to the icon view options of container window\n set arrangement of theViewOptions to not arranged\n set icon size of theViewOptions to 72\n set background picture of theViewOptions to file \".background:Audacity-DMG-background.png\" \n make new alias file at container window to POSIX file \"/Applications\" with properties {name:\"Applications\"}\n set position of item \"Audacity\" of container window to {170, 350}\n set position of item \"Applications\" of container window to {430, 350}\n close\n open\n update without registering applications\n delay 5\n eject\n end tell\n end tell\n' | osascript\n\n# Compress and prepare for Internet delivery\nhdiutil convert TMP.dmg -format UDZO -imagekey zlib-level=9 -o \"$DMG.dmg\"\n\n# Create zip version\nrm -rf \"${DMG}/Audacity/help/\"\nzip -r9 \"${DMG}.zip\" \"${DMG}\"\n\n# Cleanup\nrm -rf ${DMG} TMP.dmg\n";
showEnvVarsInLog = 0;
};
282413DA131D52CE009FD931 /* Install plugins */ = {
isa = PBXShellScriptBuildPhase;
@ -6895,6 +6900,7 @@
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
shellScript = "\"${PROJECT_DIR}/build_plugins.sh\"";
showEnvVarsInLog = 0;
};
288F0980131A400F0008E860 /* Install manual */ = {
isa = PBXShellScriptBuildPhase;
@ -6909,6 +6915,21 @@
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
shellScript = "\"${PROJECT_DIR}/build_manual.sh\"";
showEnvVarsInLog = 0;
};
28B4FD8E1B17A69D00E033A0 /* Install wxWidgets libs */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 8;
files = (
);
inputPaths = (
);
name = "Install wxWidgets libs";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
shellScript = "#!/bin/sh\n\nupdate_paths()\n{\n for lib in $(otool -L \"${1}\" | awk '/libwx/{print $1}')\n do \n install_name_tool -change \"${lib}\" @loader_path/../Frameworks/$(basename \"${lib}\") \"${1}\"\n done\n}\n\nEXEPATH=\"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nLIBPATH=\"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}\"\n\nmkdir -p \"${LIBPATH}\"\n\nfor lib in $(otool -L \"${EXEPATH}\" | awk '/libwx/{print $1}')\ndo \n cp -p ${lib} \"${LIBPATH}\"\n install_name_tool -change \"${lib}\" @executable_path/../Frameworks/$(basename \"${lib}\") \"${EXEPATH}\"\n update_paths \"${lib}\"\ndone\n";
};
/* End PBXShellScriptBuildPhase section */
@ -8147,6 +8168,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
/usr/local/lib/hide,
);
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/build/Debug Static\"";
OTHER_CFLAGS = (
@ -8202,6 +8224,7 @@
CONFIG_FLAGS = "";
CONFIG_STATIC = yes;
CONFIG_UNICODE = yes;
COPY_PHASE_STRIP = NO;
FFMPEG_CFLAGS = "-I../lib-src/ffmpeg -D__STDC_CONSTANT_MACROS";
FFMPEG_CXXFLAGS = "$(FFMPEG_CFLAGS)";
FFMPEG_PREFIX = /usr/local;
@ -8215,6 +8238,7 @@
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
STRIP_INSTALLED_PRODUCT = NO;
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";
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";
@ -8467,6 +8491,7 @@
CONFIG_FLAGS = "";
CONFIG_STATIC = no;
CONFIG_UNICODE = yes;
COPY_PHASE_STRIP = NO;
FFMPEG_CFLAGS = "-I../lib-src/ffmpeg -D__STDC_CONSTANT_MACROS";
FFMPEG_CXXFLAGS = "$(FFMPEG_CFLAGS)";
FFMPEG_PREFIX = /usr/local;
@ -8482,11 +8507,12 @@
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
STRIP_INSTALLED_PRODUCT = NO;
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";
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";
WX_CXXFLAGS = "$(WX_CFLAGS)";
WX_LDFLAGS = "-L$(WX_PREFIX)/lib -lwx_macud_html-$(WX_VER) -lwx_macud_adv-$(WX_VER) -lwx_macud_core-$(WX_VER) -lwx_base_carbonud_net-$(WX_VER) -lwx_base_carbonud-$(WX_VER) $(WX_PREFIX)/lib/libwxregexud-$(WX_VER).a $(WX_PREFIX)/lib/libwxexpatd-$(WX_VER).a $(WX_PREFIX)/lib/libwxtiffd-$(WX_VER).a $(WX_PREFIX)/lib/libwxjpegd-$(WX_VER).a $(WX_PREFIX)/lib/libwxpngd-$(WX_VER).a";
WX_LDFLAGS = "-L$(WX_PREFIX)/lib -lwx_macud_qa-$(WX_VER) -lwx_macud_xrc-$(WX_VER) -lwx_macud_html-$(WX_VER) -lwx_macud_adv-$(WX_VER) -lwx_macud_core-$(WX_VER) -lwx_base_carbonud_xml-$(WX_VER) -lwx_base_carbonud_net-$(WX_VER) -lwx_base_carbonud-$(WX_VER) $(WX_PREFIX)/lib/libwxregexud-$(WX_VER).a $(WX_PREFIX)/lib/libwxexpatd-$(WX_VER).a $(WX_PREFIX)/lib/libwxtiffd-$(WX_VER).a $(WX_PREFIX)/lib/libwxjpegd-$(WX_VER).a $(WX_PREFIX)/lib/libwxpngd-$(WX_VER).a";
WX_PREFIX = /usr/local;
WX_VER = 2.8;
ZERO_LINK = NO;
@ -8497,17 +8523,20 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 2812A5B70DF63FE500576305 /* Debug_Shared.xcconfig */;
buildSettings = {
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1)",
"BUILDING_AUDACITY=1",
"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1)",
);
GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1 = "AUDACITY_DLL_API=\"\"";
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = /Audacity;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
/usr/local/lib/hide,
);
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/build/Debug Static\"";
OTHER_CFLAGS = (
@ -8776,6 +8805,7 @@
CONFIG_FLAGS = "";
CONFIG_STATIC = no;
CONFIG_UNICODE = yes;
COPY_PHASE_STRIP = NO;
FFMPEG_CFLAGS = "-I../lib-src/ffmpeg -D__STDC_CONSTANT_MACROS";
FFMPEG_CXXFLAGS = "$(FFMPEG_CFLAGS)";
FFMPEG_PREFIX = /usr/local;
@ -8791,11 +8821,12 @@
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
STRIP_INSTALLED_PRODUCT = NO;
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";
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";
WX_CXXFLAGS = "$(WX_CFLAGS)";
WX_LDFLAGS = "-L$(WX_PREFIX)/lib -lwx_macu_html-$(WX_VER) -lwx_macu_adv-$(WX_VER) -lwx_macu_core-$(WX_VER) -lwx_base_carbonu_net-$(WX_VER) -lwx_base_carbonu-$(WX_VER) $(WX_PREFIX)/lib/libwxregexud-$(WX_VER).a $(WX_PREFIX)/lib/libwxexpatd-$(WX_VER).a $(WX_PREFIX)/lib/libwxtiffd-$(WX_VER).a $(WX_PREFIX)/lib/libwxjpegd-$(WX_VER).a $(WX_PREFIX)/lib/libwxpngd-$(WX_VER).a";
WX_LDFLAGS = "-L$(WX_PREFIX)/lib -lwx_macu_xrc-$(WX_VER) -lwx_macu_qa-$(WX_VER) -lwx_macu_html-$(WX_VER) -lwx_macu_adv-$(WX_VER) -lwx_macu_core-$(WX_VER) -lwx_base_carbonu_xml-$(WX_VER) -lwx_base_carbonu_net-$(WX_VER) -lwx_base_carbonu-$(WX_VER) $(WX_PREFIX)/lib/libwxregexud-$(WX_VER).a $(WX_PREFIX)/lib/libwxexpatd-$(WX_VER).a $(WX_PREFIX)/lib/libwxtiffd-$(WX_VER).a $(WX_PREFIX)/lib/libwxjpegd-$(WX_VER).a $(WX_PREFIX)/lib/libwxpngd-$(WX_VER).a";
WX_PREFIX = /usr/local;
WX_VER = 2.8;
ZERO_LINK = NO;
@ -8806,6 +8837,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 2812A5BB0DF63FFD00576305 /* Release_Shared.xcconfig */;
buildSettings = {
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(TOPLEVEL)/src/AudacityHeaders.h";
GCC_PREPROCESSOR_DEFINITIONS = (
@ -8814,11 +8846,13 @@
"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1)",
);
GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1 = "AUDACITY_DLL_API=\"\"";
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = /Audacity;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
/usr/local/lib/hide,
);
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/build/Debug Static\"";
OTHER_CFLAGS = (
@ -9313,6 +9347,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
/usr/local/lib/hide,
);
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/build/Debug Static\"";
OTHER_CFLAGS = (
@ -9372,6 +9407,7 @@
CONFIG_FLAGS = "";
CONFIG_STATIC = yes;
CONFIG_UNICODE = yes;
COPY_PHASE_STRIP = NO;
FFMPEG_CFLAGS = "-I../lib-src/ffmpeg -D__STDC_CONSTANT_MACROS";
FFMPEG_CXXFLAGS = "$(FFMPEG_CFLAGS)";
FFMPEG_PREFIX = /usr/local;
@ -9385,6 +9421,7 @@
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
STRIP_INSTALLED_PRODUCT = NO;
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";
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";

View File

@ -182,10 +182,16 @@
#define EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
// Paul Licameli (PRL) 24 May 2015
// Allow scrolling up to one half of a screenful beyond either end of the project.
// Allow scrolling up to one half of a screenful beyond either end of the project,
// if you turn on the appropriate Tracks preference.
// This allows smooth-scrolling scrub to work more reasonably at the ends.
#define EXPERIMENTAL_SCROLLING_LIMITS
// Paul Licameli (PRL) 28 May 2015
// Draw negative numbers on the time ruler in a different color, when
// scrolling past zero is enabled. Perhaps that lessens confusion.
#define EXPERIMENTAL_TWO_TONE_TIME_RULER
// Define to include crash reporting
#define EXPERIMENTAL_CRASH_REPORT
#if !defined(wxUSE_DEBUGREPORT) || !wxUSE_DEBUGREPORT

View File

@ -2201,6 +2201,18 @@ const PluginID & PluginManager::RegisterPlugin(EffectIdentInterface *effect)
return plug.GetID();
}
// Here solely for the purpose of Nyquist Workbench until
// a better solution is devised.
void PluginManager::UnregisterPlugin(const PluginID & ID)
{
if (mPlugins.find(ID) == mPlugins.end())
{
return;
}
mPlugins.erase(ID);
}
int PluginManager::GetPluginCount(PluginType type)
{
int num = 0;

View File

@ -262,6 +262,7 @@ public:
// Here solely for the purpose of Nyquist Workbench until
// a better solution is devised.
const PluginID & RegisterPlugin(EffectIdentInterface *effect);
void UnregisterPlugin(const PluginID & ID);
private:
void Load();

View File

@ -1096,7 +1096,7 @@ void AudacityProject::UpdatePrefs()
}
if (mRuler) {
mRuler->RegenerateTooltips();
mRuler->UpdatePrefs();
}
// The toolbars will be recreated, so make sure we don't leave

18
src/effects/EffectManager.cpp Normal file → Executable file
View File

@ -65,10 +65,22 @@ EffectManager::~EffectManager()
// Here solely for the purpose of Nyquist Workbench until
// a better solution is devised.
void EffectManager::RegisterEffect(Effect *f)
const PluginID & EffectManager::RegisterEffect(Effect *f)
{
// This will go away after all effects have been converted
mEffects[PluginManager::Get().RegisterPlugin(f)] = f;
const PluginID & ID = PluginManager::Get().RegisterPlugin(f);
mEffects[ID] = f;
return ID;
}
// Here solely for the purpose of Nyquist Workbench until
// a better solution is devised.
void EffectManager::UnregisterEffect(const PluginID & ID)
{
PluginID id = ID;
PluginManager::Get().UnregisterPlugin(id);
mEffects.erase(id);
}
bool EffectManager::DoEffect(const PluginID & ID,

5
src/effects/EffectManager.h Normal file → Executable file
View File

@ -56,10 +56,11 @@ public:
EffectManager();
virtual ~EffectManager();
/** Register an effect so it can be executed. */
/** (Un)Register an effect so it can be executed. */
// Here solely for the purpose of Nyquist Workbench until
// a better solution is devised.
void RegisterEffect(Effect *f);
const PluginID & RegisterEffect(Effect *f);
void UnregisterEffect(const PluginID & ID);
/** Run an effect given the plugin ID */
// Returns true on success. Will only operate on tracks that

11
src/effects/nyquist/Nyquist.cpp Normal file → Executable file
View File

@ -150,11 +150,6 @@ NyquistEffect::~NyquistEffect()
{
}
void NyquistEffect::RedirectOutput()
{
wxFAIL_MSG(XO("JKC: This function used to exist. Have a look in SVN and see if you can find it") );
}
// IdentInterface implementation
wxString NyquistEffect::GetPath()
@ -1180,6 +1175,12 @@ wxArrayString NyquistEffect::ParseChoice(const NyqControl & ctrl)
return choices;
}
void NyquistEffect::RedirectOutput()
{
mRedirectOutput = true;
}
void NyquistEffect::SetCommand(wxString cmd)
{
mExternal = true;

11
src/import/ImportOGG.cpp Normal file → Executable file
View File

@ -37,10 +37,12 @@
#include <wx/intl.h>
#include "../Audacity.h"
#include "ImportOGG.h"
#include "../Prefs.h"
#include "../Internat.h"
#include "../Tags.h"
#include "ImportOGG.h"
#define DESC _("Ogg Vorbis files")
static const wxChar *exts[] =
@ -104,6 +106,9 @@ public:
mFile(file),
mVorbisFile(vorbisFile)
{
mFormat = (sampleFormat)
gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleFormat"), floatSample);
mStreamInfo = new wxArrayString();
mStreamUsage = new int[vorbisFile->links];
for (int i = 0; i < vorbisFile->links; i++)
@ -151,6 +156,8 @@ private:
int *mStreamUsage;
wxArrayString *mStreamInfo;
WaveTrack ***mChannels;
sampleFormat mFormat;
};
void GetOGGImportPlugin(ImportPluginList *importPluginList,
@ -248,7 +255,7 @@ int OggImportFileHandle::Import(TrackFactory *trackFactory, Track ***outTracks,
mChannels[i] = new WaveTrack *[vi->channels];
for (c = 0; c < vi->channels; c++) {
mChannels[i][c] = trackFactory->NewWaveTrack(int16Sample, vi->rate);
mChannels[i][c] = trackFactory->NewWaveTrack(mFormat, vi->rate);
if (vi->channels == 2) {
switch (c) {

View File

@ -54,6 +54,7 @@ array of Ruler::Label.
*//******************************************************************/
#include "../Audacity.h"
#include "Ruler.h"
#include <math.h>
@ -68,7 +69,6 @@ array of Ruler::Label.
#include "../AudioIO.h"
#include "../Internat.h"
#include "../Project.h"
#include "Ruler.h"
#include "../toolbars/ControlToolBar.h"
#include "../Theme.h"
#include "../AllThemeResources.h"
@ -155,6 +155,8 @@ Ruler::Ruler()
mGridLineLength = 0;
mMajorGrid = false;
mMinorGrid = false;
mTwoTone = false;
}
Ruler::~Ruler()
@ -174,6 +176,11 @@ Ruler::~Ruler()
delete[] mMinorMinorLabels;
}
void Ruler::SetTwoTone(bool twoTone)
{
mTwoTone = twoTone;
}
void Ruler::SetFormat(RulerFormat format)
{
// IntFormat, RealFormat, RealLogFormat, TimeFormat, or LinearDBFormat
@ -734,6 +741,7 @@ void Ruler::Tick(int pos, double d, bool major, bool minor)
else
label = &mMinorMinorLabels[mNumMinorMinor++];
label->value = d;
label->pos = pos;
label->lx = mLeft - 1000; // don't display
label->ly = mTop - 1000; // don't display
@ -844,6 +852,7 @@ void Ruler::TickCustom(int labelIdx, bool major, bool minor)
else
label = &mMinorMinorLabels[labelIdx];
label->value = 0.0;
pos = label->pos; // already stored in label class
l = label->text;
label->lx = mLeft - 1000; // don't display
@ -1255,10 +1264,8 @@ void Ruler::Draw(wxDC& dc, TimeTrack* timetrack)
#ifdef EXPERIMENTAL_THEMING
mDC->SetPen(mPen);
mDC->SetTextForeground(mTickColour);
#else
mDC->SetPen(*wxBLACK_PEN);
mDC->SetTextForeground(*wxBLACK);
#endif
// Draws a long line the length of the ruler.
@ -1316,10 +1323,7 @@ void Ruler::Draw(wxDC& dc, TimeTrack* timetrack)
}
}
if (mMajorLabels[i].text != wxT(""))
mDC->DrawText(mMajorLabels[i].text,
mMajorLabels[i].lx,
mMajorLabels[i].ly);
mMajorLabels[i].Draw(*mDC, mTwoTone);
}
if(mbMinor == true) {
@ -1347,10 +1351,7 @@ void Ruler::Draw(wxDC& dc, TimeTrack* timetrack)
mRight, mTop + pos);
}
}
if (mMinorLabels[i].text != wxT(""))
mDC->DrawText(mMinorLabels[i].text,
mMinorLabels[i].lx,
mMinorLabels[i].ly);
mMinorLabels[i].Draw(*mDC, mTwoTone);
}
}
@ -1382,9 +1383,7 @@ void Ruler::Draw(wxDC& dc, TimeTrack* timetrack)
mRight, mTop + pos);
}
}
mDC->DrawText(mMinorMinorLabels[i].text,
mMinorMinorLabels[i].lx,
mMinorMinorLabels[i].ly);
mMinorMinorLabels[i].Draw(*mDC, mTwoTone);
}
}
}
@ -1453,14 +1452,9 @@ int Ruler::FindZero(Label * label, const int len)
{
int i = 0;
double d = 1.0; // arbitrary
wxString s;
do {
s = label[i].text;
if(!s.IsEmpty())
s.ToDouble(&d);
else
d = 1.0; // arbitrary, looking for some text here
d = label[i].value;
i++;
} while( (i < len) && (d != 0.0) );
@ -1475,6 +1469,7 @@ int Ruler::GetZeroPosition()
int zero;
if((zero = FindZero(mMajorLabels, mNumMajor)) < 0)
zero = FindZero(mMinorLabels, mNumMinor);
// PRL: don't consult minor minor??
return zero;
}
@ -1527,6 +1522,22 @@ void Ruler::SetCustomMinorLabels(wxArrayString *label, int numLabel, int start,
//Remember: delete majorlabels....
}
void Ruler::Label::Draw(wxDC&dc, bool twoTone) const
{
if (text != wxT("")) {
bool altColor = twoTone && value < 0.0;
#ifdef EXPERIMENTAL_THEMING
// TODO: handle color distinction
mDC->SetTextForeground(mTickColour);
#else
dc.SetTextForeground(altColor ? *wxBLUE : *wxBLACK);
#endif
dc.DrawText(text, lx, ly);
}
}
//
// RulerPanel
//
@ -1670,8 +1681,9 @@ AdornedRulerPanel::AdornedRulerPanel(wxWindow* parent,
mPlayRegionDragsSelection = (gPrefs->Read(wxT("/QuickPlay/DragSelection"), 0L) == 1)? true : false;
mQuickPlayEnabled = gPrefs->Read(wxT("/QuickPlay/QuickPlayEnabled"), 1L);
UpdatePrefs();
#if wxUSE_TOOLTIPS
RegenerateTooltips();
wxToolTip::Enable(true);
#endif
@ -1693,6 +1705,20 @@ AdornedRulerPanel::~AdornedRulerPanel()
delete mSnapManager;
}
void AdornedRulerPanel::UpdatePrefs()
{
#ifdef EXPERIMENTAL_SCROLLING_LIMITS
#ifdef EXPERIMENTAL_TWO_TONE_TIME_RULER
{
bool scrollBeyondZero = false;
gPrefs->Read(wxT("/GUI/ScrollBeyondZero"), &scrollBeyondZero, false);
ruler.SetTwoTone(scrollBeyondZero);
}
#endif
#endif
RegenerateTooltips();
}
void AdornedRulerPanel::RegenerateTooltips()
{
#if wxUSE_TOOLTIPS

View File

@ -60,6 +60,9 @@ class AUDACITY_DLL_API Ruler {
// Optional Ruler Parameters
//
// If twoTone is true, cause zero and positive numbers to appear black, negative in another color.
void SetTwoTone(bool twoTone);
// IntFormat, RealFormat, or TimeFormat
void SetFormat(RulerFormat format);
@ -174,9 +177,12 @@ private:
class Label {
public:
double value;
int pos;
int lx, ly;
wxString text;
void Draw(wxDC &dc, bool twoTone) const;
};
int mNumMajor;
@ -206,6 +212,7 @@ private:
bool mMinorGrid; // .
int mGridLineLength; // end
wxString mUnits;
bool mTwoTone;
};
class AUDACITY_DLL_API RulerPanel : public wxPanel {
@ -269,6 +276,7 @@ public:
void SetProject(AudacityProject* project) {mProject = project;};
void GetMaxSize(wxCoord *width, wxCoord *height);
void UpdatePrefs();
void RegenerateTooltips();
bool mIsSnapped;