INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 4 5   Go Down

Author Topic: ZELDA v1.0 released (Expression Language editor)  (Read 33577 times)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
ZELDA v1.0 released (Expression Language editor)
« on: June 28, 2020, 08:45:34 am »



ZELDA v1.0 released

ZELDA is an Expression Language editor for MediaCenter. It's a playground to test and tweak your expressions until you get the wanted results. ZELDA displays the result of a given expression immediately as you type, so there's no need to go back and forth to MC to test the expression. This makes the development & test process much faster.

Features:
- syntax highlighting, current function/args highlighting
- continuous code evaluation (see the results immediately)
- test expressions against any file or all files in a playlist simultaneously
- multiple expression tabs
- context sensitive function syntax/help
- multiple output modes (text/rendered/playlist column)
- HTML tag support: font, b/u/i, img with full src path or "tooltip:" for thumbnails, logos, etc
- helper for Font/Img insertion, color selector
- helper for Fields and Function insertion (select from list)

Download  -  Screenshots  -  Source code

(note: only Zelda.exe is needed. You can download Zelda.ZIP instead to bypass Windows EXE download protection.





Logged

mvandyke

  • World Citizen
  • ***
  • Posts: 159
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #1 on: June 28, 2020, 11:07:08 am »

Excited to try this.  For challenged (not very good) programmers like me this will help me a lot.  Thanks for all of the hard work. Will download and see how it works.
Logged

arcspin

  • Galactic Citizen
  • ****
  • Posts: 391
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #2 on: June 28, 2020, 11:43:02 am »

WOW, Cool!

This will definitely help out a code challenged person like myself.


Great work,

//arcspin

Logged
Hardware: Intel Core i5-8600K 16GB RAM, ASUS GeForce RTX 2080 8GB DUAL OC
Software: Windows 10 Home 64-bit, version 2004, JRiver MC 29, MadVr 0.92.17 (Beta 113), NVIDIA driver 457.09
Projector: JVC DLA-I X5500 (RS420, X570R) -
Screen: DNP Supernova 08-85
Processor: Anthem AVM 70
Power amp: XTZ A2-400 for Front & Center - XTZ A2-300 for Surround & Height channels
Speakers: Arendal 1723 S Monitor for Front & Center, Linn Unik for Front Height, Rear Height, Surround & Surround back. Elipson Planet M for Top Middle.
Sub: Arendal 1723 1S

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72442
  • Where did I put my teeth?
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #3 on: June 28, 2020, 11:48:37 am »

Well done.  Thank you.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #4 on: June 28, 2020, 12:01:36 pm »

Interesting.

Below is the image section for directories of my 'one expression to rename them all' expression that Zelda is not interpreting correctly, more often than not, returning only "Pictures\\". Granted, it's very old, last updated around 2012 I think, and should probably be checked for optimisation, but it works fine inside MC so there's nothing pushing me to do that right now :)
Code: [Select]
If(isequal([media type],image,1),
ifelse(
isequal([type],Clipart,1),\Pictures\[type]\removeleft([keywords],9)\,
isequal([type],Girls,1),\Pictures\[type]\[population]\,
!isequal([type],unknown type,1),Pictures\[type]\if(isequal([genre],unknown genre,1),,[genre]),
!isempty([Occasion,0]),Pictures\!Occasions\[Occasion]\[filenamedate],
isequal([keywords,0],day tripping,8),Pictures\!Day Tripping\[Location]\[filenamedate],
!isequal([Album,0],//,8),Pictures\!Picture Albums\[Album],
isequal([source],Scanner,8),Pictures\!Photographer\[artist]\![source]\[filenamedate],
isequal([source],Flickr,8),Pictures\if(isempty([artist,0]),!Source\[source],!Photographer\[artist]\![source])\[filenamedate],
isequal([source],Facebook,8),Pictures\if(isempty([artist,0]),!Source\[source],!Photographer\[artist]\![source])\[filenamedate],
isequal([source],Internet Downloads,1),if(isempty([artist,0]),Pictures\!Source\[source]\[filenamedate],Pictures\!Source\[source]\![artist]\[filenamedate]),
isequal([source],Mark Wilkinson,8),Pictures\!Photographer\[artist]\[camera]\[filenamedate],
!isequal([source],Mark Wilkinson,8),Pictures\!Photographer\[artist]\[filenamedate]),)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #5 on: June 28, 2020, 12:14:06 pm »

Thanks for testing it Marko.
Note that Zelda is not evaluating the expression, it's just giving it off to MC and showing the evaluation result. It does do some massaging of the output but only for the "Rendered" tab (converting font/img/other tags to proper HTML).

Are you saying it doesn't show correctly on the Rendered tab, or that the Text output only shows "Pictures\\" ? If it's the second case, then... that's just what MC is calculating that expression to.

Can you tell me what is the expected output? I don't have pictures in my collection to test this :/
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #6 on: June 28, 2020, 12:27:52 pm »

Ok, I can see what the expression is supposed to return.
One case where I can see it returning just "Pictures\\" is if you're testing it on a File with blank [type] and [genre]="unknown genre" - in this case, line 5 would correctly return "Pictures\\".

You can select a different file to test, or check the "playlist" tab to see the output of the expression against each file of the playlist.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #7 on: June 28, 2020, 12:51:03 pm »

Yeah, of course. In the rename tool, the evaluator inserts "unknown field" for blanks to avoid empty directories being created and my expression utilises this to arrive at the desired result.

I was forgetting this, just looking for a crazy complex expression to try out on Zelda.

Zelda's first impressions are pretty cool by the way. Users will find links to the wiki very useful. The wiki should hopefully be fully up to date in the next couple of weeks, time permitting.

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #8 on: June 28, 2020, 07:12:50 pm »

Bravo!
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #9 on: June 28, 2020, 07:17:38 pm »

fantastic work Zybex.  thanks for the efforts!
Logged

ssands

  • Galactic Citizen
  • ****
  • Posts: 457
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #10 on: June 29, 2020, 02:45:59 pm »

Wow! Thanks so much for doing this!
Excited to try it out.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #11 on: June 29, 2020, 03:37:37 pm »

Thanks guys, glad you like it.
Please provide some feedback/reports after using it :)
Logged

