Merge remote-tracking branch 'upstream/master' into wx3

This commit is contained in:
Leland Lucius 2015-07-28 15:06:25 -05:00
commit 37168ebbf6
191 changed files with 5000 additions and 2649 deletions

View File

@ -90,6 +90,22 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
<<<<<<< HEAD
=======
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) $(dist_doc_DATA) \
$(dist_pkgdata_DATA) $(nobase_dist_pkgdata_DATA) ABOUT-NLS \
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/config.guess \
$(top_srcdir)/autotools/config.rpath \
$(top_srcdir)/autotools/config.sub \
$(top_srcdir)/autotools/install-sh \
$(top_srcdir)/autotools/ltmain.sh \
$(top_srcdir)/autotools/missing
>>>>>>> upstream/master
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
@ -902,16 +918,22 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
<<<<<<< HEAD
@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
=======
>>>>>>> upstream/master
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
<<<<<<< HEAD
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
=======
>>>>>>> upstream/master
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@ -952,11 +974,18 @@ distcheck: dist
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
<<<<<<< HEAD
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
=======
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
>>>>>>> upstream/master
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \

View File

@ -56,3 +56,5 @@
#endif
#endif
wxCursor * MakeCursor(int WXUNUSED(CursorId), const char * pXpm[36], int HotX, int HotY);

View File

@ -842,6 +842,7 @@
288A544B1346D1BA0050D774 /* chanmap.c in Sources */ = {isa = PBXBuildFile; fileRef = 288A54481346D1BA0050D774 /* chanmap.c */; };
288A544C1346D1BA0050D774 /* chanmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 288A54491346D1BA0050D774 /* chanmap.h */; };
288A544D1346D1BA0050D774 /* id3.c in Sources */ = {isa = PBXBuildFile; fileRef = 288A544A1346D1BA0050D774 /* id3.c */; };
2890498E1B6716B40038A543 /* SpectrogramSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2890498C1B6716B40038A543 /* SpectrogramSettings.cpp */; };
2891B2870C531D2C0044FBE3 /* FindClipping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2891B2850C531D2C0044FBE3 /* FindClipping.cpp */; };
2892CE24131AFAE200E1E17D /* LICENSE.txt in Install miscellany */ = {isa = PBXBuildFile; fileRef = 288F0977131A3EE00008E860 /* LICENSE.txt */; };
2892CE25131AFAEF00E1E17D /* README.txt in Install miscellany */ = {isa = PBXBuildFile; fileRef = 288F097A131A3F130008E860 /* README.txt */; };
@ -2072,6 +2073,7 @@
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>"; };
280F5C8B1B676699003022C5 /* NumberScale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberScale.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; };
@ -2550,6 +2552,8 @@
288A544A1346D1BA0050D774 /* id3.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = id3.c; sourceTree = "<group>"; };
288F0977131A3EE00008E860 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = LICENSE.txt; path = ../LICENSE.txt; sourceTree = "<group>"; };
288F097A131A3F130008E860 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = README.txt; path = ../README.txt; sourceTree = "<group>"; };
2890498C1B6716B40038A543 /* SpectrogramSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpectrogramSettings.cpp; sourceTree = "<group>"; };
2890498D1B6716B40038A543 /* SpectrogramSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpectrogramSettings.h; sourceTree = "<group>"; };
2891B2850C531D2C0044FBE3 /* FindClipping.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = FindClipping.cpp; sourceTree = "<group>"; tabWidth = 3; };
2891B2860C531D2C0044FBE3 /* FindClipping.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = FindClipping.h; sourceTree = "<group>"; tabWidth = 3; };
28948425101DF8FC005B0713 /* EffectsPrefs.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = EffectsPrefs.cpp; sourceTree = "<group>"; tabWidth = 3; };
@ -3880,6 +3884,7 @@
280A8B4619F4403B0091DE70 /* ModuleManager.h */,
1790B0AF09883BFD008A330A /* NoteTrack.cpp */,
1790B0B009883BFD008A330A /* NoteTrack.h */,
280F5C8B1B676699003022C5 /* NumberScale.h */,
EDF3B7AF1588C0D50032D35F /* Paulstretch.cpp */,
EDF3B7AE1588C0D50032D35F /* Paulstretch.h */,
1790B0B109883BFD008A330A /* PitchName.cpp */,
@ -4226,6 +4231,8 @@
1790B0CA09883BFD008A330A /* SpectrumPrefs.cpp */,
1790B0CB09883BFD008A330A /* SpectrumPrefs.h */,
28456AC00A2C180E00C23C1E /* ThemePrefs.cpp */,
2890498C1B6716B40038A543 /* SpectrogramSettings.cpp */,
2890498D1B6716B40038A543 /* SpectrogramSettings.h */,
28456AC10A2C180E00C23C1E /* ThemePrefs.h */,
284B27E00FC66CCD005EAC96 /* TracksPrefs.cpp */,
284B27E10FC66CCD005EAC96 /* TracksPrefs.h */,
@ -7528,6 +7535,8 @@
28D000A51A32920C00367B21 /* DeviceChange.cpp in Sources */,
28D8425C1AD8D69D00551353 /* SelectedRegion.cpp in Sources */,
2888A1631AE25F9A00E06FDC /* Diags.cpp in Sources */,
28DDE3A21AE3771100C784FE /* ViewInfo.cpp in Sources */,
2890498E1B6716B40038A543 /* SpectrogramSettings.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -45,7 +45,5 @@
(T (sum (prod env (wet sig f0 f1 fc))
(prod (diff 1.0 env) sig))))))
(if (string-not-equal (get '*TRACK* 'VIEW) "spectral" :end1 8 :end2 8)
"Use this effect in the 'Spectral Selection'\nor 'Spectral Selection log(f)' view."
(catch 'error-message
(multichan-expand #'result *track*)))
(catch 'error-message
(multichan-expand #'result *track*))

View File

@ -19,20 +19,23 @@
(defmacro validate (hz)
"Ensure frequency is below Nyquist"
`(setf hz (min (/ *sound-srate* 2.0),hz)))
`(setf ,hz (max 0 (min (/ *sound-srate* 2.0) ,hz))))
(defun wet (sig gain f0 f1)
;; (re)calculate bw and fc to ensure we do not exceed Nyquist frequency
(let ((fc (sqrt (* f0 (validate f1))))
(bw (/ (log (/ (validate f1) f0))
(log 2.0))))
(validate f0)
(validate f1)
(let ((fc (sqrt (* f0 f1)))
(bw (/ (log (/ f1 f0))
(log 2.0))))
(when (= bw 0)
(throw 'error-message (format nil "~aBandwidth is zero.~%Select a frequency range." p-err)))
(eq-band sig fc gain (/ bw 2))))
(defun result (sig)
(let*
((f0 (get '*selection* 'low-hz))
(f1 (get '*selection* 'high-hz))
(bw (get '*selection* 'bandwidth))
(tn (truncate len))
(rate (snd-srate sig))
(transition (truncate (* 0.01 rate))) ; 10 ms
@ -43,26 +46,16 @@
(cond
((not (or f0 f1))
(throw 'error-message (format nil "~aPlease select frequencies." p-err)))
((not f0)
((or (not f0) (= f0 0))
(throw 'error-message (format nil "~aLow frequency is undefined." p-err)))
((not f1)
(throw 'error-message (format nil "~aHigh frequency is undefined." p-err)))
((= bw 0)
(throw 'error-message (format nil "~aBandwidth is zero.~%Select a frequency range." p-err)))
;; If seleted frequency band is above Nyquist, do nothing.
((< f0 (/ *sound-srate* 2.0))
(sum (prod env (wet sig control-gain f0 f1)) (prod (diff 1.0 env) sig))))))
(cond
((not (get '*TRACK* 'VIEW)) ; 'View is NIL during Preview
(setf p-err (format nil "This effect requires a frequency selection in the~%~
'Spectrogram' or 'Spectrogram (log f)' track view.~%~%"))
(catch 'error-message
(multichan-expand #'result *track*)))
((string-not-equal (get '*TRACK* 'VIEW) "spectral" :end1 8 :end2 8)
"Use this effect in the 'Spectral Selection'\nor 'Spectral Selection log(f)' view.")
(T (setf p-err "")
(if (= control-gain 0) ; Allow dry preview
"Gain is zero. Nothing to do."
(catch 'error-message
(multichan-expand #'result *track*)))))
(catch 'error-message
(setf p-err "")
(if (= control-gain 0) ; Allow dry preview
"Gain is zero. Nothing to do."
(multichan-expand #'result *track*)))

View File

@ -19,7 +19,7 @@
(defmacro validate (hz)
"Ensure frequency is below Nyquist"
`(setf hz (min (/ *sound-srate* 2.0),hz)))
`(setf ,hz (max 0 (min (/ *sound-srate* 2.0) ,hz))))
(defun mid-shelf (sig lf hf gain)
"Combines high shelf and low shelf filters"
@ -30,9 +30,14 @@
(defun wet (sig gain f0 f1)
(cond
((not f0) (eq-lowshelf sig f1 gain))
((not f1) (eq-highshelf sig f0 gain))
(t (mid-shelf sig f0 (validate f1) gain))))
((not f0) (eq-lowshelf sig (validate f1) gain))
((not f1) (eq-highshelf sig (validate f0) gain))
(t
(validate f0)
(validate f1)
(when (= f0 f1)
(throw 'error-message "Please select a frequency range."))
(mid-shelf sig f0 f1 gain))))
(defun result (sig)
(let*
@ -48,8 +53,6 @@
(cond
((not (or f0 f1))
(throw 'error-message (format nil "~aPlease select frequencies." p-err)))
((and f0 f1 (= f0 f1)) (throw 'error-message
"Please select a frequency range."))
; shelf is above Nyquist frequency so do nothing
((and f0 (>= f0 (/ *sound-srate* 2.0))) nil)
(T (sum (prod env (wet sig control-gain f0 f1))
@ -63,18 +66,9 @@
(>= (get '*selection* 'high-hz)(/ *sound-srate* 2)))
(remprop '*selection* 'high-hz))
(cond
((not (get '*TRACK* 'VIEW)) ; 'View is NIL during Preview
(setf p-err (format nil "This effect requires a frequency selection in the~%~
'Spectral Selection' or 'Spectral Selection log(f)'~%~
track view.~%~%"))
(catch 'error-message
(multichan-expand #'result *track*)))
((string-not-equal (get '*TRACK* 'VIEW) "spectral" :end1 8 :end2 8)
"Use this effect in the 'Spectral Selection'\nor 'Spectral Selection log(f)' view.")
(T (setf p-err "")
(if (= control-gain 0) ; Allow dry preview
"Gain is zero. Nothing to do."
(catch 'error-message
(multichan-expand #'result *track*)))))
(catch 'error-message
(setf p-err "")
(if (= control-gain 0) ; Allow dry preview
"Gain is zero. Nothing to do."
(multichan-expand #'result *track*)))

View File

@ -152,8 +152,11 @@ void QuitAudacity();
#endif
#endif
// This macro is used widely, so declared here.
#define QUANTIZED_TIME(time, rate) ((double)((sampleCount)floor(((double)(time) * (rate)) + 0.5))) / (rate)
// These macros are used widely, so declared here.
#define QUANTIZED_TIME(time, rate) (((double)((sampleCount)floor(((double)(time) * (rate)) + 0.5))) / (rate))
// dB - linear amplitude convesions
#define DB_TO_LINEAR(x) (pow(10.0, (x) / 20.0))
#define LINEAR_TO_DB(x) (20.0 * log10(x))
// Marks strings for extraction only...must use wxGetTranslation() to translate.
#define XO(s) wxT(s)

View File

@ -92,6 +92,9 @@ It handles initialization and termination by subclassing wxApp.
#include "ondemand/ODManager.h"
#include "commands/Keyboard.h"
#include "widgets/ErrorDialog.h"
#include "prefs/DirectoriesPrefs.h"
#include "prefs/SpectrogramSettings.h"
#include "prefs/WaveformSettings.h"
//temporarilly commented out till it is added to all projects
//#include "Profiler.h"
@ -123,9 +126,7 @@ It handles initialization and termination by subclassing wxApp.
// Windows specific linker control...only needed once so
// this is a good place (unless we want to add another file).
#if defined(__WXMSW__)
//#if wxCHECK_VERSION(3, 0, 2) && !wxCHECK_VERSION(3, 1, 0)
#include <wx/init.h>
//#endif
// These lines ensure that Audacity gets WindowsXP themes.
// Without them we get the old-style Windows98/2000 look under XP.
# if !defined(__WXWINCE__)
@ -209,15 +210,6 @@ It handles initialization and termination by subclassing wxApp.
# if defined(EXPERIMENTAL_CRASH_REPORT)
# pragma comment(lib, "wxmsw" V "u" D "_qa")
# endif
# pragma comment(lib, "wxbase" V "u" D)
# pragma comment(lib, "wxbase" V "u" D "_net.lib")
# pragma comment(lib, "wxmsw" V "u" D "_adv.lib")
# pragma comment(lib, "wxmsw" V "u" D "_core.lib")
# pragma comment(lib, "wxmsw" V "u" D "_html.lib")
# pragma comment(lib, "wxpng" D)
# pragma comment(lib, "wxzlib" D)
# pragma comment(lib, "wxjpeg" D)
# pragma comment(lib, "wxtiff" D)
# undef V
# undef D
@ -231,6 +223,9 @@ It handles initialization and termination by subclassing wxApp.
////////////////////////////////////////////////////////////
DEFINE_EVENT_TYPE(EVT_OPEN_AUDIO_FILE);
DEFINE_EVENT_TYPE(EVT_CAPTURE_KEYBOARD);
DEFINE_EVENT_TYPE(EVT_RELEASE_KEYBOARD);
DEFINE_EVENT_TYPE(EVT_CAPTURE_KEY);
#ifdef __WXGTK__
static void wxOnAssert(const wxChar *fileName, int lineNumber, const wxChar *msg)
@ -249,6 +244,8 @@ static void wxOnAssert(const wxChar *fileName, int lineNumber, const wxChar *msg
}
#endif
static wxFrame *gParentFrame = NULL;
static bool gInited = false;
bool gIsQuitting = false;
@ -259,8 +256,6 @@ void QuitAudacity(bool bForce)
gIsQuitting = true;
wxTheApp->SetExitOnFrameDelete(true);
// Try to close each open window. If the user hits Cancel
// in a Save Changes dialog, don't continue.
// BG: unless force is true
@ -295,8 +290,14 @@ void QuitAudacity(bool bForce)
}
}
LWSlider::DeleteSharedTipPanel();
ModuleManager::Get().Dispatch(AppQuiting);
if (gParentFrame)
gParentFrame->Destroy();
gParentFrame = NULL;
#ifdef EXPERIMENTAL_SCOREALIGN
CloseScoreAlignDialog();
#endif
@ -648,12 +649,12 @@ public:
};
};
#if !defined(__WXMAC__) && !defined(__WXMSW__)
#ifndef __WXMAC__
IMPLEMENT_APP(AudacityApp)
/* make the application class known to wxWidgets for dynamic construction */
#endif
#if defined(__WXMAC__) || defined(__WXMSW__)
#ifdef __WXMAC__
// This should be removed when Lame and FFmpeg support is converted
// from loadable libraries to commands.
//
@ -668,8 +669,6 @@ IMPLEMENT_APP(AudacityApp)
// one tried.
IMPLEMENT_APP_NO_MAIN(AudacityApp)
IMPLEMENT_WX_THEME_SUPPORT
#if defined(__WXMAC__)
int main(int argc, char *argv[])
{
if (getenv("DYLD_LIBRARY_PATH")) {
@ -678,31 +677,8 @@ int main(int argc, char *argv[])
unsetenv("DYLD_LIBRARY_PATH");
execve(argv[0], argv, environ);
}
wxDISABLE_DEBUG_SUPPORT();
return wxEntry(argc, argv);
}
#elif defined(__WXMSW__)
extern "C" int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
wxCmdLineArgType WXUNUSED(lpCmdLine),
int nCmdShow)
{
wxDISABLE_DEBUG_SUPPORT();
// Disable setting of HiDPI aware mode
wxMSWDisableSettingHighDPIAware();
/* NB: We pass NULL in place of lpCmdLine to behave the same as */
/* Borland-specific wWinMain() above. If it becomes needed */
/* to pass lpCmdLine to wxEntry() here, you'll have to fix */
/* wWinMain() above too. */
return wxEntry(hInstance, hPrevInstance, NULL, nCmdShow);
}
#endif
#endif
#ifdef __WXMAC__
@ -1012,12 +988,11 @@ void AudacityApp::InitLang( const wxString & lang )
wxSetEnv(wxT("LANG"), wxT("en_US.UTF-8"));
#endif
const wxLanguageInfo *info = wxLocale::FindLanguageInfo(lang);
if (!lang)
{
return;
}
mLocale = new wxLocale(info->Language);
#if wxCHECK_VERSION(3,0,0)
mLocale = new wxLocale(wxT(""), lang, wxT(""), true);
#else
mLocale = new wxLocale(wxT(""), lang, wxT(""), true, true);
#endif
for(unsigned int i=0; i<audacityPathList.GetCount(); i++)
mLocale->AddCatalogLookupPathPrefix(audacityPathList[i]);
@ -1038,7 +1013,12 @@ void AudacityApp::InitLang( const wxString & lang )
//
// This must go _after_ creating the wxLocale instance because
// creating the wxLocale instance sets the application-wide locale.
Internat::Init();
// Some static arrays unconnected with any project want to be informed of language changes.
SpectrogramSettings::InvalidateNames();
WaveformSettings::InvalidateNames();
}
void AudacityApp::OnFatalException()
@ -1096,16 +1076,16 @@ void AudacityApp::GenerateCrashReport(wxDebugReport::Context ctx)
}
#endif
#if defined(__WXGTK__)
// On wxGTK, there's a focus issue where dialogs do not automatically pass focus
// to the first child. This means that you can use the keyboard to navigate within
// the dialog. Watching for the ACTIVATE event allows us to set the focus ourselves
// when each dialog opens.
//
// See bug #57
//
int AudacityApp::FilterEvent(wxEvent & event)
{
#if !wxCHECK_VERSION(3, 0, 0) && defined(__WXGTK__)
// On wxGTK, there's a focus issue where dialogs do not automatically pass focus
// to the first child. This means that you can use the keyboard to navigate within
// the dialog. Watching for the ACTIVATE event allows us to set the focus ourselves
// when each dialog opens.
//
// See bug #57
//
if (event.GetEventType() == wxEVT_ACTIVATE)
{
wxActivateEvent & e = (wxActivateEvent &) event;
@ -1115,11 +1095,10 @@ int AudacityApp::FilterEvent(wxEvent & event)
((wxWindow *)e.GetEventObject())->SetFocus();
}
}
break;
#endif
return Event_Skip;
return -1;
}
#endif
AudacityApp::AudacityApp()
{
@ -1137,9 +1116,6 @@ AudacityApp::AudacityApp()
// main frame
bool AudacityApp::OnInit()
{
// Ensure we have an event loop during initialization
wxEventLoopGuarantor eventLoop;
delete wxLog::SetActiveTarget(new AudacityLogger);
mLocale = NULL;
@ -1150,6 +1126,11 @@ bool AudacityApp::OnInit()
mChecker = NULL;
mIPCServ = NULL;
#if defined(__WXGTK__)
// Workaround for bug 154 -- initialize to false
inKbdHandler = false;
#endif
#if defined(__WXMAC__)
// Disable window animation
wxSystemOptions::SetOption( wxMAC_WINDOW_PLAIN_TRANSITION, 1 );
@ -1299,6 +1280,15 @@ bool AudacityApp::OnInit()
// If we're waiitng in a dialog before then we can very easily
// start multiple instances, defeating the single instance checker.
//JKC We'd like to initialise the module manager WHILE showing the splash screen.
//Can't in wx3.0.1 as MultiDialog interacts poorly with the splash screen. So we do it before.
//TODO: Find out why opening a multidialog wrecks the splash screen.
//best current guess is that it's something to do with doing a DoModal this early
//in the program.
// Initialize the CommandHandler
InitCommandHandler();
@ -1308,6 +1298,64 @@ bool AudacityApp::OnInit()
// Initialize the ModuleManager, including loading found modules
ModuleManager::Get().Initialize(*mCmdHandler);
#if !wxCHECK_VERSION(3, 0, 0)
FinishInits();
#endif
return TRUE;
}
#if wxCHECK_VERSION(3, 0, 0)
#include <wx/evtloop.h>
static bool bInitsDone = false;
void AudacityApp::OnEventLoopEnter(wxEventLoopBase * pLoop)
{
if( !pLoop->IsMain() )
return;
if (bInitsDone)
return;
bInitsDone = true;
FinishInits();
}
#endif
// JKC: I've split 'FinishInits()' from 'OnInit()', so that
// we can have a real event loop running. We could (I think)
// put everything that is in OnInit() in here.
// This change was to support wxWidgets 3.0.0 and allow us
// to show a dialog (for module loading) during initialisation.
// without it messing up the splash screen.
// Hasn't actually fixed that yet, but is addressing the point
// they make in their release notes.
void AudacityApp::FinishInits()
{
// Until we are ready for wxWidgets 3.x, put a warning dialog up.
// Our problem is that distros may ship with 3.x builds as default.
// We are saying, don't.
//
// wx3 is Ok for experimental builds.
//
// Deliberately not translated. People can search for the english error
// text for more details. This error will only show in versions
// of Audacity that were incorrectly built.
//
// The intention was to do this, if needed, as part of the splash screen.
// However the splash screen is one of the things broken by wx3.0
// changes in OnInit handling. We also can't put this dialog earlier.
#if wxCHECK_VERSION(3, 0, 0)
ShowErrorDialog( NULL,
wxT("Bad Version"),
wxT(
"Audacity should be built with wxWidgets 2.8.12.\n\n This version \
of Audacity (") AUDACITY_VERSION_STRING wxT(") is using ") wxVERSION_STRING \
wxT( ".\n We're not ready for that version of wxWidgets yet.\n\n \
Click the 'Help' button for known issues."),
wxT("http://wiki.audacityteam.org/wiki/Incorrect_wxWidgets_Version"),
true);
#endif
// Parse command line and handle options that might require
// immediate exit...no need to initialize all of the audio
// stuff to display the version string.
@ -1357,6 +1405,9 @@ bool AudacityApp::OnInit()
exit(1);
}
// No Splash screen on wx3 whislt we sort out the problem
// with showing a dialog AND a splash screen during inits.
#if !wxCHECK_VERSION(3, 0, 0)
// BG: Create a temporary window to set as the top window
wxImage logoimage((const char **) AudacityLogoWithName_xpm);
logoimage.Rescale(logoimage.GetWidth() / 2, logoimage.GetHeight() / 2);
@ -1373,7 +1424,7 @@ bool AudacityApp::OnInit()
wxSTAY_ON_TOP);
temporarywindow->SetTitle(_("Audacity is starting up..."));
SetTopWindow(temporarywindow);
wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI);
#endif
//JKC: Would like to put module loading here.
@ -1403,10 +1454,15 @@ bool AudacityApp::OnInit()
mRecentFiles->UseMenu(recentMenu);
mRecentFiles->AddFilesToMenu(recentMenu);
SetExitOnFrameDelete(false);
// This invisibale frame will be the "root" of all other frames and will
// become the active frame when no projects are open.
gParentFrame = new wxFrame(NULL, -1, wxEmptyString, wxPoint(0, 0), wxSize(0, 0), 0);
#endif //__WXMAC__
SetExitOnFrameDelete(true);
AudacityProject *project = CreateNewAudacityProject();
mCmdHandler->SetProject(project);
wxWindow * pWnd = MakeHijackPanel() ;
@ -1418,8 +1474,11 @@ bool AudacityApp::OnInit()
pWnd->Show( true );
}
#if !wxCHECK_VERSION(3, 0, 0)
temporarywindow->Show(false);
delete temporarywindow;
#endif
if( project->mShowSplashScreen )
project->OnHelpWelcome();
@ -1447,7 +1506,7 @@ bool AudacityApp::OnInit()
DirManager::SetDontDeleteTempFiles();
delete parser;
QuitAudacity(true);
return false;
return;
}
//
@ -1460,7 +1519,7 @@ bool AudacityApp::OnInit()
delete parser;
RunBenchmark(NULL);
return false;
return;
}
for (size_t i = 0, cnt = parser->GetParamCount(); i < cnt; i++)
@ -1479,8 +1538,6 @@ bool AudacityApp::OnInit()
mTimer.SetOwner(this, kAudacityAppTimerID);
mTimer.Start(200);
return TRUE;
}
void AudacityApp::InitCommandHandler()
@ -1556,8 +1613,11 @@ bool AudacityApp::InitTempDir()
// Failed
wxMessageBox(_("Audacity could not find a place to store temporary files.\nPlease enter an appropriate directory in the preferences dialog."));
PrefsDialog dialog(NULL);
dialog.ShowTempDirPage();
// Only want one page of the preferences
DirectoriesPrefsFactory directoriesPrefsFactory;
PrefsDialog::Factories factories;
factories.push_back(&directoriesPrefsFactory);
GlobalPrefsDialog dialog(NULL, factories);
dialog.ShowModal();
wxMessageBox(_("Audacity is now going to exit. Please launch Audacity again to use the new temporary directory."));
@ -2083,7 +2143,7 @@ void AudacityApp::OnMenuPreferences(wxCommandEvent & event)
// all platforms.
if(gAudacityProjects.GetCount() == 0) {
PrefsDialog dialog(NULL /* parent */ );
GlobalPrefsDialog dialog(NULL /* parent */ );
dialog.ShowModal();
}
else

View File

@ -265,8 +265,9 @@ writing audio.
*//*******************************************************************/
#include "Audacity.h"
#include "float_cast.h"
#include "Experimental.h"
#include "AudioIO.h"
#include "float_cast.h"
#include <math.h>
#include <stdlib.h>
@ -294,11 +295,11 @@ writing audio.
#include <wx/txtstrm.h>
#include "AudacityApp.h"
#include "AudioIO.h"
#include "Mix.h"
#include "MixerBoard.h"
#include "Resample.h"
#include "RingBuffer.h"
#include "prefs/GUISettings.h"
#include "Prefs.h"
#include "Project.h"
#include "TimeTrack.h"
@ -308,8 +309,6 @@ writing audio.
#include "toolbars/ControlToolBar.h"
#include "widgets/Meter.h"
#include "Experimental.h"
#ifdef EXPERIMENTAL_MIDI_OUT
#define MIDI_SLEEP 10 /* milliseconds */
#define ROUND(x) (int) ((x)+0.5)
@ -856,6 +855,8 @@ bool AudioIO::ValidateDeviceNames(wxString play, wxString rec)
AudioIO::AudioIO()
{
mCaptureTracks = mPlaybackTracks = NULL;
mAudioThreadShouldCallFillBuffersOnce = false;
mAudioThreadFillBuffersLoopRunning = false;
mAudioThreadFillBuffersLoopActive = false;
@ -992,6 +993,9 @@ AudioIO::~AudioIO()
#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
delete mScrubQueue;
#endif
delete mCaptureTracks;
delete mPlaybackTracks;
}
void AudioIO::SetMixer(int inputSource)
@ -1525,11 +1529,11 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
int silenceLevelDB;
gPrefs->Read(wxT("/AudioIO/SilenceLevel"), &silenceLevelDB, -50);
int dBRange;
dBRange = gPrefs->Read(wxT("/GUI/EnvdBRange"), ENV_DB_RANGE);
dBRange = gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE);
if(silenceLevelDB < -dBRange)
{
silenceLevelDB = -dBRange + 3; // meter range was made smaller than SilenceLevel
gPrefs->Write(wxT("/GUI/EnvdBRange"), dBRange); // so set SilenceLevel reasonable
gPrefs->Write(ENV_DB_KEY, dBRange); // so set SilenceLevel reasonable
gPrefs->Flush();
}
mSilenceLevel = (silenceLevelDB + dBRange)/(double)dBRange; // meter goes -dBRange dB -> 0dB
@ -1542,8 +1546,8 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
mTime = t0;
mSeek = 0;
mLastRecordingOffset = 0;
mPlaybackTracks = playbackTracks;
mCaptureTracks = captureTracks;
mPlaybackTracks = new WaveTrackArray(playbackTracks);
mCaptureTracks = new WaveTrackArray(captureTracks);
#ifdef EXPERIMENTAL_MIDI_OUT
mMidiPlaybackTracks = midiPlaybackTracks;
#endif
@ -1563,7 +1567,7 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
double minScrubStutter = options.minScrubStutter;
if (scrubbing)
{
if (mCaptureTracks.GetCount() > 0 ||
if (mCaptureTracks->GetCount() > 0 ||
mPlayMode == PLAY_LOOPED ||
mTimeTrack != NULL ||
options.maxScrubSpeed < GetMinScrubSpeed())
@ -1625,8 +1629,8 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
// Capacity of the playback buffer.
mPlaybackRingBufferSecs = 10.0;
mCaptureRingBufferSecs = 4.5 + 0.5 * std::min(size_t(16), mCaptureTracks.GetCount());
mMinCaptureSecsToCopy = 0.2 + 0.2 * std::min(size_t(16), mCaptureTracks.GetCount());
mCaptureRingBufferSecs = 4.5 + 0.5 * std::min(size_t(16), mCaptureTracks->GetCount());
mMinCaptureSecsToCopy = 0.2 + 0.2 * std::min(size_t(16), mCaptureTracks->GetCount());
unsigned int playbackChannels = 0;
unsigned int captureChannels = 0;
@ -1641,7 +1645,7 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
if( captureTracks.GetCount() > 0 )
{
// For capture, every input channel gets its own track
captureChannels = mCaptureTracks.GetCount();
captureChannels = mCaptureTracks->GetCount();
// I don't deal with the possibility of the capture tracks
// having different sample formats, since it will never happen
// with the current code. This code wouldn't *break* if this
@ -1650,7 +1654,7 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
// we would set the sound card to capture in 16 bits and the second
// track wouldn't get the benefit of all 24 bits the card is capable
// of.
captureFormat = mCaptureTracks[0]->GetSampleFormat();
captureFormat = (*mCaptureTracks)[0]->GetSampleFormat();
// Tell project that we are about to start recording
if (mListener)
@ -1711,12 +1715,12 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
return 0;
}
mPlaybackBuffers = new RingBuffer* [mPlaybackTracks.GetCount()];
mPlaybackMixers = new Mixer* [mPlaybackTracks.GetCount()];
mPlaybackBuffers = new RingBuffer* [mPlaybackTracks->GetCount()];
mPlaybackMixers = new Mixer* [mPlaybackTracks->GetCount()];
// Set everything to zero in case we have to delete these due to a memory exception.
memset(mPlaybackBuffers, 0, sizeof(RingBuffer*)*mPlaybackTracks.GetCount());
memset(mPlaybackMixers, 0, sizeof(Mixer*)*mPlaybackTracks.GetCount());
memset(mPlaybackBuffers, 0, sizeof(RingBuffer*)*mPlaybackTracks->GetCount());
memset(mPlaybackMixers, 0, sizeof(Mixer*)*mPlaybackTracks->GetCount());
const Mixer::WarpOptions &warpOptions =
#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
@ -1724,12 +1728,12 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
#endif
Mixer::WarpOptions(mTimeTrack);
for (unsigned int i = 0; i < mPlaybackTracks.GetCount(); i++)
for (unsigned int i = 0; i < mPlaybackTracks->GetCount(); i++)
{
mPlaybackBuffers[i] = new RingBuffer(floatSample, playbackBufferSize);
// MB: use normal time for the end time, not warped time!
mPlaybackMixers[i] = new Mixer(1, &mPlaybackTracks[i],
mPlaybackMixers[i] = new Mixer(1, &(*mPlaybackTracks)[i],
warpOptions,
mT0, mT1, 1,
playbackMixBufferSize, false,
@ -1753,17 +1757,17 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
return 0;
}
mCaptureBuffers = new RingBuffer* [mCaptureTracks.GetCount()];
mResample = new Resample* [mCaptureTracks.GetCount()];
mCaptureBuffers = new RingBuffer* [mCaptureTracks->GetCount()];
mResample = new Resample* [mCaptureTracks->GetCount()];
mFactor = sampleRate / mRate;
// Set everything to zero in case we have to delete these due to a memory exception.
memset(mCaptureBuffers, 0, sizeof(RingBuffer*)*mCaptureTracks.GetCount());
memset(mResample, 0, sizeof(Resample*)*mCaptureTracks.GetCount());
memset(mCaptureBuffers, 0, sizeof(RingBuffer*)*mCaptureTracks->GetCount());
memset(mResample, 0, sizeof(Resample*)*mCaptureTracks->GetCount());
for( unsigned int i = 0; i < mCaptureTracks.GetCount(); i++ )
for( unsigned int i = 0; i < mCaptureTracks->GetCount(); i++ )
{
mCaptureBuffers[i] = new RingBuffer( mCaptureTracks[i]->GetSampleFormat(),
mCaptureBuffers[i] = new RingBuffer( (*mCaptureTracks)[i]->GetSampleFormat(),
captureBufferSize );
mResample[i] = new Resample(true, mFactor, mFactor); // constant rate resampling
}
@ -1791,9 +1795,9 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
// group determination should mimic what is done in audacityAudioCallback()
// when calling RealtimeProcess().
int group = 0;
for (size_t i = 0, cnt = mPlaybackTracks.GetCount(); i < cnt; i++)
for (size_t i = 0, cnt = mPlaybackTracks->GetCount(); i < cnt; i++)
{
WaveTrack *vt = gAudioIO->mPlaybackTracks[i];
WaveTrack *vt = (*gAudioIO->mPlaybackTracks)[i];
int chanCnt = 1;
if (vt->GetLinked())
@ -1815,7 +1819,7 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
// Calculate the new time position
mTime = std::max(mT0, std::min(mT1, *options.pStartTime));
// Reset mixer positions for all playback tracks
unsigned numMixers = mPlaybackTracks.GetCount();
unsigned numMixers = mPlaybackTracks->GetCount();
for (unsigned ii = 0; ii < numMixers; ++ii)
mPlaybackMixers[ii]->Reposition(mTime);
if(mTimeTrack)
@ -1919,7 +1923,7 @@ void AudioIO::StartStreamCleanup(bool bOnlyBuffers)
if(mPlaybackBuffers)
{
for( unsigned int i = 0; i < mPlaybackTracks.GetCount(); i++ )
for( unsigned int i = 0; i < mPlaybackTracks->GetCount(); i++ )
delete mPlaybackBuffers[i];
delete [] mPlaybackBuffers;
mPlaybackBuffers = NULL;
@ -1927,7 +1931,7 @@ void AudioIO::StartStreamCleanup(bool bOnlyBuffers)
if(mPlaybackMixers)
{
for( unsigned int i = 0; i < mPlaybackTracks.GetCount(); i++ )
for( unsigned int i = 0; i < mPlaybackTracks->GetCount(); i++ )
delete mPlaybackMixers[i];
delete [] mPlaybackMixers;
mPlaybackMixers = NULL;
@ -1935,7 +1939,7 @@ void AudioIO::StartStreamCleanup(bool bOnlyBuffers)
if(mCaptureBuffers)
{
for( unsigned int i = 0; i < mCaptureTracks.GetCount(); i++ )
for( unsigned int i = 0; i < mCaptureTracks->GetCount(); i++ )
delete mCaptureBuffers[i];
delete [] mCaptureBuffers;
mCaptureBuffers = NULL;
@ -1943,7 +1947,7 @@ void AudioIO::StartStreamCleanup(bool bOnlyBuffers)
if(mResample)
{
for( unsigned int i = 0; i < mCaptureTracks.GetCount(); i++ )
for( unsigned int i = 0; i < mCaptureTracks->GetCount(); i++ )
delete mResample[i];
delete [] mResample;
mResample = NULL;
@ -2268,9 +2272,9 @@ void AudioIO::StopStream()
// we allocated in StartStream()
//
if( mPlaybackTracks.GetCount() > 0 )
if( mPlaybackTracks->GetCount() > 0 )
{
for( unsigned int i = 0; i < mPlaybackTracks.GetCount(); i++ )
for( unsigned int i = 0; i < mPlaybackTracks->GetCount(); i++ )
{
delete mPlaybackBuffers[i];
delete mPlaybackMixers[i];
@ -2283,7 +2287,7 @@ void AudioIO::StopStream()
//
// Offset all recorded tracks to account for latency
//
if( mCaptureTracks.GetCount() > 0 )
if( mCaptureTracks->GetCount() > 0 )
{
//
// We only apply latency correction when we actually played back
@ -2298,15 +2302,15 @@ void AudioIO::StopStream()
double recordingOffset =
mLastRecordingOffset + latencyCorrection / 1000.0;
for( unsigned int i = 0; i < mCaptureTracks.GetCount(); i++ )
for( unsigned int i = 0; i < mCaptureTracks->GetCount(); i++ )
{
delete mCaptureBuffers[i];
delete mResample[i];
WaveTrack* track = mCaptureTracks[i];
WaveTrack* track = (*mCaptureTracks)[i];
track->Flush();
if (mPlaybackTracks.GetCount() > 0)
if (mPlaybackTracks->GetCount() > 0)
{ // only do latency correction if some tracks are being played back
WaveTrackArray playbackTracks;
AudacityProject *p = GetActiveProject();
@ -2873,7 +2877,7 @@ int AudioIO::GetCommonlyAvailPlayback()
int commonlyAvail = mPlaybackBuffers[0]->AvailForPut();
unsigned int i;
for( i = 1; i < mPlaybackTracks.GetCount(); i++ )
for( i = 1; i < mPlaybackTracks->GetCount(); i++ )
{
int thisBlockAvail = mPlaybackBuffers[i]->AvailForPut();
@ -2889,7 +2893,7 @@ int AudioIO::GetCommonlyAvailCapture()
int commonlyAvail = mCaptureBuffers[0]->AvailForGet();
unsigned int i;
for( i = 1; i < mCaptureTracks.GetCount(); i++ )
for( i = 1; i < mCaptureTracks->GetCount(); i++ )
{
int avail = mCaptureBuffers[i]->AvailForGet();
if( avail < commonlyAvail )
@ -3266,7 +3270,7 @@ void AudioIO::FillBuffers()
{
unsigned int i;
if( mPlaybackTracks.GetCount() > 0 )
if( mPlaybackTracks->GetCount() > 0 )
{
// Though extremely unlikely, it is possible that some buffers
// will have more samples available than others. This could happen
@ -3323,7 +3327,7 @@ void AudioIO::FillBuffers()
mWarpedTime += deltat;
}
for( i = 0; i < mPlaybackTracks.GetCount(); i++ )
for( i = 0; i < mPlaybackTracks->GetCount(); i++ )
{
// The mixer here isn't actually mixing: it's just doing
// resampling, format conversion, and possibly time track
@ -3400,7 +3404,7 @@ void AudioIO::FillBuffers()
startTime = startSample / mRate;
endTime = endSample / mRate;
speed = double(abs(endSample - startSample)) / mScrubDuration;
for (i = 0; i < mPlaybackTracks.GetCount(); i++)
for (i = 0; i < mPlaybackTracks->GetCount(); i++)
mPlaybackMixers[i]->SetTimesAndSpeed(startTime, endTime, speed);
}
}
@ -3415,7 +3419,7 @@ void AudioIO::FillBuffers()
// and if yes, restart from the beginning.
if (mWarpedTime >= mWarpedLength)
{
for (i = 0; i < mPlaybackTracks.GetCount(); i++)
for (i = 0; i < mPlaybackTracks->GetCount(); i++)
mPlaybackMixers[i]->Restart();
mWarpedTime = 0.0;
}
@ -3429,7 +3433,7 @@ void AudioIO::FillBuffers()
}
} // end of playback buffering
if( mCaptureTracks.GetCount() > 0 ) // start record buffering
if( mCaptureTracks->GetCount() > 0 ) // start record buffering
{
int commonlyAvail = GetCommonlyAvailCapture();
@ -3444,12 +3448,12 @@ void AudioIO::FillBuffers()
// Append captured samples to the end of the WaveTracks.
// The WaveTracks have their own buffering for efficiency.
AutoSaveFile blockFileLog;
int numChannels = mCaptureTracks.GetCount();
int numChannels = mCaptureTracks->GetCount();
for( i = 0; (int)i < numChannels; i++ )
{
int avail = commonlyAvail;
sampleFormat trackFormat = mCaptureTracks[i]->GetSampleFormat();
sampleFormat trackFormat = (*mCaptureTracks)[i]->GetSampleFormat();
AutoSaveFile appendLog;
@ -3457,7 +3461,7 @@ void AudioIO::FillBuffers()
{
samplePtr temp = NewSamples(avail, trackFormat);
mCaptureBuffers[i]->Get (temp, trackFormat, avail);
mCaptureTracks[i]-> Append(temp, trackFormat, avail, 1,
(*mCaptureTracks)[i]-> Append(temp, trackFormat, avail, 1,
&appendLog);
DeleteSamples(temp);
}
@ -3473,7 +3477,7 @@ void AudioIO::FillBuffers()
*/
size = mResample[i]->Process(mFactor, (float *)temp1, avail, !IsStreamActive(),
&size, (float *)temp2, size);
mCaptureTracks[i]-> Append(temp2, floatSample, size, 1,
(*mCaptureTracks)[i]-> Append(temp2, floatSample, size, 1,
&appendLog);
DeleteSamples(temp1);
DeleteSamples(temp2);
@ -3482,7 +3486,7 @@ void AudioIO::FillBuffers()
if (!appendLog.IsEmpty())
{
blockFileLog.StartTag(wxT("recordingrecovery"));
blockFileLog.WriteAttr(wxT("id"), mCaptureTracks[i]->GetAutoSaveIdent());
blockFileLog.WriteAttr(wxT("id"), (*mCaptureTracks)[i]->GetAutoSaveIdent());
blockFileLog.WriteAttr(wxT("channel"), (int)i);
blockFileLog.WriteAttr(wxT("numchannels"), numChannels);
blockFileLog.WriteSubTree(appendLog);
@ -3675,7 +3679,7 @@ bool AudioIO::SetHasSolo(bool hasSolo)
void AudioIO::FillMidiBuffers()
{
bool hasSolo = false;
int numPlaybackTracks = gAudioIO->mPlaybackTracks.GetCount();
int numPlaybackTracks = gAudioIO->mPlaybackTracks->GetCount();
int t;
for(t = 0; t < numPlaybackTracks; t++ )
if( gAudioIO->mPlaybackTracks[t]->GetSolo() ) {
@ -3956,7 +3960,7 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
const PaStreamCallbackFlags WXUNUSED(statusFlags), void * WXUNUSED(userData) )
{
int numPlaybackChannels = gAudioIO->mNumPlaybackChannels;
int numPlaybackTracks = gAudioIO->mPlaybackTracks.GetCount();
int numPlaybackTracks = gAudioIO->mPlaybackTracks->GetCount();
int numCaptureChannels = gAudioIO->mNumCaptureChannels;
int callbackReturn = paContinue;
void *tempBuffer = alloca(framesPerBuffer*sizeof(float)*
@ -4137,7 +4141,7 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
int numSolo = 0;
for( t = 0; t < numPlaybackTracks; t++ )
if( gAudioIO->mPlaybackTracks[t]->GetSolo() )
if( (*gAudioIO->mPlaybackTracks)[t]->GetSolo() )
numSolo++;
#ifdef EXPERIMENTAL_MIDI_OUT
int numMidiPlaybackTracks = gAudioIO->mMidiPlaybackTracks.GetCount();
@ -4162,7 +4166,7 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
int maxLen = 0;
for (t = 0; t < numPlaybackTracks; t++)
{
WaveTrack *vt = gAudioIO->mPlaybackTracks[t];
WaveTrack *vt = (*gAudioIO->mPlaybackTracks)[t];
chans[chanCnt] = vt;
@ -4516,6 +4520,8 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
// The problem there occurs if Software Playthrough is on.
// Could conditionally do the update here if Software Playthrough is off,
// and in TrackPanel::OnTimer() if Software Playthrough is on, but not now.
// PRL 12 Jul 2015: and what was in TrackPanel::OnTimer is now handled by means of event
// type EVT_TRACK_PANEL_TIMER
//AudacityProject* pProj = GetActiveProject();
//MixerBoard* pMixerBoard = pProj->GetMixerBoard();
//if (pMixerBoard)

View File

@ -29,10 +29,10 @@
#include "portmixer.h"
#endif
#include <wx/event.h>
#include <wx/string.h>
#include <wx/thread.h>
#include "WaveTrack.h"
#include "SampleFormat.h"
class AudioIO;
@ -46,6 +46,9 @@ class SelectedRegion;
class TimeTrack;
class wxDialog;
class AudacityProject;
class WaveTrackArray;
extern AUDACITY_DLL_API AudioIO *gAudioIO;
void InitAudioIO();
@ -571,9 +574,9 @@ private:
#endif
Resample **mResample;
RingBuffer **mCaptureBuffers;
WaveTrackArray mCaptureTracks;
WaveTrackArray *mCaptureTracks;
RingBuffer **mPlaybackBuffers;
WaveTrackArray mPlaybackTracks;
WaveTrackArray *mPlaybackTracks;
Mixer **mPlaybackMixers;
volatile int mStreamToken;

View File

@ -19,6 +19,7 @@ recover previous Audacity projects that were closed incorrectly.
#include "AudacityApp.h"
#include "FileNames.h"
#include "blockfile/SimpleBlockFile.h"
#include "Sequence.h"
#include "ShuttleGui.h"
#include <wx/wxprec.h>
@ -27,6 +28,8 @@ recover previous Audacity projects that were closed incorrectly.
#include <wx/dialog.h>
#include <wx/app.h>
#include "WaveTrack.h"
enum {
ID_RECOVER_ALL = 10000,
ID_RECOVER_NONE,

View File

@ -17,6 +17,7 @@ See also BatchCommandDialog and BatchProcessDialog.
#include "Audacity.h"
#include "BatchCommands.h"
#include <wx/defs.h>
#include <wx/dir.h>
@ -25,7 +26,6 @@ See also BatchCommandDialog and BatchProcessDialog.
#include <wx/textfile.h>
#include "Project.h"
#include "BatchCommands.h"
#include "commands/CommandManager.h"
#include "effects/EffectManager.h"
#include "FileNames.h"
@ -41,6 +41,7 @@ See also BatchCommandDialog and BatchProcessDialog.
#include "Theme.h"
#include "AllThemeResources.h"
#include "Track.h"
// KLUDGE: All commands should be on the same footing
// however, for historical reasons we distinguish between
@ -682,8 +683,7 @@ bool BatchCommands::ApplyChain(const wxString & filename)
{
if(proj) {
// Chain failed or was cancelled; revert to the previous state
UndoManager *um = proj->GetUndoManager();
proj->SetStateTo(um->GetCurrentState());
proj->RollbackState();
}
return false;
}

View File

@ -42,6 +42,8 @@ out.
*//*******************************************************************/
#include "BlockFile.h"
#include <float.h>
#include <math.h>
@ -51,7 +53,6 @@ out.
#include <wx/log.h>
#include <wx/math.h>
#include "BlockFile.h"
#include "Internat.h"
// msmeyer: Define this to add debug output via printf()

View File

@ -16,11 +16,11 @@
#include <wx/ffile.h>
#include <wx/filename.h>
#include "WaveTrack.h"
#include "xml/XMLTagHandler.h"
#include "xml/XMLWriter.h"
#include "SampleFormat.h"
class SummaryInfo {
public:
@ -209,7 +209,7 @@ class AliasBlockFile : public BlockFile
//
// These methods are for advanced use only!
//
wxFileName GetAliasedFileName() { return mAliasedFileName; };
wxFileName GetAliasedFileName() { return mAliasedFileName; }
void ChangeAliasedFileName(wxFileName newAliasedFile);
virtual bool IsAlias() { return true; }

View File

@ -21,6 +21,8 @@
**********************************************************************/
#include "Dependencies.h"
#include <wx/button.h>
#include <wx/defs.h>
#include <wx/dialog.h>
@ -30,13 +32,14 @@
#include <wx/choice.h>
#include "BlockFile.h"
#include "Dependencies.h"
#include "DirManager.h"
#include "Internat.h"
#include "Prefs.h"
#include "Project.h"
#include "Sequence.h"
#include "ShuttleGui.h"
#include "Track.h"
#include "WaveTrack.h"
#include "WaveClip.h"
// Note, this #include must occur here, not up with the others!
// It must be between the WX_DECLARE_OBJARRAY and WX_DEFINE_OBJARRAY.

View File

@ -15,6 +15,7 @@
#define __AUDACITY_DEPENDENCIES__
#include <wx/dynarray.h>
#include <wx/filename.h>
class AudacityProject;

View File

@ -62,6 +62,7 @@
#include "Audacity.h"
#include "DirManager.h"
#include <time.h> // to use time() for srand()
@ -94,16 +95,16 @@
#include "blockfile/PCMAliasBlockFile.h"
#include "blockfile/ODPCMAliasBlockFile.h"
#include "blockfile/ODDecodeBlockFile.h"
#include "DirManager.h"
#include "Internat.h"
#include "Project.h"
#include "Prefs.h"
#include "widgets/Warning.h"
#include "widgets/MultiDialog.h"
#include "prefs/PrefsDialog.h"
#include "ondemand/ODManager.h"
#include "Track.h"
#if defined(__WXMAC__)
#include <mach/mach.h>
#include <mach/vm_statistics.h>

View File

@ -15,8 +15,10 @@
#include <wx/string.h>
#include <wx/filename.h>
#include <wx/hashmap.h>
#include <wx/utils.h>
#include "WaveTrack.h"
#include "audacity/Types.h"
#include "xml/XMLTagHandler.h"
class wxHashTable;
class BlockFile;
@ -105,7 +107,7 @@ class DirManager: public XMLTagHandler {
void SetMaxSamples(sampleCount max) { mMaxSamples = max; }
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs);
XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; }
void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); }; // This class only reads tags.
void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); } // This class only reads tags.
bool AssignFile(wxFileName &filename,wxString value,bool check);
// Clean the temp dir. Note that now where we have auto recovery the temp

View File

@ -39,7 +39,6 @@ a draggable point type.
#include <wx/log.h>
#include "AColor.h"
#include "Prefs.h"
#include "DirManager.h"
#include "TrackArtist.h"
@ -175,23 +174,6 @@ static double Limit( double Lo, double Value, double Hi )
return Value;
}
double Envelope::toDB(double value)
{
if (value == 0)
return 0;
// TODO: Cache the gPrefs value. Reading it every time is inefficient.
double dBRange = gPrefs->Read(wxT("/GUI/EnvdBRange"), ENV_DB_RANGE);
double sign = (value >= 0 ? 1 : -1);
wxASSERT( dBRange > 0 );
double db = 20 * log10(fabs(value));
double val = (db + dBRange) / dBRange;
val = Limit( 0.0, val, 1.0 );
return sign * val;
}
/// TODO: This should probably move to track artist.
static void DrawPoint(wxDC & dc, const wxRect & r, int x, int y, bool top)
{
@ -205,8 +187,7 @@ static void DrawPoint(wxDC & dc, const wxRect & r, int x, int y, bool top)
void Envelope::DrawPoints(wxDC & dc, const wxRect & r, const ZoomInfo &zoomInfo, bool dB,
float zoomMin, float zoomMax)
{
// TODO: Cache the gPrefs value. Reading it every time is inefficient.
double dBRange = gPrefs->Read(wxT("/GUI/EnvdBRange"), ENV_DB_RANGE);
double dBRange = zoomInfo.dBr;
dc.SetPen(AColor::envelopePen);
dc.SetBrush(*wxWHITE_BRUSH);
@ -330,13 +311,13 @@ inline int SQR(int x) { return x * x; }
/// @dB - display mode either linear or log.
/// @zoomMin - vertical scale, typically -1.0
/// @zoomMax - vertical scale, typically +1.0
float Envelope::ValueOfPixel( int y, int height, bool upper, bool dB,
float Envelope::ValueOfPixel( int y, int height, bool upper,
const ZoomInfo &zoomInfo, bool dB,
float zoomMin, float zoomMax)
{
double dBRange = 0;
if (dB)
// TODO: Cache the gPrefs value. Reading it every time is inefficient.
dBRange = gPrefs->Read(wxT("/GUI/EnvdBRange"), ENV_DB_RANGE);
dBRange = zoomInfo.dBr;
float v = ::ValueOfPixel(y, height, 0 != mContourOffset, dB, dBRange, zoomMin, zoomMax);
@ -368,8 +349,7 @@ bool Envelope::HandleMouseButtonDown(wxMouseEvent & event, wxRect & r,
int bestNum = -1;
int bestDistSqr = 100; // Must be within 10 pixel radius.
// TODO: Cache the gPrefs value. Reading it every time is inefficient.
double dBr = gPrefs->Read(wxT("/GUI/EnvdBRange"), ENV_DB_RANGE);
double dBr = zoomInfo.dBr;
// Member variables hold state that will be needed in dragging.
mButton = event.GetButton();
@ -457,7 +437,7 @@ bool Envelope::HandleMouseButtonDown(wxMouseEvent & event, wxRect & r,
mContourOffset = false;
}
double newVal = ValueOfPixel(clip_y, r.height, upper, dB,
double newVal = ValueOfPixel(clip_y, r.height, upper, zoomInfo, dB,
zoomMin, zoomMax);
mDragPoint = Insert(when - mOffset, newVal);
@ -508,7 +488,7 @@ void Envelope::MoveDraggedPoint( wxMouseEvent & event, wxRect & r,
int clip_y = event.m_y - r.y;
if(clip_y < 0) clip_y = 0;
if(clip_y > r.height) clip_y = r.height;
double newVal = ValueOfPixel(clip_y, r.height, mUpper, dB,
double newVal = ValueOfPixel(clip_y, r.height, mUpper, zoomInfo, dB,
zoomMin, zoomMax);
// We no longer tolerate multiple envelope points at the same t.

View File

@ -31,8 +31,6 @@ class Envelope;
class ZoomInfo;
#define ENV_DB_RANGE 60
class EnvPoint : public XMLTagHandler {
public:
@ -197,10 +195,10 @@ class Envelope : public XMLTagHandler {
int bufferLen) const;
private:
double toDB(double x);
EnvPoint * AddPointAtEnd( double t, double val );
void MarkDragPointForDeletion();
float ValueOfPixel( int y, int height, bool upper, bool dB,
float ValueOfPixel( int y, int height, bool upper,
const ZoomInfo &zoomInfo, bool dB,
float zoomMin, float zoomMax);
void BinarySearchForTime( int &Lo, int &Hi, double t ) const;
double GetInterpolationStartValueAtPoint( int iPoint ) const;

View File

@ -39,13 +39,13 @@
* 9: Gaussian(a=4.5)
*/
#include "FFT.h"
#include <wx/intl.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "FFT.h"
static int **gFFTBitTable = NULL;
static const int MaxFastBits = 16;

View File

@ -32,6 +32,8 @@
#ifndef __AUDACITY_FFT_H__
#define __AUDACITY_FFT_H__
#include <wx/defs.h>
/*
Salvo Ventura - November 2006
Added more window functions:

View File

@ -128,6 +128,8 @@ extern "C" {
#endif
#include "Audacity.h"
#include "Experimental.h"
/* rather earlier than normal, but pulls in config*.h and other program stuff
* we need for the next bit */
#include <wx/string.h>
@ -141,10 +143,8 @@ extern "C" {
#include "Prefs.h"
#include <wx/checkbox.h>
#include <wx/textctrl.h>
// needed for sampleCount
#include "Sequence.h"
#include "Experimental.h"
#include "audacity/Types.h"
// if you needed them, any other audacity header files would go here

View File

@ -43,6 +43,8 @@ and in the spectrogram spectral selection.
#include "Audacity.h"
#include "FreqWindow.h"
#include <algorithm>
#include <wx/brush.h>
#include <wx/button.h>
#include <wx/choice.h>
@ -67,6 +69,7 @@ and in the spectrogram spectral selection.
#include "FFT.h"
#include "Internat.h"
#include "PitchName.h"
#include "prefs/GUISettings.h"
#include "Prefs.h"
#include "Project.h"
#include "WaveClip.h"
@ -75,10 +78,7 @@ and in the spectrogram spectral selection.
#include "FileDialog.h"
//#if defined(__WXGTK__)
//#define GSocket GSocketHack
//#include <gtk/gtk.h>
//#endif
#include "WaveTrack.h"
DEFINE_EVENT_TYPE(EVT_FREQWINDOW_RECALC);
@ -253,7 +253,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
gPrefs->Read(wxT("/FreqWindow/FuncChoice"), &mFunc, 3);
gPrefs->Read(wxT("/FreqWindow/AxisChoice"), &mAxis, 0);
gPrefs->Read(wxT("/GUI/EnvdBRange"), &dBRange, ENV_DB_RANGE);
gPrefs->Read(ENV_DB_KEY, &dBRange, ENV_DB_RANGE);
if(dBRange < 90.)
dBRange = 90.;
@ -534,7 +534,7 @@ bool FreqWindow::Show(bool show)
if (show && !shown)
{
gPrefs->Read(wxT("/GUI/EnvdBRange"), &dBRange, ENV_DB_RANGE);
gPrefs->Read(ENV_DB_KEY, &dBRange, ENV_DB_RANGE);
if(dBRange < 90.)
dBRange = 90.;
GetAudio();
@ -1067,7 +1067,7 @@ void FreqWindow::OnExport(wxCommandEvent & WXUNUSED(event))
void FreqWindow::OnReplot(wxCommandEvent & WXUNUSED(event))
{
gPrefs->Read(wxT("/GUI/EnvdBRange"), &dBRange, ENV_DB_RANGE);
gPrefs->Read(ENV_DB_KEY, &dBRange, ENV_DB_RANGE);
if(dBRange < 90.)
dBRange = 90.;
GetAudio();

View File

@ -35,7 +35,6 @@
#include "LabelTrack.h"
#include "Prefs.h"
#include "Project.h"
#include "Track.h"
#include "ViewInfo.h"
#include "widgets/NumericTextCtrl.h"

View File

@ -13,7 +13,9 @@
#include "LyricsWindow.h"
#include "Lyrics.h"
#include "AudioIO.h"
#include "Project.h"
#include "TrackPanel.h" // for EVT_TRACK_PANEL_TIMER
#include <wx/radiobut.h>
#include <wx/toolbar.h>
@ -123,10 +125,21 @@ LyricsWindow::LyricsWindow(AudacityProject *parent):
// default:
// pRadioButton_Highlight->SetValue(true); break;
//}
// Events from the project don't propagate directly to this other frame, so...
mProject->Connect(EVT_TRACK_PANEL_TIMER,
wxCommandEventHandler(LyricsWindow::OnTimer),
NULL,
this);
}
LyricsWindow::~LyricsWindow()
{}
{
mProject->Disconnect(EVT_TRACK_PANEL_TIMER,
wxCommandEventHandler(LyricsWindow::OnTimer),
NULL,
this);
}
void LyricsWindow::OnCloseWindow(wxCloseEvent & WXUNUSED(event))
{
@ -143,3 +156,18 @@ void LyricsWindow::OnStyle_Highlight(wxCommandEvent & WXUNUSED(event))
mLyricsPanel->SetLyricsStyle(Lyrics::kHighlightLyrics);
}
void LyricsWindow::OnTimer(wxCommandEvent &event)
{
if (mProject->IsAudioActive())
{
GetLyricsPanel()->Update(gAudioIO->GetStreamTime());
}
else
{
// Reset lyrics display.
GetLyricsPanel()->Update(mProject->GetSel0());
}
// Let other listeners get the notification
event.Skip();
}

View File

@ -32,6 +32,7 @@ class LyricsWindow : public wxFrame {
void OnStyle_BouncingBall(wxCommandEvent &evt);
void OnStyle_Highlight(wxCommandEvent &evt);
void OnTimer(wxCommandEvent &event);
AudacityProject *mProject;
Lyrics *mLyricsPanel;

View File

@ -169,6 +169,7 @@ audacity_SOURCES = \
MixerBoard.h \
ModuleManager.cpp \
ModuleManager.h \
NumberScale.h \
PitchName.cpp \
PitchName.h \
PlatformCompatibility.cpp \
@ -239,6 +240,7 @@ audacity_SOURCES = \
WaveClip.h \
WaveTrack.cpp \
WaveTrack.h \
WaveTrackLocation.h \
WrappedType.cpp \
WrappedType.h \
commands/AppCommandEvent.cpp \
@ -452,6 +454,7 @@ audacity_SOURCES = \
prefs/ExtImportPrefs.h \
prefs/GUIPrefs.cpp \
prefs/GUIPrefs.h \
prefs/GUISettings.h \
prefs/ImportExportPrefs.cpp \
prefs/ImportExportPrefs.h \
prefs/KeyConfigPrefs.cpp \
@ -475,6 +478,8 @@ audacity_SOURCES = \
prefs/QualityPrefs.h \
prefs/RecordingPrefs.cpp \
prefs/RecordingPrefs.h \
prefs/SpectrogramSettings.cpp \
prefs/SpectrogramSettings.h \
prefs/SpectrumPrefs.cpp \
prefs/SpectrumPrefs.h \
prefs/ThemePrefs.cpp \
@ -483,6 +488,10 @@ audacity_SOURCES = \
prefs/TracksPrefs.h \
prefs/WarningsPrefs.cpp \
prefs/WarningsPrefs.h \
prefs/WaveformPrefs.cpp \
prefs/WaveformPrefs.h \
prefs/WaveformSettings.cpp \
prefs/WaveformSettings.h \
toolbars/ControlToolBar.cpp \
toolbars/ControlToolBar.h \
toolbars/DeviceToolBar.cpp \

View File

@ -301,17 +301,17 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.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 RealFFTf.h RealFFTf48x.cpp \
RealFFTf48x.h Resample.cpp Resample.h RevisionIdent.h \
RingBuffer.cpp RingBuffer.h Screenshot.cpp Screenshot.h \
SelectedRegion.cpp SelectedRegion.h Shuttle.cpp Shuttle.h \
ShuttleGui.cpp ShuttleGui.h ShuttlePrefs.cpp ShuttlePrefs.h \
Snap.cpp Snap.h SoundActivatedRecord.cpp \
SoundActivatedRecord.h Spectrum.cpp Spectrum.h \
SplashDialog.cpp SplashDialog.h SseMathFuncs.cpp \
NumberScale.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 \
RealFFTf.h RealFFTf48x.cpp RealFFTf48x.h Resample.cpp \
Resample.h RevisionIdent.h RingBuffer.cpp RingBuffer.h \
Screenshot.cpp Screenshot.h SelectedRegion.cpp \
SelectedRegion.h Shuttle.cpp Shuttle.h ShuttleGui.cpp \
ShuttleGui.h ShuttlePrefs.cpp ShuttlePrefs.h Snap.cpp Snap.h \
SoundActivatedRecord.cpp SoundActivatedRecord.h Spectrum.cpp \
Spectrum.h SplashDialog.cpp SplashDialog.h SseMathFuncs.cpp \
SseMathFuncs.h Tags.cpp Tags.h Theme.cpp Theme.h \
ThemeAsCeeCode.h TimeDialog.cpp TimeDialog.h \
TimerRecordDialog.cpp TimerRecordDialog.h TimeTrack.cpp \
@ -319,7 +319,7 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
TrackPanel.cpp TrackPanel.h TrackPanelAx.cpp TrackPanelAx.h \
UndoManager.cpp UndoManager.h ViewInfo.cpp ViewInfo.h \
VoiceKey.cpp VoiceKey.h WaveClip.cpp WaveClip.h WaveTrack.cpp \
WaveTrack.h WrappedType.cpp WrappedType.h \
WaveTrack.h WaveTrackLocation.h WrappedType.cpp WrappedType.h \
commands/AppCommandEvent.cpp commands/AppCommandEvent.h \
commands/BatchEvalCommand.cpp commands/BatchEvalCommand.h \
commands/Command.cpp commands/Command.h \
@ -416,7 +416,7 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
prefs/DirectoriesPrefs.cpp prefs/DirectoriesPrefs.h \
prefs/EffectsPrefs.cpp prefs/EffectsPrefs.h \
prefs/ExtImportPrefs.cpp prefs/ExtImportPrefs.h \
prefs/GUIPrefs.cpp prefs/GUIPrefs.h \
prefs/GUIPrefs.cpp prefs/GUIPrefs.h prefs/GUISettings.h \
prefs/ImportExportPrefs.cpp prefs/ImportExportPrefs.h \
prefs/KeyConfigPrefs.cpp prefs/KeyConfigPrefs.h \
prefs/LibraryPrefs.cpp prefs/LibraryPrefs.h \
@ -427,10 +427,13 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
prefs/PrefsDialog.h prefs/PrefsPanel.h prefs/ProjectsPrefs.cpp \
prefs/ProjectsPrefs.h prefs/QualityPrefs.cpp \
prefs/QualityPrefs.h prefs/RecordingPrefs.cpp \
prefs/RecordingPrefs.h prefs/SpectrumPrefs.cpp \
prefs/RecordingPrefs.h prefs/SpectrogramSettings.cpp \
prefs/SpectrogramSettings.h prefs/SpectrumPrefs.cpp \
prefs/SpectrumPrefs.h prefs/ThemePrefs.cpp prefs/ThemePrefs.h \
prefs/TracksPrefs.cpp prefs/TracksPrefs.h \
prefs/WarningsPrefs.cpp prefs/WarningsPrefs.h \
prefs/WaveformPrefs.cpp prefs/WaveformPrefs.h \
prefs/WaveformSettings.cpp prefs/WaveformSettings.h \
toolbars/ControlToolBar.cpp toolbars/ControlToolBar.h \
toolbars/DeviceToolBar.cpp toolbars/DeviceToolBar.h \
toolbars/EditToolBar.cpp toolbars/EditToolBar.h \
@ -675,10 +678,13 @@ am_audacity_OBJECTS = $(am__objects_1) audacity-AboutDialog.$(OBJEXT) \
prefs/audacity-ProjectsPrefs.$(OBJEXT) \
prefs/audacity-QualityPrefs.$(OBJEXT) \
prefs/audacity-RecordingPrefs.$(OBJEXT) \
prefs/audacity-SpectrogramSettings.$(OBJEXT) \
prefs/audacity-SpectrumPrefs.$(OBJEXT) \
prefs/audacity-ThemePrefs.$(OBJEXT) \
prefs/audacity-TracksPrefs.$(OBJEXT) \
prefs/audacity-WarningsPrefs.$(OBJEXT) \
prefs/audacity-WaveformPrefs.$(OBJEXT) \
prefs/audacity-WaveformSettings.$(OBJEXT) \
toolbars/audacity-ControlToolBar.$(OBJEXT) \
toolbars/audacity-DeviceToolBar.$(OBJEXT) \
toolbars/audacity-EditToolBar.$(OBJEXT) \
@ -1164,17 +1170,17 @@ audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.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 RealFFTf.h RealFFTf48x.cpp \
RealFFTf48x.h Resample.cpp Resample.h RevisionIdent.h \
RingBuffer.cpp RingBuffer.h Screenshot.cpp Screenshot.h \
SelectedRegion.cpp SelectedRegion.h Shuttle.cpp Shuttle.h \
ShuttleGui.cpp ShuttleGui.h ShuttlePrefs.cpp ShuttlePrefs.h \
Snap.cpp Snap.h SoundActivatedRecord.cpp \
SoundActivatedRecord.h Spectrum.cpp Spectrum.h \
SplashDialog.cpp SplashDialog.h SseMathFuncs.cpp \
NumberScale.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 \
RealFFTf.h RealFFTf48x.cpp RealFFTf48x.h Resample.cpp \
Resample.h RevisionIdent.h RingBuffer.cpp RingBuffer.h \
Screenshot.cpp Screenshot.h SelectedRegion.cpp \
SelectedRegion.h Shuttle.cpp Shuttle.h ShuttleGui.cpp \
ShuttleGui.h ShuttlePrefs.cpp ShuttlePrefs.h Snap.cpp Snap.h \
SoundActivatedRecord.cpp SoundActivatedRecord.h Spectrum.cpp \
Spectrum.h SplashDialog.cpp SplashDialog.h SseMathFuncs.cpp \
SseMathFuncs.h Tags.cpp Tags.h Theme.cpp Theme.h \
ThemeAsCeeCode.h TimeDialog.cpp TimeDialog.h \
TimerRecordDialog.cpp TimerRecordDialog.h TimeTrack.cpp \
@ -1182,7 +1188,7 @@ audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.cpp \
TrackPanel.cpp TrackPanel.h TrackPanelAx.cpp TrackPanelAx.h \
UndoManager.cpp UndoManager.h ViewInfo.cpp ViewInfo.h \
VoiceKey.cpp VoiceKey.h WaveClip.cpp WaveClip.h WaveTrack.cpp \
WaveTrack.h WrappedType.cpp WrappedType.h \
WaveTrack.h WaveTrackLocation.h WrappedType.cpp WrappedType.h \
commands/AppCommandEvent.cpp commands/AppCommandEvent.h \
commands/BatchEvalCommand.cpp commands/BatchEvalCommand.h \
commands/Command.cpp commands/Command.h \
@ -1279,7 +1285,7 @@ audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.cpp \
prefs/DirectoriesPrefs.cpp prefs/DirectoriesPrefs.h \
prefs/EffectsPrefs.cpp prefs/EffectsPrefs.h \
prefs/ExtImportPrefs.cpp prefs/ExtImportPrefs.h \
prefs/GUIPrefs.cpp prefs/GUIPrefs.h \
prefs/GUIPrefs.cpp prefs/GUIPrefs.h prefs/GUISettings.h \
prefs/ImportExportPrefs.cpp prefs/ImportExportPrefs.h \
prefs/KeyConfigPrefs.cpp prefs/KeyConfigPrefs.h \
prefs/LibraryPrefs.cpp prefs/LibraryPrefs.h \
@ -1290,10 +1296,13 @@ audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.cpp \
prefs/PrefsDialog.h prefs/PrefsPanel.h prefs/ProjectsPrefs.cpp \
prefs/ProjectsPrefs.h prefs/QualityPrefs.cpp \
prefs/QualityPrefs.h prefs/RecordingPrefs.cpp \
prefs/RecordingPrefs.h prefs/SpectrumPrefs.cpp \
prefs/RecordingPrefs.h prefs/SpectrogramSettings.cpp \
prefs/SpectrogramSettings.h prefs/SpectrumPrefs.cpp \
prefs/SpectrumPrefs.h prefs/ThemePrefs.cpp prefs/ThemePrefs.h \
prefs/TracksPrefs.cpp prefs/TracksPrefs.h \
prefs/WarningsPrefs.cpp prefs/WarningsPrefs.h \
prefs/WaveformPrefs.cpp prefs/WaveformPrefs.h \
prefs/WaveformSettings.cpp prefs/WaveformSettings.h \
toolbars/ControlToolBar.cpp toolbars/ControlToolBar.h \
toolbars/DeviceToolBar.cpp toolbars/DeviceToolBar.h \
toolbars/EditToolBar.cpp toolbars/EditToolBar.h \
@ -1377,8 +1386,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
configwin.h: stamp-h1
@test -f $@ || rm -f stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
@if test ! -f $@; then rm -f stamp-h1; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
stamp-h1: $(srcdir)/configtemplate.h $(top_builddir)/config.status
@rm -f stamp-h1
@ -1389,8 +1398,8 @@ $(srcdir)/configtemplate.h: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
touch $@
configunix.h: stamp-h2
@test -f $@ || rm -f stamp-h2
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2
@if test ! -f $@; then rm -f stamp-h2; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h2; else :; fi
stamp-h2: $(srcdir)/configtemplate.h $(top_builddir)/config.status
@rm -f stamp-h2
@ -1771,6 +1780,8 @@ prefs/audacity-QualityPrefs.$(OBJEXT): prefs/$(am__dirstamp) \
prefs/$(DEPDIR)/$(am__dirstamp)
prefs/audacity-RecordingPrefs.$(OBJEXT): prefs/$(am__dirstamp) \
prefs/$(DEPDIR)/$(am__dirstamp)
prefs/audacity-SpectrogramSettings.$(OBJEXT): prefs/$(am__dirstamp) \
prefs/$(DEPDIR)/$(am__dirstamp)
prefs/audacity-SpectrumPrefs.$(OBJEXT): prefs/$(am__dirstamp) \
prefs/$(DEPDIR)/$(am__dirstamp)
prefs/audacity-ThemePrefs.$(OBJEXT): prefs/$(am__dirstamp) \
@ -1779,6 +1790,10 @@ prefs/audacity-TracksPrefs.$(OBJEXT): prefs/$(am__dirstamp) \
prefs/$(DEPDIR)/$(am__dirstamp)
prefs/audacity-WarningsPrefs.$(OBJEXT): prefs/$(am__dirstamp) \
prefs/$(DEPDIR)/$(am__dirstamp)
prefs/audacity-WaveformPrefs.$(OBJEXT): prefs/$(am__dirstamp) \
prefs/$(DEPDIR)/$(am__dirstamp)
prefs/audacity-WaveformSettings.$(OBJEXT): prefs/$(am__dirstamp) \
prefs/$(DEPDIR)/$(am__dirstamp)
toolbars/$(am__dirstamp):
@$(MKDIR_P) toolbars
@: > toolbars/$(am__dirstamp)
@ -2200,10 +2215,13 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@prefs/$(DEPDIR)/audacity-ProjectsPrefs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@prefs/$(DEPDIR)/audacity-QualityPrefs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@prefs/$(DEPDIR)/audacity-RecordingPrefs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@prefs/$(DEPDIR)/audacity-SpectrogramSettings.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@prefs/$(DEPDIR)/audacity-SpectrumPrefs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@prefs/$(DEPDIR)/audacity-ThemePrefs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@prefs/$(DEPDIR)/audacity-TracksPrefs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@prefs/$(DEPDIR)/audacity-WarningsPrefs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@prefs/$(DEPDIR)/audacity-WaveformPrefs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@prefs/$(DEPDIR)/audacity-WaveformSettings.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@toolbars/$(DEPDIR)/audacity-ControlToolBar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@toolbars/$(DEPDIR)/audacity-DeviceToolBar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@toolbars/$(DEPDIR)/audacity-EditToolBar.Po@am__quote@
@ -5192,6 +5210,20 @@ prefs/audacity-RecordingPrefs.obj: prefs/RecordingPrefs.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 prefs/audacity-RecordingPrefs.obj `if test -f 'prefs/RecordingPrefs.cpp'; then $(CYGPATH_W) 'prefs/RecordingPrefs.cpp'; else $(CYGPATH_W) '$(srcdir)/prefs/RecordingPrefs.cpp'; fi`
prefs/audacity-SpectrogramSettings.o: prefs/SpectrogramSettings.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT prefs/audacity-SpectrogramSettings.o -MD -MP -MF prefs/$(DEPDIR)/audacity-SpectrogramSettings.Tpo -c -o prefs/audacity-SpectrogramSettings.o `test -f 'prefs/SpectrogramSettings.cpp' || echo '$(srcdir)/'`prefs/SpectrogramSettings.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) prefs/$(DEPDIR)/audacity-SpectrogramSettings.Tpo prefs/$(DEPDIR)/audacity-SpectrogramSettings.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='prefs/SpectrogramSettings.cpp' object='prefs/audacity-SpectrogramSettings.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 prefs/audacity-SpectrogramSettings.o `test -f 'prefs/SpectrogramSettings.cpp' || echo '$(srcdir)/'`prefs/SpectrogramSettings.cpp
prefs/audacity-SpectrogramSettings.obj: prefs/SpectrogramSettings.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT prefs/audacity-SpectrogramSettings.obj -MD -MP -MF prefs/$(DEPDIR)/audacity-SpectrogramSettings.Tpo -c -o prefs/audacity-SpectrogramSettings.obj `if test -f 'prefs/SpectrogramSettings.cpp'; then $(CYGPATH_W) 'prefs/SpectrogramSettings.cpp'; else $(CYGPATH_W) '$(srcdir)/prefs/SpectrogramSettings.cpp'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) prefs/$(DEPDIR)/audacity-SpectrogramSettings.Tpo prefs/$(DEPDIR)/audacity-SpectrogramSettings.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='prefs/SpectrogramSettings.cpp' object='prefs/audacity-SpectrogramSettings.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 prefs/audacity-SpectrogramSettings.obj `if test -f 'prefs/SpectrogramSettings.cpp'; then $(CYGPATH_W) 'prefs/SpectrogramSettings.cpp'; else $(CYGPATH_W) '$(srcdir)/prefs/SpectrogramSettings.cpp'; fi`
prefs/audacity-SpectrumPrefs.o: prefs/SpectrumPrefs.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT prefs/audacity-SpectrumPrefs.o -MD -MP -MF prefs/$(DEPDIR)/audacity-SpectrumPrefs.Tpo -c -o prefs/audacity-SpectrumPrefs.o `test -f 'prefs/SpectrumPrefs.cpp' || echo '$(srcdir)/'`prefs/SpectrumPrefs.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) prefs/$(DEPDIR)/audacity-SpectrumPrefs.Tpo prefs/$(DEPDIR)/audacity-SpectrumPrefs.Po
@ -5248,6 +5280,34 @@ prefs/audacity-WarningsPrefs.obj: prefs/WarningsPrefs.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 prefs/audacity-WarningsPrefs.obj `if test -f 'prefs/WarningsPrefs.cpp'; then $(CYGPATH_W) 'prefs/WarningsPrefs.cpp'; else $(CYGPATH_W) '$(srcdir)/prefs/WarningsPrefs.cpp'; fi`
prefs/audacity-WaveformPrefs.o: prefs/WaveformPrefs.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT prefs/audacity-WaveformPrefs.o -MD -MP -MF prefs/$(DEPDIR)/audacity-WaveformPrefs.Tpo -c -o prefs/audacity-WaveformPrefs.o `test -f 'prefs/WaveformPrefs.cpp' || echo '$(srcdir)/'`prefs/WaveformPrefs.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) prefs/$(DEPDIR)/audacity-WaveformPrefs.Tpo prefs/$(DEPDIR)/audacity-WaveformPrefs.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='prefs/WaveformPrefs.cpp' object='prefs/audacity-WaveformPrefs.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 prefs/audacity-WaveformPrefs.o `test -f 'prefs/WaveformPrefs.cpp' || echo '$(srcdir)/'`prefs/WaveformPrefs.cpp
prefs/audacity-WaveformPrefs.obj: prefs/WaveformPrefs.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT prefs/audacity-WaveformPrefs.obj -MD -MP -MF prefs/$(DEPDIR)/audacity-WaveformPrefs.Tpo -c -o prefs/audacity-WaveformPrefs.obj `if test -f 'prefs/WaveformPrefs.cpp'; then $(CYGPATH_W) 'prefs/WaveformPrefs.cpp'; else $(CYGPATH_W) '$(srcdir)/prefs/WaveformPrefs.cpp'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) prefs/$(DEPDIR)/audacity-WaveformPrefs.Tpo prefs/$(DEPDIR)/audacity-WaveformPrefs.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='prefs/WaveformPrefs.cpp' object='prefs/audacity-WaveformPrefs.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 prefs/audacity-WaveformPrefs.obj `if test -f 'prefs/WaveformPrefs.cpp'; then $(CYGPATH_W) 'prefs/WaveformPrefs.cpp'; else $(CYGPATH_W) '$(srcdir)/prefs/WaveformPrefs.cpp'; fi`
prefs/audacity-WaveformSettings.o: prefs/WaveformSettings.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT prefs/audacity-WaveformSettings.o -MD -MP -MF prefs/$(DEPDIR)/audacity-WaveformSettings.Tpo -c -o prefs/audacity-WaveformSettings.o `test -f 'prefs/WaveformSettings.cpp' || echo '$(srcdir)/'`prefs/WaveformSettings.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) prefs/$(DEPDIR)/audacity-WaveformSettings.Tpo prefs/$(DEPDIR)/audacity-WaveformSettings.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='prefs/WaveformSettings.cpp' object='prefs/audacity-WaveformSettings.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 prefs/audacity-WaveformSettings.o `test -f 'prefs/WaveformSettings.cpp' || echo '$(srcdir)/'`prefs/WaveformSettings.cpp
prefs/audacity-WaveformSettings.obj: prefs/WaveformSettings.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT prefs/audacity-WaveformSettings.obj -MD -MP -MF prefs/$(DEPDIR)/audacity-WaveformSettings.Tpo -c -o prefs/audacity-WaveformSettings.obj `if test -f 'prefs/WaveformSettings.cpp'; then $(CYGPATH_W) 'prefs/WaveformSettings.cpp'; else $(CYGPATH_W) '$(srcdir)/prefs/WaveformSettings.cpp'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) prefs/$(DEPDIR)/audacity-WaveformSettings.Tpo prefs/$(DEPDIR)/audacity-WaveformSettings.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='prefs/WaveformSettings.cpp' object='prefs/audacity-WaveformSettings.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 prefs/audacity-WaveformSettings.obj `if test -f 'prefs/WaveformSettings.cpp'; then $(CYGPATH_W) 'prefs/WaveformSettings.cpp'; else $(CYGPATH_W) '$(srcdir)/prefs/WaveformSettings.cpp'; fi`
toolbars/audacity-ControlToolBar.o: toolbars/ControlToolBar.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT toolbars/audacity-ControlToolBar.o -MD -MP -MF toolbars/$(DEPDIR)/audacity-ControlToolBar.Tpo -c -o toolbars/audacity-ControlToolBar.o `test -f 'toolbars/ControlToolBar.cpp' || echo '$(srcdir)/'`toolbars/ControlToolBar.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) toolbars/$(DEPDIR)/audacity-ControlToolBar.Tpo toolbars/$(DEPDIR)/audacity-ControlToolBar.Po

View File

@ -31,6 +31,7 @@ simplifies construction of menu items.
*//*******************************************************************/
#include "Audacity.h"
#include "Project.h"
#include <iterator>
#include <limits>
@ -53,7 +54,6 @@ simplifies construction of menu items.
#include "effects/Contrast.h"
#include "TrackPanel.h"
#include "Project.h"
#include "effects/EffectManager.h"
#include "AudacityApp.h"
@ -119,6 +119,8 @@ simplifies construction of menu items.
#include "Snap.h"
#include "WaveTrack.h"
#if defined(EXPERIMENTAL_CRASH_REPORT)
#include <wx/debugrpt.h>
#endif
@ -3551,7 +3553,7 @@ void AudacityProject::OnExportMultiple()
void AudacityProject::OnPreferences()
{
PrefsDialog dialog(this /* parent */ );
GlobalPrefsDialog dialog(this /* parent */ );
if (!dialog.ShowModal()) {
// Canceled
@ -4730,12 +4732,7 @@ void AudacityProject::DoNextPeakFrequency(bool up)
for (Track *t = iter.First(); t; t = iter.Next()) {
WaveTrack *const wt = static_cast<WaveTrack*>(t);
const int display = wt->GetDisplay();
if (display == WaveTrack::SpectrumDisplay ||
display == WaveTrack::SpectrumLogDisplay ||
display == WaveTrack::SpectralSelectionDisplay ||
display == WaveTrack::SpectralSelectionLogDisplay
) {
if (display == WaveTrack::Spectrum) {
pTrack = wt;
break;
}

View File

@ -35,11 +35,11 @@
#include "WaveTrack.h"
#include "DirManager.h"
#include "Envelope.h"
#include "Internat.h"
#include "Prefs.h"
#include "Project.h"
#include "Resample.h"
#include "TimeTrack.h"
#include "float_cast.h"
//TODO-MB: wouldn't it make more sense to delete the time track after 'mix and render'?

View File

@ -15,11 +15,13 @@
#include <wx/string.h>
#include "SampleFormat.h"
#include "WaveTrack.h"
#include "TimeTrack.h"
#include "Resample.h"
class DirManager;
class TimeTrack;
class TrackFactory;
class TrackList;
class WaveTrack;
/** @brief Mixes together all input tracks, applying any envelopes, amplitude
* gain, panning, and real-time effects in the process.

View File

@ -10,8 +10,8 @@
**********************************************************************/
#include "Audacity.h"
#include "Experimental.h"
#include "MixerBoard.h"
#include <math.h>
@ -22,12 +22,14 @@
#include "AColor.h"
#include "AudioIO.h"
#include "MixerBoard.h"
#ifdef EXPERIMENTAL_MIDI_OUT
#include "NoteTrack.h"
#endif
#include "Project.h"
#include "Track.h"
#include "TrackPanel.h" // for EVT_TRACK_PANEL_TIMER
#include "WaveTrack.h"
#include "widgets/Meter.h"
#include "../images/MusicalInstruments.h"
@ -1015,6 +1017,12 @@ MixerBoard::MixerBoard(AudacityProject* pProject,
mPrevT1 = 0.0;
mTracks = mProject->GetTracks();
// Events from the project don't propagate directly to this other frame, so...
mProject->Connect(EVT_TRACK_PANEL_TIMER,
wxCommandEventHandler(MixerBoard::OnTimer),
NULL,
this);
}
MixerBoard::~MixerBoard()
@ -1032,6 +1040,11 @@ MixerBoard::~MixerBoard()
// private data members
mMusicalInstruments.Clear();
mProject->Disconnect(EVT_TRACK_PANEL_TIMER,
wxCommandEventHandler(MixerBoard::OnTimer),
NULL,
this);
}
// Reassign mixer input strips (MixerTrackClusters) to Track Clusters
@ -1691,6 +1704,30 @@ void MixerBoard::OnSize(wxSizeEvent &evt)
this->RefreshTrackClusters(true);
}
void MixerBoard::OnTimer(wxCommandEvent &event)
{
// PRL 12 Jul 2015: Moved the below (with comments) out of TrackPanel::OnTimer.
// Vaughan, 2011-01-28: No longer doing this on timer.
// Now it's in AudioIO::SetMeters() and AudioIO::StopStream(), as with Meter Toolbar meters.
//if (pMixerBoard)
// pMixerBoard->ResetMeters(false);
//v Vaughan, 2011-02-25: Moved this update back here from audacityAudioCallback.
// See note there.
// Vaughan, 2010-01-30:
// Since all we're doing here is updating the meters, I moved it to
// audacityAudioCallback where it calls gAudioIO->mOutputMeter->UpdateDisplay().
if (mProject->IsAudioActive())
{
UpdateMeters(gAudioIO->GetStreamTime(),
(mProject->mLastPlayMode == loopedPlay));
}
// Let other listeners get the notification
event.Skip();
}
// class MixerBoardFrame
@ -1759,5 +1796,3 @@ void MixerBoardFrame::OnSize(wxSizeEvent & WXUNUSED(event))
{
mMixerBoard->SetSize(this->GetClientSize());
}

View File

@ -24,7 +24,6 @@
#include "widgets/AButton.h"
#include "widgets/ASlider.h"
#include "widgets/Meter.h"
// containment hierarchy:
// MixerBoardFrame -> MixerBoard -> MixerBoardScrolledWindow -> MixerTrackCluster(s)
@ -45,7 +44,7 @@ public:
bool canUseShift = true,
float stepValue = STEP_CONTINUOUS,
int orientation = wxHORIZONTAL);
virtual ~MixerTrackSlider() {};
virtual ~MixerTrackSlider() {}
void OnMouseEvent(wxMouseEvent & event);
@ -61,6 +60,7 @@ public:
class AudacityProject;
class Meter;
class MixerBoard;
#ifdef EXPERIMENTAL_MIDI_OUT
class Track;
@ -76,7 +76,7 @@ public:
WaveTrack* pLeftTrack, WaveTrack* pRightTrack = NULL,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize);
virtual ~MixerTrackCluster() {};
virtual ~MixerTrackCluster() {}
void HandleResize(); // For wxSizeEvents, update gain slider and meter.
@ -265,6 +265,7 @@ private:
// event handlers
void OnSize(wxSizeEvent &evt);
void OnTimer(wxCommandEvent &event);
public:

279
src/NumberScale.h Normal file
View File

@ -0,0 +1,279 @@
/**********************************************************************
Audacity: A Digital Audio Editor
NumberScale.h
Paul Licameli
**********************************************************************/
#ifndef __AUDACITY_NUMBER_SCALE__
#define __AUDACITY_NUMBER_SCALE__
#include <algorithm>
#include <cmath>
#include <wx/defs.h>
#include <wx/debug.h>
enum NumberScaleType {
nstLinear,
nstLogarithmic,
nstMel,
nstBark,
nstErb,
nstUndertone,
nstNumScaleTypes,
};
class NumberScale
{
public:
NumberScale(NumberScaleType type,
float value0, float value1, float unit)
: mType(type)
{
switch (mType) {
case nstLinear:
{
mValue0 = value0 / unit;
mValue1 = value1 / unit;
mUnit = 1.0;
}
break;
case nstLogarithmic:
{
mValue0 = logf(value0 / unit);
mValue1 = logf(value1 / unit);
mUnit = 1.0;
}
break;
case nstMel:
{
mValue0 = hzToMel(value0);
mValue1 = hzToMel(value1);
mUnit = unit;
}
break;
case nstBark:
{
mValue0 = hzToBark(value0);
mValue1 = hzToBark(value1);
mUnit = unit;
}
break;
case nstErb:
{
mValue0 = hzToErb(value0);
mValue1 = hzToErb(value1);
mUnit = unit;
}
break;
case nstUndertone:
{
mValue0 = hzToUndertone(value0);
mValue1 = hzToUndertone(value1);
mUnit = unit;
}
break;
default:
wxASSERT(false);
}
}
NumberScale Reversal() const
{
NumberScale result(*this);
std::swap(result.mValue0, result.mValue1);
return result;
}
bool operator == (const NumberScale& other) const
{
return mType == other.mType
&& mValue0 == other.mValue0
&& mValue1 == other.mValue1
&& mUnit == other.mUnit;
}
bool operator != (const NumberScale &other) const
{
return !(*this == other);
}
static inline float hzToMel(float hz)
{
return 1127 * log(1 + hz / 700);
}
static inline float melToHz(float mel)
{
return 700 * (exp(mel / 1127) - 1);
}
static inline float hzToBark(float hz)
{
// Traunmueller's formula
const float z1 = 26.81 * hz / (1960 + hz) - 0.53;
if (z1 < 2.0)
return z1 + 0.15 * (2.0 - z1);
else if (z1 > 20.1)
return z1 + 0.22 * (z1 - 20.1);
else
return z1;
}
static inline float barkToHz(float z1)
{
if (z1 < 2.0)
z1 = 2.0 + (z1 - 2.0) / 0.85;
else if (z1 > 20.1)
z1 = 20.1 + (z1 - 20.1) / 1.22;
return 1960 * (z1 + 0.53) / (26.28 - z1);
}
static inline float hzToErb(float hz)
{
return 11.17268 * log(1 + (46.06538 * hz) / (hz + 14678.49));
}
static inline float erbToHz(float erb)
{
return 676170.4 / (47.06538 - exp(0.08950404 * erb)) - 14678.49;
}
static inline float hzToUndertone(float hz)
{
return -1.0 / std::max (1.0f, hz);
}
static inline float undertoneToHz(float u)
{
return -1.0 / u;
}
// Random access
float PositionToValue(float pp) const
{
switch (mType) {
default:
wxASSERT(false);
case nstLinear:
return mValue0 + pp * (mValue1 - mValue0);
case nstLogarithmic:
return exp(mValue0 + pp * (mValue1 - mValue0));
case nstMel:
return melToHz(mValue0 + pp * (mValue1 - mValue0)) / mUnit;
case nstBark:
return barkToHz(mValue0 + pp * (mValue1 - mValue0)) / mUnit;
case nstErb:
return erbToHz(mValue0 + pp * (mValue1 - mValue0)) / mUnit;
case nstUndertone:
return undertoneToHz(mValue0 + pp * (mValue1 - mValue0)) / mUnit;
}
}
// STL-idiom iteration
class Iterator
{
public:
Iterator(NumberScaleType type, float step, float value, float unit)
: mType(type), mStep(step), mValue(value), mUnit(unit)
{
}
float operator * () const
{
switch (mType) {
default:
wxASSERT(false);
case nstLinear:
case nstLogarithmic:
return mValue;
case nstMel:
return melToHz(mValue) / mUnit;
case nstBark:
return barkToHz(mValue) / mUnit;
case nstErb:
return erbToHz(mValue) / mUnit;
case nstUndertone:
return undertoneToHz(mValue) / mUnit;
}
}
Iterator &operator ++()
{
switch (mType) {
case nstLinear:
case nstMel:
case nstBark:
case nstErb:
case nstUndertone:
mValue += mStep;
break;
case nstLogarithmic:
mValue *= mStep;
break;
default:
wxASSERT(false);
}
return *this;
}
private:
const NumberScaleType mType;
const float mStep;
float mValue;
float mUnit;
};
Iterator begin(float nPositions) const
{
switch (mType) {
default:
wxASSERT(false);
case nstLinear:
case nstMel:
case nstBark:
case nstErb:
case nstUndertone:
return Iterator
(mType, (mValue1 - mValue0) / nPositions, mValue0, mUnit);
case nstLogarithmic:
return Iterator
(mType, exp((mValue1 - mValue0) / nPositions), exp(mValue0), mUnit);
}
}
// Inverse
float ValueToPosition(float val) const
{
switch (mType) {
default:
wxASSERT(false);
case nstLinear:
return ((val - mValue0) / (mValue1 - mValue0));
case nstLogarithmic:
return ((log(val) - mValue0) / (mValue1 - mValue0));
case nstMel:
return ((hzToMel(val * mUnit) - mValue0) / (mValue1 - mValue0));
case nstBark:
return ((hzToBark(val * mUnit) - mValue0) / (mValue1 - mValue0));
case nstErb:
return ((hzToErb(val * mUnit) - mValue0) / (mValue1 - mValue0));
case nstUndertone:
return ((hzToUndertone(val * mUnit) - mValue0) / (mValue1 - mValue0));
}
}
private:
const NumberScaleType mType;
float mValue0;
float mValue1;
float mUnit;
};
#endif

View File

@ -25,7 +25,6 @@
#include <wx/printdlg.h>
#include "AColor.h"
#include "Track.h"
#include "TrackArtist.h"
#include "ViewInfo.h"
#include "WaveTrack.h"

View File

@ -110,10 +110,10 @@ scroll information. It also has some status flags.
#include "Mix.h"
#include "NoteTrack.h"
#include "Prefs.h"
#include "Sequence.h"
#include "Snap.h"
#include "Tags.h"
#include "TimeTrack.h"
#include "Track.h"
#include "TrackPanel.h"
#include "WaveTrack.h"
#include "DirManager.h"
@ -121,7 +121,6 @@ scroll information. It also has some status flags.
#include "prefs/PrefsDialog.h"
#include "widgets/LinkingHtmlWindow.h"
#include "widgets/ErrorDialog.h"
#include "widgets/Meter.h"
#include "widgets/Ruler.h"
#include "widgets/Warning.h"
#include "xml/XMLFileReader.h"
@ -1162,7 +1161,7 @@ AdornedRulerPanel *AudacityProject::GetRulerPanel()
return mRuler;
}
int AudacityProject::GetAudioIOToken()
int AudacityProject::GetAudioIOToken() const
{
return mAudioIOToken;
}
@ -1172,6 +1171,12 @@ void AudacityProject::SetAudioIOToken(int token)
mAudioIOToken = token;
}
bool AudacityProject::IsAudioActive() const
{
return GetAudioIOToken() > 0 &&
gAudioIO->IsStreamActive(GetAudioIOToken());
}
Tags *AudacityProject::GetTags()
{
return mTags;
@ -1208,6 +1213,11 @@ void AudacityProject::SetProjectTitle()
SetName(name); // to make the nvda screen reader read the correct title
}
bool AudacityProject::GetIsEmpty()
{
return mTracks->IsEmpty();
}
double AudacityProject::AS_GetRate()
{
return mRate;
@ -1250,7 +1260,18 @@ void AudacityProject::AS_SetSelectionFormat(const wxString & format)
double AudacityProject::SSBL_GetRate() const
{
return mRate;
// Return maximum of project rate and all track rates.
double rate = mRate;
TrackListOfKindIterator iterWaveTrack(Track::Wave, mTracks);
WaveTrack *pWaveTrack = static_cast<WaveTrack*>(iterWaveTrack.First());
while (pWaveTrack)
{
rate = std::max(rate, pWaveTrack->GetRate());
pWaveTrack = static_cast<WaveTrack*>(iterWaveTrack.Next());
}
return rate;
}
const wxString & AudacityProject::SSBL_GetFrequencySelectionFormatName()
@ -1282,7 +1303,7 @@ void AudacityProject::SSBL_SetBandwidthSelectionFormatName(const wxString & form
void AudacityProject::SSBL_ModifySpectralSelection(double &bottom, double &top, bool done)
{
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
double nyq = mRate / 2.0;
double nyq = SSBL_GetRate() / 2.0;
if (bottom >= 0.0)
bottom = std::min(nyq, bottom);
if (top >= 0.0)
@ -2949,6 +2970,8 @@ bool AudacityProject::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
SetBandwidthSelectionFormatName(value);
} // while
mViewInfo.UpdatePrefs();
if (longVpos != 0) {
// PRL: It seems this must happen after SetSnapTo
mViewInfo.track = NULL;
@ -3861,6 +3884,11 @@ void AudacityProject::PushState(wxString desc,
AutoSave();
}
void AudacityProject::RollbackState()
{
SetStateTo(GetUndoManager()->GetCurrentState());
}
void AudacityProject::ModifyState(bool bWantsAutoSave)
{
mUndoManager.ModifyState(mTracks, mViewInfo.selectedRegion);
@ -4353,7 +4381,7 @@ void AudacityProject::GetRegionsByLabel( Regions &regions )
//If the function replaces the selection with audio of a different length,
// bSyncLockedTracks should be set true to perform the same action on sync-lock selected
// tracks.
void AudacityProject::EditByLabel( WaveTrack::EditFunction action,
void AudacityProject::EditByLabel( EditFunction action,
bool bSyncLockedTracks )
{
Regions regions;
@ -4402,7 +4430,7 @@ void AudacityProject::EditByLabel( WaveTrack::EditFunction action,
//Functions copy the edited regions to clipboard, possibly in multiple tracks
//This probably should not be called if *action() changes the timeline, because
// the copy needs to happen by track, and the timeline change by group.
void AudacityProject::EditClipboardByLabel( WaveTrack::EditDestFunction action )
void AudacityProject::EditClipboardByLabel( EditDestFunction action )
{
Regions regions;

View File

@ -86,6 +86,9 @@ class MixerBoardFrame;
struct AudioIOStartStreamOptions;
class WaveTrackArray;
class Regions;
AudacityProject *CreateNewAudacityProject();
AUDACITY_DLL_API AudacityProject *GetActiveProject();
void RedrawAllProjects();
@ -179,7 +182,8 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
TrackFactory *GetTrackFactory();
AdornedRulerPanel *GetRulerPanel();
Tags *GetTags();
int GetAudioIOToken();
int GetAudioIOToken() const;
bool IsAudioActive() const;
void SetAudioIOToken(int token);
bool IsActive();
@ -241,7 +245,7 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
TrackPanel * GetTrackPanel(){return mTrackPanel;}
bool GetIsEmpty() { return mTracks->IsEmpty(); }
bool GetIsEmpty();
bool GetTracksFitVerticallyZoomed() { return mTracksFitVerticallyZoomed; } //lda
void SetTracksFitVerticallyZoomed(bool flag) { mTracksFitVerticallyZoomed = flag; } //lda
@ -321,8 +325,14 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
void ZoomBy(double multiplier);
void Rewind(bool shift);
void SkipEnd(bool shift);
void EditByLabel( WaveTrack::EditFunction action, bool bSyncLockedTracks );
void EditClipboardByLabel( WaveTrack::EditDestFunction action );
typedef bool (WaveTrack::* EditFunction)(double, double);
typedef bool (WaveTrack::* EditDestFunction)(double, double, Track**);
void EditByLabel(EditFunction action, bool bSyncLockedTracks);
void EditClipboardByLabel(EditDestFunction action );
bool IsSyncLocked();
void SetSyncLock(bool flag);
@ -468,6 +478,7 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
void PushState(wxString desc, wxString shortDesc,
int flags = PUSH_AUTOSAVE);
void RollbackState();
private:

View File

@ -34,6 +34,8 @@
#include "Prefs.h"
#include "toolbars/ToolManager.h"
#include "Track.h"
class CommandType;
////////////////////////////////////////////////////////////////////////////////

View File

@ -16,6 +16,7 @@
#include "LabelTrack.h"
#include "Project.h"
#include "TrackPanel.h"
#include "WaveTrack.h"
#include "widgets/NumericTextCtrl.h"
// Change this to "true" to snap to nearest and "false" to snap to previous
@ -81,7 +82,7 @@ SnapManager::SnapManager(TrackList *tracks, TrackClipArray *exclusions,
WaveClip *clip = it->GetData();
if (exclusions) {
bool skip = false;
for(int j=0; j<(int)exclusions->GetCount(); j++) {
for(int j=0; j<(int)exclusions->size(); j++) {
if ((*exclusions)[j].track == waveTrack &&
(*exclusions)[j].clip == clip)
skip = true;

View File

@ -15,15 +15,27 @@
#ifndef __AUDACITY_SNAP__
#define __AUDACITY_SNAP__
#include <wx/defs.h>
#include <wx/dynarray.h>
#include <vector>
#include <wx/defs.h>
#include "Track.h"
#include "widgets/NumericTextCtrl.h"
class TrackClipArray;
class Track;
class WaveClip;
class TrackList;
class ZoomInfo;
class TrackClip
{
public:
TrackClip(Track *t, WaveClip *c) { track = t; clip = c; }
Track *track;
WaveClip *clip;
};
typedef std::vector<TrackClip> TrackClipArray;
enum
{
SNAP_OFF,

View File

@ -19,14 +19,12 @@
*//********************************************************************/
#include "Audacity.h"
#include "SoundActivatedRecord.h"
#include <wx/dialog.h>
#include "Envelope.h"
#include "ShuttleGui.h"
#include "ShuttlePrefs.h"
#include "Prefs.h"
#include "SoundActivatedRecord.h"
#include "prefs/GUISettings.h"
BEGIN_EVENT_TABLE(SoundActivatedRecord, wxDialog)
EVT_BUTTON(wxID_OK, SoundActivatedRecord::OnOK)
@ -57,7 +55,7 @@ void SoundActivatedRecord::PopulateOrExchange(ShuttleGui & S)
{
S.StartMultiColumn(2, wxEXPAND);
S.SetStretchyCol(1);
dBRange = gPrefs->Read(wxT("/GUI/EnvdBRange"), ENV_DB_RANGE);
dBRange = gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE);
S.TieSlider(_("Activation level (dB):"), wxT("/AudioIO/SilenceLevel"), -50, 0, -dBRange);
S.EndMultiColumn();
}

View File

@ -13,6 +13,13 @@
********************************************************************/
#ifndef __AUDACITY_SOUND_ACTIVATED_RECORD__
#define __AUDACITY_SOUND_ACTIVATED_RECORD__
#include <wx/dialog.h>
class ShuttleGui;
class SoundActivatedRecord : public wxDialog
{
public:
@ -27,3 +34,4 @@ private:
DECLARE_EVENT_TABLE();
};
#endif

View File

@ -11,7 +11,6 @@
#ifndef __AUDACITY_SPECTRUM__
#define __AUDACITY_SPECTRUM__
#include "WaveTrack.h"
#include "FFT.h"
/*

View File

@ -60,6 +60,7 @@ and use it for toolbar and window layouts too.
#include <wx/file.h>
#include <wx/ffile.h>
#include <wx/mstream.h>
#include <wx/msgdlg.h>
#include "Project.h"
#include "toolbars/ToolBar.h"

View File

@ -19,6 +19,7 @@
#include <wx/intl.h>
#include "AColor.h"
#include "widgets/Ruler.h"
#include "Envelope.h"
#include "Prefs.h"
#include "Internat.h"
#include "Resample.h"

View File

@ -29,6 +29,7 @@
#include <wx/string.h>
#include <wx/timer.h>
#include <wx/dynlib.h> //<! For windows.h
#include <wx/msgdlg.h>
#include "ShuttleGui.h"
#include "Project.h"

View File

@ -23,9 +23,7 @@ and TimeTrack.
#include "Track.h"
#include "WaveTrack.h"
#include "NoteTrack.h"
#include "LabelTrack.h"
#include "Project.h"
#include "TimeTrack.h"
#include "DirManager.h"
#ifdef _MSC_VER

File diff suppressed because it is too large Load Diff

View File

@ -71,19 +71,6 @@ class AUDACITY_DLL_API TrackArtist {
void UpdatePrefs();
void InvalidateSpectrumCache(TrackList *tracks);
void InvalidateSpectrumCache(WaveTrack *track);
int GetSpectrumMinFreq(int deffreq);
int GetSpectrumMaxFreq(int deffreq);
int GetSpectrumLogMinFreq(int deffreq);
int GetSpectrumLogMaxFreq(int deffreq);
int GetSpectrumWindowSize(bool includeZeroPadding);
void SetSpectrumMinFreq(int freq);
void SetSpectrumMaxFreq(int freq);
void SetSpectrumLogMinFreq(int freq);
void SetSpectrumLogMaxFreq(int freq);
void SetBackgroundBrushes(wxBrush unselectedBrush, wxBrush selectedBrush,
wxPen unselectedPen, wxPen selectedPen) {
this->unselectedBrush = unselectedBrush;
@ -110,7 +97,7 @@ class AUDACITY_DLL_API TrackArtist {
wxDC & dc, const wxRect & rect,
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo,
bool drawEnvelope, bool bigPoints, bool drawSliders,
bool dB, bool muted);
bool muted);
void DrawSpectrum(WaveTrack *track,
wxDC & dc, const wxRect & rect,
@ -154,7 +141,7 @@ class AUDACITY_DLL_API TrackArtist {
void DrawWaveformBackground(wxDC & dc, int leftOffset, const wxRect &rect,
const double env[],
float zoomMin, float zoomMax, bool dB,
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo,
double t0, double t1, const ZoomInfo &zoomInfo,
bool drawEnvelope, bool bIsSyncLockSelected);
void DrawMinMaxRMS(wxDC &dc, const wxRect & rect, const double env[],
float zoomMin, float zoomMax, bool dB,

File diff suppressed because it is too large Load Diff

View File

@ -15,18 +15,19 @@
#include <vector>
#include <wx/dcmemory.h>
#include <wx/dynarray.h>
#include <wx/panel.h>
#include <wx/timer.h>
#include <wx/window.h>
#include "Experimental.h"
#include "Sequence.h" //Stm: included for the sampleCount declaration
#include "WaveClip.h"
#include "WaveTrack.h"
#include "audacity/Types.h"
#include "UndoManager.h" //JKC: Included for PUSH_XXX definitions.
#include "widgets/NumericTextCtrl.h"
#include "WaveTrackLocation.h"
#include "Snap.h"
class wxMenu;
class wxRect;
@ -47,24 +48,16 @@ class TrackPanelAx;
class ViewInfo;
WX_DEFINE_ARRAY(LWSlider *, LWSliderArray);
class AUDACITY_DLL_API TrackClip
{
public:
TrackClip(Track *t, WaveClip *c) { track = t; clip = c; }
Track *track;
WaveClip *clip;
};
WX_DECLARE_OBJARRAY(TrackClip, TrackClipArray);
class WaveTrack;
class WaveClip;
class Envelope;
// Declared elsewhere, to reduce compilation dependencies
class TrackPanelListener;
// JKC Nov 2011: Disabled warning C4251 which is to do with DLL linkage
// and only a worry when there are DLLs using the structures.
// LWSliderArray and TrackClipArray are private in TrackInfo, so we will not
// Array classes are private in TrackInfo, so we will not
// access them directly from the DLL.
// TrackClipArray in TrackPanel needs to be handled with care in the derived
// class, but the C4251 warning is no worry in core Audacity.
@ -75,6 +68,8 @@ class TrackPanelListener;
#pragma warning( disable: 4251 )
#endif
DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, EVT_TRACK_PANEL_TIMER, -1);
class AUDACITY_DLL_API TrackInfo
{
public:
@ -210,6 +205,7 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
virtual void OnTrackGainDec();
virtual void OnTrackGainInc();
virtual void OnTrackMenu(Track *t = NULL);
virtual void OnVRulerMenu(Track *t, wxMouseEvent *pEvent = NULL);
virtual void OnTrackMute(bool shiftdown, Track *t = NULL);
virtual void OnTrackSolo(bool shiftdown, Track *t = NULL);
virtual void OnTrackClose();
@ -244,9 +240,12 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
* @param menu the menu to add the commands to.
*/
virtual void BuildCommonDropMenuItems(wxMenu * menu);
static void BuildVRulerMenuItems(wxMenu * menu, int firstId, const wxArrayString &names);
virtual bool IsAudioActive();
virtual bool IsUnsafe();
virtual bool HandleLabelTrackMouseEvent(LabelTrack * lTrack, wxRect &r, wxMouseEvent & event);
virtual bool HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &r, wxMouseEvent &event);
virtual bool HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &rect, wxMouseEvent &event);
virtual bool IsOverCutline(WaveTrack * track, wxRect &rect, wxMouseEvent &event);
virtual void HandleTrackSpecificMouseEvent(wxMouseEvent & event);
virtual void DrawIndicator();
/// draws the green line on the tracks to show playback position
@ -337,9 +336,9 @@ protected:
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
public:
void SnapCenterOnce (WaveTrack *pTrack, bool up);
void SnapCenterOnce (const WaveTrack *pTrack, bool up);
protected:
void StartSnappingFreqSelection (WaveTrack *pTrack);
void StartSnappingFreqSelection (const WaveTrack *pTrack);
void MoveSnappingFreqSelection (int mouseYCoordinate,
int trackTopEdge,
int trackHeight, Track *pTrack);
@ -359,14 +358,15 @@ protected:
// AS: Cursor handling
virtual bool SetCursorByActivity( );
virtual void SetCursorAndTipWhenInLabel( Track * t, wxMouseEvent &event, const wxChar ** ppTip );
virtual void SetCursorAndTipWhenInVResizeArea( Track * label, bool blinked, const wxChar ** ppTip );
virtual void SetCursorAndTipWhenInLabelTrack( LabelTrack * pLT, wxMouseEvent & event, const wxChar ** ppTip );
virtual bool SetCursorForCutline(WaveTrack * track, wxRect &rect, wxMouseEvent &event);
virtual void SetCursorAndTipWhenInLabel( Track * t, wxMouseEvent &event, wxString &tip );
virtual void SetCursorAndTipWhenInVResizeArea( bool blinked, wxString &tip );
virtual void SetCursorAndTipWhenInLabelTrack( LabelTrack * pLT, wxMouseEvent & event, wxString &tip );
virtual void SetCursorAndTipWhenSelectTool
( Track * t, wxMouseEvent & event, wxRect &r, bool bMultiToolMode, const wxChar ** ppTip, const wxCursor ** ppCursor );
virtual void SetCursorAndTipByTool( int tool, wxMouseEvent & event, const wxChar **ppTip );
( Track * t, wxMouseEvent & event, wxRect &r, bool bMultiToolMode, wxString &tip, const wxCursor ** ppCursor );
virtual void SetCursorAndTipByTool( int tool, wxMouseEvent & event, wxString &tip );
virtual void HandleCursor(wxMouseEvent & event);
virtual void MaySetOnDemandTip( Track * t, const wxChar ** ppTip );
virtual void MaySetOnDemandTip( Track * t, wxString &tip );
// AS: Envelope editing handlers
virtual void HandleEnvelope(wxMouseEvent & event);
@ -395,6 +395,7 @@ protected:
virtual void HandleVZoomClick(wxMouseEvent & event);
virtual void HandleVZoomDrag(wxMouseEvent & event);
virtual void HandleVZoomButtonUp(wxMouseEvent & event);
virtual void HandleWaveTrackVZoom(WaveTrack *track, bool shiftDown, bool rightUp);
// Handle sample editing using the 'draw' tool.
virtual bool IsSampleEditingPossible( wxMouseEvent & event, Track * t );
@ -459,12 +460,20 @@ protected:
virtual void MoveTrack(Track* target, int eventId);
virtual void OnChangeOctave (wxCommandEvent &event);
virtual void OnChannelChange(wxCommandEvent &event);
virtual void OnViewSettings(wxCommandEvent &event);
virtual void OnSetDisplay (wxCommandEvent &event);
virtual void OnSetTimeTrackRange (wxCommandEvent &event);
virtual void OnTimeTrackLin(wxCommandEvent &event);
virtual void OnTimeTrackLog(wxCommandEvent &event);
virtual void OnTimeTrackLogInt(wxCommandEvent &event);
virtual void OnWaveformScaleType(wxCommandEvent &event);
virtual void OnSpectrumScaleType(wxCommandEvent &event);
virtual void OnZoomInVertical(wxCommandEvent &event);
virtual void OnZoomOutVertical(wxCommandEvent &event);
virtual void OnZoomFitVertical(wxCommandEvent &event);
virtual void SetMenuCheck( wxMenu & menu, int newId );
virtual void SetRate(Track *pTrack, double rate);
virtual void OnRateChange(wxCommandEvent &event);
@ -494,9 +503,9 @@ protected:
virtual wxRect FindTrackRect(Track * target, bool label);
virtual int GetVRulerWidth() const;
virtual int GetVRulerOffset() const { return mTrackInfo.GetTrackInfoWidth(); };
virtual int GetVRulerOffset() const { return mTrackInfo.GetTrackInfoWidth(); }
virtual int GetLabelWidth() const { return mTrackInfo.GetTrackInfoWidth() + GetVRulerWidth(); };
virtual int GetLabelWidth() const { return mTrackInfo.GetTrackInfoWidth() + GetVRulerWidth(); }
// JKC Nov-2011: These four functions only used from within a dll such as mod-track-panel
// They work around some messy problems with constructors.
@ -572,8 +581,8 @@ protected:
// This stores the parts of the screen that get overwritten by the indicator
// and cursor
double mLastIndicator;
double mLastCursor;
int mLastIndicatorX;
int mLastCursorX;
// Quick-Play indicator postion
double mOldQPIndicatorPos;
@ -632,7 +641,7 @@ protected:
WaveClip *mCapturedClip;
TrackClipArray mCapturedClipArray;
bool mCapturedClipIsSelection;
WaveTrack::Location mCapturedTrackLocation;
WaveTrackLocation mCapturedTrackLocation;
wxRect mCapturedTrackLocationRect;
wxRect mCapturedRect;
@ -688,22 +697,20 @@ protected:
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
void HandleCenterFrequencyCursor
(bool shiftDown, const wxChar ** ppTip, const wxCursor ** ppCursor);
(bool shiftDown, wxString &tip, const wxCursor ** ppCursor);
void HandleCenterFrequencyClick
(bool shiftDown, Track *pTrack, double value);
double PositionToFrequency(bool maySnap,
double PositionToFrequency(const WaveTrack *wt,
bool maySnap,
wxInt64 mouseYCoordinate,
wxInt64 trackTopEdge,
int trackHeight,
double rate,
bool logF) const;
wxInt64 FrequencyToPosition(double frequency,
int trackHeight) const;
wxInt64 FrequencyToPosition(const WaveTrack *wt,
double frequency,
wxInt64 trackTopEdge,
int trackHeight,
double rate,
bool logF) const;
int trackHeight) const;
#endif
enum SelectionBoundary {
@ -749,7 +756,6 @@ protected:
IsGainSliding,
IsPanSliding,
IsMinimizing,
IsOverCutLine,
WasOverCutLine,
IsPopping,
#ifdef USE_MIDI
@ -766,7 +772,6 @@ protected:
bool mAdjustSelectionEdges;
bool mSlideUpDownOnly;
bool mCircularTrackNavigation;
float mdBr;
// JH: if the user is dragging a track, at what y
// coordinate should the dragging track move up or down?
@ -826,6 +831,9 @@ protected:
wxMenu *mFormatMenu;
wxMenu *mLabelTrackInfoMenu;
wxMenu *mRulerWaveformMenu;
wxMenu *mRulerSpectrumMenu;
Track *mPopupMenuTarget;
friend class TrackPanelAx;

View File

@ -14,6 +14,9 @@
*//*******************************************************************/
#include "Audacity.h"
#include "TrackPanelAx.h"
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
@ -23,11 +26,10 @@
#endif
#include "Audacity.h"
#include "TrackPanelAx.h"
#include <wx/intl.h>
#include "Track.h"
TrackPanelAx::TrackPanelAx( wxWindow *window )
#if wxUSE_ACCESSIBILITY
:wxWindowAccessible( window )

View File

@ -28,7 +28,6 @@ UndoManager
#include "Diags.h"
#include "Internat.h"
#include "Sequence.h"
#include "Track.h"
#include "WaveTrack.h" // temp
#include "NoteTrack.h" // for Sonify* function declarations
#include "Diags.h"

View File

@ -13,6 +13,8 @@ Paul Licameli
#include <algorithm>
#include "Internat.h"
#include "prefs/GUISettings.h"
#include "Prefs.h"
#include "xml/XMLWriter.h"
namespace {
@ -26,12 +28,18 @@ ZoomInfo::ZoomInfo(double start, double screenDuration, double pixelsPerSecond)
, screen(screenDuration)
, zoom(pixelsPerSecond)
{
UpdatePrefs();
}
ZoomInfo::~ZoomInfo()
{
}
void ZoomInfo::UpdatePrefs()
{
dBr = gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE);
}
/// Converts a position (mouse X coordinate) to
/// project time, in seconds. Needs the left edge of
/// the track as an additional parameter.

View File

@ -17,6 +17,11 @@
class Track;
#ifdef __GNUC__
#define CONST
#else
#define CONST const
#endif
// The subset of ViewInfo information (other than selection)
// that is sufficient for purposes of TrackArtist,
@ -27,6 +32,8 @@ public:
ZoomInfo(double start, double duration, double pixelsPerSecond);
~ZoomInfo();
void UpdatePrefs();
int vpos; // vertical scroll pos
double h; // h pos in secs
@ -37,6 +44,7 @@ protected:
double zoom; // pixels per second
public:
float dBr; // decibel scale range
// do NOT use this once to convert a pixel width to a duration!
// Instead, call twice to convert start and end times,
@ -85,7 +93,7 @@ public:
void ZoomBy(double multiplier);
struct Interval {
/* const */ wxInt64 position; /* const */ double averageZoom; /* const */ bool inFisheye;
CONST wxInt64 position; CONST double averageZoom; CONST bool inFisheye;
Interval(wxInt64 p, double z, bool i)
: position(p), averageZoom(z), inFisheye(i) {}
};

View File

@ -32,6 +32,8 @@ or "OFF" point
#include <wx/intl.h>
#include <iostream>
#include "WaveTrack.h"
using std::cout;
using std::endl;

View File

@ -11,13 +11,15 @@
#ifndef __AUDACITY_VOICEKEY__
#define __AUDACITY_VOICEKEY__
#include "WaveTrack.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846 /* pi */
#endif
#include "audacity/Types.h"
class WaveTrack;
enum VoiceKeyTypes
{
VKT_NONE = 0,
@ -91,10 +93,10 @@ class VoiceKey {
};
inline int sgn(int number){ return (number<0) ? -1: 1;};
inline int sgn(int number){ return (number<0) ? -1: 1;}
//This returns a logistic density based on a z-score
// a logistic distn has variance (pi*s)^2/3
//inline float inline float logistic(float z){ return fexp(-1 * z/(pi / sqrt(3)) / (1 + pow(fexp(-1 * z(pi / sqrt(3))),2)));};
//inline float inline float logistic(float z){ return fexp(-1 * z/(pi / sqrt(3)) / (1 + pow(fexp(-1 * z(pi / sqrt(3))),2)));}
#endif

View File

@ -27,13 +27,15 @@
#include <vector>
#include <wx/log.h>
#include "Sequence.h"
#include "Spectrum.h"
#include "Prefs.h"
#include "Envelope.h"
#include "Resample.h"
#include "Project.h"
#include "WaveTrack.h"
#include "prefs/SpectrumPrefs.h"
#include "prefs/SpectrogramSettings.h"
#include <wx/listimpl.cpp>
WX_DEFINE_LIST(WaveClipList);
@ -367,6 +369,11 @@ bool WaveClip::SetSamples(samplePtr buffer, sampleFormat format,
return bResult;
}
BlockArray* WaveClip::GetSequenceBlockArray()
{
return mSequence->GetBlockArray();
}
double WaveClip::GetStartTime() const
{
// JS: mOffset is the minimum value and it is returned; no clipping to 0
@ -394,6 +401,11 @@ sampleCount WaveClip::GetEndSample() const
return GetStartSample() + mSequence->GetNumSamples();
}
sampleCount WaveClip::GetNumSamples() const
{
return mSequence->GetNumSamples();
}
bool WaveClip::WithinClip(double t) const
{
sampleCount ts = (sampleCount)floor(t * mRate + 0.5);
@ -846,7 +858,8 @@ void SpecCache::CalculateOneSpectrum
rate, results,
autocorrelation, settings.windowType);
#endif // EXPERIMENTAL_USE_REALFFTF
if (!gainFactors.empty()) {
if (!autocorrelation &&
!gainFactors.empty()) {
// Apply a frequency-dependant gain factor
for (int ii = 0; ii < half; ++ii)
results[ii] += gainFactors[ii];
@ -902,8 +915,8 @@ bool WaveClip::GetSpectrogram(WaveTrackCache &waveTrackCache,
double t0, double pixelsPerSecond,
bool autocorrelation)
{
const SpectrogramSettings &settings = SpectrogramSettings::defaults();
const WaveTrack *const track = waveTrackCache.GetTrack();
const SpectrogramSettings &settings = track->GetSpectrogramSettings();
const int &frequencyGain = settings.frequencyGain;
const int &windowSize = settings.windowSize;
const int &windowType = settings.windowType;

View File

@ -14,7 +14,6 @@
#include "Audacity.h"
#include "SampleFormat.h"
#include "Sequence.h"
#include "widgets/ProgressDialog.h"
#include "ondemand/ODTaskThread.h"
#include "xml/XMLTagHandler.h"
@ -31,7 +30,10 @@
#include <vector>
class BlockArray;
class DirManager;
class Envelope;
class Sequence;
class SpectrogramSettings;
class WaveCache;
class WaveTrackCache;
@ -127,6 +129,7 @@ public:
len = cacheLen;
values = new float[len];
valid = false;
scaleType = 0;
range = gain = -1;
minFreq = maxFreq = -1;
}
@ -140,6 +143,7 @@ public:
float *values;
bool valid;
int scaleType;
int range;
int gain;
int minFreq;
@ -247,7 +251,7 @@ public:
double GetEndTime() const;
sampleCount GetStartSample() const;
sampleCount GetEndSample() const;
sampleCount GetNumSamples() const { return mSequence->GetNumSamples(); }
sampleCount GetNumSamples() const;
// One and only one of the following is true for a given t (unless the clip
// has zero length -- then BeforeClip() and AfterClip() can both be true).
@ -262,7 +266,7 @@ public:
sampleCount start, sampleCount len);
Envelope* GetEnvelope() { return mEnvelope; }
BlockArray* GetSequenceBlockArray() { return mSequence->GetBlockArray(); }
BlockArray* GetSequenceBlockArray();
// Get low-level access to the sequence. Whenever possible, don't use this,
// but use more high-level functions inside WaveClip (or add them if you

View File

@ -39,8 +39,6 @@ Track classes.
#include "float_cast.h"
#include "LabelTrack.h"
#include "Envelope.h"
#include "Sequence.h"
#include "Spectrum.h"
@ -54,6 +52,8 @@ Track classes.
#include "ondemand/ODManager.h"
#include "effects/TimeWarper.h"
#include "prefs/SpectrumPrefs.h"
#include "prefs/WaveformPrefs.h"
using std::max;
@ -72,8 +72,10 @@ WaveTrack *TrackFactory::NewWaveTrack(sampleFormat format, double rate)
return new WaveTrack(mDirManager, format, rate);
}
WaveTrack::WaveTrack(DirManager *projDirManager, sampleFormat format, double rate):
WaveTrack::WaveTrack(DirManager *projDirManager, sampleFormat format, double rate) :
Track(projDirManager)
, mpSpectrumSettings(0)
, mpWaveformSettings(0)
{
if (format == (sampleFormat)0)
{
@ -99,15 +101,20 @@ WaveTrack::WaveTrack(DirManager *projDirManager, sampleFormat format, double rat
mDisplayNumLocations = 0;
mDisplayLocations = NULL;
mDisplayNumLocationsAllocated = 0;
mLastDisplay = -1;
mLastScaleType = -1;
mAutoSaveIdent = 0;
}
WaveTrack::WaveTrack(WaveTrack &orig):
Track(orig)
, mpSpectrumSettings(orig.mpSpectrumSettings
? new SpectrogramSettings(*orig.mpSpectrumSettings) : 0
)
, mpWaveformSettings(orig.mpWaveformSettings
? new WaveformSettings(*orig.mpWaveformSettings) : 0)
{
mDisplay = FindDefaultViewMode();
mLastDisplay = -1;
mLastScaleType = -1;
mLegacyProjectFileOffset = 0;
@ -139,9 +146,14 @@ void WaveTrack::Merge(const Track &orig)
{
if (orig.GetKind() == Wave)
{
mDisplay = ((WaveTrack &)orig).mDisplay;
mGain = ((WaveTrack &)orig).mGain;
mPan = ((WaveTrack &)orig).mPan;
const WaveTrack &wt = static_cast<const WaveTrack&>(orig);
mDisplay = wt.mDisplay;
mGain = wt.mGain;
mPan = wt.mPan;
SetSpectrogramSettings(wt.mpSpectrumSettings
? new SpectrogramSettings(*wt.mpSpectrumSettings) : 0);
SetWaveformSettings
(wt.mpWaveformSettings ? new WaveformSettings(*wt.mpWaveformSettings) : 0);
}
Track::Merge(orig);
}
@ -159,6 +171,8 @@ WaveTrack::~WaveTrack()
if (mDisplayLocations)
delete [] mDisplayLocations;
delete mpSpectrumSettings;
delete mpWaveformSettings;
}
double WaveTrack::GetOffset() const
@ -195,7 +209,7 @@ WaveTrack::WaveTrackDisplay WaveTrack::FindDefaultViewMode()
if (viewMode < 0) {
int oldMode;
gPrefs->Read(wxT("/GUI/DefaultViewMode"), &oldMode,
int(WaveTrack::WaveformDisplay));
int(WaveTrack::Waveform));
viewMode = WaveTrack::ConvertLegacyDisplayValue(oldMode);
}
@ -222,15 +236,22 @@ WaveTrack::ConvertLegacyDisplayValue(int oldValue)
switch (oldValue) {
default:
case Waveform:
newValue = WaveTrack::WaveformDisplay; break;
case WaveformDB:
newValue = WaveTrack::Waveform; break;
/*
case WaveformDB:
newValue = WaveTrack::WaveformDBDisplay; break;
*/
case Spectrogram:
newValue = WaveTrack::SpectrumDisplay; break;
case SpectrogramLogF:
case Pitch:
newValue = WaveTrack::Spectrum; break;
/*
case SpectrogramLogF:
newValue = WaveTrack::SpectrumLogDisplay; break;
case Pitch:
newValue = WaveTrack::PitchDisplay; break;
*/
}
return newValue;
}
@ -239,11 +260,26 @@ WaveTrack::ConvertLegacyDisplayValue(int oldValue)
WaveTrack::WaveTrackDisplay
WaveTrack::ValidateWaveTrackDisplay(WaveTrackDisplay display)
{
// To do, in future: detect obsolete values between min and max
if (display >= int(MinDisplay) && display <= int(MaxDisplay))
switch (display) {
// non-obsolete codes
case Waveform:
case Spectrum:
return display;
else
// obsolete codes
case obsolete1: // was SpectrumLogDisplay
case obsolete2: // was SpectralSelectionDisplay
case obsolete3: // was SpectralSelectionLogDisplay
case obsolete4: // was PitchDisplay
return Spectrum;
case obsolete5: // was WaveformDBDisplay
return Waveform;
// codes out of bounds (from future prefs files?)
default:
return MinDisplay;
}
}
void WaveTrack::GetDisplayBounds(float *min, float *max)
@ -624,6 +660,69 @@ bool WaveTrack::ClearAndAddCutLine(double t0, double t1)
return HandleClear(t0, t1, true, false);
}
const SpectrogramSettings &WaveTrack::GetSpectrogramSettings() const
{
if (mpSpectrumSettings)
return *mpSpectrumSettings;
else
return SpectrogramSettings::defaults();
}
SpectrogramSettings &WaveTrack::GetSpectrogramSettings()
{
if (mpSpectrumSettings)
return *mpSpectrumSettings;
else
return SpectrogramSettings::defaults();
}
SpectrogramSettings &WaveTrack::GetIndependentSpectrogramSettings()
{
if (!mpSpectrumSettings)
mpSpectrumSettings =
new SpectrogramSettings(SpectrogramSettings::defaults());
return *mpSpectrumSettings;
}
void WaveTrack::SetSpectrogramSettings(SpectrogramSettings *pSettings)
{
if (mpSpectrumSettings != pSettings) {
delete mpSpectrumSettings;
mpSpectrumSettings = pSettings;
}
}
const WaveformSettings &WaveTrack::GetWaveformSettings() const
{
if (mpWaveformSettings)
return *mpWaveformSettings;
else
return WaveformSettings::defaults();
}
WaveformSettings &WaveTrack::GetWaveformSettings()
{
if (mpWaveformSettings)
return *mpWaveformSettings;
else
return WaveformSettings::defaults();
}
WaveformSettings &WaveTrack::GetIndependentWaveformSettings()
{
if (!mpWaveformSettings)
mpWaveformSettings = new WaveformSettings(WaveformSettings::defaults());
return *mpWaveformSettings;
}
void WaveTrack::SetWaveformSettings(WaveformSettings *pSettings)
{
if (mpWaveformSettings != pSettings) {
delete mpWaveformSettings;
mpWaveformSettings = pSettings;
}
}
//
// ClearAndPaste() is a specialized version of HandleClear()
// followed by Paste() and is used mostly by effects that
@ -2306,7 +2405,7 @@ void WaveTrack::UpdateLocationsCache()
it = it->GetNext())
{
// Add cut line expander point
mDisplayLocations[curpos].typ = locationCutLine;
mDisplayLocations[curpos].typ = WaveTrackLocation::locationCutLine;
mDisplayLocations[curpos].pos =
clip->GetOffset() + it->GetData()->GetOffset();
curpos++;
@ -2320,7 +2419,7 @@ void WaveTrack::UpdateLocationsCache()
< WAVETRACK_MERGE_POINT_TOLERANCE)
{
// Add merge point
mDisplayLocations[curpos].typ = locationMergePoint;
mDisplayLocations[curpos].typ = WaveTrackLocation::locationMergePoint;
mDisplayLocations[curpos].pos = clips.Item(i-1)->GetEndTime();
mDisplayLocations[curpos].clipidx1 = mClips.IndexOf(previousClip);
mDisplayLocations[curpos].clipidx2 = mClips.IndexOf(clip);

View File

@ -13,7 +13,6 @@
#include "Track.h"
#include "SampleFormat.h"
#include "Sequence.h"
#include "WaveClip.h"
#include "Experimental.h"
#include "widgets/ProgressDialog.h"
@ -22,6 +21,10 @@
#include <wx/longlong.h>
#include <wx/thread.h>
#include "WaveTrackLocation.h"
class SpectrogramSettings;
class WaveformSettings;
class TimeWarper;
//
@ -51,7 +54,7 @@ WX_DEFINE_ARRAY( Region*, Regions );
class Envelope;
class AUDACITY_DLL_API WaveTrack: public Track {
class AUDACITY_DLL_API WaveTrack : public Track {
private:
@ -77,22 +80,8 @@ class AUDACITY_DLL_API WaveTrack: public Track {
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
static bool mMonoAsVirtualStereo;
#endif
enum LocationType {
locationCutLine = 1,
locationMergePoint
};
struct Location {
// Position of track location
double pos;
// Type of track location
LocationType typ;
// Only for typ==locationMergePoint
int clipidx1; // first clip (left one)
int clipidx2; // second clip (right one)
};
typedef WaveTrackLocation Location;
virtual ~WaveTrack();
virtual double GetOffset() const;
@ -145,6 +134,16 @@ class AUDACITY_DLL_API WaveTrack: public Track {
sampleFormat GetSampleFormat() { return mFormat; }
bool ConvertToSampleFormat(sampleFormat format);
const SpectrogramSettings &GetSpectrogramSettings() const;
SpectrogramSettings &GetSpectrogramSettings();
SpectrogramSettings &GetIndependentSpectrogramSettings();
void SetSpectrogramSettings(SpectrogramSettings *pSettings);
const WaveformSettings &GetWaveformSettings() const;
WaveformSettings &GetWaveformSettings();
WaveformSettings &GetIndependentWaveformSettings();
void SetWaveformSettings(WaveformSettings *pSettings);
//
// High-level editing
//
@ -172,9 +171,6 @@ class AUDACITY_DLL_API WaveTrack: public Track {
virtual bool Join (double t0, double t1);
virtual bool Disjoin (double t0, double t1);
typedef bool ( WaveTrack::* EditFunction )( double, double );
typedef bool ( WaveTrack::* EditDestFunction )( double, double, Track** );
virtual bool Trim (double t0, double t1);
bool HandleClear(double t0, double t1, bool addCutLines, bool split);
@ -408,19 +404,21 @@ class AUDACITY_DLL_API WaveTrack: public Track {
// DO NOT REORDER OLD VALUES! Replace obsoletes with placeholders.
WaveformDisplay = 0,
MinDisplay = WaveformDisplay,
Waveform = 0,
MinDisplay = Waveform,
WaveformDBDisplay,
SpectrumDisplay,
SpectrumLogDisplay,
SpectralSelectionDisplay,
SpectralSelectionLogDisplay,
PitchDisplay,
obsolete5, // was WaveformDBDisplay
Spectrum,
obsolete1, // was SpectrumLogDisplay
obsolete2, // was SpectralSelectionDisplay
obsolete3, // was SpectralSelectionLogDisplay
obsolete4, // was PitchDisplay
// Add values here, and update MaxDisplay.
MaxDisplay = PitchDisplay,
MaxDisplay = Spectrum,
NoDisplay, // Preview track has no display
};
@ -434,18 +432,15 @@ class AUDACITY_DLL_API WaveTrack: public Track {
// Handle restriction of range of values of the enum from future versions
static WaveTrackDisplay ValidateWaveTrackDisplay(WaveTrackDisplay display);
void SetDisplay(WaveTrackDisplay display) {
if(mDisplay < 2)
// remember last display mode for wave and wavedb so they can remap the vertical ruler
mLastDisplay = mDisplay;
mDisplay = display;
if( mDisplay == SpectralSelectionDisplay ){
}
if( mDisplay == SpectralSelectionLogDisplay ){
}
int GetLastScaleType() { return mLastScaleType; }
void SetLastScaleType(int scaleType)
{
// remember last display mode for wave and wavedb so vertical ruler can remap
mLastScaleType = scaleType;
}
WaveTrackDisplay GetDisplay() const { return mDisplay; }
int GetLastDisplay() {return mLastDisplay;}
void SetDisplay(WaveTrackDisplay display) { mDisplay = display; }
void GetDisplayBounds(float *min, float *max);
void SetDisplayBounds(float min, float max);
@ -471,7 +466,7 @@ class AUDACITY_DLL_API WaveTrack: public Track {
float mDisplayMin;
float mDisplayMax;
WaveTrackDisplay mDisplay;
int mLastDisplay; // last display mode
int mLastScaleType; // last scale type choice
int mDisplayNumLocations;
int mDisplayNumLocationsAllocated;
Location* mDisplayLocations;
@ -490,6 +485,9 @@ class AUDACITY_DLL_API WaveTrack: public Track {
wxCriticalSection mAppendCriticalSection;
double mLegacyProjectFileOffset;
int mAutoSaveIdent;
SpectrogramSettings *mpSpectrumSettings;
WaveformSettings *mpWaveformSettings;
};
// This is meant to be a short-lived object, during whose lifetime,

32
src/WaveTrackLocation.h Normal file
View File

@ -0,0 +1,32 @@
/**********************************************************************
Audacity: A Digital Audio Editor
WaveTrackLocation.h
Paul Licameli -- split from WaveTrack.h
**********************************************************************/
#ifndef __AUDACITY_WAVE_TRACK_LOCATION__
#define __AUDACITY_WAVE_TRACK_LOCATION__
struct WaveTrackLocation {
enum LocationType {
locationCutLine = 1,
locationMergePoint
};
// Position of track location
double pos;
// Type of track location
LocationType typ;
// Only for typ==locationMergePoint
int clipidx1; // first clip (left one)
int clipidx2; // second clip (right one)
};
#endif

View File

@ -20,6 +20,7 @@ threshold of difference in two selected tracks
#include "CompareAudioCommand.h"
#include "../Project.h"
#include "Command.h"
#include "../WaveTrack.h"
wxString CompareAudioCommandType::BuildName()
{

View File

@ -20,7 +20,6 @@
#include "../TrackPanel.h"
#include "../Project.h"
#include "../Track.h"
#include "../WaveTrack.h"
wxString GetProjectInfoCommandType::BuildName()
{
@ -149,3 +148,23 @@ void GetProjectInfoCommand::SendTracksInfo(TrackList *projTracks,
}
Status(boolValueStr);
}
bool GetProjectInfoCommand::testSelected(Track * track) const
{
return track->GetSelected();
}
bool GetProjectInfoCommand::testLinked(Track * track) const
{
return track->GetLinked();
}
bool GetProjectInfoCommand::testSolo(Track * track) const
{
return track->GetSolo();
}
bool GetProjectInfoCommand::testMute(Track * track) const
{
return track->GetMute();
}

View File

@ -18,7 +18,6 @@
#include "Command.h"
#include "CommandType.h"
#include "../Track.h"
class GetProjectInfoCommandType : public CommandType
{
@ -51,10 +50,10 @@ private:
void SendTracksInfo(TrackList *projTracks, Getter);
// Functions pointed to for getting track parameters
bool testSelected(Track * track) const {return track->GetSelected();}
bool testLinked( Track * track) const {return track->GetLinked();}
bool testSolo( Track * track) const {return track->GetSolo();}
bool testMute( Track * track) const {return track->GetMute();}
bool testSelected(Track * track) const;
bool testLinked(Track * track) const;
bool testSolo(Track * track) const;
bool testMute(Track * track) const;
};

View File

@ -19,7 +19,6 @@
#include "GetTrackInfoCommand.h"
#include "../TrackPanel.h"
#include "../Project.h"
#include "../Track.h"
#include "../WaveTrack.h"
wxString GetTrackInfoCommandType::BuildName()

View File

@ -15,6 +15,7 @@
#include "ImportExportCommands.h"
#include "../Project.h"
#include "../Track.h"
#include "../export/Export.h"
// Import

View File

@ -25,6 +25,7 @@ project window.
#include <wx/settings.h>
#include <wx/bitmap.h>
#include "../Track.h"
#include "../TrackPanel.h"
#include "../toolbars/ToolManager.h"
#include "../toolbars/ToolBar.h"

View File

@ -19,6 +19,7 @@
#include "SelectCommand.h"
#include <wx/string.h>
#include "../Project.h"
#include "../Track.h"
wxString SelectCommandType::BuildName()
{

View File

@ -19,7 +19,6 @@
#include "SetProjectInfoCommand.h"
#include "../Project.h"
#include "../Track.h"
#include "../WaveTrack.h"
// The following parameters have a boolean string, indicated by the kSetOfTracksStr
#define kSetOfTracksStr "TrackSet"

View File

@ -65,7 +65,7 @@ END_EVENT_TABLE()
EffectAmplify::EffectAmplify()
{
mAmp = DEF_Amp;
mRatio = pow(10.0, mAmp / 20.0);
mRatio = DB_TO_LINEAR(mAmp);
mRatioClip = 0.0;
mCanClip = false;
mPeak = 0.0;
@ -211,10 +211,11 @@ void EffectAmplify::PopulateOrExchange(ShuttleGui & S)
S.StartVerticalLay(0);
{
int precission = 3; // allow (a generous) 3 decimal places for Amplification (dB)
// Amplitude
S.StartMultiColumn(2, wxCENTER);
{
FloatingPointValidator<double> vldAmp(2, &mAmp);
FloatingPointValidator<double> vldAmp(precission, &mAmp, NUM_VAL_ONE_TRAILING_ZERO);
vldAmp.SetRange(MIN_Amp, MAX_Amp);
mAmpT = S.Id(ID_Amp).AddTextBox(_("Amplification (dB):"), wxT(""), 12);
mAmpT->SetValidator(vldAmp);
@ -233,10 +234,10 @@ void EffectAmplify::PopulateOrExchange(ShuttleGui & S)
// Peak
S.StartMultiColumn(2, wxCENTER);
{
int precission = 2;
FloatingPointValidator<double> vldNewPeak(precission, &mNewPeak);
double minAmp = MIN_Amp + (20.0 * log10(mPeak));
double maxAmp = MAX_Amp + (20.0 * log10(mPeak));
// One extra decimal place so that rounding is visible to user (see: bug 958)
FloatingPointValidator<double> vldNewPeak(precission + 1, &mNewPeak, NUM_VAL_ONE_TRAILING_ZERO);
double minAmp = MIN_Amp + LINEAR_TO_DB(mPeak);
double maxAmp = MAX_Amp + LINEAR_TO_DB(mPeak);
// min and max need same precision as what we're validating (bug 963)
minAmp = Internat::CompatibleToDouble(Internat::ToString(minAmp, precission));
@ -268,17 +269,17 @@ void EffectAmplify::PopulateOrExchange(ShuttleGui & S)
bool EffectAmplify::TransferDataToWindow()
{
// limit range of gain
double dBInit = 20.0*log10(mRatio);
double dBInit = LINEAR_TO_DB(mRatio);
double dB = TrapDouble(dBInit, MIN_Amp, MAX_Amp);
if (dB != dBInit)
mRatio = pow(10.0, dB / 20.0);
mRatio = DB_TO_LINEAR(dB);
mAmp = 20.0 * log10(mRatio);
mAmp = LINEAR_TO_DB(mRatio);
mAmpT->GetValidator()->TransferToWindow();
mAmpS->SetValue((int) (mAmp * SCL_Amp + 0.5f));
mNewPeak = 20.0 * log10(mRatio * mPeak);
mNewPeak = LINEAR_TO_DB(mRatio * mPeak);
mNewPeakT->GetValidator()->TransferToWindow();
mClip->SetValue(mCanClip);
@ -295,7 +296,7 @@ bool EffectAmplify::TransferDataFromWindow()
return false;
}
mRatio = pow(10.0, TrapDouble(mAmp * SCL_Amp, MIN_Amp * SCL_Amp, MAX_Amp * SCL_Amp) / (20.0 * SCL_Amp));
mRatio = DB_TO_LINEAR(TrapDouble(mAmp * SCL_Amp, MIN_Amp * SCL_Amp, MAX_Amp * SCL_Amp) / SCL_Amp);
mCanClip = mClip->GetValue();
@ -322,11 +323,11 @@ void EffectAmplify::OnAmpText(wxCommandEvent & WXUNUSED(evt))
return;
}
mRatio = pow(10.0, TrapDouble(mAmp * SCL_Amp, MIN_Amp * SCL_Amp, MAX_Amp * SCL_Amp) / (20.0 * SCL_Amp));
mRatio = DB_TO_LINEAR(TrapDouble(mAmp * SCL_Amp, MIN_Amp * SCL_Amp, MAX_Amp * SCL_Amp) / SCL_Amp);
mAmpS->SetValue((int) (20.0 * log10(mRatio) * SCL_Amp + 0.5));
mAmpS->SetValue((int) (LINEAR_TO_DB(mRatio) * SCL_Amp + 0.5));
mNewPeak = 20.0 * log10(mRatio * mPeak);
mNewPeak = LINEAR_TO_DB(mRatio * mPeak);
mNewPeakT->GetValidator()->TransferToWindow();
CheckClip();
@ -343,12 +344,12 @@ void EffectAmplify::OnPeakText(wxCommandEvent & WXUNUSED(evt))
if (mNewPeak == 0.0)
mRatio = mRatioClip;
else
mRatio = pow(10.0, mNewPeak / 20.0) / mPeak;
mRatio = DB_TO_LINEAR(mNewPeak) / mPeak;
double ampInit = 20.0 * log10(mRatio);
double ampInit = LINEAR_TO_DB(mRatio);
mAmp = TrapDouble(ampInit, MIN_Amp, MAX_Amp);
if (mAmp != ampInit)
mRatio = pow(10.0, mAmp / 20.0);
mRatio = DB_TO_LINEAR(mAmp);
mAmpT->GetValidator()->TransferToWindow();
@ -360,20 +361,20 @@ void EffectAmplify::OnPeakText(wxCommandEvent & WXUNUSED(evt))
void EffectAmplify::OnAmpSlider(wxCommandEvent & evt)
{
double dB = evt.GetInt() / SCL_Amp;
mRatio = pow(10.0, TrapDouble(dB, MIN_Amp, MAX_Amp) / 20.0);
mRatio = DB_TO_LINEAR(TrapDouble(dB, MIN_Amp, MAX_Amp));
double dB2 = (evt.GetInt() - 1) / SCL_Amp;
double ratio2 = pow(10.0, TrapDouble(dB2, MIN_Amp, MAX_Amp) / 20.0);
double ratio2 = DB_TO_LINEAR(TrapDouble(dB2, MIN_Amp, MAX_Amp));
if (!mClip->GetValue() && mRatio * mPeak > 1.0 && ratio2 * mPeak < 1.0)
{
mRatio = 1.0 / mPeak;
}
mAmp = 20.0 * log10(mRatio);
mAmp = LINEAR_TO_DB(mRatio);
mAmpT->GetValidator()->TransferToWindow();
mNewPeak = 20.0 * log10(mRatio * mPeak);
mNewPeak = LINEAR_TO_DB(mRatio * mPeak);
mNewPeakT->GetValidator()->TransferToWindow();
CheckClip();

View File

@ -33,6 +33,8 @@
#include "../Theme.h"
#include "../widgets/valnum.h"
#include "../WaveTrack.h"
// Define keys, defaults, minimums, and maximums for the effect parameters
//
// Name Type Key Def Min Max Scale
@ -278,7 +280,7 @@ bool EffectAutoDuck::Process()
sampleCount minSamplesPause =
mControlTrack->TimeToLongSamples(maxPause);
double threshold = pow(10.0, mThresholdDb/20);
double threshold = DB_TO_LINEAR(mThresholdDb);
// adjust the threshold so we can compare it to the rmsSum value
threshold = threshold * threshold * kRMSWindowSize;
@ -553,7 +555,7 @@ bool EffectAutoDuck::ApplyDuckFade(int trackNumber, WaveTrack* t,
if (gain < mDuckAmountDb)
gain = mDuckAmountDb;
buf[i - pos] *= pow(10.0, gain / 20.0);
buf[i - pos] *= DB_TO_LINEAR(gain);
}
t->Set((samplePtr)buf, floatSample, pos, len);

View File

@ -19,8 +19,6 @@
#include <wx/textctrl.h>
#include <wx/window.h>
#include "../WaveTrack.h"
#include "Effect.h"
class EffectAutoDuckPanel;

View File

@ -44,8 +44,8 @@ enum
// Define keys, defaults, minimums, and maximums for the effect parameters
//
// Name Type Key Def Min Max Scale
Param( Bass, double, XO("Bass"), 0.0, -15.0, 15.0, 1 );
Param( Treble, double, XO("Treble"), 0.0, -15.0, 15.0, 1 );
Param( Bass, double, XO("Bass"), 0.0, -30.0, 30.0, 1 );
Param( Treble, double, XO("Treble"), 0.0, -30.0, 30.0, 1 );
Param( Level, double, XO("Level"), -1.0, -30.0, 0.0, 1 );
Param( Normalize, bool, XO("Normalize"), true, false, true, 1 );
@ -155,7 +155,7 @@ sampleCount EffectBassTreble::ProcessBlock(float **inBlock, float **outBlock, sa
}
else
{
float gain = (pow(10.0, dB_level / 20.0f)) / mMax;
float gain = DB_TO_LINEAR(dB_level) / mMax;
for (sampleCount i = 0; i < blockLen; i++)
{
// Normalize to specified level

View File

@ -14,12 +14,12 @@
*//*******************************************************************/
#include "../Audacity.h"
#include "ChangeSpeed.h"
#include <math.h>
#include <wx/intl.h>
#include "../Envelope.h"
#include "../LabelTrack.h"
#include "../Prefs.h"
#include "../Project.h"
@ -27,9 +27,8 @@
#include "../ShuttleGui.h"
#include "../widgets/valnum.h"
#include "ChangeSpeed.h"
#include "TimeWarper.h"
#include "../WaveTrack.h"
enum
{

View File

@ -19,8 +19,6 @@
#include <wx/string.h>
#include <wx/textctrl.h>
#include "../Track.h"
#include "../WaveTrack.h"
#include "../widgets/NumericTextCtrl.h"
#include "Effect.h"

View File

@ -37,6 +37,8 @@
#include "../ShuttleGui.h"
#include "../widgets/valnum.h"
#include "../WaveTrack.h"
enum
{
ID_Thresh = 10000,

View File

@ -21,11 +21,9 @@
#include <wx/string.h>
#include <wx/textctrl.h>
#include "../Envelope.h"
#include "../WaveTrack.h"
#include "Effect.h"
class Envelope;
class ShuttleGui;
#define CLICKREMOVAL_PLUGIN_SYMBOL XO("Click Removal")

View File

@ -41,6 +41,8 @@
#include "../float_cast.h"
#include "../widgets/Ruler.h"
#include "../WaveTrack.h"
enum
{
ID_Threshold = 10000,
@ -328,8 +330,8 @@ bool EffectCompressor::TransferDataFromWindow()
bool EffectCompressor::NewTrackPass1()
{
mThreshold = pow(10.0, mThresholdDB/20); // factor of 20 because it's power
mNoiseFloor = pow(10.0, mNoiseFloorDB/20);
mThreshold = DB_TO_LINEAR(mThresholdDB);
mNoiseFloor = DB_TO_LINEAR(mNoiseFloorDB);
mNoiseCounter = 100;
mAttackInverseFactor = exp(log(mThreshold) / (mCurRate * mAttackTime + 0.5));

View File

@ -14,7 +14,6 @@
#include "../AudacityApp.h"
#include "../Envelope.h"
#include "../FFT.h"
#include "../WaveTrack.h"
#include "../Prefs.h"
@ -112,7 +111,7 @@ float ContrastDialog::GetDB()
{
if( rms < 1.0E-30 )
return -60.0;
return 20.0*log10(rms);
return LINEAR_TO_DB(rms);
}
else
{

View File

@ -2060,6 +2060,11 @@ TimeWarper *Effect::GetTimeWarper()
// Use these two methods to copy the input tracks to mOutputTracks, if
// doing the processing on them, and replacing the originals only on success (and not cancel).
// Copy the group tracks that have tracks selected
void Effect::CopyInputTracks()
{
CopyInputTracks(Track::Wave);
}
void Effect::CopyInputTracks(int trackType)
{
// Reset map

View File

@ -30,7 +30,6 @@ class wxWindow;
#include "audacity/EffectInterface.h"
#include "../Experimental.h"
#include "../WaveTrack.h"
#include "../SelectedRegion.h"
#include "../Shuttle.h"
#include "../Internat.h"
@ -40,9 +39,14 @@ class ShuttleGui;
#define BUILTIN_EFFECT_PREFIX wxT("Built-in Effect: ")
class AudacityProject;
class SelectedRegion;
class TimeWarper;
class EffectUIHost;
class Track;
class TrackList;
class TrackFactory;
class WaveTrack;
// TODO: Apr-06-2015
// TODO: Much more cleanup of old methods and variables is needed, but
@ -337,7 +341,8 @@ protected:
// Use these two methods to copy the input tracks to mOutputTracks, if
// doing the processing on them, and replacing the originals only on success (and not cancel).
void CopyInputTracks(int trackType = Track::Wave);
void CopyInputTracks(); // trackType = Track::Wave
void CopyInputTracks(int trackType);
// If bGoodResult, replace mWaveTracks tracks in mTracks with successfully processed
// mOutputTracks copies, get rid of old mWaveTracks, and set mWaveTracks to mOutputTracks.

View File

@ -53,6 +53,7 @@
#include "../Audacity.h"
#include "Equalization.h"
#include <math.h>
#include <vector>
@ -95,13 +96,10 @@
#include "../xml/XMLFileReader.h"
#include "../Theme.h"
#include "../AllThemeResources.h"
#include "../WaveTrack.h"
#include "../float_cast.h"
#include "FileDialog.h"
#include "Equalization.h"
#ifdef EXPERIMENTAL_EQ_SSE_THREADED
#include "Equalization48x.h"
#endif
@ -1182,13 +1180,13 @@ bool EffectEqualization::CalcFilter()
}
mFilterFuncR[mWindowSize/2] = val1;
mFilterFuncR[0] = (float)(pow(10., mFilterFuncR[0]/20.));
mFilterFuncR[0] = DB_TO_LINEAR(mFilterFuncR[0]);
for(i=1;i<mWindowSize/2;i++)
{
mFilterFuncR[i] = (float)(pow(10., mFilterFuncR[i]/20.));
mFilterFuncR[i] = DB_TO_LINEAR(mFilterFuncR[i]);
mFilterFuncR[mWindowSize-i]=mFilterFuncR[i]; //Fill entire array
}
mFilterFuncR[i] = (float)(pow(10., mFilterFuncR[i]/20.)); //do last one
mFilterFuncR[i] = DB_TO_LINEAR(mFilterFuncR[i]); //do last one
//transfer to time domain to do the padding and windowing
float *outr = new float[mWindowSize];
@ -2773,7 +2771,7 @@ void EqualizationPanel::OnPaint(wxPaintEvent & WXUNUSED(event))
yF += mOutr[halfM];
yF = fabs(yF);
if(yF!=0.)
yF = 20.0*log10(yF); //20 here as an amplitude
yF = LINEAR_TO_DB(yF);
else
yF = mEffect->mdBMin;
}

View File

@ -35,8 +35,6 @@
#endif
#include "Effect.h"
#include "../Envelope.h"
#include "../WaveTrack.h"
#include "../xml/XMLTagHandler.h"
#include "../widgets/Grid.h"
#include "../widgets/Ruler.h"
@ -45,6 +43,7 @@
#define EQUALIZATION_PLUGIN_SYMBOL XO("Equalization")
class Envelope;
class EqualizationPanel;
//

View File

@ -30,6 +30,9 @@
#include "../ShuttleGui.h"
#include "../widgets/valnum.h"
#include "../LabelTrack.h"
#include "../WaveTrack.h"
// Define keys, defaults, minimums, and maximums for the effect parameters
//
// Name Type Key Def Min Max Scale

View File

@ -14,10 +14,9 @@
class wxString;
#include <wx/string.h>
class LabelTrack;
#include "../LabelTrack.h"
#include "../WaveTrack.h"
#include <wx/string.h>
#include "Effect.h"

View File

@ -14,10 +14,12 @@
**********************************************************************/
#include "Generator.h"
#include "../Project.h"
#include "../Prefs.h"
#include "../WaveTrack.h"
#include "Generator.h"
#include "TimeWarper.h"
#include <memory>

View File

@ -43,6 +43,8 @@
#include "../ShuttleGui.h"
#include "../Prefs.h"
#include "../WaveTrack.h"
#include <algorithm>
#include <vector>
#include <math.h>
@ -765,10 +767,10 @@ EffectNoiseReduction::Worker::Worker
const int nAttackBlocks = 1 + (int)(settings.mAttackTime * sampleRate / mStepSize);
const int nReleaseBlocks = 1 + (int)(settings.mReleaseTime * sampleRate / mStepSize);
// Applies to amplitudes, divide by 20:
mNoiseAttenFactor = pow(10.0, noiseGain / 20.0);
mNoiseAttenFactor = DB_TO_LINEAR(noiseGain);
// Apply to gain factors which apply to amplitudes, divide by 20:
mOneBlockAttack = pow(10.0, (noiseGain / (20.0 * nAttackBlocks)));
mOneBlockRelease = pow(10.0, (noiseGain / (20.0 * nReleaseBlocks)));
mOneBlockAttack = DB_TO_LINEAR(noiseGain / nAttackBlocks);
mOneBlockRelease = DB_TO_LINEAR(noiseGain / nReleaseBlocks);
// Applies to power, divide by 10:
mOldSensitivityFactor = pow(10.0, settings.mOldSensitivity / 10.0);

View File

@ -275,10 +275,8 @@ void EffectNoiseRemoval::Initialize()
mFreqSmoothingBins = (int)(mFreqSmoothingHz * mWindowSize / mSampleRate);
mAttackDecayBlocks = 1 +
(int)(mAttackDecayTime * mSampleRate / (mWindowSize / 2));
// Applies to amplitudes, divide by 20:
mNoiseAttenFactor = pow(10.0, mNoiseGain/20.0);
// Applies to gain factors which apply to amplitudes, divide by 20:
mOneBlockAttackDecay = pow(10.0, (mNoiseGain / (20.0 * mAttackDecayBlocks)));
mNoiseAttenFactor = DB_TO_LINEAR(mNoiseGain);
mOneBlockAttackDecay = DB_TO_LINEAR(mNoiseGain / mAttackDecayBlocks);
// Applies to power, divide by 10:
mSensitivityFactor = pow(10.0, mSensitivity/10.0);
mMinSignalBlocks =

View File

@ -16,6 +16,7 @@
#include "../Audacity.h" // for rint from configwin.h
#include "Normalize.h"
#include <math.h>
@ -28,8 +29,6 @@
#include "../WaveTrack.h"
#include "../widgets/valnum.h"
#include "Normalize.h"
// Define keys, defaults, minimums, and maximums for the effect parameters
//
// Name Type Key Def Min Max Scale
@ -152,9 +151,8 @@ bool EffectNormalize::Process()
float ratio;
if( mGain )
ratio = pow(10.0,TrapDouble(mLevel, // same value used for all tracks
MIN_Level,
MAX_Level)/20.0);
// same value used for all tracks
ratio = DB_TO_LINEAR(TrapDouble(mLevel, MIN_Level, MAX_Level));
else
ratio = 1.0;
@ -285,7 +283,7 @@ void EffectNormalize::PopulateOrExchange(ShuttleGui & S)
mGain ? wxT("true") : wxT("false"));
mGainCheckBox->SetValidator(wxGenericValidator(&mGain));
FloatingPointValidator<double> vldLevel(1, &mLevel);
FloatingPointValidator<double> vldLevel(2, &mLevel, NUM_VAL_ONE_TRAILING_ZERO);
vldLevel.SetRange(MIN_Level, MAX_Level);
mLevelTextCtrl = S.AddTextBox(wxT(""), wxT(""), 10);
mLevelTextCtrl->SetName(_("Maximum amplitude dB"));

View File

@ -18,8 +18,6 @@
#include <wx/string.h>
#include <wx/textctrl.h>
#include "../WaveTrack.h"
#include "Effect.h"
class ShuttleGui;

View File

@ -27,11 +27,13 @@
#include "../FFT.h"
#include "../widgets/valnum.h"
#include "../WaveTrack.h"
// Define keys, defaults, minimums, and maximums for the effect parameters
//
// Name Type Key Def Min Max Scale
Param( Amount, float, XO("Stretch Factor"), 10.0, 1.0, FLT_MAX, 1 );
Param( Time, float, XO("Time Resolution"), 0.25f, 0.001f, FLT_MAX, 1 );
Param( Time, float, XO("Time Resolution"), 0.25f, 0.00099f, FLT_MAX, 1 );
class PaulStretch
{
@ -170,7 +172,7 @@ void EffectPaulstretch::PopulateOrExchange(ShuttleGui & S)
*/
S.AddTextBox(_("Stretch Factor:"), wxT(""), 10)->SetValidator(vldAmount);
FloatingPointValidator<float> vldTime(1, &time_resolution);
FloatingPointValidator<float> vldTime(3, &time_resolution, NUM_VAL_ONE_TRAILING_ZERO);
vldTime.SetMin(MIN_Time);
S.AddTextBox(_("Time Resolution (seconds):"), wxT(""), 10)->SetValidator(vldTime);
}

View File

@ -12,8 +12,6 @@
#include <wx/string.h>
#include "../WaveTrack.h"
#include "Effect.h"
class ShuttleGui;

View File

@ -45,8 +45,8 @@ enum
// Name Type Key Def Min Max Scale
Param( Stages, int, XO("Stages"), 2, 2, NUM_STAGES, 1 );
Param( DryWet, int, XO("DryWet"), 128, 0, 255, 1 );
Param( Freq, double, XO("Freq"), 0.4, 0.1, 4.0, 10 );
Param( Phase, double, XO("Phase"), 0.0, 0.0, 359.0, 1 );
Param( Freq, double, XO("Freq"), 0.4, 0.001,4.0, 10.0 );
Param( Phase, double, XO("Phase"), 0.0, 0.0, 360.0, 1 );
Param( Depth, int, XO("Depth"), 100, 0, 255, 1 );
Param( Feedback, int, XO("Feedback"), 0, -100, 100, 1 );
@ -152,7 +152,7 @@ sampleCount EffectPhaser::ProcessBlock(float **inBlock, float **outBlock, sample
{
double in = ibuf[i];
double m = in + fbout * mFeedback / 100;
double m = in + fbout * mFeedback / 101; // Feedback must be less than 100% to avoid infinite gain.
if (((skipcount++) % lfoskipsamples) == 0)
{
@ -222,6 +222,7 @@ bool EffectPhaser::SetAutomationParameters(EffectAutomationParameters & parms)
void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
{
S.SetBorder(5);
S.AddSpace(0, 5);
S.StartMultiColumn(3, wxEXPAND);
{
@ -229,7 +230,7 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
IntegerValidator<int> vldStages(&mStages);
vldStages.SetRange(MIN_Stages, MAX_Stages);
mStagesT = S.Id(ID_Stages).AddTextBox(_("Stages:"), wxT(""), 12);
mStagesT = S.Id(ID_Stages).AddTextBox(_("Stages:"), wxT(""), 15);
mStagesT->SetValidator(vldStages);
S.SetStyle(wxSL_HORIZONTAL);
@ -240,7 +241,7 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
IntegerValidator<int> vldDryWet(&mDryWet);
vldDryWet.SetRange(MIN_DryWet, MAX_DryWet);
mDryWetT = S.Id(ID_DryWet).AddTextBox(_("Dry/Wet:"), wxT(""), 12);
mDryWetT = S.Id(ID_DryWet).AddTextBox(_("Dry/Wet:"), wxT(""), 15);
mDryWetT->SetValidator(vldDryWet);
S.SetStyle(wxSL_HORIZONTAL);
@ -248,19 +249,19 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
mDryWetS->SetName(_("Dry Wet"));
mDryWetS->SetMinSize(wxSize(100, -1));
FloatingPointValidator<double> vldFreq(1, &mFreq);
FloatingPointValidator<double> vldFreq(5, &mFreq, NUM_VAL_ONE_TRAILING_ZERO);
vldFreq.SetRange(MIN_Freq, MAX_Freq);
mFreqT = S.Id(ID_Freq).AddTextBox(_("LFO Frequency (Hz):"), wxT(""), 12);
mFreqT = S.Id(ID_Freq).AddTextBox(_("LFO Frequency (Hz):"), wxT(""), 15);
mFreqT->SetValidator(vldFreq);
S.SetStyle(wxSL_HORIZONTAL);
mFreqS = S.Id(ID_Freq).AddSlider(wxT(""), DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, MIN_Freq * SCL_Freq);
mFreqS = S.Id(ID_Freq).AddSlider(wxT(""), DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, 0.0);
mFreqS ->SetName(_("LFO frequency in hertz"));
mFreqS ->SetMinSize(wxSize(100, -1));
FloatingPointValidator<double> vldPhase(1, &mPhase);
vldPhase.SetRange(MIN_Phase, MAX_Phase);
mPhaseT = S.Id(ID_Phase).AddTextBox(_("LFO Start Phase (deg.):"), wxT(""), 12);
mPhaseT = S.Id(ID_Phase).AddTextBox(_("LFO Start Phase (deg.):"), wxT(""), 15);
mPhaseT->SetValidator(vldPhase);
S.SetStyle(wxSL_HORIZONTAL);
@ -271,7 +272,7 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
IntegerValidator<int> vldDepth(&mDepth);
vldDepth.SetRange(MIN_Depth, MAX_Depth);
mDepthT = S.Id(ID_Depth).AddTextBox(_("Depth:"), wxT(""), 12);
mDepthT = S.Id(ID_Depth).AddTextBox(_("Depth:"), wxT(""), 15);
mDepthT->SetValidator(vldDepth);
S.SetStyle(wxSL_HORIZONTAL);
@ -281,7 +282,7 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
IntegerValidator<int> vldFeedback(&mFeedback);
vldFeedback.SetRange(MIN_Feedback, MAX_Feedback);
mFeedbackT = S.Id(ID_Feedback).AddTextBox(_("Feedback (%):"), wxT(""), 12);
mFeedbackT = S.Id(ID_Feedback).AddTextBox(_("Feedback (%):"), wxT(""), 15);
mFeedbackT->SetValidator(vldFeedback);
S.SetStyle(wxSL_HORIZONTAL);
@ -331,7 +332,6 @@ bool EffectPhaser::TransferDataFromWindow()
void EffectPhaser::OnStagesSlider(wxCommandEvent & evt)
{
mStages = (evt.GetInt() / SCL_Stages) & ~1; // must be even;
mPhaseS->SetValue(mStages * SCL_Stages);
mStagesT->GetValidator()->TransferToWindow();
EnableApply(mUIParent->Validate());
}
@ -346,6 +346,7 @@ void EffectPhaser::OnDryWetSlider(wxCommandEvent & evt)
void EffectPhaser::OnFreqSlider(wxCommandEvent & evt)
{
mFreq = (double) evt.GetInt() / SCL_Freq;
if (mFreq < MIN_Freq) mFreq = MIN_Freq;
mFreqT->GetValidator()->TransferToWindow();
EnableApply(mUIParent->Validate());
}

View File

@ -15,14 +15,14 @@
#include "../Audacity.h"
#include "Reverse.h"
#include <math.h>
#include <wx/intl.h>
#include "../LabelTrack.h"
#include "Reverse.h"
#include "../WaveTrack.h"
//
// EffectReverse

View File

@ -15,8 +15,6 @@
#include <wx/string.h>
#include "../WaveTrack.h"
#include "Effect.h"
#define REVERSE_PLUGIN_SYMBOL XO("Reverse")

View File

@ -725,7 +725,7 @@ bool EffectScienFilter::CalcFilter()
}
if ((mOrder & 1) == 0)
{
float fTemp = pow (10.0, -wxMax(0.001, mRipple) / 20.0); // at DC the response is down R dB (for even-order)
float fTemp = DB_TO_LINEAR(-wxMax(0.001, mRipple)); // at DC the response is down R dB (for even-order)
mpBiquad[0].fNumerCoeffs [0] *= fTemp;
mpBiquad[0].fNumerCoeffs [1] *= fTemp;
mpBiquad[0].fNumerCoeffs [2] *= fTemp;
@ -761,7 +761,7 @@ bool EffectScienFilter::CalcFilter()
case kChebyshevTypeII: // Chebyshev Type 2
float fSZeroX, fSZeroY;
float fSPoleX, fSPoleY;
eps = pow (10.0, -wxMax(0.001, mStopbandRipple) / 20.0);
eps = DB_TO_LINEAR(-wxMax(0.001, mStopbandRipple));
a = log (1 / eps + sqrt(1 / square(eps) + 1)) / mOrder;
// Assume even order
@ -1131,7 +1131,7 @@ void EffectScienFilterPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
x = mEnvRect.x + i;
freq = pow(10.0, loLog + i * step); //Hz
yF = mEffect->FilterMagnAtFreq (freq);
yF = 20.0 * log10(yF);
yF = LINEAR_TO_DB(yF);
if (yF < mDbMin)
{

View File

@ -19,6 +19,7 @@
#include <wx/intl.h>
#include "../ShuttleGui.h"
#include "../WaveTrack.h"
EffectSilence::EffectSilence()
{

View File

@ -15,7 +15,6 @@
#include <wx/string.h>
#include "../WaveTrack.h"
#include "../widgets/NumericTextCtrl.h"
#include "Generator.h"

Some files were not shown because too many files have changed in this diff Show More