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: Get the average of a group in Panels UI (Read 5346 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Get the average of a group in Panels UI

hi,

is it possible, that i can get the average of something (e.g. rating, bitrate)?

what also would be nice to get the play-time of one group.


and the 3rd question: whats the command to minimize foobar in panels_ui, i tried this, but it doesnt work:

Code: [Select]
//minimize button
$button($sub(%_width%,155),0,280,110,right,top,/images\mundschuss\minimize.png,,Mini,)

Get the average of a group in Panels UI

Reply #1
3rd question: Hide

Get the average of a group in Panels UI

Reply #2
AFIK it is not possible to calculate average values in the groups. Maybe this will be a feature in the future.

Get the average of a group in Panels UI

Reply #3
An average could be calculated by adding each bitrate together using $add(), and dividing by the total number of bitrates that you are evaluating using $div() I suppose.
Not sure if there is a function that will return the total number of bit rates being examined though, based on whatever field you wish to specify the function to evaluate.

Get the average of a group in Panels UI

Reply #4
An average could be calculated by adding each bitrate together using $add(), and dividing by the total number of bitrates that you are evaluating using $div() I suppose.
Not sure if there is a function that will return the total number of bit rates being examined though, based on whatever field you wish to specify the function to evaluate.


Can you give a code example?

Get the average of a group in Panels UI

Reply #5

An average could be calculated by adding each bitrate together using $add(), and dividing by the total number of bitrates that you are evaluating using $div() I suppose.
Not sure if there is a function that will return the total number of bit rates being examined though, based on whatever field you wish to specify the function to evaluate.


Can you give a code example?


I actually think that it's possible to do this by a much easier way than above^^. I looked at the wiki and found this:

Quote
%bitrate%

Defined as $if2($info(bitrate_dynamic),$info(bitrate)). Returns the current bitrate, if available, otherwise it returns the average bitrate. If neither is available, nothing is returned.


So I think that using..

Code: [Select]
$info(bitrate)


..Should return the average bitrate. Presumably this is the average of your entire library, I'm not sure how you could return the average bitrate for a given playlist or album.

Get the average of a group in Panels UI

Reply #6
Quote
..Should return the average bitrate. Presumably this is the average of your entire library, I'm not sure how you could return the average bitrate for a given playlist or album.


Definitly not. If you insert this into the grouped section of SCPL you will get the bit rate of the first item in the group, only.

Get the average of a group in Panels UI

Reply #7
Quote

..Should return the average bitrate. Presumably this is the average of your entire library, I'm not sure how you could return the average bitrate for a given playlist or album.


Definitly not. If you insert this into the grouped section of SCPL you will get the bit rate of the first item in the group, only.


OK, did you try $info(bitrate_dynamic) as well?

If that doesn't work, then sorry I don't know anything else.

Get the average of a group in Panels UI

Reply #8
No, that's not going to work too.
All these titleformatting functions return the info of a signle track, the one for which they are executed.
The default and columns playlists don't have the "grouping" feature of Panels UI, so the required functionality would be PUI-specific.
Like, for example, some specific function that can only be executed in the Group Display.

Get the average of a group in Panels UI

Reply #9
AFAIK there is currently no possible way to reference the properties of one track while working with another. The default playlist, ColumnsUI playlist, and SCPL all work on a per track basis. Therefore taking the average of a group of tracks is not currently possible.

The SCPL group header inherits the properties of the first item in the group. So if you process $info(bitrate), $info(bitrate_dynamic), %title%, or anything else the code will resolve to the properties of the first track in the group.  If you tag your tracks with a field such as %totaltracks% then you can use %totaltracks% in the group header, which will actually pull from the first track in the group, but appear to reflect data about the entire group.  You may want to consider a similar approach using a custom tag of %albumbitrate% or something, however this will not be very practical outside of the context of an album and rely on you maintaining accurate custom tags.

You may wish to request a change in the way the SCPL pulls the data for tags in the group header, but the panelsui thread would be a more appropriate place to do so.

Get the average of a group in Panels UI

Reply #10
mhhh

is anything planed in the future to support this?

then another question.

i wanna rate albums, and not just tracks. is this possible to show this in the sort/group thing. (i hope you know what i mean, the heading of this, e.g. album).
the problem i see in it: one fily tagging for rating isnt a problem, but there you've got to tag the whole album at once with buttons (if you dont wanna have it with masstager). i think its just manualy possible, right?

Get the average of a group in Panels UI

Reply #11
You would actually only need to update the albumrating tag on the first item in the group, so if you sort your albums in track order (which is rather common) then you'd only really need to maintain an albumrating tag on track 1 instead of trying to trigger updates on multiple tracks. Also, I believe if you try to store a tag with the group header selected, the tag will be updated on the first item in the group which again works to your advantage.

I think this is probably doable by mimicking existing track rating code but replacing %rating% with %albumrating% or whatever custom tag you want to use. However I personally think this is a rather messy use of tags and you might be better off exploring foo_custominfo

EDIT: Actually I think you would need to update tags on all tracks for the sort/group by function to work as expected. However if all you want to do is display an album rating in the group header you only need to maintan the first item in the group.

 

Get the average of a group in Panels UI

Reply #12
  • As far as I know (and I've looked a lot for a way to do something like this), the only type of summation information you can derive is the total length of currently selected items
  • There is currently a feature request to add functions for calculating the sum and average value accross a group, and the developer, terrestrial, put it in the "Medium term" catagory, so we'll see 
  • To clarify on the above, there is no way to "select" the header, when you click on it, it selects all items in the group, so "selecting" the header and applying a masstagger script would apply it to every item in the group.
  • It might take a bit of time for the masstagger to go therough and change the tags of all of the items in a group, so this might be a little cumbersome

mundschuss - "i think its just manualy possible, right?"
* Not sure what you mean by this, but you can create a masstagger script to be executed with a shortcut command (ie ctrl+1 to set rating to 1, etc, you could then use ctrl+alt+1 to set album rating)