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 legacy controller system to QJSEngine #2682

Merged
merged 169 commits into from
Jun 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
169 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
9b658d1
Merge branch 'master' of github.com:mixxxdj/mixxx into migrate-to-QJS…
Holzhaus Apr 9, 2020
863b59c
Merge branch 'migrate-to-QJSEngine' of https://github.com/ferranpujol…
Holzhaus Apr 18, 2020
e5984a6
Merge branch 'master' of github.com:mixxxdj/mixxx into migrate-to-QJS…
Holzhaus Apr 18, 2020
a99fd38
ColorMapper(JSProxy): port to QJSEngine/QJSValue API
Be-ing Apr 19, 2020
7949bc6
MidiControllerPreset/HidControllerPreset: add missing 'override's
Be-ing Apr 19, 2020
7e47924
Merge remote-tracking branch 'upstream/master' into migrate-to-QJSEngine
Be-ing Apr 19, 2020
b65729e
ControllerMapperJSProxyTest: remove tests we can't test anymore
Be-ing Apr 19, 2020
bfbed64
ControllerMapperJSProxy: prevent segfault with default constructor
Be-ing Apr 19, 2020
2aa0433
controllers: allow scripts to work without XML mappings
Be-ing Apr 19, 2020
2068ce6
MidiControllerTest: fix segfault
Be-ing Apr 19, 2020
5b6bea1
ColorMapperJSProxy: remove hack for string-indexed maps
Be-ing Apr 19, 2020
44f11ef
Merge remote-tracking branch 'upstream/master' into migrate-to-QJSEngine
Be-ing Apr 22, 2020
082908f
Merge remote-tracking branch 'upstream/master' into migrate-to-QJSEngine
Be-ing Apr 25, 2020
3970b4e
Revert "controllers: allow scripts to work without XML mappings"
Be-ing Apr 25, 2020
00feedc
Merge remote-tracking branch 'upstream/master' into migrate-to-QJSEngine
Be-ing May 7, 2020
4b297dd
Roland DJ 505: use Function.prototype.bind for QJSEngine
Be-ing May 7, 2020
cb3c6f0
Merge remote-tracking branch 'upstream/master' into migrate-to-QJSEngine
Be-ing May 12, 2020
1cbcaf7
Merge remote-tracking branch 'upstream/master' into migrate-to-QJSEngine
Be-ing May 19, 2020
e1896f8
Merge remote-tracking branch 'upstream/master' into migrate-to-QJSEngine
Be-ing May 20, 2020
3130882
controllers: assorted code cleanup
Be-ing May 22, 2020
4b43d25
ControllerEngine: assorted code cleanup
Be-ing May 22, 2020
ec1d9aa
remove "controller engine version" concept
Be-ing May 22, 2020
68b6330
move ScriptConnection & ScriptConnectionJSProxy to their own files
Be-ing May 22, 2020
98bc040
ControllerEngine: cleaup comments and code formatting
Be-ing May 22, 2020
18aaec7
ControllerEngine: reorganize method order
Be-ing May 22, 2020
1b777b6
disable JS JIT compilation for Qt >= 5.14.0 to work around Qt bug
Be-ing May 27, 2020
4af2051
Merge remote-tracking branch 'upstream/master' into migrate-to-QJSEngine
Be-ing May 27, 2020
214ae8e
fix SCons build
Be-ing May 20, 2020
ec51aff
Merge remote-tracking branch 'upstream/master' into migrate-to-QJSEngine
Be-ing May 27, 2020
ccbe088
DlgPrefController: break long line
Be-ing May 27, 2020
48952ad
disable QV4_FORCE_INTERPRETER for Qt 5.15.1
Be-ing May 28, 2020
ca1e353
Merge remote-tracking branch 'upstream/master' into migrate-to-QJSEngine
Be-ing May 28, 2020
469eda7
fix disconnection of ScriptConnectionJSProxy by connectControl
Be-ing May 28, 2020
91bc471
try to fix Hss1394Controller build
Be-ing May 28, 2020
ada0929
Merge remote-tracking branch 'upstream/master' into migrate-to-QJSEngine
Be-ing Jun 6, 2020
d596ded
ColorMapper: fixes from PR #2733
Be-ing Jun 6, 2020
6e96bdb
Components: fix HotcueButton color output
Be-ing Jun 13, 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
Prev Previous commit
Next Next commit
Revert renaming of send(QByteArray) to sendByteArray
  • Loading branch information
