Skip to content
Permalink
Browse files

eliminate debug artifacts

  • Loading branch information...
Jojo-Schmitz committed Dec 18, 2018
1 parent 9769dff commit ff292d98b27e5df5ce77aec38e88153ff12320b7
@@ -141,7 +141,7 @@ sf_count_t AudioFile::read(void* ptr, sf_count_t count)

sf_count_t AudioFile::write(const void* /*ptr*/, sf_count_t /*count*/)
{
printf("write\n");
//printf("write\n");
return 0;
}

@@ -256,7 +256,7 @@ void Compressor::process(int frames, float* ip, float *op)
op[pos * 2+1] = ip[pos * 2 + 1] * gain * mug;
}

// printf("gain %f\n", gain);
//printf("gain %f\n", gain);

// amplitude = lin2db(env);
// gain_red = lin2db(gain);
@@ -100,7 +100,7 @@ void Channel::setcc(int num, int value)
{
cc[num] = value;

// printf("setcc %d %d\n", num, value);
//printf("setcc %d %d\n", num, value);

switch (num) {
case SUSTAIN_SWITCH:
@@ -647,7 +647,7 @@ void Sample::load()
std::vector<char> p;
p.resize(size);
if (fd.read(p.data(), size) != size) {
printf(" read %d failed\n", size);
qDebug("read %d failed", size);
return;
}
decompressOggVorbis(p.data(), size);
@@ -586,7 +586,7 @@ bool Voice::generateDataForDSPChain(unsigned framesBufCount)
b1 = b1_temp;
filter_coeff_incr_count = 0;
filter_startup = 0;
// printf("Setting initial filter coefficients.\n");
//printf("Setting initial filter coefficients.\n");
}
else {
/* The filter frequency is changed. Calculate an increment
@@ -644,7 +644,7 @@ void Voice::write(unsigned n, float* out, float* reverb, float* chorus)
if (!PLAYING())
return;
if (!sample) {
printf("!sample\n");
//printf("!sample\n");
off();
return;
}
@@ -1551,7 +1551,7 @@ void Voice::add_mod(const Mod* _mod, int mode)
/* if identical modulator exists, add them */
for (int i = 0; i < mod_count; i++) {
if (test_identity(&mod[i], _mod)) {
// printf("Adding modulator...\n");
//printf("Adding modulator...\n");
mod[i].amount += _mod->amount;
return;
}
@@ -1561,7 +1561,7 @@ void Voice::add_mod(const Mod* _mod, int mode)
/* if identical modulator exists, replace it (only the amount has to be changed) */
for (int i = 0; i < mod_count; i++) {
if (test_identity(&mod[i], _mod)) {
// printf("Replacing modulator...amount is %f\n",mod->amount);
//printf("Replacing modulator...amount is %f\n",mod->amount);
mod[i].amount = _mod->amount;
return;
}
@@ -1649,10 +1649,10 @@ void Voice::check_sample_sanity()
return;

#if 0
printf("Sample from %i to %i\n", sample->start, sample->end);
printf("Sample loop from %i %i\n", sample->loopstart, sample->loopend);
printf("Playback from %i to %i\n", start, end);
printf("Playback loop from %i to %i\n", loopstart, loopend);
printf("Sample from %i to %i\n", sample->start, sample->end);
printf("Sample loop from %i %i\n", sample->loopstart, sample->loopend);
printf("Playback from %i to %i\n", start, end);
printf("Playback loop from %i to %i\n", loopstart, loopend);
#endif

/* Keep the start point within the sample data */
@@ -449,7 +449,7 @@ static void genJson()
i.next();

if (!nmap.contains(i.key())) {
printf("not found: <%s>\n", qPrintable(i.key()));
fprintf(stderr, "not found: <%s>\n", qPrintable(i.key()));
continue;
}

@@ -209,7 +209,7 @@ bool Score::sanityCheck(const QString& name)
// fmrest0->setDuration(mLen * fmrest0->staff()->timeStretch(fmrest0->tick()));
fmrest0->setDuration(mLen);
if (fmrest0->actualFraction() != mLen)
printf("whoo???\n");
fprintf(stderr,"whoo???\n");
}
}
for (int v = 1; v < VOICES; ++v) {
@@ -2803,7 +2803,7 @@ void Score::checkSpanner(int startTick, int endTick)
QList<Spanner*> sl; // spanners to remove
QList<Spanner*> sl2; // spanners to shorten
auto spanners = _spanner.findOverlapping(startTick, endTick);
// printf("checkSpanner %d %d\n", startTick, endTick);
//printf("checkSpanner %d %d\n", startTick, endTick);
// for (auto i = spanners.begin(); i < spanners.end(); i++) {

// DEBUG: check all spanner
@@ -3001,7 +3001,7 @@ void Score::timeDelete(Measure* m, Segment* startSegment, const Fraction& f)
const int len = f.ticks();
const int etick = tick + len;

// printf("time delete %d at %d, start %s\n", len, tick, startSegment->subTypeName());
//printf("time delete %d at %d, start %s\n", len, tick, startSegment->subTypeName());

Segment* fs = m->first(CR_TYPE);

@@ -3055,7 +3055,7 @@ void Score::timeDelete(Measure* m, Segment* startSegment, const Fraction& f)
int updatedTick = tick;
for (Segment* s = startSegment; s; s = s->next()) {
if (s->rtick() >= etick && s->rtick() != updatedTick) {
// printf(" change segment %s tick %d -> %d\n", s->subTypeName(), s->tick(), m->tick() + updatedTick),
//printf(" change segment %s tick %d -> %d\n", s->subTypeName(), s->tick(), m->tick() + updatedTick),
s->undoChangeProperty(Pid::TICK, updatedTick);
updatedTick += s->ticks();
}
@@ -529,7 +529,7 @@ int MPaintDevice::metric(PaintDeviceMetric m) const
case QPaintDevice::PdmDpiY:
return int(DPI);
default:
printf("debug: metric %d\n", int(m));
//printf("debug: metric %d\n", int(m));
return 1;
}
}
@@ -540,7 +540,7 @@ int MPaintDevice::metric(PaintDeviceMetric m) const

QPaintEngine* MPaintDevice::paintEngine() const
{
printf("paint engine\n");
//printf("paint engine\n");
return 0;
}

@@ -1203,8 +1203,8 @@ qreal System::minBottom() const

void System::moveBracket(int /*staffIdx*/, int /*srcCol*/, int /*dstCol*/)
{
printf("System::moveBracket\n");
#if 0
printf("System::moveBracket\n");
if (vbox())
return;
for (Bracket* b : _brackets) {
@@ -214,7 +214,7 @@ bool TextBase::edit(EditData& ed)
}

if (!wasHex) {
// printf("======%x\n", s.isEmpty() ? -1 : s[0].unicode());
//printf("======%x\n", s.isEmpty() ? -1 : s[0].unicode());

switch (ed.key) {
case Qt::Key_Z: // happens when the undo stack is empty
@@ -686,7 +686,7 @@ TieSegment* Tie::layoutBack(System* system)

void Tie::startEdit(EditData& ed)
{
printf("tie start edit %p %p\n", editStartNote, editEndNote);
printf("tie start edit %p %p\n", editStartNote, editEndNote);
editStartNote = startNote();
editEndNote = endNote();
SlurTie::startEdit(ed);
@@ -698,7 +698,7 @@ void Tie::startEdit(EditData& ed)

void Tie::endEdit(EditData& ed)
{
printf("tie::endEdit\n");
//printf("tie::endEdit\n");
// if (editStartNote != startNote() || editEndNote != endNote()) {
// score()->undoStack()->push1(new ChangeSpannerElements(this, editStartNote, editEndNote));
// }
@@ -120,8 +120,8 @@ void Tremolo::setTremoloType(TremoloType t)

void Tremolo::layout()
{
printf("tremolo layout\n");
// ABORTN(1);
//printf("tremolo layout\n");
//ABORTN(1);
qreal _spatium = spatium() * mag();

qreal w2 = _spatium * score()->styleS(Sid::tremoloWidth).val() * .5;
@@ -808,7 +808,7 @@ Note* searchTieNote(Note* note)
if (c->graceIndex() == index + 1) {
note2 = c->findNote(note->pitch());
if (note2) {
printf("found grace-grace tie\n");
//printf("found grace-grace tie\n");
return note2;
}
}
@@ -424,7 +424,7 @@ int main(int argc, char* argv[])
argv[0], qPrintable(infile));
return -2;
}
printf("ScanFile %s\n", qPrintable(infile));
//printf("ScanFile %s\n", qPrintable(infile));
QString in = inFile.readAll();
scanFile(in);
inFile.close();
@@ -274,8 +274,8 @@ int MidiFile::readEvent(MidiEvent* event)
double t = 1000000.0 / double(tempo);
_tempoMap.insert(std::pair<const int, qreal>(click, t));
}
// else
// printf("META %02x\n", type);
//else
//printf("META %02x\n", type);
delete[] data;
if (type == META_EOT)
return 2;
@@ -415,7 +415,7 @@ void MidiFile::writeEvent(const MidiEvent& event)
break;
#endif
default:
printf("unsupported\n");
//fprintf(stderr, "unsupported\n");
break;
}
}
@@ -149,7 +149,7 @@ int main(int argc, char* argv[])
);
break;
default:
printf("unknown event\n");
fprintf(stderr,"unknown event\n");
xml.tagE(QString("Event tick=\"%1\" t=\"%2\" c=\"%3\" a=\"%4\" b=\"%5\"")
.arg(i->first)
.arg(int(i->second.type()), 2, 16)
@@ -57,7 +57,7 @@ AlbumManager::AlbumManager(QWidget* parent)

void AlbumManager::buttonBoxClicked(QAbstractButton*)
{
printf("buttonBox clicked\n");
//printf("buttonBox clicked\n");
}

//---------------------------------------------------------
@@ -941,10 +941,12 @@ void EditStyle::setValues()
OffsetSelect* as = qobject_cast<Ms::OffsetSelect*>(sw.widget);
if (as)
as->setOffset(val.value<QPointF>());
#if 0 // debug
else {
printf("no widget for QPointF <%s><%s>\n",
sw.widget->metaObject()->className(), MStyle::valueName(sw.idx));
sw.widget->metaObject()->className(), MStyle::valueName(sw.idx));
}
#endif
}
else
unhandledType(&sw);
@@ -151,7 +151,7 @@ static QString createDefaultFileName(QString fn)

static bool readScoreError(const QString& name, Score::FileError error, bool ask)
{
printf("<%s> %d\n", qPrintable(name), int(error));
//printf("<%s> %d\n", qPrintable(name), int(error));
QString msg = QObject::tr("Cannot read file %1:\n").arg(name);
QString detailedMsg;
bool canIgnore = false;
@@ -99,7 +99,7 @@ void HelpQuery::textChanged(const QString& ss)
for (auto i = list.begin(); i != list.end(); ++i) {
QAction* action = new QAction(i.key(), this);
action->setData(i.value());
// printf("add action <%s> <%s>\n", qPrintable(i.key()), qPrintable(i.value().toString()));
//printf("add action <%s> <%s>\n", qPrintable(i.key()), qPrintable(i.value().toString()));
menu->addAction(action);
connect(action, SIGNAL(triggered()), mapper, SLOT(map()));
mapper->setMapping(action, action);
@@ -78,7 +78,7 @@ bool NoteList::stavesOverlap(const int staff1, const int staff2) const
for (int i = 0; i < _staffNoteLists.at(staff1).size(); ++i)
for (int j = 0; j < _staffNoteLists.at(staff2).size(); ++j)
if (notesOverlap(_staffNoteLists.at(staff1).at(i), _staffNoteLists.at(staff2).at(j))) {
// printf(" %d-%d", staff1, staff2);
//printf(" %d-%d", staff1, staff2);
return true;
}
return false;
@@ -486,7 +486,7 @@ NewWizard::NewWizard(QWidget* parent)

void NewWizard::idChanged(int /*id*/)
{
// printf("\n===\nWizard: id changed %d\n", id);
//printf("\n===\nWizard: id changed %d\n", id);
}

//---------------------------------------------------------
@@ -431,7 +431,7 @@ static void applyDrop(Score* score, ScoreView* viewer, Element* target, Element*
// use same code path as drag&drop

QByteArray a = e->mimeData(QPointF());
printf("<<%s>>\n", a.data());
//printf("<<%s>>\n", a.data());

XmlReader n(a);
Fraction duration; // dummy
@@ -163,7 +163,7 @@ void PartEdit::playbackVoiceChanged()
if (val != staff->playbackVoice(voice)) {
switch (voice) {
case 0:
printf("undo\n");
//printf("undo\n");
staff->undoChangeProperty(Pid::PLAYBACK_VOICE1, val);
break;
case 1:
@@ -2937,20 +2937,20 @@ void ScoreView::adjustCanvasPosition(const Element* el, bool playBack, int staff
.adjusted(-border, -border, border, border);
}
else {
//find a box for the individual stave in a system
// find a box for the individual stave in a system
QRectF stave = QRectF(sys->canvasBoundingRect().left(),
sys->staffCanvasYpage(staff),
sys->width(),
sys->staff(staff)->bbox().height());
showRect = mRect.intersected(stave).adjusted(-border, -border, border, border);
}

/* printf("%f %f %f %f %f %f %f %f %d\n",
showRect.x(), showRect.y(), showRect.width(), showRect.height(),
r.x(), r.y(), r.width(), r.height(),
r.contains(showRect)
);
*/
/*printf("%f %f %f %f %f %f %f %f %d\n",
showRect.x(), showRect.y(), showRect.width(), showRect.height(),
r.x(), r.y(), r.width(), r.height(),
r.contains(showRect)
);
*/
// canvas is not as wide as measure, track note instead
if (r.width() < showRect.width()) {
showRect.setX(p.x());
@@ -197,7 +197,7 @@ bool Omr::omrActions(int &ID, int page)
return false;
}
int n = _doc->numPages();
printf("readPdf: %d pages\n", n);
//printf("readPdf: %d pages\n", n);
for (int i = 0; i < n; ++i) {
OmrPage* page1 = new OmrPage(this);
QImage image = _doc->page(i);

0 comments on commit ff292d9

Please sign in to comment.
You can’t perform that action at this time.