diff options
author | Henri Herscher <henri@oreka.org> | 2006-05-05 19:29:43 +0000 |
---|---|---|
committer | Henri Herscher <henri@oreka.org> | 2006-05-05 19:29:43 +0000 |
commit | a279a59505abff5d2c0802feeeceeb4f08ee067c (patch) | |
tree | 6bda4d2d70ca8ccff7210424256e6c5b7d490cc6 /orkaudio | |
parent | 8267f45f799c2c976534676ed03b5ab315382873 (diff) |
Tapes now only reported if it was possible to transcode them.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@224 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkaudio')
-rw-r--r-- | orkaudio/BatchProcessing.cpp | 29 | ||||
-rw-r--r-- | orkaudio/CapturePort.cpp | 2 | ||||
-rw-r--r-- | orkaudio/Reporting.cpp | 16 |
3 files changed, 31 insertions, 16 deletions
diff --git a/orkaudio/BatchProcessing.cpp b/orkaudio/BatchProcessing.cpp index a381958..73424f2 100644 --- a/orkaudio/BatchProcessing.cpp +++ b/orkaudio/BatchProcessing.cpp @@ -13,6 +13,7 @@ #include "ConfigManager.h" #include "BatchProcessing.h" +#include "Reporting.h" #include "LogManager.h" #include "ace/OS_NS_unistd.h" #include "audiofile/LibSndFileFile.h" @@ -149,16 +150,16 @@ void BatchProcessing::ThreadHandler(void *args) fileRef = audioTapeRef->GetAudioFileRef(); CStdString filename = audioTapeRef->GetFilename(); - if(pBatchProcessing->DropTapeIfNeeded(filename) == true) - { - // The tape we have pulled has been dropped in the meantime. just delete the capture file - if(CONFIG.m_deleteNativeFile) - { - fileRef->Delete(); - } - } - else - { + //if(pBatchProcessing->DropTapeIfNeeded(filename) == true) + //{ + // // The tape we have pulled has been dropped in the meantime. just delete the capture file + // if(CONFIG.m_deleteNativeFile) + // { + // fileRef->Delete(); + // } + //} + //else + //{ // Let's work on the tape we have pulled //CStdString threadIdString = IntToString(threadId); LOG4CXX_INFO(LOG.batchProcessingLog, CStdString("Th") + threadIdString + " processing: " + audioTapeRef->GetIdentifier()); @@ -257,9 +258,11 @@ void BatchProcessing::ThreadHandler(void *args) CStdString threadIdString = IntToString(threadId); LOG4CXX_INFO(LOG.batchProcessingLog, CStdString("Th") + threadIdString + " deleting native: " + audioTapeRef->GetIdentifier()); } - CStdString filename = audioTapeRef->GetFilename(); - pBatchProcessing->DropTapeIfNeeded(filename); // maybe the tape was dropped while we were processing it - } + //CStdString filename = audioTapeRef->GetFilename(); + //pBatchProcessing->DropTapeIfNeeded(filename); // maybe the tape was dropped while we were processing it + + Reporting::GetInstance()->AddAudioTape(audioTapeRef); + //} } } catch (CStdString& e) diff --git a/orkaudio/CapturePort.cpp b/orkaudio/CapturePort.cpp index 14e0e8a..261b1d5 100644 --- a/orkaudio/CapturePort.cpp +++ b/orkaudio/CapturePort.cpp @@ -187,7 +187,7 @@ void CapturePort::AddCaptureEvent(CaptureEventRef eventRef) // Notify immediate processing that tape has stopped ImmediateProcessing::GetInstance()->AddAudioTape(m_audioTapeRef); // Reporting needs to send a stop message - Reporting::GetInstance()->AddAudioTape(audioTapeRef); + // Reporting::GetInstance()->AddAudioTape(audioTapeRef); } else { diff --git a/orkaudio/Reporting.cpp b/orkaudio/Reporting.cpp index 308b58c..13d9c95 100644 --- a/orkaudio/Reporting.cpp +++ b/orkaudio/Reporting.cpp @@ -81,9 +81,21 @@ void Reporting::ThreadHandler(void *args) success = true; if(tr.m_deleteTape) { - LOG4CXX_INFO(LOG.reportingLog, "Registered tape for removal: " + audioTapeRef->GetIdentifier()); + //LOG4CXX_INFO(LOG.reportingLog, "Registered tape for removal: " + audioTapeRef->GetIdentifier()); + //BatchProcessing::GetInstance()->TapeDropRegistration(tapeFilename); + CStdString tapeFilename = audioTapeRef->GetFilename(); - BatchProcessing::GetInstance()->TapeDropRegistration(tapeFilename); + + CStdString absoluteFilename = CONFIG.m_audioOutputPath + "/" + tapeFilename; + if (ACE_OS::unlink((PCSTR)absoluteFilename) == 0) + { + LOG4CXX_INFO(LOG.reportingLog, "Deleted tape: " + tapeFilename); + } + else + { + LOG4CXX_DEBUG(LOG.reportingLog, "Could not delete tape: " + tapeFilename); + } + } } else |