diff options
| author | in1tiate <32779090+in1tiate@users.noreply.github.com> | 2024-05-20 08:47:27 -0500 |
|---|---|---|
| committer | in1tiate <32779090+in1tiate@users.noreply.github.com> | 2024-05-20 08:47:27 -0500 |
| commit | adf32f47275a2bac02034b848215d4413e0f9b37 (patch) | |
| tree | c9b6bfa99b61d7ff97f6de4391534ee309fc3029 /src/text_file_functions.cpp | |
| parent | 4b0f7e4d806c79313e493a3c58818e995af25847 (diff) | |
Initial slide rebase commit
Diffstat (limited to 'src/text_file_functions.cpp')
| -rw-r--r-- | src/text_file_functions.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index e7c4511b..b123da37 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -912,3 +912,22 @@ bool AOApplication::get_pos_is_judge(const QString &p_pos) } return positions.contains(p_pos.trimmed()); } + +int AOApplication::get_pos_transition_duration(const QString &old_pos, const QString &new_pos) +{ + if (old_pos.split(":").size() < 2 || new_pos.split(":").size() < 2) + { + return -1; // no subpositions + } + + QString new_subpos = new_pos.split(":")[1]; + + bool ok; + int duration = read_design_ini(old_pos + "/slide_ms_" + new_subpos, get_background_path("design.ini")).toInt(&ok); + if (ok) + { + return duration; + } + else + return -1; // invalid +} |
