Beispiel #1
0
        /**
         * ParticipantListener Override: Tutorial Handler - Sound Levels and Voice Status.
         * <ul>
         *   <li>Tutorial 5 - sound level property changes.</li>
         *   <li>Tutorial 6/7 - voice status property changes.</li>
         * </ul>
         *
         * @param obj
         *  The affected Participant.
         * @param prop
         *  The Participant property that triggered this event.
         * @param value
         *  Ignored.
         *
         * @since 1.0
         *
         * @see com.skype.api.ParticipantListener#onPropertyChange(com.skype.api.Participant, com.skype.api.Participant.Property, int, String)
         */
        public void onPropertyChange(com.skype.api.Participant obj, com.skype.api.Participant.Property prop, int value, String svalue)
        {
            Participant affectedParticipant = (Participant)obj;

            if (prop == Participant.Property.P_SOUND_LEVEL)
            {
                MySession.myConsole.printf("Sound level changed to %d for %s%n",
                                           affectedParticipant.getSoundLevel(),
                                           affectedParticipant.getIdentity());
            }
            else if (prop == Participant.Property.P_VOICE_STATUS)
            {
                Participant.VoiceStatus voiceStatus = affectedParticipant.getVoiceStatus();
                MySession.myConsole.printf("Voice status changed to %s for %s%n",
                                           voiceStatus,
                                           affectedParticipant.getIdentity());
            }
        }
Beispiel #2
0
        /**
         * <em>Dynamically</em> determine if a particular participant's "phone" is ringing.
         *
         * @param participant
         *  The target participant.
         *
         * @return
         * <ul>
         *   <li>true: participant's phone is ringing</li>
         *   <li>false: participant's phone is <em>not</em> ringing</li>
         * </ul>
         *
         * @since 1.0
         */
        public static bool isRinging(Participant participant)
        {
            MySession.myConsole.println("In isRinging!");

            if (participant == null)
            {
                return(false);
            }

            Participant.VoiceStatus voiceStatus = participant.getVoiceStatus();

            if (voiceStatus == Participant.VoiceStatus.RINGING)
            {
                return(true);
            }

            return(false);
        }