////////////////////////major //todo: dde opener still relies on timeouts (maybe ddeopener should be removed and the player should support only one instance) //todo: size calculations can be improved when blackband is enabled (test with desktop screen capture) ////////////////////////(major+minor)/2 //todo: bug: playlist->fullscreen->playlist and the status is not hiding //todo: pan scan (works only with the opengl driver and the driver itself is not working) //todo: detect and parse asx,pls,m3u playlists //todo: bug: disable screen dragging in fullscreen ////////////////////////minor //todo: volume fade in/fade out //todo: dvd menus somehow (libdvdnav?) //todo: scroll console if is at the bottom only //todo: bindings for dvd navigation (next/prev title/chapter/angle) //todo: no code to handle (s)vcd-s (is there anything to handle besides the title?) //todo: general code clean up (profile and increase performance) const char[] appversion ="0.99.3"; const char[] appname ="rulesPlayer"; const int last_menu_item_index_in_use =149; //const int last_menu_index_in_use =5; import dwt.all; import console; import std.path; import std.thread; import std.string; import std.file; import std.c.time; import config; import player; import playlist; import common; import core; import win32.win32; import std.c.windows.windows; version (Windows) { pragma(lib,"advapi32.lib"); pragma(lib,"comctl32.lib"); pragma(lib,"gdi32.lib"); pragma(lib,"shell32.lib"); pragma(lib,"comdlg32.lib"); pragma(lib,"ole32.lib"); pragma(lib,"uuid.lib"); pragma(lib,"..\\thirdparty\\dwt\\dwt.lib"); //pragma(lib,"..\\thirdparty\\dwt\\dwtextra.lib"); pragma(lib,"..\\thirdparty\\dwt\\user32_dwt.lib"); pragma(lib,"..\\thirdparty\\dwt\\imm32_dwt.lib"); pragma(lib,"..\\thirdparty\\dwt\\shell32_dwt.lib"); pragma(lib,"..\\thirdparty\\dwt\\msimg32_dwt.lib"); pragma(lib,"..\\thirdparty\\dwt\\gdi32_dwt.lib"); pragma(lib,"..\\thirdparty\\dwt\\kernel32_dwt.lib"); pragma(lib,"..\\thirdparty\\dwt\\usp10_dwt.lib"); pragma(lib,"..\\thirdparty\\dwt\\olepro32_dwt.lib"); pragma(lib,"..\\thirdparty\\dwt\\oleaut32_dwt.lib"); pragma(lib,"..\\thirdparty\\dwt\\oleacc_dwt.lib"); } extern(Windows) alias BOOL function(HWND,LPCTSTR,POINT) DoExplorerMenu_t; extern(Windows) alias BOOL function() MySystemShutdown_t; DoExplorerMenu_t DoExplorerMenu; MySystemShutdown_t MySystemShutdown; class rulesplayer { Config config; Player player; Console console; Playlist playlist; Shell shell; Menu menuBar; ToolBar toolBar; Label screen; CLabel status,time; myProgressBar progressBar,volume; SashForm sash; mySashForm sash2; ToolBar mute; Image imgsound,imgmute; MenuItem[int] mitems; Menu[int] menus; int resizetomovie=1,recentfiles=0,recentfreeslots=0,centeronresize=0; char[][] allrecentfiles; static void expandfolders(inout char[][] files) { void adddir(inout char[][] ret,char[] file) { bool callback(DirEntry* de) { if(de.isdir()) { char[][] rr; adddir(rr,std.path.join(file,de.name)); ret~=rr; } else if(getExt(de.name) in allsupportedfiles2) ret~=std.path.join(file,de.name); return true; } listdir(file, &callback); } char[][] ret; if(!allsupportedfiles2.length) foreach(a;allsupportedfiles) allsupportedfiles2[a]=true; for(int c=0;c0) aspect=player.aspect2; float rat=(cast(float)p.x)/(cast(float)p.y); if(player.keepaspect && rat0) { gridData4.grabExcessHorizontalSpace = true; gridData4.horizontalAlignment = GridData.FILL; if(aspect==0) { gridData4.verticalAlignment = GridData.FILL; gridData4.grabExcessVerticalSpace = true; }else{ gridData4.verticalAlignment = GridData.CENTER; gridData4.grabExcessVerticalSpace = true; gridData4.heightHint = cast(int)((cast(float)p.x)/aspect); } } else if(player.keepaspect && rat>aspect && aspect>0) { gridData4.grabExcessVerticalSpace = true; gridData4.verticalAlignment = GridData.FILL; if(aspect==0) { gridData4.horizontalAlignment = GridData.FILL; gridData4.grabExcessHorizontalSpace = true; }else{ gridData4.horizontalAlignment = GridData.CENTER; gridData4.grabExcessHorizontalSpace = true; gridData4.widthHint = cast(int)((cast(float)p.y)*aspect); } } else { gridData4.grabExcessHorizontalSpace = true; gridData4.horizontalAlignment = GridData.FILL; gridData4.grabExcessVerticalSpace = true; gridData4.verticalAlignment = GridData.FILL; } theapp.screen.setLayoutData(gridData4); comp.layout(); } int resized=1,wanttrayupdate=0; void resize(float zoom=1) { if(trayItem && theapp.shell.getMinimized()) { wanttrayupdate=1; return; } if(resizetomovie && !startup) { if(isfull) {resized=0;resizeScreen(null);return;} else resized=1; Point p=shell.getSize(); Point p2=new Point(0,0); if(iscomp) { if(shell.getMenuBar()) shell.setMenuBar(null); auto rrr=shell.getClientArea(); p2.x=rrr.width; p2.y=rrr.height; } else p2=sash.getSize(); float ex=cast(float)atoi(theapp.config.getVar("v_expand")); int tx=cast(int)(player.info.videowidth); if(tx<350) tx=350; int ty=0; if(player.aspect2>0) { tx+=ex*player.aspect2; ty=cast(int)(tx/player.aspect2); } else { tx+=cast(int)(ex*(theapp.player.aspect==0?1:theapp.player.aspect)); ty=player.info.videoheight+cast(int)ex; } ty+=(p.y-p2.y); tx+=(p.x-p2.x); if(centeronresize) center(tx,ty); shell.setSize(cast(int)(tx*zoom),cast(int)(ty*zoom)); } else resizeScreen(null); } Thread tmove; int updatemouse=0; bool checkmouseoffscreen=false; int timer() { if(mousehidetime==-1) return 1; int slp=10; if(slp>mousehidetime) slp=mousehidetime; mmovedone=false; while(iscomp && !mmovedone) { if(mmove.getElapsed()>=mousehidetime) { if(iscomp) { if(!tmovepaused) { updatemouse=1; display.wake(); break; } else if(!checkmouseoffscreen) { checkmouseoffscreen=true; display.wake(); } } } msleep(slp); } return 0; } Timer mmove; int tmovepaused; bool mmovedone=false; void onmmove(Event e) { if(iscomp) { if(e) { if(!mousev) { tmove=new Thread(&timer); tmovepaused=0; mmove.reset(); tmove.start(); showcursor(1); } } static Point p; static Rectangle p2; if(e) { p=display.map(cast(Control)e.widget,null,e.x,e.y); p2=display.map(cast(Control)e.widget,null,shell.getClientArea()); if(!controlsshown) { if(p.y>p2.y+(p2.height-50)) { if(!tmovepaused) { //tmove.pause(); tmovepaused=1; } sash2.show(1); onsize(null); controlsshown=1; return; } } if(!menushown) { if(p.y<(p2.y+20)) { if(!tmovepaused) { //tmove.pause(); tmovepaused=1; } shell.setMenuBar(menuBar); menushown=1; return; } } } if((menushown || controlsshown) && tmovepaused && !playlist.shown) { if(checkmouseoffscreen) { p=display.getCursorLocation(); auto bounds=shell.getBounds(); if(p.y>bounds.y+bounds.height || p.ybounds.x+bounds.width || p.x=0) {e.doit=0;console.execLine(console.bindings[i].command,0,1);} /*else { pls=player.NONE; if(e.button==1 && player.running()) { pls=player.status; player.sendCmd("pause"); } }*/ } void ondclick(Event e) { int i=console.findBind(0,e.stateMask,1,(e.button==1?hash!("mouse1dbl"):(e.button==2?hash!("mouse2dbl"):hash!("mouse3dbl")))); if(i>=0) {e.doit=0;console.execLine(console.bindings[i].command,0,1);} /*else { if(e.button==1) { if(pls==player.PLAY) player.sendCmd("pause"); fullscreen(!isfull); } }*/ } void onsize(Event e) { Point s=comp2.computeSize(DWT.DEFAULT,DWT.DEFAULT); Rectangle r=shell.getClientArea(); int[2] w; w[1]=cast(int)((cast(float)s.y/cast(float)r.height)*1000f); w[0]=1000-w[1]; sash2.setWeights(w); } int ontop=0,iscomp=0,hastitle=1; void setaspect(float asp) { theapp.player.aspect2=asp; if(player.proc) resizeScreen(null); updateAspect(); } void settitlebar(int has,int updatevar=1) { if(isfull || shell.getMaximized()) {updateTitlebar();return;} if(has==-1) { laststyle=GetWindowLongA(shell.handle,GWL_STYLE); laststyleex=GetWindowLongA(shell.handle,GWL_EXSTYLE); return; } if(!has && hastitle) { hastitle=0; laststyle=GetWindowLongA(shell.handle,GWL_STYLE); laststyleex=GetWindowLongA(shell.handle,GWL_EXSTYLE); SetWindowLongA(shell.handle,GWL_STYLE,WS_POPUP|WS_BORDER|WS_THICKFRAME); SetWindowLongA(shell.handle,GWL_EXSTYLE,0); shell.setVisible(true); } else if(has && !hastitle) { hastitle=1; SetWindowLongA(shell.handle,GWL_STYLE,(laststyle&WS_VISIBLE)?laststyle-WS_VISIBLE:laststyle); SetWindowLongA(shell.handle,GWL_EXSTYLE,laststyleex); shell.setVisible(true); } if(updatevar) config.setVar("w_titlebar",std.string.toString(hastitle),0); updateTitlebar(); } void compact(int comp,int updatevar=1) { if(comp && !iscomp) { iscomp=1; menushown=0; mmove=new Timer(); tmove=new Thread(&timer); shell.setMenuBar(null); tmove.start(); if(playlist.shown) { controlsshown=0; //tmove.pause(); tmovepaused=1; } else { controlsshown=0; sash2.show(0); } } else if(!comp && iscomp) { iscomp=0; if(tmovepaused) { mmove.reset(); //tmove.resume(); tmovepaused=0; } showcursor(1); shell.setMenuBar(menuBar); sash2.show(1); onsize(null); if(!resized) resize(); if(tmove.getState()==Thread.TS.RUNNING) tmove.wait(); } if(updatevar) config.setVar("w_compact",std.string.toString(iscomp),0); theapp.updateCompact(); } void fullscreen(int full,int updatevar=1) { static WINDOWPLACEMENT wp; static int wascomp,alaststyle,alaststyleex; wp.length=WINDOWPLACEMENT.sizeof; if(full && !isfull) { wascomp=iscomp; isfull=1; alaststyle=GetWindowLongA(shell.handle,GWL_STYLE); alaststyleex=GetWindowLongA(shell.handle,GWL_EXSTYLE); SetWindowLongA(shell.handle,GWL_STYLE,WS_POPUP|WS_VISIBLE); SetWindowLongA(shell.handle,GWL_EXSTYLE,WS_EX_APPWINDOW|WS_EX_TOPMOST); GetWindowPlacement(shell.handle,&wp); Rectangle d=display.getPrimaryMonitor().getBounds(); lastrect=shell.getBounds(); settop(1); shell.setLocation(0,0); shell.setSize(d.width,d.height); if(!iscomp) compact(1); } else if(!full && isfull) { isfull=0; SetWindowLongA(shell.handle,GWL_STYLE,alaststyle); SetWindowLongA(shell.handle,GWL_EXSTYLE,alaststyleex); if(!ontop) settop(0); //shell.setLocation(lastrect.x,lastrect.y); SetWindowPlacement(shell.handle,&wp); if(!wascomp) compact(0); else { onsize(null); if(!resized) resize(); } } if(updatevar) config.setVar("w_fullscreen",std.string.toString(isfull),0); theapp.updateFullscreen(); } Point lastm; int mousev=1,mousehidetime; int isfull,laststyle,laststyleex; int startfull=0,mintray=0,closetray=0,residetray=0,shutdownafterplayback=0; dwt.graphics.rectangle.Rectangle lastrect; void updateBrightness(){if(noupdate) return;theapp.playlist.progressBar1.setSelection(theapp.player.brightness+100);} void updateOntop(){if(noupdate) return;mitems[18].setSelection(ontop);} void updateStartfull(){if(noupdate) return;mitems[116].setSelection(startfull);} void updateShutdown(){if(noupdate) return;mitems[104].setSelection(shutdownafterplayback);} void updateContrast(){if(noupdate) return;theapp.playlist.progressBar2.setSelection(theapp.player.contrast+100);} void updateSaturation(){if(noupdate) return;theapp.playlist.progressBar3.setSelection(theapp.player.saturation+100);} void updateHue(){if(noupdate) return;theapp.playlist.progressBar4.setSelection(theapp.player.hue+100);} void updateGamma(){if(noupdate) return;/*theapp.playlist.progressBar0.setSelection(theapp.player.gamma+100);*/} void updateVolume(){if(noupdate) return;theapp.volume.setSelection(cast(int)player.volume);} void updateShuffle(){if(noupdate) return;theapp.playlist.bshuffle.setSelection(theapp.playlist.shuffle);mitems[12].setSelection(theapp.playlist.shuffle);} void updateRepeat(){if(noupdate) return;theapp.playlist.brepeat.setSelection(theapp.playlist.repeat);mitems[13].setSelection(theapp.playlist.repeat);} void updateAspect() { if(noupdate) return; mitems[26].setSelection(theapp.player.keepaspect); char[] ao=std.string.toString(player.aspect2); for(int c=112;c<116;c++) {mitems[c].setSelection((cast(StringObj)mitems[c].getData()).data==ao);} } void updateAtrack() { if(noupdate) return; int run=player.running(); mitems[27].setEnabled(run&&player.info.audio_id.length>1); if(run) { auto aa=menus[1].getItems(); foreach(MenuItem b;aa) b.setSelection(atoi((cast(StringObj)b.getData()).data)==player.atrack); } } void updateStrack() { if(noupdate) return; int run=player.running(); mitems[25].setEnabled(run); if(run) { auto a=menus[0].getItems(); foreach(int i,MenuItem b;a) {if(i==0) b.setSelection(player.subtrack<0); else b.setSelection(atoi((cast(StringObj)b.getData()).data)==player.subtrack);} } } void updateAutoplay(){if(noupdate) return;mitems[40].setSelection(theapp.playlist.autoplay);/*playlist.bautoplay.setSelection(theapp.playlist.autoplay);*/} void updateAutoloadsubs(){if(noupdate) return;mitems[24].setSelection(!theapp.player.autoloadsubs);} void updateFullscreen(){if(noupdate) return;mitems[41].setSelection(theapp.isfull);} void updateCompact(){if(noupdate) return;mitems[111].setSelection(theapp.iscomp);} void updateTitlebar(){if(noupdate) return;mitems[110].setSelection(theapp.hastitle);} void updateDeinterlace(){if(noupdate) return;mitems[22].setSelection(theapp.player.deinterlace);} void updateIdx(){if(noupdate) return;mitems[69].setSelection(theapp.player.idx);} void updateAutoseq(){if(noupdate) return;mitems[23].setSelection(theapp.player.autoseq);} void updateResize(){if(noupdate) return;mitems[14].setSelection(theapp.resizetomovie);} void updateCenter(){if(noupdate) return;mitems[143].setSelection(theapp.centeronresize);} void updateConsole(){if(noupdate) return;mitems[1].setSelection(theapp.console.shown);mute.getItem(1).setSelection(theapp.console.shown);} void updatePlaylist(){if(noupdate) return;mitems[0].setSelection(theapp.playlist.shown);mute.getItem(0).setSelection(theapp.playlist.shown);} void updateShowsubs(){if(noupdate) return;mitems[10].setSelection(theapp.player.showsubs);} void updateMute() { if(noupdate) return; mitems[11].setSelection(theapp.player.muted); if(theapp.player.muted) { ToolItem i=theapp.mute.getItem(3); i.setImage(theapp.imgmute); i.setSelection(1); theapp.volume.setEnabled(0); } else { ToolItem i=theapp.mute.getItem(3); i.setImage(theapp.imgsound); i.setSelection(0); theapp.volume.setEnabled(1); } } void updateAO() { if(noupdate) return; char[] ao=config.getVar("mp_ao"); for(int c=30;c<33;c++) mitems[c].setSelection((cast(StringObj)mitems[c].getData()).data==ao); mitems[117].setSelection(ao.length>=3 && icmp(ao[0..3],"pcm")==0); } void updatePriority() { if(noupdate) return; char[] ao=config.getVar("mp_priority"); for(int c=34;c<40;c++) mitems[c].setSelection((cast(StringObj)mitems[c].getData()).data==ao); } void updatePP() { if(noupdate) return; char[] ao=config.getVar("v_pp"); for(int c=57;c<64;c++) mitems[c].setSelection((cast(StringObj)mitems[c].getData()).data==ao); } void updateExpand() { if(noupdate) return; char[] ao=config.getVar("v_expand"); for(int c=64;c<69;c++) mitems[c].setSelection((cast(StringObj)mitems[c].getData()).data==ao); } void updateCodepage() { if(noupdate) return; char[] ao=config.getVar("sub_codepage"); for(int c=70;c<92;c++) {mitems[c].setSelection((cast(StringObj)mitems[c].getData()).data==ao);} } void updateVO() { if(noupdate) return; /*ao=config.getVar("mp_vo"); if(ao=="directx") { mitems[28].setSelection(1); mitems[29].setSelection(0); mitems[33].setSelection(0); } else if(ao=="gl") { mitems[28].setSelection(0); mitems[29].setSelection(1); mitems[33].setSelection(0); } else if(ao=="gl2") { mitems[28].setSelection(0); mitems[29].setSelection(0); mitems[33].setSelection(1); }*/ } void updatePlayback() { if(noupdate) return; if(player.status==player.NONE) { mitems[2].setSelection(0); mitems[3].setSelection(0); toolBar.getItem(0).setSelection(0); toolBar.getItem(1).setSelection(0); } else if(player.status==player.PLAY) { mitems[2].setSelection(1); mitems[3].setSelection(0); toolBar.getItem(0).setSelection(1); toolBar.getItem(1).setSelection(0); } else if(player.status==player.PAUSE) { toolBar.getItem(0).setSelection(0); toolBar.getItem(1).setSelection(1); mitems[2].setSelection(0); mitems[3].setSelection(1); } } void updateOSD(){if(noupdate) return; for(int c=5;c<9;c++) if(c-5==player.osdlevel) mitems[c].setSelection(1); else mitems[c].setSelection(0);} void updateFramedrop(){if(noupdate) return; for(int c=19;c<22;c++) if(c-19==player.framedrop) mitems[c].setSelection(1); else mitems[c].setSelection(0);} void updateSubalign(){if(noupdate) return; /*for(int c=15;c<18;c++) if(c-15==player.subalign) mitems[c].setSelection(1); else mitems[c].setSelection(0);*/} void updateTextscale(){if(noupdate) return; for(int c=42;c<47;c++) if(c-41==player.textscale) mitems[c].setSelection(1); else mitems[c].setSelection(0);} void updateMaxvolume() { if(noupdate) return; if(player.softvolmax==10) mitems[47].setSelection(1); else mitems[47].setSelection(0); if(player.softvolmax==50) mitems[48].setSelection(1); else mitems[48].setSelection(0); if(player.softvolmax==100) mitems[49].setSelection(1); else mitems[49].setSelection(0); if(player.softvolmax==200) mitems[50].setSelection(1); else mitems[50].setSelection(0); if(player.softvolmax==500) mitems[51].setSelection(1); else mitems[51].setSelection(0); if(player.softvolmax==1000) mitems[52].setSelection(1); else mitems[52].setSelection(0); } int updatingdvd=0; void updateDVD() { if(noupdate) return; if(player.running()) { updatingdvd=1; for(int c=1;c<=player.info.dvd_titles;c++) { auto aa=player.info.dvd_chaptermenu[c].getItems(); foreach(int i,MenuItem b;aa) b.setSelection(c==player.dvdtitlen&&player.dvdchapter==atoi((cast(StringObj)b.getData()).data)); aa=player.info.dvd_anglemenu[c].getItems(); foreach(int i,MenuItem b;aa) b.setSelection(c==player.dvdtitlen&&player.dvdangle==atoi((cast(StringObj)b.getData()).data)); } updatingdvd=0; } else mitems[56].setEnabled(0); } void updateMintray(){if(noupdate) return;mitems[109].setSelection(mintray);} void updateClosetray(){if(noupdate) return;mitems[108].setSelection(closetray);} void updateResidetray() { if(noupdate) return; mitems[107].setSelection(residetray); if(residetray && !trayItem) toTray(0); else if(!residetray && trayItem) fromTray(0); } void updateUI(int traytoo=0) { if(noupdate) return; updateBrightness(); updateOntop(); updateContrast(); updateSaturation(); updateHue(); //updateGamma(); updateVolume(); updateShuffle(); updateRepeat(); updateAspect(); updateAtrack(); updateStrack(); updateAutoplay(); updateAutoloadsubs(); updateFullscreen(); updateCompact(); updateDeinterlace(); updateAutoseq(); updateResize(); updateCenter(); updateConsole(); updatePlaylist(); updateShowsubs(); updateMute(); updateAO(); updatePriority(); //updateVO(); updatePlayback(); updateOSD(); updateFramedrop(); //updateSubalign(); updateTextscale(); updateMaxvolume(); updateDVD(); updatePP(); updateExpand(); updateIdx(); updateCodepage(); updateStartfull(); updateShutdown(); updateRecent(); updateStrings(); updateLanguage(); if(traytoo) updateResidetray(); updateClosetray(); updateMintray(); updateTitlebar(); updateStatus(); updateProgress(); } void updateStatus() { if(noupdate) return; if(player.status==player.NONE) setStatus(getString(67)); else if(player.status==player.PAUSE) setStatus(getString(68)); else if(player.status==player.PLAY) setStatus(getString(69,paramMake(player.speed))); else if(player.status==player.ERROR) setStatus(getString(70,paramMake(player.err))); else if(player.status==player.DUMPED) setStatus(getString(100,paramMake(player.streamdump,paramMake(player.streamdump)))); } void updateProgress() { if(noupdate) return; int t; if(!player.restarting && ((player.status!=player.PLAY && player.status!=player.PAUSE) || !(theapp.player.running()))) t=0; else t=cast(int)player.time; progressBar.setSelection(t); setTime(t); } void updateRecent() { if(noupdate) return; theapp.menus[3] = new Menu (theapp.shell, DWT.DROP_DOWN); theapp.mitems[118].setMenu (theapp.menus[3]); recentfreeslots=allrecentfiles.length; foreach(char[] rf;allrecentfiles) { if(!rf.length) continue; recentfreeslots--; auto mi = new MenuItem (menus[3], DWT.PUSH); mi.handleEvent (new StringObj(rf),DWT.Selection, delegate (Event e) {theapp.player.open(paramMake((cast(StringObj)e.cData).data));}); const int maxlen=97; mi.setText(rf.length<=maxlen?rf:"..."~rf[rf.length-maxlen..rf.length]); } mitems[118].setEnabled(recentfreeslots1) end=recentfreeslots; for(int c=allrecentfiles.length-(end+1);c>=0;c--) allrecentfiles[c+1]=allrecentfiles[c]; allrecentfiles[0]=name.dup; if(update) updateRecent(); } void updateStrings() { if(noupdate) return; for(int c=0;c<=last_menu_item_index_in_use;c++) { if(c==70) c=102; //skip encodings else if(c==113) c=116; //skip aspect ratios else if(c==47) c=49; //skip volume else if(c==50) c=53; //skip volume else if(c==58) c=63; //skip post processing else if(c==65) c=69; //skip blackband /*if(!(c in mitems)) theapp.console.append("warning: unused menu item "~.toString(c)); else */mitems[c].setText(getString(c+5000)); } if(restoretrayitem) restoretrayitem.setText(getString(shell.getMinimized()?111:112)); btnplay.setToolTipText(getString(55)); btnpause.setToolTipText(getString(56)); btnstop.setToolTipText(getString(57)); btnnext.setToolTipText(getString(58)); btnrw.setToolTipText(getString(59)); btnff.setToolTipText(getString(60)); btnprev.setToolTipText(getString(61)); btnstep.setToolTipText(getString(62)); btnpl.setToolTipText(getString(63)); btncon.setToolTipText(getString(64)); btnmute.setToolTipText(getString(65)); filtera[0]=getString(49); filtera[1]=getString(50); filtera[2]=getString(51); filtera[3]=getString(52); filtera[4]=getString(53); filtera[5]=getString(54)~" (*.*)"; filter33[0]=filtera[4]~" (*.rpl)"; filter33[1]=filtera[5]; filterda[0]=filtera[2]; filterda[1]=filtera[5]; playlist.updateStrings(); } void updateLanguage() { if(noupdate) return; auto l=theapp.config.getVar("w_language"); auto aa=menus[4].getItems(); foreach(MenuItem b;aa) b.setSelection(b.getText()==l); } char[] getString(int i,char[][] cmd=null) { auto r=i in translation_strings; if(r) { if(cmd.length) return parseParam(*r,cmd); else return (*r).dup; } else return "undefined string "~.toString(i); } char[] getHelp(char[] i) { auto r=i in translation_helps; if(r) return (*r).dup; else return null; } int setLanguage(char[] l) { if(l=="English") { theapp.config.setVar("w_language",l); setDefaultStrings(); theapp.updateUI(); return 1; } else if(config.exec(std.path.join(appdir,"lang_"~l~".kfg"),1)) { theapp.config.setVar("w_language",l); theapp.updateUI(); return 1; } else { updateLanguage(); return 0; } } TrayItem trayItem; Menu trayMenu; Image shellimage; MenuItem restoretrayitem; void toTray(int hide=1) { if(!trayItem) { trayItem = new TrayItem(shell.getDisplay().getSystemTray(), DWT.NONE); trayItem.handleEvent(this, DWT.MenuDetect, delegate(Event e){ theapp.trayMenu.setLocation(display.getCursorLocation()); theapp.trayMenu.setVisible(true); }); trayItem.handleEvent(this, DWT.Selection, delegate(Event e){ if(theapp.shell.getMinimized()) theapp.fromTray(); else theapp.toTray(); }); trayItem.setToolTipText(appname); trayItem.setImage(shellimage); } if(hide) { if(trayMenu) restoretrayitem.setText(getString(111)); shell.setMinimized(true); shell.setVisible(false); } } void fromTray(int show=1) { if(trayItem && !residetray) {trayItem.dispose();trayItem=null;} if(show) { if(trayMenu) restoretrayitem.setText(getString(112)); shell.setVisible(true); shell.setMinimized(false); if(wanttrayupdate) { wanttrayupdate=0; resize(); } } } void exit() { noupdate=1; shell.setVisible(false); fullscreen(0); config.write(std.path.join(appdir,"config.kfg")); notquit=0; player.quit(); doEvent("onexit"); } void doEvent(char[] name,char[][] params=null) { if(!name.length) return; auto al=name in console.aliases; if(al) { auto line=name~(params.length?" \""~std.string.join(params,"\" \"")~"\"":""); console.execLine(line,0,0); } if(name=="onafterplayback" && shutdownafterplayback) console.execLine("timer shutdown 25 116",0,0); } void dragwindow() { ReleaseCapture(); SendMessageA(shell.handle, WM_SYSCOMMAND, SC_MOVE+2, 0); } char[][int] translation_strings; char[][char[]] translation_helps; int god=0; char[] totaltime=null; ToolItem btnplay,btnpause,btnstop,btnnext,btnrw,btnff,btnprev,btnstep,btnpl,btncon,btnmute; } rulesplayer theapp; int notquit=1,echomp=1,indialog=0,wantupdate=0,updatesubtrack=0; Display display; char[] appdir,apppath; char[][] buf,cmq; char[][] buffer(char[] b=null) { synchronized { if(!b) { char[][] ret; foreach(a;buf) if(theapp.player.parseLine(a)) ret~=a; buf=null; return ret; } else {buf~=b;return null;} } } char[][] cmdqueue(char[] b=null) { synchronized { if(!b) { foreach(a;cmq) theapp.player.sendCmd(a); cmq=null; return null; } else {cmq~=b;return null;} } } int main(char[][] argv) { try { apppath=toUTF(argv[0]); appdir=getDirName(apppath); Config.defaults["app_dir"]=appdir; Config.defaults["app_name"]=appname; Config.defaults["app_version"]=appversion; char[MAX_PATH] dir; int l=GetWindowsDirectoryA(dir.ptr,MAX_PATH); Config.defaults["windows_dir"]=toUTF(dir[0..l].dup); auto h=LoadLibraryA("expmenu.dll\0".ptr); if(h) { DoExplorerMenu=cast(DoExplorerMenu_t)GetProcAddress(h,"DoExplorerMenu\0".ptr); MySystemShutdown=cast(MySystemShutdown_t)GetProcAddress(h,"MySystemShutdown\0".ptr); } display = Display.getDefault(); theapp=new rulesplayer; theapp.createshell(); theapp.player.showlogo(); theapp.shell.handleEvent(theapp.shell,DWT.Close,delegate(Event e){if(theapp.closetray) {theapp.toTray();e.doit=false;}else theapp.exit();}); theapp.shell.handleEvent(theapp.shell,DWT.Iconify,delegate(Event e){if(theapp.mintray) {theapp.toTray();e.doit=false;}}); theapp.shell.handleEvent(theapp.shell,DWT.Deactivate,delegate(Event e){if(theapp.isfull && !indialog) theapp.fullscreen(0);}); if(argv.length>1) { for(int c=1;c=0) { GridData gridData4 = new GridData(); gridData4.horizontalAlignment = GridData.END; gridData4.grabExcessHorizontalSpace = true; gridData4.widthHint = 50; gridData4.verticalAlignment = GridData.CENTER; GridData gridData3 = new GridData(); gridData3.horizontalAlignment = GridData.END; gridData3.widthHint = 50; gridData3.verticalAlignment = GridData.CENTER; GridData gridData2 = new GridData(); gridData2.horizontalSpan = 2; GridData gridData1 = new GridData(); gridData1.horizontalSpan = 2; gridData1.verticalAlignment = GridData.CENTER; gridData1.grabExcessHorizontalSpace = true; gridData1.horizontalAlignment = GridData.FILL; GridData gridData11 = new GridData(); gridData11.horizontalSpan = 2; gridData11.verticalAlignment = GridData.CENTER; gridData11.grabExcessHorizontalSpace = true; gridData11.horizontalAlignment = GridData.FILL; GridLayout gridLayout = new GridLayout(); gridLayout.makeColumnsEqualWidth = false; gridLayout.marginWidth = 10; gridLayout.marginHeight = 10; gridLayout.verticalSpacing = 5; gridLayout.numColumns = 2; gridLayout.horizontalSpacing = 5; sShell = new Shell(theapp.shell,DWT.DIALOG_TRIM|DWT.APPLICATION_MODAL); sShell.setText(theapp.getString(118)); sShell.setLayout(gridLayout); label = new Label(sShell, DWT.WRAP); label.setText(theapp.getString(prompt,paramMake(theapp.getString(115,paramMake(time))))); label.setLayoutData(gridData2); cancel = new Button(sShell, DWT.NONE); cancel.setText(theapp.getString(117)); cancel.setLayoutData(gridData4); cancel.handleEvent (this,DWT.Selection, &oncancel); ok = new Button(sShell, DWT.NONE); ok.setText(theapp.getString(73)); ok.setLayoutData(gridData3); ok.handleEvent (this,DWT.Selection, &onok); sShell.pack(); sShell.setSize(new Point(385,sShell.getSize().y)); Rectangle bounds = display.getPrimaryMonitor().getBounds (); Rectangle rect = sShell.getBounds (); int x = bounds.x + (bounds.width - rect.width) / 2; int y = bounds.y + (bounds.height - rect.height) / 2; sShell.setLocation (x, y); sShell.setDefaultButton(ok); ok.setFocus(); indialog=1; sShell.open(); auto th2=new Thread(&timer); th2.start(); while(!sShell.isDisposed()) if(!display.readAndDispatch()) display.sleep(); indialog=0; if(doit) theapp.console.execLine(b,0,1); } else { auto th2=new Thread(&timer); th2.start(); } } int timer() { Timer tt=new Timer; while(a<0 || indialog) { if(tt.getElapsed()>1000) { tt.reset(); t--; if(t<=0) { if(a<0) { display.asyncExec(new class Runnable{public void run() {theapp.console.execLine(b,0,1);}}); } else { display.asyncExec(new class Runnable{public void run() {if(indialog) oncancel(null);}}); } break; } else if(a>=0) { display.asyncExec(new class Runnable{public void run() {if(indialog) timerdialog.label.setText(theapp.getString(a,paramMake(theapp.getString(115,paramMake(t)))));}}); } } msleep(100); } return 0; } void onok(Event e) { doit=0; sShell.close(); } void oncancel(Event e) { doit=1; sShell.close(); } } version(Windows) { import std.c.windows.windows; const int WH_GETMESSAGE = (3); const int WH_CALLWNDPROC = (4); const int WM_DROPFILES = (563); const int WM_DDE_FIRST =0x03E0; const int WM_DDE_INITIATE =(WM_DDE_FIRST); const int WM_DDE_TERMINATE =(WM_DDE_FIRST+1); const int WM_DDE_ADVISE =(WM_DDE_FIRST+2); const int WM_DDE_UNADVISE =(WM_DDE_FIRST+3); const int WM_DDE_ACK =(WM_DDE_FIRST+4); const int WM_DDE_DATA =(WM_DDE_FIRST+5); const int WM_DDE_REQUEST =(WM_DDE_FIRST+6); const int WM_DDE_POKE =(WM_DDE_FIRST+7); const int WM_DDE_EXECUTE =(WM_DDE_FIRST+8); const int WM_DDE_LAST =(WM_DDE_FIRST+8); alias uint WINBOOL; struct CWPSTRUCT { LPARAM lParam; WPARAM wParam; UINT message; HWND hwnd; } extern(Windows) void* SetWindowsHookExA(int idHook,HOOKPROC lpfn,HINSTANCE hMod,DWORD dwThreadId); extern(Windows) void DragAcceptFiles(HWND,BOOL); extern(Windows) LRESULT CallNextHookEx(HANDLE, int, WPARAM, LPARAM); extern(Windows) uint DragQueryFileA(HANDLE, uint, CHAR*, uint); extern(Windows) void DragFinish(HANDLE); extern(Windows) UINT GlobalGetAtomNameA(ATOM, LPSTR, int); extern(Windows) ATOM AddAtomA(LPCSTR); extern(Windows) ATOM GlobalAddAtomA(LPCSTR); extern(Windows) BOOL UnpackDDElParam(UINT msg, LONG lParam, PUINT puiLo, PUINT puiHi); extern(Windows) LONG ReuseDDElParam(LONG lParam, UINT msgIn, UINT msgOut, UINT uiLo, UINT uiHi); extern(Windows) LPVOID GlobalLock(HGLOBAL); extern(Windows) WINBOOL PostMessageA(HWND, UINT, WPARAM, LPARAM); extern(Windows) ATOM GlobalDeleteAtom(ATOM); extern(Windows) WINBOOL DragQueryPoint(HANDLE, LPPOINT); extern(Windows) WINBOOL SystemParametersInfoA(UINT, UINT, PVOID, UINT); extern(Windows) LONG GetWindowLongA(HWND, int); extern(Windows) LONG SetWindowLongA(HWND, int, LONG); extern(Windows) UINT GetWindowsDirectoryA(LPSTR, UINT); extern(Windows) UINT GetDriveTypeA(LPCSTR); extern(Windows) LONG RegQueryValueExA(HKEY, LPCSTR, LPDWORD, LPDWORD, LPBYTE, LPDWORD); const int MK_CONTROL = (8); const int MK_SHIFT = (4); const int DRIVE_CDROM = (5); const int GWL_EXSTYLE = -((20)); const int GWL_STYLE = -((16)); const int WS_EX_APPWINDOW = (0x40000); const int WS_EX_TOPMOST = (0x8); const int HWND_NOTOPMOST = -(2); const int HWND_TOPMOST = -(1); const int SWP_NOMOVE = (2); const int SWP_NOSIZE = (1); extern(Windows) WINBOOL SetWindowPos(HWND, HWND, int, int, int, int, UINT); const int SPI_GETSCREENSAVEACTIVE = (16); const int SPI_SETSCREENSAVEACTIVE = (17); const int SPI_GETPOWEROFFACTIVE = (84); const int SPI_SETPOWEROFFACTIVE = (86); const int SPI_GETLOWPOWERACTIVE = 83; const int SPI_SETLOWPOWERACTIVE = 85; const int SC_SCREENSAVE=0xF140; const int SC_MONITORPOWER=0xF170; DWORD MAKELONG(WORD A, WORD B){return cast(DWORD)(A | (B << 16));} LPARAM MAKELPARAM(WORD l, WORD h){return MAKELONG(l, h);} HANDLE hhook_msg,hhook_dde; ATOM atom1,atom2; extern(Windows) LRESULT msg_hooker(int nCode, WPARAM wParam, LPARAM lParam) { void renderDDE(char[] c) { int getbraces(char[] buffer,char name1,char name2,out char[] rret) { char[] ret; char[] rest1=buffer,rest2=buffer; int l1,l2,ret2,ret1; for(;;) { l2=std.string.find(rest2,name2); if(l2>=0) { ret2+=l2; l1=std.string.find(rest1,name1); if(l1>=0) { ret1+=l1; if(ret1>ret2) break; else { ret2+=1; ret1+=1; rest1=rest1[l1+1..rest1.length]; rest2=rest2[l2+1..rest2.length]; } } else break; } else return -1; } rret=buffer[0..ret2]; return ret2; } char[][] renderbracepairs(char[] var,char a='(',char b=')') { if(var.length<2) return null; char[][] ret; char[] t; for(int c=0;;) { if(var[c]==a) { c++; if(c>=var.length) break; if(getbraces(var[c..var.length],a,b,t)<0) break; ret~=t; c+=t.length+1; if(c>=var.length) break; } else break; } return ret; } void ddecommand(char[] buffer) { int s=find(buffer,'('); if(s<0) { theapp.onDDECommand(buffer,null); return; } char[] name=buffer[0..s]; if(s>=buffer.length) { theapp.onDDECommand(name,null); return; } char[] args; getbraces(buffer[s+1..buffer.length],'(',')',args); s=0; int m,s1,end,sm; char[][] r; for(;s=args.length) break; m=find(args[s1..args.length],'"'); sm=s1+m; if(sm=args.length) break; else if(args[s]==',') s++; } } else { m=find(args[s..args.length],','); if(m<0){r~=args[s..args.length];break;} else { r~=args[s..s+m]; s+=m+1; } } } theapp.onDDECommand(name,r); } if(c.length) { if(c[0]!='[') ddecommand(c); else { char[][] m=renderbracepairs(c,'[',']'); for(int f;f0) { char[][] files; files.length=m; for(int c=0;c>16)/120); int keys=(cast(ushort)(wParam&0xFFFF)); int keymask=0; if(keys&MK_SHIFT) keymask|=DWT.SHIFT; else if(keys&MK_CONTROL) keymask|=DWT.CONTROL; int i=theapp.console.findBind(0,keymask,1,delta>0?hash!("wheelup"):hash!("wheeldown")); if(i>=0) {theapp.console.execLine(theapp.console.bindings[i].command,0,1);} } } void setDefaultStrings() {with(theapp){ translation_strings[0]="HELP"; translation_strings[1]="command"; translation_strings[2]="usage"; translation_strings[3]="type help for info on specific command"; translation_strings[4]="listing commands:"; translation_strings[5]="---end of list---"; translation_strings[6]="Disabled"; translation_strings[7]="Enabled"; translation_strings[8]="DVD"; translation_strings[9]="Title"; translation_strings[10]="Chapter"; translation_strings[11]="Angle"; translation_strings[12]="error"; translation_strings[13]="error: insufficient number of arguments. try help $0"; translation_strings[14]="error: illegal alias name"; translation_strings[15]="error: no menu to display"; translation_strings[16]="error: no menu created"; translation_strings[17]="UNKNOWN COMMAND $0"; translation_strings[18]="no errors"; translation_strings[19]="listing available commands:"; translation_strings[20]="listing aliases:"; translation_strings[21]="listing variables:"; translation_strings[22]="Enter URL:"; translation_strings[23]="listing key bindings:"; translation_strings[24]="error: key not bound ($0)"; translation_strings[25]="error: alias not found ($0)"; translation_strings[26]="error: $0 appears to be string"; translation_strings[27]="wrote $0"; translation_strings[28]="error: $0 is neither 0 or 1"; translation_strings[29]="Window size"; translation_strings[30]="Open file(s)..."; translation_strings[31]="Close"; translation_strings[32]="Playback"; translation_strings[33]="Save playlist"; translation_strings[34]="Error"; translation_strings[35]="Save what?"; translation_strings[36]="Playlist"; translation_strings[37]="error: registering (play) $0 files with "~appname; translation_strings[38]="error: registering (enqueue) $0 files with "~appname; translation_strings[39]="error: unregistering $0 files with "~appname; translation_strings[40]=appname~" playlist"; translation_strings[41]="Play with "~appname; translation_strings[42]="Enqueue in "~appname; translation_strings[43]="Shuffle"; translation_strings[44]="Repeat"; translation_strings[45]="Brightness"; translation_strings[46]="Contrast"; translation_strings[47]="Saturation"; translation_strings[48]="Hue"; translation_strings[49]="All MPlayer files"; translation_strings[50]="MPlayer video files"; translation_strings[51]="MPlayer audio files"; translation_strings[52]="MPlayer subtitles"; translation_strings[53]=appname~" playlists"; translation_strings[54]="All files"; translation_strings[55]="Start playback"; translation_strings[56]="Pause playback"; translation_strings[57]="Stop playback"; translation_strings[58]="Previous playlist item"; translation_strings[59]="Decrease playback speed"; translation_strings[60]="Increase playback speed"; translation_strings[61]="Next playlist item"; translation_strings[62]="Step one frame"; translation_strings[63]="Toggle playlist"; translation_strings[64]="Toggle console"; translation_strings[65]="Toggle audio"; translation_strings[66]=appname~" file"; translation_strings[67]="Idle"; translation_strings[68]="Paused"; translation_strings[69]="Playing ($0$%X)"; translation_strings[70]="An error occured ($0)"; translation_strings[71]="Input request"; translation_strings[72]="OK"; translation_strings[73]="Cancel"; translation_strings[74]="seems like empty or unsupported file"; translation_strings[75]="see console for more information"; translation_strings[76]="signal $0"; translation_strings[77]="can't write MPlayer pipe"; translation_strings[78]="Closing..."; translation_strings[79]="Restarting..."; translation_strings[80]="Opening..."; translation_strings[81]="title"; translation_strings[82]="chapter"; translation_strings[83]="angle"; translation_strings[84]="can't read MPlayer pipe"; translation_strings[85]="Wrote screenshot: $0"; translation_strings[86]="Buffering... ($0)"; translation_strings[87]="Dump stream to file"; translation_strings[88]="Open file(s)"; translation_strings[89]="Open video file first"; translation_strings[90]="Choose audio file"; translation_strings[91]="File"; translation_strings[92]="Video input"; translation_strings[93]="Video output"; translation_strings[94]="Audio input"; translation_strings[95]="Audio output"; translation_strings[96]="Clip metadata"; translation_strings[97]="There was some error extacting the info (see console)"; translation_strings[98]="Clip information"; translation_strings[99]="Add file(s) to playlist"; translation_strings[100]="Stream dumped to $0"; translation_strings[101]="error: unable to execute config file $0"; translation_strings[102]="Colours"; translation_strings[103]="Dumping internet stream..."; translation_strings[104]="Please enter some stuff:"; translation_strings[105]="Open URL..."; translation_strings[106]="Subtitle track"; translation_strings[107]="Audio track"; translation_strings[108]="error: a file must be opened to display the system menu"; translation_strings[109]="error: expmenu.dll failed to load properly"; translation_strings[110]="error: a file must be opened to display information about it"; translation_strings[111]="Restore"; translation_strings[112]="Hide"; translation_strings[113]="Enter title for the playlist item:"; translation_strings[114]="Search the playlist..."; translation_strings[115]="in $0 seconds"; translation_strings[116]="Shutting down $0..."; translation_strings[117]="Now"; translation_strings[118]="Timer confirmation"; translation_strings[119]="error: invalid playlist item index"; translation_strings[120]="error: the requested playlist item is a DVD chapter so the path can not be changed"; translation_strings[121]="Open folder..."; translation_strings[122]="Open folder"; translation_strings[123]="Add folder to playlist"; translation_strings[5028]="&File"; translation_strings[5017]="&Open file(s)..."; translation_strings[5016]="Open &URL..."; translation_strings[5015]="Play DVD"; translation_strings[5009]="&Close"; translation_strings[5126]="&Restart"; translation_strings[5119]="Clip information..."; translation_strings[5120]="About..."; translation_strings[5118]="Recent files"; translation_strings[5121]="MPlayer priority\t(R)"; translation_strings[5034]="Idle"; translation_strings[5035]="Below normal"; translation_strings[5036]="Normal"; translation_strings[5037]="Above normal"; translation_strings[5038]="High"; translation_strings[5039]="Realtime"; translation_strings[5122]="Associations"; translation_strings[5123]="Register videos with "~appname; translation_strings[5124]="Unregister videos"; translation_strings[5125]="&Exit"; translation_strings[5029]="&Playback"; translation_strings[5002]="Play"; translation_strings[5003]="Pause"; translation_strings[5004]="Stop"; translation_strings[5033]="Increase speed"; translation_strings[5053]="Decrease speed"; translation_strings[5054]="Next file"; translation_strings[5055]="Previous file"; translation_strings[5012]="Shuffle"; translation_strings[5013]="Repeat"; translation_strings[5040]="Autoplay"; translation_strings[5023]="Autodetect sequence files"; translation_strings[5127]="&Video"; translation_strings[5128]="OSD mode"; translation_strings[5005]="Subtitles only"; translation_strings[5006]="Volume + seek"; translation_strings[5007]="Volume + seek + timer + file position percentage on seeking"; translation_strings[5008]="Volume + seek + timer + percentage + total duration of the media"; translation_strings[5129]="Framedrop"; translation_strings[5019]="Disabled"; translation_strings[5020]="Enabled"; translation_strings[5021]="Hard"; translation_strings[5130]="Postprocessing\t(R)"; translation_strings[5057]="Disabled"; translation_strings[5063]="Slowest, best"; translation_strings[5131]="Aspect ratio"; translation_strings[5112]="Original"; translation_strings[5056]="DVD"; translation_strings[5132]="Reset color controls"; translation_strings[5026]="Keep aspect ratio"; translation_strings[5022]="Deinterlace\t(R)"; translation_strings[5069]="Rebuild index\t(R)"; translation_strings[5041]="Fullscreen mode"; translation_strings[5111]="Compact mode"; translation_strings[5133]="&Audio"; translation_strings[5027]="Track\t(R)"; translation_strings[5134]="Output\t(R)"; translation_strings[5032]="Disabled"; translation_strings[5031]="Win32"; translation_strings[5030]="DirectSound"; translation_strings[5117]="Disk writer"; translation_strings[5135]="Volume\t(R)"; translation_strings[5049]="Original clip volume"; translation_strings[5136]="Load external file...\t(R)"; translation_strings[5011]="Mute"; translation_strings[5137]="&Subtitles"; translation_strings[5025]="Track"; translation_strings[5138]="Size\t(R)"; translation_strings[5042]="Tiny"; translation_strings[5043]="Small"; translation_strings[5044]="Normal"; translation_strings[5045]="Big"; translation_strings[5046]="Large"; translation_strings[5139]="Black band\t(R)"; translation_strings[5064]="Disabled"; translation_strings[5140]="Codepage\t(R)"; translation_strings[5024]="Don't autoload subtitles"; translation_strings[5010]="Show subtitles"; translation_strings[5141]="&Tools"; translation_strings[5142]="Language"; translation_strings[5000]="Playlist"; translation_strings[5001]="Console"; translation_strings[5014]="Resize after movie"; translation_strings[5143]="Center after resize"; translation_strings[5116]="Start in fullscreen mode"; translation_strings[5109]="Minimize to tray"; translation_strings[5108]="Close to tray"; translation_strings[5107]="Reside in tray"; translation_strings[5018]="Stick on top"; translation_strings[5110]="Show titlebar"; translation_strings[5144]="Add file(s)..."; translation_strings[5145]="Add URL..."; translation_strings[5146]="Sort"; translation_strings[5147]="Clear"; translation_strings[5148]="Save..."; translation_strings[5149]="Load..."; translation_strings[5106]="Exit"; translation_strings[5105]="Search..."; translation_strings[5104]="Shutdown after playback"; translation_strings[5103]="Open folder..."; translation_strings[5102]="Add folder..."; translation_helps["alias"]="command: alias \nusage: creates an alias named 'name' for 'command'"; translation_helps["toggle"]="command: toggle \nusage: changes 'var' from 0 to 1 and vice versa"; translation_helps["errors"]="command: errors [clear=1]\nusage: show cached output of stderr and clears the cache"; translation_helps["registerext"]="command: registerext [description] [icon]\nusage: registers 'ext' extension with "~appname~". the extension must be prefixed with dot, i.e. .avi"; translation_helps["unregisterext"]="command: unregisterext \nusage: unregisters 'ext' extension from "~appname~" and returns the previous registered program. the extension must be prefixed with dot, i.e. .avi"; translation_helps["inc"]="command: inc \nusage: increases the value of 'var' by 'value' or by 1 if it is omitted"; translation_helps["incf"]="command: incf \nusage: increases the value of 'var' by 'value' or by 1 if it is omitted"; translation_helps["pladd"]="command: pladd [file1] [file2] [fileN]\nusage: adds files to the playlist"; translation_helps["pladdurl"]="command: pladdurl [file1] [file2] [fileN]\nusage: adds files to the playlist"; translation_helps["pladddvd"]="command: pladd [title] [chapter] [angle]\nusage: adds a dvd title/chapter/angle to the playlist"; translation_helps["plclear"]="command: plclear\nusage: clears the playlist"; translation_helps["plnext"]="command: plnext\nusage: plays next item in the playlist"; translation_helps["plprev"]="command: plprev\nusage: plays previous item in the playlist"; translation_helps["plsave"]="command: plsave [file]\nusage: saves the current playlist as 'file'"; translation_helps["plsort"]="command: plsort [ascending=1]\nusage: sorts the playlist"; translation_helps["plload"]="command: plload [file]\nusage: loads playlist from 'file'"; translation_helps["dec"]="command: dec \nusage: decreases the value of 'var' by 'value' or by 1 if it is omitted"; translation_helps["decf"]="command: decf \nusage: decreases the value of 'var' by 'value' or by 1 if it is omitted"; translation_helps["about"]="command: about\nusage: displays some information"; translation_helps["write"]="command: write \nusage: writes the current configuration to 'file'"; translation_helps["unalias"]="command: unalias \nusage: removes alias named 'name'"; translation_helps["unaliasall"]="command: unaliasall\nusage: removes all aliases"; translation_helps["stop"]="command: stop\nusage: pauses the playback and goes to the begining"; translation_helps["eval"]="command: eval [command2] ... [commandN]\nusage: executes few commands"; translation_helps["speed_inc"]="command: speed_inc\nusage: increases playback speed"; translation_helps["speed_dec"]="command: speed_dec\nusage: decreases playback speed"; translation_helps["aliaslist"]="command: aliaslist\nusage: displays a list of all aliases"; translation_helps["bind"]="command: bind \nusage: assigns 'command' to 'key'. you can also bind mouse1,mouse1dbl,mouse2,mouse2dbl,mouse3,mouse3dbl"; translation_helps["set"]="command: set \nusage: assigns 'value' to 'var'. the variable is created if not exists"; translation_helps["unset"]="command: unset \nusage: removes variable 'var'"; translation_helps["unsetall"]="command: unsetall\nusage: removes all variables"; translation_helps["reset"]="command: reset \nusage: resets 'var' to its default value"; translation_helps["resetall"]="command: resetall\nusage: sets all variable to their default values"; translation_helps["unbind"]="command: unbind \nusage: removes any bound command from 'key'"; translation_helps["unbindall"]="command: unbindall\nusage: clears all bindings"; translation_helps["bindlist"]="command: bindlist\nusage: displays a list of all key bindings"; translation_helps["help"]="command: help [command]\nusage: displays help information in the console"; translation_helps["say"]="command: say [say what]\nusage: prints 'say what' to the console"; translation_helps["echo"]="command: echo [duration] [level]\nusage: shows an osd message 'echo what' for 'duration' milliseconds (default 2000) at osd level 'level' (default $osd_messages). example - \"echo player 1000 1\" will show the message player if the osd mode is set to \"Volume + seek\" or higher. if 'level' is higher than the current osd level the message will be echoed to the console"; translation_helps["yell"]="command: yell [yell what]\nusage: shows a message box with 'yell what'"; translation_helps["say"]="command: mpcmd [param1] [param2] ... [paramN]\nusage: send a command directly to MPlayer"; translation_helps["varlist"]="command: varlist\nusage: shows list of all defined variables"; translation_helps["clear"]="command: clear\nusage: clears the console display"; translation_helps["clearhistory"]="command: clearhistory\nusage: clears commands history"; translation_helps["close"]="command: close\nusage: closes opened file"; translation_helps["open"]="command: open [file1] [file2] [fileN]\nusage: adds all files to the playlist and opens the first one"; translation_helps["openurl"]="command: openurl [file1] [file2] [fileN]\nusage: adds all files to the playlist and opens the first one"; translation_helps["openaudio"]="command: open [file1]\nusage: opens external audio stream"; translation_helps["menubegin"]="command: menubegin \nusage: creates a popup or submenu in the popup menu. if the command begins a subemnu 'title' is the name of the submenu item"; translation_helps["menuend"]="command: menuend\nusage: show the popupmenu created with menubegin"; translation_helps["menuseparator"]="command: menuseparator\nusage: adds a separator to a menu crated with menubegin"; translation_helps["menuitem"]="command: menuitem <title> [command]\nusage: adds an item to a menu crated with menubegin"; translation_helps["freemem"]="command: freemem\nusage: run the garbage collector or in other words free some unused memory (but it is not for sure)"; translation_helps["wndsize"]="command: wndsize [size]\nusage: sets the window size to 'size' times of the movie (default 1). 1 is 100%, 0.5 is 50%, 2 is 200%, etc."; translation_helps["recentadd"]="command: recentadd <filename>\nusage: adds 'filename' to the recent files list"; translation_helps["recentdel"]="command: recentdel <filename>\nusage: deletes 'filename' to the recent files list"; translation_helps["recentclear"]="command: recentclear\nusage: clears the recent files list"; translation_helps["playorpause"]="command: playorpause\nusage: plays or pauses the movie"; translation_helps["setstring"]="command: setstring <id> <text>\nusage: change the text (translate) of string with given 'id'"; translation_helps["sethelp"]="command: sethelp <command> <text>\nusage: change the 'text' of the help description (translate) of given 'command'"; translation_helps["setimage"]="command: setimage <id> <path>\nusage: change the image user interface item with give 'id'. works with menuitems."; translation_helps["updateui"]="command: updateui\nusage: updates the user interface so any translations could take effect"; translation_helps["getinput"]="command: getinput <varname> [prompt]\nusage: asks the user for input and saves it to variable named 'varname'"; translation_helps["menu_subtrack"]="command: menu_subtrack <itemname>\nusage: adds a menu item called 'itemname' in a menu created with menubegin, filling it with the contents of the subtitle tracks menu"; translation_helps["menu_audiotrack"]="command: menu_audiotrack <itemname>\nusage: adds a menu item called 'itemname' in a menu created with menubegin, filling it with the contents of the audio tracks menu"; translation_helps["menu_language"]="command: menu_language <itemname>\nusage: adds a menu item called 'itemname' in a menu created with menubegin, filling it with the contents of the language menu"; translation_helps["menu_playdvd"]="command: menu_playdvd <itemname>\nusage: adds a menu item called 'itemname' in a menu created with menubegin, filling it with the contents of the play dvd menu"; translation_helps["menu_dvd"]="command: menu_dvd <itemname>\nusage: adds a menu item called 'itemname' in a menu created with menubegin, filling it with the contents of the dvd menu"; translation_helps["menu_recent"]="command: menu_recent <itemname>\nusage: adds a menu item called 'itemname' in a menu created with menubegin, filling it with the contents of the recent files menu"; translation_helps["menu_system"]="command: menu_system\nusage: displays the OS shell menu for the currently playing file"; translation_helps["pladd2"]="command: pladd2 [title] [file]\nusage: adds a file to the playlist with specified title"; translation_helps["pladdurl2"]="command: pladdurl2 [title] [file]\nusage: adds a file to the playlist with specified title"; translation_helps["plsearch"]="command: plsearch [string]\nerror: displays a playlist search dialog box"; translation_helps["dragwindow"]="command: dragwindow\nusage: begin to drag the window with the mouse. works only with mouse1"; translation_helps["shutdown"]="command: shutdown\nusage: shuts the system down"; translation_helps["timer"]="command: timer <command> <time> [prompt]\nusage: executes 'command' after 'time' seconds. if 'prompt' is supplied a confirmation dialog is displayed. 'prompt' must be a string id"; translation_helps["plsetdump"]="command: plsetdump <index> <dump> \nusage: set the dump flag of a playlist item. 'dump' should be 1 for true or 0 for false"; translation_helps["plsettitle"]="command: plsetdump <index> <title> \nusage: set the title of a playlist item"; translation_helps["plsetpath"]="command: plsetpath <index> <path> \nusage: set the full path or url of a playlist item"; }}