Re: Re: Video Zoom
Home › Forums › Feature Suggestions › Video Zoom › Re: Re: Video Zoom
November 5, 2010 at 7:10 pm
#27512
Anonymous
Inactive
Hi everybody,
I think that the zooming capability is quite useful feature.
Here my proposal: use the B button as a toggle, for switching the function of the D-pad among FF,REW,… and Zoom increment/decrement.
Here the implementation (based on svn rev.684):
input.cpp, line 25
#include "mplayer/osdep/gx_supp.h"
input.cpp, line 131
/****************************************************************************
* MPlayerInput
***************************************************************************/
void MPlayerResize(float fZoomHorIncr, float fZoomVertIncr)
{
if(!wiiIsPaused())
{
WiiSettings.videoZoomHor += fZoomHorIncr;
WiiSettings.videoZoomVert += fZoomVertIncr;
GX_SetScreenPos(WiiSettings.videoXshift, WiiSettings.videoYshift,
WiiSettings.videoZoomHor, WiiSettings.videoZoomVert);
wiiReinitMPlayerVideo();
}
}
void MPlayerInput()
{
bool ir = false;
bool inDVDMenu = wiiInDVDMenu();
static bool volumeUpdated = false;
static bool BtnsBToogle = false;
if(userInput[0].wpad->ir.valid)
ir = true;
if(userInput[0].wpad->btns_d & WPAD_BUTTON_1)
osdLevel ^= 1;
else if(ExitRequested || userInput[0].wpad->btns_d & WPAD_BUTTON_HOME)
wiiGotoGui();
if(userInput[0].wpad->btns_d & WPAD_BUTTON_B)
BtnsBToogle ^= 1;
if(!inDVDMenu)
{
if(userInput[0].wpad->btns_d & WPAD_BUTTON_A)
{
// Hack to allow people to unpause while the OSD GUI is visible by
// pointing above the button bar and pressing A. We also need to be outside
// the boundaries of the volume bar area, when it is visible
int x = userInput[0].wpad->ir.x;
int y = userInput[0].wpad->ir.y;
int xoffset = 20;
if(screenwidth == 768)
xoffset = 80;
if(!drawGui || (y < 360 &&
(!VideoVolumeLevelBarVisible() || !(x > xoffset && x 180))))
{
wiiPause();
}
}
else if(userInput[0].wpad->btns_d & WPAD_BUTTON_RIGHT)
{
if (BtnsBToogle)
MPlayerResize(+0.01F, 0.00F);
else
wiiFastForward();
}
else if(userInput[0].wpad->btns_d & WPAD_BUTTON_LEFT)
{
if (BtnsBToogle)
MPlayerResize(-0.01F, 0.00F);
else
wiiRewind();
}
else if(userInput[0].wpad->btns_d & WPAD_BUTTON_UP)
{
if (BtnsBToogle)
MPlayerResize(0.00F, +0.01F);
else
{
if(!wiiIsPaused())
wiiSetProperty(MP_CMD_SUB_SELECT, -2);
}
}
else if(userInput[0].wpad->btns_d & WPAD_BUTTON_DOWN)
{
if (BtnsBToogle)
MPlayerResize(0.00F, -0.01F);
else
{
if(!wiiIsPaused())
wiiSetProperty(MP_CMD_SWITCH_AUDIO, -1);
}
}
else if(userInput[0].wpad->btns_h & WPAD_BUTTON_PLUS)
{
volnow = gettime();
if(diff_usec(volprev, volnow) > VOL_DELAY)
{
volprev = volnow;
WiiSettings.volume++;
if(WiiSettings.volume > 100) WiiSettings.volume = 100;
wiiSetVolume(WiiSettings.volume);
volumeUpdated = true;
ShowVideoVolumeLevelBar();
}
}
else if(userInput[0].wpad->btns_h & WPAD_BUTTON_MINUS)
{
volnow = gettime();
if(diff_usec(volprev, volnow) > VOL_DELAY)
{
volprev = volnow;
WiiSettings.volume--;
if(WiiSettings.volume < 0) WiiSettings.volume = 0;
wiiSetVolume(WiiSettings.volume);
volumeUpdated = true;
ShowVideoVolumeLevelBar();
}
}
if(userInput[0].wpad->btns_d & WPAD_BUTTON_2)
wiiDVDNav(MP_CMD_DVDNAV_MENU);
}
else
{
if(userInput[0].wpad->ir.valid)
wiiUpdatePointer((int)userInput[0].wpad->ir.x, (int)userInput[0].wpad->ir.y);
if(userInput[0].wpad->btns_d & WPAD_BUTTON_A)
{
if(userInput[0].wpad->ir.valid)
wiiDVDNav(MP_CMD_DVDNAV_MOUSECLICK);
else
wiiDVDNav(MP_CMD_DVDNAV_SELECT);
}
if(userInput[0].wpad->btns_d & WPAD_BUTTON_UP)
{
if (BtnsBToogle)
MPlayerResize(0.00F, +0.01F);
else
wiiDVDNav(MP_CMD_DVDNAV_UP);
}
else if(userInput[0].wpad->btns_d & WPAD_BUTTON_DOWN)
{
if (BtnsBToogle)
MPlayerResize(0.00F, -0.01F);
else
wiiDVDNav(MP_CMD_DVDNAV_DOWN);
}
else if(userInput[0].wpad->btns_d & WPAD_BUTTON_RIGHT)
{
if (BtnsBToogle)
MPlayerResize(+0.01F, 0.00F);
else
wiiDVDNav(MP_CMD_DVDNAV_RIGHT);
}
else if(userInput[0].wpad->btns_d & WPAD_BUTTON_LEFT)
{
if (BtnsBToogle)
MPlayerResize(-0.01F, 0.00F);
else
wiiDVDNav(MP_CMD_DVDNAV_LEFT);
}
}
if(volumeUpdated)
{
volnow = gettime();
if(volnow > volprev && diff_usec(volprev, volnow) > VOLDISP_MAX)
volumeUpdated = false;
else
ir = true; // trigger display
}
if(ir || BufferingStatusSet() || osdLevel)
{
drawGui = true;
}
else if(drawGui)
{
drawGui = false;
HideVideoVolumeLevelBar();
ShutoffRumble();
}
}
wiimc.h, line 82:
void wiiReinitMPlayerVideo();
mplayer/mplayer.c, line 5250:
oid wiiReinitMPlayerVideo()
{
reinit_video();
}
I’m not an expert wii homebrew developer, so I’m not so sure that the reinit_video() is totally safe without stopping the player. But probably I’m lucky and it seems to work 😀
