• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/sound/isa/gus/

Lines Matching defs:voice

32 static void interrupt_wave(struct snd_gus_card *gus, struct snd_gus_voice *voice);
33 static void interrupt_volume(struct snd_gus_card *gus, struct snd_gus_voice *voice);
34 static void interrupt_effect(struct snd_gus_card *gus, struct snd_gus_voice *voice);
36 static void sample_start(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_position_t position);
37 static void sample_stop(struct snd_gus_card *gus, struct snd_gus_voice *voice, int mode);
38 static void sample_freq(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_frequency_t freq);
39 static void sample_volume(struct snd_gus_card *card, struct snd_gus_voice *voice, struct snd_seq_ev_volume *volume);
40 static void sample_loop(struct snd_gus_card *card, struct snd_gus_voice *voice, struct snd_seq_ev_loop *loop);
41 static void sample_pos(struct snd_gus_card *card, struct snd_gus_voice *voice, snd_seq_position_t position);
42 static void sample_private1(struct snd_gus_card *card, struct snd_gus_voice *voice, unsigned char *data);
55 static void do_volume_envelope(struct snd_gus_card *card, struct snd_gus_voice *voice);
56 static void do_pan_envelope(struct snd_gus_card *card, struct snd_gus_voice *voice);
62 static void interrupt_wave(struct snd_gus_card *gus, struct snd_gus_voice *voice)
65 snd_gf1_stop_voice(gus, voice->number);
67 snd_gf1_select_voice(gus, voice->number);
70 voice->flags &= ~SNDRV_GF1_VFLG_RUNNING;
74 static void interrupt_volume(struct snd_gus_card *gus, struct snd_gus_voice *voice)
77 if (voice->flags & SNDRV_GF1_VFLG_RUNNING)
78 do_volume_envelope(gus, voice);
80 snd_gf1_stop_voice(gus, voice->number);
84 static void interrupt_effect(struct snd_gus_card *gus, struct snd_gus_voice *voice)
87 if ((voice->flags & (SNDRV_GF1_VFLG_RUNNING|SNDRV_GF1_VFLG_EFFECT_TIMER1)) ==
89 do_pan_envelope(gus, voice);
97 static void do_volume_envelope(struct snd_gus_card *gus, struct snd_gus_voice *voice)
105 snd_gf1_select_voice(gus, voice->number);
107 snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, voice->gf1_volume);
108 /* printk("gf1_volume = 0x%x\n", voice->gf1_volume); */
117 switch (voice->venv_state) {
119 voice->venv_state = VENV_ATTACK;
120 voice->venv_value_next = 0;
122 snd_gf1_select_voice(gus, voice->number);
128 voice->venv_state = VENV_SUSTAIN;
134 voice->venv_state = VENV_RELEASE;
136 snd_gf1_select_voice(gus, voice->number);
138 snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, ((int)voice->gf1_volume * (int)voice->venv_value_next) / 255);
142 voice->venv_state = VENV_DONE;
148 snd_gf1_stop_voice(gus, voice->number);
149 voice->flags &= ~SNDRV_GF1_VFLG_RUNNING;
153 next = voice->venv_value_next;
155 voice->venv_state = voice->venv_state_prev;
158 voice->venv_value_next = next;
162 snd_gf1_select_voice(gus, voice->number);
169 next = (((int)voice->gf1_volume * (int)next) / 255) >> 8;
180 voice->volume_control &= ~0xc3;
181 voice->volume_control |= 0x20;
185 voice->volume_control |= 0x40;
191 snd_gf1_write8(gus, SNDRV_GF1_VB_VOLUME_CONTROL, voice->volume_control);
194 snd_gf1_write8(gus, SNDRV_GF1_VB_VOLUME_CONTROL, voice->volume_control);
201 static void do_pan_envelope(struct snd_gus_card *gus, struct snd_gus_voice *voice)
207 voice->flags &= ~(SNDRV_GF1_VFLG_EFFECT_TIMER1|SNDRV_GF1_VFLG_PAN);
212 snd_gf1_select_voice(gus, voice->number);
213 snd_gf1_write8(gus, SNDRV_GF1_VB_PAN, voice->gf1_pan);
217 if (!(voice->flags & SNDRV_GF1_VFLG_PAN)) /* before */
218 voice->flags |= SNDRV_GF1_VFLG_EFFECT_TIMER1|SNDRV_GF1_VFLG_PAN;
220 snd_gf1_select_voice(gus, voice->number);
222 if (old_pan > voice->gf1_pan )
224 if (old_pan < voice->gf1_pan)
228 if (old_pan == voice->gf1_pan) /* the goal was reached */
229 voice->flags &= ~(SNDRV_GF1_VFLG_EFFECT_TIMER1|SNDRV_GF1_VFLG_PAN);
232 static void set_enhanced_pan(struct snd_gus_card *gus, struct snd_gus_voice *voice, unsigned short pan)
246 snd_gf1_select_voice(gus, voice->number);
250 voice->vlo = vlo;
251 voice->vro = vro;
258 static void sample_start(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_position_t position)
266 instr = snd_seq_instr_find(gus->gf1.ilist, &voice->instr, 0, 1);
269 voice->instr = instr->instr; /* copy ID to speedup aliases */
286 voice->control = 0x00;
287 voice->mode = 0x20; /* enable offset registers */
289 voice->control |= 0x04;
291 voice->control |= 0x40;
293 voice->control |= 0x08;
295 voice->control |= 0x20;
298 voice->control |= 0x10;
300 voice->mode |= 0x40;
309 snd_gf1_stop_voice(gus, voice->number);
311 snd_gf1_select_voice(gus, voice->number);
312 snd_gf1_write16(gus, SNDRV_GF1_VW_FREQUENCY, voice->fc_register + voice->fc_lfo);
313 voice->venv_state = VENV_BEFORE;
314 voice->volume_control = 0x03;
319 snd_gf1_write8(gus, SNDRV_GF1_VB_PAN, voice->gf1_pan);
321 snd_gf1_write16(gus, SNDRV_GF1_VW_OFFSET_LEFT, voice->vlo);
322 snd_gf1_write16(gus, SNDRV_GF1_VW_OFFSET_LEFT_FINAL, voice->vlo);
323 snd_gf1_write16(gus, SNDRV_GF1_VW_OFFSET_RIGHT, voice->vro);
324 snd_gf1_write16(gus, SNDRV_GF1_VW_OFFSET_RIGHT_FINAL, voice->vro);
325 snd_gf1_write8(gus, SNDRV_GF1_VB_ACCUMULATOR, voice->effect_accumulator);
326 snd_gf1_write16(gus, SNDRV_GF1_VW_EFFECT_VOLUME, voice->gf1_effect_volume);
327 snd_gf1_write16(gus, SNDRV_GF1_VW_EFFECT_VOLUME_FINAL, voice->gf1_effect_volume);
330 do_volume_envelope(gus, voice);
332 snd_gf1_select_voice(gus, voice->number);
334 snd_gf1_write8(gus, SNDRV_GF1_VB_MODE, voice->mode);
335 snd_gf1_write8(gus, SNDRV_GF1_VB_ADDRESS_CONTROL, voice->control);
338 snd_gf1_write8(gus, SNDRV_GF1_VB_ADDRESS_CONTROL, voice->control );
341 voice->flags |= SNDRV_GF1_VFLG_RUNNING;
345 static void sample_stop(struct snd_gus_card *gus, struct snd_gus_voice *voice, int mode)
350 if (!(voice->flags & SNDRV_GF1_VFLG_RUNNING))
355 if (voice->venv_state < VENV_RELEASE) {
356 voice->venv_state = VENV_RELEASE;
357 do_volume_envelope(gus, voice);
361 snd_gf1_stop_voice(gus, voice->number);
363 snd_gf1_select_voice(gus, voice->number);
366 voice->flags &= ~SNDRV_GF1_VFLG_RUNNING;
371 snd_gf1_select_voice(gus, voice->number);
381 static void sample_freq(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_frequency_t freq)
386 voice->fc_register = snd_gf1_translate_freq(gus, freq);
387 snd_gf1_select_voice(gus, voice->number);
388 snd_gf1_write16(gus, SNDRV_GF1_VW_FREQUENCY, voice->fc_register + voice->fc_lfo);
392 static void sample_volume(struct snd_gus_card *gus, struct snd_gus_voice *voice, struct snd_seq_ev_volume *volume)
396 voice->gf1_volume = snd_gf1_lvol_to_gvol_raw(volume->volume << 2) << 4;
397 voice->venv_state_prev = VENV_SUSTAIN;
398 voice->venv_state = VENV_VOLUME;
399 do_volume_envelope(gus, voice);
404 voice->gf1_pan = (volume->lr >> 10) & 15;
406 if (voice->gf1_pan == 0)
407 voice->gf1_pan++;
408 if (voice->gf1_pan == 15)
409 voice->gf1_pan--;
411 voice->flags &= ~SNDRV_GF1_VFLG_PAN; /* before */
412 do_pan_envelope(gus, voice);
414 set_enhanced_pan(gus, voice, volume->lr >> 7);
419 static void sample_loop(struct snd_gus_card *gus, struct snd_gus_voice *voice, struct snd_seq_ev_loop *loop)
422 int w_16 = voice->control & 0x04;
427 instr = snd_seq_instr_find(gus->gf1.ilist, &voice->instr, 0, 1);
430 voice->instr = instr->instr; /* copy ID to speedup aliases */
438 snd_gf1_select_voice(gus, voice->number);
445 static void sample_pos(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_position_t position)
448 int w_16 = voice->control & 0x04;
453 instr = snd_seq_instr_find(gus->gf1.ilist, &voice->instr, 0, 1);
456 voice->instr = instr->instr; /* copy ID to speedup aliases */
461 snd_gf1_select_voice(gus, voice->number);
468 static void sample_private1(struct snd_gus_card *card, struct snd_gus_voice *voice, unsigned char *data)
473 void snd_gf1_simple_init(struct snd_gus_voice *voice)
475 voice->handler_wave = interrupt_wave;
476 voice->handler_volume = interrupt_volume;
477 voice->handler_effect = interrupt_effect;
478 voice->volume_change = NULL;
479 voice->sample_ops = &sample_ops;