Send me your CHANGES and I'll look over it... the reason why I haven't worked on this yet is because I want to make it well done ... possibly using lat/long GPS coordinates to calculate sunset time and adjust accordingly for daylight savings ..
Guino
i had a chance to look you sourcecode...
and add some lines...
RR now loads day or night skin depending on the time in RR.ini
and another thing
when RR enters into FreeDrive, FreeDrive Map color will be changed as well...
in order to do this
add these lines in RR.ini
nightskin="...." // must be set to valid skin
autoskin=true
daystart=0600
nightstart=1800
gpsmode=2 //gps setting must be set for FreeDrive
oh...
and FreeDrive has to be running backgound before RR launchs it.
i just used "FreeDrive /hidden" in startup folder
can someone host this rr.exe file?
pm me, i will email it...
and Guino
you might want my code for future version..?
let me know...
Send me your CHANGES and I'll look over it... the reason why I haven't worked on this yet is because I want to make it well done ... possibly using lat/long GPS coordinates to calculate sunset time and adjust accordingly for daylight savings ..
Ride Runner RR's Myspace
"Being happy is not about having what you want, it's about wanting what you have."
"The best things in life are always free - but that doesn't mean money can't buy you good things."
without the line 'AUTOSKIN=TRUE'Originally Posted by guino
RR will act as before...
then you might want to get datsatart and nightstart value from GPS
rather than from rr.ini
now it checks time and switches skin
but still skin can be changed in skin browser
AUTOSKIN will not work until skin is set back to right skin( day or night )
here is what i changed i marked BOLD for changes
[modRoadRunner / Declarations]
.
.
.
Public AUTO_SKIN As Boolean 'Auto Skin by Time
Public DAY_SKIN As String 'Day Skin Path
Public DAY_START As String 'Day Skin Start Time
Public NIGHT_SKIN As String 'Night Skin Path
Public NIGHT_START As String 'Night Skin Start Time.
.
.
.
'Set Default Settings
AUTO_SKIN = False
.
.
.
[modRoadRunner / Exec]
.
.
.
Select Case GPSMode
Case 0
CODE = "load;destinator_gps.skin;Map Monkey;" + MapMonkey_PATH + ";Map Monkey -"
Case 1
CODE = "load;mappoint_gps.skin"
Case 2
CODE = "load;external_gps.skin;External GPS;" + GPS_PATH + ";" + GPS_NAME
If AUTO_SKIN Then COMSend "FreeDrive", IIf(SKIN_PATH = DAY_SKIN, "DAY", "NIGHT")
Case 3
CODE = "menu;gps_menu.skin;g.p.s."
End Select
.
.
.
Case "select"
If Frm.Tag = "skin_browser.skin" Then
'Switch Skin
SKIN_PATH = Frm.DL.Path + Frm.DL.Text + "\"
tmp = Format(time, "hhmm")
If LCase(SKIN_PATH) = LCase(IIf(tmp > DAY_START And tmp < NIGHT_START, DAY_SKIN, NIGHT_SKIN)) Then
AUTO_SKIN = True
Else
AUTO_SKIN = False
End If
'Garantee
Unload frmMP
.
.
.
[modRoadRunner / UpdateScreen]
.
.
.
Dim tmp As String
.
.
.
On Error Resume Next
'Make sure it's for current screen and it is visuble (no point in updating a hidden window)
If CurSCR <> F.Tag Or Not F.Visible Then Exit Sub
'Check for time to switch AUTOSKIN
tmp = Format(time, "hhmm")
If AUTO_SKIN And LCase(SKIN_PATH) <> LCase(IIf(tmp > DAY_START And tmp < NIGHT_START, DAY_SKIN, NIGHT_SKIN)) Then
SKIN_PATH = IIf(SKIN_PATH = DAY_SKIN, NIGHT_SKIN, DAY_SKIN)
Unload frmMP
'Unload All forms in order
t = UBound(Menus)
While t >= 0
If Menus(t).Tag = "destinator_gps.skin" And MMRunning Then Menus(t).Visible = True: DoEvents: Unload frmMM
If Menus(t).Tag = "mappoint_gps.skin" Then: S = "MapPoint"
Unload Menus(t)
t = t - 1
Wend
'Allows time for unloadings
DoEvents
'Now Load Menu
ReDim Menus(0)
Set Menus(0) = New frmSkin
LoadSkin SKIN_PATH, "menu.skin", Menus(0)
Menus(0).ShowForm
CurSCR = "menu.skin"
CallList = "menu.skin": CallCommands = "main"
ReloadList = True
End If
With F
'Application position/size (always show/hide window as prevention)
.
.
.
[frmLoader / Load]
.
.
.
Dim tmp As String
.
.
.
AUTO_SKIN = False
.
.
.
'Check if Skin path was saved, if so, restore it
t = GetINILine(MyPath + "resume.ini", 5)
If AUTO_SKIN Then
tmp = Format(time, "hhmm")
SKIN_PATH = IIf(tmp > DAY_START And tmp < NIGHT_START, DAY_SKIN, NIGHT_SKIN)
Else
If t <> "" And t <> "OVER" Then SKIN_PATH = t
End If.
.
.
[frmLoader / LoadSettings]
.
.
.
Case "autoskin"
AUTO_SKIN = Trim(dt(1))
Case "skinpath"
SKIN_PATH = Trim(dt(1))
If Right(SKIN_PATH, 1) <> "\" Then SKIN_PATH = SKIN_PATH + "\"
DAY_SKIN = SKIN_PATH
Case "daystart"
DAY_START = Trim(dt(1))
Case "nightskin"
NIGHT_SKIN = Trim(dt(1))
If Right(NIGHT_SKIN, 1) <> "\" Then NIGHT_SKIN = NIGHT_SKIN + "\"
Case "nightstart"
NIGHT_START = Trim(dt(1)).
.
.
[RR.ini]
.
.
.
autoskin=true
daystart=0600
nightstart=1800.
.
.
I'm not sure if you noticed but there are already settings for the switching times in general.ini (for each skin)... that ini is partially parsed on LoadSkin() ... this would allow different skins to be used on different times... also, there's no need to repeat the code to switch the skin on updatescreen... I'd recommend checking the time on the timer in frmskin and if the time has been reached just execute the "NIGHTSKIN" or "DAYSKIN" command to switch to the skin setup in RR.INI (set by RRConfig)... I do like the fact you have inniciative..![]()
Ride Runner RR's Myspace
"Being happy is not about having what you want, it's about wanting what you have."
"The best things in life are always free - but that doesn't mean money can't buy you good things."
guinoOriginally Posted by guino
thank you for your recommendation...
i like you new beta but i lost my new feature...![]()
i did change few things as you've recommended...
and now when AutoSkin changes skin it restores the current menu screen...
all procedures in this feature acts only if "autoskin" is set to "true"
can you implement these line in your next beta?
here we go again...
[modRoadRunner / Declarations]
.
.
.
Public AUTO_SKIN As Boolean 'Auto Skin by Time
Public DAY_SKIN As String 'Day Skin Path
Public DAY_START As String 'Day Skin Start Time
Public NIGHT_SKIN As String 'Night Skin Path
Public NIGHT_START As String 'Night Skin Start Time.
.
.
.
.
.
'Set Default Settings
AUTO_SKIN = False
.
.
[modRoadRunner / Exec]
.
.
.
Case "select"
If Frm.Tag = "skin_browser.skin" Then
'Switch Skin
SKIN_PATH = Frm.DL.Path + Frm.DL.Text + "\"
tmp = Format(time, "hhmm")
If LCase(SKIN_PATH) = LCase(IIf(tmp > DAY_START And tmp < NIGHT_START, DAY_SKIN, NIGHT_SKIN)) Then
AUTO_SKIN = True
Else
AUTO_SKIN = False
End If
'Garantee
Unload frmMP
.
.
.
'Set form name to go to
S = IIf(dt(1) = "dvd", "video_player.skin", dt(1))
'check autoskin and update skin
If AUTO_SKIN And S = "external_gps.skin" Then Call COMSend("FreeDrive", IIf(SKIN_PATH = DAY_SKIN, "DAY", "NIGHT"))
'Speak if text available and not already on this screen (i.e. from menu)
If UBound(dt) > 1 And InStr(1, CallList, S) = 0 Then Speak dt(2)
.
.
.
[frmLoader / Load]
.
.
.
Dim tmp As String
.
.
.
AUTO_SKIN = False
.
.
.
'Check if Skin path was saved, if so, restore it
t = GetINILine(MyPath + "resume.ini", 5)
'check if auto skin is on, if so apply skin by time set
If AUTO_SKIN Then
tmp = Format(time, "hhmm")
SKIN_PATH = IIf(tmp > DAY_START And tmp < NIGHT_START, DAY_SKIN, NIGHT_SKIN)
Else
If t <> "" And t <> "OVER" Then SKIN_PATH = t
End If
.
.
.
[frmLoader / LoadSettings]
.
.
.
Case "skinpath"
SKIN_PATH = Trim(dt(1))
If Right(SKIN_PATH, 1) <> "\" Then SKIN_PATH = SKIN_PATH + "\"
DAY_SKIN = SKIN_PATH
Case "nightskin"
NIGHT_SKIN = Trim(dt(1))
If Right(NIGHT_SKIN, 1) <> "\" Then NIGHT_SKIN = NIGHT_SKIN + "\"
Case "autoskin"
AUTO_SKIN = Trim(dt(1))
Case "daystart"
DAY_START = Trim(dt(1))
Case "nightstart"
NIGHT_START = Trim(dt(1))
.
.
.
[frmSkin / TimerUpdate]
.
.
.
'Make sure we're current screen
If CurSCR <> Me.Tag Or Not Me.Visible Then Exit Sub
'Check for time to switch AUTOSKIN
tmp = Format(time, "hhmm")
If AUTO_SKIN And LCase(SKIN_PATH) <> LCase(IIf(tmp > DAY_START And tmp < NIGHT_START, DAY_SKIN, NIGHT_SKIN)) Then
tmp = Menus(IsLoaded(CurSCR)).Tag
Call Exec(Chr(34) + IIf(SKIN_PATH = DAY_SKIN, "nightskin", "dayskin") + Chr(34), Menus(IsLoaded(CurSCR)))
Call Exec(Chr(34) + "load;" + tmp + Chr(34), Menus(IsLoaded(CurSCR)))
End If
'Load Tags (if needed)
If LazyTag Then PL_Scrolled
.
.
.
I'll definitely look into it.. I'm still not done with the changes... there's one more optimization I need to work on.. then I can probably fit your changes into it..
Ride Runner RR's Myspace
"Being happy is not about having what you want, it's about wanting what you have."
"The best things in life are always free - but that doesn't mean money can't buy you good things."
thank you...Originally Posted by guino
oh and i have a question...
you rr.exe is only 370kb...
how did you comile that small?
when i comile i get 1.5mb... (if native code)![]()
530Kb...(if P-Code)
i am using microsoft VB6 SP6...
let me know when you look into my code
i am keep changing to optimize it![]()
Guino
thank you again for your information...
i don't know how you like my idea to implement this feature...
here is what i did to boost volume by reading speed from FreeDrive...
also i add one more choice to bond master volume to wave together...
i had to change 'All Line' to -2 and Master&Wave to -1
can you put this item between 'All Lines' and 'Wave' and subtract 1 more for the value in RRConfig.exe?
setting will be located in
[DynEQ.ini]
.
.
VolBoost=true
OriginalVolMap=PC Speaker
DoubleAt=200
.
.
to enable this feature
add line 'VolBoost=true'
basically i map the original volume to 'PC Speaker'
any line not using will store original volume.
just pick one from the MapMasterVolume listed on RRConfig.exe
and the 'DoubleAt=200' sets the ratio which means volume will be doubled at speed of 200mph
so ideally, volume will be increased by 50% at 100mph and 25% at 50mph
[frmLoader / LoadDynEQ]
.
.
.
Case "minvol"
MinEQVol = Val(Trim(dt(1)))
Case "volboost"
VolBoost = CBool(Trim(dt(1)))
Case "originalvolmap"
OriginalVolMap = IDXName(dt(1))
Case "doubleat"
Ratio = Val(Trim(dt(1)))
Case Else
'EQ settings
If left(LCase(dt(0)), 2) = "eq" And Len(LCase(dt(0))) = 3 Then
EQMax(Val(Mid(dt(0), 3, 1))) = Val(Trim(dt(1)))
End If
End Select
.
.
.
[frmSkin / Timer]
.
.
.
If VolBoost Then SetDynVol MasterVolMap, OriginalVolMap
'Run Indicator Update (This function has built in control to run every .2 sec)
UpdateIndicators
.
.
.
[modMixer / Declarations]
.
.
.
'Master Volume is mapped into this line or including Master Volume (if -2) or ALL (if -2)
Public MasterVolMap As Integer
Public OriginalVolMap As Integer
Public VolBoost As Boolean ' Use Volume Boost by Speed ?
Public Ratio As Long
.
.
.
Public Sub DoVol(ByVal idx As Integer, Optional UP As Boolean = True)
Dim AllLines As Boolean
Dim Both As Boolean
Dim VolPct As Long
Dim tmp As Integer
'Get Current Volume info
GetMixerInfo
AllLines = (idx = -2)
Both = (idx = -1)
tmp = idx
idx = IIf(VolBoost, OriginalVolMap, Abs(idx))
'This will look "Funky" but this is a conditional For Loop!
If Not AllLines Then GoTo SingleLine
For idx = 0 To UBound(MixerState)
SingleLine:
.
.
.
If Not AllLines Then GoTo SingleLineEnd
Next idx
Exit Sub
SingleLineEnd:
If VolBoost Then
SetDynVol tmp, idx
ElseIf Both Then
MixerState(0).MxrVol = MixerState(Abs(idx)).MxrVol
AdjustOutput 0: GetMixerInfo
End If
End Sub
Public Sub SetDynVol(ByVal idx As Integer, ByVal ori As Integer)
Dim Both As Boolean
Both = (idx = -1)
MixerState(Abs(idx)).MxrVol = MixerState(ori).MxrVol * (1 / IIf(Ratio < 1, 1, Ratio) * COMSend("FDSDK", "REQUEST:FDSPEED:RoadRunner") + 1)
AdjustOutput Abs(idx): GetMixerInfo
If Both Then
MixerState(0).MxrVol = MixerState(Abs(idx)).MxrVol
AdjustOutput 0: GetMixerInfo
End If
End Sub
That's a good start, but there'll have to be settings for Min and Max vol range, Min and Max Speed Range.. and the desired Gain... otherwise I won't stop hearing complaints about it... There's also the fact that COMSend does not RETURN anything immediately it sends out a request and the response comes in whenever FD feels like sending it..
The Master&Wave setting is rather useless since you can MAP the master volume to ANY audio line (including Wave), basically doing the same thing..
The way this will have to work, is by FIRST verifying the data in the GPS Structure is VALID, and then IF Valid proceed with adjustments based on the GPS Speed (which can be obtained from FD)... this is so the feature works the same with Mappoint, MM and FD.. I have to ask CDR to send out GPS data to RR so I can parse it or at least send out if the GPS data is Valid or Invalid (no lock) so I can process it accordingly using lat/long/heading/speed info...
I do like that your iniciative though...
Ride Runner RR's Myspace
"Being happy is not about having what you want, it's about wanting what you have."
"The best things in life are always free - but that doesn't mean money can't buy you good things."
I have now integrated winamp control into freedrive 0.84, its wouldnt take much code to attach a volume control to the speed, but will be happy to send out any info required including the gps info. let me know how you want it.. ie comsend or some other way.
cheers
CdR
Bookmarks