public override void onStarted(SmcDeviceFinder deviceFinder, int error)
 {
     mDeviceFinder = deviceFinder;
     mDeviceFinder.setDeviceListener(mType, this);
     mDeviceFinder.rescan();
     refreshDevicesList();
 }
Ejemplo 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();
        }
Ejemplo n.º 3
0
 public override void onStopped(SmcDeviceFinder deviceFinder)
 {
     if (mDeviceFinder == deviceFinder)
     {
         mDeviceFinder.StatusListener = null;
         mDeviceFinder = null;
     }
 }
Ejemplo 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;
     }
 }
Ejemplo 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();
        }
Ejemplo n.º 7
0
		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();
		}
Ejemplo 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();
         }
     }
 }
Ejemplo n.º 9
0
        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();
        }
Ejemplo 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();
 }
Ejemplo 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;
     }
 }
Ejemplo 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;
     }
 }
Ejemplo n.º 13
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();
        }
Ejemplo 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();
            }
        }
Ejemplo n.º 15
0
		public override void onStopped(SmcDeviceFinder deviceFinder)
		{
			if (mDeviceFinder == deviceFinder)
			{
				mDeviceFinder.StatusListener = null;
				mDeviceFinder = null;
			}
		}
Ejemplo n.º 16
0
 public override void onDeviceRemoved(SmcDeviceFinder deviceFinder, SmcDevice SmcDevice, int error)
 {
     refreshDevicesList();
 }
Ejemplo n.º 17
0
        ///////////////////////////////////////////////////////////////////////////
        // This methods handle devices appearing and disappearing in network
        ///////////////////////////////////////////////////////////////////////////

        public override void onDeviceAdded(SmcDeviceFinder deviceFinder, SmcDevice smcDevice)
        {
            refreshDevicesList();
        }
Ejemplo 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();
				}
			}
		}
Ejemplo 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();
		}
Ejemplo 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;
			}
		}
Ejemplo 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();
			}
		}
Ejemplo n.º 22
0
		public override void onDetach()
		{
			if (mDeviceFinder != null)
			{
				mDeviceFinder.stop();
				mDeviceFinder = null;
			}
			base.onDetach();
		}
Ejemplo 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();

		}
Ejemplo 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();
		}
Ejemplo 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();
        }