INTERACT FORUM

Please login or register.

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

Author Topic: are there tags or expressions functions to test stack membership?  (Read 9607 times)

Tolga

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 438

are there tags or expressions functions to test stack membership? I want to construct an expression that tests whether all elements of a stack have the same value for a particular attribute. In particular, I wonder if there is a function that returns a stack id for a given song (I am guessing that each stack must have an internal unique id).

Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9140
Re: are there tags or expressions functions to test stack membership?
« Reply #1 on: January 22, 2010, 01:24:30 pm »

Working with audio, yes? Try the following:

[Media Type]=[audio] -[Stack Top]=-1 ~d=a

Every track listed from this string is a stack member.
All stack members will be displayed regardless of the stack's expanded/collapsed status

-marko

Tolga

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 438
Re: are there tags or expressions functions to test stack membership?
« Reply #2 on: January 24, 2010, 05:57:17 pm »

Marko,
thanks for your answer. It looks like the undocumented [Stack Top] tag is a unique number identifying a stack such that all elements of the stack have the same number and the items that don't belong to a stack have the value -1 for this tag. Now I wonder, if there is a tag that specifies that a file is the actual top of a stack? Also, I am wondering if the [Stack Top] tag is saved with the files or is it just in the database? (there are good arguments for both).
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9140
Re: are there tags or expressions functions to test stack membership?
« Reply #3 on: January 25, 2010, 01:47:25 am »

You may wish you'd never asked, but here goes....

Stack data is "Library Only" and from my understanding of stacks, it's the only safe way to be.

The stack fields are undocumented because MC uses the component fields internally to maintain the stacks database. They're really just a bunch of numbers that are meaningless to us.

There are four elements to a stack:

[Stack Top]
[Stack Files]
[Stack View]
[Stack Tag]

The first three are hidden fields, used internally by MC to maintain the stacks database. [Stack Tag] is exposed to the end user, but only as a read only field.

[Stack Top] is a seemingly randomly generated eight digit number that is given to every file in a given stack.
[Stack Files] are more eight digit numbers, one for each file in the stack, and this info is only held by the "top of stack" file.
[Stack View] determines whether the stack is expanded or collapsed.
[Stack Tag] as far as I can tell, is used purely for internal management of the Handheld Cache.

Personally, I don't use stacks for audio files except for the handheld cache, which MC just manages for me and I never worry about it. My ipod syncs are always speedy from my predominantly lossless library and I'm quite happy.

For me, the stack system in MC really comes into its own when used with my image library. The problem for me at first was that before I went wholesale with MC stacks, I wanted to be able to manage them.
I wanted to be able to see all my stacked files, grouped in their stacks, whenever I wanted to, without having to worry about whether or not the stack was expanded or collapsed

As you will know, when a stack is collapsed in MC, all but the top file are effectively removed from the main library, and then shipped back in when a stack is expanded.

Working with audio, yes? Try the following:

[Media Type]=[audio] -[Stack Top]=-1 ~d=a

Every track listed from this string is a stack member.
All stack members will be displayed regardless of the stack's expanded/collapsed status

The ~d=a part of the string I posted above tells MC to include all of its databases in the search results, which means the otherwise hidden stack member files appear in the list.

For me, this list is really pretty useless without some form of grouping. I left that part out in my post above because I only have experience with image files in this respect, and the grouping that suits you best will be determined by how and why you stack, and what it is your trying to achieve, in other words, you'll know best.

If it helps, for me and my images, I made a custom, expression based library field I called [Stack Locator] using the expression: if(isequal([stack top],-1),Not Stacked,[stack top])
I then grouped my list by this field. The eight digit numbers are meaningless to me, but in the list, all the stacks' files are shown nicely grouped together. With a few well chosen panes, stack management is a breeze.

The stack icons (particularly in thumbnail mode) help inform us of the current status of any given stack, namely, is it collapsed or expanded and which is the 'top file'.
If you want written confirmation, the following expression when used in the "Thumbnail Text" area of the customise view dialogue will show "Top Image" under the 'top of stack' file: if(isequal([stack files],),,Top Image)

One other thing anyone experimenting must be aware of...

In normal use, when a stack is collapsed, tag changes to the top file are propogated down through the stack, and when files in an expanded stack are tagged, then only the selected files are tagged.

When setting up a viewscheme as I have described, you see all the files in a stack, even though the stack may be collapsed, The above tagging rules still apply.
You can tag stack members exclusively even though the stack is in a collapsed state, but remember, even though you can see the individual files, if, as far as MC is concerned, the stack is collapsed, then any tagging on the top file will be propogated through the stack. If you don't want that, remember to expand the stack first.

Happy Stacking!!
Regards,
-marko.


EDIT:
I want to construct an expression that tests whether all elements of a stack have the same value for a particular attribute.
I kind of went off on one a bit there. If none of that helps you with this question let us know.
You could perhaps try a smartlist using [Media Type]=[audio] -[stack top]=-1 ~d=a ~dup=[Stack Top],[Particular Attribute]
Then exclude that smartlist from the view scheme mentioned here.

EDIT-ii:
Some more stack related rambling over here: http://yabb.jriver.com/interact/index.php?topic=65617.0

Tolga

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 438
Re: are there tags or expressions functions to test stack membership?
« Reply #4 on: January 25, 2010, 11:07:02 am »

Thanks for comprehensive and useful answer! You may want to consider create a wiki page out of it since it is very detailed and might help others too.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72444
  • Where did I put my teeth?
Re: are there tags or expressions functions to test stack membership?
« Reply #5 on: January 25, 2010, 11:18:25 am »

Thanks for comprehensive and useful answer! You may want to consider create a wiki page out of it since it is very detailed and might help others too.
You could create the page.  Anyone can.
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
wrong forum - please delete
« Reply #6 on: January 21, 2012, 10:18:33 am »

wrong forum - please delete
Logged
Pages: [1]   Go Up