Пример #1
0
	StringResult Bindata::add( const Xmms::bin& data ) const
	{
		xmmsc_result_t* res =
			call( connected_,
			      boost::bind( xmmsc_bindata_add, conn_,
			                   data.data(), data.size() ) );
		return StringResult( res, ml_ );
	}
Пример #2
0
bool
XClientCache::handle_bindata (const Xmms::bin &data, const QString &id)
{
	QPixmap i;
	i.loadFromData (data.c_str (), data.size());

	if (i.isNull ()) {
		return true;
	}

	/* conserve memory client side */
	if (i.width () < 300) {
		i = i.scaledToWidth (300, Qt::SmoothTransformation);
	}

	QPixmapCache::insert (id, i);

	QList<uint32_t> ids = m_icon_map[id];
	for (int i = 0; i < ids.size (); i++) {
		emit entryChanged (ids.at (i));
	}

	return true;
}