It is currently August 20th, 2019, 1:02 pm

Help with play button in ClearText?

Help with creating, editing & fixing problems with skins
User avatar
jabberwooh
Posts: 2
Joined: February 7th, 2019, 4:18 am

Help with play button in ClearText?

jabberwooh » February 9th, 2019, 6:19 am

The Cleartext audio skin is amazing, and I love it, but when not playing any music, I'd like to replace the skin with a functioning play button so the skin isn't empty when no audio is playing. I've created a mockup here

From this: https://imgur.com/P9W17t6
To this: https://imgur.com/pkOzjF2

Again, I only want this visible when no music is playing. I can figure out the code to replace an image with another easily, but my concern is that it should be functioning as a play button and launch the standard Cleartext layout when clicked.

The deafault code for Cleartext is here:

Code: Select all

[Rainmeter]
Update=1000
MouseOverAction=[!ShowMeterGroup Hover][!ShowMeterGroup #stowAwayName#][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!HideMeterGroup Hover][!HideMeterGroup #stowAwayName#][!UpdateMeter *][!Redraw]
AccurateText=1
DynamicWindowSize=1
SkinHeight=(#skinSize#*0.25)

ContextTitle=Open Settings panel
ContextAction=!ActivateConfig "Cleartext\Settings"
ContextTitle2=Use Cleartext Pure
ContextAction2=!ActivateConfig "Cleartext"

[Metadata]
Name=Cleartext
Author=Redsaph
Description=Displays track information from various media players.
Version=5.1.1
License=Creative Commons BY-NC-SA 3.0

[Variables]
@include=#@#base.ini
currentlySetAlign=right


; STYLES ==========================================
[styleTextControls]
FontFace=#controlsFont#
FontSize=(#skinSize#*0.027)
AntiAlias=1
FontColor=#translucent#
StringAlign=#interfaceTextAlignment#
DynamicVariables=1
Hidden=1
Group=Hover | Visible
MouseActionCursor=1

[styleTextMini]
FontFace=#controlsFont#
FontSize=(#skinSize#*0.0175)
AntiAlias=1
FontColor=#opaque#
StringAlign=#interfaceTextAlignment#
DynamicVariables=1
Hidden=1
Group=Hover | Visible

[styleTextMajor]
H=(#skinSize#*0.085)
FontSize=(#skinSize#*0.0625)
FontColor=#opaque#
AntiAlias=1
Group=Visible

; =================================================
; Meters

[LuaSettings]
Measure=Script
ScriptFile=#@#settings.lua


[mTopTextWidth]
Measure=Calc
Formula=[TopText:W]
OnChangeAction=[!WriteKeyValue Variables topTextWidth "[mTopTextWidth]" "#@#variables.inc"]
DynamicVariables=1
Group=AlignmentMeasure

[mBottomTextWidth]
Measure=Calc
Formula=[BottomText:W]
OnChangeAction=[!WriteKeyValue Variables bottomTextWidth "[mBottomTextWidth]" "#@#variables.inc"][!CommandMeasure "LuaAlign" "alignRightOnUpdate()"]
DynamicVariables=1
Group=AlignmentMeasure

[LuaAlign]
Measure=Script
ScriptFile=#@#align.lua
UpdateDivider=8
DynamicVariables=1

[Background]
Meter=Image
X=0
Y=0
W=((#skinSize# > #lastSetWidth#) ? (#skinSize#+(#skinSize#*0.35)) : (#lastSetWidth#+(#skinSize#*0.35)))
H=(#skinSize#*0.25)
SolidColor=0,0,0,1
DynamicVariables=1
Group=Visible

[Now]
Meter=String
Text=Now
StringCase=Upper
StringAlign=#interfaceTextAlignment#
FontSize=(#skinSize#*0.03)
FontColor=#opaque#
X=#nowTextPositionHor#
Y=(#skinSize#*0.09)
AntiAlias=1
FontFace=#controlsFont#
UpdateDivider=-1
Hidden=#stowAway#
Group=Stow | Visible

[Playing]
Meter=String
Text=Playing
StringCase=Upper
StringAlign=#interfaceTextAlignment#
FontSize=(#skinSize#*0.03)
FontColor=#opaque#
X=r
Y=(#skinSize#*0.125)
AntiAlias=1
FontFace=#controlsFont#
UpdateDivider=-1
Hidden=#stowAway#
Group=Stow | Visible

[Hairline]
Meter=Bar
MeasureName=mProgress#MusicSwitch#P
X=#hairlinePositionHor#
W=(#skinSize#*0.005)
H=(#skinSize#*0.25)
BarColor=#over#
SolidColor=#opaque#
BarOrientation=Vertical
ToolTipText="Progress Bar"
UpdateDivider=4
Hidden=#stowAway#
Group=Stow | Visible

[TopText]
Meter=String
MeterStyle=styleTextMajor
MeasureName=#topText##MusicSwitch#
X=#topTextPositionHor#
Y=(#skinSize#*0.14)
FontFace=#thinFont#
Text="%1" 
StringAlign=#mediaTextAlignment#

[BottomText]
Meter=String 
MeterStyle=styleTextMajor
MeasureName=#bottomText##MusicSwitch#
X=r
Y=R
FontFace=#thickFont#
Text="%1" 
StringAlign=#mediaTextAlignment#

[Time]
Meter=STRING
MeterStyle=styleTextMini
MeasureName=mPosition#MusicSwitch#
MeasureName2=mLength#MusicSwitch#
X=#nowTextPositionHor#
Y=(#skinSize#*0.02)
Text="%1/%2"
UpdateDivider=4

[Progress]
Meter=String
MeterStyle=styleTextMini
MeasureName=mProgress#MusicSwitch#W
X=r
Y=(#skinSize#*0.0465)
Text="%1%"

[Play]
MeterStyle=styleTextControls
Meter=String
MeasureName=mStateButton#MusicSwitch#
X=#playCtrlPositionHor#
Y=(#skinSize#*0.2)
Text="%1"
LeftMouseUpAction=!CommandMeasure "m#playerController#" "PlayPause"
UpdateDivider=4
SolidColor=0,0,0,1

[Previous]
MeterStyle=styleTextControls
Meter=String
X=#nowTextPositionHor#
Y=(#skinSize#*0.17)
Text="previous"
LeftMouseUpAction=!CommandMeasure "m#playerController#" "Previous"
UpdateDivider=-1

[Next]
MeterStyle=styleTextControls
Meter=String
X=#nowTextPositionHor#
Y=(#skinSize#*0.2)
Text="next"
LeftMouseUpAction=!CommandMeasure "m#playerController#" "Next"
UpdateDivider=-1
SolidColor=0,0,0,1

[Settings]
Meter=String
MeterStyle=styleTextMini
FontColor=#translucent#
X=#settingsTextPositionHor#
Y=(#skinSize#*0.0465)
Text="settings"
MouseActionCursor=1
LeftMouseUpAction=!ActivateConfig "Cleartext\Settings"
UpdateDivider=-1
Last edited by balala on February 9th, 2019, 6:48 am, edited 1 time in total.
Reason: Please use [code] tags when posting code snippets. It's the </> button.
User avatar
balala
Rainmeter Sage
Posts: 8534
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with play button in ClearText?

balala » February 9th, 2019, 7:00 am

The posted code doesn't help too much, because it has a lot of unknown variables and probably some not posted measures as well. I suppose they are in the included base.ini file (just as a side not, usually the included files should have to be .inc, not .ini files - but probably this depends on the author of the original skin).
The best would be to pack the whole config you are working with and upload it. Would be much easier for us to help you.
User avatar
Mor3bane
Posts: 584
Joined: May 7th, 2016, 7:32 am

Re: Help with play button in ClearText?

Mor3bane » February 9th, 2019, 5:40 pm

I'll post a code mock up maybe it will help you figure it out easier.

!Show, !Hide, !Toggle Parameter: Config
Shows or hides an active skin.
Config (optional)

Example: !Toggle "illustro\Clock"

The mini skin would simply be a picture that would have LeftMouseDownAction=<playername> (path may be required or another !toggle bang)
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself