realkiller Posted October 7, 2007 Share Posted October 7, 2007 i made a remote tool to control windows media player, give some comment Server expandcollapse popupDim $szIPADDRESS = @IPAddress1 Dim $nPORT = 33891 TCPStartUp() $MainSocket = TCPListen($szIPADDRESS, $nPORT) If $MainSocket = -1 Then Exit Dim $ConnectedSocket = -1 Do $ConnectedSocket = TCPAccept($MainSocket) Until $ConnectedSocket <> -1 Dim $szIP_Accepted = SocketToIP($ConnectedSocket) Dim $msg, $recv While 1 $recv = TCPRecv( $ConnectedSocket, 2048 ) If @error Then ExitLoop If $recv <> "" Then Switch $recv Case "play" Send("{MEDIA_PLAY_PAUSE}") Case "stop" Send("{MEDIA_STOP}") Case "next" Send("{MEDIA_NEXT}") Case "back" Send("{MEDIA_PREV}") Case "volumeverminderen" Send("{VOLUME_DOWN}") Case "volumeuit" Send("{VOLUME_MUTE}") Case "volumeverhogen" Send("{VOLUME_UP}") Case "volume100" SoundSetWaveVolume(100) Case "volume90" SoundSetWaveVolume(90) Case "volume80" SoundSetWaveVolume(80) Case "volume70" SoundSetWaveVolume(70) Case "volume60" SoundSetWaveVolume(60) Case "volume50" SoundSetWaveVolume(50) Case "volume40" SoundSetWaveVolume(40) Case "volume30" SoundSetWaveVolume(30) Case "volume20" SoundSetWaveVolume(20) Case "volume10" SoundSetWaveVolume(10) Case "volume0" SoundSetWaveVolume(0) EndSwitch EndIf WEnd If $ConnectedSocket <> -1 Then TCPCloseSocket( $ConnectedSocket ) TCPShutDown() Func SocketToIP($SHOCKET) Local $sockaddr = DLLStructCreate("short;ushort;uint;char[8]") Local $aRet = DLLCall("Ws2_32.dll","int","getpeername","int",$SHOCKET, _ "ptr",DLLStructGetPtr($sockaddr),"int_ptr",DLLStructGetSize($sockaddr)) If Not @error And $aRet[0] = 0 Then $aRet = DLLCall("Ws2_32.dll","str","inet_ntoa","int",DLLStructGetData($sockaddr,3)) If Not @error Then $aRet = $aRet[0] Else $aRet = 0 EndIf $sockaddr = 0 Return $aRet EndFuncoÝ÷ ÙÉbz{ZºÚ"µÍÔÝ B[H ÌÍÜÞÙÈH ][ÝÌNLMKÉ][ÝÂYÜ[^][H ÌÍÜÞTQTÔÈHÔ[YUÒT ÌÍÜÞÙÊB[H ÌÍÛÔHÌÎLB[H ÌÍÐÛÛXÝYÛØÚÙ]HLBÌÍÐÛÛXÝYÛØÚÙ]HÔÛÛXÝ ÌÍÜÞTQTÔË ÌÍÛÔ B[H ÌÍÜÞ]BYÜ[ÙÐÞ LL ][ÝÑÜ][ÝË ][ÝÕÔÛÛXÝZ[YÚ]ÔÐHÜ ][ÝÈ [ÈÜB[ÙBÒ[ÛYH ÐÛÛÝ[Ë]LÉÝÂÓÕ^RXÛÛÜ ][ÝÕ^SY[S[ÙI][ÝËJBÌÍÛ]]HH^PÜX]R][J ][ÝÓ]]I][ÝÊBÌÍÕÛ[Y]ÙÙ[H^PÜX]R][J ][ÝÕÛ[YHÙÙ[IÝÉ][ÝÊBÌÍÕÛ[Y]YÙ[H^PÜX]R][J ][ÝÕÛ[YHYÙ[ ËI][ÝÊB^PÜX]R][J ][ÝËKKKKKKKKKKKKKKKKKKI][ÝÊBÌÍÝÛ[YHH^PÜX]SY[J ][ÝÕÛ[YI][ÝÊBÌÍÝÛ[YLLH^PÜX]R][J ][ÝÕÛ[YHL I][ÝË ÌÍÝÛ[YJBÌÍÝÛ[YNLH^PÜX]R][J ][ÝÕÛ[YHL I][ÝË ÌÍÝÛ[YJBÌÍÝÛ[YNH^PÜX]R][J ][ÝÕÛ[YH I][ÝË ÌÍÝÛ[YJBÌÍÝÛ[YMÌH^PÜX]R][J ][ÝÕÛ[YH Ì I][ÝË ÌÍÝÛ[YJBÌÍÝÛ[YMH^PÜX]R][J ][ÝÕÛ[YH I][ÝË ÌÍÝÛ[YJBÌÍÝÛ[YMLH^PÜX]R][J ][ÝÕÛ[YH L I][ÝË ÌÍÝÛ[YJBÌÍÝÛ[YMH^PÜX]R][J ][ÝÕÛ[YH I][ÝË ÌÍÝÛ[YJBÌÍÝÛ[YLÌH^PÜX]R][J ][ÝÕÛ[YHÌ I][ÝË ÌÍÝÛ[YJBÌÍÝÛ[YLH^PÜX]R][J ][ÝÕÛ[YH I][ÝË ÌÍÝÛ[YJBÌÍÝÛ[YLLH^PÜX]R][J ][ÝÕÛ[YHL I][ÝË ÌÍÝÛ[YJBÌÍÝÛ[YLH^PÜX]R][J ][ÝÕÛ[YH I][ÝË ÌÍÝÛ[YJB^PÜX]R][J ][ÝËKKKKKKKKKKKKKKKKKKI][ÝÊBÌÍÜ^HH^PÜX]R][J ][ÝÔ^H Ýß ][ÝÊBÌÍÜÝÜH^PÜX]R][J ][ÝÔÝÜ ][ÝÊBÌÍÕÛÙ[HH^PÜX]R][J ][ÝÕÛÙ[HIÝÉ][ÝÊBÌÍÝÜYÙHH^PÜX]R][J ][ÝÉËHÜYÙI][ÝÊBÌÍÙ^]][HH^PÜX]R][J ][ÝÑ^] ][ÝÊB^TÙ]Ý]J BÚ[HB ÌÍÛÙÈH^QÙ]ÙÊ BÙ[XÝØÙH ÌÍÛÙÈHÛÛ[YSÛÜØÙH ÌÍÛÙÈH ÌÍÜ^B^H BØÙH ÌÍÛÙÈH ÌÍÜÝÜÝÜ BØÙH ÌÍÛÙÈH ÌÍÕÛÙ[B^ÛÛÈ BØÙH ÌÍÛÙÈH ÌÍÝÜYÙHXÚÜÛÛÈ BØÙH ÌÍÛÙÈH ÌÍÕÛ[Y]YÙ[Û[Y]Z[[ BØÙH ÌÍÛÙÈH ÌÍÕÛ[Y]ÙÙ[Û[Y]ÙÙ[ BØÙH ÌÍÛÙÈH ÌÍÛ]]HÛ[Y]Z] BØÙH ÌÍÛÙÈH ÌÍÝÛ[YLLÛ[YLL BØÙH ÌÍÛÙÈH ÌÍÝÛ[YNLÛ[YNL BØÙH ÌÍÛÙÈH ÌÍÝÛ[YNÛ[YN BØÙH ÌÍÛÙÈH ÌÍÝÛ[YMÌÛ[YMÌ BØÙH ÌÍÛÙÈH ÌÍÝÛ[YMÛ[YM BØÙH ÌÍÛÙÈH ÌÍÝÛ[YMLÛ[YML BØÙH ÌÍÛÙÈH ÌÍÝÛ[YMÛ[YM BØÙH ÌÍÛÙÈH ÌÍÝÛ[YLÌÛ[YLÌ BØÙH ÌÍÛÙÈH ÌÍÝÛ[YLÛ[YL BØÙH ÌÍÛÙÈH ÌÍÝÛ[YLLÛ[YLL BØÙH ÌÍÛÙÈH ÌÍÝÛ[YLÛ[YL BØÙH ÌÍÛÙÈH ÌÍÙ^]][B^]ÛÜ[Ù[XÝÑ[^]BBBBBBBB[Y[ÈÛ[YLL BÙ[ÛY ][ÝÝÛ[YLL ][ÝÊB[[Â[ÈÛ[YNL BÙ[ÛY ][ÝÝÛ[YNL ][ÝÊB[[Â[ÈÛ[YN BÙ[ÛY ][ÝÝÛ[YN ][ÝÊB[[Â[ÈÛ[YMÌ BÙ[ÛY ][ÝÝÛ[YMÌ ][ÝÊB[[Â[ÈÛ[YM BÙ[ÛY ][ÝÝÛ[YM ][ÝÊB[[Â[ÈÛ[YML BÙ[ÛY ][ÝÝÛ[YML ][ÝÊB[[Â[ÈÛ[YM BÙ[ÛY ][ÝÝÛ[YM ][ÝÊB[[Â[ÈÛ[YLÌ BÙ[ÛY ][ÝÝÛ[YLÌ ][ÝÊB[[Â[ÈÛ[YL BÙ[ÛY ][ÝÝÛ[YL ][ÝÊBQ[[Â[ÈÛ[YLL BÙ[ÛY ][ÝÝÛ[YLL ][ÝÊB[[Â[ÈÛ[YL BÙ[ÛY ][ÝÝÛ[YL ][ÝÊBQ[[Â[È^J BÙ[ÛY ][ÝÜ^I][ÝÊB[[Â[ÈÝÜ BÙ[ÛY ][ÝÜÝÜ ][ÝÊB[[Â[È^ÛÛÊ BÙ[ÛY ][ÝÛ^ ][ÝÊB[[Â[ÈXÚÜÛÛÊ BÙ[ÛY ][ÝØXÚÉ][ÝÊB[[Â[ÈÛ[Y]Z[[ BÙ[ÛY ][ÝÝÛ[Y]Z[[][ÝÊB[[Â[ÈÛ[Y]Z] BÙ[ÛY ][ÝÝÛ[Y]Z] ][ÝÊBQ[[Â[ÈÛ[Y]ÙÙ[ BÙ[ÛY ][ÝÝÛ[Y]ÙÙ[][ÝÊBQ[[Â[ÈÙ[ÛY ÌÍÜÞ]JBÔÙ[ ÌÍÐÛÛXÝYÛØÚÙ] ÌÍÜÞ]JBYÜ[^]ÔÙ[ ÌÍÐÛÛXÝYÛØÚÙ] ][ÝÉ][ÝÊBYÜ[^][[ Remote 3.1 BetaRemote Media Player ControlUSB Security 1.2 Link to comment Share on other sites More sharing options...
n00bIT Posted October 7, 2007 Share Posted October 7, 2007 You are creat 2 files server and client for what? Link to comment Share on other sites More sharing options...
JustinReno Posted October 7, 2007 Share Posted October 7, 2007 He explained it in the Topic title. Link to comment Share on other sites More sharing options...
rambo3889 Posted October 7, 2007 Share Posted October 7, 2007 Looks good Realkiller. Maybe if you wanna short the server code down do something like this: CASE stringinstr($recv,"volume") soundsetwavevolume(stringreplace($recv,"volume","") My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight! Link to comment Share on other sites More sharing options...
realkiller Posted October 7, 2007 Author Share Posted October 7, 2007 (edited) thx all for replying, indeed rambo3889, do you think that increes the program peformance ? Edited October 7, 2007 by realkiller Remote 3.1 BetaRemote Media Player ControlUSB Security 1.2 Link to comment Share on other sites More sharing options...
DirtDBaK Posted November 29, 2007 Share Posted November 29, 2007 nice idea, hmm if i wanted to put this into my media player AMP 3 would you mind? [center][/center] Link to comment Share on other sites More sharing options...
realkiller Posted November 29, 2007 Author Share Posted November 29, 2007 you can use my code thx for asking if you got question i like to hear it Remote 3.1 BetaRemote Media Player ControlUSB Security 1.2 Link to comment Share on other sites More sharing options...
DirtDBaK Posted November 30, 2007 Share Posted November 30, 2007 ok thanks... can't promiss it will get in there, but i'll try... Thanks! If/when i get it in there ill mention you + add a link to this thread in my 'Special Thanks To:' section!! [center][/center] Link to comment Share on other sites More sharing options...
sheeva Posted December 1, 2007 Share Posted December 1, 2007 Hi, Just a question, why are you doing a second tcpsend why nothing in it ? Func sendcmd($szData) TCPSend($ConnectedSocket,$szData) If @error Then Exit TCPSend($ConnectedSocket,"") If @error Then Exit EndFunc thank's Link to comment Share on other sites More sharing options...
James Posted December 1, 2007 Share Posted December 1, 2007 Hehe. This would be good for presentations when you use a wireless device. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now