Author Topic: Additional Tagging & Reporting Tools  (Read 938076 times)

boroda

  • Sr. Member
  • ****
  • Posts: 4659
But - How do you check for converted presets ? I see  
\Plugins\ASR Presets
which holds 221 xmls (with alphanumerical cryptic names). But, there's nothing I can identify as converted presets as such...?

you can simply check the double-extension of any preset (because they all will have the same extension): new format presets must have the extension ".asr-preset.xml" (old format presets have the extension ".ASR Preset.xml").

...we have 20 ASR hotkey slots to fill now, which is great as I used all 10 before. Just a heads up that if you update, you will need to re-assign your ASR hotkeys most likely as well.

Strictly speaking, it's not true (in the case of sequential plugin version updates). usually, presets must be correctly auto-updated, and all assigned hotkeys must be kept.

yes, i agree that removing support for old preset formats (either ASR or LR) can be very uncomfortable, but i was trying to keep the old structures required for old format presets and the auto-conversion code as long as i could.

alec.tron

  • Sr. Member
  • ****
  • Posts: 752
you can simply check the double-extension of any preset (because they all will have the same extension): new format presets must have the extension ".asr-preset.xml" (old format presets have the extension ".ASR Preset.xml").
Thanks for the insight! And the awesome component of yours of course!

...we have 20 ASR hotkey slots to fill now, which is great as I used all 10 before. Just a heads up that if you update, you will need to re-assign your ASR hotkeys most likely as well.

Strictly speaking, it's not true (in the case of sequential plugin version updates). usually, presets must be correctly auto-updated, and all assigned hotkeys must be kept.

yes, i agree that removing support for old preset formats (either ASR or LR) can be very uncomfortable, but i was trying to keep the old structures required for old format presets and the auto-conversion code as long as i could.
I assume I lost the hotkey presets as I updated to v7, which then had no presets at all (without the conversion-abillity), triggering an edge case with user asr tied to hotkeys (but who knows - the only observation I'd have was that the MB hotkey editor complained, when re-assigning the presets, that a given hotkey I had previouslty assigned, MB warned me that this is already set to "*" [iirc] hinting at a "ghost" hotkey of the previous ASR hotkey... [as the hotkey editor wasn't listing them anymore when there were no presets with v7 - they did re-appear once I re-assigned them as hotkey-able in ASR in the conversion capable version of the tools]).

But no worries - was easy to set up again - and, this is your component after all, and if you deem it beneficial to update something it will surely be ;)

Churs.
c.
Last Edit: September 13, 2023, 09:16:16 PM by alec.tron

boroda

  • Sr. Member
  • ****
  • Posts: 4659
i've fixed a bug when any user interaction was required on plugin startup to see the values of virtual tags that use plugin functions. now, all virtual tags are available immediately after plugin initialization:

https://www.mediafire.com/file/h2t08o9562efboi/mb_TagTools_latest.zip/file

austral

  • Guest
Hello,

Would it be possible to add an enhancement to $Char() function to repeat n times the specified character?
Something like $Char(2028;32)  <-- in this example it would put 32 "zero witdh characters" aka "invisible characters", etc..
This function would be really useful for people building custom sort order groupings in virtual tag formulas.

example


Cheers
Last Edit: September 15, 2023, 01:53:02 PM by austral

boroda

  • Sr. Member
  • ****
  • Posts: 4659
no problem:

https://www.mediafire.com/file/h2t08o9562efboi/mb_TagTools_latest.zip/file

use $CharSequence(hexadicemal_char_code,decimal_number_of_times)

also, i've extended ASR \@char[[]] function to accept (optional, decimal too) second parameter.

austral

  • Guest
thank you very much boroda!  :)
i just tested it with 32 nested $if and works perfectly.

example using the new function

boroda

  • Sr. Member
  • ****
  • Posts: 4659
glad to help

i saw your huge formula and guessed the most common application of this function. so, maybe it's worth to rename it to something more short until it's too late? e.g. $CharSeq() or $CharN()?
Last Edit: September 16, 2023, 07:16:51 AM by boroda

hiccup

  • Sr. Member
  • ****
  • Posts: 7908
maybe it's worth to rename it to something more short until it's too late? e.g. $CharSeq() or $CharN()?
$CharN() seems good. Or maybe $CharRep()
(for repeat, repetition)

austral

  • Guest
glad to help
i saw your huge formula and guessed the most common application of this function. so, maybe it's worth to rename it to something more short until it's too late? e.g. $CharSeq() or $CharN()?

That would be nice, the shortest the better!
Last Edit: September 16, 2023, 08:08:08 AM by austral

boroda

  • Sr. Member
  • ****
  • Posts: 4659
i've renamed it to $CharN(code,times)

https://www.mediafire.com/file/h2t08o9562efboi/mb_TagTools_latest.zip/file

hiccup, could you update your topic on the "tips & tricks" board and give a short description of the main purpose of this function (that it's strictly a service function)?

austral

  • Guest
i've renamed it to $CharN(code,times)

Thanks again boroda! i also updated my post with the example code.

This is how the formulas compare each other in Notepad++. With $CharN it will be much easier to explain the process to users interested in custom sort order groupings. Also the benefits to see the exact position of each grouping or be able to modify the formula directly inside MusicBee.

Last Edit: September 16, 2023, 09:06:08 AM by austral

hiccup

  • Sr. Member
  • ****
  • Posts: 7908
hiccup, could you update your topic on the "tips & tricks" board and give a short description of the main purpose of this function (that it's strictly a service function)?
Thanks for adding this function.
I will update that Tips&Tricks topic, but modifying it requires some courage (its BB-code is quite a minefield), and I would also want to create a brief but clear example of its use, which I haven't figured out yet.
I'm going to do it, but not today ;-)

Dizza17

  • Jr. Member
  • **
  • Posts: 69
Hi,

I’m certain I recall a ASR preset that only copied tags from <Tag 1> to <Tag 2> if <Tag 1> wasn’t empty. Is there any possibility of this being added to the preset bundle?

Cheers!!

TheRealDavid

  • Newbie
  • *
  • Posts: 5
Would it be possible to amend one or both existing $TagContains functions to accept a partial/exact parameter? This would allow users to find exact-string matches instead of only partial-string matches.

As a simplified example of what I mean, the current behavior is for $TagContainsAnyString(<URL>,Genre,Pop|Rock) to return T for the exact matches of Pop and Rock in the Genre tag. It also returns T for partial matches like Synthpop, Hard Rock, etc.

What I am asking for would look more like $TagContainsAnyString(<URL>,Genre,Pop|Rock,1). By entering a "1" for the parameter identifies that I only want to return T if the Genre tag is exactly Pop or exactly Rock. Everything else, including partial matches would return F. Alternately, using a "0" (default value) for the parameter would result in the existing behavior.

Reverse-compatibility would probably require the assumption of the default value whenever the parameter is totally excluded. Effectively, $TagContainsAnyString(<URL>,Genre,Pop|Rock) and $TagContainsAnyString(<URL>,Genre,Pop|Rock,0) would both work in exactly the same way that the existing function currently works.

Lastly, I recognize that there are multiple workarounds that would probably achieve the same result. The problem is that those workarounds all become pretty cumbersome if you want exact matches for more than just a few strings. The requested update would scale up much more easily.

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3840
  • MB Version: 3.6.8878 P
As per post here:
Steven or  boroda,
Code
MusicBee v3.5.8669.34304P  (Win10.0), 6 Oct 2023 18:06:

System.Runtime.InteropServices.COMException (0x800401D0): OpenClipboard Failed (Exception from HRESULT: 0x800401D0 (CLIPBRD_E_CANT_OPEN))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Windows.Clipboard.Flush()
   at System.Windows.Clipboard.CriticalSetDataObject(Object data, Boolean copy)
   at System.Windows.Clipboard.SetDataInternal(String format, Object data)
   at System.Windows.Clipboard.SetText(String text, TextDataFormat format)
   at System.Windows.Clipboard.SetText(String text)
   at MusicBeePlugin.CopyTagsToClipboardCommand.CopyTagsToClipboard(Int32 tagSet)
   at MusicBeePlugin.CopyTagsToClipboardCommand.buttonOK_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Not sure if this exception is from MusicBee api or from ATRT plugin.

My understanding is that
Code
Clipboard.SetText(data);
should be replaced by
Code
Clipboard.SetDataObject(data);
to stop this issue.

Hope I'm correct and  that helps.

This occurs when using 'Copy Tags to Clipboard'
MusicBee and my library - Making bee-utiful music together