summaryrefslogtreecommitdiff
path: root/Source/Android/jni/GameList/GameFile.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2025-04-12 14:27:09 +0200
committerJosJuice <josjuice@gmail.com>2025-04-19 14:34:49 +0200
commitb8e70df413ddd4663aa8e65a6f9d8a1e059c64c7 (patch)
treeb537d6552b2383bed599fad32f46efe8d7156122 /Source/Android/jni/GameList/GameFile.cpp
parent3eee52cb6bbebfc6b44b43aa85cd22b17b27aca5 (diff)
Android: Show time played in game details
Unlike in DolphinQt, there isn't much space to show playtimes directly in the game list, so I've put it in the game details dialog instead.
Diffstat (limited to 'Source/Android/jni/GameList/GameFile.cpp')
-rw-r--r--Source/Android/jni/GameList/GameFile.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Android/jni/GameList/GameFile.cpp b/Source/Android/jni/GameList/GameFile.cpp
index 3bf60beb28..dc922d701c 100644
--- a/Source/Android/jni/GameList/GameFile.cpp
+++ b/Source/Android/jni/GameList/GameFile.cpp
@@ -3,12 +3,14 @@
#include "jni/GameList/GameFile.h"
+#include <chrono>
#include <memory>
#include <utility>
#include <vector>
#include <jni.h>
+#include "Core/TimePlayed.h"
#include "DiscIO/Blob.h"
#include "DiscIO/Enums.h"
#include "UICommon/GameFile.h"
@@ -190,6 +192,13 @@ JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getBannerHe
return static_cast<jint>(GetRef(env, obj)->GetBannerImage().height);
}
+JNIEXPORT jlong JNICALL
+Java_org_dolphinemu_dolphinemu_model_GameFile_getTimePlayedMsInternal(JNIEnv* env, jobject obj)
+{
+ const std::chrono::milliseconds time = TimePlayed().GetTimePlayed(GetRef(env, obj)->GetGameID());
+ return time.count();
+}
+
JNIEXPORT jobject JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_parse(JNIEnv* env, jclass,
jstring path)
{