INTERACT FORUM

Please login or register.

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

Author Topic: Expression help  (Read 1656 times)

Jonahsdad

  • Recent member
  • *
  • Posts: 36
Expression help
« on: April 23, 2012, 10:40:18 am »

In my Classical view (panes) I've got under "Composer"  about 600 of them.  Many however are minor, or only appear on compilations, and only have 1 or 2 tracks.  I would like to write an expression to display composers with lots of tracks individually, but group those with fewer than x tracks as "Other".

What do you think?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Expression help
« Reply #1 on: April 23, 2012, 11:43:42 am »

I can think of essentially two routes to take.  MC doesn't support a direct means to obtain cumulative numbers across tracks.  Expressions have short term memory - they can ask about one track at a time, and then for the next track, they loss all knowledge of what just happened.

Two methods:

1) Mark your minor composers using a new field such as [Composer-minor]; it can be just a 0 or 1 value.  Then build your expression panes, etc. to interrogate this value when presenting the data.  Of course, this field has to be manually maintained.  Your expression will ultimately look something like:

  if(Compare([Composer-minor], =, 1), [Composer], Other\[Composer])&datatype=[list]

2) Create a playlist which includes all tracks from the minor composers.  Build your pane to use a Search List, grouping minor composers into an Other grouping, or others in a Composers grouping.  Still, marking tracks/composers is manual.
Logged
The opinions I express represent my own folly.

Jonahsdad

  • Recent member
  • *
  • Posts: 36
Re: Expression help
« Reply #2 on: April 23, 2012, 12:29:02 pm »

Thanks, that works. 

A question though:  There is a field called "Number of Tracks" which cannot be edited and is empty.  What is it there for?
 
I notice also that a sort option is "Number of Files"  So some sort of calculation is going on, just not where I want it.  Thoughts?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Expression help
« Reply #3 on: April 23, 2012, 01:00:14 pm »

I was hoping you wouldn't ask those questions.  :-)

Number of Tracks is related to JRiver's Performer store, and I presumed it is related to how many tracks have been purchased/listened to via the JRiver store.

See Store Field: Number of Tracks:
 http://wiki.jriver.com/index.php/File_Properties_%28tags%29

Number of Files is an internally maintained count for use in say, a Categories view (or sorting as you've noted).  It indicates the number of files for an Album or Genre.  You can see this in action if you modify the thumbnail text in a Categorizes view and include [Track #] as part of the thumbnail text.

So, yes, there are some special case summations internally, but they are not exposed to the expression language.  I presume this is because this stuff happens at a higher level in the MC code (i.e. after all the expressions have been evaluated for the selections of tracks presented in a view).
Logged
The opinions I express represent my own folly.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: Expression help
« Reply #4 on: April 23, 2012, 01:12:32 pm »

You'll probably find sorting your [Composer] pane by [Number of Files] the most effective way to identify your 'minor' composers.
Logged

Jonahsdad

  • Recent member
  • *
  • Posts: 36
Re: Expression help
« Reply #5 on: April 23, 2012, 02:14:48 pm »

Rick, actually I had already done that. My workaround was Composer columns, one sorted by Number of Files, the other Alphabetically with grouping.  Works OK, but It had me up to 6 columns in the view and I was trying to save a little screen space.  Also, I spent about 3 hours last night trying to figure it out and I was curious if it was me or the program.

Quote
I was hoping you wouldn't ask those questions.  :-)
The easy ones are boring ;)

Logged

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: Expression help
« Reply #6 on: April 23, 2012, 03:14:09 pm »

My comment was intended as an addendum to MrC's original suggestion. That is, use such a pane to select those to be tagged with [Composer-minor]. Since new composers may be added and it's possible for the determination may change for existing composers, this is also a convenient way to periodically review which composers should be considered 'minor'. To do that, you only need to temporarily change the sort order of your [Composer] pane.
Logged

Jonahsdad

  • Recent member
  • *
  • Posts: 36
Re: Expression help
« Reply #7 on: April 23, 2012, 03:41:49 pm »

Yup, that's exactly how I did it.  Thanks!
Logged
Pages: [1]   Go Up