コード例 #1
50
void Xine::reconfigure(){
  release_device();
  if(!playing)
    return;
  while (playing)
    mmsUsleep(100000);
  setpos(cur_time);
};
コード例 #2
0
void Xine::gather_info_internal(){
  if (quitting)
    return;
  if (!validate_stream())
    return;
  if (file.type == "media-track"){
    _title = "";
    _artist = "";
    _album = "";
  }
  else{
    const char *meta_info = xine_get_meta_info(stream, XINE_META_INFO_TITLE);
    _title = (meta_info) ? meta_info : "";
    meta_info = xine_get_meta_info(stream, XINE_META_INFO_ARTIST);
    _artist = (meta_info) ? meta_info : "";
    meta_info = xine_get_meta_info(stream, XINE_META_INFO_ALBUM);
    _album = (meta_info) ? meta_info : "";
    meta_info = xine_get_meta_info(stream, XINE_META_INFO_INPUT_PLUGIN);
    if (meta_info) /* If it is not a local file, _artist = _album, so that mms doesn't just show the filename */
      if (strcasecmp(meta_info, "pluginfile") != 0){
	_artist = _album;
	_album = "";
      }
  }


  int position_, length_ = 0;
  for (int t = 0; t < 5; t++){ /* sometimes xine doesn't return a valid position, especially after a seek
                                while playing an audio CD (it sucks) */
    xine_get_pos_length(stream, 0, &position_, &length_);
    if (position_ > 0)
      break;
    mmsUsleep(50000);
  }

  if (position_ > 0){
    _cur_time = position_/1000;
    _total_time = length_/1000;
  }
/*
  else
  {
    _title = "";
    _artist ="";
    _album = "Buffering...";
  }
*/ 
  //fprintf(stderr, "Gather info internal (position %d)\n", _cur_time);
}
コード例 #3
0
void RenderDevice::wait_for_not_drawing()
{
  while (drawing || new_to_draw)
    mmsUsleep(100*1000);
}