com.vikingbrain.nmt.operations.playback.StartAodOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of thedavidbox-client4j Show documentation
Show all versions of thedavidbox-client4j Show documentation
A Java HTTP client for consuming TheDavidBox Service API of Networked Media Tank devices
package com.vikingbrain.nmt.operations.playback;
import java.util.LinkedHashMap;
import com.vikingbrain.nmt.operations.ModuleType;
import com.vikingbrain.nmt.operations.OperationType;
import com.vikingbrain.nmt.operations.TheDavidboxOperationFactory;
import com.vikingbrain.nmt.responses.ResponseSimple;
/**
* Operation that starts audio on NMT.
* Execution example http://popcorn:8008/playback?arg0=start_aod&arg1=nombre&arg2=file:///opt/sybhttpd/localhost.drives/SATA_DISK/ztesting/music/mp3.mp3&arg3=show
*
* @author vikingBrain
*/
public class StartAodOperation extends AbstractStartInsertOperation {
/** Operation type. */
private static final OperationType operationType = ModuleType.PLAYBACK.start_aod;
/** Response target class. */
private static final Class responseTargetClass = ResponseSimple.class;
/**
* Constructor. Create the operation with the supplied parameters plus the default client parameters.
* @param operationFactory the operation factory
* @param filePath the file path
*/
public StartAodOperation(TheDavidboxOperationFactory operationFactory, String filePath) {
super(operationFactory, operationType, responseTargetClass, filePath);
}
@Override
/** {@inheritDoc} */
public LinkedHashMap buildHttpArguments(){
//Get http arguments from superclass
LinkedHashMap httpArguments = super.buildHttpArguments();
//Display mode (show: show audio playback, marquee: will only show window marquee,
//hide: will not show anything)
httpArguments.put("arg3", getDisplayMode().getParamValue());
//New in DavidBox SDK 3.4.4
//arg4 http cache (disable/enable)
return httpArguments;
}
@Override
public String toString() {
return "StartAodOperation [getFilePath()=" + getFilePath()
+ ", getDisplayMode()=" + getDisplayMode()
+ ", getOperationType()=" + getOperationType() + "]";
}
}