add configure without-thirdparty, without-libzmpeg, without-commercial
[goodguy/history.git] / cinelerra-5.1 / cinelerra / file.C
index 67b731de35a23af6c0e255b8de0ad0fad8fae56c..03348e0a6422f3316a26dc008757157f8ba546f8 100644 (file)
@@ -165,24 +165,21 @@ int File::get_options(FormatTools *format,
        int audio_options, int video_options)
 {
        BC_WindowBase *parent_window = format->window;
-       //ArrayList<PluginServer*> *plugindb = format->plugindb;
        Asset *asset = format->asset;
-
+       EDL *edl = format->mwindow ? format->mwindow->edl : 0;
        format_window = 0;
        getting_options = 1;
        format_completion->lock("File::get_options");
        switch( asset->format ) {
-       case FILE_AC3:
-               FileAC3::get_parameters(parent_window,
-                       asset,
-                       format_window,
-                       audio_options,
-                       video_options);
+#ifdef HAVE_CIN_3RDPARTY
+       case FILE_AC3: FileAC3::get_parameters(parent_window, asset, format_window,
+                       audio_options, video_options, edl);
                break;
+#endif
 #ifdef HAVE_DV
        case FILE_RAWDV:
                FileDV::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
 #endif
        case FILE_PCM:
@@ -191,56 +188,58 @@ int File::get_options(FormatTools *format,
        case FILE_AIFF:
        case FILE_SND:
                FileSndFile::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
        case FILE_FFMPEG:
                FileFFMPEG::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
+#ifdef HAVE_LIBZMPEG
        case FILE_AMPEG:
        case FILE_VMPEG:
                FileMPEG::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
+#endif
        case FILE_JPEG:
        case FILE_JPEG_LIST:
                FileJPEG::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
 #ifdef HAVE_OPENEXR
        case FILE_EXR:
        case FILE_EXR_LIST:
                FileEXR::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
 #endif
        case FILE_FLAC:
                FileFLAC::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
        case FILE_PNG:
        case FILE_PNG_LIST:
                FilePNG::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
        case FILE_PPM:
        case FILE_PPM_LIST:
                FilePPM::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
        case FILE_TGA:
        case FILE_TGA_LIST:
                FileTGA::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
        case FILE_TIFF:
        case FILE_TIFF_LIST:
                FileTIFF::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
        case FILE_OGG:
                FileOGG::get_parameters(parent_window, asset, format_window,
-                       audio_options, video_options);
+                       audio_options, video_options, edl);
                break;
        default:
                break;
@@ -381,11 +380,13 @@ int File::probe()
                        file = new FileFFMPEG(this->asset, this);
                        return FILE_OK;
                }
+#ifdef HAVE_COMMERCIAL
                if( !strcmp(pref->name,"DB") ) { // MediaDB
                        if( !FileDB::check_sig(this->asset) ) continue;
                        file = new FileDB(this->asset, this);
                        return FILE_OK;
                }
+#endif
                if( !strcmp(pref->name,"Scene") ) { // scene file
                        if( !FileScene::check_sig(this->asset, data)) continue;
                        file = new FileScene(this->asset, this);
@@ -460,11 +461,13 @@ int File::probe()
                        file = new FileVorbis(this->asset, this);
                        return FILE_OK;
                }
+#ifdef HAVE_LIBZMPEG
                if( !strcmp(pref->name,"MPEG") ) { // MPEG file
                        if( !FileMPEG::check_sig(this->asset) ) continue;
                        file = new FileMPEG(this->asset, this);
                        return FILE_OK;
                }
+#endif
                if( !strcmp(pref->name,"EDL") ) { // XML file
                        if( data[0] != '<' ) continue;
                        if( !strncmp(&data[1],"EDL>",4) ||
@@ -500,10 +503,11 @@ int File::open_file(Preferences *preferences,
                if( ret != FILE_OK ) return ret;
                break; }
 // format already determined
+#ifdef HAVE_CIN_3RDPARTY
        case FILE_AC3:
                file = new FileAC3(this->asset, this);
                break;
-
+#endif
        case FILE_SCENE:
                file = new FileScene(this->asset, this);
                break;
@@ -564,17 +568,19 @@ int File::open_file(Preferences *preferences,
        case FILE_TIFF_LIST:
                file = new FileTIFF(this->asset, this);
                break;
-
+#ifdef HAVE_COMMERCIAL
        case FILE_DB:
                file = new FileDB(this->asset, this);
                break;
+#endif
 
+#ifdef HAVE_LIBZMPEG
        case FILE_MPEG:
        case FILE_AMPEG:
        case FILE_VMPEG:
                file = new FileMPEG(this->asset, this);
                break;
-
+#endif
        case FILE_OGG:
                file = new FileOGG(this->asset, this);
                break;
@@ -1269,7 +1275,9 @@ const char* File::formattostr(int format)
        case FILE_FLAC:         return _(FLAC_NAME);
        case FILE_EXR:          return _(EXR_NAME);
        case FILE_EXR_LIST:     return _(EXR_LIST_NAME);
+#ifdef HAVE_LIBZMPEG
        case FILE_MPEG:         return _(MPEG_NAME);
+#endif
        case FILE_AMPEG:        return _(AMPEG_NAME);
        case FILE_VMPEG:        return _(VMPEG_NAME);
        case FILE_TGA:          return _(TGA_NAME);
@@ -1351,7 +1359,9 @@ int File::get_best_colormodel(Asset *asset, int driver)
 #ifdef HAVE_DV
        case FILE_RAWDV:        return FileDV::get_best_colormodel(asset, driver);
 #endif
+#ifdef HAVE_LIBZMPEG
        case FILE_MPEG:         return FileMPEG::get_best_colormodel(asset, driver);
+#endif
        case FILE_JPEG:
        case FILE_JPEG_LIST:    return FileJPEG::get_best_colormodel(asset, driver);
 #ifdef HAVE_OPENEXR
@@ -1366,7 +1376,9 @@ int File::get_best_colormodel(Asset *asset, int driver)
        case FILE_TGA_LIST:     return FileTGA::get_best_colormodel(asset, driver);
        case FILE_CR2:
        case FILE_CR2_LIST:     return FileCR2::get_best_colormodel(asset, driver);
+#ifdef HAVE_COMMERCIAL
        case FILE_DB:           return FileDB::get_best_colormodel(asset, driver);
+#endif
        case FILE_FFMPEG:       return FileFFMPEG::get_best_colormodel(asset, driver);
        }
 
@@ -1430,7 +1442,7 @@ int File::renders_video(int format)
 int File::renders_video(Asset *asset)
 {
        return asset->format == FILE_FFMPEG ?
-               FileFFMPEG::renders_video(asset->fformat) :
+               FFMPEG::renders_video(asset->fformat) :
                renders_video(asset->format);
 }
 
@@ -1456,7 +1468,7 @@ int File::renders_audio(int format)
 int File::renders_audio(Asset *asset)
 {
        return asset->format == FILE_FFMPEG ?
-               FileFFMPEG::renders_audio(asset->fformat) :
+               FFMPEG::renders_audio(asset->fformat) :
                renders_audio(asset->format);
 }