source: trunk/mediafolder/Skripte_ger/~Audio CD brennen@ 201

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

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

File size: 4.2 KB
Line 
1/****************************************/
2/* */
3/* Burn selected tracks as an audio CD. */
4/* Audio-CD-Creator must be installed. */
5/* */
6/* An audio folder will be created and */
7/* the selected tracks inserted. */
8/* */
9/****************************************/
10/* Load Rexxutil functions */
11call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
12call SysLoadFuncs
13
14QC_FIRST=0
15QC_NEXT=1
16QC_LAST=2
17
18/* Check if we are executing */
19if ARG(1)\='/EXECUTE' THEN EXIT
20
21/* Check if Audio-CD-Creator is installed */
22
23list.0=0
24found=0
25rc=SysQueryClassList(list.)
26DO a=1 to list.0
27 if TRANSLATE(WORD(list.a,1))='CWAUDIOFOLDER' THEN DO
28 found=1
29 LEAVE
30 END
31END
32
33IF found=0 THEN DO
34 theString="Audio-CD-Creator ist nicht installiert. Das CD-Creator Paket ist Voraussetzung fr die Nutzung dieser Funktion."
35 theString=theString||'0d'X||'0d'X
36 theString=theString||'Es ist erh„ltlich unter http://www.os2world.com/cdwriting'||'0d'X||' '
37 rc=RxMessageBox(theString, "",'OK', "Information")
38 EXIT
39END
40
41/* The media folder running this skript */
42mFldr=ARG(2)
43/* And the frame handle */
44frameHandle=ARG(3)
45
46/*Get the container handle */
47container=WPSWizCallWinFunc( "winQueryContainerHWND", frameHandle)
48
49if container=0 THEN DO
50 rc=RxMessageBox("Container-Handle kann nicht ermittlet werden!", "",'OK', "Information")
51 EXIT
52END
53
54pRec=WPSWizCallWinFunc( "winQueryContRecEmphasis", container, 16 , 1)
55
56a=0
57tracks.0=0
58DO WHILE (pRec\=0 & pRec\=-1)
59 /* Get object pointer */
60 obj=WPSWizCallWinFunc( "winObjectFromPRec", pRec)
61 /* Follow shadows to file system object */
62 obj=MFldrCallFunc( "cwGetFileSystemObject", mFldr, obj)
63 /* Check if it's an audio object */
64 IF MFldrCallFunc( "cwIsA", obj, "CWAudio")\=0 THEN DO
65 a=a+1
66 tracks.a._obj=obj
67 END
68 pRec=WPSWizCallWinFunc( "winQueryContRecEmphasis", container, pRec , 1)
69 tracks.0=a
70END
71
72if tracks.0=0 THEN DO
73 rc=RxMessageBox("Keine Audio-Dateien ausgew„hlt.", "Information",'OK')
74 EXIT
75END
76
77/* Try to find the desktop folder */
78
79/* Get the persistent object handle */
80hObject=WPSWizCallWinFunc( "winQueryObject" ,"<WP_DESKTOP>")
81
82if hObject\=0 THEN DO
83 /* Get the class object of the given object pointer */
84 classObject=WPSWizCallWPSFunc("somGetClass",mFldr)
85
86 /* Get the object pointer from the handle */
87 theObject=WPSWizCallWPSClsFunc("wpclsQueryObject", classObject, hObject)
88
89 /* Query the full path of the object */
90 desktop=WPSWizCallFunc("cwQueryRealName", theObject, 1)
91
92 /* The object was locked because of "wpclsQueryObject" */
93 rc=WPSWizCallWPSFunc("wpUnlockObject", theObject)
94END
95
96if desktop\='' THEN
97 desktop=desktop||'\audioFolder'
98
99/* Get a name for the new folder */
100folderName=WPSWizCallWinFunc( "winFileDlg", 1, "Name fr Audio-CD-Creator Ordner", desktop)
101
102/* No name, so quit */
103if foldername="" THEN exit
104
105/* Check if an error occurred */
106if foldername="ERROR:" THEN DO
107 rc=RxMessageBox("Der Dateidialog gab einen Fehler zurck!", "Error",'OK', "ERROR")
108 EXIT
109END
110
111/* Get the path */
112thePath=FILESPEC('drive',foldername)||FILESPEC('path',foldername)
113thePath=LEFT(thePath,LENGTH(thePath)-1)
114
115/* Create a new audio folder to hold the selected tracks */
116setup=''
117setup='DETAILSCLASS=CWAudioShadow;SORTCLASS=CWAudioShadow;DETAILSTODISPLAY=0,1,4,12,13,14,15,16,17,18,19,20,21;SORTBYATTR=6,24,25,26,27,28,29,30,31,32,33'
118
119newFldr=SysCreateObject("CWAudioFolder", FILESPEC('name',foldername), thePath, setup , 'update')
120
121if newFldr=0 THEN DO
122 /* Folder creation failed */
123 rc=RxMessageBox("Audio-CD Ordner konnte nicht erstellt werden!", "Erstellung Audio-Ordner",'OK')
124 EXIT
125END
126
127
128/* Now create shadows of the selected tracks */
129DO a=tracks.0 to 1 by -1
130 objName=MFldrCallFunc( "cwQueryRealName", tracks.a._obj, 0)
131 /* When using a space as the object title the real name is used as the title. By doing it this
132 way we may have several shadows to the same track in the folder. */
133 rc=SysCreateObject("CWAudioShadow", " ", folderName, "SHADOWID="||MFldrCallFunc( "cwQueryRealName", tracks.a._obj,1),'update')
134END
135/* Open the folder */
136rc=SysSetObjectData(folderName, "OPEN=DEFAULT")
137rc=0
138
139exit
140
141
Note: See TracBrowser for help on using the repository browser.