Skip to content

Commit

Permalink
Fix build and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAMan committed Mar 24, 2020
1 parent d3bc472 commit 90d4848
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
12 changes: 12 additions & 0 deletions src/SubOctpInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
Expand Down
16 changes: 16 additions & 0 deletions src/SubOctpInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions src/SubtitleOctopus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions src/SubtitleOctopus.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -203,4 +203,4 @@ interface SubtitleOctopus {
double findNextEventStart(double tm);
EventStopTimesResult findEventStopTimes(double tm);
void rescanAllAnimations();
};
};

0 comments on commit 90d4848

Please sign in to comment.