public override void onStarted(SmcDeviceFinder deviceFinder, int error)
 {
     mDeviceFinder = deviceFinder;
     mDeviceFinder.setDeviceListener(mType, this);
     mDeviceFinder.rescan();
     refreshDevicesList();
 }
Esempio n. 2
0
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            mType = Intent.getIntExtra("deviceType", SmcDevice.TYPE_IMAGEVIEWER);

            ContentView = R.layout.device_select;

            TextView noDevicesTextView = (TextView)findViewById(R.id.no_devices);

            noDevicesTextView.Visibility = View.GONE;

            if (FrameworkInstalled)
            {
                noDevicesTextView.Text = [email protected]_picker_no_devices;
            }
            else
            {
                noDevicesTextView.Text = [email protected]_picker_framework_not_installed;
                findViewById(R.id.refresh_button).Visibility = View.GONE;
            }

            ListView.EmptyView = noDevicesTextView;

            ListAdapter = new DevicesAdapter(this);

            findViewById(R.id.cancel_button).OnClickListener  = this;
            findViewById(R.id.refresh_button).OnClickListener = this;

            SmcDeviceFinder df = new SmcDeviceFinder(this);

            df.StatusListener = this;
            df.start();
        }
 public override void onStopped(SmcDeviceFinder deviceFinder)
 {
     if (mDeviceFinder == deviceFinder)
     {
         mDeviceFinder.StatusListener = null;
         mDeviceFinder = null;
     }
 }
Esempio n. 4
0
 public override void onDetach()
 {
     if (mDeviceFinder != null)
     {
         mDeviceFinder.stop();
         mDeviceFinder = null;
     }
     base.onDetach();
 }
 public override void onStopped(SmcDeviceFinder deviceFinder)
 {
     // Remove listeners so that no references remain
     // and GC can collect the service and this activity.
     if (mDeviceFinder == deviceFinder)
     {
         mDeviceFinder.setDeviceListener(mType, null);
         mDeviceFinder.StatusListener = null;
         mDeviceFinder = null;
     }
 }
Esempio n. 6
0
        public override void onActivityCreated(Bundle savedInstanceState)
        {
            base.onActivityCreated(savedInstanceState);

            // The service provider needs to be created after device type is set
            // It could also be created in onStart or onResume, but we the sooner
            // we create it, the sooner we get devices.
            SmcDeviceFinder df = new SmcDeviceFinder(Activity);

            df.StatusListener = this;
            df.start();
        }
		internal RemotePlayer(PlayerController controller, Uri contentUri, string mimetype, string deviceId, int deviceType)
		{
			this.mController = controller;
			this.mContentUri = contentUri;
			this.mMimeType = mimetype;
			this.mDeviceId = deviceId;
			this.mDeviceType = deviceType;

			// Connect to AllShare Service. Processing continues when
			// service instance is received in onCreated callback method.
			SmcDeviceFinder df = new SmcDeviceFinder(controller.mContext);
			df.StatusListener = this;
			df.start();
		}
Esempio n. 8
0
 public override void onDeviceRemoved(SmcDeviceFinder deviceFinder, SmcDevice smcDevice, int error)
 {
     // We aren't interested in individual devices, only in their number
     updateButtonCounter();
     //if current device has been removed
     if (smcDevice.Id.Equals(mDeviceId))
     {
         Active = false;
         if (mPickerListener != null)
         {
             mPickerListener.onAllShareDisabled();
         }
     }
 }
        internal RemotePlayer(PlayerController controller, Uri contentUri, string mimetype, string deviceId, int deviceType)
        {
            this.mController = controller;
            this.mContentUri = contentUri;
            this.mMimeType   = mimetype;
            this.mDeviceId   = deviceId;
            this.mDeviceType = deviceType;

            // Connect to AllShare Service. Processing continues when
            // service instance is received in onCreated callback method.
            SmcDeviceFinder df = new SmcDeviceFinder(controller.mContext);

            df.StatusListener = this;
            df.start();
        }
