コード例 #1
0
 public static void InitSystemStatus(ref SystemStatus CurrentStatus)
 {
     lock (StatusMutex)
     {
         using (Profile.Settings settings = new Profile.MPSettings())
         {
             CurrentStatus._AudioIsMixing = settings.GetValueAsBool("audioplayer", "mixing", false);
             CurrentStatus._AudioUseASIO  = settings.GetValueAsBool("audioplayer", "asio", false);
             bool flag = settings.GetValueAsBool("volume", "digital", true);
             CurrentStatus._AudioUseMasterVolume = !flag;
             CurrentStatus._AudioUseWaveVolume   = flag;
         }
         CurrentStatus.CurrentIconMask       = 0L;
         CurrentStatus.MP_Is_Idle            = false;
         CurrentStatus.SystemVolumeLevel     = 0;
         CurrentStatus.IsMuted               = false;
         CurrentStatus.MediaPlayer_Active    = false;
         CurrentStatus.MediaPlayer_Playing   = false;
         CurrentStatus.MediaPlayer_Paused    = false;
         CurrentStatus.Media_IsRecording     = false;
         CurrentStatus.Media_IsTV            = false;
         CurrentStatus.Media_IsTVRecording   = false;
         CurrentStatus.Media_IsDVD           = false;
         CurrentStatus.Media_IsCD            = false;
         CurrentStatus.Media_IsRadio         = false;
         CurrentStatus.Media_IsVideo         = false;
         CurrentStatus.Media_IsMusic         = false;
         CurrentStatus.Media_IsTimeshifting  = false;
         CurrentStatus.Media_CurrentPosition = 0.0;
         CurrentStatus.Media_Duration        = 0.0;
         CurrentStatus.Media_Speed           = 0;
     }
 }
コード例 #2
0
        public static void GetSystemStatus(ref SystemStatus CurrentStatus)
        {
            lock (StatusMutex)
            {
                CurrentStatus.CurrentPluginStatus  = MPStatus.CurrentPluginStatus;
                CurrentStatus.CurrentIconMask      = MPStatus.CurrentIconMask;
                CurrentStatus.UserIsIdle           = MPStatus.UserIsIdle;
                CurrentStatus.MP_Is_Idle           = MPStatus.MP_Is_Idle;
                CurrentStatus.TimeIdleStateChanged = MPStatus.TimeIdleStateChanged;

                CurrentStatus.SystemVolumeLevel = MPStatus.SystemVolumeLevel;
                CurrentStatus.IsMuted           = MPStatus.IsMuted;

                CurrentStatus.MediaPlayer_Active      = MPStatus.MediaPlayer_Active;
                CurrentStatus.MediaPlayer_Playing     = MPStatus.MediaPlayer_Playing;
                CurrentStatus.TimePlayingStateChanged = MPStatus.TimePlayingStateChanged;
                CurrentStatus.MediaPlayer_Paused      = MPStatus.MediaPlayer_Paused;
                CurrentStatus.Media_IsRecording       = MPStatus.Media_IsRecording;
                CurrentStatus.Media_IsTV          = MPStatus.Media_IsTV;
                CurrentStatus.Media_IsTVRecording = MPStatus.Media_IsTVRecording;
                CurrentStatus.Media_IsDVD         = MPStatus.Media_IsDVD;
                CurrentStatus.Media_IsCD          = MPStatus.Media_IsCD;
                CurrentStatus.Media_IsRadio       = MPStatus.Media_IsRadio;
                CurrentStatus.Media_IsVideo       = MPStatus.Media_IsVideo;
                CurrentStatus.Media_IsMusic       = MPStatus.Media_IsMusic;
                //
                // Race condition during stop of LiveTV or DVD playback
                //
                try
                {
                    CurrentStatus.Media_CurrentPosition = g_Player.CurrentPosition;
                    CurrentStatus.Media_Duration        = g_Player.Duration;
                    CurrentStatus.Media_Speed           = g_Player.Speed;
                }
                catch (Exception ex)
                {
                    Log.Debug("GetSystemStatus(): unable to update g_player properties (playback stop in progress?): " +
                              ex.Message);
                }
            }
        }
