Example #1
0
 public virtual void onDeviceSelected(SmcDevice device)
 {
     outerInstance.mProvider = (SmcProvider)device;
     //set listeners and browse the root folder
     outerInstance.mProvider.ResponseListener = outerInstance;
     outerInstance.mProvider.ResponseListener = outerInstance;
     outerInstance.browse(outerInstance.mProvider.RootFolder);
 }
Example #2
0
        // ////////////////////////////////////////////////////////////////////////
        // These methods handle the device DevicePicker events.
        // ////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// User selected remote player, connect to that device and start playback.
        /// </summary>
        public virtual void onDeviceSelected(SmcDevice device)
        {
            if (mState.mDeviceId == null)
            {
                updateStatusMessage([email protected]_connecting);
                mState.mDeviceId = device.Id;
                mPlayerController.setRemotePlayer(device.Id, SmcDevice.TYPE_AVPLAYER);
            }
        }
Example #3
0
 public virtual void onDeviceSelected(SmcDevice device)
 {
     outerInstance.mPlayer = device;
     //if there was an item requested to play before, then play it
     if (outerInstance.mItemToPlay != null)
     {
         outerInstance.playItem(outerInstance.mItemToPlay);
         outerInstance.mItemToPlay = null;
     }
 }
Example #4
0
        protected internal override void onListItemClick(ListView l, View v, int position, long id)
        {
            SmcDevice device = mDevices[position];
            Intent    ret    = new Intent();

            ret.putExtra("deviceId", device.Id);
            ret.putExtra("deviceName", device.Name);
            ret.putExtra("deviceType", device.DeviceType);
            setResult(RESULT_OK, ret);
            finish();
        }
Example #5
0
 private void restoreDevice()
 {
     if (mDeviceFinder != null && mDeviceId != null && mPickerListener != null)
     {
         SmcDevice d = mDeviceFinder.getDevice(mSelectedType, mDeviceId);
         if (d != null)
         {
             mPickerListener.onDeviceSelected(d);
             Active = true;
         }
     }
 }
Example #6
0
 public virtual void onDeviceSelected(SmcDevice device)
 {
     mUploadButton.Enabled = true;
     provider = (SmcProvider)device;
     provider.EventListener    = this;
     provider.ResponseListener = this;
     mUploadButton.Enabled     = provider.Uploadable;
     if (!provider.Uploadable)
     {
         Toast.makeText(this, "This provider doesn't support file upload", Toast.LENGTH_SHORT).show();
     }
 }
Example #7
0
            public override View getView(int position, View convertView, ViewGroup parent)
            {
                if (convertView == null)
                {
                    convertView = LayoutInflater.inflate(R.layout.device_item, null);
                }

                TextView  label = (TextView)convertView.findViewById(R.id.deviceName);
                ImageView icon  = (ImageView)convertView.findViewById(R.id.deviceIcon);

                SmcDevice device = outerInstance.mDevices[position];

                if (device is SmcImageViewer)
                {
                    label.Text = "[ImageViewer] " + device.Name;
                }
                else if (device is SmcAvPlayer)
                {
                    label.Text = "[AVPlayer] " + device.Name;
                }
                else if (device is SmcProvider)
                {
                    label.Text = "[Provider] " + device.Name;
                }
                else
                {
                    label.Text = device.Name;
                }
                Uri iconPath = device.IconUri;

                icon.Tag = iconPath;
                if (iconPath != null)
                {
                    Bitmap b = mIconsCache.get(iconPath);
                    if (b == null)
                    {
                        // Clear the image so we don't display stale icon.
                        icon.ImageResource = R.drawable.ic_launcher;
                        (new IconLoader(this, icon)).execute(iconPath);
                    }
                    else
                    {
                        icon.ImageBitmap = b;
                    }
                }
                else
                {
                    icon.ImageResource = R.drawable.ic_launcher;
                }

                return(convertView);
            }
Example #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();
         }
     }
 }
Example #9
0
        /// <summary>
        /// Callback when user has selected device in device select activity.
        /// </summary>
        public override void onActivityResult(int requestCode, int resultCode, Intent data)
        {
            if (resultCode == Activity.RESULT_OK)
            {
                mDeviceId = data.getStringExtra("deviceId");
                int type = data.getIntExtra("deviceType", -1);

                if (mDeviceFinder != null && mPickerListener != null)
                {
                    SmcDevice d = mDeviceFinder.getDevice(type, mDeviceId);
                    if (d != null)
                    {
                        mSelectedType = type;
                        mPickerListener.onDeviceSelected(d);
                        Active = true;
                    }
                }
            }
        }
Example #10
0
		public virtual void onDeviceSelected(SmcDevice device)
		{
			mUploadButton.Enabled = true;
			provider = (SmcProvider) device;
			provider.EventListener = this;
			provider.ResponseListener = this;
			mUploadButton.Enabled = provider.Uploadable;
			if (!provider.Uploadable)
			{
				Toast.makeText(this, "This provider doesn't support file upload", Toast.LENGTH_SHORT).show();
			}
		}
Example #11
0
 public override void onDeviceRemoved(SmcDeviceFinder deviceFinder, SmcDevice SmcDevice, int error)
 {
     refreshDevicesList();
 }
Example #12
0
        ///////////////////////////////////////////////////////////////////////////
        // This methods handle devices appearing and disappearing in network
        ///////////////////////////////////////////////////////////////////////////

        public override void onDeviceAdded(SmcDeviceFinder deviceFinder, SmcDevice smcDevice)
        {
            refreshDevicesList();
        }
		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();
				}
			}
		}
		///////////////////////////////////////////////////////////////////////////
		// 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();
		}
		// ////////////////////////////////////////////////////////////////////////
		// These methods handle the device DevicePicker events.
		// ////////////////////////////////////////////////////////////////////////

		/// <summary>
		/// User selected remote player, connect to that device and start playback.
		/// </summary>
		public virtual void onDeviceSelected(SmcDevice device)
		{
			if (mState.mDeviceId == null)
			{
				updateStatusMessage([email protected]_connecting);
				mState.mDeviceId = device.Id;
				mPlayerController.setRemotePlayer(device.Id, SmcDevice.TYPE_AVPLAYER);
			}
		}
Example #16
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();
        }