| 1 | #include "../ethos.hpp" |
| 2 | ConfigurationSettings* config = nullptr; |
| 3 | |
| 4 | ConfigurationSettings::ConfigurationSettings() { |
| 5 | video.append(video.driver = ruby::video.optimalDriver(), "Driver"); |
| 6 | video.append(video.synchronize = false, "Synchronize"); |
| 7 | video.append(video.shader = "Blur", "Shader"); |
| 8 | video.append(video.scaleMode = 0, "ScaleMode"); |
| 9 | video.append(video.aspectCorrection = true, "AspectCorrection"); |
| 10 | video.append(video.colorEmulation = true, "ColorEmulation"); |
| 11 | video.maskOverscan.assign(video.maskOverscan.enable = false); |
| 12 | video.maskOverscan.append(video.maskOverscan.horizontal = 8, "Horizontal"); |
| 13 | video.maskOverscan.append(video.maskOverscan.vertical = 8, "Vertical"); |
| 14 | video.append(video.maskOverscan, "MaskOverscan"); |
| 15 | video.append(video.saturation = 100, "Saturation"); |
| 16 | video.append(video.gamma = 100, "Gamma"); |
| 17 | video.append(video.luminance = 100, "Luminance"); |
| 18 | video.append(video.startFullScreen = false, "StartFullScreen"); |
| 19 | append(video, "Video"); |
| 20 | |
| 21 | audio.append(audio.driver = ruby::audio.optimalDriver(), "Driver"); |
| 22 | audio.append(audio.synchronize = true, "Synchronize"); |
| 23 | audio.append(audio.frequency = 48000, "Frequency"); |
| 24 | audio.append(audio.latency = 60, "Latency"); |
| 25 | audio.append(audio.resampler = 2, "Resampler"); |
| 26 | audio.append(audio.volume = 100, "Volume"); |
| 27 | audio.append(audio.mute = false, "Mute"); |
| 28 | append(audio, "Audio"); |
| 29 | |
| 30 | input.append(input.driver = ruby::input.optimalDriver(), "Driver"); |
| 31 | input.focus.append(input.focus.pause = false, "Pause"); |
| 32 | input.focus.append(input.focus.allow = false, "AllowInput"); |
| 33 | input.append(input.focus, "Focus"); |
| 34 | append(input, "Input"); |
| 35 | |
| 36 | timing.append(timing.video = 60.0, "Video"); |
| 37 | timing.append(timing.audio = 48000.0, "Audio"); |
| 38 | append(timing, "Timing"); |
| 39 | |
| 40 | server.append(server.hostname = "", "Hostname"); |
| 41 | server.append(server.username = "", "Username"); |
| 42 | server.append(server.password = "", "Password"); |
| 43 | append(server, "Server"); |
| 44 | |
| 45 | library.append(library.selection = -1, "Selection"); |
| 46 | library.append(library.mediaMode = 0, "MediaMode"); |
| 47 | library.append(library.showOnStartup = true, "ShowOnStartup"); |
| 48 | append(library, "Library"); |
| 49 | |
| 50 | load(); |
| 51 | } |
| 52 | |
| 53 | void ConfigurationSettings::load() { |
| 54 | Configuration::Document::load(program->path("settings.bml")); |
| 55 | save(); //creates file if it does not exist |
| 56 | } |
| 57 | |
| 58 | void ConfigurationSettings::save() { |
| 59 | Configuration::Document::save(program->path("settings.bml")); |
| 60 | } |