Skip to content
Extraits de code Groupes Projets
Valider f46200a3 rédigé par Rodrigo Braz Monteiro's avatar Rodrigo Braz Monteiro
Parcourir les fichiers

A few more tweaks to progress dialog.

Originally committed to SVN as r2429.
parent acfb8154
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#include "standard_paths.h" #include "standard_paths.h"
#include "options.h" #include "options.h"
#include "utils.h" #include "utils.h"
#include "frame_main.h"
#include "main.h"
/////////////// ///////////////
...@@ -72,7 +74,7 @@ HDAudioProvider::HDAudioProvider(AudioProvider *source) { ...@@ -72,7 +74,7 @@ HDAudioProvider::HDAudioProvider(AudioProvider *source) {
// Start progress // Start progress
volatile bool canceled = false; volatile bool canceled = false;
DialogProgress *progress = new DialogProgress(NULL,_T("Load audio"),&canceled,_T("Reading to Hard Disk cache"),0,num_samples); DialogProgress *progress = new DialogProgress(AegisubApp::Get()->frame,_T("Load audio"),&canceled,_T("Reading to Hard Disk cache"),0,num_samples);
progress->Show(); progress->Show();
// Write to disk // Write to disk
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "dialog_progress.h" #include "dialog_progress.h"
#include "audio_provider_ram.h" #include "audio_provider_ram.h"
#include "utils.h" #include "utils.h"
#include "frame_main.h"
#include "main.h"
/////////// ///////////
...@@ -82,7 +84,7 @@ RAMAudioProvider::RAMAudioProvider(AudioProvider *source) { ...@@ -82,7 +84,7 @@ RAMAudioProvider::RAMAudioProvider(AudioProvider *source) {
// Start progress // Start progress
volatile bool canceled = false; volatile bool canceled = false;
DialogProgress *progress = new DialogProgress(NULL,_("Load audio"),&canceled,_("Reading into RAM"),0,source->GetNumSamples()); DialogProgress *progress = new DialogProgress(AegisubApp::Get()->frame,_("Load audio"),&canceled,_("Reading into RAM"),0,source->GetNumSamples());
progress->Show(); progress->Show();
progress->SetProgress(0,1); progress->SetProgress(0,1);
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <wx/button.h> #include <wx/button.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include "dialog_progress.h" #include "dialog_progress.h"
#include "utils.h"
DEFINE_EVENT_TYPE(wxEVT_PROGRESS_UPDATE) DEFINE_EVENT_TYPE(wxEVT_PROGRESS_UPDATE)
...@@ -82,7 +83,7 @@ void DialogProgress::SetProgress(int cur,int max) { ...@@ -82,7 +83,7 @@ void DialogProgress::SetProgress(int cur,int max) {
// Check if it's the main thread, if so, just process it now // Check if it's the main thread, if so, just process it now
if (wxIsMainThread()) { if (wxIsMainThread()) {
gauge->SetValue(value); gauge->SetValue(MID(0,value,100));
wxYield(); wxYield();
return; return;
} }
...@@ -105,7 +106,7 @@ void DialogProgress::SetProgress(int cur,int max) { ...@@ -105,7 +106,7 @@ void DialogProgress::SetProgress(int cur,int max) {
void DialogProgress::OnUpdateProgress(wxCommandEvent &event) void DialogProgress::OnUpdateProgress(wxCommandEvent &event)
{ {
int value = event.GetInt(); int value = event.GetInt();
if (gauge->GetValue() != value) gauge->SetValue(value); if (gauge->GetValue() != value) gauge->SetValue(MID(0,value,100));
wxMutexLocker locker(mutex); wxMutexLocker locker(mutex);
count--; count--;
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter