RetroShare/plugins/VOIP/gui/VOIPChatWidgetHolder.h
2015-03-21 21:25:17 +00:00

72 lines
1.7 KiB
C++

#include <QObject>
#include <QGraphicsEffect>
#include <gui/SpeexProcessor.h>
#include <gui/chat/ChatWidget.h>
#include <gui/common/RsButtonOnText.h>
class QToolButton;
class QAudioInput;
class QAudioOutput;
class QVideoInputDevice ;
class QVideoOutputDevice ;
class VideoEncoder ;
class VideoDecoder ;
#define VOIP_SOUND_INCOMING_CALL "VOIP_incoming_call"
class VOIPChatWidgetHolder : public QObject, public ChatWidgetHolder
{
Q_OBJECT
public:
VOIPChatWidgetHolder(ChatWidget *chatWidget);
virtual ~VOIPChatWidgetHolder();
virtual void updateStatus(int status);
void addAudioData(const QString name, QByteArray* array) ;
void addVideoData(const QString name, QByteArray* array) ;
void setAcceptedBandwidth(const QString name, uint32_t bytes_per_sec) ;
private slots:
void toggleAudioListen();
void toggleAudioCapture();
void toggleVideoCapture();
void startVideoCapture();
void hangupCall() ;
void botMouseEnter();
void botMouseLeave();
public slots:
void sendAudioData();
void sendVideoData();
protected:
// Audio input/output
QAudioInput* inputAudioDevice;
QAudioOutput* outputAudioDevice;
QtSpeex::SpeexInputProcessor* inputAudioProcessor;
QtSpeex::SpeexOutputProcessor* outputAudioProcessor;
// Video input/output
QVideoOutputDevice *outputVideoDevice;
QVideoOutputDevice *echoVideoDevice;
QVideoInputDevice *inputVideoDevice;
QWidget *videoWidget ; // pointer to call show/hide
VideoEncoder *inputVideoProcessor;
VideoDecoder *outputVideoProcessor;
// Additional buttons to the chat bar
QToolButton *audioListenToggleButton ;
QToolButton *audioCaptureToggleButton ;
QToolButton *videoCaptureToggleButton ;
QToolButton *hangupButton ;
typedef QMap<QString, RSButtonOnText*> button_map;
button_map buttonMapTakeVideo;
};