diff options
Diffstat (limited to 'muse2')
89 files changed, 720 insertions, 690 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index c19ce208..d041ec5a 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -2,6 +2,7 @@ - Ported rack. TODO: Drag and drop needs a hand. It's not working. (Orcan) - Converted various Qt3 support methods to Qt4 in many files. (Orcan) - Includes cleanup in app.*. (Orcan) + - Converted all instances of latin1() and crossed my fingers. Initial tests OK. (Orcan) 06.12.2010 - Built Awl::posedit and Awl::sigedit, and replaced /widget versions and all usages. (Tim) TODO: Awl::sigedit has no returnPressed signal, for lmaster. diff --git a/muse2/al/sig.cpp b/muse2/al/sig.cpp index 026104b2..7eeae6be 100644 --- a/muse2/al/sig.cpp +++ b/muse2/al/sig.cpp @@ -484,7 +484,7 @@ void SigList::read(QDomNode node) insert(std::pair<const unsigned, SigEvent*> (tick, t)); } else - printf("MusE:SigList: unknown tag %s\n", e.tagName().toLatin1().data()); + printf("MusE:SigList: unknown tag %s\n", e.tagName().toLatin1().constData()); node = node.nextSibling(); } normalize(); @@ -569,7 +569,7 @@ int SigEvent::read(QDomNode node) else if (e.tagName() == "denom") sig.n = e.text().toInt(); else - printf("MusE:SigEvent: unknown tag %s\n", e.tagName().toLatin1().data()); + printf("MusE:SigEvent: unknown tag %s\n", e.tagName().toLatin1().constData()); node = node.nextSibling(); } return at; diff --git a/muse2/al/xml.cpp b/muse2/al/xml.cpp index 7ae40b3e..63143b1a 100644 --- a/muse2/al/xml.cpp +++ b/muse2/al/xml.cpp @@ -242,10 +242,10 @@ void readProperties(QObject* o, QDomNode node) QDomElement e = node.toElement(); QString tag(e.tagName()); - int idx = meta->indexOfProperty(tag.toLatin1().data()); + int idx = meta->indexOfProperty(tag.toLatin1().constData()); if (idx == -1) { printf("MusE:%s: unknown tag %s\n", - meta->className(), tag.toLatin1().data()); + meta->className(), tag.toLatin1().constData()); return; } QMetaProperty p = meta->property(idx); @@ -326,9 +326,9 @@ void domError(QDomNode node) s += k; } fprintf(stderr, "%s: Unknown Node <%s>, type %d\n", - s.toLatin1().data(), tag.toLatin1().data(), node.nodeType()); + s.toLatin1().constData(), tag.toLatin1().constData(), node.nodeType()); if (node.isText()) { - fprintf(stderr, " text node <%s>\n", node.toText().data().toLatin1().data()); + fprintf(stderr, " text node <%s>\n", node.toText().data().toLatin1().constData()); } } @@ -353,9 +353,9 @@ void domNotImplemented(QDomNode node) s += k; } fprintf(stderr, "%s: Node not implemented: <%s>, type %d\n", - s.toLatin1().data(), tag.toLatin1().data(), node.nodeType()); + s.toLatin1().constData(), tag.toLatin1().constData(), node.nodeType()); if (node.isText()) { - fprintf(stderr, " text node <%s>\n", node.toText().data().toLatin1().data()); + fprintf(stderr, " text node <%s>\n", node.toText().data().toLatin1().constData()); } } } diff --git a/muse2/awl/posedit.cpp b/muse2/awl/posedit.cpp index 51cea634..a6ca9b30 100644 --- a/muse2/awl/posedit.cpp +++ b/muse2/awl/posedit.cpp @@ -281,7 +281,7 @@ QAbstractSpinBox::StepEnabled PosEdit::stepEnabled() const void PosEdit::fixup(QString& input) const { - printf("fixup <%s>\n", input.toLatin1().data()); + printf("fixup <%s>\n", input.toLatin1().constData()); } //--------------------------------------------------------- diff --git a/muse2/awl/sigedit.cpp b/muse2/awl/sigedit.cpp index 193a9bd7..9ddf15c0 100644 --- a/muse2/awl/sigedit.cpp +++ b/muse2/awl/sigedit.cpp @@ -147,7 +147,7 @@ QAbstractSpinBox::StepEnabled SigEdit::stepEnabled() const void SigEdit::fixup(QString& input) const { - printf("fixup <%s>\n", input.toLatin1().data()); + printf("fixup <%s>\n", input.toLatin1().constData()); } //--------------------------------------------------------- diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index aff7815c..ba261460 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -641,7 +641,7 @@ QMenu* populateAddSynth(QWidget* parent) synMESS = dynamic_cast<MessSynth*>(*i); if(synMESS) { - mapMESS.insert( std::pair<std::string, int> (std::string(synMESS->description().lower().latin1()), ii) ); + mapMESS.insert( std::pair<std::string, int> (std::string(synMESS->description().lower().toLatin1().constData()), ii) ); } else { @@ -650,7 +650,7 @@ QMenu* populateAddSynth(QWidget* parent) synDSSI = dynamic_cast<DssiSynth*>(*i); if(synDSSI) { - mapDSSI.insert( std::pair<std::string, int> (std::string(synDSSI->description().lower().latin1()), ii) ); + mapDSSI.insert( std::pair<std::string, int> (std::string(synDSSI->description().lower().toLatin1().constData()), ii) ); } else #endif @@ -660,13 +660,13 @@ QMenu* populateAddSynth(QWidget* parent) synVST = dynamic_cast<VstSynth*>(*i); if(synVST) { - mapVST.insert( std::pair<std::string, int> (std::string(synVST->description().lower().latin1()), ii) ); + mapVST.insert( std::pair<std::string, int> (std::string(synVST->description().lower().toLatin1().constData()), ii) ); } else #endif { - mapOther.insert( std::pair<std::string, int> (std::string((*i)->description().lower().latin1()), ii) ); + mapOther.insert( std::pair<std::string, int> (std::string((*i)->description().lower().toLatin1().constData()), ii) ); } } } @@ -1551,7 +1551,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() QString prjPath(getenv("HOME")); prjPath += QString("/.musePrj"); - FILE* f = fopen(prjPath.latin1(), "r"); + FILE* f = fopen(prjPath.toLatin1().constData(), "r"); if (f == 0) { perror("open projectfile"); for (int i = 0; i < PROJECT_LIST_LEN; ++i) @@ -1609,7 +1609,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() name = projectList[0] ? *projectList[0] : QString("untitled"); else name = argv[0]; - printf("starting with selected song %s\n", config.startSong.latin1()); + printf("starting with selected song %s\n", config.startSong.toLatin1().constData()); } else if (config.startMode == 1) { printf("starting with default template\n"); @@ -1617,7 +1617,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() useTemplate = true; } else if (config.startMode == 2) { - printf("starting with pre configured song %s\n", config.startSong.latin1()); + printf("starting with pre configured song %s\n", config.startSong.toLatin1().constData()); name = config.startSong; } song->blockSignals(false); @@ -1738,7 +1738,7 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll project.setFile("untitled"); } else { - printf("Setting project path to %s\n", fi.dirPath(true).latin1()); + printf("Setting project path to %s\n", fi.dirPath(true).toLatin1().constData()); museProject = fi.dirPath(true); project.setFile(name); } @@ -2001,13 +2001,13 @@ bool MusE::save(const QString& name, bool overwriteWarn) //cacheJackRouteNames(); if (QFile::exists(name)) { - backupCommand.sprintf("cp \"%s\" \"%s.backup\"", name.latin1(), name.latin1()); + backupCommand.sprintf("cp \"%s\" \"%s.backup\"", name.toLatin1().constData(), name.toLatin1().constData()); } else if (QFile::exists(name + QString(".med"))) { - backupCommand.sprintf("cp \"%s.med\" \"%s.med.backup\"", name.latin1(), name.latin1()); + backupCommand.sprintf("cp \"%s.med\" \"%s.med.backup\"", name.toLatin1().constData(), name.toLatin1().constData()); } if (!backupCommand.isEmpty()) - system(backupCommand.latin1()); + system(backupCommand.toLatin1().constData()); bool popenFlag; FILE* f = fileOpen(this, name, QString(".med"), "w", popenFlag, false, overwriteWarn); @@ -2022,7 +2022,7 @@ bool MusE::save(const QString& name, bool overwriteWarn) QMessageBox::critical(this, tr("MusE: Write File failed"), s); popenFlag? pclose(f) : fclose(f); - unlink(name.latin1()); + unlink(name.toLatin1().constData()); return false; } else { @@ -2086,10 +2086,10 @@ void MusE::closeEvent(QCloseEvent* event) // save "Open Recent" list QString prjPath(getenv("HOME")); prjPath += "/.musePrj"; - FILE* f = fopen(prjPath.latin1(), "w"); + FILE* f = fopen(prjPath.toLatin1().constData(), "w"); if (f) { for (int i = 0; i < PROJECT_LIST_LEN; ++i) { - fprintf(f, "%s\n", projectList[i] ? projectList[i]->latin1() : ""); + fprintf(f, "%s\n", projectList[i] ? projectList[i]->toLatin1().constData() : ""); } fclose(f); } @@ -2415,7 +2415,7 @@ void MusE::routingPopupMenuActivated(Track* track, int n) { QString s(pup->text(n)); - //printf("AudioStrip::routingPopupMenuActivated audio text:%s\n", s.latin1()); + //printf("AudioStrip::routingPopupMenuActivated audio text:%s\n", s.toLatin1().constData()); if(track->type() == Track::AUDIO_OUTPUT) { @@ -2764,7 +2764,7 @@ PopupMenu* MusE::prepareRoutingPopupMenu(Track* track, bool dst) for (int i = 0; i < channel; ++i) { char buffer[128]; - snprintf(buffer, 128, "%s %d", tr("Channel").latin1(), i+1); + snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), i+1); MenuTitleItem* titel = new MenuTitleItem(QString(buffer)); pup->insertItem(titel); @@ -3052,7 +3052,7 @@ PopupView* MusE::prepareRoutingPopupView(Track* track, bool dst) for (int i = 0; i < channel; ++i) { char buffer[128]; - snprintf(buffer, 128, "%s %d", tr("Channel").latin1(), i+1); + snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), i+1); MenuTitleItem* titel = new MenuTitleItem(QString(buffer)); pup->insertItem(titel); @@ -3354,7 +3354,7 @@ void MusE::openRecentMenu() for (int i = 0; i < PROJECT_LIST_LEN; ++i) { if (projectList[i] == 0) break; - const char* path = projectList[i]->latin1(); + const char* path = projectList[i]->toLatin1().constData(); const char* p = strrchr(path, '/'); if (p == 0) p = path; @@ -3749,7 +3749,7 @@ int main(int argc, char* argv[]) // while ((i = getopt(argc, argv, "ahvdDmMsP:py")) != EOF) { //#endif - while ((i = getopt(argc, argv, optstr.latin1())) != EOF) { + while ((i = getopt(argc, argv, optstr.toLatin1().constData())) != EOF) { char c = (char)i; switch (c) { case 'v': printVersion(argv[0]); return 0; @@ -3850,11 +3850,11 @@ int main(int argc, char* argv[]) ++argc; if (debugMsg) { - printf("global lib: <%s>\n", museGlobalLib.latin1()); - printf("global share: <%s>\n", museGlobalShare.latin1()); - printf("muse home: <%s>\n", museUser.latin1()); - printf("project dir: <%s>\n", museProject.latin1()); - printf("user instruments: <%s>\n", museUserInstruments.latin1()); + printf("global lib: <%s>\n", museGlobalLib.toLatin1().constData()); + printf("global share: <%s>\n", museGlobalShare.toLatin1().constData()); + printf("muse home: <%s>\n", museUser.toLatin1().constData()); + printf("project dir: <%s>\n", museProject.toLatin1().constData()); + printf("user instruments: <%s>\n", museUserInstruments.toLatin1().constData()); } static QTranslator translator(0); @@ -3866,7 +3866,7 @@ int main(int argc, char* argv[]) QString lp(museGlobalShare); lp += QString("/locale"); if (translator.load(loc, lp) == false) { - printf("no locale <%s>/<%s>\n", loc.latin1(), lp.latin1()); + printf("no locale <%s>/<%s>\n", loc.toLatin1().constData(), lp.toLatin1().constData()); } } app.installTranslator(&translator); @@ -3901,7 +3901,7 @@ int main(int argc, char* argv[]) QStringList::Iterator it = list.begin(); printf("QtLibraryPath:\n"); while(it != list.end()) { - printf(" <%s>\n", (*it).latin1()); + printf(" <%s>\n", (*it).toLatin1().constData()); ++it; } } diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index baa94747..c2ffe6ba 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -889,8 +889,8 @@ void PartCanvas::itemPopup(CItem* item, int n, const QPoint& pt) Track* track = npart->track(); Part* dpart = track->newPart(spart, false); // Added by Tim. p3.3.6 - //printf("PartCanvas::itemPopup: #1 spart %s %p next:%s %p prev:%s %p\n", spart->name().latin1(), spart, spart->nextClone()->name().latin1(), spart->nextClone(), spart->prevClone()->name().latin1(), spart->prevClone()); - //printf("PartCanvas::itemPopup: #1 dpart %s %p next:%s %p prev:%s %p\n", dpart->name().latin1(), dpart, dpart->nextClone()->name().latin1(), dpart->nextClone(), dpart->prevClone()->name().latin1(), dpart->prevClone()); + //printf("PartCanvas::itemPopup: #1 spart %s %p next:%s %p prev:%s %p\n", spart->name().toLatin1().constData(), spart, spart->nextClone()->name().toLatin1().constData(), spart->nextClone(), spart->prevClone()->name().toLatin1().constData(), spart->prevClone()); + //printf("PartCanvas::itemPopup: #1 dpart %s %p next:%s %p prev:%s %p\n", dpart->name().toLatin1().constData(), dpart, dpart->nextClone()->name().toLatin1().constData(), dpart->nextClone(), dpart->prevClone()->name().toLatin1().constData(), dpart->prevClone()); EventList* se = spart->events(); EventList* de = dpart->events(); @@ -904,8 +904,8 @@ void PartCanvas::itemPopup(CItem* item, int n, const QPoint& pt) //audio->msgChangePart(spart, dpart, false); audio->msgChangePart(spart, dpart, false, true, false); // Added by Tim. p3.3.6 - //printf("PartCanvas::itemPopup: #2 spart %s %p next:%s %p prev:%s %p\n", spart->name().latin1(), spart, spart->nextClone()->name().latin1(), spart->nextClone(), spart->prevClone()->name().latin1(), spart->prevClone()); - //printf("PartCanvas::itemPopup: #2 dpart %s %p next:%s %p prev:%s %p\n", dpart->name().latin1(), dpart, dpart->nextClone()->name().latin1(), dpart->nextClone(), dpart->prevClone()->name().latin1(), dpart->prevClone()); + //printf("PartCanvas::itemPopup: #2 spart %s %p next:%s %p prev:%s %p\n", spart->name().toLatin1().constData(), spart, spart->nextClone()->name().toLatin1().constData(), spart->nextClone(), spart->prevClone()->name().toLatin1().constData(), spart->prevClone()); + //printf("PartCanvas::itemPopup: #2 dpart %s %p next:%s %p prev:%s %p\n", dpart->name().toLatin1().constData(), dpart, dpart->nextClone()->name().toLatin1().constData(), dpart->nextClone(), dpart->prevClone()->name().toLatin1().constData(), dpart->prevClone()); song->endUndo(SC_PART_MODIFIED); break; // Has to be break here, right? @@ -961,7 +961,7 @@ void PartCanvas::itemPopup(CItem* item, int n, const QPoint& pt) for(int i = 0; i < j; ++i) { // Added by Tim. p3.3.6 - //printf("PartCanvas::itemPopup i:%d %s %p events %p refs:%d arefs:%d\n", i, p->name().latin1(), p, part->cevents(), part->cevents()->refCount(), j); + //printf("PartCanvas::itemPopup i:%d %s %p events %p refs:%d arefs:%d\n", i, p->name().toLatin1().constData(), p, part->cevents(), part->cevents()->refCount(), j); p->setSelected(true); p = p->nextClone(); @@ -1436,7 +1436,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) //printf("part start tick %d part start pixel %d\n", part->tick(), r.x()); // Added by Tim. p3.3.6 - //printf("PartCanvas::drawItem %s evRefs:%d pTick:%d pLen:%d bb.x:%d bb.w:%d rect.x:%d rect.w:%d r.x:%d r.w:%d\n", part->name().latin1(), part->events()->arefCount(), pTick, part->lenTick(), item->bbox().x(), item->bbox().width(), rect.x(), rect.width(), r.x(), r.width()); + //printf("PartCanvas::drawItem %s evRefs:%d pTick:%d pLen:%d bb.x:%d bb.w:%d rect.x:%d rect.w:%d r.x:%d r.w:%d\n", part->name().toLatin1().constData(), part->events()->arefCount(), pTick, part->lenTick(), item->bbox().x(), item->bbox().width(), rect.x(), rect.width(), r.x(), r.width()); // Must be reasonable about very low negative x values! With long songs > 15min // and with high horizontal magnification, 'ghost' drawings appeared, @@ -1623,7 +1623,7 @@ void PartCanvas::drawWavePart(QPainter& p, continue; unsigned channels = f.channels(); if (channels == 0) { - printf("drawWavePart: channels==0! %s\n", f.name().latin1()); + printf("drawWavePart: channels==0! %s\n", f.name().toLatin1().constData()); continue; } @@ -1865,7 +1865,8 @@ void PartCanvas::copy(PartList* pl) int PartCanvas::pasteAt(const QString& pt, Track* track, int pos, bool clone, bool toTrack) { //printf("int PartCanvas::pasteAt(const QString& pt, Track* track, int pos)\n"); - const char* ptxt = pt.latin1(); + QByteArray ba = pt.toLatin1(); + const char* ptxt = ba.constData(); Xml xml(ptxt); bool firstPart=true; int posOffset=0; @@ -2069,7 +2070,7 @@ Part* PartCanvas::readPart(Xml& xml, Track* track, bool doClone, bool toTrack) { //printf("readClone: warning: event not in part: %d - %d -%d, discarded\n", printf("readClone: warning: event at tick:%d not in part:%s, discarded\n", - tick, npart->name().latin1()); + tick, npart->name().toLatin1().constData()); } else { @@ -2108,7 +2109,7 @@ Part* PartCanvas::readPart(Xml& xml, Track* track, bool doClone, bool toTrack) } else if (tag == "uuid") { - uuid_parse(xml.s2().latin1(), uuid); + uuid_parse(xml.s2().toLatin1().constData(), uuid); if(!uuid_is_null(uuid)) { uuidvalid = true; @@ -2277,7 +2278,7 @@ Part* PartCanvas::readClone(Xml& xml, Track* track, bool toTrack) { //printf("readClone: warning: event not in part: %d - %d -%d, discarded\n", printf("readClone: warning: event at tick:%d not in part:%s, discarded\n", - tick, npart->name().latin1()); + tick, npart->name().toLatin1().constData()); } else { @@ -2311,7 +2312,7 @@ Part* PartCanvas::readClone(Xml& xml, Track* track, bool toTrack) } else if (tag == "uuid") { - uuid_parse(xml.s2().latin1(), uuid); + uuid_parse(xml.s2().toLatin1().constData(), uuid); if(!uuid_is_null(uuid)) { uuidvalid = true; @@ -2605,7 +2606,7 @@ void PartCanvas::viewDropEvent(QDropEvent* event) else { if(debugMsg && event->mimeData()->formats().size() != 0) - printf("Drop with unknown format. First format:<%s>\n", event->mimeData()->formats()[0].toLatin1().data()); + printf("Drop with unknown format. First format:<%s>\n", event->mimeData()->formats()[0].toLatin1().constData()); //event->ignore(); // TODO CHECK Tim. return; } @@ -2874,7 +2875,7 @@ void PartCanvas::drawAutomation(QPainter& p, const QRect& r, AudioTrack *t) } // if (height >100) { // p.drawText(tempomap.frame2tick(0)+1000,40,"FOOO"); -// printf("drawText %s\n", cl->name().latin1()); +// printf("drawText %s\n", cl->name().toLatin1().constData()); // } } } diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index 887a80f9..f1be95fa 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -304,7 +304,7 @@ void TList::paint(const QRect& r) QString s; if (track->isMidiTrack()) { int outport = ((MidiTrack*)track)->outPort(); - s.sprintf("%d:%s", outport+1, midiPorts[outport].portname().latin1()); + s.sprintf("%d:%s", outport+1, midiPorts[outport].portname().toLatin1().constData()); } // Added by Tim. p3.3.9 @@ -316,7 +316,7 @@ void TList::paint(const QRect& r) { int outport = md->midiPort(); if((outport >= 0) && (outport < MIDI_PORTS)) - s.sprintf("%d:%s", outport+1, midiPorts[outport].portname().latin1()); + s.sprintf("%d:%s", outport+1, midiPorts[outport].portname().toLatin1().constData()); else s = tr("<none>"); } diff --git a/muse2/muse/arranger/trackinfo.cpp b/muse2/muse/arranger/trackinfo.cpp index 09185e62..2f205490 100644 --- a/muse2/muse/arranger/trackinfo.cpp +++ b/muse2/muse/arranger/trackinfo.cpp @@ -163,7 +163,7 @@ void Arranger::midiTrackInfoHeartBeat() { //const char* n = "<unknown>"; const QString n(tr("<unknown>")); - //if(strcmp(midiTrackInfo->iPatch->text().latin1(), n) != 0) + //if(strcmp(midiTrackInfo->iPatch->text().toLatin1().constData(), n) != 0) if(midiTrackInfo->iPatch->text() != n) { //printf("Arranger::midiTrackInfoHeartBeat setting patch <unknown>\n"); @@ -181,7 +181,7 @@ void Arranger::midiTrackInfoHeartBeat() midiTrackInfo->iPatch->setText("???"); } else - if(strcmp(midiTrackInfo->iPatch->text().latin1(), name) != 0) + if(strcmp(midiTrackInfo->iPatch->text().toLatin1().constData(), name) != 0) { //printf("Arranger::midiTrackInfoHeartBeat setting patch name\n"); @@ -203,7 +203,7 @@ void Arranger::midiTrackInfoHeartBeat() //{ MidiInstrument* instr = mp->instrument(); const char* name = instr->getPatchName(outChannel, program, song->mtype(), track->type() == Track::DRUM); - if(strcmp(midiTrackInfo->iPatch->text().latin1(), name) != 0) + if(strcmp(midiTrackInfo->iPatch->text().toLatin1().constData(), name) != 0) midiTrackInfo->iPatch->setText(QString(name)); int hb = ((program >> 16) & 0xff) + 1; @@ -1289,7 +1289,7 @@ void Arranger::updateMidiTrackInfo(int flags) for (int i = 0; i < MIDI_PORTS; ++i) { QString name; - name.sprintf("%d:%s", i+1, midiPorts[i].portname().latin1()); + name.sprintf("%d:%s", i+1, midiPorts[i].portname().toLatin1().constData()); midiTrackInfo->iOutput->insertItem(name, i); if (i == outPort) midiTrackInfo->iOutput->setCurrentItem(i); diff --git a/muse2/muse/audio.cpp b/muse2/muse/audio.cpp index e0ebd4a3..66003f0b 100644 --- a/muse2/muse/audio.cpp +++ b/muse2/muse/audio.cpp @@ -190,7 +190,7 @@ bool Audio::start() //printf("reconnecting output %s\n", (*i)->name().ascii()); for (int x=0; x < (*i)->channels();x++) (*i)->setJackPort(x,0); - //printf("name=%s\n",(*i)->name().latin1()); + //printf("name=%s\n",(*i)->name().toLatin1()); (*i)->setName((*i)->name()); // restore jack connection } //audioDevice->start(); @@ -602,7 +602,7 @@ void Audio::process1(unsigned samplePos, unsigned offset, unsigned frames) float data[frames * channels]; for (int i = 0; i < channels; ++i) buffer[i] = data + i * frames; - //printf("Audio::process1 calling track->copyData for track:%s\n", track->name().latin1()); + //printf("Audio::process1 calling track->copyData for track:%s\n", track->name().toLatin1()); // p3.3.38 //track->copyData(samplePos, channels, frames, buffer); diff --git a/muse2/muse/audioconvert.cpp b/muse2/muse/audioconvert.cpp index 878bc8e7..7dd09eb9 100644 --- a/muse2/muse/audioconvert.cpp +++ b/muse2/muse/audioconvert.cpp @@ -120,7 +120,7 @@ off_t AudioConverter::readAudio(SndFileR& f, unsigned offset, float** buffer, in // Added by Tim. p3.3.17 //#ifdef AUDIOCONVERT_DEBUG_PRC //printf("AudioConverter::process %s audConv:%p sfCurFrame:%ld offset:%u channel:%d fchan:%d n:%d\n", - // f.name().latin1(), this, sfCurFrame, offset, channel, f.channels(), n); + // f.name().toLatin1(), this, sfCurFrame, offset, channel, f.channels(), n); //#endif off_t frame = offset; // _spos is added before the call. @@ -321,7 +321,7 @@ off_t SRCAudioConverter::process(SndFileR& f, float** buffer, int channel, int n // Added by Tim. p3.3.17 //#ifdef AUDIOCONVERT_DEBUG_PRC //printf("AudioConverter::process %s audConv:%p sfCurFrame:%ld offset:%u channel:%d fchan:%d n:%d\n", - // f.name().latin1(), this, sfCurFrame, offset, channel, f.channels(), n); + // f.name().toLatin1(), this, sfCurFrame, offset, channel, f.channels(), n); //#endif // off_t frame = offset; // _spos is added before the call. @@ -408,7 +408,7 @@ off_t SRCAudioConverter::process(SndFileR& f, float** buffer, int channel, int n #ifdef AUDIOCONVERT_DEBUG if(srcdata.output_frames_gen != outFrames) printf("SRCAudioConverter::process %s output_frames_gen:%ld != outFrames:%ld inFrames:%ld srcdata.input_frames_used:%ld rn:%d\n", - f.name().latin1(), srcdata.output_frames_gen, outFrames, inFrames, srcdata.input_frames_used, rn); + f.name().toLatin1(), srcdata.output_frames_gen, outFrames, inFrames, srcdata.input_frames_used, rn); #endif // If the number of frames read by the soundfile equals the input frames, go back. @@ -440,7 +440,7 @@ off_t SRCAudioConverter::process(SndFileR& f, float** buffer, int channel, int n break; #ifdef AUDIOCONVERT_DEBUG - printf("SRCAudioConverter::process %s attempt:%d totalOutFrames:%ld != n:%d try again\n", f.name().latin1(), attempt, totalOutFrames, n); + printf("SRCAudioConverter::process %s attempt:%d totalOutFrames:%ld != n:%d try again\n", f.name().toLatin1(), attempt, totalOutFrames, n); #endif // SRC didn't give us the number of frames we requested. @@ -461,7 +461,7 @@ off_t SRCAudioConverter::process(SndFileR& f, float** buffer, int channel, int n _sfCurFrame += rn; #ifdef AUDIOCONVERT_DEBUG printf("SRCAudioConverter::process %s rn:%zd != inFrames:%ld output_frames_gen:%ld outFrames:%ld srcdata.input_frames_used:%ld\n", - f.name().latin1(), rn, inFrames, srcdata.output_frames_gen, outFrames, srcdata.input_frames_used); + f.name().toLatin1(), rn, inFrames, srcdata.output_frames_gen, outFrames, srcdata.input_frames_used); #endif // We've reached the end of the file. Convert the number of frames read. @@ -478,7 +478,7 @@ off_t SRCAudioConverter::process(SndFileR& f, float** buffer, int channel, int n if(totalOutFrames != n) { #ifdef AUDIOCONVERT_DEBUG - printf("SRCAudioConverter::process %s totalOutFrames:%ld != n:%d\n", f.name().latin1(), totalOutFrames, n); + printf("SRCAudioConverter::process %s totalOutFrames:%ld != n:%d\n", f.name().toLatin1(), totalOutFrames, n); #endif // Let's zero the rest of it. @@ -617,7 +617,7 @@ off_t RubberBandAudioConverter::process(SndFileR& f, float** buffer, int channel // Added by Tim. p3.3.17 //#ifdef AUDIOCONVERT_DEBUG_PRC //printf("AudioConverter::process %s audConv:%p sfCurFrame:%ld offset:%u channel:%d fchan:%d n:%d\n", - // f.name().latin1(), this, sfCurFrame, offset, channel, f.channels(), n); + // f.name().toLatin1(), this, sfCurFrame, offset, channel, f.channels(), n); //#endif // off_t frame = offset; // _spos is added before the call. @@ -741,7 +741,7 @@ off_t RubberBandAudioConverter::process(SndFileR& f, float** buffer, int channel #ifdef AUDIOCONVERT_DEBUG if(srcdata.output_frames_gen != outFrames) printf("RubberBandAudioConverter::process %s output_frames_gen:%ld != outFrames:%ld inFrames:%ld srcdata.input_frames_used:%ld rn:%d\n", - f.name().latin1(), srcdata.output_frames_gen, outFrames, inFrames, srcdata.input_frames_used, rn); + f.name().toLatin1(), srcdata.output_frames_gen, outFrames, inFrames, srcdata.input_frames_used, rn); #endif // If the number of frames read by the soundfile equals the input frames, go back. @@ -773,7 +773,7 @@ off_t RubberBandAudioConverter::process(SndFileR& f, float** buffer, int channel break; #ifdef AUDIOCONVERT_DEBUG - printf("RubberBandAudioConverter::process %s attempt:%d totalOutFrames:%ld != n:%d try again\n", f.name().latin1(), attempt, totalOutFrames, n); + printf("RubberBandAudioConverter::process %s attempt:%d totalOutFrames:%ld != n:%d try again\n", f.name().toLatin1(), attempt, totalOutFrames, n); #endif // We didn't get the number of frames we requested. @@ -794,7 +794,7 @@ off_t RubberBandAudioConverter::process(SndFileR& f, float** buffer, int channel _sfCurFrame += rn; #ifdef AUDIOCONVERT_DEBUG printf("RubberBandAudioConverter::process %s rn:%zd != inFrames:%ld output_frames_gen:%ld outFrames:%ld srcdata.input_frames_used:%ld\n", - f.name().latin1(), rn, inFrames, srcdata.output_frames_gen, outFrames, srcdata.input_frames_used); + f.name().toLatin1(), rn, inFrames, srcdata.output_frames_gen, outFrames, srcdata.input_frames_used); #endif // We've reached the end of the file. Convert the number of frames read. @@ -811,7 +811,7 @@ off_t RubberBandAudioConverter::process(SndFileR& f, float** buffer, int channel if(totalOutFrames != n) { #ifdef AUDIOCONVERT_DEBUG - printf("RubberBandAudioConverter::process %s totalOutFrames:%ld != n:%d\n", f.name().latin1(), totalOutFrames, n); + printf("RubberBandAudioConverter::process %s totalOutFrames:%ld != n:%d\n", f.name().toLatin1(), totalOutFrames, n); #endif // Let's zero the rest of it. diff --git a/muse2/muse/audiotrack.cpp b/muse2/muse/audiotrack.cpp index 189e39d1..f486fbae 100644 --- a/muse2/muse/audiotrack.cpp +++ b/muse2/muse/audiotrack.cpp @@ -713,7 +713,7 @@ void AudioTrack::setVolume(double val) iCtrlList cl = _controller.find(AC_VOLUME); if (cl == _controller.end()) { printf("no volume controller %s %zd\n", - name().latin1(), _controller.size()); + name().toLatin1().constData(), _controller.size()); return; } cl->second->setCurVal(val); @@ -1574,7 +1574,7 @@ bool AudioTrack::setRecordFlag1(bool f) QFile fil; for (;;++recFileNumber) { sprintf(buffer, "%s/rec%d.wav", - museProject.latin1(), + museProject.toLatin1().constData(), recFileNumber); fil.setName(QString(buffer)); if (!fil.exists()) @@ -1594,7 +1594,7 @@ bool AudioTrack::setRecordFlag1(bool f) } if (debugMsg) printf("AudioNode::setRecordFlag1: create internal file %s\n", - _recFile->path().latin1()); + _recFile->path().toLatin1().constData()); } else { if (_recFile) { @@ -1609,9 +1609,9 @@ bool AudioTrack::setRecordFlag1(bool f) delete _recFile; setRecFile(0); - remove(s.latin1()); + remove(s.toLatin1().constData()); if(debugMsg) - printf("AudioNode::setRecordFlag1: remove file %s\n", s.latin1()); + printf("AudioNode::setRecordFlag1: remove file %s\n", s.toLatin1().constData()); //_recFile = 0; } } @@ -1621,7 +1621,7 @@ double AudioTrack::auxSend(int idx) const { if (unsigned(idx) >= _auxSend.size()) { printf("%s auxSend: bad index: %d >= %zd\n", - name().latin1(), idx, _auxSend.size()); + name().toLatin1().constData(), idx, _auxSend.size()); return 0.0; } return _auxSend[idx]; @@ -1631,7 +1631,7 @@ void AudioTrack::setAuxSend(int idx, double v) { if (unsigned(idx) >= _auxSend.size()) { printf("%s setAuxSend: bad index: %d >= %zd\n", - name().latin1(), idx, _auxSend.size()); + name().toLatin1().constData(), idx, _auxSend.size()); return; } _auxSend[idx] = v; diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index aa1ffef6..4f3dad63 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -271,18 +271,18 @@ static void readConfigMidiPort(Xml& xml) MidiDevice* dev = midiDevices.find(device); //if(debugMsg && !dev) - // fprintf(stderr, "readConfigMidiPort: device not found %s\n", device.latin1()); + // fprintf(stderr, "readConfigMidiPort: device not found %s\n", device.toLatin1().constData()); if(!dev && type == MidiDevice::JACK_MIDI) { if(debugMsg) - fprintf(stderr, "readConfigMidiPort: creating jack midi device %s\n", device.latin1()); + fprintf(stderr, "readConfigMidiPort: creating jack midi device %s\n", device.toLatin1().constData()); //dev = MidiJackDevice::createJackMidiDevice(device, openFlags); dev = MidiJackDevice::createJackMidiDevice(device); // p3.3.55 } if(debugMsg && !dev) - fprintf(stderr, "readConfigMidiPort: device not found %s\n", device.latin1()); + fprintf(stderr, "readConfigMidiPort: device not found %s\n", device.toLatin1().constData()); MidiPort* mp = &midiPorts[idx]; mp->syncInfo().copyParams(tmpSi); @@ -367,7 +367,7 @@ static void readConfigMidiSyncInfo(Xml& xml) si.setMTCOut(sendMTC); } else - fprintf(stderr, "Read configuration: Sync device: %s not found\n", device.latin1()); + fprintf(stderr, "Read configuration: Sync device: %s not found\n", device.toLatin1().constData()); return; } @@ -732,7 +732,8 @@ void readConfiguration(Xml& xml, bool readOnlySequencer) xml.parseInt(); else if (tag == "mtcoffset") { QString qs(xml.parse1()); - const char* str = qs.latin1(); + QByteArray ba = qs.toLatin1(); + const char* str = ba.constData(); int h, m, s, f, sf; sscanf(str, "%d:%d:%d:%d:%d", &h, &m, &s, &f, &sf); mtcOffset = MTC(h, m, s, f, sf); @@ -805,7 +806,7 @@ void readConfiguration(Xml& xml, bool readOnlySequencer) xml.unknown("configuration"); break; case Xml::Text: - printf("text <%s>\n", xml.s1().latin1()); + printf("text <%s>\n", xml.s1().toLatin1().constData()); break; case Xml::Attribut: if (readOnlySequencer) @@ -869,10 +870,10 @@ static void probeMachineSpecificConfiguration() bool readConfiguration() { - FILE* f = fopen(configName.latin1(), "r"); + FILE* f = fopen(configName.toLatin1().constData(), "r"); if (f == 0) { if (debugMsg || debugMode) - fprintf(stderr, "NO Config File <%s> found\n", configName.latin1()); + fprintf(stderr, "NO Config File <%s> found\n", configName.toLatin1().constData()); // if the config file does not exist launch probeMachineSpecificConfiguration probeMachineSpecificConfiguration(); @@ -1018,10 +1019,10 @@ static void writeSeqConfiguration(int level, Xml& xml, bool writePortInfo) void MusE::writeGlobalConfiguration() const { - FILE* f = fopen(configName.latin1(), "w"); + FILE* f = fopen(configName.toLatin1().constData(), "w"); if (f == 0) { printf("save configuration to <%s> failed: %s\n", - configName.latin1(), strerror(errno)); + configName.toLatin1().constData(), strerror(errno)); return; } Xml xml(f); @@ -1428,7 +1429,7 @@ void MixerConfig::write(int level, Xml& xml) //void MixerConfig::write(int level, Xml& xml, const char* name) { //xml.stag(QString(name)); - //xml.tag(level++, name.latin1()); + //xml.tag(level++, name.toLatin1().constData()); xml.tag(level++, "Mixer"); //xml.tag(level++, name); @@ -1447,7 +1448,7 @@ void MixerConfig::write(int level, Xml& xml) xml.intTag(level, "showSyntiTracks", showSyntiTracks); //xml.etag(name); - //xml.etag(level, name.latin1()); + //xml.etag(level, name.toLatin1().constData()); xml.etag(level, "Mixer"); //xml.etag(level, name); } @@ -1489,7 +1490,7 @@ void MixerConfig::read(Xml& xml) else if (tag == "showSyntiTracks") showSyntiTracks = xml.parseInt(); else - //xml.unknown(name.latin1()); + //xml.unknown(name.toLatin1().constData()); xml.unknown("Mixer"); break; case Xml::TagEnd: diff --git a/muse2/muse/confmport.cpp b/muse2/muse/confmport.cpp index 17abc19c..8e77c155 100644 --- a/muse2/muse/confmport.cpp +++ b/muse2/muse/confmport.cpp @@ -52,7 +52,7 @@ void MPConfig::mdevViewItemRenamed(QTableWidgetItem* item) { int col = item->column(); QString s = item->text(); - //printf("MPConfig::mdevViewItemRenamed col:%d txt:%s\n", col, s.latin1()); + //printf("MPConfig::mdevViewItemRenamed col:%d txt:%s\n", col, s.toLatin1().constData()); if(item == 0) return; switch(col) @@ -60,7 +60,7 @@ void MPConfig::mdevViewItemRenamed(QTableWidgetItem* item) case DEVCOL_NAME: { QString id = item->tableWidget()->item(item->row(), DEVCOL_NO)->text(); - int no = atoi(id.latin1()) - 1; + int no = atoi(id.toLatin1().constData()) - 1; if(no < 0 || no >= MIDI_PORTS) return; @@ -88,7 +88,7 @@ void MPConfig::mdevViewItemRenamed(QTableWidgetItem* item) } break; default: - //printf("MPConfig::mdevViewItemRenamed unknown column clicked col:%d txt:%s\n", col, s.latin1()); + //printf("MPConfig::mdevViewItemRenamed unknown column clicked col:%d txt:%s\n", col, s.toLatin1().constData()); break; } } @@ -102,7 +102,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) if (item == 0) return; QString id = item->tableWidget()->item(item->row(), DEVCOL_NO)->text(); - int no = atoi(id.latin1()) - 1; + int no = atoi(id.toLatin1().constData()) - 1; if (no < 0 || no >= MIDI_PORTS) return; @@ -234,7 +234,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) //for (int i = 0; i < channel; ++i) //{ //char buffer[128]; - //snprintf(buffer, 128, "%s %d", tr("Channel").latin1(), i+1); + //snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), i+1); //MenuTitleItem* titel = new MenuTitleItem(QString(buffer)); //pup->insertItem(titel); @@ -404,8 +404,8 @@ void MPConfig::rbClicked(QTableWidgetItem* item) //if(devALSA) if((*i)->deviceType() == MidiDevice::ALSA_MIDI) { - //mapALSA.insert( std::pair<std::string, int> (std::string(devALSA->name().lower().latin1()), ii) ); - mapALSA.insert( std::pair<std::string, int> (std::string((*i)->name().latin1()), aix) ); + //mapALSA.insert( std::pair<std::string, int> (std::string(devALSA->name().lower().toLatin1().constData()), ii) ); + mapALSA.insert( std::pair<std::string, int> (std::string((*i)->name().toLatin1().constData()), aix) ); ++aix; } else @@ -413,18 +413,18 @@ void MPConfig::rbClicked(QTableWidgetItem* item) { //devJACK = dynamic_cast<MidiJackDevice*>(*i); //if(devJACK) - //mapJACK.insert( std::pair<std::string, int> (std::string(devJACK->name().lower().latin1()), ii) ); - mapJACK.insert( std::pair<std::string, int> (std::string((*i)->name().latin1()), jix) ); + //mapJACK.insert( std::pair<std::string, int> (std::string(devJACK->name().lower().toLatin1().constData()), ii) ); + mapJACK.insert( std::pair<std::string, int> (std::string((*i)->name().toLatin1().constData()), jix) ); ++jix; } else if((*i)->deviceType() == MidiDevice::SYNTH_MIDI) { - mapSYNTH.insert( std::pair<std::string, int> (std::string((*i)->name().latin1()), six) ); + mapSYNTH.insert( std::pair<std::string, int> (std::string((*i)->name().toLatin1().constData()), six) ); ++six; } else - printf("MPConfig::rbClicked unknown midi device: %s\n", (*i)->name().latin1()); + printf("MPConfig::rbClicked unknown midi device: %s\n", (*i)->name().toLatin1().constData()); } //int sz = midiDevices.size(); @@ -757,7 +757,7 @@ void MPConfig::songChanged(int flags) if(sitem) { QString id = sitem->tableWidget()->item(sitem->row(), DEVCOL_NO)->text(); - no = atoi(id.latin1()) - 1; + no = atoi(id.toLatin1().constData()) - 1; if(no < 0 || no >= MIDI_PORTS) no = -1; } diff --git a/muse2/muse/ctrl.cpp b/muse2/muse/ctrl.cpp index fa7e5bd7..4da22836 100644 --- a/muse2/muse/ctrl.cpp +++ b/muse2/muse/ctrl.cpp @@ -167,24 +167,25 @@ void CtrlList::read(Xml& xml) //_id = xml.s2().toInt(); _id = loc.toInt(xml.s2(), &ok); if(!ok) - printf("CtrlList::read failed reading _id string: %s\n", xml.s2().latin1()); + printf("CtrlList::read failed reading _id string: %s\n", xml.s2().toLatin1().constData()); } else if (tag == "cur") { //_curVal = xml.s2().toDouble(); _curVal = loc.toDouble(xml.s2(), &ok); if(!ok) - printf("CtrlList::read failed reading _curVal string: %s\n", xml.s2().latin1()); + printf("CtrlList::read failed reading _curVal string: %s\n", xml.s2().toLatin1().constData()); } else - printf("unknown tag %s\n", tag.latin1()); + printf("unknown tag %s\n", tag.toLatin1().constData()); break; case Xml::Text: { // Changed by Tim. Users in some locales reported corrupt reading, // because of the way floating point is represented (2,3456 not 2.3456). /* - const char* s = tag.latin1(); + QByteArray ba = tag.toLatin1(); + const char* s = ba;.constData(); int frame; double val; @@ -206,7 +207,7 @@ void CtrlList::read(Xml& xml) */ // Added by Tim. p3.3.6 - //printf("CtrlList::read tag:%s\n", tag.latin1()); + //printf("CtrlList::read tag:%s\n", tag.toLatin1().constData()); int len = tag.length(); int frame; @@ -235,7 +236,7 @@ void CtrlList::read(Xml& xml) frame = loc.toInt(fs, &ok); if(!ok) { - printf("CtrlList::read failed reading frame string: %s\n", fs.latin1()); + printf("CtrlList::read failed reading frame string: %s\n", fs.toLatin1().constData()); break; } @@ -257,12 +258,12 @@ void CtrlList::read(Xml& xml) val = loc.toDouble(vs, &ok); if(!ok) { - printf("CtrlList::read failed reading value string: %s\n", vs.latin1()); + printf("CtrlList::read failed reading value string: %s\n", vs.toLatin1().constData()); break; } // Added by Tim. p3.3.6 - //printf("CtrlList::read i:%d len:%d fs:%s frame %d: vs:%s val %f \n", i, len, fs.latin1(), frame, vs.latin1(), val); + //printf("CtrlList::read i:%d len:%d fs:%s frame %d: vs:%s val %f \n", i, len, fs.toLatin1().constData(), frame, vs.toLatin1().constData(), val); add(frame, val); diff --git a/muse2/muse/ctrl/ctrlpanel.cpp b/muse2/muse/ctrl/ctrlpanel.cpp index 8e044510..37472b08 100644 --- a/muse2/muse/ctrl/ctrlpanel.cpp +++ b/muse2/muse/ctrl/ctrlpanel.cpp @@ -102,7 +102,7 @@ CtrlPanel::CtrlPanel(QWidget* parent, MidiEditor* e, const char* name) _dl->setToolTip(tr("double click on/off")); _dl->setSpecialText(tr("off")); _dl->setFont(config.fonts[1]); - _dl->setBackgroundMode(Qt::PaletteMid); + _dl->setBackgroundRole(QPalette::Mid); _dl->setFrame(true); _dl->setFixedWidth(36); _dl->setFixedHeight(15); @@ -659,7 +659,7 @@ void CtrlPanel::ctrlPopup() } } if (i == cll->end()) { - printf("CtrlPanel: controller %s not found!", s.latin1()); + printf("CtrlPanel: controller %s not found!", s.toLatin1().constData()); } } } diff --git a/muse2/muse/driver/alsamidi.cpp b/muse2/muse/driver/alsamidi.cpp index 3b15fc6f..4426279b 100644 --- a/muse2/muse/driver/alsamidi.cpp +++ b/muse2/muse/driver/alsamidi.cpp @@ -199,10 +199,10 @@ void MidiAlsaDevice::writeRouting(int level, Xml& xml) const xml.tag(level++, "Route"); //xml.strTag(level, "srcNode", r->name()); - xml.tag(level, "source type=\"%d\" name=\"%s\"/", r->type, r->name().latin1()); + xml.tag(level, "source type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData()); //xml.strTag(level, "dstNode", name()); - xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::ALSA_MIDI_ROUTE, name().latin1()); + xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::ALSA_MIDI_ROUTE, name().toLatin1().constData()); xml.etag(level--, "Route"); } @@ -230,31 +230,31 @@ void MidiAlsaDevice::writeRouting(int level, Xml& xml) const /* //xml.strTag(level, "srcNode", name()); if(r->channel != -1) - //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::ALSA_MIDI_ROUTE, r->channel, name().latin1()); - //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, r->channel, name().latin1()); - xml.tag(level, "source devtype=\"%d\" channel=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, r->channel, name().latin1()); + //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::ALSA_MIDI_ROUTE, r->channel, name().toLatin1().constData()); + //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, r->channel, name().toLatin1().constData()); + xml.tag(level, "source devtype=\"%d\" channel=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, r->channel, name().toLatin1().constData()); else - //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::ALSA_MIDI_ROUTE, name().latin1()); - //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().latin1()); + //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::ALSA_MIDI_ROUTE, name().toLatin1().constData()); + //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().toLatin1().constData()); */ - //xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, name().latin1()); - xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, Xml::xmlString(name()).latin1()); + //xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, name().toLatin1().constData()); + xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, Xml::xmlString(name()).toLatin1().constData()); /* //xml.strTag(level, "dstNode", r->name()); if(r->channel != -1) { if(r->type == Route::MIDI_DEVICE_ROUTE) - xml.tag(level, "dest devtype=\"%d\" channel=\"%d\" name=\"%s\"/", r->device->deviceType(), r->channel, r->name().latin1()); + xml.tag(level, "dest devtype=\"%d\" channel=\"%d\" name=\"%s\"/", r->device->deviceType(), r->channel, r->name().toLatin1().constData()); else - xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", r->type, r->channel, r->name().latin1()); + xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", r->type, r->channel, r->name().toLatin1().constData()); } else { if(r->type == Route::MIDI_DEVICE_ROUTE) - xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", r->device->deviceType(), r->name().latin1()); + xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", r->device->deviceType(), r->name().toLatin1().constData()); else - xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().latin1()); + xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData()); } */ diff --git a/muse2/muse/driver/jack.cpp b/muse2/muse/driver/jack.cpp index 6c237622..909e6064 100644 --- a/muse2/muse/driver/jack.cpp +++ b/muse2/muse/driver/jack.cpp @@ -789,7 +789,7 @@ void JackAudioDevice::connectJackMidiPorts() QString name(namep); if(JACK_DEBUG) - printf("JackAudioDevice::graphChanged %s\n", name.latin1()); + printf("JackAudioDevice::graphChanged %s\n", name.toLatin1()); for(iMidiDevice imd = midiDevices.begin(); imd != midiDevices.end(); ++imd) { @@ -805,14 +805,14 @@ void JackAudioDevice::connectJackMidiPorts() if(!mjd->clientJackPort() || (mjd->clientJackPort() != port)) continue; - jack_port_t* devport = jack_port_by_name(_client, mjd->name().latin1()); + jack_port_t* devport = jack_port_by_name(_client, mjd->name().toLatin1()); if(!devport) continue; int ofl = mjd->openFlags(); if(JACK_DEBUG) - printf("JackAudioDevice::graphChanged found MidiJackDevice:%s\n", mjd->name().latin1()); + printf("JackAudioDevice::graphChanged found MidiJackDevice:%s\n", mjd->name().toLatin1()); // Note docs say it can't be both input and output. src, dest // If Jack port can receive data from us and we actually want to... @@ -919,7 +919,7 @@ void JackAudioDevice::graphChanged() if (irl->channel != channel) continue; QString name = irl->name(); - const char* portName = name.latin1(); + const char* portName = name.toLatin1(); //printf("portname=%s\n", portName); bool found = false; const char** pn = ports; @@ -956,7 +956,7 @@ void JackAudioDevice::graphChanged() if (irl->channel != channel) continue; QString name = irl->name(); - const char* portName = name.latin1(); + const char* portName = name.toLatin1(); if (strcmp(*pn, portName) == 0) { found = true; break; @@ -1004,7 +1004,7 @@ void JackAudioDevice::graphChanged() if (irl->channel != channel) continue; QString name = irl->name(); - const char* portName = name.latin1(); + const char* portName = name.toLatin1(); bool found = false; const char** pn = ports; while (pn && *pn) { @@ -1040,7 +1040,7 @@ void JackAudioDevice::graphChanged() if (irl->channel != channel) continue; QString name = irl->name(); - const char* portName = name.latin1(); + const char* portName = name.toLatin1(); if (strcmp(*pn, portName) == 0) { found = true; break; @@ -1114,7 +1114,7 @@ void JackAudioDevice::graphChanged() // continue; QString name = irl->name(); //name += QString(JACK_MIDI_OUT_PORT_SUFFIX); // p3.3.55 - const char* portName = name.latin1(); + const char* portName = name.toLatin1(); bool found = false; const char** pn = ports; while (pn && *pn) { @@ -1154,7 +1154,7 @@ void JackAudioDevice::graphChanged() //if (irl->channel != channel) // continue; QString name = irl->name(); - const char* portName = name.latin1(); + const char* portName = name.toLatin1(); if (strcmp(*pn, portName) == 0) { found = true; break; @@ -1210,7 +1210,7 @@ void JackAudioDevice::graphChanged() //if (irl->channel != channel) // continue; QString name = irl->name(); - const char* portName = name.latin1(); + const char* portName = name.toLatin1(); bool found = false; const char** pn = ports; while (pn && *pn) { @@ -1250,7 +1250,7 @@ void JackAudioDevice::graphChanged() //if (irl->channel != channel) // continue; QString name = irl->name(); - const char* portName = name.latin1(); + const char* portName = name.toLatin1(); if (strcmp(*pn, portName) == 0) { found = true; break; @@ -1743,7 +1743,7 @@ QString JackAudioDevice::portName(void* port) return ""; QString s(jack_port_name((jack_port_t*)port)); - //printf("Jack::portName %p %s\n", port, s.latin1()); + //printf("Jack::portName %p %s\n", port, s.toLatin1()); return s; } @@ -2130,14 +2130,14 @@ void JackAudioDevice::scanMidiPorts() // Only Jack midi devices. if(dynamic_cast<MidiJackDevice*>(*imd) == 0) continue; - if(names.find(std::string((*imd)->name().latin1())) == names.end()) + if(names.find(std::string((*imd)->name().toLatin1())) == names.end()) to_del.push_back(*imd); } for(std::list<MidiDevice*>::iterator imd = to_del.begin(); imd != to_del.end(); ++imd) { if(debugMsg) - printf(" removing port device:%s\n", (*imd)->name().latin1()); + printf(" removing port device:%s\n", (*imd)->name().toLatin1()); midiDevices.remove(*imd); // This will close (and unregister) the client port. delete (*imd); @@ -2198,7 +2198,7 @@ void JackAudioDevice::scanMidiPorts() //portList.append(jp); if(debugMsg) - printf(" adding port device:%s\n", qname.latin1()); + printf(" adding port device:%s\n", qname.toLatin1()); MidiJackDevice* dev = new MidiJackDevice(0, qname); dev->setrwFlags(flags); diff --git a/muse2/muse/driver/jackmidi.cpp b/muse2/muse/driver/jackmidi.cpp index d10712eb..da0f6235 100644 --- a/muse2/muse/driver/jackmidi.cpp +++ b/muse2/muse/driver/jackmidi.cpp @@ -203,15 +203,15 @@ MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p /// _openFlags &= _rwFlags; // restrict to available bits /// #ifdef JACK_MIDI_DEBUG -/// printf("MidiJackDevice::open %s\n", name.latin1()); +/// printf("MidiJackDevice::open %s\n", name.toLatin1().constData()); /// #endif - //jack_port_t* jp = jack_port_by_name(_client, name().latin1()); -/// jack_port_t* jp = (jack_port_t*)audioDevice->findPort(name().latin1()); + //jack_port_t* jp = jack_port_by_name(_client, name().toLatin1().constData()); +/// jack_port_t* jp = (jack_port_t*)audioDevice->findPort(name().toLatin1().constData()); /// if(!jp) /// { -/// printf("MidiJackDevice::open: Jack midi port %s not found!\n", name().latin1()); +/// printf("MidiJackDevice::open: Jack midi port %s not found!\n", name().toLatin1().constData()); /// _writeEnable = false; /// _readEnable = false; /// return QString("Jack midi port not found"); @@ -222,9 +222,9 @@ MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p //if(!name.isEmpty()) //{ // Does not work. - // if(audioDevice->findPort(name.latin1())) + // if(audioDevice->findPort(name.toLatin1().constData())) // { - // fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed! Given port name %s already exists!\n", name.latin1()); + // fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed! Given port name %s already exists!\n", name.toLatin1().constData()); // return 0; // } //} @@ -275,8 +275,8 @@ MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p //client_jackport = (jack_port_t*)audioDevice->registerOutPort(buf, true); if(audioDevice->deviceType() == AudioDevice::JACK_AUDIO) // p3.3.52 { - //client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.latin1(), true); - out_client_jackport = (jack_port_t*)audioDevice->registerOutPort((name + QString("_out")).latin1(), true); // p3.3.55 + //client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.toLatin1().constData(), true); + out_client_jackport = (jack_port_t*)audioDevice->registerOutPort((name + QString("_out")).toLatin1().constData(), true); // p3.3.55 //if(client_jackport) if(out_client_jackport) // p3.3.55 break; @@ -300,13 +300,13 @@ MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p { if(audioDevice->deviceType() == AudioDevice::JACK_AUDIO) // p3.3.52 { - //client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.latin1(), true); - out_client_jackport = (jack_port_t*)audioDevice->registerOutPort((name + QString(JACK_MIDI_OUT_PORT_SUFFIX)).latin1(), true); // p3.3.55 + //client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.toLatin1().constData(), true); + out_client_jackport = (jack_port_t*)audioDevice->registerOutPort((name + QString(JACK_MIDI_OUT_PORT_SUFFIX)).toLatin1().constData(), true); // p3.3.55 //if(!client_jackport) if(!out_client_jackport) // p3.3.55 { - //fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed creating output port name %s\n", name.latin1()); - fprintf(stderr, "MusE: createJackMidiDevice failed creating output port name %s\n", (name + QString(JACK_MIDI_OUT_PORT_SUFFIX)).latin1()); // p3.3.55 + //fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed creating output port name %s\n", name.toLatin1().constData()); + fprintf(stderr, "MusE: createJackMidiDevice failed creating output port name %s\n", (name + QString(JACK_MIDI_OUT_PORT_SUFFIX)).toLatin1().constData()); // p3.3.55 //return 0; rwflags &= ~1; // p3.3.55 Remove the output r/w flag, but continue on... @@ -318,7 +318,7 @@ MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p /* else { - client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.latin1(), true); + client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.toLatin1().constData(), true); if(!client_jackport) { for(int i = 0; ; ++i) @@ -342,10 +342,10 @@ MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p } */ - //client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.latin1(), true); + //client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.toLatin1().constData(), true); //if(client_jackport == NULL) //{ - // fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed to register jack midi client output port %s\n", name.latin1()); + // fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed to register jack midi client output port %s\n", name.toLatin1().constData()); // return 0; //} //else @@ -375,8 +375,8 @@ MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p //client_jackport = (jack_port_t*)audioDevice->registerInPort(buf, true); if(audioDevice->deviceType() == AudioDevice::JACK_AUDIO) // p3.3.52 { - //client_jackport = (jack_port_t*)audioDevice->registerInPort(name.latin1(), true); - in_client_jackport = (jack_port_t*)audioDevice->registerInPort(name.latin1(), true); // p3.3.55 + //client_jackport = (jack_port_t*)audioDevice->registerInPort(name.toLatin1().constData(), true); + in_client_jackport = (jack_port_t*)audioDevice->registerInPort(name.toLatin1().constData(), true); // p3.3.55 //if(client_jackport) if(in_client_jackport) // p3.3.55 break; @@ -400,13 +400,13 @@ MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p { if(audioDevice->deviceType() == AudioDevice::JACK_AUDIO) // p3.3.52 { - //client_jackport = (jack_port_t*)audioDevice->registerInPort(name.latin1(), true); - in_client_jackport = (jack_port_t*)audioDevice->registerInPort((name + QString(JACK_MIDI_IN_PORT_SUFFIX)).latin1(), true); // p3.3.55 + //client_jackport = (jack_port_t*)audioDevice->registerInPort(name.toLatin1().constData(), true); + in_client_jackport = (jack_port_t*)audioDevice->registerInPort((name + QString(JACK_MIDI_IN_PORT_SUFFIX)).toLatin1().constData(), true); // p3.3.55 //if(!client_jackport) if(!in_client_jackport) // p3.3.55 { - //fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed creating input port name %s\n", name.latin1()); - fprintf(stderr, "MusE: createJackMidiDevice failed creating input port name %s\n", (name + QString(JACK_MIDI_IN_PORT_SUFFIX)).latin1()); + //fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed creating input port name %s\n", name.toLatin1().constData()); + fprintf(stderr, "MusE: createJackMidiDevice failed creating input port name %s\n", (name + QString(JACK_MIDI_IN_PORT_SUFFIX)).toLatin1().constData()); //return 0; rwflags &= ~2; // p3.3.55 Remove the input r/w flag, but continue on... @@ -415,11 +415,11 @@ MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p } */ - //client_jackport = (jack_port_t*)audioDevice->registerInPort(name.latin1(), true); + //client_jackport = (jack_port_t*)audioDevice->registerInPort(name.toLatin1().constData(), true); //if(client_jackport == NULL) //{ - // fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed to register jack midi client input port %s\n", name.latin1()); + // fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed to register jack midi client input port %s\n", name.toLatin1().constData()); //_readEnable = false; //return QString("Could not register jack-midi-in client port"); // return 0; @@ -448,17 +448,17 @@ MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p void MidiJackDevice::setName(const QString& s) { #ifdef JACK_MIDI_DEBUG - printf("MidiJackDevice::setName %s new name:%s\n", name().latin1(), s.latin1()); + printf("MidiJackDevice::setName %s new name:%s\n", name().toLatin1().constData(), s.toLatin1().constData()); #endif _name = s; //if(clientPort()) // p3.3.52 Added check. - // audioDevice->setPortName(clientPort(), s.latin1()); + // audioDevice->setPortName(clientPort(), s.toLatin1().constData()); // p3.3.55 if(inClientPort()) - audioDevice->setPortName(inClientPort(), (s + QString(JACK_MIDI_IN_PORT_SUFFIX)).latin1()); + audioDevice->setPortName(inClientPort(), (s + QString(JACK_MIDI_IN_PORT_SUFFIX)).toLatin1().constData()); if(outClientPort()) - audioDevice->setPortName(outClientPort(), (s + QString(JACK_MIDI_OUT_PORT_SUFFIX)).latin1()); + audioDevice->setPortName(outClientPort(), (s + QString(JACK_MIDI_OUT_PORT_SUFFIX)).toLatin1().constData()); } //--------------------------------------------------------- @@ -470,16 +470,16 @@ QString MidiJackDevice::open() _openFlags &= _rwFlags; // restrict to available bits #ifdef JACK_MIDI_DEBUG - printf("MidiJackDevice::open %s\n", name().latin1()); + printf("MidiJackDevice::open %s\n", name().toLatin1().constData()); #endif /* - //jack_port_t* jp = jack_port_by_name(_client, name().latin1()); - jack_port_t* jp = (jack_port_t*)audioDevice->findPort(name().latin1()); + //jack_port_t* jp = jack_port_by_name(_client, name().toLatin1().constData()); + jack_port_t* jp = (jack_port_t*)audioDevice->findPort(name().toLatin1().constData()); if(!jp) { - printf("MidiJackDevice::open: Jack midi port %s not found!\n", name().latin1()); + printf("MidiJackDevice::open: Jack midi port %s not found!\n", name().toLatin1().constData()); _writeEnable = false; _readEnable = false; return QString("Jack midi port not found"); @@ -539,10 +539,10 @@ QString MidiJackDevice::open() if(audioDevice->deviceType() == AudioDevice::JACK_AUDIO) { s = name() + QString(JACK_MIDI_OUT_PORT_SUFFIX); - _out_client_jackport = (jack_port_t*)audioDevice->registerOutPort(s.latin1(), true); + _out_client_jackport = (jack_port_t*)audioDevice->registerOutPort(s.toLatin1().constData(), true); if(!_out_client_jackport) { - fprintf(stderr, "MusE: MidiJackDevice::open failed creating output port name %s\n", s.latin1()); + fprintf(stderr, "MusE: MidiJackDevice::open failed creating output port name %s\n", s.toLatin1().constData()); _openFlags &= ~1; // Remove the flag, but continue on... } } @@ -585,10 +585,10 @@ QString MidiJackDevice::open() if(audioDevice->deviceType() == AudioDevice::JACK_AUDIO) { s = name() + QString(JACK_MIDI_IN_PORT_SUFFIX); - _in_client_jackport = (jack_port_t*)audioDevice->registerInPort(s.latin1(), true); + _in_client_jackport = (jack_port_t*)audioDevice->registerInPort(s.toLatin1().constData(), true); if(!_in_client_jackport) { - fprintf(stderr, "MusE: MidiJackDevice::open failed creating input port name %s\n", s.latin1()); + fprintf(stderr, "MusE: MidiJackDevice::open failed creating input port name %s\n", s.toLatin1().constData()); _openFlags &= ~2; // Remove the flag, but continue on... } } @@ -620,7 +620,7 @@ QString MidiJackDevice::open() void MidiJackDevice::close() { #ifdef JACK_MIDI_DEBUG - printf("MidiJackDevice::close %s\n", name().latin1()); + printf("MidiJackDevice::close %s\n", name().toLatin1().constData()); #endif // p3.3.55 TODO: I don't really want to unregister the @@ -650,12 +650,12 @@ void MidiJackDevice::close() _readEnable = false; /* - //jack_port_t* jp = jack_port_by_name(_client, name().latin1()); - jack_port_t* jp = (jack_port_t*)audioDevice->findPort(name().latin1()); + //jack_port_t* jp = jack_port_by_name(_client, name().toLatin1().constData()); + jack_port_t* jp = (jack_port_t*)audioDevice->findPort(name().toLatin1().constData()); if(!jp) { - printf("MidiJackDevice::close: Jack midi port %s not found!\n", name().latin1()); + printf("MidiJackDevice::close: Jack midi port %s not found!\n", name().toLatin1().constData()); _writeEnable = false; _readEnable = false; return; @@ -665,7 +665,7 @@ void MidiJackDevice::close() // If Jack port can receive data from us and we actually want to... //if((pf & JackPortIsInput) && (_openFlags & 1)) - if(jack_port_connected_to(midi_port_out[0], name().latin1())) + if(jack_port_connected_to(midi_port_out[0], name().toLatin1().constData())) { // src, dest /// audioDevice->disconnect(midi_port_out[0], jp); @@ -674,7 +674,7 @@ void MidiJackDevice::close() else // Note docs say it can't be both input and output. // If Jack port can send data to us and we actually want it... //if((pf & JackPortIsOutput) && (_openFlags & 2)) - if(jack_port_connected_to(midi_port_in[0], name().latin1())) + if(jack_port_connected_to(midi_port_in[0], name().toLatin1().constData())) { /// audioDevice->disconnect(jp, midi_port_in[0]); _readEnable = false; @@ -706,7 +706,7 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const xml.tag(level++, "Route"); //xml.strTag(level, "srcNode", r->name()); - //xml.tag(level, "source type=\"%d\" name=\"%s\"/", r->type, r->name().latin1()); + //xml.tag(level, "source type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData()); s = QT_TR_NOOP("source"); if(r->type != Route::TRACK_ROUTE) s += QString(QT_TR_NOOP(" type=\"%1\"")).arg(r->type); @@ -716,10 +716,10 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const xml.tag(level, s); //xml.strTag(level, "dstNode", name()); - //xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, name().latin1()); - //xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().latin1()); - //xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, name().latin1()); - xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, Xml::xmlString(name()).latin1()); + //xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, name().toLatin1().constData()); + //xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().toLatin1().constData()); + //xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, name().toLatin1().constData()); + xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, Xml::xmlString(name()).toLatin1().constData()); xml.etag(level--, "Route"); } @@ -740,31 +740,31 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const /* //xml.strTag(level, "srcNode", name()); if(r->channel != -1) - //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, r->channel, name().latin1()); - //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, r->channel, name().latin1()); - xml.tag(level, "source devtype=\"%d\" channel=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, r->channel, name().latin1()); + //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, r->channel, name().toLatin1().constData()); + //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, r->channel, name().toLatin1().constData()); + xml.tag(level, "source devtype=\"%d\" channel=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, r->channel, name().toLatin1().constData()); else - //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, name().latin1()); - //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().latin1()); + //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, name().toLatin1().constData()); + //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().toLatin1().constData()); */ - //xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, name().latin1()); - xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, Xml::xmlString(name()).latin1()); + //xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, name().toLatin1().constData()); + xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, Xml::xmlString(name()).toLatin1().constData()); /* //xml.strTag(level, "dstNode", r->name()); if(r->channel != -1) { if(r->type == Route::MIDI_DEVICE_ROUTE) - xml.tag(level, "dest devtype=\"%d\" channel=\"%d\" name=\"%s\"/", r->device->deviceType(), r->channel, r->name().latin1()); + xml.tag(level, "dest devtype=\"%d\" channel=\"%d\" name=\"%s\"/", r->device->deviceType(), r->channel, r->name().toLatin1().constData()); else - xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", r->type, r->channel, r->name().latin1()); + xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", r->type, r->channel, r->name().toLatin1().constData()); } else { if(r->type == Route::MIDI_DEVICE_ROUTE) - xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", r->device->deviceType(), r->name().latin1()); + xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", r->device->deviceType(), r->name().toLatin1().constData()); else - xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().latin1()); + xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData()); } */ @@ -798,12 +798,12 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const //xml.strTag(level, "srcNode", name()); //if(r->channel != -1) - // xml.tag(level, "srcNode type=\"%d\" channel=\"%d\" name=\"%s\"", Route::JACK_MIDI_ROUTE, r->channel, name().latin1()); + // xml.tag(level, "srcNode type=\"%d\" channel=\"%d\" name=\"%s\"", Route::JACK_MIDI_ROUTE, r->channel, name().toLatin1().constData()); //else - xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, name().latin1()); + xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, name().toLatin1().constData()); //xml.strTag(level, "dstNode", r->name()); - xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().latin1()); + xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData()); xml.etag(level--, "Route"); } @@ -1097,7 +1097,7 @@ void MidiJackDevice::eventReceived(jack_midi_event_t* ev) } if (midiInputTrace) { - printf("MidiInput<%s>: ", name().latin1()); + printf("MidiInput<%s>: ", name().toLatin1().constData()); event.dump(); } @@ -1178,7 +1178,7 @@ bool MidiJackDevice::queueEvent(const MidiPlayEvent& e) // return false; //if (midiOutputTrace) { - // printf("MidiOut<%s>: jackMidi: ", portName(port).toLatin1().data()); + // printf("MidiOut<%s>: jackMidi: ", portName(port).toLatin1().constData()); // e.dump(); // } diff --git a/muse2/muse/dssihost.cpp b/muse2/muse/dssihost.cpp index dfedacaa..d274cee7 100644 --- a/muse2/muse/dssihost.cpp +++ b/muse2/muse/dssihost.cpp @@ -296,14 +296,14 @@ int oscMessageHandler(const char* path, const char* types, lo_arg** argv, static void scanDSSILib(QFileInfo& fi) // ddskrjo removed const for argument { //void* handle = dlopen(fi.filePath().toAscii().data(), RTLD_NOW); - void* handle = dlopen(fi.filePath().latin1(), RTLD_NOW); - //void* handle = dlopen(fi.absFilePath().latin1(), RTLD_NOW); + void* handle = dlopen(fi.filePath().toLatin1().constData(), RTLD_NOW); + //void* handle = dlopen(fi.absFilePath().toLatin1().constData(), RTLD_NOW); if (handle == 0) { fprintf(stderr, "scanDSSILib: dlopen(%s) failed: %s\n", //fi.filePath().toAscii().data(), dlerror()); - fi.filePath().latin1(), dlerror()); - //fi.absFilePath().latin1(), dlerror()); + fi.filePath().toLatin1().constData(), dlerror()); + //fi.absFilePath().toLatin1().constData(), dlerror()); return; } @@ -321,7 +321,7 @@ static void scanDSSILib(QFileInfo& fi) // ddskrjo removed const for argument "Are you sure this is a DSSI plugin file?\n", //fi.filePath().toAscii().data(), fi.filePath().ascii(), - //fi.absFilePath().latin1(), + //fi.absFilePath().toLatin1().constData(), txt); dlclose(handle); @@ -364,7 +364,7 @@ static void scanDSSILib(QFileInfo& fi) // ddskrjo removed const for argument Synth* s = *is; //#ifdef DSSI_DEBUG // fprintf(stderr, "scanDSSILib: name:%s listname:%s lib:%s listlib:%s\n", - // label.latin1(), s->name().latin1(), fi.baseName(true).latin1(), s->baseName().latin1()); + // label.toLatin1().constData(), s->name().toLatin1().constData(), fi.baseName(true).toLatin1().constData(), s->baseName().toLatin1().constData()); //#endif if(s->name() == label && s->baseName() == fi.completeBaseName()) @@ -378,7 +378,7 @@ static void scanDSSILib(QFileInfo& fi) // ddskrjo removed const for argument if(debugMsg) { fprintf(stderr, "scanDSSILib: name:%s listname:%s lib:%s listlib:%s\n", - label.latin1(), s->name().latin1(), fi.completeBaseName().latin1(), s->baseName().latin1()); + label.toLatin1().constData(), s->name().toLatin1().constData(), fi.completeBaseName().toLatin1().constData(), s->baseName().toLatin1().constData()); int ai = 0, ao = 0, ci = 0, co = 0; for(unsigned long pt = 0; pt < descr->LADSPA_Plugin->PortCount; ++pt) { @@ -420,7 +420,7 @@ static void scanDSSIDir(QString& s) // ddskrjo removed const for argument { if(debugMsg) //printf("scan DSSI plugin dir <%s>\n", s.toAscii().data()); - printf("scanDSSIDir: scan DSSI plugin dir <%s>\n", s.latin1()); + printf("scanDSSIDir: scan DSSI plugin dir <%s>\n", s.toLatin1().constData()); #ifdef __APPLE__ QDir pluginDir(s, QString("*.dylib"), QDir::Unsorted, QDir::Files); @@ -440,7 +440,7 @@ static void scanDSSIDir(QString& s) // ddskrjo removed const for argument for(unsigned int i = 0; i < list.count(); ++i) { if(debugMsg) - printf("scanDSSIDir: found %s\n", (s + QString("/") + list[i]).latin1()); + printf("scanDSSIDir: found %s\n", (s + QString("/") + list[i]).toLatin1().constData()); QFileInfo fi(s + QString("/") + list[i]); scanDSSILib(fi); @@ -463,7 +463,7 @@ void initDSSI() const char* p = dssiPath; //QString pth = QString(dssiPath) + QString(":") + QString(ladspaPath); - //const char* p = pth.latin1(); + //const char* p = pth.toLatin1().constData(); while (*p != '\0') { const char* pe = p; while (*pe != ':' && *pe != '\0') @@ -566,15 +566,15 @@ SynthIF* DssiSynth::createSIF(SynthI* synti) if (_instances == 0) { //handle = dlopen(info.filePath().toAscii().data(), RTLD_NOW); - handle = dlopen(info.filePath().latin1(), RTLD_NOW); - //handle = dlopen(info.absFilePath().latin1(), RTLD_NOW); + handle = dlopen(info.filePath().toLatin1().constData(), RTLD_NOW); + //handle = dlopen(info.absFilePath().toLatin1().constData(), RTLD_NOW); if (handle == 0) { fprintf(stderr, "DssiSynth::createSIF dlopen(%s) failed: %s\n", //info.filePath().toAscii().data(), dlerror()); - info.filePath().latin1(), dlerror()); - //info.absFilePath().latin1(), dlerror()); + info.filePath().toLatin1().constData(), dlerror()); + //info.absFilePath().toLatin1().constData(), dlerror()); return 0; } @@ -587,8 +587,8 @@ SynthIF* DssiSynth::createSIF(SynthI* synti) "library file \"%s\": %s.\n" "Are you sure this is a DSSI plugin file?\n", //info.filePath().toAscii().data(), - info.filePath().latin1(), - //info.absFilePath().latin1(), + info.filePath().toLatin1().constData(), + //info.absFilePath().toLatin1().constData(), txt ? txt : "?"); dlclose(handle); @@ -681,7 +681,7 @@ SynthIF* DssiSynth::createSIF(SynthI* synti) if (dssi == 0) { //fprintf(stderr, "cannot found DSSI synti %s\n", _name.toAscii().data()); - fprintf(stderr, "cannot find DSSI synti %s\n", _name.latin1()); + fprintf(stderr, "cannot find DSSI synti %s\n", _name.toLatin1().constData()); dlclose(handle); handle = 0; df = 0; @@ -698,8 +698,8 @@ SynthIF* DssiSynth::createSIF(SynthI* synti) // static char oscUrl[1024]; //snprintf(oscUrl, 1024, "%s/%s", url, synti->name().toAscii().data()); - //snprintf(oscUrl, 1024, "%s/%s", url, synti->name().latin1()); -// snprintf(oscUrl, 1024, "%s/%s/%s", url, info.baseName().latin1(), synti->name().latin1()); + //snprintf(oscUrl, 1024, "%s/%s", url, synti->name().toLatin1().constData()); +// snprintf(oscUrl, 1024, "%s/%s/%s", url, info.baseName().toLatin1().constData(), synti->name().toLatin1().constData()); //QString guiPath(info.path() + "/" + info.baseName()); QString guiPath(info.dirPath() + "/" + info.baseName()); QDir guiDir(guiPath, "*", QDir::Unsorted, QDir::Files); @@ -1019,7 +1019,7 @@ bool DssiSynthIF::init(DssiSynth* s) if(dssi->configure) { char *rv = dssi->configure(handle, DSSI_PROJECT_DIRECTORY_KEY, - museProject.latin1()); //song->projectPath() + museProject.toLatin1().constData()); //song->projectPath() if(rv) { @@ -2252,8 +2252,8 @@ bool DssiSynthIF::initGui() // static char oscUrl[1024]; //snprintf(oscUrl, 1024, "%s/%s", url, synti->name().toAscii().data()); - //snprintf(oscUrl, 1024, "%s/%s", url, synti->name().latin1()); - snprintf(oscUrl, 1024, "%s/%s/%s", url, synth->info.baseName().latin1(), synti->name().latin1()); + //snprintf(oscUrl, 1024, "%s/%s", url, synti->name().toLatin1().constData()); + snprintf(oscUrl, 1024, "%s/%s/%s", url, synth->info.baseName().toLatin1().constData(), synti->name().toLatin1().constData()); //QString guiPath(info.path() + "/" + info.baseName()); QString guiPath(synth->info.dirPath() + "/" + synth->info.baseName()); @@ -2277,7 +2277,7 @@ bool DssiSynthIF::initGui() struct stat buf; //if (stat(gui.toAscii().data(), &buf)) { - if (stat(gui.latin1(), &buf)) { + if (stat(gui.toLatin1().constData(), &buf)) { perror("stat failed"); continue; @@ -2287,15 +2287,15 @@ bool DssiSynthIF::initGui() fprintf(stderr, "DssiSynthIF::initGui %s %s %s %s\n", //fi.filePath().toAscii().data(), //fi.fileName().toAscii().data(), - fi.filePath().latin1(), - //fi.fileName().latin1(), + fi.filePath().toLatin1().constData(), + //fi.fileName().toLatin1().constData(), oscUrl, - synth->info.filePath().latin1(), + synth->info.filePath().toLatin1().constData(), //name().toAscii().data(), - synth->name().latin1()); + synth->name().toLatin1().constData()); #endif if ((S_ISREG(buf.st_mode) || S_ISLNK(buf.st_mode)) && @@ -2338,26 +2338,26 @@ bool DssiSynthIF::initGui() // execlp( // fi.filePath().toAscii().data(), // fi.fileName().toAscii().data(), - // fi.filePath().latin1(), - // fi.fileName().latin1(), + // fi.filePath().toLatin1().constData(), + // fi.fileName().toLatin1().constData(), // oscUrl, // info.filePath().toAscii().data(), // name().toAscii().data(), - // synth->info.filePath().latin1(), - // synth->name().latin1(), + // synth->info.filePath().toLatin1().constData(), + // synth->name().toLatin1().constData(), // "channel 1", (void*)0); fprintf(stderr, "exec %s %s %s %s failed: %s\n", // fi.filePath().toAscii().data(), // fi.fileName().toAscii().data(), - fi.filePath().latin1(), - fi.fileName().latin1(), + fi.filePath().toLatin1().constData(), + fi.fileName().toLatin1().constData(), oscUrl, // name().toAscii().data(), - synth->name().latin1(), + synth->name().toLatin1().constData(), strerror(errno)); // It's Ok, Keep going. So nothing happens. So what. The timeout in showGui will just leave. @@ -2377,7 +2377,7 @@ bool DssiSynthIF::initGui() else { printf("%s: no dir for dssi gui found: %s\n", //name().toAscii().data(), guiPath.toAscii().data()); - synth->name().latin1(), guiPath.latin1()); + synth->name().toLatin1().constData(), guiPath.toLatin1().constData()); //synth->_hasGui = false; } @@ -2426,7 +2426,7 @@ void DssiSynthIF::guiHeartBeat() int DssiSynthIF::oscUpdate() { // Send project directory. - _oscif.oscSendConfigure(DSSI_PROJECT_DIRECTORY_KEY, museProject.latin1()); // song->projectPath() + _oscif.oscSendConfigure(DSSI_PROJECT_DIRECTORY_KEY, museProject.toLatin1().constData()); // song->projectPath() // Send current string configuration parameters. //StringParamMap& map = synti->_stringParamMap; @@ -2771,7 +2771,7 @@ int DssiSynthIF::oscConfigure(const char *key, const char *value) // we don't bother remembering these at all. #ifdef DSSI_DEBUG - printf("DssiSynthIF::oscConfigure synth name:%s key:%s value:%s\n", synti->name().latin1(), key, value); + printf("DssiSynthIF::oscConfigure synth name:%s key:%s value:%s\n", synti->name().toLatin1().constData(), key, value); #endif // Add or modify the configuration map item. @@ -2781,7 +2781,7 @@ int DssiSynthIF::oscConfigure(const char *key, const char *value) strlen(DSSI_RESERVED_CONFIGURE_PREFIX))) { fprintf(stderr, "MusE: OSC: UI for plugin '%s' attempted to use reserved configure key \"%s\", ignoring\n", //synti->name().toAscii().data(), key); - synti->name().latin1(), key); + synti->name().toLatin1().constData(), key); return 0; } @@ -2793,7 +2793,7 @@ int DssiSynthIF::oscConfigure(const char *key, const char *value) if (message) { printf("MusE: on configure '%s' '%s', plugin '%s' returned error '%s'\n", //key, value, synti->name().toAscii().data(), message); - key, value, synti->name().latin1(), message); + key, value, synti->name().toLatin1().constData(), message); free(message); } diff --git a/muse2/muse/exportmidi.cpp b/muse2/muse/exportmidi.cpp index f1fc28f8..4aaf1f40 100644 --- a/muse2/muse/exportmidi.cpp +++ b/muse2/muse/exportmidi.cpp @@ -156,7 +156,8 @@ void MusE::exportMidi() // MarkerList* ml = song->marker(); for (ciMarker m = ml->begin(); m != ml->end(); ++m) { - const char* name = m->second.name().latin1(); + QByteArray ba = m->second.name().toLatin1(); + const char* name = ba.constData(); int len = strlen(name); MidiPlayEvent ev(m->first, port, ME_META, (unsigned char*)name, len); ev.setA(0x6); @@ -166,7 +167,8 @@ void MusE::exportMidi() //--------------------------------------------------- // Write Copyright // - const char* copyright = config.copyright.latin1(); + QByteArray ba = config.copyright.toLatin1(); + const char* copyright = ba.constData(); if (copyright && *copyright) { int len = strlen(copyright); MidiPlayEvent ev(0, port, ME_META, (unsigned char*)copyright, len); @@ -180,7 +182,7 @@ void MusE::exportMidi() QString comment = track->comment(); if (!comment.isEmpty()) { int len = comment.length(); - MidiPlayEvent ev(0, port, ME_META, (const unsigned char*)(comment.latin1()), len); + MidiPlayEvent ev(0, port, ME_META, (const unsigned char*)(comment.toLatin1().constData()), len); ev.setA(0x1); l->add(ev); } @@ -265,7 +267,8 @@ void MusE::exportMidi() //----------------------------------- if (!track->name().isEmpty()) { - const char* name = track->name().latin1(); + QByteArray ba = track->name().toLatin1(); + const char* name = ba.constData(); int len = strlen(name); MidiPlayEvent ev(0, port, ME_META, (unsigned char*)name, len+1); ev.setA(0x3); // Meta Sequence/Track Name @@ -277,7 +280,8 @@ void MusE::exportMidi() //----------------------------------- if (!track->comment().isEmpty()) { - const char* comment = track->comment().latin1(); + QByteArray ba = track->comment().toLatin1(); + const char* comment = ba.constData(); int len = strlen(comment); MidiPlayEvent ev(0, port, ME_META, (unsigned char*)comment, len+1); ev.setA(0xf); // Meta Text diff --git a/muse2/muse/help.cpp b/muse2/muse/help.cpp index f0d7b666..268449e6 100644 --- a/muse2/muse/help.cpp +++ b/muse2/muse/help.cpp @@ -26,9 +26,9 @@ void MusE::startHelpBrowser() { QString lang(getenv("LANG")); QString museHelp = museGlobalShare + QString("/html/index_") + lang + QString(".html"); - if (access(museHelp.latin1(), R_OK) != 0) { + if (access(museHelp.toLatin1(), R_OK) != 0) { museHelp = museGlobalShare + QString("/html/index.html"); - if (access(museHelp.latin1(), R_OK) != 0) { + if (access(museHelp.toLatin1(), R_OK) != 0) { QString info(tr("no help found at: ")); info += museHelp; QMessageBox::critical(this, tr("MusE: Open Help"), info); @@ -84,7 +84,7 @@ void MusE::launchBrowser(QString &whereTo) { char testStr[40]; strcpy(testStr, "which "); - strcat(testStr, config.helpBrowser.latin1()); + strcat(testStr, config.helpBrowser.toLatin1()); if (config.helpBrowser == "" || system(testStr)) { QMessageBox::information( this, "Unable to launch help", diff --git a/muse2/muse/importmidi.cpp b/muse2/muse/importmidi.cpp index e844bb43..b9449971 100644 --- a/muse2/muse/importmidi.cpp +++ b/muse2/muse/importmidi.cpp @@ -427,7 +427,7 @@ void MusE::importController(int channel, MidiPort* mport, int n) } if (ctrl == 0) { printf("controller 0x%x not defined for instrument %s, channel %d\n", - n, instr->iname().latin1(), channel); + n, instr->iname().toLatin1().constData(), channel); // TODO: register default Controller // MidiController* MidiPort::midiController(int num) const } @@ -524,7 +524,7 @@ void MusE::importPartToTrack(QString& filename, unsigned tick, Track* track) } else { - printf("Unknown tag: %s\n", tag.latin1()); + printf("Unknown tag: %s\n", tag.toLatin1().constData()); } fclose(fp); } diff --git a/muse2/muse/instruments/editinstrument.cpp b/muse2/muse/instruments/editinstrument.cpp index d210b528..486acbcc 100644 --- a/muse2/muse/instruments/editinstrument.cpp +++ b/muse2/muse/instruments/editinstrument.cpp @@ -269,8 +269,8 @@ void EditInstrument::fileSave() //QFile f(instrument->filePath()); //if (!f.open(QIODevice::WriteOnly)) { - //FILE* f = fopen(instrument->filePath().latin1(), "w"); - FILE* f = fopen(workingInstrument.filePath().latin1(), "w"); + //FILE* f = fopen(instrument->filePath().toLatin1().constData(), "w"); + FILE* f = fopen(workingInstrument.filePath().toLatin1().constData(), "w"); if(f == 0) { //fileSaveAs(); @@ -321,7 +321,7 @@ bool EditInstrument::fileSave(MidiInstrument* instrument, const QString& name) if(f == 0) { //if(debugMsg) - // printf("READ IDF %s\n", fi->filePath().latin1()); + // printf("READ IDF %s\n", fi->filePath().toLatin1().constData()); QString s("Creating file failed: "); s += QString(strerror(errno)); QMessageBox::critical(this, @@ -398,10 +398,10 @@ void EditInstrument::saveAs() Qt::NoButton) == QMessageBox::Ok) { if(QDir().mkdir(museUserInstruments)) - printf("Created user instrument directory: %s\n", museUserInstruments.latin1()); + printf("Created user instrument directory: %s\n", museUserInstruments.toLatin1().constData()); else { - printf("Unable to create user instrument directory: %s\n", museUserInstruments.latin1()); + printf("Unable to create user instrument directory: %s\n", museUserInstruments.toLatin1().constData()); QMessageBox::critical(this, tr("MusE:"), tr("Unable to create user instrument directory\n") + museUserInstruments); //return; path = museUser; @@ -437,7 +437,7 @@ void EditInstrument::saveAs() // QMessageBox::Ok, // QMessageBox::NoButton, // QMessageBox::NoButton); - printf("EditInstrument::saveAs Error: Instrument name %s already used!\n", workingInstrument.iname().latin1()); + printf("EditInstrument::saveAs Error: Instrument name %s already used!\n", workingInstrument.iname().toLatin1().constData()); return; } } @@ -451,7 +451,7 @@ void EditInstrument::saveAs() // tr("Instrument Definition (*.idf)")); QString s = QFileDialog::getSaveFileName(path, tr("Instrument Definition (*.idf)"), this, - tr("MusE: Save Instrument Definition").latin1()); + tr("MusE: Save Instrument Definition").toLatin1().constData()); if (s.isEmpty()) return; //instrument->setFilePath(s); @@ -690,10 +690,10 @@ void EditInstrument::fileSaveAs() Qt::NoButton) == QMessageBox::Ok) { if(QDir().mkdir(museUserInstruments)) - printf("Created user instrument directory: %s\n", museUserInstruments.latin1()); + printf("Created user instrument directory: %s\n", museUserInstruments.toLatin1().constData()); else { - printf("Unable to create user instrument directory: %s\n", museUserInstruments.latin1()); + printf("Unable to create user instrument directory: %s\n", museUserInstruments.toLatin1().constData()); QMessageBox::critical(this, tr("MusE:"), tr("Unable to create user instrument directory\n") + museUserInstruments); //return; path = museUser; @@ -717,7 +717,7 @@ void EditInstrument::fileSaveAs() else { sfn = QFileDialog::getSaveFileName(path, tr("Instrument Definition (*.idf)"), this, - tr("MusE: Save Instrument Definition").latin1()); + tr("MusE: Save Instrument Definition").toLatin1().constData()); if (sfn.isEmpty()) return; //instrument->setFilePath(s); @@ -1042,7 +1042,7 @@ void EditInstrument::instrumentChanged() if(!sel) return; - //printf("instrument changed: %s\n", sel->text().latin1()); + //printf("instrument changed: %s\n", sel->text().toLatin1().constData()); //if (old) { //if(oldMidiInstrument) @@ -2478,7 +2478,7 @@ void EditInstrument::deletePatchClicked() for(iPatchGroup ipg = pg->begin(); ipg != pg->end(); ++ipg) { - //printf("deletePatchClicked: working patch group name:%s ad:%X group name:%s ad:%X\n", (*ipg)->name.latin1(), (unsigned int)(*ipg), group->name.latin1(), (unsigned int) group); + //printf("deletePatchClicked: working patch group name:%s ad:%X group name:%s ad:%X\n", (*ipg)->name.toLatin1().constData(), (unsigned int)(*ipg), group->name.toLatin1().constData(), (unsigned int) group); //if(&*ipg == group) if(*ipg == group) @@ -3069,7 +3069,7 @@ void EditInstrument::addControllerClicked() } if(lnum == -1) { - printf("Add controller: Controller not found: %s\n", name.latin1()); + printf("Add controller: Controller not found: %s\n", name.toLatin1().constData()); return; } @@ -3304,7 +3304,7 @@ void EditInstrument::updateController(MidiInstrument* instrument, MidiController if (ctrlName->text() != oc->name()) { oc->setName(ctrlName->text()); - printf("updateController: name changed, setting dirty. name:%s c->name:%s\n", ctrlName->text().latin1(), oc->name().latin1()); + printf("updateController: name changed, setting dirty. name:%s c->name:%s\n", ctrlName->text().toLatin1().constData(), oc->name().toLatin1().constData()); instrument->setDirty(true); } @@ -3396,7 +3396,7 @@ int EditInstrument::checkDirty(MidiInstrument* i, bool isClose) else { //QFile f(i->filePath()); //if (!f.open(QIODevice::WriteOnly)) - FILE* f = fopen(i->filePath().latin1(), "w"); + FILE* f = fopen(i->filePath().toLatin1().constData(), "w"); if(f == 0) //fileSaveAs(); saveAs(); @@ -3568,7 +3568,7 @@ const char* EditInstrument::getPatchName(int prog) //&& (lbank == mp->lbank || !lb || mp->lbank == -1)) && (hbank == mp->hbank || mp->hbank == -1) && (lbank == mp->lbank || mp->lbank == -1)) - return mp->name.latin1(); + return mp->name.toLatin1().constData(); } } return "---"; diff --git a/muse2/muse/instruments/midictrledit.cpp b/muse2/muse/instruments/midictrledit.cpp index 6577b65f..9a7dee3e 100644 --- a/muse2/muse/instruments/midictrledit.cpp +++ b/muse2/muse/instruments/midictrledit.cpp @@ -178,7 +178,7 @@ void MidiControllerEditDialog::updateMidiPortsList() MidiDevice* dev = port->device(); QString name; name.sprintf("%d(%s)", port->portno()+1, - dev ? dev->name().latin1() : "none"); + dev ? dev->name().toLatin1() : "none"); midiPortsList->insertItem(name, i); } _lastPort = midiPortsList->currentItem(); diff --git a/muse2/muse/instruments/minstrument.cpp b/muse2/muse/instruments/minstrument.cpp index 4f0dcc3a..b784f2be 100644 --- a/muse2/muse/instruments/minstrument.cpp +++ b/muse2/muse/instruments/minstrument.cpp @@ -32,7 +32,8 @@ static const char* gmdrumname = "GM-drums"; int string2sysex(const QString& s, unsigned char** data) { - const char* src = s.toLatin1().data(); + QByteArray ba = s.toLatin1(); + const char* src = ba.constData(); char buffer[2048]; char* dst = buffer; @@ -130,7 +131,7 @@ static void loadIDF(QFileInfo* fi) /* QFile qf(fi->filePath()); if (!qf.open(IO_ReadOnly)) { - printf("cannot open file %s\n", fi->fileName().latin1()); + printf("cannot open file %s\n", fi->fileName().toLatin1()); return; } if (debugMsg) @@ -144,7 +145,7 @@ static void loadIDF(QFileInfo* fi) ln.setNum(line); error = err + " at line: " + ln + " col: " + col; printf("error reading file <%s>:\n %s\n", - fi->filePath().latin1(), error.latin1()); + fi->filePath().toLatin1(), error.toLatin1()); return; } QDomNode node = doc.documentElement(); @@ -177,7 +178,7 @@ static void loadIDF(QFileInfo* fi) } } else - printf("MusE:laodIDF: %s not supported\n", e.tagName().latin1()); + printf("MusE:laodIDF: %s not supported\n", e.tagName().toLatin1()); node = node.nextSibling(); } qf.close(); @@ -187,7 +188,7 @@ static void loadIDF(QFileInfo* fi) if (f == 0) return; if (debugMsg) - printf("READ IDF %s\n", fi->filePath().toLatin1().data()); + printf("READ IDF %s\n", fi->filePath().toLatin1().constData()); Xml xml(f); bool skipmode = true; @@ -246,7 +247,7 @@ void initMidiInstruments() genericMidiInstrument = new MidiInstrument(QWidget::tr("generic midi")); midiInstruments.push_back(genericMidiInstrument); if (debugMsg) - printf("load user instrument definitions from <%s>\n", museUserInstruments.toLatin1().data()); + printf("load user instrument definitions from <%s>\n", museUserInstruments.toLatin1().constData()); QDir usrInstrumentsDir(museUserInstruments, QString("*.idf")); if (usrInstrumentsDir.exists()) { QFileInfoList list = usrInstrumentsDir.entryInfoList(); @@ -259,13 +260,13 @@ void initMidiInstruments() //else //{ // if(usrInstrumentsDir.mkdir(museUserInstruments)) - // printf("Created user instrument directory: %s\n", museUserInstruments.latin1()); + // printf("Created user instrument directory: %s\n", museUserInstruments.toLatin1()); // else - // printf("Unable to create user instrument directory: %s\n", museUserInstruments.latin1()); + // printf("Unable to create user instrument directory: %s\n", museUserInstruments.toLatin1()); //} if (debugMsg) - printf("load instrument definitions from <%s>\n", museInstruments.toLatin1().data()); + printf("load instrument definitions from <%s>\n", museInstruments.toLatin1().constData()); QDir instrumentsDir(museInstruments, QString("*.idf")); if (instrumentsDir.exists()) { QFileInfoList list = instrumentsDir.entryInfoList(); @@ -276,7 +277,7 @@ void initMidiInstruments() } } else - printf("Instrument directory not found: %s\n", museInstruments.toLatin1().data()); + printf("Instrument directory not found: %s\n", museInstruments.toLatin1().constData()); } @@ -614,7 +615,7 @@ void Patch::write(int level, Xml& xml) // s += QString(" mode=\"%d\"").arg(typ); //s += QString(" hbank=\"%1\" lbank=\"%2\" prog=\"%3\"").arg(hbank).arg(lbank).arg(prog); //xml.tagE(s); - xml.nput(level, "<Patch name=\"%s\"", Xml::xmlString(name).toLatin1().data()); + xml.nput(level, "<Patch name=\"%s\"", Xml::xmlString(name).toLatin1().constData()); if(typ != -1) xml.nput(" mode=\"%d\"", typ); @@ -716,7 +717,8 @@ void MidiInstrument::read(Xml& xml) else if (tag == "InitScript") { if (_initScript) delete _initScript; - const char* istr = xml.parse1().toLatin1().data(); + QByteArray ba = xml.parse1().toLatin1(); + const char* istr = ba.constData(); int len = strlen(istr) +1; if (len > 1) { _initScript = new char[len]; @@ -754,14 +756,14 @@ void MidiInstrument::write(int level, Xml& xml) xml.tag(level, "muse version=\"1.0\""); //xml.stag(QString("MidiInstrument name=\"%1\"").arg(Xml::xmlString(iname()))); level++; - //xml.tag(level, "MidiInstrument name=\"%s\"", Xml::xmlString(iname()).toLatin1().data()); - xml.nput(level, "<MidiInstrument name=\"%s\"", Xml::xmlString(iname()).toLatin1().data()); + //xml.tag(level, "MidiInstrument name=\"%s\"", Xml::xmlString(iname()).toLatin1().constData()); + xml.nput(level, "<MidiInstrument name=\"%s\"", Xml::xmlString(iname()).toLatin1().constData()); if(_nullvalue != -1) { QString nv; nv.setNum(_nullvalue); - xml.nput(" nullparam=\"%s\"", nv.toLatin1().data()); + xml.nput(" nullparam=\"%s\"", nv.toLatin1().constData()); } xml.put(">"); @@ -777,8 +779,8 @@ void MidiInstrument::write(int level, Xml& xml) PatchGroup* pgp = *g; const PatchList& pl = pgp->patches; //xml.stag(QString("PatchGroup name=\"%1\"").arg(Xml::xmlString(g->name))); - //xml.tag(level, "PatchGroup name=\"%s\"", Xml::xmlString(g->name).toLatin1().data()); - xml.tag(level, "PatchGroup name=\"%s\"", Xml::xmlString(pgp->name).toLatin1().data()); + //xml.tag(level, "PatchGroup name=\"%s\"", Xml::xmlString(g->name).toLatin1().constData()); + xml.tag(level, "PatchGroup name=\"%s\"", Xml::xmlString(pgp->name).toLatin1().constData()); level++; //for (iPatch p = g->patches.begin(); p != g->patches.end(); ++p) for (ciPatch p = pl.begin(); p != pl.end(); ++p) @@ -847,7 +849,7 @@ const char* MidiInstrument::getPatchName(int channel, int prog, MType mode, bool && (hbank == mp->hbank || !hb || mp->hbank == -1) && (lbank == mp->lbank || !lb || mp->lbank == -1)) - return mp->name.toLatin1().data(); + return mp->name.toLatin1().constData(); } } return "<unknown>"; diff --git a/muse2/muse/liste/editevent.cpp b/muse2/muse/liste/editevent.cpp index 73c8f790..9eff979b 100644 --- a/muse2/muse/liste/editevent.cpp +++ b/muse2/muse/liste/editevent.cpp @@ -270,7 +270,8 @@ Event EditSysexDialog::event() void EditSysexDialog::accept() { QString qsrc = edit->text(); - const char* src = qsrc.latin1(); + QByteArray ba = qsrc.toLatin1(); + const char* src = ba.constData(); sysex = (unsigned char*)hex2string(this, src, len); if (sysex) @@ -352,7 +353,8 @@ void EditMetaDialog::typeChanged(int val) void EditMetaDialog::toggled(bool flag) { QString qsrc = edit->text(); - const char* src = qsrc.latin1(); + QByteArray ba = qsrc.toLatin1(); + const char* src = ba.constData(); edit->clear(); QString dst; @@ -396,7 +398,8 @@ Event EditMetaDialog::event() void EditMetaDialog::accept() { QString qsrc = edit->text(); - const char* src = qsrc.latin1(); + QByteArray ba = qsrc.toLatin1(); + const char* src = ba.constData(); if (!hexButton->isChecked()) { meta = (unsigned char*)strdup(src); len = strlen(src); @@ -775,7 +778,7 @@ void EditCtrlDialog::ctrlListClicked(QListWidgetItem* item) } } if (i == cll->end()) - printf("controller %s not found!\n", s.latin1()); + printf("controller %s not found!\n", s.toLatin1().constData()); } //--------------------------------------------------------- diff --git a/muse2/muse/marker/marker.cpp b/muse2/muse/marker/marker.cpp index eee0be02..e34e03dd 100644 --- a/muse2/muse/marker/marker.cpp +++ b/muse2/muse/marker/marker.cpp @@ -67,8 +67,8 @@ void MarkerList::write(int level, Xml& xml) const for (ciMarker i = begin(); i != end(); ++i) { const Marker& m = i->second; xml.put(level, "<marker tick=\"%d\" lock=\"%d\" name=\"%s\" />", - //m.tick(), m.type()==Pos::FRAMES, m.name().latin1()); - m.tick(), m.type()==Pos::FRAMES, Xml::xmlString(m.name()).latin1()); + //m.tick(), m.type()==Pos::FRAMES, m.name().toLatin1().constData()); + m.tick(), m.type()==Pos::FRAMES, Xml::xmlString(m.name()).toLatin1().constData()); } } diff --git a/muse2/muse/midictrl.cpp b/muse2/muse/midictrl.cpp index 3994fe90..570e3bf9 100644 --- a/muse2/muse/midictrl.cpp +++ b/muse2/muse/midictrl.cpp @@ -333,9 +333,9 @@ void MidiController::write(int level, Xml& xml) const else sl.setNum(l); - xml.nput(level, "<Controller name=\"%s\"", Xml::xmlString(_name).latin1()); + xml.nput(level, "<Controller name=\"%s\"", Xml::xmlString(_name).toLatin1().constData()); if(t != Controller7) - xml.nput(" type=\"%s\"", type.latin1()); + xml.nput(" type=\"%s\"", type.toLatin1().constData()); int mn = 0; int mx = 0; @@ -344,18 +344,18 @@ void MidiController::write(int level, Xml& xml) const case RPN: case NRPN: xml.nput(" h=\"%d\"", h); - xml.nput(" l=\"%s\"", sl.latin1()); + xml.nput(" l=\"%s\"", sl.toLatin1().constData()); mx = 127; break; case Controller7: - xml.nput(" l=\"%s\"", sl.latin1()); + xml.nput(" l=\"%s\"", sl.toLatin1().constData()); mx = 127; break; case Controller14: case RPN14: case NRPN14: xml.nput(" h=\"%d\"", h); - xml.nput(" l=\"%s\"", sl.latin1()); + xml.nput(" l=\"%s\"", sl.toLatin1().constData()); mx = 16383; break; case Pitch: diff --git a/muse2/muse/midiedit/dcanvas.cpp b/muse2/muse/midiedit/dcanvas.cpp index 3c2895d6..a8c133e4 100644 --- a/muse2/muse/midiedit/dcanvas.cpp +++ b/muse2/muse/midiedit/dcanvas.cpp @@ -341,7 +341,7 @@ bool DrumCanvas::moveItem(CItem* item, const QPoint& pos, DragType dtype) // Added by T356. if(((int)newEvent.endTick() - (int)part->lenTick()) > 0) - printf("DrumCanvas::moveItem Error! New event end:%d exceeds length:%d of part:%s\n", newEvent.endTick(), part->lenTick(), part->name().latin1()); + printf("DrumCanvas::moveItem Error! New event end:%d exceeds length:%d of part:%s\n", newEvent.endTick(), part->lenTick(), part->name().toLatin1().constData()); if (dtype == MOVE_COPY || dtype == MOVE_CLONE) { // Indicate no undo, and do not do port controller values and clone parts. @@ -896,7 +896,8 @@ void DrumCanvas::copy() int DrumCanvas::pasteAt(const QString& pt, int pos) { - const char* p = pt.latin1(); + QByteArray ba = pt.toLatin1(); + const char* p = ba.constData(); Xml xml(p); // Added by T356. diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index 43227810..3c9e4ecd 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -1199,7 +1199,7 @@ void DrumEdit::execDeliveredScript(int id) { //QString scriptfile = QString(INSTPREFIX) + SCRIPTSSUFFIX + deliveredScriptNames[id]; QString scriptfile = song->getScriptPath(id, true); - song->executeScript(scriptfile.toLatin1().data(), parts(), quant(), true); + song->executeScript(scriptfile.toLatin1().constData(), parts(), quant(), true); } //--------------------------------------------------------- @@ -1208,6 +1208,6 @@ void DrumEdit::execDeliveredScript(int id) void DrumEdit::execUserScript(int id) { QString scriptfile = song->getScriptPath(id, false); - song->executeScript(scriptfile.toLatin1().data(), parts(), quant(), true); + song->executeScript(scriptfile.toLatin1().constData(), parts(), quant(), true); } diff --git a/muse2/muse/midiedit/ecanvas.cpp b/muse2/muse/midiedit/ecanvas.cpp index 85801336..94a7d0c8 100644 --- a/muse2/muse/midiedit/ecanvas.cpp +++ b/muse2/muse/midiedit/ecanvas.cpp @@ -454,7 +454,7 @@ QMimeData* EventCanvas::getTextDrag() void EventCanvas::pasteAt(const QString& pt, int pos) { - const char* p = pt.latin1(); + const char* p = pt.toLatin1(); Xml xml(p); for (;;) { Xml::Token token = xml.parse(); diff --git a/muse2/muse/midiedit/prcanvas.cpp b/muse2/muse/midiedit/prcanvas.cpp index d5d9786c..279ed6bb 100644 --- a/muse2/muse/midiedit/prcanvas.cpp +++ b/muse2/muse/midiedit/prcanvas.cpp @@ -507,7 +507,7 @@ bool PianoCanvas::moveItem(CItem* item, const QPoint& pos, DragType dtype) // Added by T356. if(((int)newEvent.endTick() - (int)part->lenTick()) > 0) - printf("PianoCanvas::moveItem Error! New event end:%d exceeds length:%d of part:%s\n", newEvent.endTick(), part->lenTick(), part->name().latin1()); + printf("PianoCanvas::moveItem Error! New event end:%d exceeds length:%d of part:%s\n", newEvent.endTick(), part->lenTick(), part->name().toLatin1().constData()); if (dtype == MOVE_COPY || dtype == MOVE_CLONE) // Indicate no undo, and do not do port controller values and clone parts. @@ -1411,7 +1411,8 @@ void PianoCanvas::copy() void PianoCanvas::pasteAt(const QString& pt, int pos) { - const char* p = pt.latin1(); + QByteArray ba = pt.toLatin1(); + const char* p = ba.constData(); Xml xml(p); for (;;) { Xml::Token token = xml.parse(); diff --git a/muse2/muse/midievent.cpp b/muse2/muse/midievent.cpp index 8f2b0756..861a17f0 100644 --- a/muse2/muse/midievent.cpp +++ b/muse2/muse/midievent.cpp @@ -137,7 +137,7 @@ void MidiEventBase::read(Xml& xml) break; case Xml::Text: { - const char*s = tag.latin1(); + const char*s = tag.toLatin1(); edata.data = new unsigned char[dataLen]; edata.dataLen = dataLen; unsigned char* d = edata.data; diff --git a/muse2/muse/midiport.cpp b/muse2/muse/midiport.cpp index 0f593fd4..ee09ba31 100644 --- a/muse2/muse/midiport.cpp +++ b/muse2/muse/midiport.cpp @@ -265,7 +265,7 @@ QMenu* midiPortsPopup(QWidget* parent, int checkPort) for (int i = 0; i < MIDI_PORTS; ++i) { MidiPort* port = &midiPorts[i]; QString name; - name.sprintf("%d:%s", port->portno()+1, port->portname().latin1()); + name.sprintf("%d:%s", port->portno()+1, port->portname().toLatin1().constData()); QAction *act = p->addAction(name); act->setData(i); diff --git a/muse2/muse/midiseq.cpp b/muse2/muse/midiseq.cpp index 7d7dedef..e6ac2073 100644 --- a/muse2/muse/midiseq.cpp +++ b/muse2/muse/midiseq.cpp @@ -392,13 +392,13 @@ void MidiSeq::updatePollFd() //&& (dev->syncInfo().MCIn()))) { && (midiPorts[port].syncInfo().MCIn()))) { if(dev->selectRfd() < 0){ - //fprintf(stderr, "WARNING: read-file-descriptor for {%s} is negative\n", name.latin1()); + //fprintf(stderr, "WARNING: read-file-descriptor for {%s} is negative\n", name.toLatin1()); } addPollFd(dev->selectRfd(), POLLIN, ::midiRead, this, dev); } if (dev->bytesToWrite()){ if(dev->selectWfd() < 0){ - //fprintf(stderr, "WARNING: write-file-descriptor for {%s} is negative\n", name.latin1()); + //fprintf(stderr, "WARNING: write-file-descriptor for {%s} is negative\n", name.toLatin1()); } addPollFd(dev->selectWfd(), POLLOUT, ::midiWrite, this, dev); } diff --git a/muse2/muse/mixer/amixer.cpp b/muse2/muse/mixer/amixer.cpp index 1848b9fd..a9345b8a 100644 --- a/muse2/muse/mixer/amixer.cpp +++ b/muse2/muse/mixer/amixer.cpp @@ -677,7 +677,7 @@ void AudioMixerApp::write(int level, Xml& xml) //void AudioMixerApp::write(int level, Xml& xml, const char* name) { //xml.stag(QString(name)); - //xml.tag(level++, name.latin1()); + //xml.tag(level++, name.toLatin1()); xml.tag(level++, "Mixer"); xml.strTag(level, "name", cfg->name); @@ -695,7 +695,7 @@ void AudioMixerApp::write(int level, Xml& xml) xml.intTag(level, "showSyntiTracks", cfg->showSyntiTracks); //xml.etag(name); - //xml.etag(level, name.latin1()); + //xml.etag(level, name.toLatin1()); xml.etag(level, "Mixer"); } diff --git a/muse2/muse/mixer/astrip.cpp b/muse2/muse/mixer/astrip.cpp index 58cf870f..1c206712 100644 --- a/muse2/muse/mixer/astrip.cpp +++ b/muse2/muse/mixer/astrip.cpp @@ -1148,9 +1148,9 @@ static int addSyntiPorts(AudioTrack* t, PopupMenu* lb, int id, { char buffer[128]; if(tchans == 2) - snprintf(buffer, 128, "%s %d,%d", chpup->tr("Channel").latin1(), ch+1, ch+2); + snprintf(buffer, 128, "%s %d,%d", chpup->tr("Channel").toLatin1().constData(), ch+1, ch+2); else - snprintf(buffer, 128, "%s %d", chpup->tr("Channel").latin1(), ch+1); + snprintf(buffer, 128, "%s %d", chpup->tr("Channel").toLatin1().constData(), ch+1); act = chpup->addAction(QString(buffer)); act->setData(id); act->setCheckable(true); @@ -1281,7 +1281,7 @@ static int addMultiChannelPorts(AudioTrack* t, PopupMenu* pup, int id, RouteMenu if(chans > 1) { char buffer[128]; - snprintf(buffer, 128, "%s %d", pup->tr("Channel").latin1(), ch+1); + snprintf(buffer, 128, "%s %d", pup->tr("Channel").toLatin1().constData(), ch+1); chpup->setTitle(QString(buffer)); pup->addMenu(chpup); } @@ -1362,7 +1362,7 @@ static int addMultiChannelPorts(AudioTrack* t, PopupMenu* pup, int id, RouteMenu if(chans > 2) { char buffer[128]; - snprintf(buffer, 128, "%s %d,%d", pup->tr("Channel").latin1(), ch+1, ch+2); + snprintf(buffer, 128, "%s %d,%d", pup->tr("Channel").toLatin1().constData(), ch+1, ch+2); chpup->setTitle(QString(buffer)); pup->addMenu(chpup); } @@ -1419,7 +1419,7 @@ static int nonSyntiTrackAddSyntis(AudioTrack* t, PopupMenu* lb, int id, RouteMen for(int ch = 0; ch < chans; ++ch) { char buffer[128]; - snprintf(buffer, 128, "%s %d", chpup->tr("Channel").latin1(), ch+1); + snprintf(buffer, 128, "%s %d", chpup->tr("Channel").toLatin1().constData(), ch+1); act = chpup->addAction(QString(buffer)); act->setData(id); act->setCheckable(true); @@ -1473,7 +1473,7 @@ static int nonSyntiTrackAddSyntis(AudioTrack* t, PopupMenu* lb, int id, RouteMen for(int ch = 0; ch < chans; ++ch) { char buffer[128]; - snprintf(buffer, 128, "%s %d,%d", chpup->tr("Channel").latin1(), ch+1, ch+2); + snprintf(buffer, 128, "%s %d,%d", chpup->tr("Channel").toLatin1().constData(), ch+1, ch+2); act = chpup->addAction(QString(buffer)); act->setData(id); act->setCheckable(true); @@ -1558,7 +1558,7 @@ void AudioStrip::iRoutePressed() for(int i = 0; i < channel; ++i) { char buffer[128]; - snprintf(buffer, 128, "%s %d", tr("Channel").latin1(), i+1); + snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), i+1); MenuTitleItem* titel = new MenuTitleItem(QString(buffer), pup); pup->addAction(titel); @@ -1811,7 +1811,7 @@ void AudioStrip::oRoutePressed() for(int i = 0; i < channel; ++i) { char buffer[128]; - snprintf(buffer, 128, "%s %d", tr("Channel").latin1(), i+1); + snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), i+1); MenuTitleItem* titel = new MenuTitleItem(QString(buffer), pup); pup->addAction(titel); diff --git a/muse2/muse/mixer/rack.cpp b/muse2/muse/mixer/rack.cpp index 16e76258..b979b420 100644 --- a/muse2/muse/mixer/rack.cpp +++ b/muse2/muse/mixer/rack.cpp @@ -146,7 +146,7 @@ void EffectRack::choosePlugin(QListWidgetItem* it, bool replace) PluginI* plugi = new PluginI(); if (plugi->initPluginInstance(plugin, track->channels())) { printf("cannot instantiate plugin <%s>\n", - plugin->name().latin1()); + plugin->name().toLatin1().constData()); delete plugi; return; } @@ -396,7 +396,7 @@ void EffectRack::startDrag(int idx) QString xmlconf; xml.dump(xmlconf); - QByteArray data(xmlconf.toLatin1().data()); + QByteArray data(xmlconf.toLatin1().constData()); QMimeData* md = new QMimeData(); md->setData("text/x-muse-plugin", data); @@ -510,7 +510,7 @@ void EffectRack::mousePressEvent(QMouseEvent *event) void EffectRack::mouseMoveEvent(QMouseEvent *event) { - if (event->state() & Qt::LeftButton) { + if (event->buttons() & Qt::LeftButton) { Pipeline* pipe = track->efxPipe(); if(!pipe) return; diff --git a/muse2/muse/mpevent.cpp b/muse2/muse/mpevent.cpp index 2b7ce5eb..9988c12b 100644 --- a/muse2/muse/mpevent.cpp +++ b/muse2/muse/mpevent.cpp @@ -74,7 +74,7 @@ void MEvent::dump() const printf("time:%d port:%d chan:%d ", _time, _port, _channel+1); if (_type == 0x90) { // NoteOn QString s = pitch2string(_a); - printf("NoteOn %s(0x%x) %d\n", s.latin1(), _a, _b); + printf("NoteOn %s(0x%x) %d\n", s.toLatin1().constData(), _a, _b); } else if (_type == 0xf0) { printf("SysEx len %d 0x%0x ...\n", len(), data()[0]); diff --git a/muse2/muse/mplugins/midiitransform.cpp b/muse2/muse/mplugins/midiitransform.cpp index 22f3630f..386620b1 100644 --- a/muse2/muse/mplugins/midiitransform.cpp +++ b/muse2/muse/mplugins/midiitransform.cpp @@ -900,7 +900,7 @@ void readMidiInputTransform(Xml& xml) case Xml::TagEnd: if (xml.s1() == "midiInputTransform") { // printf("midi Input transform <%s> apply %d\n", -// trans.name.latin1(), apply); +// trans.name.toLatin1().constData(), apply); // By T356. A previous bug caused some .med files to grow very large // with duplicate transforms. Here we can eliminate those duplicates. @@ -1616,7 +1616,7 @@ void MidiInputTransformDialog::presetChanged(QListWidgetItem* item) for (i = mtlist.begin(); i != mtlist.end(); ++i) { if (item->text() == (*i)->name) { if(debugMsg) - printf("found %s\n", (*i)->name.latin1()); + printf("found %s\n", (*i)->name.toLatin1().constData()); cmt = *i; if (cmodul != -1) { modules[cmodul].transform = *i; diff --git a/muse2/muse/node.cpp b/muse2/muse/node.cpp index 47fbf1f2..8db0a3d3 100644 --- a/muse2/muse/node.cpp +++ b/muse2/muse/node.cpp @@ -298,7 +298,7 @@ void AudioTrack::copyData(unsigned pos, int dstChannels, int srcStartChan, int s srcTotalOutChans = 1; #ifdef NODE_DEBUG - printf("MusE: AudioTrack::copyData name:%s processed:%d\n", name().latin1(), processed()); + printf("MusE: AudioTrack::copyData name:%s processed:%d\n", name().toLatin1().constData(), processed()); #endif // Special consideration for metronome: It is not part of the track list, @@ -385,7 +385,7 @@ void AudioTrack::copyData(unsigned pos, int dstChannels, int srcStartChan, int s if(off() || !getData(pos, srcTotalOutChans, nframes, buffer) || (isMute() && !_prefader)) { #ifdef NODE_DEBUG - printf("MusE: AudioTrack::copyData name:%s dstChannels:%d zeroing buffers\n", name().latin1(), dstChannels); + printf("MusE: AudioTrack::copyData name:%s dstChannels:%d zeroing buffers\n", name().toLatin1().constData(), dstChannels); #endif // No data was available. Zero the supplied buffers. @@ -430,7 +430,7 @@ void AudioTrack::copyData(unsigned pos, int dstChannels, int srcStartChan, int s //--------------------------------------------------- // p3.3.41 - //fprintf(stderr, "AudioTrack::copyData %s efx apply srcChans:%d\n", name().latin1(), srcChans); + //fprintf(stderr, "AudioTrack::copyData %s efx apply srcChans:%d\n", name().toLatin1().constData(), srcChans); _efxPipe->apply(srcChans, nframes, buffer); //--------------------------------------------------- @@ -707,7 +707,7 @@ void AudioTrack::addData(unsigned pos, int dstChannels, int srcStartChan, int sr //Added by Tim. p3.3.16 #ifdef NODE_DEBUG - printf("MusE: AudioTrack::addData name:%s processed:%d\n", name().latin1(), processed()); + printf("MusE: AudioTrack::addData name:%s processed:%d\n", name().toLatin1().constData(), processed()); #endif if (off()) @@ -842,7 +842,7 @@ void AudioTrack::addData(unsigned pos, int dstChannels, int srcStartChan, int sr // p3.3.41 //fprintf(stderr, "AudioTrack::addData %s efx apply srcChans:%d nframes:%ld %e %e %e %e\n", - // name().latin1(), srcChans, nframes, buffer[0][0], buffer[0][1], buffer[0][2], buffer[0][3]); + // name().toLatin1().constData(), srcChans, nframes, buffer[0][0], buffer[0][1], buffer[0][2], buffer[0][3]); _efxPipe->apply(srcChans, nframes, buffer); // p3.3.41 //fprintf(stderr, "AudioTrack::addData after efx: %e %e %e %e\n", @@ -1167,7 +1167,7 @@ void AudioTrack::readRecfile(Xml& xml) recFile()->setFormat(format, channels, sampleRate); if (recFile()->openWrite()) { fprintf(stderr, "create wave file(%s) failed: %s\n", - path.latin1(), recFile()->strerror().latin1()); + path.toLatin1().constData(), recFile()->strerror().toLatin1().constData()); delete _recFile; _recFile = 0; } @@ -1237,7 +1237,7 @@ bool AudioTrack::getData(unsigned pos, int channels, unsigned nframes, float** b RouteList* rl = inRoutes(); #ifdef NODE_DEBUG - printf("AudioTrack::getData name:%s inRoutes:%d\n", name().latin1(), rl->size()); + printf("AudioTrack::getData name:%s inRoutes:%d\n", name().toLatin1().constData(), rl->size()); #endif iRoute ir = rl->begin(); @@ -1248,7 +1248,7 @@ bool AudioTrack::getData(unsigned pos, int channels, unsigned nframes, float** b return false; #ifdef NODE_DEBUG - printf(" calling copyData on %s...\n", ir->track->name().latin1()); + printf(" calling copyData on %s...\n", ir->track->name().toLatin1().constData()); #endif // p3.3.38 @@ -1260,12 +1260,12 @@ bool AudioTrack::getData(unsigned pos, int channels, unsigned nframes, float** b nframes, buffer); // p3.3.41 - //fprintf(stderr, "AudioTrack::getData %s data: nframes:%ld %e %e %e %e\n", name().latin1(), nframes, buffer[0][0], buffer[0][1], buffer[0][2], buffer[0][3]); + //fprintf(stderr, "AudioTrack::getData %s data: nframes:%ld %e %e %e %e\n", name().toLatin1().constData(), nframes, buffer[0][0], buffer[0][1], buffer[0][2], buffer[0][3]); ++ir; for (; ir != rl->end(); ++ir) { #ifdef NODE_DEBUG - printf(" calling addData on %s...\n", ir->track->name().latin1()); + printf(" calling addData on %s...\n", ir->track->name().toLatin1().constData()); #endif if(ir->track->isMidiTrack()) @@ -1320,7 +1320,7 @@ bool AudioInput::getData(unsigned, int channels, unsigned nframes, float** buffe // p3.3.41 //fprintf(stderr, "AudioInput::getData %s Jack port %p efx apply channels:%d nframes:%ld %e %e %e %e\n", - // name().latin1(), jackPort, channels, nframes, buffer[0][0], buffer[0][1], buffer[0][2], buffer[0][3]); + // name().toLatin1().constData(), jackPort, channels, nframes, buffer[0][0], buffer[0][1], buffer[0][2], buffer[0][3]); } } else @@ -1337,7 +1337,7 @@ bool AudioInput::getData(unsigned, int channels, unsigned nframes, float** buffe // p3.3.41 //fprintf(stderr, "AudioInput::getData %s No Jack port efx apply channels:%d nframes:%ld %e %e %e %e\n", - // name().latin1(), channels, nframes, buffer[0][0], buffer[0][1], buffer[0][2], buffer[0][3]); + // name().toLatin1().constData(), channels, nframes, buffer[0][0], buffer[0][1], buffer[0][2], buffer[0][3]); } } return true; @@ -1353,7 +1353,7 @@ void AudioInput::setName(const QString& s) if (!checkAudioDevice()) return; for (int i = 0; i < channels(); ++i) { char buffer[128]; - snprintf(buffer, 128, "%s-%d", _name.latin1(), i); + snprintf(buffer, 128, "%s-%d", _name.toLatin1().constData(), i); if (jackPorts[i]) audioDevice->setPortName(jackPorts[i], buffer); else { @@ -1563,7 +1563,7 @@ void AudioOutput::process(unsigned pos, unsigned offset, unsigned n) { //Added by Tim. p3.3.16 #ifdef NODE_DEBUG - printf("MusE: AudioOutput::process name:%s processed:%d\n", name().latin1(), processed()); + printf("MusE: AudioOutput::process name:%s processed:%d\n", name().toLatin1().constData(), processed()); #endif for (int i = 0; i < _channels; ++i) { @@ -1637,7 +1637,7 @@ void AudioOutput::setName(const QString& s) if (!checkAudioDevice()) return; for (int i = 0; i < channels(); ++i) { char buffer[128]; - snprintf(buffer, 128, "%s-%d", _name.latin1(), i); + snprintf(buffer, 128, "%s-%d", _name.toLatin1().constData(), i); if (jackPorts[i]) { audioDevice->setPortName(jackPorts[i], buffer); } diff --git a/muse2/muse/osc.cpp b/muse2/muse/osc.cpp index 6001b151..91a3a0ee 100644 --- a/muse2/muse/osc.cpp +++ b/muse2/muse/osc.cpp @@ -175,10 +175,11 @@ int oscMessageHandler(const char* path, const char* types, lo_arg** argv, SynthI* synti = *si; #ifdef OSC_DEBUG - fprintf(stderr, "oscMessageHandler: searching for:%s checking synth instance:%s\n", p, synti->name().latin1()); + fprintf(stderr, "oscMessageHandler: searching for:%s checking synth instance:%s\n", p, synti->name().toLatin1().constData()); #endif - const char* sub = strstr(p, synti->name().latin1()); + QByteArray ba = synti->name().toLatin1(); + const char* sub = strstr(p, ba.constData()); if(sub == NULL) continue; @@ -187,7 +188,8 @@ int oscMessageHandler(const char* path, const char* types, lo_arg** argv, if(!instance) break; - p = sub + strlen(synti->name().latin1()); + QByteArray ba2 = synti->name().toLatin1(); + p = sub + strlen(ba2.constData()); if (*p != '/' || *(p + 1) == 0) { @@ -198,7 +200,7 @@ int oscMessageHandler(const char* path, const char* types, lo_arg** argv, ++p; #ifdef OSC_DEBUG - fprintf(stderr, "oscMessageHandler: synth track:%s method:%s\n", synti->name().latin1(), p); + fprintf(stderr, "oscMessageHandler: synth track:%s method:%s\n", synti->name().toLatin1().constData(), p); #endif OscIF& oscif = instance->oscIF(); @@ -237,11 +239,11 @@ int oscMessageHandler(const char* path, const char* types, lo_arg** argv, #ifdef OSC_DEBUG fprintf(stderr, "oscMessageHandler: searching for:%s checking effect instance:%s label:%s lib:%s\n", - p, instance->name().latin1(), instance->label().latin1(), instance->lib().latin1()); + p, instance->name().toLatin1().constData(), instance->label().toLatin1().constData(), instance->lib().toLatin1().constData()); #endif - //const char* sub = strstr(p, instance->name().latin1()); - const char* sub = strstr(p, instance->label().latin1()); + //const char* sub = strstr(p, instance->name().toLatin1().constData()); + const char* sub = strstr(p, instance->label().toLatin1().constData()); if(sub == NULL) continue; @@ -249,8 +251,9 @@ int oscMessageHandler(const char* path, const char* types, lo_arg** argv, if(!plugin) break; - //p = sub + strlen(instance->name().latin1()); - p = sub + strlen(instance->label().latin1()); + //p = sub + strlen(instance->name().toLatin1().constData()); + QByteArray ba3 = instance->label().toLatin1(); + p = sub + strlen(ba3.constData()); if (*p != '/' || *(p + 1) == 0) { @@ -261,8 +264,8 @@ int oscMessageHandler(const char* path, const char* types, lo_arg** argv, ++p; #ifdef OSC_DEBUG - //fprintf(stderr, "oscMessageHandler: effect:%s method:%s\n", instance->name().latin1(), p); - fprintf(stderr, "oscMessageHandler: effect:%s method:%s\n", instance->label().latin1(), p); + //fprintf(stderr, "oscMessageHandler: effect:%s method:%s\n", instance->name().toLatin1().constData(), p); + fprintf(stderr, "oscMessageHandler: effect:%s method:%s\n", instance->label().toLatin1().constData(), p); #endif OscIF& oscif = instance->oscIF(); @@ -599,7 +602,7 @@ int OscIF::oscUpdate(lo_arg **argv) printf(" _uiOscProgramPath:%s\n", _uiOscProgramPath); printf(" _uiOscControlPath:%s\n",_uiOscControlPath); printf(" _uiOscShowPath:%s\n", _uiOscShowPath); - printf(" museProject:%s\n", museProject.latin1()); + printf(" museProject:%s\n", museProject.toLatin1().constData()); #endif // Send sample rate. @@ -607,7 +610,7 @@ int OscIF::oscUpdate(lo_arg **argv) // Send project directory. //lo_send(_uiOscTarget, _uiOscConfigurePath, "ss", - // DSSI_PROJECT_DIRECTORY_KEY, museProject.latin1()); // song->projectPath() + // DSSI_PROJECT_DIRECTORY_KEY, museProject.toLatin1().constData()); // song->projectPath() // Done in sub-classes. /* @@ -615,7 +618,7 @@ int OscIF::oscUpdate(lo_arg **argv) //lo_send(_uiOscTarget, _uiOscConfigurePath, "ss", //DSSI_PROJECT_DIRECTORY_KEY, song->projectPath().toAscii().data()); lo_send(_uiOscTarget, _uiOscConfigurePath, "ss", - DSSI_PROJECT_DIRECTORY_KEY, museProject.latin1()); + DSSI_PROJECT_DIRECTORY_KEY, museProject.toLatin1().constData()); if(_oscSynthIF) { @@ -885,7 +888,7 @@ bool OscIF::oscInitGui(const QString& typ, const QString& baseName, const QStrin */ //snprintf(oscUrl, 1024, "%s/%s/%s", url, baseName.ascii(), name.ascii()); - //snprintf(oscUrl, 1024, "%s%s/%s/%s", url, typ.latin1(), baseName.latin1(), name.latin1()); + //snprintf(oscUrl, 1024, "%s%s/%s/%s", url, typ.toLatin1().constData(), baseName.toLatin1().constData(), name.toLatin1().constData()); //oscUrl = QString("%1%2/%3/%4").arg(QString(QT_TR_NOOP(url))).arg(typ).arg(baseName).arg(name); oscUrl = QString("%1%2/%3/%4").arg(QString(QT_TR_NOOP(url))).arg(typ).arg(baseName).arg(label); @@ -894,7 +897,7 @@ bool OscIF::oscInitGui(const QString& typ, const QString& baseName, const QStrin QString guiPath(dirPath + "/" + baseName); #ifdef OSC_DEBUG - fprintf(stderr, "OscIF::oscInitGui guiPath:%s\n", guiPath.latin1()); + fprintf(stderr, "OscIF::oscInitGui guiPath:%s\n", guiPath.toLatin1().constData()); #endif QDir guiDir(guiPath, "*", QDir::Unsorted, QDir::Files); @@ -916,7 +919,7 @@ bool OscIF::oscInitGui(const QString& typ, const QString& baseName, const QStrin struct stat buf; //if (stat(gui.toAscii().data(), &buf)) { - if (stat(gui.latin1(), &buf)) { + if (stat(gui.toLatin1().constData(), &buf)) { perror("stat failed"); continue; @@ -926,17 +929,17 @@ bool OscIF::oscInitGui(const QString& typ, const QString& baseName, const QStrin fprintf(stderr, "OscIF::oscInitGui %s %s %s %s\n", //fi.filePath().toAscii().data(), //fi.fileName().toAscii().data(), - fi.filePath().latin1(), + fi.filePath().toLatin1().constData(), //fi.fileName().ascii(), - oscUrl.latin1(), + oscUrl.toLatin1().constData(), //synth->info.filePath().ascii(), - filePath.latin1(), + filePath.toLatin1().constData(), //name().toAscii().data(), //synth->name().ascii()); - name.latin1()); + name.toLatin1().constData()); #endif if ((S_ISREG(buf.st_mode) || S_ISLNK(buf.st_mode)) && @@ -1009,14 +1012,14 @@ bool OscIF::oscInitGui(const QString& typ, const QString& baseName, const QStrin fprintf(stderr, "exec %s %s %s %s failed: %s\n", //fi.filePath().toAscii().data(), //fi.fileName().toAscii().data(), - fi.filePath().latin1(), - fi.fileName().latin1(), + fi.filePath().toLatin1().constData(), + fi.fileName().toLatin1().constData(), - oscUrl.latin1(), + oscUrl.toLatin1().constData(), //name().toAscii().data(), //synth->name().ascii(), - name.latin1(), + name.toLatin1().constData(), strerror(errno)); @@ -1038,7 +1041,7 @@ bool OscIF::oscInitGui(const QString& typ, const QString& baseName, const QStrin printf("OscIF::oscInitGui %s: no dir for gui found: %s\n", //name().toAscii().data(), guiPath.toAscii().data()); //synth->name().ascii(), guiPath.ascii()); - name.latin1(), guiPath.latin1()); + name.toLatin1().constData(), guiPath.toLatin1().constData()); //synth->_hasGui = false; } @@ -1147,7 +1150,7 @@ int OscDssiIF::oscUpdate(lo_arg **argv) // Send project directory. No, done in DssiSynthIF. //lo_send(_uiOscTarget, _uiOscConfigurePath, "ss", - // DSSI_PROJECT_DIRECTORY_KEY, museProject.latin1()); // song->projectPath() + // DSSI_PROJECT_DIRECTORY_KEY, museProject.toLatin1().constData()); // song->projectPath() if(_oscSynthIF) _oscSynthIF->oscUpdate(); @@ -1335,7 +1338,7 @@ int OscEffectIF::oscUpdate(lo_arg** argv) // Send project directory. No, done in PluginI. //lo_send(_uiOscTarget, _uiOscConfigurePath, "ss", - // DSSI_PROJECT_DIRECTORY_KEY, museProject.latin1()); // song->projectPath() + // DSSI_PROJECT_DIRECTORY_KEY, museProject.toLatin1().constData()); // song->projectPath() if(_oscPluginI) _oscPluginI->oscUpdate(); diff --git a/muse2/muse/part.cpp b/muse2/muse/part.cpp index 0ca898ff..99f070b2 100644 --- a/muse2/muse/part.cpp +++ b/muse2/muse/part.cpp @@ -86,7 +86,7 @@ void chainCloneInternal(Part* p) for(ciPart ip = pl->begin(); ip != pl->end(); ++ip) { // Added by Tim. p3.3.6 - //printf("chainCloneInternal track %p %s part %p %s evlist %p\n", (*imt), (*imt)->name().latin1(), ip->second, ip->second->name().latin1(), ip->second->cevents()); + //printf("chainCloneInternal track %p %s part %p %s evlist %p\n", (*imt), (*imt)->name().toLatin1().constData(), ip->second, ip->second->name().toLatin1().constData(), ip->second->cevents()); if(ip->second != p && ip->second->cevents() == p->cevents()) { @@ -232,7 +232,7 @@ void replaceClone(Part* p1, Part* p2) p1->setNextClone(p1); p1->setPrevClone(p1); // Added by Tim. p3.3.6 - //printf("replaceClone p1: %s %p arefs:%d p2: %s %p arefs:%d\n", p1->name().latin1(), p1, ); + //printf("replaceClone p1: %s %p arefs:%d p2: %s %p arefs:%d\n", p1->name().toLatin1().constData(), p1, ); } @@ -279,7 +279,7 @@ void chainTrackParts(Track* t, bool incRefCount) p->events()->incARef(1); // Added by Tim. p3.3.6 - //printf("chainTrackParts track %p %s part %p %s evlist %p\n", t, t->name().latin1(), p, p->name().latin1(), p->cevents()); + //printf("chainTrackParts track %p %s part %p %s evlist %p\n", t, t->name().toLatin1().constData(), p, p->name().toLatin1().constData(), p->cevents()); Part* p1 = 0; @@ -297,7 +297,7 @@ void chainTrackParts(Track* t, bool incRefCount) for(ciPart ip = pl->begin(); ip != pl->end(); ++ip) { // Added by Tim. p3.3.6 - //printf("chainTrackParts track %p %s part %p %s evlist %p\n", mt, mt->name().latin1(), ip->second, ip->second->name().latin1(), ip->second->cevents()); + //printf("chainTrackParts track %p %s part %p %s evlist %p\n", mt, mt->name().toLatin1().constData(), ip->second, ip->second->name().toLatin1().constData(), ip->second->cevents()); if(ip->second != p && ip->second->cevents() == p->cevents()) { @@ -359,9 +359,9 @@ void chainCheckErr(Part* p) { // At all times these must be true... if(p->nextClone()->prevClone() != p) - printf("chainCheckErr: Next clone:%s %p prev clone:%s %p != %s %p\n", p->nextClone()->name().latin1(), p->nextClone(), p->nextClone()->prevClone()->name().latin1(), p->nextClone()->prevClone(), p->name().latin1(), p); + printf("chainCheckErr: Next clone:%s %p prev clone:%s %p != %s %p\n", p->nextClone()->name().toLatin1().constData(), p->nextClone(), p->nextClone()->prevClone()->name().toLatin1().constData(), p->nextClone()->prevClone(), p->name().toLatin1().constData(), p); if(p->prevClone()->nextClone() != p) - printf("chainCheckErr: Prev clone:%s %p next clone:%s %p != %s %p\n", p->prevClone()->name().latin1(), p->prevClone(), p->prevClone()->nextClone()->name().latin1(), p->prevClone()->nextClone(), p->name().latin1(), p); + printf("chainCheckErr: Prev clone:%s %p next clone:%s %p != %s %p\n", p->prevClone()->name().toLatin1().constData(), p->prevClone(), p->prevClone()->nextClone()->name().toLatin1().constData(), p->prevClone()->nextClone(), p->name().toLatin1().constData(), p); } //--------------------------------------------------------- @@ -382,7 +382,7 @@ void addPortCtrlEvents(Event& event, Part* part, bool doClones) while(1) { // Added by Tim. p3.3.6 - //printf("addPortCtrlEvents i:%d %s %p events %p refs:%d arefs:%d\n", i, p->name().latin1(), p, part->cevents(), part->cevents()->refCount(), j); + //printf("addPortCtrlEvents i:%d %s %p events %p refs:%d arefs:%d\n", i, p->name().toLatin1().constData(), p, part->cevents(), part->cevents()->refCount(), j); Track* t = p->track(); if(t && t->isMidiTrack()) @@ -395,7 +395,7 @@ void addPortCtrlEvents(Event& event, Part* part, bool doClones) //{ //const Event& ev = ie->second; // Added by Tim. p3.3.6 - //printf("addPortCtrlEvents %s len:%d end:%d etick:%d\n", p->name().latin1(), p->lenTick(), p->endTick(), event.tick()); + //printf("addPortCtrlEvents %s len:%d end:%d etick:%d\n", p->name().toLatin1().constData(), p->lenTick(), p->endTick(), event.tick()); // Do not add events which are past the end of the part. if(event.tick() >= len) @@ -457,7 +457,7 @@ void addPortCtrlEvents(Part* part, bool doClones) while(1) { // Added by Tim. p3.3.6 - //printf("addPortCtrlEvents i:%d %s %p events %p refs:%d arefs:%d\n", i, p->name().latin1(), p, part->cevents(), part->cevents()->refCount(), j); + //printf("addPortCtrlEvents i:%d %s %p events %p refs:%d arefs:%d\n", i, p->name().toLatin1().constData(), p, part->cevents(), part->cevents()->refCount(), j); Track* t = p->track(); if(t && t->isMidiTrack()) @@ -918,9 +918,9 @@ void Part::replaceClone(const Part* p) void Part::chainCheckErr() { if(_nextClone->prevClone() != this) - printf("Part::chainCheckErr Error! Next clone:%s %x prev clone:%s %x != this:%s %x\n", _nextClone->name().latin1(), _nextClone, _nextClone->prevClone()->name().latin1(), _nextClone->prevClone(), name().latin1(), this); + printf("Part::chainCheckErr Error! Next clone:%s %x prev clone:%s %x != this:%s %x\n", _nextClone->name().toLatin1().constData(), _nextClone, _nextClone->prevClone()->name().toLatin1().constData(), _nextClone->prevClone(), name().toLatin1().constData(), this); if(_prevClone->nextClone() != this) - printf("Part::chainCheckErr Error! Prev clone:%s %x next clone:%s %x != this:%s %x\n", _prevClone->name().latin1(), _prevClone, _prevClone->nextClone()->name().latin1(), _prevClone->nextClone(), name().latin1(), this); + printf("Part::chainCheckErr Error! Prev clone:%s %x next clone:%s %x != this:%s %x\n", _prevClone->name().toLatin1().constData(), _prevClone, _prevClone->nextClone()->name().toLatin1().constData(), _prevClone->nextClone(), name().toLatin1().constData(), this); } */ @@ -1395,7 +1395,7 @@ void Part::dump(int n) const { for (int i = 0; i < n; ++i) putchar(' '); - printf("Part: <%s> ", _name.latin1()); + printf("Part: <%s> ", _name.toLatin1().constData()); for (int i = 0; i < n; ++i) putchar(' '); PosLen::dump(); diff --git a/muse2/muse/plugin.cpp b/muse2/muse/plugin.cpp index 7a71f0a1..507d32ae 100644 --- a/muse2/muse/plugin.cpp +++ b/muse2/muse/plugin.cpp @@ -701,14 +701,14 @@ int Plugin::incReferences(int val) if(_handle == 0) { //_references = 0; - _handle = dlopen(fi.filePath().latin1(), RTLD_NOW); - //handle = dlopen(fi.absFilePath().latin1(), RTLD_NOW); + _handle = dlopen(fi.filePath().toLatin1().constData(), RTLD_NOW); + //handle = dlopen(fi.absFilePath().toLatin1().constData(), RTLD_NOW); if(_handle == 0) { fprintf(stderr, "Plugin::incReferences dlopen(%s) failed: %s\n", - fi.filePath().latin1(), dlerror()); - //fi.absFilePath().latin1(), dlerror()); + fi.filePath().toLatin1().constData(), dlerror()); + //fi.absFilePath().toLatin1().constData(), dlerror()); return 0; } @@ -835,7 +835,7 @@ int Plugin::incReferences(int val) dlclose(_handle); _handle = 0; _references = 0; - fprintf(stderr, "Plugin::incReferences Error: %s no plugin!\n", fi.filePath().latin1()); + fprintf(stderr, "Plugin::incReferences Error: %s no plugin!\n", fi.filePath().toLatin1().constData()); return 0; } @@ -964,7 +964,7 @@ static void loadPluginLib(QFileInfo* fi) //bool inPlaceBroken = LADSPA_IS_INPLACE_BROKEN(properties); //plugins.add(fi, descr, !inPlaceBroken); if(debugMsg) - fprintf(stderr, "loadPluginLib: adding dssi effect plugin:%s name:%s label:%s\n", fi->filePath().latin1(), descr->LADSPA_Plugin->Name, descr->LADSPA_Plugin->Label); + fprintf(stderr, "loadPluginLib: adding dssi effect plugin:%s name:%s label:%s\n", fi->filePath().toLatin1().constData(), descr->LADSPA_Plugin->Name, descr->LADSPA_Plugin->Label); plugins.add(fi, descr->LADSPA_Plugin, true); } @@ -1009,7 +1009,7 @@ static void loadPluginLib(QFileInfo* fi) //bool inPlaceBroken = LADSPA_IS_INPLACE_BROKEN(properties); //plugins.add(fi, ladspa, descr, !inPlaceBroken); if(debugMsg) - fprintf(stderr, "loadPluginLib: adding ladspa plugin:%s name:%s label:%s\n", fi->filePath().latin1(), descr->Name, descr->Label); + fprintf(stderr, "loadPluginLib: adding ladspa plugin:%s name:%s label:%s\n", fi->filePath().toLatin1().constData(), descr->Name, descr->Label); plugins.add(fi, descr); } } @@ -1024,7 +1024,7 @@ static void loadPluginLib(QFileInfo* fi) static void loadPluginDir(const QString& s) { if (debugMsg) - printf("scan ladspa plugin dir <%s>\n", s.latin1()); + printf("scan ladspa plugin dir <%s>\n", s.toLatin1().constData()); QDir pluginDir(s, QString("*.so")); // ddskrjo if (pluginDir.exists()) { QFileInfoList list = pluginDir.entryInfoList(); @@ -1852,7 +1852,7 @@ bool PluginI::setControl(const QString& s, double val) } } printf("PluginI:setControl(%s, %f) controller not found\n", - s.latin1(), val); + s.toLatin1().constData(), val); return true; } @@ -1863,16 +1863,16 @@ bool PluginI::setControl(const QString& s, double val) void PluginI::writeConfiguration(int level, Xml& xml) { xml.tag(level++, "plugin file=\"%s\" label=\"%s\" channel=\"%d\"", - //_plugin->lib().latin1(), _plugin->label().latin1(), instances * _plugin->inports()); + //_plugin->lib().toLatin1().constData(), _plugin->label().toLatin1().constData(), instances * _plugin->inports()); // p3.3.41 - //_plugin->lib().latin1(), _plugin->label().latin1(), channel); - Xml::xmlString(_plugin->lib()).latin1(), Xml::xmlString(_plugin->label()).latin1(), channel); + //_plugin->lib().toLatin1().constData(), _plugin->label().toLatin1().constData(), channel); + Xml::xmlString(_plugin->lib()).toLatin1().constData(), Xml::xmlString(_plugin->label()).toLatin1().constData(), channel); for (int i = 0; i < controlPorts; ++i) { int idx = controls[i].idx; QString s("control name=\"%1\" val=\"%2\" /"); - //xml.tag(level, s.arg(_plugin->portName(idx)).arg(controls[i].tmpVal).latin1()); - xml.tag(level, s.arg(Xml::xmlString(_plugin->portName(idx)).latin1()).arg(controls[i].tmpVal).latin1()); + //xml.tag(level, s.arg(_plugin->portName(idx)).arg(controls[i].tmpVal).toLatin1().constData()); + xml.tag(level, s.arg(Xml::xmlString(_plugin->portName(idx)).toLatin1().constData()).arg(controls[i].tmpVal).toLatin1().constData()); } if (_on == false) xml.intTag(level, "on", _on); @@ -1998,7 +1998,7 @@ bool PluginI::readConfiguration(Xml& xml, bool readPreset) if (readPreset) { if (s != plugin()->lib()) { printf("Error: Wrong preset type %s. Type must be a %s\n", - s.latin1(), plugin()->lib().latin1()); + s.toLatin1().constData(), plugin()->lib().toLatin1().constData()); return true; } } @@ -2329,7 +2329,7 @@ int PluginI::oscConfigure(const char *key, const char *value) //const char *value = (const char *)&argv[1]->s; #ifdef PLUGIN_DEBUGIN - printf("PluginI::oscConfigure effect plugin name:%s label:%s key:%s value:%s\n", _name.latin1(), _label.latin1(), key, value); + printf("PluginI::oscConfigure effect plugin name:%s label:%s key:%s value:%s\n", _name.toLatin1().constData(), _label.toLatin1().constData(), key, value); #endif #ifdef DSSI_SUPPORT @@ -2360,7 +2360,7 @@ int PluginI::oscUpdate() { #ifdef DSSI_SUPPORT // Send project directory. - _oscif.oscSendConfigure(DSSI_PROJECT_DIRECTORY_KEY, museProject.latin1()); // song->projectPath() + _oscif.oscSendConfigure(DSSI_PROJECT_DIRECTORY_KEY, museProject.toLatin1().constData()); // song->projectPath() #endif /* diff --git a/muse2/muse/pos.cpp b/muse2/muse/pos.cpp index 15327af8..5a86673d 100644 --- a/muse2/muse/pos.cpp +++ b/muse2/muse/pos.cpp @@ -53,7 +53,7 @@ Pos::Pos(unsigned t, bool ticks) Pos::Pos(const QString& s) { int m, b, t; - sscanf(s.latin1(), "%04d.%02d.%03d", &m, &b, &t); + sscanf(s.toLatin1(), "%04d.%02d.%03d", &m, &b, &t); _tick = AL::sigmap.bar2tick(m, b, t); _type = TICKS; sn = -1; diff --git a/muse2/muse/remote/pyapi.cpp b/muse2/muse/remote/pyapi.cpp index e71b8a18..8e8e765c 100644 --- a/muse2/muse/remote/pyapi.cpp +++ b/muse2/muse/remote/pyapi.cpp @@ -113,7 +113,7 @@ PyObject* getTrackNames(PyObject*, PyObject*) PyObject* res = Py_BuildValue("[]"); for (ciTrack t = tracks->begin(); t != tracks->end(); ++t) { Track* track = *t; - PyObject* ptrackname = Py_BuildValue("s", track->name().latin1()); + PyObject* ptrackname = Py_BuildValue("s", track->name().toLatin1()); PyList_Append(res, ptrackname); Py_DECREF(ptrackname); } @@ -697,7 +697,7 @@ PyObject* getSelectedTrack(PyObject*, PyObject*) for (ciTrack t = tracks->begin(); t != tracks->end(); ++t) { Track* track = *t; if (track->selected()) - return Py_BuildValue("s", track->name().latin1()); + return Py_BuildValue("s", track->name().toLatin1()); } Py_INCREF(Py_None); @@ -746,8 +746,8 @@ PyObject* getTrackEffects(PyObject*, PyObject* args) const Pipeline* pipeline = track->efxPipe(); for (int i = 0; i < PipelineDepth; i++) { QString name = pipeline->name(i); - printf("fx %d name: %s\n", i, name.latin1()); - PyObject* pyname = Py_BuildValue("s", name.latin1()); + printf("fx %d name: %s\n", i, name.toLatin1()); + PyObject* pyname = Py_BuildValue("s", name.toLatin1()); PyList_Append(pyfxnames, pyname); Py_DECREF(pyname); } @@ -897,7 +897,7 @@ PyObject* getOutputRoute(PyObject*, PyObject* args) // for (iRoute ir = r->begin(); ir != r->end(); ++ir) { // if (ir->type == 0 && ir->track == track) { // s += "*"; - // PyList_Append(routes, Py_BuildValue("s", s.latin1())); + // PyList_Append(routes, Py_BuildValue("s", s.toLatin1())); // break; // } // } diff --git a/muse2/muse/route.cpp b/muse2/muse/route.cpp index 0f9eb318..c40b4397 100644 --- a/muse2/muse/route.cpp +++ b/muse2/muse/route.cpp @@ -157,8 +157,8 @@ void addRoute(Route src, Route dst) } // printf("addRoute %d.%d:<%s> %d.%d:<%s>\n", -// src.type, src.channel, src.name().latin1(), -// dst.type, dst.channel, dst.name().latin1()); +// src.type, src.channel, src.name().toLatin1().constData(), +// dst.type, dst.channel, dst.name().toLatin1().constData()); if (src.type == Route::JACK_ROUTE) { //if (dst.type != TRACK_ROUTE) @@ -172,13 +172,13 @@ void addRoute(Route src, Route dst) { if (dst.track->type() != Track::AUDIO_INPUT) { - fprintf(stderr, "addRoute: source is jack, dest:%s is track but not audio input\n", dst.track->name().latin1()); + fprintf(stderr, "addRoute: source is jack, dest:%s is track but not audio input\n", dst.track->name().toLatin1().constData()); //exit(-1); return; } if (dst.channel < 0) { - fprintf(stderr, "addRoute: source is jack, dest:%s is track but invalid channel:%d\n", dst.track->name().latin1(), dst.channel); + fprintf(stderr, "addRoute: source is jack, dest:%s is track but invalid channel:%d\n", dst.track->name().toLatin1().constData(), dst.channel); //exit(-1); return; } @@ -198,7 +198,7 @@ void addRoute(Route src, Route dst) } } #ifdef ROUTE_DEBUG - fprintf(stderr, "addRoute: src Jack dst track name: %s pushing source route\n", dst.track->name().latin1()); + fprintf(stderr, "addRoute: src Jack dst track name: %s pushing source route\n", dst.track->name().toLatin1().constData()); #endif inRoutes->push_back(src); } @@ -237,7 +237,7 @@ void addRoute(Route src, Route dst) } } #ifdef ROUTE_DEBUG - fprintf(stderr, "addRoute: src Jack dst Jack midi name: %s pushing source route\n", dst.device->name().latin1()); + fprintf(stderr, "addRoute: src Jack dst Jack midi name: %s pushing source route\n", dst.device->name().toLatin1().constData()); #endif routes->push_back(src); } @@ -274,7 +274,7 @@ void addRoute(Route src, Route dst) } if (src.channel < 0) { - fprintf(stderr, "addRoute: destination is jack, source:%s is track but invalid channel:%d\n", src.track->name().latin1(), src.channel); + fprintf(stderr, "addRoute: destination is jack, source:%s is track but invalid channel:%d\n", src.track->name().toLatin1().constData(), src.channel); // exit(-1); return; } @@ -295,7 +295,7 @@ void addRoute(Route src, Route dst) } } #ifdef ROUTE_DEBUG - fprintf(stderr, "addRoute: dst Jack src track name: %s pushing destination route\n", src.track->name().latin1()); + fprintf(stderr, "addRoute: dst Jack src track name: %s pushing destination route\n", src.track->name().toLatin1().constData()); #endif outRoutes->push_back(dst); } @@ -323,7 +323,7 @@ void addRoute(Route src, Route dst) } } #ifdef ROUTE_DEBUG - fprintf(stderr, "addRoute: dst Jack src Jack midi name: %s pushing destination route\n", src.device->name().latin1()); + fprintf(stderr, "addRoute: dst Jack src Jack midi name: %s pushing destination route\n", src.device->name().toLatin1().constData()); #endif routes->push_back(dst); } @@ -373,7 +373,7 @@ void addRoute(Route src, Route dst) if (ir->type == Route::TRACK_ROUTE && ir->track == dst.track) // p3.3.50 Does a route to the track exist? { //#ifdef ROUTE_DEBUG - //fprintf(stderr, "addRoute: src midi port:%d dst track:%s route already exists.\n", src.midiPort, dst.track->name().latin1()); + //fprintf(stderr, "addRoute: src midi port:%d dst track:%s route already exists.\n", src.midiPort, dst.track->name().toLatin1().constData()); //#endif ir->channel |= dst.channel; // p3.3.50 Bitwise OR the desired channel bit with the existing bit mask. break; @@ -382,7 +382,7 @@ void addRoute(Route src, Route dst) } } #ifdef ROUTE_DEBUG - fprintf(stderr, "addRoute: src midi port:%d dst track name:%s pushing dst and src routes\n", src.midiPort, dst.track->name().latin1()); + fprintf(stderr, "addRoute: src midi port:%d dst track name:%s pushing dst and src routes\n", src.midiPort, dst.track->name().toLatin1().constData()); #endif if(ir == outRoutes->end()) // p3.3.50 Only if route not found, add the route, with the requested channel bits as mask to start with. @@ -436,7 +436,7 @@ void addRoute(Route src, Route dst) if (ir->type == Route::MIDI_PORT_ROUTE && ir->midiPort == dst.midiPort) // p3.3.50 Does a route to the midi port exist? { //#ifdef ROUTE_DEBUG - //fprintf(stderr, "addRoute: dst midi port:%d src track:%s route already exists.\n", dst.midiPort, src.track->name().latin1()); + //fprintf(stderr, "addRoute: dst midi port:%d src track:%s route already exists.\n", dst.midiPort, src.track->name().toLatin1().constData()); //#endif //return; @@ -451,7 +451,7 @@ void addRoute(Route src, Route dst) MidiPort *mp = &midiPorts[dst.midiPort]; #ifdef ROUTE_DEBUG - fprintf(stderr, "addRoute: src track:%s dst midi port:%d pushing dst and src routes\n", src.track->name().latin1(), dst.midiPort); + fprintf(stderr, "addRoute: src track:%s dst midi port:%d pushing dst and src routes\n", src.track->name().toLatin1().constData(), dst.midiPort); #endif RouteList* inRoutes = mp->inRoutes(); @@ -488,7 +488,7 @@ void addRoute(Route src, Route dst) //src.channels = dst.channels = 1; RouteList* outRoutes = src.device->outRoutes(); #ifdef ROUTE_DEBUG - fprintf(stderr, "addRoute: src name: %s looking for existing dest in out routes...\n", src.device->name().latin1()); + fprintf(stderr, "addRoute: src name: %s looking for existing dest in out routes...\n", src.device->name().toLatin1().constData()); #endif for (iRoute i = outRoutes->begin(); i != outRoutes->end(); ++i) { @@ -501,7 +501,7 @@ void addRoute(Route src, Route dst) } } #ifdef ROUTE_DEBUG - fprintf(stderr, "addRoute: src midi dst name: %s pushing destination and source routes\n", dst.track->name().latin1()); + fprintf(stderr, "addRoute: src midi dst name: %s pushing destination and source routes\n", dst.track->name().toLatin1().constData()); #endif outRoutes->push_back(dst); @@ -590,7 +590,7 @@ void addRoute(Route src, Route dst) if(dst.type == Route::MIDI_DEVICE_ROUTE) { #ifdef ROUTE_DEBUG - fprintf(stderr, "addRoute: src track dst midi name: %s pushing destination and source routes\n", dst.device->name().latin1()); + fprintf(stderr, "addRoute: src track dst midi name: %s pushing destination and source routes\n", dst.device->name().toLatin1().constData()); #endif inRoutes = dst.device->inRoutes(); } @@ -599,10 +599,10 @@ void addRoute(Route src, Route dst) { #ifdef ROUTE_DEBUG - //fprintf(stderr, "addRoute: src track ch:%d chs:%d dst track ch:%d chs:%d name: %s pushing destination and source routes\n", src.channel, src.channels, dst.channel, dst.channels, dst.track->name().latin1()); + //fprintf(stderr, "addRoute: src track ch:%d chs:%d dst track ch:%d chs:%d name: %s pushing destination and source routes\n", src.channel, src.channels, dst.channel, dst.channels, dst.track->name().toLatin1().constData()); fprintf(stderr, "addRoute: src track ch:%d chs:%d remch:%d dst track ch:%d chs:%d remch:%d name: %s pushing dest and source routes\n", - src.channel, src.channels, src.remoteChannel, dst.channel, dst.channels, dst.remoteChannel, dst.track->name().latin1()); - //fprintf(stderr, "addRoute: src track ch:%d dst track ch:%d name: %s pushing destination and source routes\n", src.channel, dst.channel, dst.track->name().latin1()); + src.channel, src.channels, src.remoteChannel, dst.channel, dst.channels, dst.remoteChannel, dst.track->name().toLatin1().constData()); + //fprintf(stderr, "addRoute: src track ch:%d dst track ch:%d name: %s pushing destination and source routes\n", src.channel, dst.channel, dst.track->name().toLatin1().constData()); #endif inRoutes = dst.track->inRoutes(); } @@ -626,8 +626,8 @@ void addRoute(Route src, Route dst) void removeRoute(Route src, Route dst) { //printf("removeRoute %d.%d:<%s> %d.%d:<%s>\n", - // src.type, src.channel, src.name().latin1(), - // dst.type, dst.channel, dst.name().latin1()); + // src.type, src.channel, src.name().toLatin1().constData(), + // dst.type, dst.channel, dst.name().toLatin1().constData()); if (src.type == Route::JACK_ROUTE) { @@ -1022,7 +1022,7 @@ QString Route::name() const //Route name2route(const QString& rn, bool dst) Route name2route(const QString& rn, bool /*dst*/, int rtype) { -// printf("name2route %s\n", rn.latin1()); +// printf("name2route %s\n", rn.toLatin1().constData()); int channel = -1; //int channel = 0; QString s(rn); @@ -1039,7 +1039,7 @@ Route name2route(const QString& rn, bool /*dst*/, int rtype) //{ if(checkAudioDevice()) { - void* p = audioDevice->findPort(s.latin1()); + void* p = audioDevice->findPort(s.toLatin1().constData()); if(p) return Route(p, channel); } @@ -1136,7 +1136,7 @@ Route name2route(const QString& rn, bool /*dst*/, int rtype) { if(checkAudioDevice()) { - void* p = audioDevice->findPort(s.latin1()); + void* p = audioDevice->findPort(s.toLatin1().constData()); if(p) return Route(p, channel); } @@ -1154,7 +1154,7 @@ Route name2route(const QString& rn, bool /*dst*/, int rtype) } } - printf(" name2route: <%s> not found\n", rn.latin1()); + printf(" name2route: <%s> not found\n", rn.toLatin1().constData()); return Route((Track*) 0, channel); //return Route((Track*) 0, channel, 1); } @@ -1301,7 +1301,7 @@ void Route::read(Xml& xml) // break; case Xml::Attribut: #ifdef ROUTE_DEBUG - printf("Route::read(): attribute:%s\n", tag.latin1()); + printf("Route::read(): attribute:%s\n", tag.toLatin1().constData()); #endif if(tag == "type") rtype = xml.s2().toInt(); @@ -1321,11 +1321,11 @@ void Route::read(Xml& xml) rtype = Route::MIDI_PORT_ROUTE; } else - printf("Route::read(): unknown attribute:%s\n", tag.latin1()); + printf("Route::read(): unknown attribute:%s\n", tag.toLatin1().constData()); break; case Xml::TagEnd: #ifdef ROUTE_DEBUG - printf("Route::read(): tag end type:%d channel:%d name:%s\n", rtype, channel, s.latin1()); + printf("Route::read(): tag end type:%d channel:%d name:%s\n", rtype, channel, s.toLatin1().constData()); #endif if(rtype == MIDI_PORT_ROUTE) // p3.3.49 { @@ -1355,14 +1355,14 @@ void Route::read(Xml& xml) } } if(i == tl->end()) - printf("Route::read(): track <%s> not found\n", s.latin1()); + printf("Route::read(): track <%s> not found\n", s.toLatin1().constData()); } else if(rtype == JACK_ROUTE) { void* jport = audioDevice->findPort(s); if(jport == 0) - printf("Route::read(): jack port <%s> not found\n", s.latin1()); + printf("Route::read(): jack port <%s> not found\n", s.toLatin1().constData()); else { jackPort = jport; @@ -1390,7 +1390,7 @@ void Route::read(Xml& xml) } } if(imd == midiDevices.end()) - printf("Route::read(): midi device <%s> not found\n", s.latin1()); + printf("Route::read(): midi device <%s> not found\n", s.toLatin1().constData()); } } return; @@ -1450,7 +1450,7 @@ void Song::readRoute(Xml& xml) break; case Xml::Attribut: #ifdef ROUTE_DEBUG - printf("Song::readRoute(): attribute:%s\n", tag.latin1()); + printf("Song::readRoute(): attribute:%s\n", tag.toLatin1().constData()); #endif if(tag == "channel") ch = xml.s2().toInt(); @@ -1464,7 +1464,7 @@ void Song::readRoute(Xml& xml) if(tag == "channelMask") // p3.3.50 New channel mask for midi port-track routes. ch = xml.s2().toInt(); else - printf("Song::readRoute(): unknown attribute:%s\n", tag.latin1()); + printf("Song::readRoute(): unknown attribute:%s\n", tag.toLatin1().constData()); break; case Xml::TagEnd: if (xml.s1() == "Route") @@ -1497,7 +1497,7 @@ void Song::readRoute(Xml& xml) } else printf(" Warning - device:%s to track route, no device midi port or chan:%d out of range. Ignoring route!\n", - sroute.device->name().latin1(), ch); + sroute.device->name().toLatin1().constData(), ch); } else if(sroute.type == Route::TRACK_ROUTE && droute.type == Route::MIDI_DEVICE_ROUTE) { @@ -1515,7 +1515,7 @@ void Song::readRoute(Xml& xml) } else printf(" Warning - track to device:%s route, no device midi port or chan:%d out of range. Ignoring route!\n", - droute.device->name().latin1(), ch); + droute.device->name().toLatin1().constData(), ch); } else { @@ -1563,8 +1563,8 @@ void Route::dump() const if (type == TRACK_ROUTE) { if(track) - printf("Route dump: track <%s> channel %d channels %d\n", track->name().latin1(), channel, channels); - //printf("Route dump: track <%s> channel %d\n", track->name().latin1(), channel); + printf("Route dump: track <%s> channel %d channels %d\n", track->name().toLatin1().constData(), channel, channels); + //printf("Route dump: track <%s> channel %d\n", track->name().toLatin1().constData(), channel); //else // printf("Route dump: invalid track, channel %d\n", channel); } @@ -1572,7 +1572,7 @@ void Route::dump() const if (type == JACK_ROUTE) { if(checkAudioDevice()) - printf("Route dump: jack audio port <%s> channel %d\n", audioDevice->portName(jackPort).latin1(), channel); + printf("Route dump: jack audio port <%s> channel %d\n", audioDevice->portName(jackPort).toLatin1().constData(), channel); } else if (type == MIDI_PORT_ROUTE) // p3.3.49 @@ -1588,24 +1588,24 @@ void Route::dump() const if(device->deviceType() == MidiDevice::JACK_MIDI) { if(checkAudioDevice()) - //printf("jack midi port device <%s> ", audioDevice->portName(device->clientPort()).latin1()); + //printf("jack midi port device <%s> ", audioDevice->portName(device->clientPort()).toLatin1().constData()); // p3.3.55 { - printf("jack midi device <%s> ", device->name().latin1()); + printf("jack midi device <%s> ", device->name().toLatin1().constData()); if(device->inClientPort()) printf("input port <%s> ", - audioDevice->portName(device->inClientPort()).latin1()); + audioDevice->portName(device->inClientPort()).toLatin1().constData()); if(device->outClientPort()) printf("output port <%s> ", - audioDevice->portName(device->outClientPort()).latin1()); + audioDevice->portName(device->outClientPort()).toLatin1().constData()); } } else if(device->deviceType() == MidiDevice::ALSA_MIDI) - printf("alsa midi device <%s> ", device->name().latin1()); + printf("alsa midi device <%s> ", device->name().toLatin1().constData()); else if(device->deviceType() == MidiDevice::SYNTH_MIDI) - printf("synth midi device <%s> ", device->name().latin1()); + printf("synth midi device <%s> ", device->name().toLatin1().constData()); else printf("is midi but unknown device type:%d, ", device->deviceType()); } diff --git a/muse2/muse/seqmsg.cpp b/muse2/muse/seqmsg.cpp index 2def4078..d2225190 100644 --- a/muse2/muse/seqmsg.cpp +++ b/muse2/muse/seqmsg.cpp @@ -389,7 +389,7 @@ void Audio::msgSetChannels(AudioTrack* node, int n) if (i < n && ai->jackPort(i) == 0) { char buffer[128]; - snprintf(buffer, 128, "%s-%d", name.latin1(), i); + snprintf(buffer, 128, "%s-%d", name.toLatin1().constData(), i); //ai->setJackPort(i, audioDevice->registerInPort(buffer)); ai->setJackPort(i, audioDevice->registerInPort(buffer, false)); } @@ -420,7 +420,7 @@ void Audio::msgSetChannels(AudioTrack* node, int n) if (i < n && jp == 0) { char buffer[128]; - snprintf(buffer, 128, "%s-%d", name.latin1(), i); + snprintf(buffer, 128, "%s-%d", name.toLatin1().constData(), i); //ao->setJackPort(i, audioDevice->registerOutPort(buffer)); ao->setJackPort(i, audioDevice->registerOutPort(buffer, false)); } diff --git a/muse2/muse/shortcuts.cpp b/muse2/muse/shortcuts.cpp index 68a538e9..b81ed0c9 100644 --- a/muse2/muse/shortcuts.cpp +++ b/muse2/muse/shortcuts.cpp @@ -302,7 +302,7 @@ void readShortCuts(Xml& xml) if (tag.length()) { int index = getShrtByTag(tag); if (index == -1) //No such tag found - printf("Config file might be corrupted. Unknown shortcut: %s\n",tag.latin1()); + printf("Config file might be corrupted. Unknown shortcut: %s\n",tag.toLatin1().constData()); else { //printf("Index: %d\n",index); shortcuts[index].key = xml.parseInt(); diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index c956f1d6..465bc257 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -393,7 +393,7 @@ bool Song::addEvent(Event& event, Part* part) { // This can be normal for some (redundant) operations. if(debugMsg) - printf("Song::addEvent event already found in part:%s size:%zd\n", part->name().latin1(), part->events()->size()); + printf("Song::addEvent event already found in part:%s size:%zd\n", part->name().toLatin1().constData(), part->events()->size()); return false; } @@ -412,7 +412,7 @@ void Song::changeEvent(Event& oldEvent, Event& newEvent, Part* part) if (i == part->events()->end()) { // This can be normal for some (redundant) operations. if(debugMsg) - printf("Song::changeEvent event not found in part:%s size:%zd\n", part->name().latin1(), part->events()->size()); + printf("Song::changeEvent event not found in part:%s size:%zd\n", part->name().toLatin1().constData(), part->events()->size()); // abort(); // Removed by T356. Allow it to add the new event. // (And remove the old one from the midi port controller!) @@ -514,7 +514,7 @@ void Song::deleteEvent(Event& event, Part* part) if (ev == part->events()->end()) { // This can be normal for some (redundant) operations. if(debugMsg) - printf("Song::deleteEvent event not found in part:%s size:%zd\n", part->name().latin1(), part->events()->size()); + printf("Song::deleteEvent event not found in part:%s size:%zd\n", part->name().toLatin1().constData(), part->events()->size()); return; } part->events()->erase(ev); @@ -2922,7 +2922,7 @@ void Song::chooseMidiRoutes(QButton* parent, MidiTrack* track, bool dst) // for (int i = 0; i < channel; ++i) // { // char buffer[128]; -// snprintf(buffer, 128, "%s %d", tr("Channel").latin1(), i+1); +// snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), i+1); // MenuTitleItem* titel = new MenuTitleItem(QString(buffer)); // pup->insertItem(titel); @@ -2998,12 +2998,12 @@ void Song::chooseMidiRoutes(QButton* parent, MidiTrack* track, bool dst) // disconnect if(dst) { - //printf("Song::chooseMidiRoutes removing route src track name: %s dst device name: %s\n", track->name().latin1(), md->name().latin1()); + //printf("Song::chooseMidiRoutes removing route src track name: %s dst device name: %s\n", track->name().toLatin1().constData(), md->name().toLatin1().constData()); audio->msgRemoveRoute(bRoute, aRoute); } else { - //printf("Song::chooseMidiRoutes removing route src device name: %s dst track name: %s\n", md->name().latin1(), track->name().latin1()); + //printf("Song::chooseMidiRoutes removing route src device name: %s dst track name: %s\n", md->name().toLatin1().constData(), track->name().toLatin1().constData()); audio->msgRemoveRoute(aRoute, bRoute); } } @@ -3012,12 +3012,12 @@ void Song::chooseMidiRoutes(QButton* parent, MidiTrack* track, bool dst) // connect if(dst) { - //printf("Song::chooseMidiRoutes adding route src track name: %s dst device name: %s\n", track->name().latin1(), md->name().latin1()); + //printf("Song::chooseMidiRoutes adding route src track name: %s dst device name: %s\n", track->name().toLatin1().constData(), md->name().toLatin1().constData()); audio->msgAddRoute(bRoute, aRoute); } else { - //printf("Song::chooseMidiRoutes adding route src device name: %s dst track name: %s\n", md->name().latin1(), track->name().latin1()); + //printf("Song::chooseMidiRoutes adding route src device name: %s dst track name: %s\n", md->name().toLatin1().constData(), track->name().toLatin1().constData()); audio->msgAddRoute(aRoute, bRoute); } } @@ -3214,14 +3214,14 @@ void Song::insertTrack2(Track* track, int idx) const RouteList* rl = track->inRoutes(); for (ciRoute r = rl->begin(); r != rl->end(); ++r) { - //printf("Song::insertTrack2 %s in route port:%d\n", track->name().latin1(), r->midiPort); // p3.3.50 + //printf("Song::insertTrack2 %s in route port:%d\n", track->name().toLatin1().constData(), r->midiPort); // p3.3.50 Route src(track, r->channel); midiPorts[r->midiPort].outRoutes()->push_back(src); } rl = track->outRoutes(); for (ciRoute r = rl->begin(); r != rl->end(); ++r) { - //printf("Song::insertTrack2 %s out route port:%d\n", track->name().latin1(), r->midiPort); // p3.3.50 + //printf("Song::insertTrack2 %s out route port:%d\n", track->name().toLatin1().constData(), r->midiPort); // p3.3.50 Route src(track, r->channel); midiPorts[r->midiPort].inRoutes()->push_back(src); } @@ -3332,7 +3332,7 @@ void Song::removeTrack1(Track* track) void Song::removeTrack2(Track* track) { - //printf("Song::removeTrack2 track:%s\n", track->name().latin1()); // p3.3.50 + //printf("Song::removeTrack2 track:%s\n", track->name().toLatin1().constData()); // p3.3.50 switch(track->type()) { case Track::MIDI: @@ -3415,7 +3415,7 @@ void Song::removeTrack2(Track* track) { //if(r->track == track) // r->track->outRoutes()->removeRoute(*r); - //printf("Song::removeTrack2 %s audio out track:%s\n", track->name().latin1(), r->track->name().latin1()); // p3.3.50 + //printf("Song::removeTrack2 %s audio out track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 // p3.3.50 Route src(track, r->channel, r->channels); src.remoteChannel = r->remoteChannel; @@ -3429,7 +3429,7 @@ void Song::removeTrack2(Track* track) { //if(r->track == track) // r->track->inRoutes()->removeRoute(*r); - //printf("Song::removeTrack2 %s audio in track:%s\n", track->name().latin1(), r->track->name().latin1()); // p3.3.50 + //printf("Song::removeTrack2 %s audio in track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 // p3.3.50 Route src(track, r->channel, r->channels); src.remoteChannel = r->remoteChannel; @@ -3441,14 +3441,14 @@ void Song::removeTrack2(Track* track) const RouteList* rl = track->inRoutes(); for (ciRoute r = rl->begin(); r != rl->end(); ++r) { - //printf("Song::removeTrack2 %s in route port:%d\n", track->name().latin1(), r->midiPort); // p3.3.50 + //printf("Song::removeTrack2 %s in route port:%d\n", track->name().toLatin1().constData(), r->midiPort); // p3.3.50 Route src(track, r->channel); midiPorts[r->midiPort].outRoutes()->removeRoute(src); } rl = track->outRoutes(); for (ciRoute r = rl->begin(); r != rl->end(); ++r) { - //printf("Song::removeTrack2 %s out route port:%d\n", track->name().latin1(), r->midiPort); // p3.3.50 + //printf("Song::removeTrack2 %s out route port:%d\n", track->name().toLatin1().constData(), r->midiPort); // p3.3.50 Route src(track, r->channel); midiPorts[r->midiPort].inRoutes()->removeRoute(src); } @@ -3460,7 +3460,7 @@ void Song::removeTrack2(Track* track) { //if(r->track == track) // r->track->outRoutes()->removeRoute(*r); - //printf("Song::removeTrack2 %s in route track:%s\n", track->name().latin1(), r->track->name().latin1()); // p3.3.50 + //printf("Song::removeTrack2 %s in route track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 // p3.3.50 Route src(track, r->channel, r->channels); src.remoteChannel = r->remoteChannel; @@ -3471,7 +3471,7 @@ void Song::removeTrack2(Track* track) { //if(r->track == track) // r->track->inRoutes()->removeRoute(*r); - //printf("Song::removeTrack2 %s out route track:%s\n", track->name().latin1(), r->track->name().latin1()); // p3.3.50 + //printf("Song::removeTrack2 %s out route track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 // p3.3.50 Route src(track, r->channel, r->channels); src.remoteChannel = r->remoteChannel; diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp index a95b92a2..9254546e 100644 --- a/muse2/muse/songfile.cpp +++ b/muse2/muse/songfile.cpp @@ -374,7 +374,7 @@ Part* readXmlPart(Xml& xml, Track* track, bool doClone, bool toTrack) { //printf("readClone: warning: event not in part: %d - %d -%d, discarded\n", printf("readClone: warning: event at tick:%d not in part:%s, discarded\n", - tick, npart->name().latin1()); + tick, npart->name().toLatin1().constData()); } else { @@ -419,7 +419,7 @@ Part* readXmlPart(Xml& xml, Track* track, bool doClone, bool toTrack) } else if (tag == "uuid") { - uuid_parse(xml.s2().latin1(), uuid); + uuid_parse(xml.s2().toLatin1().constData(), uuid); if(!uuid_is_null(uuid)) { uuidvalid = true; @@ -672,7 +672,7 @@ void Part::read(Xml& xml, int, bool toTrack) // int newPartOffset { //printf("Part::read: warning: event not in part: %d - %d -%d, discarded\n", printf("Part::read: warning: event at tick:%d not in part:%s, discarded\n", - tick, name().latin1()); + tick, name().toLatin1().constData()); } else { _events->add(e); @@ -738,7 +738,7 @@ void Part::read(Xml& xml, int, bool toTrack) // int newPartOffset id = xml.s2().toInt(); else if (tag == "uuid") { - uuid_parse(xml.s2().latin1(), uuid); + uuid_parse(xml.s2().toLatin1().constData(), uuid); if(!uuid_is_null(uuid)) uuidvalid = true; } @@ -896,8 +896,8 @@ void Song::writeFont(int level, Xml& xml, const char* name, const QFont& font) const { xml.nput(level, "<%s family=\"%s\" size=\"%d\"", - //name, font.family().latin1(), font.pointSize()); - name, Xml::xmlString(font.family()).latin1(), font.pointSize()); + //name, font.family().toLatin1().constData(), font.pointSize()); + name, Xml::xmlString(font.family()).toLatin1().constData(), font.pointSize()); if (font.weight() != QFont::Normal) xml.nput(" weight=\"%d\"", font.weight()); if (font.italic()) @@ -958,7 +958,7 @@ Part* MusE::readPart(Xml& xml) case Xml::Text: { int trackIdx, partIdx; - sscanf(tag.latin1(), "%d:%d", &trackIdx, &partIdx); + sscanf(tag.toLatin1().constData(), "%d:%d", &trackIdx, &partIdx); Track* track = song->tracks()->index(trackIdx); if (track) part = track->parts()->find(partIdx); diff --git a/muse2/muse/stringparam.cpp b/muse2/muse/stringparam.cpp index b3b5104e..3444dc8b 100644 --- a/muse2/muse/stringparam.cpp +++ b/muse2/muse/stringparam.cpp @@ -89,7 +89,7 @@ void StringParamMap::read(Xml& xml, const QString& name) if(tag == name) { // Add or modify the item. - set(n.latin1(), value.latin1()); + set(n.toLatin1(), value.toLatin1()); return; } default: diff --git a/muse2/muse/synth.cpp b/muse2/muse/synth.cpp index 8955bd3b..93aa0763 100644 --- a/muse2/muse/synth.cpp +++ b/muse2/muse/synth.cpp @@ -123,7 +123,7 @@ static Synth* findSynth(const QString& sclass, const QString& label) return *i; } - printf("synthi class:%s label:%s not found\n", sclass.latin1(), label.latin1()); + printf("synthi class:%s label:%s not found\n", sclass.toLatin1().constData(), label.toLatin1().constData()); return 0; } @@ -151,7 +151,7 @@ static SynthI* createSynthInstance(const QString& sclass, const QString& label) } } else - printf("createSynthInstance: synthi class:%s label:%s not found\n", sclass.latin1(), label.latin1()); + printf("createSynthInstance: synthi class:%s label:%s not found\n", sclass.toLatin1().constData(), label.toLatin1().constData()); return si; } @@ -183,7 +183,8 @@ void* MessSynth::instantiate(const QString& instanceName) //QString instanceName = baseName() + "-" + n; doSetuid(); - const char* path = info.filePath().latin1(); + QByteArray ba = info.filePath().toLatin1(); + const char* path = ba.constData(); // load Synti dll void* handle = dlopen(path, RTLD_NOW); @@ -214,7 +215,7 @@ void* MessSynth::instantiate(const QString& instanceName) undoSetuid(); return 0; } - Mess* mess = _descr->instantiate(sampleRate, muse, &museProject, instanceName.latin1()); + Mess* mess = _descr->instantiate(sampleRate, muse, &museProject, instanceName.toLatin1().constData()); undoSetuid(); return mess; } @@ -497,7 +498,7 @@ void initMidiSynth() QDir pluginDir(s, QString("*.so")); // ddskrjo if (debugMsg) - printf("searching for software synthesizer in <%s>\n", s.latin1()); + printf("searching for software synthesizer in <%s>\n", s.toLatin1().constData()); if (pluginDir.exists()) { QFileInfoList list = pluginDir.entryInfoList(); QFileInfoListIterator it=list.begin(); @@ -506,10 +507,11 @@ void initMidiSynth() fi = &*it; //doSetuid(); - const char* path = fi->filePath().latin1(); + QByteArray ba = fi->filePath().toLatin1(); + const char* path = ba.constData(); // load Synti dll - //printf("initMidiSynth: dlopen file:%s name:%s desc:%s\n", fi->filePath().latin1(), QString(descr->name), QString(descr->description), QString(""), QString(descr->version))); + //printf("initMidiSynth: dlopen file:%s name:%s desc:%s\n", fi->filePath().toLatin1().constData(), QString(descr->name), QString(descr->description), QString(""), QString(descr->version))); void* handle = dlopen(path, RTLD_NOW); if (handle == 0) { fprintf(stderr, "initMidiSynth: MESS dlopen(%s) failed: %s\n", path, dlerror()); @@ -547,7 +549,7 @@ void initMidiSynth() ++it; continue; } - //Mess* mess = descr->instantiate(sampleRate, muse, &museProject, instanceName.latin1()); + //Mess* mess = descr->instantiate(sampleRate, muse, &museProject, instanceName.toLatin1().constData()); //undoSetuid(); @@ -572,7 +574,7 @@ void initMidiSynth() //SynthI* Song::createSynthI(const QString& sclass) SynthI* Song::createSynthI(const QString& sclass, const QString& label) { - //printf("Song::createSynthI calling ::createSynthI class:%s\n", sclass.latin1()); + //printf("Song::createSynthI calling ::createSynthI class:%s\n", sclass.toLatin1().constData()); //SynthI* si = ::createSynthI(sclass); //SynthI* si = ::createSynthI(sclass, label); diff --git a/muse2/muse/track.cpp b/muse2/muse/track.cpp index 0267763a..a90aa3c1 100644 --- a/muse2/muse/track.cpp +++ b/muse2/muse/track.cpp @@ -136,7 +136,7 @@ int Track::y() const return yy; yy += (*it)->height(); } - printf("Track::y(%s): track not in tracklist\n", name().latin1()); + printf("Track::y(%s): track not in tracklist\n", name().toLatin1().constData()); return -1; } @@ -353,7 +353,7 @@ void Track::clearRecAutomation(bool clearList) void Track::dump() const { printf("Track <%s>: typ %d, parts %zd sel %d\n", - _name.latin1(), _type, _parts.size(), _selected); + _name.toLatin1().constData(), _type, _parts.size(), _selected); } //--------------------------------------------------------- @@ -757,7 +757,7 @@ void Track::writeRouting(int level, Xml& xml) const // p3.3.38 New routing scheme. ///xml.strTag(level, "srcNode", r->name()); - //xml.tag(level, "source type=\"%d\" name=\"%s\"/", r->type, r->name().latin1()); + //xml.tag(level, "source type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData()); s = QT_TR_NOOP("source"); if(r->type != Route::TRACK_ROUTE) s += QString(QT_TR_NOOP(" type=\"%1\"")).arg(r->type); @@ -768,12 +768,12 @@ void Track::writeRouting(int level, Xml& xml) const ///xml.strTag(level, "dstNode", dst.name()); //if(r->channel != -1) - // xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, r->channel, name().latin1()); + // xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, r->channel, name().toLatin1().constData()); //else - // xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, name().latin1()); + // xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, name().toLatin1().constData()); - //xml.tag(level, "dest name=\"%s\"/", name().latin1()); - xml.tag(level, "dest name=\"%s\"/", Xml::xmlString(name()).latin1()); + //xml.tag(level, "dest name=\"%s\"/", name().toLatin1().constData()); + xml.tag(level, "dest name=\"%s\"/", Xml::xmlString(name()).toLatin1().constData()); xml.etag(level--, "Route"); } @@ -819,34 +819,34 @@ void Track::writeRouting(int level, Xml& xml) const // thisChannel is the 'starting' channel of this source if feeding a regular track. //if(r->type == Route::TRACK_ROUTE && r->track->isSynti() && r->channel != -1) //if(isSynti() && r->thisChannel != -1) - //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, r->channel, name().latin1()); - // xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, r->thisChannel, name().latin1()); + //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, r->channel, name().toLatin1().constData()); + // xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, r->thisChannel, name().toLatin1().constData()); //else //if(r->channel != -1) - // xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, r->channel, name().latin1()); + // xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, r->channel, name().toLatin1().constData()); //else - // xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, name().latin1()); - //xml.tag(level, "source name=\"%s\"/", name().latin1()); - xml.tag(level, "source name=\"%s\"/", Xml::xmlString(name()).latin1()); + // xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, name().toLatin1().constData()); + //xml.tag(level, "source name=\"%s\"/", name().toLatin1().constData()); + xml.tag(level, "source name=\"%s\"/", Xml::xmlString(name()).toLatin1().constData()); ///xml.strTag(level, "dstNode", r->name()); //if(r->channel != -1) - // xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", r->type, r->channel, r->name().latin1()); + // xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", r->type, r->channel, r->name().toLatin1().constData()); //else - // xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().latin1()); + // xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData()); // Allow for a regular mono or stereo track to feed a multi-channel synti. // Channel is the 'starting' channel of the destination. //if(r->type == Route::TRACK_ROUTE && r->track->isSynti() && r->channel != -1) //if(r->type == Route::TRACK_ROUTE && r->track->type() == Track::AUDIO_SOFTSYNTH && r->remoteChannel != -1) - // xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", r->type, r->remoteChannel, r->name().latin1()); + // xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", r->type, r->remoteChannel, r->name().toLatin1().constData()); //else //if(r->type == Route::MIDI_DEVICE_ROUTE) - // xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", r->device->deviceType(), r->name().latin1()); + // xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", r->device->deviceType(), r->name().toLatin1().constData()); //else - // xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().latin1()); + // xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData()); s = QT_TR_NOOP("dest"); diff --git a/muse2/muse/undo.cpp b/muse2/muse/undo.cpp index a3bd68f8..8d218b0f 100644 --- a/muse2/muse/undo.cpp +++ b/muse2/muse/undo.cpp @@ -45,10 +45,10 @@ void UndoOp::dump() switch(type) { case AddTrack: case DeleteTrack: - printf("%d %s\n", trackno, oTrack->name().latin1()); + printf("%d %s\n", trackno, oTrack->name().toLatin1().constData()); break; case ModifyTrack: - printf("%d <%s>-<%s>\n", trackno, oTrack->name().latin1(), nTrack->name().latin1()); + printf("%d <%s>-<%s>\n", trackno, oTrack->name().toLatin1().constData(), nTrack->name().toLatin1().constData()); break; case AddPart: case DeletePart: @@ -221,7 +221,7 @@ void Song::doUndo2() case UndoOp::ModifyTrack: { // Added by Tim. p3.3.6 - //printf("Song::doUndo2 ModifyTrack #1 oTrack %p %s nTrack %p %s\n", i->oTrack, i->oTrack->name().latin1(), i->nTrack, i->nTrack->name().latin1()); + //printf("Song::doUndo2 ModifyTrack #1 oTrack %p %s nTrack %p %s\n", i->oTrack, i->oTrack->name().toLatin1().constData(), i->nTrack, i->nTrack->name().toLatin1().constData()); // Unchain the track parts, but don't touch the ref counts. unchainTrackParts(i->nTrack, false); @@ -233,7 +233,7 @@ void Song::doUndo2() *(i->nTrack) = *(i->oTrack); // Added by Tim. p3.3.6 - //printf("Song::doUndo2 ModifyTrack #2 oTrack %p %s nTrack %p %s\n", i->oTrack, i->oTrack->name().latin1(), i->nTrack, i->nTrack->name().latin1()); + //printf("Song::doUndo2 ModifyTrack #2 oTrack %p %s nTrack %p %s\n", i->oTrack, i->oTrack->name().toLatin1().constData(), i->nTrack, i->nTrack->name().toLatin1().constData()); // Prevent delete i->oTrack from crashing. switch(i->oTrack->type()) @@ -265,7 +265,7 @@ void Song::doUndo2() chainTrackParts(i->nTrack, false); // Added by Tim. p3.3.6 - //printf("Song::doUndo2 ModifyTrack #3 oTrack %p %s nTrack %p %s\n", i->oTrack, i->oTrack->name().latin1(), i->nTrack, i->nTrack->name().latin1()); + //printf("Song::doUndo2 ModifyTrack #3 oTrack %p %s nTrack %p %s\n", i->oTrack, i->oTrack->name().toLatin1().constData(), i->nTrack, i->nTrack->name().toLatin1().constData()); // Connect and register ports. switch(i->nTrack->type()) @@ -686,7 +686,7 @@ void Song::undoOp(UndoOp::UndoType type, int n, Track* oldTrack, Track* newTrack i.oTrack = oldTrack; i.nTrack = newTrack; // Added by Tim. p3.3.6 - //printf("Song::undoOp ModifyTrack oTrack %p %s nTrack %p %s\n", i.oTrack, i.oTrack->name().latin1(), i.nTrack, i.nTrack->name().latin1()); + //printf("Song::undoOp ModifyTrack oTrack %p %s nTrack %p %s\n", i.oTrack, i.oTrack->name().toLatin1().constData(), i.nTrack, i.nTrack->name().toLatin1().constData()); addUndo(i); } diff --git a/muse2/muse/vst.cpp b/muse2/muse/vst.cpp index ddb2e87d..29289924 100644 --- a/muse2/muse/vst.cpp +++ b/muse2/muse/vst.cpp @@ -270,14 +270,14 @@ long vstHostCallback(AEffect* effect, static void scanVstDir(const QString& s) { if (debugMsg) - printf("scan vst plugin dir <%s>\n", s.latin1()); + printf("scan vst plugin dir <%s>\n", s.toLatin1()); QDir pluginDir(s, QString("*.dll"), QDir::Files); if (pluginDir.exists()) { const QFileInfoList* list = pluginDir.entryInfoList(); QFileInfoListIterator it(*list); QFileInfo* fi; while((fi = it.current())) { - char* path = strdup(fi->filePath().latin1()); + char* path = strdup(fi->filePath().toLatin1()); FSTInfo* info = fst_get_info(path); if (info) { if (info->numInputs == 0 && info->numOutputs) @@ -422,7 +422,7 @@ void* VstSynth::instantiate() n.setNum(_instances); QString instanceName = baseName() + "-" + n; doSetuid(); - const char* path = info.filePath().latin1(); + const char* path = info.filePath().toLatin1(); fstHandle = fst_load(path); if (fstHandle == 0) { diff --git a/muse2/muse/wave.cpp b/muse2/muse/wave.cpp index 71537735..347bd972 100644 --- a/muse2/muse/wave.cpp +++ b/muse2/muse/wave.cpp @@ -92,9 +92,9 @@ bool SndFile::openRead() } QString p = path(); sfinfo.format = 0; - sf = sf_open(p.latin1(), SFM_READ, &sfinfo); + sf = sf_open(p.toLatin1().constData(), SFM_READ, &sfinfo); sfinfo.format = 0; - sfUI = sf_open(p.latin1(), SFM_READ, &sfinfo); + sfUI = sf_open(p.toLatin1().constData(), SFM_READ, &sfinfo); if (sf == 0 || sfUI == 0) return true; @@ -117,9 +117,9 @@ void SndFile::update() // force recreation of wca data QString cacheName = finfo->dirPath(true) + QString("/") + finfo->baseName(true) + QString(".wca"); - ::remove(cacheName.latin1()); + ::remove(cacheName.toLatin1().constData()); if (openRead()) { - printf("SndFile::update openRead(%s) failed: %s\n", path().latin1(), strerror().latin1()); + printf("SndFile::update openRead(%s) failed: %s\n", path().toLatin1().constData(), strerror().toLatin1().constData()); } } @@ -130,7 +130,7 @@ void SndFile::update() void SndFile::readCache(const QString& path, bool showProgress) { // printf("readCache %s for %d samples channel %d\n", -// path.latin1(), samples(), channels()); +// path.toLatin1().constData(), samples(), channels()); if (cache) { for (unsigned i = 0; i < channels(); ++i) @@ -146,7 +146,7 @@ void SndFile::readCache(const QString& path, bool showProgress) for (unsigned ch = 0; ch < channels(); ++ch) cache[ch] = new SampleV[csize]; - FILE* cfile = fopen(path.latin1(), "r"); + FILE* cfile = fopen(path.toLatin1().constData(), "r"); if (cfile) { for (unsigned ch = 0; ch < channels(); ++ch) fread(cache[ch], csize * sizeof(SampleV), 1, cfile); @@ -211,7 +211,7 @@ void SndFile::readCache(const QString& path, bool showProgress) void SndFile::writeCache(const QString& path) { - FILE* cfile = fopen(path.latin1(), "w"); + FILE* cfile = fopen(path.toLatin1().constData(), "w"); if (cfile == 0) return; for (unsigned ch = 0; ch < channels(); ++ch) @@ -341,7 +341,7 @@ bool SndFile::openWrite() return false; } QString p = path(); - sf = sf_open(p.latin1(), SFM_RDWR, &sfinfo); + sf = sf_open(p.toLatin1().constData(), SFM_RDWR, &sfinfo); sfUI = 0; if (sf) { openFlag = true; @@ -630,14 +630,14 @@ SndFile* getWave(const QString& inName, bool readOnlyFlag) } } } -// printf("=====%s %s\n", inName.latin1(), name.latin1()); +// printf("=====%s %s\n", inName.toLatin1().constData(), name.toLatin1().constData()); // only open one instance of wave file SndFile* f = SndFile::sndFiles.search(name); if (f == 0) { if (!QFile::exists(name)) { fprintf(stderr, "wave file <%s> not found\n", - name.latin1()); + name.toLatin1().constData()); return 0; } f = new SndFile(name); @@ -659,9 +659,9 @@ SndFile* getWave(const QString& inName, bool readOnlyFlag) } if (error) { fprintf(stderr, "open wave file(%s) for %s failed: %s\n", - name.latin1(), + name.toLatin1().constData(), readOnlyFlag ? "writing" : "reading", - f->strerror().latin1()); + f->strerror().toLatin1().constData()); QMessageBox::critical(NULL, "MusE import error.", "MusE failed to import the file.\n" "Possibly this wasn't a sound file?\n" @@ -709,24 +709,24 @@ void SndFile::applyUndoFile(const QString& original, const QString& tmpfile, uns // put in the tmpfile, and when redo is eventually called the data is switched again (causing the muted data to be written to the "original" // file. The data is merely switched. - //printf("Applying undofile: orig=%s tmpfile=%s startframe=%d endframe=%d\n", original.latin1(), tmpfile.latin1(), startframe, endframe); + //printf("Applying undofile: orig=%s tmpfile=%s startframe=%d endframe=%d\n", original.toLatin1().constData(), tmpfile.toLatin1().constData(), startframe, endframe); SndFile* orig = sndFiles.search(original); SndFile tmp = SndFile(tmpfile); if (!orig) { - printf("Internal error: could not find original file: %s in filelist - Aborting\n", original.latin1()); + printf("Internal error: could not find original file: %s in filelist - Aborting\n", original.toLatin1().constData()); return; } if (!orig->isOpen()) { if (orig->openRead()) { - printf("Cannot open original file %s for reading - cannot undo! Aborting\n", original.latin1()); + printf("Cannot open original file %s for reading - cannot undo! Aborting\n", original.toLatin1().constData()); return; } } if (!tmp.isOpen()) { if (tmp.openRead()) { - printf("Could not open temporary file %s for writing - cannot undo! Aborting\n", tmpfile.latin1()); + printf("Could not open temporary file %s for writing - cannot undo! Aborting\n", tmpfile.toLatin1().constData()); return; } } @@ -876,7 +876,7 @@ ClipBase::ClipBase(const SndFileR& file, int start, int l) { refCount = 0; for (int i = 1; true; ++i) { - _name.sprintf("%s.%d", f.basename().latin1(), i); + _name.sprintf("%s.%d", f.basename().toLatin1().constData(), i); ciClip ic = waveClips->begin(); for (; ic != waveClips->end(); ++ic) { if ((*ic)->name() == _name) @@ -1002,7 +1002,7 @@ Clip ClipList::search(const QString& name) const if ((*i)->name() == name) return Clip(*i); fprintf(stderr, "ClipList: clip <%s> not found\n", - name.latin1()); + name.toLatin1().constData()); return Clip(); } @@ -1046,7 +1046,7 @@ void Song::cmdAddRecordedWave(WaveTrack* track, Pos s, Pos e) SndFile* f = track->recFile(); if (f == 0) { printf("cmdAddRecordedWave: no snd file for track <%s>\n", - track->name().latin1()); + track->name().toLatin1().constData()); return; } @@ -1071,9 +1071,9 @@ void Song::cmdAddRecordedWave(WaveTrack* track, Pos s, Pos e) delete f; // The function which calls this function already does this immediately after. But do it here anyway. track->setRecFile(0); - remove(s.latin1()); + remove(s.toLatin1().constData()); if(debugMsg) - printf("Song::cmdAddRecordedWave: remove file %s\n", s.latin1()); + printf("Song::cmdAddRecordedWave: remove file %s\n", s.toLatin1().constData()); return; } // Round the start down using the Arranger part snap raster value. @@ -1121,8 +1121,8 @@ void Song::cmdChangeWave(QString original, QString tmpfile, unsigned sx, unsigne { char* original_charstr = new char[original.length() + 1]; char* tmpfile_charstr = new char[tmpfile.length() + 1]; - strcpy(original_charstr, original.latin1()); - strcpy(tmpfile_charstr, tmpfile.latin1()); + strcpy(original_charstr, original.toLatin1().constData()); + strcpy(tmpfile_charstr, tmpfile.toLatin1().constData()); song->undoOp(UndoOp::ModifyClip, original_charstr, tmpfile_charstr, sx, ex); } diff --git a/muse2/muse/waveedit/editgain.cpp b/muse2/muse/waveedit/editgain.cpp index f93430a0..c36df603 100644 --- a/muse2/muse/waveedit/editgain.cpp +++ b/muse2/muse/waveedit/editgain.cpp @@ -18,7 +18,7 @@ EditGain::EditGain(QWidget* parent, int initGainValue) : QDialog(parent) { setupUi(this); - sliderGain->setValue(sliderGain->maxValue() - initGainValue); + sliderGain->setValue(sliderGain->maximum() - initGainValue); connect(buttonReset, SIGNAL(pressed()), this, SLOT(resetPressed())); connect(buttonApply, SIGNAL(pressed()), this, SLOT(applyPressed())); connect(buttonCancel,SIGNAL(pressed()), this, SLOT(cancelPressed())); @@ -70,7 +70,7 @@ void EditGain::cancelPressed() */ void EditGain::gainChanged(int value) { - gain = sliderGain->maxValue() - value; + gain = sliderGain->maximum() - value; if (sliderGain->value() != 100) { buttonReset->setEnabled(true); buttonApply->setEnabled(true); diff --git a/muse2/muse/waveedit/waveview.cpp b/muse2/muse/waveedit/waveview.cpp index b357408c..cf22a4d0 100644 --- a/muse2/muse/waveedit/waveview.cpp +++ b/muse2/muse/waveedit/waveview.cpp @@ -620,7 +620,7 @@ WaveSelectionList WaveView::getSelection(unsigned startpos, unsigned stoppos) tmp_sx < (int)event_startpos ? sx = event_startpos : sx = tmp_sx; tmp_ex > (int)event_length ? ex = event_length : ex = tmp_ex; - //printf("Event data affected: %d->%d filename:%s\n", sx, ex, file.name().latin1()); + //printf("Event data affected: %d->%d filename:%s\n", sx, ex, file.name().toLatin1().constData()); WaveEventSelection s; s.file = file; s.startframe = sx; @@ -849,7 +849,7 @@ void WaveView::editExternal(unsigned file_format, unsigned file_samplerate, unsi // Forkaborkabork int pid = fork(); if (pid == 0) { - if (execlp(config.externalWavEditor.latin1(), config.externalWavEditor.latin1(), exttmpFileName.latin1(), NULL) == -1) { + if (execlp(config.externalWavEditor.toLatin1().constData(), config.externalWavEditor.toLatin1().constData(), exttmpFileName.toLatin1().constData(), NULL) == -1) { perror("Failed to launch external editor"); // Get out of here diff --git a/muse2/muse/waveevent.cpp b/muse2/muse/waveevent.cpp index 98bfe8cc..867ce5c8 100644 --- a/muse2/muse/waveevent.cpp +++ b/muse2/muse/waveevent.cpp @@ -304,7 +304,7 @@ void WaveEventBase::readAudio(WavePart* part, unsigned offset, float** buffer, i #ifdef WAVEEVENT_DEBUG_PRC printf("WaveEventBase::readAudio %s processing converter... inFrames:%ld inSize:%ld outFrames:%ld outSize:%ld rn:%d", - f.name().latin1(), inFrames, inSize, outFrames, outSize, rn); + f.name().toLatin1(), inFrames, inSize, outFrames, outSize, rn); #endif //int srcerr = src_process(src_state, &srcdata); @@ -343,14 +343,14 @@ void WaveEventBase::readAudio(WavePart* part, unsigned offset, float** buffer, i { if(srcdata.output_frames_gen != outFrames) printf("WaveEventBase::readAudio %s output_frames_gen:%ld != outFrames:%ld outSize:%ld inFrames:%ld srcdata.input_frames_used:%ld inSize:%ld rn:%d\n", - f.name().latin1(), srcdata.output_frames_gen, outFrames, outSize, inFrames, srcdata.input_frames_used, inSize, rn); + f.name().toLatin1(), srcdata.output_frames_gen, outFrames, outSize, inFrames, srcdata.input_frames_used, inSize, rn); } if(inFrames != (long)rn) { if(debugMsg) printf("WaveEventBase::readAudio %s rn:%zd != inFrames:%ld output_frames_gen:%ld outFrames:%ld outSize:%ld srcdata.input_frames_used:%ld inSize:%ld\n", - f.name().latin1(), rn, inFrames, srcdata.output_frames_gen, outFrames, outSize, srcdata.input_frames_used, inSize); + f.name().toLatin1(), rn, inFrames, srcdata.output_frames_gen, outFrames, outSize, srcdata.input_frames_used, inSize); // We've reached the end of the file. Convert the number of frames read. //rn = (double)rn * srcratio + 1; diff --git a/muse2/muse/wavetrack.cpp b/muse2/muse/wavetrack.cpp index 0c2298a8..9202f84e 100644 --- a/muse2/muse/wavetrack.cpp +++ b/muse2/muse/wavetrack.cpp @@ -29,7 +29,7 @@ void WaveTrack::fetchData(unsigned pos, unsigned samples, float** bp, bool doSee { // Added by Tim. p3.3.17 #ifdef WAVETRACK_DEBUG - printf("WaveTrack::fetchData %s samples:%lu pos:%u\n", name().latin1(), samples, pos); + printf("WaveTrack::fetchData %s samples:%lu pos:%u\n", name().toLatin1().constData(), samples, pos); #endif // reset buffer to zero @@ -275,7 +275,7 @@ bool WaveTrack::getData(unsigned framePos, int channels, unsigned nframe, float* unsigned pos; if (_prefetchFifo.get(channels, nframe, outBuffers, &pos)) { printf("WaveTrack::getData(%s) fifo underrun\n", - name().latin1()); + name().toLatin1().constData()); return false; } if (pos != framePos) { @@ -287,7 +287,7 @@ bool WaveTrack::getData(unsigned framePos, int channels, unsigned nframe, float* while (pos < framePos) { if (_prefetchFifo.get(channels, nframe, bp, &pos)) { printf("WaveTrack::getData(%s) fifo underrun\n", - name().latin1()); + name().toLatin1().constData()); return false; } } @@ -316,7 +316,7 @@ bool WaveTrack::getData(unsigned framePos, int channels, unsigned nframe, float* unsigned pos; if (_prefetchFifo.get(channels, nframe, bp, &pos)) { printf("WaveTrack::getData(%s) fifo underrun\n", - name().latin1()); + name().toLatin1().constData()); return false; } if (pos != framePos) { @@ -326,14 +326,14 @@ bool WaveTrack::getData(unsigned framePos, int channels, unsigned nframe, float* while (pos < framePos) { if (_prefetchFifo.get(channels, nframe, bp, &pos)) { printf("WaveTrack::getData(%s) fifo underrun\n", - name().latin1()); + name().toLatin1().constData()); return false; } } } // p3.3.41 - //fprintf(stderr, "WaveTrack::getData %s data: nframe:%ld %e %e %e %e\n", name().latin1(), nframe, bp[0][0], bp[0][1], bp[0][2], bp[0][3]); + //fprintf(stderr, "WaveTrack::getData %s data: nframe:%ld %e %e %e %e\n", name().toLatin1().constData(), nframe, bp[0][0], bp[0][1], bp[0][2], bp[0][3]); } //} diff --git a/muse2/muse/widgets/canvas.cpp b/muse2/muse/widgets/canvas.cpp index ec138af5..35a80aad 100644 --- a/muse2/muse/widgets/canvas.cpp +++ b/muse2/muse/widgets/canvas.cpp @@ -628,7 +628,7 @@ void Canvas::viewMousePressEvent(QMouseEvent* event) else { drag = DRAG_NEW; setCursor(); - curItem = newItem(start, event->state()); + curItem = newItem(start, event->modifiers()); if (curItem) items.add(curItem); else { @@ -1124,7 +1124,7 @@ void Canvas::viewMouseReleaseEvent(QMouseEvent* event) case DRAG_LASSO: if (!shift) deselectAll(); - lasso = lasso.normalize(); + lasso = lasso.normalized(); selectLasso(shift); updateSelection(); redrawFlag = true; @@ -1395,14 +1395,17 @@ QMenu* Canvas::genCanvasPopup() if (canvasTools == 0) return 0; QMenu* canvasPopup = new QMenu(this); + QAction* act0 = 0; for (unsigned i = 0; i < 9; ++i) { if ((canvasTools & (1 << i))==0) continue; QAction* act = canvasPopup->addAction(QIcon(**toolList[i].icon), tr(toolList[i].tip)); act->setData(1<<i); // ddskrjo + if (!act0) + act0 = act; } - canvasPopup->setActiveItem(0); + canvasPopup->setActiveAction(act0); return canvasPopup; } diff --git a/muse2/muse/widgets/filedialog.cpp b/muse2/muse/widgets/filedialog.cpp index 21bbbb27..b02aefbc 100644 --- a/muse2/muse/widgets/filedialog.cpp +++ b/muse2/muse/widgets/filedialog.cpp @@ -37,7 +37,7 @@ static bool createDir(const QString& s) if (!QDir(path + sl + *it).exists()) { if (!dir.mkdir(*it)) { printf("mkdir failed: %s %s\n", - path.toLatin1().data(), (*it).toLatin1().data()); + path.toLatin1().constData(), (*it).toLatin1().constData()); return true; } } @@ -224,7 +224,7 @@ void MFileDialog::directoryChanged(const QString&) { ViewType currentView = GLOBAL_VIEW; QDir ndir = directory(); - ///QString newdir = ndir.absolutePath().latin1(); + ///QString newdir = ndir.absolutePath().toLatin1(); QString newdir = ndir.absolutePath(); if (buttons.projectButton->isChecked()) currentView = PROJECT_VIEW; diff --git a/muse2/muse/widgets/header.cpp b/muse2/muse/widgets/header.cpp index 548ee94c..9b209517 100644 --- a/muse2/muse/widgets/header.cpp +++ b/muse2/muse/widgets/header.cpp @@ -54,12 +54,12 @@ void Header::readStatus(Xml& xml) void Header::writeStatus(int level, Xml& xml) const { //xml.nput(level, "<%s> ", name()); - xml.nput(level, "<%s> ", Xml::xmlString(name()).latin1()); + xml.nput(level, "<%s> ", Xml::xmlString(name()).toLatin1().constData()); int n = count() - 1; for (int i = n; i >= 0; --i) xml.nput("%d ", visualIndex(i)); //xml.put("</%s>", name()); - xml.put("</%s>", Xml::xmlString(name()).latin1()); + xml.put("</%s>", Xml::xmlString(name()).toLatin1().constData()); } //--------------------------------------------------------- diff --git a/muse2/muse/widgets/lcombo.cpp b/muse2/muse/widgets/lcombo.cpp index c41367ed..16fe150a 100644 --- a/muse2/muse/widgets/lcombo.cpp +++ b/muse2/muse/widgets/lcombo.cpp @@ -18,8 +18,9 @@ //--------------------------------------------------------- LabelCombo::LabelCombo(const QString& txt, QWidget* parent, - const char* name) : QWidget(parent, name) + const char* name) : QWidget(parent) { + setObjectName(name); // setFixedHeight(20); QHBoxLayout* layout = new QHBoxLayout(this); QLabel* label = new QLabel(txt, this); diff --git a/muse2/muse/widgets/mtscale.cpp b/muse2/muse/widgets/mtscale.cpp index 59d3b63b..3ed9690a 100644 --- a/muse2/muse/widgets/mtscale.cpp +++ b/muse2/muse/widgets/mtscale.cpp @@ -275,7 +275,7 @@ void MTScale::pdraw(QPainter& p, const QRect& r) else x2 = xp+200; - //printf("MTScale::pdraw marker %s xp:%d y:%d h:%d r.x:%d r.w:%d\n", m->second.name().latin1(), xp, height(), y, r.x(), r.width()); + //printf("MTScale::pdraw marker %s xp:%d y:%d h:%d r.x:%d r.w:%d\n", m->second.name().toLatin1(), xp, height(), y, r.x(), r.width()); // Must be reasonable about very low negative x values! With long songs > 15min // and with high horizontal magnification, 'ghost' drawings appeared, diff --git a/muse2/muse/widgets/scrollscale.cpp b/muse2/muse/widgets/scrollscale.cpp index 08650d18..dbced279 100644 --- a/muse2/muse/widgets/scrollscale.cpp +++ b/muse2/muse/widgets/scrollscale.cpp @@ -147,7 +147,8 @@ void ScrollScale::setRange ( int min, int max ) scroll->setValue ( min ); if ( scroll->value() > max ) scroll->setValue ( max ); - scroll->setSteps ( 20, i ); + scroll->setSingleStep(20); + scroll->setPageStep(i); } //--------------------------------------------------------- @@ -170,8 +171,8 @@ void ScrollScale::setPosNoLimit ( unsigned pos ) { //printf ( "ScrollScale::setPosNoLimit pos:%d scaleVal:%d offset ticks:%d\n", pos, scaleVal, pos2offset ( pos ) ); - if((int)pos > scroll->maxValue()) - scroll->setMaxValue(pos); + if((int)pos > scroll->maximum()) + scroll->setMaximum(pos); scroll->setValue(pos); } @@ -239,7 +240,12 @@ ScrollScale::ScrollScale ( int s1, int s2, int cs, int max_, Qt::Orientation o, delta/=2; } - scale = new QSlider ( 0, 1024, 1, cur, o); + scale = new QSlider (o); + scale->setMinimum(0); + scale->setMaximum(1024); + scale->setPageStep(1); + scale->setValue(cur); + scroll = new QScrollBar ( o ); setScale ( cur ); @@ -277,16 +283,16 @@ void ScrollScale::setPageButtons ( bool flag ) if ( up == 0 ) { up = new QToolButton; - up->setPixmap ( * ( upIcon ) ); + up->setIcon ( QIcon(*upIcon) ); down = new QToolButton; - down->setPixmap ( * ( downIcon ) ); + down->setIcon ( QIcon(*downIcon) ); pageNo = new QLabel; QString s; s.setNum ( _page+1 ); pageNo->setText ( s ); - QToolTip::add ( down, tr ( "next page" ) ); - QToolTip::add ( up, tr ( "previous page" ) ); - QToolTip::add ( pageNo, tr ( "current page number" ) ); + down->setToolTip(tr ( "next page" ) ); + up->setToolTip(tr ( "previous page" ) ); + pageNo->setToolTip(tr ( "current page number" ) ); box->insertWidget ( 1, up ); box->insertWidget ( 2, down ); box->insertSpacing ( 3, 5 ); diff --git a/muse2/muse/widgets/sigedit.cpp b/muse2/muse/widgets/sigedit.cpp index 79cf7885..d4c210e4 100644 --- a/muse2/muse/widgets/sigedit.cpp +++ b/muse2/muse/widgets/sigedit.cpp @@ -414,7 +414,7 @@ void SigEdit::setValue(const Sig& sig) void SigEdit::setValue(const QString& s) { int z, n; - sscanf(s.latin1(), "%d/%d", &z, &n); + sscanf(s.toLatin1(), "%d/%d", &z, &n); Sig sig(z, n); setValue(sig); } @@ -624,7 +624,7 @@ void SigEdit::addNumber(int secNo, int num) QString txt = sectionText(secNo); - //printf("SigEdit::addNumber secNo:%d num:%d voff:%d txt:%s\n", secNo, num, voff, txt.latin1()); + //printf("SigEdit::addNumber secNo:%d num:%d voff:%d txt:%s\n", secNo, num, voff, txt.toLatin1()); if ((unsigned) txt.length() == sec[secNo].len) { //printf("SigEdit::addNumber txt.length() == sec[secNo].len (%d)\n", sec[secNo].len); @@ -643,7 +643,7 @@ void SigEdit::addNumber(int secNo, int num) int temp = txt.toInt() - voff; if (outOfRange(secNo, temp)) { - //printf("SigEdit::addNumber not accepted secNo:%d txt:%s temp:%d\n", secNo, txt.latin1(), temp); + //printf("SigEdit::addNumber not accepted secNo:%d txt:%s temp:%d\n", secNo, txt.toLatin1(), temp); txt = sectionText(secNo); } diff --git a/muse2/muse/widgets/spinboxFP.cpp b/muse2/muse/widgets/spinboxFP.cpp index 503a19a3..2d8f3372 100644 --- a/muse2/muse/widgets/spinboxFP.cpp +++ b/muse2/muse/widgets/spinboxFP.cpp @@ -138,7 +138,7 @@ int SpinBoxFP::valueFromText(const QString& text) const { //QString qs = cleanText(); if (_decimals) { - //const char* s = qs.latin1(); + //const char* s = qs.toLatin1(); //const char* s = cleanText().toAscii().data(); //int a, b; diff --git a/muse2/muse/widgets/splitter.cpp b/muse2/muse/widgets/splitter.cpp index 68925d57..142d5307 100644 --- a/muse2/muse/widgets/splitter.cpp +++ b/muse2/muse/widgets/splitter.cpp @@ -30,13 +30,13 @@ void Splitter::writeStatus(int level, Xml& xml) { QList<int> vl = sizes(); //xml.nput(level++, "<%s>", name()); - xml.nput(level++, "<%s>", Xml::xmlString(name()).latin1()); + xml.nput(level++, "<%s>", Xml::xmlString(name()).toLatin1().constData()); QList<int>::iterator ivl = vl.begin(); for (; ivl != vl.end(); ++ivl) { xml.nput("%d ", *ivl); } //xml.nput("</%s>\n", name()); - xml.nput("</%s>\n", Xml::xmlString(name()).latin1()); + xml.nput("</%s>\n", Xml::xmlString(name()).toLatin1().constData()); } //--------------------------------------------------------- diff --git a/muse2/muse/widgets/utils.cpp b/muse2/muse/widgets/utils.cpp index 3a4fbb67..942468d4 100644 --- a/muse2/muse/widgets/utils.cpp +++ b/muse2/muse/widgets/utils.cpp @@ -118,7 +118,7 @@ QString bitmap2String(int bm) } } } -//printf(" -> <%s>\n", s.latin1()); +//printf(" -> <%s>\n", s.toLatin1()); return s; } @@ -168,7 +168,7 @@ QString u32bitmap2String(unsigned int bm) } } } -//printf(" -> <%s>\n", s.latin1()); +//printf(" -> <%s>\n", s.toLatin1()); return s; } @@ -180,7 +180,7 @@ int string2bitmap(const QString& str) { int val = 0; QString ss = str.simplified(); - const char* s = ss.latin1(); + const char* s = ss.toLatin1(); //printf("string2bitmap <%s>\n", s); if (s == 0) @@ -189,7 +189,7 @@ int string2bitmap(const QString& str) return 0xffff; if (strcmp(s, "none") == 0) return 0; -// printf("str2bitmap: <%s> ", str.latin1); +// printf("str2bitmap: <%s> ", str.toLatin1); int tval = 0; bool range = false; int sval = 0; @@ -238,7 +238,7 @@ unsigned int string2u32bitmap(const QString& str) //int val = 0; unsigned int val = 0; QString ss = str.simplified(); - const char* s = ss.latin1(); + const char* s = ss.toLatin1(); //printf("string2bitmap <%s>\n", s); if (s == 0) @@ -248,7 +248,7 @@ unsigned int string2u32bitmap(const QString& str) return 0xffffffff; if (strcmp(s, "none") == 0) return 0; -// printf("str2bitmap: <%s> ", str.latin1); +// printf("str2bitmap: <%s> ", str.toLatin1); int tval = 0; //unsigned int tval = 0; bool range = false; diff --git a/muse2/muse/xml.cpp b/muse2/muse/xml.cpp index 88251cc8..30cd17f1 100644 --- a/muse2/muse/xml.cpp +++ b/muse2/muse/xml.cpp @@ -197,7 +197,7 @@ Xml::Token Xml::parse() nextc(); if (c == EOF) { printf("unexpected EOF reading *.med file at level %d, line %d, <%s><%s><%s>\n", - level, _line, _tag.latin1(), _s1.latin1(), _s2.latin1()); + level, _line, _tag.toLatin1().constData(), _s1.toLatin1().constData(), _s2.toLatin1().constData()); return level == 0 ? End : Error; } @@ -485,7 +485,7 @@ double Xml::parseDouble() void Xml::unknown(const char* s) { printf("%s: unknown tag <%s> at line %d\n", - s, _s1.latin1(), _line+1); + s, _s1.toLatin1().constData(), _line+1); parse1(); } @@ -598,14 +598,14 @@ void Xml::floatTag(int level, const char* name, float val) { putLevel(level); QString s("<%1>%2</%3>\n"); - fprintf(f, "%s", s.arg(name).arg(val).arg(name).latin1()); + fprintf(f, "%s", s.arg(name).arg(val).arg(name).toLatin1().constData()); } void Xml::doubleTag(int level, const char* name, double val) { putLevel(level); QString s("<%1>%2</%3>\n"); - fprintf(f, "%s", s.arg(name).arg(val).arg(name).latin1()); + fprintf(f, "%s", s.arg(name).arg(val).arg(name).toLatin1().constData()); } void Xml::strTag(int level, const char* name, const char* val) @@ -665,7 +665,7 @@ void Xml::qrectTag(int level, const char* name, const QRect& r) void Xml::strTag(int level, const char* name, const QString& val) { - strTag(level, name, val.latin1()); + strTag(level, name, val.toLatin1().constData()); } //--------------------------------------------------------- diff --git a/muse2/synti/deicsonze-OLD/deicsonze.cpp b/muse2/synti/deicsonze-OLD/deicsonze.cpp index 4eea4102..63c96deb 100644 --- a/muse2/synti/deicsonze-OLD/deicsonze.cpp +++ b/muse2/synti/deicsonze-OLD/deicsonze.cpp @@ -648,10 +648,10 @@ void DeicsOnze::loadSutulaPresets() QString(INSTALL_NAME)); presetPath += "/presets/deicsonze/ARCH_ALIN"; - file = fopen (presetPath.latin1(), "rt"); + file = fopen (presetPath.toLatin1(), "rt"); if (file == NULL) { printf("can't open "); - printf("%s",presetPath.latin1()); + printf("%s",presetPath.toLatin1()); printf("\n"); return; } diff --git a/muse2/synti/deicsonze/deicsonze.cpp b/muse2/synti/deicsonze/deicsonze.cpp index 136275f1..519a7f05 100644 --- a/muse2/synti/deicsonze/deicsonze.cpp +++ b/muse2/synti/deicsonze/deicsonze.cpp @@ -1254,10 +1254,10 @@ void DeicsOnze::loadSet(QString fileName) { _gui->writeEvent(evSysexUpdateGuiSet); } else printf("unsupported *.dei file version %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } else printf("DeicsOnze: %s not supported\n", - e.tagName().toLatin1().data()); + e.tagName().toLatin1().constData()); node = node.nextSibling(); } } @@ -1292,10 +1292,10 @@ void DeicsOnze::loadSutulaPresets() QString presetPath("/home/a-lin/sources/svnMusEDev/lmuse/muse/synti/deicsonze/ARCH_ALIN"); - file = fopen (presetPath.toLatin1().data(), "rt"); + file = fopen (presetPath.toLatin1().constData(), "rt"); if (file == NULL) { printf("can't open "); - printf(presetPath.toLatin1().data()); + printf(presetPath.toLatin1().constData()); printf("\n"); } else @@ -2131,7 +2131,7 @@ void DeicsOnze::readConfiguration(QDomNode qdn) { unsigned char *dataInitSetPath = new unsigned char[1+MAXSTRLENGTHINITSETPATH]; dataInitSetPath[0]=SYSEX_INITSETPATH; - strncpy((char*)&dataInitSetPath[1], _initSetPath.toLatin1().data(), + strncpy((char*)&dataInitSetPath[1], _initSetPath.toLatin1().constData(), MAXSTRLENGTHINITSETPATH); MidiPlayEvent evInitSetPath(0, 0, ME_SYSEX, (const unsigned char*)dataInitSetPath, @@ -2155,7 +2155,7 @@ void DeicsOnze::readConfiguration(QDomNode qdn) { new unsigned char[1+MAXSTRLENGTHBACKGROUNDPIXPATH]; dataBackgroundPixPath[0]=SYSEX_BACKGROUNDPIXPATH; strncpy((char*)&dataBackgroundPixPath[1], - _backgroundPixPath.toLatin1().data(), + _backgroundPixPath.toLatin1().constData(), MAXSTRLENGTHBACKGROUNDPIXPATH); MidiPlayEvent evBackgroundPixPath(0, 0, ME_SYSEX, @@ -2218,10 +2218,10 @@ void DeicsOnze::loadConfiguration(QString fileName) { readConfiguration(node.firstChild()); } else printf("unsupported *.dco file version %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } else printf("DeicsOnze: %s not supported\n", - e.tagName().toLatin1().data()); + e.tagName().toLatin1().constData()); node = node.nextSibling(); } } @@ -2335,10 +2335,10 @@ void DeicsOnze::getInitData(int* length, const unsigned char** data) { buffer[NUM_BLUE_EDITBACKGROUND]=(unsigned char)_gui->ebColor->blue(); buffer[NUM_ISINITSET]=(unsigned char)_isInitSet; strncpy((char*)&buffer[NUM_INITSETPATH], - _initSetPath.toLatin1().data(), MAXSTRLENGTHINITSETPATH); + _initSetPath.toLatin1().constData(), MAXSTRLENGTHINITSETPATH); buffer[NUM_ISBACKGROUNDPIX]=(unsigned char)_isBackgroundPix; strncpy((char*)&buffer[NUM_BACKGROUNDPIXPATH], - _backgroundPixPath.toLatin1().data(), + _backgroundPixPath.toLatin1().constData(), MAXSTRLENGTHBACKGROUNDPIXPATH); } //FX @@ -2350,11 +2350,11 @@ void DeicsOnze::getInitData(int* length, const unsigned char** data) { (_pluginIReverb?(unsigned char)_pluginIReverb->plugin()->controlInPorts() : 0); strncpy((char*)&buffer[NUM_REVERB_LIB], (_pluginIReverb? - _pluginIReverb->plugin()->lib().toLatin1().data() : "\0"), + _pluginIReverb->plugin()->lib().toLatin1().constData() : "\0"), MAXSTRLENGTHFXLIB); strncpy((char*)&buffer[NUM_REVERB_LABEL], (_pluginIReverb? - _pluginIReverb->plugin()->label().toLatin1().data() : "\0"), + _pluginIReverb->plugin()->label().toLatin1().constData() : "\0"), MAXSTRLENGTHFXLABEL); //chorus buffer[NUM_IS_CHORUS_ON]=(unsigned char)_global.isChorusActivated; @@ -2364,11 +2364,11 @@ void DeicsOnze::getInitData(int* length, const unsigned char** data) { (_pluginIChorus?(unsigned char)_pluginIChorus->plugin()->controlInPorts() : 0); strncpy((char*)&buffer[NUM_CHORUS_LIB], (_pluginIChorus? - _pluginIChorus->plugin()->lib().toLatin1().data() : "\0"), + _pluginIChorus->plugin()->lib().toLatin1().constData() : "\0"), MAXSTRLENGTHFXLIB); strncpy((char*)&buffer[NUM_CHORUS_LABEL], (_pluginIChorus? - _pluginIChorus->plugin()->label().toLatin1().data() : "\0"), + _pluginIChorus->plugin()->label().toLatin1().constData() : "\0"), MAXSTRLENGTHFXLABEL); //delay buffer[NUM_IS_DELAY_ON]=(unsigned char)_global.isDelayActivated; @@ -2747,7 +2747,7 @@ void DeicsOnze::parseInitData(int length, const unsigned char* data) { //setSet(); } else printf("Wrong set version : %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } node = node.nextSibling(); } diff --git a/muse2/synti/deicsonze/deicsonzegui.cpp b/muse2/synti/deicsonze/deicsonzegui.cpp index c87ade2a..4bdf0205 100644 --- a/muse2/synti/deicsonze/deicsonzegui.cpp +++ b/muse2/synti/deicsonze/deicsonzegui.cpp @@ -598,10 +598,10 @@ void DeicsOnzeGui::loadConfiguration(QString fileName) { _deicsOnze->readConfiguration(node.firstChild()); } else printf("unsupported *.dco file version %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } else printf("DeicsOnze: %s not supported\n", - e.tagName().toLatin1().data()); + e.tagName().toLatin1().constData()); node = node.nextSibling(); } } @@ -1681,7 +1681,7 @@ void DeicsOnzeGui::processEvent(const MidiPlayEvent& ev) { setSet(); /*} else printf("Wrong set version : %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } node = node.nextSibling(); } @@ -1791,10 +1791,10 @@ void DeicsOnzeGui::loadSetDialog() { updatePresetName("INITVOICE", false); } else printf("unsupported *.dei file version %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } else printf("DeicsOnze: %s not supported\n", - e.tagName().toLatin1().data()); + e.tagName().toLatin1().constData()); node = node.nextSibling(); } } @@ -2026,10 +2026,10 @@ void DeicsOnzeGui::loadCategoryDialog() { setSet(); } else printf("unsupported *.dec file version %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } else printf("DeicsOnze: %s not supported\n", - e.tagName().toLatin1().data()); + e.tagName().toLatin1().constData()); node = node.nextSibling(); } } @@ -2193,10 +2193,10 @@ void DeicsOnzeGui::loadSubcategoryDialog() { setCategory(cat); } else printf("unsupported *.des file version %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } else printf("DeicsOnze: %s not supported\n", - e.tagName().toLatin1().data()); + e.tagName().toLatin1().constData()); node = node.nextSibling(); } } @@ -2364,10 +2364,10 @@ void DeicsOnzeGui::loadPresetDialog() { setSubcategory(sub->_subcategory); } else printf("unsupported *.dep file version %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } else printf("DeicsOnze: %s not supported\n", - e.tagName().toLatin1().data()); + e.tagName().toLatin1().constData()); node = node.nextSibling(); } } diff --git a/muse2/synti/deicsonze2/deicsonze2.cpp b/muse2/synti/deicsonze2/deicsonze2.cpp index 6a4bc5ff..e50eb9c5 100644 --- a/muse2/synti/deicsonze2/deicsonze2.cpp +++ b/muse2/synti/deicsonze2/deicsonze2.cpp @@ -1239,10 +1239,10 @@ void DeicsOnze2::loadSet(QString fileName) { _gui->writeEvent(evSysexUpdateGuiSet); } else printf("unsupported *.dei file version %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } else printf("DeicsOnze2: %s not supported\n", - e.tagName().toLatin1().data()); + e.tagName().toLatin1().constData()); node = node.nextSibling(); } } @@ -1277,10 +1277,10 @@ void DeicsOnze2::loadSutulaPresets() QString presetPath("/home/a-lin/sources/svnMusEDev/lmuse/muse/synti/deicsonze2/ARCH_ALIN"); - file = fopen (presetPath.toLatin1().data(), "rt"); + file = fopen (presetPath.toLatin1().constData(), "rt"); if (file == NULL) { printf("can't open "); - printf(presetPath.toLatin1().data()); + printf(presetPath.toLatin1().constData()); printf("\n"); } else @@ -2116,7 +2116,7 @@ void DeicsOnze2::readConfiguration(QDomNode qdn) { unsigned char *dataInitSetPath = new unsigned char[1+MAXSTRLENGTHINITSETPATH]; dataInitSetPath[0]=SYSEX_INITSETPATH; - strncpy((char*)&dataInitSetPath[1], _initSetPath.toLatin1().data(), + strncpy((char*)&dataInitSetPath[1], _initSetPath.toLatin1().constData(), MAXSTRLENGTHINITSETPATH); MidiPlayEvent evInitSetPath(0, ME_SYSEX, (const unsigned char*)dataInitSetPath, @@ -2140,7 +2140,7 @@ void DeicsOnze2::readConfiguration(QDomNode qdn) { new unsigned char[1+MAXSTRLENGTHBACKGROUNDPIXPATH]; dataBackgroundPixPath[0]=SYSEX_BACKGROUNDPIXPATH; strncpy((char*)&dataBackgroundPixPath[1], - _backgroundPixPath.toLatin1().data(), + _backgroundPixPath.toLatin1().constData(), MAXSTRLENGTHBACKGROUNDPIXPATH); MidiPlayEvent evBackgroundPixPath(0, ME_SYSEX, @@ -2203,10 +2203,10 @@ void DeicsOnze2::loadConfiguration(QString fileName) { readConfiguration(node.firstChild()); } else printf("unsupported *.dco file version %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } else printf("DeicsOnze2: %s not supported\n", - e.tagName().toLatin1().data()); + e.tagName().toLatin1().constData()); node = node.nextSibling(); } } @@ -2318,10 +2318,10 @@ void DeicsOnze2::getInitData(int* length, const unsigned char** data) { buffer[NUM_BLUE_EDITBACKGROUND]=(unsigned char)_gui->ebColor->Qt::blue(); buffer[NUM_ISINITSET]=(unsigned char)_isInitSet; strncpy((char*)&buffer[NUM_INITSETPATH], - _initSetPath.toLatin1().data(), MAXSTRLENGTHINITSETPATH); + _initSetPath.toLatin1().constData(), MAXSTRLENGTHINITSETPATH); buffer[NUM_ISBACKGROUNDPIX]=(unsigned char)_isBackgroundPix; strncpy((char*)&buffer[NUM_BACKGROUNDPIXPATH], - _backgroundPixPath.toLatin1().data(), + _backgroundPixPath.toLatin1().constData(), MAXSTRLENGTHBACKGROUNDPIXPATH); } //FX @@ -2332,11 +2332,11 @@ void DeicsOnze2::getInitData(int* length, const unsigned char** data) { (_pluginIReverb?(unsigned char)_pluginIReverb->plugin()->parameter() : 0); strncpy((char*)&buffer[NUM_REVERB_LIB], (_pluginIReverb? - _pluginIReverb->plugin()->lib().toLatin1().data() : "\0"), + _pluginIReverb->plugin()->lib().toLatin1().constData() : "\0"), MAXSTRLENGTHFXLIB); strncpy((char*)&buffer[NUM_REVERB_LABEL], (_pluginIReverb? - _pluginIReverb->plugin()->label().toLatin1().data() : "\0"), + _pluginIReverb->plugin()->label().toLatin1().constData() : "\0"), MAXSTRLENGTHFXLABEL); //chorus buffer[NUM_IS_CHORUS_ON]=(unsigned char)_global.isChorusActivated; @@ -2345,11 +2345,11 @@ void DeicsOnze2::getInitData(int* length, const unsigned char** data) { (_pluginIChorus?(unsigned char)_pluginIChorus->plugin()->parameter() : 0); strncpy((char*)&buffer[NUM_CHORUS_LIB], (_pluginIChorus? - _pluginIChorus->plugin()->lib().toLatin1().data() : "\0"), + _pluginIChorus->plugin()->lib().toLatin1().constData() : "\0"), MAXSTRLENGTHFXLIB); strncpy((char*)&buffer[NUM_CHORUS_LABEL], (_pluginIChorus? - _pluginIChorus->plugin()->label().toLatin1().data() : "\0"), + _pluginIChorus->plugin()->label().toLatin1().constData() : "\0"), MAXSTRLENGTHFXLABEL); //delay buffer[NUM_IS_DELAY_ON]=(unsigned char)_global.isDelayActivated; @@ -2726,7 +2726,7 @@ void DeicsOnze2::parseInitData(int length, const unsigned char* data) { //setSet(); } else printf("Wrong set version : %s\n", - version.toLatin1().data()); + version.toLatin1().constData()); } node = node.nextSibling(); } diff --git a/muse2/synti/fluid/fluidgui.cpp b/muse2/synti/fluid/fluidgui.cpp index 46a735cd..4782e741 100644 --- a/muse2/synti/fluid/fluidgui.cpp +++ b/muse2/synti/fluid/fluidgui.cpp @@ -55,7 +55,7 @@ void FLUIDGui::loadFont() QMessageBox::critical(this, tr("FLUID: open Soundfile"), s); return; } - const char* path = pathEntry->text().latin1(); + const char* path = pathEntry->text().toLatin1(); int len = strlen(path) + 1 + 3; unsigned char buffer[len]; int k = 0; diff --git a/muse2/synti/fluidsynth/fluidsynthgui.cpp b/muse2/synti/fluidsynth/fluidsynthgui.cpp index d591ecb9..39344c02 100644 --- a/muse2/synti/fluidsynth/fluidsynthgui.cpp +++ b/muse2/synti/fluidsynth/fluidsynthgui.cpp @@ -142,7 +142,7 @@ void FluidSynthGui::pushClicked() const QString& fns = Filename->text(); if (fns.isEmpty()) return; - const char * fn = fns.latin1(); + const char * fn = fns.toLatin1(); int datalen = strlen(fn) + 3; unsigned char data [datalen]; @@ -183,7 +183,7 @@ void FluidSynthGui::sendLastdir(QString dir) int l = strlen(dir)+2; byte data[l]; data[0] = FS_LASTDIR_CHANGE; - memcpy(data+1, dir.latin1(), strlen(dir)+1); + memcpy(data+1, dir.toLatin1(), strlen(dir)+1); sendSysex(data,l); } @@ -198,7 +198,7 @@ void FluidSynthGui::sendLoadFont(QString filename) byte data[l]; data[0] = FS_PUSH_FONT; data[1] = FS_UNSPECIFIED_ID; - memcpy(data+2, filename.latin1(), filename.length()+1); + memcpy(data+2, filename.toLatin1(), filename.length()+1); sendSysex(data,l); } @@ -484,7 +484,7 @@ void FluidSynthGui::channelItemClicked(QTableWidgetItem* item) int i = 0; for (std::list<FluidGuiSoundFont>::reverse_iterator it = stack.rbegin(); it != stack.rend(); it++) { i++; - /*byte* d = (byte*) it->name.latin1(); + /*byte* d = (byte*) it->name.toLatin1(); for (int i=0; i<96; i++) { if (i%16 == 0) printf("%x:",(i+d)); @@ -523,7 +523,7 @@ void FluidSynthGui::channelItemClicked(QTableWidgetItem* item) sfid = getSoundFontId(act->text()); fontname = getSoundFontName(sfid); } - //byte channel = atoi(item->text().latin1()) - 1; + //byte channel = atoi(item->text().toLatin1()) - 1; byte channel = row; sendChannelChange(sfid, channel); item->setText(fontname); @@ -541,7 +541,7 @@ void FluidSynthGui::channelItemClicked(QTableWidgetItem* item) yes->setData(1); QAction * no = popup->addAction("No"); no->setData(0); - //byte channel = atoi(item->text().latin1()) - 1; + //byte channel = atoi(item->text().toLatin1()) - 1; byte channel = row; QAction * act2 = popup->exec(ppt, 0); @@ -816,9 +816,9 @@ int main(int argc, char* argv[]) museGlobalShare = getenv("MUSE"); if (museGlobalShare == 0) { museGlobalShare = "/usr/muse"; - if (access(museGlobalShare.latin1(), R_OK) != 0) { + if (access(museGlobalShare.toLatin1(), R_OK) != 0) { museGlobalShare = "/usr/local/muse"; - if (access(museGlobalShare.latin1(), R_OK) != 0) + if (access(museGlobalShare.toLatin1(), R_OK) != 0) museGlobalShare = museUser; } }*/ diff --git a/muse2/synti/fluidsynth/fluidsynti.cpp b/muse2/synti/fluidsynth/fluidsynti.cpp index d130e741..c9d5ef4d 100644 --- a/muse2/synti/fluidsynth/fluidsynti.cpp +++ b/muse2/synti/fluidsynth/fluidsynti.cpp @@ -591,7 +591,7 @@ static void* fontLoadThread(void* t) QString temp = QString(filename); QString name = temp.right(temp.length() - temp.findRev('/',-1) - 1); name = name.left(name.length()-4); //Strip off ".sf2" - font.name = name.latin1(); + font.name = name.toLatin1().constData(); fptr->stack.push_front(font); fptr->currentlyLoadedFonts++; diff --git a/muse2/synti/simpledrums/simpledrums.cpp b/muse2/synti/simpledrums/simpledrums.cpp index 7c3a4605..c30bba76 100644 --- a/muse2/synti/simpledrums/simpledrums.cpp +++ b/muse2/synti/simpledrums/simpledrums.cpp @@ -139,36 +139,36 @@ SimpleSynth::SimpleSynth(int sr) QString c6 = "Channel " + QString::number(ch + 1) + " fx send 2"; QString c7 = "Channel " + QString::number(ch + 1) + " fx send 3"; QString c8 = "Channel " + QString::number(ch + 1) + " fx send 4"; - controllers[i].name = c1.latin1(); + controllers[i].name = c1.toLatin1(); controllers[i].num = CTRL_NRPN14_OFFSET+i; controllers[i].min = 0; controllers[i].max = 127; - controllers[i+1].name = c2.latin1(); + controllers[i+1].name = c2.toLatin1(); controllers[i+1].num = CTRL_NRPN14_OFFSET+i+1; controllers[i+1].min = 0; controllers[i+1].max = 127; - controllers[i+2].name = c3.latin1(); + controllers[i+2].name = c3.toLatin1(); controllers[i+2].num = CTRL_NRPN14_OFFSET+i+2; controllers[i+2].min = 0; controllers[i+2].max = 1; - controllers[i+3].name = c4.latin1(); + controllers[i+3].name = c4.toLatin1(); controllers[i+3].num = CTRL_NRPN14_OFFSET+i+3; controllers[i+3].min = 0; controllers[i+3].max = 1; - controllers[i+4].name = c5.latin1(); + controllers[i+4].name = c5.toLatin1(); controllers[i+4].num = CTRL_NRPN14_OFFSET+i+4; - controllers[i+5].name = c6.latin1(); + controllers[i+5].name = c6.toLatin1(); controllers[i+5].num = CTRL_NRPN14_OFFSET+i+5; - controllers[i+6].name = c7.latin1(); + controllers[i+6].name = c7.toLatin1(); controllers[i+6].num = CTRL_NRPN14_OFFSET+i+6; - controllers[i+7].name = c8.latin1(); + controllers[i+7].name = c8.toLatin1(); controllers[i+7].num = CTRL_NRPN14_OFFSET+i+7; controllers[i+4].min = controllers[i+5].min = controllers[i+6].min = controllers[i+7].min = 0; @@ -180,12 +180,12 @@ SimpleSynth::SimpleSynth(int sr) for (int sfx=0; sfx<SS_NR_OF_SENDEFFECTS; sfx++) { QString c1 = "Sendfx " + QString::number(sfx) + " ret gain"; QString c2 = "Sendfx " + QString::number(sfx) + " on/off"; - controllers[i].name = c1.latin1(); + controllers[i].name = c1.toLatin1(); controllers[i].num = CTRL_NRPN14_OFFSET+i; controllers[i].min = 0; controllers[i].max = 127; - controllers[i+1].name = c2.latin1(); + controllers[i+1].name = c2.toLatin1(); controllers[i+1].num = CTRL_NRPN14_OFFSET+i+1; controllers[i+1].min = 0; controllers[i+1].max = 1; @@ -532,7 +532,7 @@ bool SimpleSynth::sysex(int /*len*/, const unsigned char* data) QString lib = (const char*) (data + 2); QString label = (const char*) (data + lib.length() + 3); if (SS_DEBUG_MIDI) { - printf("Sysex cmd load effect: %d %s %s\n", fxid, lib.latin1(), label.latin1()); + printf("Sysex cmd load effect: %d %s %s\n", fxid, lib.toLatin1(), label.toLatin1()); } initSendEffect(fxid, lib, label); break; @@ -1561,7 +1561,7 @@ bool SimpleSynth::initSendEffect(int id, QString lib, QString name) sendEffects[id].outputs = plugin->outports(); if (plugin->instantiate()) { - SS_DBG2("Plugin instantiated", name.latin1()); + SS_DBG2("Plugin instantiated", name.toLatin1()); SS_DBG_I("Parameters", plugin->parameter()); SS_DBG_I("No of inputs", plugin->inports()); SS_DBG_I("No of outputs",plugin->outports()); @@ -1646,7 +1646,7 @@ void SimpleSynth::cleanupPlugin(int id) SS_TRACE_IN LadspaPlugin* plugin = sendEffects[id].plugin; plugin->stop(); - SS_DBG2("Stopped fx", plugin->label().latin1()); + SS_DBG2("Stopped fx", plugin->label().toLatin1()); sendEffects[id].nrofparameters = 0; sendEffects[id].state = SS_SENDFX_OFF; sendEffects[id].plugin = 0; diff --git a/muse2/synti/simpledrums/simpledrumsgui.cpp b/muse2/synti/simpledrums/simpledrumsgui.cpp index 3ba474af..f874a136 100644 --- a/muse2/synti/simpledrums/simpledrumsgui.cpp +++ b/muse2/synti/simpledrums/simpledrumsgui.cpp @@ -512,7 +512,7 @@ void SimpleSynthGui::processEvent(const MidiPlayEvent& ev) QString filename = (const char*) (data+2); sampleNameLineEdit[ch]->setText(filename.section('/',-1,-1)); if (SS_DEBUG_MIDI) { - printf("SimpleSynthGui - sample %s loaded OK on channel: %d\n", filename.latin1(), ch); + printf("SimpleSynthGui - sample %s loaded OK on channel: %d\n", filename.toLatin1(), ch); } if (!onOff[ch]->isChecked()) { onOff[ch]->blockSignals(true); @@ -708,7 +708,7 @@ void SimpleSynthGui::loadSampleDialogue(int channel) lastDir = filename.left(filename.findRev("/")); if (SS_DEBUG) - printf("lastDir = %s\n", lastDir.latin1()); + printf("lastDir = %s\n", lastDir.toLatin1()); int l = filename.length() + 4; byte d[l]; @@ -716,7 +716,7 @@ void SimpleSynthGui::loadSampleDialogue(int channel) d[0] = SS_SYSEX_LOAD_SAMPLE; d[1] = (byte) channel; d[2] = (byte) filename.length(); - memcpy(d+3, filename.latin1(), filename.length()+1); + memcpy(d+3, filename.toLatin1(), filename.length()+1); sendSysex(d, l); } } @@ -753,8 +753,8 @@ void SimpleSynthGui::loadEffectInvoked(int fxid, QString lib, QString label) byte d[l]; d[0] = SS_SYSEX_LOAD_SENDEFFECT; d[1] = (byte) fxid; - memcpy (d+2, lib.latin1(), lib.length()+1); - memcpy (d+3+lib.length(), label.latin1(), label.length()+1); + memcpy (d+2, lib.toLatin1(), lib.length()+1); + memcpy (d+3+lib.length(), label.toLatin1(), label.length()+1); sendSysex(d, l); } diff --git a/muse2/synti/simpledrums/ssplugin.cpp b/muse2/synti/simpledrums/ssplugin.cpp index 0efbc55e..4e38129e 100644 --- a/muse2/synti/simpledrums/ssplugin.cpp +++ b/muse2/synti/simpledrums/ssplugin.cpp @@ -34,7 +34,7 @@ static void loadPluginLib(QFileInfo* fi) { SS_TRACE_IN if (SS_DEBUG_LADSPA) { - printf("loadPluginLib: %s\n", fi->fileName().latin1()); + printf("loadPluginLib: %s\n", fi->fileName().toLatin1()); } void* handle = dlopen(fi->filePath().ascii(), RTLD_NOW); if (handle == 0) { @@ -159,7 +159,7 @@ LadspaPlugin::LadspaPlugin(const QFileInfo* f, } /*if (SS_DEBUG_LADSPA) { - printf("Label: %s\tLib: %s\tPortCount: %d\n", this->label().latin1(), this->lib().latin1(), plugin->PortCount); + printf("Label: %s\tLib: %s\tPortCount: %d\n", this->label().toLatin1(), this->lib().toLatin1(), plugin->PortCount); printf("LADSPA_PORT_CONTROL|LADSPA_PORT_INPUT: %d\t", pIdx.size()); printf("Input ports: %d\t", iIdx.size()); printf("Output ports: %d\n\n", oIdx.size()); @@ -182,7 +182,7 @@ LadspaPlugin::~LadspaPlugin() stop(); } if (handle) { - SS_DBG_LADSPA2("Cleaning up ", this->label().latin1()); + SS_DBG_LADSPA2("Cleaning up ", this->label().toLatin1()); plugin->cleanup(handle); } @@ -206,7 +206,7 @@ bool LadspaPlugin::instantiate() handle = plugin->instantiate(plugin, SS_samplerate); success = (handle != NULL); if (success) - SS_DBG_LADSPA2("Plugin instantiated", label().latin1()); + SS_DBG_LADSPA2("Plugin instantiated", label().toLatin1()); return success; } @@ -255,9 +255,9 @@ void LadspaPlugin::stop() { SS_TRACE_IN if (handle) { - SS_DBG_LADSPA2("Trying to stop plugin", label().latin1()); + SS_DBG_LADSPA2("Trying to stop plugin", label().toLatin1()); if (plugin->deactivate) { - SS_DBG_LADSPA2("Deactivating ", label().latin1()); + SS_DBG_LADSPA2("Deactivating ", label().toLatin1()); plugin->deactivate(handle); active = false; } @@ -355,7 +355,7 @@ Plugin* PluginList::find(const QString& file, const QString& name) return *i; } } - printf("Plugin <%s> not found\n", name.latin1()); + printf("Plugin <%s> not found\n", name.toLatin1()); SS_TRACE_OUT return 0; } diff --git a/muse2/synti/simpledrums/ssplugingui.cpp b/muse2/synti/simpledrums/ssplugingui.cpp index bd4e88d8..e1e8a7de 100644 --- a/muse2/synti/simpledrums/ssplugingui.cpp +++ b/muse2/synti/simpledrums/ssplugingui.cpp @@ -271,7 +271,7 @@ void SS_PluginFront::loadButton() pluginChooser->exec(); if ((pluginChooser->result() == QDialog::Accepted) && pluginChooser->getSelectedPlugin()) { Plugin* p = pluginChooser->getSelectedPlugin(); - //printf("Selected plugin: %s\n", pluginChooser->getSelectedPlugin()->name().latin1()); + //printf("Selected plugin: %s\n", pluginChooser->getSelectedPlugin()->name().toLatin1()); emit loadPlugin(fxid, p->lib(), p->label()); } SS_TRACE_OUT diff --git a/muse2/synti/simpledrums2/simpledrums.cpp b/muse2/synti/simpledrums2/simpledrums.cpp index 6ae7797f..13f1d3e2 100644 --- a/muse2/synti/simpledrums2/simpledrums.cpp +++ b/muse2/synti/simpledrums2/simpledrums.cpp @@ -139,36 +139,36 @@ SimpleSynth::SimpleSynth(int sr) QString c6 = "Channel " + QString::number(ch + 1) + " fx send 2"; QString c7 = "Channel " + QString::number(ch + 1) + " fx send 3"; QString c8 = "Channel " + QString::number(ch + 1) + " fx send 4"; - controllers[i].name = c1.toLatin1().data(); + controllers[i].name = c1.toLatin1().constData(); controllers[i].num = CTRL_NRPN14_OFFSET+i; controllers[i].min = 0; controllers[i].max = 127; - controllers[i+1].name = c2.toLatin1().data(); + controllers[i+1].name = c2.toLatin1().constData(); controllers[i+1].num = CTRL_NRPN14_OFFSET+i+1; controllers[i+1].min = 0; controllers[i+1].max = 127; - controllers[i+2].name = c3.toLatin1().data(); + controllers[i+2].name = c3.toLatin1().constData(); controllers[i+2].num = CTRL_NRPN14_OFFSET+i+2; controllers[i+2].min = 0; controllers[i+2].max = 1; - controllers[i+3].name = c4.toLatin1().data(); + controllers[i+3].name = c4.toLatin1().constData(); controllers[i+3].num = CTRL_NRPN14_OFFSET+i+3; controllers[i+3].min = 0; controllers[i+3].max = 1; - controllers[i+4].name = c5.toLatin1().data(); + controllers[i+4].name = c5.toLatin1().constData(); controllers[i+4].num = CTRL_NRPN14_OFFSET+i+4; - controllers[i+5].name = c6.toLatin1().data(); + controllers[i+5].name = c6.toLatin1().constData(); controllers[i+5].num = CTRL_NRPN14_OFFSET+i+5; - controllers[i+6].name = c7.toLatin1().data(); + controllers[i+6].name = c7.toLatin1().constData(); controllers[i+6].num = CTRL_NRPN14_OFFSET+i+6; - controllers[i+7].name = c8.toLatin1().data(); + controllers[i+7].name = c8.toLatin1().constData(); controllers[i+7].num = CTRL_NRPN14_OFFSET+i+7; controllers[i+4].min = controllers[i+5].min = controllers[i+6].min = controllers[i+7].min = 0; @@ -180,12 +180,12 @@ SimpleSynth::SimpleSynth(int sr) for (int sfx=0; sfx<SS_NR_OF_SENDEFFECTS; sfx++) { QString c1 = "Sendfx " + QString::number(sfx) + " ret gain"; QString c2 = "Sendfx " + QString::number(sfx) + " on/off"; - controllers[i].name = c1.toLatin1().data(); + controllers[i].name = c1.toLatin1().constData(); controllers[i].num = CTRL_NRPN14_OFFSET+i; controllers[i].min = 0; controllers[i].max = 127; - controllers[i+1].name = c2.toLatin1().data(); + controllers[i+1].name = c2.toLatin1().constData(); controllers[i+1].num = CTRL_NRPN14_OFFSET+i+1; controllers[i+1].min = 0; controllers[i+1].max = 1; @@ -532,7 +532,7 @@ bool SimpleSynth::sysex(int /*len*/, const unsigned char* data) QString lib = (const char*) (data + 2); QString label = (const char*) (data + lib.length() + 3); if (SS_DEBUG_MIDI) { - printf("Sysex cmd load effect: %d %s %s\n", fxid, lib.toLatin1().data(), label.toLatin1().data()); + printf("Sysex cmd load effect: %d %s %s\n", fxid, lib.toLatin1().constData(), label.toLatin1().constData()); } initSendEffect(fxid, lib, label); break; @@ -964,7 +964,7 @@ void SimpleSynth::getInitData(int* n, const unsigned char** data) if (sendEffects[j].plugin) { int labelnamelen = sendEffects[j].plugin->label().size() + 1; buffer[i] = labelnamelen; - memcpy((buffer+i+1), sendEffects[j].plugin->label().toLatin1().data(), labelnamelen); + memcpy((buffer+i+1), sendEffects[j].plugin->label().toLatin1().constData(), labelnamelen); if (SS_DEBUG_INIT) { printf("buffer[%d] - labelnamelen: %d\n", i, labelnamelen); printf("buffer[%d] - buffer[%d] - filename: ", (i+1), (i+1) + labelnamelen - 1); @@ -978,7 +978,7 @@ void SimpleSynth::getInitData(int* n, const unsigned char** data) int namelen = sendEffects[j].plugin->lib().size() + 1; buffer[i] = namelen; - memcpy((buffer+i+1), sendEffects[j].plugin->lib().toLatin1().data(), namelen); + memcpy((buffer+i+1), sendEffects[j].plugin->lib().toLatin1().constData(), namelen); if (SS_DEBUG_INIT) { printf("buffer[%d] - libnamelen : %d\n", i, namelen); printf("buffer[%d] - buffer[%d] - filename: ", (i+1), (i+1) + namelen - 1); @@ -1524,7 +1524,7 @@ bool SimpleSynth::initSendEffect(int id, QString lib, QString name) sendEffects[id].outputs = plugin->outports(); if (plugin->instantiate()) { - SS_DBG2("Plugin instantiated", name.toLatin1().data()); + SS_DBG2("Plugin instantiated", name.toLatin1().constData()); SS_DBG_I("Parameters", plugin->parameter()); SS_DBG_I("No of inputs", plugin->inports()); SS_DBG_I("No of outputs",plugin->outports()); @@ -1583,7 +1583,7 @@ bool SimpleSynth::initSendEffect(int id, QString lib, QString name) if (!success) { QString errorString = "Error loading plugin \"" + plugin->label() + "\""; - guiSendError(errorString.toLatin1().data()); + guiSendError(errorString.toLatin1().constData()); } return success; SS_TRACE_OUT @@ -1609,7 +1609,7 @@ void SimpleSynth::cleanupPlugin(int id) SS_TRACE_IN LadspaPlugin* plugin = sendEffects[id].plugin; plugin->stop(); - SS_DBG2("Stopped fx", plugin->label().toLatin1().data()); + SS_DBG2("Stopped fx", plugin->label().toLatin1().constData()); sendEffects[id].nrofparameters = 0; sendEffects[id].state = SS_SENDFX_OFF; sendEffects[id].plugin = 0; diff --git a/muse2/synti/simpledrums2/simpledrumsgui.cpp b/muse2/synti/simpledrums2/simpledrumsgui.cpp index 79194eed..f90c1da8 100644 --- a/muse2/synti/simpledrums2/simpledrumsgui.cpp +++ b/muse2/synti/simpledrums2/simpledrumsgui.cpp @@ -509,7 +509,7 @@ void SimpleSynthGui::processEvent(const MidiPlayEvent& ev) QString filename = (const char*) (data+2); sampleNameLineEdit[ch]->setText(filename.section('/',-1,-1)); if (SS_DEBUG_MIDI) { - printf("SimpleSynthGui - sample %s loaded OK on channel: %d\n", filename.toLatin1().data(), ch); + printf("SimpleSynthGui - sample %s loaded OK on channel: %d\n", filename.toLatin1().constData(), ch); } if (!onOff[ch]->isChecked()) { onOff[ch]->blockSignals(true); @@ -709,7 +709,7 @@ void SimpleSynthGui::loadSampleDialogue(int channel) lastDir = fi.path(); if (SS_DEBUG) - printf("lastDir = %s\n", lastDir.toLatin1().data()); + printf("lastDir = %s\n", lastDir.toLatin1().constData()); int l = filename.length() + 4; byte d[l]; @@ -717,7 +717,7 @@ void SimpleSynthGui::loadSampleDialogue(int channel) d[0] = SS_SYSEX_LOAD_SAMPLE; d[1] = (byte) channel; d[2] = (byte) filename.length(); - memcpy(d+3, filename.toLatin1().data(), filename.length()+1); + memcpy(d+3, filename.toLatin1().constData(), filename.length()+1); sendSysex(d, l); } } @@ -755,8 +755,8 @@ void SimpleSynthGui::loadEffectInvoked(int fxid, QString lib, QString label) byte d[l]; d[0] = SS_SYSEX_LOAD_SENDEFFECT; d[1] = (byte) fxid; - memcpy (d+2, lib.toLatin1().data(), lib.length()+1); - memcpy (d+3+lib.length(), label.toLatin1().data(), label.length()+1); + memcpy (d+2, lib.toLatin1().constData(), lib.length()+1); + memcpy (d+3+lib.length(), label.toLatin1().constData(), label.length()+1); sendSysex(d, l); } diff --git a/muse2/synti/simpledrums2/ssplugin.cpp b/muse2/synti/simpledrums2/ssplugin.cpp index 7e8986e7..28639a39 100644 --- a/muse2/synti/simpledrums2/ssplugin.cpp +++ b/muse2/synti/simpledrums2/ssplugin.cpp @@ -34,7 +34,7 @@ static void loadPluginLib(QFileInfo* fi) { SS_TRACE_IN if (SS_DEBUG_LADSPA) { - printf("loadPluginLib: %s\n", fi->fileName().toLatin1().data()); + printf("loadPluginLib: %s\n", fi->fileName().toLatin1().constData()); } void* handle = dlopen(fi->filePath().toAscii().data(), RTLD_NOW); if (handle == 0) { @@ -158,7 +158,7 @@ LadspaPlugin::LadspaPlugin(const QFileInfo* f, } /*if (SS_DEBUG_LADSPA) { - printf("Label: %s\tLib: %s\tPortCount: %d\n", this->label().toLatin1().data(), this->lib().toLatin1().data(), plugin->PortCount); + printf("Label: %s\tLib: %s\tPortCount: %d\n", this->label().toLatin1().constData(), this->lib().toLatin1().constData(), plugin->PortCount); printf("LADSPA_PORT_CONTROL|LADSPA_PORT_INPUT: %d\t", pIdx.size()); printf("Input ports: %d\t", iIdx.size()); printf("Output ports: %d\n\n", oIdx.size()); @@ -181,7 +181,7 @@ LadspaPlugin::~LadspaPlugin() stop(); } if (handle) { - SS_DBG_LADSPA2("Cleaning up ", this->label().toLatin1().data()); + SS_DBG_LADSPA2("Cleaning up ", this->label().toLatin1().constData()); plugin->cleanup(handle); } @@ -205,7 +205,7 @@ bool LadspaPlugin::instantiate() handle = plugin->instantiate(plugin, SS_samplerate); success = (handle != NULL); if (success) - SS_DBG_LADSPA2("Plugin instantiated", label().toLatin1().data()); + SS_DBG_LADSPA2("Plugin instantiated", label().toLatin1().constData()); return success; } @@ -254,9 +254,9 @@ void LadspaPlugin::stop() { SS_TRACE_IN if (handle) { - SS_DBG_LADSPA2("Trying to stop plugin", label().toLatin1().data()); + SS_DBG_LADSPA2("Trying to stop plugin", label().toLatin1().constData()); if (plugin->deactivate) { - SS_DBG_LADSPA2("Deactivating ", label().toLatin1().data()); + SS_DBG_LADSPA2("Deactivating ", label().toLatin1().constData()); plugin->deactivate(handle); active = false; } @@ -354,7 +354,7 @@ Plugin* PluginList::find(const QString& file, const QString& name) return *i; } } - printf("Plugin <%s> not found\n", name.toLatin1().data()); + printf("Plugin <%s> not found\n", name.toLatin1().constData()); SS_TRACE_OUT return 0; } diff --git a/muse2/synti/simpledrums2/ssplugingui.cpp b/muse2/synti/simpledrums2/ssplugingui.cpp index da74bd56..ff17255e 100644 --- a/muse2/synti/simpledrums2/ssplugingui.cpp +++ b/muse2/synti/simpledrums2/ssplugingui.cpp @@ -266,7 +266,7 @@ void SS_PluginFront::loadButton() pluginChooser->exec(); if ((pluginChooser->result() == QDialog::Accepted) && pluginChooser->getSelectedPlugin()) { Plugin* p = pluginChooser->getSelectedPlugin(); - //printf("Selected plugin: %s\n", pluginChooser->getSelectedPlugin()->name().toLatin1().data()); + //printf("Selected plugin: %s\n", pluginChooser->getSelectedPlugin()->name().toLatin1().constData()); emit loadPlugin(fxid, p->lib(), p->label()); } SS_TRACE_OUT diff --git a/muse2/synti/vam/vamgui.cpp b/muse2/synti/vam/vamgui.cpp index e438b0e0..1ed32994 100644 --- a/muse2/synti/vam/vamgui.cpp +++ b/muse2/synti/vam/vamgui.cpp @@ -445,7 +445,7 @@ void VAMGui::setPreset(Preset* preset) putchar(0x7c); // mess putchar(0x2); // vam putchar(0x3); // setPreset - const char* name = preset->name.latin1(); + const char* name = preset->name.toLatin1(); while (*name) putchar(*name++ & 0x7f); putchar(0); @@ -603,7 +603,7 @@ void VAMGui::loadPresetsPressed() break; case Xml::Attribut: if(mode == 1 && tag == "iname") { -// fprintf(stderr, "%s\n", xml.s2().latin1()); +// fprintf(stderr, "%s\n", xml.s2().toLatin1()); if(xml.s2() != "vam-1.0") return; else mode = 2; |