Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / cinelerra / formatcheck.C
blobb6d8b02e88f7e5be4f515a2e58de453cdf08d446
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_GC 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;
70 //      Local Variables:
71 //      mode: C++
72 //      c-file-style: "linux"
73 //      End: