Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

NoteDataUtil.h

Go to the documentation of this file.
00001 /* NoteDataUtil - Utility functions that deal with NoteData. */ 00002 00003 #ifndef NOTEDATAUTIL_H 00004 #define NOTEDATAUTIL_H 00005 00006 #include "GameConstantsAndTypes.h" // for RadarCategory 00007 #include "NoteTypes.h" 00008 #include "NoteData.h" 00009 00010 struct PlayerOptions; 00011 struct RadarValues; 00012 00013 /* Utils for NoteData. Things should go in here if they can be (cleanly and 00014 * efficiently) implemented using only NoteData's primitives; this improves 00015 * abstraction and makes it much easier to change NoteData internally in 00016 * the future. */ 00017 namespace NoteDataUtil 00018 { 00019 NoteType GetSmallestNoteTypeForMeasure( const NoteData &n, int iMeasureIndex ); 00020 void LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData ); 00021 void GetSMNoteDataString( const NoteData &in, CString &notes_out ); 00022 void LoadTransformedSlidingWindow( const NoteData &in, NoteData &out, int iNewNumTracks ); 00023 void LoadOverlapped( const NoteData &in, NoteData &out, int iNewNumTracks ); 00024 void LoadTransformedLights( const NoteData &in, NoteData &out, int iNewNumTracks ); 00025 00026 // radar values - return between 0.0 and 1.2 00027 float GetStreamRadarValue( const NoteData &in, float fSongSeconds ); 00028 float GetVoltageRadarValue( const NoteData &in, float fSongSeconds ); 00029 float GetAirRadarValue( const NoteData &in, float fSongSeconds ); 00030 float GetFreezeRadarValue( const NoteData &in, float fSongSeconds ); 00031 float GetChaosRadarValue( const NoteData &in, float fSongSeconds ); 00032 00033 void GetRadarValues( const NoteData &in, float fSongSeconds, RadarValues& out ); 00034 00035 void RemoveHoldNotes( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00036 void RemoveSimultaneousNotes( NoteData &inout, int iMaxSimultaneous, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00037 void RemoveJumps( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00038 void RemoveHands( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00039 void RemoveQuads( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00040 void RemoveMines( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00041 void RemoveAllButOneTap( NoteData &inout, int row ); 00042 enum TrackMapping { left, right, mirror, shuffle, super_shuffle, stomp, NUM_TRACK_MAPPINGS }; 00043 void Turn( NoteData &inout, StepsType st, TrackMapping tt, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00044 void Little( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00045 void Wide( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00046 void Big( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00047 void Quick( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00048 void BMRize( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00049 void Skippy( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00050 void InsertIntelligentTaps( 00051 NoteData &in, 00052 int iWindowSizeRows, 00053 int iInsertOffsetRows, 00054 int iWindowStrideRows, 00055 bool bSkippy, 00056 int iStartIndex = 0, 00057 int iEndIndex = MAX_NOTE_ROW ); 00058 void AddMines( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00059 void Echo( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00060 void Stomp( NoteData &inout, StepsType st, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00061 void Planted( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00062 void Floored( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00063 void Twister( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00064 void ConvertTapsToHolds( NoteData &inout, int iSimultaneousHolds, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00065 00066 // change all TAP_ADDITIONs to TAP_TAPs 00067 void ConvertAdditionsToRegular( NoteData &inout ); 00068 00069 void Backwards( NoteData &inout ); 00070 void SwapSides( NoteData &inout ); 00071 void CopyLeftToRight( NoteData &inout ); 00072 void CopyRightToLeft( NoteData &inout ); 00073 void ClearLeft( NoteData &inout ); 00074 void ClearRight( NoteData &inout ); 00075 void CollapseToOne( NoteData &inout ); 00076 void CollapseLeft( NoteData &inout ); 00077 void ShiftTracks( NoteData &inout, int iShiftBy ); 00078 void ShiftLeft( NoteData &inout ); 00079 void ShiftRight( NoteData &inout ); 00080 00081 void SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteType nt2, int iStartIndex, int iEndIndex ); 00082 00083 inline void SnapToNearestNoteType( NoteData &inout, NoteType nt, int iStartIndex, int iEndIndex ) 00084 { 00085 SnapToNearestNoteType( inout, nt, NOTE_TYPE_INVALID, iStartIndex, iEndIndex ); 00086 } 00087 00088 void FixImpossibleRows( NoteData &inout, StepsType st ); 00089 00090 // True if no notes in row that aren't true in the mask 00091 bool RowPassesValidMask( NoteData &inout, int row, const bool bValidMask[] ); 00092 00093 void TransformNoteData( NoteData &nd, const AttackArray &aa, StepsType st, Song* pSong ); 00094 void TransformNoteData( NoteData &nd, const PlayerOptions &po, StepsType st, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00095 void AddTapAttacks( NoteData &nd, Song* pSong ); 00096 00097 // void Scale( NoteData &nd, float fScale ); 00098 void ScaleRegion( NoteData &nd, float fScale, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); 00099 inline void Scale( NoteData &nd, float fScale ) { NoteDataUtil::ScaleRegion(nd, fScale); } 00100 00101 // If iRowsToShift > 0, add blank rows. If iRowsToShift < 0, delete rows 00102 void ShiftRows( NoteData &nd, int iStartIndex, int iRowsToShift ); 00103 00104 void RemoveAllTapsOfType( NoteData& ndInOut, TapNote::Type typeToRemove ); 00105 void RemoveAllTapsExceptForType( NoteData& ndInOut, TapNote::Type typeToKeep ); 00106 }; 00107 00108 #endif 00109 00110 /* 00111 * (c) 2001-2004 Chris Danford, Glenn Maynard 00112 * All rights reserved. 00113 * 00114 * Permission is hereby granted, free of charge, to any person obtaining a 00115 * copy of this software and associated documentation files (the 00116 * "Software"), to deal in the Software without restriction, including 00117 * without limitation the rights to use, copy, modify, merge, publish, 00118 * distribute, and/or sell copies of the Software, and to permit persons to 00119 * whom the Software is furnished to do so, provided that the above 00120 * copyright notice(s) and this permission notice appear in all copies of 00121 * the Software and that both the above copyright notice(s) and this 00122 * permission notice appear in supporting documentation. 00123 * 00124 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00125 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00126 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00127 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00128 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00129 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00130 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00131 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00132 * PERFORMANCE OF THIS SOFTWARE. 00133 */

Generated on Thu Jan 27 20:57:26 2005 for StepMania by doxygen 1.3.7