4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "compresspopup.h"
29 CompressPopup::CompressPopup(int x, int y, int use_dv, char *text)
30 : BC_PopupMenu(x, y, 80, File::compressiontostr(text))
33 this->use_dv = use_dv;
36 int CompressPopup::add_items()
38 if(!use_dv) add_item(format_items[0] = new CompressPopupItem(_("DV")));
39 add_item(format_items[1] = new CompressPopupItem(_("JPEG")));
40 add_item(format_items[2] = new CompressPopupItem(_("MJPA")));
41 add_item(format_items[3] = new CompressPopupItem(_("PNG")));
42 add_item(format_items[4] = new CompressPopupItem(_("PNG-Alpha")));
43 add_item(format_items[5] = new CompressPopupItem(_("RGB")));
44 add_item(format_items[6] = new CompressPopupItem(_("RGB-Alpha")));
45 add_item(format_items[7] = new CompressPopupItem(_("YUV420")));
46 add_item(format_items[8] = new CompressPopupItem(_("YUV422")));
50 CompressPopup::~CompressPopup()
52 for(int i = 0; i < COMPRESS_ITEMS; i++) delete format_items[i];
55 char* CompressPopup::get_compression()
58 return test_file.strtocompression(get_text());
61 char* CompressPopup::compression_to_text(char *compression)
64 return test_file.compressiontostr(compression);
67 CompressPopupItem::CompressPopupItem(char *text)
72 CompressPopupItem::~CompressPopupItem()
76 int CompressPopupItem::handle_event()
78 get_popup_menu()->set_text(get_text());
79 get_popup_menu()->handle_event();