Old 03-04-2015, 03:21 PM   #41
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Very very nice work !!

I will be able to propose my scripts related to this tomorrow
X-Raym is offline   Reply With Quote
Old 03-04-2015, 03:24 PM   #42
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Quote:
Originally Posted by X-Raym View Post
Very very nice work !!

I will be able to propose my scripts related to this tomorrow
thank you X-Raym... This once is a new rewrite with a new engine to read the lines and display them and it was more complicated than I thought at first. Certainly I am spending more time on this than I anticipated. But I'm excited about the new subtitling framework we are going to have
heda is offline   Reply With Quote
Old 03-06-2015, 04:08 AM   #43
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Bug report:
<i><u><b>Subtitles</b></u></i> doesn't work ^^ (the final italic doesn't work, but it usually works).

----
You had the idea of a multiple line Reader. can I suggest that it would understand what track to consider simply with the parent child relation ?
We only click on the parent and it consider the child as well.
This way, we could host all of our subtitles/notes in a parent group track That would be soooo handy!

Cheers!
X-Raym is offline   Reply With Quote
Old 03-06-2015, 04:12 AM   #44
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Quote:
Originally Posted by X-Raym View Post
Bug report:
<i><u><b>Subtitles</b></u></i> doesn't work ^^ (the final italic doesn't work, but it usually works).

----
You had the idea of a multiple line Reader. can I suggest that it would understand what track to consider simply with the parent child relation ?
We only click on the parent and it consider the child as well.
This way, we could host all of our subtitles/notes in a parent group track That would be soooo handy!

Cheers!
Yes probably I forgot some combinations of formats.

I was trying to figure out how to specify multiple track ids.. your idea of specifying only the parent one is great
heda is offline   Reply With Quote
Old 03-06-2015, 04:17 AM   #45
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Yeaah

I'm finishing to build my formatting text script, wich are not able to find if the formatting style is already applied, and update it for the font-color markup. I also made a "delete all formating" script!
What is nice is that it auto updates with your note reader even if it not playing!

EDIT: you work with format combinaison? but... there is a lot! ^^
<u><i><b> is also broken :P
X-Raym is offline   Reply With Quote
Old 03-06-2015, 04:32 AM   #46
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

I don't have any luck with font-color... does
Code:
<font-color="#CF72FD">Hello</font-color>
works for you with REAPER v5 version of the script ?
(note I will make a background color set/reset script based on item color :P)

EDIT: a suggestion for background tag,
as it is an auto-closing tag, it should be written as <background="#AAAAAA"/>. So we will know it is not meant to enclose text.
X-Raym is offline   Reply With Quote
Old 03-06-2015, 04:44 AM   #47
godly
Human being with feelings
 
godly's Avatar
 
Join Date: Sep 2013
Location: Belgium - Gent
Posts: 709
Default

I think the right syntax is
Code:
<font color="#CF72FD">Hello</font>
/font in the end

Last edited by godly; 03-06-2015 at 04:49 AM.
godly is offline   Reply With Quote
Old 03-06-2015, 04:48 AM   #48
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

the background color syntax is not standard

the font color syntax is HTML standard.
as indicated in the wikipedia https://en.wikipedia.org/wiki/SubRip
it should be <font color="color name or #code"> ... </font>
Notes reader only works with #code right now.



it also says format could be inside the line, but some implementations prefer whole-line formatting.. Notes Reader is whole-line formatting for now.
heda is offline   Reply With Quote
Old 03-06-2015, 04:56 AM   #49
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Oh I see small mistakes!

It works. You will like it

not bad for not inline markup. It is way overkill for now. We can't script all process :P

--

I know for background markup, but it is stanrd in XHTML/HTML than non enclosing tags used "/". It visually indicates that we don't have to look for its matching pair

--
Can you please copy paste a working example of your actual background properties?
X-Raym is offline   Reply With Quote
Old 03-06-2015, 05:22 AM   #50
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

it's in the instructions...
just the last line should be <background="#000000"> but, ok it can be <background="#000000" /> in next version.
heda is offline   Reply With Quote
Old 03-06-2015, 05:26 AM   #51
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Quote:
Originally Posted by godly View Post
I think the right syntax is
Code:
<font color="#CF72FD">Hello</font>
/font in the end

Thanks godly, I didn't want to reply in the other thread since it is off topic. I'm glad you could use Notes Reader live! But please test it before using it hehe
heda is offline   Reply With Quote
Old 03-06-2015, 05:47 AM   #52
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Hehe, almost the final steps!

I have a problem with HeDaSetNote function.
How do add a line to a item note ?

if i just add \n, it broke

Tell me if it works for you. For me it just broke the note.

Code:
function HeDaSetNote(item,newnote)  -- HeDa - SetNote v1.0
	--ref: Lua: boolean retval, string str reaper.GetSetItemState(MediaItem item, string str)
	retval, s = reaper.GetSetItemState(item, "")	-- get the current item's chunk
	--dbug("\nChunk=" .. s .. "\n")
	has_notes = s:find("<NOTES")  -- has notes?
	if has_notes then
		-- there are notes already
		chunk, note, chunk2 = s:match("(.*<NOTES\n)(.*)(\n>\nIMGRESOURCEFLAGS.*)")
		newchunk = chunk .. newnote .. chunk2
		--dbug(newchunk .. "\n")
		
	else
		--there are still no notes
		chunk,chunk2 = s:match("(.*IID%s%d+)(.*)")
		newchunk = chunk .. "\n<NOTES\n" .. newnote .. "\n>\nIMGRESOURCEFLAGS 0" .. chunk2
		--dbug(newchunk .. "\n")
	end
	reaper.GetSetItemState(item, newchunk)	-- set the new chunk with the note
end

note = reaper.ULT_GetMediaItemNote(item)
reaper.ShowConsoleMsg(note)  
note = "|" .. note  .. "\n<background="blabla"/>"
reaper.ShowConsoleMsg(note)
HeDaSetNote(item, note)
edit: updated with "|", but still broke at \n

EDIT: OH ok I understand. There must be a way to tell HeDaSetNote to add "|" for every break line. Any idea ? It is needed on all my text formatting script For the moment, if there is multiple line in original text item, it breaks. (or a way to format the text before going to heda set note)

EDIT/ I did it

Code:
function HeDaSetNote(item,newnote)  -- HeDa - SetNote v1.0
	newnote = newnote:gsub("\n", "\n|")

Last edited by X-Raym; 03-06-2015 at 06:01 AM.
X-Raym is offline   Reply With Quote
Old 03-06-2015, 06:03 AM   #53
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

sorry .. too busy this morning with other things too

yes I don't know why they add that ugly | after the \n for each line.. but it has to be done like that

Nice that you did it
heda is offline   Reply With Quote
Old 03-06-2015, 06:24 AM   #54
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Don't worry, I know you have some other things to do

I succeed to add a function inside HeDaSetNote, not it check if there is no traling empty line, and it is able to rease it if any.

This means than... My scripts are finally ready, if I'm not wrong
Need to make a lot of screen capture now.

Can't wait for your Multiple Tracks Note Reader !!
X-Raym is offline   Reply With Quote
Old 03-06-2015, 07:49 AM   #55
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Notes Reader 0.7 ready for download

* v0.7 (2015-03-06)
+ multiple tracks reader, specify the parent track.
# more format combinations
# background format can be <background="#rrggbb"> or <background="#rrggbb" />
# bug note was not displayed if cursor stopped exactly at item start.

To use multiple tracks, you must group them in a folder, and specify the parent folder track as the track to read in Notes Reader
heda is offline   Reply With Quote
Old 03-06-2015, 07:55 AM   #56
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Yeaaah awesome

There is one problem: markup doesn't seem to work if there is a line break...
X-Raym is offline   Reply With Quote
Old 03-06-2015, 07:58 AM   #57
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Quote:
Originally Posted by X-Raym View Post
Yeaaah awesome

There is one problem: markup doesn't seem to work if there is a line break...
I don't understand. can you give an example?
heda is offline   Reply With Quote
Old 03-06-2015, 08:08 AM   #58
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

I was making a screen capture
Here it is.
X-Raym is offline   Reply With Quote
Old 03-06-2015, 08:21 AM   #59
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Quote:
Originally Posted by X-Raym View Post
I was making a screen capture
Here it is.
ohh I see.
Yes. there is that limitation that format tags should be per line :/

edit: mmmmm I think I know how to solve it without too much trouble

Last edited by heda; 03-06-2015 at 08:29 AM.
heda is offline   Reply With Quote
Old 03-06-2015, 08:29 AM   #60
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@heda
Yeh, manipulating string can be complicated... I can see in your code that it has be hard to do.
I hope you will find a way, or than someone could help you on this...
Cause it could really be a killer feature for your already brilliant note reader!!

