r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / compresspopup.C
blob033cb8f328b64698f8b589c92ab8b32dba776f7b
1 #include "compresspopup.h"
2 #include "file.h"
3 #include "quicktime.h"
4 #include <string.h>
6 #include <libintl.h>
7 #define _(String) gettext(String)
8 #define gettext_noop(String) String
9 #define N_(String) gettext_noop (String)
12 CompressPopup::CompressPopup(int x, int y, int use_dv, char *text)
13  : BC_PopupMenu(x, y, 80, File::compressiontostr(text))
15         strcpy(format, text);
16         this->use_dv = use_dv;
19 int CompressPopup::add_items()
21         if(!use_dv) add_item(format_items[0] = new CompressPopupItem(_("DV")));
22         add_item(format_items[1] = new CompressPopupItem(_("JPEG")));
23         add_item(format_items[2] = new CompressPopupItem(_("MJPA")));
24         add_item(format_items[3] = new CompressPopupItem(_("PNG")));
25         add_item(format_items[4] = new CompressPopupItem(_("PNG-Alpha")));
26         add_item(format_items[5] = new CompressPopupItem(_("RGB")));
27         add_item(format_items[6] = new CompressPopupItem(_("RGB-Alpha")));
28         add_item(format_items[7] = new CompressPopupItem(_("YUV420")));
29         add_item(format_items[8] = new CompressPopupItem(_("YUV422")));
30         return 0;
33 CompressPopup::~CompressPopup()
35         for(int i = 0; i < COMPRESS_ITEMS; i++) delete format_items[i];
38 char* CompressPopup::get_compression()
40         File test_file;
41         return test_file.strtocompression(get_text());
44 char* CompressPopup::compression_to_text(char *compression)
46         File test_file;
47         return test_file.compressiontostr(compression);
50 CompressPopupItem::CompressPopupItem(char *text)
51  : BC_MenuItem(text)
55 CompressPopupItem::~CompressPopupItem()
58         
59 int CompressPopupItem::handle_event()
61         get_popup_menu()->set_text(get_text());
62         get_popup_menu()->handle_event();