Status Bar Template: Formatting of Property Values

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Jerry
Posts: 835
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Status Bar Template: Formatting of Property Values

Post by Jerry »

Love the status bar template!
A few questions:
  • Is there any way to format a property value in the template? For example, when a video file is selected, I want to see the Total Bit Rate, but using the System.Video.TotalBitrate property gives me the number in bytes. I'd like to see it in kilobytes, or alternatively with comma separators. Is that possible or could an xyplorer #video.totalbitrate native variable be created to do that, as for audio? (Note: I actually would prefer the System.Video.bitrate property instead to exclude the audio component, but nothing comes back for that property.)
  • Omit added strings when property values not available. For videos, I have the following template pattern:

    Code: Select all

    <prop System.Video.FrameWidth> x <prop System.Video.FrameHeight> @ <prop System.Video.TotalBitrate>
    But if the selected file is not a video, the rendered text in the status bar becomes " x @ ". It would be nice if the added strings don't show up at all in that case. Perhaps if one used a special grouping character pair such as "{ }" ? Or type-specific status bar templates? Or have a #video.dimensions native variable that works like #audio.dimensions?
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB. SCREEN SCALING: 125%

admin
Site Admin
Posts: 67304
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Status Bar Template: Formatting of Property Values

Post by admin »

1) format: currently not

2) omit: use this:

Code: Select all

v22.60.0002 - 2021-12-10 14:09
    + Custom Status Bar Info / Property Variables: The recent changes 
      (v22.60.0001) still work, but there is a better alternative now. You can 
      pass an optional format template in the argument after the property 
      selector. The * is a place holder for the value (if missing the value is 
      simply appended to the template). Must be wrapped in single or double 
      quotes if a space is included:
        echo <prop #image.dimensions 'Size: * px'>; //Size: 1024 x 460 px
        echo <prop #image.dimensions "Size: * px">; //Size: 1024 x 460 px
        echo <prop #image.dimensions "Size: ">; //Size: 1024 x 460
Try this template:

Code: Select all

<prop System.Video.FrameWidth><prop System.Video.FrameHeight ' x *'><prop System.Video.TotalBitrate ' @ *'>

Jerry
Posts: 835
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Re: Status Bar Template: Formatting of Property Values

Post by Jerry »

Thanks, the optional format template fits the bill for #2.
For issue #1, any chance of adding #video.TotalBitRate and #video.BitRate native variables that would format as kbps (or perhaps as Mbps) like #audio.bitrate does? (Also #video.dimensions would be handy too, analogous to #image.dimensions.)
Last edited by Jerry on 02 May 2022 17:09, edited 1 time in total.
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB. SCREEN SCALING: 125%

admin
Site Admin
Posts: 67304
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Status Bar Template: Formatting of Property Values

Post by admin »

Just had an idea and added this. Should do:

Code: Select all

    + Custom Status Bar Info / Property Variables: Now you can add formatting directions 
      to the place holder for the value. Remember that the template must be wrapped in 
      single or double quotes if a space is included:
        echo <prop System.Video.TotalBitrate 'Bitrate: *'>;   //Bitrate: 409600     (no formatting)
        echo <prop System.Video.TotalBitrate 'Bitrate: *n'>;  //Bitrate: 409,600    (number formatting)
        echo <prop System.Video.TotalBitrate 'Bitrate: *b'>;  //Bitrate: 400.00 KB  (bytes formatting)

Jerry
Posts: 835
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Re: Status Bar Template: Formatting of Property Values

Post by Jerry »

admin wrote: ↑02 May 2022 17:07 Just had an idea and added this. Should do:

Code: Select all

    + Custom Status Bar Info / Property Variables: Now you can add formatting directions 
      to the place holder for the value. Remember that the template must be wrapped in 
      single or double quotes if a space is included:
        echo <prop System.Video.TotalBitrate 'Bitrate: *'>;   //Bitrate: 409600     (no formatting)
        echo <prop System.Video.TotalBitrate 'Bitrate: *n'>;  //Bitrate: 409,600    (number formatting)
        echo <prop System.Video.TotalBitrate 'Bitrate: *b'>;  //Bitrate: 400.00 KB  (bytes formatting)
That would do it. A way to specify kilobits vs megabits, especially for video files would be also nice, but not essential. Could you make System.Video.Bitrate return a value? That's the bit rate without the audio component.
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB. SCREEN SCALING: 125%

admin
Site Admin
Posts: 67304
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Status Bar Template: Formatting of Property Values

Post by admin »

*b chooses the best unit depending on the value.

System.Video.Bitrate is not supported by the system.

Jerry
Posts: 835
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Re: Status Bar Template: Formatting of Property Values

Post by Jerry »

admin wrote: ↑02 May 2022 17:20 System.Video.Bitrate is not supported by the system.
The property is currently being retrieved for display in the metadata popup.
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB. SCREEN SCALING: 125%

admin
Site Admin
Posts: 67304
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Status Bar Template: Formatting of Property Values

Post by admin »

What popup? Got a screenshot?

Jerry
Posts: 835
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Re: Status Bar Template: Formatting of Property Values

Post by Jerry »

admin wrote: ↑02 May 2022 17:26 What popup? Got a screenshot?
To see the attached files, you need to log into the forum.
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB. SCREEN SCALING: 125%

admin
Site Admin
Posts: 67304
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Status Bar Template: Formatting of Property Values

Post by admin »

Simply <prop Bitrate>.

admin
Site Admin
Posts: 67304
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Status Bar Template: Formatting of Property Values

Post by admin »

Added this:

Code: Select all

echo <prop System.Video.TotalBitrate 'Bitrate: *kbps'>; //Bitrate: 462kbps    (kb per sec formatting)

Jerry
Posts: 835
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Re: Status Bar Template: Formatting of Property Values

Post by Jerry »

admin wrote: ↑02 May 2022 17:45 Simply <prop Bitrate>.
Sorry, my mistake. It seems that the video-only bit rate appears in the metadata dialog as
"Data rate". What's the property name for that?
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB. SCREEN SCALING: 125%

admin
Site Admin
Posts: 67304
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Status Bar Template: Formatting of Property Values

Post by admin »

You probably have to go by index. Here it is #298: echo <prop #298>;

Jerry
Posts: 835
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Re: Status Bar Template: Formatting of Property Values

Post by Jerry »

admin wrote: ↑02 May 2022 18:15 You probably have to go by index. Here it is #298: echo <prop #298>;
Hmm, I'm not seeing the value returned with that index, and also the optional format template isn't omitting the added strings when there's no value - does that not work with indexes?

Code: Select all

<prop #298 '@ *'>
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB. SCREEN SCALING: 125%

admin
Site Admin
Posts: 67304
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Status Bar Template: Formatting of Property Values

Post by admin »

1. Add a new column, right-click the header and open the Select Property list. Search for your field and you will see the index (it will be different on your system):
2022-05-02_184207.png
2. Will work in the next beta.
To see the attached files, you need to log into the forum.

Post Reply