Giter VIP home page Giter VIP logo

launchpadkit's Introduction

LaunchpadKit

Swift API for controlling Novation Launchpad.

Install

$ pod 'LaunchpadKit'

Build

$ pod install

API

LaunchpadManager

  • Singleton shared object.
  • Autoconnects launchpads.
  • Informs implementor with LaunchpadManagarDelegate
  func launchpadManagerSetupDidChange(_ launchpadManager: LaunchpadManager)
  func launchpadManager(_ launchpadManager: LaunchpadManager, didConnect launchpad: Launchpad)
  func launchpadManager(_ launchpadManager: LaunchpadManager, didDisconnect launchpad: Launchpad)
  func launchpadManager(_ launchpadManager: LaunchpadManager, launchpad: Launchpad, didPress button: LaunchpadButton)
  func launchpadManager(_ launchpadManager: LaunchpadManager, launchpad: Launchpad, didUnpress button: LaunchpadButton)
  • Can connect/disconnect launchpads manually
public func connect(launchpad: Launchpad)
public func disconnect(launchpad: Launchpad)
  • Can set colors of LaunchpadButtons
public func setLaunchpadButtonColor(
	_ launchpad: Launchpad,
	x: Int,
	y: Int,
	color: LaunchpadButton.Color,
	brightness: LaunchpadButton.Brightness
)

Launchpad

  • The launchpad object with grid of LaunchpadButtons.
  • Created by LaunchpadManager automatically when it detects an available launchpad.
  • Can get/set a button with [row: Int, column: Int] subscript.
// First button of the second row.
let button = launchpad[1, 0]
// Sets third button of first row.
launchpad[1, 2] = newButton
  • Can get all buttons in a row.
// get first row
let firstRow = launchpad[row: 0]
  • Can get all buttons in a column.
// get first column
let firstCol = launchpad[col: 0]
  • Can get sceneButtons.
  • Can get liveButtons.

LaunchpadButton

  • Created by Launchpad object initially on its grid array.
  • Has color and brightness properties.
  public enum Brightness: Int {
    case off
    case min
    case mid
    case max
  }

  public enum Color: Int {
    case green
    case red
    case yellow
    case amber
  }
  • You can read isPressed state.

launchpadkit's People

Contributors

cemolcay avatar kant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kant

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.