|
| Live_Microphone (Node _client) |
|
async Task | RecvThread () |
| Asynchronously receives data from MicNode and adds audio to the player if playing.
|
|
void | TempOnDisconnect (Node node) |
| Disconnects the client and microphone node if they match the provided node, and closes the form if it is not disposed.
|
|
async Task | RefreshMics () |
| Asynchronously refreshes the list of microphones and updates the UI components accordingly.
|
|
async Task< string[]> | GetMicroPhones () |
| Asynchronously retrieves the list of microphones available from the client and returns the result.
|
|
async Task | SetMicroPhone (int index) |
| Sets the microphone using the specified index.
|
|
|
override void | OnFormClosing (FormClosingEventArgs e) |
| Releases the unmanaged resources used by the Form and its components when the form is closing.
|
|
override void | Dispose (bool disposing) |
| Releases the unmanaged resources used by the Component and optionally releases the managed resources.
|
|
|
async Task | InitializeAsync () |
| Initializes the asynchronous task by creating a mic node, adding temporary on disconnect, refreshing microphones, and starting the receive thread.
|
|
async Task< Node > | CreateMicNode () |
| Creates a MicNode and returns it. If MicNode already exists, returns the existing MicNode.
|
|
void | Live_Microphone_Load (object sender, EventArgs e) |
| Event handler for the form load event.
|
|
async void | button2_Click (object sender, EventArgs e) |
| Starts the player and sends a signal to the client to start playing.
|
|
async void | button3_Click (object sender, EventArgs e) |
| Handles the click event for button3, stopping the player and sending a stop signal to the client.
|
|
async void | button1_Click (object sender, EventArgs e) |
| Asynchronously refreshes the microphones and updates the UI.
|
|
async void | comboBox1_SelectedIndexChanged (object sender, EventArgs e) |
| Handles the SelectedIndexChanged event of comboBox1.
|
|
void | InitializeComponent () |
| Initializes the components of the form including the combo box, labels, and buttons.
|
|
◆ Live_Microphone()
xeno_rat_server.Forms.Live_Microphone.Live_Microphone |
( |
Node | _client | ) |
|
|
inline |
◆ button1_Click()
async void xeno_rat_server.Forms.Live_Microphone.button1_Click |
( |
object | sender, |
|
|
EventArgs | e ) |
|
inlineprivate |
Asynchronously refreshes the microphones and updates the UI.
This method triggers the asynchronous refresh of the available microphones and updates the user interface accordingly.
◆ button2_Click()
async void xeno_rat_server.Forms.Live_Microphone.button2_Click |
( |
object | sender, |
|
|
EventArgs | e ) |
|
inlineprivate |
Starts the player and sends a signal to the client to start playing.
This method enables the start button, disables the stop and pause buttons, starts the player, and sends a signal to the client to start playing.
◆ button3_Click()
async void xeno_rat_server.Forms.Live_Microphone.button3_Click |
( |
object | sender, |
|
|
EventArgs | e ) |
|
inlineprivate |
Handles the click event for button3, stopping the player and sending a stop signal to the client.
- Parameters
-
sender | The object that raised the event. |
e | The event data. |
This method disables button3 and enables button2 and button1. It stops the player and sends a stop signal to the client using asynchronous communication.
◆ comboBox1_SelectedIndexChanged()
async void xeno_rat_server.Forms.Live_Microphone.comboBox1_SelectedIndexChanged |
( |
object | sender, |
|
|
EventArgs | e ) |
|
inlineprivate |
Handles the SelectedIndexChanged event of comboBox1.
- Parameters
-
sender | The source of the event. |
e | The EventArgs that contains the event data. |
This method sets the microphone based on the selected index in comboBox1. If the selected index is not -1, it calls the SetMicroPhone method asynchronously and awaits its completion.
◆ CreateMicNode()
async Task< Node > xeno_rat_server.Forms.Live_Microphone.CreateMicNode |
( |
| ) |
|
|
inlineprivate |
Creates a MicNode and returns it. If MicNode already exists, returns the existing MicNode.
- Returns
- The created or existing MicNode.
- Exceptions
-
Exception | Thrown when an error occurs during the creation of MicNode. |
◆ Dispose()
override void xeno_rat_server.Forms.Live_Microphone.Dispose |
( |
bool | disposing | ) |
|
|
inlineprotected |
Releases the unmanaged resources used by the Component and optionally releases the managed resources.
- Parameters
-
disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
This method releases the unmanaged resources used by the Component and optionally releases the managed resources. If disposing is true, this method releases all resources held by any managed objects that this Component references. This method is called by the public Dispose() method and the Finalize method.
◆ GetMicroPhones()
async Task< string[]> xeno_rat_server.Forms.Live_Microphone.GetMicroPhones |
( |
| ) |
|
|
inline |
Asynchronously retrieves the list of microphones available from the client and returns the result.
- Returns
- An array of strings containing the list of available microphones.
This method sends an opcode to the client to request the list of microphones, receives the number of microphones available, and then retrieves the names of the microphones one by one. The retrieved microphone names are stored in an array and assigned to the MicroPhones property of the class.
◆ InitializeAsync()
async Task xeno_rat_server.Forms.Live_Microphone.InitializeAsync |
( |
| ) |
|
|
inlineprivate |
Initializes the asynchronous task by creating a mic node, adding temporary on disconnect, refreshing microphones, and starting the receive thread.
- Returns
- An asynchronous task representing the initialization process.
This method initializes the asynchronous task by performing the following steps:
- Creates a mic node by awaiting the result of the CreateMicNode method.
- Adds temporary on disconnect by invoking the AddTempOnDisconnect method of the mic node.
- Refreshes microphones by awaiting the result of the RefreshMics method.
- Starts the receive thread by invoking the RecvThread method.
◆ InitializeComponent()
void xeno_rat_server.Forms.Live_Microphone.InitializeComponent |
( |
| ) |
|
|
inlineprivate |
Initializes the components of the form including the combo box, labels, and buttons.
This method initializes the components of the form including the combo box, labels, and buttons. It sets up the properties and event handlers for the form controls such as combo box, labels, and buttons.
◆ Live_Microphone_Load()
void xeno_rat_server.Forms.Live_Microphone.Live_Microphone_Load |
( |
object | sender, |
|
|
EventArgs | e ) |
|
inlineprivate |
Event handler for the form load event.
- Parameters
-
sender | The object that raised the event. |
e | The event data. |
◆ OnFormClosing()
override void xeno_rat_server.Forms.Live_Microphone.OnFormClosing |
( |
FormClosingEventArgs | e | ) |
|
|
inlineprotected |
Releases the unmanaged resources used by the Form and its components when the form is closing.
- Parameters
-
e | A FormClosingEventArgs that contains the event data. |
This method disposes the player object, releasing any unmanaged resources used by the player.
◆ RecvThread()
async Task xeno_rat_server.Forms.Live_Microphone.RecvThread |
( |
| ) |
|
|
inline |
Asynchronously receives data from MicNode and adds audio to the player if playing.
This method continuously receives data from MicNode while it is connected. If the received data is null, the method breaks the loop. If the player is in the playing state, the received audio data is added to the player.
- Exceptions
-
InvalidOperationException | Thrown when the MicNode is not connected. |
- Returns
- A task representing the asynchronous operation.
◆ RefreshMics()
async Task xeno_rat_server.Forms.Live_Microphone.RefreshMics |
( |
| ) |
|
|
inline |
Asynchronously refreshes the list of microphones and updates the UI components accordingly.
This method retrieves the list of available microphones using the GetMicroPhones method and updates the items in the comboBox1 accordingly. If the list of microphones is empty, it disables the button2. Otherwise, it enables the button and sets the first microphone using the SetMicroPhone method.
- Exceptions
-
Exception | Thrown when an error occurs while retrieving the list of microphones. |
- Returns
- A task representing the asynchronous operation.
◆ SetMicroPhone()
async Task xeno_rat_server.Forms.Live_Microphone.SetMicroPhone |
( |
int | index | ) |
|
|
inline |
Sets the microphone using the specified index.
- Parameters
-
index | The index of the microphone to be set. |
- Returns
- A Task representing the asynchronous operation.
This method sends a byte array opcode with a value of 2 to the client asynchronously using client.SendAsync(byte[]). Then it sends the index converted to bytes to the client asynchronously using client.SendAsync(byte[]).
◆ TempOnDisconnect()
void xeno_rat_server.Forms.Live_Microphone.TempOnDisconnect |
( |
Node | node | ) |
|
|
inline |
Disconnects the client and microphone node if they match the provided node, and closes the form if it is not disposed.
- Parameters
-
node | The node to be compared with the client and microphone node. |
If the provided node matches the client or the microphone node (if not null), this method disconnects them. If the form is not disposed, it is closed using a method invocation.
◆ button1
System.Windows.Forms.Button xeno_rat_server.Forms.Live_Microphone.button1 |
|
private |
◆ button2
System.Windows.Forms.Button xeno_rat_server.Forms.Live_Microphone.button2 |
|
private |
◆ button3
System.Windows.Forms.Button xeno_rat_server.Forms.Live_Microphone.button3 |
|
private |
◆ client
Node xeno_rat_server.Forms.Live_Microphone.client |
|
private |
◆ comboBox1
System.Windows.Forms.ComboBox xeno_rat_server.Forms.Live_Microphone.comboBox1 |
|
private |
◆ components
System.ComponentModel.IContainer xeno_rat_server.Forms.Live_Microphone.components = null |
|
private |
Required designer variable.
◆ label1
System.Windows.Forms.Label xeno_rat_server.Forms.Live_Microphone.label1 |
|
private |
◆ MicNode
Node xeno_rat_server.Forms.Live_Microphone.MicNode |
|
private |
◆ MicroPhones
string [] xeno_rat_server.Forms.Live_Microphone.MicroPhones |
|
private |
◆ player
◆ playing
bool xeno_rat_server.Forms.Live_Microphone.playing = false |
|
private |
The documentation for this class was generated from the following files: