diff --git a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt index 7aab33d1fc..98b04c4f7b 100644 --- a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt @@ -1716,12 +1716,12 @@ class MainActivity : ComponentActivity() { SessionPrefs.setRunSteamAtStartup(this, on) runSteamAtStartup = on }, - onBootMovie = { id -> SessionPrefs.setBootMovie(this, id); loadBootMovie() }, + onBootMovie = { id -> com.droiddeck.launcher.session.BootMovie.select(this, id); loadBootMovie() }, onBootMovieSound = { on -> SessionPrefs.setBootMovieSound(this, on); bootMovieSound = on }, onImportBootMovie = { pickBootMovie.launch(InAppFilePicker.buildIntent(this, com.droiddeck.launcher.session.BootMovie.PICKER_EXTENSIONS, getString(R.string.boot_movie_pick))) }, - onRemoveBootMovie = { com.droiddeck.launcher.session.BootMovie.removeCustom(this); loadBootMovie() }, + onBootMovieChanged = { loadBootMovie() }, onDeckyInstall = { release -> decky.installDecky(release) }, onDeckyCheck = { decky.refreshDecky() }, onDeckyEnabled = { enabled -> DeckyManager.setSupervisorEnabled(this, enabled); decky.deckySupervisor = enabled }, diff --git a/app/src/main/java/com/droiddeck/launcher/session/BootMovie.kt b/app/src/main/java/com/droiddeck/launcher/session/BootMovie.kt index 3641caec51..8267edd57a 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/BootMovie.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/BootMovie.kt @@ -30,7 +30,7 @@ object BootMovie { internal val AUDIO_CODECS = setOf(MediaFormat.MIMETYPE_AUDIO_OPUS, MediaFormat.MIMETYPE_AUDIO_VORBIS) sealed class Import { - data class Done(val name: String, val audioDropped: Boolean) : Import() + data class Done(val name: String, val audioDropped: Boolean, val id: String = "") : Import() object TooLong : Import() data class Unsupported(val codec: String?) : Import() object Failed : Import() @@ -39,6 +39,21 @@ object BootMovie { private fun dir(context: Context) = File(context.filesDir, "boot-movie") private fun customFile(context: Context) = File(dir(context), "custom.webm") + /** A movie imported before movies were kept in Steam's own folder. */ + internal fun legacyCustomFile(context: Context) = customFile(context) + + /** Unpacks one of DroidDeck's own movies on demand; null for anything else. */ + internal fun assetFile(context: Context, id: String): File? = ASSETS[id]?.let { extractAsset(context, it) } + + /** Picking a movie here makes it Steam's startup movie at the next session, over whatever Steam had picked. */ + fun select(context: Context, id: String) { + SessionPrefs.setBootMovie(context, id) + SessionPrefs.setBootMovieApplyNext(context, true) + BootMovieReport.note(context, "picked $id here; Steam names ${SessionFiles.startupMoviePath(BootMovieLibrary.steamConfig(context))}") + // Whatever Steam names right now is about to be replaced, so it is not a pick to adopt later. + SessionFiles.startupMoviePath(BootMovieLibrary.steamConfig(context))?.let { SessionPrefs.setBootMovieSteamSeen(context, it) } + } + fun customName(context: Context): String? = if (customFile(context).isFile) SessionPrefs.bootMovieCustomName(context) ?: "custom.webm" else null @@ -46,21 +61,127 @@ object BootMovie { val chosen = SessionPrefs.bootMovie(context) return when { chosen == CUSTOM && customFile(context).isFile -> CUSTOM + isLibraryId(chosen) && BootMovieLibrary.file(context, chosen) != null -> chosen chosen in ASSETS -> chosen else -> DROIDDECK_30 } } + /** The file the current choice plays from, before any volume or length change. */ + fun currentFile(context: Context): File? = sourceOf(context, choice(context)) + + private fun sourceOf(context: Context, choice: String): File? = when { + choice == CUSTOM -> customFile(context) + isLibraryId(choice) -> BootMovieLibrary.file(context, choice) + else -> ASSETS[choice]?.let { extractAsset(context, it) } + } + + private fun isLibraryId(id: String) = id.startsWith(BootMovieLibrary.PREFIX) || id.startsWith(BootMovieLibrary.STEAM_PREFIX) + fun prepare(context: Context): File? { - val choice = choice(context) - val source = if (choice == CUSTOM) customFile(context) else extractAsset(context, ASSETS.getValue(choice)) ?: return null - if (SessionPrefs.bootMovieSound(context)) return source - val muted = File(source.parentFile, source.nameWithoutExtension + "-muted.webm") - if (muted.isFile && muted.lastModified() >= source.lastModified()) return muted - if (remux(source, muted, audio = false)) return muted - if (BootMovieTranscoder.transcode(source, muted, keepAudio = false) {} != null) return muted - Log.e(TAG, "could not strip audio from ${source.name}; not staging it") - return null + BootMovieLibrary.restore(context) + val source = sourceOf(context, choice(context)) ?: return null + return variant(context, source) + } + + /** The movie as Steam should get it: with the chosen volume and cut off after the chosen number of seconds. */ + private fun variant(context: Context, source: File): File? { + val volume = if (SessionPrefs.bootMovieSound(context)) SessionPrefs.bootMovieVolume(context) else 0 + val seconds = SessionPrefs.bootMovieSeconds(context) + val folder = File(dir(context), "variants") + val plan = if (isOversized(source)) oversizedPlan(volume) else plan(volume, seconds) + if (plan.passthrough) { + prune(folder, null) + return source + } + folder.mkdirs() + val limitUs = if (seconds > 0) seconds * 1_000_000L else Long.MAX_VALUE + val out = File(folder, BootMovieLibrary.variantPrefix(source) + "v$volume-s$seconds.webm") + if (out.isFile && out.length() > 0L && out.lastModified() >= source.lastModified()) { + prune(folder, out.name) + return out + } + val staged = File(folder, out.name + ".staged") + val ok = runCatching { + plan.steps.any { step -> + when (step) { + Step.REMUX_SILENT -> remux(source, staged, audio = false, limitUs) + Step.REMUX_AUDIO -> remux(source, staged, audio = true, limitUs) + Step.TRANSCODE_SILENT -> transcodeSilent(source, staged, limitUs) + Step.TRANSCODE_AUDIO -> BootMovieTranscoder.transcode(source, staged, limitUs = limitUs, gain = volume / 100f) {} != null + Step.REGAIN -> BootMovieTranscoder.regain(source, staged, volume / 100f, limitUs) + } + } + }.getOrDefault(false) + if (ok && staged.renameTo(out)) { + prune(folder, out.name) + return out + } + staged.delete() + Log.e(TAG, "could not prepare ${source.name} (volume $volume, $seconds s)") + return if (plan.sourceOnFailure) source else null + } + + internal enum class Step { REMUX_SILENT, REMUX_AUDIO, TRANSCODE_SILENT, TRANSCODE_AUDIO, REGAIN } + + /** + * How a movie is processed: the steps tried in order until one works, whether the source goes out untouched, and + * whether it still plays as it is when every step fails. + */ + internal class Plan(val passthrough: Boolean, val steps: List, val sourceOnFailure: Boolean) + + internal fun plan(volume: Int, seconds: Int): Plan = when { + volume == 100 && seconds == 0 -> Plan(true, emptyList(), true) + volume == 0 -> Plan(false, listOf(Step.REMUX_SILENT, Step.TRANSCODE_SILENT), false) + // Only a length that could not be applied plays as it is; a volume that could not be applied plays no louder. + volume == 100 -> Plan(false, listOf(Step.REMUX_AUDIO, Step.TRANSCODE_AUDIO), true) + else -> Plan(false, listOf(Step.REGAIN, Step.REMUX_SILENT, Step.TRANSCODE_AUDIO), false) + } + + /** Frames beyond 1920x1080 (4K and the like) have made Steam crash while it starts, so such a movie is always scaled down. */ + internal const val MAX_LONG_SIDE = 1920 + internal const val MAX_SHORT_SIDE = 1080 + + internal fun oversized(width: Int, height: Int) = maxOf(width, height) > MAX_LONG_SIDE || minOf(width, height) > MAX_SHORT_SIDE + + private fun oversized(format: MediaFormat) = + format.containsKey(MediaFormat.KEY_WIDTH) && format.containsKey(MediaFormat.KEY_HEIGHT) && + oversized(format.getInteger(MediaFormat.KEY_WIDTH), format.getInteger(MediaFormat.KEY_HEIGHT)) + + private fun isOversized(source: File): Boolean = probe(source)?.first?.let { oversized(it) } == true + + /** A movie that is too large never goes out as it is: it is converted at the chosen volume, and plays nothing if that fails. */ + internal fun oversizedPlan(volume: Int): Plan = + Plan(false, listOf(if (volume == 0) Step.TRANSCODE_SILENT else Step.TRANSCODE_AUDIO), false) + + private fun transcodeSilent(source: File, target: File, limitUs: Long) = + BootMovieTranscoder.transcode(source, target, keepAudio = false, limitUs = limitUs) {} != null + + /** Keeps at most the one processed copy in use, so trying settings never leaves movies piling up. */ + private fun prune(folder: File, keep: String?) { + folder.listFiles()?.forEach { if (it.name != keep) it.delete() } + } + + /** + * Takes over a startup movie chosen in Steam's own settings: when Steam's config names a movie it did not name before, + * that movie becomes the choice here. Steam already plays it, so nothing is staged over it. True when the choice changed. + */ + fun syncFromSteam(context: Context): Boolean { + val path = SessionFiles.startupMoviePath(BootMovieLibrary.steamConfig(context)) ?: return false + if (path == SessionPrefs.bootMovieSteamSeen(context)) return false + SessionPrefs.setBootMovieSteamSeen(context, path) + if (path == SessionFiles.BOOT_MOVIE_PATH) return false + val prefix = "/uioverrides/movies/" + // The list names a bought movie from the Steam folder (/config/communityitemscache/...), Steam's config from its config folder. + val id = if (path.startsWith(prefix)) BootMovieLibrary.idOf(path.removePrefix(prefix)) else { + val listed = BootMovieLibrary.list(context).firstOrNull { it.id.startsWith(BootMovieLibrary.STEAM_PREFIX) && it.id.endsWith(path) } + listed?.id ?: BootMovieLibrary.STEAM_PREFIX + path + } + if (BootMovieLibrary.file(context, id) == null) return false + val changed = SessionPrefs.bootMovie(context) != id + BootMovieReport.note(context, "Steam names $path, taken over as $id") + SessionPrefs.setBootMovie(context, id) + return changed } private fun extractAsset(context: Context, name: String): File? { @@ -82,11 +203,15 @@ object BootMovie { } } - fun import(context: Context, file: File, onStart: () -> Unit = {}, onProgress: (Int) -> Unit = {}): Import { + fun import( + context: Context, file: File, onStart: () -> Unit = {}, onProgress: (Int) -> Unit = {}, + title: String? = null, source: String = BootMovieLibrary.SOURCE_IMPORT, repoId: String? = null, + cover: ByteArray? = null, use: Boolean = true, + ): Import { val (format, audio) = probe(file) ?: return Import.Unsupported(null) val video = format.getString(MediaFormat.KEY_MIME) val audioPlayable = audio == null || audio in AUDIO_CODECS - val playable = video in VIDEO_CODECS && file.length() <= MAX_BYTES + val playable = video in VIDEO_CODECS && file.length() <= MAX_BYTES && !oversized(format) val copy = playable && audioPlayable && isWebm(file) val remux = !copy && playable && video in REMUX_CODECS if (!copy && !remux) { @@ -95,11 +220,12 @@ object BootMovie { if (durationUs > MAX_CONVERT_SECONDS * 1_000_000L) return Import.TooLong onStart() } - val target = customFile(context) - val staged = File(dir(context), "custom.webm.staged") + val shown = title?.takeIf { it.isNotBlank() } ?: file.nameWithoutExtension + val library = BootMovieLibrary.libraryDir(context) + val staged = File(library, ".import-${System.nanoTime()}.staged") var audioDropped = remux && !audioPlayable return try { - target.parentFile?.mkdirs() + library.mkdirs() val ok = when { copy -> { file.inputStream().use { input -> staged.outputStream().use { output -> FileUtils.copy(input, output) } } @@ -108,11 +234,10 @@ object BootMovie { remux -> remux(file, staged, audio = true) else -> BootMovieTranscoder.transcode(file, staged, onProgress = onProgress)?.also { audioDropped = it.audioDropped } != null } - if (!ok || !staged.renameTo(target)) return Import.Failed - File(target.parentFile, "custom-muted.webm").delete() - SessionPrefs.setBootMovieCustomName(context, file.name) - SessionPrefs.setBootMovie(context, CUSTOM) - Import.Done(file.name, audioDropped) + if (!ok || !staged.setReadable(true, false)) return Import.Failed + val name = BootMovieLibrary.commit(context, staged, shown, source, repoId, cover) ?: return Import.Failed + if (use) select(context, BootMovieLibrary.idOf(name)) + Import.Done(shown, audioDropped, BootMovieLibrary.idOf(name)) } catch (e: Exception) { Log.w(TAG, "could not import ${file.name}", e) Import.Failed @@ -124,8 +249,9 @@ object BootMovie { fun removeCustom(context: Context) { customFile(context).delete() File(dir(context), "custom-muted.webm").delete() + File(dir(context), "variants").listFiles { f -> f.name.startsWith(BootMovieLibrary.variantPrefix(customFile(context))) }?.forEach { it.delete() } SessionPrefs.setBootMovieCustomName(context, null) - if (SessionPrefs.bootMovie(context) == CUSTOM) SessionPrefs.setBootMovie(context, DROIDDECK_30) + if (SessionPrefs.bootMovie(context) == CUSTOM) select(context, DROIDDECK_30) } private fun isWebm(file: File): Boolean { @@ -156,7 +282,7 @@ object BootMovie { } } - private fun remux(source: File, target: File, audio: Boolean): Boolean { + private fun remux(source: File, target: File, audio: Boolean, limitUs: Long = Long.MAX_VALUE): Boolean { val staged = File(target.parentFile, target.name + ".remux") val extractor = MediaExtractor() var muxer: MediaMuxer? = null @@ -183,7 +309,7 @@ object BootMovie { val info = MediaCodec.BufferInfo() while (true) { val size = extractor.readSampleData(buffer, 0) - if (size < 0) break + if (size < 0 || extractor.sampleTime > limitUs) break val track = tracks[extractor.sampleTrackIndex] if (track != null) { val key = extractor.sampleFlags and MediaExtractor.SAMPLE_FLAG_SYNC != 0 diff --git a/app/src/main/java/com/droiddeck/launcher/session/BootMovieLibrary.kt b/app/src/main/java/com/droiddeck/launcher/session/BootMovieLibrary.kt new file mode 100644 index 0000000000..7c125e8196 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/session/BootMovieLibrary.kt @@ -0,0 +1,410 @@ +package com.droiddeck.launcher.session + +import android.content.Context +import android.graphics.Bitmap +import android.graphics.Bitmap.CompressFormat +import android.media.MediaMetadataRetriever +import android.util.Log +import com.droiddeck.launcher.runtime.LinuxRuntime +import org.json.JSONObject +import java.io.File + +/** + * The boot movies a person can pick from: DroidDeck's own two, a movie imported before this list existed, every `.webm` in + * Steam's custom movies folder (imports, SteamDeckRepo and movies put there by hand; all of them can be removed), Steam's own + * three startup movies and the movies bought in Steam's points shop (neither can be removed). + */ +object BootMovieLibrary { + private const val TAG = "BootMovieLibrary" + const val PREFIX = "file:" + + /** A movie Steam itself keeps outside its custom movies folder, such as one bought in its points shop: `steam:`. */ + const val STEAM_PREFIX = "steam:" + + /** Held while the movie list is read and changed, so two imports at once cannot overwrite each other's entries. */ + private val lock = Any() + + /** Names DroidDeck stages the chosen movie under; they are copies, not movies of their own. */ + internal val STAGED = setOf("bigpicture_startup.webm", "steam_os_startup.webm", "droiddeck-startup.webm") + + const val SOURCE_DROIDDECK = "droiddeck" + const val SOURCE_IMPORT = "import" + const val SOURCE_REPO = "repo" + const val SOURCE_STEAM = "steam" + const val SOURCE_POINTSHOP = "pointshop" + + class Entry(val id: String, val title: String, val source: String, val file: File?, val removable: Boolean) + + internal fun moviesDir(context: Context) = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/config/uioverrides/movies") + + /** + * The folders whose custom movies are listed, found and removed: [moviesDir], where imports are put and managed, then the + * x86-64 client's. The order never depends on which client is running, so a saved choice keeps meaning the same file. + */ + internal fun customMovieDirs(context: Context): List = + listOf(moviesDir(context), File(SessionPrefs.steamRoot(context, "x86_64"), "config/uioverrides/movies")).distinctBy { it.path } + + /** Where imported and installed movies are kept for good; Steam's folder holds a copy, which is put back if it goes missing. */ + internal fun libraryDir(context: Context) = File(context.filesDir, "boot-movie/library") + + private fun metaFile(context: Context) = File(context.filesDir, "boot-movie/movies.json") + + internal fun steamRoot(context: Context) = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam") + + /** The running (else selected) Steam client's config, the one whose startup movie choice is read and recorded. */ + internal fun steamConfig(context: Context) = File(SessionPrefs.activeSteamRoot(context), "config/config.vdf") + + private fun thumbsDir(context: Context) = File(context.filesDir, "boot-movie/thumbs") + + fun idOf(name: String) = PREFIX + name + + /** Every Steam client folder: the usual one and the x86-64 client's. */ + internal fun steamRoots(context: Context): List = listOf( + steamRoot(context), File(LinuxRuntime.rootDir(context), "root/.droiddeck-x64/.local/share/Steam"), + ).filter { it.isDirectory } + + private fun steamFile(context: Context, id: String): File? { + val path = id.removePrefix(STEAM_PREFIX) + if (!path.startsWith("/") || path.contains("..") || path.contains('\\') || !path.endsWith(".webm", ignoreCase = true)) return null + return steamRoots(context).firstNotNullOfOrNull { root -> + listOf("config", "steamui", "").map { File(root, it + path) }.firstOrNull { it.isFile && it.length() > 0L } + } + } + + fun file(context: Context, id: String): File? { + if (id.startsWith(STEAM_PREFIX)) return steamFile(context, id) + if (!id.startsWith(PREFIX)) return null + val name = id.removePrefix(PREFIX) + if (name.isEmpty() || name.contains('/') || name.contains('\\') || name in STAGED) return null + return customMovieDirs(context).map { File(it, name) }.firstOrNull { it.isFile && it.length() > 0L } + } + + private fun isMovie(file: File) = file.isFile && file.length() > 0L && file.name.endsWith(".webm", ignoreCase = true) && + file.name !in STAGED && !file.name.startsWith(".") + + private fun readMeta(context: Context): JSONObject = + runCatching { JSONObject(metaFile(context).readText()) }.getOrDefault(JSONObject()) + + /** Changes the movie list one writer at a time; [change] gets the list and returns whether to save it. */ + private fun editMeta(context: Context, change: (JSONObject) -> Boolean) = synchronized(lock) { + val meta = readMeta(context) + if (change(meta)) { + val file = metaFile(context) + file.parentFile?.mkdirs() + val staged = File(file.parentFile, file.name + ".staged") + runCatching { + staged.writeText(meta.toString()) + if (!staged.renameTo(file)) staged.delete() + }.onFailure { staged.delete(); Log.w(TAG, "could not write the movie list", it) } + } + } + + /** The post a movie was installed from, if it came from SteamDeckRepo. */ + fun repoId(context: Context, name: String): String? = + readMeta(context).optJSONObject(name)?.optString("repo")?.takeIf { it.isNotEmpty() } + + fun installedRepoIds(context: Context): Set { + val meta = readMeta(context) + return meta.keys().asSequence().filter { file(context, idOf(it)) != null } + .mapNotNull { meta.optJSONObject(it)?.optString("repo")?.takeIf { id -> id.isNotEmpty() } }.toSet() + } + + fun nameForRepo(context: Context, repoId: String): String? { + val meta = readMeta(context) + return meta.keys().asSequence().firstOrNull { file(context, idOf(it)) != null && meta.optJSONObject(it)?.optString("repo") == repoId } + } + + fun list(context: Context): List { + val out = ArrayList() + out.add(Entry(BootMovie.DROIDDECK_30, "DroidDeck · 30 fps", SOURCE_DROIDDECK, null, removable = false)) + out.add(Entry(BootMovie.DROIDDECK_60, "DroidDeck · 60 fps", SOURCE_DROIDDECK, null, removable = false)) + BootMovie.customName(context)?.let { out.add(Entry(BootMovie.CUSTOM, it, SOURCE_IMPORT, BootMovie.legacyCustomFile(context), removable = true)) } + restore(context) + val meta = readMeta(context) + val names = HashSet() + customMovieDirs(context).flatMap { dir -> dir.listFiles { f -> isMovie(f) }.orEmpty().toList() } + .filter { names.add(it.name) }.sortedBy { it.name.lowercase() }.forEach { f -> + val info = meta.optJSONObject(f.name) + val source = info?.optString("source")?.takeIf { it.isNotEmpty() } ?: SOURCE_STEAM + val title = info?.optString("title")?.takeIf { it.isNotEmpty() } ?: f.nameWithoutExtension + // Everything in Steam's custom movies folder is the person's own (imported, from SteamDeckRepo or put there by hand). + out.add(Entry(idOf(f.name), title, if (source == SOURCE_STEAM) SOURCE_IMPORT else source, f, removable = true)) + } + val steam = LinkedHashMap() + SessionFiles.startupMoviePath(steamConfig(context))?.takeIf { !it.startsWith(OVERRIDES) }?.let { path -> + steamFile(context, STEAM_PREFIX + path)?.let { steam[STEAM_PREFIX + path] = it } + } + val bought = HashMap() + for (root in steamRoots(context)) { + File(root, "steamui/movies").listFiles { f -> isMovie(f) && f.nameWithoutExtension.lowercase() in NATIVE }.orEmpty() + .sortedBy { it.name.lowercase() }.forEach { steam.putIfAbsent(STEAM_PREFIX + "/movies/" + it.name, it) } + val scan = pointShopMovies(root) + bought.putAll(scan.titles) + for (found in scan.files) steam.putIfAbsent(STEAM_PREFIX + "/" + found.relativeTo(root).invariantSeparatorsPath, found) + } + val seen = HashSet() + for ((id, file) in steam) { + if (file.name in STAGED || !seen.add(file.canonicalPath)) continue + val native = file.nameWithoutExtension.lowercase() in NATIVE + // Steam names a bought movie by an item number and a hash; the points shop's own title is shown when Steam has it. + val title = if (native) NATIVE[file.nameWithoutExtension.lowercase()] ?: file.nameWithoutExtension else bought[file.path] ?: boughtId(file)?.let { "#$it" } ?: file.nameWithoutExtension + out.add(Entry(id, title, if (native) SOURCE_STEAM else SOURCE_POINTSHOP, file, removable = false)) + } + return out + } + + /** The three startup movies Steam ships with; Steam's movies folder holds many more videos that are not startup movies. */ + private val NATIVE = mapOf("deck_startup" to "Deck startup", "oled_startup" to "Oled startup", "startup_machine" to "Machine startup") + + private val skippedFolders = setOf("uioverrides", "steamapps", "librarycache", "httpcache", "logs", "compatdata", "shadercache") + + private val scanLock = Any() + private class Scan(val at: Long, val files: List, val titles: Map) + + private val scans = HashMap() + + /** Forgets the last search for Steam's own movies. */ + internal fun forgetScan() = synchronized(scanLock) { scans.clear() } + + /** + * Movies Steam keeps outside its custom movies folder, such as ones bought in its points shop: every `.webm` below the + * client's config, cache and user folders. The search is repeated at most every 15 seconds for each client folder. + */ + private fun pointShopMovies(root: File): Scan = synchronized(scanLock) { + val now = System.currentTimeMillis() + scans[root.path]?.let { if (now - it.at < 15_000L) return it } + val found = listOf("config", "userdata", "appcache", "steamui").flatMap { top -> + val base = File(root, top) + if (!base.isDirectory) return@flatMap emptyList() + base.walkTopDown().maxDepth(5) + .onEnter { dir -> dir.name !in skippedFolders && !(top == "steamui" && dir.parentFile == base && dir.name == "movies") } + .take(20_000).filter { isMovie(it) }.toList() + }.sortedBy { it.path.lowercase() } + val titles = HashMap() + for (file in found) boughtId(file)?.let { id -> boughtTitle(root, id)?.let { titles[file.path] = it } } + val scan = Scan(now, found, titles) + scans[root.path] = scan + scan + } + + /** The item number in the name Steam gives a bought movie, `_.webm`; null for any other name. */ + private fun boughtId(file: File) = Regex("^(\\d+)_").find(file.nameWithoutExtension)?.groupValues?.get(1) + + /** What the points shop calls a bought movie, from the list of startup movies Steam keeps in each user's local config. */ + private fun boughtTitle(root: File, id: String): String? { + val key = "communityitemid\\\":\\\"$id\\\"" + val title = Regex("item_title\\\\\":\\\\\"([^\\\\\"]*)") + for (user in File(root, "userdata").listFiles { f -> f.isDirectory }.orEmpty()) { + val text = runCatching { File(user, "config/localconfig.vdf").readText() }.getOrNull() ?: continue + val at = text.indexOf(key) + if (at < 0) continue + title.find(text.substring(at, (at + 3000).coerceAtMost(text.length)))?.groupValues?.get(1)?.takeIf { it.isNotBlank() }?.let { return it } + } + return null + } + + private const val OVERRIDES = "/uioverrides/movies/" + + /** Puts back, in Steam's folder, any movie of DroidDeck's that went missing there, such as after the runtime was reset. */ + internal fun restore(context: Context) = synchronized(lock) { + migrateLegacyMeta(context) + val meta = readMeta(context) + val library = libraryDir(context) + meta.keys().asSequence().toList().forEach { name -> + val kept = File(library, name) + if (name.contains('/') || !kept.isFile || kept.length() == 0L) return@forEach + val copy = File(moviesDir(context), name) + if (!copy.isFile || copy.length() != kept.length()) mirror(kept, copy) + } + } + + /** Takes in the movie notes an earlier version kept inside Steam's movies folder, so those movies keep their title and source. */ + private fun migrateLegacyMeta(context: Context) { + val legacy = File(moviesDir(context), ".droiddeck-movies.json") + if (!legacy.isFile) return + val old = runCatching { JSONObject(legacy.readText()) }.getOrNull() ?: return + editMeta(context) { meta -> + var changed = false + old.keys().asSequence().toList().forEach { name -> + val info = old.optJSONObject(name) ?: return@forEach + if (meta.optJSONObject(name) == null && File(moviesDir(context), name).isFile) { meta.put(name, info); changed = true } + } + changed + } + legacy.delete() + } + + /** Copies [kept] to [copy] through a staging name, so Steam never sees half a movie. */ + private fun mirror(kept: File, copy: File): Boolean { + val staged = File(copy.parentFile, copy.name + ".${System.nanoTime()}.staged") + return try { + copy.parentFile?.mkdirs() + kept.inputStream().use { input -> staged.outputStream().use { output -> input.copyTo(output) } } + staged.setReadable(true, false) && staged.renameTo(copy) + } catch (e: Exception) { + Log.w(TAG, "could not copy ${kept.name} into Steam's movies", e) + false + } finally { + staged.delete() + } + } + + fun title(context: Context, id: String): String = list(context).firstOrNull { it.id == id }?.title ?: id + + /** The file a movie id plays from; DroidDeck's own movies live in the app and are unpacked on demand. */ + fun fileOf(context: Context, entry: Entry): File? = entry.file ?: BootMovie.assetFile(context, entry.id) + + /** A free `.webm` name for a movie called [title]; the same title twice gets " (2)", " (3)"… */ + fun freeName(context: Context, title: String): String { + val base = title.replace(Regex("[^\\p{L}\\p{N} ._()\\-]"), "").replace(Regex("\\s+"), " ").trim().trim('.').take(60).ifEmpty { "movie" } + val dirs = customMovieDirs(context) + val library = libraryDir(context) + var name = "$base.webm" + var n = 2 + while (dirs.any { File(it, name).exists() } || File(library, name).exists() || name in STAGED) name = "$base ($n).webm".also { n++ } + return name + } + + /** + * Keeps the finished movie [staged] (a file in [libraryDir]) under a free name, copies it into Steam's folder and notes its + * title, source and cover. Returns the name, or null when it could not be kept. Runs one movie at a time. + */ + internal fun commit(context: Context, staged: File, title: String, source: String, repoId: String? = null, cover: ByteArray? = null): String? = + synchronized(lock) { + val name = freeName(context, title) + val kept = File(libraryDir(context), name) + if (!staged.renameTo(kept)) return null + if (!mirror(kept, File(moviesDir(context), name))) { kept.delete(); return null } + register(context, name, title, source, repoId, cover) + name + } + + /** Notes a movie that was just put into Steam's folder: what to call it, where it came from and its cover. */ + fun register(context: Context, name: String, title: String, source: String, repoId: String? = null, cover: ByteArray? = null) { + editMeta(context) { meta -> + val info = JSONObject().put("title", title).put("source", source) + if (repoId != null) info.put("repo", repoId) + meta.put(name, info) + true + } + if (cover != null) runCatching { + thumbsDir(context).mkdirs() + File(thumbsDir(context), coverName(name)).writeBytes(cover) + } + } + + fun remove(context: Context, id: String): Boolean { + val removed = when { + id == BootMovie.CUSTOM -> { BootMovie.removeCustom(context); true } + else -> { + // Only movies in Steam's custom movies folder are ever deleted; Steam's own and points shop movies are left alone. + if (!id.startsWith(PREFIX)) return false + val name = id.removePrefix(PREFIX) + if (name.isEmpty() || name.contains('/') || name.contains('\\') || name in STAGED) return false + val copies = customMovieDirs(context).map { File(it, name) } + // A name can exist in more than one client's folder; the entry is the first one found (see customMovieDirs), and only that file is deleted. + val target = copies.firstOrNull { it.exists() } + val managed = File(libraryDir(context), name) + if (readMeta(context).optJSONObject(name) == null && target == null && !managed.isFile) return false + synchronized(lock) { + val main = File(moviesDir(context), name) + val another = copies.any { it != target && it.exists() } + val ownsRecord = target == null || target.path == main.path || (!another && !managed.isFile) + var gone = target == null || target.delete() + if (gone && ownsRecord) { + gone = !managed.exists() || managed.delete() + if (gone) { + editMeta(context) { it.remove(name) != null } + File(thumbsDir(context), coverName(name)).delete() + thumbsDir(context).listFiles { f -> f.name.startsWith("frame-" + safe(name) + "-") }?.forEach { it.delete() } + } + } + if (gone) { + val prefixes = listOfNotNull(target, main.takeIf { ownsRecord }).map { variantPrefix(it) } + File(context.filesDir, "boot-movie/variants").listFiles { f -> prefixes.any { f.name.startsWith(it) } }?.forEach { it.delete() } + } + gone + } + } + } + if (removed && SessionPrefs.bootMovie(context) == id) BootMovie.select(context, BootMovie.DROIDDECK_30) + return removed + } + + /** What every processed copy of [source] starts with; the hash of its full path keeps same-named files in different places apart. */ + internal fun variantPrefix(source: File) = safe(source.name) + "." + Integer.toHexString(source.absolutePath.hashCode()) + "-" + + private fun safe(name: String) = name.replace(Regex("[^A-Za-z0-9._-]"), "_") + + private fun coverName(name: String) = "cover-" + safe(name) + + /** How long a movie runs, in whole seconds; 0 when it cannot be read. */ + fun durationSeconds(file: File?): Int { + if (file == null || !file.isFile) return 0 + val retriever = MediaMetadataRetriever() + return try { + retriever.setDataSource(file.path) + val ms = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)?.toLongOrNull() ?: 0L + ((ms + 500) / 1000).toInt() + } catch (e: Exception) { + 0 + } finally { + runCatching { retriever.release() } + } + } + + /** The first frame that is not nearly black out of several taken through the movie, else the brightest; a movie may open dark. */ + private fun brightestFrame(retriever: MediaMetadataRetriever, durationMs: Long): Bitmap? { + var best: Bitmap? = null + var bestLuma = -1 + for (fraction in doubleArrayOf(0.33, 0.5, 0.66, 0.2, 0.8, 0.1, 0.9)) { + val frame = runCatching { retriever.getFrameAtTime((durationMs * 1000L * fraction).toLong(), MediaMetadataRetriever.OPTION_CLOSEST) }.getOrNull() ?: continue + val luma = averageLuma(frame) + if (luma >= MIN_COVER_LUMA) return frame + if (luma > bestLuma) { best = frame; bestLuma = luma } + } + return best ?: runCatching { retriever.frameAtTime }.getOrNull() + } + + private fun averageLuma(bitmap: Bitmap): Int { + val small = Bitmap.createScaledBitmap(bitmap, 16, 9, true) + var sum = 0L + for (y in 0 until small.height) for (x in 0 until small.width) { + val c = small.getPixel(x, y) + sum += (((c shr 16) and 0xFF) * 3 + ((c shr 8) and 0xFF) * 6 + (c and 0xFF)) / 10 + } + return (sum / (small.width * small.height)).toInt() + } + + private const val MIN_COVER_LUMA = 24 + + /** A cover for a movie: the picture SteamDeckRepo gave it, or one frame taken from the video and remembered. */ + fun cover(context: Context, entry: Entry): File? { + val file = fileOf(context, entry) ?: return null + val name = if (entry.id.startsWith(PREFIX)) file.name else entry.id + // Points Shop covers once kept a picture that was not always the movie's own; those files are not used. + val given = File(thumbsDir(context), if (entry.source == SOURCE_POINTSHOP) "v2-" + coverName(name) else coverName(name)) + if (given.isFile && given.length() > 0L) return given + val key = "frame-" + safe(name) + "-v2-" + file.length() + "-" + file.lastModified() + ".jpg" + val frame = File(thumbsDir(context), key) + if (frame.isFile && frame.length() > 0L) return frame + val retriever = MediaMetadataRetriever() + return try { + retriever.setDataSource(file.path) + val ms = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)?.toLongOrNull() ?: 0L + val bitmap = brightestFrame(retriever, ms) ?: return null + val width = 480 + val scaled = if (bitmap.width > width) Bitmap.createScaledBitmap(bitmap, width, (bitmap.height * width / bitmap.width).coerceAtLeast(1), true) else bitmap + thumbsDir(context).mkdirs() + thumbsDir(context).listFiles { f -> f.name.startsWith("frame-" + safe(name) + "-") }?.forEach { it.delete() } + val staged = File(thumbsDir(context), "$key.staged") + staged.outputStream().use { scaled.compress(CompressFormat.JPEG, 82, it) } + if (staged.renameTo(frame)) frame else null + } catch (e: Exception) { + Log.w(TAG, "no cover for ${file.name}", e) + null + } finally { + runCatching { retriever.release() } + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/session/BootMovieReport.kt b/app/src/main/java/com/droiddeck/launcher/session/BootMovieReport.kt new file mode 100644 index 0000000000..3a672dcfd9 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/session/BootMovieReport.kt @@ -0,0 +1,160 @@ +package com.droiddeck.launcher.session + +import android.content.Context +import android.os.Environment +import android.util.Log +import java.io.File +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale + +/** + * What DroidDeck and Steam know about boot movies, in one text file: Steam's startup movie setting, every movie file and + * where it lives, DroidDeck's own state, and a short trace of what each session start did to Steam's config. + */ +object BootMovieReport { + private const val TAG = "BootMovieReport" + private const val MAX_TRACE_LINES = 200 + private const val MAX_HITS = 60 + private val KNOWN_TITLES = listOf("Turret Factory") + private val SKIPPED = setOf("steamapps", "compatdata", "shadercache", "logs") + private val BINARY = setOf("webm", "jpg", "jpeg", "png", "ico", "mp4", "ogg", "mp3", "wav", "ttf", "woff", "woff2", "gif", "webp", "bin", "so", "dll", "exe", "zip", "pak") + private val lock = Any() + + private fun traceFile(context: Context) = File(context.filesDir, "boot-movie/apply.log") + + /** Adds a line to the short trace kept for the report; only the latest lines are kept. */ + fun note(context: Context, line: String) { + synchronized(lock) { + runCatching { + val file = traceFile(context) + file.parentFile?.mkdirs() + val stamp = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).format(Date()) + val lines = (if (file.isFile) file.readLines() else emptyList()) + "$stamp $line" + file.writeText(lines.takeLast(MAX_TRACE_LINES).joinToString("\n") + "\n") + } + } + } + + /** Writes the report to Downloads/DroidDeck, or to the app's own folder when that is not possible; null when the report cannot be built or neither folder works. */ + fun write(context: Context): File? { + val text = runCatching { build(context) }.getOrElse { + Log.w(TAG, "could not build the report", it) + return null + } + val folders = listOfNotNull( + File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "DroidDeck"), + context.getExternalFilesDir(null), + ) + for (folder in folders) { + val file = File(folder, "boot-movie-report.txt") + val saved = runCatching { folder.mkdirs(); file.writeText(text); true }.getOrDefault(false) + if (saved) return file + Log.w(TAG, "could not write the report to ${file.path}") + } + return null + } + + private fun describe(file: File) = + "${file.path} ${file.length()} bytes ${SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).format(Date(file.lastModified()))}" + + internal fun build(context: Context): String { + val out = StringBuilder() + fun line(text: String = "") { out.append(text).append('\n') } + fun listing(title: String, folder: File) { + line("-- $title: ${folder.path}") + val files = folder.listFiles()?.sortedBy { it.name.lowercase() } + if (files == null) line(" (missing)") else if (files.isEmpty()) line(" (empty)") + else files.forEach { line(" " + describe(it)) } + } + + line("DroidDeck boot movie report, ${Date()}") + line() + line("== DroidDeck state") + line("choice=${BootMovie.choice(context)} saved choice=${SessionPrefs.bootMovie(context)} pending pick=${SessionPrefs.bootMovieApplyNext(context)}") + line("last Steam path seen=${SessionPrefs.bootMovieSteamSeen(context)}") + line("sound=${SessionPrefs.bootMovieSound(context)} volume=${SessionPrefs.bootMovieVolume(context)} seconds=${SessionPrefs.bootMovieSeconds(context)}") + line("session running=${SessionState.running}") + line() + line("== The movie list as shown") + BootMovieLibrary.list(context).forEach { line("${it.id} title=${it.title} source=${it.source} removable=${it.removable} file=${it.file?.path}") } + line() + line("== DroidDeck folders") + listing("library", BootMovieLibrary.libraryDir(context)) + listing("processed copies", File(context.filesDir, "boot-movie/variants")) + val meta = File(context.filesDir, "boot-movie/movies.json") + line("-- movie list file: ${if (meta.isFile) meta.readText().take(8000) else "(missing)"}") + + val roots = BootMovieLibrary.steamRoots(context) + val movieIds = HashSet() + for (root in roots) { + line() + line("== Steam folder ${root.path}") + val config = File(root, "config/config.vdf") + line("config.vdf: ${if (config.isFile) describe(config) else "(missing)"}") + val text = runCatching { config.readText() }.getOrNull() + if (text != null) { + line("-- StartupMovie block:") + (SessionFiles.startupMovieBlock(config) ?: " (none)").lines().forEach { line(" $it") } + line("-- Customization section with the lines before it:") + (SessionFiles.customizationBlock(config) ?: " (none)").lines().forEach { line(" $it") } + line("-- every line of config.vdf that mentions a movie:") + text.lines().filter { it.contains("movie", ignoreCase = true) }.take(40).forEach { line(" ${it.trim()}") } + Regex("\"MovieID\"\\s+\"([^\"]*)\"").find(text)?.groupValues?.get(1)?.takeIf { it.isNotEmpty() && it != "0" }?.let { movieIds.add(it) } + } + listing("custom movies", File(root, "config/uioverrides/movies")) + listing("Steam's own movies", File(root, "steamui/movies")) + listing("config/movies", File(root, "config/movies")) + line("-- every .webm below config, userdata, appcache and steamui:") + var shown = 0 + for (top in listOf("config", "userdata", "appcache", "steamui")) { + val base = File(root, top) + if (!base.isDirectory) continue + for (file in base.walkTopDown().maxDepth(8).onEnter { it.name !in SKIPPED }) { + if (!file.isFile || !file.name.endsWith(".webm", ignoreCase = true)) continue + if (shown++ >= 300) break + line(" " + describe(file)) + Regex("^(\\d+)_[0-9a-fA-F]+").find(file.name)?.groupValues?.get(1)?.let { movieIds.add(it) } + } + } + } + + line() + line("== Where Steam keeps movie names (text found in Steam's files)") + val needles = (KNOWN_TITLES + movieIds).distinct() + line("looking for: ${needles.joinToString(", ")}") + search(roots, needles) { line(" $it") } + + line() + line("== What each session start did to Steam's config (latest last)") + val trace = traceFile(context) + if (trace.isFile) trace.readLines().forEach { line(" $it") } else line(" (nothing yet: start a session after picking a movie)") + return out.toString() + } + + private fun search(roots: List, needles: List, report: (String) -> Unit) { + if (needles.isEmpty()) return + val deadline = System.currentTimeMillis() + 25_000L + var scanned = 0 + var hits = 0 + outer@ for (root in roots) { + for (top in listOf("config", "userdata", "appcache", "steamui")) { + val base = File(root, top) + if (!base.isDirectory) continue + for (file in base.walkTopDown().maxDepth(8).onEnter { it.name !in SKIPPED }) { + if (!file.isFile || file.length() > (2L shl 20) || file.extension.lowercase() in BINARY) continue + if (++scanned > 20_000 || System.currentTimeMillis() > deadline || hits >= MAX_HITS) break@outer + val text = runCatching { String(file.readBytes(), Charsets.ISO_8859_1) }.getOrNull() ?: continue + for (needle in needles) { + val at = text.indexOf(needle) + if (at < 0) continue + hits++ + val around = text.substring((at - 60).coerceAtLeast(0), (at + needle.length + 100).coerceAtMost(text.length)) + report("$needle in ${file.path}: " + around.map { if (it in ' '..'~') it else '.' }.joinToString("")) + } + } + } + } + report("(searched $scanned files, $hits matches)") + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/session/BootMovieTranscoder.kt b/app/src/main/java/com/droiddeck/launcher/session/BootMovieTranscoder.kt index ff1275d851..92bbbae4e2 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/BootMovieTranscoder.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/BootMovieTranscoder.kt @@ -37,15 +37,77 @@ internal object BootMovieTranscoder { MediaCodecList(MediaCodecList.REGULAR_CODECS).findDecoderForFormat(format) != null }.getOrDefault(false) - fun transcode(source: File, target: File, keepAudio: Boolean = true, onProgress: (Int) -> Unit): Result? { + fun transcode(source: File, target: File, keepAudio: Boolean = true, limitUs: Long = Long.MAX_VALUE, gain: Float = 1f, onProgress: (Int) -> Unit): Result? { val hadAudio = keepAudio && trackFormat(source, "audio/") != null - val audio = if (hadAudio) runCatching { encodeAudio(source) } + val audio = if (hadAudio) runCatching { encodeAudio(source, gain, limitUs) } .onFailure { Log.w(TAG, "could not convert the audio of ${source.name}", it) }.getOrNull() else null - val muxedAudio = runCatching { encodeVideo(source, target, audio, onProgress) } + val muxedAudio = runCatching { encodeVideo(source, target, audio, limitUs, onProgress) } .onFailure { Log.w(TAG, "could not convert ${source.name}", it) }.getOrNull() ?: return null return Result(audioDropped = hadAudio && !muxedAudio) } + /** Copies the video of [source] untouched and gives it its sound again at [gain] of its level, cut to [limitUs]. */ + fun regain(source: File, target: File, gain: Float, limitUs: Long): Boolean { + val audio = runCatching { encodeAudio(source, gain, limitUs) } + .onFailure { Log.w(TAG, "could not change the volume of ${source.name}", it) }.getOrNull() ?: return false + val extractor = MediaExtractor() + var muxer: MediaMuxer? = null + val staged = File(target.parentFile, target.name + ".regain") + return try { + extractor.setDataSource(source.path) + var videoTrack = -1 + var videoFormat: MediaFormat? = null + for (i in 0 until extractor.trackCount) { + val format = extractor.getTrackFormat(i) + val mime = format.getString(MediaFormat.KEY_MIME) ?: continue + if (videoTrack < 0 && (mime == MediaFormat.MIMETYPE_VIDEO_VP8 || mime == MediaFormat.MIMETYPE_VIDEO_VP9)) { + videoTrack = i + videoFormat = format + } + } + if (videoTrack < 0 || videoFormat == null) return false + extractor.selectTrack(videoTrack) + val mux = MediaMuxer(staged.path, MediaMuxer.OutputFormat.MUXER_OUTPUT_WEBM).also { muxer = it } + val outVideo = mux.addTrack(videoFormat) + val outAudio = mux.addTrack(audio.format) + mux.start() + val info = MediaCodec.BufferInfo() + var audioIndex = 0 + fun writeAudioUpTo(timeUs: Long) { + while (audioIndex < audio.samples.size && audio.samples[audioIndex].timeUs <= timeUs) { + val sample = audio.samples[audioIndex++] + info.set(0, sample.data.size, sample.timeUs, 0) + mux.writeSampleData(outAudio, ByteBuffer.wrap(sample.data), info) + } + } + var bufferSize = 8 shl 20 + if (videoFormat.containsKey(MediaFormat.KEY_MAX_INPUT_SIZE)) bufferSize = maxOf(bufferSize, videoFormat.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE)) + val buffer = ByteBuffer.allocate(bufferSize) + while (true) { + val size = extractor.readSampleData(buffer, 0) + if (size < 0 || extractor.sampleTime > limitUs) break + val time = extractor.sampleTime + writeAudioUpTo(time) + val key = extractor.sampleFlags and MediaExtractor.SAMPLE_FLAG_SYNC != 0 + info.set(0, size, time, if (key) MediaCodec.BUFFER_FLAG_KEY_FRAME else 0) + mux.writeSampleData(outVideo, buffer, info) + extractor.advance() + } + writeAudioUpTo(Long.MAX_VALUE) + mux.stop() + mux.release() + muxer = null + staged.renameTo(target) + } catch (e: Exception) { + Log.w(TAG, "could not change the volume of ${source.name}", e) + false + } finally { + runCatching { muxer?.release() } + extractor.release() + staged.delete() + } + } + private fun trackFormat(source: File, prefix: String): Pair? { val extractor = MediaExtractor() return try { @@ -75,6 +137,14 @@ internal object BootMovieTranscoder { return Layout(canvas, ch, (canvas - cw) / 2, 0, cw, ch) } + /** [pcm] made quieter by [gain] and cut to its first [limitUs] microseconds. */ + internal fun scale(pcm: ShortArray, channels: Int, gain: Float, limitUs: Long): ShortArray { + val frames = pcm.size / channels + val kept = if (limitUs == Long.MAX_VALUE) frames else minOf(frames.toLong(), limitUs * OPUS_RATE / 1_000_000L).toInt() + if (gain == 1f && kept == frames) return pcm + return ShortArray(kept * channels) { (pcm[it] * gain).toInt().coerceIn(Short.MIN_VALUE.toInt(), Short.MAX_VALUE.toInt()).toShort() } + } + internal fun resample(pcm: ShortArray, channels: Int, rate: Int): ShortArray { if (rate == OPUS_RATE) return pcm val frames = pcm.size / channels @@ -94,7 +164,10 @@ internal object BootMovieTranscoder { return out } - private fun encodeAudio(source: File): Audio? { + /** Most decoded audio held in memory at once: about six minutes of 48 kHz stereo. */ + private const val MAX_PCM_BYTES = 64 shl 20 + + private fun encodeAudio(source: File, gain: Float = 1f, limitUs: Long = Long.MAX_VALUE): Audio? { val (track, inFormat) = trackFormat(source, "audio/") ?: return null val extractor = MediaExtractor() var decoder: MediaCodec? = null @@ -139,13 +212,16 @@ internal object BootMovieTranscoder { } dec.releaseOutputBuffer(index, false) if (info.flags and MediaCodec.BUFFER_FLAG_END_OF_STREAM != 0) break + // Past the length that will be kept there is nothing more to decode; without a length, a track too big to hold is dropped. + if (limitUs != Long.MAX_VALUE && info.presentationTimeUs > limitUs) break + if (pcm.size() > MAX_PCM_BYTES) { if (limitUs == Long.MAX_VALUE) return null else break } } } if (channels !in 1..2) return null val raw = pcm.toByteArray() val shorts = ShortArray(raw.size / 2) ByteBuffer.wrap(raw).order(ByteOrder.nativeOrder()).asShortBuffer().get(shorts) - val samples = resample(shorts, channels, rate) + val samples = scale(resample(shorts, channels, rate), channels, gain, limitUs) val format = MediaFormat.createAudioFormat(MediaFormat.MIMETYPE_AUDIO_OPUS, OPUS_RATE, channels) format.setInteger(MediaFormat.KEY_BIT_RATE, 128_000) @@ -201,7 +277,7 @@ internal object BootMovieTranscoder { private fun MediaFormat.intOrNull(key: String): Int? = if (!containsKey(key)) null else runCatching { getInteger(key) }.getOrElse { runCatching { getFloat(key).toInt() }.getOrNull() } - private fun encodeVideo(source: File, target: File, audio: Audio?, onProgress: (Int) -> Unit): Boolean { + private fun encodeVideo(source: File, target: File, audio: Audio?, limitUs: Long, onProgress: (Int) -> Unit): Boolean { val (track, inFormat) = trackFormat(source, "video/") ?: throw IllegalStateException("no video track") val rotation = (inFormat.intOrNull(MediaFormat.KEY_ROTATION) ?: 0).mod(360) val layout = layout(inFormat.getInteger(MediaFormat.KEY_WIDTH), inFormat.getInteger(MediaFormat.KEY_HEIGHT), rotation) @@ -278,7 +354,8 @@ internal object BootMovieTranscoder { val index = dec.dequeueOutputBuffer(decInfo, TIMEOUT_US) if (index >= 0) { val timeUs = decInfo.presentationTimeUs - val keep = decInfo.size > 0 && (lastKept == Long.MIN_VALUE || timeUs - lastKept >= minIntervalUs) + val pastLimit = timeUs > limitUs + val keep = decInfo.size > 0 && !pastLimit && (lastKept == Long.MIN_VALUE || timeUs - lastKept >= minIntervalUs) dec.releaseOutputBuffer(index, keep) if (keep) { if (!frames.awaitFrame()) throw IllegalStateException("decoder frame timed out") @@ -290,9 +367,10 @@ internal object BootMovieTranscoder { if (percent != lastProgress) { lastProgress = percent; onProgress(percent) } } } - if (decInfo.flags and MediaCodec.BUFFER_FLAG_END_OF_STREAM != 0) { + if (pastLimit || decInfo.flags and MediaCodec.BUFFER_FLAG_END_OF_STREAM != 0) { enc.signalEndOfInputStream() decoderDone = true + inputDone = true } } } diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt index 86da51e436..3b0af016dc 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt @@ -28,7 +28,8 @@ object SessionFiles { "etc/xdg/autostart/droiddeck-clipboard.desktop" to "etc/xdg/autostart/droiddeck-clipboard.desktop", ) - fun stage(context: Context, root: File) { + /** Puts the session's files in place; [startsSession] is true only for the call that starts the Steam session. */ + fun stage(context: Context, root: File, startsSession: Boolean = false) { if (DesktopCatalog.desktopInstalled(root)) try { DesktopCatalog.cleanLegacy(context) } catch (e: Exception) { Log.w(TAG, "LXQt cleanup will retry next session", e) } GameEnvironmentStore.publish(context) @@ -208,18 +209,72 @@ object SessionFiles { Log.e(TAG, "could not write steam-compatibility-label") } + BootMovie.syncFromSteam(context) val startupMovie = BootMovie.prepare(context) - // The x86-64 client's config is left alone until its first start creates it. - val steamRoots = listOf(File(root, "root/.local/share/Steam"), File(root, "root/.droiddeck-x64/.local/share/Steam")) - .filterIndexed { i, steam -> i == 0 || File(steam, "config").isDirectory } - for (steam in steamRoots) { - val startupMovieDir = File(steam, "config/uioverrides/movies") - val bigPictureMovieInstalled = startupMovie != null && - stageStartupMovie(startupMovie, startupMovieDir, "bigpicture_startup.webm") - if (startupMovie != null) stageStartupMovie(startupMovie, startupMovieDir, "steam_os_startup.webm") - if (bigPictureMovieInstalled) { - ensureStartupMovieDefault(File(steam, "config/config.vdf")) + val force = SessionPrefs.bootMovieApplyNext(context) + val steamHomes = listOf(File(root, "root/.local/share/Steam")) + + listOf(File(root, "root/.droiddeck-x64/.local/share/Steam")).filter { File(it, "config").isDirectory } + var allDone = true + var allInstalled = true + var seen: String? = null + val activeIsX64 = SessionPrefs.activeSteamClientArch(context) == "x86_64" + for (home in steamHomes) { + val movieDir = File(home, "config/uioverrides/movies") + val config = File(home, "config/config.vdf") + if (startupMovie == null) { + // Nothing to play (a movie whose volume could not be set is never played at another volume), so no earlier copy plays either. + for (name in listOf("bigpicture_startup.webm", "steam_os_startup.webm")) { + File(movieDir, name).delete() + File(movieDir, ".$name.source").delete() + } } + val bigPictureMovieInstalled = startupMovie != null && stageStartupMovie(startupMovie, movieDir, "bigpicture_startup.webm") + if (startupMovie != null) stageStartupMovie(startupMovie, movieDir, "steam_os_startup.webm") + val before = startupMoviePath(config) + val done = if (bigPictureMovieInstalled) ensureStartupMovieDefault(config, force) else resetMissingStartupMovie(config, force) + BootMovieReport.note( + context, + "stage session=$startsSession pending=$force choice=${SessionPrefs.bootMovie(context)} movie=${startupMovie?.path} " + + "staged=$bigPictureMovieInstalled done=$done steam=${home.path} config: $before -> ${startupMoviePath(config)}", + ) + if (!done) allDone = false + if (!bigPictureMovieInstalled) allInstalled = false + if (done && home.path.contains(".droiddeck-x64") == activeIsX64) seen = if (bigPictureMovieInstalled) BOOT_MOVIE_PATH else "" + } + // A pick made in the app is done once a session started with every Steam client's config having it; guest commands run + // before that, and a Steam that is already running writes its own choice back when it exits. + if (force && allDone && allInstalled && startsSession) SessionPrefs.setBootMovieApplyNext(context, false) + seen?.let { SessionPrefs.setBootMovieSteamSeen(context, it) } + } + + /** + * Points Steam's startup movie back at its own default when it names a movie that is gone: DroidDeck's staged copy that + * could not be prepared, or (when a pick here is waiting) a movie removed from Steam's folder. True when Steam's config + * no longer names a missing movie. + */ + internal fun resetMissingStartupMovie(config: File, force: Boolean): Boolean { + if (!config.isFile) return true + val text = runCatching { config.readText() }.getOrElse { + Log.w(TAG, "could not read Steam config to reset the startup movie", it) + return false + } + val movie = activeStartupMovie(text) ?: return true + val block = text.substring(movie.keyStart, movie.close + 1) + val path = scalar(block, "LocalPath").orEmpty() + if (path.isEmpty()) return true + val missing = File(config.parentFile, "uioverrides/movies/" + path.removePrefix(BOOT_MOVIES_DIR)) + val gone = path.startsWith(BOOT_MOVIES_DIR) && !missing.isFile && (force || path == BOOT_MOVIE_PATH) + if (!gone) return false + val newline = if (text.contains("\r\n")) "\r\n" else "\n" + val updated = setScalar(setScalar(block, "MovieID", "0", newline), "LocalPath", "", newline) + val staged = File(config.parentFile, config.name + ".staged") + return try { + staged.writeText(text.replaceRange(movie.keyStart, movie.close + 1, updated)) + (staged.renameTo(config)).also { if (!it) staged.delete() } + } catch (e: Exception) { + staged.delete() + Log.w(TAG, "could not reset Steam startup movie selection", e) + false } } @@ -273,7 +328,11 @@ object SessionFiles { staged.outputStream().use { output -> FileUtils.copy(input, output) } } installed = staged.setReadable(true, false) && staged.renameTo(movie) - if (installed) FileUtils.writeString(stamp, identity) + if (installed) { + FileUtils.writeString(stamp, identity) + // Steam's picker draws its preview from this picture and does not redraw it when the movie changes. + File(directory, name.removeSuffix(".webm") + ".jpg").delete() + } } catch (e: Exception) { Log.w(TAG, "could not stage Steam startup movie $name", e) } finally { @@ -285,43 +344,108 @@ object SessionFiles { private data class VdfBlock(val keyStart: Int, val open: Int, val close: Int) - private fun ensureStartupMovieDefault(config: File) { - val path = "/uioverrides/movies/bigpicture_startup.webm" + internal const val BOOT_MOVIES_DIR = "/uioverrides/movies/" + internal const val BOOT_MOVIE_PATH = "/uioverrides/movies/bigpicture_startup.webm" + + /** + * Steam's startup movie setting is the `StartupMovie` section inside its `Customization` section; the one under the Steam + * settings is where older clients kept it, and DroidDeck still keeps it in step. + */ + private fun customizationMovie(text: String): VdfBlock? { + var from = 0 + while (true) { + val customization = findObject(text, "Customization", from, text.length) ?: return null + findObject(text, "StartupMovie", customization.open + 1, customization.close)?.let { return it } + from = customization.close + 1 + } + } + + /** The older `StartupMovie` section: the first one that is not inside `Customization`. */ + private fun olderMovie(text: String): VdfBlock? { + val inside = customizationMovie(text) + var from = 0 + while (true) { + val movie = findObject(text, "StartupMovie", from, text.length) ?: return null + if (inside == null || movie.keyStart != inside.keyStart) return movie + from = movie.close + 1 + } + } + + /** The section Steam reads: the one under `Customization` when there is one. */ + private fun activeStartupMovie(text: String): VdfBlock? = customizationMovie(text) ?: olderMovie(text) + + /** The movie Steam's config selects, as a path like `/uioverrides/movies/x.webm`; null when none is named. */ + internal fun startupMoviePath(config: File): String? { + val text = runCatching { config.readText() }.getOrNull() ?: return null + val movie = activeStartupMovie(text) ?: return null + return scalar(text.substring(movie.keyStart, movie.close + 1), "LocalPath")?.takeIf { it.isNotEmpty() } + } + + /** Both `StartupMovie` sections of Steam's config as written there, for the report; null when there is none. */ + internal fun startupMovieBlock(config: File): String? { + val text = runCatching { config.readText() }.getOrNull() ?: return null + val parts = listOfNotNull( + customizationMovie(text)?.let { "under Customization:\n" + text.substring(it.keyStart, it.close + 1) }, + olderMovie(text)?.let { "older place:\n" + text.substring(it.keyStart, it.close + 1) }, + ) + return parts.takeIf { it.isNotEmpty() }?.joinToString("\n") + } + + /** The `Customization` section of Steam's config with the lines before it, for the report; null when there is none. */ + internal fun customizationBlock(config: File): String? { + val text = runCatching { config.readText() }.getOrNull() ?: return null + val customization = findObject(text, "Customization", 0, text.length) ?: return null + val before = text.substring(0, customization.keyStart).lines().takeLast(4).joinToString("\n") + return (before + "\n" + text.substring(customization.keyStart, customization.close + 1)).take(4000) + } + + private fun pointAt(text: String, movie: VdfBlock, path: String, newline: String): String { + val block = text.substring(movie.keyStart, movie.close + 1) + return text.replaceRange(movie.keyStart, movie.close + 1, setScalar(setScalar(block, "MovieID", "0", newline), "LocalPath", path, newline)) + } + + /** True when Steam's config selects DroidDeck's staged movie once this returns. */ + internal fun ensureStartupMovieDefault(config: File, force: Boolean = false): Boolean { + val path = BOOT_MOVIE_PATH val legacyPath = "/uioverrides/movies/droiddeck-startup.webm" var text = if (config.isFile) runCatching { config.readText() }.getOrElse { Log.w(TAG, "could not read Steam config for startup movie", it) - return + return false } else "" val newline = if (text.contains("\r\n")) "\r\n" else "\n" - val movie = findObject(text, "StartupMovie", 0, text.length) - if (movie != null) { - val block = text.substring(movie.keyStart, movie.close + 1) + val custom = customizationMovie(text) + val active = custom ?: olderMovie(text) + if (active != null) { + val block = text.substring(active.keyStart, active.close + 1) val selectedId = scalar(block, "MovieID") val selectedPath = scalar(block, "LocalPath") - if (selectedPath == path) { + if (selectedPath == path && custom != null) { Log.i(TAG, "Steam startup movie is set to DroidDeck") - return + return true } val legacyDefault = selectedId == "0" && selectedPath == legacyPath val hasExplicitSelection = (!selectedId.isNullOrEmpty() && selectedId != "0") || !selectedPath.isNullOrEmpty() - if (!legacyDefault && hasExplicitSelection) { + if (!force && !legacyDefault && hasExplicitSelection && selectedPath != path) { Log.i(TAG, "Steam startup movie selection preserved") - return + return false } - val updated = setScalar(block, "MovieID", "0", newline) - .let { setScalar(it, "LocalPath", path, newline) } - text = text.replaceRange(movie.keyStart, movie.close + 1, updated) - } else { + } + // Later sections first, so the positions of earlier ones stay valid. + val targets = listOfNotNull(customizationMovie(text), olderMovie(text)).sortedByDescending { it.keyStart } + for (target in targets) text = pointAt(text, target, path, newline) + if (olderMovie(text) == null) { val steam = findSteamBlock(text) if (steam == null) { - if (text.isNotBlank()) { + if (text.isNotBlank() && customizationMovie(text) == null) { Log.w(TAG, "Steam config has no Steam settings block; startup movie default not set") - return + return false + } + if (text.isBlank()) { + text = "\"InstallConfigStore\"${newline}{${newline}\t\"Software\"${newline}\t{${newline}\t\t\"Valve\"${newline}\t\t{${newline}\t\t\t\"Steam\"${newline}\t\t\t{${newline}" + val section = startupMovieSection("\t\t\t\t", path, newline) + text += section + newline + "\t\t\t}" + newline + "\t\t}" + newline + "\t}" + newline + "}" } - text = "\"InstallConfigStore\"${newline}{${newline}\t\"Software\"${newline}\t{${newline}\t\t\"Valve\"${newline}\t\t{${newline}\t\t\t\"Steam\"${newline}\t\t\t{${newline}" - val section = startupMovieSection("\t\t\t\t", path, newline) - text += section + newline + "\t\t\t}" + newline + "\t\t}" + newline + "\t}" + newline + "}" } else { val lineStart = text.lastIndexOf('\n', steam.close).let { if (it < 0) 0 else it + 1 } val indent = text.substring(lineStart, steam.close).takeWhile { it == '\t' || it == ' ' } @@ -329,22 +453,35 @@ object SessionFiles { text = text.substring(0, lineStart) + section + newline + indent + text.substring(lineStart) } } + if (customizationMovie(text) == null) text = withCustomization(text, path, newline) val staged = File(config.parentFile, config.name + ".staged") - try { + return try { config.parentFile?.mkdirs() staged.writeText(text) if (!staged.renameTo(config)) { staged.delete() Log.e(TAG, "could not write Steam startup movie selection") + false } else { Log.i(TAG, "Steam startup movie default selected") + true } } catch (e: Exception) { staged.delete() Log.w(TAG, "could not write Steam startup movie selection", e) + false } } + /** Adds the `Customization` section Steam reads, next to the `Software` section, when the config has none. */ + private fun withCustomization(text: String, path: String, newline: String): String { + val root = findObject(text, "InstallConfigStore", 0, text.length) ?: return text + val lineStart = text.lastIndexOf('\n', root.close).let { if (it < 0) 0 else it + 1 } + val indent = text.substring(lineStart, root.close).takeWhile { it == '\t' || it == ' ' } + val section = listOf(indent + "\t\"Customization\"", indent + "\t{", startupMovieSection(indent + "\t\t", path, newline), indent + "\t}").joinToString(newline) + return text.substring(0, lineStart) + section + newline + text.substring(lineStart) + } + private fun findSteamBlock(text: String): VdfBlock? { val install = findObject(text, "InstallConfigStore", 0, text.length) ?: return null val software = findObject(text, "Software", install.open + 1, install.close) ?: return null diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt index 3cf155ccb7..25be1b42fc 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt @@ -528,6 +528,17 @@ object SessionPrefs { fun setBootMovie(context: Context, id: String) { prefs(context).edit().putString("bootMovie", id).apply() } fun bootMovieSound(context: Context): Boolean = prefs(context).getBoolean("bootMovieSound", true) fun setBootMovieSound(context: Context, on: Boolean) { prefs(context).edit().putBoolean("bootMovieSound", on).apply() } + fun bootMovieVolume(context: Context): Int = prefs(context).getInt("bootMovieVolume", 100).coerceIn(0, 100) + fun setBootMovieVolume(context: Context, percent: Int) { prefs(context).edit().putInt("bootMovieVolume", percent.coerceIn(0, 100)).apply() } + /** How long the boot movie plays, in seconds; 0 plays all of it. */ + fun bootMovieSeconds(context: Context): Int = prefs(context).getInt("bootMovieSeconds", 0).coerceAtLeast(0) + fun setBootMovieSeconds(context: Context, seconds: Int) { prefs(context).edit().putInt("bootMovieSeconds", seconds.coerceAtLeast(0)).apply() } + /** Set when a movie was picked here, so the next session makes it Steam's startup movie even if Steam had another one. */ + fun bootMovieApplyNext(context: Context): Boolean = prefs(context).getBoolean("bootMovieApplyNext", false) + fun setBootMovieApplyNext(context: Context, on: Boolean) { prefs(context).edit().putBoolean("bootMovieApplyNext", on).apply() } + /** The startup movie path Steam's config held when it was last looked at, so only a change made in Steam is taken over. */ + fun bootMovieSteamSeen(context: Context): String? = prefs(context).getString("bootMovieSteamSeen", null) + fun setBootMovieSteamSeen(context: Context, path: String) { prefs(context).edit().putString("bootMovieSteamSeen", path).apply() } fun bootMovieCustomName(context: Context): String? = prefs(context).getString("bootMovieCustomName", null) fun setBootMovieCustomName(context: Context, name: String?) { prefs(context).edit().apply { if (name == null) remove("bootMovieCustomName") else putString("bootMovieCustomName", name) }.apply() diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt index d6825e7000..0cfc0a3011 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt @@ -319,7 +319,7 @@ class SessionService : Service() { val sessionRoot = LinuxRuntime.sessionRoot(this).apply { mkdirs() } val runtimeDir = File(filesDir, ".wayland-rt").apply { mkdirs() } killStragglers() - SessionFiles.stage(this, root) + SessionFiles.stage(this, root, startsSession = true) // Earlier sessions' reports still read the Steam logs and VAC marker this session replaces. SessionArtifacts.awaitCollections() SessionArtifacts.finishAbandoned(this) diff --git a/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt b/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt index f5304ed1ea..78bbc89cd6 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt @@ -21,7 +21,8 @@ object SettingsReset { "noXalia", "fastSync", "fsyncFirst", "syncFallback", "prootNoSeccomp", "prootFastPath", "guestHostname", "fexPreset", "forceSsbs", "logs", "storageDiagnostics", "upscaler", "upscaleSharpness", "screenEffects", "textureAnisotropy", "textureLodBias", - "steamDownloadsInBackground", "steam_offline", "bootMovie", "bootMovieSound", + "steamDownloadsInBackground", "steam_offline", "bootMovie", "bootMovieSound", "bootMovieVolume", "bootMovieSeconds", + "bootMovieApplyNext", "bootMovieSteamSeen", "questDefaultsV1", ) diff --git a/app/src/main/java/com/droiddeck/launcher/session/SteamDeckRepo.kt b/app/src/main/java/com/droiddeck/launcher/session/SteamDeckRepo.kt new file mode 100644 index 0000000000..2a940a96f4 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/session/SteamDeckRepo.kt @@ -0,0 +1,218 @@ +package com.droiddeck.launcher.session + +import android.util.Log +import org.json.JSONObject +import java.io.File +import java.net.HttpURLConnection +import java.net.URL +import java.net.URLEncoder + +/** steamdeckrepo.com's public boot video list, the same one its website and its own manager app read. */ +object SteamDeckRepo { + private const val TAG = "SteamDeckRepo" + const val BASE = "https://steamdeckrepo.com" + + /** The site shows twelve movies a page. */ + const val PAGE_SIZE = 12 + const val MAX_DOWNLOAD_BYTES = 120L shl 20 + private const val MAX_JSON_BYTES = 1 shl 20 + private const val USER_AGENT = "DroidDeck (+https://github.com/Droid-Deck/DroidDeck)" + private const val CACHE_MS = 10 * 60 * 1000L + + enum class Sort(val key: String) { + TRENDING("trending"), DOWNLOADS("downloads-desc"), LIKES("likes-desc"), NEWEST("created_at-desc"), + } + + /** `null` is every device. */ + val DEVICES = listOf("steam_deck", "steam_machine") + + class Post( + val id: String, val title: String, val content: String, val author: String, val thumbnail: String, val video: String, + val seconds: Int, val likes: Int, val downloads: Int, val devices: List, val url: String, + ) + + sealed class Page { + class Ok(val posts: List) : Page() + object Failed : Page() + } + + /** The text of [key], empty when it is missing or JSON null, which `optString` would turn into the word "null". */ + private fun JSONObject.text(key: String): String = if (isNull(key)) "" else optString(key) + + fun parse(json: String): List? { + val array = runCatching { JSONObject(json).optJSONArray("posts") }.getOrNull() ?: return null + val out = ArrayList() + for (i in 0 until array.length()) { + val o = array.optJSONObject(i) ?: continue + val id = o.text("id") + val video = o.text("video") + if (id.isEmpty() || !video.startsWith("https://")) continue + val devices = o.optJSONArray("devices")?.let { d -> (0 until d.length()).map { d.optString(it) } }.orEmpty() + out.add( + Post( + id = id, title = o.text("title").ifBlank { id }, content = o.text("content"), + author = o.optJSONObject("user")?.text("steam_name").orEmpty(), + thumbnail = o.text("thumbnail").takeIf { it.startsWith("https://") }.orEmpty(), video = video, + seconds = o.optInt("video_duration"), likes = o.optInt("likes"), downloads = o.optInt("downloads"), + devices = devices, url = o.text("url"), + ), + ) + } + return out + } + + fun url(sort: Sort, device: String?, search: String, page: Int = 1): String { + val query = StringBuilder("sort=").append(sort.key) + if (device != null) query.append("&device=").append(URLEncoder.encode(device, "UTF-8")) + val term = search.trim() + if (term.isNotEmpty()) query.append("&search=").append(URLEncoder.encode(term, "UTF-8").replace("+", "%20")) + if (page > 1) query.append("&page=").append(page) + return "$BASE/api/posts?$query" + } + + private class Cached(val at: Long, val page: Page.Ok) + private val cache = HashMap() + + fun fetch(sort: Sort, device: String?, search: String, page: Int = 1, now: Long = System.currentTimeMillis()): Page { + val url = url(sort, device, search, page) + synchronized(cache) { cache[url]?.takeIf { now - it.at < CACHE_MS }?.let { return it.page } } + val body = get(url) ?: return Page.Failed + val posts = parse(body) ?: return Page.Failed + val result = Page.Ok(posts.take(PAGE_SIZE)) + synchronized(cache) { cache[url] = Cached(now, result) } + return result + } + + /** + * The number of the last page for a search, found by asking for pages: the site does not say how many there are, but a + * page past the end is empty and the last one is short. Null when the site cannot be reached. + */ + fun lastPage(sort: Sort, device: String?, search: String, cap: Int = 512, count: (Int) -> Int? = { p -> + (fetch(sort, device, search, p) as? Page.Ok)?.posts?.size + }): Int? { + val first = count(1) ?: return null + if (first < PAGE_SIZE) return 1 + var good = 1 + var bad = -1 + var probe = 2 + while (probe <= cap) { + val n = count(probe) ?: return null + if (n == 0) { bad = probe; break } + if (n < PAGE_SIZE) return probe + good = probe + probe *= 2 + } + if (bad < 0) return good + while (bad - good > 1) { + val mid = (good + bad) / 2 + val n = count(mid) ?: return null + if (n == 0) bad = mid else if (n < PAGE_SIZE) return mid else good = mid + } + return good + } + + /** Reads [input] to its end, or null as soon as it holds more than [limit] bytes, so a huge answer is never kept whole. */ + internal fun readLimited(input: java.io.InputStream, limit: Int): ByteArray? { + val out = java.io.ByteArrayOutputStream() + val buffer = ByteArray(16 * 1024) + while (true) { + val n = input.read(buffer) + if (n < 0) break + if (out.size() + n > limit) return null + out.write(buffer, 0, n) + } + return out.toByteArray() + } + + private fun get(url: String): String? { + var connection: HttpURLConnection? = null + return try { + connection = (URL(url).openConnection() as HttpURLConnection).apply { + connectTimeout = 15_000 + readTimeout = 20_000 + setRequestProperty("User-Agent", USER_AGENT) + setRequestProperty("Accept", "application/json") + } + if (connection.responseCode !in 200..299) null else connection.inputStream.use { readLimited(it, MAX_JSON_BYTES)?.toString(Charsets.UTF_8) } + } catch (e: Exception) { + Log.w(TAG, "request failed: ${e.javaClass.simpleName}") + null + } finally { + runCatching { connection?.disconnect() } + } + } + + /** Fetches a small picture such as a cover; null when it cannot be had. */ + fun bytes(url: String, limit: Int = 4 shl 20): ByteArray? { + if (!url.startsWith("https://")) return null + var connection: HttpURLConnection? = null + return try { + connection = (URL(url).openConnection() as HttpURLConnection).apply { + connectTimeout = 15_000 + readTimeout = 20_000 + setRequestProperty("User-Agent", USER_AGENT) + } + if (connection.responseCode !in 200..299 || connection.contentLengthLong > limit) null + else connection.inputStream.use { input -> readLimited(input, limit)?.takeIf { it.isNotEmpty() } } + } catch (e: Exception) { + null + } finally { + runCatching { connection?.disconnect() } + } + } + + /** + * Downloads a movie to [target] through the site's own download address, so the site counts it like a download from + * its website, and falls back to the video's address. True when a file was saved. + */ + fun download(post: Post, target: File, onProgress: (Int) -> Unit = {}): Boolean { + for (url in listOf("$BASE/post/download/${post.id}", post.video)) { + if (save(url, target, onProgress)) return true + } + return false + } + + private fun save(url: String, target: File, onProgress: (Int) -> Unit): Boolean { + var connection: HttpURLConnection? = null + val staged = File(target.parentFile, target.name + ".part") + return try { + target.parentFile?.mkdirs() + connection = (URL(url).openConnection() as HttpURLConnection).apply { + connectTimeout = 15_000 + readTimeout = 30_000 + instanceFollowRedirects = true + setRequestProperty("User-Agent", USER_AGENT) + } + if (connection.responseCode !in 200..299) return false + val type = connection.contentType.orEmpty().lowercase() + if (type.startsWith("text/") || type.contains("json")) return false + val total = connection.contentLengthLong + if (total > MAX_DOWNLOAD_BYTES) return false + var done = 0L + var lastPercent = -1 + connection.inputStream.use { input -> + staged.outputStream().use { output -> + val buffer = ByteArray(64 * 1024) + while (true) { + val n = input.read(buffer) + if (n < 0) break + done += n + if (done > MAX_DOWNLOAD_BYTES) return false + output.write(buffer, 0, n) + if (total > 0) { + val percent = (done * 100 / total).toInt() + if (percent != lastPercent) { lastPercent = percent; onProgress(percent) } + } + } + } + } + done > 0 && (total <= 0 || done == total) && staged.renameTo(target) + } catch (e: Exception) { + Log.w(TAG, "download failed: ${e.javaClass.simpleName}") + false + } finally { + runCatching { connection?.disconnect() } + staged.delete() + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AddAppDialog.kt b/app/src/main/java/com/droiddeck/launcher/ui/AddAppDialog.kt index bc9618c965..ccd7fd05e3 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/AddAppDialog.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/AddAppDialog.kt @@ -305,6 +305,7 @@ internal fun AppDialog( modifier: Modifier = Modifier, maxWidth: Dp? = null, width: Dp? = null, fitContent: Boolean = false, back: (() -> Unit)? = null, + scrollable: Boolean = true, content: @Composable ColumnScope.() -> Unit, ) { val pal = LocalPalette.current @@ -342,7 +343,7 @@ internal fun AppDialog( .clickable(interactionSource = remember { MutableInteractionSource() }, indication = null) {} .controllerBack(back ?: close) .then(modifier) - .verticalScroll(rememberScrollState()) + .then(if (scrollable) Modifier.verticalScroll(rememberScrollState()) else Modifier) .padding(horizontal = 18.dp, vertical = 16.dp), content = content, ) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BootMovieSection.kt b/app/src/main/java/com/droiddeck/launcher/ui/BootMovieSection.kt new file mode 100644 index 0000000000..3878d274b6 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/BootMovieSection.kt @@ -0,0 +1,695 @@ +package com.droiddeck.launcher.ui + +import android.widget.Toast +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable +import androidx.compose.foundation.hoverable +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.aspectRatio +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.horizontalScroll +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Close +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue +import androidx.compose.runtime.mutableStateMapOf +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.Role +import androidx.compose.ui.semantics.contentDescription +import androidx.compose.ui.semantics.selected +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.input.ImeAction +import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import android.graphics.SurfaceTexture +import android.media.MediaPlayer +import android.net.Uri +import android.view.Surface +import android.view.TextureView +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow +import androidx.compose.foundation.layout.widthIn +import androidx.compose.foundation.lazy.itemsIndexed +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material.icons.filled.PlayArrow +import androidx.compose.material.icons.filled.Search +import androidx.compose.material3.Icon +import androidx.compose.runtime.DisposableEffect +import androidx.compose.runtime.mutableFloatStateOf +import androidx.compose.ui.focus.FocusRequester +import androidx.compose.ui.focus.focusRequester +import androidx.compose.ui.input.InputMode +import androidx.compose.ui.platform.LocalConfiguration +import androidx.compose.ui.platform.LocalInputModeManager +import androidx.compose.ui.viewinterop.AndroidView +import coil.compose.AsyncImage +import com.droiddeck.launcher.R +import com.droiddeck.launcher.session.BootMovie +import com.droiddeck.launcher.session.BootMovieLibrary +import com.droiddeck.launcher.session.BootMovieReport +import com.droiddeck.launcher.session.SessionPrefs +import com.droiddeck.launcher.session.SteamDeckRepo +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import java.io.File + +private enum class MovieTab { INSTALLED, IMPORT, REPO, SOUND } + +/** Downloads run here rather than in a tab, so switching tabs or closing the settings does not cancel one halfway. */ +private val installScope = CoroutineScope(SupervisorJob() + Dispatchers.Main) + +/** The downloads under way, by post id and percent; kept here so they are still known when the tab or the settings come back. */ +private val installProgress = mutableStateMapOf() + +/** What the movie list looks like right now: every movie and the one Steam will play. */ +private class MovieSnapshot(val entries: List, val selected: String) + +/** The movie list, read again every couple of seconds so a movie picked, added or removed inside Steam shows up here too. */ +@Composable +private fun rememberMovies(refresh: Int, onSelectionChanged: () -> Unit): MovieSnapshot? { + val app = LocalContext.current.applicationContext + var snapshot by remember { mutableStateOf(null) } + val changed by androidx.compose.runtime.rememberUpdatedState(onSelectionChanged) + LaunchedEffect(refresh) { + while (true) { + val before = snapshot?.selected + snapshot = withContext(Dispatchers.IO) { + BootMovie.syncFromSteam(app) + MovieSnapshot(BootMovieLibrary.list(app), BootMovie.choice(app)) + } + if (before != null && before != snapshot?.selected) changed() + delay(2_000) + } + } + return snapshot +} + +@Composable +private fun TabChip(label: String, selected: Boolean, modifier: Modifier = Modifier, onClick: () -> Unit) { + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + val shape = RoundedCornerShape(8.dp) + Box( + contentAlignment = Alignment.Center, + modifier = modifier.clip(shape) + .background(if (selected) pal.signal.copy(alpha = 0.14f) else Color.White.copy(alpha = 0.03f)) + .border(if (selected) 2.dp else 1.dp, if (selected) pal.signal else pal.line, shape) + .glideBorder(hot, shape, pal.signal) + .hoverable(src) + .clickable(interactionSource = src, indication = androidx.compose.foundation.LocalIndication.current, role = Role.Tab, onClick = onClick) + .controllerConfirm(onClick = onClick) + .semantics { contentDescription = label; this.selected = selected } + .padding(horizontal = 10.dp, vertical = 8.dp), + ) { + Text(label, fontSize = 12.sp, fontWeight = if (selected) FontWeight.SemiBold else FontWeight.Normal, + color = MaterialTheme.colorScheme.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) + } +} + +/** The "Boot movie" settings group: Installed movies, Import your own movies, SteamDeckRepo and Sound. */ +@Composable +internal fun BootMovieGroup(s: ModeSettings, a: ModeSettingsActions, host: MenuHost) { + var tab by rememberSaveable { mutableStateOf(MovieTab.INSTALLED) } + SettingsGroup(stringResource(R.string.boot_movie)) { + Row(horizontalArrangement = Arrangement.spacedBy(6.dp), modifier = Modifier.fillMaxWidth().padding(horizontal = 10.dp, vertical = 10.dp)) { + TabChip(stringResource(R.string.boot_movie_tab_installed), tab == MovieTab.INSTALLED, Modifier.weight(1f)) { tab = MovieTab.INSTALLED } + TabChip(stringResource(R.string.boot_movie_tab_import), tab == MovieTab.IMPORT, Modifier.weight(1f)) { tab = MovieTab.IMPORT } + TabChip(stringResource(R.string.boot_movie_tab_repo), tab == MovieTab.REPO, Modifier.weight(1f)) { tab = MovieTab.REPO } + TabChip(stringResource(R.string.boot_movie_tab_sound), tab == MovieTab.SOUND, Modifier.weight(1f)) { tab = MovieTab.SOUND } + } + when (tab) { + MovieTab.INSTALLED -> InstalledTab(a) + MovieTab.IMPORT -> ImportTab(s, a) + MovieTab.REPO -> RepoTab(a) + MovieTab.SOUND -> SoundTab(s, a, host) + } + } +} + +@Composable +private fun InstalledTab(a: ModeSettingsActions) { + var browsing by remember { mutableStateOf(false) } + val snapshot = rememberMovies(0, a.onBootMovieChanged) + val current = snapshot?.let { snap -> snap.entries.firstOrNull { it.id == snap.selected }?.title } + val hint = current ?: stringResource(R.string.common_working) + SettingsRow(stringResource(R.string.boot_movie_installed), hint) { + SecondaryButton(stringResource(R.string.boot_movie_browse), onClick = { browsing = true }) + } + Text( + stringResource(R.string.boot_movie_note), fontSize = 12.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, + modifier = Modifier.padding(horizontal = 14.dp).padding(bottom = 12.dp), + ) + val app = LocalContext.current.applicationContext + val scope = rememberCoroutineScope() + var saving by remember { mutableStateOf(false) } + // The report is for bug reports, so it shows only while Debugging tools is on (read each time this tab opens). + val debugging = remember { com.droiddeck.launcher.agent.AgentAccess.commandsEnabled(app) } + if (debugging) { + SettingsRow(stringResource(R.string.boot_movie_report), stringResource(R.string.boot_movie_report_hint)) { + SecondaryButton(stringResource(R.string.boot_movie_report_save), enabled = !saving, onClick = { + saving = true + scope.launch { + val file = withContext(Dispatchers.IO) { BootMovieReport.write(app) } + saving = false + Toast.makeText( + app, + file?.let { app.getString(R.string.boot_movie_report_saved, it.path) } ?: app.getString(R.string.boot_movie_report_failed), + Toast.LENGTH_LONG, + ).show() + } + }) + } + } + if (browsing) InstalledMoviesDialog(a) { browsing = false } +} + +@Composable +private fun MovieCover(entry: BootMovieLibrary.Entry, modifier: Modifier = Modifier) { + val app = LocalContext.current.applicationContext + val cover by androidx.compose.runtime.produceState(null, entry.id, entry.title) { + value = withContext(Dispatchers.IO) { BootMovieLibrary.cover(app, entry) } + } + Box(modifier.aspectRatio(16f / 9f).clip(RoundedCornerShape(8.dp)).background(Color(0xFF0E1218))) { + cover?.let { AsyncImage(model = it, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.fillMaxSize()) } + } +} + +@Composable +private fun movieSourceLabel(source: String): String = stringResource( + when (source) { + BootMovieLibrary.SOURCE_DROIDDECK -> R.string.boot_movie_source_droiddeck + BootMovieLibrary.SOURCE_REPO -> R.string.boot_movie_source_repo + BootMovieLibrary.SOURCE_IMPORT -> R.string.boot_movie_source_import + BootMovieLibrary.SOURCE_POINTSHOP -> R.string.boot_movie_source_pointshop + else -> R.string.boot_movie_source_steam + }, +) + +/** The installed movies as a list with covers; the one Steam plays is highlighted, and the list follows changes made in Steam. */ +@Composable +private fun InstalledMoviesDialog(a: ModeSettingsActions, onDismiss: () -> Unit) { + val app = LocalContext.current.applicationContext + val scope = rememberCoroutineScope() + val shown = rememberShown(onDismiss) + val close = { shown.targetState = false } + var refresh by remember { mutableIntStateOf(0) } + val snapshot = rememberMovies(refresh, a.onBootMovieChanged) + var picked by remember { mutableStateOf(null) } + var removing by remember { mutableStateOf(null) } + var filter by rememberSaveable { mutableStateOf(null) } + val selected = picked ?: snapshot?.selected + LaunchedEffect(snapshot?.selected) { picked = null } + removing?.let { entry -> + RemoveMovieDialog( + entry, + onConfirm = { + removing = null + scope.launch { + withContext(Dispatchers.IO) { BootMovieLibrary.remove(app, entry.id) } + a.onBootMovieChanged() + refresh++ + } + }, + onDismiss = { removing = null }, + ) + } + val firstRow = remember { FocusRequester() } + val inputMode = LocalInputModeManager.current + LaunchedEffect(snapshot != null, filter) { + if (snapshot != null && inputMode.inputMode == InputMode.Keyboard) focusSoon { firstRow } + } + AppDialog(shown, close, "boot-movies", wide = false, scrollable = false) { + val filters = listOf( + null to stringResource(R.string.store_all), + BootMovieLibrary.SOURCE_DROIDDECK to movieSourceLabel(BootMovieLibrary.SOURCE_DROIDDECK), + BootMovieLibrary.SOURCE_STEAM to movieSourceLabel(BootMovieLibrary.SOURCE_STEAM), + BootMovieLibrary.SOURCE_POINTSHOP to movieSourceLabel(BootMovieLibrary.SOURCE_POINTSHOP), + BootMovieLibrary.SOURCE_REPO to movieSourceLabel(BootMovieLibrary.SOURCE_REPO), + BootMovieLibrary.SOURCE_IMPORT to movieSourceLabel(BootMovieLibrary.SOURCE_IMPORT), + ) + var filterOpen by remember { mutableStateOf(false) } + Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp), + modifier = Modifier.fillMaxWidth().padding(bottom = 8.dp), + ) { + Text( + stringResource(R.string.boot_movie_installed), fontSize = 15.sp, color = MaterialTheme.colorScheme.onBackground, + maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f), + ) + Box { + androidx.compose.runtime.CompositionLocalProvider(LocalChipMinWidth provides 100.dp) { + ValueChip(filters.first { it.first == filter }.second, filterOpen) { filterOpen = !filterOpen } + } + AnchoredMenu(filterOpen, onDismiss = { filterOpen = false }, compact = true) { firstItemFocus -> + filters.forEachIndexed { index, (source, label) -> + MenuItem(label, checked = filter == source, focusRequester = if (index == 0) firstItemFocus else null) { + filter = source + filterOpen = false + } + } + } + } + SmallIconButton(Icons.Filled.Close, stringResource(R.string.common_close), tint = MaterialTheme.colorScheme.error, onClick = close) + } + LazyColumn(verticalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.fillMaxWidth().weight(1f, fill = false)) { + itemsIndexed(snapshot?.entries.orEmpty().filter { filter == null || it.source == filter }, key = { _, entry -> entry.id }) { index, entry -> + ListRow(accent = entry.id == selected, tall = true, focus = if (index == 0) firstRow else null, onClick = { picked = entry.id; a.onBootMovie(entry.id) }) { + MovieCover(entry, Modifier.size(width = 96.dp, height = 54.dp)) + Column(Modifier.weight(1f)) { + Text(entry.title, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = MaterialTheme.colorScheme.onBackground, + maxLines = 2, overflow = TextOverflow.Ellipsis) + Text(movieSourceLabel(entry.source), fontSize = 12.sp, color = if (entry.id == selected) LocalPalette.current.signal else MaterialTheme.colorScheme.onSurfaceVariant) + } + if (entry.removable) SmallIconButton(Icons.Filled.Close, stringResource(R.string.boot_movie_remove), MaterialTheme.colorScheme.error) { + removing = entry + } + } + } + } + } +} + +@Composable +private fun RemoveMovieDialog(entry: BootMovieLibrary.Entry, onConfirm: () -> Unit, onDismiss: () -> Unit) { + androidx.compose.material3.AlertDialog( + onDismissRequest = onDismiss, + title = { Text(stringResource(R.string.boot_movie_remove_confirm, entry.title)) }, + text = { Text(stringResource(R.string.boot_movie_remove_confirm_body)) }, + confirmButton = { androidx.compose.material3.TextButton(onClick = onConfirm) { Text(stringResource(R.string.boot_movie_remove)) } }, + dismissButton = { androidx.compose.material3.TextButton(onClick = onDismiss) { Text(stringResource(R.string.common_cancel)) } }, + ) +} + +@Composable +private fun ImportTab(s: ModeSettings, a: ModeSettingsActions) { + SettingsRow( + stringResource(R.string.boot_movie_custom), + stringResource(R.string.boot_movie_custom_hint, (BootMovie.MAX_BYTES shr 20).toInt(), BootMovie.MAX_CONVERT_SECONDS), + ) { + SecondaryButton( + when { + s.bootMovieProgress >= 0 -> stringResource(R.string.boot_movie_converting, s.bootMovieProgress) + s.bootMovieImporting -> stringResource(R.string.common_working) + else -> stringResource(R.string.boot_movie_import) + }, + enabled = !s.bootMovieImporting, + progress = s.bootMovieProgress.takeIf { it >= 0 }?.let { it / 100f }, + onClick = a.onImportBootMovie, + ) + } +} + +@Composable +private fun SoundTab(s: ModeSettings, a: ModeSettingsActions, host: MenuHost) { + val app = LocalContext.current.applicationContext + var volume by remember { mutableIntStateOf(SessionPrefs.bootMovieVolume(app)) } + var seconds by remember { mutableIntStateOf(SessionPrefs.bootMovieSeconds(app)) } + val duration by androidx.compose.runtime.produceState(0, s.bootMovie) { + value = withContext(Dispatchers.IO) { BootMovieLibrary.durationSeconds(BootMovie.currentFile(app)) } + } + ToggleRow( + host, "boot-movie-sound", stringResource(R.string.boot_movie_sound), + stringResource(R.string.common_applies_next_session), s.bootMovieSound, onChange = a.onBootMovieSound, + ) + Box(Modifier.padding(horizontal = 6.dp)) { + ValueSlider( + volume, 0..100, 5, s.bootMovieSound, stringResource(R.string.boot_movie_volume), { "$it%" }, + ) { volume = it; SessionPrefs.setBootMovieVolume(app, it) } + } + Box(Modifier.padding(horizontal = 6.dp)) { + val shownSeconds = if (seconds in 1 until duration) seconds else duration + ValueSlider( + shownSeconds, 1..duration.coerceAtLeast(2), 1, duration > 1, stringResource(R.string.boot_movie_length), + { value -> app.getString(R.string.boot_movie_seconds, value) }, + ) { next -> + val stored = if (next >= duration) 0 else next + seconds = stored + SessionPrefs.setBootMovieSeconds(app, stored) + } + } + Text( + stringResource(R.string.boot_movie_length_hint), fontSize = 12.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, + modifier = Modifier.padding(horizontal = 14.dp).padding(bottom = 12.dp), + ) +} + +@Composable +private fun RepoTab(a: ModeSettingsActions) { + val progress = installProgress + val app = LocalContext.current.applicationContext + val scope = rememberCoroutineScope() + var sort by rememberSaveable { mutableStateOf(SteamDeckRepo.Sort.TRENDING) } + var device by rememberSaveable { mutableStateOf(null) } + var query by rememberSaveable { mutableStateOf("") } + var page by rememberSaveable { mutableIntStateOf(1) } + var retry by remember { mutableIntStateOf(0) } + var searching by remember { mutableStateOf(false) } + var jumping by remember { mutableStateOf(false) } + var previewing by remember { mutableStateOf(null) } + var installed by remember { mutableStateOf(setOf()) } + val chosen = rememberMovies(0, a.onBootMovieChanged)?.selected + val inUse by androidx.compose.runtime.produceState(null, chosen) { + value = withContext(Dispatchers.IO) { + chosen?.takeIf { it.startsWith(BootMovieLibrary.PREFIX) }?.let { BootMovieLibrary.repoId(app, it.removePrefix(BootMovieLibrary.PREFIX)) } + } + } + LaunchedEffect(progress.size) { installed = withContext(Dispatchers.IO) { BootMovieLibrary.installedRepoIds(app) } } + val result by androidx.compose.runtime.produceState(null, sort, device, query, page, retry) { + value = null + value = withContext(Dispatchers.IO) { SteamDeckRepo.fetch(sort, device, query, page) } + } + val last by androidx.compose.runtime.produceState(null, sort, device, query, retry) { + value = null + value = withContext(Dispatchers.IO) { SteamDeckRepo.lastPage(sort, device, query) } + } + LaunchedEffect(last) { last?.let { if (page > it) page = it } } + val installPost: (SteamDeckRepo.Post) -> Unit = { post -> + if (progress.isEmpty()) { + progress[post.id] = 0 + installScope.launch { + val outcome = try { + withContext(Dispatchers.IO) { install(app, post) { progress[post.id] = it } } + } catch (e: kotlinx.coroutines.CancellationException) { + throw e + } catch (e: Exception) { + app.getString(R.string.boot_movie_repo_download_failed) + } finally { + progress.remove(post.id) + } + Toast.makeText(app, outcome ?: app.getString(R.string.boot_movie_repo_installed, post.title), Toast.LENGTH_LONG).show() + a.onBootMovieChanged() + } + } + } + val usePost: (SteamDeckRepo.Post) -> Unit = { post -> + scope.launch { + val name = withContext(Dispatchers.IO) { BootMovieLibrary.nameForRepo(app, post.id) } + if (name != null) a.onBootMovie(BootMovieLibrary.idOf(name)) + } + } + Column(verticalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.fillMaxWidth().padding(horizontal = 10.dp).padding(bottom = 12.dp)) { + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp), modifier = Modifier.fillMaxWidth()) { + Box(Modifier.weight(1f)) { + ListRow(tall = true, onClick = { searching = true }) { + Icon(Icons.Filled.Search, contentDescription = null, tint = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.size(18.dp)) + Text( + query.ifEmpty { stringResource(R.string.boot_movie_repo_search) }, fontSize = 14.sp, maxLines = 1, overflow = TextOverflow.Ellipsis, + color = if (query.isEmpty()) MaterialTheme.colorScheme.onSurfaceVariant else MaterialTheme.colorScheme.onBackground, + modifier = Modifier.weight(1f), + ) + } + } + if (query.isNotEmpty()) SecondaryButton(stringResource(R.string.boot_movie_repo_clear), compact = true) { query = ""; page = 1 } + } + Row(Modifier.horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(6.dp)) { + TabChip(stringResource(R.string.boot_movie_repo_all), device == null) { device = null; page = 1 } + TabChip(stringResource(R.string.boot_movie_repo_deck), device == "steam_deck") { device = "steam_deck"; page = 1 } + TabChip(stringResource(R.string.boot_movie_repo_machine), device == "steam_machine") { device = "steam_machine"; page = 1 } + } + Row(Modifier.horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(6.dp)) { + SteamDeckRepo.Sort.values().forEach { option -> + TabChip( + stringResource( + when (option) { + SteamDeckRepo.Sort.TRENDING -> R.string.boot_movie_repo_trending + SteamDeckRepo.Sort.DOWNLOADS -> R.string.boot_movie_repo_downloads + SteamDeckRepo.Sort.LIKES -> R.string.boot_movie_repo_likes + SteamDeckRepo.Sort.NEWEST -> R.string.boot_movie_repo_newest + }, + ), + sort == option, + ) { sort = option; page = 1 } + } + } + when (val r = result) { + null -> Text(stringResource(R.string.common_working), fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(vertical = 12.dp)) + is SteamDeckRepo.Page.Failed -> Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) { + Text(stringResource(R.string.boot_movie_repo_failed), fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.weight(1f)) + SecondaryButton(stringResource(R.string.boot_movie_repo_retry), compact = true) { retry++ } + } + is SteamDeckRepo.Page.Ok -> { + if (r.posts.isEmpty()) Text(stringResource(R.string.boot_movie_repo_empty), fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(vertical = 12.dp)) + r.posts.chunked(2).forEach { row -> + Row(horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.fillMaxWidth()) { + row.forEach { post -> + RepoCard( + post, installed = post.id in installed, inUse = post.id == inUse, percent = progress[post.id], busy = progress.isNotEmpty(), + modifier = Modifier.weight(1f), onPreview = { previewing = post }, onInstall = { installPost(post) }, onUse = { usePost(post) }, + ) + } + if (row.size == 1) Box(Modifier.weight(1f)) + } + } + RepoPager(page, last, hasMore = r.posts.size >= SteamDeckRepo.PAGE_SIZE, onPage = { page = it }, onJump = { jumping = true }) + } + } + } + if (searching) TextEntryDialog( + stringResource(R.string.boot_movie_repo_search), query, number = false, confirm = stringResource(R.string.stores_search_open), + onSubmit = { value -> if (value != query) { query = value; page = 1 } }, onDismiss = { searching = false }, + ) + if (jumping) TextEntryDialog( + stringResource(R.string.boot_movie_repo_go_to_page), page.toString(), number = true, confirm = stringResource(R.string.common_ok), + onSubmit = { value -> value.toIntOrNull()?.let { n -> page = n.coerceIn(1, maxOf(1, last ?: n)) } }, onDismiss = { jumping = false }, + ) + previewing?.let { post -> + PreviewDialog( + post, installed = post.id in installed, inUse = post.id == inUse, percent = progress[post.id], busy = progress.isNotEmpty(), + onInstall = { installPost(post) }, onUse = { usePost(post) }, onDismiss = { previewing = null }, + ) + } +} + +/** Downloads [post] and puts it among the installed movies; returns a message when it failed, null when it worked. */ +private fun install(app: android.content.Context, post: SteamDeckRepo.Post, onProgress: (Int) -> Unit): String? { + val folder = File(app.cacheDir, "boot-movie-download").apply { mkdirs() } + // Leftovers of a download that was cut short are cleared, and every download has a file of its own. + folder.listFiles()?.forEach { if (System.currentTimeMillis() - it.lastModified() > 60 * 60 * 1000L) it.delete() } + val file = File.createTempFile("movie-", ".webm", folder) + return try { + if (!SteamDeckRepo.download(post, file, onProgress)) return app.getString(R.string.boot_movie_repo_download_failed) + val cover = if (post.thumbnail.isNotEmpty()) SteamDeckRepo.bytes(post.thumbnail) else null + when (BootMovie.import(app, file, onProgress = onProgress, title = post.title, source = BootMovieLibrary.SOURCE_REPO, repoId = post.id, cover = cover, use = false)) { + is BootMovie.Import.Done -> null + BootMovie.Import.TooLong -> app.getString(R.string.boot_movie_too_long, BootMovie.MAX_CONVERT_SECONDS) + is BootMovie.Import.Unsupported -> app.getString(R.string.boot_movie_unsupported) + BootMovie.Import.Failed -> app.getString(R.string.boot_movie_import_failed) + } + } finally { + file.delete() + } +} + +@Composable +private fun RepoCard( + post: SteamDeckRepo.Post, installed: Boolean, inUse: Boolean, percent: Int?, busy: Boolean, modifier: Modifier, + onPreview: () -> Unit, onInstall: () -> Unit, onUse: () -> Unit, +) { + val pal = LocalPalette.current + val colors = MaterialTheme.colorScheme + val shape = RoundedCornerShape(10.dp) + val thumbShape = RoundedCornerShape(7.dp) + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + val previewLabel = stringResource(R.string.boot_movie_repo_preview) + Column( + verticalArrangement = Arrangement.spacedBy(5.dp), + modifier = modifier.clip(shape) + .background(if (inUse) pal.signal.copy(alpha = 0.14f) else colors.surface.copy(alpha = 0.6f)) + .border(if (inUse) 2.dp else 1.dp, if (inUse) pal.signal else pal.line, shape).padding(6.dp), + ) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.fillMaxWidth().aspectRatio(16f / 9f).clip(thumbShape).background(Color(0xFF0E1218)) + .glideBorder(hot, thumbShape, pal.signal) + .hoverable(src).clickable(interactionSource = src, indication = androidx.compose.foundation.LocalIndication.current, role = Role.Button, onClick = onPreview) + .controllerConfirm(onClick = onPreview) + .semantics { contentDescription = previewLabel }, + ) { + if (post.thumbnail.isNotEmpty()) AsyncImage(model = post.thumbnail, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.fillMaxSize()) + Box(Modifier.size(40.dp).clip(CircleShape).background(Color.Black.copy(alpha = 0.55f)), contentAlignment = Alignment.Center) { + Icon(Icons.Filled.PlayArrow, contentDescription = null, tint = Color.White, modifier = Modifier.size(26.dp)) + } + } + Text(post.title, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) + Text(repoInfo(post), fontSize = 11.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis) + RepoAction(installed, inUse, percent, busy, Modifier.fillMaxWidth(), onInstall, onUse) + } +} + +@Composable +private fun repoInfo(post: SteamDeckRepo.Post): String = + listOf(post.author, "♥ ${post.likes}", "⇩ ${post.downloads}", if (post.seconds > 0) stringResource(R.string.boot_movie_seconds, post.seconds) else "") + .filter { it.isNotEmpty() }.joinToString(" · ") + +@Composable +private fun RepoAction(installed: Boolean, inUse: Boolean, percent: Int?, busy: Boolean, modifier: Modifier, onInstall: () -> Unit, onUse: () -> Unit) { + if (inUse) SecondaryButton(stringResource(R.string.boot_movie_in_use), compact = true, modifier = modifier, onClick = {}) + else if (installed) SecondaryButton(stringResource(R.string.boot_movie_repo_use), compact = true, modifier = modifier, onClick = onUse) + else SecondaryButton( + if (percent != null) stringResource(R.string.boot_movie_converting, percent) else stringResource(R.string.boot_movie_repo_install), + enabled = !busy, compact = true, modifier = modifier, onClick = onInstall, + ) +} + +/** A movie from SteamDeckRepo played straight from the site, so it can be checked before it is installed. */ +@Composable +private fun PreviewDialog( + post: SteamDeckRepo.Post, installed: Boolean, inUse: Boolean, percent: Int?, busy: Boolean, + onInstall: () -> Unit, onUse: () -> Unit, onDismiss: () -> Unit, +) { + val shown = rememberShown(onDismiss) + val close = { shown.targetState = false } + val action = remember { FocusRequester() } + val inputMode = LocalInputModeManager.current + LaunchedEffect(Unit) { if (inputMode.inputMode == InputMode.Keyboard) focusSoon { action } } + val maxVideoHeight = (LocalConfiguration.current.screenHeightDp - 200).coerceAtLeast(120).dp + AppDialog(shown, close, "boot-movie-preview", wide = false, maxWidth = 620.dp) { + DialogTitleRow(post.title, close) + Box(Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) { + MoviePreview(post.video, Modifier.heightIn(max = maxVideoHeight).aspectRatio(16f / 9f)) + } + Text(repoInfo(post), fontSize = 12.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis) + RepoAction(installed, inUse, percent, busy, Modifier.fillMaxWidth().focusRequester(action), onInstall, onUse) + } +} + +@Composable +private fun MoviePreview(url: String, modifier: Modifier = Modifier) { + val pal = LocalPalette.current + val shape = RoundedCornerShape(10.dp) + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + var state by remember(url) { mutableIntStateOf(0) } + var ratio by remember(url) { mutableFloatStateOf(16f / 9f) } + val player = remember(url) { arrayOfNulls(1) } + DisposableEffect(url) { + onDispose { + runCatching { player[0]?.release() } + player[0] = null + } + } + val toggle = { runCatching { player[0]?.let { if (it.isPlaying) it.pause() else it.start() } }; Unit } + Box( + contentAlignment = Alignment.Center, + modifier = modifier.clip(shape).background(Color.Black) + .glideBorder(hot, shape, pal.signal, pal.line) + .hoverable(src).clickable(interactionSource = src, indication = null, role = Role.Button, onClick = toggle) + .controllerConfirm(onClick = toggle), + ) { + AndroidView( + modifier = Modifier.aspectRatio(ratio), + factory = { viewContext -> + TextureView(viewContext).apply { + surfaceTextureListener = object : TextureView.SurfaceTextureListener { + override fun onSurfaceTextureAvailable(texture: SurfaceTexture, width: Int, height: Int) { + val mp = MediaPlayer() + player[0] = mp + try { + mp.setDataSource(viewContext, Uri.parse(url), mapOf("User-Agent" to "DroidDeck")) + mp.setSurface(Surface(texture)) + mp.isLooping = true + mp.setOnVideoSizeChangedListener { _, w, h -> if (w > 0 && h > 0) ratio = w.toFloat() / h } + mp.setOnPreparedListener { it.start(); state = 1 } + mp.setOnErrorListener { _, _, _ -> state = 2; true } + mp.prepareAsync() + } catch (e: Exception) { + state = 2 + } + } + + override fun onSurfaceTextureSizeChanged(texture: SurfaceTexture, width: Int, height: Int) = Unit + + override fun onSurfaceTextureDestroyed(texture: SurfaceTexture): Boolean { + runCatching { player[0]?.release() } + player[0] = null + return true + } + + override fun onSurfaceTextureUpdated(texture: SurfaceTexture) = Unit + } + } + }, + ) + if (state == 0) Text(stringResource(R.string.common_working), fontSize = 13.sp, color = Color.White.copy(alpha = 0.8f)) + if (state == 2) Text(stringResource(R.string.boot_movie_repo_preview_failed), fontSize = 13.sp, color = Color.White.copy(alpha = 0.8f), modifier = Modifier.padding(12.dp)) + } +} + +/** A dialog with one text box, for a search term or a page number; the Android keyboard comes up with it. */ +@Composable +private fun TextEntryDialog( + title: String, initial: String, number: Boolean, confirm: String, onSubmit: (String) -> Unit, onDismiss: () -> Unit, +) { + val shown = rememberShown(onDismiss) + val close = { shown.targetState = false } + var text by remember { mutableStateOf(initial) } + val submit = { onSubmit(text.trim()); close() } + AppDialog(shown, close, "boot-movie-entry", wide = false, maxWidth = 460.dp) { + DialogTitleRow(title, close) + AdbTextField( + value = text, onValueChange = { text = it }, label = "", keyboardType = if (number) KeyboardType.Number else KeyboardType.Text, + imeAction = ImeAction.Done, placeholder = title, focusOnShow = true, onDone = { submit() }, + ) + Row(horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.fillMaxWidth()) { + SecondaryButton(stringResource(R.string.common_cancel), modifier = Modifier.weight(1f), onClick = close) + SecondaryButton(confirm, modifier = Modifier.weight(1f)) { submit() } + } + } +} + +/** Page buttons around the current page, which opens a box to type another page into; first and last page show their numbers. */ +@OptIn(ExperimentalLayoutApi::class) +@Composable +private fun RepoPager(page: Int, last: Int?, hasMore: Boolean, onPage: (Int) -> Unit, onJump: () -> Unit) { + val reach = last ?: if (hasMore) Int.MAX_VALUE else page + FlowRow( + horizontalArrangement = Arrangement.spacedBy(6.dp, Alignment.CenterHorizontally), + verticalArrangement = Arrangement.spacedBy(6.dp), + modifier = Modifier.fillMaxWidth(), + ) { + SecondaryButton(stringResource(R.string.boot_movie_repo_previous), enabled = page > 1, compact = true) { onPage(page - 1) } + if (page - 3 > 1) SecondaryButton("1", compact = true) { onPage(1) } + for (n in maxOf(1, page - 3) until page) SecondaryButton("$n", compact = true) { onPage(n) } + TabChip("$page", true, Modifier.widthIn(min = 52.dp).heightIn(min = 44.dp), onJump) + for (n in page + 1..minOf(page + 3, reach)) SecondaryButton("$n", compact = true) { onPage(n) } + if (last != null && page + 3 < last) SecondaryButton("$last", compact = true) { onPage(last) } + SecondaryButton(stringResource(R.string.boot_movie_repo_next), enabled = page < reach, compact = true) { onPage(page + 1) } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt b/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt index b0f501cbe9..d90747aca4 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt @@ -139,7 +139,7 @@ class ModeSettingsActions( val onBootMovie: (String) -> Unit = {}, val onBootMovieSound: (Boolean) -> Unit = {}, val onImportBootMovie: () -> Unit = {}, - val onRemoveBootMovie: () -> Unit = {}, + val onBootMovieChanged: () -> Unit = {}, val onWifiDiscovery: (Boolean) -> Unit = {}, val onWifiDiscoverySettings: () -> Unit = {}, val onDeckyInstall: (DeckyManager.Release) -> Unit = {}, @@ -467,41 +467,7 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras: onPick = a.onSteamClientArch, ) } - if (s.bootMovie != null) SettingsGroup(stringResource(R.string.boot_movie)) { - ChoiceRow( - host, "boot-movie", stringResource(R.string.boot_movie_video), stringResource(R.string.common_applies_next_session), - buildList { - add(BootMovie.DROIDDECK_30 to stringResource(R.string.boot_movie_droiddeck, 30)) - add(BootMovie.DROIDDECK_60 to stringResource(R.string.boot_movie_droiddeck, 60)) - s.bootMovieCustomName?.let { add(BootMovie.CUSTOM to it) } - }, s.bootMovie, - note = stringResource(R.string.boot_movie_note), onPick = a.onBootMovie, - ) - ToggleRow( - host, "boot-movie-sound", stringResource(R.string.boot_movie_sound), - stringResource(R.string.common_applies_next_session), s.bootMovieSound, onChange = a.onBootMovieSound, - ) - SettingsRow( - stringResource(R.string.boot_movie_custom), - stringResource(R.string.boot_movie_custom_hint, (BootMovie.MAX_BYTES shr 20).toInt(), BootMovie.MAX_CONVERT_SECONDS), - ) { - Row(horizontalArrangement = androidx.compose.foundation.layout.Arrangement.spacedBy(6.dp)) { - SecondaryButton( - when { - s.bootMovieProgress >= 0 -> stringResource(R.string.boot_movie_converting, s.bootMovieProgress) - s.bootMovieImporting -> stringResource(R.string.common_working) - else -> stringResource(R.string.boot_movie_import) - }, - enabled = !s.bootMovieImporting, - progress = s.bootMovieProgress.takeIf { it >= 0 }?.let { it / 100f }, - onClick = a.onImportBootMovie, - ) - if (s.bootMovieCustomName != null) SecondaryButton( - stringResource(R.string.boot_movie_remove), enabled = !s.bootMovieImporting, onClick = a.onRemoveBootMovie, - ) - } - } - } + if (s.bootMovie != null) BootMovieGroup(s, a, host) if (s.wifiDiscovery != null) SettingsGroup(stringResource(R.string.mode_network)) { val hint = when { s.wifiDiscovery && !s.wifiDiscoveryLocation -> stringResource(R.string.mode_wifi_location_off) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 45e898e199..0bc7bd2810 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -2234,7 +2234,7 @@ الحجم حفظ العودة إلى الافتراضي - يُرسم فوق خلفية اللعبة كما يفعل Steam. قد يختلف الموضع الدقيق ببضع بكسلات. + قد يختلف هذا الموضع بضع نقاط بكسل. لا توجد لهذه اللعبة شعار بعد. اختر واحدًا من الشعار لتراه هنا. تعذّر حفظ موضع الشعار. حاول مرة أخرى. الخلفية @@ -2815,7 +2815,7 @@ فيديو الإقلاع الفيديو DroidDeck · %1$d إطار/ث - معدل 60 إطارًا/ث أكثر سلاسة لكنه يستهلك المعالج أكثر أثناء بدء Steam. فيديو البدء المختار في إعدادات Steam نفسها له الأولوية. + معدل 60 إطارًا/ث أكثر سلاسة لكنه يستهلك المعالج أكثر أثناء بدء Steam. فيديو مختار في إعدادات Steam نفسها يظهر هنا أيضًا. الصوت فيديو خاص بك MP4 أو MOV أو MKV أو WebM. تُحوَّل الصيغ الأخرى والملفات الأكبر من %1$d ميغابايت إلى WebM بدقة 720p على الجهاز، حتى %2$d ثانية. @@ -2829,6 +2829,51 @@ جارٍ تحويل %1$s لـ Steam. أبقِ DroidDeck مفتوحًا. لا يستطيع هذا الجهاز فك ترميز هذا الفيديو. تعذّر استيراد الفيديو + إزالة %1$s؟ + سيُحذف الفيديو من DroidDeck ومن مجلد فيديوهات Steam. + المثبّتة + استيراد + SteamDeckRepo + الصوت + الفيديوهات المثبّتة + استعراض + DroidDeck + مستورد + SteamDeckRepo + Steam + متجر النقاط + تقرير فيديو الإقلاع + يحفظ ما يعرفه DroidDeck وSteam عن فيديوهات الإقلاع في ملف نصي يمكنك إرفاقه ببلاغ خطأ. + حفظ + تم الحفظ في %1$s + تعذّر حفظ التقرير. + مستوى الصوت + المدة + %1$d ث + عدد الثواني التي يتم تشغيلها من الفيديو. أي جزء أطول من ذلك يُقطع في النهاية. + البحث في SteamDeckRepo + كل الأجهزة + Steam Deck + Steam Machine + الرائجة + الأكثر تنزيلًا + الأكثر إعجابًا + الأحدث + تعذّر الوصول إلى SteamDeckRepo + إعادة المحاولة + لم يُعثر على فيديوهات + تثبيت + استخدام + قيد الاستخدام + تم تثبيت %1$s + تعذّر تنزيل هذا الفيديو + السابق + التالي + الصفحة %1$d + مسح + الانتقال إلى صفحة + معاينة + تعذر تشغيل المعاينة كاميرات Luma Ultra - تجريبية تتبع موضع Joy-Con استخدم كاميرات النظارات الذكية لتحديد موضع وحدات تحكم Joy-Con المقترنة. يتم التحكم في الدوران والأزرار من خلال وحدات تحكم Joy-Con. يتم تقدير الموضع عندما تكون معصميك مخفية. يحل هذا محل وحدات التحكم التي يتم تشغيلها باليدين ويوقف تتبع كاميرا الهاتف مؤقتًا. وجّه وحدات تحكم Joy-Con للأمام عند توصيل مركز التتبع أو إعادة ضبطه. diff --git a/app/src/main/res/values-b+es+419/strings.xml b/app/src/main/res/values-b+es+419/strings.xml index 64a9038b38..b1c1c7eb55 100644 --- a/app/src/main/res/values-b+es+419/strings.xml +++ b/app/src/main/res/values-b+es+419/strings.xml @@ -2185,7 +2185,7 @@ Tamaño Guardar Volver al valor predeterminado - Se dibuja sobre el fondo del juego, igual que en Steam. La posición exacta puede variar unos píxeles. + Este punto exacto puede variar unos pocos píxeles. Este juego aún no tiene logotipo. Elige uno en Logotipo para verlo aquí. No se pudo guardar la posición del logotipo. Inténtalo de nuevo. Fondo @@ -2655,7 +2655,7 @@ Video de arranque Video DroidDeck · %1$d fps - 60 fps se ve más fluido pero usa más CPU mientras Steam se inicia. Un video de inicio elegido en la configuración de Steam tiene prioridad. + 60 fps se ve más fluido pero usa más CPU mientras Steam se inicia. Un video elegido en la configuración de Steam también aparece aquí. Sonido Tu propio video MP4, MOV, MKV o WebM. Otros formatos y archivos de más de %1$d MB se convierten a WebM 720p en el dispositivo, hasta %2$d segundos. @@ -2669,6 +2669,51 @@ Convirtiendo %1$s para Steam. Mantén DroidDeck abierto. Este dispositivo no puede decodificar ese video. No se pudo importar ese video + ¿Quitar %1$s? + Esto elimina el video de DroidDeck y de la carpeta de videos de Steam. + Instalados + Importar + SteamDeckRepo + Sonido + Videos instalados + Explorar + DroidDeck + Importado + SteamDeckRepo + Steam + Tienda de puntos + Informe de películas de arranque + Guarda en un archivo de texto lo que DroidDeck y Steam saben de las películas de arranque, para adjuntarlo a un informe de error. + Guardar + Guardado en %1$s + No se pudo guardar el informe. + Volumen + Duración + %1$d s + Cuántos segundos del video se reproducen. Todo lo que dure más se corta al final. + Buscar en SteamDeckRepo + Todos los dispositivos + Steam Deck + Steam Machine + Tendencias + Más descargados + Más gustados + Más recientes + No se pudo conectar con SteamDeckRepo + Reintentar + No se encontraron videos + Instalar + Usar + En uso + %1$s instalado + No se pudo descargar ese video + Anterior + Siguiente + Página %1$d + Borrar + Ir a la página + Vista previa + No se pudo reproducir la vista previa Clave de API Obtener una clave Clave rechazada diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index d9b58d73f2..0b839a223d 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -2150,7 +2150,7 @@ Размер Запази Обратно по подразбиране - Рисува се върху фона на играта, както прави Steam. Точната позиция може да се различава с няколко пиксела. + Точното място може да се различава с няколко пиксела. Тази игра още няма лого. Избери такова в Лого, за да го видиш тук. Позицията на логото не можа да се запази. Опитай отново. Фон @@ -2679,7 +2679,7 @@ Начално видео Видео DroidDeck · %1$d кадъра/с - 60 кадъра/с изглежда по-гладко, но натоварва повече процесора, докато Steam се стартира. Начално видео, избрано в настройките на Steam, има предимство. + 60 кадъра/с изглежда по-гладко, но натоварва повече процесора, докато Steam се стартира. Видео, избрано в настройките на Steam, също се показва тук. Звук Собствено видео MP4, MOV, MKV или WebM. Други формати и файлове над %1$d MB се конвертират на устройството до WebM 720p, до %2$d секунди. @@ -2693,6 +2693,51 @@ %1$s се конвертира за Steam. Не затваряйте DroidDeck. Устройството не може да декодира това видео. Видеото не можа да бъде импортирано + Да се премахне ли %1$s? + Това изтрива видеото от DroidDeck и от папката с видеа на Steam. + Инсталирани + Импортиране + SteamDeckRepo + Звук + Инсталирани видеа + Преглед + DroidDeck + Импортирано + SteamDeckRepo + Steam + Магазин за точки + Отчет за стартовите филми + Записва в текстов файл какво знаят DroidDeck и Steam за стартовите филми, за да го прикачите към доклад за грешка. + Запази + Записано в %1$s + Отчетът не можа да бъде записан. + Сила на звука + Продължителност + %1$d с + Колко секунди от филма се възпроизвеждат. Всичко по-дълго се отрязва в края. + Търсене в SteamDeckRepo + Всички устройства + Steam Deck + Steam Machine + Популярни + Най-изтеглени + Най-харесвани + Най-нови + SteamDeckRepo не може да бъде достигнат + Опитайте отново + Не са намерени видеа + Инсталиране + Използване + Използва се + %1$s е инсталирано + Видеото не можа да бъде изтеглено + Назад + Напред + Страница %1$d + Изчисти + Към страница + Преглед + Прегледът не можа да бъде пуснат Luma Ultra камери — Експериментално Проследяване на позицията на Joy-Con Използвайте камерите на интелигентните очила, за да позиционирате сдвоените си контролери Joy-Con. Въртенето и натискането на бутоните идват от контролерите Joy-Con. Позицията се оценява, когато китките ви са скрити. Заменя контролерите, управлявани с голи ръце, и поставя на пауза проследяването с камерата на телефона. Насочете контролерите Joy-Con напред, когато свързвате или нулирате центъра за проследяване. diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 5fd6a89f17..3ebc7210f2 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -2192,7 +2192,7 @@ Velikost Uložit Zpět na výchozí - Kreslí se přes pozadí hry, jako to dělá Steam. Přesná poloha se může lišit o pár pixelů. + Přesná poloha se může lišit o několik pixelů. Tato hra zatím nemá logo. Vyber ho v Logo, ať se tady zobrazí. Polohu loga se nepodařilo uložit. Zkus to znovu. Pozadí @@ -2747,7 +2747,7 @@ Úvodní video Video DroidDeck · %1$d fps - 60 fps vypadá plynuleji, ale při spouštění Steamu víc zatěžuje procesor. Úvodní video vybrané přímo v nastavení Steamu má přednost. + 60 fps vypadá plynuleji, ale při spouštění Steamu víc zatěžuje procesor. Video vybrané přímo v nastavení Steamu se zde také zobrazí. Zvuk Vlastní video MP4, MOV, MKV nebo WebM. Jiné formáty a soubory nad %1$d MB se v zařízení převedou na WebM 720p, nejvýše %2$d sekund. @@ -2761,6 +2761,51 @@ Převádí se %1$s pro Steam. Nechte DroidDeck otevřený. Toto zařízení video nedokáže dekódovat. Video se nepodařilo importovat + Odebrat %1$s? + Tím se video smaže z DroidDecku i ze složky videí Steamu. + Nainstalované + Importovat + SteamDeckRepo + Zvuk + Nainstalovaná videa + Procházet + DroidDeck + Importované + SteamDeckRepo + Steam + Obchod s body + Zpráva o úvodních videích + Uloží do textového souboru, co DroidDeck a Steam vědí o úvodních videích, aby šel přiložit k hlášení chyby. + Uložit + Uloženo do %1$s + Zprávu se nepodařilo uložit. + Hlasitost + Délka + %1$d s + Kolik sekund filmu se přehraje. Cokoli delšího se na konci odřízne. + Hledat v SteamDeckRepo + Všechna zařízení + Steam Deck + Steam Machine + Populární + Nejstahovanější + Nejoblíbenější + Nejnovější + SteamDeckRepo se nepodařilo kontaktovat + Zkusit znovu + Nenalezena žádná videa + Nainstalovat + Použít + Používá se + %1$s nainstalováno + Video se nepodařilo stáhnout + Předchozí + Další + Strana %1$d + Vymazat + Přejít na stránku + Náhled + Náhled se nepodařilo přehrát Kamery Luma Ultra — Experimentální Sledování polohy Joy-Conů Použijte kamery chytrých brýlí k umístění spárovaných ovladačů Joy-Con. Otáčení a vstupy tlačítek pocházejí z ovladačů Joy-Con. Poloha se odhaduje, když máte skrytá zápěstí. Nahrazuje ovladače ovládané holýma rukama a pozastavuje sledování fotoaparátem telefonu. Při připojování nebo resetování centra sledování namiřte ovladače Joy-Con dopředu. diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 00b526836d..d8005ceec4 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -2150,7 +2150,7 @@ Størrelse Gem Tilbage til standard - Tegnes oven på spillets baggrund, som Steam gør. Den præcise placering kan afvige et par pixels. + Præcis placering kan afvige med nogle få pixel. Dette spil har endnu ikke et logo. Vælg et under Logo for at se det her. Logopladeringen kunne ikke gemmes. Prøv igen. Baggrund @@ -2679,7 +2679,7 @@ Opstartsvideo Video DroidDeck · %1$d fps - 60 fps ser mere flydende ud, men bruger mere CPU, mens Steam starter. En opstartsvideo valgt i Steams egne indstillinger har forrang. + 60 fps ser mere flydende ud, men bruger mere CPU, mens Steam starter. En video valgt i Steams egne indstillinger vises også her. Lyd Din egen video MP4, MOV, MKV eller WebM. Andre formater og filer over %1$d MB konverteres til 720p-WebM på enheden, op til %2$d sekunder. @@ -2693,6 +2693,51 @@ Konverterer %1$s til Steam. Hold DroidDeck åben. Enheden kan ikke afkode videoen. Kunne ikke importere videoen + Fjern %1$s? + Dette sletter videoen fra DroidDeck og fra Steams videomappe. + Installeret + Importér + SteamDeckRepo + Lyd + Installerede videoer + Gennemse + DroidDeck + Importeret + SteamDeckRepo + Steam + Pointbutik + Rapport om startfilm + Gemmer, hvad DroidDeck og Steam ved om startfilm, i en tekstfil, som du kan vedhæfte en fejlrapport. + Gem + Gemt i %1$s + Rapporten kunne ikke gemmes. + Lydstyrke + Længde + %1$d s + Hvor mange sekunder af filmen der afspilles. Alt, hvad der er længere, klippes af til sidst. + Søg i SteamDeckRepo + Alle enheder + Steam Deck + Steam Machine + Populære + Mest downloadet + Mest likede + Nyeste + Kunne ikke få forbindelse til SteamDeckRepo + Prøv igen + Ingen videoer fundet + Installér + Brug + I brug + %1$s installeret + Kunne ikke downloade videoen + Forrige + Næste + Side %1$d + Ryd + Gå til side + Forhåndsvis + Forhåndsvisningen kunne ikke afspilles Luma Ultra-kameraer — Eksperimentel Joy-Con-positionssporing Brug smartglass-kameraerne til at placere dine parrede Joy-Con-controllere. Rotation og knapinput kommer fra Joy-Con-controllerne. Positionen estimeres, når dine håndled er skjulte. Erstatter controllere, der betjenes med bare hænder, og sætter telefonkameraets sporing på pause. Ret Joy-Con-controllerne fremad, når du tilslutter eller nulstiller sporingscentret. diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index ccbb25f78c..d7c02ce9ea 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -2136,7 +2136,7 @@ Größe Speichern Auf Standard zurücksetzen - Wird wie bei Steam über dem Spielehintergrund gezeichnet. Die Position kann um einige Pixel abweichen. + Die genaue Position kann um einige Pixel abweichen. Für dieses Spiel gibt es noch kein Logo. Wähle unter Logo eines aus, um es hier zu sehen. Die Logoposition ließ sich nicht speichern. Versuche es erneut. Hintergrund @@ -2679,7 +2679,7 @@ Bootvideo Video DroidDeck · %1$d fps - 60 fps wirkt flüssiger, braucht aber mehr CPU, während Steam startet. Ein in Steam selbst gewähltes Startvideo hat Vorrang. + 60 fps wirkt flüssiger, braucht aber mehr CPU, während Steam startet. Ein in Steam selbst gewähltes Video erscheint hier ebenfalls. Ton Eigenes Video MP4, MOV, MKV oder WebM. Andere Formate und Dateien über %1$d MB werden auf dem Gerät in 720p-WebM umgewandelt, bis %2$d Sekunden. @@ -2693,6 +2693,51 @@ %1$s wird für Steam umgewandelt. DroidDeck geöffnet lassen. Dieses Gerät kann das Video nicht dekodieren. Das Video konnte nicht importiert werden + %1$s entfernen? + Dadurch wird das Video aus DroidDeck und aus dem Videoordner von Steam gelöscht. + Installiert + Importieren + SteamDeckRepo + Ton + Installierte Videos + Durchsuchen + DroidDeck + Importiert + SteamDeckRepo + Steam + Punkteshop + Bericht zu Startfilmen + Speichert in einer Textdatei, was DroidDeck und Steam über Startfilme wissen, zum Anhängen an einen Fehlerbericht. + Speichern + Gespeichert unter %1$s + Der Bericht konnte nicht gespeichert werden. + Lautstärke + Länge + %1$d s + Wie viele Sekunden des Films abgespielt werden. Alles, was länger ist, wird am Ende abgeschnitten. + SteamDeckRepo durchsuchen + Alle Geräte + Steam Deck + Steam Machine + Im Trend + Meistgeladen + Beliebteste + Neueste + SteamDeckRepo ist nicht erreichbar + Erneut versuchen + Keine Videos gefunden + Installieren + Verwenden + In Verwendung + %1$s installiert + Das Video konnte nicht heruntergeladen werden + Zurück + Weiter + Seite %1$d + Leeren + Zur Seite + Vorschau + Die Vorschau konnte nicht abgespielt werden Luma Ultra-Kameras – Experimentell Joy-Con-Positionsverfolgung Positionieren Sie Ihre gekoppelten Joy-Con-Controller mithilfe der Kameras Ihrer Smartbrille. Drehung und Tasteneingaben erfolgen über die Joy-Con-Controller. Die Position wird geschätzt, wenn Ihre Handgelenke verdeckt sind. Ersetzt Controller, die mit bloßen Händen bedient werden, und pausiert die Verfolgung per Smartphone-Kamera. Richten Sie die Joy-Con-Controller nach vorn, wenn Sie die Verbindung herstellen oder das Tracking-Center zurücksetzen. diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index bba71c05a0..40dbd1ced2 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -2150,7 +2150,7 @@ Μέγεθος Αποθήκευση Επαναφορά στην προεπιλογή - Σχεδιάζεται πάνω από το φόντο του παιχνιδιού, όπως κάνει το Steam. Η ακριβής θέση μπορεί να διαφέρει μερικά pixel. + Ακριβώς αυτή η θέση μπορεί να διαφέρει κατά μερικά pixel. Αυτό το παιχνίδι δεν έχει λογότυπο ακόμη. Διάλεξε ένα στο Λογότυπο για να το δεις εδώ. Η θέση του λογότυπου δεν αποθηκεύτηκε. Δοκίμασε ξανά. Φόντο @@ -2679,7 +2679,7 @@ Βίντεο εκκίνησης Βίντεο DroidDeck · %1$d fps - Τα 60 fps φαίνονται πιο ομαλά, αλλά επιβαρύνουν περισσότερο τον επεξεργαστή όσο ξεκινά το Steam. Ένα βίντεο εκκίνησης που επιλέχθηκε στις ρυθμίσεις του Steam έχει προτεραιότητα. + Τα 60 fps φαίνονται πιο ομαλά, αλλά επιβαρύνουν περισσότερο τον επεξεργαστή όσο ξεκινά το Steam. Ένα βίντεο που επιλέχθηκε στις ρυθμίσεις του Steam εμφανίζεται κι εδώ. Ήχος Δικό σας βίντεο MP4, MOV, MKV ή WebM. Άλλες μορφές και αρχεία πάνω από %1$d MB μετατρέπονται στη συσκευή σε WebM 720p, έως %2$d δευτερόλεπτα. @@ -2693,6 +2693,51 @@ Μετατροπή του %1$s για το Steam. Αφήστε το DroidDeck ανοιχτό. Η συσκευή δεν μπορεί να αποκωδικοποιήσει αυτό το βίντεο. Δεν ήταν δυνατή η εισαγωγή του βίντεο + Αφαίρεση του %1$s; + Το βίντεο θα διαγραφεί από το DroidDeck και από τον φάκελο βίντεο του Steam. + Εγκατεστημένα + Εισαγωγή + SteamDeckRepo + Ήχος + Εγκατεστημένα βίντεο + Περιήγηση + DroidDeck + Εισαγμένο + SteamDeckRepo + Steam + Κατάστημα πόντων + Αναφορά ταινιών εκκίνησης + Αποθηκεύει σε αρχείο κειμένου ό,τι γνωρίζουν το DroidDeck και το Steam για τις ταινίες εκκίνησης, για να το επισυνάψετε σε αναφορά σφάλματος. + Αποθήκευση + Αποθηκεύτηκε στο %1$s + Δεν ήταν δυνατή η αποθήκευση της αναφοράς. + Ένταση + Διάρκεια + %1$d δευτ. + Πόσα δευτερόλεπτα της ταινίας αναπαράγονται. Ό,τι είναι μεγαλύτερο κόβεται στο τέλος. + Αναζήτηση στο SteamDeckRepo + Όλες οι συσκευές + Steam Deck + Steam Machine + Τάσεις + Περισσότερες λήψεις + Περισσότερα likes + Νεότερα + Δεν ήταν δυνατή η σύνδεση με το SteamDeckRepo + Επανάληψη + Δεν βρέθηκαν βίντεο + Εγκατάσταση + Χρήση + Σε χρήση + Το %1$s εγκαταστάθηκε + Δεν ήταν δυνατή η λήψη αυτού του βίντεο + Προηγούμενη + Επόμενη + Σελίδα %1$d + Εκκαθάριση + Μετάβαση στη σελίδα + Προεπισκόπηση + Η προεπισκόπηση δεν μπόρεσε να αναπαραχθεί Κάμερες Luma Ultra — Πειραματικό Παρακολούθηση θέσης Joy-Con Χρησιμοποιήστε τις κάμερες των έξυπνων γυαλιών για να τοποθετήσετε τα συνδεδεμένα χειριστήρια Joy-Con. Η περιστροφή και οι εντολές κουμπιών προέρχονται από τα χειριστήρια Joy-Con. Η θέση εκτιμάται όταν οι καρποί σας είναι κρυμμένοι. Αντικαθιστά τα χειριστήρια που λειτουργούν με γυμνά χέρια και διακόπτει την παρακολούθηση της κάμερας του τηλεφώνου. Στρέψτε τα χειριστήρια Joy-Con προς τα εμπρός κατά τη σύνδεση ή την επαναφορά του κέντρου παρακολούθησης. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 46ab87b357..07d581180e 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -2165,7 +2165,7 @@ Tamaño Guardar Volver al valor predeterminado - Se dibuja sobre el fondo del juego, igual que en Steam. La posición exacta puede variar unos píxeles. + Este punto exacto puede variar unos pocos píxeles. Este juego aún no tiene logotipo. Elige uno en Logotipo para verlo aquí. No se pudo guardar la posición del logotipo. Inténtalo de nuevo. Fondo @@ -2713,7 +2713,7 @@ Vídeo de arranque Vídeo DroidDeck · %1$d fps - 60 fps se ve más fluido pero usa más CPU mientras Steam se inicia. Un vídeo de inicio elegido en los ajustes de Steam tiene prioridad. + 60 fps se ve más fluido pero usa más CPU mientras Steam se inicia. Un vídeo elegido en los ajustes de Steam también aparece aquí. Sonido Tu propio vídeo MP4, MOV, MKV o WebM. Otros formatos y archivos de más de %1$d MB se convierten a WebM 720p en el dispositivo, hasta %2$d segundos. @@ -2727,6 +2727,51 @@ Convirtiendo %1$s para Steam. Mantén DroidDeck abierto. Este dispositivo no puede decodificar ese vídeo. No se pudo importar ese vídeo + ¿Quitar %1$s? + Esto elimina el vídeo de DroidDeck y de la carpeta de vídeos de Steam. + Instalados + Importar + SteamDeckRepo + Sonido + Vídeos instalados + Explorar + DroidDeck + Importado + SteamDeckRepo + Steam + Tienda de puntos + Informe de películas de arranque + Guarda en un archivo de texto lo que DroidDeck y Steam saben de las películas de arranque, para adjuntarlo a un informe de error. + Guardar + Guardado en %1$s + No se pudo guardar el informe. + Volumen + Duración + %1$d s + Cuántos segundos de la película se reproducen. Lo que dure más se corta al final. + Buscar en SteamDeckRepo + Todos los dispositivos + Steam Deck + Steam Machine + Tendencias + Más descargados + Más valorados + Más recientes + No se pudo acceder a SteamDeckRepo + Reintentar + No se encontraron vídeos + Instalar + Usar + En uso + %1$s instalado + No se pudo descargar ese vídeo + Anterior + Siguiente + Página %1$d + Borrar + Ir a la página + Vista previa + No se pudo reproducir la vista previa Cámaras Luma Ultra — Experimental Seguimiento de posición de los Joy-Con Usa las cámaras de las gafas inteligentes para posicionar tus mandos Joy-Con emparejados. La rotación y las pulsaciones de los botones provienen de los mandos Joy-Con. La posición se estima cuando tus muñecas están ocultas. Reemplaza los mandos operados con las manos desnudas y pausa el seguimiento de la cámara del teléfono. Apunta los mandos Joy-Con hacia adelante al conectar o restablecer el centro de seguimiento. diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 86560920f5..85574fa932 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -2150,7 +2150,7 @@ Koko Tallenna Takaisin oletukseen - Piirretään pelin taustan päälle, kuten Steam tekee. Tarkka sijainti voi poiketa muutaman pikselin. + Tämä tarkka kohta voi vaihdella muutamalla pikselillä. Tällä pelillä ei ole vielä logoa. Valitse sellainen kohdasta Logo, niin näet sen tässä. Logon sijaintia ei voitu tallentaa. Yritä uudelleen. Tausta @@ -2679,7 +2679,7 @@ Käynnistysvideo Video DroidDeck · %1$d fps - 60 fps näyttää sulavammalta, mutta kuormittaa suoritinta enemmän Steamin käynnistyessä. Steamin omista asetuksista valittu käynnistysvideo on etusijalla. + 60 fps näyttää sulavammalta, mutta kuormittaa suoritinta enemmän Steamin käynnistyessä. Steamin omista asetuksista valittu video näkyy myös täällä. Ääni Oma video MP4, MOV, MKV tai WebM. Muut muodot ja yli %1$d Mt:n tiedostot muunnetaan laitteella 720p-WebM-muotoon, enintään %2$d sekuntia. @@ -2693,6 +2693,51 @@ Muunnetaan %1$s Steamille. Pidä DroidDeck auki. Laite ei pysty purkamaan videota. Videon tuonti epäonnistui + Poistetaanko %1$s? + Tämä poistaa videon DroidDeckistä ja Steamin videokansiosta. + Asennetut + Tuo + SteamDeckRepo + Ääni + Asennetut videot + Selaa + DroidDeck + Tuotu + SteamDeckRepo + Steam + Pisteputiikki + Käynnistyselokuvaraportti + Tallentaa tekstitiedostoon, mitä DroidDeck ja Steam tietävät käynnistyselokuvista, liitettäväksi virheilmoitukseen. + Tallenna + Tallennettu: %1$s + Raportin tallennus epäonnistui. + Äänenvoimakkuus + Pituus + %1$d s + Kuinka monta sekuntia elokuvasta toistetaan. Sitä pidempi osa leikataan pois lopusta. + Hae SteamDeckReposta + Kaikki laitteet + Steam Deck + Steam Machine + Trendaavat + Ladatuimmat + Tykätyimmät + Uusimmat + SteamDeckRepoon ei saatu yhteyttä + Yritä uudelleen + Videoita ei löytynyt + Asenna + Käytä + Käytössä + %1$s asennettu + Videota ei voitu ladata + Edellinen + Seuraava + Sivu %1$d + Tyhjennä + Siirry sivulle + Esikatselu + Esikatselua ei voitu toistaa Luma Ultra -kamerat — Kokeellinen Joy-Con-paikan seuranta Käytä älylasien kameroita pariliitettyjen Joy-Con-ohjainten asemointiin. Kierto- ja painikesyötteet tulevat Joy-Con-ohjaimista. Sijainti arvioidaan, kun ranteesi ovat piilossa. Korvaa paljain käsin käytettävät ohjaimet ja keskeyttää puhelimen kameran seurannan. Osoita Joy-Con-ohjaimet eteenpäin, kun yhdistät tai nollaat seurantakeskuksen. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index d81acc097c..fe2a4330f4 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -2165,7 +2165,7 @@ Taille Enregistrer Rétablir par défaut - Dessiné sur l\'arrière-plan du jeu, comme le fait Steam. La position exacte peut varier de quelques pixels. + Cet emplacement exact peut varier de quelques pixels. Ce jeu n\'a pas encore de logo. Choisissez-en un dans Logo pour le voir ici. Impossible d\'enregistrer la position du logo. Réessayez. Arrière-plan @@ -2713,7 +2713,7 @@ Vidéo de démarrage Vidéo DroidDeck · %1$d i/s - 60 i/s est plus fluide mais sollicite davantage le processeur pendant le démarrage de Steam. Une vidéo de démarrage choisie dans les paramètres de Steam est prioritaire. + 60 i/s est plus fluide mais sollicite davantage le processeur pendant le démarrage de Steam. Une vidéo choisie dans les paramètres de Steam apparaît aussi ici. Son Votre propre vidéo MP4, MOV, MKV ou WebM. Les autres formats et les fichiers de plus de %1$d Mo sont convertis en WebM 720p sur l\'appareil, jusqu\'à %2$d secondes. @@ -2727,6 +2727,51 @@ Conversion de %1$s pour Steam. Gardez DroidDeck ouvert. Cet appareil ne peut pas décoder cette vidéo. Impossible d\'importer cette vidéo + Supprimer %1$s ? + Cela supprime la vidéo de DroidDeck et du dossier de vidéos de Steam. + Installées + Importer + SteamDeckRepo + Son + Vidéos installées + Parcourir + DroidDeck + Importée + SteamDeckRepo + Steam + Boutique de points + Rapport sur les vidéos de démarrage + Enregistre dans un fichier texte ce que DroidDeck et Steam savent des vidéos de démarrage, à joindre à un rapport de bogue. + Enregistrer + Enregistré dans %1$s + Impossible d\'enregistrer le rapport. + Volume + Durée + %1$d s + Nombre de secondes du film qui sont lues. Tout ce qui dépasse est coupé à la fin. + Rechercher dans SteamDeckRepo + Tous les appareils + Steam Deck + Steam Machine + Tendances + Les plus téléchargées + Les plus aimées + Les plus récentes + Impossible de joindre SteamDeckRepo + Réessayer + Aucune vidéo trouvée + Installer + Utiliser + Utilisé + %1$s installée + Impossible de télécharger cette vidéo + Précédent + Suivant + Page %1$d + Effacer + Aller à la page + Aperçu + Impossible de lire cet aperçu Caméras Luma Ultra — Expérimental Suivi de la position des Joy-Con Utilisez les caméras des lunettes connectées pour positionner vos manettes Joy-Con appariées. La rotation et les entrées des boutons proviennent des manettes Joy-Con. La position est estimée lorsque vos poignets sont cachés. Remplace les manettes utilisées à mains nues et interrompt le suivi par la caméra du téléphone. Pointez les manettes Joy-Con vers l\'avant lors de la connexion ou de la réinitialisation du centre de suivi. diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index 07bd570ae8..fa32ff251c 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -2150,7 +2150,7 @@ आकार सहेजें डिफ़ॉल्ट पर लौटाएँ - गेम की पृष्ठभूमि के ऊपर बनता है, जैसे Steam करता है। सटीक स्थिति कुछ पिक्सेल अलग हो सकती है। + यह सटीक जगह कुछ पिक्सल तक अलग हो सकती है। इस गेम का लोगो अभी नहीं है। यहाँ देखने के लिए लोगो में से कोई चुनें। लोगो की स्थिति सहेजी नहीं जा सकी। फिर कोशिश करें। बैकग्राउंड @@ -2679,7 +2679,7 @@ बूट वीडियो वीडियो DroidDeck · %1$d fps - 60 fps ज़्यादा स्मूथ दिखता है, लेकिन Steam शुरू होते समय CPU ज़्यादा इस्तेमाल करता है। Steam की अपनी सेटिंग्स में चुना गया स्टार्टअप वीडियो प्राथमिकता लेता है। + 60 fps ज़्यादा स्मूथ दिखता है, लेकिन Steam शुरू होते समय CPU ज़्यादा इस्तेमाल करता है। Steam की अपनी सेटिंग्स में चुना गया वीडियो यहाँ भी दिखता है। आवाज़ अपना वीडियो MP4, MOV, MKV या WebM. दूसरे फ़ॉर्मैट और %1$d MB से बड़ी फ़ाइलें डिवाइस पर 720p WebM में बदली जाती हैं, %2$d सेकंड तक। @@ -2693,6 +2693,51 @@ %1$s को Steam के लिए बदला जा रहा है। DroidDeck खुला रखें। यह डिवाइस उस वीडियो को डिकोड नहीं कर सकता। वीडियो इंपोर्ट नहीं हो सका + %1$s हटाएं? + इससे वीडियो DroidDeck और Steam के वीडियो फ़ोल्डर से मिट जाएगा। + इंस्टॉल किए गए + इंपोर्ट करें + SteamDeckRepo + आवाज़ + इंस्टॉल किए गए वीडियो + ब्राउज़ करें + DroidDeck + इंपोर्ट किया गया + SteamDeckRepo + Steam + पॉइंट्स शॉप + बूट वीडियो रिपोर्ट + बूट वीडियो के बारे में DroidDeck और Steam की जानकारी एक टेक्स्ट फ़ाइल में सहेजता है, जिसे आप बग रिपोर्ट के साथ जोड़ सकते हैं। + सहेजें + %1$s में सहेजा गया + रिपोर्ट सहेजी नहीं जा सकी। + वॉल्यूम + अवधि + %1$d सेक + वीडियो के कितने सेकंड चलेंगे। इससे लंबा हिस्सा अंत में काट दिया जाता है। + SteamDeckRepo में खोजें + सभी डिवाइस + Steam Deck + Steam Machine + ट्रेंडिंग + सबसे ज़्यादा डाउनलोड किए गए + सबसे ज़्यादा पसंद किए गए + सबसे नए + SteamDeckRepo से कनेक्ट नहीं हो सका + फिर कोशिश करें + कोई वीडियो नहीं मिला + इंस्टॉल करें + इस्तेमाल करें + इस्तेमाल में + %1$s इंस्टॉल हो गया + वह वीडियो डाउनलोड नहीं हो सका + पिछला + अगला + पेज %1$d + साफ़ करें + पेज पर जाएँ + पूर्वावलोकन + यह पूर्वावलोकन चलाया नहीं जा सका Luma Ultra कैमरे — एक्सपेरिमेंटल Joy-Con पोजीशन ट्रैकिंग अपने पेयर्ड Joy-Con कंट्रोलर्स को सही जगह पर लगाने के लिए स्मार्ट ग्लास के कैमरे का इस्तेमाल करें। रोटेशन और बटन इनपुट Joy-Con कंट्रोलर्स से आते हैं। जब आपकी कलाइयां छिपी होती हैं, तो पोजीशन का अंदाज़ा लगाया जाता है। नंगे हाथों से चलने वाले कंट्रोलर्स को बदलता है और फ़ोन-कैमरा ट्रैकिंग को पॉज़ करता है। ट्रैकिंग सेंटर को कनेक्ट या रीसेट करते समय Joy-Con कंट्रोलर्स को आगे की ओर पॉइंट करें। diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index ef37ac8cae..1ea4d95be1 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -2150,7 +2150,7 @@ Méret Mentés Vissza az alapértelmezettre - A játék háttere fölött rajzolódik ki, ahogy a Steam is teszi. A pontos pozíció néhány pixellel eltérhet. + Ez a pontos hely néhány képpontnyit eltérhet. Ennek a játéknak még nincs logója. Válassz egyet a Logó alatt, hogy itt lásd. A logó pozícióját nem sikerült menteni. Próbáld újra. Háttér @@ -2679,7 +2679,7 @@ Indítóvideó Videó DroidDeck · %1$d fps - A 60 fps simább, de jobban terheli a processzort a Steam indulása közben. A Steam saját beállításaiban választott indítóvideó elsőbbséget élvez. + A 60 fps simább, de jobban terheli a processzort a Steam indulása közben. A Steam saját beállításaiban választott videó itt is megjelenik. Hang Saját videó MP4, MOV, MKV vagy WebM. Más formátumokat és a %1$d MB-nál nagyobb fájlokat az eszköz 720p WebM-re alakítja, legfeljebb %2$d másodpercig. @@ -2693,6 +2693,51 @@ %1$s átalakítása a Steamhez. Hagyd nyitva a DroidDecket. Ez az eszköz nem tudja dekódolni a videót. Nem sikerült importálni a videót + Eltávolítod: %1$s? + Ezzel törlődik a videó a DroidDeckből és a Steam videómappájából. + Telepítve + Importálás + SteamDeckRepo + Hang + Telepített videók + Tallózás + DroidDeck + Importált + SteamDeckRepo + Steam + Pontbolt + Indítóvideó-jelentés + Szöveges fájlba menti, amit a DroidDeck és a Steam tud az indítóvideókról, hibajelentéshez csatolható. + Mentés + Mentve: %1$s + A jelentést nem sikerült menteni. + Hangerő + Hossz + %1$d mp + A videó hány másodperce játszódik le. Ami ennél hosszabb, azt a végén levágjuk. + Keresés a SteamDeckRepo-ban + Minden eszköz + Steam Deck + Steam Machine + Népszerű + Legtöbbet letöltött + Legkedveltebb + Legújabb + Nem érhető el a SteamDeckRepo + Újra + Nem található videó + Telepítés + Használat + Használatban + %1$s telepítve + Nem sikerült letölteni a videót + Előző + Következő + %1$d. oldal + Törlés + Ugrás az oldalra + Előnézet + Az előnézetet nem sikerült lejátszani Luma Ultra kamerák — Kísérleti Joy-Con pozíciókövetés Használd az okosszemüveg kameráit a párosított Joy-Con kontrollerek pozicionálásához. A forgatás és a gombbemenetek a Joy-Con kontrollerekről származnak. A pozíció akkor becsült, amikor a csuklód rejtve van. Helyettesíti a puszta kézzel működtetett kontrollereket, és szünetelteti a telefonkamera követést. Irányítsd a Joy-Con kontrollereket előre a követőközpont csatlakoztatásakor vagy visszaállításakor. diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 9673e06eec..a08d3e5dbb 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -2129,7 +2129,7 @@ Ukuran Simpan Kembalikan ke bawaan - Digambar di atas latar gim, seperti yang dilakukan Steam. Posisi persisnya bisa berbeda beberapa piksel. + Posisi persis ini bisa berbeda beberapa piksel. Gim ini belum punya logo. Pilih salah satu di Logo untuk melihatnya di sini. Posisi logo tidak tersimpan. Coba lagi. Latar belakang @@ -2654,7 +2654,7 @@ Video boot Video DroidDeck · %1$d fps - 60 fps terlihat lebih mulus tetapi memakai lebih banyak CPU saat Steam dimulai. Video startup yang dipilih di pengaturan Steam sendiri lebih diutamakan. + 60 fps terlihat lebih mulus tetapi memakai lebih banyak CPU saat Steam dimulai. Video yang dipilih di pengaturan Steam sendiri juga muncul di sini. Suara Video sendiri MP4, MOV, MKV, atau WebM. Format lain dan file di atas %1$d MB dikonversi ke WebM 720p di perangkat, hingga %2$d detik. @@ -2668,6 +2668,51 @@ Mengonversi %1$s untuk Steam. Biarkan DroidDeck tetap terbuka. Perangkat ini tidak dapat mendekode video itu. Tidak dapat mengimpor video itu + Hapus %1$s? + Ini menghapus video dari DroidDeck dan dari folder video Steam. + Terpasang + Impor + SteamDeckRepo + Suara + Video terpasang + Telusuri + DroidDeck + Diimpor + SteamDeckRepo + Steam + Toko Poin + Laporan film boot + Menyimpan apa yang diketahui DroidDeck dan Steam tentang film boot ke berkas teks yang dapat dilampirkan pada laporan bug. + Simpan + Disimpan di %1$s + Laporan tidak dapat disimpan. + Volume + Durasi + %1$d dtk + Berapa detik film yang diputar. Bagian yang lebih panjang akan dipotong di bagian akhir. + Cari di SteamDeckRepo + Semua perangkat + Steam Deck + Steam Machine + Tren + Paling banyak diunduh + Paling disukai + Terbaru + Tidak dapat terhubung ke SteamDeckRepo + Coba lagi + Video tidak ditemukan + Pasang + Gunakan + Sedang digunakan + %1$s terpasang + Tidak dapat mengunduh video itu + Sebelumnya + Berikutnya + Halaman %1$d + Hapus + Buka halaman + Pratinjau + Pratinjau tidak dapat diputar Kamera Luma Ultra — Eksperimental Pelacakan posisi Joy-Con Gunakan kamera kacamata pintar untuk memposisikan pengontrol Joy-Con yang terpasang. Rotasi dan input tombol berasal dari pengontrol Joy-Con. Posisi diperkirakan saat pergelangan tangan Anda tersembunyi. Menggantikan pengontrol yang dioperasikan dengan tangan kosong dan menghentikan pelacakan kamera ponsel. Arahkan pengontrol Joy-Con ke depan saat menghubungkan atau mengatur ulang pusat pelacakan. diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 0a807b72e5..7b650591cd 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -2157,7 +2157,7 @@ Dimensione Salva Ripristina predefinita - Viene disegnato sullo sfondo del gioco, come fa Steam. La posizione esatta può variare di qualche pixel. + Questa posizione esatta può variare di qualche pixel. Questo gioco non ha ancora un logo. Scegline uno in Logo per vederlo qui. Impossibile salvare la posizione del logo. Riprova. Sfondo @@ -2713,7 +2713,7 @@ Video di avvio Video DroidDeck · %1$d fps - 60 fps è più fluido ma usa più CPU durante l\'avvio di Steam. Un video di avvio scelto nelle impostazioni di Steam ha la precedenza. + 60 fps è più fluido ma usa più CPU durante l\'avvio di Steam. Anche un video scelto nelle impostazioni di Steam compare qui. Audio Il tuo video MP4, MOV, MKV o WebM. Altri formati e file oltre %1$d MB vengono convertiti in WebM 720p sul dispositivo, fino a %2$d secondi. @@ -2727,6 +2727,51 @@ Conversione di %1$s per Steam. Tieni aperto DroidDeck. Questo dispositivo non può decodificare il video. Impossibile importare il video + Rimuovere %1$s? + Il video verrà eliminato da DroidDeck e dalla cartella video di Steam. + Installati + Importa + SteamDeckRepo + Audio + Video installati + Sfoglia + DroidDeck + Importato + SteamDeckRepo + Steam + Negozio punti + Rapporto sui filmati di avvio + Salva in un file di testo ciò che DroidDeck e Steam sanno sui filmati di avvio, da allegare a una segnalazione di bug. + Salva + Salvato in %1$s + Impossibile salvare il rapporto. + Volume + Durata + %1$d s + Quanti secondi del filmato vengono riprodotti. Tutto ciò che è più lungo viene tagliato alla fine. + Cerca in SteamDeckRepo + Tutti i dispositivi + Steam Deck + Steam Machine + Di tendenza + Più scaricati + Più apprezzati + Più recenti + Impossibile raggiungere SteamDeckRepo + Riprova + Nessun video trovato + Installa + Usa + In uso + %1$s installato + Impossibile scaricare il video + Precedente + Successivo + Pagina %1$d + Cancella + Vai alla pagina + Anteprima + Impossibile riprodurre l\'anteprima Fotocamere Luma Ultra — Sperimentale Tracciamento della posizione dei Joy-Con Utilizza le fotocamere degli occhiali smart per posizionare i controller Joy-Con associati. La rotazione e gli input dei pulsanti provengono dai controller Joy-Con. La posizione viene stimata quando i polsi sono nascosti. Sostituisce i controller utilizzati a mani nude e mette in pausa il tracciamento tramite la fotocamera del telefono. Punta i controller Joy-Con in avanti quando li connetti o reimposti il ​​centro di tracciamento. diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 149634e119..bee4299693 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -2129,7 +2129,7 @@ サイズ 保存 既定に戻す - ゲームの背景に、Steam と同じ方法で描画されます。位置が数ピクセルずれることがあります。 + この位置は数ピクセルずれることがあります。 このゲームにはまだロゴがありません。ロゴでいずれかを選ぶとここに表示されます。 ロゴの位置を保存できませんでした。もう一度お試しください。 背景 @@ -2654,7 +2654,7 @@ 起動ムービー ムービー DroidDeck · %1$d fps - 60 fps はなめらかですが、Steam の起動中に CPU をより多く使います。Steam 本体の設定で選んだ起動ムービーが優先されます。 + 60 fps はなめらかですが、Steam の起動中に CPU をより多く使います。Steam 本体の設定で選んだムービーもここに表示されます。 サウンド 自分のムービー MP4、MOV、MKV、WebM。その他の形式や %1$d MB を超えるファイルは、端末上で 720p の WebM に変換されます(%2$d 秒まで)。 @@ -2668,6 +2668,51 @@ %1$s を Steam 用に変換しています。DroidDeck を開いたままにしてください。 この端末ではその動画をデコードできません。 ムービーをインポートできませんでした + %1$s を削除しますか? + DroidDeck と Steam のムービーフォルダからムービーが削除されます。 + インストール済み + インポート + SteamDeckRepo + サウンド + インストール済みのムービー + 参照 + DroidDeck + インポート済み + SteamDeckRepo + Steam + ポイントショップ + 起動ムービーのレポート + DroidDeck と Steam が把握している起動ムービーの情報をテキストファイルに保存します。不具合報告に添付できます。 + 保存 + %1$s に保存しました + レポートを保存できませんでした。 + 音量 + 長さ + %1$d 秒 + ムービーを何秒間再生するかを設定します。それより長い部分は最後がカットされます。 + SteamDeckRepo を検索 + すべてのデバイス + Steam Deck + Steam Machine + トレンド + ダウンロード数順 + いいね順 + 新着順 + SteamDeckRepo に接続できませんでした + 再試行 + ムービーが見つかりません + インストール + 使用 + 使用中 + %1$s をインストールしました + ムービーをダウンロードできませんでした + 前へ + 次へ + %1$d ページ + クリア + ページへ移動 + プレビュー + プレビューを再生できませんでした スマートグラス スマートグラスを接続して、ディスプレイと追跡の設定を変更してください。接続を解除しても、保存された設定は保持されます。 VR diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index d9cfa15011..03e678056e 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -2129,7 +2129,7 @@ 크기 저장 기본값으로 - 게임 배경에 Steam과 같은 방식으로 그려집니다. 위치가 몇 픽셀 어긋날 수 있습니다. + 이 정확한 위치는 몇 픽셀 차이가 날 수 있습니다. 이 게임에는 아직 로고가 없습니다. 로고에서 하나를 고르면 여기에 표시됩니다. 로고 위치를 저장하지 못했습니다. 다시 시도하세요. 배경 @@ -2654,7 +2654,7 @@ 부팅 동영상 동영상 DroidDeck · %1$d fps - 60 fps는 더 부드럽지만 Steam이 시작되는 동안 CPU를 더 사용합니다. Steam 자체 설정에서 고른 시작 동영상이 우선합니다. + 60 fps는 더 부드럽지만 Steam이 시작되는 동안 CPU를 더 사용합니다. Steam 자체 설정에서 고른 동영상도 여기에 표시됩니다. 소리 내 동영상 MP4, MOV, MKV 또는 WebM. 다른 형식과 %1$d MB를 넘는 파일은 기기에서 720p WebM으로 변환됩니다(최대 %2$d초). @@ -2668,6 +2668,51 @@ Steam용으로 %1$s 변환 중입니다. DroidDeck을 열어 두세요. 이 기기에서 해당 동영상을 디코딩할 수 없습니다. 동영상을 가져오지 못했습니다 + %1$s을(를) 삭제할까요? + DroidDeck과 Steam의 동영상 폴더에서 동영상이 삭제됩니다. + 설치됨 + 가져오기 + SteamDeckRepo + 소리 + 설치된 동영상 + 찾아보기 + DroidDeck + 가져옴 + SteamDeckRepo + Steam + 포인트 상점 + 부팅 영상 보고서 + DroidDeck과 Steam이 부팅 영상에 대해 알고 있는 내용을 텍스트 파일로 저장합니다. 버그 보고서에 첨부할 수 있습니다. + 저장 + %1$s에 저장됨 + 보고서를 저장하지 못했습니다. + 볼륨 + 길이 + %1$d초 + 동영상을 몇 초 동안 재생할지 설정합니다. 그보다 긴 부분은 끝에서 잘립니다. + SteamDeckRepo 검색 + 모든 기기 + Steam Deck + Steam Machine + 인기 + 다운로드 많은 순 + 좋아요 많은 순 + 최신순 + SteamDeckRepo에 연결할 수 없습니다 + 다시 시도 + 동영상이 없습니다 + 설치 + 사용 + 사용 중 + %1$s 설치됨 + 동영상을 다운로드하지 못했습니다 + 이전 + 다음 + %1$d페이지 + 지우기 + 페이지로 이동 + 미리보기 + 미리보기를 재생할 수 없습니다 Luma Ultra 카메라 — 실험적 기능 Joy-Con 위치 추적 스마트 안경 카메라를 사용하여 페어링된 Joy-Con 컨트롤러의 위치를 ​​조정합니다. 회전 및 버튼 입력은 Joy-Con 컨트롤러에서 이루어집니다. 손목이 가려진 경우 위치가 추정됩니다. 맨손으로 조작하는 컨트롤러를 대체하며, 휴대폰 카메라 추적이 일시 중지됩니다. 추적 센터를 연결하거나 재설정할 때는 Joy-Con 컨트롤러를 앞쪽으로 향하게 하십시오. diff --git a/app/src/main/res/values-ms/strings.xml b/app/src/main/res/values-ms/strings.xml index bf3e97a2d7..96f8207c6a 100644 --- a/app/src/main/res/values-ms/strings.xml +++ b/app/src/main/res/values-ms/strings.xml @@ -2129,7 +2129,7 @@ Saiz Simpan Kembali kepada lalai - Dilukis di atas latar belakang permainan, seperti yang dibuat oleh Steam. Kedudukan tepatnya mungkin berbeza beberapa piksel. + Kedudukan tepat ini mungkin berbeza beberapa piksel. Permainan ini belum ada logo. Pilih satu di Logo untuk melihatnya di sini. Kedudukan logo tidak dapat disimpan. Cuba lagi. Latar belakang @@ -2654,7 +2654,7 @@ Video but Video DroidDeck · %1$d fps - 60 fps kelihatan lebih lancar tetapi menggunakan lebih banyak CPU semasa Steam bermula. Video permulaan yang dipilih dalam tetapan Steam sendiri diutamakan. + 60 fps kelihatan lebih lancar tetapi menggunakan lebih banyak CPU semasa Steam bermula. Video yang dipilih dalam tetapan Steam sendiri turut dipaparkan di sini. Bunyi Video anda sendiri MP4, MOV, MKV atau WebM. Format lain dan fail melebihi %1$d MB ditukar kepada WebM 720p pada peranti, sehingga %2$d saat. @@ -2668,6 +2668,51 @@ Menukar %1$s untuk Steam. Biarkan DroidDeck terbuka. Peranti ini tidak dapat menyahkod video itu. Tidak dapat mengimport video itu + Alih keluar %1$s? + Ini memadamkan video daripada DroidDeck dan daripada folder video Steam. + Dipasang + Import + SteamDeckRepo + Bunyi + Video dipasang + Layari + DroidDeck + Diimport + SteamDeckRepo + Steam + Kedai Mata + Laporan filem but + Menyimpan apa yang DroidDeck dan Steam ketahui tentang filem but ke dalam fail teks yang boleh dilampirkan pada laporan pepijat. + Simpan + Disimpan di %1$s + Laporan tidak dapat disimpan. + Kelantangan + Tempoh + %1$d s + Berapa saat filem dimainkan. Bahagian yang lebih panjang akan dipotong pada penghujungnya. + Cari SteamDeckRepo + Semua peranti + Steam Deck + Steam Machine + Sohor kini + Paling banyak dimuat turun + Paling disukai + Terbaharu + Tidak dapat menghubungi SteamDeckRepo + Cuba semula + Tiada video ditemui + Pasang + Guna + Sedang digunakan + %1$s dipasang + Tidak dapat memuat turun video itu + Sebelumnya + Seterusnya + Halaman %1$d + Kosongkan + Pergi ke halaman + Pratonton + Pratonton tidak dapat dimainkan Kamera Luma Ultra — Eksperimen Penjejakan kedudukan Joy-Con Gunakan kamera cermin mata pintar untuk meletakkan pengawal Joy-Con yang dipasangkan. Input putaran dan butang datang daripada pengawal Joy-Con. Kedudukan dianggarkan apabila pergelangan tangan anda tersembunyi. Menggantikan pengawal yang dikendalikan dengan tangan kosong dan menjeda penjejakan kamera telefon. Halakan pengawal Joy-Con ke hadapan semasa menyambung atau menetapkan semula pusat penjejakan. diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 73f552bfc9..37d099a59a 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -2150,7 +2150,7 @@ Størrelse Lagre Tilbake til standard - Tegnes oppå spillets bakgrunn, slik Steam gjør. Den nøyaktige posisjonen kan avvike noen piksler. + Denne nøyaktige plasseringen kan avvike med noen piksler. Dette spillet har ingen logo ennå. Velg en under Logo for å se den her. Logoposisjonen kunne ikke lagres. Prøv igjen. Bakgrunn @@ -2679,7 +2679,7 @@ Oppstartsvideo Video DroidDeck · %1$d fps - 60 fps ser jevnere ut, men bruker mer CPU mens Steam starter. En oppstartsvideo valgt i Steams egne innstillinger har forrang. + 60 fps ser jevnere ut, men bruker mer CPU mens Steam starter. En video valgt i Steams egne innstillinger vises også her. Lyd Din egen video MP4, MOV, MKV eller WebM. Andre formater og filer over %1$d MB konverteres til 720p-WebM på enheten, opptil %2$d sekunder. @@ -2693,6 +2693,51 @@ Konverterer %1$s for Steam. Hold DroidDeck åpen. Enheten kan ikke dekode videoen. Kunne ikke importere videoen + Fjerne %1$s? + Dette sletter videoen fra DroidDeck og fra Steams videomappe. + Installert + Importer + SteamDeckRepo + Lyd + Installerte videoer + Bla gjennom + DroidDeck + Importert + SteamDeckRepo + Steam + Poengbutikk + Rapport om oppstartsfilmer + Lagrer det DroidDeck og Steam vet om oppstartsfilmer i en tekstfil du kan legge ved en feilrapport. + Lagre + Lagret i %1$s + Rapporten kunne ikke lagres. + Volum + Lengde + %1$d s + Hvor mange sekunder av filmen som spilles av. Alt som er lengre, klippes bort på slutten. + Søk i SteamDeckRepo + Alle enheter + Steam Deck + Steam Machine + Trender + Mest nedlastet + Mest likt + Nyeste + Fikk ikke kontakt med SteamDeckRepo + Prøv igjen + Fant ingen videoer + Installer + Bruk + I bruk + %1$s installert + Kunne ikke laste ned videoen + Forrige + Neste + Side %1$d + Tøm + Gå til side + Forhåndsvis + Forhåndsvisningen kunne ikke spilles av Luma Ultra-kameraer – Eksperimentelt Joy-Con-posisjonssporing Bruk smartbrillenes kameraer til å plassere de parede Joy-Con-kontrollerne. Rotasjon og knappinndata kommer fra Joy-Con-kontrollerne. Posisjonen estimeres når håndleddene dine er skjult. Erstatter kontrollere som betjenes med bare hender og pauser sporing av telefonkamera. Rett Joy-Con-kontrollerne fremover når du kobler til eller tilbakestiller sporingssenteret. diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 6cd75efa24..e2d4ffa988 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -2150,7 +2150,7 @@ Grootte Opslaan Terug naar standaard - Wordt over de achtergrond van de game getekend, zoals Steam doet. De exacte positie kan een paar pixels afwijken. + Deze exacte plek kan een paar pixels verschillen. Deze game heeft nog geen logo. Kies er een bij Logo om het hier te zien. De logopositie kon niet worden opgeslagen. Probeer het opnieuw. Achtergrond @@ -2679,7 +2679,7 @@ Opstartvideo Video DroidDeck · %1$d fps - 60 fps oogt vloeiender maar gebruikt meer CPU terwijl Steam opstart. Een opstartvideo die in Steam zelf is gekozen heeft voorrang. + 60 fps oogt vloeiender maar gebruikt meer CPU terwijl Steam opstart. Een video die in Steam zelf is gekozen verschijnt hier ook. Geluid Eigen video MP4, MOV, MKV of WebM. Andere formaten en bestanden boven %1$d MB worden op het apparaat omgezet naar 720p-WebM, tot %2$d seconden. @@ -2693,6 +2693,51 @@ %1$s wordt omgezet voor Steam. Houd DroidDeck open. Dit apparaat kan deze video niet decoderen. Kan deze video niet importeren + %1$s verwijderen? + Hiermee wordt de video verwijderd uit DroidDeck en uit de videomap van Steam. + Geïnstalleerd + Importeren + SteamDeckRepo + Geluid + Geïnstalleerde video\'s + Bladeren + DroidDeck + Geïmporteerd + SteamDeckRepo + Steam + Puntenwinkel + Rapport over opstartfilms + Slaat op in een tekstbestand wat DroidDeck en Steam weten over opstartfilms, om bij een bugrapport te voegen. + Opslaan + Opgeslagen in %1$s + Het rapport kon niet worden opgeslagen. + Volume + Duur + %1$d s + Hoeveel seconden van de film worden afgespeeld. Alles wat langer is, wordt aan het einde afgekapt. + Zoeken in SteamDeckRepo + Alle apparaten + Steam Deck + Steam Machine + Trending + Meest gedownload + Meest geliked + Nieuwste + Kan SteamDeckRepo niet bereiken + Opnieuw + Geen video\'s gevonden + Installeren + Gebruiken + In gebruik + %1$s geïnstalleerd + Kan die video niet downloaden + Vorige + Volgende + Pagina %1$d + Wissen + Ga naar pagina + Voorbeeld + Het voorbeeld kon niet worden afgespeeld Luma Ultra-camera\'s — Experimenteel Positietracking van Joy-Con-controllers Gebruik de camera\'s van de smartbril om je gekoppelde Joy-Con-controllers te positioneren. Rotatie en knopbediening komen van de Joy-Con-controllers. De positie wordt geschat wanneer je polsen verborgen zijn. Vervangt controllers die met blote handen worden bediend en pauzeert de tracking door de telefooncamera. Richt de Joy-Con-controllers naar voren bij het verbinden of resetten van het trackingcentrum. diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index e2ee253597..9e8459774b 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -2192,7 +2192,7 @@ Rozmiar Zapisz Przywróć domyślne - Logo jest rysowane na tle gry, tak jak robi to Steam. Dokładna pozycja może się różnić o kilka pikseli. + To dokładne miejsce może różnić się o kilka pikseli. Ta gra nie ma jeszcze logo. Wybierz je w Logo, aby zobaczyć je tutaj. Nie udało się zapisać pozycji logo. Spróbuj ponownie. Tło @@ -2747,7 +2747,7 @@ Film startowy Film DroidDeck · %1$d kl./s - 60 kl./s wygląda płynniej, ale bardziej obciąża procesor podczas uruchamiania Steam. Film startowy wybrany w ustawieniach Steam ma pierwszeństwo. + 60 kl./s wygląda płynniej, ale bardziej obciąża procesor podczas uruchamiania Steam. Film wybrany w ustawieniach Steam też jest tu widoczny. Dźwięk Własny film MP4, MOV, MKV lub WebM. Inne formaty i pliki powyżej %1$d MB są konwertowane na urządzeniu do WebM 720p, do %2$d sekund. @@ -2761,6 +2761,51 @@ Konwertowanie %1$s dla Steam. Nie zamykaj DroidDeck. To urządzenie nie może zdekodować tego filmu. Nie udało się zaimportować filmu + Usunąć %1$s? + Film zostanie usunięty z DroidDeck i z folderu filmów Steam. + Zainstalowane + Importuj + SteamDeckRepo + Dźwięk + Zainstalowane filmy + Przeglądaj + DroidDeck + Zaimportowane + SteamDeckRepo + Steam + Sklep za punkty + Raport o filmach startowych + Zapisuje w pliku tekstowym to, co DroidDeck i Steam wiedzą o filmach startowych, do dołączenia do zgłoszenia błędu. + Zapisz + Zapisano w %1$s + Nie udało się zapisać raportu. + Głośność + Długość + %1$d s + Ile sekund filmu jest odtwarzane. Wszystko, co trwa dłużej, jest ucinane na końcu. + Szukaj w SteamDeckRepo + Wszystkie urządzenia + Steam Deck + Steam Machine + Na czasie + Najczęściej pobierane + Najbardziej lubiane + Najnowsze + Nie można połączyć z SteamDeckRepo + Ponów + Nie znaleziono filmów + Zainstaluj + Użyj + W użyciu + Zainstalowano %1$s + Nie udało się pobrać tego filmu + Poprzednia + Następna + Strona %1$d + Wyczyść + Przejdź do strony + Podgląd + Nie udało się odtworzyć podglądu Kamery Luma Ultra — Eksperymentalne Śledzenie pozycji Joy-Conów Użyj kamer w inteligentnych okularach, aby ustawić sparowane kontrolery Joy-Con. Obrót i sterowanie przyciskami pochodzą z kontrolerów Joy-Con. Pozycja jest szacowana, gdy nadgarstki są ukryte. Zastępuje kontrolery obsługiwane gołymi rękami i wstrzymuje śledzenie kamery telefonu. Skieruj kontrolery Joy-Con do przodu podczas podłączania lub resetowania centrum śledzenia. diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index b1b6ccebd3..059af95511 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -2157,7 +2157,7 @@ Tamanho Guardar Repor predefinição - É desenhado sobre o fundo do jogo, como o Steam faz. A posição exata pode variar alguns píxeis. + Esta posição exata pode variar alguns píxeis. Este jogo ainda não tem logótipo. Escolha um em Logótipo para o ver aqui. Não foi possível guardar a posição do logótipo. Tente novamente. Fundo @@ -2713,7 +2713,7 @@ Vídeo de arranque Vídeo DroidDeck · %1$d fps - 60 fps é mais fluido, mas usa mais CPU enquanto o Steam arranca. Um vídeo de arranque escolhido nas definições do Steam tem prioridade. + 60 fps é mais fluido, mas usa mais CPU enquanto o Steam arranca. Um vídeo escolhido nas definições do Steam também aparece aqui. Som O seu próprio vídeo MP4, MOV, MKV ou WebM. Outros formatos e ficheiros acima de %1$d MB são convertidos para WebM 720p no dispositivo, até %2$d segundos. @@ -2727,6 +2727,51 @@ A converter %1$s para o Steam. Mantenha o DroidDeck aberto. Este dispositivo não consegue descodificar esse vídeo. Não foi possível importar esse vídeo + Remover %1$s? + Isto elimina o vídeo do DroidDeck e da pasta de vídeos do Steam. + Instalados + Importar + SteamDeckRepo + Som + Vídeos instalados + Explorar + DroidDeck + Importado + SteamDeckRepo + Steam + Loja de Pontos + Relatório dos filmes de arranque + Guarda num ficheiro de texto o que o DroidDeck e o Steam sabem sobre os filmes de arranque, para anexar a um relatório de erro. + Guardar + Guardado em %1$s + Não foi possível guardar o relatório. + Volume + Duração + %1$d s + Quantos segundos do filme são reproduzidos. Tudo o que for mais longo é cortado no fim. + Pesquisar no SteamDeckRepo + Todos os dispositivos + Steam Deck + Steam Machine + Em destaque + Mais transferidos + Mais gostados + Mais recentes + Não foi possível aceder ao SteamDeckRepo + Tentar novamente + Nenhum vídeo encontrado + Instalar + Usar + Em utilização + %1$s instalado + Não foi possível transferir esse vídeo + Anterior + Seguinte + Página %1$d + Limpar + Ir para a página + Pré-visualizar + Não foi possível reproduzir a pré-visualização Câmaras Luma Ultra — Experimental Rastreio de posição do Joy-Con Utilize as câmaras dos óculos inteligentes para posicionar os seus comandos Joy-Con emparelhados. A rotação e os comandos dos botões vêm dos comandos Joy-Con. A posição é estimada quando os seus pulsos estão escondidos. Substitui os controlos operados com as mãos nuas e pausa o rastreio da câmara do telefone. Aponte os controlos Joy-Con para a frente ao ligar ou repor o centro de seguimento. diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 28184bdafd..68a46590ff 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -2157,7 +2157,7 @@ Tamanho Salvar Voltar ao padrão - É desenhado sobre o plano de fundo do jogo, como a Steam faz. A posição exata pode variar alguns pixels. + Esta posição exata pode variar alguns pixels. Este jogo ainda não tem logo. Escolha um em Logo para vê-lo aqui. Não foi possível salvar a posição do logo. Tente de novo. Fundo @@ -2713,7 +2713,7 @@ Vídeo de inicialização Vídeo DroidDeck · %1$d fps - 60 fps fica mais fluido, mas usa mais CPU enquanto o Steam inicia. Um vídeo de inicialização escolhido nas configurações do Steam tem prioridade. + 60 fps fica mais fluido, mas usa mais CPU enquanto o Steam inicia. Um vídeo escolhido nas configurações do Steam também aparece aqui. Som Seu próprio vídeo MP4, MOV, MKV ou WebM. Outros formatos e arquivos acima de %1$d MB são convertidos para WebM 720p no aparelho, até %2$d segundos. @@ -2727,6 +2727,51 @@ Convertendo %1$s para o Steam. Mantenha o DroidDeck aberto. Este aparelho não consegue decodificar esse vídeo. Não foi possível importar esse vídeo + Remover %1$s? + Isso exclui o vídeo do DroidDeck e da pasta de vídeos do Steam. + Instalados + Importar + SteamDeckRepo + Som + Vídeos instalados + Explorar + DroidDeck + Importado + SteamDeckRepo + Steam + Loja de Pontos + Relatório dos filmes de inicialização + Salva em um arquivo de texto o que o DroidDeck e o Steam sabem sobre os filmes de inicialização, para anexar a um relatório de bug. + Salvar + Salvo em %1$s + Não foi possível salvar o relatório. + Volume + Duração + %1$d s + Quantos segundos do vídeo são reproduzidos. Tudo o que for mais longo é cortado no final. + Pesquisar no SteamDeckRepo + Todos os dispositivos + Steam Deck + Steam Machine + Em alta + Mais baixados + Mais curtidos + Mais recentes + Não foi possível acessar o SteamDeckRepo + Tentar novamente + Nenhum vídeo encontrado + Instalar + Usar + Em uso + %1$s instalado + Não foi possível baixar esse vídeo + Anterior + Próxima + Página %1$d + Limpar + Ir para a página + Pré-visualizar + Não foi possível reproduzir a pré-visualização Câmeras Luma Ultra — Experimental Rastreamento de posição do Joy-Con Use as câmeras dos óculos inteligentes para posicionar seus controles Joy-Con emparelhados. A rotação e os comandos dos botões vêm dos controles Joy-Con. A posição é estimada quando seus pulsos estão escondidos. Substitui os controles operados com as mãos nuas e pausa o rastreamento da câmera do telefone. Aponte os controles Joy-Con para frente ao conectar ou redefinir o centro de rastreamento. diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 6e4435df00..7bf7df032e 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -2171,7 +2171,7 @@ Dimensiune Salvează Revino la implicit - Se desenează peste fundalul jocului, ca în Steam. Poziția exactă poate diferi cu câțiva pixeli. + Poziția exactă poate diferi cu câțiva pixeli. Acest joc nu are încă un logo. Alege unul la Logo ca să îl vezi aici. Poziția logo-ului nu a putut fi salvată. Încearcă din nou. Fundal @@ -2713,7 +2713,7 @@ Videoclip de pornire Videoclip DroidDeck · %1$d fps - 60 fps arată mai fluid, dar folosește mai mult procesorul cât pornește Steam. Un videoclip de pornire ales în setările Steam are prioritate. + 60 fps arată mai fluid, dar folosește mai mult procesorul cât pornește Steam. Un videoclip ales în setările Steam apare și aici. Sunet Videoclipul tău MP4, MOV, MKV sau WebM. Alte formate și fișierele de peste %1$d MB sunt convertite pe dispozitiv în WebM 720p, până la %2$d secunde. @@ -2727,6 +2727,51 @@ Se convertește %1$s pentru Steam. Lasă DroidDeck deschis. Acest dispozitiv nu poate decoda videoclipul. Videoclipul nu a putut fi importat + Elimini %1$s? + Videoclipul va fi șters din DroidDeck și din folderul de videoclipuri Steam. + Instalate + Importă + SteamDeckRepo + Sunet + Videoclipuri instalate + Răsfoiește + DroidDeck + Importat + SteamDeckRepo + Steam + Magazin de puncte + Raport despre filmele de pornire + Salvează într-un fișier text ce știu DroidDeck și Steam despre filmele de pornire, pentru a-l atașa la un raport de eroare. + Salvează + Salvat în %1$s + Raportul nu a putut fi salvat. + Volum + Durată + %1$d s + Câte secunde din film se redau. Tot ce este mai lung este tăiat la final. + Caută în SteamDeckRepo + Toate dispozitivele + Steam Deck + Steam Machine + Populare + Cele mai descărcate + Cele mai apreciate + Cele mai noi + Nu s-a putut contacta SteamDeckRepo + Reîncearcă + Nu s-au găsit videoclipuri + Instalează + Folosește + În uz + %1$s instalat + Videoclipul nu a putut fi descărcat + Înapoi + Înainte + Pagina %1$d + Șterge + Mergi la pagina + Previzualizare + Previzualizarea nu a putut fi redată Camere Luma Ultra — Experimentale Urmărirea poziției Joy-Con Folosește camerele ochelarilor inteligenți pentru a poziționa controlerele Joy-Con asociate. Rotirea și comenzile de butoane provin de la controlerele Joy-Con. Poziția este estimată atunci când încheieturile mâinilor sunt ascunse. Înlocuiește controlerele acționate cu mâinile goale și întrerupe urmărirea camerei telefonului. Îndreaptă controlerele Joy-Con înainte atunci când conectezi sau resetezi centrul de urmărire. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index ec52c1287e..4489ed3bb1 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -2186,7 +2186,7 @@ Размер Сохранить Вернуть по умолчанию - Рисуется поверх фона игры, как в Steam. Точное положение может отличаться на несколько пикселей. + Точное положение может отличаться на несколько пикселей. У этой игры пока нет логотипа. Выберите его в разделе «Логотип», чтобы увидеть здесь. Не удалось сохранить положение логотипа. Попробуйте ещё раз. Фон @@ -2747,7 +2747,7 @@ Загрузочное видео Видео DroidDeck · %1$d кадр/с - 60 кадр/с выглядит плавнее, но сильнее нагружает процессор при запуске Steam. Видео при запуске, выбранное в настройках самого Steam, имеет приоритет. + 60 кадр/с выглядит плавнее, но сильнее нагружает процессор при запуске Steam. Видео, выбранное в настройках самого Steam, тоже появляется здесь. Звук Своё видео MP4, MOV, MKV или WebM. Другие форматы и файлы больше %1$d МБ преобразуются на устройстве в WebM 720p, до %2$d секунд. @@ -2761,6 +2761,51 @@ %1$s преобразуется для Steam. Не закрывайте DroidDeck. Устройство не может декодировать это видео. Не удалось импортировать видео + Удалить %1$s? + Видео будет удалено из DroidDeck и из папки видео Steam. + Установленные + Импорт + SteamDeckRepo + Звук + Установленные видео + Обзор + DroidDeck + Импортировано + SteamDeckRepo + Steam + Магазин баллов + Отчет о загрузочных роликах + Сохраняет в текстовый файл то, что DroidDeck и Steam знают о загрузочных роликах, чтобы приложить к сообщению об ошибке. + Сохранить + Сохранено: %1$s + Не удалось сохранить отчет. + Громкость + Длительность + %1$d с + Сколько секунд фильма воспроизводится. Всё, что длиннее, обрезается в конце. + Поиск в SteamDeckRepo + Все устройства + Steam Deck + Steam Machine + В тренде + Больше всего загрузок + Больше всего лайков + Новые + Не удалось подключиться к SteamDeckRepo + Повторить + Видео не найдены + Установить + Использовать + Используется + %1$s установлено + Не удалось скачать это видео + Назад + Далее + Страница %1$d + Очистить + Перейти к странице + Просмотр + Не удалось воспроизвести предпросмотр Камеры Luma Ultra — Экспериментальная Отслеживание положения Joy-Con Используйте камеры умных очков для позиционирования сопряженных контроллеров Joy-Con. Вращение и ввод с кнопок осуществляются с помощью контроллеров Joy-Con. Положение оценивается, когда ваши запястья скрыты. Заменяет контроллеры, управляемые голыми руками, и приостанавливает отслеживание камерой телефона. Направьте контроллеры Joy-Con вперед при подключении или сбросе центра отслеживания. diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 2d15731757..4a2ec518d6 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -2150,7 +2150,7 @@ Storlek Spara Tillbaka till standard - Ritas ovanpå spelets bakgrund, som Steam gör. Exakt position kan skilja några pixlar. + Den exakta positionen kan avvika med några pixlar. Det här spelet har ingen logotyp än. Välj en under Logotyp för att se den här. Logotypens position kunde inte sparas. Försök igen. Bakgrund @@ -2679,7 +2679,7 @@ Startvideo Video DroidDeck · %1$d fps - 60 fps ser jämnare ut men använder mer CPU medan Steam startar. En startvideo vald i Steams egna inställningar har företräde. + 60 fps ser jämnare ut men använder mer CPU medan Steam startar. En video vald i Steams egna inställningar visas också här. Ljud Egen video MP4, MOV, MKV eller WebM. Andra format och filer över %1$d MB konverteras till 720p-WebM på enheten, upp till %2$d sekunder. @@ -2693,6 +2693,51 @@ Konverterar %1$s för Steam. Håll DroidDeck öppet. Enheten kan inte avkoda videon. Kunde inte importera videon + Ta bort %1$s? + Videon tas bort från DroidDeck och från Steams videomapp. + Installerade + Importera + SteamDeckRepo + Ljud + Installerade videor + Bläddra + DroidDeck + Importerad + SteamDeckRepo + Steam + Poängbutiken + Rapport om startfilmer + Sparar det DroidDeck och Steam vet om startfilmer i en textfil som du kan bifoga en felrapport. + Spara + Sparad i %1$s + Rapporten kunde inte sparas. + Volym + Längd + %1$d s + Hur många sekunder av filmen som spelas upp. Allt som är längre klipps bort i slutet. + Sök i SteamDeckRepo + Alla enheter + Steam Deck + Steam Machine + Trendar + Mest nedladdade + Mest gillade + Nyast + Kunde inte nå SteamDeckRepo + Försök igen + Inga videor hittades + Installera + Använd + Används + %1$s installerad + Kunde inte ladda ner videon + Föregående + Nästa + Sida %1$d + Rensa + Gå till sida + Förhandsvisa + Förhandsvisningen kunde inte spelas upp Luma Ultra-kameror — Experimentell Joy-Con-positionsspårning Använd smartglasögonens kameror för att placera dina parade Joy-Con-kontroller. Rotation och knappinmatningar kommer från Joy-Con-kontrollerna. Positionen uppskattas när dina handleder är dolda. Ersätter kontroller som manövreras med bara händer och pausar telefonkameran. Rikta Joy-Con-kontrollerna framåt när du ansluter eller återställer spårningscentret. diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index ba19621290..67a5906f67 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -2129,7 +2129,7 @@ ขนาด บันทึก กลับเป็นค่าเริ่มต้น - วาดทับพื้นหลังของเกมเหมือนที่ Steam ทำ ตำแหน่งจริงอาจต่างไปสองสามพิกเซล + ตำแหน่งที่แน่นอนอาจต่างกันไปไม่กี่พิกเซล เกมนี้ยังไม่มีโลโก้ เลือกในโลโก้เพื่อดูที่นี่ บันทึกตำแหน่งโลโก้ไม่ได้ ลองอีกครั้ง พื้นหลัง @@ -2654,7 +2654,7 @@ วิดีโอบูต วิดีโอ DroidDeck · %1$d fps - 60 fps ลื่นกว่าแต่ใช้ CPU มากขึ้นระหว่างที่ Steam กำลังเริ่ม วิดีโอเริ่มต้นที่เลือกในการตั้งค่าของ Steam เองจะมีลำดับความสำคัญกว่า + 60 fps ลื่นกว่าแต่ใช้ CPU มากขึ้นระหว่างที่ Steam กำลังเริ่ม วิดีโอที่เลือกในการตั้งค่าของ Steam เองจะแสดงที่นี่ด้วย เสียง วิดีโอของคุณเอง MP4, MOV, MKV หรือ WebM รูปแบบอื่นและไฟล์ที่ใหญ่กว่า %1$d MB จะถูกแปลงเป็น WebM 720p บนอุปกรณ์ ความยาวไม่เกิน %2$d วินาที @@ -2668,6 +2668,51 @@ กำลังแปลง %1$s สำหรับ Steam โปรดเปิด DroidDeck ค้างไว้ อุปกรณ์นี้ถอดรหัสวิดีโอนั้นไม่ได้ นำเข้าวิดีโอนี้ไม่ได้ + ลบ %1$s หรือไม่? + วิดีโอจะถูกลบออกจาก DroidDeck และจากโฟลเดอร์วิดีโอของ Steam + ติดตั้งแล้ว + นำเข้า + SteamDeckRepo + เสียง + วิดีโอที่ติดตั้งแล้ว + เรียกดู + DroidDeck + นำเข้าแล้ว + SteamDeckRepo + Steam + ร้านค้าแต้ม + รายงานวิดีโอเปิดเครื่อง + บันทึกสิ่งที่ DroidDeck และ Steam รู้เกี่ยวกับวิดีโอเปิดเครื่องลงในไฟล์ข้อความ เพื่อแนบกับรายงานข้อบกพร่อง + บันทึก + บันทึกไปที่ %1$s แล้ว + ไม่สามารถบันทึกรายงานได้ + ระดับเสียง + ความยาว + %1$d วิ + จำนวนวินาทีของภาพยนตร์ที่จะเล่น ส่วนที่ยาวเกินกว่านั้นจะถูกตัดออกที่ท้าย + ค้นหาใน SteamDeckRepo + ทุกอุปกรณ์ + Steam Deck + Steam Machine + มาแรง + ดาวน์โหลดมากที่สุด + ถูกใจมากที่สุด + ใหม่ล่าสุด + เชื่อมต่อ SteamDeckRepo ไม่ได้ + ลองอีกครั้ง + ไม่พบวิดีโอ + ติดตั้ง + ใช้ + กำลังใช้งาน + ติดตั้ง %1$s แล้ว + ดาวน์โหลดวิดีโอนั้นไม่ได้ + ก่อนหน้า + ถัดไป + หน้า %1$d + ล้าง + ไปที่หน้า + ดูตัวอย่าง + เล่นตัวอย่างไม่ได้ กล้อง Luma Ultra — ทดลอง การติดตามตำแหน่ง Joy-Con ใช้กล้องของแว่นตาอัจฉริยะเพื่อกำหนดตำแหน่งคอนโทรลเลอร์ Joy-Con ที่จับคู่ไว้ การหมุนและการกดปุ่มจะมาจากคอนโทรลเลอร์ Joy-Con ตำแหน่งจะถูกประมาณเมื่อข้อมือของคุณถูกซ่อนอยู่ แทนที่คอนโทรลเลอร์ที่ใช้งานด้วยมือเปล่าและหยุดการติดตามของกล้องโทรศัพท์ชั่วคราว ชี้คอนโทรลเลอร์ Joy-Con ไปข้างหน้าเมื่อเชื่อมต่อหรือรีเซ็ตศูนย์กลางการติดตาม diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index d782c221b4..912ef175c5 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -2136,7 +2136,7 @@ Boyut Kaydet Varsayılana döndür - Steam\'in yaptığı gibi oyunun arka planının üzerine çizilir. Tam konum birkaç piksel değişebilir. + Tam konum birkaç piksel farklı olabilir. Bu oyunun henüz logosu yok. Burada görmek için Logo bölümünden bir tane seçin. Logo konumu kaydedilemedi. Yeniden deneyin. Arka plan @@ -2679,7 +2679,7 @@ Açılış videosu Video DroidDeck · %1$d fps - 60 fps daha akıcı görünür ama Steam açılırken işlemciyi daha çok kullanır. Steam\'in kendi ayarlarında seçilen açılış videosu önceliklidir. + 60 fps daha akıcı görünür ama Steam açılırken işlemciyi daha çok kullanır. Steam\'in kendi ayarlarında seçilen bir video da burada görünür. Ses Kendi videon MP4, MOV, MKV veya WebM. Diğer biçimler ve %1$d MB üzeri dosyalar cihazda 720p WebM\'e dönüştürülür, en fazla %2$d saniye. @@ -2693,6 +2693,51 @@ %1$s Steam için dönüştürülüyor. DroidDeck\'i açık tut. Bu cihaz o videonun kodunu çözemiyor. Video içe aktarılamadı + %1$s kaldırılsın mı? + Video, DroidDeck\'ten ve Steam\'in videolar klasöründen silinir. + Yüklü + İçe aktar + SteamDeckRepo + Ses + Yüklü videolar + Göz at + DroidDeck + İçe aktarılan + SteamDeckRepo + Steam + Puan Mağazası + Açılış videosu raporu + DroidDeck ve Steam’in açılış videoları hakkında bildiklerini, hata raporuna ekleyebileceğiniz bir metin dosyasına kaydeder. + Kaydet + %1$s konumuna kaydedildi + Rapor kaydedilemedi. + Ses düzeyi + Süre + %1$d sn + Videonun kaç saniyesinin oynatılacağı. Daha uzun olan kısım sonunda kesilir. + SteamDeckRepo\'da ara + Tüm cihazlar + Steam Deck + Steam Machine + Trend + En çok indirilen + En çok beğenilen + En yeni + SteamDeckRepo\'ya ulaşılamadı + Tekrar dene + Video bulunamadı + Yükle + Kullan + Kullanımda + %1$s yüklendi + Video indirilemedi + Önceki + Sonraki + Sayfa %1$d + Temizle + Sayfaya git + Önizle + Önizleme oynatılamadı Luma Ultra kameralar — Deneysel Joy-Con konum takibi Eşleştirilmiş Joy-Con kumandalarınızı konumlandırmak için akıllı gözlük kameralarını kullanın. Döndürme ve düğme girişleri Joy-Con kumandalarından gelir. Bilekleriniz gizlendiğinde konum tahmin edilir. Çıplak elle çalıştırılan kumandaların yerini alır ve telefon kamerası izlemesini duraklatır. İzleme merkezini bağlarken veya sıfırlarken Joy-Con kumandalarını ileriye doğru çevirin. diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index d22466ca70..9e76210923 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -2192,7 +2192,7 @@ Розмір Зберегти Повернути типове - Малюється поверх тла гри, як це робить Steam. Точна позиція може відрізнятися на кілька пікселів. + Точне розташування може відрізнятися на кілька пікселів. У цієї гри ще немає логотипу. Виберіть його в розділі Логотип, щоб побачити тут. Не вдалося зберегти позицію логотипу. Спробуйте ще раз. Фон @@ -2747,7 +2747,7 @@ Завантажувальне відео Відео DroidDeck · %1$d кадр/с - 60 кадр/с виглядає плавніше, але більше навантажує процесор під час запуску Steam. Відео запуску, вибране в налаштуваннях самого Steam, має пріоритет. + 60 кадр/с виглядає плавніше, але більше навантажує процесор під час запуску Steam. Відео, вибране в налаштуваннях самого Steam, також з\'являється тут. Звук Власне відео MP4, MOV, MKV або WebM. Інші формати й файли понад %1$d МБ перетворюються на пристрої на WebM 720p, до %2$d секунд. @@ -2761,6 +2761,51 @@ %1$s перетворюється для Steam. Не закривайте DroidDeck. Пристрій не може декодувати це відео. Не вдалося імпортувати відео + Видалити %1$s? + Відео буде видалено з DroidDeck і з папки відео Steam. + Встановлені + Імпорт + SteamDeckRepo + Звук + Встановлені відео + Огляд + DroidDeck + Імпортовано + SteamDeckRepo + Steam + Магазин балів + Звіт про завантажувальні ролики + Зберігає в текстовий файл те, що DroidDeck і Steam знають про завантажувальні ролики, щоб додати до повідомлення про помилку. + Зберегти + Збережено: %1$s + Не вдалося зберегти звіт. + Гучність + Тривалість + %1$d с + Скільки секунд фільму відтворюється. Усе, що довше, обрізається в кінці. + Пошук у SteamDeckRepo + Усі пристрої + Steam Deck + Steam Machine + У тренді + Найбільше завантажень + Найбільше вподобань + Нові + Не вдалося підключитися до SteamDeckRepo + Повторити + Відео не знайдено + Встановити + Використати + Використовується + %1$s встановлено + Не вдалося завантажити це відео + Назад + Далі + Сторінка %1$d + Очистити + Перейти на сторінку + Перегляд + Не вдалося відтворити перегляд Камери Luma Ultra — Експериментально Відстеження положення Joy-Con Використовуйте камери розумних окулярів, щоб розташувати парні контролери Joy-Con. Обертання та введення кнопок надходять від контролерів Joy-Con. Положення оцінюється, коли ваші зап\'ястя приховані. Замінює контролери, якими керують голими руками, та призупиняє відстеження камерою телефону. Направте контролери Joy-Con вперед під час підключення або скидання центру відстеження. diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 800e33b10f..e29d23dfdb 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -2129,7 +2129,7 @@ Kích thước Lưu Về mặc định - Được vẽ đè lên nền game như Steam làm. Vị trí chính xác có thể lệch vài pixel. + Vị trí chính xác có thể lệch vài pixel. Game này chưa có logo. Chọn một logo để xem tại đây. Không lưu được vị trí logo. Thử lại. Hình nền @@ -2654,7 +2654,7 @@ Video khởi động Video DroidDeck · %1$d fps - 60 fps mượt hơn nhưng tốn CPU hơn khi Steam đang khởi động. Video khởi động chọn trong cài đặt của chính Steam sẽ được ưu tiên. + 60 fps mượt hơn nhưng tốn CPU hơn khi Steam đang khởi động. Video chọn trong cài đặt của chính Steam cũng hiện ở đây. Âm thanh Video của bạn MP4, MOV, MKV hoặc WebM. Định dạng khác và tệp trên %1$d MB được chuyển sang WebM 720p ngay trên thiết bị, tối đa %2$d giây. @@ -2668,6 +2668,51 @@ Đang chuyển đổi %1$s cho Steam. Hãy để DroidDeck mở. Thiết bị này không giải mã được video đó. Không thể nhập video này + Xóa %1$s? + Thao tác này xóa video khỏi DroidDeck và khỏi thư mục video của Steam. + Đã cài + Nhập + SteamDeckRepo + Âm thanh + Video đã cài + Duyệt + DroidDeck + Đã nhập + SteamDeckRepo + Steam + Cửa hàng điểm + Báo cáo phim khởi động + Lưu những gì DroidDeck và Steam biết về phim khởi động vào một tệp văn bản để đính kèm báo cáo lỗi. + Lưu + Đã lưu vào %1$s + Không thể lưu báo cáo. + Âm lượng + Độ dài + %1$d giây + Số giây của phim sẽ được phát. Phần dài hơn sẽ bị cắt ở cuối. + Tìm trong SteamDeckRepo + Tất cả thiết bị + Steam Deck + Steam Machine + Thịnh hành + Tải nhiều nhất + Thích nhiều nhất + Mới nhất + Không kết nối được SteamDeckRepo + Thử lại + Không tìm thấy video + Cài đặt + Dùng + Đang dùng + Đã cài %1$s + Không thể tải video đó + Trước + Tiếp + Trang %1$d + Xóa + Đến trang + Xem trước + Không thể phát bản xem trước Camera Luma Ultra — Thử nghiệm Theo dõi vị trí Joy-Con Sử dụng camera của kính thông minh để định vị bộ điều khiển Joy-Con đã ghép nối. Xoay và nhập nút đến từ bộ điều khiển Joy-Con. Vị trí được ước tính khi cổ tay của bạn bị che khuất. Thay thế bộ điều khiển được điều khiển bằng tay không và tạm dừng theo dõi bằng camera điện thoại. Hướng bộ điều khiển Joy-Con về phía trước khi kết nối hoặc đặt lại trung tâm theo dõi. diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index cb8c9903be..44fd2f961e 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -764,7 +764,7 @@ 大小 保存 重置为默认 - 显示在游戏背景上,与 Steam 的绘制方式一致。具体位置可能相差几个像素。 + 确切位置可能相差几个像素。 该游戏还没有标志。在标志中选择一个即可在此查看。 无法保存标志位置。请重试。 搜索 SteamGridDB… @@ -2654,7 +2654,7 @@ 开机动画 视频 DroidDeck · %1$d fps - 60 fps 更流畅,但 Steam 启动时会占用更多 CPU。在 Steam 自身设置中选择的启动动画优先。 + 60 fps 更流畅,但 Steam 启动时会占用更多 CPU。在 Steam 自身设置中选择的动画也会显示在这里。 声音 自定义视频 MP4、MOV、MKV 或 WebM。其他格式及超过 %1$d MB 的文件会在设备上转换为 720p WebM,最长 %2$d 秒。 @@ -2668,6 +2668,51 @@ 正在为 Steam 转换 %1$s。请保持 DroidDeck 打开。 此设备无法解码该视频。 无法导入该视频 + 移除 %1$s? + 这会从 DroidDeck 和 Steam 的动画文件夹中删除该动画。 + 已安装 + 导入 + SteamDeckRepo + 声音 + 已安装的动画 + 浏览 + DroidDeck + 已导入 + SteamDeckRepo + Steam + 点数商店 + 启动影片报告 + 将 DroidDeck 和 Steam 掌握的启动影片信息保存为文本文件,可附在错误报告中。 + 保存 + 已保存到 %1$s + 无法保存报告。 + 音量 + 时长 + %1$d 秒 + 播放影片的秒数。超出该时长的部分会在结尾被截断。 + 搜索 SteamDeckRepo + 所有设备 + Steam Deck + Steam Machine + 热门 + 下载最多 + 最受欢迎 + 最新 + 无法连接 SteamDeckRepo + 重试 + 未找到动画 + 安装 + 使用 + 使用中 + 已安装 %1$s + 无法下载该动画 + 上一页 + 下一页 + 第 %1$d 页 + 清除 + 转到页面 + 预览 + 无法播放此预览 Luma Ultra 摄像头 — 实验性功能 Joy-Con 位置追踪 使用智能眼镜摄像头定位已配对的 Joy-Con 控制器。旋转和按键输入来自 Joy-Con 控制器。当您的手腕被遮挡时,系统会估算位置。此功能会取代徒手操作的控制器,并暂停手机摄像头追踪。连接或重置追踪中心时,请将 Joy-Con 控制器指向前方。 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 52207967c0..431faf6be8 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -2129,7 +2129,7 @@ 大小 儲存 還原預設 - 顯示在遊戲背景上,與 Steam 的繪製方式一致。實際位置可能相差幾個像素。 + 確切位置可能相差幾個像素。 此遊戲尚無標誌。請在標誌中選擇一個,即可在此檢視。 無法儲存標誌位置。請再試一次。 背景 @@ -2654,7 +2654,7 @@ 開機動畫 影片 DroidDeck · %1$d fps - 60 fps 較流暢,但 Steam 啟動時會使用較多 CPU。在 Steam 本身設定中選擇的啟動動畫優先。 + 60 fps 較流暢,但 Steam 啟動時會使用較多 CPU。在 Steam 本身設定中選擇的動畫也會顯示在這裡。 聲音 自訂影片 MP4、MOV、MKV 或 WebM。其他格式及超過 %1$d MB 的檔案會在裝置上轉換為 720p WebM,最長 %2$d 秒。 @@ -2668,6 +2668,51 @@ 正在為 Steam 轉換 %1$s。請保持 DroidDeck 開啟。 此裝置無法解碼該影片。 無法匯入此影片 + 移除 %1$s? + 這會從 DroidDeck 和 Steam 的動畫資料夾中刪除該動畫。 + 已安裝 + 匯入 + SteamDeckRepo + 聲音 + 已安裝的動畫 + 瀏覽 + DroidDeck + 已匯入 + SteamDeckRepo + Steam + 點數商店 + 啟動影片報告 + 將 DroidDeck 和 Steam 掌握的啟動影片資訊儲存為文字檔,可附在錯誤報告中。 + 儲存 + 已儲存到 %1$s + 無法儲存報告。 + 音量 + 長度 + %1$d 秒 + 播放影片的秒數。超出該時長的部分會在結尾被截斷。 + 搜尋 SteamDeckRepo + 所有裝置 + Steam Deck + Steam Machine + 熱門 + 下載最多 + 最受歡迎 + 最新 + 無法連接 SteamDeckRepo + 重試 + 找不到動畫 + 安裝 + 使用 + 使用中 + 已安裝 %1$s + 無法下載該動畫 + 上一頁 + 下一頁 + 第 %1$d 頁 + 清除 + 前往頁面 + 預覽 + 無法播放此預覽 Luma Ultra 相機 — 實驗性功能 Joy-Con 位置追踪 使用智慧眼鏡攝影機定位已配對的 Joy-Con 控制器。旋轉和按鍵輸入來自 Joy-Con 控制器。當您的手腕被遮住時,系統會估算位置。此功能會取代徒手操作的控制器,並暫停手機相機追蹤。連接或重設追蹤中心時,請將 Joy-Con 控制器指向前方。 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 9eacff4a16..dd6732156f 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -2129,7 +2129,7 @@ 大小 儲存 還原預設 - 顯示在遊戲背景上,與 Steam 的繪製方式一致。實際位置可能相差幾個像素。 + 確切位置可能相差幾個像素。 此遊戲尚無標誌。請在標誌中選擇一個,即可在此檢視。 無法儲存標誌位置。請再試一次。 背景 @@ -2654,7 +2654,7 @@ 開機動畫 影片 DroidDeck · %1$d fps - 60 fps 較流暢,但 Steam 啟動時會使用較多 CPU。在 Steam 本身設定中選擇的啟動動畫優先。 + 60 fps 較流暢,但 Steam 啟動時會使用較多 CPU。在 Steam 本身設定中選擇的動畫也會顯示在這裡。 聲音 自訂影片 MP4、MOV、MKV 或 WebM。其他格式及超過 %1$d MB 的檔案會在裝置上轉換為 720p WebM,最長 %2$d 秒。 @@ -2668,6 +2668,51 @@ 正在為 Steam 轉換 %1$s。請保持 DroidDeck 開啟。 此裝置無法解碼該影片。 無法匯入此影片 + 移除 %1$s? + 這會從 DroidDeck 和 Steam 的動畫資料夾中刪除該動畫。 + 已安裝 + 匯入 + SteamDeckRepo + 聲音 + 已安裝的動畫 + 瀏覽 + DroidDeck + 已匯入 + SteamDeckRepo + Steam + 點數商店 + 啟動影片報告 + 將 DroidDeck 和 Steam 掌握的啟動影片資訊儲存為文字檔,可附在錯誤報告中。 + 儲存 + 已儲存到 %1$s + 無法儲存報告。 + 音量 + 長度 + %1$d 秒 + 播放影片的秒數。超出該時長的部分會在結尾被截斷。 + 搜尋 SteamDeckRepo + 所有裝置 + Steam Deck + Steam Machine + 熱門 + 下載最多 + 最受歡迎 + 最新 + 無法連線至 SteamDeckRepo + 重試 + 找不到動畫 + 安裝 + 使用 + 使用中 + 已安裝 %1$s + 無法下載該動畫 + 上一頁 + 下一頁 + 第 %1$d 頁 + 清除 + 前往頁面 + 預覽 + 無法播放此預覽 Luma Ultra 相機 — 實驗性功能 Joy-Con 位置追踪 使用智慧眼鏡攝影機定位已配對的 Joy-Con 控制器。旋轉和按鍵輸入來自 Joy-Con 控制器。當您的手腕被遮住時,系統會估算位置。此功能會取代徒手操作的控制器,並暫停手機相機追蹤。連接或重設追蹤中心時,請將 Joy-Con 控制器指向前方。 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 10d12a6205..03e52a56c9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2212,7 +2212,7 @@ Size Save Reset to default - Shown on the game\'s background, the way Steam draws it. The exact spot can differ by a few pixels. + This exact spot can differ by a few pixels. This game has no logo yet. Choose one under Logo to see it here. Couldn\'t save the logo position. Try again. Background @@ -2763,12 +2763,14 @@ Boot movie Movie DroidDeck · %1$d fps - 60 fps looks smoother but uses more CPU while Steam starts. A startup movie picked in Steam\'s own settings takes priority. + 60 fps looks smoother but uses more CPU while Steam starts. A movie picked in Steam\'s own settings shows up here too. Sound Your own movie MP4, MOV, MKV or WebM. Other formats and files over %1$d MB are converted to 720p WebM on the device, up to %2$d seconds. Import Remove + Remove %1$s? + This deletes the movie from DroidDeck and from Steam\'s movies folder. Choose a boot movie %1$s is now the boot movie %1$s is now the boot movie, without sound @@ -2777,6 +2779,49 @@ Converting %1$s for Steam. Keep DroidDeck open. This device cannot decode that video. Could not import that movie + Installed + Import + SteamDeckRepo + Sound + Installed movies + Browse + DroidDeck + Imported + SteamDeckRepo + Steam + Points Shop + Boot movie report + Saves what DroidDeck and Steam know about boot movies to a text file you can attach to a bug report. + Save + Saved to %1$s + Could not save the report. + Volume + Length + %1$d s + How many seconds of the movie play. Anything longer is cut off at the end. + Search SteamDeckRepo + All devices + Steam Deck + Steam Machine + Trending + Most downloaded + Most liked + Newest + Could not reach SteamDeckRepo + Retry + No movies found + Install + Use + In use + %1$s installed + Could not download that movie + Previous + Next + Page %1$d + Clear + Go to page + Preview + This preview could not be played Steady hand aim Aim from your shoulder through your palm. Turn off for wrist-controlled rotation. Spatial setup diff --git a/app/src/test/java/com/droiddeck/launcher/session/BootMovieLibraryTest.kt b/app/src/test/java/com/droiddeck/launcher/session/BootMovieLibraryTest.kt new file mode 100644 index 0000000000..ca68f58678 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/session/BootMovieLibraryTest.kt @@ -0,0 +1,310 @@ +package com.droiddeck.launcher.session + +import android.content.Context +import org.junit.Assert.* +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment +import org.robolectric.annotation.Config +import java.io.File + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33]) +class BootMovieLibraryTest { + private val app get() = RuntimeEnvironment.getApplication() + private val movies get() = BootMovieLibrary.moviesDir(app) + + @Before fun clear() { + app.getSharedPreferences("session", Context.MODE_PRIVATE).edit().clear().commit() + File(app.filesDir, "boot-movie").deleteRecursively() + movies.deleteRecursively() + BootMovieLibrary.libraryDir(app).deleteRecursively() + File(BootMovieLibrary.steamRoot(app), "steamui").deleteRecursively() + File(BootMovieLibrary.steamRoot(app), "appcache").deleteRecursively() + BootMovieLibrary.forgetScan() + BootMovieLibrary.steamConfig(app).delete() + } + + private fun movie(name: String) = File(movies, name).also { it.parentFile!!.mkdirs(); it.writeText("movie") } + + /** A movie DroidDeck itself imported: kept in the library, copied into Steam's folder and noted in the list. */ + private fun imported(title: String, source: String = BootMovieLibrary.SOURCE_IMPORT, repo: String? = null): String { + val staged = File(BootMovieLibrary.libraryDir(app), ".t-${System.nanoTime()}-${Thread.currentThread().id}.staged").also { it.parentFile!!.mkdirs(); it.writeText("movie") } + return BootMovieLibrary.commit(app, staged, title, source, repo)!! + } + + private fun steamPicksAt(path: String) { + BootMovieLibrary.steamConfig(app).also { it.parentFile!!.mkdirs() }.writeText( + "\"InstallConfigStore\"\n{\n\t\"StartupMovie\"\n\t{\n\t\t\"MovieID\"\t\t\"x\"\n\t\t\"LocalPath\"\t\t\"$path\"\n\t}\n}\n", + ) + } + + private fun steamPicks(name: String) = steamPicksAt("/uioverrides/movies/$name") + + @Test fun theActiveX64ClientsOwnMoviesAreListedAndRemovedToo() { + SessionPrefs.setSteamClientArch(app, "x86_64") + val x64 = File(SessionPrefs.steamRoot(app, "x86_64"), "config/uioverrides/movies") + try { + File(x64, "Mine.webm").also { it.parentFile!!.mkdirs(); it.writeText("movie") } + movie("Main.webm") + val entries = BootMovieLibrary.list(app).filter { it.id.startsWith(BootMovieLibrary.PREFIX) } + assertEquals(listOf("file:Main.webm", "file:Mine.webm"), entries.map { it.id }) + assertTrue(entries.all { it.removable }) + assertEquals("Mine.webm", BootMovieLibrary.file(app, "file:Mine.webm")?.name) + assertEquals("Mine (2).webm", BootMovieLibrary.freeName(app, "Mine")) + assertTrue(BootMovieLibrary.remove(app, "file:Mine.webm")) + assertFalse(File(x64, "Mine.webm").exists()) + } finally { + x64.deleteRecursively() + } + } + + @Test fun removingAMovieKeepsTheSameNamedOneInTheOtherSteamFolder() { + SessionPrefs.setSteamClientArch(app, "x86_64") + val x64 = File(SessionPrefs.steamRoot(app, "x86_64"), "config/uioverrides/movies") + try { + File(x64, "Intro.webm").also { it.parentFile!!.mkdirs(); it.writeText("movie") } + movie("Intro.webm") + assertTrue(BootMovieLibrary.remove(app, "file:Intro.webm")) + assertFalse(File(movies, "Intro.webm").exists()) + assertTrue(File(x64, "Intro.webm").isFile) + assertTrue(BootMovieLibrary.list(app).any { it.id == "file:Intro.webm" }) + assertTrue(BootMovieLibrary.remove(app, "file:Intro.webm")) + assertFalse(File(x64, "Intro.webm").exists()) + } finally { + x64.deleteRecursively() + } + } + + @Test fun aSavedChoiceKeepsMeaningTheSameFileWhicheverClientRuns() { + val x64 = File(SessionPrefs.steamRoot(app, "x86_64"), "config/uioverrides/movies") + try { + File(x64, "Intro.webm").also { it.parentFile!!.mkdirs(); it.writeText("other") } + val main = movie("Intro.webm") + SessionPrefs.setSteamClientArch(app, "x86_64") + assertEquals(main.path, BootMovieLibrary.file(app, "file:Intro.webm")?.path) + SessionPrefs.setSteamClientArch(app, "arm64") + assertEquals(main.path, BootMovieLibrary.file(app, "file:Intro.webm")?.path) + } finally { + x64.deleteRecursively() + } + } + + @Test fun listsTheDroidDeckMoviesAndEveryWebmButNotTheStagedCopies() { + movie("Intro.webm") + movie("bigpicture_startup.webm") + movie("steam_os_startup.webm") + movie("notes.txt") + movie(".hidden.webm") + val ids = BootMovieLibrary.list(app).map { it.id } + assertEquals(listOf(BootMovie.DROIDDECK_30, BootMovie.DROIDDECK_60, "file:Intro.webm"), ids) + } + + @Test fun usesTheTitleItWasRegisteredWithAndFallsBackToTheFileName() { + imported("Fancy", BootMovieLibrary.SOURCE_REPO, "id1"); movie("b.webm") + val list = BootMovieLibrary.list(app).associateBy { it.id } + assertEquals("Fancy", list["file:Fancy.webm"]!!.title) + assertEquals(BootMovieLibrary.SOURCE_REPO, list["file:Fancy.webm"]!!.source) + assertTrue(list["file:Fancy.webm"]!!.removable) + assertTrue(list["file:b.webm"]!!.removable) + assertEquals("b", list["file:b.webm"]!!.title) + assertEquals(BootMovieLibrary.SOURCE_IMPORT, list["file:b.webm"]!!.source) + assertEquals(setOf("id1"), BootMovieLibrary.installedRepoIds(app)) + assertEquals("Fancy.webm", BootMovieLibrary.nameForRepo(app, "id1")) + } + + @Test fun aChosenFileMovieIsKeptAndFallsBackOnceItIsGone() { + val name = imported("Mine") + BootMovie.select(app, "file:$name") + assertEquals("file:$name", BootMovie.choice(app)) + assertTrue(BootMovieLibrary.remove(app, "file:$name")) + assertEquals(BootMovie.DROIDDECK_30, BootMovie.choice(app)) + assertFalse(File(movies, name).exists()) + assertFalse(File(BootMovieLibrary.libraryDir(app), name).exists()) + } + + @Test fun aMovieInSteamsCustomFolderCanBeRemovedEvenWithoutANote() { + movie("by-hand.webm") + assertTrue(BootMovieLibrary.list(app).first { it.id == "file:by-hand.webm" }.removable) + assertTrue(BootMovieLibrary.remove(app, "file:by-hand.webm")) + assertFalse(File(movies, "by-hand.webm").exists()) + } + + @Test fun steamsOwnMoviesAreNeverDeleted() { + val own = File(BootMovieLibrary.steamRoot(app), "steamui/movies/deck_startup.webm").also { it.parentFile!!.mkdirs(); it.writeText("movie") } + val entry = BootMovieLibrary.list(app).first { it.id == "steam:/movies/deck_startup.webm" } + assertFalse(entry.removable) + assertFalse(BootMovieLibrary.remove(app, entry.id)) + assertTrue(own.exists()) + } + + @Test fun anImportSurvivesTheRuntimeBeingReset() { + val name = imported("Keep") + movies.deleteRecursively() + assertTrue(BootMovieLibrary.list(app).any { it.id == "file:$name" }) + assertTrue(File(movies, name).isFile) + } + + @Test fun importsAtTheSameTimeAllLandInTheList() { + val names = java.util.Collections.synchronizedList(ArrayList()) + (1..8).map { n -> Thread { names.add(imported("Movie")) } }.onEach { it.start() }.forEach { it.join() } + assertEquals(8, names.toSet().size) + assertEquals(8, BootMovieLibrary.list(app).count { it.source == BootMovieLibrary.SOURCE_IMPORT }) + } + + @Test fun steamIsPointedBackAtItsDefaultWhenTheStagedMovieIsGone() { + steamPicksAt(SessionFiles.BOOT_MOVIE_PATH) + assertTrue(SessionFiles.resetMissingStartupMovie(BootMovieLibrary.steamConfig(app), false)) + assertNull(SessionFiles.startupMoviePath(BootMovieLibrary.steamConfig(app))) + } + + @Test fun aMissingConfigNeedsNoReset() { + assertTrue(SessionFiles.resetMissingStartupMovie(BootMovieLibrary.steamConfig(app), true)) + } + + @Test fun aStagedMovieThatIsThereIsLeftAlone() { + movie("bigpicture_startup.webm") + steamPicksAt(SessionFiles.BOOT_MOVIE_PATH) + assertFalse(SessionFiles.resetMissingStartupMovie(BootMovieLibrary.steamConfig(app), false)) + assertEquals(SessionFiles.BOOT_MOVIE_PATH, SessionFiles.startupMoviePath(BootMovieLibrary.steamConfig(app))) + } + + @Test fun aPendingPickResetsASteamMovieThatWasRemoved() { + steamPicksAt("/uioverrides/movies/gone.webm") + assertFalse(SessionFiles.resetMissingStartupMovie(BootMovieLibrary.steamConfig(app), false)) + assertTrue(SessionFiles.resetMissingStartupMovie(BootMovieLibrary.steamConfig(app), true)) + assertNull(SessionFiles.startupMoviePath(BootMovieLibrary.steamConfig(app))) + } + + @Test fun onlyTheThreeStartupMoviesOfSteamAreListed() { + listOf("deck_startup", "oled_startup", "startup_machine", "controller_generic_thumbstick_move").forEach { + File(BootMovieLibrary.steamRoot(app), "steamui/movies/$it.webm").also { f -> f.parentFile!!.mkdirs(); f.writeText("movie") } + } + val ids = BootMovieLibrary.list(app).map { it.id }.filter { it.startsWith("steam:") } + assertEquals( + listOf("steam:/movies/deck_startup.webm", "steam:/movies/oled_startup.webm", "steam:/movies/startup_machine.webm"), + ids.sorted(), + ) + } + + @Test fun aMovieBoughtInThePointsShopIsListedAndAdopted() { + val file = File(BootMovieLibrary.steamRoot(app), "appcache/startupmovies/Bought.webm").also { it.parentFile!!.mkdirs(); it.writeText("movie") } + val entry = BootMovieLibrary.list(app).first { it.id == "steam:/appcache/startupmovies/Bought.webm" } + assertFalse(entry.removable) + assertEquals(BootMovieLibrary.SOURCE_POINTSHOP, entry.source) + steamPicksAt("/appcache/startupmovies/Bought.webm") + assertTrue(BootMovie.syncFromSteam(app)) + assertEquals("steam:/appcache/startupmovies/Bought.webm", BootMovie.choice(app)) + assertEquals(file, BootMovie.currentFile(app)) + assertNull(BootMovieLibrary.file(app, "steam:/../x.webm")) + } + + @Test fun aBoughtMovieNamedByIdAndHashIsShownByItsId() { + File(BootMovieLibrary.steamRoot(app), "appcache/startupmovies/39900045022_590371b7f10882d09ac59e5d3691b462c0091a6d.webm") + .also { it.parentFile!!.mkdirs(); it.writeText("movie") } + val entry = BootMovieLibrary.list(app).first { it.source == BootMovieLibrary.SOURCE_POINTSHOP } + assertEquals("#39900045022", entry.title) + } + + @Test fun theReportNamesWhatStageDidAndWhereMoviesAre() { + File(BootMovieLibrary.steamRoot(app), "appcache/startupmovies/1_ab.webm").also { it.parentFile!!.mkdirs(); it.writeText("movie") } + BootMovieReport.note(app, "stage test") + val report = BootMovieReport.build(app) + assertTrue(report.contains("== DroidDeck state")) + assertTrue(report.contains("startupmovies/1_ab.webm")) + assertTrue(report.contains("stage test")) + } + + @Test fun pathTricksAreNotMovies() { + movie("a.webm") + assertNull(BootMovieLibrary.file(app, "file:../a.webm")) + assertNull(BootMovieLibrary.file(app, "file:bigpicture_startup.webm")) + assertFalse(BootMovieLibrary.remove(app, "file:../a.webm")) + } + + @Test fun freeNameNeverReusesAFileOrAStagedName() { + movie("Intro.webm") + assertEquals("Intro (2).webm", BootMovieLibrary.freeName(app, "Intro")) + assertEquals("movie.webm", BootMovieLibrary.freeName(app, "///")) + } + + @Test fun aMovieChosenInsideSteamIsAdoptedOnce() { + movie("a.webm"); movie("b.webm") + BootMovie.select(app, "file:a.webm") + steamPicks("b.webm") + assertTrue(BootMovie.syncFromSteam(app)) + assertEquals("file:b.webm", BootMovie.choice(app)) + // Picking another one here is not undone by the same Steam setting. + BootMovie.select(app, "file:a.webm") + assertFalse(BootMovie.syncFromSteam(app)) + assertEquals("file:a.webm", BootMovie.choice(app)) + // A new pick inside Steam is adopted again. + movie("c.webm") + steamPicks("c.webm") + assertTrue(BootMovie.syncFromSteam(app)) + assertEquals("file:c.webm", BootMovie.choice(app)) + } + + @Test fun aSteamPickIsTakenOverWithoutBeingStagedOverSteamsOwnSetting() { + movie("a.webm") + BootMovie.select(app, "file:a.webm") + SessionPrefs.setBootMovieApplyNext(app, false) + steamPicks("a.webm") + assertFalse(BootMovie.syncFromSteam(app)) + assertEquals("file:a.webm", BootMovie.choice(app)) + assertFalse(SessionPrefs.bootMovieApplyNext(app)) + } + + @Test fun theStagedCopyNamedInSteamsConfigIsNotAPick() { + movie("a.webm") + BootMovie.select(app, "file:a.webm") + steamPicksAt(SessionFiles.BOOT_MOVIE_PATH) + assertFalse(BootMovie.syncFromSteam(app)) + assertEquals("file:a.webm", BootMovie.choice(app)) + } + + @Test fun aBoughtMovieIsShownUnderItsPointsShopTitle() { + File(BootMovieLibrary.steamRoot(app), "config/communityitemscache/startupmovies/39900045022_ab12.webm") + .also { it.parentFile!!.mkdirs(); it.writeText("movie") } + File(BootMovieLibrary.steamRoot(app), "userdata/1/config/localconfig.vdf").also { it.parentFile!!.mkdirs() }.writeText( + "\"GetStartupMovies\"\t\t\"[{\\\"communityitemid\\\":\\\"39900045022\\\",\\\"image_small\\\":\\\"x.png\\\",\\\"name\\\":\\\"Turret Factory\\\",\\\"item_title\\\":\\\"Turret Factory\\\"}]\"\n", + ) + val entry = BootMovieLibrary.list(app).first { it.source == BootMovieLibrary.SOURCE_POINTSHOP } + assertEquals("Turret Factory", entry.title) + } + + @Test fun notesKeptInSteamsMoviesFolderByAnEarlierVersionAreTakenOver() { + movie("Old.webm") + File(movies, ".droiddeck-movies.json").writeText("{\"Old.webm\":{\"title\":\"Old one\",\"source\":\"repo\",\"repo\":\"r1\"}}") + val entry = BootMovieLibrary.list(app).first { it.id == "file:Old.webm" } + assertEquals("Old one", entry.title) + assertEquals(BootMovieLibrary.SOURCE_REPO, entry.source) + assertEquals(setOf("r1"), BootMovieLibrary.installedRepoIds(app)) + assertFalse(File(movies, ".droiddeck-movies.json").exists()) + } + + @Test fun aPickMadeHereBeatsAnOlderSteamPickThatWasNeverSeen() { + movie("a.webm"); movie("b.webm") + steamPicks("b.webm") + BootMovie.select(app, "file:a.webm") + assertFalse(BootMovie.syncFromSteam(app)) + assertEquals("file:a.webm", BootMovie.choice(app)) + } + + @Test fun steamPointingAtAMovieThatIsNotThereChangesNothing() { + steamPicks("gone.webm") + assertFalse(BootMovie.syncFromSteam(app)) + assertEquals(BootMovie.DROIDDECK_30, BootMovie.choice(app)) + } + + @Test fun volumeAndLengthDefaultToTheWholeMovieAtFullVolume() { + assertEquals(100, SessionPrefs.bootMovieVolume(app)) + assertEquals(0, SessionPrefs.bootMovieSeconds(app)) + SessionPrefs.setBootMovieVolume(app, 40) + SessionPrefs.setBootMovieSeconds(app, 3) + assertEquals(40, SessionPrefs.bootMovieVolume(app)) + assertEquals(3, SessionPrefs.bootMovieSeconds(app)) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/session/BootMoviePlanTest.kt b/app/src/test/java/com/droiddeck/launcher/session/BootMoviePlanTest.kt new file mode 100644 index 0000000000..e9341851d7 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/session/BootMoviePlanTest.kt @@ -0,0 +1,59 @@ +package com.droiddeck.launcher.session + +import com.droiddeck.launcher.session.BootMovie.Step +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test + +class BootMoviePlanTest { + @Test + fun fullVolumeWithoutLimitPassesTheSourceThrough() { + val plan = BootMovie.plan(100, 0) + assertTrue(plan.passthrough) + assertTrue(plan.steps.isEmpty()) + } + + @Test + fun fullVolumeWithLimitKeepsSoundAndFallsBackToTheSource() { + val plan = BootMovie.plan(100, 5) + assertFalse(plan.passthrough) + assertEquals(listOf(Step.REMUX_AUDIO, Step.TRANSCODE_AUDIO), plan.steps) + assertTrue(plan.sourceOnFailure) + } + + @Test + fun silentGoesWithoutSoundAndNeverFallsBackToTheSource() { + val plan = BootMovie.plan(0, 0) + assertEquals(listOf(Step.REMUX_SILENT, Step.TRANSCODE_SILENT), plan.steps) + assertFalse(plan.sourceOnFailure) + } + + @Test + fun partialVolumeDegradesToSilenceNotToFullVolume() { + val plan = BootMovie.plan(40, 0) + assertEquals(listOf(Step.REGAIN, Step.REMUX_SILENT, Step.TRANSCODE_AUDIO), plan.steps) + assertFalse(plan.passthrough) + assertFalse(plan.sourceOnFailure) + } + + @Test + fun framesBeyondFullHdAreOversizedInEitherOrientation() { + assertTrue(BootMovie.oversized(3840, 2160)) + assertTrue(BootMovie.oversized(2160, 3840)) + assertFalse(BootMovie.oversized(1920, 1080)) + assertFalse(BootMovie.oversized(1280, 800)) + assertFalse(BootMovie.oversized(1080, 1920)) + } + + @Test + fun anOversizedMovieIsAlwaysConvertedAndNeverFallsBackToTheSource() { + for (volume in listOf(0, 40, 100)) { + val plan = BootMovie.oversizedPlan(volume) + assertFalse(plan.passthrough) + assertFalse(plan.sourceOnFailure) + } + assertEquals(listOf(Step.TRANSCODE_SILENT), BootMovie.oversizedPlan(0).steps) + assertEquals(listOf(Step.TRANSCODE_AUDIO), BootMovie.oversizedPlan(60).steps) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/session/BootMovieTranscoderTest.kt b/app/src/test/java/com/droiddeck/launcher/session/BootMovieTranscoderTest.kt new file mode 100644 index 0000000000..bb31c7eaa4 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/session/BootMovieTranscoderTest.kt @@ -0,0 +1,17 @@ +package com.droiddeck.launcher.session + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertSame +import org.junit.Test + +class BootMovieTranscoderTest { + @Test fun scaleQuietsAndCutsTheSoundAtTheSameTime() { + val pcm = ShortArray(48_000 * 2) { 1000 } + assertSame(pcm, BootMovieTranscoder.scale(pcm, 2, 1f, Long.MAX_VALUE)) + val quieter = BootMovieTranscoder.scale(pcm, 2, 0.5f, Long.MAX_VALUE) + assertEquals(pcm.size, quieter.size) + assertEquals(500.toShort(), quieter[0]) + val cut = BootMovieTranscoder.scale(pcm, 2, 1f, 500_000L) + assertEquals(24_000 * 2, cut.size) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/session/StartupMovieConfigTest.kt b/app/src/test/java/com/droiddeck/launcher/session/StartupMovieConfigTest.kt new file mode 100644 index 0000000000..c14fc02310 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/session/StartupMovieConfigTest.kt @@ -0,0 +1,66 @@ +package com.droiddeck.launcher.session + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Rule +import org.junit.Test +import org.junit.rules.TemporaryFolder +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config +import java.io.File + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33]) +class StartupMovieConfigTest { + @get:Rule val folder = TemporaryFolder() + + private val older = "\t\t\t\t\"StartupMovie\"\n\t\t\t\t{\n\t\t\t\t\t\"MovieID\"\t\t\"0\"\n\t\t\t\t\t\"LocalPath\"\t\t\"%s\"\n\t\t\t\t}\n" + private val customization = "\t\"Customization\"\n\t{\n\t\t\"StartupMovie\"\n\t\t{\n\t\t\t\"MovieID\"\t\t\"%s\"\n\t\t\t\"LocalPath\"\t\t\"%s\"\n\t\t}\n\t}\n" + + private fun config(olderPath: String?, id: String?, path: String?): File { + val text = StringBuilder("\"InstallConfigStore\"\n{\n\t\"Software\"\n\t{\n\t\t\"Valve\"\n\t\t{\n\t\t\t\"Steam\"\n\t\t\t{\n") + if (olderPath != null) text.append(older.format(olderPath)) + text.append("\t\t\t}\n\t\t}\n\t}\n") + if (id != null && path != null) text.append(customization.format(id, path)) + text.append("}\n") + return folder.newFile().also { it.writeText(text.toString()) } + } + + @Test fun steamReadsTheMovieUnderCustomizationNotTheOlderOne() { + val file = config(SessionFiles.BOOT_MOVIE_PATH, "39900045022", "/communityitemscache/startupmovies/39900045022_ab.webm") + assertEquals("/communityitemscache/startupmovies/39900045022_ab.webm", SessionFiles.startupMoviePath(file)) + } + + @Test fun aPickIsWrittenWhereSteamReadsItAndTheOlderPlaceIsKeptInStep() { + val file = config("/uioverrides/movies/x.webm", "39900045022", "/communityitemscache/startupmovies/39900045022_ab.webm") + assertTrue(SessionFiles.ensureStartupMovieDefault(file, force = true)) + val text = file.readText() + assertEquals(SessionFiles.BOOT_MOVIE_PATH, SessionFiles.startupMoviePath(file)) + assertFalse(text.contains("39900045022")) + assertEquals(2, Regex("\"LocalPath\"\\s+\"" + Regex.escape(SessionFiles.BOOT_MOVIE_PATH) + "\"").findAll(text).count()) + } + + @Test fun aPickMadeInSteamIsLeftAloneWithoutAPendingPick() { + val file = config(SessionFiles.BOOT_MOVIE_PATH, "0", "/uioverrides/movies/Undertale.webm") + assertFalse(SessionFiles.ensureStartupMovieDefault(file, force = false)) + assertEquals("/uioverrides/movies/Undertale.webm", SessionFiles.startupMoviePath(file)) + } + + @Test fun aConfigWithoutCustomizationGetsOne() { + val file = config(null, null, null) + assertTrue(SessionFiles.ensureStartupMovieDefault(file, force = false)) + val text = file.readText() + assertTrue(text.contains("\"Customization\"")) + assertEquals(SessionFiles.BOOT_MOVIE_PATH, SessionFiles.startupMoviePath(file)) + assertEquals(2, Regex("\"StartupMovie\"").findAll(text).count()) + } + + @Test fun aMissingStagedMovieResetsTheSectionSteamReads() { + val file = config(SessionFiles.BOOT_MOVIE_PATH, "0", SessionFiles.BOOT_MOVIE_PATH) + assertTrue(SessionFiles.resetMissingStartupMovie(file, false)) + assertNull(SessionFiles.startupMoviePath(file)) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/session/SteamDeckRepoTest.kt b/app/src/test/java/com/droiddeck/launcher/session/SteamDeckRepoTest.kt new file mode 100644 index 0000000000..4458985f83 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/session/SteamDeckRepoTest.kt @@ -0,0 +1,92 @@ +package com.droiddeck.launcher.session + +import org.junit.Assert.* +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33]) +class SteamDeckRepoTest { + private val sample = """ + {"posts":[ + {"id":"p1","title":"Cool","content":"c","user":{"steam_name":"Ann"},"thumbnail":"https://x/t.png","video":"https://x/v.webm", + "video_duration":7,"likes":3,"downloads":9,"devices":["steam_deck"],"url":"https://steamdeckrepo.com/post/p1"}, + {"id":"p2","title":"","video":"http://insecure/v.webm"}, + {"id":"","video":"https://x/v.webm"}, + {"id":"p3","video":"https://x/v3.webm","thumbnail":"ftp://bad"} + ],"currentSort":"trending"} + """.trimIndent() + + @Test fun parsesPostsAndSkipsBrokenOnes() { + val posts = SteamDeckRepo.parse(sample)!! + assertEquals(listOf("p1", "p3"), posts.map { it.id }) + val first = posts[0] + assertEquals("Cool", first.title) + assertEquals("Ann", first.author) + assertEquals(7, first.seconds) + assertEquals(listOf("steam_deck"), first.devices) + assertEquals("p3", posts[1].title) + assertEquals("", posts[1].thumbnail) + } + + @Test fun notJsonIsNotAPage() { + assertNull(SteamDeckRepo.parse("")) + assertNull(SteamDeckRepo.parse("{}")) + } + + @Test fun buildsTheSameAddressesAsTheWebsite() { + assertEquals("https://steamdeckrepo.com/api/posts?sort=trending", SteamDeckRepo.url(SteamDeckRepo.Sort.TRENDING, null, "")) + assertEquals( + "https://steamdeckrepo.com/api/posts?sort=downloads-desc&device=steam_machine&search=a%20b%26c&page=3", + SteamDeckRepo.url(SteamDeckRepo.Sort.DOWNLOADS, "steam_machine", " a b&c ", 3), + ) + } + + @Test fun readsAreCutOffAtTheLimit() { + assertEquals(10, SteamDeckRepo.readLimited(ByteArray(10).inputStream(), 10)!!.size) + assertNull(SteamDeckRepo.readLimited(ByteArray(11).inputStream(), 10)) + } + + @Test fun jsonNullsAreEmptyTextNotTheWordNull() { + val posts = SteamDeckRepo.parse( + """{"posts":[{"id":"p9","title":null,"content":null,"user":{"steam_name":null},"thumbnail":null,"video":"https://x/v.webm","url":null}]}""", + )!! + val post = posts.single() + assertEquals("p9", post.title) + assertEquals("", post.content) + assertEquals("", post.author) + assertEquals("", post.thumbnail) + assertEquals("", post.url) + assertTrue(SteamDeckRepo.parse("""{"posts":[{"id":null,"video":"https://x/v.webm"}]}""")!!.isEmpty()) + } + + @Test fun aPageHoldsTwelveMovies() { + assertEquals(12, SteamDeckRepo.PAGE_SIZE) + } + + private fun lastPageOf(pages: Int, tail: Int = SteamDeckRepo.PAGE_SIZE) = SteamDeckRepo.lastPage(SteamDeckRepo.Sort.TRENDING, null, "") { p -> + when { + p < pages -> SteamDeckRepo.PAGE_SIZE + p == pages -> tail + else -> 0 + } + } + + @Test fun theLastPageIsFoundByAskingForPages() { + for (pages in listOf(2, 3, 7, 8, 9, 33, 100, 500)) assertEquals(pages, lastPageOf(pages)) + } + + @Test fun aShortLastPageEndsTheSearchAtOnce() { + assertEquals(1, lastPageOf(1, tail = 5)) + assertEquals(5, lastPageOf(5, tail = 3)) + assertEquals(37, lastPageOf(37, tail = 1)) + } + + @Test fun aSearchWithNothingHasOnePageAndAnUnreachableSiteHasNone() { + assertEquals(1, SteamDeckRepo.lastPage(SteamDeckRepo.Sort.TRENDING, null, "x") { 0 }) + assertNull(SteamDeckRepo.lastPage(SteamDeckRepo.Sort.TRENDING, null, "x") { null }) + assertNull(SteamDeckRepo.lastPage(SteamDeckRepo.Sort.TRENDING, null, "x") { p -> if (p < 4) SteamDeckRepo.PAGE_SIZE else null }) + } +} diff --git a/docs/development/boot-movies.md b/docs/development/boot-movies.md new file mode 100644 index 0000000000..1fa2dd04b3 --- /dev/null +++ b/docs/development/boot-movies.md @@ -0,0 +1,38 @@ +# Boot movies + +Settings → Boot movie has four tabs. + +- **Installed**: "Browse" lists every movie Steam can play: DroidDeck's two, plus every `.webm` in Steam's + `config/uioverrides/movies` folder (imported, installed from SteamDeckRepo, or put there by Steam). The list is re-read + every two seconds, so a movie picked or removed inside Steam shows up, and a movie picked inside Steam becomes the choice. +- **Import**: the same importer as before (copy, remux or on-device transcode to VP8/Opus). The result is written into + Steam's movies folder, so Steam lists it as well. +- **SteamDeckRepo**: browses `https://steamdeckrepo.com/api/posts` (`sort`, `device`, `search`, `page`; 12 posts a page). + Installing downloads the movie through the site's own download address and imports it like any other movie. Tapping a + thumbnail plays the movie from the site (`MediaPlayer` on a `TextureView`) before it is installed. The site does not + say how many pages there are, so the last page is found by asking for pages until one comes back empty or short; the + pager shows the current page (tap it to type another), three pages either side, the first and last page numbers, and + Previous and Next. Search and "go to page" use a small dialog with the app's native text field (`AdbTextField`), + because that field is what brings up the Android keyboard in these screens. +- **Sound**: sound on/off, volume, and how many seconds of the movie play. Anything other than full volume and the whole + movie is built into `files/boot-movie/variants` (audio re-encoded as Opus, video copied) and staged instead. + +Imported and installed movies are kept in `files/boot-movie/library` (with their list, `files/boot-movie/movies.json`) and +copied into Steam's movies folder, so resetting the Linux runtime does not lose them; the copy is put back when it is +missing. The list is changed under one lock, so imports at the same time cannot overwrite each other. Every movie in Steam's custom movies +folder (`config/uioverrides/movies`) can be removed after a confirmation, whether DroidDeck put it there or it was added by +hand or by Steam's own picker. Steam's own three startup movies (`deck_startup`, `oled_startup`, `startup_machine` in +`steamui/movies`) and points shop movies (any other `.webm` below Steam's `config`, `userdata`, `appcache` and `steamui` +folders, plus whatever path `StartupMovie.LocalPath` names) are listed as Steam movies, adopted when picked in Steam, and +never deleted. Bought movies live in `config/communityitemscache/startupmovies/_.webm`; their titles +come from the `GetStartupMovies` list in `userdata//config/localconfig.vdf`. Other videos in `steamui/movies` are not startup movies and are not listed. +Only one processed copy (volume or length change) is kept in `files/boot-movie/variants`; a volume that cannot be applied +plays without sound rather than louder, and plays nothing if that fails too. Covers are cached in `files/boot-movie/thumbs`. Steam reads its startup movie from the `StartupMovie` section inside the `Customization` section of +`config/config.vdf` (`MovieID`, and `LocalPath` relative to `config`; a Points Shop movie has its item number as +`MovieID`). The `StartupMovie` section under `Software/Valve/Steam` is where older clients read it, and DroidDeck writes both. +Selecting a movie here sets `bootMovieApplyNext`, so the next session stages the movie as `bigpicture_startup.webm` and +points both sections at it, over a movie Steam had picked; otherwise a movie picked in Steam is left alone and taken over as +the choice here without being staged over Steam's own setting. Settings > Boot movie > Installed has a report button that +writes what Steam and DroidDeck know to `Download/DroidDeck/boot-movie-report.txt`; it only shows while Debugging tools is on. +A movie larger than 1920x1080 (4K and the like) is never copied or remuxed as it is: import and staging always convert it +(the converter scales to at most 1280x720), because such movies have made Steam crash while it starts.