@marc2k3 you asked to please use this thread for requests, so here goes. Could I have something like the following image added to your "Track Info + Spectrogram Seekbar + Buttons" script? I'll also post the current settings I am using below:
// ==PREPROCESSOR==
// @name "Track Info + Spectrogram Seekbar + Buttons"
// @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\panel.js"
// @import "%fb2k_component_path%samples\js\seekbar.js"
// ==/PREPROCESSOR==
/*
Most samples already require FontAwesome and it's used for the default buttons.
https://github.com/FortAwesome/Font-Awesome/blob/4.x/fonts/fontawesome-webfont.ttf?raw=true
The Segoe Fluent Icons font is already included with Windows 11. Windows 10 users can download it here:
https://download.microsoft.com/download/8/f/c/8fc7cbc3-177e-4a22-af48-2a85e1c5bffb/Segoe-Fluent-Icons.zip
If installed, you can right click the panel and change the button set.
---
Full ffmpeg setup instructions here: https://jscript-panel.github.io/gallery/spectrogram-seekbar/
If you edit the ffmeg_exe variable, directory separators must be escaped like "D:\\Audio\\Tools\\ffmpeg.exe"
If you edit the spectrogram_cache variable, you must make sure the folder already exists.
*/
var ffmpeg_exe = fb.ProfilePath + 'ffmpeg.exe';
var spectrogram_cache = folders.data + 'spectrogram_cache\\';
var colours = {
buttons : RGB(8, 255, 255),
background : RGB(30, 30, 30),
title : RGB(8, 255, 255),
artist : RGB(240, 240, 240),
time : RGB(240, 240, 240),
sac : RGB(196, 30, 35),
};
var tfo = {
artist : fb.TitleFormat('%artist%'),
title : fb.TitleFormat('%tracknumber% / %totaltracks% - %title%'),
playback_time : fb.TitleFormat('[%playback_time%]'),
length : fb.TitleFormat(' %length% $ifequal(%LASTFM_LOVED_DB%,1,❤️,)' ),
};
//////////////////////////////////////////////////////////////
var panel = new _panel();
var seekbar = new _seekbar(0, 0, 0, 0, true);
var buttons = new _buttons();
var button_set_idx = 0;
var fluent_font = 'Segoe Fluent Icons';
var has_font = utils.CheckFont(fluent_font);
var bs = _scale(24);
var normal_font = CreateFontString('Segoe UI', 12);
var bold_font = CreateFontString('Segoe UI', 12, true);
window.MaxHeight = _scale(150);
var char_set = [chars, fluent_chars];
if (has_font) {
button_set_idx = window.GetProperty('2K3.BUTTON.SET', 0);
}
if (fb.IsPlaying) on_playback_new_track(fb.GetNowPlaying());
else on_item_focus_change();
buttons.update = function () {
var y = Math.round((panel.h - bs) / 2);
this.buttons.stop = new _button(panel.w - LM - (bs * 8), y, bs, bs, { char : char_set[button_set_idx].stop, colour:fb.StopAfterCurrent ? colours.sac : colours.buttons}, null, function () { fb.Stop(); }, 'Stop');
this.buttons.previous = new _button(panel.w - LM - (bs * 7), y, bs, bs, { char : char_set[button_set_idx].prev, colour:colours.buttons }, null, function () { fb.Prev(); }, 'Previous');
this.buttons.play = new _button(panel.w - LM - (bs * 6), y, bs, bs, { char : !fb.IsPlaying || fb.IsPaused ? char_set[button_set_idx].play : char_set[button_set_idx].pause, colour:colours.buttons}, null, function () { fb.PlayOrPause(); }, !fb.IsPlaying || fb.IsPaused ? 'Play' : 'Pause');
this.buttons.next = new _button(panel.w - LM - (bs * 5), y, bs, bs, { char : char_set[button_set_idx].next, colour:colours.buttons }, null, function () { fb.Next(); }, 'Next');
this.buttons.console = new _button(panel.w - LM - (bs * 3), y, bs, bs, {char : char_set[button_set_idx].console, colour:colours.buttons }, null, function () { fb.ShowConsole(); }, 'Console');
this.buttons.search = new _button(panel.w - LM - (bs * 2), y, bs, bs, { char : char_set[button_set_idx].search, colour:colours.buttons }, null, function () { fb.RunMainMenuCommand('Library/Search'); }, 'Library Search');
this.buttons.preferences = new _button(panel.w - LM - bs, y, bs, bs, { char : char_set[button_set_idx].preferences, colour:colours.buttons}, null, function () { fb.ShowPreferences(); }, 'Preferences');
if (button_set_idx == 1) {
this.change_font(fluent_font);
}
}
function on_item_focus_change() {
seekbar.item_focus_change();
}
function on_mouse_lbtn_down(x, y) {
seekbar.lbtn_down(x, y);
}
function on_mouse_lbtn_up(x, y) {
if (buttons.lbtn_up(x, y)) {
return;
}
if (seekbar.lbtn_up(x, y)) {
return;
}
fb.RunMainMenuCommand('View/Show now playing in playlist');
}
function on_mouse_leave() {
buttons.leave();
}
function on_mouse_move(x, y) {
if (buttons.move(x, y)) {
return;
}
seekbar.move(x, y);
}
function on_mouse_rbtn_up(x, y) {
if (seekbar.containsXY(x, y)) {
return panel.rbtn_up(x, y, seekbar);
}
if (buttons.buttons.stop.containsXY(x, y)) {
fb.StopAfterCurrent = !fb.StopAfterCurrent;
return true;
}
var menu = window.CreatePopupMenu();
var sub = window.CreatePopupMenu();
sub.AppendMenuItem(MF_STRING, 1, 'Original');
sub.AppendMenuItem(EnableMenuIf(has_font), 2, 'Fluent');
sub.CheckMenuRadioItem(1, 2, button_set_idx + 1);
sub.AppendTo(menu, MF_STRING, 'Buttons');
menu.AppendMenuSeparator();
menu.AppendMenuItem(MF_STRING, 3, 'Configure');
var idx = menu.TrackPopupMenu(x, y);
menu.Dispose();
switch (idx ) {
case 1:
case 2:
button_set_idx = idx - 1;
window.SetProperty('2K3.BUTTON.SET', button_set_idx);
buttons.update();
window.Repaint();
break;
case 3:
window.ShowConfigure();
break;
}
return true;
}
function on_mouse_wheel(s) {
if (seekbar.wheel(s)) {
return;
}
if (s == 1) {
fb.VolumeUp();
} else {
fb.VolumeDown();
}
}
function on_paint(gr) {
gr.Clear(colours.background);
gr.FillRectangle(seekbar.x, seekbar.y, seekbar.w, seekbar.h, colours.seekbar_background);
seekbar.paint(gr);
DrawRectangle(gr, seekbar.x, seekbar.y, seekbar.w, seekbar.h, seekbar.properties.marker_colour.value);
buttons.paint(gr);
if (fb.IsPlaying) {
gr.WriteText(tfo.title.Eval(), bold_font, colours.title, 10, 0, seekbar.x - _scale(60), panel.h * 0.6, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
gr.WriteText(tfo.artist.Eval(), normal_font, colours.artist, 10, panel.h * 0.3, seekbar.x - _scale(60), panel.h * 0.7, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
gr.WriteText(tfo.playback_time.Eval(), normal_font, colours.time, seekbar.x - _scale(66), 0, _scale(60), panel.h, DWRITE_TEXT_ALIGNMENT_TRAILING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
gr.WriteText(tfo.length.Eval(), normal_font, colours.time, seekbar.x + seekbar.w + _scale(6), 0, _scale(60), panel.h, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
}
}
function on_playback_dynamic_info_track(type) {
if (type == 0) window.Repaint();
}
function on_playback_edited() {
window.Repaint();
}
function on_playback_new_track(metadb) {
seekbar.playback_new_track(metadb);
}
function on_playback_pause() {
buttons.update();
window.Repaint();
}
function on_playback_seek() {
seekbar.playback_seek();
}
function on_playback_starting() {
buttons.update();
window.Repaint();
}
function on_playback_stop(reason) {
seekbar.playback_stop(reason);
buttons.update();
window.Repaint();
}
function on_playback_time() {
window.RepaintRect(panel.h, 0, seekbar.x - panel.h, panel.h);
}
function on_playlist_stop_after_current_changed() {
buttons.update();
window.Repaint();
}
function on_playlist_switch() {
seekbar.item_focus_change();
}
function on_run_cmd_async_done(task_id) {
seekbar.run_cmd_async_done(task_id);
}
function on_size() {
panel.size();
seekbar.x = _scale(300);
seekbar.y = _scale(5);
seekbar.w = panel.w - seekbar.x - _scale(280);
seekbar.h = panel.h - (seekbar.y * 2);
buttons.update();
}