Browse Source

sip.unwrapinstance works for python -> c++ pointer conversion

pull/1723/head
falkTX 2 years ago
parent
commit
8a9dac53c0
3 changed files with 11 additions and 10 deletions
  1. +5
    -7
      source/frontend/carla_frontend.py
  2. +5
    -2
      source/frontend/dialogs/aboutjucedialog.py
  3. +1
    -1
      source/frontend/dialogs/jackappdialog.py

+ 5
- 7
source/frontend/carla_frontend.py View File

@@ -23,12 +23,12 @@
# Imports (ctypes)

from ctypes import (
c_bool, c_char_p, c_double, c_int, c_uint, c_uint32, c_void_p, cast,
c_char_p, c_void_p, cast,
cdll, Structure,
CFUNCTYPE, POINTER
POINTER
)

from sip import voidptr
from sip import unwrapinstance

# ------------------------------------------------------------------------------------------------------------
# Imports (Custom)
@@ -69,11 +69,9 @@ class CarlaFrontendLib():
# --------------------------------------------------------------------------------------------------------

def createAndExecAboutJuceW(self, parent):
# FIXME cast(c_void_p, voidptr(parent))
self.lib.carla_frontend_createAndExecAboutJuceW(None)
self.lib.carla_frontend_createAndExecAboutJuceW(unwrapinstance(parent))

def createAndExecJackApplicationW(self, parent, projectFilename):
# FIXME cast(c_void_p, voidptr(parent))
return structToDictOrNull(self.lib.carla_frontend_createAndExecJackApplicationW(None, projectFilename.encode("utf-8")))
return structToDictOrNull(self.lib.carla_frontend_createAndExecJackApplicationW(unwrapinstance(parent), projectFilename.encode("utf-8")))

# ------------------------------------------------------------------------------------------------------------

+ 5
- 2
source/frontend/dialogs/aboutjucedialog.py View File

@@ -31,7 +31,7 @@ from carla_shared import gCarla
# ---------------------------------------------------------------------------------------------------------------------
# Imports (Local)

from .aboutjucedialog_ui import Ui_AboutJuceDialog
from aboutjucedialog_ui import Ui_AboutJuceDialog

# ------------------------------------------------------------------------------------------------------------
# About JUCE dialog
@@ -67,8 +67,11 @@ if __name__ == '__main__':
from PyQt5.QtWidgets import QApplication
# pylint: enable=ungrouped-imports

# from carla_utils import CarlaUtils
# gCarla.utils = CarlaUtils(os.path.dirname(__file__) + "/../../../bin/libcarla_utils.dylib")

_app = QApplication(sys.argv)
_gui = AboutJuceW(None, "")
_gui = AboutJuceW(None)
_gui.exec_()

# ---------------------------------------------------------------------------------------------------------------------

+ 1
- 1
source/frontend/dialogs/jackappdialog.py View File

@@ -32,7 +32,7 @@ from utils import QSafeSettings
# ---------------------------------------------------------------------------------------------------------------------
# Imports (Local)

from .jackappdialog_ui import Ui_JackAppDialog
from jackappdialog_ui import Ui_JackAppDialog

# ---------------------------------------------------------------------------------------------------------------------
# Imports (API)


Loading…
Cancel
Save