source: branches/v2.9/classes/bin/chktimid.rx

Last change on this file was 2, checked in by stevenhl, 8 years ago

Import sources from cwmm-full.zip dated 2005-03-21

File size: 1.3 KB
Line 
1/* Rexx - check if Timidity is used as the default
2 sequencer.
3 The WPS crashes when Timidity is used to play a Midi
4 song using the classes.
5
6 (C) Chris Wohlgemuth 2003. This file is part of the
7 CW-Multimedia classes.
8
9 http://www.os2world.com/cdwriting
10
11 This skript is called by M_MMAudio::wpclsInitData()
12*/
13
14call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
15call SysLoadFuncs
16
17rc=0
18
19/* Get MMOS2 directory */
20mmos2Dir=STRIP(TRANSLATE(value("MMBASE",,"OS2ENVIRONMENT")," ",";"))
21if LEFT(mmos2Dir,1)='\' THEN
22 mmpm2Ini=mmos2Dir||'mmpm2.ini'
23else
24 mmpm2Ini=mmos2Dir||'\mmpm2.ini'
25
26if STREAM(mmpm2ini, "C", "Query exists")='' THEN DO
27 /* MMPM2.INI not found */
28 exit "0"
29END
30
31/* Read ini */
32a=0
33DO WHILE LINES(mmpm2ini)
34 a=a+1
35 mmini.a=STRIP(LINEIN(mmpm2ini))
36END
37mmini.0=a
38ret=STREAM(mmpm2ini, "C", "close")
39
40/* Find [DEFAULTNAMES] section */
41DO a=1 to mmini.0
42 if ABBREV(STRIP(TRANSLATE(mmini.a)), "[DEFAULTNAMES]")=1 THEN DO
43 rc=parseDefaultnames()
44 LEAVE
45 END
46END
47SAY rc
48if rc=1 THEN return "1"
49return "0"
50EXIT
51
52/**************************************/
53
54parseDefaultnames:
55a=a+1
56DO WHILE LEFT(mmini.a,1)\='['
57 IF ABBREV(TRANSLATE(mmini.a),"SEQUENCER")=1 THEN DO
58 thePos=POS("TIMIDITY",TRANSLATE(mmini.a))
59 if thePos=0 then return 0
60 return 1
61 END
62 a=a+1
63END
64return 0
65
66
Note: See TracBrowser for help on using the repository browser.