Preview mode warning (Pro Tools)
Hello, it would be great if you would get a warning that stays on the screen when you're in preview mode an disapears when you're out. Would be great if it would be a floating window that is draggable and resizeable, so you could put it on a prefered position on your screen.
It would save me a lot of useless passes because I was still in preview...
Linked from:
- LLucas Frisch @Lucas_Frisch
Hey !
I m really not a java script guy but i really like the idea and i m trying to figure something out by searching bits of code...
I have some trouble and maybe some more advance coding people could help me out.My idea is to display a big surface green or red if preview is on or off ( i tried on the mac but it makes pro tools display buggy so i going my telephone route for now.)
my first problem is this :
this works :
sf.ui.proTools.appActivateMainWindow(); //Button var previewAutomationBtn = sf.ui.proTools.automationWindow.buttons.whoseTitle.is('Enable Auto Preview Mode').first; //Check if button is enabled if (previewAutomationBtn.invalidate().value.value == "Selected") { sf.surfaces.get('user:cl1tm5xan000cng10ohmfnl97:cl1tm65u1000dng10tv58qn5w').open({ device: sf.devices.mobile.getByDeviceId('mobile.25bbc8803fdd3389--Galaxy-S9-de-Lucas'), }); } else { log("Automation Preview is not enabled"); };
but this doesn't :
sf.ui.proTools.appActivateMainWindow(); //Button var previewAutomationBtn = sf.ui.proTools.automationWindow.buttons.whoseTitle.is('Enable Auto Preview Mode').first; //Check if button is enabled if (previewAutomationBtn.invalidate().value.value == "Selected") { sf.surfaces.get('user:cl1tm5xan000cng10ohmfnl97:cl1tm65u1000dng10tv58qn5w').open({ device: sf.devices.mobile.getByDeviceId('mobile.25bbc8803fdd3389--Galaxy-S9-de-Lucas'), }); } else { sf.surfaces.get('user:cl1tm5xan000cng10ohmfnl97:cl1tmex7x000lng109pifex9x').open({ device: sf.devices.mobile.getByDeviceId('mobile.25bbc8803fdd3389--Galaxy-S9-de-Lucas'), });
I suppect it's coding basics but that where i am at..
for now my the script is set to an application trigger but is there a way to SF to monitor the preview state constantly? without making everything buggy or slow obviously?
- In reply toErik_Griekspoor⬆:Erik Griekspoor @Erik_Griekspoor
Wow great! I can’t do coding unfortunately.. Would be even better if it turns orange when in preview suspend, but I dont want to push 😉
- MIn reply toErik_Griekspoor⬆:Martin Pavey @Martin_Pavey
This is something I'd really be interested in too.
Is there a way to get Soundflow to flash a button on a streamdeck or surface?
I have 2 commands/Streamdeck buttons I use for entering preview and then writing to selection.
One could switch on the flashing and the write command could switch it off?
Maybe a notification would work or just opening a graphic and then closing it.
'It would save me a lot of useless passes because I was still in preview...'
I feel your pain Erik. ;-) - LIn reply toErik_Griekspoor⬆:Lucas Frisch @Lucas_Frisch
Thanks for your interest Martin,
I think i m pretty close to have something working with the script above , but we need some javascript guru to helps us..,i ll try to post on the script help forum and maybe we ll have more luck..
- CIn reply toErik_Griekspoor⬆:Chris Stangroom @Chris_Stangroom
After having been diving into this for more time today than I really wanted to, the hardest thing to figure out so far in Javascript is how to find the status of sf.ui.proTools.automationPreview. I have tried invalidate, but that does not seem to be a recognized action.
Chad Wahlbrink @Chad2024-10-22 18:04:03.720Z
Hi, @Chris_Stangroom (and others!),
Monitoring on/off states is tricky, so SoundFlow generally does not support dynamic button states for standard SoundFlow scripts and Macros. You can read more about this here:
However, to get dynamic states of the Automation Window and, specifically, Preview Mode in SoundFlow, you can get the Pro Tools Automation Package. This package is a premium app, so it's a one-time $19 cost to add the functionality to SoundFlow.
Here's a video of that app in action:
- In reply toChris_Stangroom⬆:
Chad Wahlbrink @Chad2024-10-22 18:07:14.711Z
Also, note if you are just trying to react to whether Preview is enabled, you can use something like this:
if(sf.ui.proTools.automationWindow.buttons.whoseTitle.is("Enable Auto Preview Mode").first.value.value === 'Selected'){ log('Preview is Enabled') } else if (sf.ui.proTools.automationWindow.buttons.whoseTitle.is("Enable Auto Preview Mode").first.value.value === ''){ log('Preview is Disabled') }
When enabled,
sf.ui.proTools.automationWindow.buttons.whoseTitle.is("Enable Auto Preview Mode").first.value.value
will returnSelected
.
- CIn reply toErik_Griekspoor⬆:Chris Stangroom @Chris_Stangroom
Thanks for this, Chad. I like to build Surfaces for my workflow so I'm curious if items from the Automation Package can be added to one of my Surfaces and still reflect the automation state. Thanks!
Chad Wahlbrink @Chad2024-10-23 17:08:49.994Z
No problem, @Chris_Stangroom.
The commands in the Pro Tools Automation Package are meta commands, which means they can be added to any deck and displayed on iOS and Android devices.
I don't believe it's possible to add a meta command to a surface at the moment, but that's a great idea. If you'd like to see that functionality added to SoundFlow, you can log it in the Ideas section of the forum for future consideration.
- OIn reply toErik_Griekspoor⬆:Owen Granich-Young @Owen_Granich_Young
You need to get this app https://apps.apple.com/us/app/overlays/id868499627?mt=12 - the fucntion basically quits and opens this app depending on Preview status. Run script to start the run forever, run script again to stop the run forever.
let lastPreviewStatus; globalState.runAutoFollowOutputWin = !globalState.runAutoFollowOutputWin; function main() { // Get current state of Automation Window const isClipListEnabled = sf.ui.proTools.getMenuItem("Window", "Automation").isMenuChecked // Open Automation Window if It's not if (!isClipListEnabled) { sf.ui.proTools.menuClick({ menuPath: ["Window", "Automation"], }); } try { const automationWindow = sf.ui.proTools.automationWindow.invalidate(); if (automationWindow) { // Check the status of the "Enable Auto Preview Mode" button let previewStatus = sf.ui.proTools.automationWindow.buttons .whoseTitle.is("Enable Auto Preview Mode") .first.value.value; if (previewStatus === lastPreviewStatus || previewStatus === undefined) return; lastPreviewStatus = previewStatus; // Log based on the status of the preview button if (previewStatus === 'Selected') { /* log("Preview is on!") */ sf.app.launch({ path: '/Applications/Overlays!.app' }); } else if (previewStatus === '') { /* log("Preview is off!") */ sf.ui.app('es.abbiecod.overlays').appQuit({ onError: "Continue" }); } } } catch (err) { /* log('Error: ' + err.message); */ } } function runForever(name, action, interval, timeout) { sf.ui.proTools.appActivate(); sf.ui.proTools.invalidate(); log('Preview Warning Activated') let now = (new Date).valueOf(); if (now - globalState[name] < timeout) throw 0; // Exit if we were invoked again inside the timeout globalState[name] = now; sf.engine.runInBackground(function () { try { while (true && globalState.runAutoFollowOutputWin) { sf.engine.checkForCancellation(); globalState[name] = (new Date).valueOf(); action(); sf.wait({ intervalMs: interval, executionMode: 'Background' }); } } finally { globalState[name] = null; log('Preview Warning Deactivated') } }); } // Start the runForever process runForever("isFollowPreviewStatusRunning", main, 500, 5000);