diff --git a/src/SubOctpInterface.cpp b/src/SubOctpInterface.cpp index e82cb863..1082cc04 100644 --- a/src/SubOctpInterface.cpp +++ b/src/SubOctpInterface.cpp @@ -174,6 +174,14 @@ void EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_setLogLevel_1(Subtitle self->setLogLevel(level); } +void EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_setDropAnimations_1(SubtitleOctopus* self, int value) { + self->setDropAnimations(value); +} + +int EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_getDropAnimations_0(SubtitleOctopus* self) { + return self->getDropAnimations(); +} + void EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_initLibrary_2(SubtitleOctopus* self, int frame_w, int frame_h) { self->initLibrary(frame_w, frame_h); } @@ -262,6 +270,10 @@ EventStopTimesResult* EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_findE return self->findEventStopTimes(tm); } +void EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_rescanAllAnimations_0(SubtitleOctopus* self) { + self->rescanAllAnimations(); +} + ASS_Track* EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_get_track_0(SubtitleOctopus* self) { return self->track; } diff --git a/src/SubOctpInterface.js b/src/SubOctpInterface.js index 6f696f87..8100de52 100644 --- a/src/SubOctpInterface.js +++ b/src/SubOctpInterface.js @@ -420,6 +420,17 @@ SubtitleOctopus.prototype['setLogLevel'] = SubtitleOctopus.prototype.setLogLevel _emscripten_bind_SubtitleOctopus_setLogLevel_1(self, level); };; +SubtitleOctopus.prototype['setDropAnimations'] = SubtitleOctopus.prototype.setDropAnimations = /** @suppress {undefinedVars, duplicate} */function(value) { + var self = this.ptr; + if (value && typeof value === 'object') value = value.ptr; + _emscripten_bind_SubtitleOctopus_setDropAnimations_1(self, value); +};; + +SubtitleOctopus.prototype['getDropAnimations'] = SubtitleOctopus.prototype.getDropAnimations = /** @suppress {undefinedVars, duplicate} */function() { + var self = this.ptr; + return _emscripten_bind_SubtitleOctopus_getDropAnimations_0(self); +};; + SubtitleOctopus.prototype['initLibrary'] = SubtitleOctopus.prototype.initLibrary = /** @suppress {undefinedVars, duplicate} */function(frame_w, frame_h) { var self = this.ptr; if (frame_w && typeof frame_w === 'object') frame_w = frame_w.ptr; @@ -558,6 +569,11 @@ SubtitleOctopus.prototype['findEventStopTimes'] = SubtitleOctopus.prototype.find return wrapPointer(_emscripten_bind_SubtitleOctopus_findEventStopTimes_1(self, tm), EventStopTimesResult); };; +SubtitleOctopus.prototype['rescanAllAnimations'] = SubtitleOctopus.prototype.rescanAllAnimations = /** @suppress {undefinedVars, duplicate} */function() { + var self = this.ptr; + _emscripten_bind_SubtitleOctopus_rescanAllAnimations_0(self); +};; + SubtitleOctopus.prototype['get_track'] = SubtitleOctopus.prototype.get_track = /** @suppress {undefinedVars, duplicate} */function() { var self = this.ptr; return wrapPointer(_emscripten_bind_SubtitleOctopus_get_track_0(self), ASS_Track); diff --git a/src/SubtitleOctopus.cpp b/src/SubtitleOctopus.cpp index 0282fe28..0b40a2d4 100644 --- a/src/SubtitleOctopus.cpp +++ b/src/SubtitleOctopus.cpp @@ -199,20 +199,20 @@ class SubtitleOctopus { int status; - SubtitleOctopus(): status(0), ass_library(NULL), ass_renderer(NULL), track(NULL), canvas_w(0), canvas_h(0), m_is_event_animated(NULL), m_drop_animations(false) { + SubtitleOctopus(): ass_library(NULL), ass_renderer(NULL), track(NULL), canvas_w(0), canvas_h(0), status(0), m_is_event_animated(NULL), m_drop_animations(false) { } void setLogLevel(int level) { log_level = level; } - void setDropAnimations(bool value) { - bool rescan = m_drop_animations != value && track != NULL; - m_drop_animations = value; + void setDropAnimations(int value) { + bool rescan = m_drop_animations != bool(value) && track != NULL; + m_drop_animations = bool(value); if (rescan) rescanAllAnimations(); } - bool getDropAnimations() const { + int getDropAnimations() const { return m_drop_animations; } diff --git a/src/SubtitleOctopus.idl b/src/SubtitleOctopus.idl index 773962f6..74c3436b 100644 --- a/src/SubtitleOctopus.idl +++ b/src/SubtitleOctopus.idl @@ -178,8 +178,8 @@ interface SubtitleOctopus { attribute ASS_Renderer ass_renderer; attribute ASS_Library ass_library; void setLogLevel(long level); - void setDropAnimations(bool value); - bool getDropAnimations(); + void setDropAnimations(long value); + long getDropAnimations(); void initLibrary(long frame_w, long frame_h); void createTrack(DOMString subfile); void createTrackMem(DOMString buf, unsigned long bufsize); @@ -203,4 +203,4 @@ interface SubtitleOctopus { double findNextEventStart(double tm); EventStopTimesResult findEventStopTimes(double tm); void rescanAllAnimations(); -}; \ No newline at end of file +};