Re: avoid slur-tie collision? (issue #582)
On 11 juin 2012, at 17:20, Werner LEMBERG wrote: Naive question: We have a lot of code to avoid collisions between various grobs. What about slurs and ties? Look at issue #582 for samples. Werner Fixed with commit ad0e41c6cd25db2643d1a3e25242d284d6f65e69. Cheers, MS ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Sets TabVoice Stem height to ##f (issue 6303065)
On 2012/06/12 13:22:10, dak wrote: On 2012/06/12 12:54:40, MikeSol wrote: On 2012/06/12 12:49:45, dak wrote: http://codereview.appspot.com/6303065/diff/10003/lily/grob.cc File lily/grob.cc (right): http://codereview.appspot.com/6303065/diff/10003/lily/grob.cc#newcode472 lily/grob.cc:472: real_ext[d] += offset; On 2012/06/12 12:32:37, dak wrote: I don't understand this. The only way to get a nan from adding an offset to infinity is by adding another nan or an infinite offset with different sign. What case is this supposed to catch? So what you actually meant to say was if (!real_ext.is_empty ()) real_ext.translate (offset); If that's what you mean, why don't you write it instead of some puzzle? This is not what I mean. An empty interval is, in LilyPond, an interval whose left is greater than it's right. I disagree. An empty interval is an interval not containing any point. The details are not important. I see that you chose to push this unchanged instead of using my suggestion. The result is that both interval ends are translated _independently_. Treating them _independently_ in this obfuscate manner only makes sense when you expect them to be set independently, namely one interval end being infinite, the other finite. For one thing, you have not explained how you expect such a configuration to come about. For another it means that (inf,3) which is an empty interval, gets transformed under an infinite shift to (inf,inf) an interval that will likely blow the emptiness check. Your example, (3,2) is transformed with an infinite shift into (inf,inf) again blowing the emptiness check since infinf can't be determined. Could you please explain the cases where you expect to get sensible results with that approach? http://codereview.appspot.com/6303065/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: cleanup: infinity, get property (issue 6310043)
How do you like this? I've tried to define a new property lyricDefaultAlignment (similar to lyricMelismaAlignment) and use it in line 47, but i got an error: 'internal_get_property' was not declared in this scope I'll investigate when i get back home. http://codereview.appspot.com/6310043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: cleanup: infinity, get property (issue 6310043)
On 2012/06/15 09:22:28, janek wrote: How do you like this? I've tried to define a new property lyricDefaultAlignment (similar to lyricMelismaAlignment) and use it in line 47, but i got an error: 'internal_get_property' was not declared in this scope I'll investigate when i get back home. What makes you think Lyric_text has properties? It is a class you defined yourself. I really can't figure out what you are trying to do here. http://codereview.appspot.com/6310043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: cleanup: infinity, get property (issue 6310043)
I forgot that my git-cl is configured to add -devel to cc! This is a draft which i was discussing with Mike, but since it got public, i welcome any comments! On 2012/06/15 09:42:03, dak wrote: On 2012/06/15 09:22:28, janek wrote: How do you like this? I've tried to define a new property lyricDefaultAlignment (similar to lyricMelismaAlignment) and use it in line 47, but i got an error: 'internal_get_property' was not declared in this scope I'll investigate when i get back home. What makes you think Lyric_text has properties? It is a class you defined yourself. I really can't figure out what you are trying to do here. I'm trying to define a new context property lyricDefaultAlignment similarly to how lyricMelismaAlignment is defined. (did i use the right name? lyricMelismaAlignment is a context property, i.e. a property that doesn't belong to a specific grob?) Look at Lyric_engraver, lines 76-77: last_text_-set_property (self-alignment-X, get_property (lyricMelismaAlignment)); unless i'm totally wrong, last_text_ is a pointer to a LyricText item. These two lines set that LyricText's self-alignment-X to what is inside lyricMelismaAlignment. I want to do something similar: in Lyric_text, i have a pointer to LyricText item and i want to set its self-alignment to what's inside another property: lyricDefaultAlignment. What makes you think Lyric_text has properties? Does it need any? I'm trying to read a context property (or at least that's what i think i'm trying), i thought that they don't need to be owned. It is a class you defined yourself. I've looked at other class definitions (in particular, flag.cc) and tried to define Lyric_text accordingly to what i saw. Apparently i missed something, but i don't know what :( I thought that ADD_INTERFACE is responsible for connecting my class with the rest of the code, and MAKE_SCHEME_CALLBACK makes a method available in Scheme layer. I don't have any idea what else is necessary... I'd be grateful for an explanation. thanks, Janek ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: cleanup: infinity, get property (issue 6310043)
On Fri, Jun 15, 2012 at 5:04 PM, David Kastrup d...@gnu.org wrote: Janek Warchoł janek.lilyp...@gmail.com writes: I'm trying to define a new context property lyricDefaultAlignment similarly to how lyricMelismaAlignment is defined. (did i use the right name? lyricMelismaAlignment is a context property, i.e. a property that doesn't belong to a specific grob?) Look at Lyric_engraver, lines 76-77: last_text_-set_property (self-alignment-X, get_property (lyricMelismaAlignment)); unless i'm totally wrong, last_text_ is a pointer to a LyricText item. These two lines set that LyricText's self-alignment-X to what is inside lyricMelismaAlignment. But this is inside of a member function of an _Engraver_. An engraver has an associated context, and get_property inside of an engraver will access the respective context property. Ah, indeed - silly me! What makes you think Lyric_text has properties? Does it need any? I'm trying to read a context property (or at least that's what i think i'm trying), i thought that they don't need to be owned. What do you think the word context in context property means? How should the C++ compiler guess what context you are talking about when you just write get_property (lyricMelismaAlignment) ? I thought that since i have a pointer to a LyricText Item, which is placed in some context, that context would be used. From what i see in Context::internal_get_property, i can start from a child context of the context i need (i.e. if MyProperty isn't set for Staff, but it is set for Score, i can start from Staff and it will go up to Score). It is a class you defined yourself. I've looked at other class definitions (in particular, flag.cc) and tried to define Lyric_text accordingly to what i saw. Apparently i missed something, but i don't know what :( You call a member function get_property (or rather via a macro definition internal_get_property) but don't define it. Should i #include context.hh then? I thought that ADD_INTERFACE is responsible for connecting my class with the rest of the code, and MAKE_SCHEME_CALLBACK makes a method available in Scheme layer. I don't have any idea what else is necessary... I'd be grateful for an explanation. Again: how should LilyPond guess the context from which you want the property read? The code will, of course, depend on the answer to that question. I'd like to use the parent context of the Item that i have. Can it be done this way? Could you point me to an example? thanks, Janek ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: cleanup: infinity, get property (issue 6310043)
Janek Warchoł janek.lilyp...@gmail.com writes: On Fri, Jun 15, 2012 at 5:04 PM, David Kastrup d...@gnu.org wrote: Janek Warchoł janek.lilyp...@gmail.com writes: I'm trying to define a new context property lyricDefaultAlignment similarly to how lyricMelismaAlignment is defined. (did i use the right name? lyricMelismaAlignment is a context property, i.e. a property that doesn't belong to a specific grob?) Look at Lyric_engraver, lines 76-77: last_text_-set_property (self-alignment-X, get_property (lyricMelismaAlignment)); unless i'm totally wrong, last_text_ is a pointer to a LyricText item. These two lines set that LyricText's self-alignment-X to what is inside lyricMelismaAlignment. But this is inside of a member function of an _Engraver_. An engraver has an associated context, and get_property inside of an engraver will access the respective context property. Ah, indeed - silly me! What makes you think Lyric_text has properties? Does it need any? I'm trying to read a context property (or at least that's what i think i'm trying), i thought that they don't need to be owned. What do you think the word context in context property means? How should the C++ compiler guess what context you are talking about when you just write get_property (lyricMelismaAlignment) ? I thought that since i have a pointer to a LyricText Item, which is placed in some context, that context would be used. What makes you think LyricText is an Item? Its definition is class Lyric_text { public: DECLARE_SCHEME_CALLBACK (calc_x_offset, (SCM)); DECLARE_GROB_INTERFACE (); }; It is a class with one member function and an interface. That does not make it an Item. If you want it to be an Item, you need to have it inherit from Item in which case it will know its context (and consequently how to get properties) from the way it has been created. I thought that ADD_INTERFACE is responsible for connecting my class with the rest of the code, and MAKE_SCHEME_CALLBACK makes a method available in Scheme layer. I don't have any idea what else is necessary... I'd be grateful for an explanation. Again: how should LilyPond guess the context from which you want the property read? The code will, of course, depend on the answer to that question. I'd like to use the parent context of the Item that i have. So far, you don't have an Item that I can see. -- David Kastrup ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: cleanup: infinity, get property (issue 6310043)
On Fri, Jun 15, 2012 at 6:00 PM, David Kastrup d...@gnu.org wrote: What makes you think LyricText is an Item? Its definition is class Lyric_text { public: DECLARE_SCHEME_CALLBACK (calc_x_offset, (SCM)); DECLARE_GROB_INTERFACE (); }; It is a class with one member function and an interface. That does not make it an Item. If you want it to be an Item, you need to have it inherit from Item in which case it will know its context (and consequently how to get properties) from the way it has been created. indeed, i'm more silly than i thought. Is the inheritance correct now? I still get an error, though... Btw, why doesn't Flag inherit from Item? thanks, Janek ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: cleanup: infinity, get property (issue 6310043)
On Fri, Jun 15, 2012 at 6:48 PM, David Kastrup d...@gnu.org wrote: Janek Warchoł janek.lilyp...@gmail.com writes: indeed, i'm more silly than i thought. Is the inheritance correct now? I still get an error, though... Btw, why doesn't Flag inherit from Item? Good question. Looking through this and stem, it would seem that this does not work via inheritance but rather callbacks. So disregard what I said previously. Should Lyric_text inherit from Item, then? Or is it totally irrelevant? You likely want to use a grob property, in which case you would write me-get_property (...). Done - works without any problem :) Should i also change lyricMelismaAlignment to be a grob property? Using a context property does not make sense here since the lifetime of a grob is not synchronized to the lifetime of context properties. You mean that a context property may be changed during the lifetime of one grob? thanks for help! Janek http://codereview.appspot.com/6310043/diff/2008/scm/define-grobs.scm File scm/define-grobs.scm (right): http://codereview.appspot.com/6310043/diff/2008/scm/define-grobs.scm#newcode1282 scm/define-grobs.scm:1282: (default-alignment . 0) should i name it 'default-alignment-X'? http://codereview.appspot.com/6310043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: cleanup: infinity, get property (issue 6310043)
janek.lilyp...@gmail.com writes: On Fri, Jun 15, 2012 at 6:48 PM, David Kastrup d...@gnu.org wrote: Janek Warchoł janek.lilyp...@gmail.com writes: indeed, i'm more silly than i thought. Is the inheritance correct now? I still get an error, though... Btw, why doesn't Flag inherit from Item? Good question. Looking through this and stem, it would seem that this does not work via inheritance but rather callbacks. So disregard what I said previously. Should Lyric_text inherit from Item, then? Apparently not. Or is it totally irrelevant? Possibly. I consider it likely that this class is never instantiated, but I don't have enough of a clue right now. You likely want to use a grob property, in which case you would write me-get_property (...). Done - works without any problem :) Should i also change lyricMelismaAlignment to be a grob property? No idea. Using a context property does not make sense here since the lifetime of a grob is not synchronized to the lifetime of context properties. You mean that a context property may be changed during the lifetime of one grob? Sure. The lifetime of a grob is until the output is produced. The life time of the interface is likely more interesting. http://codereview.appspot.com/6310043/diff/2008/scm/define-grobs.scm File scm/define-grobs.scm (right): http://codereview.appspot.com/6310043/diff/2008/scm/define-grobs.scm#newcode1282 scm/define-grobs.scm:1282: (default-alignment . 0) should i name it 'default-alignment-X'? No idea. Someone else needs to answer this. -- David Kastrup http://codereview.appspot.com/6310043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: cleanup: infinity, get property (issue 6310043)
Ok, I am currently somewhat fuzzy. A grob has individual properties, and it has interfaces. Interfaces also carry properties. When a grob is created, its properties are initialized from the context and then live on independently. I think that the interface-induced properties initialize from context properties unless overriden per grob. But I really don't have enough of a clue of the backend to really tell right now. http://codereview.appspot.com/6310043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: cleanup: infinity, get property (issue 6310043)
On 15 juin 2012, at 22:10, d...@gnu.org wrote: Ok, I am currently somewhat fuzzy. A grob has individual properties, and it has interfaces. Interfaces also carry properties. When a grob is created, its properties are initialized from the context and then live on independently. I think that the interface-induced properties initialize from context properties unless overriden per grob. But I really don't have enough of a clue of the backend to really tell right now. http://codereview.appspot.com/6310043/ For a grob to have a property, it must have an interface that implements that property. What do you mean by interface induced property? If a grob implements an interface with property X, said grob does not have a value set for property X unless it is explicitly defined in define-grobs.scm. Cheers, MS ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: cleanup: infinity, get property (issue 6310043)
On Fri, Jun 15, 2012 at 9:58 PM, d...@gnu.org wrote: Good question. Looking through this and stem, it would seem that this does not work via inheritance but rather callbacks. So disregard what I said previously. Should Lyric_text inherit from Item, then? Apparently not. ok, it doesn't. You likely want to use a grob property, in which case you would write me-get_property (...). Done - works without any problem :) Should i also change lyricMelismaAlignment to be a grob property? No idea. i think i'll change it. On Fri, Jun 15, 2012 at 10:10 PM, d...@gnu.org wrote: Ok, I am currently somewhat fuzzy. A grob has individual properties, and it has interfaces. Interfaces also carry properties. When a grob is created, its properties are initialized from the context and then live on independently. I think that the interface-induced properties initialize from context properties unless overriden per grob. But I really don't have enough of a clue of the backend to really tell right now. Nevertheless many thanks for explanations! I understand things better now. cheers, Janek ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel