Skip to content

Commit

Permalink
v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Wil-B committed May 13, 2023
1 parent 2429bea commit b8086ec
Show file tree
Hide file tree
Showing 31 changed files with 1,822 additions and 749 deletions.
49 changes: 49 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,52 @@
# v1.4.0

### Added
- summary
- option to disable compact style for the summary
- allows showing all genres, moods, members & composers in summary rather than limiting each to one line
- menu > display or click summary to toggle
- nowplaying display
- image effects
- user configurable (options > textreader & lyrics tab)
- use in it's own right or as a fallback
- layout
- full overlay preset (menu > layout)
- shows text over an album art background
- configurable. Press CTRL or options > behaviour tab > overlay where there is also an example of usage
- advanced radio stream parser
- designed for use with streams that contain the artist name and song title in a non-standard format
- user configurable (open in a text editor)
- location: ...foo_spider_monkey_panel\package_data\{BA9557CE-7B4B-4E0E-9373-99F511E81252}
- won't be overwritten if biography is updated
- language support for menu
- simplified Chinese
- traditional Chinese
- enable: panel properties > 'Language [Menu]...'
- lyrics
- drop shadow effect (options > textreader & lyrics tab)
- larger sync line options (options > textreader & lyrics tab)
- customisable playlist interaction for follow selected item
- default settings should be fine for most users. If required:
- load delay can now be increased if moving through playlist is laggy (options > advanced tab) [regorxxx]
- leading item can now be set to use the delay or load immediately (options > advanced tab)

### Changed
- improve support for other scripts wishing to use biography virtual tags
- scripts can now use ```window.NotifyOthers('bio_syncTags', focus)``` when the current track changes. Focus is either false (prefer nowplaying) or true (follow selected track)
- overrides biography tag settings so that:
- biography always notifies the tags
- that the notified tags include a core set of tags
- that the notified tags include the correct selection mode
- the notification also now has the artist and album name

### Fixed
- rare on_size error
- occasional ActiveX Object error triggered by a site change
- title format regression introduced in 1.3.4 with certain special characters
- workaround for apparent folder locking stopping some film strip images loading during downloading

<br />

# v1.3.6

### Added
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
@@ -1,6 +1,6 @@
License

Copyright (c) 2021-2022 WilB
Copyright (c) 2021-2023 WilB

