qDebug -> LOGD

This commit is contained in:
Eism 2022-05-06 17:19:51 +03:00
parent 5630d4ebda
commit c14d6f0c33
151 changed files with 1299 additions and 1266 deletions

View file

@ -37,6 +37,8 @@
#include "commonscenetypes.h"
#include "log.h"
using namespace mu;
using namespace mu::engraving;
@ -58,7 +60,7 @@ ExampleView::ExampleView(QWidget* parent)
m_backgroundPixmap = new QPixmap(wallpaperPath);
if (m_backgroundPixmap == 0 || m_backgroundPixmap->isNull()) {
qDebug("no valid pixmap %s", qPrintable(wallpaperPath));
LOGD("no valid pixmap %s", qPrintable(wallpaperPath));
}
}
@ -197,7 +199,7 @@ void ExampleView::dragEnterEvent(QDragEnterEvent* event)
QByteArray a = d->data(mu::commonscene::MIME_SYMBOL_FORMAT);
// qDebug("ExampleView::dragEnterEvent Symbol: <%s>", a.data());
// LOGD("ExampleView::dragEnterEvent Symbol: <%s>", a.data());
XmlReader e(a);
PointF dragOffset;

View file

@ -400,7 +400,7 @@ bool MidiFile::write(const void* p, qint64 len)
if (rv == len) {
return false;
}
qDebug("write midifile failed: %s", fp->errorString().toLatin1().data());
LOGD("write midifile failed: %s", fp->errorString().toLatin1().data());
return true;
}
@ -565,14 +565,14 @@ bool MidiFile::readEvent(MidiEvent* event)
int nclick = getvl();
if (nclick == -1) {
qDebug("readEvent: error 1(getvl)");
LOGD("readEvent: error 1(getvl)");
return false;
}
click += nclick;
for (;;) {
read(&me, 1);
if (me >= 0xf1 && me <= 0xfe && me != 0xf7) {
qDebug("Midi: Unknown Message 0x%02x", me & 0xff);
LOGD("Midi: Unknown Message 0x%02x", me & 0xff);
} else {
break;
}
@ -585,7 +585,7 @@ bool MidiFile::readEvent(MidiEvent* event)
status = -1; // no running status
int len = getvl();
if (len == -1) {
qDebug("readEvent: error 3");
LOGD("readEvent: error 3");
return false;
}
data = new unsigned char[len + 1];
@ -593,7 +593,7 @@ bool MidiFile::readEvent(MidiEvent* event)
read(data, len);
data[dataLen] = 0; // always terminate with zero
if (data[len - 1] != 0xf7) {
qDebug("SYSEX does not end with 0xf7!");
LOGD("SYSEX does not end with 0xf7!");
// more to come?
} else {
dataLen--; // don't count 0xf7
@ -610,7 +610,7 @@ bool MidiFile::readEvent(MidiEvent* event)
read(&type, 1);
dataLen = getvl(); // read len
if (dataLen == -1) {
qDebug("readEvent: error 6");
LOGD("readEvent: error 6");
return false;
}
data = new unsigned char[dataLen + 1];
@ -632,8 +632,8 @@ bool MidiFile::readEvent(MidiEvent* event)
read(&a, 1);
} else {
if (status == -1) {
qDebug("readEvent: no running status, read 0x%02x", me);
qDebug("sstatus ist 0x%02x", sstatus);
LOGD("readEvent: no running status, read 0x%02x", me);
LOGD("sstatus ist 0x%02x", sstatus);
if (sstatus == -1) {
return 0;
}
@ -685,14 +685,14 @@ bool MidiFile::readEvent(MidiEvent* event)
event->setValue(a & 0x7f);
break;
default: // f1 f2 f3 f4 f5 f6 f7 f8 f9
qDebug("BAD STATUS 0x%02x, me 0x%02x", status, me);
LOGD("BAD STATUS 0x%02x, me 0x%02x", status, me);
return false;
}
if ((a & 0x80) || (b & 0x80)) {
qDebug("8't bit in data set(%02x %02x): tick %d read 0x%02x status:0x%02x",
a & 0xff, b & 0xff, click, me, status);
qDebug("readEvent: error 16");
LOGD("8't bit in data set(%02x %02x): tick %d read 0x%02x status:0x%02x",
a & 0xff, b & 0xff, click, me, status);
LOGD("readEvent: error 16");
if (b & 0x80) {
// Try to fix: interpret as channel byte
status = b;
@ -772,7 +772,7 @@ void MidiTrack::mergeNoteOnOffAndFindMidiType(MidiType* mt)
}
if (!found) {
if (rpnh == -1 || rpnl == -1) {
qDebug("parameter number not defined, data 0x%x", datah);
LOGD("parameter number not defined, data 0x%x", datah);
ev.setType(ME_INVALID);
continue;
} else {
@ -787,8 +787,8 @@ void MidiTrack::mergeNoteOnOffAndFindMidiType(MidiType* mt)
datal = val;
if (rpnh == -1 || rpnl == -1) {
qDebug("parameter number not defined, data 0x%x 0x%x, tick %d, channel %d",
datah, datal, i->first, ev.channel());
LOGD("parameter number not defined, data 0x%x 0x%x, tick %d, channel %d",
datah, datal, i->first, ev.channel());
continue;
}
// assume that the sequence is always
@ -877,7 +877,7 @@ void MidiTrack::mergeNoteOnOffAndFindMidiType(MidiType* mt)
}
int tick = i->first;
if (ev.type() == ME_NOTEOFF || ev.velo() == 0) {
qDebug("-extra note off at %d", tick);
LOGD("-extra note off at %d", tick);
ev.setType(ME_INVALID);
continue;
}
@ -902,7 +902,7 @@ void MidiTrack::mergeNoteOnOffAndFindMidiType(MidiType* mt)
}
}
if (k == _events.end()) {
qDebug("-no note-off for note at %d", tick);
LOGD("-no note-off for note at %d", tick);
note.setLen(1);
}
el.insert(std::pair<int, MidiEvent>(tick, note));

View file

@ -85,7 +85,7 @@ void Layout::doLayoutRange(const LayoutOptions& options, const Fraction& st, con
Q_ASSERT(!(stick == Fraction(-1, 1) && etick == Fraction(-1, 1)));
if (!m_score->last() || (options.isLinearMode() && !m_score->firstMeasure())) {
qDebug("empty score");
LOGD("empty score");
qDeleteAll(m_score->_systems);
m_score->_systems.clear();
qDeleteAll(m_score->pages());
@ -136,7 +136,7 @@ void Layout::doLayoutRange(const LayoutOptions& options, const Fraction& st, con
// rest which replaces the measure range
if (!m->system() && m->isMeasure() && toMeasure(m)->hasMMRest()) {
qDebug(" dont start with mmrest");
LOGD(" dont start with mmrest");
m = toMeasure(m)->mmRest();
}
@ -300,7 +300,7 @@ void Layout::resetSystems(bool layoutAll, const LayoutOptions& options, LayoutCo
qDeleteAll(m_score->pages());
m_score->pages().clear();
if (!m_score->firstMeasure()) {
qDebug("no measures");
LOGD("no measures");
return;
}

View file

@ -562,7 +562,7 @@ static void layoutDrumsetChord(Chord* c, const Drumset* drumset, const StaffType
for (Note* note : c->notes()) {
int pitch = note->pitch();
if (!drumset->isValid(pitch)) {
// qDebug("unmapped drum note %d", pitch);
// LOGD("unmapped drum note %d", pitch);
} else if (!note->fixed()) {
note->undoChangeProperty(Pid::HEAD_GROUP, int(drumset->noteHead(pitch)));
int line = drumset->line(pitch);
@ -627,7 +627,7 @@ void LayoutMeasure::getNextMeasure(const LayoutOptions& options, LayoutContext&
ctx.measureNo = mno;
}
} else if (toMeasure(ctx.curMeasure)->isMMRest()) {
qDebug("mmrest: no %d += %d", ctx.measureNo, toMeasure(ctx.curMeasure)->mmRestCount());
LOGD("mmrest: no %d += %d", ctx.measureNo, toMeasure(ctx.curMeasure)->mmRestCount());
ctx.measureNo += toMeasure(ctx.curMeasure)->mmRestCount() - 1;
}
}

View file

@ -337,7 +337,7 @@ void LayoutPage::collectPage(const LayoutOptions& options, LayoutContext& ctx)
void LayoutPage::layoutPage(const LayoutContext& ctx, Page* page, qreal restHeight, qreal footerPadding)
{
if (restHeight < 0.0) {
qDebug("restHeight < 0.0: %f\n", restHeight);
LOGD("restHeight < 0.0: %f\n", restHeight);
restHeight = 0;
}

View file

@ -344,7 +344,7 @@ AccidentalType Accidental::name2subtype(const QString& tag)
{
SymId symId = SymNames::symIdByName(tag);
if (symId == SymId::noSym) {
// qDebug("no symbol found");
// LOGD("no symbol found");
} else {
int i = 0;
for (const Acc& acc : accList) {
@ -568,7 +568,7 @@ EngravingItem* Accidental::drop(EditData& data)
undoChangeProperty(Pid::ACCIDENTAL_BRACKET, int(AccidentalBracket::BRACKET), PropertyFlags::NOSTYLE);
break;
default:
qDebug("unknown icon type");
LOGD("unknown icon type");
break;
}
break;

View file

@ -579,7 +579,7 @@ SymId Ambitus::noteHead() const
SymId t = Note::noteHead(hg, _noteHeadGroup, ht);
if (t == SymId::noSym) {
qDebug("invalid notehead %d/%d", int(_noteHeadGroup), int(_noteHeadType));
LOGD("invalid notehead %d/%d", int(_noteHeadGroup), int(_noteHeadType));
t = Note::noteHead(0, NoteHeadGroup::HEAD_NORMAL, ht);
}
return t;

View file

@ -450,7 +450,7 @@ struct BEDrawingDataY {
/*
static void printBBox(const char* name, const RectF b)
{
qDebug("bbox%s left %f bot %f right %f top %f",
LOGD("bbox%s left %f bot %f right %f top %f",
name,
b.left(),
b.bottom(),
@ -460,13 +460,13 @@ static void printBBox(const char* name, const RectF b)
static void symMetrics(const char* name, const Sym& headsym)
{
qDebug("%s", name);
qDebug("bbox left %f bot %f right %f top %f",
LOGD("%s", name);
LOGD("bbox left %f bot %f right %f top %f",
headsym.getBbox().left(),
headsym.getBbox().bottom(),
headsym.getBbox().right(),
headsym.getBbox().top());
qDebug("attach x %f y %f",
LOGD("attach x %f y %f",
headsym.getAttach().x(),
headsym.getAttach().y());
}
@ -491,7 +491,7 @@ void BagpipeEmbellishment::layout()
{
/*
if (_embelType == 0 || _embelType == 8 || _embelType == 9) {
qDebug("BagpipeEmbellishment::layout st %d", _embelType);
LOGD("BagpipeEmbellishment::layout st %d", _embelType);
}
*/
SymId headsym = SymId::noteheadBlack;
@ -505,7 +505,7 @@ void BagpipeEmbellishment::layout()
if (_embelType == 0 || _embelType == 8 || _embelType == 9) {
symMetrics("headsym", headsym);
symMetrics("flagsym", flagsym);
qDebug("mags %f headw %f headp %f spatium %f xl %f",
LOGD("mags %f headw %f headp %f spatium %f xl %f",
dx.mags, dx.headw, dx.headp, dx.spatium, dx.xl);
}
*/

View file

@ -1424,7 +1424,7 @@ void BarLine::add(EngravingItem* e)
e->added();
break;
default:
qDebug("BarLine::add() not impl. %s", e->typeName());
LOGD("BarLine::add() not impl. %s", e->typeName());
delete e;
break;
}
@ -1441,13 +1441,13 @@ void BarLine::remove(EngravingItem* e)
case ElementType::SYMBOL:
case ElementType::IMAGE:
if (!_el.remove(e)) {
qDebug("BarLine::remove(): cannot find %s", e->typeName());
LOGD("BarLine::remove(): cannot find %s", e->typeName());
} else {
e->removed();
}
break;
default:
qDebug("BarLine::remove() not impl. %s", e->typeName());
LOGD("BarLine::remove() not impl. %s", e->typeName());
return;
}
}

View file

@ -219,7 +219,7 @@ void Beam::addChordRest(ChordRest* a)
void Beam::removeChordRest(ChordRest* a)
{
if (!mu::remove(_elements, a)) {
qDebug("Beam::remove(): cannot find ChordRest");
LOGD("Beam::remove(): cannot find ChordRest");
}
a->setBeam(0);
}

View file

@ -43,6 +43,8 @@
#include "measure.h"
#include "undo.h"
#include "log.h"
using namespace mu;
using namespace mu::engraving;
using namespace mu::draw;
@ -287,7 +289,7 @@ bool Box::readProperties(XmlReader& e)
t = Factory::createText(this);
t->read(e);
if (t->empty()) {
qDebug("read empty text");
LOGD("read empty text");
} else {
add(t);
}
@ -531,7 +533,7 @@ bool Box::acceptDrop(EditData& data) const
return false;
}
if (MScore::debugMode) {
qDebug("<%s>", data.dropElement->typeName());
LOGD("<%s>", data.dropElement->typeName());
}
ElementType t = data.dropElement->type();
switch (t) {
@ -572,7 +574,7 @@ EngravingItem* Box::drop(EditData& data)
return 0;
}
if (MScore::debugMode) {
qDebug("<%s>", e->typeName());
LOGD("<%s>", e->typeName());
}
switch (e->type()) {
case ElementType::LAYOUT_BREAK:
@ -888,7 +890,7 @@ void FBox::add(EngravingItem* e)
// FretDiagram* fd = toFretDiagram(e);
// fd->setFlag(ElementFlag::MOVABLE, false);
} else {
qDebug("FBox::add: element not allowed");
LOGD("FBox::add: element not allowed");
return;
}
el().push_back(e);

View file

@ -629,7 +629,7 @@ void Bracket::read(XmlReader& e)
} else if (t == "Line") {
_bi->setBracketType(BracketType::LINE);
} else {
qDebug("unknown brace type <%s>", qPrintable(t));
LOGD("unknown brace type <%s>", qPrintable(t));
}
while (e.readNextStartElement()) {

View file

@ -114,7 +114,7 @@ void BSymbol::add(EngravingItem* e)
toBSymbol(e)->setZ(z() - 1); // draw on top of parent
e->added();
} else {
qDebug("BSymbol::add: unsupported type %s", e->typeName());
LOGD("BSymbol::add: unsupported type %s", e->typeName());
}
}
@ -140,10 +140,10 @@ void BSymbol::remove(EngravingItem* e)
if (mu::remove(_leafs, e)) {
e->removed();
} else {
qDebug("BSymbol::remove: element <%s> not found", e->typeName());
LOGD("BSymbol::remove: element <%s> not found", e->typeName());
}
} else {
qDebug("BSymbol::remove: unsupported type %s", e->typeName());
LOGD("BSymbol::remove: unsupported type %s", e->typeName());
}
}

View file

@ -444,7 +444,7 @@ void ChangeMap::cleanup()
return;
}
// qDebug() << "Before cleanup:";
// LOGD() << "Before cleanup:";
// dump();
cleanupStage0();
@ -452,7 +452,7 @@ void ChangeMap::cleanup()
cleanupStage3();
cleanedUp = true;
// qDebug() << "After cleanup:";
// LOGD() << "After cleanup:";
// dump();
}

View file

@ -66,7 +66,7 @@ void Score::checkScore()
}
}
if (empty) {
qDebug("checkScore: remove empty ChordRest segment");
LOGD("checkScore: remove empty ChordRest segment");
}
}
s = ns;
@ -184,7 +184,7 @@ bool Score::sanityCheck(const QString& name)
QJsonDocument jsonDoc(json);
QFile fp(name);
if (!fp.open(QIODevice::WriteOnly)) {
qDebug("Open <%s> failed", qPrintable(name));
LOGD("Open <%s> failed", qPrintable(name));
return false;
}
fp.write(jsonDoc.toJson(QJsonDocument::Compact));
@ -214,7 +214,7 @@ bool Score::checkKeys()
}
}
if (staff(i)->key(m->tick()) != k) {
qDebug("measure %d (tick %d) : key %d, map %d", m->no(), m->tick().ticks(), int(k),
LOGD("measure %d (tick %d) : key %d, map %d", m->no(), m->tick().ticks(), int(k),
int(staff(i)->key(m->tick())));
rc = false;
}
@ -229,7 +229,7 @@ bool Score::checkKeys()
void Measure::fillGap(const Fraction& pos, const Fraction& len, track_idx_t track, const Fraction& stretch, bool useGapRests)
{
qDebug("measure %6d pos %d, len %d/%d, stretch %d/%d track %zu",
LOGD("measure %6d pos %d, len %d/%d, stretch %d/%d track %zu",
tick().ticks(),
pos.ticks(),
len.numerator(), len.denominator(),
@ -279,11 +279,11 @@ void Measure::checkMeasure(staff_idx_t staffIdx, bool useGapRests)
currentPos = seg->rtick() * stretch;
if (currentPos < expectedPos) {
qDebug("in measure overrun %6d at %d-%d track %zu", tick().ticks(),
LOGD("in measure overrun %6d at %d-%d track %zu", tick().ticks(),
(currentPos / stretch).ticks(), (expectedPos / stretch).ticks(), track);
break;
} else if (currentPos > expectedPos) {
qDebug("in measure underrun %6d at %d-%d track %zu", tick().ticks(),
LOGD("in measure underrun %6d at %d-%d track %zu", tick().ticks(),
(currentPos / stretch).ticks(), (expectedPos / stretch).ticks(), track);
fillGap(expectedPos, currentPos - expectedPos, track, stretch, useGapRests);
}
@ -302,7 +302,7 @@ void Measure::checkMeasure(staff_idx_t staffIdx, bool useGapRests)
fillGap(expectedPos, f - expectedPos, track, stretch);
}
} else if (f < expectedPos) {
qDebug("measure overrun %6d, %d > %d, track %zu", tick().ticks(), expectedPos.ticks(), f.ticks(), track);
LOGD("measure overrun %6d, %d > %d, track %zu", tick().ticks(), expectedPos.ticks(), f.ticks(), track);
}
}
}

View file

@ -737,7 +737,7 @@ void Chord::remove(EngravingItem* e)
note->removeSpannerFor(s);
}
} else {
qDebug("Chord::remove() note %p not found!", e);
LOGD("Chord::remove() note %p not found!", e);
}
if (voice() && measure() && note->visible()) {
measure()->checkMultiVoices(staffIdx());
@ -783,7 +783,7 @@ void Chord::remove(EngravingItem* e)
{
Articulation* a = toArticulation(e);
if (!mu::remove(_articulations, a)) {
qDebug("ChordRest::remove(): articulation not found");
LOGD("ChordRest::remove(): articulation not found");
}
}
break;
@ -2960,13 +2960,13 @@ EngravingItem* Chord::drop(EditData& data)
s = s->next();
}
if (s == 0) {
qDebug("no segment for second note of tremolo found");
LOGD("no segment for second note of tremolo found");
delete e;
return 0;
}
Chord* ch2 = toChord(s->element(track()));
if (ch2->ticks() != ticks()) {
qDebug("no matching chord for second note of tremolo found");
LOGD("no matching chord for second note of tremolo found");
delete e;
return 0;
}

View file

@ -33,6 +33,8 @@
#include "config.h"
#include "log.h"
using namespace mu;
namespace Ms {
@ -271,7 +273,7 @@ void HChord::print() const
for (int i = 0; i < 12; i++) {
if (contains(i)) {
qDebug(" %s", names[i]);
LOGD(" %s", names[i]);
}
}
}
@ -282,7 +284,7 @@ void HChord::print() const
void HChord::add(const std::vector<HDegree>& degreeList)
{
// qDebug("HChord::add ");print();
// LOGD("HChord::add ");print();
// convert degrees to semitones
static const int degreeTable[] = {
// 1 2 3 4 5 6 7
@ -305,7 +307,7 @@ void HChord::add(const std::vector<HDegree>& degreeList)
*this -= dv1;
*this += dv;
} else {
// qDebug("HDegreeType::ALTER: chord does not contain degree %d(%d):",
// LOGD("HDegreeType::ALTER: chord does not contain degree %d(%d):",
// d.value(), d.alter());
// print();
*this += dv; // DEBUG: default to add
@ -314,14 +316,14 @@ void HChord::add(const std::vector<HDegree>& degreeList)
if (contains(dv1)) {
*this -= dv1;
} else {
qDebug("SUB: chord does not contain degree %d(%d):",
d.value(), d.alter());
LOGD("SUB: chord does not contain degree %d(%d):",
d.value(), d.alter());
}
} else {
qDebug("degree type %d not supported", static_cast<int>(d.type()));
LOGD("degree type %d not supported", static_cast<int>(d.type()));
}
// qDebug(" HCHord::added "); print();
// LOGD(" HCHord::added "); print();
}
}
@ -1155,12 +1157,12 @@ bool ParsedChord::parse(const QString& s, const ChordList* cl, bool syntaxOnly,
_xmlDegrees.clear();
}
if (MScore::debugMode) {
qDebug("parse: source = <%s>, handle = %s", qPrintable(s), qPrintable(_handle));
LOGD("parse: source = <%s>, handle = %s", qPrintable(s), qPrintable(_handle));
if (!syntaxOnly) {
qDebug("parse: HChord = <%s> (%d)", qPrintable(chord.voicing()), chord.getKeys());
qDebug("parse: xmlKind = <%s>, text = <%s>", qPrintable(_xmlKind), qPrintable(_xmlText));
qDebug("parse: xmlSymbols = %s, xmlParens = %s", qPrintable(_xmlSymbols), qPrintable(_xmlParens));
qDebug("parse: xmlDegrees = <%s>", qPrintable(_xmlDegrees.join(",")));
LOGD("parse: HChord = <%s> (%d)", qPrintable(chord.voicing()), chord.getKeys());
LOGD("parse: xmlKind = <%s>, text = <%s>", qPrintable(_xmlKind), qPrintable(_xmlText));
LOGD("parse: xmlSymbols = %s, xmlParens = %s", qPrintable(_xmlSymbols), qPrintable(_xmlParens));
LOGD("parse: xmlDegrees = <%s>", qPrintable(_xmlDegrees.join(",")));
}
}
return _parseable;
@ -1819,7 +1821,7 @@ void ChordList::write(XmlWriter& xml) const
bool ChordList::read(const QString& name)
{
// qDebug("ChordList::read <%s>", qPrintable(name));
// LOGD("ChordList::read <%s>", qPrintable(name));
QString path;
QFileInfo ftest(name);
if (ftest.isAbsolute()) {
@ -1856,7 +1858,7 @@ bool ChordList::read(const QString& name)
QFile f(path);
if (!f.open(QIODevice::ReadOnly)) {
MScore::lastError = QObject::tr("Cannot open chord description:\n%1\n%2").arg(f.fileName(), f.errorString());
qDebug("ChordList::read failed: <%s>", qPrintable(path));
LOGD("ChordList::read failed: <%s>", qPrintable(path));
return false;
}
@ -1987,6 +1989,6 @@ void RenderAction::print() const
"SET", "MOVE", "PUSH", "POP",
"NOTE", "ACCIDENTAL"
};
qDebug("%10s <%s> %f %f", names[int(type)], qPrintable(text), movex, movey);
LOGD("%10s <%s> %f %f", names[int(type)], qPrintable(text), movex, movey);
}
}

