Mercurial > hg > Applications > TreeVNC
changeset 289:bb94d3e567ba
add share sound button and add sound encoding type.
author | oc |
---|---|
date | Tue, 13 Jan 2015 04:41:12 +0900 |
parents | 0b61b7214ece |
children | c10e0dee7bbb |
files | src/main/java/com/glavsoft/rfb/encoding/EncodingType.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java |
diffstat | 3 files changed, 18 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/EncodingType.java Mon Jan 12 21:29:41 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/EncodingType.java Tue Jan 13 04:41:12 2015 +0900 @@ -75,6 +75,11 @@ SEND_SINGLE_DISPLAY_WIDTH(18, "SEND_SINGLE_DISPLAY_WIDTH"), /** + * share sound. + */ + SOUND(19, "SOUND"), + + /** * Transmit initial data of new display */ INIT_DATA(0xFFFFFF10, "InitData"),
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Mon Jan 12 21:29:41 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Tue Jan 13 04:41:12 2015 +0900 @@ -299,6 +299,8 @@ sendCheckDelayReply(rect.time, port, address); } else if (rect.getEncodingType() == EncodingType.SEND_SINGLE_DISPLAY_WIDTH) { rfb.singleWidth = rect.width; + } else if (rect.getEncodingType() == EncodingType.SOUND) { + // SOUNDを受信した時の処理を } else throw new CommonException("Unprocessed encoding: " + rect.toString()); }
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Mon Jan 12 21:29:41 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Tue Jan 13 04:41:12 2015 +0900 @@ -870,7 +870,7 @@ int rightScreenNumber = 1; viewer.getRfb().singleWidth = (int) rectangles.get(leftScreenNumber).getWidth(); - if (viewer.getRfb().isTreeManager()) { + if (viewer.getRfb().isTreeManager()) { try { viewer.getRfb().changeVNCServer(viewer, "127.0.0.1", (int) rectangles.get(leftScreenNumber).getWidth(), (int) rectangles.get(leftScreenNumber).getHeight(), viewer.getRfb().getId()); } catch (Exception e1) { @@ -901,6 +901,16 @@ }); kbdButtons.add(adjustHdSizeButton); + final JButton soundButton = buttonsBar.createButton("share-sound", "Share Sound", new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + // ここにsound共有始める処理を書く + if (viewer.getRfb().isTreeManager()) { + return; + } + } + }); + kbdButtons.add(adjustHdSizeButton); ModifierButtonEventListener modifierButtonListener = new ModifierButtonEventListener();