Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Custom Title format in tagnavi_custom
« previous next »
  • Print
Pages: [1] 2

Author Topic: Custom Title format in tagnavi_custom  (Read 2920 times)

Offline chileboy

  • Member
  • *
  • Posts: 40
Custom Title format in tagnavi_custom
« on: January 12, 2011, 03:42:45 PM »
I'm loving the ability to build customized menus when browsing the database, but I'm trying to build a customized song title based on whether or not it is from an album marked as a compilation.

I like to browse in this manner:

    Genre -> Album Artist -> Album

So far so good.  The issue I'm trying to address is when the album is marked as a Compilation (where the Album Artist is usually, but not always, "Various Artists")

Instead of the song title appearing as:

    1.03  Tragedy - 05:16
 
I'd like to see

    1.03  Don Ellis - Tragedy - 05:16

I've read through the Database wiki, and I thought I could build fmt_title with multiple conditionals, and access compilation information by using the "_cmpl" which the wiki says is appended to the title - so I cooked this up:

Code: [Select]
%format "fmt_title"       "%d.%02d. %s - %02d:%02d" discnum tracknum title Lm Ls ? discnum > "0" & filename !~ "_cmpl"
%format "fmt_title"       "%02d. %s - %02d:%02d" tracknum title Lm Ls ? tracknum > "0" & filename !~ "_cmpl"
%format "fmt_title"       "%s - %02d:%02d" title Lm Ls ? filename !~ "_cmpl"
%format "fmt_title"       "%d.%02d. %s - %s - %02d:%02d" discnum tracknum artist title Lm Ls ? discnum > "0"
%format "fmt_title"       "%02d. %s - %s - %02d:%02d" tracknum artist title Lm Ls ? tracknum > "0"
%format "fmt_title"       "%s - %s - %02d:%02d" artist title Lm Ls

but it seems to flag everything as "not from a compilation".

Can I not access "_cmpl" from a %format line?

Alternatively, can I use a conditional, similar to the wps definition:

Code: [Select]
%if(compilation, =, 1) <yes | no>

I would try the latter, except I can't seem to locate in the docs anywhere how to access the compilation tag directly, or if it is even possible.

Or am I way off base here?

Many thanks.

- Mark


Logged

Offline steelman

  • Member
  • *
  • Posts: 7
Re: Custom Title format in tagnavi_custom
« Reply #1 on: January 12, 2011, 04:09:49 PM »
Please remember that you need to reboot for the changes you've made to take effect.
« Last Edit: January 12, 2011, 04:23:25 PM by steelman »
Logged

Offline chileboy

  • Member
  • *
  • Posts: 40
Re: Custom Title format in tagnavi_custom
« Reply #2 on: January 12, 2011, 04:21:22 PM »
I've tried that - even reinitialized the database (although I didn't think that would matter)...

Thanks, though.
Logged

Offline steelman

  • Member
  • *
  • Posts: 7
Re: Custom Title format in tagnavi_custom
« Reply #3 on: January 12, 2011, 04:26:12 PM »
OK. Try removing all fmt_title-s from tagnavi.config. Their order is significant and yours won't override "theirs". Their ones would be selected as matching first.
Logged

Offline chileboy

  • Member
  • *
  • Posts: 40
Re: Custom Title format in tagnavi_custom
« Reply #4 on: January 12, 2011, 08:12:43 PM »
Ok, but I followed bascule's instructions in this thread - the way I interpreted it, the default tagnavi.config isn't even processed past the "include tagnavi_custom.config" line - is that not the case?  The whole point is not having to modify the default tagnavi at all.  As bascule said, "You should never need to touch the original tagnavi.config file, as that will always get overwritten when you update a build."
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: Custom Title format in tagnavi_custom
« Reply #5 on: January 13, 2011, 05:11:24 AM »
All the include does is insert the contents of your tagnavi_custom at that point; it doesn't disregard the rest of the file. So yes, if you want to override fmt_title you need to redefine new copies of the menus such that they don't use fmt_title, but rather fmt_mycustomtitle or something instead.
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

Offline steelman

  • Member
  • *
  • Posts: 7
Re: Custom Title format in tagnavi_custom
« Reply #6 on: January 13, 2011, 06:23:49 AM »
With tagnavi_custom.config being included almost at the beginning of the tagnavi.config file it is impossible to define anything more than the custom menu and its formats. Custom formats would be appended to the existing ones with the same names and the system menus would redefine custom ones (no the ones that are below the "custom view" of course).
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: Custom Title format in tagnavi_custom
« Reply #7 on: January 13, 2011, 07:09:40 AM »
No, you can redefine the entire menu structure; the *first* root menu specification is the one that takes effect, so if you specify one in tagnavi_custom you win.
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