View file

@ -241,7 +241,7 @@ bool ChordRest::readProperties(XmlReader& e)
atr->read(e);
add(atr);
} else if (tag == "leadingSpace" || tag == "trailingSpace") {
qDebug("ChordRest: %s obsolete", tag.toLocal8Bit().data());
LOGD("ChordRest: %s obsolete", tag.toLocal8Bit().data());
e.skipCurrentElement();
} else if (tag == "small") {
m_isSmall = e.readInt();
@ -350,7 +350,7 @@ void ChordRest::readAddConnector(ConnectorInfoReader* info, bool pasteMode)
}
}
} else {
qDebug("ChordRest::readAddConnector(): Slur end is neither start nor end");
LOGD("ChordRest::readAddConnector(): Slur end is neither start nor end");
}
}
break;
@ -526,7 +526,7 @@ EngravingItem* ChordRest::drop(EditData& data)
}
case ElementType::INSTRUMENT_CHANGE:
if (part()->instruments().find(tick().ticks()) != part()->instruments().end()) {
qDebug() << "InstrumentChange already exists at tick = " << tick().ticks();
LOGD() << "InstrumentChange already exists at tick = " << tick().ticks();
delete e;
return 0;
} else {
@ -609,7 +609,7 @@ EngravingItem* ChordRest::drop(EditData& data)
score()->undoAddElement(spanner);
return e;
}
qDebug("cannot drop %s", e->typeName());
LOGD("cannot drop %s", e->typeName());
delete e;
return 0;
}
@ -718,7 +718,7 @@ void ChordRest::add(EngravingItem* e)
e->setTrack(track());
switch (e->type()) {
case ElementType::ARTICULATION: // for backward compatibility
qDebug("ChordRest::add: unknown element %s", e->typeName());
LOGD("ChordRest::add: unknown element %s", e->typeName());
break;
case ElementType::LYRICS:
if (e->isStyled(Pid::OFFSET)) {
@ -747,7 +747,7 @@ void ChordRest::remove(EngravingItem* e)
_lyrics.erase(i);
e->removed();
} else {
qDebug("ChordRest::remove: %s %p not found", e->typeName(), e);
LOGD("ChordRest::remove: %s %p not found", e->typeName(), e);
}
}
break;

View file

@ -42,6 +42,8 @@
#include "stafftype.h"
#include "part.h"
#include "log.h"
using namespace mu;
using namespace mu::engraving;
@ -150,8 +152,8 @@ void Clef::layout()
if (!show) {
setbbox(RectF());
symId = SymId::noSym;
qDebug("Clef::layout(): invisible clef at tick %d(%d) staff %zu",
segment()->tick().ticks(), segment()->tick().ticks() / 1920, staffIdx());
LOGD("Clef::layout(): invisible clef at tick %d(%d) staff %zu",
segment()->tick().ticks(), segment()->tick().ticks() / 1920, staffIdx());
return;
}
lines = st->lines(); // init values from staff type
@ -206,7 +208,7 @@ void Clef::layout()
break;
case ClefType::INVALID:
case ClefType::MAX:
qDebug("Clef::layout: invalid type");
LOGD("Clef::layout: invalid type");
return;
default:
break;

View file

