diff options
author | Guillermo S. Romero <gsr.b3d@infernal-iceberg.com> | 2009-06-10 00:03:52 +0400 |
---|---|---|
committer | Guillermo S. Romero <gsr.b3d@infernal-iceberg.com> | 2009-06-10 00:03:52 +0400 |
commit | a796a74fb5b9676b564fac3112e3c2bb0a049f64 (patch) | |
tree | ccfe9c562f5c0526eef69976dcb0fb841572a090 /source/blender/editors/animation/anim_draw.c | |
parent | 677abc7f49b7946c0ad1b5f497d291d13aa1c6aa (diff) |
Timecode printing is more or less duplicated in two different places,
so make them both use the same style and note down for future.
Diffstat (limited to 'source/blender/editors/animation/anim_draw.c')
-rw-r--r-- | source/blender/editors/animation/anim_draw.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 0474f81754d..c176f20c26b 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -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); |