/// <summary>
        /// Returns true if the shot is currently live
        /// false otherwise
        /// </summary>
        public bool IsShotIDLive(int shotID)
        {
            object shot   = GetShotWithID(shotID);
            int    result = (int)Late.Invoke(shot, "Live");

            return(result == 1);
        }
        /// <summary>
        /// Returns true if the shot is currently in preview
        /// false otherwise
        /// </summary>
        public bool IsShotIDInPreview(int shotID)
        {
            object shot   = GetShotWithID(shotID);
            int    result = (int)Late.Invoke(shot, "Preview");

            return(result == 1);
        }
        public bool IsShotNameLive(string name)
        {
            object shot   = GetShotWithName(name);
            int    result = (int)Late.Invoke(shot, "Live");

            return(result == 1);
        }
        /// <summary>
        /// Returns true if the shot is a Playlist Shot
        /// false otherwise
        /// </summary>
        public bool IsPlaylistByShotID(int shotID)
        {
            object shot   = GetShotWithID(shotID);
            int    result = (int)Late.Invoke(shot, "Playlist");

            return(result == 1);
        }
        public bool IsPlaylistByShotName(string name)
        {
            object shot   = GetShotWithName(name);
            int    result = (int)Late.Invoke(shot, "Playlist");

            return(result == 1);
        }
        /// <summary>
        /// Returns the total number of shots in the document
        /// </summary>
        public int GetTotalShotCount()
        {
            int totalLayers    = GetMasterLayerCount();
            int totalShotCount = 0;

            for (int i = 0; i < totalLayers; i++)
            {
                totalShotCount += (int)Late.Invoke(i, "ShotCount");
            }

            return(totalShotCount);
        }
        /// <summary>
        /// Change the internal selected layer of the binding object
        /// All future calls to layer related APIs will be use this new layer
        /// </summary>
        public bool SwitchLayer(int index)
        {
            bool   hasLayer  = false;
            string layerName = LayerIndexToName(index);

            if (layerName != "")
            {
                _SelectedLayer      = Late.Invoke(_Document, "LayerByName", layerName);
                _SelectedLayerIndex = index;
                hasLayer            = true;
            }

            return(hasLayer);
        }
        /// <summary>
        /// Switches the internal document of the binding object to the new one
        /// The seletec layer of the new document will be the same as the previous document
        /// So if the selected layer was "text"/1, then that is the selected layer of the new document
        /// All future call to the Document and Layer API will apply to the new document
        /// </summary>
        public bool SwitchDocument(int index)
        {
            bool   validDoc    = false;
            object newDocument = Late.Invoke(_Wirecast, "DocumentByIndex", index);

            if (newDocument != null)
            {
                _Document = newDocument;
                validDoc  = true;

                //  After Change the Document, we need to update the layer
                SwitchLayer(3);
            }

            return(validDoc);
        }
        /// <summary>
        /// Same as SwitchDocument with an index except indead of a document index, use the document name
        /// </summary>
        public bool SwitchDocument(string docName)
        {
            bool   validDoc    = false;
            object newDocument = Late.Invoke(_Wirecast, "DocumentByName", docName);

            if (newDocument != null)
            {
                _Document = newDocument;
                validDoc  = true;

                //  After Change the Document, we need to update the layer
                SwitchLayer(_SelectedLayerIndex); // 3 is the "normal" layer
            }

            return(validDoc);
        }
 public void StartBroadcast()
 {
     Late.Invoke(_Document, "Broadcast", "start");
 }
 public void StopBroadcast()
 {
     Late.Invoke(_Document, "Broadcast", "stop");
 }
        /// <summary>
        /// Returns whether or not the current document is recording to disk
        /// </summary>
        public bool IsRecording()
        {
            int isRecording = (int)Late.Invoke(_Document, "IsArchivingToDisk");

            return(isRecording == 1);
        }
        /// <summary>
        /// Returns the shot info of the shot currently live, in the currently selected layer
        /// </summary>
        public int GetLiveShotID()
        {
            int shotID = (int)Late.Invoke(_SelectedLayer, "LiveShotID");

            return(shotID);
        }
        /// <summary>
        /// Returns the shot info of the shot currently in preview, of the currently selected layer
        /// The shot in preview is equivilent to the active shot
        /// </summary>
        public int GetPreviewShotID()
        {
            int shotID = (int)Late.Invoke(_SelectedLayer, "PreviewShotID");

            return(shotID);
        }
 /// <summary>
 /// Makes the active shot of the selected layer go live
 /// </summary>
 public void Go()
 {
     Late.Invoke(_SelectedLayer, "Go");
 }
 public void StopRecording()
 {
     Late.Invoke(_Document, "ArchiveToDisk", "stop");
 }
        /// <summary>
        /// Creates a new shot with the asset located in the given path and adds it to the currently selected layer
        /// </summary>
        public int AddShotWithMedia(string path)
        {
            int shotID = (int)Late.Invoke(_SelectedLayer, "AddShotWithMedia", path);

            return(shotID);
        }
        /// <summary>
        /// Tells the input Playlist Shot to transition to the previous shot
        /// </summary>
        public void PreviousShotByShotID(int shotID)
        {
            object shot = GetShotWithID(shotID);

            Late.Invoke(shot, "PreviousShot");
        }
        /// <summary>
        /// Tells the input Playlist Shot to transition to the next shot
        /// </summary>
        public void NextShotByShotID(int shotID)
        {
            object shot = GetShotWithID(shotID);

            Late.Invoke(shot, "NextShot");
        }
        /// <summary>
        /// Returns the ShotID for the index within the selected layer
        /// The index is Zero based and from left to right in the layer
        /// </summary>
        public int GetShotIDByIndex(int index)
        {
            int shotID = (int)Late.Invoke(_SelectedLayer, "ShotIDByIndex", index);

            return(shotID);
        }
        /// <summary>
        /// Returns the ShotID for associated with the Shot name
        /// The name is the text under the shot in the Shot bin
        /// </summary>
        public int GetShotIDByName(string name)
        {
            int shotID = (int)Late.Invoke(_SelectedLayer, "ShotIDByName", name, 2);

            return(shotID);
        }
        /// <summary>
        /// Return whether or not the current document is broadcasting a stream
        /// </summary>
        public bool IsBroadcasting()
        {
            int isBroadcasting = (int)Late.Invoke(_Document, "IsBroadcasting");

            return(isBroadcasting == 1);
        }
 /// <summary>
 /// Removes the shot with the given ID from the currently selected layer
 /// Does nothing if the shot ID is invalid or not associated with any shots in the currently selected layer
 /// </summary>
 public void RemoveShotWithID(int shotID)
 {
     Late.Invoke(_SelectedLayer, "RemoveShotByID", shotID);
 }
 /// <summary>
 /// Returns the Shot COM object for the shotID
 /// Usually would not need to call this method directly
 ///
 /// Returns null if there are no shots assoicated witht he shotID
 /// </summary>
 public object GetShotWithID(int shotID)
 {
     return(Late.Invoke(_Document, "ShotByShotID", shotID));
 }
        /// <summary>
        /// Returns the total umber of shots in the selected layer
        /// To change which layer to count the shots in, use switch layers
        /// To get the total number of shots in the document, use GetTotalShotCount
        /// </summary>
        public int GetShotCount()
        {
            int shotCount = (int)Late.Invoke(_SelectedLayer, "ShotCount");

            return(shotCount);
        }
        public void NextShotByShotName(string name)
        {
            object shot = GetShotWithName(name);

            Late.Invoke(shot, "NextShot");
        }
 /// <summary>
 /// Takes a snapshot still image of the current output and saves it as a JPEG to the given path
 /// </summary>
 public void SaveSnapshot(string path)
 {
     Late.Invoke(_Document, "SaveSnapshot", path);
 }
        public void PreviousShotByShotName(string name)
        {
            object shot = GetShotWithName(name);

            Late.Invoke(shot, "PreviousShot");
        }
 /// <summary>
 /// Remove the media asset at the given path from Wirecast
 /// The path is not the shot name, but the actual media location on disk
 /// </summary>
 public void RemoveMedia(string path)
 {
     Late.Invoke(_Document, "RemoveMedia", path);
 }