> On 25.03.2015, at 08:44, D. Michael McIntyre <[email protected]> 
> wrote:
> 
> On 03/24/2015 06:50 PM, Lambacher, Armin wrote:
> 
>> So, what would be the correct way to repaint either the notes individually 
>> or the whole notation window?
> 
> That's an interesting question.
> 
> src/commands/notation/ChangeSlurPositionCommand.cpp for example...  It 
> sets the properties, but it doesn't do anything to trigger any kind of 
> refresh.  Where does the refresh happen?
> 
> I only had a moment, and didn't find the answer in that time, but 
> discovering exactly how ChangeSlurPositionCommand even gets called in 
> the first place should be illuminating.  NotationCommandRegistry, but 
> what's that all about?  If I ever knew, I don't remember.  Sounds like 
> Chris or maybe Julie.
> 
> Are you doing your new thing following the template of one of these 
> existing notation commands?  That would be a good start if you're not. 
> I chose this example at random, because I knew it was one of the 
> commands that instantly changed something visible that was controlled by 
> a property.

Ok, so I got this one running now. I must admit that the command logic is not 
so very trivial follow for a newcomer... 8-))

However, now it works. I created a command for marking the parallels (it 
basically does nothing, it just enforces CommandHistory to emit the repaint 
signal), which is called once at the end of the search while during search I 
update the note properties and the "Segment::updateRefreshStatuses" so that 
there is only on repaint at the end of the whole search (I have one piece where 
otherwise it takes fairly long to run).

So this is ok except one issue: If you search for the parallels, at the end the 
file is set to "modified" state. This does not happen when you just select 
notes and deselect them again. IMHO, the marking of the parallels is just 
something that corresponds to how you view the file (like getting notes in blue 
when highlighting), not so much as editing/changing the file...

Of course I can live with that, but maybe a general mechanism to enforce 
repainting after one has set the "Segment::updateRefreshStatuses"  would be a 
nice feature to have, spontaneously a corresponding signal that one could emit 
comes to mind...

Now some questions on how to properly organize the source code in order to not 
create a mess:

1:
I use a new property for the note to mark them as a member of a parallel. This 
is a boolean with the name "MemberOfParallel". At the moment this is a string 
literal in the source code.

To quote from the wiki: "Of course, you don't see much real code using literal 
strings; the event types are generally just declared as string constants in 
various places (actually almost all in NotationTypes.h), but the property names 
are usually declared as constant PropertyName objects (in NotationTypes, 
BaseProperties or notationproperties, most usually) which is a class that's 
constructed from a string constant but interns to an integer for faster lookup, 
not that you need to deal with that at all. "

So, where would be the best place to put it?

2:
I also introduced a new color, MemberOfParallelColour, in NotePixmapFactory in 
enum ColorType. This is then hardcoded in NotePixmapFactory::getCharacter as 
magenta. Is this ok or is there a better way to do this? Should this be 
configureable? Or is this too complicated?

3: 
The notes are colored now, but not the stems. How would I also change the color 
of the corresponding stem?


Thank you in advance

Armin
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to