Rockbox Technical Forums

Support and General Use => User Interface and Voice => Topic started by: jiriholz on February 28, 2012, 01:50:15 PM

Title: a problem with creating shortcuts
Post by: jiriholz on February 28, 2012, 01:50:15 PM
Hello,
I triet to create shortcut to talk the time.
Rockbox says empty
I created file shortcuts.txt with ansi code as follows

[shortcut]
type: time
data: talk
name: time
talkclip: time.talk
Title: Re: a problem with creating shortcuts
Post by: JdGordon on February 28, 2012, 06:46:23 PM
hmm, not sure. That looks correct.
shortcuts.txt is only loaded the first time you enter the menu. Does rebooting help? (also the talkclip needs the full filepath)
Title: Re: a problem with creating shortcuts
Post by: jiriholz on February 29, 2012, 03:12:37 AM
I tried it without a talkclip and it doesnot work. Restarting player doesnot help.
Title: Re: a problem with creating shortcuts
Post by: Burrhus on March 09, 2012, 02:56:23 PM
Something a bit strange, but...

I had difficult times making shortcuts.txt, inorder to set up a timer. My shortcuts wouldn't even appear in the RockBox shortcuts menu, just like you !!!

Finally I made it. The trick for me is to find a way to make a text files, with lines ending by <LF> (or chr$10, for Line Feed), instead of <CR>+<LF> (the <CR> standing for chr$13, or Carriage Return).

I mean : if in windows you open your textfile with notepad++, making all the characters visible, your textfile might show as :
[shortcut]<CR><LF>
type: time<CR><LF>
data: talk<CR><LF>
name: time<CR><LF>
talkclip: time.talk<CR><LF>


Instead, inorder to have something working, you should have something like :
[shortcut]<LF>
type: time<LF>
data: talk<LF>
name: time<LF>
talkclip: time.talk<LF>


How did I made it, in windows environment ?
1. Adding a few shortcuts lines in the shortcuts.txt, using the rockboxk interface, with <LF> only. How ? Within the RockBox environment on my Sansa Clip+, while navigating in the folders, while having highlighted a track, holding the central key to make appear the context menu, then select 'Add to shortcuts'. Repeating a few times inorder to generate a file containing as many shortcuts as needed, maybe more.

2.Using Notepad++ as text editor, I open the shortcuts.txt file, and I make all the characters in the text file visible, so I can see the <LF>. Then I change the content in the text, carefully avoiding to manipulate the <LF> items. Then I delete the unneeded part of the file.

3. Saving the file to the .rockbox directory.

It did it with your shortcut, adding it to my shortcuts menu, the shortcut now appears. It doesn't do anything, but I think this is another business :  I am now going to activate the speech on my Sansa Clip+, and retry... ;-P

Regards,
Burrhus.
Title: Re: a problem with creating shortcuts
Post by: torne on March 09, 2012, 04:13:36 PM
We should probably fix the code that reads the shortcut files to be more flexible about line endings, then. Could you report a bug for this?
Title: Re: a problem with creating shortcuts
Post by: JdGordon on March 10, 2012, 09:33:10 AM
well shortcuts doesnt d anything special, it just uses readline() and settings_parseline(), so not sure why crlf is causing problems.
Title: Re: a problem with creating shortcuts
Post by: jiriholz on March 13, 2012, 10:59:59 AM
I have created shortcuts with lf line ending successfully I would like to set a language from shortcuts. the shortcut appears, but no effect. I wrote this [shortcut]
type:setting
data:lang
/.rockbox/langs/Czech.lng
name:Czech
talkclip:/.rockbox/ozvuceni/Czech.talk

well shortcuts doesnt d anything special, it just uses readline() and settings_parseline(), so not sure why crlf is causing problems.
Title: Re: a problem with creating shortcuts
Post by: JdGordon on March 13, 2012, 06:15:30 PM
type:file
data:/.rockbox/langs/Czech.lng
name:Czech
talkclip:/.rockbox/ozvuceni/Czech.talk
Title: Re: a problem with creating shortcuts
Post by: ThisIsMikeHere on May 25, 2012, 10:49:49 AM
I just had the same problem with rockbox v3.11.2, on sansa clip+. As mentioned a reboot is required to read a changed file.

A file shortcuts.txt using LF (0x0A) works - UNIX format.
A file shortcuts.txt using CRLF (0x0D, 0x0A) fails - PC format.

I use textpad and there they use the terms UNIX/PC for the two filetypes.
Title: Re: a problem with creating shortcuts
Post by: JdGordon on July 05, 2012, 09:03:21 AM
Fixed... finally! try the next dev build