Re: Re: Any suggestions for implementing some kind of web interf
Home › Forums › General Discussion › Any suggestions for implementing some kind of web interface? › Re: Re: Any suggestions for implementing some kind of web interf
Ok, thanks.
After having a look at the code in the repository I may have some small idea what is going on. Would appreciate any thoughts/comments…
Seems like the MPlayer underneath WiiMC is being given commands via mp_input_queue_cmd() (in …/mplayer/input/input.h) and various other hooks in …/mplayer/mplayer.c (e.g. lines 4726-):
http://code.google.com/p/wiimc/source/browse/trunk/source/mplayer/mplayer.c
/****************************************************************************
* Wii hooks
***************************************************************************/
void wiiLoadFile(char *_filename, char *_partitionlabel)
{
if (partitionlabel)
free(partitionlabel);
partitionlabel = (_partitionlabel) ? strdup(_partitionlabel) : strdup("");
if(filename)
free(filename);
filename = strdup(_filename);
}
void wiiGotoGui()
{
mp_cmd_t * cmd = calloc( 1,sizeof( *cmd ) );
cmd->id=MP_CMD_QUIT;
cmd->name=strdup("quit");
mp_input_queue_cmd(cmd);
}
void wiiPause()
{
mp_cmd_t * cmd = calloc( 1,sizeof( *cmd ) );
cmd->id=MP_CMD_PAUSE;
cmd->name=strdup("pause");
mp_input_queue_cmd(cmd);
}
etc...
The “main loop” is in …/wiimc.cpp (lines 708-):
http://code.google.com/p/wiimc/source/browse/tags/1.1.8/source/wiimc.cpp
// create GUI thread
while(1)
{
ResetVideo_Menu();
WiiMenu();
if(ExitRequested)
break;
MPlayerMenu();
}
// application exiting
StopGX();
UnmountAllDevices();
etc...
What this seems to be doing is using WiiMenu() to find out what kind of file to play, then handing control to MenuBrowse() to select the particular file etc, then using the …/mplayer/mplayer.c hooks above.
There seem to be various threads active, some for the GUI’s, some for MPlayer.
Seems to me the theoretical solution would be to:
* include source from something like WiiWebServer (http://wiibrew.org/wiki/Wii_Web_Server);
* somewhere in wiimc.cpp before the main loop, fire up another thread that sleeps most of the time but listens occasionally to the httpd, and serves some kind of logfile (which could perhaps be an echo all the stdio output?), and implements a few simple commands (using the “hook” calls above) based on what it receives.
That would be a start anyway.
This is a pretty ambitous thing for me to contemplate (I mainly use VB/excel). Does this interest anyone? Does this sound sensible/insane?
Cheers,
fttb.
