From: Julie S <msjulie_s@ya...> - 2009-08-28 21:35:52
Hello RG Team,
I've been studying the RG code quite a bit concerning restInserter() and noteInserter()
I been down a few roads and hit dead ends.
Here is the situation:
We really need one tool that does both notes and rest and its state between uses (duration and rest/note mode).
Currently have two tools that have some coding to share if "switching" from one tool to the other without first going to another tool.
That work ok. But if you switch to another tool between uses of the noteInserter on the restInserter, there currently is no method to decide who was used last (the restInserter or the noteInserter) and so that creates some issues when recalling the tool:
* If the new "Draw" icon or the F# key is hit, we need to recall the last tool used (but we don't know which one that was. We only can recall our current tool)
* This also means that even if the user selects an action that "determines" which part of the tool to use we don't know whose duration to use the restInserter's or the noteInserter. That is because we don't know who was used last.
So many ways to handle this.
Some simple facts:
NoteInserter() is the parent class to RestInserter().
We create both a noteInserter and restInserter and treat them seperately, but have lots of glue code for communicating information between them in different situations.
I suggest we create a NoteRestInserter().
Outside of the actual insertion, a right click context menu, and which symbols appear on the duration toolbar, there is not much difference between them.
We can have one tool and and a current state -- "bool isaRestInserter;" comes to mind.
That way we only have to call the noteRestInserter Tool, it will handle the details of recalling its state.
switchToRest(), switchToNote(), toggleDots(), etc. will just interact with NoteRestInserter tool directly.
I'm afraid that the current system is at its limits, and this would simplify things. But a lot more work than I anticipated. I just don't feel right adding more glue code or a new "meta" tool that the two current tools would have to communicate through.
Your thoughts on this.
Get latest updates about Open Source Projects, Conferences and News.