Hello!
I've skimmed through this thread and didn't find anyone talking about a VERY TINY "flaw" in this component:
Pausing doesn't update waveform minibar instantly, it updates similarly to the default seekbar (which is reasonable!)
JScript Panel "Minimal Seekbar" functions similarly, BUT as you can see, JScript Panel "Seekbar" updates instantly!
I'm not sure what magic it does to achieve that but maybe it can be done for this component?
JScript Panel "Minimal Seekbar" code:
// ==PREPROCESSOR==
// @name "Minimal Seekbar"
// @author "marc2003"
// @import "%fb2k_component_path%helpers.txt"
// @import "%fb2k_component_path%samples\js\lodash.min.js"
// @import "%fb2k_component_path%samples\js\common.js"
// @import "%fb2k_component_path%samples\js\seekbar.js"
// ==/PREPROCESSOR==
var seekbar = new _seekbar(0, 0, 0, 0);
var font = CreateFontString("Segoe UI", 12);
var is_dark = window.IsDark;
var tfo = {
playback_time : fb.TitleFormat('[%playback_time%]'),
length : fb.TitleFormat('$if2(%length%,LIVE)'),
};
var colours = {
dark : RGB(30, 30, 30),
light : RGB(240, 240, 240),
slider_background : RGB(160, 160, 160),
slider_contrast : RGB(196, 30, 35),
};
function on_colours_changed() {
is_dark = window.IsDark;
window.Repaint();
}
function on_mouse_lbtn_down(x, y) {
seekbar.lbtn_down(x, y);
}
function on_mouse_lbtn_up(x, y) {
seekbar.lbtn_up(x, y);
}
function on_mouse_move(x, y) {
seekbar.move(x, y);
}
function on_mouse_wheel(s) {
seekbar.wheel(s);
}
function on_paint(gr) {
gr.Clear(is_dark ? colours.dark : colours.light);
gr.FillRoundedRectangle(seekbar.x, seekbar.y, seekbar.w, seekbar.h, _scale(2), _scale(2), colours.slider_background);
if (fb.IsPlaying) {
var time_width = seekbar.x - _scale(12);
gr.WriteText(tfo.playback_time.Eval(), font, is_dark ? colours.light : colours.dark, 0, 0, time_width, window.Height - 3, 1, 2);
gr.WriteText(tfo.length.Eval(), font, is_dark ? colours.light : colours.dark, seekbar.x + seekbar.w + _scale(12), 0, time_width, window.Height - 3, 0, 2);
if (fb.PlaybackLength > 0) {
gr.FillEllipse(seekbar.x + seekbar.pos(), seekbar.y + _scale(3), _scale(6), _scale(6), colours.slider_contrast);
}
}
}
function on_playback_seek() {
seekbar.playback_seek();
}
function on_playback_stop() {
window.Repaint();
}
function on_playback_time() {
window.Repaint();
}
function on_size() {
seekbar.x = _scale(60);
seekbar.y = (window.Height / 2) - _scale(3);
seekbar.w = window.Width - (seekbar.x * 2);
seekbar.h = _scale(6);
}
JScript Panel "Seekbar" code:
// ==PREPROCESSOR==
// @name "Seekbar"
// @author "marc2003"
// @import "%fb2k_component_path%helpers.txt"
// @import "%fb2k_component_path%samples\js\lodash.min.js"
// @import "%fb2k_component_path%samples\js\common.js"
// @import "%fb2k_component_path%samples\js\seekbar.js"
// ==/PREPROCESSOR==
var seekbar = new _seekbar(0, 0, 0, 0);
seekbar.c1 = RGB(50, 50, 50);
seekbar.c2 = RGB(196, 30, 35);
function on_mouse_lbtn_down(x, y) {
seekbar.lbtn_down(x, y);
}
function on_mouse_lbtn_up(x, y) {
seekbar.lbtn_up(x, y);
}
function on_mouse_move(x, y) {
seekbar.move(x, y);
}
function on_mouse_wheel(s) {
seekbar.wheel(s);
}
function on_paint(gr) {
gr.FillRectangle(seekbar.x, seekbar.y, seekbar.w, seekbar.h, seekbar.c1);
if (fb.IsPlaying && fb.PlaybackLength > 0) {
gr.FillRectangle(seekbar.x, seekbar.y, seekbar.pos(), seekbar.h, seekbar.c2);
}
}
function on_playback_seek() {
seekbar.playback_seek();
}
function on_playback_stop() {
seekbar.playback_stop();
}
function on_size() {
seekbar.w = window.Width;
seekbar.h = window.Height;
}
I realize i'm being very nitpicky, i mean my post to be more of a "hey, maybe this can help" rather than anything else.
I made my forum account to mainly thank you @Case, i love what you've made.