QML: encoder.is_turned
Comments
-
What's the code you are using for live deck play button look like?
0 -
Wire { enabled: active && deckType == DeckType.Live; from: "%surface%.play"; to: ButtonScriptAdapter { onPress: play_pause() } }
0 -
Try this:
Wire { enabled: active && deckType == DeckType.Live; from: "%surface%.play"; to: ButtonScriptAdapter { brightness: 0.0; onPress: play_pause() } }
Brightness can be any value between 0 and 1. You can use any numeric variable (including booleans) in place of the number, like for example ' brightness: deckPlayingProp.value '. If you use it on a button with several RGB values available, you can also add in for example ' color: "Blue"; '.
0 -
Thanks, will try!
2 more questions... can I use the brightness parameter in my scripts? And what's the approach for sharing data between qml files (say between deck.qml and transportButtons.qml. Are there global variables I can declare or is there a better way?
0 -
If you are sharing data in the form of variables, you can do it like this:
S3deck.qml
Module { id: module property bool active: false property bool shift: false property string surface: "" property int deckIdx: 0 ... //------------------------------------SUBMODULES------------------------------------------// S3Transport { name: "transport" surface: module.surface deckIdx: module.deckIdx active: module.active shift: module.shift }
S3Transport.qml
Module { id: module property string surface: "" // e.g. "s4mk3.left" property int deckIdx: 0 // Traktor deck 1..4 property bool active: false property bool shift: false ...
You can also use Traktor's global variables and assign their values as well as manipulate them locally like this:
AppProperty { id: deckPlayingProp; path: "app.traktor.decks." + deckIdx + ".play"; }
and in a different module you can define it (if you like) with a different name, pointing to the same global variable.
AppProperty { id: deckPlayingDifferent; path: "app.traktor.decks." + deckIdx + ".play"; }
Then you can use 'deckPlayingProp.value ' or 'deckPlayingDifferent.value ' directly somewhat like a pointer.
0 -
No idea about brightness in scripts. But you can use boolean logic instead of the number, like this:
brightness: hideBottomPanel.value ? 0.0 : 1.0
0 -
How did it go?
0 -
Didn't have a chance to test it yet. Will let you know. Thanks!
0 -
@Sûlherokhh finally had a chance to try it and it seems to be working. Thanks!
1
Categories
- All Categories
- 19 Welcome
- 1.3K Hangout
- 59 NI News
- 706 Tech Talks
- 3.6K Native Access
- 15.2K Komplete
- 1.8K Komplete General
- 4K Komplete Kontrol
- 5.2K Kontakt
- 1.5K Reaktor
- 354 Battery 4
- 783 Guitar Rig & FX
- 403 Massive X & Synths
- 1.1K Other Software & Hardware
- 5.2K Maschine
- 6.7K Traktor
- 6.7K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators