Module: synfig/synfig
Branch: master
Commit: 40bd8542524fc63dc297997277e7d58e30a694b1
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig/synfig;a=commit;h=40bd8542524fc63dc297997277e7d58e30a694b1

Author: Carlos Lopez <[email protected]>
Date:   Mon Oct 25 19:33:52 2010 +0200

Assume frames when no unit provided in a time field. Apply feature request ID: 
2879693

---

 synfig-core/src/synfig/time.cpp |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/synfig-core/src/synfig/time.cpp b/synfig-core/src/synfig/time.cpp
index f9fae68..47a3306 100644
--- a/synfig-core/src/synfig/time.cpp
+++ b/synfig-core/src/synfig/time.cpp
@@ -114,9 +114,16 @@ Time::Time(const String &str_, float fps):
                        // and the amount isn't zero. There is no need
                        // to warn about units if the value is zero
                        // it is the only case where units are irrelevant.
-                       if(amount!=0)
-                               synfig::warning("Time(): No unit provided in 
time code, assuming SECONDS (\"%s\")",str.c_str());
-                       value_+=amount;
+                       if(amount!=0 && fps)
+                       {
+                               synfig::warning(_("Time(): No unit provided in 
time code, assuming FRAMES (\"%s\")"),str.c_str());
+                               value_+=amount/fps;
+                       }
+                       else
+                       {
+                               synfig::warning(_("Time(): No unit provided in 
time code and frame rate is unknown! Assuming SECONDS"));
+                               value_+=amount;
+                       }
                        return;
                }
                switch(str[pos])


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to