static string StateToNameOutput(LaunchpadProState state) { if (state == LaunchpadProState.AbletonLive) { return(StateToName(state)); } return("MIDIOUT" + (int)state + " " + StateToName(state)); }
static string StateToName(LaunchpadProState state) { if (state != LaunchpadProState.AbletonLive) { return("(Launchpad Pro)"); } return("LaunchpadPro"); }
/// <summary> /// get port based on the type of Launchpad /// </summary> /// <param name="state"></param> /// <returns></returns> public static int getPort(LaunchpadProState state) { return(MidiInput.FindPort("Launchpad Pro " + (int)state)); }
/// <summary> /// Get Output port based on the type of Launchpad pro state /// </summary> /// <param name="state"> the type of port to look for in the launchpad pro. </param> /// <returns>device port based on the type of state, MIDIOUTERROR if the launchpad was not found. </returns> public static uint GetOutputPort(LaunchpadProState state) { return(MidiOutput.FindPortByName(StateToNameOutput(state))); }