Lines Matching refs:turtle
638 if( session->turtle.isClockEnabled )
639 turtleCheckClock( session, &session->turtle );
752 struct tr_turtle_info * turtle = &session->turtle;
893 /* update the turtle mode's fields */
895 turtle->speedLimit_Bps[TR_UP] = toSpeedBytes( i );
897 turtle->speedLimit_Bps[TR_DOWN] = toSpeedBytes( i );
899 turtle->beginMinute = i;
901 turtle->endMinute = i;
903 turtle->days = i;
905 turtle->isClockEnabled = boolVal;
907 turtle->isEnabled = boolVal;
908 turtleBootstrap( session, turtle );
1295 struct tr_turtle_info * t = &session->turtle;
1324 * @return whether turtle should be on/off according to the scheduler
1365 tr_inf( "Time to turn %s turtle mode!", (enabled?"on":"off") );
1371 /* Called after the turtle's fields are loaded from an outside source.
1373 * and turns on turtle mode if the clock settings say to. */
1375 turtleBootstrap( tr_session * session, struct tr_turtle_info * turtle )
1377 turtle->changedByUser = false;
1378 turtle->autoTurtleState = TR_AUTO_SWITCH_UNUSED;
1380 tr_bitfieldConstruct( &turtle->minutes, MINUTES_PER_WEEK );
1382 turtleUpdateTable( turtle );
1384 if( turtle->isClockEnabled )
1386 turtle->isEnabled = getInTurtleTime( turtle );
1387 turtle->autoTurtleState = autoSwitchState( turtle->isEnabled );
1459 s->turtle.speedLimit_Bps[d] = Bps;
1476 return s->turtle.speedLimit_Bps[d];
1487 tr_dbg( "Refreshing the turtle mode clock due to user changes" );
1504 struct tr_turtle_info * t = &s->turtle;
1520 return s->turtle.isClockEnabled;
1529 if( s->turtle.beginMinute != minute ) {
1530 s->turtle.beginMinute = minute;
1531 userPokedTheClock( s, &s->turtle );
1540 return s->turtle.beginMinute;
1549 if( s->turtle.endMinute != minute ) {
1550 s->turtle.endMinute = minute;
1551 userPokedTheClock( s, &s->turtle );
1560 return s->turtle.endMinute;
1568 if( s->turtle.days != days ) {
1569 s->turtle.days = days;
1570 userPokedTheClock( s, &s->turtle );
1579 return s->turtle.days;
1585 useAltSpeed( session, &session->turtle, enabled, true );
1593 return s->turtle.isEnabled;
1603 session->turtle.callback = func;
1604 session->turtle.callbackUserData = userData;
1867 tr_bitfieldDestruct( &session->turtle.minutes );