Skip to content
Snippets Groups Projects
Commit 3e79b658 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

gui for mpeg

parent f0915760
Branches
Tags
No related merge requests found
...@@ -348,6 +348,69 @@ int jpegFileDialog(const char *name) ...@@ -348,6 +348,69 @@ int jpegFileDialog(const char *name)
return 0; return 0;
} }
// Save mpeg dialog
int mpegFileDialog(const char *name)
{
struct _mpegFileDialog{
Fl_Window *window;
Fl_Round_Button *b[2];
Fl_Check_Button *c[1];
Fl_Button *ok, *cancel;
};
static _mpegFileDialog *dialog = NULL;
if(!dialog){
dialog = new _mpegFileDialog;
int h = 3 * WB + 4 * BH, w = 2 * BB + 3 * WB, y = WB;
dialog->window = new Fl_Double_Window(w, h, "MPEG Options");
dialog->window->box(GMSH_WINDOW_BOX);
dialog->window->set_modal();
{
Fl_Group *o = new Fl_Group(WB, y, 2 * BB + WB, 2 * BH);
dialog->b[0] = new Fl_Round_Button
(WB, y, 2 * BB + WB, BH, "Cycle through time steps"); y += BH;
dialog->b[0]->type(FL_RADIO_BUTTON);
dialog->b[1] = new Fl_Round_Button
(WB, y, 2 * BB + WB, BH, "Cycle through views"); y += BH;
dialog->b[1]->type(FL_RADIO_BUTTON);
o->end();
}
dialog->c[0] = new Fl_Check_Button
(WB, y, 2 * BB + WB, BH, "Composite all window tiles"); y += BH;
dialog->c[0]->type(FL_TOGGLE_BUTTON);
dialog->ok = new Fl_Return_Button(WB, y + WB, BB, BH, "OK");
dialog->cancel = new Fl_Button(2 * WB + BB, y + WB, BB, BH, "Cancel");
dialog->window->end();
dialog->window->hotspot(dialog->window);
}
dialog->b[0]->value(!CTX::instance()->post.animCycle);
dialog->b[1]->value(CTX::instance()->post.animCycle);
dialog->c[0]->value(CTX::instance()->print.compositeWindows);
dialog->window->show();
while(dialog->window->shown()){
Fl::wait();
for (;;) {
Fl_Widget* o = Fl::readqueue();
if (!o) break;
if (o == dialog->ok) {
opt_post_anim_cycle(0, GMSH_SET | GMSH_GUI, (int)dialog->b[1]->value());
opt_print_composite_windows(0, GMSH_SET | GMSH_GUI, (int)dialog->c[0]->value());
CreateOutputFile(name, FORMAT_MPEG);
dialog->window->hide();
return 1;
}
if (o == dialog->window || o == dialog->cancel){
dialog->window->hide();
return 0;
}
}
}
return 0;
}
// Save gif dialog // Save gif dialog
int gifFileDialog(const char *name) int gifFileDialog(const char *name)
... ...
......
...@@ -22,6 +22,7 @@ int fileChooserGetFilter(); ...@@ -22,6 +22,7 @@ int fileChooserGetFilter();
void fileChooserGetPosition(int *x, int *y); void fileChooserGetPosition(int *x, int *y);
int jpegFileDialog(const char *filename); int jpegFileDialog(const char *filename);
int mpegFileDialog(const char *filename);
int gifFileDialog(const char *filename); int gifFileDialog(const char *filename);
int geoFileDialog(const char *filename); int geoFileDialog(const char *filename);
int genericBitmapFileDialog(const char *filename, const char *title, int format); int genericBitmapFileDialog(const char *filename, const char *title, int format);
... ...
......
...@@ -252,6 +252,7 @@ static int _save_eps(const char *name){ return gl2psFileDialog ...@@ -252,6 +252,7 @@ static int _save_eps(const char *name){ return gl2psFileDialog
(name, "EPS Options", FORMAT_EPS); } (name, "EPS Options", FORMAT_EPS); }
static int _save_gif(const char *name){ return gifFileDialog(name); } static int _save_gif(const char *name){ return gifFileDialog(name); }
static int _save_jpeg(const char *name){ return jpegFileDialog(name); } static int _save_jpeg(const char *name){ return jpegFileDialog(name); }
static int _save_mpeg(const char *name){ return mpegFileDialog(name); }
static int _save_tex(const char *name){ return latexFileDialog(name); } static int _save_tex(const char *name){ return latexFileDialog(name); }
static int _save_pdf(const char *name){ return gl2psFileDialog static int _save_pdf(const char *name){ return gl2psFileDialog
(name, "PDF Options", FORMAT_PDF); } (name, "PDF Options", FORMAT_PDF); }
...@@ -287,6 +288,7 @@ static int _save_auto(const char *name) ...@@ -287,6 +288,7 @@ static int _save_auto(const char *name)
case FORMAT_EPS : return _save_eps(name); case FORMAT_EPS : return _save_eps(name);
case FORMAT_GIF : return _save_gif(name); case FORMAT_GIF : return _save_gif(name);
case FORMAT_JPEG : return _save_jpeg(name); case FORMAT_JPEG : return _save_jpeg(name);
case FORMAT_MPEG : return _save_mpeg(name);
case FORMAT_TEX : return _save_tex(name); case FORMAT_TEX : return _save_tex(name);
case FORMAT_PDF : return _save_pdf(name); case FORMAT_PDF : return _save_pdf(name);
case FORMAT_PNG : return _save_png(name); case FORMAT_PNG : return _save_png(name);
...@@ -334,7 +336,7 @@ static void file_save_as_cb(Fl_Widget *w, void *data) ...@@ -334,7 +336,7 @@ static void file_save_as_cb(Fl_Widget *w, void *data)
{"JPEG" TT "*.jpg", _save_jpeg}, {"JPEG" TT "*.jpg", _save_jpeg},
#endif #endif
#if defined(HAVE_MPEG_ENCODE) #if defined(HAVE_MPEG_ENCODE)
{"MPEG" TT "*.mpg", 0}, {"MPEG" TT "*.mpg", _save_mpeg},
#endif #endif
{"LaTeX" TT "*.tex", _save_tex}, {"LaTeX" TT "*.tex", _save_tex},
{"PDF" TT "*.pdf", _save_pdf}, {"PDF" TT "*.pdf", _save_pdf},
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment