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
| |-+  Plugins/Viewers
| | |-+  sncviewer plugin
« previous next »
  • Print
Pages: 1 2 3 [4] 5 6 ... 13

Author Topic: sncviewer plugin  (Read 114214 times)

Offline Janco

  • Member
  • *
  • Posts: 10
Re: new plugin: sncviewer
« Reply #45 on: January 30, 2006, 04:22:34 PM »
Great plugin!

However, it would be even nicer if it wouldn't be a plugin but part of the wps screen.

I could then define a lyrics line (or a couple of them) in the wps definition (new tag type). In case a lyrics file is present, it would show the current lyrics at the defined line(s). In case it's absent, it would show some other useful (or useless) information (also defined by a tag, like next song title, or, who knows, album art bitmap).

This would give us more flexibility: we wouldn't need to start a plugin all the time, and and we wouldn't have to remember for which songs we do and for which songs we don't have lyrics on our player.
Logged

Offline omedina

  • Member
  • *
  • Posts: 27
  • JA JA JA
Re: new plugin: sncviewer
« Reply #46 on: January 30, 2006, 05:29:32 PM »
Can you give detailed indtructions on how to make it work? Please. I do not know how to program so please be as specific as you can.  THANK YOU for your time and effort
Logged
My mother taught me about OSMOSIS.
"Shut your mouth and eat your supper!"

Offline Janco

  • Member
  • *
  • Posts: 10
Re: new plugin: sncviewer
« Reply #47 on: January 30, 2006, 06:13:50 PM »
Well, in fact it was a suggestion for the programmer of the plugin to improve things (at least for me). Without programming this definitely doesn't work. Some fairly profound C knowledge is indispensible. Sorry!
Logged

(:@)

  • Guest
Re: new plugin: sncviewer
« Reply #48 on: February 06, 2006, 07:59:40 AM »
the plugin is updated.
i think this is the final version...
Logged

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: new plugin: sncviewer
« Reply #49 on: February 06, 2006, 09:57:16 AM »
Quote from: (:@) on February 06, 2006, 07:59:40 AM
the plugin is updated.
i think this is the final version...

Thank you very much. I was just thinking how good it would be to have basic edit facilities, for example when your lyrics file doesn't contain repeated chorus lines. On a related issue: Can you suggest a way to insert blank lines (e.g. for guitar solos)? Maybe if neither are nor b are set, play-hold could insert an empty line? That would make it even better.

A pity to hear that you think it is the final version. This thread is currently the main reason I keep checking the forums. ;)

I must admit I have been hacking away on your program a little to change it to my liking. For example I have written a new read_line function that wraps according to the screen width taking into account the width of the characters. I also convert non-utf8 files on the fly to utf-8 using the function iso_convert from the plugin api, so I don't have to mess with my lyrics files. And some other small things. If you want I can supply a patch, but it is all a little hackish.

Anyway. Thanks again. A very nice contribution to Rockbox.

Roolku

Logged

(:@)

  • Guest
Re: new plugin: sncviewer
« Reply #50 on: February 07, 2006, 03:12:40 AM »
Quote from: roolku on February 06, 2006, 09:57:16 AM
On a related issue: Can you suggest a way to insert blank lines (e.g. for guitar solos)? Maybe if neither are nor b are set, play-hold could insert an empty line? That would make it even better.
if you want to insert a blank line you have to set 'a' to a blank line and then copy it. if you don't have any blank lines then you can set 'a' to the first line (<Timetag Editor>) and copy it. I know it's not very handy.

Quote from: roolku on February 06, 2006, 09:57:16 AM
I must admit I have been hacking away on your program a little to change it to my liking. For example I have written a new read_line function that wraps according to the screen width taking into account the width of the characters.
I also thought about that. But I didn't implement it, because I thought it will delay the init process without much benefit.

Can you post your version?

« Last Edit: February 07, 2006, 03:19:12 AM by (:@) »
Logged

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: new plugin: sncviewer
« Reply #51 on: February 07, 2006, 03:43:38 PM »
Okay, I finally had time to play with this version and incorporate my changes. What can I say. It is so much fun to sync & display lyrics now. Don't know how I could have done without it. ;)

Just a few comments:

I think a short readme would be very beneficial to discover all the features. Some of them I only discovered reading the code - which probably not every user will do.

