-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add groundwork for Controller COs #2884
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we register the controller as a midi clock consumer by a dedicated function in the JS API?
However we actually need such "controller specific namespace" for controller dependent skins and settings. Here the Pug And Play topic essential to match the stored preferences to the right controller after restart.
I think if we consider that in the group name as well it becomes a nice solution.
@@ -56,8 +57,13 @@ QList<Controller*> BulkEnumerator::queryDevices() { | |||
continue; | |||
} | |||
|
|||
// Generate a group for this controller | |||
QString group = QStringLiteral("[BulkController") + | |||
QString::number(index) + QStringLiteral("]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be just a QChar(']');
I think we could, but it should also be possible to sync from a midi device, and for that we also need all the other sync-related COs I think (e.g.
That's the hard part though. I have no idea how to match devices after a restart. Is this even possible with portaudio? We could use the device name, but would that work if I have 2 identical devices attached, e.g. 2 Allen & Heath Xone:K2's? |
Ah, now I understand. I did not consider the case where a user can switch between different external midi clocks. Does this actually exist? I don't know one. In this case I think it is better to have it more generic like [ExternalClock1] [ExternalClock2] This way we can build a GUI around it and the External clock sources like Albaton Link OSC and midi can subscribe to one of them. |
My first thought was the same as @daschuer that a JS API may be more appropriate for MIDI clock. I don't fully understand what you have in mind for the design of using MIDI clock, so it's difficult to understand where you are going with this. I think we should have a larger discussion about how MIDI clock should work in Mixxx so we know what it will require before proceeding with this. Also, let's not add any features to the legacy controller scripting system and only add new features when using JS modules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments.
Update: Ignore if this PR might become obsolete. I didn't notice.
m_bIsOutputDevice(false), | ||
m_bIsInputDevice(false), | ||
m_bIsOpen(false), | ||
m_bLearning(false) { | ||
m_userActivityInhibitTimer.start(); | ||
|
||
m_pReloadScripts = make_parented<ControlObject>(ConfigKey(group, "reload_scripts"), this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QStringLiteral("reload_scripts")
class ControllerJSProxy; | ||
|
||
class Controller : public QObject, ConstControllerPresetVisitor { | ||
Q_OBJECT | ||
public: | ||
Controller(); | ||
Controller(const QString& group); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explicit
Minor improvement: Since Controller is supposed to be an abstract base class we could reduce the visibility of the ctor from public to protected.
@@ -23,7 +23,7 @@ class FakeControllerJSProxy : public ControllerJSProxy { | |||
class FakeController : public Controller { | |||
Q_OBJECT | |||
public: | |||
FakeController(); | |||
FakeController(const QString& group); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explicit (although just a test class)
@@ -64,6 +66,10 @@ class Controller : public QObject, ConstControllerPresetVisitor { | |||
inline const QString& getCategory() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could remove all those redundant inline keywords while editing this file.
This PR is marked as stale because it has been open 90 days with no activity. |
Superseeded by #3703. I cherry picked some commits. |
This add a group attribute to each controller, so that we can create COs for each controller. This group is passed as third parameter to the script's
init
function, so that controller-specific COs can be access from the controller itself.Right now, this adds a
reload_scripts
CO for each controller. I know if this is actually useful, but in theory you could actually reload the controller script using a button press on the controller itself (although you should only need this if your controller script is buggy). I mostly implemented this as a Proof of Concept and can remove this if you want.The actual reason why I implemented this is because I really want to have MIDI Clock support at some point, and one prerequisite is controller-specific COs to toggle sync lock (and disable/enable MTC output). So if I press the SYNC button for the drum machine on my controller, it would then set
[PortMidiControllerN],sync_enabled
to 1 and Mixxx could start sending/receiving MIDI timing clock signals.