HSPポータル
サイトマップ お問い合わせ


HSPTV!掲示板


未解決 解決 停止 削除要請

2017
0615
morimorimci動画再生の各種設定2解決


morimori

リンク

2017/6/15(Thu) 20:33:28|NO.80237

mciの再生のテストをしていますが、
明るさの調整がうまく行きません。

キーボード E/R で明るさを下げ/上げするようにコマンドを送っていますが、
手持ちのAVIファイルでテストしていますが、変化がありません。
というか明るさの取得もできていないです。なので値の範囲もわかりません。

mciコマンドが違うのか、対応していないのか…

以下テストスクリプトです。
よろしくお願いします。


//mciテスト new_winx = 320 : new_winy = 240 screen 2,ginfo_dispx,ginfo_dispy,,,,new_winx,new_winy oncmd gosub *win_resize , 0x00005 //ウィンドウサイズ変更 onkey gosub *key_input onexit *BeforeClose keycode1 = 0 : key_shift = 0 : key_ctrl = 0 val_brightness = 1000 *open1 dialog "",16,"" if stat!=1 : stop filenm=refstr *open2 mci "open "+filenm+" alias abc style child parent "+hwnd mes "open stat : " + stat mci "put abc window at 10 20 "+(new_winx-20)+" "+(new_winy-30) mci "play abc" mci "set abc time format milliseconds" mci "status abc length" : time_length = stat wait 250 repeat mci "status abc position" color 255,255,255 : boxf 0,0,200,18 color 0,0,0 : pos 0,0 : mes "" + (double(stat)/1000) + " / " + (double(time_length)/1000) mci "status abc mode" : if refstr="playing" : stat_play=1 : else : stat_play=0 mci "status abc brightness" title "brightness : " + stat + refstr wait 10 loop stop *win_resize new_winx = ginfo_winx : new_winy = ginfo_winy mci "put abc window at 10 20 "+(new_winx-20)+" "+(new_winy-30) return *key_input keycode1 = wparam getkey key_shift,16 : getkey key_ctrl,17 if keycode1=37 : time_seek=-5000-(key_shift*10000 + key_ctrl*5000) : gosub *seek1 if keycode1=39 : time_seek=5000+(key_shift*10000 + key_ctrl*5000) : gosub *seek1 if keycode1=32 : gosub *playpause if keycode1=82 : val_brightness += 10 : mci "setvideo abc brightness to "+val_brightness if keycode1=69 : val_brightness -= 10 : mci "setvideo abc brightness to "+val_brightness return *playpause mci "status abc mode" if refstr="playing" { mci "stop abc" } else { mci "play abc" } return *seek1 mci "status abc position" time_seek += stat if time_seek < 0 : time_seek = 0 mci "seek abc to " + time_seek if stat_play=1 : mci "play abc" ;再生状態の復帰(seekすると止まる) return *BeforeClose mci "close all" end



この記事に返信する


MillkeySoftw

リンク

2017/6/16(Fri) 11:50:11|NO.80244

mci エラーコード 274 : このコマンドはサポートしません。
じゃないのかな。この場合は、設定が無理だからね。

#module _mci_morimori_ #uselib "winmm.dll" #cfunc mciSendString "mciSendStringA" sptr,var,int,int #cfunc mciSendCommand "mciSendCommandA" int,sptr,int,var #func mciGetErrorString "mciGetErrorStringA" int,var,int #cfunc mciGetDeviceID "mciGetDeviceIDA" sptr #undef mci #deffunc mci str mcicommand sdim ReturnString,4096 res = mciSendString(mcicommand,ReturnString,4096,NotifyHWND) if (res != 0)&(LastErrorCode != res){ ErrStringPut = "コマンド\n\"%s\"\nでエラーが発生しました。\n\nエラー番号 : %d\n\n%s" LastErrorCode = res & 0xFFFF mciGetErrorString res,ReturnString,4096 dialog strf(ErrStringPut,mcicommand,LastErrorCode,ReturnString),1,"mci エラー" } return int(ReturnString) #define MCI_STATUS 0x0814 #define MCI_DGV_STATUS_BRIGHTNESS 0x00004005 #global
上記モジュールをスクリプトの先頭にコピーして実行してみてね。
サポートしてない場合、そのようなエラーが表示されます。



morimori

リンク

2017/6/16(Fri) 22:15:55|NO.80251

MillkeySoftwさん

回答ありがとうございます。
274出ました。サポートしてないんですね。
Microsoftの資料にはなんかいろいろ書いてあるんですけどね。
https://msdn.microsoft.com/ja-jp/library/windows/desktop/dd798668(v=vs.85).aspx

ありがとうございました!



ONION software Copyright 1997-2023(c) All rights reserved.