rework tap attack representation

This commit is contained in:
Chris Danford
2003-11-15 23:19:13 +00:00
parent 474b8b9a49
commit 38ec8ca856
6 changed files with 112 additions and 88 deletions
+11 -8
View File
@@ -15,6 +15,8 @@
*/
#include "NoteTypes.h"
#include <map>
#include "Attack.h"
class NoteData
@@ -25,7 +27,7 @@ class NoteData
vector<HoldNote> m_HoldNotes;
vector<AttackNote> m_AttackNotes;
map<TapNote,Attack> m_AttackMap;
/* Pad m_TapNotes so it includes the row "rows". */
void PadTapNotes(int rows);
@@ -134,20 +136,22 @@ public:
void GetTracksHeldAtRow( int row, vector<int>& viTracksOut );
int GetNumTracksHeldAtRow( int row );
//
// used in edit/record
//
void AddHoldNote( HoldNote newNote ); // add note hold note merging overlapping HoldNotes and destroying TapNotes underneath
void RemoveHoldNote( int index );
HoldNote &GetHoldNote( int index ) { return m_HoldNotes[index]; }
const HoldNote &GetHoldNote( int index ) const { return m_HoldNotes[index]; }
// used in edit/record
void AddAttackNote( AttackNote an ); // add note hold note merging overlapping HoldNotes and destroying TapNotes underneath
void RemoveAttackNote( int index );
const AttackNote& GetAttackNote( int index ) { return m_AttackNotes[index]; }
void ShuffleAttackNotesOnSameRow();
void AddAttackNote( int track, int row, Attack attack );
void PruneUnusedAttacksFromMap(); // slow
const Attack& GetAttackAt( int track, int row );
// remove Attacks with SetTapNote(TAP_EMPTY)
//
// statistics
//
/* Return the highest beat/row that might contain notes. (Use GetLastBeat if you need
* accuracy.) */
float GetMaxBeat() const { return NoteRowToBeat(GetMaxRow()); }
@@ -164,7 +168,6 @@ public:
/* optimization: for the default of start to end, use the second (faster) */
int GetNumHoldNotes( const float fStartBeat, const float fEndBeat = -1 ) const;
int GetNumHoldNotes() const { return m_HoldNotes.size(); }
int GetNumAttackNotes() const { return m_AttackNotes.size(); }
// Transformations
void LoadTransformed( const NoteData* pOriginal, int iNewNumTracks, const int iOriginalTrackToTakeFrom[] ); // -1 for iOriginalTracksToTakeFrom means no track