protected void StateChange(OggPlayerStatus NewState, OggPlayerStateChanger Reason) { if (StateChanged != null) { StateChanged(this, new OggPlayerStateChangedArgs(m_PlayerState, NewState, Reason)); } #if (DEBUG) Console.WriteLine(DateTime.Now.ToLongTimeString() + "\tOggPlayer::StateChange -- From: " + OggUtilities.GetEnumString(m_PlayerState) + " -- To: " + OggUtilities.GetEnumString(NewState)); #endif m_PlayerState = NewState; }
/// <summary> /// Converts an enumeration into a description string for display to a user /// </summary> /// <param name="oPlayerStateChanger"> /// An <see cref="OggPlayerStateChanger"/> enumeration to interpret /// </param> /// <returns> /// A <see cref="System.String"/> containing the description /// </returns> static public string GetEnumString(OggPlayerStateChanger oPlayerStateChanger) { switch (oPlayerStateChanger) { case OggPlayerStateChanger.EndOfFile: return("Reached end of file"); case OggPlayerStateChanger.Error: return("An error occured"); case OggPlayerStateChanger.Internal: return("State changed for unknown internal reason"); case OggPlayerStateChanger.NoChange: return("State didn't change"); case OggPlayerStateChanger.UserRequest: return("User requested state change"); default: return("Unknown Player State Changer Value"); } }
/// <summary> /// Converts an enumeration into a description string for display to a user /// </summary> /// <param name="oPlayerStateChanger"> /// An <see cref="OggPlayerStateChanger"/> enumeration to interpret /// </param> /// <returns> /// A <see cref="System.String"/> containing the description /// </returns> public static string GetEnumString(OggPlayerStateChanger oPlayerStateChanger) { switch (oPlayerStateChanger) { case OggPlayerStateChanger.EndOfFile: return "Reached end of file"; case OggPlayerStateChanger.Error: return "An error occured"; case OggPlayerStateChanger.Internal: return "State changed for unknown internal reason"; case OggPlayerStateChanger.NoChange: return "State didn't change"; case OggPlayerStateChanger.UserRequest: return "User requested state change"; default: return "Unknown Player State Changer Value"; } }
/// <summary> /// Constructor /// </summary> /// <param name="eOldState"> /// Original state of the player as an <see cref="OggPlayerStatus"/> enumeration /// </param> /// <param name="eNewState"> /// New state of the player as an <see cref="OggPlayerStatus"/> enumeration /// </param> /// <param name="eChanger"> /// Reason for the change in state as an <see cref="OggPlayerStateChanger"/> enumeration /// </param> public OggPlayerStateChangedArgs(OggPlayerStatus eOldState, OggPlayerStatus eNewState, OggPlayerStateChanger eChanger) { m_OldState = eOldState; m_NewState = eNewState; m_Changer = eChanger; }
protected void StateChange(OggPlayerStatus NewState, OggPlayerStateChanger Reason) { if (StateChanged!=null) { StateChanged(this, new OggPlayerStateChangedArgs(m_PlayerState, NewState, Reason)); } #if (DEBUG) Console.WriteLine(DateTime.Now.ToLongTimeString() + "\tOggPlayer::StateChange -- From: " + OggUtilities.GetEnumString(m_PlayerState) + " -- To: " + OggUtilities.GetEnumString(NewState)); #endif m_PlayerState = NewState; }
/// <summary> /// Constructor /// </summary> /// <param name="eOldState"> /// Original state of the player as an <see cref="OggPlayerStatus"/> enumeration /// </param> /// <param name="eNewState"> /// New state of the player as an <see cref="OggPlayerStatus"/> enumeration /// </param> /// <param name="eChanger"> /// Reason for the change in state as an <see cref="OggPlayerStateChanger"/> enumeration /// </param> public OggPlayerStateChangedArgs(OggPlayerStatus eOldState, OggPlayerStatus eNewState, OggPlayerStateChanger eChanger) { m_OldState = eOldState; m_NewState = eNewState; m_Changer = eChanger; }
private void StateChange(OggPlayerStatus NewState, OggPlayerStateChanger Reason) { if (StateChanged != null) { StateChanged(this, new OggPlayerStateChangedArgs(m_PlayerState, NewState, Reason)); } m_PlayerState = NewState; }