Offline chileboy

  • Member
  • *
  • Posts: 40
Re: Custom Title format in tagnavi_custom
« Reply #8 on: January 13, 2011, 10:33:27 AM »
Ahh!  OK,  torne, I understand what you're saying and will tinker with it - thanks very much.  I had already redefined the root menu, so no problem there.

As a matter of interest, will the %if() stuff work here?

And, btw steelman, check out the thread I referenced in my first post, I found bascule's information on using tagnavi_custom very useful.

Thanks again,

- Mark
« Last Edit: January 13, 2011, 11:17:45 AM by chileboy »
Logged

Offline steelman

  • Member
  • *
  • Posts: 7
Re: Custom Title format in tagnavi_custom
« Reply #9 on: January 13, 2011, 01:51:27 PM »
Quote from: torne on January 13, 2011, 07:09:40 AM
No, you can redefine the entire menu structure; the *first* root menu specification is the one that takes effect, so if you specify one in tagnavi_custom you win.

My bad. I missed  the `if' and `break'.
Logged

Offline chileboy

  • Member
  • *
  • Posts: 40
Re: Custom Title format in tagnavi_custom
« Reply #10 on: January 13, 2011, 10:15:32 PM »
Without going into all the details right now of all the things I have tried in experimenting with this, can anyone see why the following does not work?

Code: [Select]
%format "fmt_custom_title"       "%d.%02d. %s %s - %02d:%02d" discnum tracknum artist title Lm Ls

When I use that line, "fmt_custom_title" is empty (and using no other definitions for "fmt_custom_title").

Simply removing one %s  and "artist" works fine.

What am I missing?
Logged

Offline chileboy

  • Member
  • *
  • Posts: 40
Re: Custom Title format in tagnavi_custom
« Reply #11 on: January 15, 2011, 08:35:40 PM »
Ok, as an experiment I deleted tagnavi_custom.config.  Then I did nothing to the default tagnavi except I changed:

Code: [Select]
%format "fmt_title"       "%d.%02d. %s - %02d:%02d" discnum tracknum title Lm Ls ? discnum > "0"

to

Code: [Select]
%format "fmt_title"       "%d.%02d. %s - %s - %02d:%02d" discnum tracknum artist title Lm Ls ? discnum > "0"

and, again, I get no titles whatsoever.

From everything I have read here, that should work just fine.

And, again, what am I missing?
Logged

Offline chileboy

  • Member
  • *
  • Posts: 40
Re: Custom Title format in tagnavi_custom
« Reply #12 on: January 17, 2011, 10:36:30 PM »
Ok, I continued to experiment while hoping for some input, and I believe the issue is that a "format" line will accept a maximum of 5 modifiers.  So while

Code: [Select]
%format "fmt_custom_title"       "%d.%02d. %s - %s" discnum tracknum artist title

will work,

Code: [Select]
%format "fmt_custom_title"       "%d.%02d. %s - %s - %02d:%02d" discnum tracknum artist title Lm Ls

will not.

I know the max modifiers is 5 because I also tried removing only the last %02d and corresponding Ls, and that also worked, although obviously not useful.

Not a big deal, I don't really need to see MM:SS in the menu.

I also determined that you can't access the appended "_cmpl" in the filename on a format line, so for now I am using albumartist ~ "Various Artists" as my condition, until I can hopefully find some way to access the compilation tag.
Logged

Offline chileboy

  • Member
  • *
  • Posts: 40
Re: Custom Title format in tagnavi_custom
« Reply #13 on: January 24, 2011, 01:43:50 PM »
Reading through a lot of posts, I realized that bascule simply appends "_cmpl" to filenames that need to be flagged as "Compilation".  In my ignorance, when I read his tagnavi_custom post, I believed the system was itself internally "appending" that tag to the filename it was passing. :-[

Bascule's is a reasonable workaround, but I am curious as to why the "Compilation" tag itself does not seem to be accessible.  I searched quite a bit in the forums and wikis, and it' entirely possible I'm missing something - but is there some reason it is not a usable tag, and that it doesn't seem to be a (common) request?  Is it a non-standard tag, and therefore one of those things that "will never be supported"?
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: Custom Title format in tagnavi_custom
« Reply #14 on: January 24, 2011, 01:55:33 PM »
The database only indexes a fixed set of tags; this is unrelated to whether Rockbox can read/display any particular tag. Changing which tags are indexed requires code changes, and produces a new database index file for every tag indexed; this takes up more disk space (and more RAM if you have load to ram enabled).
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Custom Title format in tagnavi_custom
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.076 seconds with 15 queries.