ferranpujolcamins committed Nov 29, 2018
commit 11c7508c336f6e06ef9fbdf3801ba7f00da33f44
4 changes: 2 additions & 2 deletions src/controllers/bulk/bulkcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ void BulkController::send(QList<int> data, unsigned int length) {
foreach (int datum, data) {
temp.append(datum);
}
sendByteArray(temp);
send(temp);
}

void BulkController::sendByteArray(QByteArray data) {
void BulkController::send(QByteArray data) {
int ret;
int transferred;

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/bulk/bulkcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class BulkController : public Controller {
private:
// For devices which only support a single report, reportID must be set to
// 0x0.
void sendByteArray(QByteArray data) override;
void send(QByteArray data) override;

// Returns a pointer to the currently loaded controller preset. For internal
// use only.
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void Controller::send(QList<int> data, unsigned int length) {
for (unsigned int i = 0; i < length; ++i) {
msg[i] = data.at(i);
}
sendByteArray(msg);
send(msg);
}

void Controller::triggerActivity()
Expand Down
8 changes: 4 additions & 4 deletions src/controllers/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ class Controller : public QObject, ConstControllerPresetVisitor {
// were required to specify it.
virtual void send(QList<int> data, unsigned int length = 0);

// This must be reimplemented by sub-classes desiring to send raw bytes to a
// controller.
virtual void send(QByteArray data) = 0;

// To be called in sub-class' open() functions after opening the device but
// before starting any input polling/processing.
void startEngine();
Expand Down Expand Up @@ -146,10 +150,6 @@ class Controller : public QObject, ConstControllerPresetVisitor {
}

private:
// This must be reimplemented by sub-classes desiring to send raw bytes to a
// controller.
virtual void sendByteArray(QByteArray data) = 0;

// Returns a pointer to the currently loaded controller preset. For internal
// use only.
virtual ControllerPreset* preset() = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/hid/hidcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void HidController::send(QList<int> data, unsigned int length, unsigned int repo
send(temp, reportID);
}

void HidController::sendByteArray(QByteArray data) {
void HidController::send(QByteArray data) {
send(data, 0);
}

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/hid/hidcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class HidController final : public Controller {
private:
// For devices which only support a single report, reportID must be set to
// 0x0.
void sendByteArray(QByteArray data) override;
void send(QByteArray data) override;
void virtual send(QByteArray data, unsigned int reportID);

// Returns a pointer to the currently loaded controller preset. For internal
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/midi/hss1394controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void Hss1394Controller::sendShortMsg(unsigned char status, unsigned char byte1,
//}
}

void Hss1394Controller::sendByteArray(QByteArray data) {
void Hss1394Controller::send(QByteArray data) {
int bytesSent = m_pChannel->SendChannelBytes(
(unsigned char*)data.constData(), data.size());

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/midi/hss1394controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Hss1394Controller : public MidiController {
private:
// The sysex data must already contain the start byte 0xf0 and the end byte
// 0xf7.
void sendByteArray(QByteArray data) override;
void send(QByteArray data) override;

hss1394::TNodeInfo m_deviceInfo;
int m_iDeviceIndex;
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/midi/portmidicontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void PortMidiController::sendShortMsg(unsigned char status, unsigned char byte1,
}
}

void PortMidiController::sendByteArray(QByteArray data) {
void PortMidiController::send(QByteArray data) {
// PortMidi does not receive a length argument for the buffer we provide to
// Pm_WriteSysEx. Instead, it scans for a MIDI_EOX byte to know when the
// message is over. If one is not provided, it will overflow the buffer and
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/midi/portmidicontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class PortMidiController : public MidiController {
private:
// The sysex data must already contain the start byte 0xf0 and the end byte
// 0xf7.
void sendByteArray(QByteArray data) override;
void send(QByteArray data) override;

bool isPolling() const override {
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/test/controller_preset_validation_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class FakeController : public Controller {
}

private:
void sendByteArray(QByteArray data) override {
void send(QByteArray data) override {
Q_UNUSED(data);
}
virtual void send(QByteArray data, unsigned int reportID) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/midicontrollertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MockMidiController : public MidiController {
MOCK_METHOD3(sendShortMsg, void(unsigned char status,
unsigned char byte1,
unsigned char byte2));
MOCK_METHOD1(sendByteArray, void(QByteArray data));
MOCK_METHOD1(send, void(QByteArray data));
MOCK_CONST_METHOD0(isPolling, bool());
};

Expand Down