// Invoke the Volume event; called whenever the Volume gets changed:
 protected static void OnEventVolume(OnEvenSetVolumeEventArgs e)
 {
     if (VolumeEvent != null)
     {
         VolumeEvent(e);
     }
 }
        private static UPnPError OnSetVolume(DvAction action, IList <object> inParams,
                                             out IList <object> outParams, CallContext context)
        {
            TraceLogger.DebugLogParams(inParams);
            ChangeStateVariable("Volume", inParams[2], action);
            // we don't want to fire an event yet
            //action.ParentService.StateVariables["Volume"].Value = inParams[2];

            OnEvenSetVolumeEventArgs eventArgs = new OnEvenSetVolumeEventArgs();

            eventArgs.Volume = inParams[2];

            OnEventVolume(eventArgs); // Fire Event

            outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList();

            return(null);
        }
Пример #3
0
 private void OnVolume(OnEvenSetVolumeEventArgs e)
 {
     ServiceRegistration.Get <IPlayerManager>().Volume = Convert.ToInt32(e.Volume);
     //TraceLogger.WriteLine("Volume set: " + e.Volume.ToString());
     //TraceLogger.WriteLine("Wolume is: " + ServiceRegistration.Get<IPlayerManager>().Volume);
 }
 // Invoke the Volume event; called whenever the Volume gets changed:
 protected static void OnEventVolume(OnEvenSetVolumeEventArgs e)
 {
   if (VolumeEvent != null)
     VolumeEvent(e);
 }
    private static UPnPError OnSetVolume(DvAction action, IList<object> inParams,
      out IList<object> outParams, CallContext context)
    {
      TraceLogger.DebugLogParams(inParams);
      ChangeStateVariable("Volume", inParams[2], action);
      // we don't want to fire an event yet
      //action.ParentService.StateVariables["Volume"].Value = inParams[2];

      OnEvenSetVolumeEventArgs eventArgs = new OnEvenSetVolumeEventArgs();
      eventArgs.Volume = inParams[2];

      OnEventVolume(eventArgs); // Fire Event

      outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList();

      return null;
    }