summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorSakari Bergen <sakari.bergen@beatwaves.net>2012-01-28 18:14:19 +0000
committerSakari Bergen <sakari.bergen@beatwaves.net>2012-01-28 18:14:19 +0000
commitdb384a6f143ee878e70740c65e7c7f699e3fa076 (patch)
treefe633d92fb075f3010e70356255db4e3980b3823 /libs
parentab8cea1d7c19fddc6b81a6ba4a303a00e4fdd93c (diff)
Go back to one progress bar with several passes in export.
Don't calculate the progress bar position in the engine, let the UI decide. Work around progress bar bug (not verified, as I could not reproduce). git-svn-id: svn://localhost/ardour2/branches/3.0@11377 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/export_status.h4
-rw-r--r--libs/ardour/export_handler.cc7
-rw-r--r--libs/ardour/export_status.cc7
3 files changed, 12 insertions, 6 deletions
diff --git a/libs/ardour/ardour/export_status.h b/libs/ardour/ardour/export_status.h
index 5a50777f94..c85d37156c 100644
--- a/libs/ardour/ardour/export_status.h
+++ b/libs/ardour/ardour/export_status.h
@@ -52,7 +52,6 @@ struct ExportStatus {
/* Progress info */
- volatile float progress;
volatile bool normalizing;
volatile uint32_t total_timespans;
@@ -61,6 +60,9 @@ struct ExportStatus {
volatile framecnt_t total_frames;
volatile framecnt_t processed_frames;
+ volatile framecnt_t total_frames_current_timespan;
+ volatile framecnt_t processed_frames_current_timespan;
+
volatile uint32_t total_normalize_cycles;
volatile uint32_t current_normalize_cycle;
diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc
index ef9d32474a..d6ade6532c 100644
--- a/libs/ardour/export_handler.cc
+++ b/libs/ardour/export_handler.cc
@@ -163,6 +163,8 @@ ExportHandler::start_timespan ()
}
current_timespan = config_map.begin()->first;
+ export_status->total_frames_current_timespan = current_timespan->get_length();
+ export_status->processed_frames_current_timespan = 0;
/* Register file configurations to graph builder */
@@ -215,8 +217,7 @@ ExportHandler::process_timespan (framecnt_t frames)
process_position += frames_to_read;
export_status->processed_frames += frames_to_read;
- export_status->progress = (float) export_status->processed_frames /
- export_status->total_frames;
+ export_status->processed_frames_current_timespan += frames_to_read;
/* Do actual processing */
int ret = graph_builder->process (frames_to_read, last_cycle);
@@ -246,8 +247,6 @@ ExportHandler::process_normalize ()
export_status->normalizing = true;
}
- export_status->progress = (float) export_status->current_normalize_cycle /
- export_status->total_normalize_cycles;
export_status->current_normalize_cycle++;
return 0;
diff --git a/libs/ardour/export_status.cc b/libs/ardour/export_status.cc
index dbb96432ee..70ce8dd27e 100644
--- a/libs/ardour/export_status.cc
+++ b/libs/ardour/export_status.cc
@@ -37,7 +37,6 @@ ExportStatus::init ()
_finished = false;
_errors = false;
- progress = 0.0;
normalizing = false;
total_timespans = 0;
@@ -45,6 +44,12 @@ ExportStatus::init ()
total_frames = 0;
processed_frames = 0;
+
+ total_frames_current_timespan = 0;
+ processed_frames_current_timespan = 0;
+
+ total_normalize_cycles = 0;
+ current_normalize_cycle = 0;
}
void