@ -241,7 +241,7 @@ void CmdState::setUpdateMode(UpdateMode m)
void Score::startCmd()
{
if (MScore::debugMode) {
qDebug("===startCmd()");
LOGD("===startCmd()");
}
MScore::setError(MsError::MS_NO_ERROR);
@ -251,7 +251,7 @@ void Score::startCmd()
// Start collecting low-level undo operations for a
// user-visible undo action.
if (undoStack()->active()) {
qDebug("Score::startCmd(): cmd already active");
LOGD("Score::startCmd(): cmd already active");
return;
}
undoStack()->beginMacro(this);
@ -375,7 +375,7 @@ ScoreChangesRange Score::changesRange() const
void CmdState::dump()
{
qDebug("CmdState: mode %d %d-%d", int(_updateMode), _startTick.ticks(), _endTick.ticks());
LOGD("CmdState: mode %d %d-%d", int(_updateMode), _startTick.ticks(), _endTick.ticks());
// bool _excerptsChanged { false };
// bool _instrumentsChanged { false };
}
@ -476,7 +476,7 @@ void Score::cmdAddSpanner(Spanner* spanner, const PointF& pos, bool systemStaves
}
// ignore if we do not have a measure
if (mb == 0 || mb->type() != ElementType::MEASURE) {
qDebug("cmdAddSpanner: cannot put object here");
LOGD("cmdAddSpanner: cannot put object here");
delete spanner;
return;
}
@ -545,7 +545,7 @@ void Score::cmdAddSpanner(Spanner* spanner, staff_idx_t staffIdx, Segment* start
void Score::expandVoice(Segment* s, track_idx_t track)
{
if (!s) {
qDebug("expand voice: no segment");
LOGD("expand voice: no segment");
return;
}
if (s->element(track)) {
@ -564,7 +564,7 @@ void Score::expandVoice(Segment* s, track_idx_t track)
Fraction tick = cr->tick() + cr->actualTicks();
if (tick > s->tick()) {
// previous cr extends past current segment
qDebug("expandVoice: cannot insert element here");
LOGD("expandVoice: cannot insert element here");
return;
}
if (cr->isChord()) {
@ -821,7 +821,7 @@ Segment* Score::setNoteRest(Segment* segment, track_idx_t track, NoteVal nval, F
Fraction dd = makeGap(segment, track, sd, tuplet);
if (dd.isZero()) {
qDebug("cannot get gap at %d type: %d/%d", tick.ticks(), sd.numerator(),
LOGD("cannot get gap at %d type: %d/%d", tick.ticks(), sd.numerator(),
sd.denominator());
break;
}
@ -903,7 +903,7 @@ Segment* Score::setNoteRest(Segment* segment, track_idx_t track, NoteVal nval, F
Segment* nseg = tick2segment(tick, false, SegmentType::ChordRest);
if (!nseg) {
qDebug("reached end of score");
LOGD("reached end of score");
break;
}
segment = nseg;
@ -914,7 +914,7 @@ Segment* Score::setNoteRest(Segment* segment, track_idx_t track, NoteVal nval, F
if (track % VOICES) {
cr = addRest(segment, track, TDuration(DurationType::V_MEASURE), 0);
} else {
qDebug("no rest in voice 0");
LOGD("no rest in voice 0");
break;
}
}
@ -1166,7 +1166,7 @@ bool Score::makeGap1(const Fraction& baseTick, staff_idx_t staffIdx, const Fract
{
Segment* seg = tick2segment(baseTick, true, SegmentType::ChordRest);
if (!seg) {
qDebug("no segment to paste at tick %d", baseTick.ticks());
LOGD("no segment to paste at tick %d", baseTick.ticks());
return false;
}
track_idx_t strack = staffIdx * VOICES;
@ -1211,7 +1211,7 @@ bool Score::makeGapVoice(Segment* seg, track_idx_t track, Fraction len, const Fr
for (;;) {
if (seg1 == 0) {
if (!(track % VOICES)) {
qDebug("no segment before tick %d", tick.ticks());
LOGD("no segment before tick %d", tick.ticks());
}
// this happens only for voices other than voice 1
expandVoice(seg, track);
@ -1259,7 +1259,7 @@ bool Score::makeGapVoice(Segment* seg, track_idx_t track, Fraction len, const Fr
for (;;) {
seg1 = seg1->next1(SegmentType::ChordRest);
if (seg1 == 0) {
qDebug("no segment");
LOGD("no segment");
return false;
}
if (seg1->element(track)) {
@ -1271,12 +1271,12 @@ bool Score::makeGapVoice(Segment* seg, track_idx_t track, Fraction len, const Fr
for (;;) {
if (!cr) {
qDebug("cannot make gap");
LOGD("cannot make gap");
return false;
}
Fraction l = makeGap(cr->segment(), cr->track(), len, 0);
if (l.isZero()) {
qDebug("returns zero gap");
LOGD("returns zero gap");
return false;
}
len -= l;
@ -1286,13 +1286,13 @@ bool Score::makeGapVoice(Segment* seg, track_idx_t track, Fraction len, const Fr
// go to next cr
Measure* m = cr->measure()->nextMeasure();
if (!m) {
qDebug("EOS reached");
LOGD("EOS reached");
InsertMeasureOptions options;
options.createEmptyMeasures = false;
insertMeasure(ElementType::MEASURE, nullptr, options);
m = cr->measure()->nextMeasure();
if (!m) {
qDebug("===EOS reached");
LOGD("===EOS reached");
return true;
}
}
@ -1328,7 +1328,7 @@ std::list<Fraction> Score::splitGapToMeasureBoundaries(ChordRest* cr, Fraction g
rest -= de->ticks();
}
if (rest < gap) {
qDebug("does not fit in tuplet");
LOGD("does not fit in tuplet");
} else {
flist.push_back(gap);
}
@ -1663,19 +1663,19 @@ void Score::upDown(bool up, UpDownMode mode)
{ // without changing the string
// compute new fret
if (!stringData->frets()) {
qDebug("upDown tab chromatic: no frets?");
LOGD("upDown tab chromatic: no frets?");
return;
}
fret += (up ? 1 : -1);
if (fret < 0 || fret > stringData->frets()) {
qDebug("upDown tab in-string: out of fret range");
LOGD("upDown tab in-string: out of fret range");
return;
}
// update pitch and tpc's and check it matches stringData
upDownChromatic(up, pitch, oNote, key, tpc1, tpc2, newPitch, newTpc1, newTpc2);
if (newPitch != stringData->getPitch(string, fret, staff)) {
// oh-oh: something went very wrong!
qDebug("upDown tab in-string: pitch mismatch");
LOGD("upDown tab in-string: pitch mismatch");
return;
}
// store the fretting change before undoChangePitch() chooses
@ -2099,7 +2099,7 @@ void Score::moveUp(ChordRest* cr)
// we know that staffMove+rstaff-1 index exists due to the previous condition.
if (staff->staffType(cr->tick())->group() != StaffGroup::STANDARD
|| staves.at(rstaff + staffMove - 1)->staffType(cr->tick())->group() != StaffGroup::STANDARD) {
qDebug("User attempted to move a note from/to a staff which does not use standard notation - ignoring.");
LOGD("User attempted to move a note from/to a staff which does not use standard notation - ignoring.");
} else {
// move the chord up a staff
undo(new ChangeChordStaffMove(cr, staffMove - 1));
@ -2120,7 +2120,7 @@ void Score::moveDown(ChordRest* cr)
size_t rstaves = part->nstaves();
if ((staffMove == 1) || (rstaff + staffMove >= rstaves - 1)) {
qDebug("moveDown staffMove==%d rstaff %zu rstaves %zu", staffMove, rstaff, rstaves);
LOGD("moveDown staffMove==%d rstaff %zu rstaves %zu", staffMove, rstaff, rstaves);
return;
}
@ -2128,7 +2128,7 @@ void Score::moveDown(ChordRest* cr)
// we know that staffMove+rstaff+1 index exists due to the previous condition.
if (staff->staffType(cr->tick())->group() != StaffGroup::STANDARD
|| staves.at(staffMove + rstaff + 1)->staffType(cr->tick())->group() != StaffGroup::STANDARD) {
qDebug("User attempted to move a note from/to a staff which does not use standard notation - ignoring.");
LOGD("User attempted to move a note from/to a staff which does not use standard notation - ignoring.");
} else {
// move the chord down a staff
undo(new ChangeChordStaffMove(cr, staffMove + 1));
@ -2172,7 +2172,7 @@ void Score::cmdResetBeamMode()
if (noSelection) {
cmdSelectAll();
} else if (!selection().isRange()) {
qDebug("no system or staff selected");
LOGD("no system or staff selected");
return;
}
@ -2242,7 +2242,7 @@ void Score::cmdResetNoteAndRestGroupings()
if (noSelection) {
cmdSelectAll();
} else if (!selection().isRange()) {
qDebug("no system or staff selected");
LOGD("no system or staff selected");
return;
}
@ -3635,7 +3635,7 @@ Segment* Score::setChord(Segment* segment, track_idx_t track, Chord* chordTempla
Fraction dd = makeGap(segment, track, tDur, t);
if (dd.isZero()) {
qDebug("cannot get gap at %d type: %d/%d", tick.ticks(), dur.numerator(),
LOGD("cannot get gap at %d type: %d/%d", tick.ticks(), dur.numerator(),
dur.denominator());
break;
}
@ -3699,7 +3699,7 @@ Segment* Score::setChord(Segment* segment, track_idx_t track, Chord* chordTempla
//go to next segment unless we are at the score (which means we will just be done there)
Segment* nseg = tick2segment(tick, false, SegmentType::ChordRest);
if (!nseg) {
qDebug("reached end of score");
LOGD("reached end of score");
break;
}
segment = nseg;
@ -3710,7 +3710,7 @@ Segment* Score::setChord(Segment* segment, track_idx_t track, Chord* chordTempla
if (track % VOICES) {
cr = addRest(segment, track, TDuration(DurationType::V_MEASURE), 0);
} else {
qDebug("no rest in voice 0");
LOGD("no rest in voice 0");
break;
}
}
@ -4217,7 +4217,7 @@ void Score::cmdAddPitch(const EditData& ed, int note, bool addFlag, bool insert)
return;
}
if (is.segment() == 0) {
qDebug("cannot enter notes here (no chord rest at current position)");
LOGD("cannot enter notes here (no chord rest at current position)");
return;
}
is.setRest(false);
@ -4238,7 +4238,7 @@ void Score::cmdAddPitch(const EditData& ed, int note, bool addFlag, bool insert)
}
}
if (pitch == -1) {
qDebug(" shortcut %c not defined in drumset", note1);
LOGD(" shortcut %c not defined in drumset", note1);
return;
}
is.setDrumNote(pitch);
@ -4401,7 +4401,7 @@ void Score::cmdAddFret(int fret)
return;
}
if (!is.segment()) {
qDebug("cannot enter notes here (no chord rest at current position)");
LOGD("cannot enter notes here (no chord rest at current position)");
return;
}
is.setRest(false);

View file

@ -80,7 +80,7 @@ void Drumset::save(XmlWriter& xml) const
}
break;
default:
qDebug("illegal drum shortcut");
LOGD("illegal drum shortcut");
break;
}
}
@ -167,7 +167,7 @@ void Drumset::load(XmlReader& e)
{
int pitch = e.intAttribute("pitch", -1);
if (pitch < 0 || pitch > 127) {
qDebug("load drumset: invalid pitch %d", pitch);
LOGD("load drumset: invalid pitch %d", pitch);
return;
}
while (e.readNextStartElement()) {

View file

@ -101,7 +101,7 @@ void TDuration::setVal(int ticks)
return;
}
}
qDebug("2: no duration type for ticks %d", ticks);
LOGD("2: no duration type for ticks %d", ticks);
_val = DurationType::V_QUARTER; // fallback default value
}
}
@ -492,7 +492,7 @@ std::vector<TDuration> toDurationList(Fraction l, bool useDots, int maxDots, boo
}
if (printRestRemains && l.numerator() != 0) {
qDebug("toDurationList:: rest remains %d/%d", l.numerator(), l.denominator());
LOGD("toDurationList:: rest remains %d/%d", l.numerator(), l.denominator());
}
return dList;

View file

@ -369,7 +369,7 @@ void Dynamic::setDynamicType(const QString& tag)
return;
}
}
qDebug("setDynamicType: other <%s>", qPrintable(tag));
LOGD("setDynamicType: other <%s>", qPrintable(tag));
setDynamicType(DynamicType::OTHER);
setXmlText(tag);
}

View file

@ -339,7 +339,7 @@ Chord* Score::addChord(const Fraction& tick, TDuration d, Chord* oc, bool genTie
{
Measure* measure = tick2measure(tick);
if (measure->endTick() <= tick) {
qDebug("Score::addChord(): end of score?");
LOGD("Score::addChord(): end of score?");
return 0;
}
@ -1092,7 +1092,7 @@ bool Score::rewriteMeasures(Measure* fm, const Fraction& ns, staff_idx_t staffId
sectionBreak->setParent(lastMeasure());
undoAddElement(sectionBreak);
} else {
qDebug("unable to restore section break");
LOGD("unable to restore section break");
nm = nullptr;
sectionBreak = nullptr;
}
@ -1216,7 +1216,7 @@ void Score::cmdAddTimeSig(Measure* fm, staff_idx_t staffIdx, TimeSig* ts, bool l
endStaffIdx = startStaffIdx + 1;
} else {
// TODO: get index for this score
qDebug("cmdAddTimeSig: unable to write local time signature change to linked score");
LOGD("cmdAddTimeSig: unable to write local time signature change to linked score");
startStaffIdx = 0;
endStaffIdx = 0;
}
@ -1719,7 +1719,7 @@ void Score::cmdAddTie(bool addToChord)
const std::vector<Note*> noteList = cmdTieNoteList(selection(), noteEntryMode());
if (noteList.empty()) {
qDebug("no notes selected");
LOGD("no notes selected");
return;
}
@ -1727,7 +1727,7 @@ void Score::cmdAddTie(bool addToChord)
Chord* lastAddedChord = 0;
for (Note* note : noteList) {
if (note->tieFor()) {
qDebug("cmdAddTie: note %p has already tie? noteFor: %p", note, note->tieFor());
LOGD("cmdAddTie: note %p has already tie? noteFor: %p", note, note->tieFor());
if (addToChord) {
continue;
} else {
@ -1836,7 +1836,7 @@ void Score::cmdToggleTie()
const std::vector<Note*> noteList = cmdTieNoteList(selection(), noteEntryMode());
if (noteList.empty()) {
qDebug("no notes selected");
LOGD("no notes selected");
return;
}
@ -2017,12 +2017,12 @@ void Score::addNoteLine()
}
if (!firstNote || !lastNote) {
qDebug("addNoteLine: no note %p %p", firstNote, lastNote);
LOGD("addNoteLine: no note %p %p", firstNote, lastNote);
return;
}
if (firstNote == lastNote) {
qDebug("addNoteLine: no support for note to same note line %p", firstNote);
LOGD("addNoteLine: no support for note to same note line %p", firstNote);
return;
}
@ -2223,7 +2223,7 @@ void Score::deleteItem(EngravingItem* el)
if (el->generated() && !(el->isBracket() || el->isBarLine() || el->isClef() || el->isMeasureNumber())) {
return;
}
// qDebug("%s", el->typeName());
// LOGD("%s", el->typeName());
switch (el->type()) {
case ElementType::INSTRUMENT_NAME: {
@ -2244,7 +2244,7 @@ void Score::deleteItem(EngravingItem* el)
Measure* m = s->measure();
Segment* ns = m->findSegment(s->segmentType(), s->tick());
if (!ns || (ns->element(ts->track()) != ts)) {
qDebug("deleteItem: not found");
LOGD("deleteItem: not found");
break;
}
cmdRemoveTimeSig(ts);
@ -2628,7 +2628,7 @@ void Score::deleteItem(EngravingItem* el)
case ElementType::STEM_SLASH: // cannot delete this elements
case ElementType::HOOK:
qDebug("cannot remove %s", el->typeName());
LOGD("cannot remove %s", el->typeName());
break;
case ElementType::TEXT:
@ -3459,7 +3459,7 @@ void Score::cmdExchangeVoice(int s, int d)
void Score::cmdEnterRest(const TDuration& d)
{
if (_is.track() == mu::nidx) {
qDebug("cmdEnterRest: track invalid");
LOGD("cmdEnterRest: track invalid");
return;
}
startCmd();
@ -3478,7 +3478,7 @@ void Score::enterRest(const TDuration& d, InputState* externalInputState)
expandVoice(is.segment(), is.track());
if (!is.cr()) {
qDebug("cannot enter rest here");
LOGD("cannot enter rest here");
return;
}
@ -3626,7 +3626,7 @@ MeasureBase* Score::insertMeasure(ElementType type, MeasureBase* beforeMeasure,
if (beforeMeasure->score() == score) {
im = beforeMeasure;
} else {
qDebug("no links");
LOGD("no links");
}
} else {
for (EngravingObject* m : *beforeMeasure->links()) {
@ -3638,7 +3638,7 @@ MeasureBase* Score::insertMeasure(ElementType type, MeasureBase* beforeMeasure,
}
}
if (!im) {
qDebug("measure not found");
LOGD("measure not found");
}
}
MeasureBase* mb = toMeasureBase(Factory::createItem(type, score->dummy()));
@ -3837,7 +3837,7 @@ void Score::checkSpanner(const Fraction& startTick, const Fraction& endTick)
s->computeStartElement();
if (!s->startElement()) {
sl.push_back(s);
qDebug("checkSpanner::remove (3)");
LOGD("checkSpanner::remove (3)");
} else {
if (s->tick2() > lastTick) {
sl2.push_back(s); //s->undoChangeProperty(Pid::SPANNER_TICKS, lastTick - s->tick());
@ -3936,7 +3936,7 @@ bool Score::checkTimeDelete(Segment* startSegment, Segment* endSegment)
void Score::globalTimeDelete()
{
qDebug("not implemented");
LOGD("not implemented");
}
//---------------------------------------------------------
@ -4293,7 +4293,7 @@ void Score::cloneVoice(track_idx_t strack, track_idx_t dtrack, Segment* sf, cons
nn->setTieBack(tie);
tie->setEndNote(nn);
} else {
qDebug("cloneVoices: cannot find tie");
LOGD("cloneVoices: cannot find tie");
}
}
// add back spanners (going back from end to start spanner element
@ -4311,7 +4311,7 @@ void Score::cloneVoice(track_idx_t strack, track_idx_t dtrack, Segment* sf, cons
newSp->setNoteSpan(newStart, nn);
addElement(newSp);
} else {
qDebug("cloneVoices: cannot find spanner start note");
LOGD("cloneVoices: cannot find spanner start note");
}
}
}
@ -4319,7 +4319,7 @@ void Score::cloneVoice(track_idx_t strack, track_idx_t dtrack, Segment* sf, cons
if (och->tremolo() && och->tremolo()->twoNotes()) {
if (och == och->tremolo()->chord1()) {
if (tremolo) {
qDebug("unconnected two note tremolo");
LOGD("unconnected two note tremolo");
}
if (link) {
tremolo = toTremolo(och->tremolo()->linkedClone());
@ -4333,13 +4333,13 @@ void Score::cloneVoice(track_idx_t strack, track_idx_t dtrack, Segment* sf, cons
nch->setTremolo(tremolo);
} else if (och == och->tremolo()->chord2()) {
if (!tremolo) {
qDebug("first note for two note tremolo missing");
LOGD("first note for two note tremolo missing");
} else {
tremolo->setChords(tremolo->chord1(), nch);
nch->setTremolo(tremolo);
}
} else {
qDebug("inconsistent two note tremolo");
LOGD("inconsistent two note tremolo");
}
}
}
@ -5742,7 +5742,7 @@ void Score::undoAddCR(ChordRest* cr, Measure* measure, const Fraction& tick)
Score* score = staff->score();
Measure* m = (score == this) ? measure : score->tick2measure(tick);
if (!m) {
qDebug("measure not found");
LOGD("measure not found");
break;
}
Segment* seg = m->undoGetSegment(segmentType, tick);

View file

@ -723,7 +723,7 @@ PointF EngravingItem::pagePos() const
}
if (system) {
if (system->staves().size() <= idx) {
qDebug("staffIdx out of bounds: %s", typeName());
LOGD("staffIdx out of bounds: %s", typeName());
}
p.ry() += system->staffYpage(idx);
}
@ -1034,7 +1034,7 @@ bool EngravingItem::readProperties(XmlReader& e)
_links = mu::value(e.linkIds(), id, nullptr);
if (!_links) {
if (!score()->isMaster()) { // DEBUG
qDebug("---link %d not found (%zu)", id, e.linkIds().size());
LOGD("---link %d not found (%zu)", id, e.linkIds().size());
}
_links = new LinkedObjects(score(), id);
e.linkIds().insert({ id, _links });
@ -1124,7 +1124,7 @@ void ElementList::replace(EngravingItem* o, EngravingItem* n)
{
auto i = find(begin(), end(), o);
if (i == end()) {
qDebug("ElementList::replace: element not found");
LOGD("ElementList::replace: element not found");
return;
}
*i = n;
@ -1247,7 +1247,7 @@ void Compound::clear()
void EngravingItem::dump() const
{
qDebug("---EngravingItem: %s, pos(%4.2f,%4.2f)"
LOGD("---EngravingItem: %s, pos(%4.2f,%4.2f)"
"\n bbox(%g,%g,%g,%g)"
"\n abox(%g,%g,%g,%g)"
"\n parent: %p",
@ -1322,7 +1322,7 @@ EngravingItem* EngravingItem::readMimeData(Score* score, const QByteArray& data,
e.setPasteMode(true);
if (type == ElementType::INVALID) {
qDebug("cannot read type");
LOGD("cannot read type");
return nullptr;
}
@ -1340,7 +1340,7 @@ EngravingItem* EngravingItem::readMimeData(Score* score, const QByteArray& data,
void EngravingItem::add(EngravingItem* e)
{
qDebug("EngravingItem: cannot add %s to %s", e->typeName(), typeName());
LOGD("EngravingItem: cannot add %s to %s", e->typeName(), typeName());
}
//---------------------------------------------------------

View file

@ -294,7 +294,7 @@ PropertyValue EngravingObject::propertyDefault(Pid pid) const
if (sid != Sid::NOSTYLE) {
return styleValue(pid, sid);
}
// qDebug("<%s>(%d) not found in <%s>", propertyQmlName(pid), int(pid), typeName());
// LOGD("<%s>(%d) not found in <%s>", propertyQmlName(pid), int(pid), typeName());
return PropertyValue();
}
@ -506,7 +506,7 @@ void EngravingObject::writeProperty(XmlWriter& xml, Pid pid) const
}
PropertyValue p = getProperty(pid);
if (!p.isValid()) {
qDebug("%s invalid property %d <%s>", typeName(), int(pid), propertyName(pid));
LOGD("%s invalid property %d <%s>", typeName(), int(pid), propertyName(pid));
return;
}
PropertyFlags f = propertyFlags(pid);
@ -605,7 +605,7 @@ void EngravingObject::reset()
void EngravingObject::readAddConnector(ConnectorInfoReader* info, bool pasteMode)
{
Q_UNUSED(pasteMode);
qDebug("Cannot add connector %s to %s", info->connector()->typeName(), typeName());
LOGD("Cannot add connector %s to %s", info->connector()->typeName(), typeName());
}
//---------------------------------------------------------

View file

@ -220,7 +220,7 @@ void Excerpt::read(XmlReader& e)
} else if (tag == "part") {
size_t partIdx = static_cast<size_t>(e.readInt());
if (partIdx >= pl.size()) {
qDebug("Excerpt::read: bad part index");
LOGD("Excerpt::read: bad part index");
} else {
m_parts.push_back(pl.at(partIdx));
}
@ -295,7 +295,7 @@ void Excerpt::createExcerpt(Excerpt* excerpt)
MeasureBase* measure = masterScore->first();
if (!measure || !measure->isVBox()) {
qDebug("original score has no header frame");
LOGD("original score has no header frame");
masterScore->insertMeasure(ElementType::VBOX, measure);
measure = masterScore->first();
}
@ -400,7 +400,7 @@ void MasterScore::deleteExcerpt(Excerpt* excerpt)
Score* partScore = excerpt->excerptScore();
if (!partScore) {
qDebug("deleteExcerpt: no partScore");
LOGD("deleteExcerpt: no partScore");
return;
}
@ -524,10 +524,10 @@ static void cloneSpanner(Spanner* s, Score* score, track_idx_t dstTrack, track_i
}
}
if (!ns->startElement()) {
qDebug("clone Slur: no start element");
LOGD("clone Slur: no start element");
}
if (!ns->endElement()) {
qDebug("clone Slur: no end element");
LOGD("clone Slur: no end element");
}
}
score->undo(new AddElement(ns));
@ -760,7 +760,7 @@ static Ms::MeasureBase* cloneMeasure(Ms::MeasureBase* mb, Ms::Score* score, cons
nn->setTieBack(tie);
tie->setEndNote(nn);
} else {
qDebug("cloneStaves: cannot find tie");
LOGD("cloneStaves: cannot find tie");
}
}
// add back spanners (going back from end to start spanner element
@ -777,7 +777,7 @@ static Ms::MeasureBase* cloneMeasure(Ms::MeasureBase* mb, Ms::Score* score, cons
newSp->setNoteSpan(newStart, nn);
score->addElement(newSp);
} else {
qDebug("cloneStaves: cannot find spanner start note");
LOGD("cloneStaves: cannot find spanner start note");
}
}
for (Spanner* oldSp : on->spannerFor()) {
@ -791,7 +791,7 @@ static Ms::MeasureBase* cloneMeasure(Ms::MeasureBase* mb, Ms::Score* score, cons
newSp->setNoteSpan(nn, newEnd);
score->addElement(newSp);
} else {
qDebug("cloneStaves: cannot find spanner end note");
LOGD("cloneStaves: cannot find spanner end note");
}
}
}
@ -799,7 +799,7 @@ static Ms::MeasureBase* cloneMeasure(Ms::MeasureBase* mb, Ms::Score* score, cons
if (och->tremolo() && och->tremolo()->twoNotes()) {
if (och == och->tremolo()->chord1()) {
if (tremolo) {
qDebug("unconnected two note tremolo");
LOGD("unconnected two note tremolo");
}
tremolo = toTremolo(och->tremolo()->linkedClone());
tremolo->setScore(nch->score());
@ -809,13 +809,13 @@ static Ms::MeasureBase* cloneMeasure(Ms::MeasureBase* mb, Ms::Score* score, cons
nch->setTremolo(tremolo);
} else if (och == och->tremolo()->chord2()) {
if (!tremolo) {
qDebug("first note for two note tremolo missing");
LOGD("first note for two note tremolo missing");
} else {
tremolo->setChords(tremolo->chord1(), nch);
nch->setTremolo(tremolo);
}
} else {
qDebug("inconsistent two note tremolo");
LOGD("inconsistent two note tremolo");
}
}
}
@ -1077,7 +1077,7 @@ void Excerpt::cloneStaff(Staff* srcStaff, Staff* dstStaff)
for (EngravingItem* e : seg->annotations()) {
if (!e) {
qDebug("cloneStaff: corrupted annotation found.");
LOGD("cloneStaff: corrupted annotation found.");
continue;
}
if (e->generated() || e->systemFlag()) {
@ -1141,7 +1141,7 @@ void Excerpt::cloneStaff(Staff* srcStaff, Staff* dstStaff)
nn->setTieBack(tie);
tie->setEndNote(nn);
} else {
qDebug("cloneStaff: cannot find tie");
LOGD("cloneStaff: cannot find tie");
}
}
// add back spanners (going back from end to start spanner element
@ -1154,7 +1154,7 @@ void Excerpt::cloneStaff(Staff* srcStaff, Staff* dstStaff)
newSp->setNoteSpan(newStart, nn);
score->addElement(newSp);
} else {
qDebug("cloneStaff: cannot find spanner start note");
LOGD("cloneStaff: cannot find spanner start note");
}
}
}
@ -1162,7 +1162,7 @@ void Excerpt::cloneStaff(Staff* srcStaff, Staff* dstStaff)
if (och->tremolo() && och->tremolo()->twoNotes()) {
if (och == och->tremolo()->chord1()) {
if (tremolo) {
qDebug("unconnected two note tremolo");
LOGD("unconnected two note tremolo");
}
tremolo = toTremolo(och->tremolo()->linkedClone());
tremolo->setScore(nch->score());
@ -1172,13 +1172,13 @@ void Excerpt::cloneStaff(Staff* srcStaff, Staff* dstStaff)
nch->setTremolo(tremolo);
} else if (och == och->tremolo()->chord2()) {
if (!tremolo) {
qDebug("first note for two note tremolo missing");
LOGD("first note for two note tremolo missing");
} else {
tremolo->setChords(tremolo->chord1(), nch);
nch->setTremolo(tremolo);
}
} else {
qDebug("inconsistent two note tremolo");
LOGD("inconsistent two note tremolo");
}
}
}
@ -1373,7 +1373,7 @@ void Excerpt::cloneStaff2(Staff* srcStaff, Staff* dstStaff, const Fraction& star
nn->setTieBack(tie);
tie->setEndNote(nn);
} else {
qDebug("cloneStaff2: cannot find tie");
LOGD("cloneStaff2: cannot find tie");
}
}
}

View file

@ -362,7 +362,7 @@ EngravingItem* Factory::doCreateItem(ElementType type, EngravingItem* parent)
case ElementType::DUMMY:
break;
}
qDebug("cannot create type %d <%s>", int(type), Factory::name(type));
LOGD("cannot create type %d <%s>", int(type), Factory::name(type));
return 0;
}

View file

@ -112,7 +112,7 @@ bool Fermata::readProperties(XmlReader& e)
void Fermata::write(XmlWriter& xml) const
{
if (!xml.canWrite(this)) {
qDebug("%s not written", typeName());
LOGD("%s not written", typeName());
return;
}
xml.startObject(this);

View file

@ -1203,7 +1203,7 @@ void FiguredBass::layoutLines()
}
}
if (!m || !nextSegm) {
qDebug("FiguredBass layout: no segment found for tick %d", nextTick.ticks());
LOGD("FiguredBass layout: no segment found for tick %d", nextTick.ticks());
_lineLengths.resize(1); // be sure to always have
_lineLengths[0] = 0; // at least 1 item in array
return;
@ -1245,10 +1245,10 @@ void FiguredBass::layoutLines()
len = x - pageX();
} else if (i > 0 && i != sysIdx2) {
// middle line
qDebug("FiguredBass: duration indicator middle line not implemented");
LOGD("FiguredBass: duration indicator middle line not implemented");
} else if (i == sysIdx2) {
// end line
qDebug("FiguredBass: duration indicator end line not implemented");
LOGD("FiguredBass: duration indicator end line not implemented");
}
// store length item, reusing array items if already present
if (_lineLengths.size() <= segIdx) {
@ -1684,7 +1684,7 @@ bool FiguredBass::readConfigFile(const QString& fileName)
QFile fi(path);
if (!fi.open(QIODevice::ReadOnly)) {
MScore::lastError = QObject::tr("Cannot open figured bass description:\n%1\n%2").arg(fi.fileName(), fi.errorString());
qDebug("FiguredBass::read failed: <%s>", qPrintable(path));
LOGD("FiguredBass::read failed: <%s>", qPrintable(path));
return false;
}
XmlReader e(&fi);

View file

@ -1275,7 +1275,7 @@ void FretDiagram::scanElements(void* data, void (* func)(void*, EngravingItem*),
void FretDiagram::writeMusicXML(XmlWriter& xml) const
{
qDebug("FretDiagram::writeMusicXML() this %p harmony %p", this, _harmony);
LOGD("FretDiagram::writeMusicXML() this %p harmony %p", this, _harmony);
xml.startObject("frame");
xml.tag("frame-strings", _strings);
xml.tag("frame-frets", frets());

View file

@ -255,7 +255,7 @@ void Glissando::layout()
}
SLine::layout();
if (spannerSegments().empty()) {
qDebug("no segments");
LOGD("no segments");
return;
}
setPos(0.0, 0.0);
@ -559,7 +559,7 @@ Note* Glissando::guessInitialNote(Chord* chord)
}
segm = segm->prev1();
}
qDebug("no first note for glissando found");
LOGD("no first note for glissando found");
return 0;
}
@ -659,7 +659,7 @@ Note* Glissando::guessFinalNote(Chord* chord)
}
segm = segm->next1();
}
qDebug("no second note for glissando found");
LOGD("no second note for glissando found");
return 0;
}

View file

@ -160,7 +160,7 @@ BeamMode Groups::beamMode(int tick, DurationType d) const
case 2: return BeamMode::BEGIN32;
case 3: return BeamMode::BEGIN64;
default:
qDebug(" Groups::beamMode: bad action %d", action);
LOGD(" Groups::beamMode: bad action %d", action);
return BeamMode::AUTO;
}
}
@ -289,9 +289,9 @@ void Groups::addStop(int pos, DurationType d, BeamMode bm)
void Groups::dump(const char* m) const
{
qDebug("%s", m);
LOGD("%s", m);
for (const GroupNode& n : m_nodes) {
qDebug(" group tick %d action 0x%02x", n.pos * 60, n.action);
LOGD(" group tick %d action 0x%02x", n.pos * 60, n.action);
}
}
}

View file

@ -158,7 +158,7 @@ void Harmony::resolveDegreeList()
hc.add(_degreeList);
// qDebug("resolveDegreeList: <%s> <%s-%s>: ", _descr->name, _descr->xmlKind, _descr->xmlDegrees);
// LOGD("resolveDegreeList: <%s> <%s-%s>: ", _descr->name, _descr->xmlKind, _descr->xmlDegrees);
// hc.print();
// _descr->chord.print();
@ -167,13 +167,13 @@ void Harmony::resolveDegreeList()
for (const auto& p : *cl) {
const ChordDescription& cd = p.second;
if ((cd.chord == hc) && !cd.names.empty()) {
qDebug("ResolveDegreeList: found in table as %s", qPrintable(cd.names.front()));
LOGD("ResolveDegreeList: found in table as %s", qPrintable(cd.names.front()));
_id = cd.id;
_degreeList.clear();
return;
}
}
qDebug("ResolveDegreeList: not found in table");
LOGD("ResolveDegreeList: not found in table");
}
//---------------------------------------------------------
@ -387,8 +387,8 @@ void Harmony::read(XmlReader& e)
if (degreeValue <= 0 || degreeValue > 13
|| degreeAlter < -2 || degreeAlter > 2
|| (degreeType != "add" && degreeType != "alter" && degreeType != "subtract")) {
qDebug("incorrect degree: degreeValue=%d degreeAlter=%d degreeType=%s",
degreeValue, degreeAlter, qPrintable(degreeType));
LOGD("incorrect degree: degreeValue=%d degreeAlter=%d degreeType=%s",
degreeValue, degreeAlter, qPrintable(degreeType));
} else {
if (degreeType == "add") {
addDegree(HDegree(degreeValue, degreeAlter, HDegreeType::ADD));
@ -761,7 +761,7 @@ const ChordDescription* Harmony::parseHarmony(const QString& ss, int* root, int*
if (s[0] == '/') {
idx = 0;
} else {
qDebug("failed <%s>", qPrintable(ss));
LOGD("failed <%s>", qPrintable(ss));
_userName = s;
_textName = s;
return 0;
@ -888,7 +888,7 @@ bool Harmony::edit(EditData& ed)
&& root == TPC_INVALID
&& _harmonyType == HarmonyType::STANDARD;
if (_isMisspelled) {
qDebug("bad spell");
LOGD("bad spell");
}
return rv;
@ -1225,7 +1225,7 @@ const ChordDescription* Harmony::fromXml(const QString& kind, const std::list<HD
QString lowerCaseK = k.toLower(); // required for xmlKind Tristan
QStringList d = cd.xmlDegrees;
if ((lowerCaseKind == lowerCaseK) && (d == degrees)) {
// qDebug("harmony found in db: %s %s -> %d", qPrintable(kind), qPrintable(degrees), cd->id);
// LOGD("harmony found in db: %s %s -> %d", qPrintable(kind), qPrintable(degrees), cd->id);
return &cd;
}
}
@ -1712,7 +1712,7 @@ void Harmony::render(const std::list<RenderAction>& renderList, qreal& x, qreal&
qreal _spatium = spatium();
qreal mag = magS();
// qDebug("===");
// LOGD("===");
for (const RenderAction& a : renderList) {
// a.print();
if (a.type == RenderAction::RenderActionType::SET) {
@ -1741,7 +1741,7 @@ void Harmony::render(const std::list<RenderAction>& renderList, qreal& x, qreal&
x = pt.x();
y = pt.y();
} else {
qDebug("RenderAction::RenderActionType::POP: stack empty");
LOGD("RenderAction::RenderActionType::POP: stack empty");
}
} else if (a.type == RenderAction::RenderActionType::NOTE) {
QString c;
@ -1796,7 +1796,7 @@ void Harmony::render(const std::list<RenderAction>& renderList, qreal& x, qreal&
x += ts->width();
}
} else {
qDebug("unknown render action %d", static_cast<int>(a.type));
LOGD("unknown render action %d", static_cast<int>(a.type));
}
}
}

View file

@ -115,7 +115,7 @@ void Image::setImageType(ImageType t)
} else if (imageType == ImageType::RASTER) {
rasterDoc.reset();
} else {
qDebug("illegal image type");
LOGD("illegal image type");
}
}
@ -409,7 +409,7 @@ void Image::read(XmlReader& e)
bool Image::load(const QString& ss)
{
qDebug("Image::load <%s>", qPrintable(ss));
LOGD("Image::load <%s>", qPrintable(ss));
QString path(ss);
// if file path is relative, prepend score path
QFileInfo fi(path);
@ -421,7 +421,7 @@ bool Image::load(const QString& ss)
_linkIsValid = false; // assume link fname is invalid
QFile f(path);
if (!f.open(QIODevice::ReadOnly)) {
qDebug("Image::load<%s> failed", qPrintable(path));
LOGD("Image::load<%s> failed", qPrintable(path));
return false;
}
QByteArray ba = f.readAll();
@ -447,7 +447,7 @@ bool Image::load(const QString& ss)
bool Image::loadFromData(const QString& ss, const QByteArray& ba)
{
qDebug("Image::loadFromData <%s>", qPrintable(ss));
LOGD("Image::loadFromData <%s>", qPrintable(ss));
_linkIsValid = false;
_linkPath = "";

View file

@ -88,7 +88,7 @@ void ImageStoreItem::load()
}
QFile inFile(_path);
if (!inFile.open(QIODevice::ReadOnly)) {
qDebug("Cannot open picture file");
LOGD("Cannot open picture file");
return;
}
_buffer = inFile.readAll();
@ -162,10 +162,10 @@ ImageStoreItem* ImageStore::getImage(const QString& path) const
return item;
}
}
qDebug("ImageStore::getImage(%s): bad base name <%s>",
LOGD("ImageStore::getImage(%s): bad base name <%s>",
qPrintable(path), qPrintable(s));
for (ImageStoreItem* item : _items) {
qDebug(" in store: <%s>", qPrintable(item->path()));
LOGD(" in store: <%s>", qPrintable(item->path()));
}
return 0;
@ -179,7 +179,7 @@ ImageStoreItem* ImageStore::getImage(const QString& path) const
return item;
}
}
qDebug("ImageStore::getImage(): not found <%s>", qPrintable(path));
LOGD("ImageStore::getImage(): not found <%s>", qPrintable(path));
return 0;
}

View file

@ -169,7 +169,7 @@ void InstrumentGroup::read(XmlReader& e)
InstrumentTemplate* t = new InstrumentTemplate(*ttt);
instrumentTemplates.push_back(t);
} else {
qDebug("instrument reference not found <%s>", e.text().toUtf8().data());
LOGD("instrument reference not found <%s>", e.text().toUtf8().data());
}
} else if (tag == "name") {
name = qtrc("InstrumentsXML", e.readElementText().toUtf8().data());
@ -591,7 +591,7 @@ void InstrumentTemplate::read(XmlReader& e)
if (ttt) {
init(*ttt);
} else {
qDebug("InstrumentTemplate:: init instrument <%s> not found", qPrintable(val));
LOGD("InstrumentTemplate:: init instrument <%s> not found", qPrintable(val));
}
} else if (tag == "musicXMLid") {
musicXMLid = e.readElementText();
@ -629,7 +629,7 @@ void InstrumentTemplate::read(XmlReader& e)
}
if (staffCount == 0) {
qDebug(" 2Instrument: staves == 0 <%s>", qPrintable(id));
LOGD(" 2Instrument: staves == 0 <%s>", qPrintable(id));
}
}
@ -676,7 +676,7 @@ bool loadInstrumentTemplates(const QString& instrTemplates)
{
QFile qf(instrTemplates);
if (!qf.open(QIODevice::Text | QIODevice::ReadOnly)) {
qDebug("cannot load instrument templates at <%s>", qPrintable(instrTemplates));
LOGD("cannot load instrument templates at <%s>", qPrintable(instrTemplates));
return false;
}

View file

@ -87,7 +87,7 @@ static void midi_event_write(const MidiCoreEvent& e, XmlWriter& xml)
}
break;
default:
qDebug("MidiCoreEvent::write: unknown type");
LOGD("MidiCoreEvent::write: unknown type");
break;
}
}
@ -603,7 +603,7 @@ Channel::Channel()
_solo = false;
_soloMute = false;
// qDebug("construct Channel ");
// LOGD("construct Channel ");
}
//---------------------------------------------------------
@ -999,7 +999,7 @@ void Channel::switchExpressive(Synthesizer* synth, bool expressive, bool force /
// }
// const auto& info = fontsInfo.front();
// if (!info.fontName.contains("MuseScore_General", Qt::CaseInsensitive)) {
// qDebug().nospace() << "Soundfont '" << info.fontName << "' is not MuseScore General, cannot update expressive";
// LOGD().nospace() << "Soundfont '" << info.fontName << "' is not MuseScore General, cannot update expressive";
// return;
// }

View file

@ -77,7 +77,7 @@ void InstrumentName::setInstrumentNameType(const QString& s)
} else if (s == "long") {
setInstrumentNameType(InstrumentNameType::LONG);
} else {
qDebug("InstrumentName::setSubtype: unknown <%s>", qPrintable(s));
LOGD("InstrumentName::setSubtype: unknown <%s>", qPrintable(s));
}
}

View file

@ -29,6 +29,8 @@
#include "accidental.h"
#include "part.h"
#include "log.h"
using namespace mu;
namespace Ms {
@ -133,10 +135,10 @@ void KeySigEvent::enforceLimits()
{
if (_key < Key::MIN) {
_key = Key::MIN;
qDebug("key < -7");
LOGD("key < -7");
} else if (_key > Key::MAX) {
_key = Key::MAX;
qDebug("key > 7");
LOGD("key > 7");
}
}
@ -146,16 +148,16 @@ void KeySigEvent::enforceLimits()
void KeySigEvent::print() const
{
qDebug("<KeySigEvent: ");
LOGD("<KeySigEvent: ");
if (!isValid()) {
qDebug("invalid>");
LOGD("invalid>");
} else {
if (isAtonal()) {
qDebug("atonal>");
LOGD("atonal>");
} else if (custom()) {
qDebug("custom>");
LOGD("custom>");
} else {
qDebug("accidental %d>", int(_key));
LOGD("accidental %d>", int(_key));
}
}
}

View file

@ -237,7 +237,7 @@ void KeySig::layout()
case 0: accidentals = 0;
break;
default:
qDebug("illegal t1 key %d", t1);
LOGD("illegal t1 key %d", t1);
break;
}
@ -294,7 +294,7 @@ void KeySig::layout()
case 0: naturals = 0;
break;
default:
qDebug("illegal t2 key %d", int(t2));
LOGD("illegal t2 key %d", int(t2));
break;
}
// remove redundant naturals
@ -333,7 +333,7 @@ void KeySig::layout()
addLayout(symbol, lines[lineIndexOffset + i]);
}
} else {
qDebug("illegal t1 key %d", t1);
LOGD("illegal t1 key %d", t1);
}
// add suffixed naturals, if any
@ -629,7 +629,7 @@ SymId KeySig::convertFromOldId(int val) const
case 57: symId = SymId::accidentalKoron;
break;
default:
qDebug("MuseScore 1.3 symbol id corresponding to <%d> not found", val);
LOGD("MuseScore 1.3 symbol id corresponding to <%d> not found", val);
symId = SymId::noSym;
break;
}

View file

@ -215,7 +215,7 @@ void LayoutBreak::layout0()
break;
default:
qDebug("unknown layout break symbol");
LOGD("unknown layout break symbol");
break;
}

View file

@ -280,7 +280,7 @@ bool LineSegment::edit(EditData& ed)
s2 = score()->lastSegment();
}
if (!s1 && !s2) {
qDebug("LineSegment::edit: no start/end segment");
LOGD("LineSegment::edit: no start/end segment");
return true;
}
if (ed.key == Qt::Key_Left) {
@ -315,7 +315,7 @@ bool LineSegment::edit(EditData& ed)
Note* oldNote1 = note1;
Note* oldNote2 = note2;
if (!note1 && !note2) {
qDebug("LineSegment::edit: no start/end note");
LOGD("LineSegment::edit: no start/end note");
return true; // accept the event without doing anything
}
@ -423,7 +423,7 @@ bool LineSegment::edit(EditData& ed)
} else if (st == SpannerSegmentType::END) {
nls = l->backSegment();
} else {
qDebug("spannerSegmentType %d", int(spannerSegmentType()));
LOGD("spannerSegmentType %d", int(spannerSegmentType()));
}
if (nls && (nls != this)) {
@ -726,7 +726,7 @@ void LineSegment::editDrag(EditData& ed)
if (e && e->isNote()) {
SLine* l = line();
if (ed.curGrip == Grip::END && e != line()->endElement()) {
qDebug("LineSegment: move end anchor");
LOGD("LineSegment: move end anchor");
Note* noteOld = toNote(l->endElement());
Note* noteNew = toNote(e);
Note* sNote = toNote(l->startElement());
@ -737,7 +737,7 @@ void LineSegment::editDrag(EditData& ed)
_offset2 += noteOld->canvasPos() - noteNew->canvasPos();
}
} else if (ed.curGrip == Grip::START && e != l->startElement()) {
qDebug("LineSegment: move start anchor (not impl.)");
LOGD("LineSegment: move start anchor (not impl.)");
}
}
}
@ -920,7 +920,7 @@ PointF SLine::linePos(Grip grip, System** sys) const
// it is possible CR won't be in correct track
// prefer element in current track if available
if (!cr) {
qDebug("no end for lyricsline segment - start %d, ticks %d", tick().ticks(), ticks().ticks());
LOGD("no end for lyricsline segment - start %d, ticks %d", tick().ticks(), ticks().ticks());
} else if (cr->track() != track()) {
EngravingItem* e = cr->segment()->element(track());
if (e) {
@ -1076,7 +1076,7 @@ PointF SLine::linePos(Grip grip, System** sys) const
Note* n = toNote(e);
System* s = n->chord()->segment()->system();
if (s == 0) {
qDebug("no system: %s start %s chord parent %s\n", typeName(), n->typeName(), n->chord()->explicitParent()->typeName());
LOGD("no system: %s start %s chord parent %s\n", typeName(), n->typeName(), n->chord()->explicitParent()->typeName());
return PointF();
}
*sys = s;

View file

@ -148,7 +148,7 @@ bool Lyrics::readProperties(XmlReader& e)
} else if (val == "middle") {
_syllabic = Syllabic::MIDDLE;
} else {
qDebug("bad syllabic property");
LOGD("bad syllabic property");
}
} else if (tag == "ticks") { // obsolete
_ticks = e.readFraction(); // will fall back to reading integer ticks on older scores
@ -172,7 +172,7 @@ void Lyrics::add(EngravingItem* el)
// _separator.append((Line*)el); // ignore! Internally managed
// ;
// else
qDebug("Lyrics::add: unknown element %s", el->typeName());
LOGD("Lyrics::add: unknown element %s", el->typeName());
}
//---------------------------------------------------------
@ -192,7 +192,7 @@ void Lyrics::remove(EngravingItem* el)
separ->removeUnmanaged();
}
} else {
qDebug("Lyrics::remove: unknown element %s", el->typeName());
LOGD("Lyrics::remove: unknown element %s", el->typeName());
}
}
@ -308,7 +308,7 @@ void Lyrics::layout()
// should have text layout to be able to do it correctly.
Q_ASSERT(rows() != 0);
if (!leading.isEmpty() || !trailing.isEmpty()) {
// qDebug("create leading, trailing <%s> -- <%s><%s>", qPrintable(text), qPrintable(leading), qPrintable(trailing));
// LOGD("create leading, trailing <%s> -- <%s><%s>", qPrintable(text), qPrintable(leading), qPrintable(trailing));
const TextBlock& tb = textBlock(0);
const qreal leadingWidth = tb.xpos(leading.length(), this) - tb.boundingRect().x();

View file

@ -28,6 +28,8 @@
#include "score.h"
#include "measure.h"
#include "log.h"
using namespace mu;
using namespace mu::engraving;
@ -127,7 +129,7 @@ void Marker::setMarkerType(Type t)
break;
default:
qDebug("unknown marker type %d", int(t));
LOGD("unknown marker type %d", int(t));
break;
}
if (empty() && txt) {

View file

@ -442,7 +442,7 @@ void MasterScore::removeExcerpt(Excerpt* ex)
setExcerptsChanged(true);
// delete ex;
} else {
qDebug("removeExcerpt:: ex not found");
LOGD("removeExcerpt:: ex not found");
}
}

View file