Why did you take out the light-switch? Very handy when you want to sync a few lyrics before going to sleep. :)

I removed all the splashes, as I didn't like how they obscure the lyrics.

Quote from: (:@) on February 07, 2006, 03:12:40 AM
if you want to insert a blank line you have to set 'a' to a blank line and then copy it. if you don't have any blank lines then you can set 'a' to the first line (<Timetag Editor>) and copy it. I know it's not very handy.

Yes, I figured that out. It is good enough for me. There are gowever a few quirks:

- you can't copy past the last line which is annoying when the last chorus is missing. The workaround is to copy it just before the last line and then copy the last line infront of that block and delete the old version.
- but! if you work from a saved snc file, the last line seems to include the ************** ?
- you can't mark a block that includes the last line
- saveing an anfinished snc file will put all the unsynced lines into the last block.

Quote
Quote from: roolku on February 06, 2006, 09:57:16 AM
I must admit I have been hacking away on your program a little to change it to my liking. For example I have written a new read_line function that wraps according to the screen width taking into account the width of the characters.
I also thought about that. But I didn't implement it, because I thought it will delay the init process without much benefit.

Yes, I can understand. But in German we have some horribly long words so it wraps very often. I would like to fit as much on a line as I can. Also your method would occasionally result in lines that are too long. I don't think my method is very efficient nor flexible. I guess the best way would be to read the whole file in as one block (probably into the pluginbuffer). Then parse it once and store the time, a pointer to the start of the text and a pointer to the end of the text in the sncs structure. Now when a line is displayed, it will get wrapped to the required width (full width/with time/for remote). As the icing of the cake this wrapping (i.e. pointers to the break points) could be stored/cached in the sncs structure for faster re-display. Editing become now pure pointer manipulation (many pointer can point   to the same string.) For saving the text lines don't need to be re-assambled from the row array etc. Does this make sense? I am just not sure if it is worth the effort.

Quote
Can you post your version?

Sure. I have also attached a patch file against your latest version, so you can easily spot my changes. Most of them are not very elegant solutions, just quick hacks to make it work the way I want it. You'll probably hate it. ;)

Anyway. Maybe it gives you some ideas.

Thanks a lot for sharing this with us.

[attachment deleted by admin, too old]
Logged

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: new plugin: sncviewer
« Reply #52 on: February 08, 2006, 12:07:58 PM »
Quote from: roolku on February 07, 2006, 03:43:38 PM
- if you work from a saved snc file, the last line seems to include the ************** ?
- saveing an a finished snc file will put all the unsynced lines into the last block.

Ah, I think this is something I broke with my changes.....

Maybe a unified load_xxxfile is on order that can read txt, snc and lrc files... Hopefully I have some time over the weekend.
Logged

(:@)

  • Guest
