org.fourthline.cling.support.avtransport.callback.Stop Java Examples

The following examples show how to use org.fourthline.cling.support.avtransport.callback.Stop. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PlaybackCommand.java    From BeyondUPnP with Apache License 2.0 6 votes vote down vote up
public static void stop() {
    Device device = SystemManager.getInstance().getSelectedDevice();
    //Check selected device
    if (device == null) return;

    Service avtService = device.findService(SystemManager.AV_TRANSPORT_SERVICE);
    if (avtService != null) {
        ControlPoint cp = SystemManager.getInstance().getControlPoint();
        cp.execute(new Stop(avtService) {
            @Override
            public void success(ActionInvocation invocation) {
                Log.i(TAG, "Stop success.");
            }

            @Override
            public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2) {
                Log.e(TAG, "Stop failed");
            }
        });
    }
}
 
Example #2
Source File: DLNAController.java    From Popeens-DSub with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void shutdown() {
	try {
		controlPoint.execute(new Stop(getTransportService()) {
			@Override
			public void failure(ActionInvocation invocation, org.fourthline.cling.model.message.UpnpResponse operation, String defaultMessage) {
				Log.w(TAG, "Stop failed: " + defaultMessage);
			}
		});
	} catch(Exception e) {
		Log.w(TAG, "Failed to shutdown", e);
	}

	if(callback != null) {
		callback.end();
		callback = null;
	}

	if(proxy != null) {
		proxy.stop();
		proxy = null;
	}

	running = false;
}