[GRASS-SVN] r43547 - grass/trunk/raster/r.out.mpeg
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Sep 20 20:50:44 EDT 2010
Author: hamish
Date: 2010-09-21 00:50:44 +0000 (Tue, 21 Sep 2010)
New Revision: 43547
Modified:
grass/trunk/raster/r.out.mpeg/main.c
grass/trunk/raster/r.out.mpeg/write.c
Log:
remove quiet flag, portable /dev/null, partial merge of cleanups from devbr6
Modified: grass/trunk/raster/r.out.mpeg/main.c
===================================================================
--- grass/trunk/raster/r.out.mpeg/main.c 2010-09-21 00:38:11 UTC (rev 43546)
+++ grass/trunk/raster/r.out.mpeg/main.c 2010-09-21 00:50:44 UTC (rev 43547)
@@ -54,7 +54,7 @@
/* global variables */
-int nrows, ncols, numviews, quality, quiet = 0;
+int nrows, ncols, numviews, quality, quiet = FALSE;
char *vfiles[MAXVIEWS][MAXIMAGES];
char outfile[GPATH_MAX];
const char *encoder;
@@ -80,7 +80,7 @@
status = G_spawn_ex(
encoder, encoder,
- SF_REDIRECT_FILE, SF_STDERR, SF_MODE_OUT, "/dev/null",
+ SF_REDIRECT_FILE, SF_STDERR, SF_MODE_OUT, G_DEV_NULL,
NULL);
G_suppress_warnings(prev);
@@ -100,8 +100,11 @@
module = G_define_module();
G_add_keyword(_("raster"));
- module->description = _("Raster file series to MPEG movie conversion program.");
+ G_add_keyword(_("animation"));
+ module->description =
+ _("Raster map series to MPEG movie conversion.");
+
for (i = 0; i < MAXVIEWS; i++) {
char buf[BUFSIZ];
viewopts[i] = G_define_option();
@@ -133,22 +136,19 @@
qual->description =
_("Quality factor (1 = highest quality, lowest compression)");
- qt = G_define_flag();
- qt->key = 'q';
- qt->description = _("Quiet - suppress progress report");
-
conv = G_define_flag();
conv->key = 'c';
- conv->description =
- _("Convert on the fly, use less disk space\n\t(requires r.out.ppm with stdout option)");
+ conv->label = _("Convert on the fly, uses less disk space");
+ conv->description = _("(requires r.out.ppm with stdout option)");
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
+
parse_command(viewopts, vfiles, &numviews, &frames);
- if (qt->answer)
- quiet = 1;
+ if (G_verbose() <= G_verbose_min())
+ quiet = TRUE;
r_out = 0;
if (conv->answer)
@@ -194,7 +194,7 @@
scale = 1.0;
- { /* find animation image size */
+ { /* find animation image size */
int max, min;
char *p;
@@ -296,9 +296,9 @@
}
name = vfiles[vnum][cnt];
- if (!quiet)
- G_message("\r%s <%s>", _("Reading file"), name);
+ G_message(_("Reading file <%s> ..."), name);
+
fd = Rast_open_old(name, "");
if (Rast_read_colors(name, "", &colors) < 0)
@@ -345,8 +345,8 @@
if (quiet)
ret = G_spawn(encoder, encoder, mpfilename,
- SF_REDIRECT_FILE, SF_STDOUT, SF_MODE_OUT, "/dev/null",
- SF_REDIRECT_FILE, SF_STDERR, SF_MODE_OUT, "/dev/null",
+ SF_REDIRECT_FILE, SF_STDOUT, SF_MODE_OUT, G_DEV_NULL,
+ SF_REDIRECT_FILE, SF_STDERR, SF_MODE_OUT, G_DEV_NULL,
NULL);
else
ret = G_spawn(encoder, encoder, mpfilename, NULL);
@@ -378,8 +378,8 @@
if (quiet)
ret = G_spawn(encoder, encoder, mpfilename,
- SF_REDIRECT_FILE, SF_STDOUT, SF_MODE_OUT, "/dev/null",
- SF_REDIRECT_FILE, SF_STDERR, SF_MODE_OUT, "/dev/null",
+ SF_REDIRECT_FILE, SF_STDOUT, SF_MODE_OUT, G_DEV_NULL,
+ SF_REDIRECT_FILE, SF_STDERR, SF_MODE_OUT, G_DEV_NULL,
NULL);
else
ret = G_spawn(encoder, encoder, mpfilename, NULL);
@@ -505,7 +505,3 @@
}
}
}
-
-/*********************************************************************/
-
-/*********************************************************************/
Modified: grass/trunk/raster/r.out.mpeg/write.c
===================================================================
--- grass/trunk/raster/r.out.mpeg/write.c 2010-09-21 00:38:11 UTC (rev 43546)
+++ grass/trunk/raster/r.out.mpeg/write.c 2010-09-21 00:50:44 UTC (rev 43547)
@@ -333,6 +333,3 @@
remove(files[i]);
}
-/*******************************************************/
-
-/*******************************************************/
More information about the grass-commit
mailing list