mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Debug tweaks
This commit is contained in:
parent
e3ab6476ca
commit
4922592cfa
3 changed files with 9 additions and 9 deletions
|
@ -223,7 +223,7 @@ void Player::startPlaying() {
|
||||||
_audioThread = new QThread();
|
_audioThread = new QThread();
|
||||||
_options.setPosition(_avatar->getPosition());
|
_options.setPosition(_avatar->getPosition());
|
||||||
_options.setOrientation(_avatar->getOrientation());
|
_options.setOrientation(_avatar->getOrientation());
|
||||||
_injector.reset(new AudioInjector(_recording->getAudio(), _options));
|
_injector.reset(new AudioInjector(_recording->getAudio(), _options), &QObject::deleteLater);
|
||||||
_injector->moveToThread(_audioThread);
|
_injector->moveToThread(_audioThread);
|
||||||
_audioThread->start();
|
_audioThread->start();
|
||||||
QMetaObject::invokeMethod(_injector.data(), "injectAudio", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(_injector.data(), "injectAudio", Qt::QueuedConnection);
|
||||||
|
@ -317,13 +317,13 @@ bool Player::computeCurrentFrame() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeRecordingToFile(RecordingPointer recording, QString filename) {
|
void writeRecordingToFile(RecordingPointer recording, QString filename) {
|
||||||
qDebug() << "Writing recording to " << filename;
|
qDebug() << "Writing recording to " << filename << ".";
|
||||||
QElapsedTimer timer;
|
QElapsedTimer timer;
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
if (!file.open(QIODevice::WriteOnly)){
|
if (!file.open(QIODevice::WriteOnly)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
qDebug() << file.fileName();
|
timer.start();
|
||||||
|
|
||||||
|
|
||||||
QDataStream fileStream(&file);
|
QDataStream fileStream(&file);
|
||||||
|
@ -443,20 +443,21 @@ void writeRecordingToFile(RecordingPointer recording, QString filename) {
|
||||||
|
|
||||||
fileStream << recording->_audio->getByteArray();
|
fileStream << recording->_audio->getByteArray();
|
||||||
|
|
||||||
qDebug() << "Wrote " << file.size() << " bytes in " << timer.elapsed();
|
qDebug() << "Wrote " << file.size() << " bytes in " << timer.elapsed() << " ms.";
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordingPointer readRecordingFromFile(RecordingPointer recording, QString filename) {
|
RecordingPointer readRecordingFromFile(RecordingPointer recording, QString filename) {
|
||||||
qDebug() << "Reading recording from " << filename;
|
qDebug() << "Reading recording from " << filename << ".";
|
||||||
if (!recording) {
|
if (!recording) {
|
||||||
recording.reset(new Recording());
|
recording.reset(new Recording());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QElapsedTimer timer;
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
if (!file.open(QIODevice::ReadOnly)){
|
if (!file.open(QIODevice::ReadOnly)){
|
||||||
return recording;
|
return recording;
|
||||||
}
|
}
|
||||||
|
timer.start();
|
||||||
QDataStream fileStream(&file);
|
QDataStream fileStream(&file);
|
||||||
|
|
||||||
fileStream >> recording->_timestamps;
|
fileStream >> recording->_timestamps;
|
||||||
|
@ -557,7 +558,7 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, QString filen
|
||||||
recording->addAudioPacket(audioArray);
|
recording->addAudioPacket(audioArray);
|
||||||
|
|
||||||
|
|
||||||
qDebug() << "Read " << file.size() << " bytes";
|
qDebug() << "Read " << file.size() << " bytes in " << timer.elapsed() << " ms.";
|
||||||
return recording;
|
return recording;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -528,6 +528,7 @@ void MyAvatar::startRecording() {
|
||||||
}
|
}
|
||||||
Application::getInstance()->getAudio()->setRecorder(_recorder);
|
Application::getInstance()->getAudio()->setRecorder(_recorder);
|
||||||
_recorder->startRecording();
|
_recorder->startRecording();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::stopRecording() {
|
void MyAvatar::stopRecording() {
|
||||||
|
|
|
@ -295,7 +295,6 @@ QScriptValue WindowScriptingInterface::showBrowse(const QString& title, const QS
|
||||||
// filename if the directory is valid.
|
// filename if the directory is valid.
|
||||||
QString path = "";
|
QString path = "";
|
||||||
QFileInfo fileInfo = QFileInfo(directory);
|
QFileInfo fileInfo = QFileInfo(directory);
|
||||||
qDebug() << "File: " << directory << fileInfo.isFile();
|
|
||||||
if (fileInfo.isDir()) {
|
if (fileInfo.isDir()) {
|
||||||
fileInfo.setFile(directory, "__HIFI_INVALID_FILE__");
|
fileInfo.setFile(directory, "__HIFI_INVALID_FILE__");
|
||||||
path = fileInfo.filePath();
|
path = fileInfo.filePath();
|
||||||
|
@ -303,7 +302,6 @@ QScriptValue WindowScriptingInterface::showBrowse(const QString& title, const QS
|
||||||
|
|
||||||
QFileDialog fileDialog(Application::getInstance()->getWindow(), title, path, nameFilter);
|
QFileDialog fileDialog(Application::getInstance()->getWindow(), title, path, nameFilter);
|
||||||
fileDialog.setAcceptMode(acceptMode);
|
fileDialog.setAcceptMode(acceptMode);
|
||||||
qDebug() << "Opening!";
|
|
||||||
QUrl fileUrl(directory);
|
QUrl fileUrl(directory);
|
||||||
if (acceptMode == QFileDialog::AcceptSave) {
|
if (acceptMode == QFileDialog::AcceptSave) {
|
||||||
fileDialog.setFileMode(QFileDialog::Directory);
|
fileDialog.setFileMode(QFileDialog::Directory);
|
||||||
|
|
Loading…
Reference in a new issue