X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fexport_format_base.cc;h=1eda44991550f3e6267170c3f3718faef8c80fc7;hb=fa73112f081ee38bc5c9752f900c9c5dccb68141;hp=fa6f1198e94167437e344d04736de2138b245002;hpb=ffadfff6506e507b09853e4c7e50bcedffa29cce;p=ardour.git diff --git a/libs/ardour/export_format_base.cc b/libs/ardour/export_format_base.cc index fa6f1198e9..1eda449915 100644 --- a/libs/ardour/export_format_base.cc +++ b/libs/ardour/export_format_base.cc @@ -70,12 +70,6 @@ ExportFormatBase::get_intersection (ExportFormatBase const & other) const return do_set_operation (other, SetIntersection); } -boost::shared_ptr -ExportFormatBase::get_difference (ExportFormatBase const & other) const -{ - return do_set_operation (other, SetDifference); -} - boost::shared_ptr ExportFormatBase::get_union (ExportFormatBase const & other) const { @@ -101,9 +95,6 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation case SetIntersection: std::set_intersection (start1, end1, start2, end2, insert); break; - case SetDifference: - std::set_difference (start1, end1, start2, end2, insert); - break; case SetUnion: std::set_union (start1, end1, start2, end2, insert); break; @@ -122,9 +113,6 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation case SetIntersection: std::set_intersection (start1, end1, start2, end2, insert); break; - case SetDifference: - std::set_difference (start1, end1, start2, end2, insert); - break; case SetUnion: std::set_union (start1, end1, start2, end2, insert); break; @@ -144,9 +132,6 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation case SetIntersection: std::set_intersection (start1, end1, start2, end2, insert); break; - case SetDifference: - std::set_difference (start1, end1, start2, end2, insert); - break; case SetUnion: std::set_union (start1, end1, start2, end2, insert); break; @@ -165,9 +150,6 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation case SetIntersection: std::set_intersection (start1, end1, start2, end2, insert); break; - case SetDifference: - std::set_difference (start1, end1, start2, end2, insert); - break; case SetUnion: std::set_union (start1, end1, start2, end2, insert); break; @@ -186,9 +168,6 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation case SetIntersection: std::set_intersection (start1, end1, start2, end2, insert); break; - case SetDifference: - std::set_difference (start1, end1, start2, end2, insert); - break; case SetUnion: std::set_union (start1, end1, start2, end2, insert); break; @@ -204,22 +183,22 @@ ExportFormatBase::nearest_sample_rate (framecnt_t sample_rate) int diff = 0; int smallest_diff = INT_MAX; SampleRate best_match = SR_None; - + #define DO_SR_COMPARISON(rate) \ - diff = std::abs((rate) - sample_rate); \ + diff = std::fabs((double)((rate) - sample_rate)); \ if(diff < smallest_diff) { \ smallest_diff = diff; \ best_match = (rate); \ } - DO_SR_COMPARISON(SR_22_05); + DO_SR_COMPARISON(SR_8); DO_SR_COMPARISON(SR_22_05); DO_SR_COMPARISON(SR_44_1); DO_SR_COMPARISON(SR_48); DO_SR_COMPARISON(SR_88_2); DO_SR_COMPARISON(SR_96); DO_SR_COMPARISON(SR_192); - + return best_match; #undef DO_SR_COMPARISON }