help debugging notes

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

help debugging notes

Jim Newton
Can someone tell me the correct way to print the "name" of a note (Note *note) using qDebug() ?
By name, I mean something like Ab3, but even something like Ab would work for the particular case.
I'd like to get the octave as well if possible?

qDebug("%s", note->find_my_name_and_octave());

Reply | Threaded
Open this post in threaded view
|

Re: help debugging notes

Marc Sabatella
See Note::tpcUserName(), also see how it is used in, for instance, Note::accessibleInfo().

On Sun, Jul 26, 2015 at 11:22 AM Jim Newton <[hidden email]> wrote:
Can someone tell me the correct way to print the "name" of a note (Note
*note) using qDebug() ?
By name, I mean something like Ab3, but even something like Ab would work
for the particular case.
I'd like to get the octave as well if possible?

qDebug("%s", note->find_my_name_and_octave());





--
View this message in context: http://dev-list.musescore.org/help-debugging-notes-tp7579465.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: help debugging notes

Jim Newton
Thanks.  It looks like note->tpcUserName() returns a Qstring which cannot be printed with %s.
How can I print the human readable name?
Reply | Threaded
Open this post in threaded view
|

Re: help debugging notes

AndreiTuicu
Hello Jim,

Please try qDebug(note->tcpUserName().toLatin1.data()), or if you preffer printf("%s\n", note->tcpUserName().toLatin1.data()).

Cheers,
Andrei

2015-08-02 15:42 GMT+03:00 Jim Newton <[hidden email]>:
Thanks.  It looks like note->tpcUserName() returns a Qstring which cannot be
printed with %s.
How can I print the human readable name?



--
View this message in context: http://dev-list.musescore.org/help-debugging-notes-tp7579465p7579471.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: help debugging notes

AndreiTuicu
sorry, note->tcpUserName().toLatin1().data()

2015-08-02 15:50 GMT+03:00 Andrei Tuicu <[hidden email]>:
Hello Jim,

Please try qDebug(note->tcpUserName().toLatin1.data()), or if you preffer printf("%s\n", note->tcpUserName().toLatin1.data()).

Cheers,
Andrei

2015-08-02 15:42 GMT+03:00 Jim Newton <[hidden email]>:
Thanks.  It looks like note->tpcUserName() returns a Qstring which cannot be
printed with %s.
How can I print the human readable name?



--
View this message in context: http://dev-list.musescore.org/help-debugging-notes-tp7579465p7579471.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer



------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: help debugging notes

Jim Newton
Thanks, i'll give it a try.
Reply | Threaded
Open this post in threaded view
|

Re: help debugging notes

Marc Sabatella
Also, if you browse the source and look at other qDebug() calls, you'll see we print qStrings all the time, normally using qPrintable().

On Sun, Aug 2, 2015 at 8:22 AM Jim Newton <[hidden email]> wrote:
Thanks, i'll give it a try.



--
View this message in context: http://dev-list.musescore.org/help-debugging-notes-tp7579465p7579474.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: help debugging notes

Jim Newton
In reply to this post by AndreiTuicu
         qDebug("starting with pitch=%d %s", n->ppitch(), n->tcpUserName().toLatin1.data()); 
Gives the following errors/

/Users/jimka/MuseScore/libmscore/figuredbass.cpp:1819:83: error: no member named 'tcpUserName' in 'Ms::Note'; did you mean 'tpcUserName'?
                              qDebug("starting with pitch=%d %s", n->ppitch(), n->tcpUserName().toLatin1.data());
                                                                                  ^~~~~~~~~~~
                                                                                  tpcUserName
In file included from /Users/jimka/MuseScore/libmscore/figuredbass.cpp:13:
In file included from /Users/jimka/Musescore/libmscore/figuredbass.h:18:
In file included from /Users/jimka/Musescore/libmscore/chord.h:22:
In file included from /Users/jimka/Musescore/libmscore/chordrest.h:17:
In file included from /Users/jimka/Musescore/libmscore/duration.h:18:
In file included from /Users/jimka/Musescore/libmscore/durationtype.h:17:
/Users/jimka/Musescore/libmscore/note.h:300:15: note: 'tpcUserName' declared here
      QString tpcUserName(bool explicitAccidental = false);
              ^
/Users/jimka/MuseScore/libmscore/figuredbass.cpp:1819:97: error: reference to non-static member function must be called; did you mean to call it with no arguments?
                              qDebug("starting with pitch=%d %s", n->ppitch(), n->tcpUserName().toLatin1.data());
                                                                               ~~~~~~~~~~~~~~~~~^~~~~~~~
                                                                                                        ()
Reply | Threaded
Open this post in threaded view
|

Re: help debugging notes

Jim Newton
I'm dyslexic.  It's pretty difficult for me to see the difference between tcp and tpc.  I'll learn in time.