1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Fix BSG problems introduced with my recent Snap/TimeConverter changes.

This commit is contained in:
lllucius 2013-10-27 18:17:00 +00:00
parent 45ebbc0491
commit 3cd39fedea

View File

@ -36,15 +36,15 @@ SnapManager::SnapManager(TrackList *tracks, TrackClipArray *exclusions,
// Grab time-snapping prefs (unless otherwise requested)
mSnapToTime = false;
if (GetActiveProject()->GetSnapTo() && !noTimeSnap)
{
// Look up the format string
AudacityProject *p = GetActiveProject();
wxASSERT(p);
if (p) {
mConverter.SetSampleRate(p->GetRate());
if (p)
{
// Look up the format string
if (p->GetSnapTo() && !noTimeSnap) {
mSnapToTime = true;
mConverter.SetFormatName(GetActiveProject()->GetSelectionFormat());
mConverter.SetSampleRate(p->GetRate());
mConverter.SetFormatName(p->GetSelectionFormat());
}
}
@ -107,10 +107,13 @@ SnapManager::SnapManager(TrackList *tracks, TrackClipArray *exclusions,
// Adds to mSnapPoints, filtering by TimeConverter
void SnapManager::CondListAdd(double t, Track *tr)
{
if (mSnapToTime) {
mConverter.SetTimeValue(t);
}
if (mConverter.GetTimeValue() == t)
if (!mSnapToTime || mConverter.GetTimeValue() == t) {
mSnapPoints->Add(new SnapPoint(t, tr));
}
}
SnapManager::~SnapManager()