Ocean
JSMediaObject.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_INTERACTION_JS_MEDIA_OBJECT_H
9 #define META_OCEAN_INTERACTION_JS_MEDIA_OBJECT_H
10 
13 
14 namespace Ocean
15 {
16 
17 namespace Interaction
18 {
19 
20 namespace JavaScript
21 {
22 
23 /**
24  * This class implements a wrapper for a JavaScript MediaObject object.
25  * @ingroup interactionjs
26  */
27 class OCEAN_INTERACTION_JS_EXPORT JSMediaObject : public JSObject<JSMediaObject, Media::MediumRef>
28 {
29  friend class JSObject<JSMediaObject, Media::MediumRef>;
30  friend class JSLibrary;
31 
32  public:
33 
34  /**
35  * Definition of ids for individual accessors.
36  */
37  enum AccessorId : unsigned int
38  {
39  /// The accessor for the url property, a string value.
40  AI_URL
41  };
42 
43  /**
44  * Definition of ids for individual functions.
45  */
46  enum FunctionId : unsigned int
47  {
64 
74 
86 
90 
95 
96  FI_IS_STARTED
97  };
98 
99  public:
100 
101  /**
102  * Returns the JavaScript name of this object.
103  * @return The object's JavaScript name
104  */
105  static inline const char* objectName();
106 
107  protected:
108 
109  /**
110  * Creates the function template and object template for this object.
111  */
112  static void createFunctionTemplate();
113 };
114 
115 inline const char* JSMediaObject::objectName()
116 {
117  return "MediaObject";
118 }
119 
120 }
121 
122 }
123 
124 }
125 
126 #endif // META_OCEAN_INTERACTION_JS_MEDIA_OBJECT_H
This class implements the java script interaction library object.
Definition: JSLibrary.h:32
This class implements a wrapper for a JavaScript MediaObject object.
Definition: JSMediaObject.h:28
static void createFunctionTemplate()
Creates the function template and object template for this object.
static const char * objectName()
Returns the JavaScript name of this object.
Definition: JSMediaObject.h:115
FunctionId
Definition of ids for individual functions.
Definition: JSMediaObject.h:47
@ FI_SET_PREFERRED_FRAME_FREQUENCY
Definition: JSMediaObject.h:79
@ FI_FRAME_FREQUENCY
Definition: JSMediaObject.h:54
@ FI_STOP
Definition: JSMediaObject.h:94
@ FI_IS_VALID
Definition: JSMediaObject.h:87
@ FI_PREFERRED_FRAME_PIXEL_FORMAT
Definition: JSMediaObject.h:60
@ FI_IS_INVALID
Definition: JSMediaObject.h:89
@ FI_SPEED
Definition: JSMediaObject.h:63
@ FI_SOUND_MUTE
Definition: JSMediaObject.h:70
@ FI_SOUND_BITS_PER_SAMPLE
Definition: JSMediaObject.h:68
@ FI_SET_POSITION
Definition: JSMediaObject.h:76
@ FI_PREFERRED_FRAME_FREQUENCY
Definition: JSMediaObject.h:59
@ FI_SET_PREFERRED_FRAME_PIXEL_FORMAT
Definition: JSMediaObject.h:80
@ FI_PREFERRED_SOUND_CHANNELS
Definition: JSMediaObject.h:71
@ FI_HAS_SOUND
Definition: JSMediaObject.h:65
@ FI_DURATION
Definition: JSMediaObject.h:48
@ FI_SOUND_CHANNELS
Definition: JSMediaObject.h:66
@ FI_SET_PREFERRED_SOUND_BITS_PER_SAMPLE
Definition: JSMediaObject.h:81
@ FI_FRAME_WIDTH
Definition: JSMediaObject.h:51
@ FI_SET_PREFERRED_FRAME_DIMENSION
Definition: JSMediaObject.h:78
@ FI_PREFERRED_FRAME_WIDTH
Definition: JSMediaObject.h:58
@ FI_PREFERRED_FRAME_HEIGHT
Definition: JSMediaObject.h:57
@ FI_PREFERRED_SOUND_BITS_PER_SAMPLE
Definition: JSMediaObject.h:73
@ FI_LOOP
Definition: JSMediaObject.h:49
@ FI_PREFERRED_SOUND_FREQUENCY
Definition: JSMediaObject.h:72
@ FI_HAS_FRAME
Definition: JSMediaObject.h:56
@ FI_SET_SOUND_MUTE
Definition: JSMediaObject.h:85
@ FI_RESTART
Definition: JSMediaObject.h:92
@ FI_FRAME_PIXEL_FORMAT
Definition: JSMediaObject.h:52
@ FI_NORMAL_DURATION
Definition: JSMediaObject.h:61
@ FI_SET_SPEED
Definition: JSMediaObject.h:77
@ FI_FRAME_HEIGHT
Definition: JSMediaObject.h:50
@ FI_FRAME_PIXEL_ORIGIN
Definition: JSMediaObject.h:53
@ FI_SET_SOUND_VOLUME
Definition: JSMediaObject.h:84
@ FI_SOUND_VOLUME
Definition: JSMediaObject.h:69
@ FI_IS_EXCLUSIVE
Definition: JSMediaObject.h:88
@ FI_SET_LOOP
Definition: JSMediaObject.h:75
@ FI_SET_PREFERRED_SOUND_FREQUENCY
Definition: JSMediaObject.h:83
@ FI_FRAME_TIMESTAMP
Definition: JSMediaObject.h:55
@ FI_SET_PREFERRED_SOUND_CHANNELS
Definition: JSMediaObject.h:82
@ FI_POSITION
Definition: JSMediaObject.h:62
@ FI_PAUSE
Definition: JSMediaObject.h:93
@ FI_START
Definition: JSMediaObject.h:91
@ FI_SOUND_FREQUENCY
Definition: JSMediaObject.h:67
AccessorId
Definition of ids for individual accessors.
Definition: JSMediaObject.h:38
This class implements the base class for all native wrapper of JavaScript objects.
Definition: JSObject.h:31
ObjectRef< Medium > MediumRef
This class implements a medium reference with an internal reference counter.
Definition: Medium.h:23
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15