bitfocus / companion-module-renewedvision-pvp

MIT License
1 stars 2 forks source link

Add support for selecting transitions and transition options #1

Closed chrisrouse closed 5 years ago

chrisrouse commented 5 years ago

Full transition documentation can be found on my PasteBin account: https://pastebin.com/cVdFuvrW

PVP supports transitions set per layer or globally, and these transitions can be selected via the API.

Transitions are a more complicated curl string than the rest of the commands that are currently available. Rather than being a single line command, these are more complex.

Below is the Color Burn transition:

curl -XPOST -H "Content-type: application/json" -d '{
      "transition" : {
        "variables" : [
          {
            "type" : "Color",
            "base" : {
              "name" : "Burn Color",
              "color" : "#6C6C6C"
            }
          }
        ],
        "enabled" : false,
        "name" : "Color Burn",
        "uuid" : "2B855B65-6ABC-4F65-8198-A19A5EF97821"
      }
    }' 'http://localhost:8080/api/0/transition/workspace'

curl -XPOST -H "Content-type: application/json" -d '{
    "value" : 1.0
}' 'http://localhost:8080/api/0/transitionDuration/layer/0'

There are several pieces of data that must be changed in each effect. Universally, the URLs at the bottom of the transition options must be defined.

The user can apply a transition to a layer or to the global workspace. Use http://localhost:8080/api/0/transition/workspace for the workspace and http://localhost:8080/api/0/transition/layer/# for a specific layer, replacing the # with the index number for the layer.

For Color Burn, the user must also define the color using a hex value. The # is not required for the hex value. The user must also define the "value", which is the duration of the transition. This is anything from 0 to 5.

Other transitions are more complex and include a directional value, just as Zoom In.

"Zoom In" Available directions: (1) Top Left; (2) Top; (4) Top Right; (8)Left; (16) Center; (32) Right; (64) Bottom Left; (128) Bottom; (256) Bottom Right.

curl -XPOST -H "Content-type: application/json" -d '{
      "transition" : {
        "variables" : [
          {
            "type" : "Direction",
            "base" : {
              "name" : "Direction",
              "direction" : 1,
              "availableDirections" : [
                1,
                2,
                4,
                8,
                16,
                32,
                64,
                128,
                256
              ]
            }
          }
        ],
        "enabled" : false,
        "name" : "Zoom In",
        "uuid" : "928B442C-4912-42F6-B526-60921E0F0D40"
      }
    }' 'http://localhost:8080/api/0/transition/workspace'

curl -XPOST -H "Content-type: application/json" -d '{
    "value" : 1.0
}' 'http://localhost:8080/api/0/transitionDuration/workspace'

The user must choose which direction they want to use from the available directions library and replace it in the "direction" value above.

There is a lot of extraneous data as part of the default curls that are sent. I have not taken the time to go through them to see what can be removed without impacting the performance.

chrisrouse commented 5 years ago

Moved to main project issues.