home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 October / VPR9710A.ISO / Ffilly / TFYW111 / RTW_MULT.MAC < prev    next >
Text File  |  1997-06-05  |  5KB  |  211 lines

  1. //マルチメディア関連関数
  2. main:
  3.     menu
  4.         "Play&MIDI\tMIDIファイル演奏",
  5.         "Play&WAVE\tWAVEファイル再生",
  6.         "Play&AVI\tAVIムービー再生",
  7.         "PlayA&VI...\tAVIムービー再生(詳細設定)",
  8.         "Play&CD...\tCD再生",
  9.         "MC&I\tMCIコマンドを実行(返り値:整数)",
  10.         "&StrMCI\tMCIコマンドを実行(返り値:文字列)",
  11.         "&LoadRsc\tWAVEをメモリに読み込む",
  12.         "&PlayRsc\tメモリに読んだWAVEファイルを再生",
  13.         "&DelRsc\tメモリ上のWAVEファイルを削除";
  14.     if(result == 0) goto macro_cancel;
  15.     else if(result == 1) call InsFunc "PlayMIDI",2;
  16.     else if(result == 2) call InsFunc "PlayWAVE",2;
  17.     else if(result == 3) call InsFunc "PlayAVI",2;
  18.     else if(result == 4) goto PlayAVIF;
  19.     else if(result == 5) goto PlayCD;
  20.     else if(result == 6) call InsFunc "MCI",2;
  21.     else if(result == 7) call InsFunc "StrMCI",2;
  22.     else if(result == 8) call InsFunc "LoadRsc",2;
  23.     else if(result == 9) call InsFunc "PlayRsc",1;
  24.     else if(result ==10) call InsFunc "DelRsc",1;
  25.  
  26.  
  27. macro_end:
  28.     endmacro;
  29.  
  30.  
  31. macro_cancel:
  32.     writeininum "tfywrite.ini", "Control", "MenuCancel", 1;
  33.     endmacro;
  34.  
  35.  
  36. PlayAVIF:
  37.     escape;
  38.     call MacSrvInit;
  39.  
  40.     ddepoke "newdialog", "36,PlayAVI";
  41.  
  42.     ddepoke "newcontrol", "text,,AVIファイル名(&F)";
  43.     ddepoke "part", "14";
  44.     ddepoke "newcontrol", "edit,File,";
  45.  
  46.     ddepoke "newcontrol", "text,,ウィンドウ番号(&W)";
  47.     ddepoke "part", "14";
  48.     ddepoke "newcontrol", "edit,Win,";
  49.     ddepoke "part", "6";
  50.     ddepoke "newcontrol", "text,,";    
  51.  
  52.     ddepoke "newcontrol", "text,,始点";
  53.     ddepoke "part", "5";
  54.     ddepoke "newcontrol", "text,,X座標(&X)";
  55.     ddepoke "part", "9";
  56.     ddepoke "newcontrol", "edit,X,";
  57.     ddepoke "part", "6";
  58.     ddepoke "newcontrol", "text,,Y座標(&Y)";
  59.     ddepoke "part", "9";
  60.     ddepoke "newcontrol", "edit,Y,";
  61.     ddepoke "part", "6";
  62.     ddepoke "newcontrol", "text,,";    
  63.  
  64.     ddepoke "newcontrol", "text,,サイズ";
  65.     ddepoke "part", "5";
  66.     ddepoke "newcontrol", "text,,幅(&W)";
  67.     ddepoke "part", "9";
  68.     ddepoke "newcontrol", "edit,W,";
  69.     ddepoke "part", "6";
  70.     ddepoke "newcontrol", "text,,高さ(&H)";
  71.     ddepoke "part", "9";
  72.     ddepoke "newcontrol", "edit,H,";
  73.     ddepoke "part", "6";
  74.     ddepoke "newcontrol", "text,,";    
  75.  
  76.     ddepoke "newcontrol", "text,, ";    
  77.     ddepoke "part", "16";
  78.     ddepoke "newcontrol", "okcancel,Ok";
  79.  
  80.     call MakeDialog;
  81.  
  82.     $Ok = dderequest("getstring Ok");
  83.     if($Ok == "0")goto macro_end;
  84.  
  85.     $File = dderequest("getstring File");
  86.     $Win  = dderequest("getstring Win");
  87.     $X    = dderequest("getstring X");
  88.     $Y    = dderequest("getstring Y");
  89.     $W    = dderequest("getstring W");
  90.     $H    = dderequest("getstring H");
  91.  
  92.     $Cmd = "PlayAVI(\"" +$File+ "\"," +$Win+ "," +$X+ "," +$Y+ "," +$W+ "," +$H+ ");";
  93.     insert $Cmd;
  94.  
  95.     goto macro_end;
  96.     ddeexecute "exit";
  97.  
  98.  
  99. PlayCD:
  100.     escape;
  101.     call MacSrvInit;
  102.  
  103.     ddepoke "newdialog", "22,PlayCD";
  104.  
  105.     ddepoke "newcontrol", "text,,演奏開始トラック(&S)";
  106.     ddepoke "part", "16";
  107.     ddepoke "newcontrol", "edit,Start,";
  108.  
  109.     ddepoke "newcontrol", "text,,演奏終了トラック(&E)";
  110.     ddepoke "part", "16";
  111.     ddepoke "newcontrol", "edit,End,";
  112.  
  113.  
  114.     ddepoke "newcontrol", "okcancel,Ok";
  115.  
  116.     call MakeDialog;
  117.  
  118.     $Ok = dderequest("getstring Ok");
  119.     if($Ok == "0")goto macro_end;
  120.  
  121.     $Start = dderequest("getstring Start");
  122.     $End   = dderequest("getstring End");
  123.  
  124.     $Cmd = "PlayCD(" +$Start+ "," +$End+ ");";
  125.     insert $Cmd;
  126.  
  127.     goto macro_end;
  128.     ddeexecute "exit";
  129.  
  130.  
  131. //関数の挿入
  132. InsFunc:
  133.     //第1引数 str 関数名
  134.     //第2引数 str 関数の引数のタイプ
  135.     // (0=なし、1=数値型、2=文字列型、3=配列変数)
  136.  
  137.     if(##2 == 0){
  138.         escape;
  139.         insert $$1 + "();";
  140.         return;
  141.     }
  142.  
  143.     #Select = selecting;
  144.     $SText = "";
  145.  
  146.     if(#Select == 1){
  147.         #STopX = seltopx;
  148.         #STopY = seltopy;
  149.         #SEndX = selendx;
  150.         #SEndY = selendy;
  151.         $SText = gettext(#STopX,#STopY,#SEndX,#SEndY);
  152.         #SLength = strlen($SText);
  153.         moveto #STopX,#STopY;
  154.  
  155.         beginsel;
  156.         right #SLength;
  157.         delete;
  158.     }
  159.     
  160.     if(##2 == 1){
  161.         insertfix $$1 + "(" + $SText + ");";
  162.         if($SText == ""){
  163.             gowordend;
  164.             right;
  165.         }
  166.     }
  167.  
  168.     else if(##2 == 2){
  169.         insertfix $$1 + "(\"" + $SText + "\");";
  170.         if($SText == ""){
  171.             gowordend;
  172.             right 2;
  173.         }
  174.     }
  175.  
  176.     else if(##2 == 3){
  177.         if(rightstr($SText,2) != "[]") $SText = $SText + "[]";
  178.         insertfix $$1 + "(\"" + $SText + "\");";
  179.         if($SText == ""){
  180.             gowordend;
  181.             right;
  182.         }
  183.     }
  184.  
  185.     return;
  186.  
  187.  
  188. //ダイアログボックス関連サブルーチン
  189. MacSrvInit:
  190.     run "macserv.exe /h";
  191.     ddeinitiate "HideMacroServer", "DlgService";
  192.     if( !result ) {
  193.         message "ddeinitiate failed";
  194.         endmacro;
  195.     }
  196.     ddeexecute "setcurdir " + directory;
  197.     return;
  198.  
  199.  
  200. MakeDialog:
  201.     #hwnd = hidemaruhandle(0);
  202.     ddeexecute "dialog " + str(#hwnd);
  203.     $$a = "";
  204.     ddestartadvice "dlgresult", $$a;
  205.     while( strlen($$a) == 0 ) {
  206.         ddewaitadvice $$a, 100;
  207.     }
  208.     ddestopadvice "dlgresult";
  209.     ddeexecute "enddialog";
  210.     return $$a;
  211.