comment to make IsHoldNoteAtRow's behavior clear, add IsHoldHeadOrBodyAtRow

This commit is contained in:
Glenn Maynard
2005-07-22 00:34:54 +00:00
parent 4ec405f13b
commit b8838ba5c0
2 changed files with 21 additions and 6 deletions
+19 -2
View File
@@ -337,7 +337,25 @@ void NoteData::AddHoldNote( int iTrack, int iStartRow, int iEndRow, TapNote tn )
SetTapNote( iTrack, iStartRow, tn );
}
/* Return true if a hold note lies on or adjacent to the given spot. */
/* Determine if a hold note lies on the given spot. Return true if so. If
* pHeadRow is non-NULL, return the row of the head. */
bool NoteData::IsHoldHeadOrBodyAtRow( int iTrack, int iRow, int *pHeadRow ) const
{
const TapNote &tn = GetTapNote( iTrack, iRow );
if( tn.type == TapNote::hold_head )
{
if( pHeadRow != NULL )
*pHeadRow = iRow;
return true;
}
return IsHoldNoteAtRow( iTrack, iRow, pHeadRow );
}
/* Determine if a hold note lies on the given spot. Return true if so. If
* pHeadRow is non-NULL, return the row of the head. (Note that this returns
* false if a hold head lies on iRow itself.) */
/* XXX: rename this to IsHoldBodyAtRow */
bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const
{
int iDummy;
@@ -354,7 +372,6 @@ bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const
switch( tn.type )
{
case TapNote::hold_head:
// if( tn.iDuration + r <= iRow )
if( tn.iDuration + r < iRow )
return false;
*pHeadRow = r;