| 1 | /*
|
|---|
| 2 | * This file is (C) Chris Wohlgemuth 2002
|
|---|
| 3 | *
|
|---|
| 4 | * It's part of the Media-Folder distribution
|
|---|
| 5 | */
|
|---|
| 6 | /*
|
|---|
| 7 | * This program is free software; you can redistribute it and/or modify
|
|---|
| 8 | * it under the terms of the GNU General Public License as published by
|
|---|
| 9 | * the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 10 | * any later version.
|
|---|
| 11 | *
|
|---|
| 12 | * This program is distributed in the hope that it will be useful,
|
|---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 15 | * GNU General Public License for more details.
|
|---|
| 16 | *
|
|---|
| 17 | * You should have received a copy of the GNU General Public License
|
|---|
| 18 | * along with this program; see the file COPYING. If not, write to
|
|---|
| 19 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|---|
| 20 | */
|
|---|
| 21 |
|
|---|
| 22 | #define INCL_DOSERRORS
|
|---|
| 23 | #define INCL_DOSERRORS
|
|---|
| 24 | #define INCL_GPIBITMAPS
|
|---|
| 25 |
|
|---|
| 26 | #include "mediafolder.hh"
|
|---|
| 27 | #include <stdio.h>
|
|---|
| 28 | #include <stdlib.h>
|
|---|
| 29 | #include <string.h>
|
|---|
| 30 | #include "mediafolderres.h"
|
|---|
| 31 | #include "menufolder.hh"
|
|---|
| 32 | #include "cwcdtrack.hh"
|
|---|
| 33 |
|
|---|
| 34 | /* typedef for somTP_MMAudio_cwmmQueryTrackInfo */
|
|---|
| 35 | /* For calling the method in the CWAudio class. Linking to the DLL would require the
|
|---|
| 36 | new audio classes. By dynamically querying the method the media folder works without
|
|---|
| 37 | installing the audio classes. */
|
|---|
| 38 | #include "cwmmquerytrackinfo.h"
|
|---|
| 39 |
|
|---|
| 40 | somTD_MMAudio_cwmmQueryTrackInfo methodPtr=NULL;
|
|---|
| 41 |
|
|---|
| 42 | /* For calling the method in the CWCDTrack class. Linking to the DLL would require the
|
|---|
| 43 | new audio classes. By dynamically querying the method the media folder works without
|
|---|
| 44 | installing the audio classes. */
|
|---|
| 45 | typedef ULONG SOMLINK somTP_MMCDTrack_cwmmQueryTrackInfo(MMCDTrack *somSelf,
|
|---|
| 46 | PSZ chrString,
|
|---|
| 47 | ULONG ulSize,
|
|---|
| 48 | int iWhich);
|
|---|
| 49 | typedef somTP_MMCDTrack_cwmmQueryTrackInfo *somTD_MMCDTrack_cwmmQueryTrackInfo;
|
|---|
| 50 |
|
|---|
| 51 | somTD_MMCDTrack_cwmmQueryTrackInfo methodPtrCDTrack=NULL;
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 | SOMClass* somhlpGetSomClass(char* chrClassName)
|
|---|
| 55 | {
|
|---|
| 56 | somId mySomId;
|
|---|
| 57 | SOMClass *somClass;
|
|---|
| 58 |
|
|---|
| 59 | if((mySomId=somIdFromString(chrClassName))==NULLHANDLE)
|
|---|
| 60 | return NULLHANDLE;
|
|---|
| 61 |
|
|---|
| 62 | // somClass=SOMClassMgrObject->somClassFromId(mySomId);
|
|---|
| 63 | somClass=SOMClassMgrObject->somFindClass(mySomId, 1, 1);
|
|---|
| 64 | SOMFree(mySomId);
|
|---|
| 65 |
|
|---|
| 66 | return somClass;
|
|---|
| 67 | }
|
|---|
| 68 |
|
|---|
| 69 | BOOL somhlpQueryCWAudioMethodPtr(CWMediaFolder *thisPtr)
|
|---|
| 70 | {
|
|---|
| 71 | somId mySomId;
|
|---|
| 72 | SOMClass *mmAudioClass;
|
|---|
| 73 |
|
|---|
| 74 | if(!methodPtr) {
|
|---|
| 75 | /* If we don't have the method pointer yet, get it. */
|
|---|
| 76 | mmAudioClass=somhlpGetSomClass("MMAudio");
|
|---|
| 77 | if(mmAudioClass) {
|
|---|
| 78 | /* We have the class object */
|
|---|
| 79 | mySomId=somIdFromString("cwmmQueryTrackInfo");/* A new method in MMAudio (replacement for MMAudio) */
|
|---|
| 80 | methodPtr=(somTD_MMAudio_cwmmQueryTrackInfo) mmAudioClass->somFindSMethod(mySomId);
|
|---|
| 81 | SOMFree(mySomId);
|
|---|
| 82 | return TRUE;
|
|---|
| 83 | }
|
|---|
| 84 | return FALSE;
|
|---|
| 85 | }
|
|---|
| 86 | else
|
|---|
| 87 | return TRUE;
|
|---|
| 88 | #if 0
|
|---|
| 89 | if(!methodPtr) {
|
|---|
| 90 | /* If we don't have the method pointer yet, get it. */
|
|---|
| 91 | /* Get class object of MMAudio. */
|
|---|
| 92 | if((mySomId=somIdFromString("MMAudio"))==NULLHANDLE)
|
|---|
| 93 | return FALSE;
|
|---|
| 94 | mmAudioClass=SOMClassMgrObject->somClassFromId(mySomId);
|
|---|
| 95 | SOMFree(mySomId);
|
|---|
| 96 | if(mmAudioClass) {
|
|---|
| 97 | /* We have the class object */
|
|---|
| 98 | mySomId=somIdFromString("cwmmQueryTrackInfo");/* A new method in MMAudio (replacement for MMAudio) */
|
|---|
| 99 | methodPtr=(somTD_MMAudio_cwmmQueryTrackInfo) mmAudioClass->somFindSMethod(mySomId);
|
|---|
| 100 | SOMFree(mySomId);
|
|---|
| 101 | return TRUE;
|
|---|
| 102 | }
|
|---|
| 103 | return FALSE;
|
|---|
| 104 | }
|
|---|
| 105 | else
|
|---|
| 106 | return TRUE;
|
|---|
| 107 | #endif
|
|---|
| 108 | }
|
|---|
| 109 |
|
|---|
| 110 | BOOL somhlpQueryCWCDTrackMethodPtr(CWMediaFolder *thisPtr)
|
|---|
| 111 | {
|
|---|
| 112 | somId mySomId;
|
|---|
| 113 | SOMClass *mmCDTrackClass;
|
|---|
| 114 |
|
|---|
| 115 | if(!methodPtrCDTrack) {
|
|---|
| 116 | /* If we don't have the method pointer yet, get it. */
|
|---|
| 117 | /* Get class object of CWCDTrack. */
|
|---|
| 118 | mmCDTrackClass=somhlpGetSomClass("MMCDTrack");
|
|---|
| 119 | if(mmCDTrackClass) {
|
|---|
| 120 | /* We have the class object */
|
|---|
| 121 | mySomId=somIdFromString("cwmmQueryTrackInfo");/* A new method in CWAudio/CWCDTrack (replacement for MMAudio) */
|
|---|
| 122 | methodPtrCDTrack=(somTD_MMCDTrack_cwmmQueryTrackInfo) mmCDTrackClass->somFindSMethod(mySomId);
|
|---|
| 123 | SOMFree(mySomId);
|
|---|
| 124 | return TRUE;
|
|---|
| 125 | }
|
|---|
| 126 | return FALSE;
|
|---|
| 127 | }
|
|---|
| 128 | else
|
|---|
| 129 | return TRUE;
|
|---|
| 130 | }
|
|---|
| 131 |
|
|---|
| 132 | SOMClass* somhlpQueryMMAudioClass(void)
|
|---|
| 133 | {
|
|---|
| 134 | somId mySomId;
|
|---|
| 135 | static SOMClass *mAudioClass=NULL;
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 | if(!mAudioClass)
|
|---|
| 139 | mAudioClass=somhlpGetSomClass("MMAudio");
|
|---|
| 140 |
|
|---|
| 141 | return mAudioClass;
|
|---|
| 142 |
|
|---|
| 143 | #if 0
|
|---|
| 144 | if(!mAudioClass) {
|
|---|
| 145 | if((mySomId=somIdFromString("MMAudio"))!=NULLHANDLE) {
|
|---|
| 146 | mAudioClass=(SOMClass*)SOMClassMgrObject->somClassFromId(mySomId);
|
|---|
| 147 | SOMFree(mySomId);
|
|---|
| 148 | }
|
|---|
| 149 | }
|
|---|
| 150 | return mAudioClass;
|
|---|
| 151 | #endif
|
|---|
| 152 | }
|
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 |
|
|---|
| 156 |
|
|---|