+
+ std::list<string> paths;
+ build_filenames(paths, filename, timespans, channel_config, format);
+
+ for (std::list<string>::const_iterator path_it = paths.begin(); path_it != paths.end(); ++path_it) {
+
+ string path = *path_it;
+
+ if (Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {
+ warnings->conflicting_filenames.push_back (path);
+ }
+
+ if (format->with_toc()) {
+ string marker_file = handler->get_cd_marker_filename(path, CDMarkerTOC);
+ if (Glib::file_test (marker_file, Glib::FILE_TEST_EXISTS)) {
+ warnings->conflicting_filenames.push_back (marker_file);
+ }
+ }
+
+ if (format->with_cue()) {
+ string marker_file = handler->get_cd_marker_filename(path, CDMarkerCUE);
+ if (Glib::file_test (marker_file, Glib::FILE_TEST_EXISTS)) {
+ warnings->conflicting_filenames.push_back (marker_file);
+ }
+ }
+ }
+}
+
+bool
+ExportProfileManager::check_format (ExportFormatSpecPtr format, uint32_t channels)
+{
+ switch (format->type()) {
+ case ExportFormatBase::T_Sndfile:
+ return check_sndfile_format (format, channels);
+
+ default:
+ throw ExportFailed (X_("Invalid format given for ExportFileFactory::check!"));
+ }
+}
+
+bool
+ExportProfileManager::check_sndfile_format (ExportFormatSpecPtr format, unsigned int channels)
+{
+ SF_INFO sf_info;
+ sf_info.channels = channels;
+ sf_info.samplerate = format->sample_rate ();
+ sf_info.format = format->format_id () | format->sample_format ();
+
+ return (sf_format_check (&sf_info) == SF_TRUE ? true : false);
+}
+
+void
+ExportProfileManager::build_filenames(std::list<std::string> & result, ExportFilenamePtr filename,
+ TimespanListPtr timespans, ExportChannelConfigPtr channel_config,
+ ExportFormatSpecPtr format)
+{
+ for (std::list<ExportTimespanPtr>::iterator timespan_it = timespans->begin();
+ timespan_it != timespans->end(); ++timespan_it) {