Normalize API rename part 2

This commit is contained in:
Robin Gareus 2016-07-18 17:31:50 +02:00
parent b64dcac17e
commit 8c944c08ea
8 changed files with 16 additions and 16 deletions

View file

@ -406,12 +406,12 @@ ExportDialog::progress_timeout ()
case ExportStatus::Normalizing: case ExportStatus::Normalizing:
status_text = string_compose (_("Normalizing '%3' (timespan %1 of %2)"), status_text = string_compose (_("Normalizing '%3' (timespan %1 of %2)"),
status->timespan, status->total_timespans, status->timespan_name); status->timespan, status->total_timespans, status->timespan_name);
progress = ((float) status->current_normalize_cycle) / status->total_normalize_cycles; progress = ((float) status->current_postprocessing_cycle) / status->total_postprocessing_cycles;
break; break;
case ExportStatus::Encoding: case ExportStatus::Encoding:
status_text = string_compose (_("Encoding '%3' (timespan %1 of %2)"), status_text = string_compose (_("Encoding '%3' (timespan %1 of %2)"),
status->timespan, status->total_timespans, status->timespan_name); status->timespan, status->total_timespans, status->timespan_name);
progress = ((float) status->current_normalize_cycle) / status->total_normalize_cycles; progress = ((float) status->current_postprocessing_cycle) / status->total_postprocessing_cycles;
break; break;
case ExportStatus::Tagging: case ExportStatus::Tagging:
status_text = string_compose (_("Tagging '%3' (timespan %1 of %2)"), status_text = string_compose (_("Tagging '%3' (timespan %1 of %2)"),

View file

@ -559,7 +559,7 @@ ExportVideoDialog::audio_progress_display ()
switch (status->active_job) { switch (status->active_job) {
case ExportStatus::Normalizing: case ExportStatus::Normalizing:
pbar.set_text (_("Normalizing audio")); pbar.set_text (_("Normalizing audio"));
progress = ((float) status->current_normalize_cycle) / status->total_normalize_cycles; progress = ((float) status->current_postprocessing_cycle) / status->total_postprocessing_cycles;
progress = progress / (_twopass ? 4.0 : 3.0) + (_twopass ? .25 : 1.0 / 3.0); progress = progress / (_twopass ? 4.0 : 3.0) + (_twopass ? .25 : 1.0 / 3.0);
break; break;
case ExportStatus::Exporting: case ExportStatus::Exporting:

View file

@ -71,7 +71,7 @@ class LIBARDOUR_API ExportGraphBuilder
bool post_process (); // returns true when finished bool post_process (); // returns true when finished
bool need_postprocessing () const { return !intermediates.empty(); } bool need_postprocessing () const { return !intermediates.empty(); }
bool realtime() const { return _realtime; } bool realtime() const { return _realtime; }
unsigned get_normalize_cycle_count() const; unsigned get_postprocessing_cycle_count() const;
void reset (); void reset ();
void cleanup (bool remove_out_files = false); void cleanup (bool remove_out_files = false);
@ -155,7 +155,7 @@ class LIBARDOUR_API ExportGraphBuilder
void remove_children (bool remove_out_files); void remove_children (bool remove_out_files);
bool operator== (FileSpec const & other_config) const; bool operator== (FileSpec const & other_config) const;
unsigned get_normalize_cycle_count() const; unsigned get_postprocessing_cycle_count() const;
/// Returns true when finished /// Returns true when finished
bool process (); bool process ();

View file

@ -78,8 +78,8 @@ class LIBARDOUR_API ExportStatus {
volatile framecnt_t total_frames_current_timespan; volatile framecnt_t total_frames_current_timespan;
volatile framecnt_t processed_frames_current_timespan; volatile framecnt_t processed_frames_current_timespan;
volatile uint32_t total_normalize_cycles; volatile uint32_t total_postprocessing_cycles;
volatile uint32_t current_normalize_cycle; volatile uint32_t current_postprocessing_cycle;
AnalysisResults result_map; AnalysisResults result_map;

View file

@ -98,11 +98,11 @@ ExportGraphBuilder::post_process ()
} }
unsigned unsigned
ExportGraphBuilder::get_normalize_cycle_count() const ExportGraphBuilder::get_postprocessing_cycle_count() const
{ {
unsigned max = 0; unsigned max = 0;
for (std::list<Intermediate *>::const_iterator it = intermediates.begin(); it != intermediates.end(); ++it) { for (std::list<Intermediate *>::const_iterator it = intermediates.begin(); it != intermediates.end(); ++it) {
max = std::max(max, (*it)->get_normalize_cycle_count()); max = std::max(max, (*it)->get_postprocessing_cycle_count());
} }
return max; return max;
} }
@ -516,7 +516,7 @@ ExportGraphBuilder::Intermediate::operator== (FileSpec const & other_config) con
} }
unsigned unsigned
ExportGraphBuilder::Intermediate::get_normalize_cycle_count() const ExportGraphBuilder::Intermediate::get_postprocessing_cycle_count() const
{ {
return static_cast<unsigned>(std::ceil(static_cast<float>(tmp_file->get_frames_written()) / return static_cast<unsigned>(std::ceil(static_cast<float>(tmp_file->get_frames_written()) /
max_frames_out)); max_frames_out));

View file

@ -275,8 +275,8 @@ ExportHandler::process_timespan (framecnt_t frames)
if (last_cycle) { if (last_cycle) {
post_processing = graph_builder->need_postprocessing (); post_processing = graph_builder->need_postprocessing ();
if (post_processing) { if (post_processing) {
export_status->total_normalize_cycles = graph_builder->get_normalize_cycle_count(); export_status->total_postprocessing_cycles = graph_builder->get_postprocessing_cycle_count();
export_status->current_normalize_cycle = 0; export_status->current_postprocessing_cycle = 0;
} else { } else {
finish_timespan (); finish_timespan ();
return 0; return 0;
@ -300,7 +300,7 @@ ExportHandler::post_process ()
} }
} }
export_status->current_normalize_cycle++; export_status->current_postprocessing_cycle++;
return 0; return 0;
} }

View file

@ -50,8 +50,8 @@ ExportStatus::init ()
total_frames_current_timespan = 0; total_frames_current_timespan = 0;
processed_frames_current_timespan = 0; processed_frames_current_timespan = 0;
total_normalize_cycles = 0; total_postprocessing_cycles = 0;
current_normalize_cycle = 0; current_postprocessing_cycle = 0;
result_map.clear(); result_map.clear();
} }

View file

@ -124,7 +124,7 @@ static int export_session (Session *session,
double progress = 0.0; double progress = 0.0;
switch (status->active_job) { switch (status->active_job) {
case ExportStatus::Normalizing: case ExportStatus::Normalizing:
progress = ((float) status->current_normalize_cycle) / status->total_normalize_cycles; progress = ((float) status->current_postprocessing_cycle) / status->total_postprocessing_cycles;
printf ("* Normalizing %.1f%% \r", 100. * progress); fflush (stdout); printf ("* Normalizing %.1f%% \r", 100. * progress); fflush (stdout);
break; break;
case ExportStatus::Exporting: case ExportStatus::Exporting: