HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CH_MultiChannel.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: CH_MultiChannel.h (UI library, C++)
7  *
8  * COMMENTS: Manages an array of arbitary channels to act as a single one.
9  * This is meant to be a lightweight collection of channels that
10  * may belong to an arbitrary list of CH_Collection's. Ownership
11  * of the pointers are NOT assumed.
12  *
13  */
14 
15 #ifndef __CH_MultiChannel_h__
16 #define __CH_MultiChannel_h__
17 
18 #include "CH_API.h"
19 #include "CH_Types.h"
20 #include <UT/UT_ValArray.h>
21 #include <UT/UT_Array.h>
22 #include <UT/UT_String.h>
23 #include <SYS/SYS_Types.h>
24 
25 class CH_Channel;
26 class CH_Manager;
27 
29 {
30 public:
32  explicit CH_MultiChannel(const char *name);
33  virtual ~CH_MultiChannel();
34 
35  CH_MultiChannel(const CH_MultiChannel &copy);
36  CH_MultiChannel &operator=(
37  const CH_MultiChannel &copy);
38 
39  const UT_String & getName() const
40  { return myName; }
41  void setName(const UT_String &name)
42  { myName.harden(name); }
43  void appendChannelNames(const char *separator);
44 
45  void clear()
46  { myChannels.entries(); }
47  void append(CH_Channel *channel);
48 
50  { return myChannels; }
51 
52  int getNumChannels() const
53  { return myChannels.entries(); }
54 
55  void removeChannel(int i)
56  { myChannels.removeIndex((unsigned)i); }
57 
58  void addToList(CH_ChannelList &channels) const;
59 
60  bool isEmpty() const
61  { return myChannels.entries() == 0; }
62  bool isAllEnabled() const;
63  bool hasKeys() const;
64 
65  fpreal getStart() const;
66  fpreal getEnd() const;
67  fpreal getLength() const;
68 
69  bool isAtHardKey(fpreal gtime) const;
70  bool isAtHardKeyframe(int frame) const;
71  fpreal findKey(fpreal gtime, int direction) const;
72  int findKeyframe(int frame, int direction) const;
73 
74  void scroll(fpreal newStart, int update = 1);
75 
76 private:
77  // do not use!
78  int operator==(const CH_MultiChannel &) const
79  { return 0; }
80 
81 protected:
82  // only subclasses can modify the array!
84  { return myChannels; }
85 
86 private:
87  UT_String myName;
88  CH_ChannelList myChannels;
89 };
90 
91 #endif // __CH_MultiChannel_h__
92 
IMF_EXPORT IMATH_NAMESPACE::V3f direction(const IMATH_NAMESPACE::Box2i &dataWindow, const IMATH_NAMESPACE::V2f &pixelPosition)
const UT_String & getName() const
png_uint_32 i
Definition: png.h:2877
int getNumChannels() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setName(const UT_String &name)
CH_ChannelList & getModifyChannelList()
GLuint const GLchar * name
Definition: glcorearb.h:785
void removeChannel(int i)
double fpreal
Definition: SYS_Types.h:270
#define CH_API
Definition: CH_API.h:10
const CH_ChannelList & getChannelList() const
bool isEmpty() const