r956: README.BUILD - add more library recommendations
[cinelerra_cv/ct.git] / cinelerra / formatcheck.C
blob58169d57a7b3ee7aba4a2d4ce8e6e2501af9282a
1 #include "asset.h"
2 #include "file.h"
3 #include "errorbox.h"
4 #include "formatcheck.h"
5 #include "mwindow.inc"
7 #include <libintl.h>
8 #define _(String) gettext(String)
9 #define gettext_noop(String) String
10 #define N_(String) gettext_noop (String)
12 FormatCheck::FormatCheck(Asset *asset)
14         this->asset = asset;
17 FormatCheck::~FormatCheck()
21 int FormatCheck::check_format()
23         int result = 0;
25         if(!result && asset->video_data)
26         {
27 // Only 1 format can store video.
28                 if(!File::supports_video(asset->format))
29                 {
30                         ErrorBox errorbox(PROGRAM_NAME ": Error");
31                         errorbox.create_objects(_("The format you selected doesn't support video."));
32                         errorbox.run_window();
33                         result = 1;
34                 }
35         }
36         
37         if(!result && asset->audio_data)
38         {
39                 if(!File::supports_audio(asset->format))
40                 {
41                         ErrorBox errorbox(PROGRAM_NAME ": Error");
42                         errorbox.create_objects(_("The format you selected doesn't support audio."));
43                         errorbox.run_window();
44                         result = 1;
45                 }
47                 if(!result && asset->bits == BITSIMA4 && asset->format != FILE_MOV)
48                 {
49                         ErrorBox errorbox(PROGRAM_NAME ": Error");
50                         errorbox.create_objects(_("IMA4 compression is only available in Quicktime movies."));
51                         errorbox.run_window();
52                         result = 1;
53                 }
55                 if(!result && asset->bits == BITSULAW && 
56                         asset->format != FILE_MOV &&
57                         asset->format != FILE_PCM)
58                 {
59                         ErrorBox errorbox(PROGRAM_NAME ": Error");
60                         errorbox.create_objects(_("ULAW compression is only available in\n" 
61                                 "Quicktime Movies and PCM files."));
62                         errorbox.run_window();
63                         result = 1;
64                 }
65         }
67         return result;