Esempio n. 10
0
 public override void onStarted(SmcDeviceFinder deviceFinder, int error)
 {
     mDeviceFinder = deviceFinder;
     if (mType != 0)
     {
         mDeviceFinder.setDeviceListener(mType, this);
     }
     else
     {
         mDeviceFinder.setDeviceListener(SmcDevice.TYPE_IMAGEVIEWER, this);
         mDeviceFinder.setDeviceListener(SmcDevice.TYPE_AVPLAYER, this);
     }
     mDeviceFinder.rescan();
     refreshDevicesList();
 }
Esempio n. 11
0
 public override void onStopped(SmcDeviceFinder deviceFinder)
 {
     if (mDeviceFinder == deviceFinder)
     {
         if (mType != 0)
         {
             mDeviceFinder.setDeviceListener(mType, null);
         }
         else
         {
             mDeviceFinder.setDeviceListener(SmcDevice.TYPE_IMAGEVIEWER, null);
             mDeviceFinder.setDeviceListener(SmcDevice.TYPE_AVPLAYER, null);
         }
         mDeviceFinder.StatusListener = null;
         mDeviceFinder = null;
     }
 }
Esempio n. 12
0
 public override void onStopped(SmcDeviceFinder deviceFinder)
 {
     // Remove listeners so that no references remain
     // and GC can collect the service and this activity.
     if (mDeviceFinder == deviceFinder)
     {
         if (mType != 0)
         {
             mDeviceFinder.setDeviceListener(mType, null);
         }
         else
         {
             mDeviceFinder.setDeviceListener(SmcDevice.TYPE_IMAGEVIEWER, null);
             mDeviceFinder.setDeviceListener(SmcDevice.TYPE_AVPLAYER, null);
         }
         mDeviceFinder.StatusListener = null;
         mDeviceFinder = null;
     }
 }
        /////////////////////////////////////////////////////////////////////////////////
        // SmcDeviceFinder.StatusListener implementation
        /////////////////////////////////////////////////////////////////////////////////

        public override void onStarted(SmcDeviceFinder deviceFinder, int error)
        {
            mDeviceFinder = deviceFinder;
            mPlayer       = (SmcAvPlayer)mDeviceFinder.getDevice(mDeviceType, mDeviceId);
            if (mPlayer == null)
            {
                mController.setLocalPlayer();
                return;
            }

            if (mController.CurrentState != PlayerState.STOPPED)
            {
                registerListeners();
            }

            mPlayer.requestVolumeInfo();
            mPlayer.requestStateInfo();
            mPlayer.requestMuteInfo();
        }
Esempio n. 14
0
        ///////////////////////////////////////////////////////////////////////////
        // These methods handle device finder start hide event.
        ///////////////////////////////////////////////////////////////////////////

        public override void onStarted(SmcDeviceFinder deviceFinder, int error)
        {
            if (error == Smc.SUCCESS)
            {
                mDeviceFinder = deviceFinder;
                if (mType != 0)
                {
                    mDeviceFinder.setDeviceListener(mType, this);
                }
                else
                {
                    mDeviceFinder.setDeviceListener(SmcDevice.TYPE_IMAGEVIEWER, this);
                    mDeviceFinder.setDeviceListener(SmcDevice.TYPE_AVPLAYER, this);
                }
                mDeviceFinder.rescan();
                updateButtonCounter();
                restoreDevice();
            }
        }
Esempio n. 15
0
		public override void onStopped(SmcDeviceFinder deviceFinder)
		{
			if (mDeviceFinder == deviceFinder)
			{
				mDeviceFinder.StatusListener = null;
				mDeviceFinder = null;
			}
		}
Esempio n. 16
0
 public override void onDeviceRemoved(SmcDeviceFinder deviceFinder, SmcDevice SmcDevice, int error)
 {
     refreshDevicesList();
 }
Esempio n. 17
0
        ///////////////////////////////////////////////////////////////////////////
        // This methods handle devices appearing and disappearing in network
        ///////////////////////////////////////////////////////////////////////////

        public override void onDeviceAdded(SmcDeviceFinder deviceFinder, SmcDevice smcDevice)
        {
            refreshDevicesList();
        }
