Skip to content

Commit

Permalink
Update and rename css visualization widget
Browse files Browse the repository at this point in the history
For pulse_viz support
  • Loading branch information
r52 committed Mar 28, 2023
1 parent 0f84a81 commit 9278377
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 22 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# win_visualizer_css
# visualizer_css

A simple CSS/JS animation based audio spectrum visualizer widget for Quasar, adapted from codepen by Akihiro Ikeda (http://codepen.io/AI428/pen/dXqvjN).
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
let websocket = null;
const source = "win_audio_viz/" + src;
let rate = 90; // milliseconds
const source = `${extension}/${src}`;
let rate = 10; // milliseconds

// acceptable sources
const sources = {
band: {
size: "win_audio_viz/Bands",
size: `${extension}/Bands`,
calc: function (e) {
return e.val;
},
},
fft: {
size: "win_audio_viz/FFTSize",
size: `${extension}/FFTSize`,
calc: function (e) {
return e.val / 2 + 1;
},
Expand All @@ -32,8 +32,8 @@ function subscribe() {
function initialize(dat) {
const element = `<div><i></i></div>`;

if ("win_audio_viz/settings" in dat) {
let settings = dat["win_audio_viz/settings"];
if (`${extension}/settings` in dat) {
let settings = dat[`${extension}/settings`];

settings.forEach(function (e) {
if (e.name === sources[src].size) {
Expand All @@ -51,12 +51,12 @@ function initialize(dat) {
});
}

if ("rates" in dat["win_audio_viz/metadata"]) {
let rates = dat["win_audio_viz/metadata"]["rates"];
if ("rates" in dat[`${extension}/metadata`]) {
let rates = dat[`${extension}/metadata`]["rates"];

rates.forEach(function (e) {
if (e.name === source) {
rate = Math.round(e.rate * 0.9);
rate = Math.round(e.rate * 0.0006);
}
});
}
Expand Down Expand Up @@ -88,7 +88,7 @@ function parseMsg(msg) {
return;
}

if ("win_audio_viz/settings" in data) {
if (`${extension}/settings` in data) {
initialize(data);
return;
}
Expand Down
6 changes: 6 additions & 0 deletions widgets/visualizer_css/js/options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Viz extension
// "win_audio_viz" on windows, "pulse_viz" on linux
const extension = "win_audio_viz";

// "band" or "fft"
const src = "band";
18 changes: 18 additions & 0 deletions widgets/visualizer_css/visualizer_css.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "visualizer_css",
"width": 500,
"height": 200,
"startFile": "index.html",
"transparentBg": true,
"required": [
{
"name": "win_audio_viz",
"platform": "windows"
},
{
"name": "pulse_viz",
"platform": "linux"
}
],
"dataserver": true
}
2 changes: 0 additions & 2 deletions widgets/win_visualizer_css/js/options.js

This file was deleted.

9 changes: 0 additions & 9 deletions widgets/win_visualizer_css/win_visualizer_css.json

This file was deleted.

0 comments on commit 9278377

Please sign in to comment.