Prepare for function abstraction.
This commit is contained in:
+24
-4
@@ -100,6 +100,26 @@ void Song::DetachSteps()
|
|||||||
m_vpStepsByType[st].clear();
|
m_vpStepsByType[st].clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float Song::GetFirstSecond() const
|
||||||
|
{
|
||||||
|
return this->firstSecond;
|
||||||
|
}
|
||||||
|
|
||||||
|
float Song::GetFirstBeat() const
|
||||||
|
{
|
||||||
|
return this->m_SongTiming.GetBeatFromElapsedTime(this->firstSecond);
|
||||||
|
}
|
||||||
|
|
||||||
|
float Song::GetLastSecond() const
|
||||||
|
{
|
||||||
|
return this->lastSecond;
|
||||||
|
}
|
||||||
|
|
||||||
|
float Song::GetLastBeat() const
|
||||||
|
{
|
||||||
|
return this->m_SongTiming.GetBeatFromElapsedTime(this->lastSecond);
|
||||||
|
}
|
||||||
|
|
||||||
// Reset to an empty song.
|
// Reset to an empty song.
|
||||||
void Song::Reset()
|
void Song::Reset()
|
||||||
{
|
{
|
||||||
@@ -1580,22 +1600,22 @@ public:
|
|||||||
static int NormallyDisplayed( T* p, lua_State *L ){ lua_pushboolean(L, p->NormallyDisplayed()); return 1; }
|
static int NormallyDisplayed( T* p, lua_State *L ){ lua_pushboolean(L, p->NormallyDisplayed()); return 1; }
|
||||||
static int GetFirstSecond(T* p, lua_State *L)
|
static int GetFirstSecond(T* p, lua_State *L)
|
||||||
{
|
{
|
||||||
lua_pushnumber(L, p->firstSecond);
|
lua_pushnumber(L, p->GetFirstSecond());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
static int GetLastSecond(T* p, lua_State *L)
|
static int GetLastSecond(T* p, lua_State *L)
|
||||||
{
|
{
|
||||||
lua_pushnumber(L, p->lastSecond);
|
lua_pushnumber(L, p->GetLastSecond());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
static int GetFirstBeat( T* p, lua_State *L )
|
static int GetFirstBeat( T* p, lua_State *L )
|
||||||
{
|
{
|
||||||
lua_pushnumber(L, p->m_SongTiming.GetBeatFromElapsedTime(p->firstSecond));
|
lua_pushnumber(L, p->GetFirstBeat());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
static int GetLastBeat( T* p, lua_State *L )
|
static int GetLastBeat( T* p, lua_State *L )
|
||||||
{
|
{
|
||||||
lua_pushnumber(L, p->m_SongTiming.GetBeatFromElapsedTime(p->lastSecond));
|
lua_pushnumber(L, p->GetLastBeat());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
static int HasAttacks( T* p, lua_State *L ) { lua_pushboolean(L, p->HasAttacks()); return 1; }
|
static int HasAttacks( T* p, lua_State *L ) { lua_pushboolean(L, p->HasAttacks()); return 1; }
|
||||||
|
|||||||
@@ -231,9 +231,13 @@ public:
|
|||||||
RString m_sMusicFile;
|
RString m_sMusicFile;
|
||||||
RString m_sInstrumentTrackFile[NUM_InstrumentTrack];
|
RString m_sInstrumentTrackFile[NUM_InstrumentTrack];
|
||||||
|
|
||||||
|
/** @brief The length of the music file. */
|
||||||
float m_fMusicLengthSeconds;
|
float m_fMusicLengthSeconds;
|
||||||
|
/** @brief The first second that a note is hit. */
|
||||||
float firstSecond;
|
float firstSecond;
|
||||||
|
/** @brief The last second that a note is hit. */
|
||||||
float lastSecond;
|
float lastSecond;
|
||||||
|
/** @brief The last second of the song for playing purposes. */
|
||||||
float specifiedLastSecond;
|
float specifiedLastSecond;
|
||||||
float m_fMusicSampleStartSeconds;
|
float m_fMusicSampleStartSeconds;
|
||||||
float m_fMusicSampleLengthSeconds;
|
float m_fMusicSampleLengthSeconds;
|
||||||
@@ -290,6 +294,11 @@ public:
|
|||||||
/** @brief The Song's TimingData. */
|
/** @brief The Song's TimingData. */
|
||||||
TimingData m_SongTiming;
|
TimingData m_SongTiming;
|
||||||
|
|
||||||
|
float GetFirstBeat() const;
|
||||||
|
float GetFirstSecond() const;
|
||||||
|
float GetLastBeat() const;
|
||||||
|
float GetLastSecond() const;
|
||||||
|
|
||||||
typedef vector<BackgroundChange> VBackgroundChange;
|
typedef vector<BackgroundChange> VBackgroundChange;
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user