Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 299:3ede63861103
create SoundPacketQueue.
author | oc |
---|---|
date | Thu, 15 Jan 2015 17:55:11 +0900 |
parents | a9b8514a7c0e |
children | 0b75fdbb8c11 |
files | src/main/java/com/glavsoft/rfb/protocol/MessageQueue.java src/main/java/com/glavsoft/rfb/protocol/Protocol.java src/main/java/jp/ac/u_ryukyu/treevnc/SoundPacketQueue.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java |
diffstat | 4 files changed, 28 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/MessageQueue.java Thu Jan 15 04:09:56 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/MessageQueue.java Thu Jan 15 17:55:11 2015 +0900 @@ -25,7 +25,6 @@ package com.glavsoft.rfb.protocol; import com.glavsoft.rfb.client.ClientToServerMessage; - import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit;
--- a/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Thu Jan 15 04:09:56 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Thu Jan 15 17:55:11 2015 +0900 @@ -91,6 +91,7 @@ // continue; } this.messageQueue = new MessageQueue(); + // ここでsoundpacketqueueを作成する } @Override
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/SoundPacketQueue.java Thu Jan 15 17:55:11 2015 +0900 @@ -0,0 +1,26 @@ +package jp.ac.u_ryukyu.treevnc; + +import com.glavsoft.rfb.encoding.decoder.ByteBuffer; + +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.TimeUnit; + +/** + * Created by OcBookPro on 15/01/15. + */ +public class SoundPacketQueue { + + private final BlockingQueue<byte[]> queue; + + public SoundPacketQueue(BlockingQueue<byte[]> queue) { + this.queue = queue; + } + + public void put(byte[] packet) { + queue.offer(packet); + } + + public byte[] get() throws InterruptedException { + return queue.poll(1, TimeUnit.SECONDS); + } +}
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Thu Jan 15 04:09:56 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Thu Jan 15 17:55:11 2015 +0900 @@ -876,7 +876,7 @@ }); kbdButtons.add(screenButton); - final JButton soundButton = buttonsBar.createButton("share-screen-sound", "Share Screen and Sound", new ActionListener() { + final JButton soundButton = buttonsBar.createButton("share-sound", "Shara Sound", new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // 再生するかどうかボタンにしよう