The above copyright notice shall be included in all
copies or substantial portions of the Software.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -9,6 +9,7 @@ Feature rich biography plug-in for [foobar2000](https://www.foobar2000.org)
- Lyrics: synced and unsynced
- Textreader
- Item properties
- Nowplaying display
- Layout presets: top, left, right, bottom and overlay. Fully customisable with freestyle layouts
- Themes: user interface, dark, blend, light and random
- Custom colours and fonts
Expand Down Expand Up @@ -63,4 +64,3 @@ Standard grouping

Alternative grouping
![item_properties_alternative_grouping](https://user-images.githubusercontent.com/35600752/179354332-31ef0545-4834-4837-bcbc-a86f912181e6.png)

160 changes: 103 additions & 57 deletions assets/html/config.html

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion assets/html/confirm.html
Expand Up @@ -39,11 +39,12 @@
if (parsed_args) {
document.title = parsed_args[0];
window.div_text.innerText = parsed_args[1];
if (parsed_args[5] == 'center') window.div_text.style.textAlign = "center";
var labelInnerHtml = window.btn_ok.innerHTML;
window.btn_ok.innerHTML = labelInnerHtml.replace(/Yes/g, parsed_args[2]);
var labelInnerHtml = window.btn_cancel.innerHTML;
window.btn_cancel.innerHTML = labelInnerHtml.replace(/No/g, parsed_args[3]);
callback = parsed_args[4];
callback = parsed_args[6];
}

var window_w = 558;
Expand Down
Binary file modified assets/images/Logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions main.js
@@ -1,6 +1,7 @@
'use strict';

if (typeof my_utils === 'undefined') include('utils.js');
//include(fb.ProfilePath + 'elements\\colourSelector.js'); // sort handling n/a standalone

const loadAsync = window.GetProperty('Load Biography Asynchronously', true);

Expand All @@ -17,6 +18,7 @@ const files = [
'properties.js',
'settings.js',
'interface.js',
'language.js',
'panel.js',
'server.js',
'allmusic.js',
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"author": "WilB",
"description": "Feature rich all-in-one biography plugin\r\n\r\nDownloads and displays artist photos, biographies and reviews from last.fm, allmusic and wikipedia\r\n\r\n• main artist, similar artists, contributing artists, performers and composers etc\r\n\r\n• main album and top albums\r\n\r\n• history\r\n\r\n• lyrics\r\n\r\n• textreader\r\n\r\n• item properties\r\n\r\n• layout presets: top, left, right, bottom and overlay. Fully customisable with freestyle layouts\r\n\r\n• themes: user interface, dark, blend, light and random\r\n\r\n• custom colours and fonts\r\n\r\n• filmstrip: top, left, right, bottom or hidden\r\n\r\n• image+text, image only or text only\r\n\r\n• drag resizing of image and filmstrip (press Ctrl while panel has focus)\r\n\r\n• custom title format for field remapping and save locations\r\n\r\n• and more...",
"description": "Feature rich all-in-one biography plugin\r\n\r\nDownloads and displays artist photos, biographies and reviews from last.fm, allmusic and wikipedia\r\n\r\n• main artist, similar artists, contributing artists, performers and composers etc\r\n\r\n• main album and top albums\r\n\r\n• history\r\n\r\n• lyrics\r\n\r\n• textreader\r\n\r\n• item properties\r\n\r\nnow playing display\r\n\r\nlayout presets: top, left, right, bottom and overlay. Fully customisable with freestyle layouts\r\n\r\n• themes: user interface, dark, blend, light and random\r\n\r\n• custom colours and fonts\r\n\r\n• filmstrip: top, left, right, bottom or hidden\r\n\r\n• image+text, image only or text only\r\n\r\n• drag resizing of image and filmstrip (press Ctrl while panel has focus)\r\n\r\n• custom title format for field remapping and save locations\r\n\r\n• and more...",
"enableDragDrop": false,
"id": "{BA9557CE-7B4B-4E0E-9373-99F511E81252}",
"name": "Biography",
Expand Down
24 changes: 15 additions & 9 deletions scripts/allmusic.js
Expand Up @@ -265,9 +265,11 @@ class DldAllmusicRev {
$.htmlParse(div.getElementsByTagName('li'), 'id', 'microdata-rating', v => rating = v.innerText.replace(/\D+/g, '') / 2);
review = '>> Album rating: ' + rating + ' << ' + review;
if (review.length > 22) {
$.buildPth(this.fo_rev);
$.save(this.pth_rev, review, true);
server.res();
if (this.fo_rev) {
$.buildPth(this.fo_rev);
$.save(this.pth_rev, review, true);
server.res();
}
} else {
server.updateNotFound('Rev ' + cfg.partialMatch + ' ' + this.pth_rev);
$.trace('allmusic review: ' + this.album + ' / ' + this.albumArtist + ': not found', true);
Expand Down Expand Up @@ -310,9 +312,11 @@ class DldAllmusicRev {
wiki: review,
update: Date.now()
};
$.buildPth(this.fo_rev);
$.save(this.pth_rev, JSON.stringify($.sortKeys(text), null, 3), true);

if (this.fo_rev) {
$.buildPth(this.fo_rev);
$.save(this.pth_rev, JSON.stringify($.sortKeys(text), null, 3), true);
}

if (reviewAuthor || reviewGenre || reviewMood || reviewTheme || review || songReleaseYear || composer) {
server.res();
} else {
Expand Down Expand Up @@ -385,9 +389,11 @@ class Parse {
biography = biography.trim();

if (biography.length > 19) {
$.buildPth(fo_bio);
$.save(pth_bio, biography, true);
server.res();
if (fo_bio) {
$.buildPth(fo_bio);
$.save(pth_bio, biography, true);
server.res();
}
} else {
album ? server.updateNotFound('Bio ' + cfg.partialMatch + ' ' + pth_rev) : server.updateNotFound('Bio ' + cfg.partialMatch + ' ' + artist + ' - ' + title);
if (!$.file(pth_bio)) $.trace('allmusic biography: ' + artist + ': not found', true);
Expand Down
109 changes: 57 additions & 52 deletions scripts/buttons.js
Expand Up @@ -60,7 +60,6 @@ class Buttons {
bahnInstalled: utils.CheckFont('Bahnschrift SemiBold SemiConden'),
col: {},
font: gdi.Font('Segoe UI Symbol', 12, 1),
fontSize: 12,
h: 19,
icon: false,
item_w: {
Expand Down Expand Up @@ -232,67 +231,67 @@ class Buttons {
}
}

createStars() {
createStars(force) {
this.src.icon = ui.show.btnLabel == 2 ? 1 : 0;
const hs = ui.font.heading.Size;
const fs = ui.stars != 1 ? (this.src.icon ? (this.src.bahnInstalled ? 12 : 11) : 10) * $.scale : 12 * $.scale;
const srcFontSize = this.src.fontSize;
this.src.fontSize = $.clamp(Math.round(hs * 0.47) + (ppt.zoomHeadBtn - 100) / 10, Math.min(fs, hs), Math.max(fs, hs));
this.src.font = gdi.Font('Segoe UI', this.src.fontSize, 1);
if (this.src.fontSize != srcFontSize || force) this.src.font = gdi.Font('Segoe UI', this.src.fontSize, 1);
$.gr(1, 1, false, g => {
this.src.h = g.CalcTextHeight('allmusic', this.src.font);
});
switch (this.src.icon) {
case 0:
this.src.amBio = cfg.amDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.amRev = cfg.amDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.lfmBio = cfg.lfmDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.lfmRev = cfg.lfmDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.wikiBio = cfg.wikiDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.wikiRev = cfg.wikiDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.txtBio = (txt.bio.subhead.txt[0] || '').toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.txtRev = (txt.rev.subhead.txt[0] || '').toLowerCase() + (!ppt.sourceAll ? '' : '... ');
if (!ui.show.btnLabel) {
this.src.amBio = '';
this.src.amRev = '';
this.src.lfmBio = '';
this.src.lfmRev = '';
this.src.wikiBio = '';
this.src.wikiRev = '';
this.src.txtBio = '';
this.src.txtRev = '';
}
$.gr(1, 1, false, g => {
['space', 'amRev', 'lfmRev', 'wikiRev', 'txtRev', 'amBio', 'lfmBio', 'wikiBio', 'txtBio'].forEach(v => this.src.item_w[v] = g.CalcTextWidth(this.src[v], this.src.font, true))
});
break;
case 1: {
this.src.amBio = this.src.amRev = cfg.amDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.lfmBio = this.src.lfmRev = '\uF202' + (!ppt.sourceAll ? '' : '... ');
this.src.wikiBio = this.src.wikiRev = '\uF266' + (!ppt.sourceAll ? '' : '... ');
this.src.txtBio = (txt.bio.subhead.txt[0] || '').toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.txtRev = (txt.rev.subhead.txt[0] || '').toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.font = gdi.Font(this.src.bahnInstalled ? this.src.bahn : 'Segoe UI Semibold', this.src.fontSize, 0);
this.src.iconFont = gdi.Font('FontAwesome', Math.round(this.src.fontSize * (this.src.bahnInstalled ? 1.09 : 1.16)), 0);
const alt_w = [];
alt_w[9] = ' ';
const fonts = [this.src.font, this.src.font, this.src.iconFont, this.src.iconFont, this.src.font, this.src.font, this.src.iconFont, this.src.iconFont, this.src.font, this.src.iconFont];
$.gr(1, 1, false, g => {
switch (this.src.icon) {
case 0:
this.src.amBio = cfg.amDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.amRev = cfg.amDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.lfmBio = cfg.lfmDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.lfmRev = cfg.lfmDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.wikiBio = cfg.wikiDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.wikiRev = cfg.wikiDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.txtBio = (txt.bio.subhead.txt[0] || '').toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.txtRev = (txt.rev.subhead.txt[0] || '').toLowerCase() + (!ppt.sourceAll ? '' : '... ');
if (!ui.show.btnLabel) {
this.src.amBio = '';
this.src.amRev = '';
this.src.lfmBio = '';
this.src.lfmRev = '';
this.src.wikiBio = '';
this.src.wikiRev = '';
this.src.txtBio = '';
this.src.txtRev = '';
}
$.gr(1, 1, false, g => {
['space', 'amRev', 'lfmRev', 'wikiRev', 'txtRev', 'amBio', 'lfmBio', 'wikiBio', 'txtBio'].forEach(v => this.src.item_w[v] = g.CalcTextWidth(this.src[v], this.src.font, true))
});
break;
case 1: {
this.src.amBio = this.src.amRev = cfg.amDisplayName.toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.lfmBio = this.src.lfmRev = '\uF202' + (!ppt.sourceAll ? '' : '... ');
this.src.wikiBio = this.src.wikiRev = '\uF266' + (!ppt.sourceAll ? '' : '... ');
this.src.txtBio = (txt.bio.subhead.txt[0] || '').toLowerCase() + (!ppt.sourceAll ? '' : '... ');
this.src.txtRev = (txt.rev.subhead.txt[0] || '').toLowerCase() + (!ppt.sourceAll ? '' : '... ');
if (this.src.fontSize != srcFontSize || force) {
this.src.font = gdi.Font(this.src.bahnInstalled ? this.src.bahn : 'Segoe UI Semibold', this.src.fontSize, 0);
this.src.iconFont = gdi.Font('FontAwesome', Math.round(this.src.fontSize * (this.src.bahnInstalled ? 1.09 : 1.16)), 0);
}
const alt_w = [];
alt_w[9] = ' ';
const fonts = [this.src.font, this.src.font, this.src.iconFont, this.src.iconFont, this.src.font, this.src.font, this.src.iconFont, this.src.iconFont, this.src.font, this.src.iconFont];
['space', 'amRev', 'lfmRev', 'wikiRev', 'txtRev', 'amBio', 'lfmBio', 'wikiBio', 'txtBio', 'spaceIconFont'].forEach((v, i) => {
this.src.item_w[v] = g.CalcTextWidth(i < 9 ? this.src[v] : alt_w[i], fonts[i], true);
})
});
this.src.item_w.space = Math.max(this.src.item_w.space, this.src.item_w.spaceIconFont);
const n = ppt.artistView ? 'bio' : 'rev';
this.src.y = this.src.fontSize < 12 || txt[n].loaded.ix == 2 ? 1 : 0;
break;
});
this.src.item_w.space = Math.max(this.src.item_w.space, this.src.item_w.spaceIconFont);
const n = ppt.artistView ? 'bio' : 'rev';
this.src.y = this.src.fontSize < 12 || txt[n].loaded.ix == 2 ? 1 : 0;
break;
}
}
}
});
if (ui.stars == 1) this.setRatingImages(Math.round(this.src.h / 1.5) * 5, Math.round(this.src.h / 1.5), ui.col.starOn, ui.col.starOff, ui.col.starBor, false);
else if (ui.stars == 2) {
this.setRatingImages(Math.round(ui.font.main_h / 1.75) * 5, Math.round(ui.font.main_h / 1.75), ui.col.starOn, ui.col.starOff, ui.col.starBor, false);
}
if (ui.stars == 1 && ui.show.btnRedLastfm) this.setRatingImages(Math.round(this.src.h / 1.5) * 5, Math.round(this.src.h / 1.5), RGBA(225, 225, 245, 255), RGBA(225, 225, 245, 60), ui.col.starBor, true);

this.src.pxShift = /[gjpqy]/.test(this.src.amRev + this.src.lfmRev + this.src.wikiRev + this.src.txtRev + this.src.amBio + this.src.lfmBio + this.src.wikiBio + this.src.txtBio);
}

Expand Down Expand Up @@ -467,9 +466,14 @@ class Buttons {
this.btns.lookUp = new Btn(this.lookUp.x, this.lookUp.y, this.lookUp.w, this.lookUp.h, 7, this.lookUp.p1, this.lookUp.p2, '', {
normal: RGBA(this.lookUp.col[0], this.lookUp.col[1], this.lookUp.col[2], this.lookUp.pos == 2 ? 100 : 50),
hover: RGBA(this.lookUp.col[0], this.lookUp.col[1], this.lookUp.col[2], this.lookUp.pos == 2 ? 200 : this.alpha[1])
//}, !panel.id.lookUp, '', () => men.buttonMenu(this.lookUp.x + this.lookUp.p1, this.lookUp.y + this.lookUp.h), () => 'Click: look up...\r\n' + (!panel.id.lyricsSource ? 'Middle click: ' + (!panel.lock ? 'lock: stop track change updates' : 'Unlock') + '...' : 'Lock N/A with enabled lyrics source'), true, 'lookUp');
}, !panel.id.lookUp, '', () => bMenu.load(this.lookUp.x + this.lookUp.p1, this.lookUp.y + this.lookUp.h), () => 'Click: look up...\r\n' + (!panel.id.lyricsSource ? 'Middle click: ' + (!panel.lock ? 'lock: stop track change updates' : 'Unlock') + '...' : 'Lock N/A with enabled lyrics source'), true, 'lookUp');
}, !panel.id.lookUp, '', () => bMenu.load(this.lookUp.x + this.lookUp.p1, this.lookUp.y + this.lookUp.h), () => 'Click: look up...\r\n' + (!panel.id.lyricsSource && !panel.id.nowplayingSource ? 'Middle click: ' + (!panel.lock ? 'lock: stop track change updates' : 'Unlock') + '...' : 'Lock N/A with enabled lyrics or nowplaying sources'), true, 'lookUp');
} else delete this.btns.lookUp;
if (ppt.summaryShow) {
this.btns.summary = new Btn(panel.text.l, panel.text.t, panel.text.w, ppt.artistView ? (txt.line.h.bio * txt.bio.summaryEnd) : (txt.line.h.rev * txt.rev.summaryEnd), 8, this.lookUp.p1, this.lookUp.p2, '', {
normal: RGBA(this.lookUp.col[0], this.lookUp.col[1], this.lookUp.col[2], this.lookUp.pos == 2 ? 100 : 50),
hover: RGBA(this.lookUp.col[0], this.lookUp.col[1], this.lookUp.col[2], this.lookUp.pos == 2 ? 200 : this.alpha[1])
}, '', '', () => {ppt.toggle('summaryCompact'); txt.refresh(1);}, '', false, 'summary');
} else delete this.btns.summary;
if (ppt.sbarShow) {
switch (ui.sbar.type) {
case 2:
Expand Down Expand Up @@ -510,7 +514,7 @@ class Buttons {
}

resetZoom() {
txt.bio.scrollPos = {}; // avoids sometimes memory
txt.bio.scrollPos = {};
txt.rev.scrollPos = {};
ppt.zoomFont = 100;
ppt.zoomHead = 115;
Expand All @@ -527,7 +531,7 @@ class Buttons {
this.refresh(true);
txt.refresh(2);
const n = ppt.artistView ? 'bio' : 'rev';
if (txt[n].loaded.txt && txt.reader.lyrics) txt.getText();
if (txt[n].loaded.txt && txt.reader[n].lyrics) txt.getText();
}

scrollAlb() {
Expand Down Expand Up @@ -886,6 +890,7 @@ class Btn {

trace(x, y) {
but.traceBtn = !this.hide && x > this.x && x < this.x + this.w && y > this.y && y < this.y + this.h;
if (this.name == 'summary' && (ppt.artistView && art_scrollbar.delta > txt.line.h.bio * txt.bio.summaryEnd || !ppt.artistView && alb_scrollbar.delta > txt.line.h.rev * txt.rev.summaryEnd)) but.traceBtn = false;
return but.traceBtn;
}
}
Expand Down

0 comments on commit b8086ec

Please sign in to comment.