Module: synfig
Branch: eldruin_ffmpeg2
Commit: 4857c9f4d0982bf6cbe3abb800b66cd3fd25a14f
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig;a=commit;h=4857c9f4d0982bf6cbe3abb800b66cd3fd25a14f

Author: Carlos Lopez <[email protected]>
Date:   Sat Feb 27 01:00:57 2010 +0100

Give functionality to the Target Parameter Dialog.

---

 synfig-studio/src/gtkmm/dialog_targetparam.cpp |   48 +++++++++++++++--------
 synfig-studio/src/gtkmm/dialog_targetparam.h   |    3 +-
 synfig-studio/src/gtkmm/render.cpp             |    3 +-
 3 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/synfig-studio/src/gtkmm/dialog_targetparam.cpp 
b/synfig-studio/src/gtkmm/dialog_targetparam.cpp
index b6231d0..43cb1fd 100644
--- a/synfig-studio/src/gtkmm/dialog_targetparam.cpp
+++ b/synfig-studio/src/gtkmm/dialog_targetparam.cpp
@@ -38,7 +38,6 @@
 /* === U S I N G =========================================================== */
 
 using namespace std;
-//using namespace etl;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -60,21 +59,21 @@ Dialog_TargetParam::Dialog_TargetParam(synfig::TargetParam 
&tparam)
        Gtk::Label* label(manage(new Gtk::Label(_("Available Video Codecs:"))));
        label->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
        get_vbox()->pack_start(*label, true, true, 0);
-       //vcodec->signal_changed().connect(sigc::mem_fun(*this, 
&Dialog_TargetParam::on_video_codec_changed));
-       vcodec->prepend_text("flv");
-       vcodec->prepend_text("h263p");
-       vcodec->prepend_text("huffyuv");
-       vcodec->prepend_text("libtheora");
-       vcodec->prepend_text("libx264");
-       vcodec->prepend_text("libxvid");
-       vcodec->prepend_text("mjpeg");
-       vcodec->prepend_text("mpeg2video");
-       vcodec->prepend_text("mpeg4");
-       vcodec->prepend_text("msmpeg4");
-       vcodec->prepend_text("msmpeg4v1");
-       vcodec->prepend_text("msmpeg4v2");
-       vcodec->prepend_text("wmv1");
-       vcodec->prepend_text("wmv2");
+       vcodec->append_text("flv");
+       vcodec->append_text("h263p");
+       vcodec->append_text("huffyuv");
+       vcodec->append_text("libtheora");
+       vcodec->append_text("libx264");
+       vcodec->append_text("libxvid");
+       vcodec->append_text("mjpeg");
+       vcodec->append_text("mpeg2video");
+       vcodec->append_text("mpeg4");
+       vcodec->append_text("msmpeg4");
+       vcodec->append_text("msmpeg4v1");
+       vcodec->append_text("msmpeg4v2");
+       vcodec->append_text("wmv1");
+       vcodec->append_text("wmv2");
+       vcodec->set_active_text(get_tparam().video_codec);
        get_vbox()->pack_start(*vcodec, true, true, 0);
 
        //Bitrate Spin Button
@@ -89,16 +88,31 @@ Dialog_TargetParam::Dialog_TargetParam(synfig::TargetParam 
&tparam)
 
        ok_button = manage(new class Gtk::Button(Gtk::StockID("gtk-ok")));
        ok_button->show();
-       add_action_widget(*ok_button,0);
+       add_action_widget(*ok_button,Gtk::RESPONSE_OK);
        
ok_button->signal_clicked().connect(sigc::mem_fun(*this,&Dialog_TargetParam::on_ok));
+
+       cancel_button = manage(new class 
Gtk::Button(Gtk::StockID("gtk-cancel")));
+       cancel_button->show();
+       add_action_widget(*cancel_button,Gtk::RESPONSE_CANCEL);
+       
cancel_button->signal_clicked().connect(sigc::mem_fun(*this,&Dialog_TargetParam::on_cancel));
+
 }
 
 void
 Dialog_TargetParam::on_ok()
 {
+       tparam_.video_codec=vcodec->get_active_text();
+       tparam_.bitrate=bitrate->get_value();
+       hide();
+}
+
+void
+Dialog_TargetParam::on_cancel()
+{
        hide();
 }
 
 Dialog_TargetParam::~Dialog_TargetParam()
 {
 }
+
diff --git a/synfig-studio/src/gtkmm/dialog_targetparam.h 
b/synfig-studio/src/gtkmm/dialog_targetparam.h
index 87781ce..8fa8cfb 100644
--- a/synfig-studio/src/gtkmm/dialog_targetparam.h
+++ b/synfig-studio/src/gtkmm/dialog_targetparam.h
@@ -45,13 +45,12 @@ class Dialog_TargetParam : public Gtk::Dialog
 {
        synfig::TargetParam tparam_;
        Gtk::Button *ok_button;
-       Gtk::Button *cancelbutton;
+       Gtk::Button *cancel_button;
        Gtk::SpinButton *bitrate;
        Gtk::ComboBoxText *vcodec;
 
        void on_ok();
        void on_cancel();
-       //void on_video_codec_changed();
 
 public:
        Dialog_TargetParam(synfig::TargetParam &tparam);
diff --git a/synfig-studio/src/gtkmm/render.cpp 
b/synfig-studio/src/gtkmm/render.cpp
index 4caca02..e958682 100644
--- a/synfig-studio/src/gtkmm/render.cpp
+++ b/synfig-studio/src/gtkmm/render.cpp
@@ -249,8 +249,9 @@ void
 RenderSettings::on_targetparam_pressed()
 {
        Dialog_TargetParam *dialogtp = new Dialog_TargetParam(tparam);
-       if(dialogtp->run()==GTK_RESPONSE_ACCEPT)
+       if(dialogtp->run()==Gtk::RESPONSE_OK)
                tparam=dialogtp->get_tparam();
+
        delete dialogtp;
 }
 


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to