Esempio n. 18
0
		public override void onDeviceRemoved(SmcDeviceFinder deviceFinder, SmcDevice smcDevice, int error)
		{
			// We aren't interested in individual devices, only in their number
			updateButtonCounter();
			//if current device has been removed
			if (smcDevice.Id.Equals(mDeviceId))
			{
				Active = false;
				if (mPickerListener != null)
				{
					mPickerListener.onAllShareDisabled();
				}
			}
		}
Esempio n. 19
0
		///////////////////////////////////////////////////////////////////////////
		// These methods handle devices appearing and disappearing in network.
		///////////////////////////////////////////////////////////////////////////

		public override void onDeviceAdded(SmcDeviceFinder deviceFinder, SmcDevice smcDevice)
		{
			// We aren't interested in individual devices, only in their number
			updateButtonCounter();
		}
Esempio n. 20
0
		public override void onStopped(SmcDeviceFinder deviceFinder)
		{
			if (mDeviceFinder == deviceFinder)
			{
				if (mType != 0)
				{
					mDeviceFinder.setDeviceListener(mType, null);
				}
				else
				{
					mDeviceFinder.setDeviceListener(SmcDevice.TYPE_IMAGEVIEWER, null);
					mDeviceFinder.setDeviceListener(SmcDevice.TYPE_AVPLAYER, null);
				}
				mDeviceFinder.StatusListener = null;
				mDeviceFinder = null;
			}
		}
Esempio n. 21
0
		///////////////////////////////////////////////////////////////////////////
		// These methods handle device finder start hide event.
		///////////////////////////////////////////////////////////////////////////

		public override void onStarted(SmcDeviceFinder deviceFinder, int error)
		{
			if (error == Smc.SUCCESS)
			{
				mDeviceFinder = deviceFinder;
				if (mType != 0)
				{
					mDeviceFinder.setDeviceListener(mType, this);
				}
				else
				{
					mDeviceFinder.setDeviceListener(SmcDevice.TYPE_IMAGEVIEWER, this);
					mDeviceFinder.setDeviceListener(SmcDevice.TYPE_AVPLAYER, this);
				}
				mDeviceFinder.rescan();
				updateButtonCounter();
				restoreDevice();
			}
		}
Esempio n. 22
0
		public override void onDetach()
		{
			if (mDeviceFinder != null)
			{
				mDeviceFinder.stop();
				mDeviceFinder = null;
			}
			base.onDetach();
		}
Esempio n. 23
0
		public override void onActivityCreated(Bundle savedInstanceState)
		{
			base.onActivityCreated(savedInstanceState);

			// The service provider needs to be created after device type is set
			// It could also be created in onStart or onResume, but we the sooner
			// we create it, the sooner we get devices.
			SmcDeviceFinder df = new SmcDeviceFinder(Activity);
			df.StatusListener = this;
			df.start();

		}
Esempio n. 24
0
		/////////////////////////////////////////////////////////////////////////////////
		// SmcDeviceFinder.StatusListener implementation
		/////////////////////////////////////////////////////////////////////////////////

		public override void onStarted(SmcDeviceFinder deviceFinder, int error)
		{
			mDeviceFinder = deviceFinder;
			mPlayer = (SmcAvPlayer) mDeviceFinder.getDevice(mDeviceType, mDeviceId);
			if (mPlayer == null)
			{
				mController.setLocalPlayer();
				return;
			}

			if (mController.CurrentState != PlayerState.STOPPED)
			{
				registerListeners();
			}

			mPlayer.requestVolumeInfo();
			mPlayer.requestStateInfo();
			mPlayer.requestMuteInfo();
		}
Esempio n. 25
0
        ///////////////////////////////////////////////////////////////////////////
        // These methods handle devices appearing and disappearing in network.
        ///////////////////////////////////////////////////////////////////////////

        public override void onDeviceAdded(SmcDeviceFinder deviceFinder, SmcDevice smcDevice)
        {
            // We aren't interested in individual devices, only in their number
            updateButtonCounter();
        }