1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-03 13:32:16 +00:00

add mixer keys

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@457 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
pontscho 2001-04-15 23:09:14 +00:00
parent e7dcdbfb89
commit c2360a7630
2 changed files with 45 additions and 37 deletions

View File

@ -29,6 +29,10 @@ o MPlayer and LIRC
FRWND - 60 secs back
FWD - skip 10 secs
FFWD - skip 60 secs
INCVOL - increase volume one percent
DECVOL - decrease volmue one percent
MASTER - use master mixer channel
PCM - use pcm mixer channel
Don't forget to enable the repeat flag for RWND/FWD in .lircrc. Here's an
excerpt from my .lircrc:

View File

@ -25,17 +25,17 @@ static int timeout_save=0;
void vo_hidecursor ( Display *disp , Window win )
{
Cursor no_ptr;
Pixmap bm_no;
XColor black,dummy;
Colormap colormap;
static unsigned char bm_no_data[] = { 0,0,0,0, 0,0,0,0 };
colormap = DefaultColormap(disp,DefaultScreen(disp));
XAllocNamedColor(disp,colormap,"black",&black,&dummy);
bm_no = XCreateBitmapFromData(disp, win, bm_no_data, 8,8);
no_ptr=XCreatePixmapCursor(disp, bm_no, bm_no,&black, &black,0, 0);
XDefineCursor(disp,win,no_ptr);
Cursor no_ptr;
Pixmap bm_no;
XColor black,dummy;
Colormap colormap;
static unsigned char bm_no_data[] = { 0,0,0,0, 0,0,0,0 };
colormap = DefaultColormap(disp,DefaultScreen(disp));
XAllocNamedColor(disp,colormap,"black",&black,&dummy);
bm_no = XCreateBitmapFromData(disp, win, bm_no_data, 8,8);
no_ptr=XCreatePixmapCursor(disp, bm_no, bm_no,&black, &black,0, 0);
XDefineCursor(disp,win,no_ptr);
}
@ -100,6 +100,10 @@ void vo_x11_putkey(int key){
case wsGrayMinus: mplayer_put_key('-'); break;
case wsPlus:
case wsGrayPlus: mplayer_put_key('+'); break;
case wsGrayMul:
case wsMul: mplayer_put_key('*'); break;
case wsGrayDiv:
case wsDiv: mplayer_put_key('/'); break;
default: if((key>='a' && key<='z')||(key>='A' && key<='Z')) mplayer_put_key(key);
}
@ -153,17 +157,17 @@ int vo_x11_check_events(Display *mydisplay){
switch( Event.type )
{
case Expose:
ret|=VO_EVENT_EXPOSE;
ret|=VO_EVENT_EXPOSE;
break;
case ConfigureNotify:
vo_dwidth=Event.xconfigure.width;
vo_dheight=Event.xconfigure.height;
ret|=VO_EVENT_RESIZE;
vo_dheight=Event.xconfigure.height;
ret|=VO_EVENT_RESIZE;
break;
case KeyPress:
XLookupString( &Event.xkey,buf,sizeof(buf),&keySym,&stat );
vo_x11_putkey( ( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) ) );
ret|=VO_EVENT_KEYPRESS;
ret|=VO_EVENT_KEYPRESS;
break;
}
}
@ -176,20 +180,20 @@ void saver_on(Display *mDisplay) {
int nothing;
if (dpms_disabled)
{
if (DPMSQueryExtension(mDisplay, &nothing, &nothing))
{
printf ("Enabling DPMS\n");
DPMSEnable(mDisplay); // restoring power saving settings
DPMSQueryExtension(mDisplay, &nothing, &nothing);
}
if (DPMSQueryExtension(mDisplay, &nothing, &nothing))
{
printf ("Enabling DPMS\n");
DPMSEnable(mDisplay); // restoring power saving settings
DPMSQueryExtension(mDisplay, &nothing, &nothing);
}
}
if (timeout_save)
{
int dummy, interval, prefer_blank, allow_exp;
XGetScreenSaver(mDisplay, &dummy, &interval, &prefer_blank, &allow_exp);
XSetScreenSaver(mDisplay, timeout_save, interval, prefer_blank, allow_exp);
XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
int dummy, interval, prefer_blank, allow_exp;
XGetScreenSaver(mDisplay, &dummy, &interval, &prefer_blank, &allow_exp);
XSetScreenSaver(mDisplay, timeout_save, interval, prefer_blank, allow_exp);
XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
}
}
@ -200,20 +204,20 @@ void saver_off(Display *mDisplay) {
if (DPMSQueryExtension(mDisplay, &nothing, &nothing))
{
BOOL onoff;
CARD16 state;
DPMSInfo(mDisplay, &state, &onoff);
if (onoff)
{
printf ("Disabling DPMS\n");
dpms_disabled=1;
DPMSDisable(mDisplay); // monitor powersave off
}
BOOL onoff;
CARD16 state;
DPMSInfo(mDisplay, &state, &onoff);
if (onoff)
{
printf ("Disabling DPMS\n");
dpms_disabled=1;
DPMSDisable(mDisplay); // monitor powersave off
}
}
XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
if (timeout_save)
XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp);
// turning off screensaver
XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp);
// turning off screensaver
}
#endif