Esempio n. 1
0
static void
_process_emotion_commands(struct _App *app)
{
   int cmd = _em_cmd_read(app);
   switch (cmd) {
      case EM_CMD_FILE_SET:
	 _file_set(app);
	 break;
      case EM_CMD_FILE_SET_DONE:
	 _file_set_done(app);
	 break;
      case EM_CMD_FILE_CLOSE:
	 _file_close(app);
	 break;
      case EM_CMD_PLAY:
	 _play(app);
	 break;
      case EM_CMD_STOP:
	 _stop(app);
	 break;
      case EM_CMD_POSITION_SET:
	 _position_set(app);
	 break;
      case EM_CMD_SPEED_SET:
	 _speed_set(app);
	 break;
      case EM_CMD_AUDIO_MUTE_SET:
	 _mute_set(app);
	 break;
      case EM_CMD_VOLUME_SET:
	 _volume_set(app);
	 break;
      case EM_CMD_AUDIO_TRACK_SET:
	 _audio_track_set(app);
	 break;
      case EM_CMD_VIDEO_TRACK_SET:
	 _video_track_set(app);
	 break;
   };
}
Esempio n. 2
0
  ck_assert_ptr_ne(type_file, NULL);
  ck_assert_str_eq(type_file -> type_name, "file");
END_TEST

START_TEST(file_open_close)
  typedescr_t *type_file = typedescr_get_byname("file");
  data_t      *f;
  data_t      *ret;

  ck_assert_int_ne(File, -1);
  ck_assert_ptr_ne(type_file, NULL);
  f = _file_open("file.txt");
  ck_assert_ptr_ne(f, NULL);
  ck_assert_int_eq(data_type(f), type_file -> type);

  ret = _file_close(f);
  ck_assert_ptr_ne(ret, NULL);
  ck_assert_int_eq(data_type(ret), Bool);
  ck_assert_int_ne(data_intval(ret), 0);
END_TEST

START_TEST(file_readline)
  data_t *f;
  int     ix;
  data_t *d;

  f = _file_open("file.txt");
  for (d = _file_readline(f); 
       data_type(d) == String; 
       d = _file_readline(f)) {
    debug("%s", data_charval(d));