MagerClab

  • Recent member
  • *
  • Posts: 37
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #12 on: June 29, 2020, 04:43:09 pm »

Very good. Thank you! :)
Logged

Moe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 718
  • Hi
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #13 on: June 29, 2020, 05:45:18 pm »

I've been stuck on "Connecting to JRiver... - Reading Playlists" for about five minutes now.


EDIT: Let it run for 25 minutes.  Never go past the msg above. 
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #14 on: June 30, 2020, 02:30:42 am »

Hi Moe,
That should take just a few seconds max. It's almost the exact same code as in ZRatings, which I think you use. Does the progress bar stop scrolling or never stops?
Try starting MC before Zelda. Ler me know if it still doesn't work, I'll get you a debug version with more logging.

EDIT:
I remembered you also had the same problem with ZRatings and I added a "fast start" option because of that. I now did the same change on Zelda and sent you a debug build via PM. Let me know if that fixes it.
Logged

Moe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 718
  • Hi
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #15 on: June 30, 2020, 03:25:21 pm »

Logging found the culprit.  It was the built in playlist "Audio -- Task -- Missing files" that was causing the problems.  I deleted that playlist and it booted right up.  Thanks for the quick update.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #16 on: June 30, 2020, 03:58:15 pm »

Great :)
Then I'll keep the normal startup sequence that gets the file count for each playlist, and just skip that playlist if it exists.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10938
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #17 on: June 30, 2020, 04:43:20 pm »

Users could have other pretty slow playlists. I deleted all the built-in ones in my library and then at some point re-made a missing file playlist.
If you can look at the expression that make up a smartlist, you could skip those with IsMissing() in them or such, thats the only expression thats truely going to be incredibly slow over a large library - that I currently remember, anyway.
Logged
~ nevcairiel
~ Author of LAV Filters

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #18 on: June 30, 2020, 05:06:07 pm »

The COM API doesn't give me the field expression, just the name. I'll have to switch to MWCS at some point, but there are some missing stuff there compared to the COM API, so that would need to be checked first.

But actually, I think IsMissing() should be fixed, it's almost unusable as it is. Other network access internals in MC also sometimes cause it to hang for 30 seconds when clicking on something, just because the NAS happens to be offline.

Possible improvements:
- MC could cache network access results - 1 or 2 timeouts could add the hostname to a blacklist for some time - a background thread could then periodically re-rest the blacklist elements to clean it up when they come back online
- IsMissing() could timeout in 500ms instead of waiting for the Windows call to return
- Playlists with IsMissing() could return a cached set instead of trying to re-check the availability on each access

Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10938
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #19 on: June 30, 2020, 05:20:58 pm »

IsMissing() is not only slow when a drive is down, it needs to hit the file system for every single file if it exists. That is just a slow operation for thousands of files.

I would generally suggest to avoid blindly loading every single smartlist without a user request.
Logged
~ nevcairiel
~ Author of LAV Filters

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #20 on: June 30, 2020, 05:49:33 pm »

I'm simply asking how many files each playlist has to display on the list drop-down. It's nice to have, but not critical. However, asking this for a given playlist should not lead to a 30 minute API freeze.

These playlists for missing files, by definition, only contain files that are inaccessible. For local c: files that is not a problem, it takes 1 second to do 1000 file checks on an SSD. But for a missing LAN share, windows times out after 20 or 30 seconds for EACH call. That is why Moe sees it freezing for 30 minutes.

You can do a simple test on MC. Add a network file, disconnect the file server, and then just click on the file... MC UI freezes for some time. That is not nice.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #21 on: June 30, 2020, 05:59:55 pm »

Many threads about the issue:
https://yabb.jriver.com/interact/index.php/topic,122262.msg846083.html#msg846083