@ -451,7 +451,7 @@ AccidentalVal Measure::findAccidental(Note* note) const
}
}
}
qDebug("Measure::findAccidental: note not found");
LOGD("Measure::findAccidental: note not found");
return AccidentalVal::NATURAL;
}
@ -503,7 +503,7 @@ AccidentalVal Measure::findAccidental(Segment* s, staff_idx_t staffIdx, int line
}
}
}
qDebug("segment not found");
LOGD("segment not found");
return AccidentalVal::NATURAL;
}
@ -931,7 +931,7 @@ void Measure::add(EngravingItem* e)
}
while (s && s->rtick() == t) {
if (!seg->isChordRestType() && (seg->segmentType() == s->segmentType())) {
qDebug("there is already a <%s> segment", seg->subTypeName());
LOGD("there is already a <%s> segment", seg->subTypeName());
return;
}
if (s->segmentType() > st) {
@ -1096,7 +1096,7 @@ void Measure::remove(EngravingItem* e)
case ElementType::MARKER:
case ElementType::HBOX:
if (!el().remove(e)) {
qDebug("Measure(%p)::remove(%s,%p) not found", this, e->typeName(), e);
LOGD("Measure(%p)::remove(%s,%p) not found", this, e->typeName(), e);
}
break;
@ -1117,7 +1117,7 @@ void Measure::remove(EngravingItem* e)
}
}
}
qDebug("Measure::remove: %s %p not found", e->typeName(), e);
LOGD("Measure::remove: %s %p not found", e->typeName(), e);
break;
case ElementType::MEASURE:
@ -1853,7 +1853,7 @@ EngravingItem* Measure::drop(EditData& data)
break;
default:
qDebug("Measure: cannot drop %s here", e->typeName());
LOGD("Measure: cannot drop %s here", e->typeName());
delete e;
break;
}
@ -2067,7 +2067,7 @@ void Measure::readAddConnector(ConnectorInfoReader* info, bool pasteMode)
bool Measure::visible(staff_idx_t staffIdx) const
{
if (staffIdx >= score()->staves().size()) {
qDebug("Measure::visible: bad staffIdx: %zu", staffIdx);
LOGD("Measure::visible: bad staffIdx: %zu", staffIdx);
return false;
}
if (system() && (system()->staves().empty() || !system()->staff(staffIdx)->show())) {
@ -2204,7 +2204,7 @@ void Measure::connectTremolo()
for (Segment* ls = s->next(st); ls; ls = ls->next(st)) {
if (EngravingItem* element = ls->element(i)) {
if (!element->isChord()) {
qDebug("cannot connect tremolo");
LOGD("cannot connect tremolo");
continue;
}
Chord* nc = toChord(element);
@ -2286,7 +2286,7 @@ void Measure::exchangeVoice(track_idx_t strack, track_idx_t dtrack, staff_idx_t
Spanner* sp = i->value;
Fraction spStart = sp->tick();
Fraction spEnd = spStart + sp->ticks();
qDebug("Start %d End %d Diff %d \n Measure Start %d End %d", spStart.ticks(), spEnd.ticks(), (spEnd - spStart).ticks(),
LOGD("Start %d End %d Diff %d \n Measure Start %d End %d", spStart.ticks(), spEnd.ticks(), (spEnd - spStart).ticks(),
start.ticks(), end.ticks());
if (sp->isSlur() && (spStart >= start || spEnd < end)) {
if (sp->track() == strack && spStart >= start) {
@ -2706,7 +2706,7 @@ Measure* Measure::cloneMeasure(Score* sc, const Fraction& tick, TieMap* tieMap)
nn->setTieBack(tie);
tie->setEndNote(nn);
} else {
qDebug("cloneMeasure: cannot find tie, track %zu", track);
LOGD("cloneMeasure: cannot find tie, track %zu", track);
}
}
}
@ -3317,7 +3317,7 @@ Fraction Measure::computeTicks()
{
Fraction minTick = ticks();
if (minTick <= Fraction(0, 1)) {
qDebug("=====minTick %d measure %p", minTick.ticks(), this);
LOGD("=====minTick %d measure %p", minTick.ticks(), this);
}
Q_ASSERT(minTick > Fraction(0, 1));
@ -3611,7 +3611,7 @@ qreal Measure::createEndBarLines(bool isLastMeasureInSystem)
} else if (visibleInt == 1) { // all (courtesy) clefs in the clef segment are not visible
clefSeg->setVisible(false);
} else { // should never happen
qDebug("Clef Segment without Clef elements at tick %d/%d", clefSeg->tick().numerator(), clefSeg->tick().denominator());
LOGD("Clef Segment without Clef elements at tick %d/%d", clefSeg->tick().numerator(), clefSeg->tick().denominator());
}
if ((wasVisible != clefSeg->visible()) && system()) { // recompute the width only if necessary
computeWidth(system()->minSysTicks(), layoutStretch());

View file

@ -183,7 +183,7 @@ void MeasureBase::remove(EngravingItem* el)
}
}
if (!_el.remove(el)) {
qDebug("MeasureBase(%p)::remove(%s,%p) not found", this, el->typeName(), el);
LOGD("MeasureBase(%p)::remove(%s,%p) not found", this, el->typeName(), el);
} else {
el->removed();
}
@ -370,7 +370,7 @@ void MeasureBase::scanElements(void* data, void (* func)(void*, EngravingItem*),
for (EngravingItem* e : _el) {
if (score()->tagIsValid(e->tag())) {
if (e->staffIdx() >= score()->staves().size()) {
qDebug("MeasureBase::scanElements: bad staffIdx %zu in element %s", e->staffIdx(), e->typeName());
LOGD("MeasureBase::scanElements: bad staffIdx %zu in element %s", e->staffIdx(), e->typeName());
}
if ((e->track() == mu::nidx) || e->systemFlag() || ((Measure*)this)->visible(e->staffIdx())) {
e->scanElements(data, func, all);

View file

@ -360,7 +360,7 @@ void MasterScore::updateMidiMapping(Channel* channel, Part* part, int midiPort,
return;
}
if (c >= int(masterScore()->midiMapping().size())) {
qDebug("Can't set midi channel: midiMapping is empty!");
LOGD("Can't set midi channel: midiMapping is empty!");
return;
}
MidiMapping& mm = _midiMapping[c];

View file

@ -898,7 +898,7 @@ SymId Note::noteHead() const
if (d) {
return d->noteHeads(_pitch, ht);
} else {
qDebug("no drumset");
LOGD("no drumset");
return noteHead(up, NoteHeadGroup::HEAD_NORMAL, ht);
}
}
@ -923,7 +923,7 @@ SymId Note::noteHead() const
}
SymId t = noteHead(up, _headGroup, ht, tpc(), key, scheme);
if (t == SymId::noSym) {
qDebug("invalid notehead %d/%d", int(_headGroup), int(ht));
LOGD("invalid notehead %d/%d", int(_headGroup), int(ht));
t = noteHead(up, NoteHeadGroup::HEAD_NORMAL, ht);
}
return t;
@ -1006,7 +1006,7 @@ void Note::updateHeadGroup(const NoteHeadGroup headGroup)
NoteHeadGroup group = headGroup;
if (group == NoteHeadGroup::HEAD_INVALID) {
qDebug("unknown notehead");
LOGD("unknown notehead");
group = NoteHeadGroup::HEAD_NORMAL;
}
@ -1169,7 +1169,7 @@ void Note::removeSpanner(Spanner* l)
Note* e = toNote(l->endElement());
if (e && e->isNote()) {
if (!e->removeSpannerBack(l)) {
qDebug("Note::removeSpanner(%p): cannot remove spannerBack %s %p", this, l->typeName(), l);
LOGD("Note::removeSpanner(%p): cannot remove spannerBack %s %p", this, l->typeName(), l);
// abort();
}
if (l->isGlissando()) {
@ -1177,7 +1177,7 @@ void Note::removeSpanner(Spanner* l)
}
}
if (!removeSpannerFor(l)) {
qDebug("Note(%p): cannot remove spannerFor %s %p", this, l->typeName(), l);
LOGD("Note(%p): cannot remove spannerFor %s %p", this, l->typeName(), l);
// abort();
}
}
@ -1223,7 +1223,7 @@ void Note::add(EngravingItem* e)
addSpanner(toSpanner(e));
break;
default:
qDebug("Note::add() not impl. %s", e->typeName());
LOGD("Note::add() not impl. %s", e->typeName());
break;
}
triggerLayout();
@ -1248,7 +1248,7 @@ void Note::remove(EngravingItem* e)
case ElementType::FINGERING:
case ElementType::BEND:
if (!_el.remove(e)) {
qDebug("Note::remove(): cannot find %s", e->typeName());
LOGD("Note::remove(): cannot find %s", e->typeName());
}
break;
case ElementType::TIE: {
@ -1270,7 +1270,7 @@ void Note::remove(EngravingItem* e)
break;
default:
qDebug("Note::remove() not impl. %s", e->typeName());
LOGD("Note::remove() not impl. %s", e->typeName());
break;
}
triggerLayout();
@ -1489,14 +1489,14 @@ void Note::read(XmlReader& e)
int tpc2Pitch = (tpc2pitch(_tpc[1]) + 12) % 12;
int soundingPitch = _pitch % 12;
if (tpc1Pitch != soundingPitch) {
qDebug("bad tpc1 - soundingPitch = %d, tpc1 = %d", soundingPitch, tpc1Pitch);
LOGD("bad tpc1 - soundingPitch = %d, tpc1 = %d", soundingPitch, tpc1Pitch);
_pitch += tpc1Pitch - soundingPitch;
}
if (staff()) {
Interval v = staff()->part()->instrument(e.tick())->transpose();
int writtenPitch = (_pitch - v.chromatic) % 12;
if (tpc2Pitch != writtenPitch) {
qDebug("bad tpc2 - writtenPitch = %d, tpc2 = %d", writtenPitch, tpc2Pitch);
LOGD("bad tpc2 - writtenPitch = %d, tpc2 = %d", writtenPitch, tpc2Pitch);
if (concertPitch()) {
// assume we want to keep sounding pitch
// so fix written pitch (tpc only)
@ -1743,7 +1743,7 @@ public:
qreal degrees = (qAcos(radians) * 180.0) / M_PI;
qDebug() << "NOTE DRAG DEGREES " << degrees;
LOGD() << "NOTE DRAG DEGREES " << degrees;
if (degrees >= MODE_TRANSITION_LIMIT_DEGREES) {
return NoteEditData::EditMode_ChangePitch;
@ -1878,7 +1878,7 @@ EngravingItem* Note::drop(EditData& data)
NoteHead* s = toNoteHead(e);
NoteHeadGroup group = s->headGroup();
if (group == NoteHeadGroup::HEAD_INVALID) {
qDebug("unknown notehead");
LOGD("unknown notehead");
group = NoteHeadGroup::HEAD_NORMAL;
}
delete s;
@ -1981,7 +1981,7 @@ EngravingItem* Note::drop(EditData& data)
{
for (auto ee : qAsConst(_spannerFor)) {
if (ee->type() == ElementType::GLISSANDO) {
qDebug("there is already a glissando");
LOGD("there is already a glissando");
delete e;
return 0;
}
@ -2007,7 +2007,7 @@ EngravingItem* Note::drop(EditData& data)
gliss->setParent(this);
score()->undoAddElement(e);
} else {
qDebug("no segment for second note of glissando found");
LOGD("no segment for second note of glissando found");
delete e;
return 0;
}
@ -2350,7 +2350,7 @@ void Note::updateAccidental(AccidentalState* as)
int eRelLine = absStep(tpc(), epitch() + ottaveCapoFret());
AccidentalVal relLineAccVal = as->accidentalVal(eRelLine, error);
if (error) {
qDebug("error accidentalVal()");
LOGD("error accidentalVal()");
return;
}
if ((accVal != relLineAccVal) || hidden() || as->tieContext(eRelLine)) {
@ -2904,7 +2904,7 @@ void Note::updateRelLine(int relLine, bool undoable)
staff_idx_t maxStaff = part()->endTrack() / VOICES;
const Staff* stf = this->staff();
if (idx < minStaff || idx >= maxStaff || st->group() != stf->staffTypeForElement(this)->group()) {
qDebug("staffMove out of scope %zu + %d min %zu max %zu",
LOGD("staffMove out of scope %zu + %d min %zu max %zu",
staffIdx(), chord()->staffMove(), minStaff, maxStaff);
chord()->undoChangeProperty(Pid::STAFF_MOVE, 0);
}

View file

@ -160,7 +160,7 @@ Note* Score::addPitch(NoteVal& nval, bool addFlag, InputState* externalInputStat
ChordRest* c = toChordRest(is.lastSegment()->element(is.track()));
if (c == 0 || !c->isChord()) {
qDebug("Score::addPitch: cr %s", c ? c->typeName() : "zero");
LOGD("Score::addPitch: cr %s", c ? c->typeName() : "zero");
return 0;
}
Note* note = addNote(toChord(c), nval, /* forceAccidental */ false, is.articulationIds(), externalInputState);
@ -305,7 +305,7 @@ Note* Score::addPitch(NoteVal& nval, bool addFlag, InputState* externalInputStat
is.slur()->setEndElement(e);
}
} else {
qDebug("addPitch: cannot find slur note");
LOGD("addPitch: cannot find slur note");
}
}
if (is.usingNoteEntryMethod(NoteEntryMethod::REPITCH)) {
@ -335,7 +335,7 @@ void Score::putNote(const PointF& pos, bool replace, bool insert)
{
Position p;
if (!getPosition(&p, pos, _is.voice())) {
qDebug("cannot put note here, get position failed");
LOGD("cannot put note here, get position failed");
return;
}
Score* score = p.segment->score();
@ -441,7 +441,7 @@ void Score::putNote(const Position& p, bool replace)
nval.fret = fret;
nval.pitch = stringData->getPitch(nval.string, nval.fret, st);
} else {
qDebug("can't increase fret to %d", fret);
LOGD("can't increase fret to %d", fret);
}
}
// set fret number (original or combined) in all linked notes

View file

@ -269,7 +269,7 @@ void Part::setStaves(int n)
{
int ns = static_cast<int>(_staves.size());
if (n < ns) {
qDebug("Part::setStaves(): remove staves not implemented!");
LOGD("Part::setStaves(): remove staves not implemented!");
return;
}
@ -309,7 +309,7 @@ void Part::insertStaff(Staff* staff, staff_idx_t idx)
void Part::removeStaff(Staff* staff)
{
if (!mu::remove(_staves, staff)) {
qDebug("Part::removeStaff: not found %p", staff);
LOGD("Part::removeStaff: not found %p", staff);
return;
}
}
@ -429,7 +429,7 @@ void Part::removeInstrument(const Fraction& tick)
{
auto i = _instruments.find(tick.ticks());
if (i == _instruments.end()) {
qDebug("Part::removeInstrument: not found at tick %d", tick.ticks());
LOGD("Part::removeInstrument: not found at tick %d", tick.ticks());
return;
}
_instruments.erase(i);
@ -581,7 +581,7 @@ bool Part::setProperty(Pid id, const PropertyValue& property)
setPreferSharpFlat(PreferSharpFlat(property.toInt()));
break;
default:
qDebug("Part::setProperty: unknown id %d", int(id));
LOGD("Part::setProperty: unknown id %d", int(id));
break;
}
score()->setLayoutAll();

View file

@ -127,7 +127,7 @@ bool Score::pasteStaff(XmlReader& e, Segment* dst, staff_idx_t dstStaff, Fractio
QString version = e.attribute("version", "NONE");
if (!MScore::testMode) {
if (version != MSC_VERSION) {
qDebug("pasteStaff: bad version");
LOGD("pasteStaff: bad version");
break;
}
}
@ -161,7 +161,7 @@ bool Score::pasteStaff(XmlReader& e, Segment* dst, staff_idx_t dstStaff, Fractio
e.setTrackOffset(static_cast<int>((dstStaff - staffStart) * VOICES));
size_t dstStaffIdx = e.track() / VOICES;
if (dstStaffIdx >= dst->score()->nstaves()) {
qDebug("paste beyond staves");
LOGD("paste beyond staves");
done = true;
break;
}
@ -230,14 +230,14 @@ bool Score::pasteStaff(XmlReader& e, Segment* dst, staff_idx_t dstStaff, Fractio
}
} else if (tag == "endTuplet") {
if (!tuplet) {
qDebug("Score::pasteStaff: encountered <endTuplet/> when no tuplet was started");
LOGD("Score::pasteStaff: encountered <endTuplet/> when no tuplet was started");
e.skipCurrentElement();
continue;
}
Tuplet* oldTuplet = tuplet;
tuplet = tuplet->tuplet();
if (oldTuplet->elements().empty()) {
qDebug("Score::pasteStaff: ended tuplet is empty");
LOGD("Score::pasteStaff: ended tuplet is empty");
if (tuplet) {
tuplet->remove(oldTuplet);
}
@ -448,25 +448,25 @@ bool Score::pasteStaff(XmlReader& e, Segment* dst, staff_idx_t dstStaff, Fractio
beam->read(e);
beam->resetExplicitParent();
if (startingBeam) {
qDebug("The read beam was not used");
LOGD("The read beam was not used");
delete startingBeam;
}
startingBeam = beam;
} else if (tag == "BarLine") {
e.skipCurrentElement(); // ignore bar line
} else {
qDebug("PasteStaff: element %s not handled", tag.toUtf8().data());
LOGD("PasteStaff: element %s not handled", tag.toUtf8().data());
e.skipCurrentElement(); // ignore
}
}
e.checkConnectors();
if (startingBeam) {
qDebug("The read beam was not used");
LOGD("The read beam was not used");
delete startingBeam;
}
if (tuplet) {
qDebug("<endTuplet/> not found");
LOGD("<endTuplet/> not found");
if (tuplet->elements().empty()) {
if (tuplet->tuplet()) {
tuplet->tuplet()->remove(tuplet);
@ -564,7 +564,7 @@ void Score::readAddConnector(ConnectorInfoReader* info, bool pasteMode)
{
if (!pasteMode) {
// How did we get there?
qDebug("Score::readAddConnector is called not in paste mode.");
LOGD("Score::readAddConnector is called not in paste mode.");
return;
}
const ElementType type = info->type();
@ -608,7 +608,7 @@ void Score::readAddConnector(ConnectorInfoReader* info, bool pasteMode)
void Score::pasteChordRest(ChordRest* cr, const Fraction& t, const Interval& srcTranspose)
{
Fraction tick(t);
// qDebug("pasteChordRest %s at %d, len %d/%d", cr->typeName(), tick, cr->ticks().numerator(), cr->ticks().denominator() );
// LOGD("pasteChordRest %s at %d, len %d/%d", cr->typeName(), tick, cr->ticks().numerator(), cr->ticks().denominator() );
Measure* measure = tick2measure(tick);
if (!measure) {
@ -834,7 +834,7 @@ void Score::pasteSymbols(XmlReader& e, ChordRest* dst)
harmSegm = meas ? meas->undoGetSegment(SegmentType::ChordRest, destTick) : nullptr;
}
if (destTrack >= maxTrack || harmSegm == nullptr) {
qDebug("PasteSymbols: no track or segment for %s", tag.toUtf8().data());
LOGD("PasteSymbols: no track or segment for %s", tag.toUtf8().data());
e.skipCurrentElement(); // ignore
continue;
}
@ -891,13 +891,13 @@ void Score::pasteSymbols(XmlReader& e, ChordRest* dst)
}
// check the intended dest. track and segment exist
if (destTrack >= maxTrack || currSegm == nullptr) {
qDebug("PasteSymbols: no track or segment for %s", tag.toUtf8().data());
LOGD("PasteSymbols: no track or segment for %s", tag.toUtf8().data());
e.skipCurrentElement(); // ignore
continue;
}
// check there is a segment element in the required track
if (currSegm->element(destTrack) == nullptr) {
qDebug("PasteSymbols: no track element for %s", tag.toUtf8().data());
LOGD("PasteSymbols: no track element for %s", tag.toUtf8().data());
e.skipCurrentElement();
continue;
}
@ -961,7 +961,7 @@ void Score::pasteSymbols(XmlReader& e, ChordRest* dst)
}
}
if (!prevSegm) {
qDebug("PasteSymbols: can't place off-note FiguredBass");
LOGD("PasteSymbols: can't place off-note FiguredBass");
delete el;
continue;
}
@ -980,7 +980,7 @@ void Score::pasteSymbols(XmlReader& e, ChordRest* dst)
if (!nextSegm || nextSegm->tick() > destTick1) { // no ChordRest segm at this tick
nextSegm = Factory::createSegment(prevSegm->measure(), SegmentType::ChordRest, destTick1);
if (!nextSegm) {
qDebug("PasteSymbols: can't find or create destination segment for FiguredBass");
LOGD("PasteSymbols: can't find or create destination segment for FiguredBass");
delete el;
continue;
}
@ -1016,12 +1016,12 @@ void Score::pasteSymbols(XmlReader& e, ChordRest* dst)
}
}
if (currSegm == nullptr) {
qDebug("PasteSymbols: no segment for Lyrics");
LOGD("PasteSymbols: no segment for Lyrics");
e.skipCurrentElement();
continue;
}
if (!cr->isChord()) {
qDebug("PasteSymbols: can't paste Lyrics to rest");
LOGD("PasteSymbols: can't paste Lyrics to rest");
e.skipCurrentElement();
continue;
}
@ -1032,7 +1032,7 @@ void Score::pasteSymbols(XmlReader& e, ChordRest* dst)
el->setParent(cr);
undoAddElement(el);
} else {
qDebug("PasteSymbols: element %s not handled", tag.toUtf8().data());
LOGD("PasteSymbols: element %s not handled", tag.toUtf8().data());
e.skipCurrentElement(); // ignore
}
} // if !Harmony
@ -1108,7 +1108,7 @@ inline static bool canPasteStaff(const QByteArray& mimeData, const Fraction& sca
void Score::cmdPaste(const QMimeData* ms, MuseScoreView* view, Fraction scale)
{
if (ms == 0) {
qDebug("no application mime data");
LOGD("no application mime data");
MScore::setError(MsError::NO_MIME);
return;
}
@ -1159,7 +1159,7 @@ void Score::cmdPaste(const QMimeData* ms, MuseScoreView* view, Fraction scale)
} else if (_selection.isSingle()) {
EngravingItem* e = _selection.element();
if (!e->isNote() && !e->isChordRest()) {
qDebug("cannot paste to %s", e->typeName());
LOGD("cannot paste to %s", e->typeName());
MScore::setError(MsError::DEST_NO_CR);
return;
}
@ -1177,7 +1177,7 @@ void Score::cmdPaste(const QMimeData* ms, MuseScoreView* view, Fraction scale)
} else {
QByteArray data(ms->data(mimeStaffListFormat));
if (MScore::debugMode) {
qDebug("paste <%s>", data.data());
LOGD("paste <%s>", data.data());
}
if (canPasteStaff(data, scale)) {
XmlReader e(data);
@ -1194,7 +1194,7 @@ void Score::cmdPaste(const QMimeData* ms, MuseScoreView* view, Fraction scale)
} else if (_selection.isSingle()) {
EngravingItem* e = _selection.element();
if (!e->isNote() && !e->isRest() && !e->isChord()) {
qDebug("cannot paste to %s", e->typeName());
LOGD("cannot paste to %s", e->typeName());
MScore::setError(MsError::DEST_NO_CR);
return;
}
@ -1209,7 +1209,7 @@ void Score::cmdPaste(const QMimeData* ms, MuseScoreView* view, Fraction scale)
} else {
QByteArray data(ms->data(mimeSymbolListFormat));
if (MScore::debugMode) {
qDebug("paste <%s>", data.data());
LOGD("paste <%s>", data.data());
}
XmlReader e(data);
pasteSymbols(e, cr);
@ -1247,10 +1247,10 @@ void Score::cmdPaste(const QMimeData* ms, MuseScoreView* view, Fraction scale)
}
delete image;
} else {
qDebug("cannot paste selState %d staffList %s",
LOGD("cannot paste selState %d staffList %s",
int(_selection.state()), (ms->hasFormat(mimeStaffListFormat)) ? "true" : "false");
for (const QString& s : ms->formats()) {
qDebug(" format %s", qPrintable(s));
LOGD(" format %s", qPrintable(s));
}
}
}

View file

@ -333,7 +333,7 @@ void tpc2name(int tpc, NoteSpellingType noteSpelling, NoteCaseType noteCase, QSt
}
break;
default:
qDebug("tpc2name(%d): acc %d", tpc, static_cast<int>(accVal));
LOGD("tpc2name(%d): acc %d", tpc, static_cast<int>(accVal));
acc = "";
break;
}
@ -622,7 +622,7 @@ int computeWindow(const std::vector<Note*>& notes, int start, int end)
Fraction tick = notes[i]->chord()->tick();
key[k] = int(notes[i]->staff()->key(tick)) + 7;
if (key[k] < 0 || key[k] > 14) {
qDebug("illegal key at tick %d: %d, window %d-%d",
LOGD("illegal key at tick %d: %d, window %d-%d",
tick.ticks(), key[k] - 7, start, end);
return 0;
// abort();
@ -666,15 +666,15 @@ int computeWindow(const std::vector<Note*>& notes, int start, int end)
}
}
}
/* qDebug("compute window\n ");
/* LOGD("compute window\n ");
for (int i = 0; i < 10; ++i)
qDebug("%2d ", pitch[i]);
qDebug("\n ");
LOGD("%2d ", pitch[i]);
LOGD("\n ");
for (int i = 0; i < 10; ++i)
qDebug("%2d ", key[i]);
qDebug("\n ");
LOGD("%2d ", key[i]);
LOGD("\n ");
for (int i = 0; i < 10; ++i)
qDebug("%2d ", tpc(i, pitch[i], idx));
LOGD("%2d ", tpc(i, pitch[i], idx));
*/
return idx;
}

View file

@ -392,26 +392,26 @@ PosLen::PosLen(const PosLen& p)
void PosLen::dump(int n) const
{
Pos::dump(n);
qDebug(" Len(");
LOGD(" Len(");
switch (type()) {
case TType::FRAMES:
qDebug("samples=%d)", _lenFrame);
LOGD("samples=%d)", _lenFrame);
break;
case TType::TICKS:
qDebug("ticks=%d)", _lenTick);
LOGD("ticks=%d)", _lenTick);
break;
}
}
void Pos::dump(int /*n*/) const
{
qDebug("Pos(%s, sn=%d, ", type() == TType::FRAMES ? "Frames" : "Ticks", sn);
LOGD("Pos(%s, sn=%d, ", type() == TType::FRAMES ? "Frames" : "Ticks", sn);
switch (type()) {
case TType::FRAMES:
qDebug("samples=%d)", _frame);
LOGD("samples=%d)", _frame);
break;
case TType::TICKS:
qDebug("ticks=%d)", _tick);
LOGD("ticks=%d)", _tick);
break;
}
}

View file

@ -361,7 +361,7 @@ void TrackList::read(const Segment* fs, const Segment* es)
}
}
if (!found) {
qDebug("Tied note not found");
LOGD("Tied note not found");
}
break;
}
@ -824,13 +824,13 @@ Fraction ScoreRange::ticks() const
void TrackList::dump() const
{
qDebug("elements %zu, duration %d/%d", size(), _duration.numerator(), _duration.denominator());
LOGD("elements %zu, duration %d/%d", size(), _duration.numerator(), _duration.denominator());
for (EngravingItem* e : *this) {
if (e->isDurationElement()) {
Fraction du = toDurationElement(e)->ticks();
qDebug(" %s %d/%d", e->typeName(), du.numerator(), du.denominator());
LOGD(" %s %d/%d", e->typeName(), du.numerator(), du.denominator());
} else {
qDebug(" %s", e->typeName());
LOGD(" %s", e->typeName());
}
}
}

View file

@ -232,7 +232,7 @@ void Score::updateChannel()
size_t channel = st->channel(c->tick(), c->voice());
Instrument* instr = c->part()->instrument(c->tick());
if (channel >= instr->channel().size()) {
qDebug() << "Channel " << channel << " too high. Max " << instr->channel().size();
LOGD() << "Channel " << channel << " too high. Max " << instr->channel().size();
channel = 0;
}
for (Note* note : c->notes()) {
@ -1433,7 +1433,7 @@ void renderTremolo(Chord* chord, std::vector<NoteEventList>& ell)
}
}
} else {
qDebug("Chord::renderTremolo: cannot find 2. chord");
LOGD("Chord::renderTremolo: cannot find 2. chord");
}
} else if (chord->tremoloChordType() == TremoloChordType::TremoloSecondNote) {
for (int k = 0; k < notes; ++k) {

View file

@ -317,7 +317,7 @@ SymId Rest::getSymbol(DurationType type, int line, int lines, int* yoffset)
case DurationType::V_1024TH:
return SymId::rest1024th;
default:
qDebug("unknown rest type %d", int(type));
LOGD("unknown rest type %d", int(type));
return SymId::restQuarter;
}
}
@ -904,7 +904,7 @@ void Rest::remove(EngravingItem* e)
case ElementType::SYMBOL:
case ElementType::IMAGE:
if (!el().remove(e)) {
qDebug("Rest::remove(): cannot find %s", e->typeName());
LOGD("Rest::remove(): cannot find %s", e->typeName());
} else {
e->removed();
}

View file

@ -1403,7 +1403,7 @@ bool Score::checkHasMeasures() const
Page* page = pages().empty() ? 0 : pages().front();
const std::vector<System*>* sl = page ? &page->systems() : 0;
if (sl == 0 || sl->empty() || sl->front()->measures().empty()) {
qDebug("first create measure, then repeat operation");
LOGD("first create measure, then repeat operation");
return false;
}
return true;
@ -1509,7 +1509,7 @@ void Score::addElement(EngravingItem* element)
EngravingItem* parent = element->parentItem();
element->triggerLayout();
// qDebug("Score(%p) EngravingItem(%p)(%s) parent %p(%s)",
// LOGD("Score(%p) EngravingItem(%p)(%s) parent %p(%s)",
// this, element, element->typeName(), parent, parent ? parent->typeName() : "");
ElementType et = element->type();
@ -1632,7 +1632,7 @@ void Score::removeElement(EngravingItem* element)
EngravingItem* parent = element->parentItem();
element->triggerLayout();
// qDebug("Score(%p) EngravingItem(%p)(%s) parent %p(%s)",
// LOGD("Score(%p) EngravingItem(%p)(%s) parent %p(%s)",
// this, element, element->typeName(), parent, parent ? parent->typeName() : "");
// special for MEASURE, HBOX, VBOX
@ -2087,13 +2087,13 @@ void Score::removeAudio()
bool Score::appendScore(Score* score, bool addPageBreak, bool addSectionBreak)
{
if (parts().size() < score->parts().size() || staves().size() < score->staves().size()) {
qDebug("Score to append has %zu parts and %zu staves, but this score only has %zu parts and %zu staves.",
LOGD("Score to append has %zu parts and %zu staves, but this score only has %zu parts and %zu staves.",
score->parts().size(), score->staves().size(), parts().size(), staves().size());
return false;
}
if (!last()) {
qDebug("This score doesn't have any MeasureBase objects.");
LOGD("This score doesn't have any MeasureBase objects.");
return false;
}
@ -2279,7 +2279,7 @@ bool Score::appendMeasuresFromScore(Score* score, const Fraction& startTick, con
void Score::splitStaff(staff_idx_t staffIdx, int splitPoint)
{
// qDebug("split staff %d point %d", staffIdx, splitPoint);
// LOGD("split staff %d point %d", staffIdx, splitPoint);
//
// create second staff
@ -3283,7 +3283,7 @@ void Score::select(EngravingItem* e, SelectType type, staff_idx_t staffIdx)
}
if (MScore::debugMode) {
qDebug("select element <%s> type %d(state %d) staff %zu",
LOGD("select element <%s> type %d(state %d) staff %zu",
e ? e->typeName() : "", int(type), int(selection().state()), e ? e->staffIdx() : -1);
}
@ -3441,7 +3441,7 @@ void Score::selectRange(EngravingItem* e, staff_idx_t staffIdx)
_selection.setRange(s1, s2, staffIdx, staffIdx + 1);
}
} else {
qDebug("SELECT_RANGE: measure: sel state %d", int(_selection.state()));
LOGD("SELECT_RANGE: measure: sel state %d", int(_selection.state()));
return;
}
} else if (e->isNote() || e->isChordRest()) {
@ -3479,7 +3479,7 @@ void Score::selectRange(EngravingItem* e, staff_idx_t staffIdx)
} else if (_selection.isRange()) {
_selection.extendRangeSelection(cr);
} else {
qDebug("sel state %d", int(_selection.state()));
LOGD("sel state %d", int(_selection.state()));
return;
}
if (!endRangeSelected && !_selection.endSegment()) {
@ -3904,7 +3904,7 @@ void Score::addLyrics(const Fraction& tick, staff_idx_t staffIdx, const QString&
Measure* measure = tick2measure(tick);
Segment* seg = measure->findSegment(SegmentType::ChordRest, tick);
if (seg == 0) {
qDebug("no segment found for lyrics<%s> at tick %d",
LOGD("no segment found for lyrics<%s> at tick %d",
qPrintable(txt), tick.ticks());
return;
}
@ -3923,7 +3923,7 @@ void Score::addLyrics(const Fraction& tick, staff_idx_t staffIdx, const QString&
}
}
if (!lyricsAdded) {
qDebug("no chord/rest for lyrics<%s> at tick %d, staff %zu",
LOGD("no chord/rest for lyrics<%s> at tick %d, staff %zu",
qPrintable(txt), tick.ticks(), staffIdx);
}
}
@ -4268,7 +4268,7 @@ ChordRest* Score::findCR(Fraction tick, track_idx_t track) const
{
Measure* m = tick2measureMM(tick);
if (!m) {
//qDebug("findCR: no measure for tick %d", tick.ticks());
//LOGD("findCR: no measure for tick %d", tick.ticks());
return nullptr;
}
// attach to first rest all spanner when mmRest
@ -4311,7 +4311,7 @@ ChordRest* Score::findCRinStaff(const Fraction& tick, staff_idx_t staffIdx) cons
Fraction ptick = tick - Fraction::fromTicks(1);
Measure* m = tick2measureMM(ptick);
if (!m) {
qDebug("findCRinStaff: no measure for tick %d", ptick.ticks());
LOGD("findCRinStaff: no measure for tick %d", ptick.ticks());
return 0;
}
// attach to first rest all spanner when mmRest
@ -5107,7 +5107,7 @@ std::set<ID> Score::partIdsFromRange(const track_idx_t trackFrom, const track_id
PropertyValue Score::getProperty(Pid /*id*/) const
{
qDebug("Score::getProperty: unhandled id");
LOGD("Score::getProperty: unhandled id");
return PropertyValue();
}
@ -5117,7 +5117,7 @@ PropertyValue Score::getProperty(Pid /*id*/) const
bool Score::setProperty(Pid /*id*/, const PropertyValue& /*v*/)
{
qDebug("Score::setProperty: unhandled id");
LOGD("Score::setProperty: unhandled id");
setLayoutAll();
return true;
}
@ -5303,7 +5303,7 @@ void Score::connectTies(bool silent)
}
if (nnote == 0) {
if (!silent) {
qDebug("next note at %d track %zu for tie not found (version %d)", s->tick().ticks(), i, _mscVersion);
LOGD("next note at %d track %zu for tie not found (version %d)", s->tick().ticks(), i, _mscVersion);
delete tie;
n->setTieFor(0);
}

View file

@ -262,7 +262,7 @@ void Score::linkMeasures(Score* score)
mbMaster = mbMaster->next();
}
if (!mbMaster) {
qDebug("Measures in MasterScore and Score are not in sync.");
LOGD("Measures in MasterScore and Score are not in sync.");
break;
}
mb->linkTo(mbMaster);
@ -495,7 +495,7 @@ void Score::writeSegments(XmlWriter& xml, track_idx_t strack, track_idx_t etrack
if (lm) {
eseg = lm->nextMeasure() ? lm->nextMeasure()->first() : nullptr;
} else {
qDebug("writeSegments: no measure for end segment in mmrest");
LOGD("writeSegments: no measure for end segment in mmrest");
}
}
if (fm && fm->isMMRest()) {

View file

@ -94,7 +94,7 @@ bool ScoreOrder::readBoolAttribute(Ms::XmlReader& reader, const char* attrName,
} else if (attr.toLower() == "true") {
return true;
}
qDebug("invalid value \"%s\" for attribute \"%s\", using default \"%d\"", qPrintable(attr), qPrintable(attrName), defvalue);
LOGD("invalid value \"%s\" for attribute \"%s\", using default \"%d\"", qPrintable(attr), qPrintable(attrName), defvalue);
return defvalue;
}
@ -106,7 +106,7 @@ void ScoreOrder::readInstrument(Ms::XmlReader& reader)
{
QString instrumentId { reader.attribute("id") };
if (!Ms::searchTemplate(instrumentId)) {
qDebug("cannot find instrument templates for <%s>", qPrintable(instrumentId));
LOGD("cannot find instrument templates for <%s>", qPrintable(instrumentId));
reader.skipCurrentElement();
return;
}

View file

@ -687,7 +687,7 @@ EngravingObjectList TBox::scanChildren() const
void _dumpScoreTree(EngravingObject* s, int depth)
{
qDebug() << qPrintable(QString(" ").repeated(4 * depth)) << s->typeName() << "at" << s;
LOGD() << qPrintable(QString(" ").repeated(4 * depth)) << s->typeName() << "at" << s;
for (EngravingObject* child : s->scanChildren()) {
_dumpScoreTree(child, depth + 1);
}

View file

@ -531,7 +531,7 @@ void Segment::checkElement(EngravingItem* el, track_idx_t track)
{
// generated elements can be overwritten
if (_elist[track] && !_elist[track]->generated()) {
qDebug("add(%s): there is already a %s at track %zu tick %d",
LOGD("add(%s): there is already a %s at track %zu tick %d",
el->typeName(),
_elist[track]->typeName(),
track,
@ -547,7 +547,7 @@ void Segment::checkElement(EngravingItem* el, track_idx_t track)
void Segment::add(EngravingItem* el)
{
// qDebug("%p segment %s add(%d, %d, %s)", this, subTypeName(), tick(), el->track(), el->typeName());
// LOGD("%p segment %s add(%d, %d, %s)", this, subTypeName(), tick(), el->track(), el->typeName());
if (el->explicitParent() != this) {
el->setParent(this);
@ -697,7 +697,7 @@ void Segment::add(EngravingItem* el)
void Segment::remove(EngravingItem* el)
{
// qDebug("%p Segment::remove %s %p", this, el->typeName(), el);
// LOGD("%p Segment::remove %s %p", this, el->typeName(), el);
track_idx_t track = el->track();
@ -835,7 +835,7 @@ SegmentType Segment::segmentType(ElementType type)
case ElementType::BREATH:
return SegmentType::Breath;
default:
qDebug("Segment:segmentType(): bad type: <%s>", Factory::name(type));
LOGD("Segment:segmentType(): bad type: <%s>", Factory::name(type));
return SegmentType::Invalid;
}
}

View file

@ -580,7 +580,7 @@ void Selection::updateSelectedElements()
size_t staves = _score->nstaves();
if (_staffStart == mu::nidx || _staffStart >= staves || _staffEnd == mu::nidx || _staffEnd > staves
|| _staffStart >= _staffEnd) {
qDebug("updateSelectedElements: bad staff selection %zu - %zu, staves %zu", _staffStart, _staffEnd, staves);
LOGD("updateSelectedElements: bad staff selection %zu - %zu, staves %zu", _staffStart, _staffEnd, staves);
_staffStart = 0;
_staffEnd = 0;
}
@ -717,17 +717,17 @@ void Selection::update()
void Selection::dump()
{
qDebug("Selection dump: ");
LOGD("Selection dump: ");
switch (_state) {
case SelState::NONE: qDebug("NONE");
case SelState::NONE: LOGD("NONE");
return;
case SelState::RANGE: qDebug("RANGE");
case SelState::RANGE: LOGD("RANGE");
break;
case SelState::LIST: qDebug("LIST");
case SelState::LIST: LOGD("LIST");
break;
}
foreach (const EngravingItem* e, _el) {
qDebug(" %p %s", e, e->typeName());
LOGD(" %p %s", e, e->typeName());
}
}

View file

@ -28,6 +28,8 @@
#include "infrastructure/draw/painter.h"
#include "log.h"
using namespace mu;
using namespace mu::draw;
@ -417,7 +419,7 @@ void Shape::paint(Painter& painter) const
void Shape::dump(const char* p) const
{
qDebug("Shape dump: %p %s size %zu", this, p, size());
LOGD("Shape dump: %p %s size %zu", this, p, size());
for (const ShapeElement& r : *this) {
r.dump();
}
@ -425,7 +427,7 @@ void Shape::dump(const char* p) const
void ShapeElement::dump() const
{
qDebug(" %s: %f %f %f %f", toItem ? toItem->typeName() : "", x(), y(), width(), height());
LOGD(" %s: %f %f %f %f", toItem ? toItem->typeName() : "", x(), y(), width(), height());
}
#endif

View file

@ -227,7 +227,7 @@ bool SigEvent::operator==(const SigEvent& e) const
void TimeSigMap::add(int tick, const Fraction& f)
{
if (!f.isValid()) {
qDebug("illegal signature %d/%d", f.numerator(), f.denominator());
LOGD("illegal signature %d/%d", f.numerator(), f.denominator());
}
(*this)[tick] = SigEvent(f);
normalize();
@ -331,7 +331,7 @@ void TimeSigMap::tickValues(int t, int* bar, int* beat, int* tick) const
int ticksB = ticks_beat(e->second.timesig().denominator()); // ticks in beat
int ticksM = ticksB * e->second.timesig().numerator(); // ticks in measure (bar)
if (ticksM == 0) {
qDebug("TimeSigMap::tickValues: at %d %s", t, qPrintable(e->second.timesig().toString()));
LOGD("TimeSigMap::tickValues: at %d %s", t, qPrintable(e->second.timesig().toString()));
*bar = 0;
*beat = 0;
*tick = 0;
@ -374,9 +374,9 @@ int TimeSigMap::bar2tick(int bar, int beat) const
}
}
if (empty() || e == begin()) {
qDebug("TimeSigMap::bar2tick(): not found(%d,%d) not found", bar, beat);
LOGD("TimeSigMap::bar2tick(): not found(%d,%d) not found", bar, beat);
if (empty()) {
qDebug(" list is empty");
LOGD(" list is empty");
}
return 0;
}
@ -504,7 +504,7 @@ unsigned TimeSigMap::raster(unsigned t, int raster) const
}
auto e = upper_bound(t);
if (e == end()) {
qDebug("TimeSigMap::raster(%x,)", t);
LOGD("TimeSigMap::raster(%x,)", t);
return t;
}
auto timesig = e->second.timesig();
@ -563,9 +563,9 @@ int TimeSigMap::rasterStep(unsigned t, int raster) const
void TimeSigMap::dump() const
{
qDebug("TimeSigMap:");
LOGD("TimeSigMap:");
for (auto i = begin(); i != end(); ++i) {
qDebug("%6d timesig: %s measure: %d",
LOGD("%6d timesig: %s measure: %d",
i->first, qPrintable(i->second.timesig().toString()), i->second.bar());
}
}

View file

@ -366,7 +366,7 @@ void SlurSegment::computeBezier(mu::PointF p6o)
if ((p2.x() == 0.0) && (p2.y() == 0.0)) {
Measure* m1 = slur()->startCR()->segment()->measure();
Measure* m2 = slur()->endCR()->segment()->measure();
qDebug("zero slur at tick %d(%d) track %zu in measure %d-%d tick %d ticks %d",
LOGD("zero slur at tick %d(%d) track %zu in measure %d-%d tick %d ticks %d",
m1->tick().ticks(), tick().ticks(), track(), m1->no(), m2->no(), slur()->tick().ticks(), slur()->ticks().ticks());
slur()->setBroken(true);
return;
@ -720,7 +720,7 @@ void Slur::slurPosChord(SlurPos* sp)
Measure* measure = endChord()->measure();
sp->system1 = measure->system();
if (!sp->system1) { // DEBUG
qDebug("no system1");
LOGD("no system1");
return;
}
Q_ASSERT(sp->system1);
@ -812,7 +812,7 @@ void Slur::slurPos(SlurPos* sp)
sp->system2 = ecr->measure()->system();
if (sp->system1 == 0) {
qDebug("no system1");
LOGD("no system1");
return;
}
@ -1175,7 +1175,7 @@ int calcStemArrangement(EngravingItem* start, EngravingItem* end)
void Slur::write(XmlWriter& xml) const
{
if (broken()) {
qDebug("broken slur not written");
LOGD("broken slur not written");
return;
}
if (!xml.canWrite(this)) {
@ -1283,7 +1283,7 @@ SpannerSegment* Slur::layoutSystem(System* system)
setTrack2(track());
}
if (startCR() == 0 || startCR()->measure() == 0) {
qDebug("Slur::layout(): track %zu-%zu %p - %p tick %d-%d null start anchor",
LOGD("Slur::layout(): track %zu-%zu %p - %p tick %d-%d null start anchor",
track(), track2(), startCR(), endCR(), tick().ticks(), tick2().ticks());
return slurSegment;
}
@ -1589,12 +1589,12 @@ void Slur::layout()
}
if (startCR() == 0 || startCR()->measure() == 0) {
qDebug("track %zu-%zu %p - %p tick %d-%d null start anchor",
LOGD("track %zu-%zu %p - %p tick %d-%d null start anchor",
track(), track2(), startCR(), endCR(), tick().ticks(), tick2().ticks());
return;
}
if (endCR() == 0) { // sanity check
qDebug("no end CR for %d", (tick() + ticks()).ticks());
LOGD("no end CR for %d", (tick() + ticks()).ticks());
setEndElement(startCR());
setTick2(tick());
}
@ -1656,7 +1656,7 @@ void Slur::layout()
++is;
}
if (is == sl.end()) {
qDebug("Slur::layout first system not found");
LOGD("Slur::layout first system not found");
}
setPos(0, 0);

View file

@ -724,7 +724,7 @@ void Spanner::computeEndElement()
Fraction tick = (l->ticks().ticks() == Lyrics::TEMP_MELISMA_TICKS) ? l->tick() : l->endTick();
Segment* s = score()->tick2segment(tick, true, SegmentType::ChordRest);
if (!s) {
qDebug("%s no end segment for tick %d", typeName(), tick.ticks());
LOGD("%s no end segment for tick %d", typeName(), tick.ticks());
return;
}
voice_idx_t t = trackZeroVoice(track2());
@ -741,7 +741,7 @@ void Spanner::computeEndElement()
_endElement = score()->findCRinStaff(tick2(), track2() / VOICES);
}
if (!_endElement) {
qDebug("%s no end element for tick %d", typeName(), tick2().ticks());
LOGD("%s no end element for tick %d", typeName(), tick2().ticks());
return;
}
@ -749,7 +749,7 @@ void Spanner::computeEndElement()
ChordRest* cr = endCR();
Fraction nticks = cr->tick() + cr->actualTicks() - _tick;
if ((_ticks - nticks).isNotZero()) {
qDebug("%s ticks changed, %d -> %d", typeName(), _ticks.ticks(), nticks.ticks());
LOGD("%s ticks changed, %d -> %d", typeName(), _ticks.ticks(), nticks.ticks());
setTicks(nticks);
if (isOttava()) {
staff()->updateOttava();
@ -762,7 +762,7 @@ void Spanner::computeEndElement()
case Anchor::MEASURE:
_endElement = score()->tick2measure(tick2() - Fraction(1, 1920));
if (!_endElement) {
qDebug("Spanner::computeEndElement(), measure not found for tick %d\n", tick2().ticks() - 1);
LOGD("Spanner::computeEndElement(), measure not found for tick %d\n", tick2().ticks() - 1);
_endElement = score()->lastMeasure();
}
break;
@ -1380,7 +1380,7 @@ void Spanner::eraseSpannerSegments()
SpannerSegment* Spanner::layoutSystem(System*)
{
qDebug(" %s", typeName());
LOGD(" %s", typeName());
return 0;
}

View file

@ -102,7 +102,7 @@ bool SpannerMap::removeSpanner(Spanner* s)
return true;
}
}
qDebug("%s (%p) not found", s->typeName(), s);
LOGD("%s (%p) not found", s->typeName(), s);
return false;
}
@ -113,9 +113,9 @@ bool SpannerMap::removeSpanner(Spanner* s)
void SpannerMap::dump() const
{
qDebug("SpannerMap::dump");
LOGD("SpannerMap::dump");
for (auto i = begin(); i != end(); ++i) {
qDebug(" %5d: %s %p", i->first, i->second->typeName(), i->second);
LOGD(" %5d: %s %p", i->first, i->second->typeName(), i->second);
}
}

View file

@ -497,9 +497,9 @@ QString Staff::staffName() const
void Staff::dumpClefs(const char* title) const
{
qDebug("(%zd): %s", clefs.size(), title);
LOGD("(%zd): %s", clefs.size(), title);
for (auto& i : clefs) {
qDebug(" %d: %d %d", i.first, int(i.second._concertClef), int(i.second._transposingClef));
LOGD(" %d: %d %d", i.first, int(i.second._concertClef), int(i.second._transposingClef));
}
}
@ -509,9 +509,9 @@ void Staff::dumpClefs(const char* title) const
void Staff::dumpKeys(const char* title) const
{
qDebug("(%zd): %s", _keys.size(), title);
LOGD("(%zd): %s", _keys.size(), title);
for (auto& i : _keys) {
qDebug(" %d: %d", i.first, int(i.second.key()));
LOGD(" %d: %d", i.first, int(i.second.key()));
}
}
@ -521,9 +521,9 @@ void Staff::dumpKeys(const char* title) const
void Staff::dumpTimeSigs(const char* title) const
{
qDebug("size (%zd) staffIdx %zu: %s", timesigs.size(), idx(), title);
LOGD("size (%zd) staffIdx %zu: %s", timesigs.size(), idx(), title);
for (auto& i : timesigs) {
qDebug(" %d: %d/%d", i.first, i.second->sig().numerator(), i.second->sig().denominator());
LOGD(" %d: %d/%d", i.first, i.second->sig().numerator(), i.second->sig().denominator());
}
}
@ -907,7 +907,7 @@ bool Staff::readProperties(XmlReader& e)
int v = e.readInt() - 1;
Staff* st = score()->masterScore()->staff(v);
if (_links) {
qDebug("Staff::readProperties: multiple <linkedTo> tags");
LOGD("Staff::readProperties: multiple <linkedTo> tags");
if (!st || isLinked(st)) { // maybe we don't need actually to relink...
return true;
}
@ -921,7 +921,7 @@ bool Staff::readProperties(XmlReader& e)
} else if (!score()->isMaster() && !st) {
// if it is a master score it is OK not to find
// a staff which is going after the current one.
qDebug("staff %d not found in parent", v);
LOGD("staff %d not found in parent", v);
}
} else if (tag == "color") {
staffType(Fraction(0, 1))->setColor(e.readColor());
@ -1572,7 +1572,7 @@ PropertyValue Staff::getProperty(Pid id) const
case Pid::GENERATED:
return false;
default:
qDebug("unhandled id <%s>", propertyName(id));
LOGD("unhandled id <%s>", propertyName(id));
return PropertyValue();
}
}
@ -1645,7 +1645,7 @@ bool Staff::setProperty(Pid id, const PropertyValue& v)
setUserDist(v.value<Millimetre>());
break;
default:
qDebug("unhandled id <%s>", propertyName(id));
LOGD("unhandled id <%s>", propertyName(id));
break;
}
triggerLayout();
@ -1678,7 +1678,7 @@ PropertyValue Staff::propertyDefault(Pid id) const
case Pid::STAFF_USERDIST:
return Millimetre(0.0);
default:
qDebug("unhandled id <%s>", propertyName(id));
LOGD("unhandled id <%s>", propertyName(id));
return PropertyValue();
}
}

View file

@ -29,6 +29,8 @@
#include "staff.h"
#include "part.h"
#include "log.h"
using namespace mu;
using namespace mu::draw;
@ -152,7 +154,7 @@ void StaffState::layout()
break;
default:
qDebug("unknown layout break symbol");
LOGD("unknown layout break symbol");
break;
}
RectF bb(0, 0, w, h);

View file

@ -29,6 +29,8 @@
#include "score.h"
#include "measure.h"
#include "log.h"
using namespace mu;
using namespace mu::engraving;
@ -219,7 +221,7 @@ bool StaffTextBase::getAeolusStop(int group, int idx) const
Segment* StaffTextBase::segment() const
{
if (!explicitParent()->isSegment()) {
qDebug("parent %s", explicitParent()->typeName());
LOGD("parent %s", explicitParent()->typeName());
return 0;
}
Segment* s = toSegment(explicitParent());

View file

@ -37,6 +37,8 @@
#include "staff.h"
#include "score.h"
#include "log.h"
using namespace mu;
using namespace mu::engraving;
@ -355,7 +357,7 @@ void StaffType::read(XmlReader& e)
} else if (group == fileGroupNames[(int)StaffGroup::STANDARD]) {
_group = StaffGroup::STANDARD;
} else {
qDebug("StaffType::read: unknown group: %s", qPrintable(group));
LOGD("StaffType::read: unknown group: %s", qPrintable(group));
_group = StaffGroup::STANDARD;
}
@ -1253,7 +1255,7 @@ bool StaffType::readConfigFile(const QString& fileName)
if (!fi.exists() || !f.open(QIODevice::ReadOnly)) {
MScore::lastError = QObject::tr("Cannot open tablature font description:\n%1\n%2").arg(f.fileName(), f.errorString());
qDebug("StaffTypeTablature::readConfigFile failed: <%s>", qPrintable(path));
LOGD("StaffTypeTablature::readConfigFile failed: <%s>", qPrintable(path));
return false;
}

View file

@ -156,7 +156,7 @@ void Symbol::read(XmlReader& e)
// TODO: does it make sense? user names are probably localized
symId = SymNames::symIdByUserName(val);
if (symId == SymId::noSym) {
qDebug("unknown symbol <%s>, falling back to no symbol", qPrintable(val));
LOGD("unknown symbol <%s>, falling back to no symbol", qPrintable(val));
// set a default symbol, or layout() will crash
symId = SymId::noSym;
}

View file

@ -462,7 +462,7 @@ void System::setMeasureHeight(qreal height)
} else if (m->isTBox()) {
toTBox(m)->layout();
} else {
qDebug("unhandled measure type %s", m->typeName());
LOGD("unhandled measure type %s", m->typeName());
}
}
}
@ -1089,13 +1089,13 @@ void System::add(EngravingItem* el)
if (!el) {
return;
}
// qDebug("%p System::add: %p %s", this, el, el->typeName());
// LOGD("%p System::add: %p %s", this, el, el->typeName());
el->setParent(this);
switch (el->type()) {
case ElementType::INSTRUMENT_NAME:
// qDebug(" staffIdx %d, staves %d", el->staffIdx(), _staves.size());
// LOGD(" staffIdx %d, staves %d", el->staffIdx(), _staves.size());
_staves[el->staffIdx()]->instrumentNames.push_back(toInstrumentName(el));
toInstrumentName(el)->setSysStaff(_staves[el->staffIdx()]);
break;
@ -1135,7 +1135,7 @@ void System::add(EngravingItem* el)
SpannerSegment* ss = toSpannerSegment(el);
#ifndef NDEBUG
if (mu::contains(_spannerSegments, ss)) {
qDebug("System::add() %s %p already there", ss->typeName(), ss);
LOGD("System::add() %s %p already there", ss->typeName(), ss);
} else
#endif
_spannerSegments.push_back(ss);
@ -1154,7 +1154,7 @@ void System::add(EngravingItem* el)
break;
default:
qDebug("System::add(%s) not implemented", el->typeName());
LOGD("System::add(%s) not implemented", el->typeName());
return;
}
@ -1179,7 +1179,7 @@ void System::remove(EngravingItem* el)
{
Bracket* b = toBracket(el);
if (!mu::remove(_brackets, b)) {
qDebug("System::remove: bracket not found");
LOGD("System::remove: bracket not found");
}
}
break;
@ -1203,7 +1203,7 @@ void System::remove(EngravingItem* el)
case ElementType::TEMPO_RANGED_CHANGE_SEGMENT:
case ElementType::GLISSANDO_SEGMENT:
if (!mu::remove(_spannerSegments, toSpannerSegment(el))) {
qDebug("System::remove: %p(%s) not found, score %p", el, el->typeName(), score());
LOGD("System::remove: %p(%s) not found, score %p", el, el->typeName(), score());
Q_ASSERT(score() == el->score());
}
break;
@ -1217,7 +1217,7 @@ void System::remove(EngravingItem* el)
break;
default:
qDebug("System::remove(%s) not implemented", el->typeName());
LOGD("System::remove(%s) not implemented", el->typeName());
return;
}
@ -1330,7 +1330,7 @@ void System::scanElements(void* data, void (* func)(void*, EngravingItem*), bool
for (SpannerSegment* ss : _spannerSegments) {
staff_idx_t staffIdx = ss->spanner()->staffIdx();
if (staffIdx == mu::nidx) {
qDebug("System::scanElements: staffIDx == -1: %s %p", ss->spanner()->typeName(), ss->spanner());
LOGD("System::scanElements: staffIDx == -1: %s %p", ss->spanner()->typeName(), ss->spanner());
staffIdx = 0;
}
bool v = true;
@ -1583,7 +1583,7 @@ staff_idx_t System::firstVisibleSysStaff() const
return i;
}
}
qDebug("no sys staff");
LOGD("no sys staff");
return mu::nidx;
}
@ -1599,7 +1599,7 @@ staff_idx_t System::lastVisibleSysStaff() const
return static_cast<staff_idx_t>(i);
}
}
qDebug("no sys staff");
LOGD("no sys staff");
return mu::nidx;
}
@ -1773,7 +1773,7 @@ qreal System::firstNoteRestSegmentX(bool leading)
}
}
}
qDebug("firstNoteRestSegmentX: did not find segment");
LOGD("firstNoteRestSegmentX: did not find segment");
return margin;
}
@ -1812,7 +1812,7 @@ qreal System::lastNoteRestSegmentX(bool trailing)
}
}
}
qDebug("lastNoteRestSegmentX: did not find segment");
LOGD("lastNoteRestSegmentX: did not find segment");
return margin;
}

