1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2024-10-06 02:50:50 +01:00

Refactoting: change names in settings, and using camelCase for settings name.

This commit is contained in:
Filippo Scognamiglio 2014-12-23 18:13:34 +01:00
parent 9d5896b62c
commit 4d3c16fabc
13 changed files with 257 additions and 257 deletions

View File

@ -31,44 +31,44 @@ QtObject{
property bool showMenubar: true property bool showMenubar: true
property real windowOpacity: 1.0 property real windowOpacity: 1.0
property real ambient_light: 0.2 property real ambientLight: 0.2
property real contrast: 0.85 property real contrast: 0.85
property real brightness: 0.5 property real brightness: 0.5
property bool show_terminal_size: true property bool showTerminalSize: true
property real window_scaling: 1.0 property real windowScaling: 1.0
property real fps: 24 property real fps: 24
property bool verbose: false property bool verbose: false
onWindow_scalingChanged: handleFontChanged(); onWindowScalingChanged: handleFontChanged();
// PROFILE SETTINGS /////////////////////////////////////////////////////// // PROFILE SETTINGS ///////////////////////////////////////////////////////
property string _background_color: "#000000" property string _backgroundColor: "#000000"
property string _font_color: "#ff8100" property string _fontColor: "#ff8100"
property string saturated_color: Utils.mix(Utils.strToColor("#FFFFFF"), Utils.strToColor(_font_color), saturation_color * 0.5) property string saturatedColor: Utils.mix(Utils.strToColor("#FFFFFF"), Utils.strToColor(_fontColor), saturationColor * 0.5)
property color font_color: Utils.mix(Utils.strToColor(saturated_color), Utils.strToColor(_background_color), 0.7 + (contrast * 0.3)) property color fontColor: Utils.mix(Utils.strToColor(saturatedColor), Utils.strToColor(_backgroundColor), 0.7 + (contrast * 0.3))
property color background_color: Utils.mix(Utils.strToColor(_background_color), Utils.strToColor(saturated_color), 0.7 + (contrast * 0.3)) property color backgroundColor: Utils.mix(Utils.strToColor(_backgroundColor), Utils.strToColor(saturatedColor), 0.7 + (contrast * 0.3))
property real noise_strength: 0.1 property real staticNoise: 0.1
property real screen_distortion: 0.1 property real screenCurvature: 0.1
property real glowing_line_strength: 0.2 property real glowingLine: 0.2
property real motion_blur: 0.40 property real burnIn: 0.40
property real bloom_strength: 0.65 property real bloom: 0.65
property real bloom_quality: 0.5 property real bloomQuality: 0.5
property real blur_quality: 0.5 property real burnInQuality: 0.5
property real chroma_color: 0.0 property real chromaColor: 0.0
property real saturation_color: 0.0 property real saturationColor: 0.0
property real jitter: 0.18 property real jitter: 0.18
property real horizontal_sincronization: 0.08 property real horizontalSync: 0.08
property real brightness_flickering: 0.1 property real flickering: 0.1
property real rgb_shift: 0.0 property real rbgShift: 0.0
readonly property int no_rasterization: 0 readonly property int no_rasterization: 0
readonly property int scanline_rasterization: 1 readonly property int scanline_rasterization: 1
@ -76,7 +76,7 @@ QtObject{
property int rasterization: no_rasterization property int rasterization: no_rasterization
property int profiles_index: 0 property int profilesIndex: 0
// FONTS ////////////////////////////////////////////////////////////////// // FONTS //////////////////////////////////////////////////////////////////
@ -129,7 +129,7 @@ QtObject{
if (index === undefined) return; if (index === undefined) return;
fontManager.item.selectedFontIndex = index; fontManager.item.selectedFontIndex = index;
fontManager.item.scaling = fontScaling * window_scaling; fontManager.item.scaling = fontScaling * windowScaling;
var fontSource = fontManager.item.source; var fontSource = fontManager.item.source;
var pixelSize = fontManager.item.pixelSize; var pixelSize = fontManager.item.pixelSize;
@ -143,17 +143,17 @@ QtObject{
// FRAMES ///////////////////////////////////////////////////////////////// // FRAMES /////////////////////////////////////////////////////////////////
property bool _frameReflections: false property bool _frameReflections: false
property bool reflectionsAllowed: frames_list.get(frames_index).reflections property bool reflectionsAllowed: framesList.get(framesIndex).reflections
property bool frameReflections: _frameReflections && reflectionsAllowed property bool frameReflections: _frameReflections && reflectionsAllowed
property ListModel frames_list: ListModel{ property ListModel framesList: ListModel{
ListElement{text: "No frame"; source: ""; reflections: false} ListElement{text: "No frame"; source: ""; reflections: false}
ListElement{text: "Simple white frame"; source: "./frames/WhiteSimpleFrame.qml"; reflections: true} ListElement{text: "Simple white frame"; source: "./frames/WhiteSimpleFrame.qml"; reflections: true}
ListElement{text: "Rough black frame"; source: "./frames/BlackRoughFrame.qml"; reflections: true} ListElement{text: "Rough black frame"; source: "./frames/BlackRoughFrame.qml"; reflections: true}
} }
property string frame_source: frames_list.get(frames_index).source property string frameSource: framesList.get(framesIndex).source
property int frames_index: 1 property int framesIndex: 1
// DB STORAGE ///////////////////////////////////////////////////////////// // DB STORAGE /////////////////////////////////////////////////////////////
@ -169,38 +169,38 @@ QtObject{
function composeSettingsString(){ function composeSettingsString(){
var settings = { var settings = {
fps: fps, fps: fps,
window_scaling: window_scaling, windowScaling: windowScaling,
show_terminal_size: show_terminal_size, showTerminalSize: showTerminalSize,
fontScaling: fontScaling, fontScaling: fontScaling,
fontNames: fontNames, fontNames: fontNames,
frameReflections: _frameReflections, frameReflections: _frameReflections,
showMenubar: showMenubar, showMenubar: showMenubar,
bloom_quality: bloom_quality, bloomQuality: bloomQuality,
blur_quality: blur_quality burnInQuality: burnInQuality
} }
return stringify(settings); return stringify(settings);
} }
function composeProfileString(){ function composeProfileString(){
var settings = { var settings = {
background_color: _background_color, backgroundColor: _backgroundColor,
font_color: _font_color, fontColor: _fontColor,
brightness_flickering: brightness_flickering, flickering: flickering,
horizontal_sincronization: horizontal_sincronization, horizontalSync: horizontalSync,
noise_strength: noise_strength, staticNoise: staticNoise,
chroma_color: chroma_color, chromaColor: chromaColor,
saturation_color: saturation_color, saturationColor: saturationColor,
screen_distortion: screen_distortion, screenCurvature: screenCurvature,
glowing_line_strength: glowing_line_strength, glowingLine: glowingLine,
frames_index: frames_index, framesIndex: framesIndex,
motion_blur: motion_blur, burnIn: burnIn,
bloom_strength: bloom_strength, bloom: bloom,
rasterization: rasterization, rasterization: rasterization,
jitter: jitter, jitter: jitter,
rgb_shift: rgb_shift, rbgShift: rbgShift,
brightness: brightness, brightness: brightness,
contrast: contrast, contrast: contrast,
ambient_light: ambient_light, ambientLight: ambientLight,
windowOpacity: windowOpacity, windowOpacity: windowOpacity,
fontName: fontNames[rasterization], fontName: fontNames[rasterization],
fontWidth: fontWidth fontWidth: fontWidth
@ -238,10 +238,10 @@ QtObject{
function loadSettingsString(settingsString){ function loadSettingsString(settingsString){
var settings = JSON.parse(settingsString); var settings = JSON.parse(settingsString);
show_terminal_size = settings.show_terminal_size !== undefined ? settings.show_terminal_size : show_terminal_size showTerminalSize = settings.showTerminalSize !== undefined ? settings.showTerminalSize : showTerminalSize
fps = settings.fps !== undefined ? settings.fps: fps fps = settings.fps !== undefined ? settings.fps: fps
window_scaling = settings.window_scaling !== undefined ? settings.window_scaling : window_scaling windowScaling = settings.windowScaling !== undefined ? settings.windowScaling : windowScaling
fontNames = settings.fontNames !== undefined ? settings.fontNames : fontNames fontNames = settings.fontNames !== undefined ? settings.fontNames : fontNames
fontScaling = settings.fontScaling !== undefined ? settings.fontScaling : fontScaling fontScaling = settings.fontScaling !== undefined ? settings.fontScaling : fontScaling
@ -250,36 +250,36 @@ QtObject{
showMenubar = settings.showMenubar !== undefined ? settings.showMenubar : showMenubar; showMenubar = settings.showMenubar !== undefined ? settings.showMenubar : showMenubar;
bloom_quality = settings.bloom_quality !== undefined ? settings.bloom_quality : bloom_quality; bloomQuality = settings.bloomQuality !== undefined ? settings.bloomQuality : bloomQuality;
blur_quality = settings.blur_quality !== undefined ? settings.blur_quality : blur_quality; burnInQuality = settings.burnInQuality !== undefined ? settings.burnInQuality : burnInQuality;
} }
function loadProfileString(profileString){ function loadProfileString(profileString){
var settings = JSON.parse(profileString); var settings = JSON.parse(profileString);
_background_color = settings.background_color !== undefined ? settings.background_color : _background_color; _backgroundColor = settings.backgroundColor !== undefined ? settings.backgroundColor : _backgroundColor;
_font_color = settings.font_color !== undefined ? settings.font_color : _font_color; _fontColor = settings.fontColor !== undefined ? settings.fontColor : _fontColor;
horizontal_sincronization = settings.horizontal_sincronization !== undefined ? settings.horizontal_sincronization : horizontal_sincronization horizontalSync = settings.horizontalSync !== undefined ? settings.horizontalSync : horizontalSync
brightness_flickering = settings.brightness_flickering !== undefined ? settings.brightness_flickering : brightness_flickering; flickering = settings.flickering !== undefined ? settings.flickering : flickering;
noise_strength = settings.noise_strength !== undefined ? settings.noise_strength : noise_strength; staticNoise = settings.staticNoise !== undefined ? settings.staticNoise : staticNoise;
chroma_color = settings.chroma_color !== undefined ? settings.chroma_color : chroma_color; chromaColor = settings.chromaColor !== undefined ? settings.chromaColor : chromaColor;
saturation_color = settings.saturation_color !== undefined ? settings.saturation_color : saturation_color; saturationColor = settings.saturationColor !== undefined ? settings.saturationColor : saturationColor;
screen_distortion = settings.screen_distortion !== undefined ? settings.screen_distortion : screen_distortion; screenCurvature = settings.screenCurvature !== undefined ? settings.screenCurvature : screenCurvature;
glowing_line_strength = settings.glowing_line_strength !== undefined ? settings.glowing_line_strength : glowing_line_strength; glowingLine = settings.glowingLine !== undefined ? settings.glowingLine : glowingLine;
motion_blur = settings.motion_blur !== undefined ? settings.motion_blur : motion_blur burnIn = settings.burnIn !== undefined ? settings.burnIn : burnIn
bloom_strength = settings.bloom_strength !== undefined ? settings.bloom_strength : bloom_strength bloom = settings.bloom !== undefined ? settings.bloom : bloom
frames_index = settings.frames_index !== undefined ? settings.frames_index : frames_index; framesIndex = settings.framesIndex !== undefined ? settings.framesIndex : framesIndex;
rasterization = settings.rasterization !== undefined ? settings.rasterization : rasterization; rasterization = settings.rasterization !== undefined ? settings.rasterization : rasterization;
jitter = settings.jitter !== undefined ? settings.jitter : jitter; jitter = settings.jitter !== undefined ? settings.jitter : jitter;
rgb_shift = settings.rgb_shift !== undefined ? settings.rgb_shift : rgb_shift; rbgShift = settings.rbgShift !== undefined ? settings.rbgShift : rbgShift;
ambient_light = settings.ambient_light !== undefined ? settings.ambient_light : ambient_light; ambientLight = settings.ambientLight !== undefined ? settings.ambientLight : ambientLight;
contrast = settings.contrast !== undefined ? settings.contrast : contrast; contrast = settings.contrast !== undefined ? settings.contrast : contrast;
brightness = settings.brightness !== undefined ? settings.brightness : brightness; brightness = settings.brightness !== undefined ? settings.brightness : brightness;
windowOpacity = settings.windowOpacity !== undefined ? settings.windowOpacity : windowOpacity; windowOpacity = settings.windowOpacity !== undefined ? settings.windowOpacity : windowOpacity;
@ -303,14 +303,14 @@ QtObject{
for (var i=0; i<customProfiles.length; i++) { for (var i=0; i<customProfiles.length; i++) {
var profile = customProfiles[i]; var profile = customProfiles[i];
console.log("Loading custom profile: " + stringify(profile)); console.log("Loading custom profile: " + stringify(profile));
profiles_list.append(profile); profilesList.append(profile);
} }
} }
function composeCustomProfilesString(){ function composeCustomProfilesString(){
var customProfiles = [] var customProfiles = []
for(var i=0; i<profiles_list.count; i++){ for(var i=0; i<profilesList.count; i++){
var profile = profiles_list.get(i); var profile = profilesList.get(i);
if(profile.builtin) continue; if(profile.builtin) continue;
customProfiles.push({text: profile.text, obj_string: profile.obj_string, builtin: false}) customProfiles.push({text: profile.text, obj_string: profile.obj_string, builtin: false})
} }
@ -318,72 +318,72 @@ QtObject{
} }
function loadCurrentProfile(){ function loadCurrentProfile(){
loadProfile(profiles_index); loadProfile(profilesIndex);
} }
function loadProfile(index){ function loadProfile(index){
var profile = profiles_list.get(index); var profile = profilesList.get(index);
loadProfileString(profile.obj_string); loadProfileString(profile.obj_string);
} }
function addNewCustomProfile(name){ function addNewCustomProfile(name){
var profileString = composeProfileString(); var profileString = composeProfileString();
profiles_list.append({text: name, obj_string: profileString, builtin: false}); profilesList.append({text: name, obj_string: profileString, builtin: false});
} }
// PROFILES /////////////////////////////////////////////////////////////// // PROFILES ///////////////////////////////////////////////////////////////
property ListModel profiles_list: ListModel{ property ListModel profilesList: ListModel{
ListElement{ ListElement{
text: "Default Amber" text: "Default Amber"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.65,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontName":"TERMINUS","font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.4,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}' obj_string: '{"ambientLight":0.2,"backgroundColor":"#000000","bloom":0.65,"brightness":0.5,"flickering":0.1,"contrast":0.85,"fontName":"TERMINUS","fontColor":"#ff8100","framesIndex":1,"glowingLine":0.2,"horizontalSync":0.08,"jitter":0.18,"burnIn":0.4,"staticNoise":0.1,"rasterization":0,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true builtin: true
} }
ListElement{ ListElement{
text: "Default Green" text: "Default Green"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontName":"TERMINUS","font_color":"#0ccc68","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.45,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}' obj_string: '{"ambientLight":0.2,"backgroundColor":"#000000","bloom":0.4,"brightness":0.5,"flickering":0.1,"contrast":0.85,"fontName":"TERMINUS","fontColor":"#0ccc68","framesIndex":1,"glowingLine":0.2,"horizontalSync":0.08,"jitter":0.18,"burnIn":0.45,"staticNoise":0.1,"rasterization":0,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true builtin: true
} }
ListElement{ ListElement{
text: "Default Scanlines" text: "Default Scanlines"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontName":"TERMINUS","font_color":"#00ff5b","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.07,"jitter":0.11,"motion_blur":0.4,"noise_strength":0.05,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}' obj_string: '{"ambientLight":0.2,"backgroundColor":"#000000","bloom":0.4,"brightness":0.5,"flickering":0.1,"contrast":0.85,"fontName":"TERMINUS","fontColor":"#00ff5b","framesIndex":1,"glowingLine":0.2,"horizontalSync":0.07,"jitter":0.11,"burnIn":0.4,"staticNoise":0.05,"rasterization":1,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true builtin: true
} }
ListElement{ ListElement{
text: "Default Pixelated" text: "Default Pixelated"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontName":"TERMINUS","font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.1,"jitter":0,"motion_blur":0.45,"noise_strength":0.14,"rasterization":2,"screen_distortion":0.05,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}' obj_string: '{"ambientLight":0.2,"backgroundColor":"#000000","bloom":0.4,"brightness":0.5,"flickering":0.1,"contrast":0.85,"fontName":"TERMINUS","fontColor":"#ff8100","framesIndex":1,"glowingLine":0.2,"horizontalSync":0.1,"jitter":0,"burnIn":0.45,"staticNoise":0.14,"rasterization":2,"screenCurvature":0.05,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true builtin: true
} }
ListElement{ ListElement{
text: "Apple ][" text: "Apple ]["
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.5,"brightness":0.5,"brightness_flickering":0.2,"contrast":0.85,"fontName":"APPLE_II","font_color":"#2fff91","frames_index":1,"glowing_line_strength":0.22,"horizontal_sincronization":0.08,"jitter":0.1,"motion_blur":0.65,"noise_strength":0.08,"rasterization":1,"screen_distortion":0.18,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}' obj_string: '{"ambientLight":0.2,"backgroundColor":"#000000","bloom":0.5,"brightness":0.5,"flickering":0.2,"contrast":0.85,"fontName":"APPLE_II","fontColor":"#2fff91","framesIndex":1,"glowingLine":0.22,"horizontalSync":0.08,"jitter":0.1,"burnIn":0.65,"staticNoise":0.08,"rasterization":1,"screenCurvature":0.18,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true builtin: true
} }
ListElement{ ListElement{
text: "Vintage" text: "Vintage"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.54,"contrast":0.85,"fontName":"TERMINUS","font_color":"#00ff3e","frames_index":2,"glowing_line_strength":0.3,"horizontal_sincronization":0.2,"jitter":0.4,"motion_blur":0.75,"noise_strength":0.2,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}' obj_string: '{"ambientLight":0.2,"backgroundColor":"#000000","bloom":0.4,"brightness":0.5,"flickering":0.54,"contrast":0.85,"fontName":"TERMINUS","fontColor":"#00ff3e","framesIndex":2,"glowingLine":0.3,"horizontalSync":0.2,"jitter":0.4,"burnIn":0.75,"staticNoise":0.2,"rasterization":1,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true builtin: true
} }
ListElement{ ListElement{
text: "IBM Dos" text: "IBM Dos"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.07,"contrast":0.85,"fontName":"IBM_DOS","font_color":"#ffffff","frames_index":1,"glowing_line_strength":0.13,"horizontal_sincronization":0,"jitter":0.08,"motion_blur":0.3,"noise_strength":0.03,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":1,"saturation_color":0,"rgb_shift":0.5,"fontWidth":1.0}' obj_string: '{"ambientLight":0.2,"backgroundColor":"#000000","bloom":0.4,"brightness":0.5,"flickering":0.07,"contrast":0.85,"fontName":"IBM_DOS","fontColor":"#ffffff","framesIndex":1,"glowingLine":0.13,"horizontalSync":0,"jitter":0.08,"burnIn":0.3,"staticNoise":0.03,"rasterization":0,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":1,"saturationColor":0,"rbgShift":0.5,"fontWidth":1.0}'
builtin: true builtin: true
} }
ListElement{ ListElement{
text: "IBM 3278" text: "IBM 3278"
obj_string: '{"ambient_light":0.1,"background_color":"#000000","bloom_strength":0.15,"brightness":0.5,"brightness_flickering":0,"contrast":0.95,"fontName":"IBM_3278","font_color":"#0ccc68","frames_index":1,"glowing_line_strength":0,"horizontal_sincronization":0,"jitter":0,"motion_blur":0.6,"noise_strength":0,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}' obj_string: '{"ambientLight":0.1,"backgroundColor":"#000000","bloom":0.15,"brightness":0.5,"flickering":0,"contrast":0.95,"fontName":"IBM_3278","fontColor":"#0ccc68","framesIndex":1,"glowingLine":0,"horizontalSync":0,"jitter":0,"burnIn":0.6,"staticNoise":0,"rasterization":0,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true builtin: true
} }
ListElement{ ListElement{
text: "Transparent Green" text: "Transparent Green"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.45,"brightness":0.5,"brightness_flickering":0.20,"contrast":0.85,"fontName":"TERMINUS","font_color":"#0ccc68","frames_index":0,"glowing_line_strength":0.16,"horizontal_sincronization":0.05,"jitter":0.20,"motion_blur":0.25,"noise_strength":0.20,"rasterization":0,"screen_distortion":0.05,"windowOpacity":0.60,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}' obj_string: '{"ambientLight":0.2,"backgroundColor":"#000000","bloom":0.45,"brightness":0.5,"flickering":0.20,"contrast":0.85,"fontName":"TERMINUS","fontColor":"#0ccc68","framesIndex":0,"glowingLine":0.16,"horizontalSync":0.05,"jitter":0.20,"burnIn":0.25,"staticNoise":0.20,"rasterization":0,"screenCurvature":0.05,"windowOpacity":0.60,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true builtin: true
} }
} }
function getProfileIndexByName(name) { function getProfileIndexByName(name) {
for (var i = 0; i < profiles_list.count; i++) { for (var i = 0; i < profilesList.count; i++) {
if(profiles_list.get(i).text === name) if(profilesList.get(i).text === name)
return i; return i;
} }
return -1; return -1;

View File

@ -31,7 +31,7 @@ MenuBar {
title: qsTr("Profiles") title: qsTr("Profiles")
visible: defaultMenuBar.visible visible: defaultMenuBar.visible
Instantiator{ Instantiator{
model: appSettings.profiles_list model: appSettings.profilesList
delegate: MenuItem { delegate: MenuItem {
text: model.text text: model.text
onTriggered: { onTriggered: {

View File

@ -45,7 +45,7 @@ Window{
} }
function validateName(name){ function validateName(name){
var profile_list = appSettings.profiles_list; var profile_list = appSettings.profilesList;
if (name === "") if (name === "")
return 1; return 1;

View File

@ -37,13 +37,13 @@ Item{
property alias title: ksession.title property alias title: ksession.title
property alias kterminal: kterminal property alias kterminal: kterminal
anchors.leftMargin: frame.displacementLeft * appSettings.window_scaling anchors.leftMargin: frame.displacementLeft * appSettings.windowScaling
anchors.rightMargin: frame.displacementRight * appSettings.window_scaling anchors.rightMargin: frame.displacementRight * appSettings.windowScaling
anchors.topMargin: frame.displacementTop * appSettings.window_scaling anchors.topMargin: frame.displacementTop * appSettings.windowScaling
anchors.bottomMargin: frame.displacementBottom * appSettings.window_scaling anchors.bottomMargin: frame.displacementBottom * appSettings.windowScaling
//The blur effect has to take into account the framerate //The blur effect has to take into account the framerate
property real mBlur: appSettings.motion_blur property real mBlur: appSettings.burnIn
property real motionBlurCoefficient: (_maxBlurCoefficient * Math.sqrt(mBlur) + _minBlurCoefficient * (1 - Math.sqrt(mBlur))) property real motionBlurCoefficient: (_maxBlurCoefficient * Math.sqrt(mBlur) + _minBlurCoefficient * (1 - Math.sqrt(mBlur)))
property real _minBlurCoefficient: 0.50 property real _minBlurCoefficient: 0.50
property real _maxBlurCoefficient: 0.90 property real _maxBlurCoefficient: 0.90
@ -208,7 +208,7 @@ Item{
y = y / height; y = y / height;
var cc = Qt.size(0.5 - x, 0.5 - y); var cc = Qt.size(0.5 - x, 0.5 - y);
var distortion = (cc.height * cc.height + cc.width * cc.width) * appSettings.screen_distortion; var distortion = (cc.height * cc.height + cc.width * cc.width) * appSettings.screenCurvature;
return Qt.point((x - cc.width * (1+distortion) * distortion) * kterminal.width, return Qt.point((x - cc.width * (1+distortion) * distortion) * kterminal.width,
(y - cc.height * (1+distortion) * distortion) * kterminal.height) (y - cc.height * (1+distortion) * distortion) * kterminal.height)
@ -256,7 +256,7 @@ Item{
// Restart blurred source settings change. // Restart blurred source settings change.
Connections{ Connections{
target: appSettings target: appSettings
onMotion_blurChanged: _blurredSourceEffect.restartBlurSource(); onBurnInChanged: _blurredSourceEffect.restartBlurSource();
onTerminalFontChanged: _blurredSourceEffect.restartBlurSource(); onTerminalFontChanged: _blurredSourceEffect.restartBlurSource();
onRasterizationChanged: _blurredSourceEffect.restartBlurSource(); onRasterizationChanged: _blurredSourceEffect.restartBlurSource();
} }
@ -270,8 +270,8 @@ Item{
Loader{ Loader{
id: blurredTerminalLoader id: blurredTerminalLoader
width: kterminal.width * scaleTexture * appSettings.blur_quality width: kterminal.width * scaleTexture * appSettings.burnInQuality
height: kterminal.height * scaleTexture * appSettings.blur_quality height: kterminal.height * scaleTexture * appSettings.burnInQuality
active: mBlur !== 0 active: mBlur !== 0
asynchronous: true asynchronous: true

View File

@ -30,18 +30,18 @@ Tab{
anchors.fill: parent anchors.fill: parent
CheckableSlider{ CheckableSlider{
name: qsTr("Bloom") name: qsTr("Bloom")
onNewValue: appSettings.bloom_strength = newValue onNewValue: appSettings.bloom = newValue
value: appSettings.bloom_strength value: appSettings.bloom
} }
CheckableSlider{ CheckableSlider{
name: qsTr("Motion Blur") name: qsTr("BurnIn")
onNewValue: appSettings.motion_blur = newValue onNewValue: appSettings.burnIn = newValue
value: appSettings.motion_blur value: appSettings.burnIn
} }
CheckableSlider{ CheckableSlider{
name: qsTr("Noise") name: qsTr("Static Noise")
onNewValue: appSettings.noise_strength = newValue onNewValue: appSettings.staticNoise = newValue
value: appSettings.noise_strength value: appSettings.staticNoise
} }
CheckableSlider{ CheckableSlider{
name: qsTr("Jitter") name: qsTr("Jitter")
@ -49,36 +49,36 @@ Tab{
value: appSettings.jitter value: appSettings.jitter
} }
CheckableSlider{ CheckableSlider{
name: qsTr("Glow") name: qsTr("Glow Line")
onNewValue: appSettings.glowing_line_strength = newValue; onNewValue: appSettings.glowingLine = newValue;
value: appSettings.glowing_line_strength value: appSettings.glowingLine
} }
CheckableSlider{ CheckableSlider{
name: qsTr("Screen distortion") name: qsTr("Screen Curvature")
onNewValue: appSettings.screen_distortion = newValue; onNewValue: appSettings.screenCurvature = newValue;
value: appSettings.screen_distortion; value: appSettings.screenCurvature;
} }
CheckableSlider{ CheckableSlider{
name: qsTr("Ambient light") name: qsTr("Ambient Light")
onNewValue: appSettings.ambient_light = newValue; onNewValue: appSettings.ambientLight = newValue;
value: appSettings.ambient_light value: appSettings.ambientLight
enabled: appSettings.frames_index !== 0 enabled: appSettings.framesIndex !== 0
} }
CheckableSlider{ CheckableSlider{
name: qsTr("Brightness flickering") name: qsTr("Flickering")
onNewValue: appSettings.brightness_flickering = newValue; onNewValue: appSettings.flickering = newValue;
value: appSettings.brightness_flickering; value: appSettings.flickering;
} }
CheckableSlider{ CheckableSlider{
name: qsTr("Horizontal flickering") name: qsTr("Horizontal Sync")
onNewValue: appSettings.horizontal_sincronization = newValue; onNewValue: appSettings.horizontalSync = newValue;
value: appSettings.horizontal_sincronization; value: appSettings.horizontalSync;
} }
CheckableSlider{ CheckableSlider{
name: qsTr("RGB shift") name: qsTr("RGB Shift")
onNewValue: appSettings.rgb_shift = newValue; onNewValue: appSettings.rbgShift = newValue;
value: appSettings.rgb_shift; value: appSettings.rbgShift;
enabled: appSettings.chroma_color !== 0 enabled: appSettings.chromaColor !== 0
} }
} }
} }

View File

@ -33,8 +33,8 @@ Tab{
ComboBox{ ComboBox{
id: profilesbox id: profilesbox
Layout.fillWidth: true Layout.fillWidth: true
model: appSettings.profiles_list model: appSettings.profilesList
currentIndex: appSettings.profiles_index currentIndex: appSettings.profilesIndex
} }
RowLayout{ RowLayout{
Layout.fillWidth: true Layout.fillWidth: true
@ -42,7 +42,7 @@ Tab{
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Load") text: qsTr("Load")
onClicked: { onClicked: {
appSettings.profiles_index = profilesbox.currentIndex appSettings.profilesIndex = profilesbox.currentIndex
appSettings.loadCurrentProfile(); appSettings.loadCurrentProfile();
appSettings.handleFontChanged(); appSettings.handleFontChanged();
} }
@ -55,9 +55,9 @@ Tab{
Button{ Button{
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Remove Selected") text: qsTr("Remove Selected")
enabled: !appSettings.profiles_list.get(profilesbox.currentIndex).builtin enabled: !appSettings.profilesList.get(profilesbox.currentIndex).builtin
onClicked: { onClicked: {
appSettings.profiles_list.remove(profilesbox.currentIndex) appSettings.profilesList.remove(profilesbox.currentIndex)
profilesbox.currentIndex = profilesbox.currentIndex - 1 profilesbox.currentIndex = profilesbox.currentIndex - 1
} }
} }
@ -99,9 +99,9 @@ Tab{
ComboBox{ ComboBox{
id: framescombobox id: framescombobox
Layout.fillWidth: true Layout.fillWidth: true
model: appSettings.frames_list model: appSettings.framesList
currentIndex: appSettings.frames_index currentIndex: appSettings.framesIndex
onCurrentIndexChanged: appSettings.frames_index = currentIndex onCurrentIndexChanged: appSettings.framesIndex = currentIndex
} }
} }
} }

View File

@ -38,7 +38,7 @@ Tab{
property int fps: checked ? slider.value : 0 property int fps: checked ? slider.value : 0
onFpsChanged: appSettings.fps = fps onFpsChanged: appSettings.fps = fps
checked: appSettings.fps !== 0 checked: appSettings.fps !== 0
text: qsTr("Limit FPS") text: qsTr("Effects FPS")
} }
Slider{ Slider{
id: slider id: slider
@ -54,8 +54,8 @@ Tab{
Slider{ Slider{
Layout.fillWidth: true Layout.fillWidth: true
id: txtslider id: txtslider
onValueChanged: appSettings.window_scaling = value; onValueChanged: appSettings.windowScaling = value;
value: appSettings.window_scaling value: appSettings.windowScaling
stepSize: 0.10 stepSize: 0.10
Component.onCompleted: minimumValue = 0.3 //Without this value gets set to 0.5 Component.onCompleted: minimumValue = 0.3 //Without this value gets set to 0.5
} }
@ -75,8 +75,8 @@ Tab{
Slider{ Slider{
Layout.fillWidth: true Layout.fillWidth: true
id: bloomSlider id: bloomSlider
onValueChanged: appSettings.bloom_quality = value; onValueChanged: appSettings.bloomQuality = value;
value: appSettings.bloom_quality value: appSettings.bloomQuality
stepSize: 0.10 stepSize: 0.10
Component.onCompleted: minimumValue = 0.3 //Without this value gets set to 0.5 Component.onCompleted: minimumValue = 0.3 //Without this value gets set to 0.5
} }
@ -84,7 +84,7 @@ Tab{
} }
} }
GroupBox{ GroupBox{
title: qsTr("Motion Blur") title: qsTr("BurnIn")
Layout.fillWidth: true Layout.fillWidth: true
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@ -92,12 +92,12 @@ Tab{
id: blurQualityContainer id: blurQualityContainer
anchors.fill: parent anchors.fill: parent
Text{text: qsTr("Blur Quality")} Text{text: qsTr("BurnIn Quality")}
Slider{ Slider{
Layout.fillWidth: true Layout.fillWidth: true
id: blurSlider id: blurSlider
onValueChanged: appSettings.blur_quality = value; onValueChanged: appSettings.burnInQuality = value;
value: appSettings.blur_quality value: appSettings.burnInQuality
stepSize: 0.10 stepSize: 0.10
Component.onCompleted: minimumValue = 0.3 //Without this value gets set to 0.5 Component.onCompleted: minimumValue = 0.3 //Without this value gets set to 0.5
} }

View File

@ -123,29 +123,29 @@ Tab{
name: qsTr("Font") name: qsTr("Font")
height: 50 height: 50
Layout.fillWidth: true Layout.fillWidth: true
onColorSelected: appSettings._font_color = color; onColorSelected: appSettings._fontColor = color;
button_color: appSettings._font_color button_color: appSettings._fontColor
} }
ColorButton{ ColorButton{
name: qsTr("Background") name: qsTr("Background")
height: 50 height: 50
Layout.fillWidth: true Layout.fillWidth: true
onColorSelected: appSettings._background_color = color; onColorSelected: appSettings._backgroundColor = color;
button_color: appSettings._background_color button_color: appSettings._backgroundColor
} }
} }
ColumnLayout{ ColumnLayout{
Layout.fillWidth: true Layout.fillWidth: true
CheckableSlider{ CheckableSlider{
name: qsTr("Chroma Color") name: qsTr("Chroma Color")
onNewValue: appSettings.chroma_color = newValue onNewValue: appSettings.chromaColor = newValue
value: appSettings.chroma_color value: appSettings.chromaColor
} }
CheckableSlider{ CheckableSlider{
name: qsTr("Saturation Color") name: qsTr("Saturation Color")
onNewValue: appSettings.saturation_color = newValue onNewValue: appSettings.saturationColor = newValue
value: appSettings.saturation_color value: appSettings.saturationColor
enabled: appSettings.chroma_color !== 0 enabled: appSettings.chromaColor !== 0
} }
} }
} }

View File

@ -26,33 +26,33 @@ ShaderEffect {
property ShaderEffectSource blurredSource property ShaderEffectSource blurredSource
property ShaderEffectSource bloomSource property ShaderEffectSource bloomSource
property color font_color: appSettings.font_color property color fontColor: appSettings.fontColor
property color background_color: appSettings.background_color property color backgroundColor: appSettings.backgroundColor
property real bloom_strength: appSettings.bloom_strength * 2.5 property real bloom: appSettings.bloom * 2.5
property real motion_blur: appSettings.motion_blur property real burnIn: appSettings.burnIn
property real jitter: appSettings.jitter * 0.007 property real jitter: appSettings.jitter * 0.007
property real noise_strength: appSettings.noise_strength property real staticNoise: appSettings.staticNoise
property size scaleNoiseSize: Qt.size((width) / (noiseTexture.width * appSettings.window_scaling * appSettings.fontScaling), property size scaleNoiseSize: Qt.size((width) / (noiseTexture.width * appSettings.windowScaling * appSettings.fontScaling),
(height) / (noiseTexture.height * appSettings.window_scaling * appSettings.fontScaling)) (height) / (noiseTexture.height * appSettings.windowScaling * appSettings.fontScaling))
property real screen_distorsion: appSettings.screen_distortion property real screen_distorsion: appSettings.screenCurvature
property real glowing_line_strength: appSettings.glowing_line_strength property real glowingLine: appSettings.glowingLine
property real chroma_color: appSettings.chroma_color; property real chromaColor: appSettings.chromaColor;
property real rgb_shift: appSettings.rgb_shift * 0.2 property real rbgShift: appSettings.rbgShift * 0.2
property real brightness_flickering: appSettings.brightness_flickering property real flickering: appSettings.flickering
property real horizontal_sincronization: appSettings.horizontal_sincronization property real horizontalSync: appSettings.horizontalSync
property bool frameReflections: appSettings.frameReflections property bool frameReflections: appSettings.frameReflections
property real disp_top: (frame.displacementTop * appSettings.window_scaling) / height property real disp_top: (frame.displacementTop * appSettings.windowScaling) / height
property real disp_bottom: (frame.displacementBottom * appSettings.window_scaling) / height property real disp_bottom: (frame.displacementBottom * appSettings.windowScaling) / height
property real disp_left: (frame.displacementLeft * appSettings.window_scaling) / width property real disp_left: (frame.displacementLeft * appSettings.windowScaling) / width
property real disp_right: (frame.displacementRight * appSettings.window_scaling) / width property real disp_right: (frame.displacementRight * appSettings.windowScaling) / width
property real screen_brightness: appSettings.brightness * 1.5 + 0.5 property real screen_brightness: appSettings.brightness * 1.5 + 0.5
@ -112,11 +112,11 @@ ShaderEffect {
(!fallBack ? " (!fallBack ? "
uniform sampler2D noiseSource;" : "") + uniform sampler2D noiseSource;" : "") +
(!fallBack && brightness_flickering !== 0.0 ?" (!fallBack && flickering !== 0.0 ?"
varying lowp float brightness; varying lowp float brightness;
uniform lowp float brightness_flickering;" : "") + uniform lowp float flickering;" : "") +
(!fallBack && horizontal_sincronization !== 0.0 ?" (!fallBack && horizontalSync !== 0.0 ?"
uniform lowp float horizontal_sincronization; uniform lowp float horizontalSync;
varying lowp float distortionScale; varying lowp float distortionScale;
varying lowp float distortionFreq;" : "") + varying lowp float distortionFreq;" : "") +
@ -126,16 +126,16 @@ ShaderEffect {
qt_TexCoord0.y = (qt_MultiTexCoord0.y - disp_top) / (1.0 - disp_top - disp_bottom); qt_TexCoord0.y = (qt_MultiTexCoord0.y - disp_top) / (1.0 - disp_top - disp_bottom);
vec2 coords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));" + vec2 coords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));" +
(!fallBack && (brightness_flickering !== 0.0 || horizontal_sincronization !== 0.0) ? (!fallBack && (flickering !== 0.0 || horizontalSync !== 0.0) ?
"vec4 initialNoiseTexel = texture2D(noiseSource, coords);" "vec4 initialNoiseTexel = texture2D(noiseSource, coords);"
: "") + : "") +
(!fallBack && brightness_flickering !== 0.0 ? " (!fallBack && flickering !== 0.0 ? "
brightness = 1.0 + (initialNoiseTexel.g - 0.5) * brightness_flickering;" brightness = 1.0 + (initialNoiseTexel.g - 0.5) * flickering;"
: "") + : "") +
(!fallBack && horizontal_sincronization !== 0.0 ? " (!fallBack && horizontalSync !== 0.0 ? "
float randval = horizontal_sincronization - initialNoiseTexel.r; float randval = horizontalSync - initialNoiseTexel.r;
distortionScale = step(0.0, randval) * randval * horizontal_sincronization; distortionScale = step(0.0, randval) * randval * horizontalSync;
distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);" distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);"
: "") + : "") +
@ -148,50 +148,50 @@ ShaderEffect {
uniform highp float time; uniform highp float time;
varying highp vec2 qt_TexCoord0; varying highp vec2 qt_TexCoord0;
uniform highp vec4 font_color; uniform highp vec4 fontColor;
uniform highp vec4 background_color; uniform highp vec4 backgroundColor;
uniform lowp float screen_brightness; uniform lowp float screen_brightness;
uniform highp vec2 virtual_resolution; uniform highp vec2 virtual_resolution;
uniform highp float dispX; uniform highp float dispX;
uniform highp float dispY;" + uniform highp float dispY;" +
(bloom_strength !== 0 ? " (bloom !== 0 ? "
uniform highp sampler2D bloomSource; uniform highp sampler2D bloomSource;
uniform lowp float bloom_strength;" : "") + uniform lowp float bloom;" : "") +
(motion_blur !== 0 ? " (burnIn !== 0 ? "
uniform sampler2D blurredSource;" : "") + uniform sampler2D blurredSource;" : "") +
(noise_strength !== 0 ? " (staticNoise !== 0 ? "
uniform highp float noise_strength;" : "") + uniform highp float staticNoise;" : "") +
(((noise_strength !== 0 || jitter !== 0 || rgb_shift) (((staticNoise !== 0 || jitter !== 0 || rbgShift)
||(fallBack && (brightness_flickering || horizontal_sincronization))) ? " ||(fallBack && (flickering || horizontalSync))) ? "
uniform lowp sampler2D noiseSource; uniform lowp sampler2D noiseSource;
uniform highp vec2 scaleNoiseSize;" : "") + uniform highp vec2 scaleNoiseSize;" : "") +
(screen_distorsion !== 0 ? " (screen_distorsion !== 0 ? "
uniform highp float screen_distorsion;" : "") + uniform highp float screen_distorsion;" : "") +
(glowing_line_strength !== 0 ? " (glowingLine !== 0 ? "
uniform highp float glowing_line_strength;" : "") + uniform highp float glowingLine;" : "") +
(chroma_color !== 0 ? " (chromaColor !== 0 ? "
uniform lowp float chroma_color;" : "") + uniform lowp float chromaColor;" : "") +
(jitter !== 0 ? " (jitter !== 0 ? "
uniform lowp float jitter;" : "") + uniform lowp float jitter;" : "") +
(rgb_shift !== 0 ? " (rbgShift !== 0 ? "
uniform lowp float rgb_shift;" : "") + uniform lowp float rbgShift;" : "") +
(fallBack && horizontal_sincronization !== 0 ? " (fallBack && horizontalSync !== 0 ? "
uniform lowp float horizontal_sincronization;" : "") + uniform lowp float horizontalSync;" : "") +
(fallBack && brightness_flickering !== 0.0 ?" (fallBack && flickering !== 0.0 ?"
uniform lowp float brightness_flickering;" : "") + uniform lowp float flickering;" : "") +
(!fallBack && brightness_flickering !== 0 ? " (!fallBack && flickering !== 0 ? "
varying lowp float brightness;" varying lowp float brightness;"
: "") + : "") +
(!fallBack && horizontal_sincronization !== 0 ? " (!fallBack && horizontalSync !== 0 ? "
varying lowp float distortionScale; varying lowp float distortionScale;
varying lowp float distortionFreq;" : "") + varying lowp float distortionFreq;" : "") +
(glowing_line_strength !== 0 ? " (glowingLine !== 0 ? "
float randomPass(vec2 coords){ float randomPass(vec2 coords){
return fract(smoothstep(-0.2, 0.0, coords.y - 3.0 * fract(time * 0.0001))) * glowing_line_strength; return fract(smoothstep(-0.2, 0.0, coords.y - 3.0 * fract(time * 0.0001))) * glowingLine;
}" : "") + }" : "") +
"highp float getScanlineIntensity(vec2 coords) { "highp float getScanlineIntensity(vec2 coords) {
@ -214,21 +214,21 @@ ShaderEffect {
"float distance = length(cc);" + "float distance = length(cc);" +
//FallBack if there are problems //FallBack if there are problems
(fallBack && (brightness_flickering !== 0.0 || horizontal_sincronization !== 0.0) ? (fallBack && (flickering !== 0.0 || horizontalSync !== 0.0) ?
"vec2 initialCoords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0))); "vec2 initialCoords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));
vec4 initialNoiseTexel = texture2D(noiseSource, initialCoords);" vec4 initialNoiseTexel = texture2D(noiseSource, initialCoords);"
: "") + : "") +
(fallBack && brightness_flickering !== 0.0 ? " (fallBack && flickering !== 0.0 ? "
float brightness = 1.0 + (initialNoiseTexel.g - 0.5) * brightness_flickering;" float brightness = 1.0 + (initialNoiseTexel.g - 0.5) * flickering;"
: "") + : "") +
(fallBack && horizontal_sincronization !== 0.0 ? " (fallBack && horizontalSync !== 0.0 ? "
float randval = horizontal_sincronization - initialNoiseTexel.r; float randval = horizontalSync - initialNoiseTexel.r;
float distortionScale = step(0.0, randval) * randval * horizontal_sincronization; float distortionScale = step(0.0, randval) * randval * horizontalSync;
float distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);" float distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);"
: "") + : "") +
(noise_strength ? " (staticNoise ? "
float noise = noise_strength;" : "") + float noise = staticNoise;" : "") +
(screen_distorsion !== 0 ? " (screen_distorsion !== 0 ? "
float distortion = dot(cc, cc) * screen_distorsion; float distortion = dot(cc, cc) * screen_distorsion;
@ -238,14 +238,14 @@ ShaderEffect {
"vec2 coords = staticCoords;" + "vec2 coords = staticCoords;" +
(horizontal_sincronization !== 0 ? " (horizontalSync !== 0 ? "
float dst = sin((coords.y + time * 0.001) * distortionFreq); float dst = sin((coords.y + time * 0.001) * distortionFreq);
coords.x += dst * distortionScale;" + coords.x += dst * distortionScale;" +
(noise_strength ? " (staticNoise ? "
noise += distortionScale * 3.0;" : "") noise += distortionScale * 3.0;" : "")
: "") + : "") +
(jitter !== 0 || noise_strength !== 0 ? (jitter !== 0 || staticNoise !== 0 ?
"vec4 noiseTexel = texture2D(noiseSource, scaleNoiseSize * coords + vec2(fract(time / 51.0), fract(time / 237.0)));" "vec4 noiseTexel = texture2D(noiseSource, scaleNoiseSize * coords + vec2(fract(time / 51.0), fract(time / 237.0)));"
: "") + : "") +
@ -256,54 +256,54 @@ ShaderEffect {
"float color = 0.0;" + "float color = 0.0;" +
(noise_strength !== 0 ? " (staticNoise !== 0 ? "
float noiseVal = noiseTexel.a; float noiseVal = noiseTexel.a;
color += noiseVal * noise * (1.0 - distance * 1.3);" : "") + color += noiseVal * noise * (1.0 - distance * 1.3);" : "") +
(glowing_line_strength !== 0 ? " (glowingLine !== 0 ? "
color += randomPass(coords) * glowing_line_strength;" : "") + color += randomPass(coords) * glowingLine;" : "") +
"vec3 txt_color = texture2D(source, txt_coords).rgb;" + "vec3 txt_color = texture2D(source, txt_coords).rgb;" +
(motion_blur !== 0 ? " (burnIn !== 0 ? "
vec4 txt_blur = texture2D(blurredSource, txt_coords); vec4 txt_blur = texture2D(blurredSource, txt_coords);
txt_color = txt_color + txt_blur.rgb * txt_blur.a;" txt_color = txt_color + txt_blur.rgb * txt_blur.a;"
: "") + : "") +
"float greyscale_color = rgb2grey(txt_color) + color;" + "float greyscale_color = rgb2grey(txt_color) + color;" +
(chroma_color !== 0 ? (chromaColor !== 0 ?
(rgb_shift !== 0 ? " (rbgShift !== 0 ? "
float rgb_noise = abs(texture2D(noiseSource, vec2(fract(time/(1024.0 * 256.0)), fract(time/(1024.0*1024.0)))).a - 0.5); float rgb_noise = abs(texture2D(noiseSource, vec2(fract(time/(1024.0 * 256.0)), fract(time/(1024.0*1024.0)))).a - 0.5);
float rcolor = texture2D(source, txt_coords + vec2(0.1, 0.0) * rgb_shift * rgb_noise).r; float rcolor = texture2D(source, txt_coords + vec2(0.1, 0.0) * rbgShift * rgb_noise).r;
float bcolor = texture2D(source, txt_coords - vec2(0.1, 0.0) * rgb_shift * rgb_noise).b; float bcolor = texture2D(source, txt_coords - vec2(0.1, 0.0) * rbgShift * rgb_noise).b;
txt_color.r = rcolor; txt_color.r = rcolor;
txt_color.b = bcolor; txt_color.b = bcolor;
greyscale_color = 0.33 * (rcolor + bcolor);" : "") + greyscale_color = 0.33 * (rcolor + bcolor);" : "") +
"vec3 mixedColor = mix(font_color.rgb, txt_color * font_color.rgb, chroma_color); "vec3 mixedColor = mix(fontColor.rgb, txt_color * fontColor.rgb, chromaColor);
vec3 finalBackColor = mix(background_color.rgb, mixedColor, greyscale_color); vec3 finalBackColor = mix(backgroundColor.rgb, mixedColor, greyscale_color);
vec3 finalColor = mix(finalBackColor, font_color.rgb, color).rgb;" vec3 finalColor = mix(finalBackColor, fontColor.rgb, color).rgb;"
: :
"vec3 finalColor = mix(background_color.rgb, font_color.rgb, greyscale_color);") + "vec3 finalColor = mix(backgroundColor.rgb, fontColor.rgb, greyscale_color);") +
"finalColor *= getScanlineIntensity(coords);" + "finalColor *= getScanlineIntensity(coords);" +
(bloom_strength !== 0 ? (bloom !== 0 ?
"vec4 bloomFullColor = texture2D(bloomSource, coords); "vec4 bloomFullColor = texture2D(bloomSource, coords);
vec3 bloomColor = bloomFullColor.rgb; vec3 bloomColor = bloomFullColor.rgb;
float bloomAlpha = bloomFullColor.a;" + float bloomAlpha = bloomFullColor.a;" +
(chroma_color !== 0 ? (chromaColor !== 0 ?
"bloomColor = font_color.rgb * mix(vec3(rgb2grey(bloomColor)), bloomColor, chroma_color);" "bloomColor = fontColor.rgb * mix(vec3(rgb2grey(bloomColor)), bloomColor, chromaColor);"
: :
"bloomColor = font_color.rgb * rgb2grey(bloomColor);") + "bloomColor = fontColor.rgb * rgb2grey(bloomColor);") +
"finalColor += bloomColor * bloom_strength * bloomAlpha;" "finalColor += bloomColor * bloom * bloomAlpha;"
: "") + : "") +
"finalColor *= smoothstep(-dispX, 0.0, staticCoords.x) - smoothstep(1.0, 1.0 + dispX, staticCoords.x); "finalColor *= smoothstep(-dispX, 0.0, staticCoords.x) - smoothstep(1.0, 1.0 + dispX, staticCoords.x);
finalColor *= smoothstep(-dispY, 0.0, staticCoords.y) - smoothstep(1.0, 1.0 + dispY, staticCoords.y);" + finalColor *= smoothstep(-dispY, 0.0, staticCoords.y) - smoothstep(1.0, 1.0 + dispY, staticCoords.y);" +
(brightness_flickering !== 0 ? " (flickering !== 0 ? "
finalColor *= brightness;" : "") + finalColor *= brightness;" : "") +
"gl_FragColor = vec4(finalColor * screen_brightness, qt_Opacity);" + "gl_FragColor = vec4(finalColor * screen_brightness, qt_Opacity);" +

View File

@ -25,7 +25,7 @@ QtObject {
property bool initialized: false property bool initialized: false
function getDatabase() { function getDatabase() {
return LocalStorage.openDatabaseSync("coololdterm", "1.0", "StorageDatabase", 100000); return LocalStorage.openDatabaseSync("coolretroterm", "1.0", "StorageDatabase", 100000);
} }
function initialize() { function initialize() {

View File

@ -12,8 +12,8 @@ ShaderTerminal{
source: terminal.mainSource source: terminal.mainSource
blurredSource: terminal.blurredSource blurredSource: terminal.blurredSource
dispX: (12 / width) * appSettings.window_scaling dispX: (12 / width) * appSettings.windowScaling
dispY: (12 / height) * appSettings.window_scaling dispY: (12 / height) * appSettings.windowScaling
virtual_resolution: terminal.virtualResolution virtual_resolution: terminal.virtualResolution
Loader{ Loader{
@ -29,7 +29,7 @@ ShaderTerminal{
visible: status === Loader.Ready visible: status === Loader.Ready
z: 2.1 z: 2.1
source: appSettings.frame_source source: appSettings.frameSource
} }
PreprocessedTerminal{ PreprocessedTerminal{
@ -41,19 +41,19 @@ ShaderTerminal{
Loader{ Loader{
id: bloomEffectLoader id: bloomEffectLoader
active: appSettings.bloom_strength active: appSettings.bloom
asynchronous: true asynchronous: true
width: parent.width * appSettings.bloom_quality width: parent.width * appSettings.bloomQuality
height: parent.height * appSettings.bloom_quality height: parent.height * appSettings.bloomQuality
sourceComponent: FastBlur{ sourceComponent: FastBlur{
radius: 48 * appSettings.bloom_quality * appSettings.window_scaling radius: 48 * appSettings.bloomQuality * appSettings.windowScaling
source: terminal.mainTerminal source: terminal.mainTerminal
transparentBorder: true transparentBorder: true
} }
} }
Loader{ Loader{
id: bloomSourceLoader id: bloomSourceLoader
active: appSettings.bloom_strength !== 0 active: appSettings.bloom !== 0
asynchronous: true asynchronous: true
sourceComponent: ShaderEffectSource{ sourceComponent: ShaderEffectSource{
id: _bloomEffectSource id: _bloomEffectSource
@ -75,8 +75,8 @@ ShaderTerminal{
// width: parent.width // width: parent.width
// height: parent.height // height: parent.height
// property real outColor: 0.0 // property real outColor: 0.0
// property real dispX: (5 / width) * appSettings.window_scaling // property real dispX: (5 / width) * appSettings.windowScaling
// property real dispY: (5 / height) * appSettings.window_scaling // property real dispY: (5 / height) * appSettings.windowScaling
// property size virtual_resolution: terminal.virtualResolution // property size virtual_resolution: terminal.virtualResolution
// blending: false // blending: false

View File

@ -5,8 +5,8 @@ import "../../utils.js" as Utils
Item{ Item{
id: framecontainer id: framecontainer
property int textureWidth: terminalContainer.width / appSettings.window_scaling property int textureWidth: terminalContainer.width / appSettings.windowScaling
property int textureHeight: terminalContainer.height / appSettings.window_scaling property int textureHeight: terminalContainer.height / appSettings.windowScaling
property int addedWidth property int addedWidth
property int addedHeight property int addedHeight
@ -105,12 +105,12 @@ Item{
id: staticLight id: staticLight
property alias source: framesource property alias source: framesource
property alias normals: framesourcenormals property alias normals: framesourcenormals
property real screen_distorsion: appSettings.screen_distortion property real screen_distorsion: appSettings.screenCurvature
property size curvature_coefficients: Qt.size(width / mainShader.width, height / mainShader.height) property size curvature_coefficients: Qt.size(width / mainShader.width, height / mainShader.height)
property real ambient_light: appSettings.ambient_light property real ambientLight: appSettings.ambientLight
property color font_color: appSettings.font_color property color fontColor: appSettings.fontColor
property color background_color: appSettings.background_color property color backgroundColor: appSettings.backgroundColor
property color reflectionColor: Utils.mix(font_color, background_color, 0.2) property color reflectionColor: Utils.mix(fontColor, backgroundColor, 0.2)
property real diffuseComponent: staticDiffuseComponent property real diffuseComponent: staticDiffuseComponent
anchors.centerIn: parent anchors.centerIn: parent
@ -124,7 +124,7 @@ Item{
uniform highp sampler2D source; uniform highp sampler2D source;
uniform lowp float screen_distorsion; uniform lowp float screen_distorsion;
uniform highp vec2 curvature_coefficients; uniform highp vec2 curvature_coefficients;
uniform lowp float ambient_light; uniform lowp float ambientLight;
uniform highp float qt_Opacity; uniform highp float qt_Opacity;
uniform lowp vec4 reflectionColor; uniform lowp vec4 reflectionColor;
uniform lowp float diffuseComponent; uniform lowp float diffuseComponent;
@ -151,7 +151,7 @@ Item{
float dotProd = dot(normal, vec3(lightDirection, 0.0)) * diffuseComponent * txtNormal.a; float dotProd = dot(normal, vec3(lightDirection, 0.0)) * diffuseComponent * txtNormal.a;
vec3 darkColor = dotProd * reflectionColor.rgb; vec3 darkColor = dotProd * reflectionColor.rgb;
gl_FragColor = vec4(mix(darkColor, txtColor.rgb, ambient_light), dotProd); gl_FragColor = vec4(mix(darkColor, txtColor.rgb, ambientLight), dotProd);
} }
" "
@ -174,8 +174,8 @@ Item{
property ShaderEffectSource lightMask: staticLightSource property ShaderEffectSource lightMask: staticLightSource
property ShaderEffectSource reflectionSource: reflectionEffectSourceLoader.item property ShaderEffectSource reflectionSource: reflectionEffectSourceLoader.item
property real diffuseComponent: dinamycDiffuseComponent property real diffuseComponent: dinamycDiffuseComponent
property real chroma_color: appSettings.chroma_color property real chromaColor: appSettings.chromaColor
property color font_color: appSettings.font_color property color fontColor: appSettings.fontColor
visible: true visible: true
blending: true blending: true
@ -184,8 +184,8 @@ Item{
uniform sampler2D lightMask; uniform sampler2D lightMask;
uniform sampler2D reflectionSource; uniform sampler2D reflectionSource;
uniform lowp float diffuseComponent; uniform lowp float diffuseComponent;
uniform lowp float chroma_color; uniform lowp float chromaColor;
uniform highp vec4 font_color; uniform highp vec4 fontColor;
uniform highp float qt_Opacity; uniform highp float qt_Opacity;
varying highp vec2 qt_TexCoord0; varying highp vec2 qt_TexCoord0;
@ -197,9 +197,9 @@ Item{
void main() { void main() {
float alpha = texture2D(lightMask, qt_TexCoord0).a * diffuseComponent; float alpha = texture2D(lightMask, qt_TexCoord0).a * diffuseComponent;
vec3 reflectionColor = texture2D(reflectionSource, qt_TexCoord0).rgb; vec3 reflectionColor = texture2D(reflectionSource, qt_TexCoord0).rgb;
vec3 color = font_color.rgb * rgb2grey(reflectionColor);" + vec3 color = fontColor.rgb * rgb2grey(reflectionColor);" +
(chroma_color !== 0 ? (chromaColor !== 0 ?
"color = mix(color, font_color.rgb * reflectionColor, chroma_color);" "color = mix(color, fontColor.rgb * reflectionColor, chromaColor);"
: "") + : "") +
"gl_FragColor = vec4(color, 1.0) * alpha; "gl_FragColor = vec4(color, 1.0) * alpha;
} }

View File

@ -116,12 +116,12 @@ ApplicationWindow{
TerminalContainer{ TerminalContainer{
id: terminalContainer id: terminalContainer
y: appSettings.showMenubar ? 0 : -2 // Workaroud to hide the margin in the menubar. y: appSettings.showMenubar ? 0 : -2 // Workaroud to hide the margin in the menubar.
width: parent.width * appSettings.window_scaling width: parent.width * appSettings.windowScaling
height: (parent.height + Math.abs(y)) * appSettings.window_scaling height: (parent.height + Math.abs(y)) * appSettings.windowScaling
transform: Scale { transform: Scale {
xScale: 1 / appSettings.window_scaling xScale: 1 / appSettings.windowScaling
yScale: 1 / appSettings.window_scaling yScale: 1 / appSettings.windowScaling
} }
} }
SettingsWindow{ SettingsWindow{
@ -134,7 +134,7 @@ ApplicationWindow{
} }
Loader{ Loader{
anchors.centerIn: parent anchors.centerIn: parent
active: appSettings.show_terminal_size active: appSettings.showTerminalSize
sourceComponent: SizeOverlay{ sourceComponent: SizeOverlay{
z: 3 z: 3
terminalSize: terminalContainer.terminalSize terminalSize: terminalContainer.terminalSize