Skip to content

Commit

Permalink
Expose the Profile operators to SWIG for comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
jonoomph committed Oct 10, 2024
1 parent 6998177 commit 178cae4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bindings/python/openshot.i
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
%shared_ptr(juce::AudioBuffer<float>)
%shared_ptr(openshot::Frame)

/* Rename operators to avoid wrapping name collisions */
%rename(__eq__) operator==;
%rename(__lt__) operator<;
%rename(__gt__) operator>;

/* Instantiate the required template specializations */
%template() std::map<std::string, int>;
%template() std::pair<int, int>;
Expand Down Expand Up @@ -249,6 +254,18 @@
%}
}

%extend openshot::Profile {
bool __eq__(const openshot::Profile& other) const {
return (*self == other);
}
bool __lt__(const openshot::Profile& other) const {
return (*self < other);
}
bool __gt__(const openshot::Profile& other) const {
return (*self > other);
}
}

%extend openshot::OpenShotVersion {
// Give the struct a string representation
const std::string __str__() {
Expand Down

0 comments on commit 178cae4

Please sign in to comment.