Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Recent Posts
1
3rd Party Plugins - (fb2k) / Re: JScript Panel script discussion/help
Last post by marc2k3 -
Code: [Select]
var x = (panel.w - (bs * 7)) / 2

You have 8 buttons so that's why it is off centre.  :D

And yay, the SVG parser which takes around 1.5MB (or 25%) of the overall DLL size is getting some use.

edit: you should not comment this out...

Code: [Select]
// function on_playback_time() {
// text.playback_time();
// window.RepaintRect(0, bottom_y, panel.w, panel.h - bottom_y);
// }

People customising their own text may want %playback_time% etc during playback. There is a toggle on the right click menu to turn per second updates on or off.
3
3rd Party Plugins - (fb2k) / Re: JScript Panel script discussion/help
Last post by eurekagliese -
Thank you very much for the update and the guide @marc2k3
---
This is a composite image of an image from the foo_uie_webview thread, so I don't know. Sorry.
No worries, mate. With latest JSP update, we can also replicate it on a text display.
The script and image files with the PNG and SVG icons are available below.
In your foobar config folder, extract it to the images folder.
Just modify the link on script or the icons as needed.


Code: [Select]
// ==PREPROCESSOR==
// @name "Text Display + Album Art + Custom SVG and PNG 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\albumart.js"
// @import "%fb2k_component_path%samples\js\text_display.js"
// @import "%fb2k_component_path%samples\js\seekbar.js"
// ==/PREPROCESSOR==

// https://jscript-panel.github.io/gallery/text-display/

//.svg files
var google = utils.LoadSVG(fb.ProfilePath + 'images\\google.svg');
var youtube = utils.LoadSVG(fb.ProfilePath + 'images\\youtube.svg');
var spotify = utils.LoadSVG(fb.ProfilePath + 'images\\spotify.svg');
var wikipedia = utils.LoadSVG(fb.ProfilePath + 'images\\wikipedia.svg');
var lastfm = utils.LoadSVG(fb.ProfilePath + 'images\\lastfm.svg');
var search = utils.LoadSVG(fb.ProfilePath + 'images\\search.svg');
var settings = utils.LoadSVG(fb.ProfilePath + 'images\\settings.svg');
//.png files
var discogs = utils.LoadImage(fb.ProfilePath + 'images\\discogs.png');

var tfo = {
artist: fb.TitleFormat('%artist%'),
title: fb.TitleFormat('%title%'),
// playback_time : fb.TitleFormat('[%playback_time%]'),
// length : fb.TitleFormat('$if2(%length%,LIVE)'),
}

var panel = new _panel({ custom_background : true });
var albumart = new _albumart(0, 0, 0, 0);
var text = new _text_display(LM, 0, 0, 0, true);
var seekbar = new _seekbar(0, 0, 0, 0);

var colours = {
slider_background : RGB(160, 160, 160),
white : RGB(255, 255, 255),
contrast : RGB(196, 30, 35),
};

var font = CreateFontString('Segoe UI', 12);
var buttons = new _buttons();
var bs = _scale(24);
var bottom_y = 0;

buttons.update = function () {
var x = (panel.w - (bs * 7)) / 2
var y = seekbar.y + _scale(12);
this.buttons.google = new _button(x, y, bs, bs, { img : google }, null, function () { utils.Run('https://www.google.com/search?tbm=isch&q=' + encodeURIComponent(tfo.artist.Eval() + " " + tfo.title.Eval())); }, 'Google');
this.buttons.youtube = new _button(x + bs, y, bs, bs, { img : youtube }, null, function () { utils.Run('http://www.youtube.com/results?search_query=' + encodeURIComponent(tfo.artist.Eval() + " " + tfo.title.Eval())); }, 'youtube');
this.buttons.spotify = new _button(x + (bs * 2), y, bs, bs, { img : spotify}, null, function () { utils.Run('https://open.spotify.com/search/' + encodeURIComponent(tfo.artist.Eval() + " " + tfo.title.Eval())); }, 'spotify');
this.buttons.wikipedia = new _button(x + (bs * 3), y, bs, bs, { img : wikipedia }, null, function () { utils.Run('http://en.wikipedia.org/wiki/Special:Search?search=' + encodeURIComponent(tfo.artist.Eval()));  }, 'wikipedia');
this.buttons.lastfm = new _button(x + (bs * 4), y, bs, bs, { img : lastfm }, null, function () { utils.Run('https://www.last.fm/search?q=' + encodeURIComponent(tfo.artist.Eval()));  }, 'lastfm');
this.buttons.discogs = new _button(x + (bs * 5), y, bs, bs, { img : discogs }, null, function () { utils.Run('http://www.discogs.com/search?q=' + encodeURIComponent(tfo.artist.Eval()));  }, 'discogs');
this.buttons.search = new _button(x + (bs * 6), y, bs, bs, { img : search }, null, function () { fb.RunMainMenuCommand('Library/Search'); }, 'Library Search');
this.buttons.preferences = new _button(x + (bs * 7), y, bs, bs, { img : settings}, null, function () { fb.ShowPreferences(); }, 'Preferences');
}

panel.item_focus_change();

function on_colours_changed() {
panel.colours_changed();
text.refresh(true);
}

function on_font_changed() {
panel.font_changed();
text.refresh(true);
}

function on_item_focus_change() {
if (panel.selection.value == 0 && fb.IsPlaying) return;
panel.item_focus_change();
}

function on_metadb_changed(handles, fromhook) {
if (!fromhook) {
albumart.metadb_changed();
}
text.metadb_changed();
}

function on_mouse_lbtn_dblclk(x, y) {
if (albumart.img && albumart.containsXY(x, y)) {
panel.metadb.ShowAlbumArtViewer();
}
}

function on_mouse_lbtn_down(x, y) {
seekbar.lbtn_down(x, y);
}

function on_mouse_lbtn_up(x, y) {
if (seekbar.lbtn_up(x, y)) {
return;
}
if (buttons.lbtn_up(x, y)) {
return;
}
text.lbtn_up(x, y);
}

function on_mouse_leave() {
buttons.leave();
}

function on_mouse_move(x, y) {
window.SetCursor(buttons.buttons.google.containsXY(x, y) ? IDC_HAND
: buttons.buttons.youtube.containsXY(x, y) ? IDC_HAND
: buttons.buttons.spotify.containsXY(x, y) ? IDC_HAND
: buttons.buttons.wikipedia.containsXY(x, y) ? IDC_HAND
: buttons.buttons.lastfm.containsXY(x, y) ? IDC_HAND
: buttons.buttons.discogs.containsXY(x, y) ? IDC_HAND
: buttons.buttons.search.containsXY(x, y) ? IDC_HAND
: buttons.buttons.preferences.containsXY(x, y) ? IDC_HAND
: IDC_ARROW);

if (seekbar.move(x, y)) {
return;
}
if (buttons.move(x, y)) {
return;
}
text.move(x, y);
}

function on_mouse_rbtn_up(x, y) {
// if (buttons.buttons.stop.containsXY(x, y)) {
// fb.StopAfterCurrent = !fb.StopAfterCurrent;
// return true;
// }
return panel.rbtn_up(x, y, text);
}

function on_mouse_wheel(s) {
if (seekbar.wheel(s)) {
return;
}
text.wheel(s);
}

function on_paint(gr) {
panel.paint(gr);
text.paint(gr);
buttons.paint(gr);

// 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, colours.white, 0, bottom_y, time_width, _scale(12), 1, 2);
// gr.WriteText(tfo.length.Eval(), font, colours.white, seekbar.x + seekbar.w + _scale(12), bottom_y, time_width, _scale(12), 0, 2);

// if (fb.PlaybackLength > 0) {
// gr.FillEllipse(seekbar.x + seekbar.pos(), seekbar.y + _scale(3), _scale(6), _scale(6), colours.white);
// }
// }
}

function on_playback_order_changed() {
buttons.update();
window.Repaint();
}

function on_playback_dynamic_info_track(type) {
if (type == 0) text.metadb_changed();
else if (type == 1) albumart.metadb_changed();
}

function on_playback_new_track() {
panel.item_focus_change();
}

function on_playback_pause() {
text.refresh();
buttons.update();
window.Repaint();
}

function on_playback_seek() {
seekbar.playback_seek();
}

function on_playback_starting() {
buttons.update();
window.Repaint();
}

function on_playback_stop(reason) {
if (reason != 2) {
panel.item_focus_change();
}

buttons.update();
window.Repaint();
}

// function on_playback_time() {
// text.playback_time();
// window.RepaintRect(0, bottom_y, panel.w, panel.h - bottom_y);
// }

function on_playlist_items_added() {
text.refresh();
}

function on_playlist_items_removed() {
text.refresh();
}

function on_playlist_items_reordered() {
text.refresh();
}

function on_playlist_stop_after_current_changed() {
buttons.update();
window.Repaint();
}

function on_playlist_switch() {
on_item_focus_change();
}

function on_playlists_changed() {
text.refresh();
}

