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

Migrate ControllerEngine to QJSEngine + improve error handling #1795

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
e2441bd
Replace QtScript classes with QtQml script classes
ferranpujolcamins Mar 25, 2018
8e21856
Move controllerengine files into new engine subfolder
ferranpujolcamins Aug 18, 2018
3bf236a
Expose Controller and ControllerEngine scripting apis through a proxy
ferranpujolcamins Aug 18, 2018
08dd110
Add checks for JS engine evaluation errors
ferranpujolcamins Aug 19, 2018
6ddae3d
Remove unused evaluate slot in ControllerEngine
ferranpujolcamins Aug 19, 2018
9b3b28f
Refactor exceptions
ferranpujolcamins Aug 19, 2018
50f8059
Add nullengine exception handling
ferranpujolcamins Aug 20, 2018
2b14555
Fix tests build
ferranpujolcamins Aug 30, 2018
a3475d8
Add controller script name to assertion message
ferranpujolcamins Aug 30, 2018
9009fc9
Fix script error not displaying file name
ferranpujolcamins Aug 30, 2018
d7b6811
Remove comment
ferranpujolcamins Aug 30, 2018
6bd1f15
Adapt hid devices to new JS Engine
ferranpujolcamins Sep 1, 2018
4047bf8
Add QtQml dependency to travis config file
ferranpujolcamins Sep 3, 2018
5ed5280
Update comments
ferranpujolcamins Sep 3, 2018
b3380ba
Remove QScriptEngineDebugger from SkinContext
ferranpujolcamins Sep 3, 2018
6274220
Components: use Function.prototype.bind for QJSEngine
Be-ing Nov 22, 2018
ed4b00c
Xone K2: use Function.prototype.bind for QJSEngine
Be-ing Nov 22, 2018
ccbc73c
Hercules P32: use Function.prototype.bind for QJSEngine
Be-ing Nov 22, 2018
eb06da4
Add comment to depends.py
ferranpujolcamins Nov 24, 2018
1200db3
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Nov 25, 2018
9143bb3
Add missing file to depends.py
ferranpujolcamins Nov 25, 2018
7c65f81
Fix usage of deprecated parameter
ferranpujolcamins Nov 25, 2018
c34427d
Replace checks with VERIFY_OR_DEBUG_ASSERT
ferranpujolcamins Nov 25, 2018
630c781
Replace tabs with spaces
ferranpujolcamins Nov 25, 2018
da214be
Rename ControllerEngine member
ferranpujolcamins Nov 25, 2018
4bee8ab
Replace tabs with spaces
ferranpujolcamins Nov 25, 2018
98818df
Rename function in ControllerEngine
ferranpujolcamins Nov 25, 2018
86efb47
Rename variable
ferranpujolcamins Nov 25, 2018
b69b9b9
Improve comments
ferranpujolcamins Nov 25, 2018
cf40beb
Rename method in ControllerEngine
ferranpujolcamins Nov 25, 2018
d572eb1
Let subclasses of Controller provide custom JS api
ferranpujolcamins Nov 25, 2018
8521131
Remove redundant warning
ferranpujolcamins Nov 25, 2018
d9013e8
Replace tabs with spaces
ferranpujolcamins Nov 25, 2018
85b7855
Rename MidiController member
ferranpujolcamins Nov 27, 2018
d6d86e8
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Nov 27, 2018
bd58277
Add missing Q_OBJECT macro
Be-ing Nov 27, 2018
f6291d7
Add missing Q_OBJECT macro
Be-ing Nov 27, 2018
6f5dfd2
Add HidControllerJSProxy
ferranpujolcamins Nov 27, 2018
e8e25a4
Make Controller::send virtual
ferranpujolcamins Nov 27, 2018
70b16f7
Remove unused method of ControllerEngine
ferranpujolcamins Nov 27, 2018
a353c34
Centralise script evaluation handling
ferranpujolcamins Nov 29, 2018
06ad456
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Nov 29, 2018
8da5220
Remove close button from script error dialog
ferranpujolcamins Nov 29, 2018
e804155
Fix the retry button of the script error dialog
ferranpujolcamins Nov 29, 2018
ad2e814
Fix typo in comment
Pegasus-RPG Nov 29, 2018
11c7508
Revert renaming of send(QByteArray) to sendByteArray
ferranpujolcamins Nov 29, 2018
ca59d2d
Fix method hiding warning in FakeController
ferranpujolcamins Nov 29, 2018
3053d2e
Fix connectionExecutesWithCorrectThisObject test
ferranpujolcamins Nov 29, 2018
fb54489
Check precondition of showScriptExceptionDialog(QJSValue)
ferranpujolcamins Nov 29, 2018
77d2372
Add warnings when m_pScriptEngine is null
ferranpujolcamins Nov 29, 2018
733e7b0
Revert "Add warnings when m_pScriptEngine is null"
ferranpujolcamins Nov 30, 2018
c0c3268
Rename evaluateProgram to evaluateCodeString
Nov 30, 2018
1170b0b
Add missing override
Nov 30, 2018
a003f1f
Delete ControllerEngine::isReady()
Nov 30, 2018
2cfa4bc
Merge pull request #5 from Be-ing/update_scripts_for_qjsengine
ferranpujolcamins Dec 1, 2018
0ab3fee
showScriptExceptionDialog inside evaluateCodeString
ferranpujolcamins Dec 1, 2018
907d9df
Rename internalExecute and remove execute methods
ferranpujolcamins Dec 1, 2018
17cb8eb
Remove internalExecute methods
ferranpujolcamins Dec 1, 2018
183eb08
Update comments
ferranpujolcamins Dec 1, 2018
70ed3c9
Fix log message
ferranpujolcamins Dec 1, 2018
e0295ad
Add script error dialog on executeFunction and ScriptConnection
ferranpujolcamins Dec 2, 2018
3337dfd
Remove controllerengineexceptions.h
ferranpujolcamins Dec 2, 2018
aa28540
Don't open new error dialogs when there's already one
ferranpujolcamins Dec 2, 2018
80263a9
Rename variable
ferranpujolcamins Dec 8, 2018
075664d
Evaluate timer callback strings on beginTimer
ferranpujolcamins Dec 8, 2018
bd2185a
Avoid recalculation of m_byteArrayToScriptValueJSFunction
ferranpujolcamins Dec 8, 2018
4fa82f7
Remove m_bPopups
ferranpujolcamins Dec 8, 2018
b57ef7b
Add missing function in header file
ferranpujolcamins Dec 8, 2018
49e01ed
Fix controller scripts
ferranpujolcamins Dec 8, 2018
2deded5
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Dec 8, 2018
f2f04d2
Patch novation launchpad generated scripts
ferranpujolcamins Dec 8, 2018
90d6770
Add QtQml to linux appveyor config
ferranpujolcamins Dec 9, 2018
ecedd59
remove 'use strict' from Novation Launchpad scripts
Be-ing Dec 28, 2018
a4c198b
Components.js: remove dependency on Lodash
Be-ing Dec 28, 2018
c2ebe26
Merge remote-tracking branch 'upstream/master' into qjsengine_migration
Be-ing Dec 28, 2018
28497ba
remove controller scripts' dependency on Lodash
Be-ing Dec 28, 2018
fa6393b
remove Lodash
Be-ing Dec 28, 2018
99f9f36
Merge pull request #6 from Be-ing/qjsengine_migration
ferranpujolcamins Dec 28, 2018
619b1df
Throw QJSEngine exceptions on evaluation failure of callbacks
ferranpujolcamins Dec 19, 2018
4e1d544
Remove warning in ControllerEngine
ferranpujolcamins Dec 28, 2018
454d1ed
Improve ControllerEngine error messages
ferranpujolcamins Dec 28, 2018
6740331
make ControllerEngine throw an errorr on faulty makeConnection callback
ferranpujolcamins Dec 28, 2018
d3c5f65
make ControllerEngine throw an errorr on faulty makeConnection callback
ferranpujolcamins Dec 28, 2018
11f4be3
Fix build error in ControllerEngine
ferranpujolcamins Dec 28, 2018
ac6b3ba
Display controller name on ControllerEngine script error dialog
ferranpujolcamins Dec 28, 2018
8906c5d
Correct message on ControllerEngine script error dialog
ferranpujolcamins Dec 28, 2018
b845529
Improve ControllerEngine error message on callbacks
ferranpujolcamins Dec 29, 2018
191ce6f
use function pointers for Qt connections in ControllerEngine
Be-ing Dec 29, 2018
bb885fb
Merge pull request #7 from Be-ing/qjsengine_migration
ferranpujolcamins Dec 29, 2018
2d2bac7
Add alternative to QJSEngine::throwError for QT < 5.12.0
ferranpujolcamins Dec 30, 2018
9158b50
Check presets for compatibility with ControllerEngine version
ferranpujolcamins Dec 30, 2018
3a00f84
Correct engine version
ferranpujolcamins Dec 30, 2018
76f4b77
Revert "remove Lodash"
ferranpujolcamins Dec 31, 2018
e14c247
Revert "remove controller scripts' dependency on Lodash"
ferranpujolcamins Dec 31, 2018
996df30
Revert "Components.js: remove dependency on Lodash"
ferranpujolcamins Dec 31, 2018
8eeb00f
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Dec 31, 2018
de53702
Add comment on ControllerEngine version
ferranpujolcamins Dec 31, 2018
c7dd4db
Disable apply and accept buttons when loading an incompatible mapping
ferranpujolcamins Jan 2, 2019
059e6a3
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Jan 6, 2019
3ca5bfd
Disconnect DlgPreferences::changePage before deleting controller dele…
ferranpujolcamins Jan 6, 2019
c1d34f9
Replace Qt foreach macro with standard C++11 for loop
ferranpujolcamins Jan 6, 2019
299fcfd
Use new signals and slots syntax in DlgPrefControllers
ferranpujolcamins Jan 7, 2019
98ffee1
Hide unsupported mapping warning when controller is disabled
ferranpujolcamins Jan 7, 2019
9058f5f
Mixtrack Platinum: use Function.prototype.bind for QJSEngine
Be-ing Jan 7, 2019
718f971
Numark N4: use Function.prototype.bind for QJSEngine
Be-ing Jan 7, 2019
8bd4ad9
Pioneer DDJ-SB2: use Function.prototype.bind for QJSEngine
Be-ing Jan 7, 2019
72cd1ca
fix script validation tests failing with nonexistent COs
Be-ing Jan 7, 2019
a7a7bdb
Add FakeControllerJSProxy
Be-ing Jan 7, 2019
e5916c1
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Jan 11, 2019
d5a980e
Fix beginTimer trying to evaluate the result of an evaluation
ferranpujolcamins Jan 11, 2019
e622a07
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Jan 22, 2019
cc13e7c
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Feb 17, 2019
60ac314
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Feb 17, 2019
431c40a
Fix merge and simplify tests
ferranpujolcamins Feb 17, 2019
1df12b1
add bundles
dszakallas Feb 27, 2019
276f0dc
add sources
dszakallas Feb 27, 2019
f2610e3
Merge pull request #10 from dszakallas/upgrade-lp
ferranpujolcamins Mar 2, 2019
c86cc16
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Jun 8, 2019
ab78036
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Jun 8, 2019
db6aadc
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Jun 21, 2019
e1a1b71
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Jun 24, 2019
803d1cb
Remove mixco based controlelr scripts
ferranpujolcamins Jun 24, 2019
eb62363
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Jun 27, 2019
2c4936a
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Oct 23, 2019
0f50ff6
Format code
ferranpujolcamins Oct 23, 2019
a17bdf8
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Jan 19, 2020
9cdf435
Merge branch 'master' into migrate-to-QJSEngine
ferranpujolcamins Jan 19, 2020
155f066
Merge branch 'master' into migrate-to-QJSEngine
Mar 27, 2020
cfc4142
Merge branch 'master' into migrate-to-QJSEngine
Mar 27, 2020
e122b79
controllers/bulk: Fix BulkController constructor
Holzhaus Apr 9, 2020
97d5623
Merge pull request #15 from Holzhaus/bulk-controller-fix
ferranpujolcamins Apr 12, 2020
381214a
Fix wrong file path in scons
ferranpujolcamins Apr 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ addons:
- portaudio19-dev
- protobuf-compiler
- qt5-default
- qtdeclarative5-dev
- qtscript5-dev
- qt5keychain-dev
homebrew:
Expand Down
18 changes: 6 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,8 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/control/controlpushbutton.cpp
src/control/controlttrotary.cpp
src/controllers/colormapper.cpp
src/controllers/colormapperjsproxy.cpp
src/controllers/controller.cpp
src/controllers/controllerdebug.cpp
src/controllers/controllerengine.cpp
src/controllers/controllerenumerator.cpp
src/controllers/controllerinputmappingtablemodel.cpp
src/controllers/controllerlearningeventfilter.cpp
Expand All @@ -214,6 +212,10 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/controllers/dlgprefcontrollerdlg.ui
src/controllers/dlgprefcontrollers.cpp
src/controllers/dlgprefcontrollersdlg.ui
src/controllers/engine/controllerengine.cpp
src/controllers/engine/controllerenginejsproxy.cpp
src/controllers/engine/colorjsproxy.cpp
src/controllers/engine/colormapperjsproxy.cpp
src/controllers/keyboard/keyboardeventfilter.cpp
src/controllers/learningutils.cpp
src/controllers/midi/midicontroller.cpp
Expand Down Expand Up @@ -1353,6 +1355,7 @@ find_package(Qt5
Gui
Network
OpenGL
Qml
Script
ScriptTools
Sql
Expand All @@ -1368,6 +1371,7 @@ target_link_libraries(mixxx-lib PUBLIC
Qt5::Gui
Qt5::Network
Qt5::OpenGL
Qt5::Qml
Qt5::Script
Qt5::ScriptTools
Qt5::Sql
Expand Down Expand Up @@ -1472,16 +1476,6 @@ elseif(WIN32)
endif()
endif()

# QtScriptByteArray
add_library(QtScriptByteArray STATIC EXCLUDE_FROM_ALL
lib/qtscript-bytearray/bytearrayclass.cpp
lib/qtscript-bytearray/bytearrayprototype.cpp
)
set_target_properties(QtScriptByteArray PROPERTIES AUTOMOC ON)
target_link_libraries(QtScriptByteArray Qt5::Core)
target_include_directories(mixxx-lib PUBLIC lib/qtscript-bytearray)
target_link_libraries(mixxx-lib PUBLIC QtScriptByteArray)

# Queen Mary DSP
add_library(QueenMaryDsp STATIC EXCLUDE_FROM_ALL
# lib/qm-dsp/base/KaiserWindow.cpp
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ for:
protobuf-compiler
python-pip
qt5-default
qtdeclarative5-dev
qt5keychain-dev
qtscript5-dev
xsltproc
Expand Down
19 changes: 7 additions & 12 deletions build/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def enabled_modules(build):
'QtGui',
'QtNetwork',
'QtOpenGL',
'QtQml', # Needed for QJSEngine
'QtScript',
'QtScriptTools',
'QtSql',
Expand Down Expand Up @@ -702,14 +703,6 @@ def sources(self, build):
env['CCFLAGS'].remove('-ffast-math')
return env.Object('src/util/fpclassify.cpp')

class QtScriptByteArray(Dependence):
def configure(self, build, conf):
build.env.Append(CPPPATH='#lib/qtscript-bytearray')

def sources(self, build):
return ['lib/qtscript-bytearray/bytearrayclass.cpp',
'lib/qtscript-bytearray/bytearrayprototype.cpp']

class PortAudioRingBuffer(Dependence):
def configure(self, build, conf):
build.env.Append(CPPPATH='#lib/portaudio')
Expand Down Expand Up @@ -743,6 +736,7 @@ def enabled(self, build):
return True

def sources(self, build):

sources = ["src/control/control.cpp",
"src/control/controlaudiotaperpot.cpp",
"src/control/controlbehavior.cpp",
Expand Down Expand Up @@ -904,7 +898,6 @@ def sources(self, build):

"src/controllers/controller.cpp",
"src/controllers/controllerdebug.cpp",
"src/controllers/controllerengine.cpp",
"src/controllers/controllerenumerator.cpp",
"src/controllers/controllerlearningeventfilter.cpp",
"src/controllers/controllermanager.cpp",
Expand All @@ -921,6 +914,10 @@ def sources(self, build):
"src/controllers/delegates/midibytedelegate.cpp",
"src/controllers/delegates/midioptionsdelegate.cpp",
"src/controllers/learningutils.cpp",
"src/controllers/engine/controllerengine.cpp",
"src/controllers/engine/controllerenginejsproxy.cpp",
"src/controllers/engine/colorjsproxy.cpp",
"src/controllers/engine/colormapperjsproxy.cpp",
"src/controllers/midi/midimessage.cpp",
"src/controllers/midi/midiutils.cpp",
"src/controllers/midi/midicontroller.cpp",
Expand All @@ -930,7 +927,6 @@ def sources(self, build):
"src/controllers/softtakeover.cpp",
"src/controllers/keyboard/keyboardeventfilter.cpp",
"src/controllers/colormapper.cpp",
"src/controllers/colormapperjsproxy.cpp",

"src/main.cpp",
"src/mixxx.cpp",
Expand Down Expand Up @@ -1319,7 +1315,6 @@ def sources(self, build):
"src/util/workerthread.cpp",
"src/util/workerthreadscheduler.cpp"
]

proto_args = {
'PROTOCPROTOPATH': ['src'],
'PROTOCPYTHONOUTDIR': '', # set to None to not generate python
Expand Down Expand Up @@ -1609,7 +1604,7 @@ def depends(self, build):
return [SoundTouch, ReplayGain, Ebur128Mit, PortAudio, PortMIDI, Qt, TestHeaders,
FidLib, SndFile, FLAC, OggVorbis, OpenGL, TagLib, ProtoBuf,
Chromaprint, RubberBand, SecurityFramework, CoreServices, IOKit,
QtScriptByteArray, Reverb, FpClassify, PortAudioRingBuffer, LAME,
Reverb, FpClassify, PortAudioRingBuffer, LAME,
QueenMaryDsp, Kaitai, MP3GuessEnc, RigtorpSPSCQueue]

def post_dependency_check_configure(self, build, conf):
Expand Down
Loading