Basic support for Target Parameters. Non functional yet.
[synfig.git] / synfig-studio / src / gtkmm / dialog_targetparam.cpp
1 /* === S Y N F I G ========================================================= */
2 /*!     \file dialog_targetparam.cpp
3 **      \brief Implementation for the TargetParam Dialog
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2010 Carlos López González
9 **
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.
14 **
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.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === H E A D E R S ======================================================= */
24
25 #ifdef USING_PCH
26 #       include "pch.h"
27 #else
28 #ifdef HAVE_CONFIG_H
29 #       include <config.h>
30 #endif
31
32 #include "dialog_targetparam.h"
33
34 #include "general.h"
35
36 #endif
37
38 /* === U S I N G =========================================================== */
39
40 using namespace std;
41 //using namespace etl;
42 using namespace studio;
43
44 /* === M A C R O S ========================================================= */
45
46 /* === G L O B A L S ======================================================= */
47
48 /* === P R O C E D U R E S ================================================= */
49
50 /* === M E T H O D S ======================================================= */
51
52 /* === E N T R Y P O I N T ================================================= */
53
54 Dialog_TargetParam::Dialog_TargetParam(synfig::TargetParam &tparam)
55 {
56         set_title("TargetParam Dialog");
57         set_tparam(tparam);
58         // Available Video Codecs Combo Box Text.
59         vcodec = Gtk::manage(new Gtk::ComboBoxText());
60         Gtk::Label* label(manage(new Gtk::Label(_("Available Video Codecs:"))));
61         label->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
62         get_vbox()->pack_start(*label, true, true, 0);
63         //vcodec->signal_changed().connect(sigc::mem_fun(*this, &Dialog_TargetParam::on_video_codec_changed));
64         vcodec->prepend_text("flv");
65         vcodec->prepend_text("h263p");
66         vcodec->prepend_text("huffyuv");
67         vcodec->prepend_text("libtheora");
68         vcodec->prepend_text("libx264");
69         vcodec->prepend_text("libxvid");
70         vcodec->prepend_text("mjpeg");
71         vcodec->prepend_text("mpeg2video");
72         vcodec->prepend_text("mpeg4");
73         vcodec->prepend_text("msmpeg4");
74         vcodec->prepend_text("msmpeg4v1");
75         vcodec->prepend_text("msmpeg4v2");
76         vcodec->prepend_text("wmv1");
77         vcodec->prepend_text("wmv2");
78         get_vbox()->pack_start(*vcodec, true, true, 0);
79
80         //Bitrate Spin Button
81         Gtk::Adjustment* bradj(manage(new class Gtk::Adjustment(double(tparam.bitrate), 10.0,1000.0)));
82         bitrate = Gtk::manage(new class Gtk::SpinButton(*bradj));
83         Gtk::Label* label2(manage(new Gtk::Label(_("Video Bit Rate:"))));
84         label2->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
85         get_vbox()->pack_start(*label2, true, true, 0);
86         get_vbox()->pack_start(*bitrate,true, true, 0);
87
88         get_vbox()->show_all();
89
90         ok_button = manage(new class Gtk::Button(Gtk::StockID("gtk-ok")));
91         ok_button->show();
92         add_action_widget(*ok_button,0);
93         ok_button->signal_clicked().connect(sigc::mem_fun(*this,&Dialog_TargetParam::on_ok));
94 }
95
96 void
97 Dialog_TargetParam::on_ok()
98 {
99         hide();
100 }
101
102 Dialog_TargetParam::~Dialog_TargetParam()
103 {
104 }