public override void onStarted(SmcDeviceFinder deviceFinder, int error) { mDeviceFinder = deviceFinder; mDeviceFinder.setDeviceListener(mType, this); mDeviceFinder.rescan(); refreshDevicesList(); }
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; } }
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; } }
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(); }
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(); } } }
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(); }
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; } }
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(); }
/////////////////////////////////////////////////////////////////////////// // 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(); } }
public override void onDeviceRemoved(SmcDeviceFinder deviceFinder, SmcDevice SmcDevice, int error) { refreshDevicesList(); }
/////////////////////////////////////////////////////////////////////////// // This methods handle devices appearing and disappearing in network /////////////////////////////////////////////////////////////////////////// public override void onDeviceAdded(SmcDeviceFinder deviceFinder, SmcDevice smcDevice) { refreshDevicesList(); }
/////////////////////////////////////////////////////////////////////////// // 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(); }
///////////////////////////////////////////////////////////////////////////////// // 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(); }