Can I do this....

Calling the great script gurus…

I’m planning to write a couple of scripts, the first one I have no worries with but number 2:-

  1. In conjunction with CAD’s IVP, but after setting the endtypes (O or U) and Outro points etc, then before you run the IVP script, run this script to give you an estimated recalculated duration of the show. This will allow you to tweak before the IVP is run.

This I think i can handle fine.

  1. A Segue preview. - Basically select a song and then run a script that will then play the last x seconds, segue to the next event etc. Now, looking through the help file with all the class types and stuff, I can’t find a “Set position”. I think I can cheat it by a "read cue in, store. Set new temp cue in, play from this new mark. After play, restore old cue in to playlist.

Any better thoughts?

Thanks, Richard

  1. You can just use CurrentPlaylist.GetDuration, that will be the total duration with all segues included (subtracted).

  2. Unfortunately, scripts cannot determine which item is currently selected in the playlist GUI. mAirList’s architecture is pretty similar to the model-view-controller pattern. The non-visual control classes are separated from the GUI classes, and scripts can only access the non-visual part so far. (That’s also because scripts run in a background thread sometimes, and the VCL is not thread-safe.) But I’m sure I will find a way to make this information available to scripts.

Basically, you would just create a new Container item through the Factory, add a copy of the two items to its playlist, adjust the copies as needed, and then use the BuildSource method to create an IAudioSource object. You need to pass the desired audio device (and region audio devices) to BuildSource. These can e.g. be accessed through the the audio device configuration (Instance.GetDeviceConfig), and the BuildDevice and BuildRegionDevices methods. Once the IAudioSource is set up, you can use SetPosition and Play to listen to the segue - then Sleep() for a while and use Stop to stop playback.

I can write you some sample code later.

I think that won’t take into account any outro/play next cues that will be altered when I run the IVP script. I frequently run the script, realise I’m too heavy or light, reload my original playlist, tweak again etc etc. I don’t think it will too hard!

[quote=“Torben, post:2, topic:6569”]2) Unfortunately, scripts cannot determine which item is currently selected in the playlist GUI. mAirList’s architecture is pretty similar to the model-view-controller pattern. The non-visual control classes are separated from the GUI classes, and scripts can only access the non-visual part so far. (That’s also because scripts run in a background thread sometimes, and the VCL is not thread-safe.) But I’m sure I will find a way to make this information available to scripts.

Basically, you would just create a new Container item through the Factory, add a copy of the two items to its playlist, adjust the copies as needed, and then use the BuildSource method to create an IAudioSource object. You need to pass the desired audio device (and region audio devices) to BuildSource. These can e.g. be accessed through the the audio device configuration (Instance.GetDeviceConfig), and the BuildDevice and BuildRegionDevices methods. Once the IAudioSource is set up, you can use SetPosition and Play to listen to the segue - then Sleep() for a while and use Stop to stop playback.

I can write you some sample code later.[/quote]

Thanks, but don’t worry about sample code. It looks a bit more than anticipated so it’s one of those “if I get time” moments!

Much appreciated.

I think that won’t take into account any outro/play next cues that will be altered when I run the IVP script.[/quote]
Um … after you’ve run IVP, if you do a CurrentPlaylist.GetDuration, it definitely SHOULD show the correct duration!

Also, though it’s not precisely what you wanted for a segue preview, I take it you do know that in any Playlist, you can select two or more adjacent items (Shift+click or Ctrl+click), then right-click, click PFL, and preview the tracks and segues in the PFL player? Sure, you need to move the position slider, but it does work.

Hope that helps, Richard.

BFN
CAD

I’m sure it does, but I want to see what the running time would be before I run the IVP script so I can adjust timings accordingly

Ah, I didn’t know that. There is more to this software than I thought.

I’ve just quickly written a script that can swap out an item (for versioning purposes) using a swap attribute. Need to tidy it up and test it more.

Thanks, Richard

Um … why not just look at that nice big box at the right-hand end of the Playlist toolbar after you load your playlist? That will show you the playlist duration: or am I missing something? :wink:
(And yes, it DOES take StartNext etc. into account: try changing a cue point in a playlist item!)

As you said yourself, there’s a LOT more to mAirList than meets the eye. ;D

BFN
CAD