summaryrefslogtreecommitdiffstats
path: root/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NativeConfig.kt
blob: f4e1bb13fc56ae4c006a0dbf3945db9ffa276692 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

package org.yuzu.yuzu_emu.utils

import org.yuzu.yuzu_emu.model.GameDir

object NativeConfig {
    /**
     * Creates a Config object and opens the emulation config.
     */
    @Synchronized
    external fun initializeConfig()

    /**
     * Destroys the stored config object. This automatically saves the existing config.
     */
    @Synchronized
    external fun unloadConfig()

    /**
     * Reads values saved to the config file and saves them.
     */
    @Synchronized
    external fun reloadSettings()

    /**
     * Saves settings values in memory to disk.
     */
    @Synchronized
    external fun saveSettings()

    external fun getBoolean(key: String, getDefault: Boolean): Boolean
    external fun setBoolean(key: String, value: Boolean)

    external fun getByte(key: String, getDefault: Boolean): Byte
    external fun setByte(key: String, value: Byte)

    external fun getShort(key: String, getDefault: Boolean): Short
    external fun setShort(key: String, value: Short)

    external fun getInt(key: String, getDefault: Boolean): Int
    external fun setInt(key: String, value: Int)

    external fun getFloat(key: String, getDefault: Boolean): Float
    external fun setFloat(key: String, value: Float)

    external fun getLong(key: String, getDefault: Boolean): Long
    external fun setLong(key: String, value: Long)

    external fun getString(key: String, getDefault: Boolean): String
    external fun setString(key: String, value: String)

    external fun getIsRuntimeModifiable(key: String): Boolean

    external fun getConfigHeader(category: Int): String

    external fun getPairedSettingKey(key: String): String

    /**
     * Gets every [GameDir] in AndroidSettings::values.game_dirs
     */
    @Synchronized
    external fun getGameDirs(): Array<GameDir>

    /**
     * Clears the AndroidSettings::values.game_dirs array and replaces them with the provided array
     */
    @Synchronized
    external fun setGameDirs(dirs: Array<GameDir>)

    /**
     * Adds a single [GameDir] to the AndroidSettings::values.game_dirs array
     */
    @Synchronized
    external fun addGameDir(dir: GameDir)
}