Browse Source

- 修改设置布局

- 修改Line样式频谱线上下的位置
- 优化翻译
- 修改翻译文件名
master
mashiros 2 years ago
parent
commit
2e339d7e57
  1. 0
      Locales/ja.qm
  2. 0
      Locales/zh_TW.qm
  3. 98
      package.json
  4. 1
      qml/Main.qml
  5. 31
      qml/StylePreferences.qml
  6. 17
      qml/api/AdvpPreference.qml
  7. 4
      readme.md
  8. 1
      styles/Preset_Ordinal_Scale_UI_bottom/Style.qml
  9. 1
      styles/Preset_circle/Style.qml
  10. 61
      styles/Preset_gradient_line/Style.qml
  11. 68
      styles/Preset_line/Style.qml
  12. 1
      styles/Preset_solidcircle/Style.qml
  13. 1
      styles/Preset_waves/Style.qml

0
Locales/ja_JP.qm → Locales/ja.qm

0
Locales/zh_CN.qm → Locales/zh_TW.qm

98
package.json

@ -1,6 +1,6 @@
{ {
"name": "top.mashiros.widget.advp", "name": "top.mashiros.widget.advp",
"version": "1.2.0", "version": "1.2.1",
"title": { "title": {
"en": "ADV Plugin", "en": "ADV Plugin",
@ -54,10 +54,10 @@
"location": "/advp-style-preset/line", "location": "/advp-style-preset/line",
"catalog": "top.mashiros.advp-style", "catalog": "top.mashiros.advp-style",
"title": { "title": {
"en": "Preset Line", "en": "Line",
"zh": "预置 线", "zh": "线",
"zh_TW": "預置 線", "zh_TW": "線",
"ja": "プリセット 線" "ja": "線"
}, },
"entry": "./styles/Preset_line/Style.qml" "entry": "./styles/Preset_line/Style.qml"
}, },
@ -65,10 +65,10 @@
"location": "/advp-style-preset/gradient_line", "location": "/advp-style-preset/gradient_line",
"catalog": "top.mashiros.advp-style", "catalog": "top.mashiros.advp-style",
"title": { "title": {
"en": "Preset Gradient Line", "en": "Gradient Line",
"zh": "预置 渐变线", "zh": "渐变线",
"zh_TW": "預置 漸變線", "zh_TW": "漸變線",
"ja": "プリセット グラデーションライン" "ja": "グラデーションライン"
}, },
"entry": "./styles/Preset_gradient_line/Style.qml" "entry": "./styles/Preset_gradient_line/Style.qml"
}, },
@ -76,10 +76,10 @@
"location": "/advp-style-preset/waves", "location": "/advp-style-preset/waves",
"catalog": "top.mashiros.advp-style", "catalog": "top.mashiros.advp-style",
"title": { "title": {
"en": "Preset Waves", "en": "Waves",
"zh": "预置 波浪", "zh": "波浪",
"zh_TW": "預置 波浪", "zh_TW": "波浪",
"ja": "プリセット 波浪" "ja": "波浪"
}, },
"entry": "./styles/Preset_waves/Style.qml" "entry": "./styles/Preset_waves/Style.qml"
}, },
@ -87,10 +87,10 @@
"location": "/advp-style-preset/circle", "location": "/advp-style-preset/circle",
"catalog": "top.mashiros.advp-style", "catalog": "top.mashiros.advp-style",
"title": { "title": {
"en": "Preset Circle", "en": "Circle",
"zh": "预置 圆", "zh": "圆",
"zh_TW": "預置 圓", "zh_TW": "圓",
"ja": "プリセット 円" "ja": "円"
}, },
"entry": "./styles/Preset_circle/Style.qml" "entry": "./styles/Preset_circle/Style.qml"
}, },
@ -98,10 +98,10 @@
"location": "/advp-style-preset/solidcircle", "location": "/advp-style-preset/solidcircle",
"catalog": "top.mashiros.advp-style", "catalog": "top.mashiros.advp-style",
"title": { "title": {
"en": "Preset Solid-circle", "en": "Solid-circle",
"zh": "预置 实心圆", "zh": "实心圆",
"zh_TW": "預置 實心圓", "zh_TW": "實心圓",
"ja": "プリセット 固形円" "ja": "固形円"
}, },
"entry": "./styles/Preset_solidcircle/Style.qml" "entry": "./styles/Preset_solidcircle/Style.qml"
}, },
@ -109,10 +109,10 @@
"location": "/advp-style-preset/ordinal_scale_ui_bottom", "location": "/advp-style-preset/ordinal_scale_ui_bottom",
"catalog": "top.mashiros.advp-style", "catalog": "top.mashiros.advp-style",
"title": { "title": {
"en": "Preset Ordinal Scale UI bottom", "en": "Ordinal Scale UI bottom",
"zh": "预置 序列之争底部UI", "zh": "序列之争底部UI",
"zh_TW": "預置 序列之爭底部UI", "zh_TW": "序列之爭底部UI",
"ja": "プリセット オーディナル・スケール- UI 下部" "ja": "オーディナル・スケール- UI 下部"
}, },
"entry": "./styles/Preset_Ordinal_Scale_UI_bottom/Style.qml" "entry": "./styles/Preset_Ordinal_Scale_UI_bottom/Style.qml"
}, },
@ -120,10 +120,10 @@
"location": "/preset/advp-style-preset/line", "location": "/preset/advp-style-preset/line",
"catalog": "preset/widget", "catalog": "preset/widget",
"title": { "title": {
"en": "ADV Preset Line", "en": "Audio Visualization: Line",
"zh": "ADV预置 线", "zh": "音频可视化: 线",
"zh_TW": "ADV預置 線", "zh_TW": "音頻可視化: 線",
"ja": "ADVプリセット 線" "ja": "音声視覚化: 線"
}, },
"preview": "Presets/Line/preview.png", "preview": "Presets/Line/preview.png",
"entry": "Presets/Line/preset.json" "entry": "Presets/Line/preset.json"
@ -132,10 +132,10 @@
"location": "/preset/advp-style-preset/gradient_line", "location": "/preset/advp-style-preset/gradient_line",
"catalog": "preset/widget", "catalog": "preset/widget",
"title": { "title": {
"en": "ADV Preset Gradient Line", "en": "Audio Visualization: Gradient Line",
"zh": "ADV预置 渐变线", "zh": "音频可视化: 渐变线",
"zh_TW": "ADV預置 漸變線", "zh_TW": "音頻可視化: 漸變線",
"ja": "ADVプリセット グラデーションライン" "ja": "音声視覚化: グラデーションライン"
}, },
"preview": "Presets/Gradient_Line/preview.png", "preview": "Presets/Gradient_Line/preview.png",
"entry": "Presets/Gradient_Line/preset.json" "entry": "Presets/Gradient_Line/preset.json"
@ -144,10 +144,10 @@
"location": "/preset/advp-style-preset/waves", "location": "/preset/advp-style-preset/waves",
"catalog": "preset/widget", "catalog": "preset/widget",
"title": { "title": {
"en": "ADV Preset Waves", "en": "Audio Visualization: Waves",
"zh": "ADV预置 波浪", "zh": "音频可视化: 波浪",
"zh_TW": "ADV預置 波浪", "zh_TW": "音頻可視化: 波浪",
"ja": "ADVプリセット 波浪" "ja": "音声視覚化: 波浪"
}, },
"preview": "Presets/Waves/preview.png", "preview": "Presets/Waves/preview.png",
"entry": "Presets/Waves/preset.json" "entry": "Presets/Waves/preset.json"
@ -156,10 +156,10 @@
"location": "/preset/advp-style-preset/circle", "location": "/preset/advp-style-preset/circle",
"catalog": "preset/widget", "catalog": "preset/widget",
"title": { "title": {
"en": "ADV Preset Circle", "en": "Audio Visualization: Circle",
"zh": "ADV预置 圆", "zh": "音频可视化: 圆",
"zh_TW": "ADV預置 圓", "zh_TW": "音頻可視化: 圓",
"ja": "ADVプリセット 円" "ja": "音声視覚化: 円"
}, },
"preview": "Presets/Circle/preview.png", "preview": "Presets/Circle/preview.png",
"entry": "Presets/Circle/preset.json" "entry": "Presets/Circle/preset.json"
@ -168,10 +168,10 @@
"location": "/preset/advp-style-preset/solidcircle", "location": "/preset/advp-style-preset/solidcircle",
"catalog": "preset/widget", "catalog": "preset/widget",
"title": { "title": {
"en": "ADV Preset Solid-circle", "en": "Audio Visualization: Solid-circle",
"zh": "ADV预置 实心圆", "zh": "音频可视化: 实心圆",
"zh_TW": "ADV預置 實心圓", "zh_TW": "音頻可視化: 實心圓",
"ja": "ADVプリセット 固形円" "ja": "音声視覚化: 固形円"
}, },
"preview": "Presets/Solidcircle/preview.png", "preview": "Presets/Solidcircle/preview.png",
"entry": "Presets/Solidcircle/preset.json" "entry": "Presets/Solidcircle/preset.json"
@ -180,10 +180,10 @@
"location": "/preset/advp-style-preset/ordinal_scale_ui_bottom", "location": "/preset/advp-style-preset/ordinal_scale_ui_bottom",
"catalog": "preset/widget", "catalog": "preset/widget",
"title": { "title": {
"en": "ADV Preset Ordinal Scale UI bottom", "en": "Audio Visualization: Ordinal Scale UI bottom",
"zh": "ADV预置 序列之争底部UI", "zh": "音频可视化: 序列之争底部UI",
"zh_TW": "ADV預置 序列之爭底部UI", "zh_TW": "音頻可視化: 序列之爭底部UI",
"ja": "ADVプリセット オーディナル・スケール- UI 下部" "ja": "音声視覚化: オーディナル・スケール- UI 下部"
}, },
"preview": "Presets/Ordinal_Scale_UI_bottom/preview.png", "preview": "Presets/Ordinal_Scale_UI_bottom/preview.png",
"entry": "Presets/Ordinal_Scale_UI_bottom/preset.json" "entry": "Presets/Ordinal_Scale_UI_bottom/preset.json"

