From 30b087ab3d28f1585987fa3f6ae006562ae192e3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 18 Sep 2017 12:39:17 -0400 Subject: globally change all use of "frame" to refer to audio into "sample". Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode and video in order to keep the legible --- libs/ardour/export_handler.cc | 72 +++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'libs/ardour/export_handler.cc') diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc index 1f10aaa2d3..7301e12b68 100644 --- a/libs/ardour/export_handler.cc +++ b/libs/ardour/export_handler.cc @@ -66,7 +66,7 @@ ExportElementFactory::~ExportElementFactory () ExportTimespanPtr ExportElementFactory::add_timespan () { - return ExportTimespanPtr (new ExportTimespan (session.get_export_status(), session.frame_rate())); + return ExportTimespanPtr (new ExportTimespan (session.get_export_status(), session.sample_rate())); } ExportChannelConfigPtr @@ -145,7 +145,7 @@ ExportHandler::do_export () for (ConfigMap::iterator it = config_map.begin(); it != config_map.end(); ++it) { bool new_timespan = timespan_set.insert (it->first).second; if (new_timespan) { - export_status->total_frames += it->first->get_length(); + export_status->total_samples += it->first->get_length(); } } export_status->total_timespans = timespan_set.size(); @@ -180,9 +180,9 @@ ExportHandler::start_timespan () */ current_timespan = config_map.begin()->first; - export_status->total_frames_current_timespan = current_timespan->get_length(); + export_status->total_samples_current_timespan = current_timespan->get_length(); export_status->timespan_name = current_timespan->name(); - export_status->processed_frames_current_timespan = 0; + export_status->processed_samples_current_timespan = 0; /* Register file configurations to graph builder */ @@ -270,7 +270,7 @@ ExportHandler::handle_duplicate_format_extensions() } int -ExportHandler::process (framecnt_t frames) +ExportHandler::process (samplecnt_t samples) { if (!export_status->running ()) { return 0; @@ -284,34 +284,34 @@ ExportHandler::process (framecnt_t frames) } } else { Glib::Threads::Mutex::Lock l (export_status->lock()); - return process_timespan (frames); + return process_timespan (samples); } } int -ExportHandler::process_timespan (framecnt_t frames) +ExportHandler::process_timespan (samplecnt_t samples) { export_status->active_job = ExportStatus::Exporting; /* update position */ - framecnt_t frames_to_read = 0; - framepos_t const end = current_timespan->get_end(); + samplecnt_t samples_to_read = 0; + samplepos_t const end = current_timespan->get_end(); - bool const last_cycle = (process_position + frames >= end); + bool const last_cycle = (process_position + samples >= end); if (last_cycle) { - frames_to_read = end - process_position; + samples_to_read = end - process_position; export_status->stop = true; } else { - frames_to_read = frames; + samples_to_read = samples; } - process_position += frames_to_read; - export_status->processed_frames += frames_to_read; - export_status->processed_frames_current_timespan += frames_to_read; + process_position += samples_to_read; + export_status->processed_samples += samples_to_read; + export_status->processed_samples_current_timespan += samples_to_read; /* Do actual processing */ - int ret = graph_builder->process (frames_to_read, last_cycle); + int ret = graph_builder->process (samples_to_read, last_cycle); /* Start post-processing/normalizing if necessary */ if (last_cycle) { @@ -559,7 +559,7 @@ ExportHandler::export_cd_marker_file (ExportTimespanPtr timespan, ExportFormatSp /* Start actual marker stuff */ - framepos_t last_end_time = timespan->get_start(); + samplepos_t last_end_time = timespan->get_start(); status.track_position = 0; for (i = temp.begin(); i != temp.end(); ++i) { @@ -580,7 +580,7 @@ ExportHandler::export_cd_marker_file (ExportTimespanPtr timespan, ExportFormatSp /* A track, defined by a cd range marker or a cd location marker outside of a cd range */ status.track_position = last_end_time - timespan->get_start(); - status.track_start_frame = (*i)->start() - timespan->get_start(); // everything before this is the pregap + status.track_start_sample = (*i)->start() - timespan->get_start(); // everything before this is the pregap status.track_duration = 0; if ((*i)->is_mark()) { @@ -756,12 +756,12 @@ ExportHandler::write_track_info_cue (CDMarkerStatus & status) status.out << " SONGWRITER " << cue_escape_cdtext (status.marker->cd_info["composer"]) << endl; } - if (status.track_position != status.track_start_frame) { - frames_to_cd_frames_string (buf, status.track_position); + if (status.track_position != status.track_start_sample) { + samples_to_cd_samples_string (buf, status.track_position); status.out << " INDEX 00" << buf << endl; } - frames_to_cd_frames_string (buf, status.track_start_frame); + samples_to_cd_samples_string (buf, status.track_start_sample); status.out << " INDEX 01" << buf << endl; status.index_number = 2; @@ -814,13 +814,13 @@ ExportHandler::write_track_info_toc (CDMarkerStatus & status) status.out << " }" << endl << "}" << endl; - frames_to_cd_frames_string (buf, status.track_position); + samples_to_cd_samples_string (buf, status.track_position); status.out << "FILE " << toc_escape_filename (status.filename) << ' ' << buf; - frames_to_cd_frames_string (buf, status.track_duration); + samples_to_cd_samples_string (buf, status.track_duration); status.out << buf << endl; - frames_to_cd_frames_string (buf, status.track_start_frame - status.track_position); + samples_to_cd_samples_string (buf, status.track_start_sample - status.track_position); status.out << "START" << buf << endl; } @@ -828,7 +828,7 @@ void ExportHandler::write_track_info_mp4ch (CDMarkerStatus & status) { gchar buf[18]; - frames_to_chapter_marks_string(buf, status.track_start_frame); + samples_to_chapter_marks_string(buf, status.track_start_sample); status.out << buf << " " << status.marker->name() << endl; } @@ -839,7 +839,7 @@ ExportHandler::write_index_info_cue (CDMarkerStatus & status) snprintf (buf, sizeof(buf), " INDEX %02d", cue_indexnum); status.out << buf; - frames_to_cd_frames_string (buf, status.index_position); + samples_to_cd_samples_string (buf, status.index_position); status.out << buf << endl; cue_indexnum++; @@ -850,7 +850,7 @@ ExportHandler::write_index_info_toc (CDMarkerStatus & status) { gchar buf[18]; - frames_to_cd_frames_string (buf, status.index_position - status.track_position); + samples_to_cd_samples_string (buf, status.index_position - status.track_position); status.out << "INDEX" << buf << endl; } @@ -860,25 +860,25 @@ ExportHandler::write_index_info_mp4ch (CDMarkerStatus & status) } void -ExportHandler::frames_to_cd_frames_string (char* buf, framepos_t when) +ExportHandler::samples_to_cd_samples_string (char* buf, samplepos_t when) { - framecnt_t remainder; - framecnt_t fr = session.nominal_frame_rate(); - int mins, secs, frames; + samplecnt_t remainder; + samplecnt_t fr = session.nominal_sample_rate(); + int mins, secs, samples; mins = when / (60 * fr); remainder = when - (mins * 60 * fr); secs = remainder / fr; remainder -= secs * fr; - frames = remainder / (fr / 75); - sprintf (buf, " %02d:%02d:%02d", mins, secs, frames); + samples = remainder / (fr / 75); + sprintf (buf, " %02d:%02d:%02d", mins, secs, samples); } void -ExportHandler::frames_to_chapter_marks_string (char* buf, framepos_t when) +ExportHandler::samples_to_chapter_marks_string (char* buf, samplepos_t when) { - framecnt_t remainder; - framecnt_t fr = session.nominal_frame_rate(); + samplecnt_t remainder; + samplecnt_t fr = session.nominal_sample_rate(); int hours, mins, secs, msecs; hours = when / (3600 * fr); -- cgit v1.2.3