當前位置: 首頁>>代碼示例>>Java>>正文


Java SoundSettings類代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:igniterealtime,項目名稱:Fastpath-webchat,代碼行數:19,代碼來源:SoundServlet.java

示例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;
}
 
開發者ID:TTalkIM,項目名稱:Smack,代碼行數:17,代碼來源:Workgroup.java


注:本文中的org.jivesoftware.smackx.workgroup.settings.SoundSettings類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。