Beispiel #1
0
    public static void Run(string effectIdentifier, double hue = 0, double saturation = 255, double brightness = 255)
    {
        ProPhotoColor      color  = HsvToRgb(hue, saturation / 255, brightness / 255);
        SolidColor2DEffect effect = (SolidColor2DEffect)ContentObjectAccessor.GetObject(effectIdentifier);

        effect.Value = color;
    }
    public static void Run(string sequenceId, int cueNum)
    {
        Sequence sequence = (Sequence)ContentObjectAccessor.GetObject(sequenceId);
        string   cueId    = String.Format("{0}.Cue_{1}", sequenceId, cueNum.ToString());

        Logger.Info(String.Format("GotoCue: {0}", cueId));
        Cue cue = (Cue)ContentObjectAccessor.GetObject(cueId);

        sequence.StartCue(cue);
    }
    public static void Run(string sequenceId)
    {
        Sequence sequence      = (Sequence)ContentObjectAccessor.GetObject(sequenceId);
        int      playbackState = (int)sequence.PlaybackState;

        Logger.Info(playbackState.ToString());
        if (playbackState == 0)
        {
            sequence.Start();
        }
        else
        {
            sequence.GoToNextCue();
        }
    }
    public static void Run(string identifier, string bgColor = "#FF444444", string borderColor = "#FF888888", string textColor = "#FFFFFFFF", string text = "", bool bold = false, bool italic = false)
    {
        ProPhotoGradient RgbGradient = new ProPhotoGradient(new ProPhotoColor[1]
        {
            new ProPhotoColor(bgColor),
        });
        ActionPadButtonControl button = (ActionPadButtonControl)ContentObjectAccessor.GetObject(identifier);

        button.BorderColor             = new ProPhotoColor(borderColor);
        button.ActiveTextColor         = new ProPhotoColor(textColor);
        button.InactiveTextColor       = new ProPhotoColor(textColor);
        button.InactiveBackgroundColor = RgbGradient;
        button.ActiveBackgroundColor   = RgbGradient;
        button.ButtonText = text;
        button.ItalicText = italic;
        button.BoldText   = bold;
    }
    public static void handleSequenceCommands(string[] commandParts)
    {
        if (commandParts.Length < 3)
        {
            Logger.Error("Invalid sequence command received.\n Format must be '/sequence/<sequence_id>/<start, stop, continue, or pause>'\n Sequence IDs are case sensitive");
            return;
        }

        string sequenceId = commandParts[2];

        try {
            Sequence sequence = (Sequence)ContentObjectAccessor.GetObject(sequenceId);

            switch (commandParts[3].ToLower())
            {
            case "start":
                sequence.Start();
                break;

            case "stop":
                sequence.Stop();
                break;

            case "pause":
                sequence.Pause();
                break;

            case "continue":
                sequence.Continue();
                break;

            case "level":
                handleSequenceLevelCommand(sequence, commandParts);
                break;

            default:
                Logger.Error("Invalid sequence command received.\n Format must be '/sequence/<sequence_id>/<start, stop, continue, or pause>'\n Sequence IDs are case sensitive");
                break;
            }
        } catch (Exception e) {
            Logger.Error(string.Format("Sequence '{0}' does not exist", sequenceId));
            Logger.Error(e.ToString());
        }
    }
    public static void handleGrandmasterLevelCommand(string[] commandParts)
    {
        if (commandParts.Length < 2)
        {
            Logger.Error("Grandmaster level must be specified");
            return;
        }
        float level = float.Parse(commandParts[2]);

        // I added this to ensure opacity level is between 0 and 100.
        if (level < 0 || level > 100)
        {
            Logger.Error("Invalid level command received.\n Level must be between 0 and 100\n ");
            return;
        }

        try {
            ShowInformation showInformation = (ShowInformation)ContentObjectAccessor.GetObject("ShowInformation");
            showInformation.Opacity = level;
        } catch (Exception e) {
            Logger.Error("Failed to set grandmaster level");
        }
    }
    public static void Run(string id)
    {
        Sequence sequence = (Sequence)ContentObjectAccessor.GetObject(id);

        sequence.Pause();
    }
Beispiel #8
0
    public static void Run(string id, double angle)
    {
        ColorEffect2DSequenceItem layer = (ColorEffect2DSequenceItem)ContentObjectAccessor.GetObject(id);

        layer.Angle = -angle / 360 * TWO_PI;
    }
Beispiel #9
0
    public static void Run(string id, string text = "")
    {
        ScrollTextEffect scrollText = (ScrollTextEffect)ContentObjectAccessor.GetObject(id);

        scrollText.Text = text;
    }