1 /* 2 * Copyright (C) 2008-2013 Paul Davis <paul@linuxaudiosystems.com> 3 * Copyright (C) 2009-2011 David Robillard <d@drobilla.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License along 16 * with this program; if not, write to the Free Software Foundation, Inc., 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 */ 19 20 #ifndef __ardour_export_format_compatibility_h__ 21 #define __ardour_export_format_compatibility_h__ 22 23 #include <string> 24 #include "ardour/export_format_base.h" 25 26 namespace ARDOUR 27 { 28 29 /// Allows adding to all sets. A format should be able to test if it is compatible with this 30 class LIBARDOUR_API ExportFormatCompatibility : public ExportFormatBase, public ExportFormatBase::SelectableCompatible { 31 private: 32 33 public: ExportFormatCompatibility(std::string name)34 ExportFormatCompatibility (std::string name) 35 { 36 set_name (name); 37 sample_formats.insert (SF_None); 38 sample_rates.insert (SR_None); 39 format_ids.insert (F_None); 40 qualities.insert (Q_None); 41 } 42 ~ExportFormatCompatibility()43 ~ExportFormatCompatibility () {}; 44 ExportFormatCompatibility(ExportFormatBase const & other)45 ExportFormatCompatibility (ExportFormatBase const & other) 46 : ExportFormatBase (other) {} 47 add_endianness(Endianness endianness)48 void add_endianness (Endianness endianness) { endiannesses.insert (endianness); } add_sample_format(SampleFormat format)49 void add_sample_format (SampleFormat format) { sample_formats.insert (format); } add_sample_rate(SampleRate rate)50 void add_sample_rate (SampleRate rate) { sample_rates.insert (rate); } add_format_id(FormatId id)51 void add_format_id (FormatId id) { format_ids.insert (id); } add_quality(Quality quality)52 void add_quality (Quality quality) { qualities.insert (quality); } 53 }; 54 55 } // namespace ARDOUR 56 57 #endif /* __ardour_export_format_compatibility_h__ */ 58