// optional public void Pause() { if (TransportState != TransportState.PAUSED_PLAYBACK) { UPnP.InvokeAction(_service, "Pause", InstanceId); } }
// required public void Next() { if (CurrentTrack < NumberOfTracks) { UPnP.InvokeAction(_service, "Next", InstanceId); } }
// required public void Previous() { if (CurrentTrack > 1) { UPnP.InvokeAction(_service, "Previous", InstanceId); } }
// required public void Stop() { if (TransportState != TransportState.STOPPED) { UPnP.InvokeAction(_service, "Stop", InstanceId); } }
public IEnumerable <XPathNavigator> Browse(string objectId, BrowseFlags browseFlag, string filter, string sortCriteria) { object[] inArgs = { objectId, browseFlag.ToString(), filter, 0u, 256u * 4, sortCriteria }; object[] outArray = { "", 0u, uint.MaxValue, 0u }; for (uint i = 0; i < (uint)outArray[2]; i += (uint)outArray[1]) { inArgs.SetValue(i, 3); // starting index inArgs.SetValue(Math.Min((uint)inArgs.GetValue(4), (uint)outArray[2] - (uint)outArray[1]), 4); // items to retrieve outArray = UPnP.InvokeAction(_service, "Browse", inArgs); string resultXml = Convert.ToString(outArray.GetValue(0)); uint numberReturned = Convert.ToUInt32(outArray.GetValue(1)); uint totalMatches = Convert.ToUInt32(outArray.GetValue(2)); uint updateId = Convert.ToUInt32(outArray.GetValue(3)); XPathDocument doc = new XPathDocument(new StringReader(resultXml)); XPathNavigator nav = doc.CreateNavigator(); foreach (XPathNavigator node in nav.Select(XPath.Expressions.ContainerElements)) { yield return(node); } foreach (XPathNavigator node in nav.Select(XPath.Expressions.ItemsElements)) { yield return(node); } } }
public void BeginSoftwareUpdate(Uri updateUrl, uint flags) { if (updateUrl == null || updateUrl.IsAbsoluteUri == false) { throw new ArgumentException("Need absolute uri", "updateUrl"); } UPnP.InvokeAction(_service, "BeginSoftwareUpdate", updateUrl.ToString(), flags); }
public AudioInputAttributes GetAudioInputAttributes() { object[] ret = UPnP.InvokeAction(_service, "GetAudioInputAttributes"); AudioInputAttributes aia = new AudioInputAttributes(); aia._currentName = Convert.ToString(ret[0], CultureInfo.InvariantCulture); aia._currentIcon = Convert.ToString(ret[1], CultureInfo.InvariantCulture); return(aia); }
// required public void Play() { const string speed = "1"; if (this.NumberOfTracks > 0 && TransportState != TransportState.PLAYING) { UPnP.InvokeAction(_service, "Play", InstanceId, speed); } }
public LineInLevel GetLineInLevel() { object[] ret = UPnP.InvokeAction(_service, "GetLineInLevel"); LineInLevel lil = new LineInLevel(); lil._currentLeftLineInLevel = Convert.ToInt32(ret[0], CultureInfo.InvariantCulture); lil._currentRightLineInLevel = Convert.ToInt32(ret[1], CultureInfo.InvariantCulture); return(lil); }
public TransportSettings GetTransportSettings() { object[] outArray = UPnP.InvokeAction(_service, "GetTransportSettings", InstanceId); TransportSettings ts = new TransportSettings(); ts._playMode = Convert.ToString(outArray[0], CultureInfo.InvariantCulture); ts._recQualityMode = Convert.ToString(outArray[1], CultureInfo.InvariantCulture); return(ts); }
public TransportInfo GetTransportInfo() { object[] outArray = UPnP.InvokeAction(_service, "GetTransportInfo", InstanceId); TransportInfo ti = new TransportInfo(); ti._currentTransportState = (TransportState)Enum.Parse(typeof(TransportState), Convert.ToString(outArray[0], CultureInfo.InvariantCulture), true); ti._currentTransportStatus = Convert.ToString(outArray[1], CultureInfo.InvariantCulture); ti._currentSpeed = Convert.ToString(outArray[2], CultureInfo.InvariantCulture); return(ti); }
public DeviceCapabilities GetDeviceCapabilities() { object[] outArray = UPnP.InvokeAction(_service, "GetDeviceCapabilities", InstanceId); DeviceCapabilities dc = new DeviceCapabilities(); dc._playMedia = Convert.ToString(outArray[0], CultureInfo.InvariantCulture); dc._recMedia = Convert.ToString(outArray[1], CultureInfo.InvariantCulture); dc._reqQualityModes = Convert.ToString(outArray[2], CultureInfo.InvariantCulture); return(dc); }
public void AddUriToQueue(Uri enqueuedUri, string enqueuedUriMetaData, uint desiredFirstTrackNumberEnqueued, bool enqueueAsNext) { if (enqueuedUri == null) { throw new ArgumentException("enqueuedUri required", "enqueuedUri"); } UPnP.InvokeAction(_service, "AddURIToQueue", InstanceId, enqueuedUri.ToString(), enqueuedUriMetaData, desiredFirstTrackNumberEnqueued, enqueueAsNext); // out[0] == FirstTrackNumberEnqueued // out[1] == NumTracksAdded // out[2] == NewQueueLength }
// optional public void SetNextAVTransportUri(Uri currentUri, string currentUriMetadata) { if (currentUri == null) { throw new ArgumentException("currentUri is required", "currentUri"); } if (NextAVTransportUri != currentUri || String.CompareOrdinal(_NextAVTransportURIMetaData, currentUriMetadata) != 0) { UPnP.InvokeAction(_service, "SetNextAVTransportUri", InstanceId, currentUri.ToString(), currentUriMetadata); } }
public PositionInfo GetPositionInfo() { object[] outArray = UPnP.InvokeAction(_service, "GetPositionInfo", InstanceId); PositionInfo pi = new PositionInfo(); pi._track = Convert.ToString(outArray[0], CultureInfo.InvariantCulture); pi._trackDuration = CreateTimeSpan(Convert.ToString(outArray[1], CultureInfo.InvariantCulture)); pi._trackMetaData = Convert.ToString(outArray[2], CultureInfo.InvariantCulture); pi._trackUri = CreateUri(Convert.ToString(outArray[3], CultureInfo.InvariantCulture)); pi._relTime = CreateTimeSpan(Convert.ToString(outArray[4], CultureInfo.InvariantCulture)); pi._absTime = CreateTimeSpan(Convert.ToString(outArray[5], CultureInfo.InvariantCulture)); pi._relCount = Convert.ToString(outArray[6], CultureInfo.InvariantCulture); pi._absCount = Convert.ToString(outArray[7], CultureInfo.InvariantCulture); return(pi); }
public MediaInfo GetMediaInfo() { object[] outArray = UPnP.InvokeAction(_service, "GetMediaInfo", InstanceId); MediaInfo mi = new MediaInfo(); mi._nrTracks = Convert.ToUInt32(outArray[0], CultureInfo.InvariantCulture); mi._mediaDuration = Convert.ToString(outArray[1], CultureInfo.InvariantCulture); mi._currentUri = CreateUri(Convert.ToString(outArray[2], CultureInfo.InvariantCulture)); mi._currentUriMetadata = Convert.ToString(outArray[3], CultureInfo.InvariantCulture); mi._nextUri = CreateUri(Convert.ToString(outArray[4], CultureInfo.InvariantCulture)); mi._nextUriMetadata = Convert.ToString(outArray[5], CultureInfo.InvariantCulture); mi._playMedium = Convert.ToString(outArray[6], CultureInfo.InvariantCulture); mi._recordMedium = Convert.ToString(outArray[7], CultureInfo.InvariantCulture); mi._writeStatus = Convert.ToString(outArray[8], CultureInfo.InvariantCulture); return(mi); }
public void SetTreble(int desiredTreble) { UPnP.InvokeAction(_service, "SetTreble", InstanceId, desiredTreble); }
public short GetTreble() { return(UPnP.InvokeAction <short>(_service, "GetTreble", InstanceId)); }
public void SetBass(int desiredBass) { UPnP.InvokeAction(_service, "SetBass", InstanceId, desiredBass); }
public short GetBass() { return(UPnP.InvokeAction <short>(_service, "GetBass", InstanceId)); }
public void GetVolumeDBRange(Channel channel) { // TODO: return MinValue/MaxValue object[] results = UPnP.InvokeAction(_service, "GetVolumeDBRange", InstanceId, channel.ToString()); }
public uint RampToVolume(Channel channel, RampType rampType, short desiredVolume) { return(UPnP.InvokeAction <uint>(_service, "RampToVolume", InstanceId, channel.ToString(), rampType.ToString(), desiredVolume)); }
public bool GetOutputFixed() { return(UPnP.InvokeAction <bool>(_service, "GetOutputFixed", InstanceId)); }
public bool GetLoudness(Channel channel) { return(UPnP.InvokeAction <bool>(_service, "GetLoudness", InstanceId, channel.ToString())); }
public void SetLoudness(Channel channel, bool desiredLoudness) { UPnP.InvokeAction(_service, "SetLoudness", InstanceId, channel.ToString(), desiredLoudness); }
public ushort SetRelativeVolume(Channel channel, int adjustment) { return(UPnP.InvokeAction <ushort>(_service, "SetRelativeVolume", InstanceId, channel.ToString(), adjustment)); }
public void SetOutputFixed(bool desiredFixed) { UPnP.InvokeAction(_service, "SetOutputFixed", InstanceId, desiredFixed); }
public short GetVolumeDB(Channel channel) { return(UPnP.InvokeAction <short>(_service, "GetVolumeDB", InstanceId, channel.ToString())); }
public void RestoreVolumePriorToRamp(Channel channel) { UPnP.InvokeAction(_service, "RestoreVolumePriorToRamp", InstanceId, channel.ToString()); }
public void SetVolumeDB(Channel channel, short desiredVolume) { UPnP.InvokeAction(_service, "SetVolumeDB", InstanceId, channel.ToString(), desiredVolume); }