Changeset 121


Ignore:
Timestamp:
Oct 8, 2023, 7:02:23 PM (22 months ago)
Author:
erdmann
Message:

now using already existing routine "somhlpGetSomClass" to find (and potentially load) any class object we need to refer to and handle drag over at the top level "CWMediaFolder" media class instead of "CWM3UFolder" class, as "CWMediaFolder" includes CWCDFolder and CWM3UFolder classes: we now only accept drops of "MMAudio" and derived with the exception of "MMCDTrack" because the latter is not suitable to being played as an audio file

Location:
branches/v2.9_Lars/mediafolder
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/v2.9_Lars/mediafolder/c/helper/launchpad.cpp

    r119 r121  
    3131
    3232#include "sys_funcs.h"
     33SOMClass* somhlpGetSomClass(char* chrClassName);
    3334
    3435extern HWND hwndShadow;// The handle of the help window
     
    269270  if (DrgAccessDraginfo(pDragInfo)) {
    270271      PDRAGITEM pDragItem = NULL;
    271       M_CWMediaFolder *mediaFolderClass = NULL;
     272      SOMClass *cdTrackClass = NULL;
    272273
    273274        /* Get number of items */
     
    293294      */
    294295      wpObject = (WPObject *)OBJECT_FROM_PREC(pDragItem->ulItemID);
    295       mediaFolderClass = (M_CWMediaFolder *)CWMediaFolder::__ClassObject;
    296       if (!somIsObj(wpObject) || wpObject->somIsA(mediaFolderClass->MMCDTrackClass)) {
     296      cdTrackClass = somhlpGetSomClass("MMCDTrack");
     297      if (!somIsObj(wpObject) || wpObject->somIsA(cdTrackClass)) {
    297298         usIndicator = DOR_NEVERDROP;
    298299         usOp = 0;
  • branches/v2.9_Lars/mediafolder/c/m3ufolder/m3ufolderoverriddenwpmethods.cpp

    r120 r121  
    815815}
    816816
    817 MRESULT CWM3UFolder::wpDragOver(HWND hwndCnr,PDRAGINFO pDragInfo)
    818 {
    819   ULONG ulNumberOfObjects;
    820   WPObject *wpObject = NULL; 
    821   USHORT usIndicator=DOR_NEVERDROP,usOp=0;
    822 
    823   /* Get access to the dragInfo */
    824   if (DrgAccessDraginfo(pDragInfo)) {
    825       PDRAGITEM pDragItem = NULL;
    826       M_CWMediaFolder *mediaFolderClass = NULL;
    827 
    828         /* Get number of items */
    829         ulNumberOfObjects = DrgQueryDragitemCount( pDragInfo);
    830 
    831         if(ulNumberOfObjects>1) {
    832          usIndicator = DOR_NODROP;
    833          usOp = 0;
    834          goto quit;
    835         }
    836 
    837       /* check if a WPS object was dropped, we do not accept anything else */
    838       pDragItem = DrgQueryDragitemPtr(pDragInfo,0);
    839       if (!DrgVerifyRMF(pDragItem,"DRM_OBJECT","DRF_OBJECT")) {
    840          usIndicator = DOR_NEVERDROP;
    841          usOp = 0;
    842          goto quit;
    843       } /* endif */
    844 
    845       /*
    846          refuse drop if WPS object pointer is not valid or if the object is
    847          a descendant of MMCDTrack class (see Netlabs ticket #19)
    848       */
    849       wpObject = (WPObject *)OBJECT_FROM_PREC(pDragItem->ulItemID);
    850       mediaFolderClass = (M_CWMediaFolder *)CWMediaFolder::__ClassObject;
    851       if (!somIsObj(wpObject) || wpObject->somIsA(mediaFolderClass->MMCDTrackClass)) {
    852          usIndicator = DOR_NEVERDROP;
    853          usOp = 0;
    854          goto quit;
    855       } /* endif */
    856 
    857         switch(pDragInfo->usOperation)
    858        {
    859        case DO_DEFAULT:
    860        case DO_LINK:
    861          usIndicator = DOR_DROP;
    862          usOp = DO_LINK;
    863          break;
    864       default:
    865          usIndicator = DOR_NODROPOP;
    866          usOp = DO_LINK;
    867          break;
    868        }
    869 quit:
    870      /* Free the draginfo */
    871      DrgFreeDraginfo(pDragInfo);
    872   }
    873   return MRFROM2SHORT(usIndicator,usOp);
    874 }
    875 
    876817void _Optlink saveThreadFunc (void *arg)
    877818{
  • branches/v2.9_Lars/mediafolder/c/mediafldr/mediafolderoverridenwpclsmethods.cpp

    r119 r121  
    530530void M_CWMediaFolder::wpclsInitData()
    531531{
    532   static char *cls = "MMCDTrack";
    533   static somId classId = &cls;
    534 
    535532  COUNTRYCODE country= {0};
    536533  COUNTRYINFO countryInfo= {0};
     
    546543  /* Call parent */
    547544  M_CWProgFolder::wpclsInitData();
    548 
    549   /* find out what module contains the MMCDTrackClass */
    550   /* and load MMCDTrackClass dynamically */
    551   /* need to do it this way because MMCDTrack class is */
    552   /* contained in CWMM.DLL which is not on LIBPATH */
    553   MMCDTrackClass = SOMClassMgrObject->somFindClass(classId,0,0);
    554545
    555546  /* Get slider cursor */
  • branches/v2.9_Lars/mediafolder/c/mediafldr/mediafolderoverridenwpmethods.cpp

    r4 r121  
    11/*
    22 * This file is (C) Chris Wohlgemuth 2002
    3  * 
     3 *
    44 * It's part of the Media-Folder distribution
    55 */
     
    3636/* For calling the method in the CWAudio class. Linking to the DLL would require the
    3737   new audio classes. By dynamically querying the method the media folder works without
    38    installing the audio classes. */ 
     38   installing the audio classes. */
    3939#include "cwmmquerytrackinfo.h"
    4040
     
    144144        while(!(thisPtr->wpQueryFldrFlags() & FOI_POPULATEDWITHALL))
    145145          DosSleep(300);
    146        
     146
    147147        hwndContainer=WinWindowFromID(tPt->hwndFrame, FID_CLIENT);
    148148        WinSendMsg(hwndContainer,CM_QUERYCNRINFO, MPFROMP(&cnrInfo),
    149149                   MPFROMLONG(sizeof(cnrInfo)));
    150        
     150
    151151        /* Get class object of MMAudio. We need it so we can check if a file is an audio file. */
    152152        if(somIsObj(cwAudioClass)) {
     
    234234  char time[200];
    235235  ULONG ulSecs;
    236  
     236
    237237  if(!methodPtr)
    238238    somhlpQueryCWAudioMethodPtr(this);
    239  
     239
    240240  if(methodPtr){
    241241    if((fsObject=(WPFileSystem*)cwGetFileSystemObject(Object))!=NULLHANDLE){/* Filesystem object or NULL */
     
    248248      }
    249249    }
    250   } 
     250  }
    251251  return CWProgFolder::wpDeleteFromContent(Object);
    252252}
     
    265265
    266266  /* Reregister wpFolder window class on first opening */
    267   /* We need this private code to have some private 
     267  /* We need this private code to have some private
    268268     window words */
    269269  if(!g_fRegisteredWindowClass)
    270270    {
    271271      CLASSINFO ci;
    272      
     272
    273273      if(WinQueryClassInfo(WinQueryAnchorBlock(HWND_DESKTOP),
    274274                           (PSZ)"wpFolder window",
     
    299299    return NULLHANDLE;
    300300
    301 #if 0   
     301#if 0
    302302  for(pViewItem=wpFindViewItem(VIEW_ANY, NULLHANDLE); pViewItem; pViewItem=wpFindViewItem(VIEW_ANY, pViewItem))
    303303    iItemCount+=1;
     
    318318    }
    319319
    320     /* Save this ptr */ 
     320    /* Save this ptr */
    321321    WinSetWindowULong( hwnd, ulQWP_THISPTR, (ULONG)this); /* Moved from outside the if clause */
    322322
     
    338338        ulFlags|=FLAG_ALREADYSIZED;
    339339      }
    340      
     340
    341341      /* Build new menu entries. */
    342342      myFrameCtrlHWND=WinWindowFromID(hwnd,FID_MENU);//Get menu hwnd
     
    388388            iItemCount=(int)WinSendMsg(myFrameCtrlHWND,MM_QUERYITEMCOUNT,(MPARAM)0,
    389389                                       (MPARAM)0);
    390            
     390
    391391            /* Fill the MENUITEM structure */
    392392            mi.iPosition=iItemCount-1;
    393393            mi.afStyle=MIS_TEXT|MIS_SUBMENU;
    394394            mi.id=ID_MBMENUSKRIPTS;
    395             mi.afAttribute=NULL;               
     395            mi.afAttribute=NULL;
    396396            mi.hwndSubMenu=hwndMenu;
    397397            mi.hItem=NULL;
     
    400400            getMessage(text, IDSTR_MENUSKRIPTS,sizeof(text), hResource, hwnd);
    401401            WinSendMsg(myFrameCtrlHWND,MM_INSERTITEM,MPFROMP(&mi),
    402                        (MPARAM)text); 
     402                       (MPARAM)text);
    403403          }/* end of if(hwndMenu) */
    404404        }
     
    422422         the procedure saves this pointer for later use. */
    423423      myFrameCtrlHWND=WinLoadDlg(hwnd,hwnd,topCtrlDialogProc,hResource,IDDLG_TOPFRAME ,this);
    424       /* Save the HWND in the Window words */   
     424      /* Save the HWND in the Window words */
    425425      WinSetWindowULong( hwnd, ulQWL_TOPCTRLHWND, myFrameCtrlHWND);
    426426
     
    431431           is always the width of the folder. */
    432432        sizel.cy=allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cy;
    433         /* Call a method of CWProgFolder to add the dialog as a framecontrol. 
     433        /* Call a method of CWProgFolder to add the dialog as a framecontrol.
    434434           FCTL_TOP means put it at the top of the folder.
    435435           After calling cwUpdateFrame(hwnd) it will be visible */
     
    442442         the procedure saves this pointer for later use. */
    443443      myFrameCtrlHWND=WinLoadDlg(hwnd,hwnd,leftCtrlDialogProc,hResource,IDDLG_LEFTFRAME ,this);
    444       /* Save the HWND in the Window words */   
     444      /* Save the HWND in the Window words */
    445445      WinSetWindowULong( hwnd, ulQWL_LEFTCTRLHWND, myFrameCtrlHWND);
    446            
     446
    447447      if(myFrameCtrlHWND){
    448448        /* Query the size of the dialog */
     
    450450        /* It's the right dialog so we need the width but not the height. */
    451451        sizel.cx=allBMPs[CTRLIDX_TOPRIGHT].bmpInfoHdr.cx-1-7-2;//rectl.xRight-rectl.xLeft;
    452         /* Call a method of CWProgFolder to add the dialog as a framecontrol. 
     452        /* Call a method of CWProgFolder to add the dialog as a framecontrol.
    453453           FCTL_RIGHT means put it at the RIGHT of the folder.
    454454           After calling cwUpdateFrame(hwnd) it will be visible */
     
    460460         the procedure saves this pointer for later use. */
    461461      myFrameCtrlHWND=WinLoadDlg(hwnd,hwnd,rightCtrlDialogProc,hResource,IDDLG_FRAMERIGHT ,this);
    462       /* Save the HWND in the Window words */   
     462      /* Save the HWND in the Window words */
    463463      WinSetWindowULong( hwnd, ulQWL_RIGHTCTRLHWND, myFrameCtrlHWND);
    464464
    465465      if(myFrameCtrlHWND){
    466466        CNRINFO cnrInfo;
    467         HWND hwndContainer; 
     467        HWND hwndContainer;
    468468        PVIEWITEM pView;
    469469
     
    472472        /* It's the right dialog so we need the width but not the height. */
    473473        sizel.cx=allBMPs[CTRLIDX_TOPRIGHT].bmpInfoHdr.cx-1-7-2;// rectl.xRight-rectl.xLeft;
    474         /* Call a method of CWProgFolder to add the dialog as a framecontrol. 
     474        /* Call a method of CWProgFolder to add the dialog as a framecontrol.
    475475           FCTL_RIGHT means put it at the RIGHT of the folder.
    476476           After calling cwUpdateFrame(hwnd) it will be visible */
    477477        cwAddFrameCtl(hwnd, myFrameCtrlHWND, sizel, FCTL_RIGHT, FCTL_POSABOVE|FCTL_POSBELOW);
    478        
     478
    479479        hwndContainer=WinWindowFromID(myFrameCtrlHWND, IDCNR_PLAYLIST);
    480480        WinSendMsg(hwndContainer,CM_QUERYCNRINFO, MPFROMP(&cnrInfo),
     
    489489      /* Save the HWND in the instance data */
    490490      hwndBottom=myFrameCtrlHWND;
    491       /* Save the HWND in the Window words */   
     491      /* Save the HWND in the Window words */
    492492      WinSetWindowULong( hwnd, ulQWL_BOTTOMCTRLHWND, myFrameCtrlHWND);
    493    
     493
    494494      if(hwndBottom){
    495495        /* Query the size of the dialog */
     
    498498        sizel.cy=rectl.yTop-rectl.yBottom-2;
    499499        //    sizel.cy=allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cy;
    500         /* Call a method of CWProgFolder to add the dialog as a framecontrol. 
     500        /* Call a method of CWProgFolder to add the dialog as a framecontrol.
    501501           FCTL_TOP means put it at the top of the folder.
    502502           After calling cwUpdateFrame(hwnd) it will be visible */
     
    526526        SysWriteToTrapLog("\nTrap occured in %s, file: %s above line %d.\n",
    527527                          __FUNCTION__, __FILE__, __LINE__);
    528        
     528
    529529      } END_CATCH;
    530530  }
     
    543543  QMSG qmsg;
    544544  CWMediaFolder *thisPtr;
    545  
     545
    546546  thisPtr=(CWMediaFolder*)arg;    //Pointer auf CWMediaFolder-Object
    547547  hab=WinInitialize(0);
     
    575575  bufferSize=sizeof(buffer);
    576576  if(!wpScanSetupString(pSetupString, MEDIAFLDR_VOLUME, buffer,&bufferSize))
    577     { 
     577    {
    578578      ulVolume=70;
    579579      /* Set position of slider bar */
     
    593593  if(!wpScanSetupString(pSetupString,"ICONVIEWPOS",buffer,&bufferSize))
    594594    wpSetup( "ICONVIEWPOS=20,10,60,75");/* Fill in defaults */
    595  
     595
    596596  /* Set folder details- and sortclass to CWAudioShadow so track infos are shown */
    597597  bufferSize=sizeof(buffer);
    598598  if(!wpScanSetupString(pSetupString,"DETAILSCLASS",buffer,&bufferSize))
    599599    wpSetup("DETAILSCLASS=CWAudioShadow");/* Fill in defaults */
    600  
     600
    601601  bufferSize=sizeof(buffer);
    602602  if(!wpScanSetupString(pSetupString,"SORTCLASS",buffer,&bufferSize))
    603603    wpSetup("SORTCLASS=CWAudioShadow");/* Fill in defaults */
    604  
     604
    605605  /* This works only on Warp 4 and above */
    606606  bufferSize=sizeof(buffer);
     
    608608    /* This works only on Warp 4 and above */
    609609    wpSetup("DETAILSTODISPLAY=0,1,4,12,13,14,15,16,17,18,19,20,21");/* Fill in defaults */
    610  
     610
    611611  /* This works only on Warp 4 and above */
    612612  bufferSize=sizeof(buffer);
     
    614614    /* This works only on Warp 4 and above */
    615615    wpSetup("SORTBYATTR=6,24,25,26,27,28,29,30,31,32,33");/* Fill in defaults */
    616  
     616
    617617  return rcParent;
    618618}
     
    621621{
    622622  PVIEWITEM pViewItem;
    623  
     623
    624624  /* Check if we close a settings view or a folder view. */
    625625  pViewItem=thisPtr->wpFindViewItem(VIEW_DETAILS|VIEW_CONTENTS, NULLHANDLE);
     
    664664  bufferSize=sizeof(buffer);
    665665  if(wpScanSetupString(pSetupString, MEDIAFLDR_STOP, buffer,&bufferSize))
    666     { 
     666    {
    667667      HWND hwndFrame=_findOpenMediaFldrViewHWND(this);
    668668      if(WinIsWindow(WinQueryAnchorBlock(HWND_DESKTOP), hwndFrame))
     
    671671  bufferSize=sizeof(buffer);
    672672  if(wpScanSetupString(pSetupString, MEDIAFLDR_NEXT, buffer,&bufferSize))
    673     { 
     673    {
    674674      HWND hwndFrame=_findOpenMediaFldrViewHWND(this);
    675675      if(WinIsWindow(WinQueryAnchorBlock(HWND_DESKTOP), hwndFrame))
     
    678678  bufferSize=sizeof(buffer);
    679679  if(wpScanSetupString(pSetupString, MEDIAFLDR_PREV, buffer,&bufferSize))
    680     { 
     680    {
    681681      HWND hwndFrame=_findOpenMediaFldrViewHWND(this);
    682682      if(WinIsWindow(WinQueryAnchorBlock(HWND_DESKTOP), hwndFrame))
     
    687687  bufferSize=sizeof(buffer);
    688688  if(wpScanSetupString(pSetupString, MEDIAFLDR_VOLUME, buffer,&bufferSize))
    689     { 
     689    {
    690690      ulVolume=atol(buffer);
    691691      if(ulVolume<0)
     
    699699  bufferSize=sizeof(buffer);
    700700  if(wpScanSetupString(pSetupString, MEDIAFLDR_REPEAT, buffer,&bufferSize))
    701     { 
     701    {
    702702      switch(atol(buffer))
    703703        {
     
    779779ULONG CWMediaFolder::wpAddFolderView1Page(HWND hwndNotebook)
    780780{
    781   /* 
     781  /*
    782782     Removing this page also means removing the XWorkplace
    783783     view page. It would be possible to call the XWP method
     
    836836    }
    837837  /*
    838    
     838
    839839    Climb up the list of parents to make sure we call the right
    840840    method if the parent was replaced. Otherwise we may skip a replacement class
     
    848848                            1,
    849849                            __ClassObject->
    850                             somGetMethodToken(mySomId))                   
    851         )(this, hwndNotebook, ppageinfo); 
     850                            somGetMethodToken(mySomId))
     851        )(this, hwndNotebook, ppageinfo);
    852852    SOMFree(mySomId);
    853853    return rc;
    854854  }
    855   else 
     855  else
    856856    return CWProgFolder::wpInsertSettingsPage(hwndNotebook, ppageinfo);
    857857}
     
    886886      ulPrivFlags&= ~MFLDR_VIEW_COMPACT;
    887887      return rcParent;
    888     case ID_MENUVIEWCOMPACT: /* Compact view */ 
     888    case ID_MENUVIEWCOMPACT: /* Compact view */
    889889      if(cwShrinkFolderToCompact(hwndFrame)) {
    890890        /* Mark that we are in compact view. May be removed later when 'Compact'
     
    950950                            1,
    951951                            __ClassObject->
    952                             somGetMethodToken(mySomId))                   
    953         )(this, ulFlags, hwndCnr, fMultiSelect); 
     952                            somGetMethodToken(mySomId))
     953        )(this, ulFlags, hwndCnr, fMultiSelect);
    954954    SOMFree(mySomId);
    955955    return rc & ~( CTXT_TREE | CTXT_ICON);
    956956  }
    957   else 
     957  else
    958958    return CWProgFolder::wpFilterPopupMenu( ulFlags, hwndCnr, fMultiSelect) & ~( CTXT_TREE | CTXT_ICON);
    959959}
     
    970970                              1,
    971971                              __ClassObject->
    972                               somGetMethodToken(mySomId))                 
    973           )(this, ulView,pReserved); 
     972                              somGetMethodToken(mySomId))
     973          )(this, ulView,pReserved);
    974974      SOMFree(mySomId);
    975975    }
    976     else 
     976    else
    977977      rc=CWProgFolder::wpRefresh(ulView, pReserved);
    978978
     
    993993                              1,
    994994                              __ClassObject->
    995                               somGetMethodToken(mySomId))                   
    996           )(this,hwndNotebook); 
     995                              somGetMethodToken(mySomId))
     996          )(this,hwndNotebook);
    997997      SOMFree(mySomId);
    998998    }
    999     else 
     999    else
    10001000      rc=CWProgFolder::wpAddSettingsPages(hwndNotebook);
    1001    
     1001
    10021002    if(!queryResModuleHandle()) {
    10031003      errorResource();
     
    10111011{
    10121012  WPObject *wpObject;
    1013   WPFileSystem *wpFSObject;
    1014   ULONG ulNum;
    1015   ULONG a;
    1016   MRESULT mr;
    1017   SOMClass *mmAudioClass=somhlpQueryMMAudioClass();
    1018   SOMClass *mmMIDIClass=somhlpGetSomClass("MMMIDI");
    1019   SOMClass *cwAudioClass=somhlpGetSomClass("CWAudioShadow");
    1020 
    1021 
    1022   mr=MRFROM2SHORT( DOR_DROP, DO_LINK);
    1023   ulNum=DrgQueryDragitemCount(pDragInfo);/* Num items */
    1024 
    1025   if(pDragInfo->usOperation!=DO_DEFAULT && pDragInfo->usOperation!=DO_LINK)
    1026     //    return MRFROM2SHORT( DOR_NEVERDROP, DO_MOVE);/* It's not an audio object */
    1027     {
    1028       /* Only CWAudioShadows may be copied or moved */
    1029       for(a=0;a<ulNum && SHORT1FROMMR(mr)!=DOR_NEVERDROP; a++)
    1030         {
    1031           /* Check every object dragged */
    1032           wpObject=(WPObject*)OBJECT_FROM_PREC(DrgQueryDragitemPtr( pDragInfo, a)->ulItemID);
    1033           if(!wpObject->somIsA(cwAudioClass))
    1034             {
    1035               return MRFROM2SHORT( DOR_NEVERDROP, DO_MOVE);/* It's not an audio object */
    1036             }
    1037         }
    1038       return MRFROM2SHORT( DOR_DROP, DO_MOVE);/*  */
    1039       return MRFROM2SHORT( DOR_DROP, pDragInfo->usOperation);/*  */
    1040     }
    1041 
    1042 
    1043   for(a=0;a<ulNum && SHORT1FROMMR(mr)!=DOR_NEVERDROP; a++)
    1044     {
    1045       /* Check every object dragged */
    1046       wpObject=(WPObject*)OBJECT_FROM_PREC(DrgQueryDragitemPtr( pDragInfo, a)->ulItemID);
    1047       /* Get the filesystem object in case it's a shadow */
    1048       wpFSObject=(WPFileSystem*)cwGetFileSystemObject(wpObject);
    1049       if(!somIsObj(wpFSObject))
    1050         return MRFROM2SHORT( DOR_NEVERDROP, DO_MOVE);/* It's not an object */
    1051       if(!wpFSObject->somIsA(cwAudioClass) && !wpFSObject->somIsA(mmAudioClass) && !wpFSObject->somIsA(mmMIDIClass))
    1052         return MRFROM2SHORT( DOR_NEVERDROP, DO_MOVE);/* It's not an audio object */
    1053     }
    1054   /* The following is necessary because for some reason hwndCnr and pDragInfo->hwndSource
    1055      are equal when the dragged object resides in the same folder as the target and the target
    1056      isn't opened yet. Without this check the dragged object would be moved not linked. */
    1057   if(this->wpQueryFolder()==wpObject->wpQueryFolder())
    1058       return MRFROM2SHORT(DOR_DROP,DO_LINK);
    1059   /* Do not create shadows if the source is the current container */
    1060   if(hwndCnr==pDragInfo->hwndSource)
    1061     return MRFROM2SHORT( DOR_DROP, DO_MOVE);
    1062 
    1063   return mr;
     1013  USHORT usIndicator=DOR_DROP,usOp=DO_LINK;
     1014  SOMClass *mmAudioClass = somhlpGetSomClass("MMAudio");
     1015  SOMClass *cdTrackClass = somhlpGetSomClass("MMCDTrack");
     1016
     1017  if (DrgAccessDraginfo(pDragInfo)) {
     1018     ULONG ulNum=DrgQueryDragitemCount(pDragInfo);/* Num items */
     1019     ULONG a=0;
     1020
     1021     for(a=0;a<ulNum; a++)
     1022       {
     1023         PDRAGITEM pDragItem = DrgQueryDragitemPtr(pDragInfo,a);
     1024         if (!DrgVerifyRMF(pDragItem,"DRM_OBJECT","DRF_OBJECT")) {
     1025            usIndicator = DOR_NEVERDROP;
     1026            usOp = 0;
     1027            goto quit;
     1028         } /* endif */
     1029         /* Check every object dragged */
     1030         wpObject=(WPObject*)OBJECT_FROM_PREC(pDragItem->ulItemID);
     1031         if (!somIsObj(wpObject) || !wpObject->somIsA(mmAudioClass) || wpObject->somIsA(cdTrackClass)) {
     1032            usIndicator = DOR_NEVERDROP;
     1033            usOp = 0;
     1034            goto quit;
     1035         } /* endif */
     1036#if 0
     1037         if (somIsObj(wpObject) && this->wpQueryFolder() == wpObject->wpQueryFolder()) {
     1038            usIndicator = DOR_DROP;
     1039            usOp = DO_LINK;
     1040         } /* endif */
     1041#endif
     1042       }
     1043     /* Do not create shadows if the source is the current container */
     1044     if(hwndCnr==pDragInfo->hwndSource) {
     1045        usIndicator = DOR_DROP;
     1046        usOp = DO_MOVE;
     1047     }
     1048
     1049quit:
     1050     DrgFreeDraginfo(pDragInfo);
     1051  } /* endif */
     1052
     1053  return MRFROM2SHORT(usIndicator,usOp);
    10641054}
    10651055
     
    10781068    return;
    10791069  thisPtr=(CWMediaFolder*)threadParams->thisPtr;    //Pointer auf CWMediaFolder-Object
    1080  
     1070
    10811071  if(!somIsObj(thisPtr))
    10821072    return;
    1083  
     1073
    10841074  if(thisPtr->mfData)
    10851075    thisPtr->mfData->bProcessing=TRUE;
    1086  
     1076
    10871077  hab=WinInitialize(0);
    10881078  if(hab) {
     
    10971087      /* Needed for specifying the drop point */
    10981088      POINTL ptl;
    1099       PMINIRECORDCORE pmrc; 
     1089      PMINIRECORDCORE pmrc;
    11001090      CNRINFO cnrInfo;
    11011091      int ID;
     
    11091099        hwndSource=threadParams->hwndSource;
    11101100        ulNumObjects=threadParams->ulNumObjects;
    1111        
     1101
    11121102        if((mySomId=somIdFromString(SHADOW_CLASS_NAME))!=NULLHANDLE) {
    11131103          WPFileSystem *wpFSObject;
     
    11211111              ptl.x=threadParams->ptl.x;
    11221112              ptl.y=threadParams->ptl.y;
    1123              
     1113
    11241114              /* Map to CNR */
    11251115              WinMapWindowPoints(HWND_DESKTOP, hwndCnr,&ptl, 1);
    1126               ptl.y+=10;         
     1116              ptl.y+=10;
    11271117              /* Window below the mouse ptr. We need it to check if we are over the column title area. */
    11281118              ID=WinQueryWindowUShort(WinWindowFromPoint(hwndCnr,&ptl, TRUE),QWS_ID);
    11291119              ptl.y-=10;
    1130              
     1120
    11311121              /* Find the record near the drop point */
    11321122              qRecRcl.cb=sizeof(qRecRcl);
     
    11381128              pmrc=(PMINIRECORDCORE)WinSendMsg(hwndCnr, CM_QUERYRECORDFROMRECT,MPFROMLONG(CMA_FIRST),
    11391129                                               MPFROMP(&qRecRcl));
    1140               WinSendMsg(hwndCnr, CM_QUERYCNRINFO, MPFROMP(&cnrInfo), MPFROMSHORT(sizeof(cnrInfo)));       
     1130              WinSendMsg(hwndCnr, CM_QUERYCNRINFO, MPFROMP(&cnrInfo), MPFROMSHORT(sizeof(cnrInfo)));
    11411131            }/*if(hwndSource!=hwndCnr)*/
    1142            
    1143             /* For all dropped objects */ 
     1132
     1133            /* For all dropped objects */
    11441134            for(ulCount=0; ulCount<ulNumObjects; ulCount++) {
    11451135              if(ulCount%10)/* Redraw window every 10 objects */
     
    11471137              else
    11481138                WinEnableWindowUpdate(hwndCnr, TRUE);
    1149              
     1139
    11501140              wpObject=(WPObject*) threadParams->wpObject[ulCount];
    11511141              /* Get the filesystem object in case it's a shadow */
     
    11611151                      /* Detailsview */
    11621152                      RECORDINSERT recInsert;
    1163                      
     1153
    11641154                      recInsert.cb=sizeof(recInsert);
    11651155                      recInsert.pRecordParent=NULL;
     
    11671157                      recInsert.zOrder=CMA_TOP;
    11681158                      recInsert.cRecordsInsert=1;
    1169                      
     1159
    11701160                      //     WinEnableWindowUpdate(hwndCnr, FALSE);
    11711161                      /* Create the shadow */
     
    12121202                            __FUNCTION__, __FILE__, __LINE__);
    12131203        } END_CATCH;
    1214        
     1204
    12151205        WinDestroyMsgQueue(hmq);
    12161206    }
     
    12191209  if(thisPtr->mfData)
    12201210    thisPtr->mfData->bProcessing=FALSE;
    1221  
     1211
    12221212  thisPtr->wpFreeMem((PBYTE)threadParams);
    12231213}
     
    12271217MRESULT CWMediaFolder::wpDrop(HWND hwndCnr,PDRAGINFO pDragInfo,PDRAGITEM pDragItem)
    12281218{
    1229   WPObject *wpObject;
    1230   somId mySomId;
    1231   M_WPObject *mAudioObject;
    1232   SOMClass*  scCWShadowClass;
    1233   ULONG ulCount;
    1234   ULONG ulNumObjects=DrgQueryDragitemCount(pDragInfo);
    1235 
    1236   /* Needed for specifying the drop point */
    1237   POINTL ptl;
    1238   PMINIRECORDCORE pmrc;
    1239   CNRINFO cnrInfo;
    1240   int ID;
    1241  
    1242   /* The objects are already checked by the wpDragOver() method. */
    1243   TRY_LOUD(MEDIAFLDR_DROP) {
    1244     PDROPTHREADPARAMS pThreadParams;
    1245     ULONG ulErr;
    1246     WPObject* wpObj;
    1247    
    1248     /* DROPTHREADPARAMS already contains one WPObject var so only memory for ulNumObjects-1 must be added to the end */
    1249     pThreadParams=(PDROPTHREADPARAMS)wpAllocMem(sizeof(DROPTHREADPARAMS)+(ulNumObjects-1)*sizeof(WPObject*), &ulErr);
    1250     pThreadParams->hwndCnr=hwndCnr;
    1251     pThreadParams->hwndSource=pDragInfo->hwndSource;
    1252     pThreadParams->ulNumObjects=DrgQueryDragitemCount(pDragInfo);
    1253     pThreadParams->thisPtr=this;
    1254     pThreadParams->ptl.x=pDragInfo->xDrop;
    1255     pThreadParams->ptl.y=pDragInfo->yDrop;
    1256              
    1257     /* For all dropped objects */
    1258     for(ulCount=0;ulCount<ulNumObjects ; ulCount++) {
    1259       pThreadParams->wpObject[ulCount]=(WPObject*)OBJECT_FROM_PREC(DrgQueryDragitemPtr( pDragInfo, ulCount)->ulItemID);
    1260     }
    1261     _beginthread(dropThreadFunc,NULL,8192*16,(void*)pThreadParams); //Fehlerbehandlung fehlt
     1219  if (DrgAccessDraginfo(pDragInfo)) {
     1220    /* The objects are already checked by the wpDragOver() method. */
     1221    TRY_LOUD(MEDIAFLDR_DROP) {
     1222       PDROPTHREADPARAMS pThreadParams;
     1223       ULONG ulErr;
     1224       ULONG ulCount;
     1225       ULONG ulNumObjects=DrgQueryDragitemCount(pDragInfo);
     1226
     1227       /* DROPTHREADPARAMS already contains one WPObject var so only memory for ulNumObjects-1 must be added to the end */
     1228       pThreadParams=(PDROPTHREADPARAMS)wpAllocMem(sizeof(DROPTHREADPARAMS)+(ulNumObjects-1)*sizeof(WPObject*), &ulErr);
     1229       pThreadParams->hwndCnr=hwndCnr;
     1230       pThreadParams->hwndSource=pDragInfo->hwndSource;
     1231       pThreadParams->ulNumObjects=ulNumObjects;
     1232       pThreadParams->thisPtr=this;
     1233       pThreadParams->ptl.x=pDragInfo->xDrop;
     1234       pThreadParams->ptl.y=pDragInfo->yDrop;
     1235
     1236       /* For all dropped objects */
     1237       for(ulCount=0;ulCount<ulNumObjects ; ulCount++) {
     1238         pThreadParams->wpObject[ulCount]=(WPObject*)OBJECT_FROM_PREC(DrgQueryDragitemPtr( pDragInfo, ulCount)->ulItemID);
     1239       }
     1240       _beginthread(dropThreadFunc,NULL,8192*16,(void*)pThreadParams); //Fehlerbehandlung fehlt
     1241    }
     1242    CATCH(MEDIAFLDR_DROP)
     1243    {
     1244       SysWriteToTrapLog("\nTrap occured in %s, file: %s, around line %d.\n",
     1245                         __FUNCTION__, __FILE__, __LINE__);
     1246    } END_CATCH;
     1247    DrgFreeDraginfo(pDragInfo);
    12621248  }
    1263   CATCH(MEDIAFLDR_DROP)
    1264     {
    1265       SysWriteToTrapLog("\nTrap occured in %s, file: %s, around line %d.\n",
    1266                         __FUNCTION__, __FILE__, __LINE__);
    1267     } END_CATCH;
    1268    
    1269   DrgFreeDraginfo(pDragInfo);
    1270   return (MRESULT)RC_DROP_DROPCOMPLETE;
     1249  return MRFROMLONG(RC_DROP_DROPCOMPLETE);
    12711250}
    12721251
     
    13681347    /* Start a timer which will cause the folder to close automatically after some time even
    13691348       if the user doesn't click any button. Get the timeout from the INI file if available. */
    1370     if((lDelay=PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", MFLDR_TIMER_DELAY_KEY, MFLDR_MBOX_TIMER_DELAY)) 
     1349    if((lDelay=PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", MFLDR_TIMER_DELAY_KEY, MFLDR_MBOX_TIMER_DELAY))
    13711350       < MFLDR_MBOX_MIN_TIMER_DELAY)
    13721351      lDelay=MFLDR_MBOX_MIN_TIMER_DELAY;
     
    13831362    }
    13841363  }
    1385   cwStopAudioFile(hwndFrame); 
     1364  cwStopAudioFile(hwndFrame);
    13861365  /* Stop the playing thread */
    13871366  WinPostMsg(mfData->hwndPlayObject, WM_QUIT, 0, 0);
  • branches/v2.9_Lars/mediafolder/include/m3ufolder.hh

    r120 r121  
    7676  virtual ULONG wpFilterPopupMenu(ULONG ulFlags, HWND hwndCnr, BOOL fMultiSelect);
    7777  virtual BOOL wpModifyPopupMenu(HWND hwndMenu, HWND hwndCnr, ULONG ulPosition);
    78   virtual MRESULT wpDragOver(HWND hwndCnr,PDRAGINFO pDragInfo);
    7978#if 0
    8079  virtual BOOL wpRestoreState(ULONG ulReserved);
  • branches/v2.9_Lars/mediafolder/include/mediafolder.hh

    r119 r121  
    183183#pragma SOMCallstyle(oidl)
    184184public:
    185   SOMClass *MMCDTrackClass;
    186185  virtual PSZ  wpclsQueryTitle();
    187186  virtual void wpclsInitData();
Note: See TracChangeset for help on using the changeset viewer.