getmusicbee.com

Support => Tips and Tricks => Topic started by: hiccup on February 01, 2020, 09:43:47 PM

Title: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on February 01, 2020, 09:43:47 PM
Here are some User Defined Language (UDL) files for Notepad++ (a.k.a. Notepad Plus, NPP, NP+) that I created.

These UDL files define a layout for the edit panel, and can include colouring, fonts and highlighting features.
I have created four of them for different purposes related to MusicBee:


MusicBee virtual tags  -  for editing virtual tags and other MB formulas:

dark version:

(https://i.imgur.com/yhHn0UD.png)

light version:

(https://i.imgur.com/2ZJ4PKo.png)

DOWNLOAD MusicBee virtual tags Notepad++ udl (https://rebrand.ly/NPP-UDL_MusicBee_virtual_tags)


- - -


MusicBee xml skins  -  for editing xml skins:

dark version:

(https://i.imgur.com/gWoWYhh.png)

light version:

(https://i.imgur.com/HZZOGQK.png)

DOWNLOAD MusicBee skinning Notepad++ udl (https://rebrand.ly/NPP-UDL_MusicBee_xml_skins)


- - -


MusicBee Theater Modes  -  for editing Theater Mode XMLs:

The colouring aims to differentiate between:

<!-- comments -->    (do not use \\ or // slashes for comments)
basic elements  values  position/size elements  font elements  image elements
child elements  other elements  settings elements  autohide panel elements  (can be collapsed)

(https://i.imgur.com/JoQMX6N.png)


(https://i.imgur.com/p8RLkMTm.jpg) (https://i.imgur.com/p8RLkMT.png)

DOWNLOAD MusicBee Theater Modes Notepad++ udl (https://rebrand.ly/NPP-UDL_MusicBee_theater_modes)


- - -


Picard scripting  -  for editing Picard scripts:

dark version:

(https://i.imgur.com/pa6PPXy.png)

light version:

(https://i.imgur.com/SQbI7t4.png)

DOWNLOAD Picard scripting Notepad++ udl (https://rebrand.ly/NPP-UDL_Picard_scripting)



- - - - - - - - - - - - -


Especially the one for xml skins has a lot of highlighting features, most of them to improve readability, some of them to help indicating flaws in syntaxes.
So don't get scared when you make a syntax mistake somewhere, and everything below it turns into a red bloody mess.
It should be helpful to locate the error at where the flood of red begins.
(you may need to refresh the view to get the correct highlight colours back after you fixed the mistake)


howto:

- Download the file(s)

- Navigate to your NPP installation folder and locate the folder: userDefineLangs

- Copy the UDL file(s) there

- Open Notepad++
  Now in the menubar under [Language], the new UDL should be available.

That should be all.


- - - - - - - - - - - - - - - -


note 1:

Important!

Notepad++ has an UDL import feature by means of an [Import...] button in the UDL settings panel.
Do not use that to import these UDL files!
NPP currently seems to have a bug that deletes font specifications from UDL files when importing.
(currently at v7.8.3)

note 2:

There are several fonts referenced to in these UDL's:

Segoe UI
Segoe UI Symbol
Calibri
Verdana
Consolas
Source Code Pro (Regular, Medium and Semibold)

If I am not mistaken Windows 10 will have the first five installed by default.
The others are included in the download links.

note 3:

UDL language files are limited to the extent of what elements of NPP they can define colours for.
For example, you will need to set the background colour in NPP's Style Configurator.
(rgb 30,30,30 is suggested for the dark versions, 242,242,242 for the light ones)

The same goes for items such as the line numbers sidebar, folding controls, brackets, etc.


You are obviously free to edit these themes' colours and fonts to your own liking.
And then perhaps post and share the results in this thread?


- - - - - - - - - - - - - - - -


bonus:

I created some icons making it possible to differentiate between xml files, MusicBee formula files, and Picard scripting files.:

(https://i.imgur.com/Uda9e5I.png)

Updated:

-  48x48 desktop icons are now non-transparent. (better for desktops with an image as background)
-  I added icons for .ini and .config.

(https://i.imgur.com/sl1XOuF.png)

(https://i.imgur.com/JFJXnHr.png)


DOWNLOAD XML/MusicBee/Picard coding file icons (https://rebrand.ly/icons_filetype_icons)
 
 
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: psychoadept on February 01, 2020, 11:17:52 PM
This is awesome, thanks!  I think I will move it to Tips & Tricks
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on February 02, 2020, 01:25:53 PM
This is awesome, thanks!  I think I will move it to Tips & Tricks

Thanks psychoadept. Fwiw; I am trying to make the virtual tag script work for Picard scripting also.
At the moment I am running into some difficulties making it work for both MB and Picard, but I hope I can solve it.
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: boroda on February 03, 2020, 11:13:37 AM
But if I am not mistaken, there are also functions that can be used when Additional Tagging Tools is installed.
Functions such as $Date, $Round, $Div, etc.
Would it be useful to add those too?
And if so, does anybody have a complete list of available functions?

Code
$Random(max_number)
$Add(number1,number2)
$Sub(number1,number2)
$Mul(number1,number2)
$Div(number1,number2)
$Round(number,number_of_digits_after_decimal_point)
$Abs(number)
$Now(): returns current date/time
$AddDuration(duration1,duration2): duration format is similar to date/time format
     without "am/pm" suffix, but allowed values are different,
     e.g. 00/01/0000 00:00:00 is valid duration, but not valid date/time. Either
     date part or time part can be omitted, it will be defaulted to zero value.
$SubDuration(duration1,duration2)
$SubDateTime(datetime1,datetime2): returns duration between datetime1 and
     datetime2. Date/time format depends on your Windows regional settings,
     e.g. 12/31/2018 11:59:59 pm. For datetime1 and datetime2 either date part or
     time part can be omitted, it will be defaulted to current date or
     time 00:00:00 am.
$NumberOfDays(datetime1,datetime2): returns number of days between
     datetime1 and datetime2 rounded down to nearest integer value.
$AddDurationToDateTime(datetime,duration)
$SubDurationFromDateTime(datetime,duration)
$And(parameter1,parameter2) is MusicBee native function
$Or(parameter1,parameter2) is MusicBee native function
$Xor(parameter1,parameter2)
$Not(parameter)
$Log(number,base)
$Lg(number): decimal logarithm
$Ln(number): natural logarithm
$Sqrt(number): square root. May be useful for gathering some library
     statistics (in conjunction with ALR functions).
$Len(string): length of string
$Name(filename): returns file name without extension and
     path to file
$CutLeft(string,count): removes number of chars from
     the left of the string
$CutRight(string,count): removes number of chars from
     the right of the string
$RoundDown(number,number_of_digits_after_decimal_point): $RoundDown(4.28,1)
     returns 4.2
$RoundUp(number,number_of_digits_after_decimal_point): $RoundUp(5.2,0)
     returns 6
$Mod(number1,number2): returns the remainder of division
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on February 03, 2020, 04:02:29 PM
Code
...

Thanks, I updated it so it now highlights those functions of Additional Tagging Tools too.
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on February 03, 2020, 04:05:59 PM
Update; I also created a dedicated Notepad++ language file for MusicBrainz' Picard scripting.
Details and a screenshot are at the bottom of the start post.
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: boroda on February 03, 2020, 04:59:53 PM
Thanks, I updated it so it now highlights those functions of Additional Tagging Tools too.
thank *you*
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on February 04, 2020, 04:47:50 PM
Updated; I've added some folding fun:

(https://i.imgur.com/Zfd1eib.png)
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on February 09, 2020, 11:26:02 AM
Update:

I created some icons making it possible to differentiate between xml files, MusicBee formula files, and Picard scripting files.:

(https://i.imgur.com/Uda9e5I.png)

details are in the start post
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on April 30, 2020, 05:05:41 PM
Update:

Since the days are getting longer, I decided to complete the light versions of the UDL files.

They are included in the downloads.
See the startpost for further details.
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on March 20, 2021, 12:36:22 PM
The UDL files for Picard scripting were updated.

The recently added tags:
Code
 _releasegroup_firstreleasedate
 _recording_firstreleasedate
and functions:
Code
$datetime
$find
$foreach
$getmulti
$join
$lenmulti
$map
$reverse
$reversemulti
$slice
$sortmulti
$substr
$while
Are now recognised.
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on December 22, 2021, 04:18:22 PM
The UDL language files for MusicBee virtual tags and Picard scripting were updated with recently added functions.
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on August 01, 2022, 05:13:12 PM
updated

1.
All UDLs now have transparency for their backgrounds.
This means that it is not necessary anymore to set the background colour of your Notepad++ theme to exactly 30,30,30 (dark theme) or 242,242,242 (light theme)
The UDLs will still look fine when using darker or lighter backgrounds.

2.
More functions now have distinct colouring.
The most notable one probably being regex functions.

3.
The matching of brackets has improved.

- - -

A quick impression:

MusicBee formulas:

(https://i.imgur.com/lRxxEin.png)

Picard scripting:

(https://i.imgur.com/tLigU42.png)

(the colours for matching (and bad) brackets can be set under Settings > Style configurator > "Brace highlight style" and "Bad brace colour")

BAD bracket!:
(https://i.imgur.com/UKD5JkD.png)
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on August 05, 2022, 05:09:59 PM
A small update for the Picard scripting UDLs:

A new discriminating colour for some functions that need a plugin to function was added.

- Functions that are by default available in Picard are blue.
- Functions that need the Classical Extras plugin to function are green.
- Functions that need the Additional Artists Variables or the Artist Variables plugin (both by rdswift) are purple.

(https://i.imgur.com/ye45vqu.png)
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on December 28, 2022, 01:26:42 AM
The information is very special
Yes, I think it is too. Thanks for noticing.
I'll settle for appreciation from a bot.

Moderator's Note: The post that was quoted in this message has been removed due to spam.
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on July 28, 2023, 04:45:38 PM
updated for Picard 2.9

Markup formatting was added for several new, and some previously overlooked tags, functions and variables:

$max
$min
_datatrack
_discpregap
_file_created_timestamp
_file_modified_timestamp
_lyricistsort
_musicbrainz_discids
_musicbrainz_tracknumber
_performance_attributes
_pregap
_recording_comment
_recording_firstreleasedate
_recording_series
_recording_seriescomment
_recording_seriesid
_recording_seriesnumber
_release_series
_release_seriescomment
_release_seriesid
_release_seriesnumber
_releaseannotation
_releasecountries
_releasegroup_firstreleasedate
_releasegroup_series
_releasegroup_seriescomment
_releasegroup_seriesid
_releasegroup_seriesnumber
_work_series
_work_seriescomment
_work_seriesid
_work_seriesnumber
_workcomment
_writersort
movement
movementnumber
movementtotal
showmovement
releasedate

Formatting for the AlbumArtist Extension plugin functions was removed since the plugin is now obsolete and is succeeded by the Additional Artists Variables plugin.
 
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on November 16, 2023, 03:31:51 PM
I have added a UDL for editing Theater Mode XMLs:

(https://i.imgur.com/JoQMX6N.png)

More info and the download link are in the startpost.
 
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: Mayibongwe on November 17, 2023, 06:08:27 PM
Cool. Thanks hiccup.
Having used your UDL for skins all this time, it's nice to see familiar colours again.
Below is what I have been using for editing Theater Modes - Notepad++'s default for XML files.

(https://i.imgur.com/PHnEIRr.png)
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on November 17, 2023, 06:24:36 PM
Having used your UDL for skins all this time, it's nice to see familiar colours again.
Below is what I have been using for editing Theater Modes - Notepad++'s default for XML files.
That's very good to hear read.
Let me know if you find some functionality that you think could be better. (colour grouping of elements, maybe some elements not getting coloured, collapsing/folding blocks, etc.)

There may be some room to add additional colours (not much though), but I'm also worried that too many different colours can turn things into a circus ;-)
Of course you can tweak the colours yourself too. Or fonts, sizes etc.
I'm sure you can figure that out if you want to. (else, ring a bell)
Title: Re: User Defined Language templates for editing skins and virtual tags in Notepad++
Post by: hiccup on December 23, 2023, 11:07:04 AM
The UDL for editing Theater Mode XMLs was updated.
(added a couple of missing elements)