Author: Diego Barrios Romero <[email protected]>
Date:   Sun Apr 21 19:43:22 2013 +0200

Changed type of values for time-related options to string

In order to support unities together with the numbers, e.g. 1f and decimal 
values.

---

 synfig-core/src/tool/main.cpp             |   10 ++++----
 synfig-core/src/tool/optionsprocessor.cpp |   32 ++++++++++------------------
 2 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/synfig-core/src/tool/main.cpp b/synfig-core/src/tool/main.cpp
index 7cd9720..40387bc 100644
--- a/synfig-core/src/tool/main.cpp
+++ b/synfig-core/src/tool/main.cpp
@@ -150,11 +150,11 @@ int main(int ac, char* av[])
                named_type<string>* canvas_arg_desc = new 
named_type<string>("canvas-id");
                named_type<string>* output_file_arg_desc = new 
named_type<string>("filename");
                named_type<string>* input_file_arg_desc = new 
named_type<string>("filename");
-               named_type<int>* fps_arg_desc = new named_type<int>("NUM");
-               named_type<int>* time_arg_desc = new named_type<int>("seconds");
-               named_type<int>* begin_time_arg_desc = new 
named_type<int>("seconds");
-               named_type<int>* start_time_arg_desc = new 
named_type<int>("seconds");
-               named_type<int>* end_time_arg_desc = new 
named_type<int>("seconds");
+               named_type<float>* fps_arg_desc = new named_type<float>("NUM");
+               named_type<string>* time_arg_desc = new 
named_type<string>("seconds");
+               named_type<string>* begin_time_arg_desc = new 
named_type<string>("seconds");
+               named_type<string>* start_time_arg_desc = new 
named_type<string>("seconds");
+               named_type<string>* end_time_arg_desc = new 
named_type<string>("seconds");
                named_type<int>* dpi_arg_desc = new named_type<int>("NUM");
                named_type<int>* dpi_x_arg_desc = new named_type<int>("NUM");
                named_type<int>* dpi_y_arg_desc = new named_type<int>("NUM");
diff --git a/synfig-core/src/tool/optionsprocessor.cpp 
b/synfig-core/src/tool/optionsprocessor.cpp
index a238575..6e40714 100644
--- a/synfig-core/src/tool/optionsprocessor.cpp
+++ b/synfig-core/src/tool/optionsprocessor.cpp
@@ -354,35 +354,27 @@ RendDesc OptionsProcessor::extract_renddesc(const 
RendDesc& renddesc)
        }
        if (_vm.count("start-time"))
        {
-               int seconds;
-               stringstream ss;
-               seconds = _vm["start-time"].as<int>();
-               ss << seconds;
-               desc.set_time_start(Time(ss.str().c_str(), 
desc.get_frame_rate()));
+               string seconds;
+               seconds = _vm["start-time"].as<string>();
+               desc.set_time_start(Time(seconds.c_str(), 
desc.get_frame_rate()));
        }
        if (_vm.count("begin-time"))
        {
-               int seconds;
-               stringstream ss;
-               seconds = _vm["begin-time"].as<int>();
-               ss << seconds;
-               desc.set_time_start(Time(ss.str().c_str(), 
desc.get_frame_rate()));
+               string seconds;
+               seconds = _vm["begin-time"].as<string>();
+               desc.set_time_start(Time(seconds.c_str(), 
desc.get_frame_rate()));
        }
        if (_vm.count("end-time"))
        {
-               int seconds;
-               stringstream ss;
-               seconds = _vm["end-time"].as<int>();
-               ss << seconds;
-               desc.set_time_end(Time(ss.str().c_str(), 
desc.get_frame_rate()));
+               string seconds;
+               seconds = _vm["end-time"].as<string>();
+               desc.set_time_end(Time(seconds.c_str(), desc.get_frame_rate()));
        }
        if (_vm.count("time"))
        {
-               int seconds;
-               stringstream ss;
-               seconds = _vm["time"].as<int>();
-               ss << seconds;
-               desc.set_time(Time(ss.str().c_str(), desc.get_frame_rate()));
+               string seconds;
+               seconds = _vm["time"].as<string>();
+               desc.set_time(Time(seconds.c_str(), desc.get_frame_rate()));
 
                VERBOSE_OUT(1) << _("Rendering frame at ")
                                           << 
desc.get_time_start().get_string(desc.get_frame_rate())


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to