Skip to content

Commit

Permalink
Add getModuleLength
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed Nov 29, 2021
1 parent ec777be commit af4bb2a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions source/audioformats/stream.d
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,26 @@ public: // This is also part of the public API
}
}

/// Length. Returns the amount of PLAYED patterns in the module
/// Formats that support this: MOD, XM
int getModuleLength() {
assert(_io && (_io.read !is null) );
final switch(_format) with (AudioFileFormat)
{
case mp3:
case flac:
case ogg:
case opus:
case wav:
case unknown:
assert(false);
case mod:
return _modDecoder.length;
case xm:
return xm_get_module_length(_xmDecoder);
}
}

/// Tell. Returns amount of rows in a pattern.
/// Formats that support this: MOD, XM
int rowsInPattern(int pattern) {
Expand Down

0 comments on commit af4bb2a

Please sign in to comment.