What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Custom Sounds Plugin - HELP [now it is getting really weird...]

Pages: (2): « First [ 1 ] 2 » Last »
Custom Sounds Plugin - HELP [now it is getting really weird...]
Author: Message:
rh
Full Member
***


Posts: 115
– / Male / –
Joined: Mar 2003
O.P. Custom Sounds Plugin - HELP [now it is getting really weird...]
hi!

i have created a custom sounds plugin... very quick'n'dirty but who cares :D

it plays any sound that is located on some server through an embedded Windows Media Component. so before usin a custom sound, you will have to upload the file to a server, but it think this should be acceptable, because it makes possible streamed playback (without transfering the whole file first) and also gives a certain flooding-protection (because windows media only plays one file at a time).

the plugin is nearly done, just transfering the command to play the sound to the other person does not work. i used the ping-pong-example by patchou and changed just very few things still it simply does not work; the ReceiveNotify-function is not called at all!

would be nice if you could help me! thanks a lot!

rupert

p.s.: here's my code:

code:
'//////////////////////////////////////////////////////////////////////
'//                                                                  //
'// Project: Messenger Plus! simple plugin in Visual Basic           //
'// Author: Patchou                                                  //
'// Last Update: 2003/07/06                                          //
'//                                                                  //
'// For more help, please read the documentation in MPPluginDef.cls  //
'// and in MPPluginConst.bas                                         //
'//                                                                  //
'//////////////////////////////////////////////////////////////////////
Option Explicit


'//////////////////////////////////////////////////////////////////////
'//                                                                  //
'// Purpose: Initialization function                                 //
'//                                                                  //
'//////////////////////////////////////////////////////////////////////
Public Function Initialize(ByVal nVersion As Long, ByVal sUserEmail As String, ByVal oMessenger As Object) As Boolean
    Initialize = True
End Function


'//////////////////////////////////////////////////////////////////////
'//                                                                  //
'// Purpose: Uninitialization function                               //
'//                                                                  //
'//////////////////////////////////////////////////////////////////////
Public Function Uninitialize()
End Function


'//////////////////////////////////////////////////////////////////////
'//                                                                  //
'// Purpose: Provide new commands in Messenger Plus!                 //
'//                                                                  //
'//////////////////////////////////////////////////////////////////////
Public Function ParseCommand(ByVal sCommand As String, ByVal sCommandArg As String, ByVal oConversationWnd As Object, ByRef sResult As String) As Boolean
           
    'The second sample command simulates a !ping request. See
    'ReceiveNotify() for more information. You could improve it by ignoring
    'the next ReceiveNotify() call to avoid a local answer (obviously, you
    'can ping yourself).
    If (StrComp(LCase(sCommand), "/xcustomsound", vbTextCompare) = 0) Then
        sResult = Chr(nCCNotify) + "xcsnd" 'The notify code must be 5 characters long
        sResult = sResult + sCommandArg
        Load Form1
        Form1.MediaPlayer1.FileName = sCommandArg
        Form1.MediaPlayer1.Play
       
       
        ParseCommand = True
        Exit Function
    End If
   
    'Give other plugins a chance to parse this command
    ParseCommand = False
End Function


'//////////////////////////////////////////////////////////////////////
'//                                                                  //
'// Purpose: Provide new tags in Messenger Plus!                     //
'//                                                                  //
'//////////////////////////////////////////////////////////////////////
Public Function ParseTag(ByVal sTag As String, ByVal oConversationWnd As Object, ByRef sResult As String) As Boolean
 
    'Give other plugins a chance to parse this tag
    ParseTag = False
End Function


'//////////////////////////////////////////////////////////////////////
'//                                                                  //
'// Purpose: Allow special actions when a plugin text is received    //
'//                                                                  //
'//////////////////////////////////////////////////////////////////////
Public Function ReceiveNotify(ByVal sNotifyCode As String, ByVal sText As String, ByVal oConversationWnd As Object, ByRef sTextToSend As String) As Boolean
  MsgBox ("Debug: -" & sText & "-")
    'This sample responds to a !ping request sent by /xpingvb
    If (StrComp(sNotifyCode, "xcsnd", vbTextCompare) = 0) Then
       
        Load Form1
        Form1.MediaPlayer1.FileName = sText
        Form1.MediaPlayer1.Play
        sTextToSend = "[Succesfully played.]"
       
        ReceiveNotify = True
        Exit Function
    End If
   
    'Give other plugins a chance to receive this notification
    ReceiveNotify = False
