Nebula
Loading...
Searching...
No Matches
animjobenqueuemode.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
12#include "core/types.h"
13
14//------------------------------------------------------------------------------
15namespace Animation
16{
18{
19public:
21 enum Code
22 {
23 Append = 0, // append the new job after other enqueued jobs on same track
24 Intercept = 1, // stop all clips on same track and insert new job at current time
25 IgnoreIfSameClipActive = 2, // ignore the new job if another job with the same clip name is running
26 IgnoreIfSameExclTagActive = 4, // ignore the new job is another job with the same exclusive tag is running
27 };
28
30 static const char* ToString(Code c);
32 static Code FromString(const char* s);
33};
34
35//------------------------------------------------------------------------------
40{
41 n_assert(0 != s);
42 if (0 == Util::String::StrCmp(s, "Append")) return Append;
43 else if (0 == Util::String::StrCmp(s, "Intercept")) return Intercept;
44 else if (0 == Util::String::StrCmp(s, "IgnoreIfSameClipActive")) return IgnoreIfSameClipActive;
45 else if (0 == Util::String::StrCmp(s, "IgnoreIfSameExclTagActive")) return IgnoreIfSameExclTagActive;
46 else
47 {
48 n_error("AnimJobEnqueueMode: Invalid mode string '%s'!\n", s);
49 }
50 return Intercept;
51}
52
53//------------------------------------------------------------------------------
56inline const char*
58{
59 switch (c)
60 {
61 case Append: return "Append";
62 case Intercept: return "Intercept";
63 case IgnoreIfSameClipActive: return "IgnoreIfSameClipActive";
64 case IgnoreIfSameExclTagActive: return "IgnoreIfSameExclTagActive";
65 default:
66 n_error("AnimJobEnqueueMode: Invalid mode '%d'!\n", c);
67 break;
68 }
69 return 0;
70}
71
72} // namespace Animation
73//------------------------------------------------------------------------------
74
Describes the behaviour when enqueueing a new animation job into an anim sequencer.
Definition animjobenqueuemode.h:18
static Code FromString(const char *s)
convert from string
Definition animjobenqueuemode.h:39
static const char * ToString(Code c)
convert to string
Definition animjobenqueuemode.h:57
Code
enqueue modes
Definition animjobenqueuemode.h:22
@ Append
Definition animjobenqueuemode.h:23
@ IgnoreIfSameClipActive
Definition animjobenqueuemode.h:25
@ Intercept
Definition animjobenqueuemode.h:24
@ IgnoreIfSameExclTagActive
Definition animjobenqueuemode.h:26
void __cdecl n_error(const char *msg,...)
This function is called when a serious situation is encountered which requires abortion of the applic...
Definition debug.cc:138
#define n_assert(exp)
Definition debug.h:50
Definition animeventhandlerbase.cc:10
static int StrCmp(const char *str0, const char *str1)
lowlevel string compare wrapper function
Definition string.cc:1139