Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo S. Romero <gsr.b3d@infernal-iceberg.com>2009-06-10 00:03:52 +0400
committerGuillermo S. Romero <gsr.b3d@infernal-iceberg.com>2009-06-10 00:03:52 +0400
commita796a74fb5b9676b564fac3112e3c2bb0a049f64 (patch)
treeccfe9c562f5c0526eef69976dcb0fb841572a090 /source/blender/editors/interface/view2d.c
parent677abc7f49b7946c0ad1b5f497d291d13aa1c6aa (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/interface/view2d.c')
-rw-r--r--source/blender/editors/interface/view2d.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index b363f1f6272..4621be6eda0 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -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 */