diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt
index c037661321..2ed3ac9132 100644
--- a/Docs/Changelog_sm5.txt
+++ b/Docs/Changelog_sm5.txt
@@ -8,6 +8,11 @@ ________________________________________________________________________________
StepMania 5.0 $next | 2011????
--------------------------------------------------------------------------------
+2011/09/18
+----------
+* [Song] Added GetSampleStart() and GetSampleLength()
+ Lua bindings. [Wolfman2000]
+
2011/09/16
----------
* [UnlockManager] Added GetNumLockedSongs() Lua binding. [Wolfman2000]
diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml
index 82e4d30bda..79b0ddb7f9 100644
--- a/Docs/Luadoc/Lua.xml
+++ b/Docs/Luadoc/Lua.xml
@@ -1279,6 +1279,8 @@
+
+
diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml
index 7fe7b921a3..cea772098f 100644
--- a/Docs/Luadoc/LuaDocumentation.xml
+++ b/Docs/Luadoc/LuaDocumentation.xml
@@ -3364,6 +3364,12 @@
Gets the Song's origin.
+
+ Gets the length of a song's sample time in seconds.
+
+
+ Gets the starting position of a song sample in seconds.
+
Returns the song's directory.
diff --git a/src/Song.cpp b/src/Song.cpp
index 08182feaa6..181f552d83 100644
--- a/src/Song.cpp
+++ b/src/Song.cpp
@@ -1761,6 +1761,16 @@ public:
lua_pushnumber(L, p->m_fMusicLengthSeconds);
return 1;
}
+ static int GetSampleStart( T* p, lua_State *L )
+ {
+ lua_pushnumber(L, p->m_fMusicSampleStartSeconds);
+ return 1;
+ }
+ static int GetSampleLength( T* p, lua_State *L )
+ {
+ lua_pushnumber(L, p->m_fMusicSampleLengthSeconds);
+ return 1;
+ }
static int IsLong( T* p, lua_State *L )
{
lua_pushboolean(L, p->IsLong());
@@ -1926,6 +1936,8 @@ public:
ADD_METHOD( IsEnabled );
ADD_METHOD( GetGroupName );
ADD_METHOD( MusicLengthSeconds );
+ ADD_METHOD( GetSampleStart );
+ ADD_METHOD( GetSampleLength );
ADD_METHOD( IsLong );
ADD_METHOD( IsMarathon );
ADD_METHOD( HasStepsType );