summaryrefslogtreecommitdiffstats
path: root/src/document/io/LilyPondExporter.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
commit11f31c37e5fa4889d9989f10272f44845449cb7b (patch)
tree4383da04a76c497950d957fc6120b0fd0d9082c2 /src/document/io/LilyPondExporter.cpp
parent832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff)
downloadrosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.tar.gz
rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.zip
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/document/io/LilyPondExporter.cpp')
-rw-r--r--src/document/io/LilyPondExporter.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/src/document/io/LilyPondExporter.cpp b/src/document/io/LilyPondExporter.cpp
index 68731f8..cd29b60 100644
--- a/src/document/io/LilyPondExporter.cpp
+++ b/src/document/io/LilyPondExporter.cpp
@@ -68,11 +68,11 @@
#include "gui/widgets/CurrentProgressDialog.h"
#include <kconfig.h>
#include <kmessagebox.h>
-#include <qfileinfo.h>
-#include <qobject.h>
-#include <qregexp.h>
-#include <qstring.h>
-#include <qtextcodec.h>
+#include <tqfileinfo.h>
+#include <tqobject.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqtextcodec.h>
#include <kapplication.h>
#include <sstream>
#include <algorithm>
@@ -88,7 +88,7 @@ const PropertyName LilyPondExporter::SKIP_PROPERTY
LilyPondExporter::LilyPondExporter(RosegardenGUIApp *parent,
RosegardenGUIDoc *doc,
std::string fileName) :
- ProgressReporter((QObject *)parent, "lilypondExporter"),
+ ProgressReporter((TQObject *)parent, "lilypondExporter"),
m_doc(doc),
m_fileName(fileName),
m_lastClefFound(Clef::Treble)
@@ -104,7 +104,7 @@ LilyPondExporter::LilyPondExporter(RosegardenGUIApp *parent,
LilyPondExporter::LilyPondExporter(NotationView *parent,
RosegardenGUIDoc *doc,
std::string fileName) :
- ProgressReporter((QObject *)parent, "lilypondExporter"),
+ ProgressReporter((TQObject *)parent, "lilypondExporter"),
m_doc(doc),
m_fileName(fileName),
m_lastClefFound(Clef::Treble)
@@ -349,17 +349,17 @@ std::string
LilyPondExporter::protectIllegalChars(std::string inStr)
{
- QString tmpStr = strtoqstr(inStr);
+ TQString tmpStr = strtoqstr(inStr);
- tmpStr.replace(QRegExp("&"), "\\&");
- tmpStr.replace(QRegExp("\\^"), "\\^");
- tmpStr.replace(QRegExp("%"), "\\%");
- tmpStr.replace(QRegExp("<"), "\\<");
- tmpStr.replace(QRegExp(">"), "\\>");
- tmpStr.replace(QRegExp("\\["), "");
- tmpStr.replace(QRegExp("\\]"), "");
- tmpStr.replace(QRegExp("\\{"), "");
- tmpStr.replace(QRegExp("\\}"), "");
+ tmpStr.replace(TQRegExp("&"), "\\&");
+ tmpStr.replace(TQRegExp("\\^"), "\\^");
+ tmpStr.replace(TQRegExp("%"), "\\%");
+ tmpStr.replace(TQRegExp("<"), "\\<");
+ tmpStr.replace(TQRegExp(">"), "\\>");
+ tmpStr.replace(TQRegExp("\\["), "");
+ tmpStr.replace(TQRegExp("\\]"), "");
+ tmpStr.replace(TQRegExp("\\{"), "");
+ tmpStr.replace(TQRegExp("\\}"), "");
//
// LilyPond uses utf8 encoding.
@@ -378,22 +378,22 @@ struct MarkerComp {
bool
LilyPondExporter::write()
{
- QString tmpName = strtoqstr(m_fileName);
+ TQString tmpName = strtoqstr(m_fileName);
// dmm - modified to act upon the filename itself, rather than the whole
// path; fixes bug #855349
// split name into parts:
- QFileInfo nfo(tmpName);
- QString dirName = nfo.dirPath();
- QString baseName = nfo.fileName();
+ TQFileInfo nfo(tmpName);
+ TQString dirName = nfo.dirPath();
+ TQString baseName = nfo.fileName();
// sed LilyPond-choking chars out of the filename proper
bool illegalFilename = (baseName.contains(' ') || baseName.contains("\\"));
- baseName.replace(QRegExp(" "), "");
- baseName.replace(QRegExp("\\\\"), "");
- baseName.replace(QRegExp("'"), "");
- baseName.replace(QRegExp("\""), "");
+ baseName.replace(TQRegExp(" "), "");
+ baseName.replace(TQRegExp("\\\\"), "");
+ baseName.replace(TQRegExp("'"), "");
+ baseName.replace(TQRegExp("\""), "");
// cat back together
tmpName = dirName + '/' + baseName;
@@ -1137,7 +1137,7 @@ LilyPondExporter::write()
currentVerse++) {
bool haveLyric = false;
bool firstNote = true;
- QString text = "";
+ TQString text = "";
timeT lastTime = (*i)->getStartTime();
for (Segment::iterator j = (*i)->begin();
@@ -1180,8 +1180,8 @@ LilyPondExporter::write()
(*j)->get<String>(Text::TextPropertyName, ssyllable);
text += " ";
- QString syllable(strtoqstr(ssyllable));
- syllable.replace(QRegExp("\\s+"), "");
+ TQString syllable(strtoqstr(ssyllable));
+ syllable.replace(TQRegExp("\\s+"), "");
text += "\"" + syllable + "\"";
haveLyric = true;
} else if (verse > lastVerse) {
@@ -1190,13 +1190,13 @@ LilyPondExporter::write()
}
}
- text.replace( QRegExp(" _+([^ ])") , " \\1" );
+ text.replace( TQRegExp(" _+([^ ])") , " \\1" );
text.replace( "\"_\"" , " " );
// Do not create empty context for lyrics.
// Does this save some vertical space, as was written
// in earlier comment?
- QRegExp rx( "\"" );
+ TQRegExp rx( "\"" );
if ( rx.search( text ) != -1 ) {
str << indent(col) << "\\lyricsto \"" << voiceNumber.str() << "\""
@@ -1430,7 +1430,7 @@ LilyPondExporter::writeBar(Segment *s,
writtenDuration += note.getDuration();
durationRatio = writeSkip(timeSignature, 0, note.getDuration(), true, str);
durationRatioSum = fractionSum(durationRatioSum,durationRatio);
- // str << qstrtostr(QString(" %{ %1/%2 %} ").arg(durationRatio.first).arg(durationRatio.second)); // DEBUG
+ // str << qstrtostr(TQString(" %{ %1/%2 %} ").arg(durationRatio.first).arg(durationRatio.second)); // DEBUG
}
timeT prevDuration = -1;
@@ -1452,8 +1452,8 @@ LilyPondExporter::writeBar(Segment *s,
// First test whether we're entering or leaving a group,
// before we consider how to write the event itself (at least
// for pre-2.0 LilyPond output)
- QString startGroupBeamingsStr = "";
- QString endGroupBeamingsStr = "";
+ TQString startGroupBeamingsStr = "";
+ TQString endGroupBeamingsStr = "";
if ((*i)->isa(Note::EventType) || (*i)->isa(Note::EventRestType) ||
(*i)->isa(Clef::EventType) || (*i)->isa(Rosegarden::Key::EventType)) {
@@ -1496,7 +1496,7 @@ LilyPondExporter::writeBar(Segment *s,
groupId = -1;
groupType = "";
} else {
- startGroupBeamingsStr += QString("\\times %1/%2 { ").arg(numerator).arg(denominator);
+ startGroupBeamingsStr += TQString("\\times %1/%2 { ").arg(numerator).arg(denominator);
tupletRatio = std::pair<int, int>(numerator, denominator);
// Require explicit beamed groups,
// fixes bug #1683205.
@@ -1688,7 +1688,7 @@ LilyPondExporter::writeBar(Segment *s,
writtenDuration += soundingDuration;
std::pair<int,int> ratio = fractionProduct(durationRatio,tupletRatio);
durationRatioSum = fractionSum(durationRatioSum, ratio);
- // str << qstrtostr(QString(" %{ %1/%2 * %3/%4 = %5/%6 %} ").arg(durationRatio.first).arg(durationRatio.second).arg(tupletRatio.first).arg(tupletRatio.second).arg(ratio.first).arg(ratio.second)); // DEBUG
+ // str << qstrtostr(TQString(" %{ %1/%2 * %3/%4 = %5/%6 %} ").arg(durationRatio.first).arg(durationRatio.second).arg(tupletRatio.first).arg(tupletRatio.second).arg(ratio.first).arg(ratio.second)); // DEBUG
std::vector<Mark> marks(chord.getMarksForChord());
// problem here: stem direction unavailable (it's a view-local property)
@@ -1869,7 +1869,7 @@ LilyPondExporter::writeBar(Segment *s,
writtenDuration += soundingDuration;
std::pair<int,int> ratio = fractionProduct(durationRatio,tupletRatio);
durationRatioSum = fractionSum(durationRatioSum, ratio);
- // str << qstrtostr(QString(" %{ %1/%2 * %3/%4 = %5/%6 %} ").arg(durationRatio.first).arg(durationRatio.second).arg(tupletRatio.first).arg(tupletRatio.second).arg(ratio.first).arg(ratio.second)); // DEBUG
+ // str << qstrtostr(TQString(" %{ %1/%2 * %3/%4 = %5/%6 %} ").arg(durationRatio.first).arg(durationRatio.second).arg(tupletRatio.first).arg(tupletRatio.second).arg(ratio.first).arg(ratio.second)); // DEBUG
} else if ((*i)->isa(Clef::EventType)) {
try {
@@ -2050,16 +2050,16 @@ LilyPondExporter::writeBar(Segment *s,
if (overlong) {
str << std::endl << indent(col) <<
- qstrtostr(QString("% %1").
+ qstrtostr(TQString("% %1").
arg(i18n("warning: overlong bar truncated here")));
}
if (fractionSmaller(durationRatioSum, barDurationRatio)) {
str << std::endl << indent(col) <<
- qstrtostr(QString("% %1").
+ qstrtostr(TQString("% %1").
arg(i18n("warning: bar too short, padding with rests")));
str << std::endl << indent(col) <<
- qstrtostr(QString("% %1/%2 < %3/%4").
+ qstrtostr(TQString("% %1/%2 < %3/%4").
arg(durationRatioSum.first).
arg(durationRatioSum.second).
arg(barDurationRatio.first).