Back to index

libsfml  1.6+dfsg2
Public Member Functions | Private Member Functions | Private Attributes
NetworkRecorder Class Reference

Specialization of audio recorder for sending recorded audio data through the network /////////////////////////////////////////////////////////. More...

List of all members.

Public Member Functions

 NetworkRecorder (sf::SocketTCP Socket)
 Constructor.

Private Member Functions

virtual bool OnProcessSamples (const sf::Int16 *Samples, std::size_t SamplesCount)
 /see SoundRecorder::ProcessSamples

Private Attributes

sf::SocketTCP mySocket
 Socket used to communicate with the server.

Detailed Description

Specialization of audio recorder for sending recorded audio data through the network /////////////////////////////////////////////////////////.

Definition at line 18 of file Client.cpp.


Constructor & Destructor Documentation

NetworkRecorder::NetworkRecorder ( sf::SocketTCP  Socket) [inline]

Constructor.

Parameters:
Socket: Socket that holds the connection with the server

/////////////////////////////////////////////////////////

Definition at line 28 of file Client.cpp.

                                        :
    mySocket(Socket)
    {

    }

Member Function Documentation

virtual bool NetworkRecorder::OnProcessSamples ( const sf::Int16 *  Samples,
std::size_t  SamplesCount 
) [inline, private, virtual]

/see SoundRecorder::ProcessSamples

/////////////////////////////////////////////////////////

Definition at line 40 of file Client.cpp.

    {
        // Pack the audio samples into a network packet
        sf::Packet PacketOut;
        PacketOut << AudioData;
        PacketOut.Append(Samples, SamplesCount * sizeof(sf::Int16));

        // Send the audio packet to the server
        return mySocket.Send(PacketOut) == sf::Socket::Done;
    }

Member Data Documentation

sf::SocketTCP NetworkRecorder::mySocket [private]

Socket used to communicate with the server.

Definition at line 54 of file Client.cpp.


The documentation for this class was generated from the following file: