corrade-vassal – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 vero 1 /*
2 * Copyright (c) 2006-2014, openmetaverse.org
3 * All rights reserved.
4 *
5 * - Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * - Redistributions of source code must retain the above copyright notice, this
9 * list of conditions and the following disclaimer.
10 * - Neither the name of the openmetaverse.org nor the names
11 * of its contributors may be used to endorse or promote products derived from
12 * this software without specific prior written permission.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 * POSSIBILITY OF SUCH DAMAGE.
25 */
26  
27 using System;
28 using System.Collections.Generic;
29 using System.Text;
30  
31 namespace OpenMetaverse.Voice
32 {
33 public partial class VoiceGateway
34 {
35 /// <summary>
36 /// This is used to initialize and stop the Connector as a whole. The Connector
37 /// Create call must be completed successfully before any other requests are made
38 /// (typically during application initialization). The shutdown should be called
39 /// when the application is shutting down to gracefully release resources
40 /// </summary>
41 /// <param name="ClientName">A string value indicting the Application name</param>
42 /// <param name="AccountManagementServer">URL for the management server</param>
43 /// <param name="Logging">LoggingSettings</param>
44 /// <param name="MaximumPort"></param>
45 /// <param name="MinimumPort"></param>
46 public int ConnectorCreate(string ClientName, string AccountManagementServer, ushort MinimumPort,
47 ushort MaximumPort, VoiceLoggingSettings Logging)
48 {
49 StringBuilder sb = new StringBuilder();
50 sb.Append(VoiceGateway.MakeXML("ClientName", ClientName));
51 sb.Append(VoiceGateway.MakeXML("AccountManagementServer", AccountManagementServer));
52 sb.Append(VoiceGateway.MakeXML("MinimumPort", MinimumPort.ToString()));
53 sb.Append(VoiceGateway.MakeXML("MaximumPort", MaximumPort.ToString()));
54 sb.Append(VoiceGateway.MakeXML("Mode", "Normal"));
55 sb.Append("<Logging>");
56 sb.Append(VoiceGateway.MakeXML("Enabled", Logging.Enabled ? "true" : "false"));
57 sb.Append(VoiceGateway.MakeXML("Folder", Logging.Folder));
58 sb.Append(VoiceGateway.MakeXML("FileNamePrefix", Logging.FileNamePrefix));
59 sb.Append(VoiceGateway.MakeXML("FileNameSuffix", Logging.FileNameSuffix));
60 sb.Append(VoiceGateway.MakeXML("LogLevel", Logging.LogLevel.ToString()));
61 sb.Append("</Logging>");
62 return Request("Connector.Create.1", sb.ToString());
63 }
64  
65 /// <summary>
66 /// Shutdown Connector -- Should be called when the application is shutting down
67 /// to gracefully release resources
68 /// </summary>
69 /// <param name="ConnectorHandle">Handle returned from successful Connector ‘create’ request</param>
70 public int ConnectorInitiateShutdown(string ConnectorHandle)
71 {
72 string RequestXML = VoiceGateway.MakeXML("ConnectorHandle", ConnectorHandle);
73 return Request("Connector.InitiateShutdown.1", RequestXML);
74 }
75  
76 /// <summary>
77 /// Mute or unmute the microphone
78 /// </summary>
79 /// <param name="ConnectorHandle">Handle returned from successful Connector ‘create’ request</param>
80 /// <param name="Mute">true (mute) or false (unmute)</param>
81 public int ConnectorMuteLocalMic(string ConnectorHandle, bool Mute)
82 {
83 StringBuilder sb = new StringBuilder();
84 sb.Append(VoiceGateway.MakeXML("ConnectorHandle", ConnectorHandle));
85 sb.Append(VoiceGateway.MakeXML("Value", Mute ? "true" : "false"));
86 return Request("Connector.MuteLocalMic.1", sb.ToString());
87 }
88  
89 /// <summary>
90 /// Mute or unmute the speaker
91 /// </summary>
92 /// <param name="ConnectorHandle">Handle returned from successful Connector ‘create’ request</param>
93 /// <param name="Mute">true (mute) or false (unmute)</param>
94 public int ConnectorMuteLocalSpeaker(string ConnectorHandle, bool Mute)
95 {
96 StringBuilder sb = new StringBuilder();
97 sb.Append(VoiceGateway.MakeXML("ConnectorHandle", ConnectorHandle));
98 sb.Append(VoiceGateway.MakeXML("Value", Mute ? "true" : "false"));
99 return Request("Connector.MuteLocalSpeaker.1", sb.ToString());
100 }
101  
102 /// <summary>
103 /// Set microphone volume
104 /// </summary>
105 /// <param name="ConnectorHandle">Handle returned from successful Connector ‘create’ request</param>
106 /// <param name="Value">The level of the audio, a number between -100 and 100 where
107 /// 0 represents ‘normal’ speaking volume</param>
108 public int ConnectorSetLocalMicVolume(string ConnectorHandle, int Value)
109 {
110 StringBuilder sb = new StringBuilder();
111 sb.Append(VoiceGateway.MakeXML("ConnectorHandle", ConnectorHandle));
112 sb.Append(VoiceGateway.MakeXML("Value", Value.ToString()));
113 return Request("Connector.SetLocalMicVolume.1", sb.ToString());
114 }
115  
116 /// <summary>
117 /// Set local speaker volume
118 /// </summary>
119 /// <param name="ConnectorHandle">Handle returned from successful Connector ‘create’ request</param>
120 /// <param name="Value">The level of the audio, a number between -100 and 100 where
121 /// 0 represents ‘normal’ speaking volume</param>
122 public int ConnectorSetLocalSpeakerVolume(string ConnectorHandle, int Value)
123 {
124 StringBuilder sb = new StringBuilder();
125 sb.Append(VoiceGateway.MakeXML("ConnectorHandle", ConnectorHandle));
126 sb.Append(VoiceGateway.MakeXML("Value", Value.ToString()));
127 return Request("Connector.SetLocalSpeakerVolume.1", sb.ToString());
128 }
129 }
130 }