summaryrefslogtreecommitdiffstats
path: root/src/sound/AudioFileManager.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/sound/AudioFileManager.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/sound/AudioFileManager.cpp')
-rw-r--r--src/sound/AudioFileManager.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/src/sound/AudioFileManager.cpp b/src/sound/AudioFileManager.cpp
index 93be26c..46525c4 100644
--- a/src/sound/AudioFileManager.cpp
+++ b/src/sound/AudioFileManager.cpp
@@ -41,10 +41,10 @@
#include <kio/netaccess.h>
#include <kmessagebox.h>
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qdatetime.h>
-#include <qfile.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
+#include <tqdatetime.h>
+#include <tqfile.h>
#include "AudioFile.h"
#include "AudioFileManager.h"
@@ -101,8 +101,8 @@ AudioFileManager::AudioFileManager() :
// Retransmit progress
//
- connect(&m_peakManager, SIGNAL(setProgress(int)),
- this, SIGNAL(setProgress(int)));
+ connect(&m_peakManager, TQT_SIGNAL(setProgress(int)),
+ this, TQT_SIGNAL(setProgress(int)));
}
AudioFileManager::~AudioFileManager()
@@ -118,10 +118,10 @@ AudioFileManager::addFile(const std::string &filePath)
MutexLock lock (&_audioFileManagerLock)
;
- QString ext;
+ TQString ext;
if (filePath.length() > 3) {
- ext = QString(filePath.substr(filePath.length() - 3, 3).c_str()).lower();
+ ext = TQString(filePath.substr(filePath.length() - 3, 3).c_str()).lower();
}
// Check for file existing already in manager by path
@@ -252,7 +252,7 @@ AudioFileManager::insertFile(const std::string &name,
// If we've expanded and we can't find the file
// then try to find it in audio file directory.
//
- QFileInfo info(foundFileName.c_str());
+ TQFileInfo info(foundFileName.c_str());
if (!info.exists())
foundFileName = getFileInPath(foundFileName);
@@ -353,7 +353,7 @@ AudioFileManager::insertFile(const std::string &name,
// If we've expanded and we can't find the file
// then try to find it in audio file directory.
//
- QFileInfo info(foundFileName.c_str());
+ TQFileInfo info(foundFileName.c_str());
if (!info.exists())
foundFileName = getFileInPath(foundFileName);
@@ -422,7 +422,7 @@ AudioFileManager::setAudioPath(const std::string &path)
void
AudioFileManager::testAudioPath() throw (BadAudioPathException)
{
- QFileInfo info(m_audioPath.c_str());
+ TQFileInfo info(m_audioPath.c_str());
if (!(info.exists() && info.isDir() && !info.isRelative() &&
info.isWritable() && info.isReadable()))
throw BadAudioPathException(m_audioPath.data());
@@ -439,7 +439,7 @@ AudioFileManager::getFileInPath(const std::string &file)
MutexLock lock (&_audioFileManagerLock)
;
- QFileInfo info(file.c_str());
+ TQFileInfo info(file.c_str());
if (info.exists())
return file;
@@ -447,8 +447,8 @@ AudioFileManager::getFileInPath(const std::string &file)
// Build the search filename from the audio path and
// the file basename.
//
- QString searchFile = QString(m_audioPath.c_str()) + info.fileName();
- QFileInfo searchInfo(searchFile);
+ TQString searchFile = TQString(m_audioPath.c_str()) + info.fileName();
+ TQFileInfo searchInfo(searchFile);
if (searchInfo.exists())
return searchFile.latin1();
@@ -532,15 +532,15 @@ AudioFileManager::createRecordingAudioFile()
;
AudioFileId newId = getFirstUnusedID();
- QString fileName = "";
+ TQString fileName = "";
while (fileName == "") {
- fileName = QString("rg-%1-%2.wav")
- .arg(QDateTime::currentDateTime().toString("yyyyMMdd-hhmmss"))
+ fileName = TQString("rg-%1-%2.wav")
+ .arg(TQDateTime::currentDateTime().toString("yyyyMMdd-hhmmss"))
.arg(newId + 1);
- if (QFile(m_audioPath.c_str() + fileName).exists()) {
+ if (TQFile(m_audioPath.c_str() + fileName).exists()) {
fileName = "";
++newId;
}
@@ -611,7 +611,7 @@ AudioFileManager::createDerivedAudioFile(AudioFileId source,
if (!sourceFile) return 0;
AudioFileId newId = getFirstUnusedID();
- QString fileName = "";
+ TQString fileName = "";
std::string sourceBase = sourceFile->getShortFilename();
if (sourceBase.length() > 4 && sourceBase.substr(0, 3) == "rg-") {
@@ -621,13 +621,13 @@ AudioFileManager::createDerivedAudioFile(AudioFileId source,
while (fileName == "") {
- fileName = QString("%1-%2-%3-%4.wav")
+ fileName = TQString("%1-%2-%3-%4.wav")
.arg(prefix)
.arg(sourceBase)
- .arg(QDateTime::currentDateTime().toString("yyyyMMdd-hhmmss"))
+ .arg(TQDateTime::currentDateTime().toString("yyyyMMdd-hhmmss"))
.arg(newId + 1);
- if (QFile(m_audioPath.c_str() + fileName).exists()) {
+ if (TQFile(m_audioPath.c_str() + fileName).exists()) {
fileName = "";
++newId;
}
@@ -659,7 +659,7 @@ AudioFileManager::importURL(const KURL &url, int sampleRate)
emit setOperationName(i18n("Downloading file %1").arg(url.prettyURL()));
- QString localPath = "";
+ TQString localPath = "";
if (!KIO::NetAccess::download(url, localPath)) {
KMessageBox::error(0, i18n("Cannot download file %1").arg(url.prettyURL()));
throw SoundFile::BadSoundFileException(url.prettyURL());
@@ -688,7 +688,7 @@ AudioFileManager::fileNeedsConversion(const std::string &fileName,
*proc << "rosegarden-audiofile-importer";
if (sampleRate > 0) {
*proc << "-r";
- *proc << QString("%1").arg(sampleRate);
+ *proc << TQString("%1").arg(sampleRate);
}
*proc << "-w";
*proc << fileName.c_str();
@@ -715,7 +715,7 @@ AudioFileManager::importFile(const std::string &fileName, int sampleRate)
*proc << "rosegarden-audiofile-importer";
if (sampleRate > 0) {
*proc << "-r";
- *proc << QString("%1").arg(sampleRate);
+ *proc << TQString("%1").arg(sampleRate);
}
*proc << "-w";
*proc << fileName.c_str();
@@ -742,9 +742,9 @@ AudioFileManager::importFile(const std::string &fileName, int sampleRate)
}
AudioFileId newId = getFirstUnusedID();
- QString targetName = "";
+ TQString targetName = "";
- QString sourceBase = QFileInfo(fileName.c_str()).baseName();
+ TQString sourceBase = TQFileInfo(fileName.c_str()).baseName();
if (sourceBase.length() > 3 && sourceBase.startsWith("rg-")) {
sourceBase = sourceBase.right(sourceBase.length() - 3);
}
@@ -752,12 +752,12 @@ AudioFileManager::importFile(const std::string &fileName, int sampleRate)
while (targetName == "") {
- targetName = QString("conv-%2-%3-%4.wav")
+ targetName = TQString("conv-%2-%3-%4.wav")
.arg(sourceBase)
- .arg(QDateTime::currentDateTime().toString("yyyyMMdd-hhmmss"))
+ .arg(TQDateTime::currentDateTime().toString("yyyyMMdd-hhmmss"))
.arg(newId + 1);
- if (QFile(m_audioPath.c_str() + targetName).exists()) {
+ if (TQFile(m_audioPath.c_str() + targetName).exists()) {
targetName = "";
++newId;
}
@@ -768,7 +768,7 @@ AudioFileManager::importFile(const std::string &fileName, int sampleRate)
*m_importProcess << "rosegarden-audiofile-importer";
if (sampleRate > 0) {
*m_importProcess << "-r";
- *m_importProcess << QString("%1").arg(sampleRate);
+ *m_importProcess << TQString("%1").arg(sampleRate);
}
*m_importProcess << "-c";
*m_importProcess << fileName.c_str();
@@ -1048,7 +1048,7 @@ void
AudioFileManager::drawPreview(AudioFileId id,
const RealTime &startTime,
const RealTime &endTime,
- QPixmap *pixmap)
+ TQPixmap *pixmap)
{
MutexLock lock (&_audioFileManagerLock)
;
@@ -1070,11 +1070,11 @@ AudioFileManager::drawPreview(AudioFileId id,
pixmap->width(),
false);
- QPainter painter(pixmap);
- pixmap->fill(kapp->palette().color(QPalette::Active,
- QColorGroup::Base));
- painter.setPen(kapp->palette().color(QPalette::Active,
- QColorGroup::Dark));
+ TQPainter painter(pixmap);
+ pixmap->fill(kapp->palette().color(TQPalette::Active,
+ TQColorGroup::Base));
+ painter.setPen(kapp->palette().color(TQPalette::Active,
+ TQColorGroup::Dark));
if (values.size() == 0) {
#ifdef DEBUG_AUDIOFILEMANAGER
@@ -1124,7 +1124,7 @@ AudioFileManager::drawHighlightedPreview(AudioFileId id,
const RealTime &endTime,
const RealTime &highlightStart,
const RealTime &highlightEnd,
- QPixmap *pixmap)
+ TQPixmap *pixmap)
{
MutexLock lock (&_audioFileManagerLock)
;
@@ -1151,9 +1151,9 @@ AudioFileManager::drawHighlightedPreview(AudioFileId id,
int endWidth = (int)(double(pixmap->width()) * (highlightEnd /
(endTime - startTime)));
- QPainter painter(pixmap);
- pixmap->fill(kapp->palette().color(QPalette::Active,
- QColorGroup::Base));
+ TQPainter painter(pixmap);
+ pixmap->fill(kapp->palette().color(TQPalette::Active,
+ TQColorGroup::Base));
float yStep = pixmap->height() / 2;
int channels = audioFile->getChannels();
@@ -1177,11 +1177,11 @@ AudioFileManager::drawHighlightedPreview(AudioFileId id,
}
if (i < startWidth || i > endWidth)
- painter.setPen(kapp->palette().color(QPalette::Active,
- QColorGroup::Mid));
+ painter.setPen(kapp->palette().color(TQPalette::Active,
+ TQColorGroup::Mid));
else
- painter.setPen(kapp->palette().color(QPalette::Active,
- QColorGroup::Dark));
+ painter.setPen(kapp->palette().color(TQPalette::Active,
+ TQColorGroup::Dark));
painter.drawLine(i, static_cast<int>(yStep - ch1Value * yStep),
i, static_cast<int>(yStep + ch2Value * yStep));