End Function


This post was edited on 07-15-2003 at 11:25 AM by rh.
07-14-2003 10:16 AM
Profile E-Mail PM Find Quote Report
Xerxis
Full Member
***


Posts: 234
Reputation: 1
40 / Male / –
Joined: Jul 2003
Status: Away
RE: Custom Sounds Plugin - HELP
load form1 interupts the thread
you have to use

form1.show vbmodal,screen.activeform
07-14-2003 10:51 AM
Profile E-Mail PM Web Find Quote Report
rh
Full Member
***


Posts: 115
– / Male / –
Joined: Mar 2003
O.P. RE: Custom Sounds Plugin - HELP
hi!

thanks for your idea, but it did not help.

as you can see i don't want to to DISPLAY the form, i just need it to be loaded, so that the windowsmedia-control gets initialized. and it works so far, because on the local pc you CAN hear the sound.

it's just that on the remote PC the ReceiveNotify-function is not being called... not even the debug-msgbox at the beginning is being displayed... but the message IS being transfered to the remote pc, because you can see the "sText" in the chat window there.

still, i have tried your idea and out-commented the "load form1" (it is not required as i realized), but the problem persists...

anyone another idea? thanks a lot!

regards,

rh

This post was edited on 07-15-2003 at 11:09 AM by rh.
07-14-2003 12:42 PM
Profile E-Mail PM Find Quote Report
Whacko
Full Member
***

Avatar

Posts: 209
Reputation: 1
40 / Male / –
Joined: Apr 2002
RE: Custom Sounds Plugin - HELP
ok, cant find the problem :(

but i did find something else... in the ParseCommand Function you play the custom sound... and in ReceiveNotify too.

the local pc ALSO receives the receiveNotify() you send... so playing the sound in ParsCommand, isnt really necessary :)
so if you do both... you should hear the sound twice :P so that maybe a way to debug your code.

i will try to find your problem still. but i thought this bit would help you in any case :)
I code in:
C
C++
Delphi
Visual Basic
Pascal :P
07-14-2003 01:03 PM
Profile PM Web Find Quote Report
rh
Full Member
***


Posts: 115
– / Male / –
Joined: Mar 2003
O.P. RE: Custom Sounds Plugin - HELP
jup this is definitly useful :D
but this shows me that there is something REALLY wrong.

because when the local pc is meant to receive the receiveNotify as well, then i should be able to see the debug-msgbox everytime i use the command - but i don't. so it seems that the whole launching of the ReceiveNotify is wrong... could it be that there is something wrong with the "nCCNotify"?
07-14-2003 01:55 PM
Profile E-Mail PM Find Quote Report
rh
Full Member
***


Posts: 115
– / Male / –
Joined: Mar 2003
O.P. RE: Custom Sounds Plugin - HELP
BTW i use VB6 for compiling, that should be okay, shouldn't it?
07-14-2003 01:56 PM
Profile E-Mail PM Find Quote Report
Whacko
Full Member
***

Avatar

Posts: 209
Reputation: 1
40 / Male / –
Joined: Apr 2002
RE: Custom Sounds Plugin - HELP
you could try entering the notifycode by yourself and see what happens:

<CTRL>+<TAB>+xcsnd+ Http://your file.sound
I code in:
C
C++
Delphi
Visual Basic
Pascal :P
07-14-2003 02:28 PM
Profile PM Web Find Quote Report
rh
Full Member
***


Posts: 115
– / Male / –
Joined: Mar 2003
O.P. RE: Custom Sounds Plugin - HELP
hi!

good idea! i did that and the result was the following:

quote:
And if there's one thing that I learned when I was still a child... sagt:
http://www.hwnd.de/persdata_rupert/custsnd.mp3


so this is as intended - the code is recognized as a code and is hidden. but: the ReceiveNotify is not being executed... a bug in plus! ????

This post was edited on 07-14-2003 at 02:37 PM by rh.
07-14-2003 02:34 PM
Profile E-Mail PM Find Quote Report
rh
Full Member
***


Posts: 115
– / Male / –
Joined: Mar 2003
O.P. RE: Custom Sounds Plugin - HELP
HELP! :)
07-15-2003 10:09 AM
Profile E-Mail PM Find Quote Report
Xerxis
Full Member
***


Posts: 234
Reputation: 1
40 / Male / –
Joined: Jul 2003
Status: Away
RE: Custom Sounds Plugin - HELP
leave the load form out of it
and try again
07-15-2003 10:36 AM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On