Jamoma API  0.6.0.a19
Max.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularMax
4  *
5  * @brief Max Clock class
6  *
7  * @details
8  *
9  * @authors Théo de la Hogue
10  *
11  * @copyright ©2013, Théo de la Hogue @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 
17 #ifndef __MAX_H__
18 #define __MAX_H__
19 
20 #include "TTClock.h"
21 
22 #include "ext.h" // Max Header
23 #include "ext_proto.h"
24 #include "ext_obex.h"
25 
26 #include "ext_common.h"
27 #include "z_dsp.h"
28 #include "commonsyms.h" // Common symbols used by the Max 4.5 API
29 
30 class Max : public TTClock {
31 
32  TTCLASS_SETUP(Max)
33 
34 private:
35 
36  TTFloat64 mGranularity; ///< ATTRIBUTE : The granularity or time intervals between successive values in ms
37 
38  TTFloat64 numGrains; ///< The number of steps left to take.
39  ///< We use float value to cope with time shorter than the duration of mGranularity
40 
41  TTFloat64 stepSize; ///< The size of the steps we need to take in the normalized range
42 
43  TTPtr clock; ///< Pointer to a Max clock instance
44 
45  /** Get specific parameters names needed by this Clock
46  @return an error code if the Clock fails to give his specific parameters */
47  TTErr getParameterNames(TTValue& value);
48 
49  /** Start the Clock
50  @return an error code if the Clock fails to start */
51  TTErr Go();
52 
53  /** Halt the sheduler
54  @return an error code if the Clock fails to stop */
55  TTErr Stop();
56 
57  /** Pause the sheduler progression
58  @return an error code if the Clock fails to pause */
59  TTErr Pause();
60 
61  /** Resume the sheduler progression
62  @return an error code if the Clock fails to resume */
63  TTErr Resume();
64 
65  /** Called every time a new step should be processed
66  @return an error code if the Clock step fails */
67  TTErr Tick();
68 
69  friend void TT_EXTENSION_EXPORT MaxClockCallback(Max* aMaxClock);
70 
71 };
72 typedef Max* MaxPtr;
73 
74 /** Called by the Max queue, and provided to the qelem -- needs to have a C interface
75  @param baton ..
76  @param data ..
77  @return an error code */
78 void TT_EXTENSION_EXPORT MaxClockCallback(Max* aMaxClock);
79 
80 #endif // __MAX_H__
void TT_EXTENSION_EXPORT MaxClockCallback(Max *aMaxClock)
Called by the Max queue, and provided to the qelem – needs to have a C interface.
Definition: Max.cpp:164
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
void * TTPtr
A generic pointer.
Definition: TTBase.h:248
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTClock is the base class for all Clock Unit.
Definition: TTClock.h:46
A Clock interface.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34