Example #1
0
void mixer_set_mixing_level(int ch, int level)
{
	struct mixer_channel_data *channel = &mixer_channel[ch];

	mixer_update_channel(channel, sound_scalebufferpos(samples_this_frame));
	channel->mixing_level = level;
}
Example #2
0
void mixer_set_volume(int ch, int volume)
{
	struct mixer_channel_data *channel = &mixer_channel[ch];

	mixer_update_channel(channel, sound_scalebufferpos(samples_this_frame));
	channel->volume = volume;
}
Example #3
0
void TMS3617_doupdate(void)
{
	int newpos;


	newpos = sound_scalebufferpos(buffer_len);	/* get current position based on the timer */

	TMS3617_update(&output_buffer[sample_pos],newpos - sample_pos);
	sample_pos = newpos;
}
Example #4
0
/* min_interval is in usec */
void stream_update(int channel,int min_interval)
{
	int newpos;
	int buflen;


	if (Machine->sample_rate == 0 || stream_buffer[channel] == 0)
		return;

	/* get current position based on the timer */
	newpos = sound_scalebufferpos(SAMPLES_THIS_FRAME(channel));

	buflen = newpos - stream_buffer_pos[channel];

	if (buflen * stream_sample_length[channel] > min_interval)
	{
		if (stream_joined_channels[channel] > 1)
		{
			INT16 *buf[MIXER_MAX_CHANNELS];
			int i;


			for (i = 0;i < stream_joined_channels[channel];i++)
				buf[i] = stream_buffer[channel+i] + stream_buffer_pos[channel+i];

			profiler_mark(PROFILER_SOUND);
			(*stream_callback_multi[channel])(stream_param[channel],buf,buflen);
			profiler_mark(PROFILER_END);

			for (i = 0;i < stream_joined_channels[channel];i++)
				stream_buffer_pos[channel+i] += buflen;
		}
		else
		{
			INT16 *buf;


			buf = stream_buffer[channel] + stream_buffer_pos[channel];

			profiler_mark(PROFILER_SOUND);
			(*stream_callback[channel])(stream_param[channel],buf,buflen);
			profiler_mark(PROFILER_END);

			stream_buffer_pos[channel] += buflen;
		}
	}
}
Example #5
0
/* ADD AN ENTRY TO THE QUEUE */
INLINE void apu_enqueue(unsigned int chip,unsigned char reg,unsigned char val)
{
  queue_t *entry;

  SETAPU(chip);

  /* Only enqueue if it isn't full */
  if (apu_queuenotfull(chip))
  {
    cur->head++;
    cur->head&=QUEUE_MAX;
    entry=&cur->queue[cur->head];
    entry->pos=sound_scalebufferpos(samps_per_sync);
    entry->reg=reg;
    entry->val=val;
  }
}
Example #6
0
void llander_sh_update_partial(void)
{
	int newpos;

	if (Machine->sample_rate == 0) return;

	newpos = sound_scalebufferpos(buffer_len); /* get current position based on the timer */

	if(newpos-sample_pos<MIN_SLICE) return;

	/* Process count samples into the buffer */

	llander_process (sample_buffer, sample_pos, newpos - sample_pos);

	/* Update sample position */

	sample_pos = newpos;
}