home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 November / PCONLINE_11_99.ISO / filesbbs / OS2 / ACDCR032.ZIP / source / sendconfig.cpp < prev   
Encoding:
C/C++ Source or Header  |  1999-07-06  |  2.8 KB  |  88 lines

  1. /*
  2.  * This file is (C) Chris Wohlgemuth 1999
  3.  */
  4. /*
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2, or (at your option)
  8.  * any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; see the file COPYING.  If not, write to
  17.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19. #include "audiofolder.hh"
  20. #include "stdio.h"
  21.  
  22. extern char chrCDRecord[CCHMAXPATH];/* Path to cdrecord */
  23. extern char chrCDROptions[CCHMAXPATH];
  24. extern LONG lCDROptions;
  25. extern char chrInstallDir[CCHMAXPATH];/* Dir with all the helpers */
  26.  
  27. extern int iNumCD;
  28. extern char cFirstCD;
  29. extern char chosenWriter[3];
  30.  
  31. /*
  32.  * This function sends the cdrecord config info
  33.  * to the CWDisk class.
  34.  */
  35. void sendConfig()
  36. {
  37.   int a,b;
  38.   HOBJECT hObject;
  39.   char chrCD[4];
  40.   char driveID[40];
  41.   char chrOptions[2*CCHMAXPATH];
  42.  
  43.   b=cFirstCD-'A'+iNumCD;
  44.   /* Unset writeflag of diskobjects */
  45.   for( a=0; a<b ;a++) {
  46.     chrCD[0]=a+'A';
  47.     chrCD[1]=0;
  48.     /* Build ID of drive object */
  49.     sprintf(driveID,"<WP_DRIVE_%s>",chrCD);
  50.     /* Clear writer flag of disk objects. Clear CD-Rom flag */
  51.     if((hObject=WinQueryObject(driveID))!=NULL) {
  52.       WinSetObjectData(hObject,"ISWRITER=0;ISCDROM=0");
  53.     }
  54.   }
  55.  
  56.   for( a=0; a<iNumCD ;a++) {
  57.     chrCD[0]=cFirstCD+a;
  58.     chrCD[1]=0;
  59.     /* Build ID of CD-Drive object */
  60.     sprintf(driveID,"<WP_DRIVE_%s>",chrCD);
  61.     /* Clear writer flag of disk objects. Set CD-Rom flag */
  62.     if((hObject=WinQueryObject(driveID))!=NULL) {
  63.       WinSetObjectData(hObject,"ISCDROM=1");
  64.     }
  65.   }               
  66.   /* Query the writer-drive */
  67.   sprintf(chrCD,"%s",chosenWriter);
  68.   chrCD[1]=0;
  69.   /* Build ID of chosenCD-Drive object */
  70.   sprintf(driveID,"<WP_DRIVE_%s>",chrCD);
  71.   /* Set writer flag of this disk object */
  72.   if((hObject=WinQueryObject(driveID))!=NULL) {
  73.     WinSetObjectData(hObject,"ISWRITER=1");
  74.     sprintf(chrOptions,"CDRPATH=%s;CDROPTIONS=%s;CDREXECUTION=%d",chrCDRecord,chrCDROptions,lCDROptions);// Path and cdrecord options
  75.     WinSetObjectData(hObject,chrOptions);
  76.     
  77.     sprintf(chrOptions,"INSTALLDIR=%s",chrInstallDir);
  78.     WinSetObjectData(hObject,chrOptions);
  79.     /*    WinMessageBox(  HWND_DESKTOP,
  80.           HWND_DESKTOP,
  81.           chrInstallDir,
  82.           chrOptions,
  83.           0UL,
  84.           MB_YESNO | MB_ICONQUESTION );*/
  85.   }
  86. }
  87.  
  88.