コード例 #3
0
 public static void ShowSystemStatus(ref SystemStatus CurrentStatus)
 {
 }
コード例 #4
0
 public static void ShowSystemStatus(ref SystemStatus CurrentStatus) {}
コード例 #5
0
 public static void InitSystemStatus(ref SystemStatus CurrentStatus)
 {
   lock (StatusMutex)
   {
     using (Profile.Settings settings = new Profile.MPSettings())
     {
       CurrentStatus._AudioIsMixing = settings.GetValueAsBool("audioplayer", "mixing", false);
       CurrentStatus._AudioUseASIO = settings.GetValueAsBool("audioplayer", "asio", false);
       bool flag = settings.GetValueAsBool("volume", "digital", true);
       CurrentStatus._AudioUseMasterVolume = !flag;
       CurrentStatus._AudioUseWaveVolume = flag;
     }
     CurrentStatus.CurrentIconMask = 0L;
     CurrentStatus.MP_Is_Idle = false;
     CurrentStatus.SystemVolumeLevel = 0;
     CurrentStatus.IsMuted = false;
     CurrentStatus.MediaPlayer_Active = false;
     CurrentStatus.MediaPlayer_Playing = false;
     CurrentStatus.MediaPlayer_Paused = false;
     CurrentStatus.Media_IsRecording = false;
     CurrentStatus.Media_IsTV = false;
     CurrentStatus.Media_IsTVRecording = false;
     CurrentStatus.Media_IsDVD = false;
     CurrentStatus.Media_IsCD = false;
     CurrentStatus.Media_IsRadio = false;
     CurrentStatus.Media_IsVideo = false;
     CurrentStatus.Media_IsMusic = false;
     CurrentStatus.Media_IsTimeshifting = false;
     CurrentStatus.Media_CurrentPosition = 0.0;
     CurrentStatus.Media_Duration = 0.0;
     CurrentStatus.Media_Speed = 0;
   }
 }
コード例 #6
0
    public static void GetSystemStatus(ref SystemStatus CurrentStatus)
    {
      lock (StatusMutex)
      {
        CurrentStatus.CurrentPluginStatus = MPStatus.CurrentPluginStatus;
        CurrentStatus.CurrentIconMask = MPStatus.CurrentIconMask;
        CurrentStatus.MP_Is_Idle = MPStatus.MP_Is_Idle;

        CurrentStatus.SystemVolumeLevel = MPStatus.SystemVolumeLevel;
        CurrentStatus.IsMuted = MPStatus.IsMuted;

        CurrentStatus.MediaPlayer_Active = MPStatus.MediaPlayer_Active;
        CurrentStatus.MediaPlayer_Playing = MPStatus.MediaPlayer_Playing;
        CurrentStatus.MediaPlayer_Paused = MPStatus.MediaPlayer_Paused;
        CurrentStatus.Media_IsRecording = MPStatus.Media_IsRecording;
        CurrentStatus.Media_IsTV = MPStatus.Media_IsTV;
        CurrentStatus.Media_IsTVRecording = MPStatus.Media_IsTVRecording;
        CurrentStatus.Media_IsDVD = MPStatus.Media_IsDVD;
        CurrentStatus.Media_IsCD = MPStatus.Media_IsCD;
        CurrentStatus.Media_IsRadio = MPStatus.Media_IsRadio;
        CurrentStatus.Media_IsVideo = MPStatus.Media_IsVideo;
        CurrentStatus.Media_IsMusic = MPStatus.Media_IsMusic;
        //
        // Race condition during stop of LiveTV or DVD playback      
        //
        try
        {
          CurrentStatus.Media_CurrentPosition = g_Player.CurrentPosition;
          CurrentStatus.Media_Duration = g_Player.Duration;
          CurrentStatus.Media_Speed = g_Player.Speed;
        }
        catch (Exception ex)
        {
          Log.Debug("GetSystemStatus(): unable to update g_player properties (playback stop in progress?): " +
                    ex.Message);
        }
      }
    }
