//}}} //{{{ GetSpeed HavanaStatus_t HavanaPlayback_c::GetSpeed(int* PlaySpeed) { PlayerStatus_t Status; PlayDirection_t Direction; Rational_t Speed; Status = Player->GetPlaybackSpeed(PlayerPlayback, &Speed, &Direction); if (Status != PlayerNoError) { PLAYBACK_ERROR("Failed to get speed - Status = %x\n", Status); return HavanaError; } PLAYBACK_DEBUG("Getting speed of %d.%06d\n", Speed.IntegerPart(), Speed.RemainderDecimal()); *PlaySpeed = (int)IntegerPart(Speed * PLAY_SPEED_NORMAL_PLAY); if (((*PlaySpeed) == PLAY_SPEED_STOPPED) && (Direction != PlayForward)) *PlaySpeed = PLAY_SPEED_REVERSE_STOPPED; else if (Direction != PlayForward) *PlaySpeed = -*PlaySpeed; return HavanaNoError; }
var Round(Var x) { return IntegerPart(x); }
var Ceiling(Var x) { return IntegerPart(x); }
var Floor(Var x) { return IntegerPart(x); }