public static IPlayback GetHeadset(Headsets headsets, IOutput output) { IPlayback playback = null; switch (headsets) { case Headsets.iPhoneHeadset: playback = new iPhoneHeadset(output); break; case Headsets.SamsungHeadset: playback = new SamsungHeadset(output); break; case Headsets.UnofficialiPhoneHeadset: playback = new UnofficialiPhoneHeadset(output); break; case Headsets.PhoneSpeaker: playback = new PhoneSpeaker(output); break; default: throw new ArgumentOutOfRangeException(); } return(playback); }
private void Form1_Load(object sender, EventArgs e) { formOutput = new FormOutput(richTextBoxOutWindow); currentHeadsets = GetSelectedHeadset(); currentCharges = GetSelectedCharge(); labelCurentPhone.Text = labelCurentPhone.Text + " " + Nokia1100.Model; richTextBoxOutWindow.ReadOnly = true; }
public static Headsets GetHeadsetType(bool summary = false) { Headsets returnValue = Headsets.Unknown; cachedHeadsetType = (cachedHeadsetType == "" ? XRDevice.model.Replace(" ", "").Replace(".", "").ToLowerInvariant() : cachedHeadsetType); switch (cachedHeadsetType) { case "oculusriftcv1": returnValue = (summary ? Headsets.OculusRift : Headsets.OculusRiftCV1); break; case "oculusriftes07": returnValue = (summary ? Headsets.OculusRift : Headsets.OculusRiftES07); break; case "vivemv": returnValue = (summary ? Headsets.Vive : Headsets.ViveMV); break; case "vivedvt": returnValue = (summary ? Headsets.Vive : Headsets.ViveDVT); break; } if (returnValue == Headsets.Unknown) { VRTK_Logger.Warn( string.Format("Your headset is of type '{0}' which VRTK doesn't know about yet. Please report this headset type to the maintainers of VRTK." + (summary ? " Falling back to a slower check to summarize the headset type now." : ""), cachedHeadsetType) ); if (summary) { if (cachedHeadsetType.Contains("rift")) { return(Headsets.OculusRift); } if (cachedHeadsetType.Contains("vive")) { return(Headsets.Vive); } } } return(returnValue); }
/// <summary> /// The GetHeadsetType method returns the type of headset connected to the computer. /// </summary> /// <param name="summary">If this is true, then the generic name for the headset is returned not including the version type (e.g. OculusRift will be returned for DK2 and CV1).</param> /// <returns>The Headset type that is connected.</returns> public static Headsets GetHeadsetType(bool summary = false) { Headsets returnValue = Headsets.Unknown; string checkValue = VRDevice.model; switch (checkValue) { case "Oculus Rift CV1": returnValue = (summary ? Headsets.OculusRift : Headsets.OculusRiftCV1); break; case "Vive MV": returnValue = (summary ? Headsets.Vive : Headsets.ViveMV); break; } return(returnValue); }
/// <summary> /// The GetHeadsetType method returns the type of headset connected to the computer. /// </summary> /// <param name="summary">If this is true, then the generic name for the headset is returned not including the version type (e.g. OculusRift will be returned for DK2 and CV1).</param> /// <returns>The Headset type that is connected.</returns> public static Headsets GetHeadsetType(bool summary = false) { Headsets returnValue = Headsets.Unknown; string checkValue = VRDevice.model; switch (checkValue) { case "Oculus Rift CV1": returnValue = (summary ? Headsets.OculusRift : Headsets.OculusRiftCV1); break; case "Vive MV": case "Vive. MV": returnValue = (summary ? Headsets.Vive : Headsets.ViveMV); break; case "Vive DVT": returnValue = (summary ? Headsets.Vive : Headsets.ViveDVT); break; } if (returnValue == Headsets.Unknown) { VRTK_Logger.Warn( string.Format("Your headset is of type '{0}' which VRTK doesn't know about yet. Please report this headset type to the maintainers of VRTK." + (summary ? " Falling back to a slower check to summarize the headset type now." : ""), checkValue) ); if (summary) { checkValue = checkValue.ToLowerInvariant(); if (checkValue.Contains("rift")) { return(Headsets.OculusRift); } if (checkValue.Contains("vive")) { return(Headsets.Vive); } } } return(returnValue); }
private void radioButton_PhoneSpeaker_CheckedChanged(object sender, EventArgs e) { currentHeadsets = GetSelectedHeadset(); }
private void radioButton_UnofficialiPhoneHeadset_CheckedChanged(object sender, EventArgs e) { currentHeadsets = GetSelectedHeadset(); }
private void radioButton_SamsungHeadset_CheckedChanged(object sender, EventArgs e) { currentHeadsets = GetSelectedHeadset(); }