OK, here is the script (called PLUGIN in FMA) for FMA.
Prequisites:
XLobby server with XEvent plugin
FMA 2.0.xx stable release
Bluetooth adapter (or IR)
GSM moble phone with bluetooth (or IR)
How to:
* install FMA
* Connect bluetooth adapter to your PC
* Turn it on
* Turn on Bluetooth on your GSM mobile phone
* Map serial port in FMA to your mobile phone
* copy the script to the FMA plugins folder (c:\program files\fma\sframework\plugins)
* run FMA
it will automatically load the script and on each event send a message to XLobby (actually to XEvent plugin).
Events include:
* connect
* disconnect
* connection lost
* proximity
* SMS received
* Incoming call
* outgoing call
....
This is only FMA part. You need to create GSM database(s) in XLobby and make the screens and events to display them and overlays for warning messages (i.e. when phone rings you could mute volume and display overlay with caller name and picture)
This script uses (creates) 2 databases. GSM and GSMARC. First is used to alert XLobby, second contains a log of all calls and SMSes. Variable XPath contains a path to your XLobby folder. I use FMA on different PC and that is why I have network path mapped. Edit to your liking
You can see the structure of databases by examining the script.... (the code speaks for itself!
http://www.lanik.org/VisualX.vbs
===========cut here ======================
' *** visualx script for communication between FMA 2.0 Stable Release and XLobby
' *** by Dalibor Lanik, December 2005
Class VisualX
' *** Path to XLobby on XLobby server, i.e. "C:\Program Files\" or "\\MYPC\" if you shared XLobby folder
Private XPath
Private m_Self
Private m_WinampState
' *** Do I have a menu?
Public Property Get SHOWABLE()
SHOWABLE = False
End Property
' *** What's my name?
Public Property Get TITLE()
TITLE = "VisualX"
End Property
' *** What's my purpose?
Public Property Get DESCRIPTION()
DESCRIPTION = "Communication between FMA and XLobby"
End Property
' *** Who created me?
Public Property Get AUTHOR()
AUTHOR = "DaLanik"
End Property
' *** Were can I be found? Where can you get more information?
Public Property Get URL()
URL = "hhtp://xlobby.lanik.org"
End Property
' *** Who am I?
Public Property Let Self(s)
m_Self = s
XPath = "\\CZ_PRG1B_C0402\"
EventManager.RegisterEvent "Connected", s & ".VXConnected", Me
EventManager.RegisterEvent "Disconnected", s & ".VXDisconnected", Me
EventManager.RegisterEvent "ConnectionLost", s & ".VXConnectionLost", Me
EventManager.RegisterEvent "Proximity", s & ".VXProximity", Me
EventManager.RegisterEvent "NewSMS", s & ".VXNewSMS", Me
EventManager.RegisterEvent "Call", s & ".VXCall", Me
End Property
Public Property Get Self()
Self = m_Self
End Property
' *** Events starting here =======================================>
Sub VXConnected
WriteEvent("gsm:con")
End Sub
Sub VXDisconnected
WriteEvent("gsm:dis")
End Sub
Sub VXConnectionLost
WriteEvent("gsm:connectionlost")
End Sub
Sub VXProximity
WriteEvent("gsm:proximity")
End Sub
Sub VXNewSMS(S, T)
Dim cf, poss, SenderName, SenderNum
' *** Delete old version of gsm database
If ( fso.FileExists( XPath ++ "Xlobby\databases\gsm.xml") ) Then
Set cf = fso.GetFile( XPath ++ "Xlobby\databases\gsm.xml")
cf.Delete
End if
Set cf = fso.GetFile( XPath ++ "Xlobby\app\gsmtemplate.xml")
cf.Copy ( XPath ++ "XLobby\databases\gsm.xml")
poss = InStr( S, "[" )
SenderName = Left( S, poss -1 )
SenderNum = Right( S, Len( S ) - poss )
SenderNum = Left( SenderNum, Len( SenderNum ) - 1 )
Set cf = fso.OpenTextFile( XPath ++ "XLobby\databases\gsm.xml", 8, False)
cf.WriteLine(" <item>" )
cf.WriteLine(" <coverart>" ++ XPath ++ "XLobby\databases\gsm\" ++ SenderName ++ ".jpg</coverart>")
cf.WriteLine(" <parameter>" ++ S ++ "</parameter>")
cf.WriteLine(" <display>" ++ SenderName ++ "</display>")
cf.WriteLine(" <information>" )
cf.WriteLine(" <msgtext>" ++ T ++ "</msgtext>")
cf.WriteLine(" </information>" )
cf.WriteLine(" </item>")
cf.WriteLine("</database>")
cf.Close
If ( Not fso.FileExists( XPath ++ "Xlobby\databases\gsmarc.xml") ) Then
Set cf = fso.GetFile( XPath ++ "Xlobby\app\gsmtemplate.xml")
cf.Copy ( XPath ++ "XLobby\databases\gsmarc.xml")
Set cf = fso.OpenTextFile( XPath ++ "XLobby\databases\gsmarc.xml", 8, False)
cf.WriteLine("</database>")
cf.Close
End if
Set of = fso.OpenTextFile( XPath ++ "XLobby\databases\gsmarc.xml", 1, False)
Set cf = fso.OpenTextFile( XPath ++ "XLobby\databases\gsmarcnew.xml", 2, True)
Do While Not ( of.atEndOfStream )
buff = of.ReadLine
if( buff = "</database>") Then
cf.WriteLine(" <item>" )
cf.WriteLine(" <coverart>" ++ XPath ++ "XLobby\databases\gsm\" ++ SenderName ++ ".jpg</coverart>")
cf.WriteLine(" <parameter>" ++ S ++ "</parameter>")
cf.WriteLine(" <display>" ++ SenderName ++ "</display>")
cf.WriteLine(" <information>" )
cf.WriteLine(" <msgtext>" ++ T ++ "</msgtext>")
cf.WriteLine(" </information>" )
cf.WriteLine(" </item>")
End if
cf.WriteLine( buff )
Loop
cf.Close
of.Close
Set cf = fso.GetFile( XPath ++ "XLobby\databases\gsmarc.xml")
cf.Delete
Set cf = fso.GetFile( XPath ++ "XLobby\databases\gsmarcnew.xml")
cf.Name = "gsmarc.xml"
WriteEvent("gsm:incoming_sms")
End Sub
Sub VXCall( C, A, N )
Dim cf, of, buff
' *** Delete old version of gsm database
If ( fso.FileExists( XPath ++ "Xlobby\databases\gsm.xml") ) Then
Set cf = fso.GetFile( XPath ++ "Xlobby\databases\gsm.xml")
cf.Delete
End if
Set cf = fso.GetFile( XPath ++ "Xlobby\app\gsmtemplate.xml")
cf.Copy ( XPath ++ "XLobby\databases\gsm.xml")
Set cf = fso.OpenTextFile( XPath ++ "XLobby\databases\gsm.xml", 8, False)
cf.WriteLine(" <item>" )
cf.WriteLine(" <coverart>" ++ XPath ++ "XLobby\databases\gsm\" ++ A ++ ".jpg</coverart>")
cf.WriteLine(" <parameter>" ++ C ++ "</parameter>")
cf.WriteLine(" <display>" ++ A ++ "</display>")
cf.WriteLine(" <information>" )
cf.WriteLine(" <callernumber>" ++ N ++ "</callernumber>")
cf.WriteLine(" </information>" )
cf.WriteLine(" </item>")
cf.WriteLine("</database>")
cf.Close
If ( Not fso.FileExists( XPath ++ "Xlobby\databases\gsmarc.xml") ) Then
Set cf = fso.GetFile( XPath ++ "Xlobby\app\gsmtemplate.xml")
cf.Copy ( XPath ++ "XLobby\databases\gsmarc.xml")
Set cf = fso.OpenTextFile( XPath ++ "XLobby\databases\gsmarc.xml", 8, False)
cf.WriteLine("</database>")
cf.Close
End if
Set of = fso.OpenTextFile( XPath ++ "XLobby\databases\gsmarc.xml", 1, False)
Set cf = fso.OpenTextFile( XPath ++ "XLobby\databases\gsmarcnew.xml", 2, True)
Do While Not ( of.atEndOfStream )
buff = of.ReadLine
if( buff = "</database>") Then
cf.WriteLine(" <item>" )
cf.WriteLine(" <coverart>" ++ XPath ++ "XLobby\databases\gsm\" ++ A ++ ".jpg</coverart>")
cf.WriteLine(" <parameter>" ++ C ++ "</parameter>")
cf.WriteLine(" <display>" ++ A ++ "</display>")
cf.WriteLine(" <information>" )
cf.WriteLine(" <callernumber>" ++ N ++ "</callernumber>")
cf.WriteLine(" </information>" )
cf.WriteLine(" </item>")
End if
cf.WriteLine( buff )
Loop
cf.Close
of.Close
Set cf = fso.GetFile( XPath ++ "XLobby\databases\gsmarc.xml")
cf.Delete
Set cf = fso.GetFile( XPath ++ "XLobby\databases\gsmarcnew.xml")
cf.Name = "gsmarc.xml"
If( C = "Connecting" ) Then
WriteEvent("gsm:outgoing_call")
Else
WriteEvent("gsm:incoming_call")
End if
End Sub
Function WriteEvent(str)
Dim tf
Set tf = Fso.OpenTextFile( XPath ++ "Xlobby\plugins\XEvent\XAlarmClock.ini", 8, True)
tf.WriteLine( "now|" ++ str )
tf.Close
End Function
End Class
==========cut here - end ======================
You also need to create a file called gsmtemplate.xml and put it in xlobby\app folder (or edit the script to look for this file elsewhere)
here is the contents of the file:
===========cut here ===========
<?xml version="1.0" encoding="UTF-8"?>
<database>"
<sortorder>display</sortorder>
<sortable>
</sortable>
<paths>
</paths>
===========cut here -end =========
Hope you have fun
I'll try posting the whole skin with overlays and events next week....
Dalibor