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,15 +61,16 @@ Variable (string) lastclick
|
||||
Text :
|
||||
Max. Text Size: 255
|
||||
|
||||
Variable (int32) va_current
|
||||
Variable (string) va0
|
||||
Attributes
|
||||
ID : 23
|
||||
Scope: local
|
||||
Value: 0
|
||||
ID : 24
|
||||
Scope : local
|
||||
Text :
|
||||
Max. Text Size: 10
|
||||
|
||||
Variable (int32) va_total
|
||||
Variable (int32) is_muted
|
||||
Attributes
|
||||
ID : 24
|
||||
ID : 25
|
||||
Scope: local
|
||||
Value: 0
|
||||
|
||||
@@ -116,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
|
||||
@@ -136,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
|
||||
@@ -156,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
|
||||
@@ -216,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
|
||||
@@ -236,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
|
||||
@@ -256,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
|
||||
@@ -276,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
|
||||
@@ -296,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
|
||||
@@ -324,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
|
||||
@@ -359,18 +381,46 @@ Button button_back
|
||||
page home
|
||||
}
|
||||
|
||||
Timer tm_progress
|
||||
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
|
||||
if(va_current.val<va_total.val)
|
||||
{
|
||||
va_current.val++
|
||||
//covx time_progress.val,target_temp.txt,0,0
|
||||
}
|
||||
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