View file

@ -137,9 +137,9 @@ void TempoMap::normalize()
void TempoMap::dump() const
{
qDebug("\nTempoMap:");
LOGD("\nTempoMap:");
for (auto i = begin(); i != end(); ++i) {
qDebug("%6d type: %2d tempo: %f pause: %f time: %f",
LOGD("%6d type: %2d tempo: %f pause: %f time: %f",
i->first, static_cast<int>(i->second.type), i->second.tempo.val, i->second.pause, i->second.time);
}
}
@ -203,7 +203,7 @@ void TempoMap::del(int tick)
{
auto e = find(tick);
if (e == end()) {
qDebug("TempoMap::del event at (%d): not found", tick);
LOGD("TempoMap::del event at (%d): not found", tick);
// abort();
return;
}
@ -287,7 +287,7 @@ qreal TempoMap::tick2time(int tick, int* sn) const
}
delta = qreal(tick - ptick);
} else {
qDebug("TempoMap: empty");
LOGD("TempoMap: empty");
}
if (sn) {
*sn = _tempoSN;

View file

@ -504,7 +504,7 @@ bool TextCursor::movePosition(TextCursor::MoveOperation op, TextCursor::MoveMode
break;
default:
qDebug("Text::movePosition: not implemented");
LOGD("Text::movePosition: not implemented");
return false;
}
if (mode == TextCursor::MoveMode::MoveAnchor) {
@ -1235,7 +1235,7 @@ QString TextBlock::remove(int column, TextCursor* cursor)
}
insertEmptyFragmentIfNeeded(cursor); // without this, cursorRect can't calculate the y position of the cursor correctly
return s;
// qDebug("TextBlock::remove: column %d not found", column);
// LOGD("TextBlock::remove: column %d not found", column);
}
//---------------------------------------------------------
@ -1733,7 +1733,7 @@ void TextBase::createLayout()
insert(&cursor, code);
cursor.setFormat(fmt); // restore format
} else {
qDebug("unknown symbol <%s>", qPrintable(sym));
LOGD("unknown symbol <%s>", qPrintable(sym));
}
}
} else {
@ -1808,7 +1808,7 @@ bool TextBase::prepareFormat(const QString& token, Ms::CharFormat& format)
format.setFontFamily(face);
return true;
} else {
qDebug("cannot parse html property <%s> in text <%s>",
LOGD("cannot parse html property <%s> in text <%s>",
qPrintable(token), qPrintable(_text));
}
}
@ -2744,17 +2744,17 @@ bool TextBase::validateText(QString& s)
QString ss = "<data>" + d + "</data>\n";
XmlReader xml(ss);
while (xml.readNextStartElement()) {
// qDebug(" token %d <%s>", int(xml.tokenType()), qPrintable(xml.name().toString()));
// LOGD(" token %d <%s>", int(xml.tokenType()), qPrintable(xml.name().toString()));
}
if (xml.error() == QXmlStreamReader::NoError) {
s = d;
return true;
}
qDebug("xml error at line %lld column %lld: %s",
LOGD("xml error at line %lld column %lld: %s",
xml.lineNumber(),
xml.columnNumber(),
qPrintable(xml.errorString()));
qDebug("text: |%s|", qPrintable(ss));
LOGD("text: |%s|", qPrintable(ss));
return false;
}
@ -3118,7 +3118,7 @@ Sid TextBase::getPropertyStyle(Pid id) const
void TextBase::styleChanged()
{
if (!styledProperties()) {
qDebug("no styled properties");
LOGD("no styled properties");
return;
}
int i = 0;
@ -3283,7 +3283,7 @@ void TextBase::drawEditMode(mu::draw::Painter* p, EditData& ed, qreal currentVie
TextEditData* ted = static_cast<TextEditData*>(ed.getData(this).get());
if (!ted) {
qDebug("ted not found");
LOGD("ted not found");
return;
}
TextCursor* cursor = ted->cursor();

View file

@ -162,7 +162,7 @@ void TextBase::endEdit(EditData& ed)
const bool removeTextIfEmpty = !(explicitParent() && explicitParent()->isTBox());
if (actualPlainText.isEmpty() && removeTextIfEmpty) {
qDebug("actual text is empty");
LOGD("actual text is empty");
// If this assertion fails, no undo command relevant to this text
// resides on undo stack and reopen() would corrupt the previous
@ -732,7 +732,7 @@ EngravingItem* TextBase::drop(EditData& ed)
break;
default:
qDebug("drop <%s> not handled", e->typeName());
LOGD("drop <%s> not handled", e->typeName());
break;
}
return 0;
@ -745,7 +745,7 @@ EngravingItem* TextBase::drop(EditData& ed)
void TextBase::paste(EditData& ed, const QString& txt)
{
if (MScore::debugMode) {
qDebug("<%s>", qPrintable(txt));
LOGD("<%s>", qPrintable(txt));
}
int state = 0;
@ -850,7 +850,7 @@ void TextBase::endHexState(EditData& ed)
if (ok) {
editInsertText(cursor, QString(code));
} else {
qDebug("cannot convert hex string <%s>, state %d (%d-%d)",
LOGD("cannot convert hex string <%s>, state %d (%d-%d)",
qPrintable(ss.mid(1)), hexState, c1, c2);
}
}

View file

@ -164,7 +164,7 @@ void TBox::remove(EngravingItem* el)
// but if it does:
// replace with new empty text element
// this keeps undo/redo happier than just clearing the text
qDebug("TBox::remove() - replacing _text");
LOGD("TBox::remove() - replacing _text");
_text = Factory::createText(this, TextStyleType::FRAME);
_text->setLayoutToParentWidth(true);
_text->setParent(this);

View file

@ -257,7 +257,7 @@ void TieSegment::computeBezier(PointF shoulderOffset)
PointF tieEndNormalized = tieEnd - tieStart; // normalize to zero
if (tieEndNormalized.x() == 0.0) {
qDebug("zero tie");
LOGD("zero tie");
return;
}
@ -845,7 +845,7 @@ void Tie::slurPos(SlurPos* sp)
sp->system1 = sc->measure()->system();
if (!sp->system1) {
Measure* m = sc->measure();
qDebug("No system: measure is %d has %d count %d", m->isMMRest(), m->hasMMRest(), m->mmRestCount());
LOGD("No system: measure is %d has %d count %d", m->isMMRest(), m->hasMMRest(), m->mmRestCount());
}
qreal x1, y1;
@ -1104,7 +1104,7 @@ TieSegment* Tie::layoutFor(System* system)
//
if (startNote() == 0 || endNote() == 0) {
if (startNote() == 0) {
qDebug("no start note");
LOGD("no start note");
return 0;
}
Chord* c1 = startNote()->chord();

View file

@ -295,7 +295,7 @@ void TimeSig::layout()
// if staff is without time sig, format as if no text at all
if (!_staff->staffTypeForElement(this)->genTimesig()) {
// reset position and box sizes to 0
// qDebug("staff: no time sig");
// LOGD("staff: no time sig");
pointLargeLeftParen.rx() = 0.0;
pn.rx() = 0.0;
pz.rx() = 0.0;

View file

@ -150,7 +150,7 @@ int transposeTpc(int tpc, Interval interval, bool useDoubleSharpsFlats)
int steps = interval.diatonic;
int semitones = interval.chromatic;
// qDebug("transposeTpc tpc %d steps %d semitones %d", tpc, steps, semitones);
// LOGD("transposeTpc tpc %d steps %d semitones %d", tpc, steps, semitones);
if (semitones == 0 && steps == 0) {
return tpc;
}
@ -188,9 +188,9 @@ int transposeTpc(int tpc, Interval interval, bool useDoubleSharpsFlats)
} else {
break;
}
// qDebug(" again alter %d steps %d, step %d", alter, steps, step);
// LOGD(" again alter %d steps %d, step %d", alter, steps, step);
}
// qDebug(" = step %d alter %d tpc %d", step, alter, step2tpc(step, alter));
// LOGD(" = step %d alter %d tpc %d", step, alter, step2tpc(step, alter));
return step2tpc(step, AccidentalVal(alter));
}
@ -679,7 +679,7 @@ void Score::transposeSemitone(int step)
const int interval = intervalListArray[keyType][step > 0 ? 0 : 1];
if (!transpose(TransposeMode::BY_INTERVAL, dir, Key::C, interval, true, true, false)) {
qDebug("Score::transposeSemitone: failed");
LOGD("Score::transposeSemitone: failed");
// TODO: set error message
} else {
setSelectionChanged(true);

View file

@ -350,7 +350,7 @@ void Trill::layout()
}
TrillSegment* ls = toTrillSegment(frontSegment());
if (spannerSegments().empty()) {
qDebug("Trill: no segments");
LOGD("Trill: no segments");
}
if (_accidental) {
_accidental->setParent(ls);
@ -442,7 +442,7 @@ void Trill::setTrillType(const QString& s)
return;
}
}
qDebug("Trill::setSubtype: unknown <%s>", qPrintable(s));
LOGD("Trill::setSubtype: unknown <%s>", qPrintable(s));
}
//---------------------------------------------------------
@ -456,7 +456,7 @@ QString Trill::type2name(Trill::Type t)
return i.name;
}
}
qDebug("unknown Trill subtype %d", int(t));
LOGD("unknown Trill subtype %d", int(t));
return "?";
}

View file

@ -175,7 +175,7 @@ void Tuplet::resetNumberProperty()
void Tuplet::layout()
{
if (_elements.empty()) {
qDebug("Tuplet::layout(): tuplet is empty");
LOGD("Tuplet::layout(): tuplet is empty");
return;
}
// is in a TAB without stems, skip any format: tuplets are not shown
@ -955,7 +955,7 @@ void Tuplet::add(EngravingItem* e)
#ifndef NDEBUG
for (DurationElement* el : _elements) {
if (el == e) {
qDebug("%p: %p %s already there", this, e, e->typeName());
LOGD("%p: %p %s already there", this, e, e->typeName());
return;
}
}
@ -985,7 +985,7 @@ void Tuplet::add(EngravingItem* e)
break;
default:
qDebug("Tuplet::add() unknown element");
LOGD("Tuplet::add() unknown element");
return;
}
@ -1008,8 +1008,8 @@ void Tuplet::remove(EngravingItem* e)
case ElementType::TUPLET: {
auto i = std::find(_elements.begin(), _elements.end(), toDurationElement(e));
if (i == _elements.end()) {
qDebug("Tuplet::remove: cannot find element <%s>", e->typeName());
qDebug(" elements %zu", _elements.size());
LOGD("Tuplet::remove: cannot find element <%s>", e->typeName());
LOGD(" elements %zu", _elements.size());
} else {
_elements.erase(i);
e->removed();
@ -1017,7 +1017,7 @@ void Tuplet::remove(EngravingItem* e)
}
break;
default:
qDebug("Tuplet::remove: unknown element");
LOGD("Tuplet::remove: unknown element");
break;
}
}
@ -1336,11 +1336,11 @@ void Tuplet::sanitizeTuplet()
if (TDuration::isValid(fbl)) {
setTicks(testDuration);
setBaseLen(fbl);
qDebug("Tuplet %p sanitized duration %d/%d baseLen %d/%d", this,
LOGD("Tuplet %p sanitized duration %d/%d baseLen %d/%d", this,
testDuration.numerator(), testDuration.denominator(),
1, fbl.denominator());
} else {
qDebug("Impossible to sanitize the tuplet");
LOGD("Impossible to sanitize the tuplet");
}
}
}
@ -1357,7 +1357,7 @@ Fraction Tuplet::addMissingElement(const Fraction& startTick, const Fraction& en
Fraction f = (endTick - startTick) * ratio();
TDuration d = TDuration(f, true);
if (!d.isValid()) {
qDebug("Tuplet::addMissingElement(): invalid duration: %d/%d", f.numerator(), f.denominator());
LOGD("Tuplet::addMissingElement(): invalid duration: %d/%d", f.numerator(), f.denominator());
return Fraction::fromTicks(0);
}
f = d.fraction();
@ -1439,7 +1439,7 @@ void Tuplet::addMissingElements()
}
missingElementsDuration -= addMissingElement(startTick, endTick);
if (!missingElementsDuration.isZero()) {
qDebug("Tuplet::addMissingElements(): still missing duration of %d/%d",
LOGD("Tuplet::addMissingElements(): still missing duration of %d/%d",
missingElementsDuration.numerator(), missingElementsDuration.denominator());
}
}

View file

@ -85,7 +85,7 @@ Measure* Score::tick2measure(const Fraction& tick) const
if (lm && (tick >= lm->tick()) && (tick <= lm->endTick())) {
return lm;
}
qDebug("tick2measure %d (max %d) not found", tick.ticks(), lm ? lm->tick().ticks() : -1);
LOGD("tick2measure %d (max %d) not found", tick.ticks(), lm ? lm->tick().ticks() : -1);
return 0;
}
@ -116,7 +116,7 @@ Measure* Score::tick2measureMM(const Fraction& t) const
if (lm && (tick >= lm->tick()) && (tick <= lm->endTick())) {
return lm;
}
qDebug("tick2measureMM %d (max %d) not found", tick.ticks(), lm ? lm->tick().ticks() : -1);
LOGD("tick2measureMM %d (max %d) not found", tick.ticks(), lm ? lm->tick().ticks() : -1);
return 0;
}
@ -133,7 +133,7 @@ MeasureBase* Score::tick2measureBase(const Fraction& tick) const
return mb;
}
}
// qDebug("tick2measureBase %d not found", tick);
// LOGD("tick2measureBase %d not found", tick);
return 0;
}
@ -171,7 +171,7 @@ Segment* Score::tick2segment(const Fraction& t, bool first, SegmentType st, bool
}
if (m == 0) {
qDebug("no measure for tick %d", tick.ticks());
LOGD("no measure for tick %d", tick.ticks());
return 0;
}
for (Segment* segment = m->first(st); segment;) {
@ -188,7 +188,7 @@ Segment* Score::tick2segment(const Fraction& t, bool first, SegmentType st, bool
}
segment = nsegment;
}
qDebug("no segment for tick %d (start search at %d (measure %d))", tick.ticks(), t.ticks(), m->tick().ticks());
LOGD("no segment for tick %d (start search at %d (measure %d))", tick.ticks(), t.ticks(), m->tick().ticks());
return 0;
}
@ -212,7 +212,7 @@ Segment* Score::tick2leftSegment(const Fraction& tick, bool useMMrest) const
{
Measure* m = useMMrest ? tick2measureMM(tick) : tick2measure(tick);
if (m == 0) {
qDebug("tick2leftSegment(): not found tick %d", tick.ticks());
LOGD("tick2leftSegment(): not found tick %d", tick.ticks());
return 0;
}
// loop over all segments
@ -238,7 +238,7 @@ Segment* Score::tick2rightSegment(const Fraction& tick, bool useMMrest) const
{
Measure* m = useMMrest ? tick2measureMM(tick) : tick2measure(tick);
if (m == 0) {
//qDebug("tick2nearestSegment(): not found tick %d", tick.ticks());
//LOGD("tick2nearestSegment(): not found tick %d", tick.ticks());
return 0;
}
// loop over all segments
@ -662,7 +662,7 @@ int version()
return _majorVersion * 10000 + _minorVersion * 100 + _patchVersion;
}
}
qDebug() << "Could not parse version:" << VERSION;
LOGD() << "Could not parse version:" << VERSION;
return 0;
}

View file

@ -209,7 +209,7 @@ void Vibrato::layout()
return;
}
if (spannerSegments().empty()) {
qDebug("Vibrato: no segments");
LOGD("Vibrato: no segments");
return;
}
}
@ -283,7 +283,7 @@ void Vibrato::setVibratoType(const QString& s)
return;
}
}
qDebug("Vibrato::setSubtype: unknown <%s>", qPrintable(s));
LOGD("Vibrato::setSubtype: unknown <%s>", qPrintable(s));
}
//---------------------------------------------------------
@ -297,7 +297,7 @@ QString Vibrato::type2name(Vibrato::Type t)
return i.name;
}
}
qDebug("unknown Vibrato subtype %d", int(t));
LOGD("unknown Vibrato subtype %d", int(t));
return "?";
}

View file

