MCPcopy Create free account
hub / github.com/ActiveState/code / dec_timer

Function dec_timer

recipes/JavaScript/578517_Music_player/recipe-578517.js:1240–1293  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1238}
1239
1240function dec_timer()
1241{
1242 if (b_making_word_list==true)
1243 {
1244 regenerate_word_list();
1245 }
1246
1247 if (g_busy_searching==false && g_busy_sorting==false)
1248 {
1249 var es=document.getElementById("txtstat");
1250 var s="";
1251 s=smart_play_state();
1252 es.innerHTML=play_state_str(s);
1253
1254 if (s=="10")
1255 {
1256 if (g_second_delay<10)
1257 {
1258 if (g_second_delay<=4)
1259 {
1260 move_current_position(0);
1261 }
1262 g_second_delay++;
1263 if (g_second_delay==4)
1264 {
1265 var em=document.getElementById("embplay");
1266 em.controls.play();
1267 set_mute(); // Make sure it doesn't come off mute when it switches songs.
1268 }
1269 }
1270 }
1271
1272 if (s!="3" && s!="2" && g_enable==true)
1273 {
1274 play_next_sound();
1275 }
1276 if (s=="3")
1277 {
1278 g_enable=true;
1279 show_current_position();
1280 }
1281 else
1282 {
1283 // In case it hits an audio file that is really short.
1284 if (g_user_play==true)
1285 {
1286 g_seconds_not_playing++;
1287 if (g_seconds_not_playing>8)
1288 play_next_sound();
1289 }
1290 }
1291 } // if busy && busy
1292 Timer=setTimeout("dec_timer()", 300);
1293}
1294
1295
1296function play_next_sound()

Callers 1

do_all_initFunction · 0.85

Calls 7

smart_play_stateFunction · 0.85
play_state_strFunction · 0.85
move_current_positionFunction · 0.85
set_muteFunction · 0.85
play_next_soundFunction · 0.85
show_current_positionFunction · 0.85
playMethod · 0.45

Tested by

no test coverage detected