Maybe LUA ? It has a lot of nice string related native function.
Well, that would be 500 lines to rewrite.
An EEL solution would be far better :P

EDIT: HAHA ! Don't tease me like that! :P
X-Raym is offline   Reply With Quote
Old 03-06-2015, 08:34 AM   #61
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

yes. Don't modify your scripts. I will find a way

hehe.. yes I'm not planning to translate this to Lua. And I use it in production in REAPER 4 so EEL is good for now. Maybe when REAPER 5 is officially released I will see...
heda is offline   Reply With Quote
Old 03-06-2015, 08:39 AM   #62
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@heda
Don't, if it works in EEL, there is no reason to change!

So I'll be patient until you find a way, and then I would be able to make a nice demo of my 16 formating text scripts :P

Last edited by X-Raym; 03-06-2015 at 09:04 AM.
X-Raym is offline   Reply With Quote
Old 03-06-2015, 11:06 AM   #63
godly
Human being with feelings
 
godly's Avatar
 
Join Date: Sep 2013
Location: Belgium - Gent
Posts: 709
Default

HeDa, looks great,
Only thing is, everytime I want to move or resize the window, I get the Track ID prompt. What's wrong?

Can I dock the window? I'm on Reaper 4.77, propably not?
Where do I get the buttons or what actions?

Last edited by godly; 03-06-2015 at 11:27 AM.
godly is offline   Reply With Quote
Old 03-06-2015, 02:33 PM   #64
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Quote:
Originally Posted by godly View Post
HeDa, looks great,
Only thing is, everytime I want to move or resize the window, I get the Track ID prompt. What's wrong?

Can I dock the window? I'm on Reaper 4.77, propably not?
Where do I get the buttons or what actions?
there is a bug in REAPER 4 when moving the window will trigger mouse click. I did a trick in the code to avoid it to some extent, but only works if you move the window slowly. In REAPER 5 it doesn't happen. YOu cannot dock it in REAPER 4 either. Docking is only for the REAPER 5 version.

which buttons?
heda is offline   Reply With Quote
Old 03-06-2015, 02:38 PM   #65
timothys_monster
Human being with feelings
 
timothys_monster's Avatar
 
Join Date: Jan 2012
Location: Germany
Posts: 1,130
Default

Quote:
Originally Posted by heda View Post
which buttons?
godly is probably referring to the buttons (scripts or actions?) that X-Raym used in his GIF for formatting the text.
timothys_monster is offline   Reply With Quote
Old 03-06-2015, 04:25 PM   #66
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@timothys_monster
Coming soon!
Waiting for multiline formatting support first
This gonna be great.
(good luck for heda on this!)
X-Raym is offline   Reply With Quote
Old 03-06-2015, 05:24 PM   #67
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Quote:
Originally Posted by heda View Post
edit: mmmmm I think I know how to solve it without too much trouble
^^
not it is not that simple...

I have a problem with the formatting parameter of gfx_setfont
it seems it accepts a parameter as a string with ' ' but strcat doesn't seem to work with those, only with " "
I don't know what's going on. I may have to rethink all the display engine again. or leave it like that and you adapt the scripts to work by line
heda is offline   Reply With Quote
Old 03-06-2015, 05:34 PM   #68
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@heda
I made a LOT of string operations with all my text items scripts. Concatenation, trim, find, character pos, replacement etc...
I already made some of these in EEL.
Verdict: it is way more easier in LUA. with have access to a lot of functions, and more, to whole documentation online about it.
So, if you think about a rewrite... go for LUA :P
But of course, don't rush into it. You may find a solution after a good night sleep!

EDIT: You can still tell us precisely (with line number) what you are trying to do and why. You may find help here

Last edited by X-Raym; 03-06-2015 at 05:42 PM.
X-Raym is offline   Reply With Quote
Old 03-06-2015, 05:45 PM   #69
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

yes I'm frustrated because I can see how I would do it in Lua
Maybe we could leave a better formatting support, including inside line formatting, for a Lua REAPER 5 version in the future and leave this one as it is for now.
Unless I get a new idea tomorrow after a good sleep
heda is offline   Reply With Quote
Old 03-07-2015, 02:03 AM   #70
godly
Human being with feelings
 
godly's Avatar
 
Join Date: Sep 2013
Location: Belgium - Gent
Posts: 709
Default

