Page 1 of 1

Freestyler .NET Wrapper Library

Posted: June 27th, 2014, 7:11 pm
by ewdieckman
I created a wrapper library for sequences and cues to use with a cue stacking program/plugin. I figured I would post it, in case anybody else is interested.

It reads in cue files (FCF) and generates .NET objects with those options. Currently the library only supports reading in files - no writing yet. I will post subsequent versions here.

Most of my development is for in-house apps - I have never sent stuff out in the wild before. So if you have any comments or suggestions (that are constructive - "Hey dude, this sucks" doesn't really help) to improve it, please let me know.

A generated .CHM help file is included for documentation. Thanks to mattotone for his FreeStylerConnection library.

Re: Freestyler .NET Wrapper Library

Posted: August 19th, 2014, 11:37 pm
by chriske
Hi! First of all thank you for sharing this!

I am very interested in your libary, although i don't completly understand it :D Maybe you have a little example to show us how it works? I would be happy to use your libary in my application!

Re: Freestyler .NET Wrapper Library

Posted: August 20th, 2014, 1:57 am
by ewdieckman
I'll use some examples from the Cue-ing program I wrote (called LiveCue). Let me know if this helps:

Code: Select all

        Dim cueF As FSCueFile = FSCueFile.LoadFCF("C:\FreeStyler\Cues\Songs N-Z\Slither Intro.fcf")

        Dim sequenceNumber As Int16 = 0
        Dim cue As FSCue


        For Each cue In cueF.Cues
            sequenceNumber = cueF.Cues.IndexOf(cue)
            Console.WriteLine(String.Format("Sequence {0} path: {1}", sequenceNumber, cue.Sequence.Path))
            Console.WriteLine(String.Format("Sequence {0} looped: {1}", sequenceNumber, cue.Loop))
            'etc - cue has all the properties available to the end user for a cue line (sequence) in a cue
        Next

        'you can either send the cue as-is, or manipulate values and then send to Freestyler

        'stop all sequences - in case there are sequences already running
        For sequenceNumber = FSConstants.FIRST_SEQUENCE_NUM To FSConstants.TOTAL_SEQUENCES_IN_CUE - 1
            FSCommandUtil.StopSequence(sequenceNumber )
        Next


        'loop thru and "load up" freestyler with the sequences from the .FCF file and set all options
        For Each cue In cueF.Cues
            If cue IsNot Nothing Then
                sequenceNumber = cueF.Cues.IndexOf(cue)

                'load cue into FreeStyler
                FSCommandUtil.LoadCue(cue.SequenceLoadCommand(sequenceNumber))

                'set cue options
                FSCommandUtil.LoadCueOptions(cue.SequenceOptionsCommand(sequenceNumber))

                'set cue speed
                FSCommandUtil.SetCueSpeed(sequenceNumber, cue.SpeedCommand)
            End If

        Next
       

        'loop through all sequences - if a cue exists, start it.  
        For sequenceNumber = FSConstants.FIRST_SEQUENCE_NUM To FSConstants.TOTAL_SEQUENCES_IN_CUE - 1

            If sequenceNumber < cueF.Cues.Count Then
                cue = cueF.Cues(sequenceNumber)
                If cue IsNot Nothing Then
                    'send the command to freestyler to play the sequence
                    FSCommandUtil.PlaySequence(sequenceNumber)

                End If
            End If
        Next
Let me know if that's enough to get you started.