diff options
Diffstat (limited to 'lib/simfile.dart')
-rw-r--r-- | lib/simfile.dart | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/simfile.dart b/lib/simfile.dart index 20e79e8..2174de9 100644 --- a/lib/simfile.dart +++ b/lib/simfile.dart @@ -1,3 +1,4 @@ +import 'dart:ffi'; import 'dart:io'; enum Difficulty { Beginner, Easy, Medium, Hard, Challenge, Edit } @@ -42,6 +43,9 @@ class Simfile { Chart? chartSimplest; + Map<double, double> bpms = {}; + double offset = 0; + Simfile(this.path); void load() { @@ -55,6 +59,22 @@ class Simfile { List<String> keys = fieldData[1]!.split(':').map((key) => key.trim()).toList(); String value = fieldData[2]!; + if (keys[0] == "BPMS") { + for (final pairRaw in value.split(',')) { + List<String> pair = pairRaw.split('='); + if (pair.length != 2) { + continue; + } + double time = double.parse(pair[0]); + double bpm = double.parse(pair[1]); + bpms[time] = bpm; + } + } + + if (keys[0] == "OFFSET") { + offset = double.parse(value); + } + if (keys[0] != "NOTES") { tags[keys[0]] = value; continue; |