コード例 #7
0
    /// <summary>
    /// Check our EQ settings and MP states to determine if it is appropriate to show our EQ.
    /// </summary>
    /// <param name="EQSETTINGS"></param>
    /// <returns>True if it is appropriate to show our EQ, false otherwise.</returns>    public static bool GetEQ(ref EQControl EQSETTINGS)
    public static bool GetEQ(ref EQControl EQSETTINGS)
    {
      SystemStatus MPStatus=new SystemStatus();
      GetSystemStatus(ref MPStatus);
      bool extensiveLogging = Settings.Instance.ExtensiveLogging;
      bool flag2 = (EQSETTINGS.UseStereoEq | EQSETTINGS.UseVUmeter) | EQSETTINGS.UseVUmeter2;
      if (!MPStatus.UserIsIdle || g_Player.Player == null || !g_Player.IsMusic || !BassMusicPlayer.IsDefaultMusicPlayer)
      {
        return false;
      }

      if (!EQSETTINGS.UseEqDisplay)
      {
        return false;
      }
      if (EQSETTINGS._AudioUseASIO)
      {
        return false;
      }
      try
      {
        if (g_Player.Paused)
        {
            return false;
        }

        if (EQSETTINGS.DelayEQ & (g_Player.CurrentPosition < EQSETTINGS._DelayEQTime))
        {
          EQSETTINGS._EQDisplayTitle = false;
          EQSETTINGS._LastEQTitle = (DateTime.Now.Ticks / 1000);
          return false;
        }
        if (EQSETTINGS.EQTitleDisplay)
        {
          if (g_Player.CurrentPosition < EQSETTINGS._EQTitleDisplayTime)
          {
            EQSETTINGS._EQDisplayTitle = false;
          }
          if (((DateTime.Now.Ticks / 1000) - EQSETTINGS._LastEQTitle) > (EQSETTINGS._EQTitleDisplayTime * 10000))
          {
            EQSETTINGS._LastEQTitle = (DateTime.Now.Ticks / 1000);
            EQSETTINGS._EQDisplayTitle = !EQSETTINGS._EQDisplayTitle;
          }
          if (EQSETTINGS._EQDisplayTitle &
              (((DateTime.Now.Ticks / 1000) - EQSETTINGS._LastEQTitle) < (EQSETTINGS._EQTitleShowTime * 10000)))
          {
            return false;
          }
        }
      }
      catch
      {
        EQSETTINGS._EQDisplayTitle = false;
        EQSETTINGS._LastEQTitle = (DateTime.Now.Ticks / 1000);
        return false;
      }
      int handle = -1;
      try
      {
        handle = g_Player.Player.CurrentAudioStream;
      }
      catch (Exception exception)
      {
        Log.Debug("MiniDisplay.GetEQ(): Caugth exception obtaining audio stream: {0}", new object[] {exception});
        return false;
      }
      if ((handle != 0) & (handle != -1))
      {
        int num2;
        if (extensiveLogging)
        {
          Log.Info("MiniDisplay.GetEQ(): attempting to retrieve equalizer data from audio stream {0}",
                   new object[] {handle});
        }
        try
        {
          int num3;
          if (flag2)
          {
            num3 = -2147483630;
          }
          else
          {
            num3 = -2147483646;
          }

          if (Bass.BASS_WASAPI_IsStarted())
          {
            num2 = Bass.GetDataFFT(EQSETTINGS.EqFftData, num3);
          }
          else
          {
            num2 = Bass.GetChannelData(handle, EQSETTINGS.EqFftData, num3);
          }
        }
        catch
        {
          if (extensiveLogging)
          {
            Log.Info("MiniDisplay.GetEQ(): CAUGHT EXCeption - audio stream {0} disappeared", new object[] {handle});
          }
          return false;
        }
        if (num2 > 0)
        {
          return true;
        }
        if (extensiveLogging)
        {
          Log.Info("MiniDisplay.GetEQ(): unable to retreive equalizer data");
        }
        return false;
      }
      if (extensiveLogging)
      {
        Log.Info("MiniDisplay.GetEQ(): Audio Stream not available");
      }
      return false;
    }
