home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 October
/
VPR9710A.ISO
/
Ffilly
/
TFYW111
/
RTW_MULT.MAC
< prev
next >
Wrap
Text File
|
1997-06-05
|
5KB
|
211 lines
//マルチメディア関連関数
main:
menu
"Play&MIDI\tMIDIファイル演奏",
"Play&WAVE\tWAVEファイル再生",
"Play&AVI\tAVIムービー再生",
"PlayA&VI...\tAVIムービー再生(詳細設定)",
"Play&CD...\tCD再生",
"MC&I\tMCIコマンドを実行(返り値:整数)",
"&StrMCI\tMCIコマンドを実行(返り値:文字列)",
"&LoadRsc\tWAVEをメモリに読み込む",
"&PlayRsc\tメモリに読んだWAVEファイルを再生",
"&DelRsc\tメモリ上のWAVEファイルを削除";
if(result == 0) goto macro_cancel;
else if(result == 1) call InsFunc "PlayMIDI",2;
else if(result == 2) call InsFunc "PlayWAVE",2;
else if(result == 3) call InsFunc "PlayAVI",2;
else if(result == 4) goto PlayAVIF;
else if(result == 5) goto PlayCD;
else if(result == 6) call InsFunc "MCI",2;
else if(result == 7) call InsFunc "StrMCI",2;
else if(result == 8) call InsFunc "LoadRsc",2;
else if(result == 9) call InsFunc "PlayRsc",1;
else if(result ==10) call InsFunc "DelRsc",1;
macro_end:
endmacro;
macro_cancel:
writeininum "tfywrite.ini", "Control", "MenuCancel", 1;
endmacro;
PlayAVIF:
escape;
call MacSrvInit;
ddepoke "newdialog", "36,PlayAVI";
ddepoke "newcontrol", "text,,AVIファイル名(&F)";
ddepoke "part", "14";
ddepoke "newcontrol", "edit,File,";
ddepoke "newcontrol", "text,,ウィンドウ番号(&W)";
ddepoke "part", "14";
ddepoke "newcontrol", "edit,Win,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,";
ddepoke "newcontrol", "text,,始点";
ddepoke "part", "5";
ddepoke "newcontrol", "text,,X座標(&X)";
ddepoke "part", "9";
ddepoke "newcontrol", "edit,X,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,Y座標(&Y)";
ddepoke "part", "9";
ddepoke "newcontrol", "edit,Y,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,";
ddepoke "newcontrol", "text,,サイズ";
ddepoke "part", "5";
ddepoke "newcontrol", "text,,幅(&W)";
ddepoke "part", "9";
ddepoke "newcontrol", "edit,W,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,高さ(&H)";
ddepoke "part", "9";
ddepoke "newcontrol", "edit,H,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,";
ddepoke "newcontrol", "text,, ";
ddepoke "part", "16";
ddepoke "newcontrol", "okcancel,Ok";
call MakeDialog;
$Ok = dderequest("getstring Ok");
if($Ok == "0")goto macro_end;
$File = dderequest("getstring File");
$Win = dderequest("getstring Win");
$X = dderequest("getstring X");
$Y = dderequest("getstring Y");
$W = dderequest("getstring W");
$H = dderequest("getstring H");
$Cmd = "PlayAVI(\"" +$File+ "\"," +$Win+ "," +$X+ "," +$Y+ "," +$W+ "," +$H+ ");";
insert $Cmd;
goto macro_end;
ddeexecute "exit";
PlayCD:
escape;
call MacSrvInit;
ddepoke "newdialog", "22,PlayCD";
ddepoke "newcontrol", "text,,演奏開始トラック(&S)";
ddepoke "part", "16";
ddepoke "newcontrol", "edit,Start,";
ddepoke "newcontrol", "text,,演奏終了トラック(&E)";
ddepoke "part", "16";
ddepoke "newcontrol", "edit,End,";
ddepoke "newcontrol", "okcancel,Ok";
call MakeDialog;
$Ok = dderequest("getstring Ok");
if($Ok == "0")goto macro_end;
$Start = dderequest("getstring Start");
$End = dderequest("getstring End");
$Cmd = "PlayCD(" +$Start+ "," +$End+ ");";
insert $Cmd;
goto macro_end;
ddeexecute "exit";
//関数の挿入
InsFunc:
//第1引数 str 関数名
//第2引数 str 関数の引数のタイプ
// (0=なし、1=数値型、2=文字列型、3=配列変数)
if(##2 == 0){
escape;
insert $$1 + "();";
return;
}
#Select = selecting;
$SText = "";
if(#Select == 1){
#STopX = seltopx;
#STopY = seltopy;
#SEndX = selendx;
#SEndY = selendy;
$SText = gettext(#STopX,#STopY,#SEndX,#SEndY);
#SLength = strlen($SText);
moveto #STopX,#STopY;
beginsel;
right #SLength;
delete;
}
if(##2 == 1){
insertfix $$1 + "(" + $SText + ");";
if($SText == ""){
gowordend;
right;
}
}
else if(##2 == 2){
insertfix $$1 + "(\"" + $SText + "\");";
if($SText == ""){
gowordend;
right 2;
}
}
else if(##2 == 3){
if(rightstr($SText,2) != "[]") $SText = $SText + "[]";
insertfix $$1 + "(\"" + $SText + "\");";
if($SText == ""){
gowordend;
right;
}
}
return;
//ダイアログボックス関連サブルーチン
MacSrvInit:
run "macserv.exe /h";
ddeinitiate "HideMacroServer", "DlgService";
if( !result ) {
message "ddeinitiate failed";
endmacro;
}
ddeexecute "setcurdir " + directory;
return;
MakeDialog:
#hwnd = hidemaruhandle(0);
ddeexecute "dialog " + str(#hwnd);
$$a = "";
ddestartadvice "dlgresult", $$a;
while( strlen($$a) == 0 ) {
ddewaitadvice $$a, 100;
}
ddestopadvice "dlgresult";
ddeexecute "enddialog";
return $$a;