es.po update by rafa, add ms win10 cygwin port, add pulseaudio, new config flags...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / file.C
index f611b814e136ad4a5f19c7aad08ab26a32f474ec..1fec188eacb98570229d46acda6e27cc19322cfd 100644 (file)
@@ -54,6 +54,7 @@
 #undef HAVE_STDLIB_H // automake conflict
 #include "filepng.h"
 #include "fileppm.h"
+#include "fileref.h"
 #include "filescene.h"
 #include "filesndfile.h"
 #include "filetga.h"
@@ -422,7 +423,7 @@ int File::probe()
                        else continue;
                        return FILE_OK;
                }
-#ifdef HAVE_EXR
+#ifdef HAVE_OPENEXR
                if( !strcmp(pref->name,"EXR") ) { // EXR file
                        if( !FileEXR::check_sig(this->asset, data)) continue;
                        file = new FileEXR(this->asset, this);
@@ -577,6 +578,9 @@ int File::open_file(Preferences *preferences,
                file = new FileDV(this->asset, this);
                break;
 #endif
+       case FILE_REF:
+               file = new FileREF(this->asset, this);
+               break;
 // try plugins
        default:
                return 1;
@@ -657,17 +661,10 @@ void File::delete_temp_frame_buffer()
 
 int File::close_file(int ignore_thread)
 {
-       const int debug = 0;
-
-       if( debug ) printf("File::close_file file=%p %d\n", file, __LINE__);
-
        if( !ignore_thread ) {
                stop_audio_thread();
                stop_video_thread();
        }
-
-
-       if( debug ) printf("File::close_file file=%p %d\n", file, __LINE__);
        if( file ) {
 // The file's asset is a copy of the argument passed to open_file so the
 // user must copy lengths from the file's asset.
@@ -679,28 +676,18 @@ int File::close_file(int ignore_thread)
                file->close_file();
                delete file;
        }
-       if( debug ) printf("File::close_file file=%p %d\n", file, __LINE__);
 
        delete_temp_samples_buffer();
        delete_temp_frame_buffer();
-       if( debug ) printf("File::close_file file=%p %d\n", file, __LINE__);
-
-       if( debug ) printf("File::close_file file=%p %d\n", file, __LINE__);
-
        reset_parameters();
-       if( debug ) printf("File::close_file file=%p %d\n", file, __LINE__);
        return 0;
 }
 
-
-
 int File::get_index(IndexFile *index_file, MainProgressBar *progress_bar)
 {
        return !file ? -1 : file->get_index(index_file, progress_bar);
 }
 
-
-
 int File::start_audio_thread(int buffer_size, int ring_buffers)
 {
        this->audio_ring_buffers = ring_buffers;
@@ -713,20 +700,16 @@ int File::start_audio_thread(int buffer_size, int ring_buffers)
        return 0;
 }
 
-int File::start_video_thread(int buffer_size,
-       int color_model,
-       int ring_buffers,
-       int compressed)
+int File::start_video_thread(int buffer_size, int color_model,
+               int ring_buffers, int compressed)
 {
        this->video_ring_buffers = ring_buffers;
        this->video_buffer_size = buffer_size;
 
        if( !video_thread ) {
                video_thread = new FileThread(this, 0, 1);
-               video_thread->start_writing(buffer_size,
-                       color_model,
-                       ring_buffers,
-                       compressed);
+               video_thread->start_writing(buffer_size, color_model,
+                               ring_buffers, compressed);
        }
        return 0;
 }
@@ -1234,6 +1217,7 @@ int File::strtoformat(const char *format)
        if( !strcasecmp(format, _(RAWDV_NAME)) ) return FILE_RAWDV;
        if( !strcasecmp(format, _(FFMPEG_NAME)) ) return FILE_FFMPEG;
        if( !strcasecmp(format, _(DBASE_NAME)) ) return FILE_DB;
+       if( !strcasecmp(format, _(REF_NAME)) ) return FILE_REF;
 
        return 0;
 }
@@ -1274,6 +1258,7 @@ const char* File::formattostr(int format)
        case FILE_RAWDV:        return _(RAWDV_NAME);
        case FILE_FFMPEG:       return _(FFMPEG_NAME);
        case FILE_DB:           return _(DBASE_NAME);
+       case FILE_REF:          return _(REF_NAME);
        }
        return _("Unknown");
 }
@@ -1365,6 +1350,7 @@ int File::get_best_colormodel(Asset *asset, int driver)
        case FILE_DB:           return FileDB::get_best_colormodel(asset, driver);
 #endif
        case FILE_FFMPEG:       return FileFFMPEG::get_best_colormodel(asset, driver);
+       case FILE_REF:          return FileREF::get_best_colormodel(asset, driver);
        }
 
        return BC_RGB888;
@@ -1499,6 +1485,7 @@ const char* File::get_tag(int format)
        case FILE_VMPEG:        return "m2v";
        case FILE_WAV:          return "wav";
        case FILE_FFMPEG:       return "ffmpg";
+       case FILE_REF:          return "ref";
        }
        return 0;
 }
@@ -1536,6 +1523,7 @@ const char* File::get_prefix(int format)
        case FILE_CR2_LIST:     return "CR2_LIST";
        case FILE_GIF_LIST:     return "GIF_LIST";
        case FILE_DB:           return "DB";
+       case FILE_REF:          return "REF";
        }
        return _("UNKNOWN");
 }