import QtQuick 2.12 import NERvGear.Preferences 1.0 as P import "../../qml/api" AdvpStyleTemplate { style: AdvpCanvasTemplate { readonly property var audioData: new Array(128) readonly property bool centerLineFlag: configs["Center Line"] readonly property string center_color: configs["Center Color"] readonly property string line_color: configs["Line Color"] readonly property int linePosition: configs["Line Position"] readonly property int uDataLen: Math.pow(2, configs["Data Length"]); readonly property int dataLength: 64/uDataLen readonly property int channel: configs["Channel"] readonly property bool centerRotateFlag: configs["Rotate Settings"]["Center Enable"] readonly property real centerRotateAngle: configs["Rotate Settings"]["Center Angle"]*Math.PI/180 readonly property bool lineRotateFlag: configs["Rotate Settings"]["Line Enable"] readonly property real lineRotateAngle: configs["Rotate Settings"]["Line Angle"]*Math.PI/180 readonly property bool autoNormalizing: configs["Data Settings"]["Auto Normalizing"] readonly property real amplitude: 400.0/configs["Data Settings"]["Amplitude"] readonly property int unitStyle: configs["Data Settings"]["Unit Style"] property real halfWidth: width/2 property real halfHeight: height/2 readonly property int l_start: (channel===1)*dataLength readonly property int r_stop: dataLength+dataLength*(channel!==0) readonly property int total: r_stop-l_start readonly property real _y_dy: centerRotateFlag*Math.tan(centerRotateAngle)*halfWidth readonly property real _ux: width/(r_stop-l_start) readonly property real _dx: Math.round(_ux/2) onAudioDataUpdeted: { let normalizing_ratio = autoNormalizing ? data[128] : amplitude; if (unitStyle) { //对数化显示 for(let i=l_start; i