Ignore:
Timestamp:
Oct 2, 2023, 11:34:35 PM (23 months ago)
Author:
gyoung
Message:

Remaining changes from merge with Lars 2.9 branch

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/classes/mm-progs/videoplayer/mmplayer.c

    r46 r104  
    2121 * If you need another license for your project/product (commercial,
    2222 * noncommercial, whatever) contact me at
    23  * 
     23 *
    2424 * http://www.os2world.com/cdwriting
    2525 * http://www.geocities.com/SiliconValley/Sector/5785/
     
    5555#include "sys_funcs.h"
    5656
    57 #ifndef OPEN_DEFAULT 
     57#ifndef OPEN_DEFAULT
    5858/*  Open views for the wpOpen() method */
    5959
     
    140140
    141141/* Every folder has one running play thread to handle play commands */
    142 void _Optlink playThreadFunc (void *arg);
     142void playThreadFunc (void *arg);
    143143void controlPlaying(HWND hwndDialog, ULONG ulAction, ULONG ulReserved);
    144144BOOL stopAudioFile(HWND hwndFrame);
     
    216216  WinQueryPointerPos(HWND_DESKTOP, &ptl) ;
    217217  WinMapWindowPoints(HWND_DESKTOP,hwnd,&ptl,1);
    218   WinPopupMenu(hwnd, hwnd, hwndPopup, 
     218  WinPopupMenu(hwnd, hwnd, hwndPopup,
    219219               ptl.x, ptl.y, 0, PU_HCONSTRAIN | PU_VCONSTRAIN |
    220                PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_MOUSEBUTTON2 | PU_NONE  ); 
    221  
     220               PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_MOUSEBUTTON2 | PU_NONE  );
     221
    222222}
    223223
     
    232232  hResource=BMP_RESSOURCEHANDLE; //_queryResModuleHandle();
    233233  hps=WinGetPS(HWND_DESKTOP);
    234  
     234
    235235  /* The main BMP */
    236236  allBMPs[MAIN_BMP_IDX].hbm=GpiLoadBitmap(hps, hResource, IDBMP_TOPMIDDLE, 0, 0);
     
    332332  WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclSource.xLeft,ci.rclSource.yBottom,
    333333                  ci.rclSource.xRight-ci.rclSource.xLeft,
    334                   ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE|SWP_SIZE); 
     334                  ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE|SWP_SIZE);
    335335  oldPlayTimeProc=WinSubclassWindow(WinWindowFromID(hwnd, IDST_MMPLAYERPLAYTIME), playTimeTextProc);
    336336
    337337  /* Pos slider */
    338338  ci=ciControls[CTRLIDX_POSSLIDER];//ciPosSlider;
    339   WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 
     339  WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10,
    340340                  hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE);
    341341  WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom,
    342342                  ci.rclSource.xRight-ci.rclSource.xLeft,
    343343                  ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE | SWP_SIZE);
    344  
     344
    345345  WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO,
    346346             MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0),
    347              MPFROM2SHORT( 9, 9)); 
     347             MPFROM2SHORT( 9, 9));
    348348
    349349  /* Vol slider */
    350350  ci=ciControls[CTRLIDX_VOLSLIDER];//ciVolSlider;
    351   WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 
     351  WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10,
    352352                  hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE);
    353353  WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom,
     
    356356  WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO,
    357357             MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0),
    358              MPFROM2SHORT( 9, 9)); 
     358             MPFROM2SHORT( 9, 9));
    359359
    360360}
     
    375375  if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
    376376    /* Problem with MCI. Clean up. The Timer will be stopped in the method */
    377     stopAudioFile(hwndFrame); 
     377    stopAudioFile(hwndFrame);
    378378  }
    379379  else {
    380380    if(!stricmp(retMsg, "stopped")) {
    381381      /* Audio file played. */
    382       stopAudioFile(hwndFrame); 
     382      stopAudioFile(hwndFrame);
    383383    }
    384384    showPlayTimeDisplay(hwndFrame, TRUE);/* Ensure display is visible */
     
    396396      return usItems;
    397397    }
    398  
     398
    399399  return 0;
    400400}
     
    402402BOOL DrgVerifyTypeCW(PDRAGITEM pDragItem, char * chrType)
    403403{
    404   /* DrgVerifyType() seems not to work when several types are in the list?? 
     404  /* DrgVerifyType() seems not to work when several types are in the list??
    405405     Dokumentation says, it works... */
    406406  /* Only check for a single type for now */
     
    472472    for(ulHash=0;*theString!='\0'; theString++)
    473473      ulHash=*theString+37*ulHash;
    474  
     474
    475475  return ulHash%HASHSIZE;
    476476}
     
    543543MRESULT handleDrag0ver(PDRAGINFO pdi, HWND hwnd)
    544544{
    545  
     545
    546546  /* Only accept one file */
    547547  if(DrgGetNumObjects(pdi)!=1) {
     
    551551  if(DrgCheckForKnownType(pdi, hwnd))
    552552    return MRFROM2SHORT(DOR_DROP, DO_COPY);
    553  
    554   return MRFROM2SHORT(DOR_NEVERDROP, DO_COPY); 
     553
     554  return MRFROM2SHORT(DOR_NEVERDROP, DO_COPY);
    555555}
    556556
     
    567567      char chrFile[CCHMAXPATH];
    568568      PDRAGITEM pDragItem;
    569      
     569
    570570      pDragItem=DrgQueryDragitemPtr(pdi, 0);
    571       DrgQueryStrName(pDragItem->hstrSourceName,sizeof(chrFile), chrFile); 
    572       DrgQueryStrName(pDragItem->hstrContainerName,sizeof(chrSourceName), chrSourceName); 
     571      DrgQueryStrName(pDragItem->hstrSourceName,sizeof(chrFile), chrFile);
     572      DrgQueryStrName(pDragItem->hstrContainerName,sizeof(chrSourceName), chrSourceName);
    573573      strcat(chrSourceName, chrFile);
    574      
     574
    575575      /* Start new file */
    576576      controlPlaying(hwnd, PLAY_FIRST, 0);
     
    613613             MPFROM2SHORT(SC_SIZE, TRUE),
    614614             MPFROMP(NULL));
    615  
     615
    616616  WinSendMsg(hwndMenu, /* Delete Minimize from the system menu */
    617617             MM_DELETEITEM,
    618618             MPFROM2SHORT(SC_MINIMIZE, TRUE),
    619619             MPFROMP(NULL));
    620  
     620
    621621  WinSendMsg(hwndMenu, /* Delete Maximize from the system menu */
    622622             MM_DELETEITEM,
     
    653653
    654654  switch (msg)
    655     {     
     655    {
    656656    case DM_DRAGOVER:
    657657      {
     
    682682        swctl.fbJump=SWL_JUMPABLE;
    683683        WinAddSwitchEntry(&swctl);
    684        
     684
    685685        adjustDialogControlPos(hwnd);
    686        
     686
    687687        /* Set volume slider*/
    688688        WinSendMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERVOLUME),
     
    690690                    MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_INCREMENTVALUE),
    691691                    MPFROMLONG( ulVolume));
    692        
     692
    693693        /* Subclass buttons for DnD */
    694694        orgButtonProc=WinSubclassWindow(WinWindowFromID(hwnd, IDPB_MMPLAYERPLAY), buttonProc);
    695695        WinSubclassWindow(WinWindowFromID(hwnd, IDPB_MMPLAYERPAUSE), buttonProc);
    696696        WinSubclassWindow(WinWindowFromID(hwnd, IDPB_MMPLAYERSTOP), buttonProc);
    697                
     697
    698698        FixSysMenu(hwnd);
    699699
     
    701701        if(allBMPs[MAIN_BMP_IDX].hbm) {
    702702          SWP swp;
    703          
    704           WinQueryWindowPos(WinWindowFromID(hwnd, FID_TITLEBAR), &swp);         
    705           WinSetWindowPos(WinWindowFromID(hwnd, ID_CLIENT), NULLHANDLE, 
    706                           WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME), 
    707                           WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME), 
     703
     704          WinQueryWindowPos(WinWindowFromID(hwnd, FID_TITLEBAR), &swp);
     705          WinSetWindowPos(WinWindowFromID(hwnd, ID_CLIENT), NULLHANDLE,
     706                          WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME),
     707                          WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME),
    708708                          allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cx,
    709709                          allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cy,
    710710                          SWP_SIZE|SWP_MOVE);
    711711          orgBgProc=WinSubclassWindow(WinWindowFromID(hwnd, ID_CLIENT), bgProc);
    712          
     712
    713713          WinSetWindowPos(hwnd, NULLHANDLE, 0, 0,
    714714                          allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cx+WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME)*2,
     
    741741      /*****************************************************/
    742742    case WM_APPTERMINATENOTIFY:
    743      
     743
    744744      switch(SHORT1FROMMP(mp1))
    745745        {
     
    754754          return MRFALSE;
    755755        case NOTIFY_CONTEXT:
    756           /* Show context menu. */           
     756          /* Show context menu. */
    757757          HlpContextMenu(hwnd, iWhichDisplay+ID_MENUITEMELAPSED, TRUE);
    758758          return MRFALSE;
     
    761761        }
    762762      return MRFALSE;
    763      
     763
    764764      /*****************************************************/
    765765      /* The following two messages are for device sharing */
     
    769769        char chrCommand[100];
    770770        int iWavePriv;
    771    
     771
    772772        iWavePriv=ulPid;
    773773
     
    800800      /* SETPOSITIONADVICE does not work for some reason,  */
    801801      /* so a timer is used. Yes, it's quit cumbersome...  */
    802       /*****************************************************/ 
     802      /*****************************************************/
    803803    case WM_TIMER:
    804804      if(SHORT1FROMMP(mp1)==IDTIMER_PLAY) {
     
    821821            /* Set slider position */
    822822
    823             WinPostMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERPOSBAR), 
     823            WinPostMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERPOSBAR),
    824824                        SLM_SETSLIDERINFO,
    825825                        MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_INCREMENTVALUE),
     
    908908        default:
    909909          break;
    910         }             
     910        }
    911911      break;
    912912
     
    919919        char chrCommand[50];
    920920        char retMsg[20];
    921        
     921
    922922        switch(SHORT2FROMMP(mp1))
    923923          {
     
    949949                      static long lLastPos=0;
    950950                      long lPos=LONGFROMMP(mp2);
    951              
     951
    952952                      bPosDragging=TRUE;
    953953                      lPos*=ulTotalLength/100;
     
    973973                    {
    974974                      ULONG ulValue;
    975                      
     975
    976976                      ulValue=LONGFROMMP(mp2);
    977977                      ulVolume=ulValue;
     
    985985
    986986                      bPosDragging=FALSE;
    987                       lPos*=1000;                     
     987                      lPos*=1000;
    988988                      lPos*=ulTotalLength/100;
    989989                      lPos/=1000;// Use only full seconds
     
    992992                      seekAudioFile(lPos);
    993993                      /* restart timer */
    994                       WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, IDTIMER_PLAY, PLAYTIMER_DELAY); 
     994                      WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, IDTIMER_PLAY, PLAYTIMER_DELAY);
    995995                      ulPos=lPos/1000;
    996996                      break;
     
    10091009      break;
    10101010    }/* switch */
    1011  
     1011
    10121012  return WinDefDlgProc( hwnd, msg, mp1, mp2);
    10131013}
     
    10291029                     ))==NULLHANDLE)
    10301030    return FALSE;
    1031  
     1031
    10321032  ulSize=sizeof(chrFileName);
    1033  
     1033
    10341034  if ((rc = DosOpen(chrFileName, &handle, &act,
    10351035                    0L, 0, OPEN_ACTION_OPEN_IF_EXISTS,
     
    10951095BOOL writeVolumeToIni(char * iniFile, char* chrApp, char *chrKey, ULONG ulVolume)
    10961096{
    1097  
     1097
    10981098  return IniSaveInt(iniFile, chrApp, chrKey, ulVolume);
    10991099}
     
    11451145  if(hab) {
    11461146    hmq=WinCreateMsgQueue(hab,0);
    1147     if(hmq) { 
    1148       /* Check if user started prog by hand */   
     1147    if(hmq) {
     1148      /* Check if user started prog by hand */
    11491149      if(argc!=NUMPARAMS) {/* Not the right num of params */
    11501150        pmUsage();
     
    11641164          strcpy(chrClassName, params[1]);
    11651165
    1166         /* Get our ressource dll */ 
     1166        /* Get our ressource dll */
    11671167        RESSOURCEHANDLE=queryResModuleHandle(argv[0]);
    11681168        /* Get data from INI file */
     
    11761176        WinRegisterClass(WinQueryAnchorBlock(HWND_DESKTOP), SLIDER_CLASS, privateSliderProc,0, SLADDBYTES);
    11771177
    1178         _loadBmps();       
     1178        _loadBmps();
    11791179        DosGetInfoBlocks(&ptib, &ppib);
    11801180        ulPid=ppib->pib_ulpid;
     
    11831183        //DosBeep(5000, 400);
    11841184
    1185         if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 
     1185        if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc,
    11861186                       RESSOURCEHANDLE, IDDLG_MMPLAYER, 0) == DID_ERROR )
    11871187          {
    11881188            /*
    1189               Text:   
    1190               Title:  "Installation problem"                       
    1191               */             
     1189              Text:
     1190              Title:  "Installation problem"
     1191              */
    11921192            messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text),
    11931193                        title, IDSTR_INSTALLERRORTITLE , sizeof(title),
Note: See TracChangeset for help on using the changeset viewer.