Re: new plugin: sncviewer
« Reply #53 on: February 09, 2006, 03:22:53 AM »
Quote
- Why did you take out the light-switch?
I already implemented it outside the plugin. I don't need it twice.
Quote
- you can't mark a block that includes the last line
??? (it's possible for me)
Quote
- saveing an anfinished snc file will put all the unsynced lines into the last block.
yes, that's why I have to distinguish between txt and snc files.
txt: every line is a block
snc: one block has max. 7 lines (it starts from a timetag to another or until the end of the file)

as long as the the tagging is not finished the lyrics file should have the extension txt. I saw that you modified the saving function, so that the player saves the changes to a snc-file and your txt-file will still remain on your player. In my version the txt file will be overwritten every time the saving function is called and if every block has a tag the file will automatically renamed to snc. so it's not possible to have an unfinished snc file.
Quote
I guess the best way would be to read the whole file in as one block (probably into the pluginbuffer). Then parse it once and store the time, a pointer to the start of the text and a pointer to the end of the text in the sncs structure. Now when a line is displayed, it will get wrapped to the required width (full width/with time/for remote). As the icing of the cake this wrapping (i.e. pointers to the break points) could be stored/cached in the sncs structure for faster re-display. Editing become now pure pointer manipulation (many pointer can point   to the same string.) For saving the text lines don't need to be re-assambled from the row array etc. Does this make sense? I am just not sure if it is worth the effort.
sounds great, but the only drawback I see is, you have to copy the parts everytime before displaying them, due to the missing terminating zeros.
Logged

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: new plugin: sncviewer
« Reply #54 on: February 09, 2006, 05:25:31 AM »
Quote from: (:@) on February 09, 2006, 03:22:53 AM
Quote
- Why did you take out the light-switch?
I already implemented it outside the plugin. I don't need it twice.

Fair enough. Maybe I should do this as well.

Quote
Quote
- you can't mark a block that includes the last line
??? (it's possible for me)

I just tried again with your original version. The line that you mark with the b marker is not included in the block for copying/deleting. And since you can't move behind the last line there is no way to include the last line in the a-b block. You can copy/delete the last line by itself by just using the a marker, but not as part of a block.

Quote
Quote
- saveing an anfinished snc file will put all the unsynced lines into the last block.
yes, that's why I have to distinguish between txt and snc files.
txt: every line is a block
snc: one block has max. 7 lines (it starts from a timetag to another or until the end of the file)

as long as the the tagging is not finished the lyrics file should have the extension txt. I saw that you modified the saving function, so that the player saves the changes to a snc-file and your txt-file will still remain on your player. In my version the txt file will be overwritten every time the saving function is called and if every block has a tag the file will automatically renamed to snc. so it's not possible to have an unfinished snc file.

Okay I didn't understand this. Better change it back to your version then.

Cheers

EDIT:

I  found another small glitch. If the first line doesn't start at: 0:00, it will normally sit in the waiting position until its time comes. However, if you press a key (e.g. volume) it will display in the active position prematurely.
« Last Edit: February 10, 2006, 03:48:50 AM by roolku »
Logged

Offline carmenm

  • Member
  • *
  • Posts: 50
Re: new plugin: sncviewer
« Reply #55 on: February 12, 2006, 02:53:53 PM »
Would it be possible for this plugin to be able to read lrc and lrc8 files??? there is no big difference between snc files and lrc files.
Logged

(:@)

  • Guest
Re: new plugin: sncviewer
« Reply #56 on: February 13, 2006, 05:06:58 AM »
new update
contains only bugfixes (thanks to roolku)

Quote
I  found another small glitch. If the first line doesn't start at: 0:00, it will normally sit in the waiting position until its time comes. However, if you press a key (e.g. volume) it will display in the active position prematurely.
fixed

Quote from: carmenm on February 12, 2006, 02:53:53 PM
Would it be possible for this plugin to be able to read lrc and lrc8 files??? there is no big difference between snc files and lrc files.

no, I won't implement lrc support. maybe someone else have the time to do it.
« Last Edit: February 14, 2006, 02:45:23 AM by (:@) »
Logged

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: new plugin: sncviewer
« Reply #57 on: February 17, 2006, 08:43:31 AM »
I thought I would share my modifications to this wonderful plugin. Basically I have tailored the editing mode to my preference and now syncing lyrics is a breeze. :)

If no a-b markers are set the keys are as follows:

play - insert empty line at current position
stop - delete current line
rec - merge current with next line (useful if next line contains just a single word)
up/down - scrolls through lyrics
select - set time stamp for current line
right - seek music to current position
left - leave edit mode

hold-rec - save lyrics file
hold-select - time shift lyrics
hold-stop - quit

When A marker is set it becomes

play - insert marked line at curren position
stop - delete marked line

And when A&B marker are set it becomes

play - insert marked block at curren position
stop - delete marked block
hold-select - time shift lyrics marked block

Maybe it is useful to someone else...

[attachment deleted by admin, too old]
Logged

Offline loveclaire

  • Member
  • *
  • Posts: 1
Re: new plugin: sncviewer
« Reply #58 on: February 18, 2006, 02:08:46 AM »
- "buffer has not enough rows" -> to increase the buffer you have to modify BUFFERSIZE and MAX_ROWS


how?
Logged

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: new plugin: sncviewer
« Reply #59 on: February 18, 2006, 07:44:48 AM »
Quote from: loveclaire on February 18, 2006, 02:08:46 AM
- "buffer has not enough rows" -> to increase the buffer you have to modify BUFFERSIZE and MAX_ROWS

This shouldn'r really happen with a sensible snc file. Check how much text is between the timestamps. Chances are it won't fit on the screen anyway if the buffer overflows. Also check for empty lines at the end of the file.
Logged

  • Print
Pages: 1 2 3 [4] 5 6 ... 13
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  sncviewer plugin
 

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

Page created in 0.099 seconds with 15 queries.