1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-22 00:47:13 +01:00

Bug 377 (P2) - fix case where the R channel of a stereo clip wouldn't be dragged if it was off-screen and sync-lock was off

This commit is contained in:
mchinen
2011-04-25 18:10:32 +00:00
parent d42f014b6d
commit 9321b1634e
5 changed files with 46 additions and 4 deletions

View File

@@ -1030,6 +1030,18 @@ void WaveClip::GetDisplayRect(wxRect* r)
*r = mDisplayRect;
}
// only works if the clip is on screen an mDisplayRect is set.
sampleCount WaveClip::GetSampleNumberAtX(int xcoord)
{
if (mDisplayRect.width > 0 &&
xcoord >= mDisplayRect.x && xcoord < mDisplayRect.x + mDisplayRect.width) {
float cursor = (xcoord - mDisplayRect.x) / mDisplayRect.width;
return GetStartSample() + GetNumSamples() * cursor;
}
return -1;
}
bool WaveClip::Append(samplePtr buffer, sampleFormat format,
sampleCount len, unsigned int stride /* = 1 */,
XMLWriter* blockFileLog /*=NULL*/)