Compare commits

...

4 Commits

Author SHA1 Message Date
mashiros 7215870424 V1.4.4 1 year ago
mashiros 3650d12c87 - 新增挂件时绘制第一帧初始画面 2 years ago
mashiros f4b2127b10 V1.4.3 2 years ago
mashiros ee7b87bdc9 - 修复无音频数据时"序列之争底部UI"暂停bug 2 years ago
  1. BIN
      Locales/ja.qm
  2. BIN
      Locales/zh.qm
  3. BIN
      Locales/zh_TW.qm
  4. 2
      Presets/Ordinal_Scale_UI_bottom/settings.xml
  5. BIN
      bin/ADVServer.exe
  6. 2
      package.json
  7. 7
      qml/Common.qml
  8. 14
      qml/ServerPreferences.qml
  9. 6
      qml/api/AdvpCanvasTemplate.qml
  10. 73
      styles/Preset_Ordinal_Scale_UI_bottom/Style.qml

BIN
Locales/ja.qm

Binary file not shown.

BIN
Locales/zh.qm

Binary file not shown.

BIN
Locales/zh_TW.qm

Binary file not shown.

2
Presets/Ordinal_Scale_UI_bottom/settings.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map>
<value name="current_style">"nvg://advp.widget.mashiros.top/advp-style-preset/ordinal_scale_ui_bottom"</value>
<value name="nvg://advp.widget.mashiros.top/advp-style-preset/ordinal_scale_ui_bottom">{"Bass Color":"#dc143c","Alto Color":"#f8f8ff","Treble Color":"#4169e1","Bass AM":100,"Alto AM":150,"Treble AM":200,"Static AM":25,"Speed":20,"Data Settings":{"Auto Normalizing":true,"Amplitude":10}}</value>
<value name="nvg://advp.widget.mashiros.top/advp-style-preset/ordinal_scale_ui_bottom">{"Refresh Rate":30,"Bass Color":"#dc143c","Alto Color":"#f8f8ff","Treble Color":"#4169e1","Bass AM":100,"Alto AM":150,"Treble AM":200,"Static AM":25,"Speed":20,"Data Settings":{"Auto Normalizing":true,"Amplitude":10}}</value>
</map>

BIN
bin/ADVServer.exe

Binary file not shown.

2
package.json