I'm under the impression that this was actually fixed recently and the UI is no longer freezing, but I'm not sure (on my mobile now, can't test). But it'll still a problem on the API.
Logged

jherbert

  • World Citizen
  • ***
  • Posts: 120
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #22 on: July 02, 2020, 12:46:06 pm »

I am also stuck at "reading playlists".
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #23 on: July 02, 2020, 01:44:31 pm »

Hi JHerbert,
Please get v1.0.1 v1.0.2 which adds a timeout on reading playlists:
https://github.com/zybexXL/Zelda/releases/tag/1.0.2

It will try to read each playlist and automatically skip the bad/slow ones. You can check the logfile to see which playlists were skipped - log is at %temp%\zelda folder. Each bad playlist adds just 1 second to the total startup time.

v1.0.2: I added an indicator on the playlist dropdown showing when the playlist timed out - check screenshot below.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #24 on: July 02, 2020, 02:04:08 pm »

For existing users - note that Zelda has auto-update function. You'll get a red status message saying there's a new version available, just click it to upgrade.
Logged

jherbert

  • World Citizen
  • ***
  • Posts: 120
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #25 on: July 07, 2020, 02:46:47 am »

Forgot to mention that I receive the following error upon startup (long version):

When I click continue the app starts just fine.

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


Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei Zelda.ZeldaUI.resizeGridColumns()
   bei Zelda.ZeldaUI.LoadState()
   bei Zelda.ZeldaUI.ZeldaUI_Load(Object sender, EventArgs e)
   bei System.Windows.Forms.Form.OnLoad(EventArgs e)
   bei System.Windows.Forms.Form.OnCreateControl()
   bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   bei System.Windows.Forms.Control.CreateControl()
   bei System.Windows.Forms.Control.WmShowWindow(Message& m)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   bei System.Windows.Forms.Form.WmShowWindow(Message& m)
   bei System.Windows.Forms.Form.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Geladene Assemblys **************
mscorlib
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4180.0 built by: NET48REL1LAST_B.
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll.
----------------------------------------
_Zelda
    Assembly-Version: 1.0.0.0.
    Win32-Version: 1.0.0.0.
    CodeBase: file:///C:/Users/Joachim%20Herbert/Desktop/Zelda%201.0.2.exe.
----------------------------------------
System.Windows.Forms
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.
----------------------------------------
System
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll.
----------------------------------------
System.Drawing
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
----------------------------------------
System.Data
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll.
----------------------------------------
System.Core
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4180.0 built by: NET48REL1LAST_B.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll.
----------------------------------------
System.Configuration
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll.
----------------------------------------
System.Xml
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll.
----------------------------------------
mscorlib.resources
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_de_b77a5c561934e089/mscorlib.resources.dll.
----------------------------------------
System.Windows.Forms.resources
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.
----------------------------------------
System.Runtime.Serialization
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4180.0 built by: NET48REL1LAST_B.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll.
----------------------------------------
SMDiagnostics
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4180.0 built by: NET48REL1LAST_B.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/SMDiagnostics/v4.0_4.0.0.0__b77a5c561934e089/SMDiagnostics.dll.
----------------------------------------
System.ServiceModel.Internals
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4180.0 built by: NET48REL1LAST_B.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ServiceModel.Internals/v4.0_4.0.0.0__31bf3856ad364e35/System.ServiceModel.Internals.dll.
----------------------------------------
System.RunTime.Serialization.resources
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization.resources/v4.0_4.0.0.0_de_b77a5c561934e089/System.Runtime.Serialization.resources.dll.
----------------------------------------

************** JIT-Debuggen **************
Um das JIT-Debuggen (Just-In-Time) zu aktivieren, muss in der
Konfigurationsdatei der Anwendung oder des Computers
(machine.config) der jitDebugging-Wert im Abschnitt system.windows.forms festgelegt werden.
Die Anwendung muss mit aktiviertem Debuggen kompiliert werden.

Zum Beispiel:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Wenn das JIT-Debuggen aktiviert ist, werden alle nicht behandelten
Ausnahmen an den JIT-Debugger gesendet, der auf dem
Computer registriert ist, und nicht in diesem Dialogfeld behandelt.


Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #26 on: July 07, 2020, 05:33:32 am »

Thanks for reporting JHerbert, fixed in v1.0.4.
Logged

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #27 on: July 08, 2020, 01:20:24 pm »

Awesome work. The only way it could be any better is if it were somehow directly built into MC. I haven't done any real work with it yet but as I was poking around everytime I thought "This is pretty nice, but I wish it did <this other thing>" followed shortly by "Oh! It DOES do <this other thing>!" Very well done.
Logged

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #28 on: July 08, 2020, 01:29:18 pm »

And just as I finish saying that I do find something that I, at least, would find useful.

Since I was previously using either VS Code or Notepad++ with the syntax highlighter to edit my expressions, I began saving them all as text files in a git repo. I used the ".jexp" extension to give Notepad++ something to key off of to know which syntax to use. I found it useful for times when I accidentally broke something and needed to revert an old commit, and it was easier than constant copy/pasting back and forth. If I needed to edit an expression I would just open it from the repo, make my edit, then do one copy/paste into MC. I might have to do that a few times if the expression wasn't correct. So anyway, would it be possible that Zelda could allow for saving/opening expressions that are saved as text files? Or open an entire directory and allow browsing for them in a tree, like you can with editors like VS Code, Sublime, etc? And then maybe a copy button to allow easy copy/paste into MC? If it did that I could easily browse for the expression I need, edit it, see the results immediately, all from within Zelda, and then only do a final copy/paste once I'm done.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #29 on: July 08, 2020, 01:47:50 pm »

Hi Doof, thanks for the feedback :)

Those are good ideas - I initially had a couple of buttons for file load/save, but then I decided to just save the session state (list of tabs and their content) and thought that load/saving was redundant. But you have a point with GIT, it still makes sense to have it. I'll add this to the TODO, along with an optional file extension association (.jexp, you named it).

Button to copy the tab content - you just need to do CTRL-A/CTRL-C, but a toolbar button is easy to add. What I'd like to do, however, is load an expression from a given field (like "tooltip") into a tab, edit it, and then save it back to the field directly. Unfortunately the API doesn't allow me to do that yet, but Matt said he'll add the missing functionality eventually.
Logged

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #30 on: July 08, 2020, 02:07:12 pm »

If they do add the ability to load/save expressions directly from MC, that would be awesome and would definitely remove the necessary copy/paste. The only downside would be losing the versioning, but given how easy Zelda makes it to edit your expressions and confirm they work as expected, versioning may not be as important as it was before. I also didn't realize Zelda would save state like that, so that's cool. Between that and the hoped-for future ability to save directly, the git repo probably wouldn't be necessary anymore, although I was thinking it might be a useful way to share expressions with the community.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #31 on: July 08, 2020, 02:46:39 pm »

