Skip to content

Commit

Permalink
Added ViewSonic geometry presets (#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed May 22, 2022
1 parent 101e8e2 commit 132da8b
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 11 deletions.
1 change: 1 addition & 0 deletions GUI/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

public extension Int {

static let config = 0 // Configuration
static let defaults = 0 // User defaults
static let events = 0 // Event processing
static let exec = 0 // Execution of external tools
Expand Down
2 changes: 1 addition & 1 deletion GUI/Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ extension Configuration {
hAutoCenter = defaults.bool(Keys.Vid.hAutoCenter)
vAutoCenter = defaults.bool(Keys.Vid.vAutoCenter)
hCenter = defaults.float(Keys.Vid.hCenter)
hCenter = defaults.float(Keys.Vid.vCenter)
vCenter = defaults.float(Keys.Vid.vCenter)
hZoom = defaults.float(Keys.Vid.hZoom)
vZoom = defaults.float(Keys.Vid.vZoom)

Expand Down
50 changes: 40 additions & 10 deletions GUI/Dialogs/Configuration/VideoConf.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,39 +239,57 @@ extension ConfigurationController {

@IBAction func vidHAutoCenterAction(_ sender: NSButton) {

config.hAutoCenter = sender.state == .off
let state = sender.state == .off
debug(.config, "hAutoCenter = \(state)")

config.hAutoCenter = state
parent.renderer.canvas.updateTextureRect()
refresh()
}

@IBAction func vidVAutoCenterAction(_ sender: NSButton) {

config.vAutoCenter = sender.state == .off
let state = sender.state == .off
debug(.config, "vAutoCenter = \(state)")

config.vAutoCenter = state
parent.renderer.canvas.updateTextureRect()
refresh()
}

@IBAction func vidHCenterAction(_ sender: NSSlider!) {

config.hCenter = sender.floatValue / 1000
let value = sender.floatValue / 1000
debug(.config, "hCenter = \(value)")

config.hCenter = value
refresh()
}

@IBAction func vidVCenterAction(_ sender: NSSlider!) {

config.vCenter = sender.floatValue / 1000

let value = sender.floatValue / 1000
debug(.config, "vCenter = \(value)")

config.vCenter = value
refresh()
}

@IBAction func vidHZoomAction(_ sender: NSSlider!) {

config.hZoom = sender.floatValue / 1000

let value = sender.floatValue / 1000
debug(.config, "hZoom = \(value)")

config.hZoom = value
refresh()
}

@IBAction func vidVZoomAction(_ sender: NSSlider!) {

config.vZoom = sender.floatValue / 1000

let value = sender.floatValue / 1000
debug(.config, "vZoom = \(value)")

config.vZoom = value
refresh()
}

Expand Down Expand Up @@ -332,7 +350,19 @@ extension ConfigurationController {
defaults.set(Keys.Vid.bloom, 1)
defaults.set(Keys.Vid.dotMask, 1)
defaults.set(Keys.Vid.scanlines, 2)


case 10: // My personal monitor (ViewSonic VP191b)

AmigaProxy.defaults.removeColorUserDefaults()
AmigaProxy.defaults.removeShaderUserDefaults()
AmigaProxy.defaults.removeGeometryUserDefaults()
defaults.set(Keys.Vid.hAutoCenter, false)
defaults.set(Keys.Vid.vAutoCenter, false)
defaults.set(Keys.Vid.hCenter, 0.39813587)
defaults.set(Keys.Vid.vCenter, 1.0)
defaults.set(Keys.Vid.hZoom, 0.6763221)
defaults.set(Keys.Vid.vZoom, 0.032)

default:
fatalError()
}
Expand Down
7 changes: 7 additions & 0 deletions XIB files/Configuration.xib
Original file line number Diff line number Diff line change
Expand Up @@ -3329,6 +3329,13 @@ DQ
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="xwn-wj-QV7"/>
<menuItem title="ViewSonic VP191b" tag="10" id="6K7-Ed-04f">
<attributedString key="attributedTitle"/>
<connections>
<action selector="vidPresetAction:" target="-2" id="jWc-UT-8O9"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="vdu-oI-n6i"/>
<menuItem title="Geometry" id="tu7-cl-NYW">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Geometry" id="z8l-o7-fX3">
Expand Down

0 comments on commit 132da8b

Please sign in to comment.