diff --git a/Locales/ja_JP.qm b/Locales/ja.qm similarity index 100% rename from Locales/ja_JP.qm rename to Locales/ja.qm diff --git a/Locales/zh_CN.qm b/Locales/zh_TW.qm similarity index 100% rename from Locales/zh_CN.qm rename to Locales/zh_TW.qm diff --git a/package.json b/package.json index d2f13f9..e15255b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "top.mashiros.widget.advp", - "version": "1.2.0", + "version": "1.2.1", "title": { "en": "ADV Plugin", @@ -54,10 +54,10 @@ "location": "/advp-style-preset/line", "catalog": "top.mashiros.advp-style", "title": { - "en": "Preset Line", - "zh": "预置 线", - "zh_TW": "預置 線", - "ja": "プリセット 線" + "en": "Line", + "zh": "线", + "zh_TW": "線", + "ja": "線" }, "entry": "./styles/Preset_line/Style.qml" }, @@ -65,10 +65,10 @@ "location": "/advp-style-preset/gradient_line", "catalog": "top.mashiros.advp-style", "title": { - "en": "Preset Gradient Line", - "zh": "预置 渐变线", - "zh_TW": "預置 漸變線", - "ja": "プリセット グラデーションライン" + "en": "Gradient Line", + "zh": "渐变线", + "zh_TW": "漸變線", + "ja": "グラデーションライン" }, "entry": "./styles/Preset_gradient_line/Style.qml" }, @@ -76,10 +76,10 @@ "location": "/advp-style-preset/waves", "catalog": "top.mashiros.advp-style", "title": { - "en": "Preset Waves", - "zh": "预置 波浪", - "zh_TW": "預置 波浪", - "ja": "プリセット 波浪" + "en": "Waves", + "zh": "波浪", + "zh_TW": "波浪", + "ja": "波浪" }, "entry": "./styles/Preset_waves/Style.qml" }, @@ -87,10 +87,10 @@ "location": "/advp-style-preset/circle", "catalog": "top.mashiros.advp-style", "title": { - "en": "Preset Circle", - "zh": "预置 圆", - "zh_TW": "預置 圓", - "ja": "プリセット 円" + "en": "Circle", + "zh": "圆", + "zh_TW": "圓", + "ja": "円" }, "entry": "./styles/Preset_circle/Style.qml" }, @@ -98,10 +98,10 @@ "location": "/advp-style-preset/solidcircle", "catalog": "top.mashiros.advp-style", "title": { - "en": "Preset Solid-circle", - "zh": "预置 实心圆", - "zh_TW": "預置 實心圓", - "ja": "プリセット 固形円" + "en": "Solid-circle", + "zh": "实心圆", + "zh_TW": "實心圓", + "ja": "固形円" }, "entry": "./styles/Preset_solidcircle/Style.qml" }, @@ -109,10 +109,10 @@ "location": "/advp-style-preset/ordinal_scale_ui_bottom", "catalog": "top.mashiros.advp-style", "title": { - "en": "Preset Ordinal Scale UI bottom", - "zh": "预置 序列之争底部UI", - "zh_TW": "預置 序列之爭底部UI", - "ja": "プリセット オーディナル・スケール- UI 下部" + "en": "Ordinal Scale UI bottom", + "zh": "序列之争底部UI", + "zh_TW": "序列之爭底部UI", + "ja": "オーディナル・スケール- UI 下部" }, "entry": "./styles/Preset_Ordinal_Scale_UI_bottom/Style.qml" }, @@ -120,10 +120,10 @@ "location": "/preset/advp-style-preset/line", "catalog": "preset/widget", "title": { - "en": "ADV Preset Line", - "zh": "ADV预置 线", - "zh_TW": "ADV預置 線", - "ja": "ADVプリセット 線" + "en": "Audio Visualization: Line", + "zh": "音频可视化: 线", + "zh_TW": "音頻可視化: 線", + "ja": "音声視覚化: 線" }, "preview": "Presets/Line/preview.png", "entry": "Presets/Line/preset.json" @@ -132,10 +132,10 @@ "location": "/preset/advp-style-preset/gradient_line", "catalog": "preset/widget", "title": { - "en": "ADV Preset Gradient Line", - "zh": "ADV预置 渐变线", - "zh_TW": "ADV預置 漸變線", - "ja": "ADVプリセット グラデーションライン" + "en": "Audio Visualization: Gradient Line", + "zh": "音频可视化: 渐变线", + "zh_TW": "音頻可視化: 漸變線", + "ja": "音声視覚化: グラデーションライン" }, "preview": "Presets/Gradient_Line/preview.png", "entry": "Presets/Gradient_Line/preset.json" @@ -144,10 +144,10 @@ "location": "/preset/advp-style-preset/waves", "catalog": "preset/widget", "title": { - "en": "ADV Preset Waves", - "zh": "ADV预置 波浪", - "zh_TW": "ADV預置 波浪", - "ja": "ADVプリセット 波浪" + "en": "Audio Visualization: Waves", + "zh": "音频可视化: 波浪", + "zh_TW": "音頻可視化: 波浪", + "ja": "音声視覚化: 波浪" }, "preview": "Presets/Waves/preview.png", "entry": "Presets/Waves/preset.json" @@ -156,10 +156,10 @@ "location": "/preset/advp-style-preset/circle", "catalog": "preset/widget", "title": { - "en": "ADV Preset Circle", - "zh": "ADV预置 圆", - "zh_TW": "ADV預置 圓", - "ja": "ADVプリセット 円" + "en": "Audio Visualization: Circle", + "zh": "音频可视化: 圆", + "zh_TW": "音頻可視化: 圓", + "ja": "音声視覚化: 円" }, "preview": "Presets/Circle/preview.png", "entry": "Presets/Circle/preset.json" @@ -168,10 +168,10 @@ "location": "/preset/advp-style-preset/solidcircle", "catalog": "preset/widget", "title": { - "en": "ADV Preset Solid-circle", - "zh": "ADV预置 实心圆", - "zh_TW": "ADV預置 實心圓", - "ja": "ADVプリセット 固形円" + "en": "Audio Visualization: Solid-circle", + "zh": "音频可视化: 实心圆", + "zh_TW": "音頻可視化: 實心圓", + "ja": "音声視覚化: 固形円" }, "preview": "Presets/Solidcircle/preview.png", "entry": "Presets/Solidcircle/preset.json" @@ -180,10 +180,10 @@ "location": "/preset/advp-style-preset/ordinal_scale_ui_bottom", "catalog": "preset/widget", "title": { - "en": "ADV Preset Ordinal Scale UI bottom", - "zh": "ADV预置 序列之争底部UI", - "zh_TW": "ADV預置 序列之爭底部UI", - "ja": "ADVプリセット オーディナル・スケール- UI 下部" + "en": "Audio Visualization: Ordinal Scale UI bottom", + "zh": "音频可视化: 序列之争底部UI", + "zh_TW": "音頻可視化: 序列之爭底部UI", + "ja": "音声視覚化: オーディナル・スケール- UI 下部" }, "preview": "Presets/Ordinal_Scale_UI_bottom/preview.png", "entry": "Presets/Ordinal_Scale_UI_bottom/preset.json" diff --git a/qml/Main.qml b/qml/Main.qml index f774523..50e4436 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -40,7 +40,6 @@ T.Widget { if (!widget.settings[widget.settings.current_style]) { widget.settings[widget.settings.current_style] = defaultValues; }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"]; widget.settings[widget.settings.current_style] = Object.assign(defaultValues, widget.settings[widget.settings.current_style]); } diff --git a/qml/StylePreferences.qml b/qml/StylePreferences.qml index 849bdef..fa3e885 100644 --- a/qml/StylePreferences.qml +++ b/qml/StylePreferences.qml @@ -14,17 +14,10 @@ NVG.Window { title: qsTr("ADV-Plugin: Settings") visible: true minimumWidth: 480 - minimumHeight: 580 + minimumHeight: 600 width: minimumWidth height: minimumHeight - Behavior on minimumHeight { - PropertyAnimation { - duration: 500 - easing.type: Easing.InOutBack - } - } - property var old_style_cfg property int last_style_index @@ -34,7 +27,6 @@ NVG.Window { header: TitleBar { text: qsTr("Settings") - standardButtons: Dialog.Save | Dialog.Reset onAccepted: { @@ -72,8 +64,6 @@ NVG.Window { id: rootPreference Layout.fillWidth: true - label: qsTr("Configuration") - onPreferenceEdited: { if (widget.settings.current_style !== Common.stylesURL[styleList.value]) { widget.settings[widget.settings.current_style] = old_style_cfg; @@ -92,8 +82,11 @@ NVG.Window { defaultValue: 0 model: Common.styles } - - P.Separator {} + + Heading { + id: heading + text: Common.styles[styleList.value] + " " + qsTr("Configuration") + } P.PreferenceLoader { id: stylePreferenceLoader @@ -102,21 +95,9 @@ NVG.Window { onLoaded: { let cfg = save(); 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: { last_style_index = Common.stylesURL.indexOf(widget.settings.current_style); if (last_style_index === -1) { diff --git a/qml/api/AdvpPreference.qml b/qml/api/AdvpPreference.qml index 0888f60..3859786 100644 --- a/qml/api/AdvpPreference.qml +++ b/qml/api/AdvpPreference.qml @@ -2,11 +2,8 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import NERvGear.Preferences 1.0 as P -P.DialogPreference { - icon.name: "solid:\uf085" - live: true +P.PreferenceGroup { property string version: "" - property int cfg_height: 580 P.TextFieldPreference { name: "Version" @@ -14,17 +11,7 @@ P.DialogPreference { enabled: false defaultValue: version } - - P.SpinPreference { - name: "__cfg_height" - enabled: false - visible: false - editable: false - from: cfg_height - to: cfg_height - defaultValue: cfg_height - } - + ItemDelegate { text: qsTr("Version") visible: version diff --git a/readme.md b/readme.md index 16cd521..b1050b1 100644 --- a/readme.md +++ b/readme.md @@ -11,7 +11,7 @@ ## 特色 * 整合客户端与服务器端的功能,使用更简单 -* 预设4种频谱显示形式,其中每种都可以进一步自定义设置其样式 +* 预设6种频谱显示形式,其中每种都可以进一步自定义设置其样式 * 提供了Style的开发接口,供开发者添加更多的可视化样式 * 导入第三方Style类似其他插件,预计支持steam创意工坊下载 * 服务端崩溃后自启动 @@ -20,7 +20,7 @@ 安装并启用插件后,默认加载第一种预设Style样式。右键挂件可调出菜单,在挂件菜单的挂件名选单中点击Settings选项,呼出Style设置窗口。点击其中的Styles选项可切换不同的Style风格,若此Style提供可配置项,则在Styles选项下方会出现配置界面的入口。 -
+
# 进阶设置 diff --git a/styles/Preset_Ordinal_Scale_UI_bottom/Style.qml b/styles/Preset_Ordinal_Scale_UI_bottom/Style.qml index 062d5be..3e5a9e3 100644 --- a/styles/Preset_Ordinal_Scale_UI_bottom/Style.qml +++ b/styles/Preset_Ordinal_Scale_UI_bottom/Style.qml @@ -135,7 +135,6 @@ AdvpStyleTemplate { preference: AdvpPreference { version: defaultValues["Version"] - cfg_height: 680 P.ColorPreference { name: "Bass Color" diff --git a/styles/Preset_circle/Style.qml b/styles/Preset_circle/Style.qml index 2cf2dcd..00ee6e1 100644 --- a/styles/Preset_circle/Style.qml +++ b/styles/Preset_circle/Style.qml @@ -125,7 +125,6 @@ AdvpStyleTemplate { preference: AdvpPreference { version: defaultValues["Version"] - cfg_height: 740 P.ColorPreference { name: "Main Color" diff --git a/styles/Preset_gradient_line/Style.qml b/styles/Preset_gradient_line/Style.qml index 5c513e6..b2e325f 100644 --- a/styles/Preset_gradient_line/Style.qml +++ b/styles/Preset_gradient_line/Style.qml @@ -30,15 +30,13 @@ AdvpStyleTemplate { 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"] + 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"] + 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 degUnit: Math.PI / 180 - property real halfWidth: width/2 property real halfHeight: height/2 @@ -46,7 +44,7 @@ AdvpStyleTemplate { 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*degUnit)*halfWidth + 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) @@ -97,26 +95,40 @@ AdvpStyleTemplate { context.clearRect(0, 0, width+32, height+32); - let _y = halfHeight-_y_dy; - 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 _y; let _dy; - for (let i=l_start; i