Added bell (pcspeaker) support
This commit is contained in:
parent
36ef046e3c
commit
104f762e5d
@ -108,7 +108,7 @@
|
||||
#define RDP_DATA_PDU_POINTER 27
|
||||
#define RDP_DATA_PDU_INPUT 28
|
||||
#define RDP_DATA_PDU_SYNCHRONISE 31
|
||||
#define RDP_DATA_PDU_BELL 34
|
||||
#define RDP_DATA_PDU_PLAY_SOUND 34
|
||||
#define RDP_DATA_PDU_LOGON 38
|
||||
#define RDP_DATA_PDU_FONT2 39
|
||||
#define RDP_DATA_PDU_DISCONNECT 47
|
||||
|
@ -168,6 +168,36 @@ libxrdp_send_palette(struct xrdp_session* session, int* palette)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int EXPORT_CC
|
||||
libxrdp_send_bell(struct xrdp_session* session)
|
||||
{
|
||||
struct stream* s = (struct stream *)NULL;
|
||||
|
||||
DEBUG(("libxrdp_send_bell sending bell signal"));
|
||||
/* see MS documentation: Server play sound PDU, TS_PLAY_SOUND_PDU_DATA */
|
||||
|
||||
make_stream(s);
|
||||
init_stream(s, 8192);
|
||||
|
||||
if (xrdp_rdp_init_data((struct xrdp_rdp*)session->rdp, s) != 0)
|
||||
{
|
||||
free_stream(s);
|
||||
return 1;
|
||||
}
|
||||
out_uint32_le(s, 440); /* frequency */
|
||||
out_uint32_le(s, 100); /* duration (ms) */
|
||||
s_mark_end(s);
|
||||
if (xrdp_rdp_send_data((struct xrdp_rdp*)session->rdp, s, RDP_DATA_PDU_PLAY_SOUND) != 0)
|
||||
{
|
||||
free_stream(s);
|
||||
return 1;
|
||||
}
|
||||
free_stream(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
int EXPORT_CC
|
||||
libxrdp_send_bitmap(struct xrdp_session* session, int width, int height,
|
||||
|
@ -125,6 +125,8 @@ libxrdp_process_data(struct xrdp_session* session);
|
||||
int DEFAULT_CC
|
||||
libxrdp_send_palette(struct xrdp_session* session, int* palette);
|
||||
int DEFAULT_CC
|
||||
libxrdp_send_bell(struct xrdp_session* session);
|
||||
int DEFAULT_CC
|
||||
libxrdp_send_bitmap(struct xrdp_session* session, int width, int height,
|
||||
int bpp, char* data, int x, int y, int cx, int cy);
|
||||
int DEFAULT_CC
|
||||
|
@ -890,7 +890,7 @@ rdp_rdp_process_data_pdu(struct rdp_rdp* self, struct stream* s)
|
||||
case RDP_DATA_PDU_POINTER:
|
||||
rv = rdp_rdp_process_pointer_pdu(self, s);
|
||||
break;
|
||||
case RDP_DATA_PDU_BELL:
|
||||
case RDP_DATA_PDU_PLAY_SOUND:
|
||||
break;
|
||||
case RDP_DATA_PDU_LOGON:
|
||||
break;
|
||||
|
15
vnc/vnc.c
15
vnc/vnc.c
@ -748,6 +748,17 @@ lib_palette_update(struct vnc* v)
|
||||
return error;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int DEFAULT_CC
|
||||
lib_bell_trigger(struct vnc* v)
|
||||
{
|
||||
struct stream* s;
|
||||
int error;
|
||||
|
||||
error = v->server_bell_trigger(v);
|
||||
return error;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int DEFAULT_CC
|
||||
lib_mod_signal(struct vnc* v)
|
||||
@ -766,6 +777,10 @@ lib_mod_signal(struct vnc* v)
|
||||
else if (type == 1) /* palette */
|
||||
{
|
||||
error = lib_palette_update(v);
|
||||
}
|
||||
else if (type == 2) /* bell */
|
||||
{
|
||||
error = lib_bell_trigger(v);
|
||||
}
|
||||
else if (type == 3) /* clipboard */
|
||||
{
|
||||
|
@ -50,6 +50,7 @@ struct vnc
|
||||
/* server functions */
|
||||
int (*server_begin_update)(struct vnc* v);
|
||||
int (*server_end_update)(struct vnc* v);
|
||||
int (*server_bell_trigger)(struct vnc* v);
|
||||
int (*server_fill_rect)(struct vnc* v, int x, int y, int cx, int cy);
|
||||
int (*server_screen_blt)(struct vnc* v, int x, int y, int cx, int cy,
|
||||
int srcx, int srcy);
|
||||
|
@ -89,6 +89,8 @@ xrdp_wm_delete(struct xrdp_wm* self);
|
||||
int APP_CC
|
||||
xrdp_wm_send_palette(struct xrdp_wm* self);
|
||||
int APP_CC
|
||||
xrdp_wm_send_bell(struct xrdp_wm* self);
|
||||
int APP_CC
|
||||
xrdp_wm_load_static_colors(struct xrdp_wm* self);
|
||||
int APP_CC
|
||||
xrdp_wm_load_static_pointers(struct xrdp_wm* self);
|
||||
@ -352,6 +354,8 @@ server_begin_update(struct xrdp_mod* mod);
|
||||
int DEFAULT_CC
|
||||
server_end_update(struct xrdp_mod* mod);
|
||||
int DEFAULT_CC
|
||||
server_bell_trigger(struct xrdp_mod* mod);
|
||||
int DEFAULT_CC
|
||||
server_fill_rect(struct xrdp_mod* mod, int x, int y, int cx, int cy);
|
||||
int DEFAULT_CC
|
||||
server_screen_blt(struct xrdp_mod* mod, int x, int y, int cx, int cy,
|
||||
|
@ -297,6 +297,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
|
||||
self->mod->wm = (long)(self->wm);
|
||||
self->mod->server_begin_update = server_begin_update;
|
||||
self->mod->server_end_update = server_end_update;
|
||||
self->mod->server_bell_trigger = server_bell_trigger;
|
||||
self->mod->server_fill_rect = server_fill_rect;
|
||||
self->mod->server_screen_blt = server_screen_blt;
|
||||
self->mod->server_paint_rect = server_paint_rect;
|
||||
@ -1060,6 +1061,19 @@ server_end_update(struct xrdp_mod* mod)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* got bell signal... try to send to client */
|
||||
int DEFAULT_CC
|
||||
server_bell_trigger(struct xrdp_mod* mod)
|
||||
{
|
||||
struct xrdp_wm* wm;
|
||||
wm = (struct xrdp_wm*)(mod->wm);
|
||||
|
||||
xrdp_wm_send_bell(wm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
int DEFAULT_CC
|
||||
server_fill_rect(struct xrdp_mod* mod, int x, int y, int cx, int cy)
|
||||
|
@ -42,6 +42,7 @@ struct xrdp_mod
|
||||
/* server functions */
|
||||
int (*server_begin_update)(struct xrdp_mod* v);
|
||||
int (*server_end_update)(struct xrdp_mod* v);
|
||||
int (*server_bell_trigger)(struct xrdp_mod* v);
|
||||
int (*server_fill_rect)(struct xrdp_mod* v, int x, int y, int cx, int cy);
|
||||
int (*server_screen_blt)(struct xrdp_mod* v, int x, int y, int cx, int cy,
|
||||
int srcx, int srcy);
|
||||
|
@ -84,6 +84,13 @@ xrdp_wm_send_palette(struct xrdp_wm* self)
|
||||
return libxrdp_send_palette(self->session, self->palette);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int APP_CC
|
||||
xrdp_wm_send_bell(struct xrdp_wm* self)
|
||||
{
|
||||
return libxrdp_send_bell(self->session);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int APP_CC
|
||||
xrdp_wm_send_bitmap(struct xrdp_wm* self, struct xrdp_bitmap* bitmap,
|
||||
|
Loading…
Reference in New Issue
Block a user