Timecode printing is more or less duplicated in two different places,
authorGuillermo S. Romero <gsr.b3d@infernal-iceberg.com>
Tue, 9 Jun 2009 20:03:52 +0000 (20:03 +0000)
committerGuillermo S. Romero <gsr.b3d@infernal-iceberg.com>
Tue, 9 Jun 2009 20:03:52 +0000 (20:03 +0000)
so make them both use the same style and note down for future.

source/blender/editors/animation/anim_draw.c
source/blender/editors/interface/view2d.c

index 0474f81754d08a26d7ab97564620d73e825a641e..c176f20c26b274e35362bd848fcbca38c6be4550 100644 (file)
@@ -83,12 +83,16 @@ static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time)
        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 @@ static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time)
                }
                
                /* 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);
index b363f1f627279d941dbf8217ea3fafcef5d0bcae..4621be6eda095da703f3ba12943ca3ec1b9508bc 100644 (file)
@@ -1289,12 +1289,16 @@ static void scroll_printstr(View2DScrollers *scrollers, Scene *scene, float x, f
        
        /* 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 @@ static void scroll_printstr(View2DScrollers *scrollers, Scene *scene, float x, f
                /* 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 */