@ -1,6 +1,6 @@
{
"name": "top.mashiros.widget.advp",
"version": "1.4.1",
"version": "1.4.4",
"title": {
"en": "ADV Plugin",

7
qml/Common.qml

@ -22,6 +22,9 @@ Item {
"peakthr": 10,
"fps": 35,
"changespeed": 20
},
"advanced": {
"device_reboot": false
}
}
readonly property string iniFile: "../bin/advConfig.ini"
@ -198,8 +201,8 @@ Item {
}
}
function parse_resource(resource_list, sort) {
if (sort)
function parse_resource(resource_list, preset) {
if (preset)
resource_list.sort(function (x, y) {
let preset_order = ["/advp-style-preset/line", "/advp-style-preset/gradient_line", "/advp-style-preset/waves", "/advp-style-preset/circle", "/advp-style-preset/solidcircle", "/advp-style-preset/ordinal_scale_ui_bottom"];
if (preset_order.indexOf(x.location) < preset_order.indexOf(y.location))

14
qml/ServerPreferences.qml

@ -207,6 +207,20 @@ NVG.Window {
}
}
P.PreferenceGroup {
Layout.fillWidth: true
name: "advanced"
Heading { text: qsTr("Advanced") }
P.SwitchPreference {
name: "device_reboot"
label: qsTr("Reboot on Device Changed")
message: qsTr("Problems caused by switching devices may be resolved.")
warning: value ? qsTr("The recovery time of the animation when switching devices may increase!") : ""
defaultValue: Common.defaultServerCFG["advanced"]["device_reboot"]
}
}
Component.onCompleted: {
rootPreference.load(Common.serverCFG)
}

6
qml/api/AdvpCanvasTemplate.qml

@ -34,6 +34,12 @@ Canvas {
onContextChanged: {
if (context) {
configsUpdated();
let _data = new Array(129);
for (let i = 0; i < 128; i++) {
_data[i] = 0;
}
_data[128] = 1;
audioDataUpdeted(_data);
}
}

73
styles/Preset_Ordinal_Scale_UI_bottom/Style.qml

@ -8,6 +8,7 @@ AdvpStyleTemplate {
readonly property var audioData: new Array(128)
//configs
readonly property real timer_interval: 1000/configs["Refresh Rate"]
readonly property real bassAmRatio: configs["Bass AM"]/100
readonly property real altoAmRatio: configs["Alto AM"]/100
readonly property real trebleAmRatio: configs["Treble AM"]/100
@ -20,7 +21,7 @@ AdvpStyleTemplate {
readonly property real halfWidth: width/2
readonly property real rHeight: 0.6*height
readonly property real speed: configs["Speed"]/100
readonly property real speed: 0.3*configs["Speed"]/configs["Refresh Rate"]
readonly property real _MAX: (height/2)-4
readonly property real _noise: configs["Static AM"]/100*_MAX
readonly property real _delta: _MAX-_noise
@ -80,40 +81,51 @@ AdvpStyleTemplate {
audioData[i] = data[i] * amplitude;
}
}
let trebleAm = 0;
let altoAm = 0;
let bassAm = 0;
}
for(let i=0; i<6.4; i++) {
bassAm += audioData[i];
}
for(let i=7; i<19.2; i++) {
altoAm += audioData[i];
}
for(let i=20; i<64; i++) {
trebleAm += audioData[i];
}
Timer {
id: animation
interval: timer_interval
repeat: true
triggeredOnStart: false
onTriggered: {
let trebleAm = 0;
let altoAm = 0;
let bassAm = 0;
for(let i=0; i<6.4; i++) {
bassAm += audioData[i];
}
for(let i=7; i<19.2; i++) {
altoAm += audioData[i];
}
for(let i=20; i<64; i++) {
trebleAm += audioData[i];
}
trebleAm = trebleAm / 38.4;
altoAm = altoAm / 19.2;
bassAm = bassAm / 6.4;
trebleAm = trebleAm / 38.4;
altoAm = altoAm / 19.2;
bassAm = bassAm / 6.4;
_phase = (_phase+speed)%(Math.PI*64);
_phase = (_phase+speed)%(Math.PI*64);
context.clearRect(0, 0, width+32, height+32);
context.clearRect(0, 0, width+32, height+32);
drawLine(_delta*trebleAmRatio*trebleAm, trebleColor, 1.5, _phase, false);
drawLine(_delta*bassAmRatio*bassAm, bassColor, 1.5, _phase+0.8, false);
drawLine(_delta*altoAmRatio*altoAm, altoColor, 2, _phase+0.4, true);
context.beginPath();
context.stroke();
requestPaint();
drawLine(_delta*trebleAmRatio*trebleAm, trebleColor, 1.5, _phase, false);
drawLine(_delta*bassAmRatio*bassAm, bassColor, 1.5, _phase+0.8, false);
drawLine(_delta*altoAmRatio*altoAm, altoColor, 2, _phase+0.4, true);
context.beginPath();
context.stroke();
requestPaint();
}
}
onCompleted: {
for (let i = 0; i < 128; i++) {
audioData[i] = 0;
}
animation.start();
}
onVersionUpdated: {
@ -122,7 +134,8 @@ AdvpStyleTemplate {
}
defaultValues: {
"Version": "1.0.0",
"Version": "1.0.1",
"Refresh Rate": 30,
"Bass Color": "#dc143c",
"Alto Color": "#f8f8ff",
"Treble Color": "#4169e1",
@ -140,6 +153,16 @@ AdvpStyleTemplate {
preference: AdvpPreference {
version: defaultValues["Version"]
P.SliderPreference {
name: "Refresh Rate"
label: qsTr("Refresh Rate")
from: 20
to: 60
stepSize: 1
defaultValue: defaultValues["Refresh Rate"]
displayValue: value + " fps"
}
P.ColorPreference {
name: "Bass Color"
label: qsTr("Bass Line Color")

Loading…
Cancel
Save