From: Dominique F. <fo...@gr...> - 2019-10-02 07:34:20
|
<html><head></head><body dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div class="ApplePlainTextBody">Hi Michael,<br><br><br>Difficult to answer on the graphic problem and the offset. I don’t know Direct2D.<br>You should have a look at other device implementations.<br>The fact is that normally there is no need for scaling (that’s transparent). <br>As far as I can remember, it seems to me that there was a similar problem with the opengl device.<br><br>Regarding the question #2 the answer is yes: the guido factory can create all sort of elements. It’s actually used by the parser to create the AR representation. The API is a bit ugly and could be greatly improved, especially by making it more functional. Currently it works entirely by side effect :-(<br><br>And for the question #3: there is no hit testing mechanism but it should be easy to build one using the mapping api.<br>Have a look at “GUIDOScoreMap.h” : there are methods to inspect the graphic score and to associate elements, rectangles and time intervals. If you need more information, it could be easy to extend.<br><br>Best<br>—<br>Dominique<br><br><br><br><br><blockquote type="cite">Le 27 sept. 2019 à 17:44, Michael Chourdakis <win...@gm...> a écrit :<br><br>I'm up to putting Quido to my sequencer.<br><br>There are questions:<br><br>1. I'm trying to create a Direct2D device so Guido can use my normal render target, hardware accelerated.<br>This is the output:<br><br><image.png><br><br>When using the implemented HDC, this is the correct one:<br><br><image.png><br><image.png><br><br>It seems to me that some weird scaling occurs. <br><br>This is my code:<br><br> virtual void<span class="Apple-tab-span" style="white-space:pre"> </span>DrawMusicSymbol(float x, float y, unsigned int inSymbolID) <br>{<br>EnsureBrush();<br>D2D1_RECT_F ly = { 0 };<br>wstring yy = inSymbolID;<br>auto ty = MeasureString(mSys->WriteFactory, mCurrMusicFont.Text, yy.c_str(), yy.length()); <br>// To measure width and height, irrelevant<br><br>// The following is weird, probably<br>ly.left = (NextOrigin.x + x)* Scale.x;<br>ly.top = (NextOrigin.y + y)*Scale.y;<br>ly.right = ly.left + std::get<0>(ty);<br>ly.bottom = ly.top + std::get<1>(ty);<br><br>mSys->rt->DrawTextW(yy.c_str(), yy.length(), mCurrMusicFont.Text, ly, NextColor);<br>}<br><br>I need to understand more on scaling perhaps. Any ideas?<br><br>2. Can the guido factory create all sort of elements? I want to create a score editor and I can use it if it can create everything, otherwise I will simply edit gmn sources with my code.<br><br>3. Is there a hit testing mechanism, information about where each element is drawn? Notes particularly. So they can be hit-tested with the mouse and edited perhaps. If not, I can make a keyboard-only editor.<br><br>Best Regards,<br><br>_______________________________________________<br>Guidolib-devel mailing list<br>Gui...@li...<br>https://lists.sourceforge.net/lists/listinfo/guidolib-devel<br></blockquote><br></div></body></html> |