mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-23 15:16:25 +01:00
Add warnings for overwriting marker files
git-svn-id: svn://localhost/ardour2/branches/3.0@11305 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
e317386c5c
commit
09d1fbd6c1
3 changed files with 38 additions and 10 deletions
|
|
@ -115,6 +115,8 @@ class ExportHandler : public ExportElementFactory
|
||||||
BroadcastInfoPtr broadcast_info);
|
BroadcastInfoPtr broadcast_info);
|
||||||
void do_export (bool rt = false);
|
void do_export (bool rt = false);
|
||||||
|
|
||||||
|
std::string get_cd_marker_filename(std::string filename, CDMarkerFormat format);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int process (framecnt_t frames);
|
int process (framecnt_t frames);
|
||||||
|
|
|
||||||
|
|
@ -266,12 +266,7 @@ void
|
||||||
ExportHandler::export_cd_marker_file (ExportTimespanPtr timespan, ExportFormatSpecPtr file_format,
|
ExportHandler::export_cd_marker_file (ExportTimespanPtr timespan, ExportFormatSpecPtr file_format,
|
||||||
std::string filename, CDMarkerFormat format)
|
std::string filename, CDMarkerFormat format)
|
||||||
{
|
{
|
||||||
string filepath;
|
string filepath = get_cd_marker_filename(filename, format);
|
||||||
|
|
||||||
/* do not strip file suffix because there may be more than one format,
|
|
||||||
and we do not want the CD marker file from one format to overwrite
|
|
||||||
another (e.g. foo.wav.cue > foo.aiff.cue)
|
|
||||||
*/
|
|
||||||
|
|
||||||
void (ExportHandler::*header_func) (CDMarkerStatus &);
|
void (ExportHandler::*header_func) (CDMarkerStatus &);
|
||||||
void (ExportHandler::*track_func) (CDMarkerStatus &);
|
void (ExportHandler::*track_func) (CDMarkerStatus &);
|
||||||
|
|
@ -279,15 +274,11 @@ ExportHandler::export_cd_marker_file (ExportTimespanPtr timespan, ExportFormatSp
|
||||||
|
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case CDMarkerTOC:
|
case CDMarkerTOC:
|
||||||
filepath = filename;
|
|
||||||
filepath += ".toc";
|
|
||||||
header_func = &ExportHandler::write_toc_header;
|
header_func = &ExportHandler::write_toc_header;
|
||||||
track_func = &ExportHandler::write_track_info_toc;
|
track_func = &ExportHandler::write_track_info_toc;
|
||||||
index_func = &ExportHandler::write_index_info_toc;
|
index_func = &ExportHandler::write_index_info_toc;
|
||||||
break;
|
break;
|
||||||
case CDMarkerCUE:
|
case CDMarkerCUE:
|
||||||
filepath = filename;
|
|
||||||
filepath += ".cue";
|
|
||||||
header_func = &ExportHandler::write_cue_header;
|
header_func = &ExportHandler::write_cue_header;
|
||||||
track_func = &ExportHandler::write_track_info_cue;
|
track_func = &ExportHandler::write_track_info_cue;
|
||||||
index_func = &ExportHandler::write_index_info_cue;
|
index_func = &ExportHandler::write_index_info_cue;
|
||||||
|
|
@ -381,6 +372,24 @@ ExportHandler::export_cd_marker_file (ExportTimespanPtr timespan, ExportFormatSp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string
|
||||||
|
ExportHandler::get_cd_marker_filename(std::string filename, CDMarkerFormat format)
|
||||||
|
{
|
||||||
|
/* do not strip file suffix because there may be more than one format,
|
||||||
|
and we do not want the CD marker file from one format to overwrite
|
||||||
|
another (e.g. foo.wav.cue > foo.aiff.cue)
|
||||||
|
*/
|
||||||
|
|
||||||
|
switch (format) {
|
||||||
|
case CDMarkerTOC:
|
||||||
|
return filename + ".toc";
|
||||||
|
case CDMarkerCUE:
|
||||||
|
return filename + ".cue";
|
||||||
|
default:
|
||||||
|
return filename + ".marker"; // Should not be reached when actually creating a file
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExportHandler::write_cue_header (CDMarkerStatus & status)
|
ExportHandler::write_cue_header (CDMarkerStatus & status)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -840,6 +840,23 @@ ExportProfileManager::check_config (boost::shared_ptr<Warnings> warnings,
|
||||||
warnings->conflicting_filenames.push_back (path);
|
warnings->conflicting_filenames.push_back (path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO check what happens with split channel configs...
|
||||||
|
string path = filename->get_path (format);
|
||||||
|
|
||||||
|
if (format->with_toc()) {
|
||||||
|
string marker_file = handler->get_cd_marker_filename(path, CDMarkerTOC);
|
||||||
|
if (sys::exists (sys::path (marker_file))) {
|
||||||
|
warnings->conflicting_filenames.push_back (marker_file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (format->with_cue()) {
|
||||||
|
string marker_file = handler->get_cd_marker_filename(path, CDMarkerCUE);
|
||||||
|
if (sys::exists (sys::path (marker_file))) {
|
||||||
|
warnings->conflicting_filenames.push_back (marker_file);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue