IntResult Playlist::setNext( int pos ) const { xmmsc_result_t* res = call( connected_, boost::bind( xmmsc_playlist_set_next, conn_, pos ) ); return IntResult( res, ml_ ); }
std::vector<IntResult> SimpleIntersector::LinesIntersect(FastLine* line1, FastLine* line2) { std::vector<IntResult> ret; double ua = (line2->B.X()-line2->A.X())*(line1->A.Y()-line2->A.Y()) - (line2->B.Y()-line2->A.Y())*(line1->A.X()-line2->A.X()); ua /= (line2->B.Y()-line2->A.Y())*(line1->B.X()-line1->A.X())-(line2->B.X()-line2->A.X())*(line1->B.Y()-line1->A.Y()); double ub = (line1->B.X()-line1->A.X())*(line1->A.Y()-line2->A.Y()) - (line1->B.Y()-line1->A.Y())*(line1->A.X()-line2->A.X()); ub /= (line2->B.Y()-line2->A.Y())*(line1->B.X()-line1->A.X())-(line2->B.X()-line2->A.X())*(line1->B.Y()-line1->A.Y()); if(ua > -tol && ua < 1+tol && ub > -tol && ub < 1+tol) { double atX = line1->A.X() + ua * (line1->B.X() - line1->A.X()); double atY = line1->A.Y() + ua * (line1->B.Y() - line1->A.Y()); ret.push_back(IntResult(true,ua,ub,atX,atY)); } return ret; }
IntResult Playback::getPlaytime() const { xmmsc_result_t* res = call( connected_, boost::bind( xmmsc_playback_playtime, conn_ ) ); return IntResult( res, ml_ ); }