1 /* === S Y N F I G ========================================================= */
2 /*! \file dialog_targetparam.cpp
3 ** \brief Implementation for the TargetParam Dialog
8 ** Copyright (c) 2010 Carlos López González
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === H E A D E R S ======================================================= */
32 #include "dialog_targetparam.h"
38 /* === U S I N G =========================================================== */
41 using namespace studio;
43 /* === M A C R O S ========================================================= */
45 /* === G L O B A L S ======================================================= */
47 /* === P R O C E D U R E S ================================================= */
49 /* === M E T H O D S ======================================================= */
51 /* === E N T R Y P O I N T ================================================= */
53 Dialog_TargetParam::Dialog_TargetParam(synfig::TargetParam &tparam)
55 set_title("TargetParam Dialog");
57 // Available Video Codecs Combo Box Text.
58 vcodec = Gtk::manage(new Gtk::ComboBoxText());
59 Gtk::Label* label(manage(new Gtk::Label(_("Available Video Codecs:"))));
60 label->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
61 get_vbox()->pack_start(*label, true, true, 0);
62 vcodec->append_text("flv");
63 vcodec->append_text("h263p");
64 vcodec->append_text("huffyuv");
65 vcodec->append_text("libtheora");
66 vcodec->append_text("libx264");
67 vcodec->append_text("libxvid");
68 vcodec->append_text("mjpeg");
69 vcodec->append_text("mpeg2video");
70 vcodec->append_text("mpeg4");
71 vcodec->append_text("msmpeg4");
72 vcodec->append_text("msmpeg4v1");
73 vcodec->append_text("msmpeg4v2");
74 vcodec->append_text("wmv1");
75 vcodec->append_text("wmv2");
76 vcodec->set_active_text(get_tparam().video_codec);
77 get_vbox()->pack_start(*vcodec, true, true, 0);
80 Gtk::Adjustment* bradj(manage(new class Gtk::Adjustment(double(tparam.bitrate), 10.0,1000.0)));
81 bitrate = Gtk::manage(new class Gtk::SpinButton(*bradj));
82 Gtk::Label* label2(manage(new Gtk::Label(_("Video Bit Rate:"))));
83 label2->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
84 get_vbox()->pack_start(*label2, true, true, 0);
85 get_vbox()->pack_start(*bitrate,true, true, 0);
87 get_vbox()->show_all();
89 ok_button = manage(new class Gtk::Button(Gtk::StockID("gtk-ok")));
91 add_action_widget(*ok_button,Gtk::RESPONSE_OK);
92 ok_button->signal_clicked().connect(sigc::mem_fun(*this,&Dialog_TargetParam::on_ok));
94 cancel_button = manage(new class Gtk::Button(Gtk::StockID("gtk-cancel")));
95 cancel_button->show();
96 add_action_widget(*cancel_button,Gtk::RESPONSE_CANCEL);
97 cancel_button->signal_clicked().connect(sigc::mem_fun(*this,&Dialog_TargetParam::on_cancel));
102 Dialog_TargetParam::on_ok()
104 tparam_.video_codec=vcodec->get_active_text();
105 tparam_.bitrate=bitrate->get_value();
110 Dialog_TargetParam::on_cancel()
115 Dialog_TargetParam::~Dialog_TargetParam()