Files
itgmania212121/stepmania/src/NoteDataUtil.h
T

107 lines
5.0 KiB
C++
Raw Normal View History

2003-08-07 06:36:34 +00:00
#ifndef NOTEDATAUTIL_H
#define NOTEDATAUTIL_H
/*
-----------------------------------------------------------------------------
File: NoteDataUtil.h
Desc: Holds data about the notes that the player is supposed to hit. NoteData
is organized by:
track - corresponds to different columns of notes on the screen
index - corresponds to subdivisions of beats
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "GameConstantsAndTypes.h" // for RadarCategory
#include "NoteTypes.h"
#include "NoteData.h"
2003-08-13 19:17:28 +00:00
struct PlayerOptions;
2003-08-07 06:36:34 +00:00
/* Utils for NoteData. Things should go in here if they can be (cleanly and
* efficiently) implemented using only NoteData's primitives; this improves
* abstraction and makes it much easier to change NoteData internally in
* the future. */
namespace NoteDataUtil
{
NoteType GetSmallestNoteTypeForMeasure( const NoteData &n, int iMeasureIndex );
2003-11-17 03:38:24 +00:00
void LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData, CString sSMAttackData );
void GetSMNoteDataString( const NoteData &in, CString &notes_out, CString &attacks_out );
2004-05-20 19:05:37 +00:00
void LoadTransformedLights( const NoteData &in, NoteData &out, int iNewNumTracks );
2003-08-07 06:36:34 +00:00
float GetStreamRadarValue( const NoteData &in, float fSongSeconds );
float GetVoltageRadarValue( const NoteData &in, float fSongSeconds );
float GetAirRadarValue( const NoteData &in, float fSongSeconds );
float GetFreezeRadarValue( const NoteData &in, float fSongSeconds );
float GetChaosRadarValue( const NoteData &in, float fSongSeconds );
// radar values - return between 0.0 and 1.2
float GetRadarValue( const NoteData &in, RadarCategory rv, float fSongSeconds );
2003-11-07 08:45:21 +00:00
void RemoveHoldNotes( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
2004-01-11 06:34:30 +00:00
void RemoveSimultaneousNotes( NoteData &in, int iMaxSimultaneous, float fStartBeat = 0, float fEndBeat = 99999 );
void RemoveJumps( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
2004-01-02 11:25:21 +00:00
void RemoveHands( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
2004-01-12 03:47:55 +00:00
void RemoveQuads( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
2003-11-07 08:45:21 +00:00
void RemoveMines( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
2004-01-02 21:02:06 +00:00
enum TrackMapping { left, right, mirror, shuffle, super_shuffle, stomp, NUM_TRACK_MAPPINGS };
void Turn( NoteData &in, StepsType st, TrackMapping tt, float fStartBeat = 0, float fEndBeat = -1 );
2003-10-27 04:23:08 +00:00
void Little( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
void Wide( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
void Big( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
void Quick( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
void BMRize( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
2003-10-27 04:23:08 +00:00
void Skippy( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
2004-03-01 08:59:22 +00:00
void InsertIntelligentTaps(
NoteData &in,
float fWindowSizeBeats,
float fInsertOffsetBeats,
float fWindowStrideBeats,
bool bSkippy,
float fStartBeat = 0,
float fEndBeat = 99999 );
2003-11-07 08:45:21 +00:00
void AddMines( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
2003-11-07 05:17:41 +00:00
void Echo( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
void Planted( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
2004-01-02 21:02:06 +00:00
void Stomp( NoteData &in, StepsType st, float fStartBeat = 0, float fEndBeat = 99999 );
2003-11-07 08:45:21 +00:00
void Twister( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
void ConvertTapsToHolds( NoteData &in, int iSimultaneousHolds, float fStartBeat = 0, float fEndBeat = 99999 );
2003-08-07 06:36:34 +00:00
// change all TAP_ADDITIONs to TAP_TAPs
void ConvertAdditionsToRegular( NoteData &in );
2003-08-07 06:36:34 +00:00
void Backwards( NoteData &in );
void SwapSides( NoteData &in );
void CopyLeftToRight( NoteData &in );
void CopyRightToLeft( NoteData &in );
void ClearLeft( NoteData &in );
void ClearRight( NoteData &in );
void CollapseToOne( NoteData &in );
2003-12-31 07:49:30 +00:00
void CollapseLeft( NoteData &in );
2003-08-07 06:36:34 +00:00
void ShiftLeft( NoteData &in );
void ShiftRight( NoteData &in );
void SnapToNearestNoteType( NoteData &in, NoteType nt1, NoteType nt2, float fBeginBeat, float fEndBeat );
inline void SnapToNearestNoteType( NoteData &in, NoteType nt, float fBeginBeat, float fEndBeat ) { SnapToNearestNoteType( in, nt, (NoteType)-1, fBeginBeat, fEndBeat ); }
void FixImpossibleRows( NoteData &in, StepsType st );
// True if no notes in row that aren't true in the mask
bool RowPassesValidMask( NoteData &in, int row, const bool bValidMask[] );
2003-10-27 04:23:08 +00:00
void TransformNoteData( NoteData &nd, const PlayerOptions &po, StepsType st, float fStartBeat = 0, float fEndBeat = 99999 );
2003-11-20 06:50:05 +00:00
void AddTapAttacks( NoteData &nd, Song* pSong );
2003-09-07 22:28:46 +00:00
// void Scale( NoteData &nd, float fScale );
void ScaleRegion( NoteData &nd, float fScale, float fStartBeat = 0, float fEndBeat = 99999);
inline void Scale( NoteData &nd, float fScale ) { NoteDataUtil::ScaleRegion(nd, fScale); }
2003-09-07 22:28:46 +00:00
// If fBeatsToShift>0, add blank rows. If fBeatsToShift<0, delete rows
void ShiftRows( NoteData &nd, float fStartBeat, float fBeatsToShift );
2003-08-07 06:36:34 +00:00
};
#endif