Skip to content

Commit 90d4848

Browse files
committed
Fix build and warnings
1 parent d3bc472 commit 90d4848

4 files changed

+36
-8
lines changed

src/SubOctpInterface.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ void EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_setLogLevel_1(Subtitle
174174
self->setLogLevel(level);
175175
}
176176

177+
void EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_setDropAnimations_1(SubtitleOctopus* self, int value) {
178+
self->setDropAnimations(value);
179+
}
180+
181+
int EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_getDropAnimations_0(SubtitleOctopus* self) {
182+
return self->getDropAnimations();
183+
}
184+
177185
void EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_initLibrary_2(SubtitleOctopus* self, int frame_w, int frame_h) {
178186
self->initLibrary(frame_w, frame_h);
179187
}
@@ -262,6 +270,10 @@ EventStopTimesResult* EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_findE
262270
return self->findEventStopTimes(tm);
263271
}
264272

273+
void EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_rescanAllAnimations_0(SubtitleOctopus* self) {
274+
self->rescanAllAnimations();
275+
}
276+
265277
ASS_Track* EMSCRIPTEN_KEEPALIVE emscripten_bind_SubtitleOctopus_get_track_0(SubtitleOctopus* self) {
266278
return self->track;
267279
}

src/SubOctpInterface.js

+16
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,17 @@ SubtitleOctopus.prototype['setLogLevel'] = SubtitleOctopus.prototype.setLogLevel
420420
_emscripten_bind_SubtitleOctopus_setLogLevel_1(self, level);
421421
};;
422422

423+
SubtitleOctopus.prototype['setDropAnimations'] = SubtitleOctopus.prototype.setDropAnimations = /** @suppress {undefinedVars, duplicate} */function(value) {
424+
var self = this.ptr;
425+
if (value && typeof value === 'object') value = value.ptr;
426+
_emscripten_bind_SubtitleOctopus_setDropAnimations_1(self, value);
427+
};;
428+
429+
SubtitleOctopus.prototype['getDropAnimations'] = SubtitleOctopus.prototype.getDropAnimations = /** @suppress {undefinedVars, duplicate} */function() {
430+
var self = this.ptr;
431+
return _emscripten_bind_SubtitleOctopus_getDropAnimations_0(self);
432+
};;
433+
423434
SubtitleOctopus.prototype['initLibrary'] = SubtitleOctopus.prototype.initLibrary = /** @suppress {undefinedVars, duplicate} */function(frame_w, frame_h) {
424435
var self = this.ptr;
425436
if (frame_w && typeof frame_w === 'object') frame_w = frame_w.ptr;
@@ -558,6 +569,11 @@ SubtitleOctopus.prototype['findEventStopTimes'] = SubtitleOctopus.prototype.find
558569
return wrapPointer(_emscripten_bind_SubtitleOctopus_findEventStopTimes_1(self, tm), EventStopTimesResult);
559570
};;
560571

572+
SubtitleOctopus.prototype['rescanAllAnimations'] = SubtitleOctopus.prototype.rescanAllAnimations = /** @suppress {undefinedVars, duplicate} */function() {
573+
var self = this.ptr;
574+
_emscripten_bind_SubtitleOctopus_rescanAllAnimations_0(self);
575+
};;
576+
561577
SubtitleOctopus.prototype['get_track'] = SubtitleOctopus.prototype.get_track = /** @suppress {undefinedVars, duplicate} */function() {
562578
var self = this.ptr;
563579
return wrapPointer(_emscripten_bind_SubtitleOctopus_get_track_0(self), ASS_Track);

src/SubtitleOctopus.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -199,20 +199,20 @@ class SubtitleOctopus {
199199

200200
int status;
201201

202-
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) {
202+
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) {
203203
}
204204

205205
void setLogLevel(int level) {
206206
log_level = level;
207207
}
208208

209-
void setDropAnimations(bool value) {
210-
bool rescan = m_drop_animations != value && track != NULL;
211-
m_drop_animations = value;
209+
void setDropAnimations(int value) {
210+
bool rescan = m_drop_animations != bool(value) && track != NULL;
211+
m_drop_animations = bool(value);
212212
if (rescan) rescanAllAnimations();
213213
}
214214

215-
bool getDropAnimations() const {
215+
int getDropAnimations() const {
216216
return m_drop_animations;
217217
}
218218

src/SubtitleOctopus.idl

+3-3
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ interface SubtitleOctopus {
178178
attribute ASS_Renderer ass_renderer;
179179
attribute ASS_Library ass_library;
180180
void setLogLevel(long level);
181-
void setDropAnimations(bool value);
182-
bool getDropAnimations();
181+
void setDropAnimations(long value);
182+
long getDropAnimations();
183183
void initLibrary(long frame_w, long frame_h);
184184
void createTrack(DOMString subfile);
185185
void createTrackMem(DOMString buf, unsigned long bufsize);
@@ -203,4 +203,4 @@ interface SubtitleOctopus {
203203
double findNextEventStart(double tm);
204204
EventStopTimesResult findEventStopTimes(double tm);
205205
void rescanAllAnimations();
206-
};
206+
};

0 commit comments

Comments
 (0)