コード例 #8
0
        /// <summary>
        /// Check our EQ settings and MP states to determine if it is appropriate to show our EQ.
        /// </summary>
        /// <param name="EQSETTINGS"></param>
        /// <returns>True if it is appropriate to show our EQ, false otherwise.</returns>    public static bool GetEQ(ref EQControl EQSETTINGS)
        public static bool GetEQ(ref EQControl EQSETTINGS)
        {
            SystemStatus MPStatus = new SystemStatus();

            GetSystemStatus(ref MPStatus);
            bool extensiveLogging = Settings.Instance.ExtensiveLogging;
            bool flag2            = (EQSETTINGS.UseStereoEq | EQSETTINGS.UseVUmeter) | EQSETTINGS.UseVUmeter2;

            if (!MPStatus.UserIsIdle || g_Player.Player == null || !g_Player.IsMusic || !BassMusicPlayer.IsDefaultMusicPlayer)
            {
                return(false);
            }

            if (!EQSETTINGS.UseEqDisplay)
            {
                return(false);
            }
            if (EQSETTINGS._AudioUseASIO)
            {
                return(false);
            }
            try
            {
                if (g_Player.Paused)
                {
                    return(false);
                }

                if (Bass == null)
                {
                    Bass = BassMusicPlayer.Player;
                }

                if (EQSETTINGS.DelayEQ & (g_Player.CurrentPosition < EQSETTINGS._DelayEQTime))
                {
                    EQSETTINGS._EQDisplayTitle = false;
                    EQSETTINGS._LastEQTitle    = (DateTime.Now.Ticks / 1000);
                    return(false);
                }
                if (EQSETTINGS.EQTitleDisplay)
                {
                    if (g_Player.CurrentPosition < EQSETTINGS._EQTitleDisplayTime)
                    {
                        EQSETTINGS._EQDisplayTitle = false;
                    }
                    if (((DateTime.Now.Ticks / 1000) - EQSETTINGS._LastEQTitle) > (EQSETTINGS._EQTitleDisplayTime * 10000))
                    {
                        EQSETTINGS._LastEQTitle    = (DateTime.Now.Ticks / 1000);
                        EQSETTINGS._EQDisplayTitle = !EQSETTINGS._EQDisplayTitle;
                    }
                    if (EQSETTINGS._EQDisplayTitle &
                        (((DateTime.Now.Ticks / 1000) - EQSETTINGS._LastEQTitle) < (EQSETTINGS._EQTitleShowTime * 10000)))
                    {
                        return(false);
                    }
                }
            }
            catch
            {
                EQSETTINGS._EQDisplayTitle = false;
                EQSETTINGS._LastEQTitle    = (DateTime.Now.Ticks / 1000);
                return(false);
            }
            int handle = -1;

            try
            {
                handle = g_Player.Player.CurrentAudioStream;
            }
            catch (Exception exception)
            {
                Log.Debug("MiniDisplay.GetEQ(): Caugth exception obtaining audio stream: {0}", new object[] { exception });
                return(false);
            }
            if ((handle != 0) & (handle != -1))
            {
                int num2;
                if (extensiveLogging)
                {
                    Log.Info("MiniDisplay.GetEQ(): attempting to retrieve equalizer data from audio stream {0}",
                             new object[] { handle });
                }
                try
                {
                    int num3;
                    if (flag2)
                    {
                        num3 = -2147483630;
                    }
                    else
                    {
                        num3 = -2147483646;
                    }

                    if (Bass.BASS_WASAPI_IsStarted())
                    {
                        num2 = Bass.GetDataFFT(EQSETTINGS.EqFftData, num3);
                    }
                    else
                    {
                        num2 = Bass.GetChannelData(handle, EQSETTINGS.EqFftData, num3);
                    }
                }
                catch (Exception exception)
                {
                    if (extensiveLogging)
                    {
                        Log.Info("MiniDisplay.GetEQ(): CAUGHT Exception - audio stream {0} disappeared - {1}", new object[] { handle }, exception.Message);
                    }
                    return(false);
                }
                if (num2 > 0)
                {
                    return(true);
                }
                if (extensiveLogging)
                {
                    Log.Info("MiniDisplay.GetEQ(): unable to retreive equalizer data");
                }
                return(false);
            }
            if (extensiveLogging)
            {
                Log.Info("MiniDisplay.GetEQ(): Audio Stream not available");
            }
            return(false);
        }