Media player first buttons actions
This commit is contained in:
@@ -12,7 +12,6 @@ Page media_player
|
||||
|
||||
Events
|
||||
Preinitialize Event
|
||||
dim=brightness
|
||||
if(api==0)
|
||||
{
|
||||
page home
|
||||
@@ -62,6 +61,19 @@ Variable (string) lastclick
|
||||
Text :
|
||||
Max. Text Size: 255
|
||||
|
||||
Variable (string) va0
|
||||
Attributes
|
||||
ID : 24
|
||||
Scope : local
|
||||
Text :
|
||||
Max. Text Size: 10
|
||||
|
||||
Variable (int32) is_muted
|
||||
Attributes
|
||||
ID : 25
|
||||
Scope: local
|
||||
Value: 0
|
||||
|
||||
Text page_label
|
||||
Attributes
|
||||
ID : 1
|
||||
@@ -104,7 +116,13 @@ Text bt_vol_down
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_vol_down\", \"entity\": \""+entity.txt+"\"}"
|
||||
if(vol_slider.val>0)
|
||||
{
|
||||
vol_slider.val--
|
||||
covx vol_slider.val,va0.txt,0,0
|
||||
vol_text.txt=va0.txt+"%"
|
||||
timer0.en=1
|
||||
}
|
||||
printh 92
|
||||
prints "localevent",0
|
||||
printh 00
|
||||
@@ -124,7 +142,13 @@ Text bt_vol_up
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_vol_up\", \"entity\": \""+entity.txt+"\"}"
|
||||
if(vol_slider.val<100)
|
||||
{
|
||||
vol_slider.val++
|
||||
covx vol_slider.val,va0.txt,0,0
|
||||
vol_text.txt=va0.txt+"%"
|
||||
timer0.en=1
|
||||
}
|
||||
printh 92
|
||||
prints "localevent",0
|
||||
printh 00
|
||||
@@ -144,7 +168,14 @@ Text bt_mute
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_mute\", \"entity\": \""+entity.txt+"\"}"
|
||||
if(is_muted.val==1)
|
||||
{
|
||||
va0.txt="true"
|
||||
}else
|
||||
{
|
||||
va0.txt="false"
|
||||
}
|
||||
lastclick.txt="{\"page\": \"media_player\", \"key\": \"volume_mute\", \"value\": \""+va0.txt+"\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "localevent",0
|
||||
printh 00
|
||||
@@ -204,7 +235,7 @@ Text bt_prev
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_prev\", \"entity\": \""+entity.txt+"\"}"
|
||||
lastclick.txt="{\"page\": \"media_player\", \"key\": \"media_previous_track\", \"value\": \"\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "localevent",0
|
||||
printh 00
|
||||
@@ -224,7 +255,7 @@ Text bt_play_pause
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_play_pause\", \"entity\": \""+entity.txt+"\"}"
|
||||
lastclick.txt="{\"page\": \"media_player\", \"key\": \"media_play_pause\", \"value\": \"\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "localevent",0
|
||||
printh 00
|
||||
@@ -244,7 +275,7 @@ Text bt_stop
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_stop\", \"entity\": \""+entity.txt+"\"}"
|
||||
lastclick.txt="{\"page\": \"media_player\", \"key\": \"media_stop\", \"value\": \"\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "localevent",0
|
||||
printh 00
|
||||
@@ -264,7 +295,7 @@ Text bt_next
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_next\", \"entity\": \""+entity.txt+"\"}"
|
||||
lastclick.txt="{\"page\": \"media_player\", \"key\": \"media_next_track\", \"value\": \"\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "localevent",0
|
||||
printh 00
|
||||
@@ -284,7 +315,7 @@ Text bt_on_off
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_on_off\", \"entity\": \""+entity.txt+"\"}"
|
||||
lastclick.txt="{\"page\": \"media_player\", \"key\": \"toggle\", \"value\": \"\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "localevent",0
|
||||
printh 00
|
||||
@@ -312,6 +343,9 @@ Slider vol_slider
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
covx vol_slider.val,va0.txt,0,0
|
||||
vol_text.txt=va0.txt+"%"
|
||||
timer0.en=1
|
||||
printh 91
|
||||
prints "touchevent",0
|
||||
printh 00
|
||||
@@ -347,3 +381,46 @@ Button button_back
|
||||
page home
|
||||
}
|
||||
|
||||
Timer wakeup_timer
|
||||
Attributes
|
||||
ID : 22
|
||||
Scope : local
|
||||
Period (ms): 100
|
||||
Enabled : yes
|
||||
|
||||
Events
|
||||
Timer Event
|
||||
if(dim<brightness)
|
||||
{
|
||||
dimdelta=brightness-dim
|
||||
dimdelta/=10
|
||||
if(dimdelta<1)
|
||||
{
|
||||
dimdelta=1
|
||||
}
|
||||
dim+=dimdelta
|
||||
}else
|
||||
{
|
||||
wakeup_timer.en=0
|
||||
}
|
||||
|
||||
Timer timer0
|
||||
Attributes
|
||||
ID : 23
|
||||
Scope : local
|
||||
Period (ms): 1000
|
||||
Enabled : no
|
||||
|
||||
Events
|
||||
Timer Event
|
||||
timer0.en=0
|
||||
covx vol_slider.val,va0.txt,0,0
|
||||
vol_text.txt=va0.txt+"%"
|
||||
lastclick.txt="{\"page\": \"media_player\", \"key\": \"volume_set\", \"value\": "+va0.txt+", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "localevent",0
|
||||
printh 00
|
||||
prints lastclick.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user