fix clicking when processors become active/inactive; reduce crazy 2.5sec delay for...
[ardour.git] / libs / ardour / export_formats.cc
index f3c8f7197c31e0c4c225c48496af94f32a103f00..a3fa389e8c5e8886be60c24f78223d335260e716 100644 (file)
 
 */
 
-#include <ardour/export_formats.h>
+#include "ardour/export_formats.h"
 
 #include "i18n.h"
 
+using namespace std;
+
 namespace ARDOUR
 {
 
@@ -234,6 +236,16 @@ ExportFormatLinear::set_compatibility_state (ExportFormatCompatibility const & c
 
 ExportFormatOggVorbis::ExportFormatOggVorbis ()
 {
+       /* Check system compatibility */
+       
+       SF_INFO sf_info;
+       sf_info.channels = 2;
+       sf_info.samplerate = SR_44_1;
+       sf_info.format = F_Ogg | SF_Vorbis;
+       if (sf_format_check (&sf_info) != SF_TRUE) {
+               throw ExportFormatIncompatible();
+       }
+       
        set_name ("Ogg Vorbis");
        set_format_id (F_Ogg);
        sample_formats.insert (SF_Vorbis);
@@ -251,17 +263,6 @@ ExportFormatOggVorbis::ExportFormatOggVorbis ()
        set_quality (Q_LossyCompression);
 }
 
-bool
-ExportFormatOggVorbis::check_system_compatibility ()
-{
-       SF_INFO sf_info;
-       sf_info.channels = 2;
-       sf_info.samplerate = SR_44_1;
-       sf_info.format = F_Ogg | SF_Vorbis;
-
-       return (sf_format_check (&sf_info) == SF_TRUE ? true : false);
-}
-
 bool
 ExportFormatOggVorbis::set_compatibility_state (ExportFormatCompatibility const & compatibility)
 {
@@ -275,6 +276,16 @@ ExportFormatOggVorbis::set_compatibility_state (ExportFormatCompatibility const
 ExportFormatFLAC::ExportFormatFLAC () :
   HasSampleFormat (sample_formats)
 {
+       /* Check system compatibility */
+       
+       SF_INFO sf_info;
+       sf_info.channels = 2;
+       sf_info.samplerate = SR_44_1;
+       sf_info.format = F_FLAC | SF_16;
+       if (sf_format_check (&sf_info) != SF_TRUE) {
+               throw ExportFormatIncompatible();
+       }
+       
        set_name ("FLAC");
        set_format_id (F_FLAC);
        
@@ -295,17 +306,6 @@ ExportFormatFLAC::ExportFormatFLAC () :
        set_quality (Q_LosslessCompression);
 }
 
-bool
-ExportFormatFLAC::check_system_compatibility ()
-{
-       SF_INFO sf_info;
-       sf_info.channels = 2;
-       sf_info.samplerate = SR_44_1;
-       sf_info.format = F_FLAC | SF_16;
-
-       return (sf_format_check (&sf_info) == SF_TRUE ? true : false);
-}
-
 bool
 ExportFormatFLAC::set_compatibility_state (ExportFormatCompatibility const & compatibility)
 {