From: D. M. M. <mic...@ro...> - 2007-09-09 16:15:39
|
OK, I have an [x] ignore percussion thingie in the dialog, and pass an extra bool around to all 13,000 places where it's needed. This tells me whether to ignore percussion or not, but figuring out whether the segment is percussion is still complicated enough to make my teeth hurt. I'm sitting in void KeyInsertionCommand::modifySegment() { at the top, where my if (this_segment_is_percussion && user_doesn't_want_to_affect_percussion_segments) logic needs to abort twiddling the key change in this case. Problem is getting a value for this_segment_is_percussion (actually instrumentIsPercussion) using the new convenience method. I still need a studio object, as from RosegardenGUIDoc::getStudio(), but I don't have a doc object in here that I can find, and I don't see a way to get a doc from a segment. So I either have to go back and change 13,000 things (actually it was about 10, I think, but it took me an hour to find them all) to pass in a doc, which seems stupid, or I need to make sure everything that calls KeyInsertionCommand is sitting somewhere it can find a doc, and pass in a bool from the outside to test against. Or something. I think both of these sound like an obnoxious approach, and I'm hoping maybe I'm just too long away from the code to see the obvious, easy ahah moment. Let's see... From the notation view, slotEditAddKeySignature() I have a doc, and can get a studio, but I don't have any idea what segment I'm going to be working on, so I can't get instrumentIsPercussion at this level. Obviously, stupid. I can't pass in a bool for a multi insertion command especially. So I guess I'm going to have to pass in a doc to the command, as yet another in the already obnoxiously long list of parameters? Or am I missing something? It would probably help if I saw any of this like a Real Programmer. Truth is I still barely have any idea what the hell I'm doing, and I play a lot of "try this until it compiles" games guessing at syntax I don't fundamentally understand the meaning of. Rosegarden sure is a shining example of everything that's gone on in the world of OOP while I was sleeping. I hope this explanation makes enough sense for you to understand what the hell I'm trying to say, and it suggests an easy something->doSomething() method I don't see. (like segment->getDoc() or segment->getStudio() or something maybe?) -- D. Michael McIntyre |