示例#1
0
void MythSqueezeDisplay::RightArrowEffect( void )
{
    StopScroll();
    isTransition = true;
    transitionDirection = transLEFT;
    LoadTransitionBuffer();
    horzTransTimer->start();
}
示例#2
0
void MythSqueezeDisplay::DownArrowEffect( void )
{
    StopScroll();
    isTransition = true;
    transitionDirection = transUP;
    LoadTransitionBuffer();
    vertTransTimer->start();
}
示例#3
0
void SqueezeDisplay::UpArrowEffect( void )
{
    StopScroll();
    isTransition = true;
    transitionDirection = transDOWN;
    LoadTransitionBuffer();
    vertTransTimer->start();
}
示例#4
0
/** \brief MouseUp Callback.
 * This handles the situation where someone does a drag and drop of an item.
 * In this case we should copy it to the desired location.
 *
 * \todo Implement recursive transfer when a folder is dropped.
 */
void RemoteIconView::MouseUp( const Point& cPoint, uint32 nButtons, Message* pcData )
{
	if( pcData == NULL || m_pcServer == NULL ) {
		/* No drag & drop, or no connection */
		IconView::MouseUp( cPoint, nButtons, pcData );
		return;
	}
	StopScroll();
	
	/* We got a drag & drop. Check if it contains a local file */
	int nCount, nType;
	pcData->GetNameInfo( "file/path", &nType, &nCount );
	if( nType != T_STRING || nCount == 0 ) {
		/* Something was dropped that isn't a file. Ignore it */
		IconView::MouseUp( cPoint, nButtons, pcData );
		return;
	}
	
	/* Check if there is a directory icon under the mouse. If so, we transfer the file into that directory.
	   Otherwise, we transfer it into this directory. */
	String zDestPath = m_zPath;
	for( uint i = 0; i < GetIconCount(); i++ ) {
		if( Rect( GetIconPosition( i ), GetIconPosition( i ) + GetIconSize() ).DoIntersect( ConvertToView( cPoint ) ) ) {
			/* Found an icon under the mouse */
			RemoteIconData* pcData = (RemoteIconData*)GetIconData( i );
			if( pcData->m_cNode.IsDir() ) {
				/* Found a dir under the mouse. Add it to the destination path */
				zDestPath += "/";
				zDestPath += pcData->m_cNode.m_zName;
				break;
			}
		}
	}
	
	/* Start transferring the files */
	String zSource;
	String zDest;
	for( int i = 0; pcData->FindString( "file/path", &zSource, i ) == 0; i++ )
	{
		Path cPath( zSource );
		zDest = zDestPath;
		if( zDest.Length() > 0 && zDest[zDest.Length()-1] != '/' ) zDest += "/";
		zDest += cPath.GetLeaf();
		DEBUG( "GUI: Drag & drop %s to %s\n", zSource.c_str(), zDest.c_str() );
		
		/* Ask the Server object to start the transfer */
		/* Need to determine if it is a file or a dir first though */
		FileReference cFileRef( zSource );
		struct stat sStat;
		cFileRef.GetStat( &sStat );
		if( S_ISDIR( sStat.st_mode ) ) {
			m_pcServer->SendLocalDir( zSource, zDest );
		} else {
			m_pcServer->SendLocalFile( zSource, zDest );
		}
	}
}
void SmoothScroll::Update()
{
	if( m_touchManager->GetSwipeDirection() != TouchManager::SD_NONE )
	{
		const double distance = m_touchManager->GetSwipe()->m_delta.GetLength() * s_lengthFactor;
		const uint64 duration = static_cast< uint64 >( distance * s_durationFactor );

		StartScroll( m_touchManager->GetSwipeDirection(), distance * s_distanceDecrease * s_timeCoef, duration ); 
		
		m_touchManager->ResetSwipeDirection();
	}

	if( m_isActive )
	{
		const uint64 currentTime = s3eTimerGetMs() - m_startTime;

		if( currentTime <= m_duration )
		{
			if( currentTime >= m_duration * s_percentOfSmoothingStart )
			{
				m_distance = ( m_duration - currentTime ) * s_distanceDecrease;
			}

			switch( m_direction )
			{
			case TouchManager::SD_LEFT:
				{
					m_stepX = m_distance;
				}	
				break;
			case TouchManager::SD_RIGHT:
				{
					m_stepX = -m_distance;
				}	
				break;
			case TouchManager::SD_UP:
				{
					m_stepY = m_distance;
				}
				break;
			case TouchManager::SD_DOWN:
				{
					m_stepY = -m_distance;
				}
				break;
			}
		}
		else
		{
			StopScroll();
		}
	}
}
示例#6
0
void MythSqueezeDisplay::LeftArrowEffect( void )
{
    StopScroll();
    isTransition = true;
    transitionDirection = transRIGHT;
    LoadTransitionBuffer();
    if( activeDevice->getDisplayBuffer()->line0 == "Squeezebox Home" ) {  // are we at the "left-most" menu option?
        bumpTransTimer->start();
    }
    else {
        horzTransTimer->start();
    }
}
示例#7
0
void MythSqueezeDisplay::slotUpdateSlimDisplay( void )
{
    DEBUGF("");
    boundingRect = line1fm->boundingRect( line1Bounds, Qt::AlignLeft | Qt::AlignHCenter, activeDevice->getDisplayBuffer()->line1 );
    lineWidth = line1fm->width( activeDevice->getDisplayBuffer()->line1 );

    // set the point at which we draw the second iteration of line1 text
    pointLine1_2 = QPoint( lineWidth + ( displayLabel.width() - line1Bounds.width()) + (Line1FontWidth*2), line1Bounds.bottom() );

    if(  lineWidth > line1Bounds.width() ) {
        if( scrollState == NOSCROLL ) {
            StopScroll();
            scrollTextLen = lineWidth - line1Bounds.width();
            scrollTimer.setInterval( m_scrollInterval );
            scrollTimer.start();
        }
    }
    else {
        ScrollOffset = 0;
        scrollState = NOSCROLL;
        scrollTimer.stop();
    }
    PaintSqueezeDisplay(activeDevice->getDisplayBuffer());
}