It is currently May 19th, 2024, 10:38 am

Enigma Question for iTunes and Calendar

Get help with creating, editing & fixing problems with skins
TheSquall
Posts: 7
Joined: July 1st, 2010, 6:20 am

Enigma Question for iTunes and Calendar

Post by TheSquall »

Hello, I have two questions for the customization of the Enigma skin.

The first deals with the calendar. I'm currently using Calendar+ for the sidebar and I haven't done too much customization to it. I had a problem though (and this is really just due to my OCD). I am attempting to get the days to show a leading zero if they are less than 10 (ie July 1st will show 01 on the calendar). Due to this doing a lot of formulas, the date is showing based on math, instead of just doing a Measure=time in which I could easily add the leading zero. Does anyone have a fix to be able to add the leading zeros?

[SOLVED] The second question involved the iTunes plugins. I was noticing that whenever a song was not playing or if iTunes were not open, a time of 0.00 is showing. Is there a way to either make that disappear or say "iTunes Closed" or something of the nature? I know there's the ability to replace strings, but I don't believe it's possible to do with the plugin meter.


Any help on either of these subjects would be greatly appreciated. Thank you for your time.
Last edited by TheSquall on July 1st, 2010, 1:12 pm, edited 1 time in total.
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Enigma Question for iTunes and Calendar

Post by Chewtoy »

Got nothing for the calendar, unless you are willing to use a totaly different calendar that's very much not like the one you have.

The iTunes "problem" could perhaps be solved with a calc.
If you measure the totalt length of a track, and check if it's greater than 0, you could make it respond to when it is zero.
ie

Code: Select all

[MTrackLength]
Measure=Plugin
Plugin=Plugins\iTunesPlugin.dll
Command=GetCurrentTrackTime

[CalcCheck]
Measure=Calc
Formula=MTrackLength < 0 ? 0 : 3
IfBelowValue=1
IfBelowaction=!Execute [!RainmeterShowNeter TrackInfo][!RainmeterHideMeter NotPlaying][!RainmeterRedraw]
IfAboveValue=2
IfAboveAction=!Execute [!RainmeterHideMeter TrackInfo][!RainmeterShowMeter NotPlaying][!RainmeterRedraw]
I am uncertain whether GetCurrentTrackTime returns value in seconds or not.
If it does, it should work ok I guess. What it really does if to check it the value is greater than 0, if it does it displays the info you want.
If not, it hides it and displays what ever meter you tell it to.

Alternativly, you could replace the GetCurrentTrackTime with GetPlayerPosition. That will however not work until you've come a bit in the the track. After ~2s it should say it's playing a track.
I don't think, therefore I'm not.
TheSquall
Posts: 7
Joined: July 1st, 2010, 6:20 am

Re: Enigma Question for iTunes and Calendar

Post by TheSquall »

Thanks for your post. I got it to do basically what I want using that. It's not the prettiest thing, but it works how I want it to.

Code: Select all

[Background]
Meter=IMAGE
SolidColor=0,0,0,2
X=25
Y=0
W=30
H=30

[Track]
Meter=STRING
MeasureName=MeasureTrack
X=0
Y=0
W=280
H=15
ClipString=1
FontColor=#Color1#
FontFace=#Font#
FontSize=#Height3#
StringStyle=NORMAL
StringAlign=LEFT
AntiAlias=1

[Artist]
Meter=STRING
MeasureName=MeasureArtist
MeasureName2=MeasureTMinute
MeasureName3=MeasureTZero
MeasureName4=MeasureTSecond
Text="%2.%3%4 | %1"
X=r
Y=15r
H=15
W=280
ClipString=1
FontColor=#Color2#
FontFace=#Font#
FontSize=#Height2#
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1

[NotPlaying2]
Meter=STRING
X=0
Y=0
W=280
H=15
ClipString=1
FontColor=#Color1#
FontFace=#Font#
FontSize=#Height3#
StringStyle=NORMAL
StringAlign=LEFT
AntiAlias=1
Text="iTunes"

[NotPlaying1]
Meter=STRING
MeterStyle=StyleText
X=r
Y=15r
H=15
W=280
ClipString=1
FontColor=#Color2#
FontFace=#Font#
FontSize=#Height2#
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
Text="Not Playing"

[PlayingCheck]
Measure=Calc
Formula=MeasureTime = 0 ? 0 : -1
IfBelowValue=0
IfBelowAction=!Execute [!RainmeterShowMeter Artist][!RainmeterShowMeter Track][!RainmeterHideMeter NotPlaying1][!RainmeterHideMeter NotPlaying2][!RainmeterRedraw]
IfEqualValue=0
IfEqualAction=!Execute [!RainmeterHideMeter Artist][!RainmeterHideMeter Track][!RainmeterShowMeter NotPlaying1][!RainmeterShowMeter NotPlaying2][!RainmeterRedraw]
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Enigma Question for iTunes and Calendar

Post by smurfier »

For the calendar try this, take the calculated date, divide by 100, then add the following substitute (or append if I remember what I did to that calendar):

Substitute="0.":""
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
TheSquall
Posts: 7
Joined: July 1st, 2010, 6:20 am

Re: Enigma Question for iTunes and Calendar

