Add many TimingData bindings. See changelog.

This commit is contained in:
Jason Felds
2011-06-15 16:56:01 -04:00
parent 614a878ebf
commit 49ac1c362d
4 changed files with 128 additions and 0 deletions
+6
View File
@@ -8,6 +8,12 @@ ________________________________________________________________________________
StepMania 5.0 Preview 2 | 20110???
--------------------------------------------------------------------------------
2011/06/15
----------
* [TimingData] Added many lua bindings for the other timing segments. GetWarps,
GetCombos, GetTimeSignatures, GetTickcounts, GetFakes, GetScrolls, GetSpeeds.
This should cover all of them now. [Wolfman2000]
2011/06/13
----------
* [InputHandler_DirectInput] Fixed MouseWheel input not resetting. [AJ]
+7
View File
@@ -1430,10 +1430,17 @@
<Function name='GetBPMs'/>
<Function name='GetBPMsAndTimes'/>
<Function name='GetBeatFromElapsedTime'/>
<Function name='GetCombos'/>
<Function name='GetDelays'/>
<Function name='GetElapsedTimeFromBeat'/>
<Function name='GetFakes'/>
<Function name='GetLabels'/>
<Function name='GetScrolls'/>
<Function name='GetSpeeds'/>
<Function name='GetStops'/>
<Function name='GetTickcounts'/>
<Function name='GetTimeSignatures'/>
<Function name='GetWarps'/>
<Function name='HasBPMChanges'/>
<Function name='HasFakes'/>
<Function name='HasNegativeBPMs'/>
+21
View File
@@ -3611,6 +3611,27 @@
<Function name='GetLabels' return='{string}' arguments=''>
Returns a table of the Labels and the times they happen as strings with the format "<code>beat=label name</code>."
</Function>
<Function name='GetWarps' return='{string}' arguments=''>
Returns a table of the Warps and the times they happen as strings with the format "<code>beat=number of beats warped over</code>."
</Function>
<Function name='GetCombos' return='{string}' arguments=''>
Returns a table of the Combos and the times they happen as strings with the format "<code>beat=combo value</code>."
</Function>
<Function name='GetTimeSignatures' return='{string}' arguments=''>
Returns a table of the Time Signatures and the times they happen as strings with the format "<code>beat=beats per measure (numerator)=denominator</code>."
</Function>
<Function name='GetTickcounts' return='{string}' arguments=''>
Returns a table of the Tickcountss and the times they happen as strings with the format "<code>beat=number of ticks per beat</code>."
</Function>
<Function name='GetFakes' return='{string}' arguments=''>
Returns a table of the Fakes and the times they happen as strings with the format "<code>beat=number of beats to not judge</code>."
</Function>
<Function name='GetScrolls' return='{string}' arguments=''>
Returns a table of the Scrolls and the times they happen as strings with the format "<code>beat=scroll rate ratio</code>."
</Function>
<Function name='GetSpeeds' return='{string}' arguments=''>
Returns a table of the Speeds and the times they happen as strings with the format "<code>beat=scroll rate ratio=length of time to fully activate=unit of activation (0 for beats, 1 for seconds)</code>."
</Function>
<Function name='HasBPMChanges' return='bool' arguments=''>
Returns <code>true</code> if the TimingData contains BPM changes.
</Function>
+94
View File
@@ -1670,6 +1670,93 @@ public:
static int HasFakes( T* p, lua_State *L ) { lua_pushboolean(L, p->HasFakes()); return 1; }
static int HasSpeedChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasSpeedChanges()); return 1; }
static int HasScrollChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasScrollChanges()); return 1; }
static int GetWarps( T* p, lua_State *L )
{
vector<RString> vWarps;
FOREACH_CONST( WarpSegment, p->m_WarpSegments, seg )
{
const float length = seg->GetLength();
const float beat = seg->GetBeat();
vWarps.push_back( ssprintf("%f=%f", beat, length) );
}
LuaHelpers::CreateTableFromArray(vWarps, L);
return 1;
}
static int GetFakes( T* p, lua_State *L )
{
vector<RString> vFakes;
FOREACH_CONST( FakeSegment, p->m_FakeSegments, seg )
{
const float length = seg->GetLength();
const float beat = seg->GetBeat();
vFakes.push_back( ssprintf("%f=%f", beat, length) );
}
LuaHelpers::CreateTableFromArray(vFakes, L);
return 1;
}
static int GetScrolls( T* p, lua_State *L )
{
vector<RString> vScrolls;
FOREACH_CONST( ScrollSegment, p->m_ScrollSegments, seg )
{
const float ratio = seg->GetRatio();
const float beat = seg->GetBeat();
vScrolls.push_back( ssprintf("%f=%f", beat, ratio) );
}
LuaHelpers::CreateTableFromArray(vScrolls, L);
return 1;
}
static int GetSpeeds( T* p, lua_State *L )
{
vector<RString> vSpeeds;
FOREACH_CONST( SpeedSegment, p->m_SpeedSegments, seg )
{
const float length = seg->GetLength();
const float ratio = seg->GetRatio();
const unsigned short unit = seg->GetUnit();
const float beat = seg->GetBeat();
vSpeeds.push_back( ssprintf("%f=%f=%f=%uh", beat, ratio, length, unit) );
}
LuaHelpers::CreateTableFromArray(vSpeeds, L);
return 1;
}
static int GetTimeSignatures( T* p, lua_State *L )
{
vector<RString> vTimes;
FOREACH_CONST( TimeSignatureSegment, p->m_vTimeSignatureSegments, seg )
{
const int numerator = seg->GetNum();
const int denominator = seg->GetDen();
const float beat = seg->GetBeat();
vTimes.push_back( ssprintf("%f=%d=%d", beat, numerator, denominator) );
}
LuaHelpers::CreateTableFromArray(vTimes, L);
return 1;
}
static int GetCombos( T* p, lua_State *L )
{
vector<RString> vCombos;
FOREACH_CONST( ComboSegment, p->m_ComboSegments, seg )
{
const int combo = seg->GetCombo();
const float beat = seg->GetBeat();
vCombos.push_back( ssprintf("%f=%d", beat, combo) );
}
LuaHelpers::CreateTableFromArray(vCombos, L);
return 1;
}
static int GetTickcounts( T* p, lua_State *L )
{
vector<RString> vTicks;
FOREACH_CONST( TickcountSegment, p->m_TickcountSegments, seg )
{
const int ticks = seg->GetTicks();
const float beat = seg->GetBeat();
vTicks.push_back( ssprintf("%f=%d", beat, ticks) );
}
LuaHelpers::CreateTableFromArray(vTicks, L);
return 1;
}
static int GetStops( T* p, lua_State *L )
{
vector<RString> vStops;
@@ -1763,6 +1850,13 @@ public:
ADD_METHOD( GetStops );
ADD_METHOD( GetDelays );
ADD_METHOD( GetBPMs );
ADD_METHOD( GetWarps );
ADD_METHOD( GetFakes );
ADD_METHOD( GetTimeSignatures );
ADD_METHOD( GetTickcounts );
ADD_METHOD( GetSpeeds );
ADD_METHOD( GetScrolls );
ADD_METHOD( GetCombos );
ADD_METHOD( GetLabels );
ADD_METHOD( GetBPMsAndTimes );
ADD_METHOD( GetActualBPM );