Beispiel #1
0
// get the ID3tag from the file
void get_id3_tag( const char* pFileName, off_t size ){

	static char szTitle[31]      = {'\0'};
	static char szArtist[31]     = {'\0'};
	static char szAlbum[31]      = {'\0'};
	static char szYear[5]        = {'\0'};
	static char szPath[PATH_MAX] = {'\0'};

	if( bRelPath )
		strcpy( szPath, szRelativePath );
	else
		getcwd( szPath, PATH_MAX );
			
	if( bFsInfo )													// Save file size
		size_count( size );

	get_tags( pFileName, szTitle, szArtist, szAlbum, szYear );		// Try to get all tags

	if( szTitle[0] == '\0' && szArtist[0] == '\0' && szAlbum[0] == '\0' && szYear[0] == '\0' ){
		
		if( bUseFileName ){											// Use file name to get song infos			
			filename_to_field( pFileName, szTitle, szArtist, szAlbum, szYear );
				
		} else {													// print a warning message and return
			if( bVerbose )
				print_message( WARNING, "%s has no id3 Tag\n", pFileName );
		}
	}

	sql_insert( szTitle, szArtist, szAlbum, szYear, pFileName, szPath, size );
}
Beispiel #2
0
void DImage::save_info(){ //save info writes to the image file and saves loc and tags.
    ofstream write("info.txt", ios::app);
    if (!write){
        cout << "couldnt open"<< endl;
    }
    string temp = get_url() + " " + get_tags();
	write << endl << temp;
	write.close();
}
Beispiel #3
0
std::string rss_feed::get_attribute(const std::string& attribname) {
	if (attribname == "feedtitle")
		return title();
	else if (attribname == "description")
		return description();
	else if (attribname == "feedlink")
		return title();
	else if (attribname == "feeddate")
		return pubDate();
	else if (attribname == "rssurl")
		return rssurl();
	else if (attribname == "unread_count") {
		return utils::to_s(unread_item_count());
	} else if (attribname == "total_count") {
		return utils::to_s(items_.size());
	} else if (attribname == "tags") {
		return get_tags();
	} else if (attribname == "feedindex") {
		return utils::to_s(idx);
	}
	return "";
}
Beispiel #4
0
void PLodNode::ray_test_impl(Ray const& ray,
                             int options,
                             Mask const& mask,
                             std::set<PickResult>& hits) {

  // first of all, check bbox
  auto box_hits(::gua::intersect(ray, bounding_box_));

  // ray did not intersect bbox -- therefore it wont intersect
  if (box_hits.first == Ray::END && box_hits.second == Ray::END) {
    return;
  }

  // return if only first object shall be returned and the current first hit
  // is in front of the bbox entry point and the ray does not start inside
  // the bbox
  if (options & PickResult::PICK_ONLY_FIRST_OBJECT && hits.size() > 0 &&
      hits.begin()->distance < box_hits.first && box_hits.first != Ray::END) {
    return;
  }

  // bbox is intersected, but check geometry only if mask tells us to check
  if (get_geometry_description() != "" && mask.check(get_tags())) {
    auto geometry(
        GeometryDatabase::instance()->lookup(get_geometry_description()));

    if (geometry) {
      Ray world_ray(ray);
      geometry->ray_test(world_ray, options, this, hits);
    }
  }

  for (auto child : get_children()) {
    child->ray_test_impl(ray, options, mask, hits);
  }
}