@ -157,7 +157,7 @@ static const PaperSize* getPaperSize114(const QString& name)
return &paperSizes114[i];
}
}
qDebug("unknown paper size");
LOGD("unknown paper size");
return &paperSizes114[0];
}
@ -373,7 +373,7 @@ static bool readTextProperties(XmlReader& e, TextBase* t, EngravingItem*)
break;
case 0:
default:
qDebug("style %d invalid", i);
LOGD("style %d invalid", i);
ss = TextStyleType::DEFAULT;
break;
}
@ -383,7 +383,7 @@ static bool readTextProperties(XmlReader& e, TextBase* t, EngravingItem*)
} else if (tag == "html-data") {
QString ss = e.readXml();
QString s = convertFromHtml(ss);
// qDebug("html-data <%s>", qPrintable(s));
// LOGD("html-data <%s>", qPrintable(s));
t->setXmlText(s);
} else if (tag == "foregroundColor") { // same as "color" ?
e.skipCurrentElement();
@ -567,7 +567,7 @@ static void readAccidental(Accidental* a, XmlReader& e)
};
auto it = accMap.find(text);
if (it == accMap.end()) {
qDebug("invalid type %s", qPrintable(text));
LOGD("invalid type %s", qPrintable(text));
a->setAccidentalType(AccidentalType::NONE);
} else {
a->setAccidentalType(it->second);
@ -864,13 +864,13 @@ static void readNote(Note* note, XmlReader& e, ReadContext& ctx)
int tpc2Pitch = (tpc2pitch(note->tpc2()) + 12) % 12;
int concertPitch = note->pitch() % 12;
if (tpc1Pitch != concertPitch) {
qDebug("bad tpc1 - concertPitch = %d, tpc1 = %d", concertPitch, tpc1Pitch);
LOGD("bad tpc1 - concertPitch = %d, tpc1 = %d", concertPitch, tpc1Pitch);
note->setPitch(note->pitch() + tpc1Pitch - concertPitch);
}
Interval v = note->staff()->part()->instrument(e.tick())->transpose();
int transposedPitch = (note->pitch() - v.chromatic) % 12;
if (tpc2Pitch != transposedPitch) {
qDebug("bad tpc2 - transposedPitch = %d, tpc2 = %d", transposedPitch, tpc2Pitch);
LOGD("bad tpc2 - transposedPitch = %d, tpc2 = %d", transposedPitch, tpc2Pitch);
// just in case the staff transposition info is not reliable here,
v.flip();
note->setTpc2(Ms::transposeTpc(note->tpc1(), v, true));
@ -1449,7 +1449,7 @@ static void readHarmony114(XmlReader& e, const ReadContext& ctx, Harmony* h)
if (degreeValue <= 0 || degreeValue > 13
|| degreeAlter < -2 || degreeAlter > 2
|| (degreeType != "add" && degreeType != "alter" && degreeType != "subtract")) {
qDebug("incorrect degree: degreeValue=%d degreeAlter=%d degreeType=%s",
LOGD("incorrect degree: degreeValue=%d degreeAlter=%d degreeType=%s",
degreeValue, degreeAlter, qPrintable(degreeType));
} else {
if (degreeType == "add") {
@ -1538,7 +1538,7 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e, ReadContext& ctx
if (sl.size() == 2) {
m->setTicks(Fraction(sl[0].toInt(), sl[1].toInt()));
} else {
qDebug("illegal measure size <%s>", qPrintable(e.attribute("len")));
LOGD("illegal measure size <%s>", qPrintable(e.attribute("len")));
}
ctx.sigmap()->add(m->tick().ticks(), SigEvent(m->ticks(), m->timesig()));
ctx.sigmap()->add(m->endTick().ticks(), SigEvent(m->timesig()));
@ -1670,7 +1670,7 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e, ReadContext& ctx
pch->setTicks(pts * Fraction(1, 2));
chord->setTicks(crticks * Fraction(1, 2));
} else {
qDebug("tremolo: first note not found");
LOGD("tremolo: first note not found");
}
crticks = crticks * Fraction(1, 2);
} else {
@ -1877,7 +1877,7 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e, ReadContext& ctx
Fraction curTick = e.tick();
if (!ks->isCustom() && !ks->isAtonal() && ks->key() == Key::C && curTick.isZero()) {
// ignore empty key signature
qDebug("remove keysig c at tick 0");
LOGD("remove keysig c at tick 0");
if (ks->links()) {
if (ks->links()->size() == 1) {
mu::remove(e.linkIds(), ks->links()->lid());
@ -1914,7 +1914,7 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e, ReadContext& ctx
} else if (val == "middle") {
l->setSyllabic(Lyrics::Syllabic::MIDDLE);
} else {
qDebug("bad syllabic property");
LOGD("bad syllabic property");
}
} else if (t == "endTick") { // obsolete
// store <endTick> tag value until a <ticks> tag has been read
@ -1932,7 +1932,7 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e, ReadContext& ctx
// if any endTick, make it relative to current tick
if (iEndTick) {
l->setTicks(Fraction::fromTicks(iEndTick - e.tick().ticks()));
// qDebug("Lyrics::endTick: %d ticks %d", iEndTick, _ticks);
// LOGD("Lyrics::endTick: %d ticks %d", iEndTick, _ticks);
}
if (_verseNumber) {
// TODO: add text to main text
@ -1946,7 +1946,7 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e, ReadContext& ctx
cr = toChordRest(segment->element(e.track())); // in case lyric itself has bad track info
}
if (!cr) {
qDebug("Internal error: no chord/rest for lyrics");
LOGD("Internal error: no chord/rest for lyrics");
} else {
cr->add(l);
}
@ -1956,7 +1956,7 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e, ReadContext& ctx
t->setTrack(e.track());
readStaffText(t, e);
if (t->empty()) {
qDebug("reading empty text: deleted");
LOGD("reading empty text: deleted");
delete t;
} else {
segment->add(t);
@ -2127,7 +2127,7 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e, ReadContext& ctx
const QStringRef& t(e.name());
if (t == "off1") {
qreal o = e.readDouble();
qDebug("TODO: off1 %f", o);
LOGD("TODO: off1 %f", o);
} else {
e.unknown();
}
@ -2172,7 +2172,7 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e, ReadContext& ctx
}
}
if (!found) {
qDebug("Adding tuplet %p as nested tuplet to tuplet %p", tuplet2, tuplet);
LOGD("Adding tuplet %p as nested tuplet to tuplet %p", tuplet2, tuplet);
tuplet2->setTuplet(tuplet);
tuplet->add(tuplet2);
}
@ -2221,7 +2221,7 @@ static bool readBoxProperties(XmlReader& e, Box* b)
t = Factory::createText(b);
readText114(e, t, t);
if (t->empty()) {
qDebug("read empty text");
LOGD("read empty text");
} else {
b->add(t);
}
@ -2327,7 +2327,7 @@ static void readStaffContent(Score* score, XmlReader& e, ReadContext& ctx)
}
} else {
if (measure == 0) {
qDebug("Score::readStaff(): missing measure!");
LOGD("Score::readStaff(): missing measure!");
measure = Factory::createMeasure(score->dummy()->system());
measure->setTick(e.tick());
score->measures()->add(measure);
@ -2420,7 +2420,7 @@ static void readDrumset(Drumset* ds, XmlReader& e)
{
int pitch = e.intAttribute("pitch", -1);
if (pitch < 0 || pitch > 127) {
qDebug("load drumset: invalid pitch %d", pitch);
LOGD("load drumset: invalid pitch %d", pitch);
return;
}
while (e.readNextStartElement()) {
@ -2888,7 +2888,7 @@ Score::FileError Read114::read114(MasterScore* masterScore, XmlReader& e, ReadCo
s->setTrack2(s->track());
}
if (s->ticks().isZero()) {
qDebug("zero spanner %s ticks: %d", s->typeName(), s->ticks().ticks());
LOGD("zero spanner %s ticks: %d", s->typeName(), s->ticks().ticks());
delete s;
} else {
masterScore->addSpanner(s);
@ -2913,7 +2913,7 @@ Score::FileError Read114::read114(MasterScore* masterScore, XmlReader& e, ReadCo
}
if (e.error() != QXmlStreamReader::NoError) {
qDebug("%lld %lld: %s ", e.lineNumber(), e.columnNumber(), qPrintable(e.errorString()));
LOGD("%lld %lld: %s ", e.lineNumber(), e.columnNumber(), qPrintable(e.errorString()));
return Score::FileError::FILE_BAD_FORMAT;
}
@ -2923,7 +2923,7 @@ Score::FileError Read114::read114(MasterScore* masterScore, XmlReader& e, ReadCo
// check barLineSpan
if (s->barLineSpan() > static_cast<int>(masterScore->nstaves() - idx)) {
qDebug("read114: invalid barline span %d (max %zu)",
LOGD("read114: invalid barline span %d (max %zu)",
s->barLineSpan(), masterScore->nstaves() - idx);
s->setBarLineSpan(masterScore->nstaves() - idx);
}
@ -2959,7 +2959,7 @@ Score::FileError Read114::read114(MasterScore* masterScore, XmlReader& e, ReadCo
for (auto i = km->begin(); i != km->end(); ++i) {
Fraction tick = Fraction::fromTicks(i->first);
if (tick < Fraction(0, 1)) {
qDebug("read114: Key tick %d", tick.ticks());
LOGD("read114: Key tick %d", tick.ticks());
continue;
}
if (tick.isZero() && i->second.key() == Key::C) {
@ -3080,7 +3080,7 @@ Score::FileError Read114::read114(MasterScore* masterScore, XmlReader& e, ReadCo
staff_idx_t idx = staff->idx();
size_t n = masterScore->nstaves();
if (idx + barLineSpan > n) {
qDebug("bad span: idx %zu span %d staves %zu", idx, barLineSpan, n);
LOGD("bad span: idx %zu span %d staves %zu", idx, barLineSpan, n);
staff->setBarLineSpan(n - idx);
}
staff->updateOttava();

View file

@ -307,12 +307,12 @@ void Read206::readTextStyle206(MStyle* style, XmlReader& e, std::map<QString, st
if (ss == TextStyleType::TEXT_TYPES) {
ss = e.addUserTextStyle(name);
if (ss == TextStyleType::TEXT_TYPES) {
qDebug("unhandled substyle <%s>", qPrintable(name));
LOGD("unhandled substyle <%s>", qPrintable(name));
isExcessStyle = true;
} else {
int idx = int(ss) - int(TextStyleType::USER1);
if ((int(ss) < int(TextStyleType::USER1)) || (int(ss) > int(TextStyleType::USER12))) {
qDebug("User style index %d outside of range.", idx);
LOGD("User style index %d outside of range.", idx);
return;
}
Sid sid[] = { Sid::user1Name, Sid::user2Name, Sid::user3Name, Sid::user4Name, Sid::user5Name, Sid::user6Name,
@ -397,7 +397,7 @@ void Read206::readTextStyle206(MStyle* style, XmlReader& e, std::map<QString, st
}
break;
default:
// qDebug("unhandled property <%s>%d", propertyName(i.pid), int (i.pid));
// LOGD("unhandled property <%s>%d", propertyName(i.pid), int (i.pid));
break;
}
if (value.isValid()) {
@ -408,7 +408,7 @@ void Read206::readTextStyle206(MStyle* style, XmlReader& e, std::map<QString, st
}
}
// else
// qDebug("invalid style value <%s> pid<%s>", MStyle::valueName(i.sid), propertyName(i.pid));
// LOGD("invalid style value <%s> pid<%s>", MStyle::valueName(i.sid), propertyName(i.pid));
}
if (isExcessStyle && excessPairs.size() > 0) {
@ -453,7 +453,7 @@ void Read206::readAccidental206(Accidental* a, XmlReader& e)
};
auto it = accMap.find(text);
if (it == accMap.end()) {
qDebug("invalid type %s", qPrintable(text));
LOGD("invalid type %s", qPrintable(text));
a->setAccidentalType(AccidentalType::NONE);
} else {
a->setAccidentalType(it->second);
@ -616,7 +616,7 @@ static void readDrumset206(Drumset* ds, XmlReader& e)
{
int pitch = e.intAttribute("pitch", -1);
if (pitch < 0 || pitch > 127) {
qDebug("load drumset: invalid pitch %d", pitch);
LOGD("load drumset: invalid pitch %d", pitch);
return;
}
while (e.readNextStartElement()) {
@ -722,7 +722,7 @@ static void readStaff(Staff* staff, XmlReader& e)
const QStringRef& tag(e.name());
if (tag == "type") { // obsolete
int staffTypeIdx = e.readInt();
qDebug("obsolete: Staff::read staffTypeIdx %d", staffTypeIdx);
LOGD("obsolete: Staff::read staffTypeIdx %d", staffTypeIdx);
} else if (tag == "neverHide") {
bool v = e.readInt();
if (v) {
@ -1506,7 +1506,7 @@ bool Read206::readDurationProperties206(XmlReader& e, const ReadContext& ctx, Du
int i = e.readInt();
Tuplet* t = e.findTuplet(i);
if (!t) {
qDebug("readDurationProperties206(): Tuplet id %d not found", i);
LOGD("readDurationProperties206(): Tuplet id %d not found", i);
}
if (t) {
de->setTuplet(t);
@ -1599,7 +1599,7 @@ bool Read206::readChordRestProperties206(XmlReader& e, ReadContext& ctx, ChordRe
ch->add(el);
}
} else if (tag == "leadingSpace" || tag == "trailingSpace") {
qDebug("ChordRest: %s obsolete", tag.toLocal8Bit().data());
LOGD("ChordRest: %s obsolete", tag.toLocal8Bit().data());
e.skipCurrentElement();
} else if (tag == "Beam") {
int id = e.readInt();
@ -1607,7 +1607,7 @@ bool Read206::readChordRestProperties206(XmlReader& e, ReadContext& ctx, ChordRe
if (beam) {
beam->add(ch); // also calls ch->setBeam(beam)
} else {
qDebug("Beam id %d not found", id);
LOGD("Beam id %d not found", id);
}
} else if (tag == "small") {
ch->setSmall(e.readInt());
@ -1647,7 +1647,7 @@ bool Read206::readChordRestProperties206(XmlReader& e, ReadContext& ctx, ChordRe
sv.tick2 = e.tick();
e.addSpannerValues(sv);
} else if (atype == "start") {
qDebug("spanner: start without spanner");
LOGD("spanner: start without spanner");
}
} else {
if (atype == "start") {
@ -1708,7 +1708,7 @@ bool Read206::readChordRestProperties206(XmlReader& e, ReadContext& ctx, ChordRe
}
}
} else {
qDebug("readChordRestProperties206(): unknown Slur type <%s>", qPrintable(atype));
LOGD("readChordRestProperties206(): unknown Slur type <%s>", qPrintable(atype));
}
}
e.readNext();
@ -2256,7 +2256,7 @@ EngravingItem* Read206::readArticulation(EngravingItem* parent, XmlReader& e, co
if (i == n) {
sym = SymNames::symIdByName(s);
if (sym == SymId::noSym) {
qDebug("Articulation: unknown type <%s>", qPrintable(s));
LOGD("Articulation: unknown type <%s>", qPrintable(s));
}
}
}
@ -2299,7 +2299,7 @@ EngravingItem* Read206::readArticulation(EngravingItem* parent, XmlReader& e, co
timeStretch = e.readDouble();
} else {
if (!el) {
qDebug("not handled <%s>", qPrintable(tag.toString()));
LOGD("not handled <%s>", qPrintable(tag.toString()));
}
if (!el || !el->readProperties(e)) {
e.unknown();
@ -2416,7 +2416,7 @@ static void readMeasure206(Measure* m, int staffIdx, XmlReader& e, ReadContext&
if (sl.size() == 2) {
m->setTicks(Fraction(sl[0].toInt(), sl[1].toInt()));
} else {
qDebug("illegal measure size <%s>", qPrintable(e.attribute("len")));
LOGD("illegal measure size <%s>", qPrintable(e.attribute("len")));
}
irregular = true;
ctx.sigmap()->add(m->tick().ticks(), SigEvent(m->ticks(), m->timesig()));
@ -2666,7 +2666,7 @@ static void readMeasure206(Measure* m, int staffIdx, XmlReader& e, ReadContext&
}
if (clef->links() && clef->links()->size() == 1) {
mu::remove(e.linkIds(), clef->links()->lid());
qDebug("remove link %d", clef->links()->lid());
LOGD("remove link %d", clef->links()->lid());
}
delete clef;
continue;
@ -2750,7 +2750,7 @@ static void readMeasure206(Measure* m, int staffIdx, XmlReader& e, ReadContext&
Fraction curTick = e.tick();
if (!ks->isCustom() && !ks->isAtonal() && ks->key() == Key::C && curTick.isZero()) {
// ignore empty key signature
qDebug("remove keysig c at tick 0");
LOGD("remove keysig c at tick 0");
if (ks->links()) {
if (ks->links()->size() == 1) {
mu::remove(e.linkIds(), ks->links()->lid());
@ -2790,7 +2790,7 @@ static void readMeasure206(Measure* m, int staffIdx, XmlReader& e, ReadContext&
if (t->empty()) {
if (t->links()) {
if (t->links()->size() == 1) {
qDebug("reading empty text: deleted lid = %d", t->links()->lid());
LOGD("reading empty text: deleted lid = %d", t->links()->lid());
mu::remove(tctx.reader().linkIds(), t->links()->lid());
delete t;
}
@ -3003,7 +3003,7 @@ static void readBox(Box* b, XmlReader& e, const ReadContext& ctx)
t = Factory::createText(b);
readText206(e, ctx, t, t);
if (t->empty()) {
qDebug("read empty text");
LOGD("read empty text");
} else {
b->add(t);
}
@ -3104,7 +3104,7 @@ static void readStaffContent206(Score* score, XmlReader& e, ReadContext& ctx)
if (tag == "Measure") {
if (measure == 0) {
qDebug("Score::readStaff(): missing measure!");
LOGD("Score::readStaff(): missing measure!");
measure = Factory::createMeasure(score->dummy()->system());
measure->setTick(e.tick());
score->measures()->add(measure);
@ -3312,7 +3312,7 @@ bool Read206::readScore206(Score* score, XmlReader& e, ReadContext& ctx)
ex->read(e);
mScore->excerpts().push_back(ex);
} else {
qDebug("read206: readScore(): part cannot have parts");
LOGD("read206: readScore(): part cannot have parts");
e.skipCurrentElement();
}
}
@ -3348,14 +3348,14 @@ bool Read206::readScore206(Score* score, XmlReader& e, ReadContext& ctx)
} else if (s == "system") {
score->setLayoutMode(LayoutMode::SYSTEM);
} else {
qDebug("layoutMode: %s", qPrintable(s));
LOGD("layoutMode: %s", qPrintable(s));
}
} else {
e.unknown();
}
}
if (e.error() != QXmlStreamReader::NoError) {
qDebug("%s: xml read error at line %lld col %lld: %s",
LOGD("%s: xml read error at line %lld col %lld: %s",
qPrintable(e.getDocName()), e.lineNumber(), e.columnNumber(),
e.name().toUtf8().data());
MScore::lastError = QObject::tr("XML read error at line %1, column %2: %3").arg(e.lineNumber()).arg(e.columnNumber()).arg(

View file

@ -168,7 +168,7 @@ bool Read302::readScore302(Ms::Score* score, XmlReader& e, ReadContext& ctx)
ex->read(e);
mScore->excerpts().push_back(ex);
} else {
qDebug("Score::read(): part cannot have parts");
LOGD("Score::read(): part cannot have parts");
e.skipCurrentElement();
}
}
@ -212,7 +212,7 @@ bool Read302::readScore302(Ms::Score* score, XmlReader& e, ReadContext& ctx)
} else if (s == "system") {
score->setLayoutMode(LayoutMode::SYSTEM);
} else {
qDebug("layoutMode: %s", qPrintable(s));
LOGD("layoutMode: %s", qPrintable(s));
}
} else {
e.unknown();
@ -220,7 +220,7 @@ bool Read302::readScore302(Ms::Score* score, XmlReader& e, ReadContext& ctx)
}
e.reconnectBrokenConnectors();
if (e.error() != QXmlStreamReader::NoError) {
qDebug("%s: xml read error at line %lld col %lld: %s",
LOGD("%s: xml read error at line %lld col %lld: %s",
qPrintable(e.getDocName()), e.lineNumber(), e.columnNumber(),
e.name().toUtf8().data());
if (e.error() == QXmlStreamReader::CustomError) {

View file

@ -71,7 +71,7 @@ void ReadChordListHook::validate()
// but treat as "old" (114) score just in case
style.set(Sid::chordStyle, QString("custom"));
style.set(Sid::chordsXmlFile, true);
qDebug("StyleData::load: custom chord description file %s with chordStyle == std", qPrintable(newChordDescriptionFile));
LOGD("StyleData::load: custom chord description file %s with chordStyle == std", qPrintable(newChordDescriptionFile));
}
bool custom = style.value(Sid::chordStyle).toString() == "custom";

View file

@ -81,7 +81,7 @@ void MeasureRW::readMeasure(Measure* measure, XmlReader& e, ReadContext& ctx, in
if (sl.size() == 2) {
measure->_len = Fraction(sl[0].toInt(), sl[1].toInt());
} else {
qDebug("illegal measure size <%s>", qPrintable(e.attribute("len")));
LOGD("illegal measure size <%s>", qPrintable(e.attribute("len")));
}
irregular = true;
if (measure->_len.numerator() <= 0 || measure->_len.denominator() <= 0 || measure->_len.denominator() > 128) {
@ -216,7 +216,7 @@ void MeasureRW::readVoice(Measure* measure, XmlReader& e, ReadContext& ctx, int
loc.read(e);
e.setLocation(loc);
} else if (tag == "tick") { // obsolete?
qDebug("read midi tick");
LOGD("read midi tick");
e.setTick(Fraction::fromTicks(ctx.fileDivision(e.readInt())));
} else if (tag == "BarLine") {
BarLine* barLine = Factory::createBarLine(ctx.dummy()->segment());
@ -402,7 +402,7 @@ void MeasureRW::readVoice(Measure* measure, XmlReader& e, ReadContext& ctx, int
Fraction curTick = e.tick();
if (!ks->isCustom() && !ks->isAtonal() && ks->key() == Key::C && curTick.isZero()) {
// ignore empty key signature
qDebug("remove keysig c at tick 0");
LOGD("remove keysig c at tick 0");
} else {
// if key sig not at beginning of measure => courtesy key sig
bool courtesySig = (curTick == measure->endTick());
@ -418,7 +418,7 @@ void MeasureRW::readVoice(Measure* measure, XmlReader& e, ReadContext& ctx, int
t->setTrack(e.track());
t->read(e);
if (t->empty()) {
qDebug("==reading empty text: deleted");
LOGD("==reading empty text: deleted");
delete t;
} else {
segment->add(t);
@ -486,7 +486,7 @@ void MeasureRW::readVoice(Measure* measure, XmlReader& e, ReadContext& ctx, int
}
} else if (tag == "endTuplet") {
if (!tuplet) {
qDebug("Measure::read: encountered <endTuplet/> when no tuplet was started");
LOGD("Measure::read: encountered <endTuplet/> when no tuplet was started");
e.skipCurrentElement();
continue;
}
@ -494,7 +494,7 @@ void MeasureRW::readVoice(Measure* measure, XmlReader& e, ReadContext& ctx, int
tuplet = tuplet->tuplet();
if (oldTuplet->elements().empty()) {
// this should not happen and is a sign of input file corruption
qDebug("Measure:read: empty tuplet in measure index=%d, input file corrupted?", e.currentMeasureIndex());
LOGD("Measure:read: empty tuplet in measure index=%d, input file corrupted?", e.currentMeasureIndex());
if (tuplet) {
tuplet->remove(oldTuplet);
}
@ -507,7 +507,7 @@ void MeasureRW::readVoice(Measure* measure, XmlReader& e, ReadContext& ctx, int
beam->read(e);
beam->resetExplicitParent();
if (startingBeam) {
qDebug("The read beam was not used");
LOGD("The read beam was not used");
delete startingBeam;
}
startingBeam = beam;
@ -525,11 +525,11 @@ void MeasureRW::readVoice(Measure* measure, XmlReader& e, ReadContext& ctx, int
}
}
if (startingBeam) {
qDebug("The read beam was not used");
LOGD("The read beam was not used");
delete startingBeam;
}
if (tuplet) {
qDebug("Measure:readVoice: measure index=%d, <endTuplet/> not found", e.currentMeasureIndex());
LOGD("Measure:readVoice: measure index=%d, <endTuplet/> not found", e.currentMeasureIndex());
if (tuplet->elements().empty()) {
if (tuplet->tuplet()) {
tuplet->tuplet()->remove(tuplet);

View file

@ -42,7 +42,7 @@ using namespace Ms;
bool Read400::read400(Ms::Score* score, XmlReader& e, ReadContext& ctx)
{
if (!e.readNextStartElement()) {
qDebug("%s: xml file is empty", qPrintable(e.getDocName()));
LOGD("%s: xml file is empty", qPrintable(e.getDocName()));
return false;
}
@ -64,7 +64,7 @@ bool Read400::read400(Ms::Score* score, XmlReader& e, ReadContext& ctx)
}
}
} else {
qDebug("%s: invalid structure of xml file", qPrintable(e.getDocName()));
LOGD("%s: invalid structure of xml file", qPrintable(e.getDocName()));
return false;
}
@ -212,7 +212,7 @@ bool Read400::readScore400(Ms::Score* score, XmlReader& e, ReadContext& ctx)
} else if (s == "system") {
score->setLayoutMode(LayoutMode::SYSTEM);
} else {
qDebug("layoutMode: %s", qPrintable(s));
LOGD("layoutMode: %s", qPrintable(s));
}
} else {
e.unknown();
@ -220,7 +220,7 @@ bool Read400::readScore400(Ms::Score* score, XmlReader& e, ReadContext& ctx)
}
e.reconnectBrokenConnectors();
if (e.error() != QXmlStreamReader::NoError) {
qDebug("%s: xml read error at line %lld col %lld: %s",
LOGD("%s: xml read error at line %lld col %lld: %s",
qPrintable(e.getDocName()), e.lineNumber(), e.columnNumber(),
e.name().toUtf8().data());
if (e.error() == QXmlStreamReader::CustomError) {

View file

@ -91,7 +91,7 @@ void StaffRW::readStaff(Ms::Score* score, Ms::XmlReader& e, ReadContext& ctx)
if (tag == "Measure") {
if (measure == 0) {
qDebug("Score::readStaff(): missing measure!");
LOGD("Score::readStaff(): missing measure!");
measure = Factory::createMeasure(ctx.dummy()->system());
measure->setTick(e.tick());
score->measures()->add(measure);

View file

@ -43,7 +43,7 @@ namespace Ms {
XmlReader::~XmlReader()
{
if (!_connectors.empty() || !_pendingConnectors.empty()) {
qDebug("XmlReader::~XmlReader: there are unpaired connectors left");
LOGD("XmlReader::~XmlReader: there are unpaired connectors left");
for (auto& c : _connectors) {
EngravingItem* conn = c->releaseConnector();
if (conn && !conn->isTuplet()) { // tuplets are added to score even when not finished
@ -125,16 +125,16 @@ PointF XmlReader::readPoint()
#ifndef NDEBUG
if (!attributes().hasAttribute("x")) {
QXmlStreamAttributes map = attributes();
qDebug("XmlReader::readPoint: x attribute missing: %s (%d)",
LOGD("XmlReader::readPoint: x attribute missing: %s (%d)",
name().toUtf8().data(), map.size());
for (int i = 0; i < map.size(); ++i) {
const QXmlStreamAttribute& a = map.at(i);
qDebug(" attr <%s> <%s>", a.name().toUtf8().data(), a.value().toUtf8().data());
LOGD(" attr <%s> <%s>", a.name().toUtf8().data(), a.value().toUtf8().data());
}
unknown();
}
if (!attributes().hasAttribute("y")) {
qDebug("XmlReader::readPoint: y attribute missing: %s", name().toUtf8().data());
LOGD("XmlReader::readPoint: y attribute missing: %s", name().toUtf8().data());
unknown();
}
#endif
@ -233,13 +233,13 @@ Fraction XmlReader::readFraction()
void XmlReader::unknown()
{
if (QXmlStreamReader::error()) {
qDebug("%s ", qPrintable(errorString()));
LOGD("%s ", qPrintable(errorString()));
}
if (!docName.isEmpty()) {
qDebug("tag in <%s> line %lld col %lld: %s",
LOGD("tag in <%s> line %lld col %lld: %s",
qPrintable(docName), lineNumber() + _offsetLines, columnNumber(), name().toUtf8().data());
} else {
qDebug("line %lld col %lld: %s", lineNumber() + _offsetLines, columnNumber(), name().toUtf8().data());
LOGD("line %lld col %lld: %s", lineNumber() + _offsetLines, columnNumber(), name().toUtf8().data());
}
skipCurrentElement();
}
@ -367,7 +367,7 @@ void XmlReader::checkTuplets()
Tuplet* tuplet = p.second;
if (tuplet->elements().empty()) {
// this should not happen and is a sign of input file corruption
qDebug("Measure:read(): empty tuplet id %d (%p), input file corrupted?",
LOGD("Measure:read(): empty tuplet id %d (%p), input file corrupted?",
tuplet->id(), tuplet);
delete tuplet;
} else {
@ -445,7 +445,7 @@ QString XmlReader::readXml()
break;
default:
qDebug("htmlToString: read token: %s", qPrintable(tokenString()));
LOGD("htmlToString: read token: %s", qPrintable(tokenString()));
return s;
}
}
@ -514,7 +514,7 @@ int XmlReader::spannerId(const Spanner* s)
return i.first;
}
}
qDebug("XmlReader::spannerId not found");
LOGD("XmlReader::spannerId not found");
return -1;
}
@ -526,7 +526,7 @@ int XmlReader::spannerId(const Spanner* s)
TextStyleType XmlReader::addUserTextStyle(const QString& name)
{
qDebug("%s", qPrintable(name));
LOGD("%s", qPrintable(name));
TextStyleType id = TextStyleType::TEXT_TYPES;
if (userTextStyles.size() == 0) {
id = TextStyleType::USER1;
@ -553,7 +553,7 @@ TextStyleType XmlReader::addUserTextStyle(const QString& name)
} else if (userTextStyles.size() == 11) {
id = TextStyleType::USER12;
} else {
qDebug("too many user defined textstyles");
LOGD("too many user defined textstyles");
}
if (id != TextStyleType::TEXT_TYPES) {
userTextStyles.push_back({ name, id });
@ -647,7 +647,7 @@ void XmlReader::reconnectBrokenConnectors()
if (_connectors.empty()) {
return;
}
qDebug("Reconnecting broken connectors (%d nodes)", int(_connectors.size()));
LOGD("Reconnecting broken connectors (%d nodes)", int(_connectors.size()));
std::vector<std::pair<int, std::pair<ConnectorInfoReader*, ConnectorInfoReader*> > > brokenPairs;
for (size_t i = 1; i < _connectors.size(); ++i) {
for (size_t j = 0; j < i; ++j) {
@ -683,7 +683,7 @@ void XmlReader::reconnectBrokenConnectors()
cptr->addToScore(pasteMode());
removeConnector(cptr);
}
qDebug("reconnected %d broken connectors", reconnected.count());
LOGD("reconnected %d broken connectors", reconnected.count());
}
//---------------------------------------------------------

View file

@ -160,12 +160,12 @@ bool MTest::compareFilesFromPaths(const QString& f1, const QString& f2)
args.append(f2);
args.append(f1);
QProcess p;
qDebug() << "Running " << cmd << " with arg1: " << f2 << " and arg2: " << f1;
LOGD() << "Running " << cmd << " with arg1: " << f2 << " and arg2: " << f1;
p.start(cmd, args);
if (!p.waitForFinished() || p.exitCode()) {
QByteArray ba = p.readAll();
//qDebug("%s", qPrintable(ba));
//qDebug(" <diff -u %s %s failed", qPrintable(compareWith),
//LOGD("%s", qPrintable(ba));
//LOGD(" <diff -u %s %s failed", qPrintable(compareWith),
// qPrintable(QString(root + "/" + saveName)));
QTextStream outputText(stdout);
outputText << QString(ba);

View file

@ -36,6 +36,8 @@
#include "utils/scorerw.h"
#include "utils/scorecomp.h"
#include "log.h"
static const QString CPSYMBOLLIST_DATA_DIR("copypastesymbollist_data/");
using namespace mu::engraving;
@ -73,7 +75,7 @@ void CopyPasteSymbolListTests::copypastecommon(MasterScore* score, const char* n
score->startCmd();
const QMimeData* ms = QApplication::clipboard()->mimeData();
if (!ms->hasFormat(mimeSymbolListFormat)) {
qDebug("wrong type mime data");
LOGD("wrong type mime data");
return;
}
score->cmdPaste(ms, 0);

View file

@ -33,6 +33,8 @@
#include "utils/scorerw.h"
#include "utils/scorecomp.h"
#include "log.h"
static const QString ALL_ELEMENTS_DATA_DIR("all_elements_data/");
using namespace mu::engraving;
@ -81,10 +83,10 @@ static void isLayoutDone(void* data, EngravingItem* e)
(*result) = false;
// Print some info about the element to make test more useful...
if (Measure* m = toMeasure(e->findMeasure())) {
qDebug("Layout of %s is not done (page %zu, measure %d)", e->typeName(), m->system()->page()->no() + 1,
m->no() + 1);
LOGD("Layout of %s is not done (page %zu, measure %d)", e->typeName(), m->system()->page()->no() + 1,
m->no() + 1);
} else {
qDebug("Layout of %s is not done", e->typeName());
LOGD("Layout of %s is not done", e->typeName());
}
}
}

View file

@ -74,7 +74,7 @@ static bool staffHasElements(Score* score, Ms::staff_idx_t staffIdx)
}
for (Spanner* s : score->unmanagedSpanners()) {
if (s->staffIdx() == staffIdx) {
qDebug() << s->typeName() << " is in staff " << staffIdx;
LOGD() << s->typeName() << " is in staff " << staffIdx;
return true;
}
}

View file

@ -41,12 +41,12 @@ QMap<QString, QStringList>* mu::smuflRanges()
if (ranges.empty()) {
QFile fi(":fonts/smufl/ranges.json");
if (!fi.open(QIODevice::ReadOnly)) {
qDebug("ScoreFont: open ranges file <%s> failed", qPrintable(fi.fileName()));
LOGD("ScoreFont: open ranges file <%s> failed", qPrintable(fi.fileName()));
}
QJsonParseError error;
QJsonObject o = QJsonDocument::fromJson(fi.readAll(), &error).object();
if (error.error != QJsonParseError::NoError) {
qDebug("Json parse error in <%s>(offset: %d): %s", qPrintable(fi.fileName()),
LOGD("Json parse error in <%s>(offset: %d): %s", qPrintable(fi.fileName()),
error.offset, qPrintable(error.errorString()));
}

View file

@ -26,6 +26,8 @@
#include <QtTest/QtTest>
#include <QList>
#include "log.h"
namespace mu::testing {
class QTestSuite
{
@ -85,9 +87,9 @@ public:
inline static int run(int argc, char* argv[])
{
qDebug() << "========================== argc: " << argc;
LOGD() << "========================== argc: " << argc;
for (int i = 0; i < argc; ++i) {
qDebug() << "========================== argv " << i << ": " << argv[i];
LOGD() << "========================== argv " << i << ": " << argv[i];
}
int ret = 0;
for (QObject* test : testList()) {

Some files were not shown because too many files have changed in this diff Show more