本文整理匯總了Java中org.jivesoftware.smackx.workgroup.settings.SoundSettings類的典型用法代碼示例。如果您正苦於以下問題:Java SoundSettings類的具體用法?Java SoundSettings怎麽用?Java SoundSettings使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SoundSettings類屬於org.jivesoftware.smackx.workgroup.settings包,在下文中一共展示了SoundSettings類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doGet
import org.jivesoftware.smackx.workgroup.settings.SoundSettings; //導入依賴的package包/類
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String workgroupName = request.getParameter("workgroup");
String action = request.getParameter("action");
Workgroup workgroup = new Workgroup(workgroupName, ChatManager.getInstance().getGlobalConnection());
try {
SoundSettings soundSettings = workgroup.getSoundSettings();
response.setContentType("audio/wav");
if (action != null) {
if ("incoming".equals(action.trim())) {
response.getOutputStream().write(soundSettings.getIncomingSoundBytes());
} else if ("outgoing".equals(action.trim())) {
response.getOutputStream().write(soundSettings.getOutgoingSoundBytes());
}
}
} catch (XMPPException e) {
WebLog.log("Could not load sound settings for workgroup " + workgroupName);
}
}
示例2: getSoundSettings
import org.jivesoftware.smackx.workgroup.settings.SoundSettings; //導入依賴的package包/類
/**
* Asks the workgroup for it's Sound Settings.
*
* @return soundSettings the sound settings for the specified workgroup.
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
*/
public SoundSettings getSoundSettings() throws NoResponseException, XMPPErrorException, NotConnectedException {
SoundSettings request = new SoundSettings();
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
SoundSettings response = (SoundSettings) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
return response;
}