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.
Topic: World-Map-SMP (Read 1008 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

World-Map-SMP

A foobar2000 UI Spider Monkey Panel which displays current artist's country on the world map and lets you generate autoplaylists based on selection and locale tag saving when integrated along WilB's Biography Script.


Features


  • Follow now playing track or selection.
  • Works with multiple selected tracks (draws all points on the map), allowing to show statistics of an entire playlist or library.
  • On playback the panel fetches tags from (by order of preference):
    • Track's tags.
    • Json database.
    • WilB's Biography panel.
  • Biography integration:
    • Done via script. There is a menu option to install the mod (it looks for the original file, edits the relevant lines and creates a backup). Is done step by step and can be reverted back.
      • Selection mode changes automatically when changing it on Biography panel, therefore syncing the changes.
      • Biography lets you write tags on demand, this lets you write tags as soon as the panel gets refreshed with new data.
      • Tool-tip shows multiple info about the points and tracks selected.
    • AutoPlaylist creation:
      • On click over a point, an autoplaylist is created with any artist on your library from the selected country.
      • key modifiers: forces an autoplaylist with artist from selected country AND same tags (3 configurable). Currently set to style/genre or both.


Also integrates
 1. Menu-Framework-SMP: Helper which allows to easily create customizable and dynamic menus.

Installation
Copy all files from the zip into YOUR_FOOBAR_PROFILE_PATH\scripts\SMP\xxx-scripts
Any other path WILL NOT work without editing the scripts. (see images_Installation_*jpg)
For ex: mine is c:\Users\xxx\AppData\Roaming\foobar2000\scripts\SMP\xxx-scripts...
For portable installations >= 1.6: .\foobar2000\profile\scripts\SMP\xxx-scripts...
For portable installations <= 1.5: .\foobar2000\scripts\SMP\xxx-scripts...
Then load 'world_map.js' into a SMP panel within foobar.

Download latest release (or nightly releases) at github:
https://github.com/regorxxx/World-Map-SMP[/list]

Re: World-Map-SMP

Reply #1
deleted - accidentally posted in the wrong place.


Re: World-Map-SMP

Reply #2
This is pretty cool, but one recommendation.

The map it uses is a bit odd, given that probably 70%+ of recorded music is from about 8% of the map area (US/EU) and I'm not aware of any recordings from Antarctica which is generously represented on the projection.

You put a lot of good work into this, it would be nice to see it better. :)

Re: World-Map-SMP

Reply #3
Hi there.
interesting projects!
@regor ,Is it possible to set the background color of the window to match the color of the main theme? (see picture).
Many thanks.

But the pointer does not appear on the map. WilB's script is integrated.
Can't figure out what's wrong?

Re: World-Map-SMP

Reply #4
This is pretty cool, but one recommendation.

The map it uses is a bit odd, given that probably 70%+ of recorded music is from about 8% of the map area (US/EU) and I'm not aware of any recordings from Antarctica which is generously represented on the projection.

You put a lot of good work into this, it would be nice to see it better. :)
I already offer a possibility to change the image to whatever you like, so... feel free to change it if you don't like it (?).
Cutting the map to not show Antarctica would break Mercator coordinates and make it incompatible with other standard maps, which also breaks the design decision to let users to change the image.

Not going that route unless I can support both, standard maps and maps without Antarctica, without needing to use different coordinates. Will take a look at it.

Re: World-Map-SMP

Reply #5
Hi there.
interesting projects!
@regor ,Is it possible to set the background color of the window to match the color of the main theme? (see picture).
Many thanks.

But the pointer does not appear on the map. WilB's script is integrated.
Can't figure out what's wrong?
As far as I know that's as easy as setting your panel right at appearance (transparency). Let me know if that works.

The other problem... I don't understand it without more data. Integration must be installed AND enabled. And obviously, the artists must have that data on last fm (or on the track's tag)... otherwise it does nothing.

Re: World-Map-SMP

Reply #6
I found a relatively easy way to adjust the coordinates according to a factor and it works.
So I cut the original map to not show Antarctica and put both options in a menu, along entries to edit the image path and factors.

X