Post by TheSquall »

smurfier wrote:For the calendar try this, take the calculated date, divide by 100, then add the following substitute (or append if I remember what I did to that calendar):

Substitute="0.":""
I hate to sound stupid, but do you mind putting it in context? Here's some code for the first Thursday of a month (conveniently today)

Code: Select all

[cDay04]
;Thursday in week 1
Measure=calc
Formula=5-FLOOR((5*mYear)/4)-cMonthCode+(2*cCentury)-7*FLOOR((5-FLOOR((5*mYear)/4)-cMonthCode+(2*cCentury))/7)

[cDay04b]
Measure=calc
Formula=(cMonthStart <= 5) ? cDay04 : (cDay04 > 0 ? mDayCount2 + (cDay04 - 7) : mDayCount2)

[cDay04Draw]
Measure=calc
Formula=(cMonthStart <= 5) ? 1 :(#E.Days# = 0 ? 0 : -1)
IfBelowValue=0
IfBelowAction=!Execute [!RainmeterHideMeter mDay04][!RainmeterShowMeter mDay04b][!RainmeterEnableMeasure cDay04b]
IfAboveValue=0
IfAboveAction=!Execute [!RainmeterShowMeter mDay04][!RainmeterHideMeter mDay04b][!RainmeterEnableMeasure cDay04b]
IfEqualValue=0
IfEqualAction=!Execute [!RainmeterHideMeter mDay04][!RainmeterHideMeter mDay04b][!RainmeterDisableMeasure cDay04b]

[mDay04]
Meter=string
MeasureName=cDay04b
X=#pTh.x#
Y=#pW1.y#
MeterStyle=TextStyle
FontColor=#Text.Color#

[mDay04b]
Meter=string
MeasureName=cDay04b
X=#pTh.x#
Y=#pW1.y#
MeterStyle=TextStyle
FontColor=#Text.Color2#
Thanks
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Enigma Question for iTunes and Calendar

Post by smurfier »

So, I guess I forgot that everyone else doesn't have the current version of Calendar+. Here is the newest version with the feature you requested:

Code: Select all

[Rainmeter]
Author=hatbocs@gmail.com
AppVersion=1001000
;Update the calendar every .5 seconds
Update=500
BackgroundMode=2
SolidColor=0,0,0,1
BevelType=0
LeftMouseDoubleClickAction=!RainmeterActivateConfig #CURRENTCONFIG# Calendar-Week.ini

[Metadata]
Name=Calendar | Month
Config=Enigma | Sidebar | Calendar
Description=This visual calendar skin displays dates and weekdays. | The "Week" variant shows only this week.
Version=2.7
Tags=Time | Sidebar | Calendar
Variant=3
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Preview=#SKINSPATH#Enigma\Resources\Images\Preview.png

;==========================================================
[Variables]
;Enigma Universal Variables
@include=#SKINSPATH#Enigma\Resources\Variables\UserVariables.inc
;Set to 0 for no day indicator, 1 for horizontal line, 2 for highlighted text, 3 for both
Ind=2
Highlight.Color=255,255,255,255
;Horizontal date indicator, 0 for off, 1 for current week only, 2 for weekday only, 3 for both
Ind2=3
Line.Color=255,255,255,20
;General text formatting
;Color for regular text
Text.Color=#Color2#
;Color for extra days and horizontal line day indicator
Text.Color2=#ColorUpload#
;With these options- 0 to disable, 1 to enable
;Enable or Disable extra days on Calendar
E.Days=1
;Enable or Disable the last week when it is not part of the current month.
Last.Wk=1
;Endable or Disable leading zeros for days less than 10.
Lead.Zero=0
;Align weekday x
;Aligns each column vertically. These values are for the right side.
pSu.x=18
pMo.x=43
pTu.x=72
pWe.x=99
pTh.x=125
pFr.x=152
pSa.x=178
;Align week y
;Aligns the days horizontally along each row
pW1.y=33
pW2.y=53
pW3.y=73
pW4.y=93
pW5.y=113
pW6.y=133
;Color substitute string
Color.Sub="-1":"#Text.Color#","-2":"#Text.Color2#","-3":"#Highlight.Color#"

;Meter Styles =========================================

[LabelBGStyle]
Y=13
W=16
H=16
SolidColor=255, 255, 255, 25

[LabelStyle]
Y=15
FontColor=#Color1#
FontFace=Trebuchet MS
FontSize=8
stringAlign=center
stringStyle=normal
AntiAlias=1

[TextStyle]
FontColor=#Text.Color#
FontFace=Trebuchet MS
FontSize=10
stringAlign=center
stringStyle=normal
AntiAlias=1
Numofdecimals=[cLeadZero]
DynamicVariables=1

;Measures ==============================================
[mYear]
;Retreve year with century
Measure=TIME
Format=%Y

[cCentury]
;mod(century , 4)
Measure=CALC
Formula=(TRUNC(mYear/100)%4)

[cYear]
;separate year from century
measure=CALC
Formula=FRAC(mYear/100)*100
Substitute=".0":""

[mMonth]
;Gets current month without leading zero. ex: 8
Measure=TIME
Format=%#m

[mDay]
;Gets current day without leading zero. ex 8
Measure=TIME
Format=%#d

[mWeek]
Measure=TIME
Format=%#w

[cLeapYear]
;Returns 1 if leap year or 0 if not
Measure=CALC
Formula=((cYear%4 = 0) && (cYear%100 <> 0) || (cYear%400 = 0))

[cMonthCode]
;Turns month "code" according to notes
Measure=CALC
Formula=((mMonth=3)||(mMonth=11))?3:(((mMonth=4)||(mMonth = 7))?6:((mMonth=5)?1:((mMonth=6)?4:((mMonth=8)?2:(((mMonth=9)||(mMonth=12))?5:((mMonth=10)?0:(cLeapYear?((mMonth=1)?6:2):((mMonth=1)?0:3))))))))

[cMonthStartDay]
;Determines which day of the week a month starts. Used in week one to turn off days not in the current month
Measure=CALC
Formula=(FLOOR((5*cYear)/4)+cMonthCode+1-(2*cCentury))%7

[cMonthStart]
;Used to help determine day a month starts. If the day of the week is 0 or Saturday then return 7 (for day 7 in a traditional sense) otherwise return the other "coded" day of the week.
Measure=CALC
Formula=(cMonthStartDay = 0) ? 7 : cMonthStartDay

[mDayCount]
Measure=CALC
Formula=(mMonth=1)*31+(mMonth=2)*(28+((mYear%4)=0))+(mMonth=3)*31+(mMonth=4)*30+(mMonth=5)*31+(mMonth=6)*30+(mMonth=7)*31+(mMonth=8)*31+(mMonth=9)*30+(mMonth=10)*31+(mMonth=11)*30+(mMonth=12)*31

[mDayCount2]
Measure=CALC
Formula=(mMonth=1)*31+(mMonth=2)*31+(mMonth=3)*(28+((mYear%4)=0))+(mMonth=4)*31+(mMonth=5)*30+(mMonth=6)*31+(mMonth=7)*30+(mMonth=8)*31+(mMonth=9)*31+(mMonth=10)*30+(mMonth=11)*31+(mMonth=12)*30

[cWeekNumA]
Measure=CALC
Formula=7-(cMonthStart-1)

[cWeekNum]
Measure=Calc
Formula=(mDay<=cWeekNumA)*1+((mDay>cWeekNumA)&&(mDay<=(cWeekNumA+7)))*2+((mDay>(cWeekNumA+7))&&(mDay<=(cWeekNumA+14)))*3 +((mDay>(cWeekNumA+14))&&(mDay<=(cWeekNumA+21)))*4+((mDay>(cWeekNumA+21))&&(mDay<=(cWeekNumA+28)))*5+((mDay>(cWeekNumA+28))&&(mDay<=(cWeekNumA+35)))*6

[cYPos]
Measure=CALC
Formula=-cWeekNum
Substitute="-1":"#pW1.y#","-2":"#pW2.y#","-3":"#pW3.y#","-4":"#pW4.y#","-5":"#pW5.y#","-6":"#pW6.y#"

[cXPos]
Measure=CALC
Formula=(mWeek=0)*#pSu.x#+(mWeek=1)*#pMo.x#+(mWeek=2)*#pTu.x#+(mWeek=3)*#pWe.x#+(mWeek=4)*#pTh.x#+(mWeek=5)*#pFr.x#+(mWeek=6)*#pSa.x#

[cHideLW]
Measure=Calc
Formula=(CEIL((cMonthStart+mDayCount)/7) < 6) && (#Last.Wk#=0) ? 1 : 0

[cLeadZero]
Measure=calc
Formula=#Lead.Zero#=1?2:0

[cZeroDiv]
Measure=Calc
Formula=#Lead.Zero#=1?100:1

;Day of Month Indicator------------------------------------
[cHideWeek]
Measure=Calc
Formula=(#Ind2#=0)+(#Ind2#=2)

[cHideDay]
Measure=Calc
Formula=(#Ind2#<2)

[HLWeek]
Meter=Image
X=(#pSu.x#-16)
Y=[cYPos]
SolidColor=#Line.Color#
H=16
W=(#pSa.x#-(#pSu.x#-16))
;W=176
Hidden=[cHideWeek]
DynamicVariables=1

[HLWeekDay]
Meter=Image
X=([cXPos]-16)
Y=29
SolidColor=#Line.Color#
H=([cHideLW]?104:124)
W=16
Hidden=[cHideDay]
DynamicVariables=1

[HLShow]
Measure=Calc
Formula=(#Ind#=0)||(#Ind#=2)

[TodayHL]
Meter=image
X=([cXPos]-13)
Y=([cYPos]+14)
H=2
W=10
SolidColor=#Text.Color2#
Hidden=[HLShow]
DynamicVariables=1

;Week 1 Begin----------------------------------------------
[cDay00]
;Sunday in week 1
;r = a - n [a/n] where a%n
;Checks if day is less than month start if less than then hide
Measure=calc
Formula=1-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury)-7*FLOOR((1-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury))/7)

[cDay00b]
Measure=calc
Formula=(cMonthStart<=1)?cDay00/cZeroDiv:(#E.Days#?(mDayCount2+(cDay00-7)*(cDay00>0))/cZeroDiv:-1)
Substitute="0.":"","-1":""

[cDay00Color]
Measure=Calc
Formula=(cMonthStart<=1)?((cDay00=mDay)&&(#Ind#>=2)?-3:-1):-2
Substitute=#Color.Sub#

[mDay00]
Meter=string
MeasureName=cDay00b
X=(#pSu.x#-8)
Y=#pW1.y#
MeterStyle=TextStyle
FontColor=[cDay00Color]

[cDay01]
;Monday in week 1
Measure=calc
Formula=2-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury)-7*FLOOR((2-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury))/7)

[cDay01b]
Measure=calc
Formula=(cMonthStart<=2)?cDay01/cZeroDiv:(#E.Days#?(mDayCount2+(cDay01-7)*(cDay01>0))/cZeroDiv:-1)
Substitute="0.":"","-1":""

[cDay01Color]
Measure=Calc
Formula=(cMonthStart<=2)?((cDay01=mDay)&&(#Ind#>=2)?-3:-1):-2
Substitute=#Color.Sub#

[mDay01]
Meter=string
MeasureName=cDay01b
X=(#pMo.x#-8)
Y=#pW1.y#
MeterStyle=TextStyle
FontColor=[cDay01Color]

[cDay02]
;Tuesday in week 1
Measure=calc
Formula=3-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury)-7*FLOOR((3-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury))/7)

[cDay02b]
Measure=calc
Formula=(cMonthStart<=3)?cDay02/cZeroDiv:(#E.Days#?(mDayCount2+(cDay02-7)*(cDay02>0))/cZeroDiv:-1)
Substitute="0.":"","-1":""

[cDay02Color]
Measure=Calc
Formula=(cMonthStart<=3)?((cDay02=mDay)&&(#Ind#>=2)?-3:-1):-2
Substitute=#Color.Sub#

[mDay02]
Meter=string
MeasureName=cDay02b
X=(#pTu.x#-8)
Y=#pW1.y#
MeterStyle=TextStyle
FontColor=[cDay02Color]

[cDay03]
;Wednesday in week 1
Measure=calc
Formula=4-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury)-7*FLOOR((4-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury))/7)

[cDay03b]
Measure=calc
Formula=(cMonthStart<=4)?cDay03/cZeroDiv:(#E.Days#?(mDayCount2+(cDay03-7)*(cDay03>0))/cZeroDiv:-1)
Substitute="0.":"","-1":""

[cDay03Color]
Measure=Calc
Formula=(cMonthStart<=4)?((cDay03=mDay)&&(#Ind#>=2)?-3:-1):-2
Substitute=#Color.Sub#

[mDay03]
Meter=string
MeasureName=cDay03b
X=(#pWe.x#-8)
Y=#pW1.y#
MeterStyle=TextStyle
FontColor=[cDay03Color]

[cDay04]
;Thursday in week 1
Measure=calc
Formula=5-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury)-7*FLOOR((5-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury))/7)

[cDay04b]
Measure=calc
Formula=(cMonthStart<=5)?cDay04/cZeroDiv:(#E.Days#?(mDayCount2+(cDay04-7)*(cDay04>0))/cZeroDiv:-1)
Substitute="0.":"","-1":""

[cDay04Color]
Measure=Calc
Formula=(cMonthStart<=5)?((cDay04=mDay)&&(#Ind#>=2)?-3:-1):-2
Substitute=#Color.Sub#

[mDay04]
Meter=string
MeasureName=cDay04b
X=(#pTh.x#-8)
Y=#pW1.y#
MeterStyle=TextStyle
FontColor=[cDay04Color]

[cDay05]
;Friday in week 1
Measure=calc
Formula=6-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury)-7*FLOOR((6-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury))/7)

[cDay05b]
Measure=calc
Formula=(cMonthStart<=6)?cDay05/cZeroDiv:(#E.Days#?(mDayCount2+(cDay05-7)*(cDay05>0))/cZeroDiv:-1)
Substitute="0.":"","-1":""

[cDay05Color]
Measure=Calc
Formula=(cMonthStart<=6)?((cDay05=mDay)&&(#Ind#>=2)?-3:-1):-2
Substitute=#Color.Sub#

[mDay05]
Meter=string
MeasureName=cDay05b
X=(#pFr.x#-8)
Y=#pW1.y#
MeterStyle=TextStyle
FontColor=[cDay05Color]

[cDay06]
;Saturday in week 1
Measure=calc
Formula=(0-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury)-7*FLOOR((0-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury))/7)) = 0 ? 7 : (0-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury)-7*FLOOR((0-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury))/7))

[cDay06b]
Measure=Calc
Formula=cDay06/cZeroDiv
Substitute="0.":""

[cDay06Color]
Measure=Calc
Formula=(cDay06=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay06]
Meter=string
MeasureName=cDay06b
X=(#pSa.x#-8)
Y=#pW1.y#
MeterStyle=TextStyle
FontColor=[cDay06Color]

;Week 2 Begin----------------------------------------------
[cDay10]
;Sunday in week 2
;Try simply adding 1 to Day06
;No need to worry about calculating if day exists until 28th
Measure=calc
Formula=cDay06+1

[cDay10b]
Measure=calc
Formula=cDay10/cZeroDiv
Substitute="0.":""

[cDay10Color]
Measure=Calc
Formula=(cDay10=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay10]
Meter=string
MeasureName=cDay10b
X=(#pSu.x#-8)
Y=#pW2.y#
MeterStyle=TextStyle
FontColor=[cDay10Color]

[cDay11]
;Monday in week 2
;Try simply adding 1 to previous
Measure=calc
Formula=cDay10+1

[cDay11b]
Measure=calc
Formula=cDay11/cZeroDiv
Substitute="0.":""

[cDay11Color]
Measure=Calc
Formula=(cDay11=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay11]
Meter=string
MeasureName=cDay11b
X=(#pMo.x#-8)
Y=#pW2.y#
MeterStyle=TextStyle
FontColor=[cDay11Color]

[cDay12]
;Tuesday in week 2
Measure=calc
Formula=cDay11+1

[cDay12b]
Measure=calc
Formula=cDay12/cZeroDiv
Substitute="0.":""

[cDay12Color]
Measure=Calc
Formula=(cDay12=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay12]
Meter=string
MeasureName=cDay12b
X=(#pTu.x#-8)
Y=#pW2.y#
MeterStyle=TextStyle
FontColor=[cDay12Color]

[cDay13]
;Wednesday in week 2
Measure=calc
Formula=cDay12+1

[cDay13b]
Measure=calc
Formula=cDay13/cZeroDiv
Substitute="0.":""

[cDay13Color]
Measure=Calc
Formula=(cDay13=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay13]
Meter=string
MeasureName=cDay13b
X=(#pWe.x#-8)
Y=#pW2.y#
MeterStyle=TextStyle
FontColor=[cDay13Color]

[cDay14]
;Thursday in week 2
Measure=calc
Formula=cDay13+1

[cDay14b]
Measure=calc
Formula=cDay14/cZeroDiv
Substitute="0.":""

[cDay14Color]
Measure=Calc
Formula=(cDay14=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay14]
Meter=string
MeasureName=cDay14b
X=(#pTh.x#-8)
Y=#pW2.y#
MeterStyle=TextStyle
FontColor=[cDay14Color]

[cDay15]
;Friday in week 2
Measure=calc
Formula=cDay14+1

[cDay15b]
Measure=calc
Formula=cDay15/cZeroDiv
Substitute="0.":""

[cDay15Color]
Measure=Calc
Formula=(cDay15=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay15]
Meter=string
MeasureName=cDay15b
X=(#pFr.x#-8)
Y=#pW2.y#
MeterStyle=TextStyle
FontColor=[cDay15Color]

[cDay16]
;Saturday in week 2
Measure=calc
Formula=cDay15+1

[cDay16b]
Measure=calc
Formula=cDay16/cZeroDiv
Substitute="0.":""

[cDay16Color]
Measure=Calc
Formula=(cDay16=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay16]
Meter=string
MeasureName=cDay16b
X=(#pSa.x#-8)
Y=#pW2.y#
MeterStyle=TextStyle
FontColor=[cDay16Color]

;Week 3 Begin----------------------------------------------
[cDay20]
;Sunday in week 3
;Keep adding one
;No need to worry about calculating if day exists until 28th
Measure=calc
Formula=cDay16 + 1

[cDay20b]
Measure=calc
Formula=cDay20/cZeroDiv
Substitute="0.":""

[cDay20Color]
Measure=Calc
Formula=(cDay20=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay20]
Meter=string
MeasureName=cDay20b
X=(#pSu.x#-8)
Y=#pW3.y#
MeterStyle=TextStyle
FontColor=[cDay20Color]

[cDay21]
;Monday in week 3
Measure=calc
Formula=cDay20 + 1

[cDay21Color]
Measure=Calc
Formula=(cDay21=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay21]
Meter=string
MeasureName=cDay21
X=(#pMo.x#-8)
Y=#pW3.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay21Color]

[cDay22]
;Tuesday in week 3
Measure=calc
Formula=cDay21 + 1

[cDay22Color]
Measure=Calc
Formula=(cDay22=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay22]
Meter=string
MeasureName=cDay22
X=(#pTu.x#-8)
Y=#pW3.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay22Color]

[cDay23]
;Wednesday in week 3
Measure=calc
Formula=cDay22 + 1

[cDay23Color]
Measure=Calc
Formula=(cDay23=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay23]
Meter=string
MeasureName=cDay23
X=(#pWe.x#-8)
Y=#pW3.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay23Color]

[cDay24]
;Thursday in week 3
Measure=calc
Formula=cDay23 + 1

[cDay24Color]
Measure=Calc
Formula=(cDay24=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay24]
Meter=string
MeasureName=cDay24
X=(#pTh.x#-8)
Y=#pW3.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay24Color]

[cDay25]
;Friday in week 3
Measure=calc
Formula=cDay24 + 1

[cDay25Color]
Measure=Calc
Formula=(cDay25=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay25]
Meter=string
MeasureName=cDay25
X=(#pFr.x#-8)
Y=#pW3.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay25Color]

[cDay26]
;Saturday in week 3
Measure=calc
Formula=cDay25 + 1

[cDay26Color]
Measure=Calc
Formula=(cDay26=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay26]
Meter=string
MeasureName=cDay26
X=(#pSa.x#-8)
Y=#pW3.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay26Color]

;Week 4 Begin----------------------------------------------
[cDay30]
;Sunday in Week 4
;Keep adding one
;No need to worry about calculating if day exists until 28th
Measure=calc
Formula=cDay26 + 1

[cDay30Color]
Measure=Calc
Formula=(cDay30=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay30]
Meter=string
MeasureName=cDay30
X=(#pSu.x#-8)
Y=#pW4.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay30Color]

[cDay31]
;Monday in Week 4
Measure=calc
Formula=cDay30 + 1

[cDay31Color]
Measure=Calc
Formula=(cDay31=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay31]
Meter=string
MeasureName=cDay31
X=(#pMo.x#-8)
Y=#pW4.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay31Color]

[cDay32]
;Tuesday in Week 4
Measure=calc
Formula=cDay31 + 1

[cDay32Color]
Measure=Calc
Formula=(cDay32=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay32]
Meter=string
MeasureName=cDay32
X=(#pTu.x#-8)
Y=#pW4.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay32Color]

[cDay33]
;Wednesday in Week 4
Measure=calc
Formula=cDay32 + 1

[cDay33Color]
Measure=Calc
Formula=(cDay33=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay33]
Meter=string
MeasureName=cDay33
X=(#pWe.x#-8)
Y=#pW4.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay33Color]

[cDay34]
;Thursday in Week 4
Measure=calc
Formula=cDay33 + 1

[cDay34Color]
Measure=Calc
Formula=(cDay34=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay34]
Meter=string
MeasureName=cDay34
X=(#pTh.x#-8)
Y=#pW4.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay34Color]

[cDay35]
;Friday in Week 4
Measure=calc
Formula=cDay34 + 1

[cDay35Color]
Measure=Calc
Formula=(cDay35=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay35]
Meter=string
MeasureName=cDay35
X=(#pFr.x#-8)
Y=#pW4.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay35Color]

[cDay36]
;Saturday in Week 4
Measure=calc
Formula=cDay35 + 1

[cDay36Color]
Measure=Calc
Formula=(cDay36=mDay)&&(#Ind#>=2)?-3:-1
Substitute=#Color.Sub#

[mDay36]
Meter=string
MeasureName=cDay36
X=(#pSa.x#-8)
Y=#pW4.y#
MeterStyle=TextStyle
NumofDecimals=0
FontColor=[cDay36Color]

[cDay40];Week 5 Begin----------------------------------------------
;Sunday in Week 5
;28th likely to occur so test for 28th
Measure=calc
Formula=cDay36 + 1

[cDay40b]
Measure=calc
Formula=cDay40>mDayCount?(#E.Days#?(cDay40-mDayCount)/cZeroDiv:-1):cDay40/cZeroDiv
Substitute="0.":"","-1":""

[cDay40Color]
Measure=Calc
Formula=(cDay40 > mDayCount) ? -2 : ((cDay40=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay40]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay40b
X=(#pSu.x#-8)
Y=#pW5.y#
FontColor=[cDay40Color]

[cDay41]
;Monday in Week 5
Measure=calc
Formula=cDay40 + 1

[cDay41b]
Measure=calc
Formula=cDay41>mDayCount?(#E.Days#?(cDay41-mDayCount)/cZeroDiv:-1):cDay41/cZeroDiv
Substitute="0.":"","-1":""

[cDay41Color]
Measure=Calc
Formula=(cDay41 > mDayCount) ? -2 : ((cDay41=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay41]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay41b
X=(#pMo.x#-8)
Y=#pW5.y#
FontColor=[cDay41Color]

[cDay42]
;Tuesday in Week 5
Measure=calc
Formula=cDay41 + 1

[cDay42b]
Measure=calc
Formula=cDay42>mDayCount?(#E.Days#?(cDay42-mDayCount)/cZeroDiv:-1):cDay42/cZeroDiv
Substitute="0.":"","-1":""

[cDay42Color]
Measure=Calc
Formula=(cDay42 > mDayCount) ? -2 : ((cDay42=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay42]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay42b
X=(#pTu.x#-8)
Y=#pW5.y#
FontColor=[cDay42Color]

[cDay43]
;Wednesday in Week 5
Measure=calc
Formula=cDay42 + 1

[cDay43b]
Measure=calc
Formula=cDay43>mDayCount?(#E.Days#?(cDay43-mDayCount)/cZeroDiv:-1):cDay43/cZeroDiv
Substitute="0.":"","-1":""

[cDay43Color]
Measure=Calc
Formula=(cDay43 > mDayCount) ? -2 : ((cDay43=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay43]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay43b
X=(#pWe.x#-8)
Y=#pW5.y#
FontColor=[cDay43Color]

[cDay44]
;Thursday in Week 5
Measure=calc
Formula=cDay43 + 1

[cDay44b]
Measure=calc
Formula=cDay44>mDayCount?(#E.Days#?(cDay44-mDayCount)/cZeroDiv:-1):cDay44/cZeroDiv
Substitute="0.":"","-1":""

[cDay44Color]
Measure=Calc
Formula=(cDay44 > mDayCount) ? -2 : ((cDay44=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay44]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay44b
X=(#pTh.x#-8)
Y=#pW5.y#
FontColor=[cDay44Color]

[cDay45]
;Friday in Week 5
Measure=calc
Formula=cDay44 + 1

[cDay45b]
Measure=calc
Formula=cDay45>mDayCount?(#E.Days#?(cDay45-mDayCount)/cZeroDiv:-1):cDay45/cZeroDiv
Substitute="0.":"","-1":""

[cDay45Color]
Measure=Calc
Formula=(cDay45 > mDayCount) ? -2 : ((cDay45=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay45]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay45b
X=(#pFr.x#-8)
Y=#pW5.y#
FontColor=[cDay45Color]

[cDay46]
;Saturday in Week 5
Measure=calc
Formula=cDay45 + 1

[cDay46b]
Measure=calc
Formula=cDay46>mDayCount?(#E.Days#?(cDay46-mDayCount)/cZeroDiv:-1):cDay46/cZeroDiv
Substitute="0.":"","-1":""

[cDay46Color]
Measure=Calc
Formula=(cDay45>mDayCount)?-2:((cDay46=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay46]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay46b
X=(#pSa.x#-8)
Y=#pW5.y#
FontColor=[cDay46Color]

;Week 6 Begin----------------------------------------------
[cDay50]
;Sunday in Week 6
;28th likely to occur so test for 28th
Measure=calc
Formula=cDay46 + 1

[cDay50b]
Measure=calc
Formula=cDay50>mDayCount?(#E.Days#?(cHideLW?-1:(cDay50-mDayCount)/cZeroDiv):-1):cDay50/cZeroDiv
Substitute="0.":"","-1":""

[cDay50Color]
Measure=Calc
Formula=(cDay50 > mDayCount) ? -2 : ((cDay50=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay50]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay50b
X=(#pSu.x#-8)
Y=#pW6.y#
FontColor=[cDay50Color]

[cDay51]
;Monday in Week 6
Measure=calc
Formula=cDay50 + 1

[cDay51b]
Measure=calc
Formula=cDay51>mDayCount?(#E.Days#?(cHideLW?-1:(cDay51-mDayCount)/cZeroDiv):-1):cDay51/cZeroDiv
Substitute="0.":"","-1":""

[cDay51Color]
Measure=Calc
Formula=(cDay51 > mDayCount) ? -2 : ((cDay51=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay51]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay51b
X=(#pMo.x#-8)
Y=#pW6.y#
FontColor=[cDay51Color]

[cDay52]
;Tuesday in Week 6
Measure=calc
Formula=cDay51 + 1

[cDay52b]
Measure=calc
Formula=cDay52>mDayCount?(#E.Days#?(cHideLW?-1:(cDay52-mDayCount)/cZeroDiv):-1):cDay52/cZeroDiv
Substitute="0.":"","-1":""

[cDay52Color]
Measure=Calc
Formula=(cDay52 > mDayCount) ? -2 : ((cDay52=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay52]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay52b
X=(#pTu.x#-8)
Y=#pW6.y#
FontColor=[cDay52Color]

[cDay53]
;Wednesday in Week 6
Measure=calc
Formula=cDay52 + 1

[cDay53b]
Measure=calc
Formula=cDay53>mDayCount?(#E.Days#?(cHideLW?-1:(cDay53-mDayCount)/cZeroDiv):-1):cDay53/cZeroDiv
Substitute="0.":"","-1":""

[cDay53Color]
Measure=Calc
Formula=(cDay53 > mDayCount) ? -2 : ((cDay53=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay53]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay53b
X=(#pWe.x#-8)
Y=#pW6.y#
FontColor=[cDay53Color]

[cDay54]
;Thursday in Week 6
Measure=calc
Formula=cDay53 + 1

[cDay54b]
Measure=calc
Formula=cDay54>mDayCount?(#E.Days#?(cHideLW?-1:(cDay54-mDayCount)/cZeroDiv):-1):cDay54/cZeroDiv
Substitute="0.":"","-1":""

[cDay54Color]
Measure=Calc
Formula=(cDay54 > mDayCount) ? -2 : ((cDay54=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay54]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay54b
X=(#pTh.x#-8)
Y=#pW6.y#
FontColor=[cDay54Color]

[cDay55]
;Friday in Week 6
Measure=calc
Formula=cDay54 + 1

[cDay55b]
Measure=calc
Formula=cDay55>mDayCount?(#E.Days#?(cHideLW?-1:(cDay55-mDayCount)/cZeroDiv):-1):cDay55/cZeroDiv
Substitute="0.":"","-1":""

[cDay55Color]
Measure=Calc
Formula=(cDay55 > mDayCount) ? -2 : ((cDay55=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay55]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay55b
X=(#pFr.x#-8)
Y=#pW6.y#
FontColor=[cDay55Color]

[cDay56]
;Saturday in Week 6
Measure=calc
Formula=cDay55 + 1

[cDay56b]
Measure=calc
Formula=cDay56>mDayCount?(#E.Days#?(cHideLW?-1:(cDay56-mDayCount)/cZeroDiv):-1):cDay56/cZeroDiv
Substitute="0.":"","-1":""

[cDay56Color]
Measure=Calc
Formula=(cDay56 > mDayCount) ? -2 : ((cDay56=mDay)&&(#Ind#>=2)?-3:-1)
Substitute=#Color.Sub#

[mDay56]
Meter=string
MeterStyle=TextStyle
MeasureName=cDay56b
X=(#pSa.x#-8)
Y=#pW6.y#
FontColor=[cDay56Color]

[heightDummy]
;Used to keep other skins from snapping to the bottom of an unused week
Meter=image
X=0
Y=#pW6.y#
W=10
H=18
SolidColor=0,0,0,0

;Day Labels-------------------------------------------------
[lSun]
Meter=string
Text="S"
X=(#pSu.x#-8)
;X=7
MeterStyle=LabelStyle

[lMon]
Meter=string
Text="M"
X=(#pMo.x#-8)
MeterStyle=LabelStyle

[lTues]
Meter=string
Text="T"
X=(#pTu.x#-8)
MeterStyle=LabelStyle

[lWed]
Meter=string
Text="W"
X=(#pWe.x#-8)
MeterStyle=LabelStyle

[lThur]
Meter=string
Text="R"
X=(#pTh.x#-8)
MeterStyle=LabelStyle

[lFri]
Meter=string
Text="F"
X=(#pFr.x#-8)
MeterStyle=LabelStyle

[lSat]
Meter=string
Text="S"
X=(#pSa.x#-8)
MeterStyle=LabelStyle

;Day Label BG===============================================
[lSunBG]
Meter=image
MeterStyle=LabelBGStyle
X=(#pSu.x#-16)

[lMonBG]
Meter=image
MeterStyle=LabelBGStyle
X=(#pMo.x#-16)

[lTuesBG]
Meter=image
MeterStyle=LabelBGStyle
X=(#pTu.x#-16)

[lWedBG]
Meter=image
MeterStyle=LabelBGStyle
X=(#pWe.x#-16)

[lThurBG]
Meter=image
MeterStyle=LabelBGStyle
X=(#pTh.x#-16)

[lFriBG]
Meter=image
MeterStyle=LabelBGStyle
X=(#pFr.x#-16)

[lSatBG]
Meter=image
MeterStyle=LabelBGStyle
X=(#pSa.x#-16)

[Border]
Meter=IMAGE
SolidColor=#ColorBorder#
X=0
Y=0
W=180
H=1
Hidden=1

[BottomBorder]
Meter=Image
SolidColor=#ColorBorder#
X=0
Y=([cHideLW]?#pW5.y#+20:#pW6.y#+20)
W=180
H=1
DynamicVariables=1
Last edited by smurfier on July 3rd, 2010, 6:43 pm, edited 2 times in total.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
TheSquall
Posts: 7
Joined: July 1st, 2010, 6:20 am

Re: Enigma Question for iTunes and Calendar

Post by TheSquall »

Code: Select all

[cDay05]
;Friday in week 1
Measure=calc
Formula=6-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury)-7*FLOOR((6-FLOOR((5*cYear)/4)-cMonthCode+(2*cCentury))/7)

[cDay05b]
Measure=calc
Formula=(cMonthStart<=6)?cDay05/100:(#E.Days#?(mDayCount2+(cDay05-7)*(cDay05>0))/100:-1)
Substitute="0.":"","-1":""

[cDay05Color]
Measure=Calc
Formula=(cMonthStart<=6)?((cDay05=mDay)&&(#Ind#>=2)?-3:-1):-2
Substitute=#Color.Sub#

[mDay05]
Meter=string
MeasureName=cDay05b
X=#pFr.x#
Y=#pW1.y#
MeterStyle=TextStyle
FontColor=[cDay05Color]
I see where you put the substitute. But I'm not 100% sure this does what I'm asking it to do. I guess the best thing I can ask is this:
Is there anyway to put a:

Code: Select all

Formula=(cDayxx<10)?("this is where I want to say append a 0 then have cDayxx):cDayxx
anywhere in there?

Thanks again :D
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Enigma Question for iTunes and Calendar

Post by smurfier »

If you want to add a zero in front of every number less than 10, well, that code makes sure every number is a two digit number, adding a zero on front if necessary. You take the number, divide by 100, substitute out the "0.", and add NumofDecimals=2 to the string meter.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
TheSquall
Posts: 7
Joined: July 1st, 2010, 6:20 am

Re: Enigma Question for iTunes and Calendar

Post by TheSquall »

Oh, I get it.. Here we go:

Code: Select all

[cDay04b]
Measure=calc
Formula=FRAC(((cMonthStart <= 5) ? cDay04 : (cDay04 > 0 ? mDayCount2 + (cDay04 - 7) : mDayCount2))/100)
Substitute="0.":""
Thanks so much!
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Enigma Question for iTunes and Calendar

Post by smurfier »

Not a problem. I just updated the code above. The leading zero is now an option in the variables section, and I made a small edit since it is not necessary to add a zero to all numbers since most will be greater than 10. There are also a couple different options for how to identify the current date.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .