Exemple #1
0
static int rl_prev_line (SLrline_Type *This_RLI)
{
   RL_History_Type *prev;

   if ((This_RLI->is_modified)
       || (This_RLI->last == NULL))
     {
	prev = This_RLI->tail;
     }
   else
     prev = This_RLI->last->prev;

   if (prev == NULL)
     {
	rl_beep ();
	return 0;
     }

   if (prev == This_RLI->tail)
     {
	This_RLI->buf[This_RLI->len] = 0;
	free_history_item (This_RLI->saved_line);
	This_RLI->saved_line = allocate_history ((char *)This_RLI->buf, This_RLI->point);
	if (This_RLI->saved_line == NULL)
	  return -1;
     }

   return rl_select_line (This_RLI, prev);
}
void FileFFMPEGStream::append_history(short *new_data, int len)
{
	allocate_history(len);

	for(int i = 0; i < channels; i++)
	{
		double *output = pcm_history[i] + history_size;
		short *input = new_data + i;
		for(int j = 0; j < len; j++)
		{
			*output++ = (double)*input / 32768;
			input += channels;
		}
	}

	history_size += len;
	decode_end += len;
}
Exemple #3
0
int SLrline_add_to_history (SLrline_Type *rli, SLFUTURE_CONST char *hist)
{
   RL_History_Type *h;

   if ((rli == NULL) || (hist == NULL))
     return -1;

   h = allocate_history (hist, -1);

   if (rli->root == NULL)
     rli->root = h;

   if (rli->tail != NULL)
     rli->tail->next = h;
   
   h->prev = rli->tail;
   rli->tail = h;
   h->next = NULL;

   return 0;
}