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:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/classes/mm-progs/mmfind/image.c

    r4 r104  
    2626    POINTL aptl[4];
    2727    HPS    hps;
    28     BOOL   bReturnCode;
    2928    ULONG  ulHeight;
    3029    ULONG  ulWidth;
     
    3736     *  Get position of image frame
    3837     */
    39     bReturnCode = WinQueryWindowPos ( hwnd, &swp);
     38    WinQueryWindowPos ( hwnd, &swp);
    4039
    4140    WinQueryWindowRect(hwnd, &rectl);
     
    4847        aptl[0].x=(swp.cx-ulWidth)/2;
    4948        aptl[1].x=aptl[0].x+ulWidth;
    50        
     49
    5150        aptl[0].y=(swp.cy-ulHeight)/2;
    5251        aptl[1].y=aptl[0].y+ulHeight;
     
    6261      aptl[0].x=(swp.cx-ulWidth*fRes)/2;
    6362      aptl[1].x=aptl[0].x+ulWidth*fRes;
    64      
     63
    6564      aptl[0].y=(swp.cy-ulHeight*fRes)/2;
    6665      aptl[1].y=aptl[0].y+ulHeight*fRes;
    6766    }
    68    
     67
    6968    aptl[2].x = 0;              // source lower left
    7069    aptl[2].y = 0;
    71    
     70
    7271    aptl[3].x = ulWidth;   // source upper right
    7372    aptl[3].y = ulHeight;
     
    8988    //       WinDrawBitmap(hps, hBitmap, NULLHANDLE, (PPOINTL)aptl, 0, 0, DBM_NORMAL/*|DBM_STRETCH*/);
    9089#endif
    91     bReturnCode = WinEndPaint (hps);
     90    WinEndPaint (hps);
    9291}
    9392
     
    9695
    9796  switch (msg)
    98     {     
     97    {
    9998    case WM_PAINT:
    10099      {
     
    276275        return(0L);
    277276      }
    278    
     277
    279278
    280279    // ***************************************************
     
    282281    // the memory device context obtained above.
    283282    // ***************************************************
    284    
     283
    285284    ImageSize.cx = dwWidth;
    286285    ImageSize.cy = dwHeight;
     
    300299                       (ULONG) MB_OK | MB_MOVEABLE |
    301300                       MB_ERROR );
    302 #endif   
     301#endif
    303302        DevCloseDC(hdc);
    304303        DosFreeMem(pRowBuffer);
  • trunk/classes/mm-progs/mmfind/mmfind.c

    r4 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/
     
    7373BOOL bIsMidi=FALSE;             /* No MIDI support atm */
    7474BOOL bIsPlaying=FALSE;          /* TRUE if currently playing */
    75 BOOL bPaused=FALSE;             
     75BOOL bPaused=FALSE;
    7676ULONG ulPos;
    7777ULONG ulTotalLength;
     
    120120  hps=WinGetPS(HWND_DESKTOP);
    121121
    122   /* Play */ 
     122  /* Play */
    123123  hbmPlay=GpiLoadBitmap(hps, hResource, IDBMP_PLAY, 0, 0);
    124124
     
    143143    ulStyle|=(BS_BITMAP);
    144144    ulStyle&=~BS_TEXT;
    145    
     145
    146146    if(WinSetWindowULong(hwndTemp, QWL_STYLE, ulStyle)) {
    147147      memset(&btCtrl, 0, sizeof(btCtrl));
     
    163163    ulStyle|=(BS_BITMAP);
    164164    ulStyle&=~BS_TEXT;
    165    
     165
    166166    if(WinSetWindowULong(hwndTemp, QWL_STYLE, ulStyle)) {
    167167      memset(&btCtrl, 0, sizeof(btCtrl));
     
    199199  if(!MsgGetMessage(audioText, IDSTR_AUDIOINFOTEXT, sizeof(audioText), hResMod,HWND_DESKTOP))
    200200    strcpy(audioText, TEXT_INFOTEXT);
    201   if(!MsgGetMessage(chrMediaFileTypes[MT_AUDIO], IDSTR_TYPEAUDIO, 
     201  if(!MsgGetMessage(chrMediaFileTypes[MT_AUDIO], IDSTR_TYPEAUDIO,
    202202                 sizeof(chrMediaFileTypes[MT_AUDIO]), hResMod, HWND_DESKTOP))
    203203    strcpy(chrMediaFileTypes[MT_AUDIO], TEXT_TYPEAUDIO);
    204   if(!MsgGetMessage(chrMediaFileTypes[MT_IMAGE], IDSTR_TYPEIMAGE, 
     204  if(!MsgGetMessage(chrMediaFileTypes[MT_IMAGE], IDSTR_TYPEIMAGE,
    205205                 sizeof(chrMediaFileTypes[MT_IMAGE]), hResMod, HWND_DESKTOP))
    206206    strcpy(chrMediaFileTypes[MT_AUDIO], TEXT_TYPEIMAGE);
    207   if(!MsgGetMessage(chrMediaFileTypes[MT_VIDEO], IDSTR_TYPEVIDEO, 
     207  if(!MsgGetMessage(chrMediaFileTypes[MT_VIDEO], IDSTR_TYPEVIDEO,
    208208                 sizeof(chrMediaFileTypes[MT_VIDEO]), hResMod, HWND_DESKTOP))
    209209    strcpy(chrMediaFileTypes[MT_VIDEO], TEXT_TYPEVIDEO);
     
    272272  char chrCommand[50];
    273273  char retMsg[100];
    274   ULONG rc;
    275274
    276275  if(bIsPlaying) {
    277276    sprintf(chrCommand,"stop wave%ld wait", hwndNotify);
    278     rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
    279    
     277    mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     278
    280279    sprintf(chrCommand,"close wave%ld wait", hwndNotify);
    281     rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
    282 
    283 #if 0   
     280    mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     281
     282#if 0
    284283    _resetDisplay(hwndFrame);
    285284    showPlayTimeDisplay( hwndFrame, TRUE);
     
    287286#endif
    288287    bIsPlaying=FALSE;
    289     bPaused=FALSE; 
     288    bPaused=FALSE;
    290289  }
    291290
     
    319318    strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice));
    320319
    321   /* Start audio file */ 
     320  /* Start audio file */
    322321  sprintf(chrCommand,"open \"%s\"  type %s alias wave%ld SHAREABLE wait", chrSourceName, chrDevice, hwndNotify);
    323322
     
    326325  if((rc & 0x0000ffff)!=MCIERR_SUCCESS)
    327326    return 0;
    328  
     327
    329328  /* Set time format */
    330329  sprintf(chrCommand,"SET wave%ld TIME FORMAT MILLISECONDS wait", hwndNotify);
     
    334333    rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
    335334    return 0;
    336   }     
     335  }
    337336
    338337#if 0
     
    420419
    421420/* Every folder has one running play thread to handle play commands */
    422 void _Optlink playThreadFunc (void *arg)
     421void playThreadFunc (void *arg)
    423422{
    424423  HAB  hab;
     
    488487  if(MMIO_SUCCESS!=mmioIdentifyFile(chrFile, &mmioInfo, &mmFormatInfo, &fourCC, 0,0))
    489488    {
    490       return MT_UNKNOWN; 
     489      return MT_UNKNOWN;
    491490    }
    492491
     
    539538        }
    540539        /* Fill combo box with media types (audio, image, video) */
    541         for(a=0;a<NUMMEDIATYPES;a++) 
    542           WinSendMsg(WinWindowFromID(hwnd, IDCB_TYPEOFFILE), LM_INSERTITEM, MRFROMSHORT(LIT_SORTASCENDING), 
     540        for(a=0;a<NUMMEDIATYPES;a++)
     541          WinSendMsg(WinWindowFromID(hwnd, IDCB_TYPEOFFILE), LM_INSERTITEM, MRFROMSHORT(LIT_SORTASCENDING),
    543542                     MPFROMP(chrMediaFileTypes[a]));
    544543        WinSetWindowText(WinWindowFromID(hwnd, IDCB_TYPEOFFILE), chrMediaFileTypes[0]);
     
    681680                  mmio.ulFlags=MMIO_READ;
    682681                  mmio.ulTranslate=MMIO_TRANSLATEHEADER;
    683                  
     682
    684683                  hmmio = mmioOpen(chrFullName, &mmio, MMIO_READ);
    685684                  if(!hmmio)
     
    689688                  rc = mmioGetHeader(hmmio, &mmAudioHeader,sizeof(MMAUDIOHEADER),
    690689                                     &lBytesRead, 0, 0);
    691                  
     690
    692691                  mmioClose(hmmio, 0);
    693692                  if(rc!=MMIO_SUCCESS) {
     
    785784  APIRET   rc;                        /* return code from REXX     */
    786785  SHORT    rexxrc = 0;                /* return code from function */
    787   char theScript[CCHMAXPATH]; 
     786  char theScript[CCHMAXPATH];
    788787  /* By setting the strlength of the output RXSTRING to zero, we   */
    789788  /* force the interpreter to allocate memory and return it to us. */
    790789  /* We could provide a buffer for the interpreter to use instead. */
    791790  rexxretval.strlength = 0L;          /* initialize return to empty*/
    792    
     791
    793792  sprintf(theScript, "%s\\%s", pszBinDir, rexxFile);
    794793
     
    807806#if 0
    808807  if(rc) {
    809     sprintf(text,"Error in the Rexx skript %s\n\n Get more information with 'help REX%04d'.\n", 
     808    sprintf(text,"Error in the Rexx skript %s\n\n Get more information with 'help REX%04d'.\n",
    810809            tPt->rexxSkript, rc*-1);
    811810    WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, text, "", 1234, MB_OK|MB_MOVEABLE|MB_ERROR);
     
    822821  }
    823822  if(rexxretval.strptr)
    824     DosFreeMem(rexxretval.strptr);          /* Release storage given to us by REXX.  */     
     823    DosFreeMem(rexxretval.strptr);          /* Release storage given to us by REXX.  */
    825824  if(!rc)
    826825    return TRUE;
     
    845844            '\0',
    846845            sizeof(MMFORMATINFO) );
    847    
     846
    848847    mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE;
    849     mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/   
     848    mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/
    850849    ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo,
    851850                                          &lNumIOProcs,
    852851                                          0,
    853852                                          0 );
    854    
     853
    855854    if( ulReturnCode != MMIO_SUCCESS )
    856855      {
     
    873872        return FALSE;
    874873      }
    875    
     874
    876875    /*
    877876     * call mmioGetFormats to get info on the formats supported.
     
    891890        return FALSE;
    892891      }
    893    
     892
    894893    if( lFormatsRead != lNumIOProcs )
    895894      {
     
    919918            }
    920919          }
    921         } 
     920        }
    922921        /*
    923922         *  advance to next entry in mmFormatInfo array
    924          */       
     923         */
    925924        pmmFormatInfoArray++;
    926925      }
     
    952951  if(hab) {
    953952    hmq=WinCreateMsgQueue(hab,0);
    954     if(hmq) { 
    955       /* Check if user started prog by hand */   
     953    if(hmq) {
     954      /* Check if user started prog by hand */
    956955      if(argc!=NUMPARAMS) {/* Not the right num of params */
    957956        pmUsage();
    958957      }
    959958      else {
    960         HWND hwndDlg;       
    961 
    962         /* Get our ressource dll */ 
     959        HWND hwndDlg;
     960
     961        /* Get our ressource dll */
    963962        RESSOURCEHANDLE=queryResModuleHandle(argv[0]);
    964963        /* Load NLV strings */
     
    10311030          {
    10321031            if(hBitmap)
    1033               GpiDeleteBitmap(hBitmap); 
     1032              GpiDeleteBitmap(hBitmap);
    10341033            if( fd.lReturn == DID_OK )
    10351034              {
     
    10561055                    {
    10571056                      HOBJECT hObject;
    1058                       char *chr;
    10591057                      if((hObject=WinQueryObject(fd.szFullFile))!=NULLHANDLE)
    10601058                        WinOpenObject(hObject, ID_MENU_PLAYER /* OPEN_DEFAULT */, TRUE);
    10611059#if 0
    10621060                      /* Open folder */
    1063                       if((chr=strrchr(fd.szFullFile, '\\'))!=NULLHANDLE) {
    1064                         *chr=0;
     1061                      if(strrchr(fd.szFullFile, '\\')!=NULLHANDLE) {
    10651062                        if((hObject=WinQueryObject(fd.szFullFile))!=NULLHANDLE)
    10661063                          WinOpenObject(hObject, OPEN_CONTENTS, TRUE);
Note: See TracChangeset for help on using the changeset viewer.