The factors should work as long as the image is a mercator map (no matter if it's cut at any axis). For other projections, the entire coordinates table should be replaced.

Re: World-Map-SMP

Reply #7
## [1.1.0] - 2021-05-26
### Added
- Menu: Map image can be set via menus.
- Menu: 2 different map images are not offered by default, full and No Antarctica. Coordinates are re-scaled according to the crop when choosing the later.
- Map framework: Coordinates transformation has been added, allowing to use custom map images while using the default coordinates (plus a factor).
### Changed
- Map framework: updated with last changes.
- Menu framework: updated with last changes.
- Readme: updated some tips.
### Removed
### Fixed

Re: World-Map-SMP

Reply #8
## [1.1.1] - 2021-05-28
### Added
### Changed
- Menu framework: updated.
### Removed
### Fixed
- Changing image map did not ask automatically for X and Y coordinates factors.

Re: World-Map-SMP

Reply #9
v1.2.0 - File restructuring and cleanup
File restructuring update for compatibility with the other repositories.

## [1.2.0] - 2021-06-07
### Added
### Changed
- Helpers: Split 'helpers_xxx.js' file into multiple ones for easier future maintenance.
### Removed
### Fixed

Re: World-Map-SMP

Reply #10
As far as I know that's as easy as setting your panel right at appearance (transparency). Let me know if that works.
regor,
The background of the world map panel is still white.
And I hope you and WilB will be able to develop a version of the World-Map script that works without modifying the Bio script.
Thanks.

Re: World-Map-SMP

Reply #11
As far as I know that's as easy as setting your panel right at appearance (transparency). Let me know if that works.
regor,
The background of the world map panel is still white.
And I hope you and WilB will be able to develop a version of the World-Map script that works without modifying the Bio script.
Thanks.
The last bio version works fine BUT without a mod the selection can not be synchronized between the panels (therefore I add my own mod to solve that "limitation"). Without sel sync, if you change the selection mode in one panel, the other requires to be set manually too or things break.

It's on his side to change that, sorry (I mean.. I posted him the required changes, but people should ask for it, not me). Anyway I don't see it as a "problem"... my script installs the mod automatically and gives 0 problems. Manual installation is a matter of adding 1 line.
Next release will add latest bio integration and some readme tips about it.

About the background, If I set transparency, then it matches the background. I could obviously add a setting to change the color, but that still doesn't answer why it doesn't work for you. So check your config (columns UI or default UI?), since it has nothing to do with the script itself. I have zero idea about how the transparency setting works and it relates to UI, better to ask about it in SMP thread. I only know I use Columns UI and it works with the background color I have set.

X
X

Re: World-Map-SMP

Reply #12
If you want UI colours, you have to retrieve them using window.GetColourDUI / window.GetColourCUI. You'd want this as the first lines inside on_paint

Code: [Select]
var bg = window.InstanceType ? window.GetColourDUI(1): window.GetColourCUI(3);
gr.FillSolidRect(0, 0, window.Width, window.Height, bg);

Typically you'd want them to update whenever the user changes the settings too so you'd need this callback as well...

Code: [Select]
function on_colours_changed() {
window.Repaint();
}

Re: World-Map-SMP

Reply #13
If you want UI colours, you have to retrieve them using window.GetColourDUI / window.GetColourCUI. You'd want this as the first lines inside on_paint

Code: [Select]
var bg = window.InstanceType ? window.GetColourDUI(1): window.GetColourCUI(3);
gr.FillSolidRect(0, 0, window.Width, window.Height, bg);

Typically you'd want them to update whenever the user changes the settings too so you'd need this callback as well...

Code: [Select]
function on_colours_changed() {
window.Repaint();
}
My doubt is more why the transparency doesn't work for him? Since it works fine on my side (which makes all that unnecessary). Otherwise, yep, I would do that and also add a custom color option

Re: World-Map-SMP

Reply #14
Transparency has no effect in default UI. It will always be white unless you use FillSolidRect to draw your own colour.

The same goes inside a normal CUI splitter. It would be white too. Pretty sure only reason yours is grey is because its inside a tab stack.

The real purpose of pseudo transparent mode is for laying panels on top of Panel Stack Splitters which may have some image/text/colours you want to show through your own panels on top. Also, it's needed if you add SMP as a CUI toolbar.

JSP actually disables items that aren't available in DUI so there is no confusion.


Re: World-Map-SMP

Reply #15
Thanks! I had no idea at all how it worked, and yes.. as you have noted I use my script within a tab stack.

Then I will add the colors option and use UI/DUI as default and done.

EDIT: done for the next release.

Re: World-Map-SMP

Reply #16
v1.2.1 - Biograpy 1.2.X integration
Biograpy 1.2.X integration. Customizable background color. Minor improvements.
(*) Recommended to update all other scripts (Playlist Tools, Search by Distance, Playlist Manager) too. There have been major changes on those.


## [1.2.1] - 2021-06-15
### Added
- Biography Integration: Now works with Biograpy 1.2.X version too. 'Notify tags' must be enabled on Bio's config panel, the script will do it automatically when installing the mod. Appart from that, installation and selection mode sync works the same than 1.1.X series.
- Image: Added 2 map versions with black border (now the default ones).
- Colors: Option to change background color.
### Changed
- Portable: When properties are set for the first time, now use relative paths on profile folder for portable installations (>= 1.6).
- Data: json file for tags is now formatted to be readable.
- Biography Integration: Manually reloading Biography panel after installing the mod is no longer required, since it's done auttomatically after installing the mod.
- Image: 'No Antarctica map' (black border) is now the default one.
### Removed
### Fixed
- Menu: After setting a custom map image, panel was not being redrawn (requiring a manual update).
- Avoid possible crashes when tags json file get corrupted. Warns about it whit a popup.

Re: World-Map-SMP

Reply #17
 :)
Thanks regor and snotlicker!
The new version of the script looks great!
See picture MC_WorldMap1.jpg

A few points that would be great to consider for the next releases:
1. The country is marked on the map only if English is selected in the Bio. Is it possible for other languages?
2. I think the marker should be smaller. It is better if the type and color of the marker could be changed (for example, the option as in the picture map1.png)
3. Add the ability to display the name of the country (as an option in the picture).
4. Is the country marker not displayed for internet radio tracks?

Other than that, what does this message in the console mean?
World Map - Portable installation: replacing path 'wm_09.JSON filename (for tags)' with '.\profile\js_data\worldMap.json'

 
SimplePortal 1.0.0 RC1 © 2008-2021