Quote:
Originally Posted by heda View Post
there is a bug in REAPER 4 when moving the window will trigger mouse click. I did a trick in the code to avoid it to some extent, but only works if you move the window slowly. In REAPER 5 it doesn't happen. YOu cannot dock it in REAPER 4 either. Docking is only for the REAPER 5 version.

which buttons?
Thx, i thought so.
The bug is only once you open a note.

Indeed the buttons from the gif in the toolbar.
godly is offline   Reply With Quote
Old 03-07-2015, 05:48 AM   #71
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@heda
If you know how to do it in Lua, and if it will allows multiple lines and inline formatting... It's probably the way to go!
You may take less time rewritting it than finding a native solution. Or/and probably avoid a lot of frustration and have much more satisfaction! When I transcribe my eel emplate script to lua, the key was to work in block, and then go deeper and deeper inside the loops. It allows to avoid more bugs than rewritting it in line order, cause you can verify if the loops work at every steps.
You have all my support, whatever solution you find/choose!
X-Raym is offline   Reply With Quote
Old 03-07-2015, 07:21 AM   #72
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@godly
You can find it here:
Scripts (LUA): Text Items Formatting Actions (vavrious)

@heda

So, I release my scripts today, so can use start to use it
All the scripts have been updated. You may find them very useful for testing the Note Reader!
X-Raym is offline   Reply With Quote
Old 03-07-2015, 12:41 PM   #73
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Cool!

I don't know how to import the toolbar reapermenu file
It says the file doesn't have menu for toolbar
heda is offline   Reply With Quote
Old 03-07-2015, 01:24 PM   #74
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@heda
You have to be on the right toolbar number first. It is number 15.
I don't know if the button will be linked to the script. Sure they have to been imported before the menu importation, but this may not be enough. You will tell me :P
X-Raym is offline   Reply With Quote
Old 03-07-2015, 01:31 PM   #75
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Quote:
Originally Posted by X-Raym View Post
@heda
You have to be on the right toolbar number first. It is number 15.
I don't know if the button will be linked to the script. Sure they have to been imported before the menu importation, but this may not be enough. You will tell me :P
It doesn't import the toolbar even being in the toolbar 15
But you are right, the actions command id's won't match because they are scripts. so there is no way to import the toolbar. We have to create the buttons 1 by one.
heda is offline   Reply With Quote
Old 03-07-2015, 06:29 PM   #76
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@heda
That is sad really. Sharing toolbars must be simpler.
I should write a feature request, but I donlt even what the trick would be to make it works with action scripts. It is not
thought for script support.

Any news from note reader rewritting ?
X-Raym is offline   Reply With Quote
Old 03-08-2015, 02:07 AM   #77
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Sleeping is good

Try 0.8
* v0.8 (2015-03-08)
+ SHIFT+click: Enable/Disable reading from parent track
# better multiline formatting

at least it will work better, but I think it is all a mess. But if it works for most cases then I will leave it for now until REAPER 5 is released and we can have a better Lua version.
heda is offline   Reply With Quote
Old 03-08-2015, 03:00 AM   #78
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

That's
better, obviously, I hope it was not too much pain!

As you said, there is still some things to improve. (screenshot with bold, then u, then font-color). (I didn't test all the combination)

Anyway, this has been an incredible work so far, thank you for this great tool!

Ah REAPER 5... I can't wait for an official release, and starting to make my script work on my main REAPER.
We can't export our toolbars with scripts, it is really long to import what we have done in another version of REAPER. I will definitely write a feature request for this.
X-Raym is offline   Reply With Quote
Old 03-08-2015, 03:10 AM   #79
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

the way I have coded it for the font color is that it should be always the outer tag. and all the italic, bold and underline should be inside the font tags.

anyway I didn't want to end up coding a full HTML browser inside REAPER. And not in EEL for sure

I'll vote for that FR. However I don't know how they could do it if the actions get that random ID each time you add them. I don't know why they do that but it doesn't make sense to me to assign a random string to each script. At least the string should be always the same for each script file name. Like a hash of the filename string.
heda is offline   Reply With Quote
Old 03-08-2015, 03:51 AM   #80
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@heda
Don't worry, there is just <u>, <i>, <b>, <font color> and <background> to care about
and the last one is not SRt standards, it is from you haha

I write my feature request here:
Better Scripts Management: Importation, Folders, ID, Deletion
X-Raym is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.