mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-09 00:50:01 +02:00
Merge branch 'master' into scrubbing
This commit is contained in:
commit
c79b10713f
2
lib-src/FileDialog/FileDialog.h
Normal file → Executable file
2
lib-src/FileDialog/FileDialog.h
Normal file → Executable file
@ -50,6 +50,8 @@ DECLARE_EVENT_TYPE(EVT_FILEDIALOG_SELECTION_CHANGED, -1);
|
||||
DECLARE_EVENT_TYPE(EVT_FILEDIALOG_FILTER_CHANGED, -1);
|
||||
DECLARE_EVENT_TYPE(EVT_FILEDIALOG_ADD_CONTROLS, -1);
|
||||
|
||||
#define FD_NO_ADD_EXTENSION 0x0400
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// wxFileDialog convenience functions
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -328,18 +328,21 @@ wxString FileDialog::GetPath() const
|
||||
|
||||
if (!path.HasExt())
|
||||
{
|
||||
int filterIndex = GetFilterIndex();
|
||||
if (filterIndex != -1)
|
||||
{
|
||||
wxStringTokenizer tokenizer(m_patterns[filterIndex], wxT(";"));
|
||||
if (tokenizer.HasMoreTokens())
|
||||
if (!(m_dialogStyle & FD_NO_ADD_EXTENSION))
|
||||
{
|
||||
int filterIndex = GetFilterIndex();
|
||||
if (filterIndex != -1)
|
||||
{
|
||||
wxString extension = tokenizer.GetNextToken().AfterFirst(wxT('.'));
|
||||
if (extension.Right(2) == wxT("*"))
|
||||
wxStringTokenizer tokenizer(m_patterns[filterIndex], wxT(";"));
|
||||
if (tokenizer.HasMoreTokens())
|
||||
{
|
||||
extension = wxEmptyString;
|
||||
wxString extension = tokenizer.GetNextToken().AfterFirst(wxT('.'));
|
||||
if (extension.Right(2) == wxT("*"))
|
||||
{
|
||||
extension = wxEmptyString;
|
||||
}
|
||||
path.SetExt(extension);
|
||||
}
|
||||
path.SetExt(extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -744,15 +744,18 @@ int FileDialog::ShowModal()
|
||||
wxFileName fn = ConvertSlashInFileName(thePath);
|
||||
if (!fn.HasExt())
|
||||
{
|
||||
wxStringTokenizer tokenizer( myData.extensions[m_filterIndex], wxT(";"));
|
||||
if (tokenizer.HasMoreTokens())
|
||||
if (!(m_dialogStyle & FD_NO_ADD_EXTENSION))
|
||||
{
|
||||
wxString extension = tokenizer.GetNextToken().AfterFirst(wxT('.'));
|
||||
if (extension.Right(2) == wxT("*"))
|
||||
wxStringTokenizer tokenizer( myData.extensions[m_filterIndex], wxT(";"));
|
||||
if (tokenizer.HasMoreTokens())
|
||||
{
|
||||
extension = wxEmptyString;
|
||||
wxString extension = tokenizer.GetNextToken().AfterFirst(wxT('.'));
|
||||
if (extension.Right(2) == wxT("*"))
|
||||
{
|
||||
extension = wxEmptyString;
|
||||
}
|
||||
fn.SetExt(extension);
|
||||
}
|
||||
fn.SetExt(extension);
|
||||
}
|
||||
}
|
||||
m_path = fn.GetFullPath();
|
||||
|
25
lib-src/FileDialog/win/FileDialogPrivate.cpp
Normal file → Executable file
25
lib-src/FileDialog/win/FileDialogPrivate.cpp
Normal file → Executable file
@ -844,20 +844,23 @@ int FileDialog::ShowModal()
|
||||
{
|
||||
//=== Adding the correct extension >>=================================
|
||||
m_filterIndex = (int)of.nFilterIndex - 1;
|
||||
|
||||
if ( !of.nFileExtension ||
|
||||
(of.nFileExtension && fileNameBuffer[of.nFileExtension] == wxT('\0')) )
|
||||
|
||||
if (!(m_dialogStyle & FD_NO_ADD_EXTENSION))
|
||||
{
|
||||
// User has typed a filename without an extension:
|
||||
const wxChar* extension = filterBuffer;
|
||||
int maxFilter = (int)(of.nFilterIndex*2L) - 1;
|
||||
if ( !of.nFileExtension ||
|
||||
(of.nFileExtension && fileNameBuffer[of.nFileExtension] == wxT('\0')) )
|
||||
{
|
||||
// User has typed a filename without an extension:
|
||||
const wxChar* extension = filterBuffer;
|
||||
int maxFilter = (int)(of.nFilterIndex*2L) - 1;
|
||||
|
||||
for( int i = 0; i < maxFilter; i++ ) // get extension
|
||||
extension = extension + wxStrlen( extension ) + 1;
|
||||
for( int i = 0; i < maxFilter; i++ ) // get extension
|
||||
extension = extension + wxStrlen( extension ) + 1;
|
||||
|
||||
m_fileName = AppendExtension(fileNameBuffer, extension);
|
||||
wxStrncpy(fileNameBuffer, m_fileName.c_str(), wxMin(m_fileName.Len(), wxMAXPATH-1));
|
||||
fileNameBuffer[wxMin(m_fileName.Len(), wxMAXPATH-1)] = wxT('\0');
|
||||
m_fileName = AppendExtension(fileNameBuffer, extension);
|
||||
wxStrncpy(fileNameBuffer, m_fileName.c_str(), wxMin(m_fileName.Len(), wxMAXPATH-1));
|
||||
fileNameBuffer[wxMin(m_fileName.Len(), wxMAXPATH-1)] = wxT('\0');
|
||||
}
|
||||
}
|
||||
|
||||
m_path = fileNameBuffer;
|
||||
|
@ -6929,7 +6929,7 @@
|
||||
);
|
||||
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";
|
||||
shellScript = "#!/bin/sh\n\nupdate_paths()\n{\n base=$(basename \"${1}\")\n cp -p \"${1}\" \"${LIBPATH}\"\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}\") \"${LIBPATH}/${base}\"\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 install_name_tool -change \"${lib}\" @executable_path/../Frameworks/$(basename \"${lib}\") \"${EXEPATH}\"\n update_paths \"${lib}\"\ndone\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
isa = PBXAggregateTarget;
|
||||
buildConfigurationList = 17072E890988BD58008541CC /* Build configuration list for PBXAggregateTarget "Configure" */;
|
||||
buildPhases = (
|
||||
17072E8C0988BD85008541CC /* Run Script */,
|
||||
17072E8C0988BD85008541CC /* Configure */,
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
@ -6407,6 +6407,7 @@
|
||||
1790AFAE09883B6D008A330A /* Frameworks */,
|
||||
28032560131DAFAF0059D002 /* Copy nyquist */,
|
||||
28032580131DB4960059D002 /* Copy plug-ins */,
|
||||
28708D631B17C3C400496FEB /* Install wxWidgets libs */,
|
||||
288F0980131A400F0008E860 /* Install manual */,
|
||||
282413DA131D52CE009FD931 /* Install plugins */,
|
||||
2892CE28131AFB1900E1E17D /* Install miscellany */,
|
||||
@ -6721,7 +6722,7 @@
|
||||
/* End PBXRezBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
17072E8C0988BD85008541CC /* Run Script */ = {
|
||||
17072E8C0988BD85008541CC /* Configure */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@ -6729,7 +6730,7 @@
|
||||
inputPaths = (
|
||||
"$(TOPLEVEL)/Makefile.in",
|
||||
);
|
||||
name = "Run Script";
|
||||
name = Configure;
|
||||
outputPaths = (
|
||||
"$(TOPLEVEL)/Makefile",
|
||||
);
|
||||
@ -6797,6 +6798,20 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PROJECT_DIR}/build_plugins.sh\"";
|
||||
};
|
||||
28708D631B17C3C400496FEB /* 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 base=$(basename \"${1}\")\n cp -p \"${1}\" \"${LIBPATH}\"\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}\") \"${LIBPATH}/${base}\"\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 install_name_tool -change \"${lib}\" @executable_path/../Frameworks/$(basename \"${lib}\") \"${EXEPATH}\"\n update_paths \"${lib}\"\ndone\n";
|
||||
};
|
||||
288F0980131A400F0008E860 /* Install manual */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 8;
|
||||
@ -8056,6 +8071,7 @@
|
||||
baseConfigurationReference = 2812A5B90DF63FF000576305 /* Debug_Static.xcconfig */;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1)",
|
||||
@ -8112,7 +8128,7 @@
|
||||
"-lFLAC",
|
||||
);
|
||||
PRODUCT_NAME = Audacity;
|
||||
SKIP_INSTALL = NO;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/include $(TOPLEVEL)/mac/config/$(arch)/src/** $(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/mac/config/$(arch)/lib-src/libmad $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/mac/config/$(arch)/lib-src/libsndfile/** $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libsoxr/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)/mac/config/$(arch)/lib-src/soundtouch/** $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/lv2 $(TOPLEVEL)/lib-src/lv2/lilv $(TOPLEVEL)/lib-src/lv2/suil $(TOPLEVEL)/lib-src/twolame/libtwolame $(TOPLEVEL)/mac/config/$(arch)/lib-src/sbsms/**";
|
||||
};
|
||||
name = "Debug Static";
|
||||
@ -8128,7 +8144,6 @@
|
||||
FFMPEG_CFLAGS = "-I../lib-src/ffmpeg -D__STDC_CONSTANT_MACROS";
|
||||
FFMPEG_CXXFLAGS = "$(FFMPEG_CFLAGS)";
|
||||
FFMPEG_PREFIX = /usr/local;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
|
||||
INFOPLIST_PREFIX_HEADER = Info.plist.h;
|
||||
@ -8447,10 +8462,7 @@
|
||||
FFMPEG_CFLAGS = "-I../lib-src/ffmpeg -D__STDC_CONSTANT_MACROS";
|
||||
FFMPEG_CXXFLAGS = "$(FFMPEG_CFLAGS)";
|
||||
FFMPEG_PREFIX = /usr/local;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
|
||||
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
|
||||
INFOPLIST_PREFIX_HEADER = Info.plist.h;
|
||||
INFOPLIST_PREPROCESS = YES;
|
||||
@ -8462,7 +8474,7 @@
|
||||
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_xrc-$(WX_VER) -lwx_macud_qa-$(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;
|
||||
@ -8474,12 +8486,15 @@
|
||||
baseConfigurationReference = 2812A5B70DF63FE500576305 /* Debug_Shared.xcconfig */;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
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 = (
|
||||
@ -8528,7 +8543,7 @@
|
||||
"-lFLAC",
|
||||
);
|
||||
PRODUCT_NAME = Audacity;
|
||||
SKIP_INSTALL = NO;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/include $(TOPLEVEL)/mac/config/$(arch)/src/** $(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/mac/config/$(arch)/lib-src/libmad $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/mac/config/$(arch)/lib-src/libsndfile/** $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libsoxr/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)/mac/config/$(arch)/lib-src/soundtouch/** $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/lv2 $(TOPLEVEL)/lib-src/lv2/lilv $(TOPLEVEL)/lib-src/lv2/suil $(TOPLEVEL)/lib-src/twolame/libtwolame $(TOPLEVEL)/mac/config/$(arch)/lib-src/sbsms/**";
|
||||
};
|
||||
name = "Debug Shared";
|
||||
@ -8784,10 +8799,7 @@
|
||||
FFMPEG_CFLAGS = "-I../lib-src/ffmpeg -D__STDC_CONSTANT_MACROS";
|
||||
FFMPEG_CXXFLAGS = "$(FFMPEG_CFLAGS)";
|
||||
FFMPEG_PREFIX = /usr/local;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 3;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
|
||||
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
|
||||
INFOPLIST_PREFIX_HEADER = Info.plist.h;
|
||||
INFOPLIST_PREPROCESS = YES;
|
||||
@ -8799,7 +8811,7 @@
|
||||
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;
|
||||
@ -8811,6 +8823,8 @@
|
||||
baseConfigurationReference = 2812A5BB0DF63FFD00576305 /* Release_Shared.xcconfig */;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "$(TOPLEVEL)/src/AudacityHeaders.h";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
@ -8819,6 +8833,7 @@
|
||||
"$(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 = (
|
||||
@ -8867,7 +8882,7 @@
|
||||
"-lFLAC",
|
||||
);
|
||||
PRODUCT_NAME = Audacity;
|
||||
SKIP_INSTALL = NO;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/include $(TOPLEVEL)/mac/config/$(arch)/src/** $(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/mac/config/$(arch)/lib-src/libmad $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/mac/config/$(arch)/lib-src/libsndfile/** $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libsoxr/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)/mac/config/$(arch)/lib-src/soundtouch/** $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/lv2 $(TOPLEVEL)/lib-src/lv2/lilv $(TOPLEVEL)/lib-src/lv2/suil $(TOPLEVEL)/lib-src/twolame/libtwolame $(TOPLEVEL)/mac/config/$(arch)/lib-src/sbsms/**";
|
||||
};
|
||||
name = "Release Shared";
|
||||
@ -9367,6 +9382,7 @@
|
||||
baseConfigurationReference = 2812A5BD0DF6400E00576305 /* Release_Static.xcconfig */;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "$(TOPLEVEL)/src/AudacityHeaders.h";
|
||||
@ -9425,7 +9441,7 @@
|
||||
"-lFLAC",
|
||||
);
|
||||
PRODUCT_NAME = Audacity;
|
||||
SKIP_INSTALL = NO;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
USER_HEADER_SEARCH_PATHS = "$(TOPLEVEL)/include $(TOPLEVEL)/mac/config/$(arch)/src/** $(TOPLEVEL)/mac $(TOPLEVEL)/src/** $(TOPLEVEL)/lib-src/FileDialog $(TOPLEVEL)/lib-src/libflac/include $(TOPLEVEL)/lib-src/libid3tag $(TOPLEVEL)/lib-src/lame $(TOPLEVEL)/mac/config/$(arch)/lib-src/libmad $(TOPLEVEL)/lib-src/libmad $(TOPLEVEL)/lib-src/libogg/include $(TOPLEVEL)/lib-src/libnyquist/nyq $(TOPLEVEL)/mac/config/$(arch)/lib-src/libsndfile/** $(TOPLEVEL)/lib-src/libsndfile/src $(TOPLEVEL)/lib-src/libsoxr/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)/mac/config/$(arch)/lib-src/soundtouch/** $(TOPLEVEL)/lib-src/soundtouch/include $(TOPLEVEL)/lib-src/lv2/lv2 $(TOPLEVEL)/lib-src/lv2/lilv $(TOPLEVEL)/lib-src/lv2/suil $(TOPLEVEL)/lib-src/twolame/libtwolame $(TOPLEVEL)/mac/config/$(arch)/lib-src/sbsms/**";
|
||||
};
|
||||
name = "Release Static";
|
||||
@ -9441,7 +9457,6 @@
|
||||
FFMPEG_CFLAGS = "-I../lib-src/ffmpeg -D__STDC_CONSTANT_MACROS";
|
||||
FFMPEG_CXXFLAGS = "$(FFMPEG_CFLAGS)";
|
||||
FFMPEG_PREFIX = /usr/local;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 3;
|
||||
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
|
||||
INFOPLIST_PREFIX_HEADER = Info.plist.h;
|
||||
|
@ -83,23 +83,8 @@ function buildAction
|
||||
# Get to where we need to be
|
||||
cd "${swhpath}"
|
||||
|
||||
# We won't be using fftw, but configure won't complete without it, so just
|
||||
# create a dummy pkg-config file.
|
||||
export PKG_CONFIG_PATH="."
|
||||
cat <<EOF >fftw3f.pc
|
||||
Name: FFTW
|
||||
Description: dummy for pkg-config
|
||||
Version: 3.0.0
|
||||
Libs:
|
||||
Cflags:
|
||||
EOF
|
||||
|
||||
# Run configure
|
||||
if [ ! -e "config.status" ]
|
||||
then
|
||||
echo "Configuring plugins"
|
||||
./configure --disable-dependency-tracking --enable-shared --disable-static >/dev/null 2>&1
|
||||
fi
|
||||
# Get rid of the existing config.h options
|
||||
echo >config.h
|
||||
|
||||
# Build the 2 standard plugins
|
||||
build hard_limiter_1413 hard_limiter_1413.c
|
||||
|
@ -1,7 +1,7 @@
|
||||
;nyquist plug-in
|
||||
;version 4
|
||||
;type process
|
||||
;preview enabled
|
||||
;preview linear
|
||||
;name "Spectral edit parametric EQ..."
|
||||
;action "Filtering..."
|
||||
;author "Paul Licameli"
|
||||
|
@ -1,7 +1,7 @@
|
||||
;nyquist plug-in
|
||||
;version 4
|
||||
;type process
|
||||
;preview enabled
|
||||
;preview linear
|
||||
;name "Spectral edit shelves..."
|
||||
;action "Filtering..."
|
||||
;author "Paul Licameli"
|
||||
|
@ -1,6 +1,8 @@
|
||||
;nyquist plug-in
|
||||
;version 3
|
||||
;version 4
|
||||
;type process
|
||||
;preview linear
|
||||
;preview selection
|
||||
;categories "http://lv2plug.in/ns/lv2core#MixerPlugin"
|
||||
;name "Adjustable Fade..."
|
||||
;action "Applying Fade..."
|
||||
@ -22,6 +24,20 @@
|
||||
;control preset " Handy Presets\n(override controls)" choice "None Selected,Linear In,Linear Out,Exponential In,Exponential Out,Logarithmic In,Logarithmic Out,Rounded In,Rounded Out,Cosine In,Cosine Out,S-Curve In,S-Curve Out" 0
|
||||
|
||||
|
||||
(defun get-input (sig)
|
||||
"Preview takes the entire selection so that we know the correct
|
||||
selection length, but preview only needs to process preview length."
|
||||
(if (get '*track* 'view) ;NIL if preview
|
||||
sig
|
||||
(multichan-expand #'trim-input sig)))
|
||||
|
||||
(defun trim-input (sig)
|
||||
"Trim input when previewing."
|
||||
(let ((dur (min (get-duration 1)
|
||||
(get '*project* 'preview-duration))))
|
||||
(setf sig (extract-abs 0 dur *track*))))
|
||||
|
||||
|
||||
(setq err "")
|
||||
; bad things may happen outside of the slider range.
|
||||
(setq curve (min 1 (max -1 (/ curve 100.0))))
|
||||
@ -57,7 +73,7 @@
|
||||
|
||||
;;; select and apply fade
|
||||
(defun fade (sig type curve g0 g1)
|
||||
(mult sig
|
||||
(mult (get-input sig)
|
||||
(case preset
|
||||
(0 (case type ; Custom fade
|
||||
(0 (simple (min g0 g1) (max g0 g1) curve))
|
||||
@ -180,5 +196,5 @@
|
||||
(check-values gain0 gain1)
|
||||
(setf err (format nil "~a" (invalid-string gain0 gain1))))
|
||||
(if (= (length err) 0)
|
||||
(fade s type curve gain0 gain1)
|
||||
(fade *track* type curve gain0 gain1)
|
||||
(format nil "Error.~%~a." err)))
|
||||
|
@ -3,7 +3,7 @@
|
||||
;type process
|
||||
;name "Crossfade Tracks..."
|
||||
;action "Crossfading..."
|
||||
;preview disabled - cannot use preview because tracks are processed differently.
|
||||
;preview selection
|
||||
;author "Steve Daulton"
|
||||
;copyright "Released under terms of the GNU General Public License version 2"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
;nyquist plug-in
|
||||
;version 3
|
||||
;type process
|
||||
;preview enabled
|
||||
;preview linear
|
||||
;categories "http://lv2plug.in/ns/lv2core#DelayPlugin"
|
||||
;name "Delay..."
|
||||
;action "Applying Delay Effect..."
|
||||
|
@ -1,7 +1,7 @@
|
||||
;nyquist plug-in
|
||||
;version 3
|
||||
;version 4
|
||||
;type process
|
||||
;preview enabled
|
||||
;preview linear
|
||||
;categories "http://lv2plug.in/ns/lv2core#HighpassPlugin"
|
||||
;name "High Pass Filter..."
|
||||
;action "Performing High Pass Filter..."
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
;; highpass.ny by Dominic Mazzoni
|
||||
;; Modified by David R. Sky
|
||||
;; Updated by Steve Daulton June 2012
|
||||
;; Updated by Steve Daulton June 2012, 2015.
|
||||
;; Released under terms of the GNU General Public License version 2:
|
||||
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
;;control q "Filter quality (Q) for 12 dB rolloff" real "" 0.7071 .1 20
|
||||
;control frequency "Cutoff frequency (Hz)" real "" 1000 1 20000
|
||||
|
||||
|
||||
(cond
|
||||
((> frequency (/ *sound-srate* 2))
|
||||
(format nil
|
||||
@ -35,4 +36,4 @@
|
||||
(T
|
||||
(funcall
|
||||
(nth rolloff '(hp highpass2 highpass4 highpass6 highpass8))
|
||||
s frequency)))
|
||||
*track* frequency)))
|
||||
|
@ -1,7 +1,7 @@
|
||||
;nyquist plug-in
|
||||
;version 3
|
||||
;version 4
|
||||
;type process
|
||||
;preview enabled
|
||||
;preview linear
|
||||
;categories "http://lv2plug.in/ns/lv2core#LowpassPlugin"
|
||||
;name "Low Pass Filter..."
|
||||
;action "Performing Low Pass Filter..."
|
||||
@ -35,4 +35,4 @@
|
||||
(T
|
||||
(funcall
|
||||
(nth rolloff '(lp lowpass2 lowpass4 lowpass6 lowpass8))
|
||||
s frequency)))
|
||||
*track* frequency)))
|
||||
|
@ -1,7 +1,7 @@
|
||||
;nyquist plug-in
|
||||
;version 1
|
||||
;type process
|
||||
;preview enabled
|
||||
;preview linear
|
||||
;categories "http://lv2plug.in/ns/lv2core/#FilterPlugin"
|
||||
;name "Notch Filter..."
|
||||
;action "Performing Notch Filter..."
|
||||
|
@ -1,7 +1,7 @@
|
||||
;nyquist plug-in
|
||||
;version 3
|
||||
;type process
|
||||
;preview enabled
|
||||
;preview linear
|
||||
;categories "http://lv2plug.in/ns/lv2core#ModulatorPlugin"
|
||||
;name "Tremolo..."
|
||||
;action "Applying Tremolo..."
|
||||
|
@ -1,7 +1,7 @@
|
||||
;nyquist plug-in
|
||||
;version 3
|
||||
;type process
|
||||
;preview enabled
|
||||
;preview linear
|
||||
;categories "http://lv2plug.in/ns/lv2core#UtilityPlugin"
|
||||
;name "Vocal Remover..."
|
||||
;action "Removing center-panned audio..."
|
||||
|
@ -218,7 +218,7 @@ void NoteTrack::WarpAndTransposeNotes(double t0, double t1,
|
||||
Alg_iterator iter(mSeq, false);
|
||||
iter.begin();
|
||||
Alg_event_ptr event;
|
||||
while ((event = iter.next()) && event->time < t1) {
|
||||
while (0 != (event = iter.next()) && event->time < t1) {
|
||||
if (event->is_note() && event->time >= t0 &&
|
||||
// Allegro data structure does not restrict channels to 16.
|
||||
// Since there is not way to select more than 16 channels,
|
||||
|
@ -86,6 +86,7 @@ bool AudacityPrintout::OnPrintPage(int WXUNUSED(page))
|
||||
viewInfo.h = 0.0;
|
||||
viewInfo.screen = mTracks->GetEndTime() - viewInfo.h;
|
||||
viewInfo.total = viewInfo.screen;
|
||||
viewInfo.zoom = width / viewInfo.screen;
|
||||
int y = rulerPageHeight;
|
||||
|
||||
TrackListIterator iter(mTracks);
|
||||
|
@ -781,9 +781,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
mMenuClose(false)
|
||||
, mbInitializingScrollbar(false)
|
||||
{
|
||||
int widths[] = {-2, -1};
|
||||
mStatusBar = CreateStatusBar(2);
|
||||
mStatusBar->SetStatusWidths(2, widths);
|
||||
mStatusBar = CreateStatusBar(3);
|
||||
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
|
||||
|
||||
@ -827,10 +825,6 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
|
||||
UpdatePrefs();
|
||||
|
||||
// Some extra information
|
||||
mViewInfo.bIsPlaying = false;
|
||||
mViewInfo.bRedrawWaveform = false;
|
||||
|
||||
mLockPlayRegion = false;
|
||||
|
||||
// Make sure valgrind sees mIsSyncLocked is initialized, even
|
||||
@ -1020,9 +1014,11 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
|
||||
mTrackFactory = new TrackFactory(mDirManager);
|
||||
|
||||
int widths[] = {GetControlToolBar()->WidthForStatusBar(), -2, -1};
|
||||
mStatusBar->SetStatusWidths(3, widths);
|
||||
wxString msg = wxString::Format(_("Welcome to Audacity version %s"),
|
||||
AUDACITY_VERSION_STRING);
|
||||
mStatusBar->SetStatusText(msg);
|
||||
mStatusBar->SetStatusText(msg, 1);
|
||||
mLastStatusUpdateTime = ::wxGetUTCTime();
|
||||
|
||||
mTimer = new wxTimer(this, AudacityProjectTimerID);
|
||||
@ -3507,7 +3503,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
|
||||
wxRemoveFile(safetyFileName);
|
||||
|
||||
mStatusBar->SetStatusText(wxString::Format(_("Saved %s"),
|
||||
mFileName.c_str()));
|
||||
mFileName.c_str()), 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -4285,11 +4281,6 @@ void AudacityProject::SetCaptureMeter(Meter *capture)
|
||||
}
|
||||
}
|
||||
|
||||
void AudacityProject::SetStop(bool bStopped)
|
||||
{
|
||||
mTrackPanel->SetStop(bStopped);
|
||||
}
|
||||
|
||||
void AudacityProject::OnTimer(wxTimerEvent& WXUNUSED(event))
|
||||
{
|
||||
MixerToolBar *mixerToolBar = GetMixerToolBar();
|
||||
@ -4330,7 +4321,7 @@ void AudacityProject::OnTimer(wxTimerEvent& WXUNUSED(event))
|
||||
else
|
||||
msg.Printf(_("Out of disk space"));
|
||||
|
||||
mStatusBar->SetStatusText(msg);
|
||||
mStatusBar->SetStatusText(msg, 1);
|
||||
}
|
||||
}
|
||||
else if(ODManager::IsInstanceCreated())
|
||||
@ -4351,7 +4342,7 @@ void AudacityProject::OnTimer(wxTimerEvent& WXUNUSED(event))
|
||||
|
||||
|
||||
msg.Printf(_("On-demand import and waveform calculation complete."));
|
||||
mStatusBar->SetStatusText(msg);
|
||||
mStatusBar->SetStatusText(msg, 1);
|
||||
|
||||
}
|
||||
else if(numTasks>1)
|
||||
@ -4362,7 +4353,7 @@ void AudacityProject::OnTimer(wxTimerEvent& WXUNUSED(event))
|
||||
ratioComplete*100.0);
|
||||
|
||||
|
||||
mStatusBar->SetStatusText(msg);
|
||||
mStatusBar->SetStatusText(msg, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4551,7 +4542,7 @@ void AudacityProject::EditClipboardByLabel( WaveTrack::EditDestFunction action )
|
||||
// TrackPanel callback method
|
||||
void AudacityProject::TP_DisplayStatusMessage(wxString msg)
|
||||
{
|
||||
mStatusBar->SetStatusText(msg);
|
||||
mStatusBar->SetStatusText(msg, 1);
|
||||
mLastStatusUpdateTime = ::wxGetUTCTime();
|
||||
}
|
||||
|
||||
@ -4798,9 +4789,9 @@ void AudacityProject::OnAudioIORate(int rate)
|
||||
display = wxString::Format(_("Actual Rate: %d"), rate);
|
||||
int x, y;
|
||||
mStatusBar->GetTextExtent(display, &x, &y);
|
||||
int widths[] = {-1, x+50};
|
||||
mStatusBar->SetStatusWidths(2, widths);
|
||||
mStatusBar->SetStatusText(display, 1);
|
||||
int widths[] = {GetControlToolBar()->WidthForStatusBar(), -1, x+50};
|
||||
mStatusBar->SetStatusWidths(3, widths);
|
||||
mStatusBar->SetStatusText(display, 2);
|
||||
}
|
||||
|
||||
void AudacityProject::OnAudioIOStartRecording()
|
||||
|
@ -304,7 +304,6 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
|
||||
void Zoom(double level);
|
||||
void Rewind(bool shift);
|
||||
void SkipEnd(bool shift);
|
||||
void SetStop(bool bStopped);
|
||||
void EditByLabel( WaveTrack::EditFunction action, bool bSyncLockedTracks );
|
||||
void EditClipboardByLabel( WaveTrack::EditDestFunction action );
|
||||
bool IsSyncLocked();
|
||||
@ -398,6 +397,8 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
|
||||
LyricsWindow* GetLyricsWindow() { return mLyricsWindow; }
|
||||
MixerBoard* GetMixerBoard() { return mMixerBoard; }
|
||||
|
||||
wxStatusBar* GetStatusBar() { return mStatusBar; }
|
||||
|
||||
// SelectionBarListener callback methods
|
||||
|
||||
virtual double AS_GetRate();
|
||||
|
@ -87,8 +87,8 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
samplePtr mPtr;
|
||||
int mCount;
|
||||
samplePtr mPtr;
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -563,7 +563,7 @@ void ScreenFrame::DoCapture(wxString captureMode)
|
||||
|
||||
mCommand->SetParameter(wxT("CaptureMode"), captureMode);
|
||||
if (!mCommand->Apply(mContext))
|
||||
mStatus->SetStatusText(wxT("Capture failed!"));
|
||||
mStatus->SetStatusText(wxT("Capture failed!"), 1);
|
||||
Show();
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ void Track::ReorderList(bool resize)
|
||||
}
|
||||
#endif
|
||||
|
||||
bool Track::IsSyncLockSelected()
|
||||
bool Track::IsSyncLockSelected() const
|
||||
{
|
||||
#ifdef EXPERIMENTAL_SYNC_LOCK
|
||||
AudacityProject *p = GetActiveProject();
|
||||
@ -278,7 +278,7 @@ bool Track::IsSyncLockSelected()
|
||||
return false;
|
||||
|
||||
SyncLockedTracksIterator git(mList);
|
||||
Track *t = git.First(this);
|
||||
Track *t = git.First(const_cast<Track*>(this));
|
||||
|
||||
if (!t) {
|
||||
// Not in a sync-locked group.
|
||||
|
@ -206,7 +206,7 @@ class AUDACITY_DLL_API Track: public XMLTagHandler
|
||||
virtual double GetEndTime() const = 0;
|
||||
|
||||
// Checks if sync-lock is on and any track in its sync-lock group is selected.
|
||||
bool IsSyncLockSelected();
|
||||
bool IsSyncLockSelected() const;
|
||||
};
|
||||
|
||||
struct TrackListNode
|
||||
|
@ -1737,18 +1737,6 @@ void TrackArtist::DrawSpectrum(WaveTrack *track,
|
||||
viewInfo->selectedRegion.t0(), viewInfo->selectedRegion.t1(),
|
||||
viewInfo->h, viewInfo->zoom);
|
||||
|
||||
if(!viewInfo->bUpdateTrackIndicator && viewInfo->bIsPlaying) {
|
||||
// BG: Draw (undecorated) waveform instead of spectrum
|
||||
DrawWaveform(track, dc, r, viewInfo, false, false, false, false, false);
|
||||
/*
|
||||
// BG: uncomment to draw grey instead of spectrum
|
||||
dc.SetBrush(unselectedBrush);
|
||||
dc.SetPen(unselectedPen);
|
||||
dc.DrawRectangle(r);
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
WaveTrackCache cache(track);
|
||||
for (WaveClipList::compatibility_iterator it = track->GetClipIterator(); it; it = it->GetNext()) {
|
||||
DrawClipSpectrum(cache, it->GetData(), dc, r, viewInfo, autocorrelation, logF);
|
||||
|
@ -866,12 +866,6 @@ void TrackPanel::UpdatePrefs()
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void TrackPanel::SetStop(bool bStopped)
|
||||
{
|
||||
mViewInfo->bIsPlaying = !bStopped;
|
||||
Refresh(false);
|
||||
}
|
||||
|
||||
/// Remembers the track we clicked on and why we captured it.
|
||||
/// We also use this method to clear the record
|
||||
/// of the captured track, passing NULL as the track.
|
||||
|
@ -172,8 +172,6 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
|
||||
|
||||
virtual void SelectNone();
|
||||
|
||||
virtual void SetStop(bool bStopped);
|
||||
|
||||
virtual void Refresh(bool eraseBackground = true,
|
||||
const wxRect *rect = (const wxRect *) NULL);
|
||||
virtual void RefreshTrack(Track *trk, bool refreshbacking = true);
|
||||
|
@ -162,11 +162,13 @@ void TrackPanelAx::Updated()
|
||||
{
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
Track *t = GetFocus();
|
||||
NotifyEvent(wxACC_EVENT_OBJECT_NAMECHANGE,
|
||||
|
||||
// logically, this should be an OBJECT_NAMECHANGE event, but Window eyes 9.1
|
||||
// does not read out the name with this event type, hence use OBJECT_FOCUS.
|
||||
NotifyEvent(wxACC_EVENT_OBJECT_FOCUS,
|
||||
mTrackPanel,
|
||||
wxOBJID_CLIENT,
|
||||
TrackNum(t));
|
||||
SetFocus(t);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -51,10 +51,7 @@ struct ViewInfo {
|
||||
// Other stuff, mainly states (true or false) related to autoscroll and
|
||||
// drawing the waveform. Maybe this should be put somewhere else?
|
||||
|
||||
bool bRedrawWaveform;
|
||||
bool bUpdateTrackIndicator;
|
||||
|
||||
bool bIsPlaying;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1631,7 +1631,7 @@ AUDACITY_DLL_API sampleCount WaveTrack::TimeToLongSamples(double t0) const
|
||||
return (sampleCount)floor(t0 * mRate + 0.5);
|
||||
}
|
||||
|
||||
double WaveTrack::LongSamplesToTime(sampleCount pos)
|
||||
double WaveTrack::LongSamplesToTime(sampleCount pos) const
|
||||
{
|
||||
return ((double)pos) / mRate;
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ class AUDACITY_DLL_API WaveTrack: public Track {
|
||||
* @param pos The time number of samples from the start of the track to convert.
|
||||
* @return The time in seconds.
|
||||
*/
|
||||
double LongSamplesToTime(sampleCount pos);
|
||||
double LongSamplesToTime(sampleCount pos) const;
|
||||
|
||||
// Get access to the clips in the tracks. This is used by
|
||||
// track artists and also by TrackPanel when sliding...it would
|
||||
|
@ -117,7 +117,7 @@ public:
|
||||
{}
|
||||
virtual void Update(wxString message)
|
||||
{
|
||||
mStatus.SetStatusText(message);
|
||||
mStatus.SetStatusText(message, 1);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -32,6 +32,7 @@ greater use in future.
|
||||
#include <wx/tglbtn.h>
|
||||
#include <wx/timer.h>
|
||||
#include <wx/utils.h>
|
||||
#include <wx/log.h>
|
||||
|
||||
#include "audacity/ConfigInterface.h"
|
||||
|
||||
@ -46,6 +47,7 @@ greater use in future.
|
||||
#include "../widgets/ProgressDialog.h"
|
||||
#include "../ondemand/ODManager.h"
|
||||
#include "TimeWarper.h"
|
||||
#include "nyquist/Nyquist.h"
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
#include <wx/mac/private.h>
|
||||
@ -91,8 +93,10 @@ Effect::Effect()
|
||||
mT0 = 0.0;
|
||||
mT1 = 0.0;
|
||||
mDuration = 0.0;
|
||||
mIsPreview = false;
|
||||
mIsLinearEffect = false;
|
||||
mPreviewWithNotSelected = false;
|
||||
mPreviewFullSelection = false;
|
||||
mNumTracks = 0;
|
||||
mNumGroups = 0;
|
||||
mProgress = NULL;
|
||||
@ -734,7 +738,6 @@ void Effect::SetDuration(double seconds)
|
||||
|
||||
mDuration = seconds;
|
||||
mT1 = mT0 + mDuration;
|
||||
mSetDuration = mDuration;
|
||||
|
||||
mIsSelection = false;
|
||||
|
||||
@ -1556,7 +1559,16 @@ bool Effect::ProcessTrack(int count,
|
||||
bool isProcessor = GetType() == EffectTypeProcess;
|
||||
if (isGenerator)
|
||||
{
|
||||
genLength = left->GetRate() * mDuration;
|
||||
double genDur;
|
||||
if (mIsPreview) {
|
||||
gPrefs->Read(wxT("/AudioIO/EffectsPreviewLen"), &genDur, 6.0);
|
||||
genDur = wxMin(mDuration, CalcPreviewInputLength(genDur));
|
||||
}
|
||||
else {
|
||||
genDur = mDuration;
|
||||
}
|
||||
|
||||
genLength = left->GetRate() * genDur;
|
||||
delayRemaining = genLength;
|
||||
cleared = true;
|
||||
|
||||
@ -1827,11 +1839,13 @@ bool Effect::ProcessTrack(int count,
|
||||
|
||||
if (isGenerator)
|
||||
{
|
||||
AudacityProject *p = GetActiveProject();
|
||||
StepTimeWarper *warper = new StepTimeWarper(mT0 + genLength, genLength - (mT1 - mT0));
|
||||
|
||||
// Transfer the data from the temporary tracks to the actual ones
|
||||
genLeft->Flush();
|
||||
left->ClearAndPaste(mT0, mT1, genLeft, true, true, warper);
|
||||
// mT1 gives us the new selection. We want to replace up to GetSel1().
|
||||
left->ClearAndPaste(mT0, p->GetSel1(), genLeft, true, true, warper);
|
||||
delete genLeft;
|
||||
|
||||
if (genRight)
|
||||
@ -1952,6 +1966,12 @@ void Effect::SetLinearEffectFlag(bool linearEffectFlag)
|
||||
mIsLinearEffect = linearEffectFlag;
|
||||
}
|
||||
|
||||
void Effect::SetPreviewFullSelectionFlag(bool previewDurationFlag)
|
||||
{
|
||||
mPreviewFullSelection = previewDurationFlag;
|
||||
}
|
||||
|
||||
|
||||
void Effect::IncludeNotSelectedPreviewTracks(bool includeNotSelected)
|
||||
{
|
||||
mPreviewWithNotSelected = includeNotSelected;
|
||||
@ -2383,75 +2403,77 @@ void Effect::Preview(bool dryOnly)
|
||||
else
|
||||
wxLogDebug(wxT("Non-linear Effect"));
|
||||
|
||||
if (mNumTracks==0) // nothing to preview
|
||||
if (mNumTracks == 0) { // nothing to preview
|
||||
return;
|
||||
}
|
||||
|
||||
wxWindow* FocusDialog = wxWindow::FindFocus();
|
||||
if (gAudioIO->IsBusy())
|
||||
if (gAudioIO->IsBusy()) {
|
||||
return;
|
||||
}
|
||||
|
||||
wxWindow *FocusDialog = wxWindow::FindFocus();
|
||||
|
||||
double previewDuration;
|
||||
bool isNyquist = (GetFamily().IsSameAs(NYQUISTEFFECTS_FAMILY))? true : false;
|
||||
bool isGenerator = GetType() == EffectTypeGenerate;
|
||||
|
||||
// Mix a few seconds of audio from all of the tracks
|
||||
double previewLen = 6.0;
|
||||
gPrefs->Read(wxT("/AudioIO/EffectsPreviewLen"), &previewLen);
|
||||
double previewLen;
|
||||
gPrefs->Read(wxT("/AudioIO/EffectsPreviewLen"), &previewLen, 6.0);
|
||||
|
||||
double rate = mProjectRate;
|
||||
double warpedPreviewLength = CalcPreviewInputLength(previewLen);
|
||||
double t0 = mT0;
|
||||
double t1 = t0 + warpedPreviewLength;
|
||||
|
||||
// Generators can run without a selection.
|
||||
if (GetType() == EffectTypeGenerate) {
|
||||
// If a generator varies over time, it must use the selected duration.
|
||||
// otherwise set it as a linear effect and process no more than the preview length.
|
||||
// TODO: When previewing non-linear generate effect, calculate only the first 'preview length'.
|
||||
// For generate effects derived from the Nyquist Prompt, the duration is unknow, so
|
||||
// ensure that we have at least preview length to copy.
|
||||
double dur = (mIsLinearEffect)? wxMin(mSetDuration, warpedPreviewLength) :
|
||||
wxMax(mSetDuration, warpedPreviewLength);
|
||||
t1 = t0 + dur;
|
||||
this->SetDuration(dur);
|
||||
if (isNyquist && isGenerator) {
|
||||
previewDuration = CalcPreviewInputLength(previewLen);
|
||||
}
|
||||
else if (t1 > mT1) {
|
||||
else {
|
||||
previewDuration = wxMin(mDuration, CalcPreviewInputLength(previewLen));
|
||||
}
|
||||
|
||||
double t1 = mT0 + previewDuration;
|
||||
|
||||
if ((t1 > mT1) && !(isNyquist && isGenerator)) {
|
||||
t1 = mT1;
|
||||
}
|
||||
if (t1 <= t0)
|
||||
|
||||
if (t1 <= mT0)
|
||||
return;
|
||||
|
||||
bool success = true;
|
||||
WaveTrack *mixLeft = NULL;
|
||||
WaveTrack *mixRight = NULL;
|
||||
double oldT0 = mT0;
|
||||
double oldT1 = mT1;
|
||||
// Most effects should stop at t1.
|
||||
if (!mPreviewFullSelection)
|
||||
mT1 = t1;
|
||||
|
||||
// Save the original track list
|
||||
TrackList *saveTracks = mTracks;
|
||||
|
||||
// Linear Effect preview optimised by pre-mixing to one track.
|
||||
// Generators need to generate per track.
|
||||
if (mIsLinearEffect && !(GetType() == EffectTypeGenerate)) {
|
||||
success = ::MixAndRender(mTracks, mFactory, rate, floatSample, t0, t1,
|
||||
&mixLeft, &mixRight);
|
||||
}
|
||||
|
||||
// Build new tracklist from rendering tracks
|
||||
mTracks = new TrackList();
|
||||
|
||||
if (mIsLinearEffect && !(GetType() == EffectTypeGenerate)) {
|
||||
// Linear Effect preview optimised by pre-mixing to one track.
|
||||
// Generators need to generate per track.
|
||||
if (mIsLinearEffect && !isGenerator) {
|
||||
success = ::MixAndRender(saveTracks, mFactory, rate, floatSample, mT0, t1,
|
||||
&mixLeft, &mixRight);
|
||||
if (!success) {
|
||||
delete mTracks;
|
||||
mTracks = saveTracks;
|
||||
return;
|
||||
}
|
||||
|
||||
mixLeft->InsertSilence(0.0, mT0);
|
||||
mixLeft->SetSelected(true);
|
||||
mixLeft->SetDisplay(WaveTrack::NoDisplay);
|
||||
mTracks->Add(mixLeft);
|
||||
if (mixRight) {
|
||||
mixRight->InsertSilence(0.0, mT0);
|
||||
mixRight->SetSelected(true);
|
||||
mTracks->Add(mixRight);
|
||||
}
|
||||
|
||||
// Reset t0 / t1 is required when source tracks have different start times.
|
||||
t0 = mixLeft->GetStartTime();
|
||||
t1 = mixLeft->GetEndTime();
|
||||
}
|
||||
else {
|
||||
TrackListOfKindIterator iter(Track::Wave, saveTracks);
|
||||
@ -2460,7 +2482,8 @@ void Effect::Preview(bool dryOnly)
|
||||
{
|
||||
WaveTrack *dest;
|
||||
if (src->GetSelected() || mPreviewWithNotSelected) {
|
||||
src->Copy(t0, t1, (Track **) &dest);
|
||||
src->Copy(mT0, t1, (Track **) &dest);
|
||||
dest->InsertSilence(0.0, mT0);
|
||||
dest->SetSelected(src->GetSelected());
|
||||
dest->SetDisplay(WaveTrack::NoDisplay);
|
||||
mTracks->Add(dest);
|
||||
@ -2472,25 +2495,14 @@ void Effect::Preview(bool dryOnly)
|
||||
// Update track/group counts
|
||||
CountWaveTracks();
|
||||
|
||||
double t0save = mT0;
|
||||
double t1save = mT1;
|
||||
|
||||
if (mIsLinearEffect) {
|
||||
mT0 = t0;
|
||||
mT1 = t1;
|
||||
}
|
||||
else {
|
||||
mT0 = 0;
|
||||
mT1 = t1 - t0;
|
||||
}
|
||||
|
||||
// Apply effect
|
||||
|
||||
if (!dryOnly) {
|
||||
mProgress = new ProgressDialog(GetName(),
|
||||
_("Preparing preview"),
|
||||
pdlgHideCancelButton); // Have only "Stop" button.
|
||||
mIsPreview = true;
|
||||
success = Process();
|
||||
mIsPreview = false;
|
||||
delete mProgress;
|
||||
mProgress = NULL;
|
||||
}
|
||||
@ -2502,11 +2514,12 @@ void Effect::Preview(bool dryOnly)
|
||||
|
||||
SelectedTrackListOfKindIterator iter(Track::Wave, mTracks);
|
||||
WaveTrack *src = (WaveTrack *) iter.First();
|
||||
while (src)
|
||||
{
|
||||
while (src) {
|
||||
playbackTracks.Add(src);
|
||||
src = (WaveTrack *) iter.Next();
|
||||
}
|
||||
if (isNyquist && isGenerator)
|
||||
t1 = mT1;
|
||||
|
||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||
NoteTrackArray empty;
|
||||
@ -2517,11 +2530,11 @@ void Effect::Preview(bool dryOnly)
|
||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||
empty,
|
||||
#endif
|
||||
rate, mT0, mT1);
|
||||
rate, mT0, t1);
|
||||
|
||||
if (token) {
|
||||
int previewing = eProgressSuccess;
|
||||
|
||||
wxLogDebug(wxT("mT0 %.3f t1 %.3f"),mT0,t1);
|
||||
// The progress dialog must be deleted before stopping the stream
|
||||
// to allow events to flow to the app during StopStream processing.
|
||||
// The progress dialog blocks these events.
|
||||
@ -2530,7 +2543,7 @@ void Effect::Preview(bool dryOnly)
|
||||
|
||||
while (gAudioIO->IsStreamActive(token) && previewing == eProgressSuccess) {
|
||||
::wxMilliSleep(100);
|
||||
previewing = progress->Update(gAudioIO->GetStreamTime() - mT0, mT1);
|
||||
previewing = progress->Update(gAudioIO->GetStreamTime() - mT0, t1 - mT0);
|
||||
}
|
||||
|
||||
delete progress;
|
||||
@ -2547,10 +2560,6 @@ void Effect::Preview(bool dryOnly)
|
||||
}
|
||||
}
|
||||
|
||||
// Restore original selection
|
||||
mT0 = t0save;
|
||||
mT1 = t1save;
|
||||
|
||||
if (FocusDialog) {
|
||||
FocusDialog->SetFocus();
|
||||
}
|
||||
@ -2562,6 +2571,9 @@ void Effect::Preview(bool dryOnly)
|
||||
delete mTracks;
|
||||
|
||||
mTracks = saveTracks;
|
||||
mT0 = oldT0;
|
||||
mT1 = oldT1;
|
||||
|
||||
// Effect is already inited; we call Process, End, and then Init
|
||||
// again, so the state is exactly the way it was before Preview
|
||||
// was called.
|
||||
|
@ -321,6 +321,10 @@ protected:
|
||||
// To allow pre-mixing before Preview, set linearEffectFlag to true.
|
||||
void SetLinearEffectFlag(bool linearEffectFlag);
|
||||
|
||||
// Most effects only need to preview a short selection. However some
|
||||
// (such as fade effects) need to know the full selection length.
|
||||
void SetPreviewFullSelectionFlag(bool previewDurationFlag);
|
||||
|
||||
// Most effects only require selected tracks to be copied for Preview.
|
||||
// If IncludeNotSelectedPreviewTracks(true), then non-linear effects have
|
||||
// preview copies of all wave tracks.
|
||||
@ -400,12 +404,13 @@ private:
|
||||
|
||||
bool mIsLinearEffect;
|
||||
bool mPreviewWithNotSelected;
|
||||
bool mPreviewFullSelection;
|
||||
|
||||
bool mIsSelection;
|
||||
double mDuration;
|
||||
wxString mDurationFormat;
|
||||
// mSetDuration should ONLY be set when SetDuration() is called.
|
||||
double mSetDuration;
|
||||
|
||||
bool mIsPreview;
|
||||
|
||||
bool mUIDebug;
|
||||
|
||||
|
36
src/effects/Equalization.cpp
Normal file → Executable file
36
src/effects/Equalization.cpp
Normal file → Executable file
@ -880,18 +880,7 @@ bool EffectEqualization::TransferDataToWindow()
|
||||
mdBMax = 0; // force refresh in TransferDataFromWindow()
|
||||
|
||||
// Reload the curve names
|
||||
mCurve->Clear();
|
||||
for (size_t i = 0, cnt = mCurves.GetCount(); i < cnt; i++)
|
||||
{
|
||||
mCurve->Append(mCurves[ i ].Name);
|
||||
}
|
||||
mCurve->SetStringSelection(mCurveName);
|
||||
|
||||
// Allow the control to resize
|
||||
mCurve->SetSizeHints(-1, -1);
|
||||
|
||||
// Set initial curve
|
||||
setCurve( mCurveName );
|
||||
UpdateCurves();
|
||||
|
||||
// Set graphic interpolation mode
|
||||
mInterpChoice->SetSelection(mInterp);
|
||||
@ -1847,6 +1836,23 @@ void EffectEqualization::LayoutEQSliders()
|
||||
mUIParent->RefreshRect(wxRect(szrG->GetPosition(), szrGSize));
|
||||
}
|
||||
|
||||
void EffectEqualization::UpdateCurves()
|
||||
{
|
||||
// Reload the curve names
|
||||
mCurve->Clear();
|
||||
for (size_t i = 0, cnt = mCurves.GetCount(); i < cnt; i++)
|
||||
{
|
||||
mCurve->Append(mCurves[ i ].Name);
|
||||
}
|
||||
mCurve->SetStringSelection(mCurveName);
|
||||
|
||||
// Allow the control to resize
|
||||
mCurve->SetSizeHints(-1, -1);
|
||||
|
||||
// Set initial curve
|
||||
setCurve( mCurveName );
|
||||
}
|
||||
|
||||
void EffectEqualization::UpdateDraw()
|
||||
{
|
||||
int numPoints = mLogEnvelope->GetNumberOfPoints();
|
||||
@ -2416,6 +2422,12 @@ void EffectEqualization::OnManage(wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
EditCurvesDialog d(mUIParent, this, mCurve->GetSelection());
|
||||
d.ShowModal();
|
||||
|
||||
// Reload the curve names
|
||||
UpdateCurves();
|
||||
|
||||
// Allow control to resize
|
||||
mUIParent->Layout();
|
||||
}
|
||||
|
||||
void EffectEqualization::OnClear(wxCommandEvent & WXUNUSED(event))
|
||||
|
1
src/effects/Equalization.h
Normal file → Executable file
1
src/effects/Equalization.h
Normal file → Executable file
@ -150,6 +150,7 @@ private:
|
||||
XMLTagHandler *HandleXMLChild(const wxChar *tag);
|
||||
void WriteXML(XMLWriter &xmlFile);
|
||||
|
||||
void UpdateCurves();
|
||||
void UpdateDraw();
|
||||
|
||||
void LayoutEQSliders();
|
||||
|
@ -1366,6 +1366,10 @@ void NyquistEffect::Parse(wxString line)
|
||||
mEnablePreview = true;
|
||||
SetLinearEffectFlag(true);
|
||||
}
|
||||
else if (tokens[1] == wxT("selection")) {
|
||||
mEnablePreview = true;
|
||||
SetPreviewFullSelectionFlag(true);
|
||||
}
|
||||
else if (tokens[1] == wxT("disabled") || tokens[1] == wxT("false")) {
|
||||
mEnablePreview = false;
|
||||
}
|
||||
|
2
src/export/Export.cpp
Normal file → Executable file
2
src/export/Export.cpp
Normal file → Executable file
@ -550,7 +550,7 @@ bool Exporter::GetFilename()
|
||||
mFilename.GetPath(),
|
||||
mFilename.GetFullName(),
|
||||
maskString,
|
||||
wxFD_SAVE | wxRESIZE_BORDER);
|
||||
wxFD_SAVE | wxRESIZE_BORDER | FD_NO_ADD_EXTENSION);
|
||||
mDialog = &fd;
|
||||
|
||||
fd.SetFilterIndex(mFilterIndex);
|
||||
|
@ -325,7 +325,7 @@ public:
|
||||
Tags *metadata = NULL,
|
||||
int subformat = 0);
|
||||
// optional
|
||||
wxString GetExtension(int index = 0);
|
||||
wxString GetExtension(int index = WXSIZEOF(kFormats));
|
||||
|
||||
private:
|
||||
|
||||
@ -911,7 +911,7 @@ bool ExportPCM::DisplayOptions(wxWindow *parent, int format)
|
||||
|
||||
wxString ExportPCM::GetExtension(int index)
|
||||
{
|
||||
if (index == 0) {
|
||||
if (index == WXSIZEOF(kFormats)) {
|
||||
// get extension libsndfile thinks is correct for currently selected format
|
||||
return sf_header_extension(ReadExportFormatPref());
|
||||
}
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include <wx/event.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/statusbr.h>
|
||||
#include <wx/timer.h>
|
||||
#endif
|
||||
#include <wx/tooltip.h>
|
||||
@ -99,6 +100,12 @@ ControlToolBar::ControlToolBar()
|
||||
|
||||
mSizer = NULL;
|
||||
mCutPreviewTracks = NULL;
|
||||
|
||||
// strings for status bar
|
||||
mStatePlay = _("Play");
|
||||
mStateStop = _("Stop");
|
||||
mStateRecord = _("Record");
|
||||
mStatePause = _("Pause");
|
||||
}
|
||||
|
||||
ControlToolBar::~ControlToolBar()
|
||||
@ -433,6 +440,7 @@ void ControlToolBar::SetPlay(bool down, bool looped, bool cutPreview)
|
||||
mPlay->SetAlternateIdx(0);
|
||||
}
|
||||
EnableDisableButtons();
|
||||
UpdateStatusBar();
|
||||
}
|
||||
|
||||
void ControlToolBar::SetStop(bool down)
|
||||
@ -714,11 +722,13 @@ void ControlToolBar::OnPlay(wxCommandEvent & WXUNUSED(evt))
|
||||
if (p) p->TP_DisplaySelection();
|
||||
|
||||
PlayDefault();
|
||||
UpdateStatusBar();
|
||||
}
|
||||
|
||||
void ControlToolBar::OnStop(wxCommandEvent & WXUNUSED(evt))
|
||||
{
|
||||
StopPlaying();
|
||||
UpdateStatusBar();
|
||||
}
|
||||
|
||||
void ControlToolBar::PlayDefault()
|
||||
@ -972,6 +982,7 @@ void ControlToolBar::OnRecord(wxCommandEvent &evt)
|
||||
SetRecord(false);
|
||||
}
|
||||
}
|
||||
UpdateStatusBar();
|
||||
}
|
||||
|
||||
|
||||
@ -996,6 +1007,7 @@ void ControlToolBar::OnPause(wxCommandEvent & WXUNUSED(evt))
|
||||
}
|
||||
|
||||
gAudioIO->SetPaused(mPaused);
|
||||
UpdateStatusBar();
|
||||
}
|
||||
|
||||
void ControlToolBar::OnRewind(wxCommandEvent & WXUNUSED(evt))
|
||||
@ -1069,3 +1081,49 @@ void ControlToolBar::ClearCutPreviewTracks()
|
||||
}
|
||||
}
|
||||
|
||||
// works out the width of the field in the status bar needed for the state (eg play, record pause)
|
||||
int ControlToolBar::WidthForStatusBar()
|
||||
{
|
||||
AudacityProject* p = GetActiveProject();
|
||||
if (!p)
|
||||
return 100; // dummy value to keep things happy before the project is fully created
|
||||
|
||||
wxStatusBar* sb = p->GetStatusBar();
|
||||
int xMax = 0;
|
||||
int x, y;
|
||||
|
||||
sb->GetTextExtent(mStatePlay + wxT(" ") + mStatePause, &x, &y);
|
||||
if (x > xMax)
|
||||
xMax = x;
|
||||
|
||||
sb->GetTextExtent(mStateStop + wxT(" ") + mStatePause, &x, &y);
|
||||
if (x > xMax)
|
||||
xMax = x;
|
||||
|
||||
sb->GetTextExtent(mStateRecord + wxT(" ") + mStatePause, &x, &y);
|
||||
if (x > xMax)
|
||||
xMax = x;
|
||||
|
||||
return xMax + 30; // added constant needed because xMax isn't large enough for some reason, plus some space.
|
||||
}
|
||||
|
||||
void ControlToolBar::UpdateStatusBar()
|
||||
{
|
||||
wxString state;
|
||||
|
||||
if (mPlay->IsDown())
|
||||
state = mStatePlay;
|
||||
else if (mRecord->IsDown())
|
||||
state = mStateRecord;
|
||||
else
|
||||
state = mStateStop;
|
||||
|
||||
if (mPause->IsDown())
|
||||
{
|
||||
state.Append(wxT(" "));
|
||||
state.Append(mStatePause);
|
||||
}
|
||||
|
||||
GetActiveProject()->GetStatusBar()->SetStatusText(state);
|
||||
}
|
||||
|
||||
|
@ -85,6 +85,8 @@ class ControlToolBar:public ToolBar {
|
||||
virtual void ReCreateButtons();
|
||||
void RegenerateToolsTooltips();
|
||||
|
||||
int WidthForStatusBar();
|
||||
|
||||
private:
|
||||
|
||||
AButton *MakeButton(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
|
||||
@ -102,6 +104,7 @@ class ControlToolBar:public ToolBar {
|
||||
void SetupCutPreviewTracks(double playStart, double cutStart,
|
||||
double cutEnd, double playEnd);
|
||||
void ClearCutPreviewTracks();
|
||||
void UpdateStatusBar();
|
||||
|
||||
enum
|
||||
{
|
||||
@ -135,6 +138,12 @@ class ControlToolBar:public ToolBar {
|
||||
|
||||
TrackList* mCutPreviewTracks;
|
||||
|
||||
// strings for status bar
|
||||
wxString mStatePlay;
|
||||
wxString mStateStop;
|
||||
wxString mStateRecord;
|
||||
wxString mStatePause;
|
||||
|
||||
public:
|
||||
|
||||
DECLARE_CLASS(ControlToolBar);
|
||||
|
Loading…
x
Reference in New Issue
Block a user