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:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  User Interface and Voice
| | |-+  Shortcuts Menu Oddity(?)
« previous next »
  • Print
Pages: [1]

Author Topic: Shortcuts Menu Oddity(?)  (Read 360 times)

Offline iPodVT

  • Member
  • *
  • Posts: 102
Shortcuts Menu Oddity(?)
« on: October 24, 2022, 07:35:13 PM »
I added 'Use Shortcuts Menu Instead of Quick Screen' to my Shortcuts Menu via the Settings context menu, but the length of the default name for that item in my Shortcuts Menu seemed kind of excessive.  So I edited shortcuts.txt and entered "Shortcuts Instead of Quickscreen" for the item's name (which had been blank indicating the use of a default name).  After rebooting my iPod I found that the displayed name of that menu item was truncated to "Shortcuts Instead of Quickscree", despite the fact that the entire longer default name had previously been fully displayed.  I'm wondering if this is due to a limitation in what Rockbox will recognize for a name field in shortcuts.txt?
Logged

Offline iPodVT

  • Member
  • *
  • Posts: 102
Re: Shortcuts Menu Oddity(?)
« Reply #1 on: October 24, 2022, 08:15:00 PM »
I forgot to add that this is on an MA446LL/A iPod 5.5 Gen with Rockbox version 498988d34a-221022.
Logged

Offline chris_s

  • Developer
  • Member
  • *
  • Posts: 222
Re: Shortcuts Menu Oddity(?)
« Reply #2 on: October 24, 2022, 10:17:22 PM »
Yeah, the length for the name of shortcuts appears to be purposefully capped at 31 characters currently, if you provide one yourself, whereas if you don't, it is able to display the full name of the setting.
Logged

Offline iPodVT

  • Member
  • *
  • Posts: 102
Re: Shortcuts Menu Oddity(?)
« Reply #3 on: October 24, 2022, 11:37:55 PM »
32 byte string, with the first byte specifying the length.  Is that limitation because Rockbox holds the Shortcuts Menu in memory at all times?
Logged

Offline chris_s

  • Developer
  • Member
  • *
  • Posts: 222
Re: Shortcuts Menu Oddity(?)
« Reply #4 on: October 25, 2022, 11:26:58 PM »
You may be thinking of Pascal strings instead of null-terminated C strings?

not sure what the reasoning behind the exact number may have been, except that it probably suffices in most cases. It seems to have remain unchanged since jdgordon originally implemented the menu  a decade ago. Memory usage in one way or another must have been a priority like it is almost anywhere else in Rockbox…
Logged

Offline iPodVT

  • Member
  • *
  • Posts: 102
Re: Shortcuts Menu Oddity(?)
« Reply #5 on: October 26, 2022, 12:10:20 AM »
Right - Pascal strings - a blast from the past term that I never would have remembered on my own.  I was a Mac applications programmer in the 1980s and 90s, and even though I worked in C, that era's Mac Toolbox as documented in the Inside Macintosh reference books was full of Pascal strings.

Re the Shortcuts Menu:  It's kind of ironically funny that I bumped up against a string length limit while trying to shorten Rockbox's verbose menu item name.
Logged

Offline amachronic

  • Developer
  • Member
  • *
  • Posts: 269
Re: Shortcuts Menu Oddity(?)
« Reply #6 on: October 26, 2022, 11:00:15 AM »
Increasing the name length to 64 bytes or more seems reasonable. Most targets aren't that memory constrained.
Logged

Offline iPodVT

  • Member
  • *
  • Posts: 102
Re: Shortcuts Menu Oddity(?)
« Reply #7 on: October 26, 2022, 12:10:29 PM »
Would the length have to be a power of 2?  A menu item name that is longer than 48 characters seems excessive to me, especially in the context of shortcuts, though that is just off the top of my head.
Logged

Offline amachronic

  • Developer
  • Member
  • *
  • Posts: 269
Re: Shortcuts Menu Oddity(?)
« Reply #8 on: October 26, 2022, 03:37:24 PM »
It doesn't need to be a power of two. But we're talking bytes, not characters. Non-English languages tend to have longer strings than English and use multibyte UTF-8 sequences, so it's worth having some extra wiggle room to accommodate them.
Logged

Offline iPodVT

  • Member
  • *
  • Posts: 102
Re: Shortcuts Menu Oddity(?)
« Reply #9 on: October 26, 2022, 03:46:19 PM »
Right, of course.  I was narrowly thinking only of english, and I totally forgot that some languages require multi-byte character sets.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  User Interface and Voice
| | |-+  Shortcuts Menu Oddity(?)
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.057 seconds with 17 queries.