Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / cinelerra / compresspopup.C
blob1ee2fa9cc66e97116a7d30c3f09ddb4d0dcb818c
1 #include "compresspopup.h"
2 #include "file.h"
3 #include "language.h"
4 #include "quicktime.h"
5 #include <string.h>
9 CompressPopup::CompressPopup(int x, int y, int use_dv, char *text)
10  : BC_PopupMenu(x, y, 80, File::compressiontostr(text))
12         strcpy(format, text);
13         this->use_dv = use_dv;
16 int CompressPopup::add_items()
18         if(!use_dv) add_item(format_items[0] = new CompressPopupItem(_("DV")));
19         add_item(format_items[1] = new CompressPopupItem(_("JPEG")));
20         add_item(format_items[2] = new CompressPopupItem(_("MJPA")));
21         add_item(format_items[3] = new CompressPopupItem(_("PNG")));
22         add_item(format_items[4] = new CompressPopupItem(_("PNG-Alpha")));
23         add_item(format_items[5] = new CompressPopupItem(_("RGB")));
24         add_item(format_items[6] = new CompressPopupItem(_("RGB-Alpha")));
25         add_item(format_items[7] = new CompressPopupItem(_("YUV420")));
26         add_item(format_items[8] = new CompressPopupItem(_("YUV422")));
27         return 0;
30 CompressPopup::~CompressPopup()
32         for(int i = 0; i < COMPRESS_ITEMS; i++) delete format_items[i];
35 char* CompressPopup::get_compression()
37         File test_file;
38         return test_file.strtocompression(get_text());
41 char* CompressPopup::compression_to_text(char *compression)
43         File test_file;
44         return test_file.compressiontostr(compression);
47 CompressPopupItem::CompressPopupItem(char *text)
48  : BC_MenuItem(text)
52 CompressPopupItem::~CompressPopupItem()
55         
56 int CompressPopupItem::handle_event()
58         get_popup_menu()->set_text(get_text());
59         get_popup_menu()->handle_event();
62 //      Local Variables:
63 //      mode: C++
64 //      c-file-style: "linux"
65 //      End: