EXPORT_C TInt CAknNoteWrapper::ExecuteLD(TInt aResId, const TDesC& aPrompt) { TAknNoteResData resData = ReadResDataAndPrepareL(aResId); SetTextL(aPrompt); if (iTimeoutInMicroseconds == -1) { SetTimeout(resData.iTimeout); } if (iTone == STATIC_CAST(TTone,-1)) { SetTone(resData.iTone); } return RunLD(); }
void BattleAnimation::DrawAt(int x, int y) { if (IsDone()) { return; } if (!GetVisible()) { return; } const RPG::AnimationFrame& anim_frame = animation.frames[frame]; std::vector<RPG::AnimationCellData>::const_iterator it; for (it = anim_frame.cells.begin(); it != anim_frame.cells.end(); ++it) { const RPG::AnimationCellData& cell = *it; if (!cell.valid) { // Skip unused cells (they are created by deleting cells in the // animation editor, resulting in gaps) continue; } SetX(cell.x + x); SetY(cell.y + y); int sx = cell.cell_id % 5; int sy = cell.cell_id / 5; int size = large ? 128 : 96; SetSrcRect(Rect(sx * size, sy * size, size, size)); SetOx(size / 2); SetOy(size / 2); SetTone(Tone(cell.tone_red * 128 / 100, cell.tone_green * 128 / 100, cell.tone_blue * 128 / 100, cell.tone_gray * 128 / 100)); SetOpacity(255 * (100 - cell.transparency) / 100); SetZoomX(cell.zoom / 100.0); SetZoomY(cell.zoom / 100.0); Sprite::Draw(); } if (anim_frame.cells.empty()) { // Draw an empty sprite when no cell is available in the animation SetSrcRect(Rect(0, 0, 0, 0)); Sprite::Draw(); } }
void VarioSynthesiser::SetVario(unsigned sample_rate, fixed vario) { mutex.lock(); const int ivario = Clamp((int)(vario * 100), min_vario, max_vario); if (dead_band_enabled && InDeadBand(ivario)) { /* inside the "dead band" */ UnsafeSetSilence(); mutex.unlock(); return; } /* update the ToneSynthesiser base class */ SetTone(sample_rate, VarioToFrequency(ivario)); if (ivario > 0) { /* while climbing, the vario sound gets interrupted by silence periodically */ const unsigned period_ms = sample_rate * (min_period_ms + (max_vario - ivario) * (max_period_ms - min_period_ms) / max_vario) / 1000; silence_count = period_ms / 3; audible_count = period_ms - silence_count; /* preserve the old "_remaining" values as much as possible, to avoid chopping off the previous tone */ if (audible_remaining > audible_count) audible_remaining = audible_count; if (silence_remaining > silence_count) silence_remaining = silence_count; } else { /* continuous tone while sinking */ audible_count = 1; silence_count = 0; } mutex.unlock(); }
static int dvbfe_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t arg) { DECLARE_DEV; DBG_fCDVBFE("calling \n"); return SetTone(p->context, arg); }