MC has 2 APIs:
- COM API: this has the GetFilledTemplate() function to evaluate an expression, but cannot read/write field expressions, just their already-calculated content.
- MCWS: this has functions to read/write the field expressions, but is missing the evaluate functionality.

I'm using the COM API, which has apparently been declared a dead end. Matt said he'll add the "evaluate" API to MCWS... after that's available I can switch Zelda to it.
Logged

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #32 on: July 08, 2020, 03:27:17 pm »

I'm using the COM API, which has apparently been declared a dead end.

Been a while since I did any MC plugin dev or kept up with the current state of things. What does this mean for third party plugins? Can they use MWCS? Is the COM API going away or is it just in an "as-is" state from here on? I briefly toyed with the idea of dusting off my old LyricsEditor/Captionator plugins to get them working properly again, so I'm curious if it would be a lost cause.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #33 on: July 08, 2020, 03:52:21 pm »

I believe it's just frozen, but will remain available. The MCWS Rest API is just more flexible and easier to expand. I suppose in-app plugins can also use it, but I don't know.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #34 on: August 01, 2020, 12:04:47 pm »

You know how there are some places in MC that will only accept an expression in a single line?

But, (bad grammar, I know) when constructing, it's often easier to write them with carriage returns and tabs...

Could Zelda have a button that would make a long and complex, multi-line expression a single line in one click, maybe, putting that into a new tab so as to preserve the multi-line work?

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #35 on: August 01, 2020, 11:56:38 pm »

Could Zelda have a button that would make a long and complex, multi-line expression a single line in one click, maybe, putting that into a new tab so as to preserve the multi-line work?

Could even just copy that version of the expression to the clipboard without opening the extra tab if the only use for it is to paste back into MC.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #36 on: August 02, 2020, 01:39:32 am »

Sure. I'll add that after coming back from vacation, in 10 days or so.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #37 on: August 02, 2020, 01:50:26 am »

Thank you, enjoy your vacation, as much as you can in these scary times.

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #38 on: August 12, 2020, 03:59:38 pm »

ZELDA v1.0.6 published:
- Add context menu option "Copy as Single Line - Strip CRLF" (CTRL+SHIFT+C)
- Add context menu option "Copy as Single Line - Preserve CRLF" (CTRL+ALT+C)

Right-click on the expression to get the context menu. Both options copy the entire expression to Clipboard as a single line of text.

The first option just concatenates all lines into a single line by removing the newline chars (CR/LF).

The second option replaces CR/LF chars with "char(10)" which causes a newline to be printed when the expression is executed. This allows you to build expressions which output multiple lines of text, but can still be concatenated into a single-line expression. This option also takes into consideration the whitespace rules of the Expression Language (newlines after commas are ignored by the language).
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #39 on: September 07, 2020, 04:26:19 am »

ZELDA v1.0.7 published:
- Update function Wiki with new functions and Wiki links
Logged

mvandyke

  • World Citizen
  • ***
  • Posts: 159
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #40 on: September 11, 2020, 11:18:37 am »

I'm just starting to work on this and having some minor challenges.  My text rendered output does not match up with my actual output.  Rendered is a very dark background and actual is  a light back ground.  See attached files

Any thoughts on how to get to a light background?  All the other font colors are correct.

Thanks

Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #41 on: September 11, 2020, 12:57:53 pm »

Code: [Select]
If(IsEqual([Media Type],Audio,1),
If(!IsEmpty([AMG Track Pick]),<img src="tooltip:web-amg-track-pick-top" width="50" valign="bottom">,)
,)
Throws unhandled exception for me. Seems that colon causes the havoc...
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #42 on: September 11, 2020, 04:08:23 pm »

Any thoughts on how to get to a light background?  All the other font colors are correct.

The background color is fixed (to match my current Theme, sorry). There are options in Settings to change the colors, but they're disabled for now.
I'll enable changing background color this weekend.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #43 on: September 11, 2020, 04:15:13 pm »

