Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] python bindings #1303

Conversation

charbeljc
Copy link
Contributor

@charbeljc charbeljc commented Jun 23, 2021

  • pybind11 bindings for libhydrogen-core, made with a patched version of binder (see PR here)
  • new library: libhydrogen-gui (hydrogen executable is only main.cpp + libhydrogen-gui)
  • pyside2 bindings for libhydrogen-gui, made with shiboken

(work in progress)

I open this PR on development branch but it follows and include commits from #1302

Purpose ?

  • testing, testing, code hardening
  • open new usages
  • standalone drumkit editor

For instance, this just works 😁

from hydra.H2Core import *
import time
logger = Logger.bootstrap(
    Logger.Debug | Logger.Error | Logger.Warning | Logger.Info
)
Object.bootstrap(logger, True)
Filesystem.bootstrap(logger, "/usr/local/share/hydrogen/data/")
prefs = Preferences.create_instance()
hydrogen = Hydrogen.get_instance( False, True )
dk = Drumkit.load_file('/home/rebelcat/.hydrogen/data/drumkits/RoRBateria/drumkit.xml')
song = Song.load('/home/rebelcat/envelope_test.h2song')
hydrogen.setSong(song)
hydrogen.sequencer_play()
time.sleep(60)
hydrogen.sequencer_stop()

(I named the package hydra, because the binder generator I used just pulled most of QtCore while walking on libhydrogen-core's headers, so you end up with gratis semi working bindings for qt5 ...)

@charbeljc charbeljc force-pushed the pyside_bindings_sample_editor_love branch from 6bf7b1a to 20277cd Compare June 24, 2021 20:36
@theGreatWhiteShark
Copy link
Contributor

That's a rather big one. :) I need to finish some other Hydrogen-related stuff and will have a look at this PR in a couple of days.

@charbeljc
Copy link
Contributor Author

That's a rather big one. :) I need to finish some other Hydrogen-related stuff and will have a look at this PR in a couple of days.

This is rather informative for now, don't rush yourself reviewing this, I'm redoing it in a much more digestible form, with a custom made binding generator 😁

@charbeljc
Copy link
Contributor Author

That's a rather big one. :) I need to finish some other Hydrogen-related stuff and will have a look at this PR in a couple of days.

See #1313 instead. Regards.

@charbeljc
Copy link
Contributor Author

This one is mostly superseded by #1313. I will redo the gui binding parts later, in a more digestible form.

@charbeljc charbeljc closed this Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants