Revision: 20769
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20769
Author:   gsrb3d
Date:     2009-06-09 22:03:52 +0200 (Tue, 09 Jun 2009)

Log Message:
-----------
Timecode printing is more or less duplicated in two different places,
so make them both use the same style and note down for future.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c
    branches/blender2.5/blender/source/blender/editors/interface/view2d.c

Modified: 
branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c    
2009-06-09 18:57:39 UTC (rev 20768)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c    
2009-06-09 20:03:52 UTC (rev 20769)
@@ -83,12 +83,16 @@
        glScalef(1.0f/xscale, 1.0f, 1.0f);
        
        if (time) {
-               /* (Pseudo) SMPTE timecode style:
+               /* Timecode:
                 *      - In general, minutes and seconds should be shown, as 
most clips will be
                 *        within this length. Hours will only be included if 
relevant.
                 *      - Only show frames when zoomed in enough for them to be 
relevant 
-                *        (using separator of '+' for frames).
+                *        (using separator of '!' for frames).
                 *        When showing frames, use slightly different display 
to avoid confusion with mm:ss format
+                * TODO: factor into reusable function.
+                * Meanwhile keep in sync:
+                *        source/blender/editors/animation/anim_draw.c
+                *        source/blender/editors/interface/view2d.c
                 */
                float val= FRA2TIME(CFRA);
                int hours=0, minutes=0, seconds=0, frames=0;
@@ -124,9 +128,9 @@
                }
                
                /* print timecode to temp string buffer */
-               if (hours) sprintf(str, "   %s%02d:%02d:%02d+%02d", neg, hours, 
minutes, seconds, frames);
-               else if (minutes) sprintf(str, "   %s%02d:%02d+%02d", neg, 
minutes, seconds, frames);
-               else sprintf(str, "   %s%d+%02d", neg, seconds, frames);
+               if (hours) sprintf(str, "   %s%02d:%02d:%02d!%02d", neg, hours, 
minutes, seconds, frames);
+               else if (minutes) sprintf(str, "   %s%02d:%02d!%02d", neg, 
minutes, seconds, frames);
+               else sprintf(str, "   %s%d!%02d", neg, seconds, frames);
        }
        else 
                sprintf(str, "   %d", CFRA);

Modified: branches/blender2.5/blender/source/blender/editors/interface/view2d.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/view2d.c       
2009-06-09 18:57:39 UTC (rev 20768)
+++ branches/blender2.5/blender/source/blender/editors/interface/view2d.c       
2009-06-09 20:03:52 UTC (rev 20769)
@@ -1289,12 +1289,16 @@
        
        /* get string to print */
        if (unit == V2D_UNIT_SECONDS) {
-               /* SMPTE timecode style:
+               /* Timecode:
                 *      - In general, minutes and seconds should be shown, as 
most clips will be
                 *        within this length. Hours will only be included if 
relevant.
                 *      - Only show frames when zoomed in enough for them to be 
relevant 
-                *        (using separator convention of ';' for frames, ala 
QuickTime).
+                *        (using separator of '!' for frames).
                 *        When showing frames, use slightly different display 
to avoid confusion with mm:ss format
+                * TODO: factor into reusable function.
+                * Meanwhile keep in sync:
+                *        source/blender/editors/animation/anim_draw.c
+                *        source/blender/editors/interface/view2d.c
                 */
                int hours=0, minutes=0, seconds=0, frames=0;
                char neg[2]= "";
@@ -1335,9 +1339,9 @@
                /* print timecode to temp string buffer */
                if (power <= 0) {
                        /* include "frames" in display */
-                       if (hours) sprintf(str, "%s%02d:%02d:%02d;%02d", neg, 
hours, minutes, seconds, frames);
-                       else if (minutes) sprintf(str, "%s%02d:%02d;%02d", neg, 
minutes, seconds, frames);
-                       else sprintf(str, "%s%d;%02d", neg, seconds, frames);
+                       if (hours) sprintf(str, "%s%02d:%02d:%02d!%02d", neg, 
hours, minutes, seconds, frames);
+                       else if (minutes) sprintf(str, "%s%02d:%02d!%02d", neg, 
minutes, seconds, frames);
+                       else sprintf(str, "%s%d!%02d", neg, seconds, frames);
                }
                else {
                        /* don't include 'frames' in display */


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to