Throws unhandled exception for me. Seems that colon causes the havoc...

Lepa, the exception is because Zelda is failing to get MC's install folder due to missing registry keys (so it can't translate the "tooltip:" to a path).
I've also had some problems after upgrading to 27 - reinstalling the latest 27 fixed those issues.

Before you do that, can you please let me know:
- which MC version you have, and is it 32 or 64bit
- is there a key called "Install Directory" under this Registry key: (I assume this is missing for you)
HKEY_CURRENT_USER\Software\JRiver\Media Center 27\Installer

Thanks!

@MC team: after upgrading to 27 and uninstalling 26 the "HKCR\MediaJukebox Application" key was missing for me, even though I selected the option to preserve registry settings during uninstall. It looks like the App is unregistered anyway.
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #44 on: September 11, 2020, 04:48:10 pm »

Lepa, the exception is because Zelda is failing to get MC's install folder due to missing registry keys (so it can't translate the "tooltip:" to a path).
I've also had some problems after upgrading to 27 - reinstalling the latest 27 fixed those issues.

Before you do that, can you please let me know:
- which MC version you have, and is it 32 or 64bit
- is there a key called "Install Directory" under this Registry key: (I assume this is missing for you)
HKEY_CURRENT_USER\Software\JRiver\Media Center 27\Installer

Thanks!

@MC team: after upgrading to 27 and uninstalling 26 the "HKCR\MediaJukebox Application" key was missing for me, even though I selected the option to preserve registry settings during uninstall. It looks like the App is unregistered anyway.
27.0.12 64bit and I have the key "Install Directory" under the
Code: [Select]
Computer\HKEY_CURRENT_USER\SOFTWARE\JRiver\Media Center 27\InstallerI still have MC26 installed (not running). Zelda is connected to MC27
Logged

mvandyke

  • World Citizen
  • ***
  • Posts: 159
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #45 on: September 11, 2020, 05:09:12 pm »

The background color is fixed (to match my current Theme, sorry). There are options in Settings to change the colors, but they're disabled for now.
I'll enable changing background color this weekend.

Thank you much.  Have a great weekend.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #46 on: September 11, 2020, 07:51:15 pm »

Computer\HKEY_CURRENT_USER\SOFTWARE\JRiver\Media Center 27\Installer

Interesting - the forum seems to convert "J.  River" (with 1 space) to "JRiver" :)
I had to enter 2 spaces now to prevent it from happening.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #47 on: September 11, 2020, 08:16:09 pm »

ZELDA v1.1 published - just click the "new version available" notice to auto-upgrade.

- Color/font customization of editor and output panels
- Improve detection of MC27 install folder
- Update function wiki
- fix exception when MC folder detection fails
- other bug fixes

Lepa, please let me know if you still see the same issue.
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #48 on: September 12, 2020, 02:43:08 am »

MS Defender removes new ZELDA as a trojan
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: ZELDA v1.0 released (Expression Language editor)
« Reply #49 on: September 12, 2020, 03:35:26 am »

Crap. I tried it on a couple of PCs with Defender and I don't get any alert. Chrome warns when downloading it that "it's not commonly downloaded and may be dangerous", but if you choose "Keep the file" it works, and Defender doesn't complain for me.

Here's the VirusTotal scan of the file - Microsoft says it's OK, only gets flagged by some obscure anti-malware:
https://www.virustotal.com/gui/file/ce330bd52c2a9d4f0c9afde93a6705f70dd457253d540d834bd68804ddf5dc3a/detection

Not sure what I can do here. I don't want to tell you to whitelist it, you're not supposed to trust strangers. However, the source code is published, can be reviewed, and you can compile from source if you're so inclined.

<rant>Heuristics sucks. This is an app that doesn't write anything to the Registry, doesn't drop any other files anywhere on the system except for itself and a JSON file in the %appdata% folder. Doesn't hook any system handlers. But sure, it's suspicious... then you have some malware out there that starts encrypting each and every file on your system (ransomware), and it gets to do so without the AV stopping it after a few files. sigh.</rant>

edit: Here's the code changes since last version. Must have been the latin Lorem Ipsum ::)
Logged
Pages: [1] 2 3 4 5   Go Up