function on_size() {
panel.size();
text.size();

seekbar.x = _scale(60);
seekbar.y = panel.h - _scale(44);
seekbar.w = panel.w - (seekbar.x * 2);
seekbar.h  = _scale(6);

bottom_y = seekbar.y - _scale(4);
buttons.update();
}
4
Other Lossy Codecs / Re: lossyWAV 1.4.2 Development (was 1.5.0)
Last post by Nick.C -
If lossyWAV was a DSP then it would *have* to be the last in the chain if the preservation of zeroed LSBs was to be guaranteed.

Although I would question the need to insert lossyWAV as a DSP in the playback chain in the first place - why waste the CPU cycles processing the source to a lossy/lossier form while listening when one could simply listen to the unprocessed version?
5
General - (fb2k) / Re: Dumb Columns UI Playlist Sorting Question
Last post by marc2k3 -
The issue I'm running into is the Columns UI playlist view seems to sort by album automatically

Nope, It's not a playlist viewers job to sort playlist items as they are added. That is entirely the responsibility of whichever library viewer you are using to populate the playlist.

If you were using Columns UI filters, you can change the sort pattern found under File>Preferences>Display>Columns UI>Filters>Behaviour tab.

Other library viewers may have their own settings. But as an example, ReFacets does not.
6
foobar2000 mobile / Re: Opus ReplayGain/Normalization on fb2k iOS mobile 1.5.2
Last post by mimifluff -
Quick summary: Currently, setting ReplayGain ON for any setting on foobar2000 mobile applies Track Gain only, and ReplayGain OFF disables normalization including opus' internal one, no way to get Album Gain applied.

The only workaround I've found so far was to use ffmpeg to transcode Opus (as it ignores input file RG tags), then write normal RG tags onto the encoded file, however that comes with its own caveats (e.g. ffmpeg doesn't support embedding album art into opus files)

Reading the following threads:
http://www.hydrogenaud.io/forums/index.php?showtopic=104878
http://www.hydrogenaud.io/forums/index.php?showtopic=108311

It seems that the default opusenc behavior w.r.t. RG turned into R128 is intentional but different RG by default. Setting Album Gain for opus files managed to work fine in earlier versions, can this be fixed for current foobar2000 mobile? Thanks  :D
7
General - (fb2k) / Dumb Columns UI Playlist Sorting Question
Last post by Penn42 -
I expect this is a simple fix that I am just looking past, but nonetheless I've been unable to find the answer.  I'm relatively new to FB2K and thoroughly enjoying customizing the interface and splitting up tags in my live music collection into separate fields for greater filtering/sorting/display customization ability.  I've pretty much completed that task and am looking to remove data in the Album field entirely from any of my live music shows, which are otherwise treated in my library view as an album.

The issue I'm running into is the Columns UI playlist view seems to sort by album automatically, and then defaults to looking at some other fields if album doesn't exist.  Everything works fine if I only select a single show at a time in my library view, but if I select multiple shows the playlist will sort by track number automatically, but I want each show to be grouped together. 

I've tried all sorts of things under Preference > Columns UI > Playlist View > Grouping, but no combination of fields will solve this unless the criteria "album" is included and each show has a unique entry. 

Playlist grouping is set to %album%, which is automatically finding my new %venue% field somehow, and it defaults to by track order unless each show has a unique venue name.  Ultimately I would like the playlist to be grouped and sorted by a set of fields and not one master field that has to be unique to each show/show source.  This works swimmingly in Library Tree view configurations, but does not seem to work here. 
8
Other Lossy Codecs / Re: lossyWAV 1.4.2 Development (was 1.5.0)
Last post by TF3RDL -
Since lossyWAV is technically a DSP effect (that reduces the bitrate when encoded to certain lossless codecs like FLAC, but it is moot for uncompressed audio files), I wonder this could be implemented as foobar2000 DSP component to perhaps, simplify the conversion process just by putting lossyWAV into the "Active DSPs" part on the converter side and what would lossyWAV-processed FLACs sound like when put on the playback DSP chain
9
General Audio / Re: Sound level meter / analysis (stereo MP3s)
Last post by DVDdoug -
Quote
'm not sure if that's what you meant but DAC will only accept integer format, so the clipping will happen already on the computer side, somewhere between decoding the MP3 and sending PCM to DAC.
Normally you can turn down the digital volume in in your media player software before it's converted to integer.   
10
3rd Party Plugins - (fb2k) / Re: JScript Panel script discussion/help
Last post by marc2k3 -
Can we get a sample of a png or svg image as buttons instead of font icons?

In 3.6.1, the _button object now supports images.

Replace

Code: [Select]
{ char : some_char, colour : some_colour }

with

Code: [Select]
{ img : some_image }

Code: [Select]
var some_image = utils.LoadImage(fb.ProfilePath + "images\\blah.png");

You only want to load images once on script init so don't put this inside any update function.