public string Enum_TransportState_ToString(Enum_TransportState en)
 {
     string RetVal = "";
     switch(en)
     {
         case Enum_TransportState.STOPPED:
             RetVal = "STOPPED";
             break;
         case Enum_TransportState.PAUSED_PLAYBACK:
             RetVal = "PAUSED_PLAYBACK";
             break;
         case Enum_TransportState.PAUSED_RECORDING:
             RetVal = "PAUSED_RECORDING";
             break;
         case Enum_TransportState.PLAYING:
             RetVal = "PLAYING";
             break;
         case Enum_TransportState.RECORDING:
             RetVal = "RECORDING";
             break;
         case Enum_TransportState.TRANSITIONING:
             RetVal = "TRANSITIONING";
             break;
         case Enum_TransportState.NO_MEDIA_PRESENT:
             RetVal = "NO_MEDIA_PRESENT";
             break;
         case Enum_TransportState._UNSPECIFIED_:
             RetVal = GetUnspecifiedValue("Enum_TransportState");
             break;
     }
     return(RetVal);
 }
Exemplo n.º 2
0
 public void Sync_GetTransportInfo(System.UInt32 InstanceID, out Enum_TransportState CurrentTransportState, out Enum_TransportStatus CurrentTransportStatus, out Enum_TransportPlaySpeed CurrentSpeed)
 {
    UPnPArgument[] args = new UPnPArgument[4];
    args[0] = new UPnPArgument("InstanceID", InstanceID);
    args[1] = new UPnPArgument("CurrentTransportState", "");
    args[2] = new UPnPArgument("CurrentTransportStatus", "");
    args[3] = new UPnPArgument("CurrentSpeed", "");
     _S.InvokeSync("GetTransportInfo", args);
     for(int i=0;i<args.Length;++i)
     {
         switch(args[i].Name)
         {
             case "CurrentTransportState":
                 switch((string)args[i].DataValue)
                 {
                     case "STOPPED":
                         args[i].DataValue = Enum_TransportState.STOPPED;
                         break;
                     case "PAUSED_PLAYBACK":
                         args[i].DataValue = Enum_TransportState.PAUSED_PLAYBACK;
                         break;
                     case "PAUSED_RECORDING":
                         args[i].DataValue = Enum_TransportState.PAUSED_RECORDING;
                         break;
                     case "PLAYING":
                         args[i].DataValue = Enum_TransportState.PLAYING;
                         break;
                     case "RECORDING":
                         args[i].DataValue = Enum_TransportState.RECORDING;
                         break;
                     case "TRANSITIONING":
                         args[i].DataValue = Enum_TransportState.TRANSITIONING;
                         break;
                     case "NO_MEDIA_PRESENT":
                         args[i].DataValue = Enum_TransportState.NO_MEDIA_PRESENT;
                         break;
                     default:
                        SetUnspecifiedValue("Enum_TransportState", (string)args[i].DataValue);
                        args[i].DataValue = Enum_TransportState._UNSPECIFIED_;
                        break;
                 }
                 break;
             case "CurrentTransportStatus":
                 switch((string)args[i].DataValue)
                 {
                     case "OK":
                         args[i].DataValue = Enum_TransportStatus.OK;
                         break;
                     case "ERROR_OCCURRED":
                         args[i].DataValue = Enum_TransportStatus.ERROR_OCCURRED;
                         break;
                     case " vendor-defined ":
                         args[i].DataValue = Enum_TransportStatus._VENDOR_DEFINED_;
                         break;
                     default:
                        SetUnspecifiedValue("Enum_TransportStatus", (string)args[i].DataValue);
                        args[i].DataValue = Enum_TransportStatus._UNSPECIFIED_;
                        break;
                 }
                 break;
             case "CurrentSpeed":
                 switch((string)args[i].DataValue)
                 {
                     case "1":
                         args[i].DataValue = Enum_TransportPlaySpeed._1;
                         break;
                     case " vendor-defined ":
                         args[i].DataValue = Enum_TransportPlaySpeed._VENDOR_DEFINED_;
                         break;
                     default:
                        SetUnspecifiedValue("Enum_TransportPlaySpeed", (string)args[i].DataValue);
                        args[i].DataValue = Enum_TransportPlaySpeed._UNSPECIFIED_;
                        break;
                 }
                 break;
         }
     }
     InstanceID = (System.UInt32) args[0].DataValue;
     CurrentTransportState = (Enum_TransportState) args[1].DataValue;
     CurrentTransportStatus = (Enum_TransportStatus) args[2].DataValue;
     CurrentSpeed = (Enum_TransportPlaySpeed) args[3].DataValue;
     return;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Action: GetTransportInfo
 /// </summary>
 /// <param name="InstanceID">Associated State Variable: A_ARG_TYPE_InstanceID</param>
 /// <param name="CurrentTransportState">Associated State Variable: TransportState</param>
 /// <param name="CurrentTransportStatus">Associated State Variable: TransportStatus</param>
 /// <param name="CurrentSpeed">Associated State Variable: TransportPlaySpeed</param>
 public void GetTransportInfo(System.UInt32 InstanceID, out Enum_TransportState CurrentTransportState, out Enum_TransportStatus CurrentTransportStatus, out Enum_TransportPlaySpeed CurrentSpeed)
 {
     //ToDo: Add Your implementation here, and remove exception
     throw(new UPnPCustomException(800,"This method has not been completely implemented..."));
 }