1
qml/Main.qml

@ -40,7 +40,6 @@ T.Widget {
if (!widget.settings[widget.settings.current_style]) { if (!widget.settings[widget.settings.current_style]) {
widget.settings[widget.settings.current_style] = defaultValues; widget.settings[widget.settings.current_style] = defaultValues;
}else if(widget.settings[widget.settings.current_style]["Version"] !== defaultValues["Version"]) { }else if(widget.settings[widget.settings.current_style]["Version"] !== defaultValues["Version"]) {
delete widget.settings[widget.settings.current_style]["__cfg_height"];
delete widget.settings[widget.settings.current_style]["Version"]; delete widget.settings[widget.settings.current_style]["Version"];
widget.settings[widget.settings.current_style] = Object.assign(defaultValues, widget.settings[widget.settings.current_style]); widget.settings[widget.settings.current_style] = Object.assign(defaultValues, widget.settings[widget.settings.current_style]);
} }

31
qml/StylePreferences.qml

@ -14,17 +14,10 @@ NVG.Window {
title: qsTr("ADV-Plugin: Settings") title: qsTr("ADV-Plugin: Settings")
visible: true visible: true
minimumWidth: 480 minimumWidth: 480
minimumHeight: 580 minimumHeight: 600
width: minimumWidth width: minimumWidth
height: minimumHeight height: minimumHeight
Behavior on minimumHeight {
PropertyAnimation {
duration: 500
easing.type: Easing.InOutBack
}
}
property var old_style_cfg property var old_style_cfg
property int last_style_index property int last_style_index
@ -34,7 +27,6 @@ NVG.Window {
header: TitleBar { header: TitleBar {
text: qsTr("Settings") text: qsTr("Settings")
standardButtons: Dialog.Save | Dialog.Reset standardButtons: Dialog.Save | Dialog.Reset
onAccepted: { onAccepted: {
@ -72,8 +64,6 @@ NVG.Window {
id: rootPreference id: rootPreference
Layout.fillWidth: true Layout.fillWidth: true
label: qsTr("Configuration")
onPreferenceEdited: { onPreferenceEdited: {
if (widget.settings.current_style !== Common.stylesURL[styleList.value]) { if (widget.settings.current_style !== Common.stylesURL[styleList.value]) {
widget.settings[widget.settings.current_style] = old_style_cfg; widget.settings[widget.settings.current_style] = old_style_cfg;
@ -92,8 +82,11 @@ NVG.Window {
defaultValue: 0 defaultValue: 0
model: Common.styles model: Common.styles
} }
P.Separator {} Heading {
id: heading
text: Common.styles[styleList.value] + " " + qsTr("Configuration")
}
P.PreferenceLoader { P.PreferenceLoader {
id: stylePreferenceLoader id: stylePreferenceLoader
@ -102,21 +95,9 @@ NVG.Window {
onLoaded: { onLoaded: {
let cfg = save(); let cfg = save();
load(widget.settings[widget.settings.current_style]); load(widget.settings[widget.settings.current_style]);
window.minimumHeight = cfg["__cfg_height"];
}
onContentItemChanged: {
if(contentItem) {
let index = Common.stylesURL.indexOf(widget.settings.current_style);
if (index === -1)
index = 0;
contentItem.label = Common.styles[index];
}
} }
} }
P.Separator {}
Component.onCompleted: { Component.onCompleted: {
last_style_index = Common.stylesURL.indexOf(widget.settings.current_style); last_style_index = Common.stylesURL.indexOf(widget.settings.current_style);
if (last_style_index === -1) { if (last_style_index === -1) {

17
qml/api/AdvpPreference.qml

@ -2,11 +2,8 @@ import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import NERvGear.Preferences 1.0 as P import NERvGear.Preferences 1.0 as P
P.DialogPreference { P.PreferenceGroup {
icon.name: "solid:\uf085"
live: true
property string version: "" property string version: ""
property int cfg_height: 580
P.TextFieldPreference { P.TextFieldPreference {
name: "Version" name: "Version"
@ -14,17 +11,7 @@ P.DialogPreference {
enabled: false enabled: false
defaultValue: version defaultValue: version
} }
P.SpinPreference {
name: "__cfg_height"
enabled: false
visible: false
editable: false
from: cfg_height
to: cfg_height
defaultValue: cfg_height
}
ItemDelegate { ItemDelegate {
text: qsTr("Version") text: qsTr("Version")
visible: version visible: version

4
readme.md

@ -11,7 +11,7 @@
## 特色 ## 特色
* 整合客户端与服务器端的功能,使用更简单 * 整合客户端与服务器端的功能,使用更简单
* 预设4种频谱显示形式,其中每种都可以进一步自定义设置其样式 * 预设6种频谱显示形式,其中每种都可以进一步自定义设置其样式
* 提供了Style的开发接口,供开发者添加更多的可视化样式 * 提供了Style的开发接口,供开发者添加更多的可视化样式
* 导入第三方Style类似其他插件,预计支持steam创意工坊下载 * 导入第三方Style类似其他插件,预计支持steam创意工坊下载
* 服务端崩溃后自启动 * 服务端崩溃后自启动
@ -20,7 +20,7 @@
安装并启用插件后,默认加载第一种预设Style样式。右键挂件可调出菜单,在挂件菜单的挂件名选单中点击Settings选项,呼出Style设置窗口。点击其中的Styles选项可切换不同的Style风格,若此Style提供可配置项,则在Styles选项下方会出现配置界面的入口。 安装并启用插件后,默认加载第一种预设Style样式。右键挂件可调出菜单,在挂件菜单的挂件名选单中点击Settings选项,呼出Style设置窗口。点击其中的Styles选项可切换不同的Style风格,若此Style提供可配置项,则在Styles选项下方会出现配置界面的入口。
<div align="center"><img src="https://s3.bmp.ovh/imgs/2022/04/15/b62270e9dd574622.png" style="zoom:80%;" /></div> <div align="center"><img src="https://s3.bmp.ovh/imgs/2022/04/29/c666df5a88a7ab9a.png" style="zoom:80%;" /></div>
# 进阶设置 # 进阶设置

1
styles/Preset_Ordinal_Scale_UI_bottom/Style.qml

@ -135,7 +135,6 @@ AdvpStyleTemplate {
preference: AdvpPreference { preference: AdvpPreference {
version: defaultValues["Version"] version: defaultValues["Version"]
cfg_height: 680
P.ColorPreference { P.ColorPreference {
name: "Bass Color" name: "Bass Color"

1
styles/Preset_circle/Style.qml

@ -125,7 +125,6 @@ AdvpStyleTemplate {
preference: AdvpPreference { preference: AdvpPreference {
version: defaultValues["Version"] version: defaultValues["Version"]
cfg_height: 740
P.ColorPreference { P.ColorPreference {
name: "Main Color" name: "Main Color"

61
styles/Preset_gradient_line/Style.qml

@ -30,15 +30,13 @@ AdvpStyleTemplate {
readonly property int dataLength: 64/uDataLen readonly property int dataLength: 64/uDataLen
readonly property int channel: configs["Channel"] readonly property int channel: configs["Channel"]
readonly property bool centerRotateFlag: configs["Rotate Settings"]["Center Enable"] readonly property bool centerRotateFlag: configs["Rotate Settings"]["Center Enable"]
readonly property real centerRotateAngle: configs["Rotate Settings"]["Center Angle"] readonly property real centerRotateAngle: configs["Rotate Settings"]["Center Angle"]*Math.PI/180
readonly property bool lineRotateFlag: configs["Rotate Settings"]["Line Enable"] readonly property bool lineRotateFlag: configs["Rotate Settings"]["Line Enable"]
readonly property real lineRotateAngle: configs["Rotate Settings"]["Line Angle"] readonly property real lineRotateAngle: configs["Rotate Settings"]["Line Angle"]*Math.PI/180
readonly property bool autoNormalizing: configs["Data Settings"]["Auto Normalizing"] readonly property bool autoNormalizing: configs["Data Settings"]["Auto Normalizing"]
readonly property real amplitude: 400.0/configs["Data Settings"]["Amplitude"] readonly property real amplitude: 400.0/configs["Data Settings"]["Amplitude"]
readonly property int unitStyle: configs["Data Settings"]["Unit Style"] readonly property int unitStyle: configs["Data Settings"]["Unit Style"]
property real degUnit: Math.PI / 180
property real halfWidth: width/2 property real halfWidth: width/2
property real halfHeight: height/2 property real halfHeight: height/2
@ -46,7 +44,7 @@ AdvpStyleTemplate {
readonly property int r_stop: dataLength+dataLength*(channel!==0) readonly property int r_stop: dataLength+dataLength*(channel!==0)
readonly property int total: r_stop-l_start readonly property int total: r_stop-l_start
readonly property real _y_dy: centerRotateFlag*Math.tan(centerRotateAngle*degUnit)*halfWidth readonly property real _y_dy: centerRotateFlag*Math.tan(centerRotateAngle)*halfWidth
readonly property real _ux: width/(r_stop-l_start) readonly property real _ux: width/(r_stop-l_start)
readonly property real _dx: Math.round(_ux/2) readonly property real _dx: Math.round(_ux/2)
@ -97,26 +95,40 @@ AdvpStyleTemplate {
context.clearRect(0, 0, width+32, height+32); context.clearRect(0, 0, width+32, height+32);
let _y = halfHeight-_y_dy; let _y;
if(lineRotateFlag || centerRotateFlag) {
context.transform(1, centerRotateFlag*centerRotateAngle * degUnit, -lineRotateFlag*lineRotateAngle * degUnit, 1, lineRotateFlag*Math.sin(1.05*lineRotateAngle*degUnit)*_y, 0);
}
if (centerLineFlag) {
context.fillRect(0, _y, width, 2);
}
//
let _dy; let _dy;
for (let i=l_start; i<r_stop; i++) { //
_y = halfHeight*(1-(linePosition!==2)*audioData[i])-_y_dy; if(lineRotateFlag || centerRotateFlag) {
_dy = (halfHeight + (!linePosition)*halfHeight)*audioData[i]; context.transform(1, Math.sin(centerRotateFlag*centerRotateAngle), -Math.sin(lineRotateFlag*lineRotateAngle), 1, Math.sin(lineRotateFlag*lineRotateAngle)*(halfHeight-_y_dy), 0);
context.fillRect(_ux * (i-l_start), _y, _dx, _dy); for (let i=l_start; i<r_stop; i++) {
} _y = halfHeight*(1-(linePosition!==2)*audioData[i])-_y_dy;
_dy = (halfHeight + (!linePosition)*halfHeight)*audioData[i];
context.fillRect(_ux * (i-l_start), _y, _dx, _dy);
if (centerRotateFlag || lineRotateFlag) }
if (centerLineFlag) {
context.fillRect(0, halfHeight-_y_dy, width, 2);
}
context.resetTransform(); context.resetTransform();
} else if (linePosition) {
let _flag = 1-2*(linePosition===1);
_y = halfHeight + halfHeight*(3-2*linePosition)*Boolean(linePosition);
for (let i=l_start; i<r_stop; i++) {
_dy = height*audioData[i]*_flag;
context.fillRect(_ux * (i-l_start), _y, _dx, _dy);
}
if (centerLineFlag) {
context.fillRect(0, _y-(2-linePosition)*2, width, 2);
}
} else {
for (let i=l_start; i<r_stop; i++) {
_y = halfHeight*(1-(linePosition!==2)*audioData[i])-_y_dy;
_dy = (halfHeight + (!linePosition)*halfHeight)*audioData[i];
context.fillRect(_ux * (i-l_start), _y, _dx, _dy);
}
if (centerLineFlag) {
context.fillRect(0, halfHeight-_y_dy, width, 2);
}
}
context.fill(); context.fill();
requestPaint(); requestPaint();
@ -132,7 +144,7 @@ AdvpStyleTemplate {
} }
defaultValues: { defaultValues: {
"Version": "1.1.0", "Version": "1.2.0",
"Gradient Direction": 0, "Gradient Direction": 0,
"Start Position Color": "#f44336", "Start Position Color": "#f44336",
"Middle Position Color": "#4caf50", "Middle Position Color": "#4caf50",
@ -156,7 +168,6 @@ AdvpStyleTemplate {
preference: AdvpPreference { preference: AdvpPreference {
version: defaultValues["Version"] version: defaultValues["Version"]
cfg_height: 670
P.SelectPreference { P.SelectPreference {
name: "Gradient Direction" name: "Gradient Direction"

68
styles/Preset_line/Style.qml

@ -15,22 +15,20 @@ AdvpStyleTemplate {
readonly property int dataLength: 64/uDataLen readonly property int dataLength: 64/uDataLen
readonly property int channel: configs["Channel"] readonly property int channel: configs["Channel"]
readonly property bool centerRotateFlag: configs["Rotate Settings"]["Center Enable"] readonly property bool centerRotateFlag: configs["Rotate Settings"]["Center Enable"]
readonly property real centerRotateAngle: configs["Rotate Settings"]["Center Angle"] readonly property real centerRotateAngle: configs["Rotate Settings"]["Center Angle"]*Math.PI/180
readonly property bool lineRotateFlag: configs["Rotate Settings"]["Line Enable"] readonly property bool lineRotateFlag: configs["Rotate Settings"]["Line Enable"]
readonly property real lineRotateAngle: configs["Rotate Settings"]["Line Angle"] readonly property real lineRotateAngle: configs["Rotate Settings"]["Line Angle"]*Math.PI/180
readonly property bool autoNormalizing: configs["Data Settings"]["Auto Normalizing"] readonly property bool autoNormalizing: configs["Data Settings"]["Auto Normalizing"]
readonly property real amplitude: 400.0/configs["Data Settings"]["Amplitude"] readonly property real amplitude: 400.0/configs["Data Settings"]["Amplitude"]
readonly property int unitStyle: configs["Data Settings"]["Unit Style"] readonly property int unitStyle: configs["Data Settings"]["Unit Style"]
property real degUnit: Math.PI / 180
property real halfWidth: width/2 property real halfWidth: width/2
property real halfHeight: height/2 property real halfHeight: height/2
readonly property int l_start: (channel===1)*dataLength readonly property int l_start: (channel===1)*dataLength
readonly property int r_stop: dataLength+dataLength*(channel!==0) readonly property int r_stop: dataLength+dataLength*(channel!==0)
readonly property int total: r_stop-l_start readonly property int total: r_stop-l_start
readonly property real _y_dy: centerRotateFlag*Math.tan(centerRotateAngle*degUnit)*halfWidth readonly property real _y_dy: centerRotateFlag*Math.tan(centerRotateAngle)*halfWidth
readonly property real _ux: width/(r_stop-l_start) readonly property real _ux: width/(r_stop-l_start)
readonly property real _dx: Math.round(_ux/2) readonly property real _dx: Math.round(_ux/2)
@ -72,27 +70,46 @@ AdvpStyleTemplate {
context.clearRect(0, 0, width+32, height+32); context.clearRect(0, 0, width+32, height+32);
let _y = halfHeight-_y_dy; let _y;
if(lineRotateFlag || centerRotateFlag) {
context.transform(1, centerRotateFlag*centerRotateAngle * degUnit, -lineRotateFlag*lineRotateAngle * degUnit, 1, lineRotateFlag*Math.sin(1.05*lineRotateAngle*degUnit)*_y, 0);
}
if (centerLineFlag) {
context.fillStyle = center_color;
context.fillRect(0, _y, width, 2);
}
context.fillStyle = line_color;
//
let _dy; let _dy;
for (let i=l_start; i<r_stop; i++) { //
_y = halfHeight*(1-(linePosition!==2)*audioData[i])-_y_dy; if(lineRotateFlag || centerRotateFlag) {
_dy = (halfHeight + (!linePosition)*halfHeight)*audioData[i]; context.transform(1, Math.sin(centerRotateFlag*centerRotateAngle), -Math.sin(lineRotateFlag*lineRotateAngle), 1, Math.sin(lineRotateFlag*lineRotateAngle)*(halfHeight-_y_dy), 0);
context.fillRect(_ux * (i-l_start), _y, _dx, _dy); context.fillStyle = line_color;
} for (let i=l_start; i<r_stop; i++) {
_y = halfHeight*(1-(linePosition!==2)*audioData[i])-_y_dy;
if (centerRotateFlag || lineRotateFlag) _dy = (halfHeight + (!linePosition)*halfHeight)*audioData[i];
context.fillRect(_ux * (i-l_start), _y, _dx, _dy);
}
if (centerLineFlag) {
context.fillStyle = center_color;
context.fillRect(0, halfHeight-_y_dy, width, 2);
}
context.resetTransform(); context.resetTransform();
} else if (linePosition) {
let _flag = 1-2*(linePosition===1);
_y = halfHeight + halfHeight*(3-2*linePosition)*Boolean(linePosition);
context.fillStyle = line_color;
for (let i=l_start; i<r_stop; i++) {
_dy = height*audioData[i]*_flag;
context.fillRect(_ux * (i-l_start), _y, _dx, _dy);
}
if (centerLineFlag) {
context.fillStyle = center_color;
context.fillRect(0, _y-(2-linePosition)*2, width, 2);
}
} else {
context.fillStyle = line_color;
for (let i=l_start; i<r_stop; i++) {
_y = halfHeight*(1-(linePosition!==2)*audioData[i])-_y_dy;
_dy = (halfHeight + (!linePosition)*halfHeight)*audioData[i];
context.fillRect(_ux * (i-l_start), _y, _dx, _dy);
}
if (centerLineFlag) {
context.fillStyle = center_color;
context.fillRect(0, halfHeight-_y_dy, width, 2);
}
}
context.fill(); context.fill();
requestPaint(); requestPaint();
@ -106,7 +123,7 @@ AdvpStyleTemplate {
} }
defaultValues: { defaultValues: {
"Version": "1.1.0", "Version": "1.2.0",
"Center Line": true, "Center Line": true,
"Center Color": "#ff4500", "Center Color": "#ff4500",
"Line Color": "#ff4500", "Line Color": "#ff4500",
@ -128,7 +145,6 @@ AdvpStyleTemplate {
preference: AdvpPreference { preference: AdvpPreference {
version: defaultValues["Version"] version: defaultValues["Version"]
cfg_height: 580
P.SwitchPreference { P.SwitchPreference {
id: _cfg_preset_line_Center_Line id: _cfg_preset_line_Center_Line

1
styles/Preset_solidcircle/Style.qml

@ -141,7 +141,6 @@ AdvpStyleTemplate {
preference: AdvpPreference { preference: AdvpPreference {
version: defaultValues["Version"] version: defaultValues["Version"]
cfg_height: 740
P.ColorPreference { P.ColorPreference {
name: "Main Color" name: "Main Color"

1
styles/Preset_waves/Style.qml

@ -98,7 +98,6 @@ AdvpStyleTemplate {
preference: AdvpPreference { preference: AdvpPreference {
version: defaultValues["Version"] version: defaultValues["Version"]
cfg_height: 500
P.SliderPreference { P.SliderPreference {
name: "Line Width" name: "Line Width"

Loading…
Cancel
Save