Print the total duration when the process is completed.

This commit is contained in:
LoRd_MuldeR 2011-11-28 00:35:43 +01:00
parent c1b88a7d07
commit 5585d53fc7
21 changed files with 339 additions and 66 deletions

View File

@ -20,7 +20,7 @@ a:visited { color: #0000EE; }
<li>Added support for the QAAC Encoder, requires QuickTime v7.7.1 or newer (see <a href="FAQ.html#71a113b0" target="_blank">FAQ doc</a> for details)
<li>Updated LAME encoder to v3.99.2 Final (2011-11-18), compiled with ICL 12.1.7 and MSVC 10.0 (<a href="http://lame.cvs.sourceforge.net/viewvc/lame/lame/doc/html/history.html?revision=1.134" target="_blank">details</a>)
<li>Updated MediaInfo to v0.7.51+ (2011-11-19), compiled with ICL 12.1.6 and MSVC 10.0
<li>Implemented coalescing of update signals in order to reduce the CPU usage of the LameXP process
<li>Implemented coalescing of update signals to reduce the CPU usage of the LameXP process (<a href="http://forum.doom9.org/showpost.php?p=1539631&postcount=507" target="_blank">details</a>)
<li>Run more than four instances in parallel on systems with more than four CPU cores (<a href="FAQ.html#89cbd3d0" target="_blank">details</a>)
</ul><br>

View File

@ -489,7 +489,7 @@ we create, the more CPU cores can be utilized. In reality, however, there are so
computer. And, the more instances we run in parallel, the more processes will be competing for these shared<br>
resources! More specifically, the amount of main memory (RAM) is limited. Creating a huge number of instances<br>
in parallel can easily use up all RAM, which will cause the operating system to make heavy use of the page<br>
file. This can result in HDD thrasing and may significantly hurt the overall performance! But even when there<br>
file. This can result in HDD thrashing and may significantly hurt the overall performance! But even if there<br>
is enough RAM available on the system, each encoder or decoder instance needs to access the HDD, e.g. for<br>
reading the input file and for writing the output file. Thus too many instances will cause an I/O bottleneck!<br>
If, however, you think that LameXP's choice of the number of parallel instances is too conservative, you may<br>

View File

@ -606,7 +606,7 @@
<context>
<name>DiskObserverThread</name>
<message>
<location filename="../../src/Thread_DiskObserver.cpp" line="82"/>
<location filename="../../src/Thread_DiskObserver.cpp" line="83"/>
<source>Low diskspace on drive &apos;%1&apos; detected (only %2 MB are free), problems can occur!</source>
<translation type="unfinished"></translation>
</message>
@ -2633,127 +2633,154 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="152"/>
<location filename="../../src/Dialog_Processing.cpp" line="154"/>
<source>Show details for selected job</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="153"/>
<location filename="../../src/Dialog_Processing.cpp" line="155"/>
<source>Browse Output File Location</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="171"/>
<location filename="../../src/Dialog_Processing.cpp" line="173"/>
<source>Encoding Files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="171"/>
<location filename="../../src/Dialog_Processing.cpp" line="173"/>
<source>Your files are being encoded, please be patient...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="332"/>
<location filename="../../src/Dialog_Processing.cpp" line="335"/>
<source>Encoding files, please wait...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="375"/>
<location filename="../../src/Dialog_Processing.cpp" line="378"/>
<source>Multi-threading enabled: Running %1 instances in parallel!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="389"/>
<location filename="../../src/Dialog_Processing.cpp" line="398"/>
<source>Aborted! Waiting for running jobs to terminate...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="404"/>
<location filename="../../src/Dialog_Processing.cpp" line="413"/>
<source>Encoding: %1 files of %2 completed so far, please wait...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="432"/>
<location filename="../../src/Dialog_Processing.cpp" line="441"/>
<source>Creating the playlist file, please wait...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="442"/>
<location filename="../../src/Dialog_Processing.cpp" line="451"/>
<source>Process was aborted by the user after %1 file(s)!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="442"/>
<location filename="../../src/Dialog_Processing.cpp" line="451"/>
<source>Process was aborted prematurely by the user!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="443"/>
<location filename="../../src/Dialog_Processing.cpp" line="452"/>
<source>LameXP - Aborted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="443"/>
<location filename="../../src/Dialog_Processing.cpp" line="452"/>
<source>Process was aborted by the user.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="455"/>
<location filename="../../src/Dialog_Processing.cpp" line="465"/>
<source>Process finished after %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="474"/>
<source>Error: %1 of %2 files failed. Double-click failed items for detailed information!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="456"/>
<location filename="../../src/Dialog_Processing.cpp" line="475"/>
<source>LameXP - Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="456"/>
<location filename="../../src/Dialog_Processing.cpp" line="475"/>
<source>At least one file has failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="466"/>
<location filename="../../src/Dialog_Processing.cpp" line="467"/>
<location filename="../../src/Dialog_Processing.cpp" line="485"/>
<location filename="../../src/Dialog_Processing.cpp" line="486"/>
<source>All files completed successfully.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="467"/>
<location filename="../../src/Dialog_Processing.cpp" line="486"/>
<source>LameXP - Done</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="864"/>
<location filename="../../src/Dialog_Processing.cpp" line="883"/>
<source>Playlist creation failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="864"/>
<location filename="../../src/Dialog_Processing.cpp" line="883"/>
<source>The playlist file could not be created:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="934"/>
<location filename="../../src/Dialog_Processing.cpp" line="953"/>
<source>Warning: Computer will shutdown in %1 seconds...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="938"/>
<location filename="../../src/Dialog_Processing.cpp" line="939"/>
<location filename="../../src/Dialog_Processing.cpp" line="957"/>
<location filename="../../src/Dialog_Processing.cpp" line="958"/>
<source>Cancel Shutdown</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="1013"/>
<source>hour(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="1014"/>
<location filename="../../src/Dialog_Processing.cpp" line="1018"/>
<source>minute(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="1019"/>
<location filename="../../src/Dialog_Processing.cpp" line="1023"/>
<source>second(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="1024"/>
<source>millisecond(s)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProgressModel</name>
<message>
<location filename="../../src/Model_Progress.cpp" line="114"/>
<location filename="../../src/Model_Progress.cpp" line="118"/>
<source>Job</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Model_Progress.cpp" line="117"/>
<location filename="../../src/Model_Progress.cpp" line="121"/>
<source>Status</source>
<translation type="unfinished"></translation>
</message>

View File

@ -2125,6 +2125,26 @@
<source>Free Disk Space (Temp Folder)</source>
<translation>Freier Festplattenspeicher (Temp Ordner)</translation>
</message>
<message>
<source>Process finished after %1.</source>
<translation>Vorgang abgeschlossen nach %1.</translation>
</message>
<message>
<source>hour(s)</source>
<translation>Stunde(n)</translation>
</message>
<message>
<source>minute(s)</source>
<translation>Minute(n)</translation>
</message>
<message>
<source>second(s)</source>
<translation>Sekunde(n)</translation>
</message>
<message>
<source>millisecond(s)</source>
<translation>Millisekunde(n)</translation>
</message>
</context>
<context>
<name>ProgressModel</name>

View File

@ -2124,6 +2124,26 @@
<source>Free Disk Space (Temp Folder)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Process finished after %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>hour(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>minute(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>second(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>millisecond(s)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProgressModel</name>

View File

@ -2134,6 +2134,26 @@ Ouvrir le dossier récursivement...</translation>
<source>Free Disk Space (Temp Folder)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Process finished after %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>hour(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>minute(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>second(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>millisecond(s)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProgressModel</name>

View File

@ -2125,6 +2125,26 @@
<source>Free Disk Space (Temp Folder)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Process finished after %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>hour(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>minute(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>second(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>millisecond(s)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProgressModel</name>

View File

@ -2124,6 +2124,26 @@
<source>Free Disk Space (Temp Folder)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Process finished after %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>hour(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>minute(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>second(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>millisecond(s)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProgressModel</name>

View File

@ -606,7 +606,7 @@
<context>
<name>DiskObserverThread</name>
<message>
<location filename="../../src/Thread_DiskObserver.cpp" line="82"/>
<location filename="../../src/Thread_DiskObserver.cpp" line="83"/>
<source>Low diskspace on drive &apos;%1&apos; detected (only %2 MB are free), problems can occur!</source>
<translation type="unfinished">Mało miejsca na dysku &apos;%1&apos; (tylko %2 MB dostępnych), mogą wystąpić problemy!</translation>
</message>
@ -2633,127 +2633,154 @@
<translation type="unfinished">Powrót</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="152"/>
<location filename="../../src/Dialog_Processing.cpp" line="154"/>
<source>Show details for selected job</source>
<translation type="unfinished">Pokaż szczegóły wybranego zadania</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="153"/>
<location filename="../../src/Dialog_Processing.cpp" line="155"/>
<source>Browse Output File Location</source>
<translation type="unfinished">Wybierz lokalizację dla plików wyjściowych</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="171"/>
<location filename="../../src/Dialog_Processing.cpp" line="173"/>
<source>Encoding Files</source>
<translation type="unfinished">Kompresowanie plików</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="171"/>
<location filename="../../src/Dialog_Processing.cpp" line="173"/>
<source>Your files are being encoded, please be patient...</source>
<translation type="unfinished">Twoje pliki właśnie kompresowane, prosze być cierpliwy...</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="332"/>
<location filename="../../src/Dialog_Processing.cpp" line="335"/>
<source>Encoding files, please wait...</source>
<translation type="unfinished">Kompresowanie plików, prosze czekać...</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="375"/>
<location filename="../../src/Dialog_Processing.cpp" line="378"/>
<source>Multi-threading enabled: Running %1 instances in parallel!</source>
<translation type="unfinished">Wielowątkowosć włączona: Równolegle wykonywanych jest %1 kodowań!</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="389"/>
<location filename="../../src/Dialog_Processing.cpp" line="398"/>
<source>Aborted! Waiting for running jobs to terminate...</source>
<translation type="unfinished">Przerwano! Czekanie na wyłączenie procesu...</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="404"/>
<location filename="../../src/Dialog_Processing.cpp" line="413"/>
<source>Encoding: %1 files of %2 completed so far, please wait...</source>
<translation type="unfinished">Kompresja: Prosze czekać, jak dotąd wykonano %1 z %2 plików...</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="432"/>
<location filename="../../src/Dialog_Processing.cpp" line="441"/>
<source>Creating the playlist file, please wait...</source>
<translation type="unfinished">Tworzenie pliku playlisty, prosze czekać...</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="442"/>
<location filename="../../src/Dialog_Processing.cpp" line="451"/>
<source>Process was aborted by the user after %1 file(s)!</source>
<translation type="unfinished">Proces został przerwany przez użytkownika po wykonaniu %1 plików!</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="442"/>
<location filename="../../src/Dialog_Processing.cpp" line="451"/>
<source>Process was aborted prematurely by the user!</source>
<translation type="unfinished">Proces został przedwcześnie zakończony przez użytkownika!</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="443"/>
<location filename="../../src/Dialog_Processing.cpp" line="452"/>
<source>LameXP - Aborted</source>
<translation type="unfinished">LameXP - Przerwano</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="443"/>
<location filename="../../src/Dialog_Processing.cpp" line="452"/>
<source>Process was aborted by the user.</source>
<translation type="unfinished">Proces został przerwany przez użytkownika.</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="455"/>
<location filename="../../src/Dialog_Processing.cpp" line="465"/>
<source>Process finished after %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="474"/>
<source>Error: %1 of %2 files failed. Double-click failed items for detailed information!</source>
<translation type="unfinished">Błąd: %1 z %2 plików nie zostało skompresowanych. Kliknij dwukrotnie na plik aby zobaczyć szczegóły!</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="456"/>
<location filename="../../src/Dialog_Processing.cpp" line="475"/>
<source>LameXP - Error</source>
<translation type="unfinished">LameXP - Błąd</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="456"/>
<location filename="../../src/Dialog_Processing.cpp" line="475"/>
<source>At least one file has failed!</source>
<translation type="unfinished">Przynajmniej jeden plik nie został skompresowany!</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="466"/>
<location filename="../../src/Dialog_Processing.cpp" line="467"/>
<location filename="../../src/Dialog_Processing.cpp" line="485"/>
<location filename="../../src/Dialog_Processing.cpp" line="486"/>
<source>All files completed successfully.</source>
<translation type="unfinished">Kompresja wszystkich plików zakończona powodzeniem.</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="467"/>
<location filename="../../src/Dialog_Processing.cpp" line="486"/>
<source>LameXP - Done</source>
<translation type="unfinished">LameXP - Zrobione</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="864"/>
<location filename="../../src/Dialog_Processing.cpp" line="883"/>
<source>Playlist creation failed</source>
<translation type="unfinished">Tworzenie playlisty zakończone niepowodzeniem</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="864"/>
<location filename="../../src/Dialog_Processing.cpp" line="883"/>
<source>The playlist file could not be created:</source>
<translation type="unfinished">Playlista nie mogła zostać utworzona:</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="934"/>
<location filename="../../src/Dialog_Processing.cpp" line="953"/>
<source>Warning: Computer will shutdown in %1 seconds...</source>
<translation type="unfinished">Ostrzeżenie: Komputer zostanie zamknięty za %1 sekund/y...</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="938"/>
<location filename="../../src/Dialog_Processing.cpp" line="939"/>
<location filename="../../src/Dialog_Processing.cpp" line="957"/>
<location filename="../../src/Dialog_Processing.cpp" line="958"/>
<source>Cancel Shutdown</source>
<translation type="unfinished">Anuluj wyłączenie komputera</translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="1013"/>
<source>hour(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="1014"/>
<location filename="../../src/Dialog_Processing.cpp" line="1018"/>
<source>minute(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="1019"/>
<location filename="../../src/Dialog_Processing.cpp" line="1023"/>
<source>second(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="1024"/>
<source>millisecond(s)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProgressModel</name>
<message>
<location filename="../../src/Model_Progress.cpp" line="114"/>
<location filename="../../src/Model_Progress.cpp" line="118"/>
<source>Job</source>
<translation type="unfinished">Zadanie</translation>
</message>
<message>
<location filename="../../src/Model_Progress.cpp" line="117"/>
<location filename="../../src/Model_Progress.cpp" line="121"/>
<source>Status</source>
<translation type="unfinished">Status</translation>
</message>

View File

@ -2132,6 +2132,26 @@
<source>Free Disk Space (Temp Folder)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Process finished after %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>hour(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>minute(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>second(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>millisecond(s)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProgressModel</name>

View File

@ -2125,6 +2125,26 @@
<source>Free Disk Space (Temp Folder)</source>
<translation>Вільне місце на диску (тека тимчасових файлів)</translation>
</message>
<message>
<source>Process finished after %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>hour(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>minute(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>second(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>millisecond(s)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProgressModel</name>

View File

@ -36,6 +36,7 @@
..\..\src\Dialog_WorkingBanner.cpp
..\..\src\Encoder_AAC.cpp
..\..\src\Encoder_AAC_FHG.cpp
..\..\src\Encoder_AAC_QAAC.cpp
..\..\src\Encoder_Abstract.cpp
..\..\src\Encoder_AC3.cpp
..\..\src\Encoder_FLAC.cpp
@ -103,6 +104,7 @@
..\..\src\Dialog_WorkingBanner.h
..\..\src\Encoder_AAC.h
..\..\src\Encoder_AAC_FHG.h
..\..\src\Encoder_AAC_QAAC.h
..\..\src\Encoder_Abstract.h
..\..\src\Encoder_AC3.h
..\..\src\Encoder_FLAC.h

View File

@ -23,6 +23,7 @@
<file>icons/cd_delete.png</file>
<file>icons/cd_edit.png</file>
<file>icons/cd_go.png</file>
<file>icons/clock.png</file>
<file>icons/clock_play.png</file>
<file>icons/cog.png</file>
<file>icons/comment.png</file>

Binary file not shown.

View File

@ -29,8 +29,8 @@
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 4
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 4
#define VER_LAMEXP_BUILD 793
#define VER_LAMEXP_PATCH 5
#define VER_LAMEXP_BUILD 796
///////////////////////////////////////////////////////////////////////////////
// Tool versions (minimum expected versions!)

View File

@ -61,6 +61,7 @@
#include <QSystemTrayIcon>
#include <QProcess>
#include <QProgressDialog>
#include <QTime>
#include <MMSystem.h>
#include <math.h>
@ -73,6 +74,7 @@
//Function to calculate the number of instances
static int cores2instances(int cores);
static QString time2text(const double timeVal);
////////////////////////////////////////////////////////////
@ -180,6 +182,7 @@ ProcessingDialog::ProcessingDialog(FileListModel *fileListModel, AudioFileModel
m_succeededJobs.clear();
m_failedJobs.clear();
m_userAborted = false;
m_timerStart = 0I64;
}
////////////////////////////////////////////////////////////
@ -345,7 +348,7 @@ void ProcessingDialog::initEncoding(void)
if(!m_diskObserver)
{
m_diskObserver = new DiskObserverThread(m_settings->customTempPathEnabled() ? m_settings->customTempPath() : lamexp_temp_folder2());
connect(m_diskObserver, SIGNAL(messageLogged(QString,bool)), m_progressModel, SLOT(addSystemMessage(QString,bool)), Qt::QueuedConnection);
connect(m_diskObserver, SIGNAL(messageLogged(QString,int)), m_progressModel, SLOT(addSystemMessage(QString,int)), Qt::QueuedConnection);
connect(m_diskObserver, SIGNAL(freeSpaceChanged(quint64)), this, SLOT(diskUsageHasChanged(quint64)), Qt::QueuedConnection);
m_diskObserver->start();
}
@ -379,6 +382,12 @@ void ProcessingDialog::initEncoding(void)
{
startNextJob();
}
LARGE_INTEGER counter;
if(QueryPerformanceCounter(&counter))
{
m_timerStart = counter.QuadPart;
}
}
void ProcessingDialog::abortEncoding(void)
@ -447,6 +456,16 @@ void ProcessingDialog::doneEncoding(void)
}
else
{
LARGE_INTEGER counter, frequency;
if(QueryPerformanceCounter(&counter) && QueryPerformanceFrequency(&frequency))
{
if((m_timerStart > 0I64) && (frequency.QuadPart > 0I64) && (m_timerStart < counter.QuadPart))
{
double timeElapsed = static_cast<double>(counter.QuadPart - m_timerStart) / static_cast<double>(frequency.QuadPart);
m_progressModel->addSystemMessage(tr("Process finished after %1.").arg(time2text(timeElapsed)), ProgressModel::SysMsg_Performance);
}
}
if(m_failedJobs.count() > 0)
{
CHANGE_BACKGROUND_COLOR(frame_header, QColor("#FFBABA"));
@ -981,6 +1000,33 @@ bool ProcessingDialog::shutdownComputer(void)
return true;
}
QString ProcessingDialog::time2text(const double timeVal) const
{
double intPart = 0;
double frcPart = modf(timeVal, &intPart);
int x = 0, y = 0; QString a, b;
QTime time = QTime().addSecs(qRound(intPart)).addMSecs(qRound(frcPart * 1000.0));
if(time.hour() > 0)
{
x = time.hour(); a = tr("hour(s)");
y = time.minute(); b = tr("minute(s)");
}
else if(time.minute() > 0)
{
x = time.minute(); a = tr("minute(s)");
y = time.second(); b = tr("second(s)");
}
else
{
x = time.second(); a = tr("second(s)");
y = time.msec(); b = tr("millisecond(s)");
}
return QString("%1 %2, %3 %4").arg(QString::number(x), a, QString::number(y), b);
}
////////////////////////////////////////////////////////////
// HELPER FUNCTIONS
////////////////////////////////////////////////////////////

View File

@ -82,6 +82,7 @@ private:
AudioFileModel updateMetaInfo(const AudioFileModel &audioFile);
void writePlayList(void);
bool shutdownComputer(void);
QString time2text(const double timeVal) const;
QList<AudioFileModel> m_pendingJobs;
SettingsModel *m_settings;
@ -102,4 +103,5 @@ private:
CPUObserverThread *m_cpuObserver;
RAMObserverThread *m_ramObserver;
DiskObserverThread *m_diskObserver;
qint64 m_timerStart;
};

View File

@ -32,7 +32,8 @@ ProgressModel::ProgressModel(void)
m_iconComplete(":/icons/tick.png"),
m_iconFailed(":/icons/exclamation.png"),
m_iconSystem(":/icons/computer.png"),
m_iconWarning(":/icons/error.png")
m_iconWarning(":/icons/error.png"),
m_iconPerformance(":/icons/clock.png")
{
}
@ -88,6 +89,9 @@ QVariant ProgressModel::data(const QModelIndex &index, int role) const
case JobWarning:
return m_iconWarning;
break;
case JobPerformance:
return m_iconPerformance;
break;
default:
return m_iconFailed;
break;
@ -205,7 +209,7 @@ const QUuid &ProgressModel::getJobId(const QModelIndex &index)
return *(reinterpret_cast<QUuid*>(NULL));
}
void ProgressModel::addSystemMessage(const QString &text, bool isWarning)
void ProgressModel::addSystemMessage(const QString &text, int type)
{
const QUuid &jobId = QUuid::createUuid();
@ -222,12 +226,27 @@ void ProgressModel::addSystemMessage(const QString &text, bool isWarning)
}
int newIndex = m_jobList.count();
JobState jobState = JobState(-1);
switch(type)
{
case SysMsg_Warning:
jobState = JobWarning;
break;
case SysMsg_Performance:
jobState = JobPerformance;
break;
default:
jobState = JobSystem;
break;
}
beginInsertRows(QModelIndex(), newIndex, newIndex);
m_jobList.append(jobId);
m_jobName.insert(jobId, text);
m_jobStatus.insert(jobId, QString());
m_jobState.insert(jobId, isWarning ? JobWarning : JobSystem);
m_jobState.insert(jobId, jobState);
m_jobLogFile.insert(jobId, QStringList());
endInsertRows();

View File

@ -45,7 +45,14 @@ public:
JobComplete = 2,
JobFailed = 3,
JobSystem = 4,
JobWarning = 5
JobWarning = 5,
JobPerformance = 6
};
enum SysMsgType
{
SysMsg_Info = 0,
SysMsg_Performance = 1,
SysMsg_Warning = 2
};
//Model functions
@ -63,7 +70,7 @@ public slots:
void addJob(const QUuid &jobId, const QString &jobName, const QString &jobInitialStatus = QString("Initializing..."), int jobInitialState = JobRunning);
void updateJob(const QUuid &jobId, const QString &newStatus, int newState);
void appendToLog(const QUuid &jobId, const QString &line);
void addSystemMessage(const QString &text, bool isWarning = false);
void addSystemMessage(const QString &text, int type = SysMsg_Info);
private:
QList<QUuid> m_jobList;
@ -79,4 +86,5 @@ private:
const QIcon m_iconFailed;
const QIcon m_iconSystem;
const QIcon m_iconWarning;
const QIcon m_iconPerformance;
};

View File

@ -22,6 +22,7 @@
#include "Thread_DiskObserver.h"
#include "Global.h"
#include "Model_Progress.h"
#include <QDir>
@ -79,7 +80,7 @@ void DiskObserverThread::observe(void)
if(freeSpace < minimumSpace)
{
qWarning("Free diskspace on '%s' dropped below %s MB, only %s MB free!", m_path.toUtf8().constData(), QString::number(minimumSpace / 1048576ui64).toUtf8().constData(), QString::number(freeSpace / 1048576ui64).toUtf8().constData());
emit messageLogged(tr("Low diskspace on drive '%1' detected (only %2 MB are free), problems can occur!").arg(QDir::toNativeSeparators(m_path), QString::number(freeSpace / 1048576ui64)), true);
emit messageLogged(tr("Low diskspace on drive '%1' detected (only %2 MB are free), problems can occur!").arg(QDir::toNativeSeparators(m_path), QString::number(freeSpace / 1048576ui64)), ProgressModel::SysMsg_Warning);
minimumSpace = qMin(freeSpace, (minimumSpace >> 1));
}
if(freeSpace != previousSpace)

View File

@ -41,7 +41,7 @@ protected:
static QString makeRootDir(const QString &baseDir);
signals:
void messageLogged(const QString &text, bool isWarning);
void messageLogged(const QString &text, int type);
void freeSpaceChanged(const quint64);
private: