Esempio n. 1
0
//-----------------------------------------------------------------------------
//! 
//-----------------------------------------------------------------------------
tNASTunerBar::tNASTunerBar( tFusionClientAgent& fusionClientAgent, quint8 sourceId, QWidget* pParent )
: tNASBar( fusionClientAgent, sourceId, pParent )
, m_pSelectFavoritesAction( 0 )
, m_pSeekUpAction( 0 )
, m_pSeekDownAction( 0 )
, m_pSaveAction( 0 )
, m_pSeekFavUpAction( 0 )
, m_pSeekFavDownAction( 0 )
, m_pControlAct( 0 )
, m_pTuneUpAct( 0 )
, m_pTuneDownAct( 0 )
, m_pSpacerAct( 0 )
, m_pTunerRegionAction( 0 )
, m_FavoriteStations()
, m_Seeking( false )
, m_Frequency( 0 )
, m_SignalStrength( 0 )
, m_pFavoritesDialog( 0 )
, m_pRemoveFavoriteYesNo( 0 )
, m_pFavoritesListWidget( 0 )
, m_pSignalStr0Pix( 0 )
, m_pSignalStr1Pix( 0 )
, m_pSignalStr2Pix( 0 )
, m_pSignalStr3Pix( 0 )
, m_pSignalStr4Pix( 0 )
, m_pSignalStr5Pix( 0 )
, m_Status( tFusionClient::eTS_NotScanning )
, m_MaxSupportedFavorites( 0 )
, m_TunerRegion( tFusionClient::eTR_USA )
{
    TRACE_FUNCTION;

    // Frequency
    m_Frequency = 0;

    tNOSStyle* pStyle(qobject_cast<tNOSStyle*>(style()));  
    m_pSourceIcon->setPixmap( QPixmap( pStyle->GetFilePath(tNOSStyle::FP_AudioSourceRadio) ) );
    m_pSourceIcon->resize( sizeHint() );


    tNOSStyle* pNemStyle = qobject_cast< tNOSStyle* >( style() );
    m_pSignalStr0Pix = new QPixmap( pNemStyle->NasSignalPixmap(0) );
    m_pSignalStr1Pix = new QPixmap( pNemStyle->NasSignalPixmap(1) );
    m_pSignalStr2Pix = new QPixmap( pNemStyle->NasSignalPixmap(2) );
    m_pSignalStr3Pix = new QPixmap( pNemStyle->NasSignalPixmap(3) );
    m_pSignalStr4Pix = new QPixmap( pNemStyle->NasSignalPixmap(4) );
    m_pSignalStr5Pix = new QPixmap( pNemStyle->NasSignalPixmap(5) );

    // station frequency shown here
    m_pStatusIcon->show();

    // Signal Strength indicator
    m_pShuffleIcon->show();
    m_pShuffleIcon->setPixmap( *m_pSignalStr0Pix );

    // until Fusion can resolve the RDS issue, we will remove it.  it is better to have none than have bad RDS
    // rds info.
    m_pTicker->show();
}
Esempio n. 2
0
ChEXPORT WrdStyleSheet* WrdStyleSheet::clone() const
{
	ChAutoPtr<WrdStyle> pStyle((WrdStyle*)m_pDefaultStyle->clone());
	
	// Can't put this in an auto-pointer due to the order of the cleanup stack
	WrdStyleSheet* pStyleSheet = ChNEW WrdStyleSheet((WrdStyle*)pStyle.get());
	
	pStyle.giveUpOwnership();
	
	// Need to place this in an auto-pointer in case operator()= throws an exception
	ChAutoPtr<WrdStyleSheet> pClone(pStyleSheet);
	*pClone = *this;
	return pClone.giveUpOwnership();
}
Esempio n. 3
0
//-----------------------------------------------------------------------------
//! 
//-----------------------------------------------------------------------------
tPanel* tNASBar::Create( tFusionClientAgent& fusionClientAgent, quint8 sourceId, QWidget* pPage )
{
    tNOSStyle* pStyle(qobject_cast<tNOSStyle*>(QApplication::style()));  

    TRACE_FUNCTION;
    switch( fusionClientAgent.GetSourceType( sourceId ) )
    {
    case tFusionClient::eST_Invalid:
        // Show that we are still trying to connect.
        return new tNASDefaultBar( fusionClientAgent, sourceId );
        break;

    case tFusionClient::eST_AM:
        return new tNASAMTunerBar( fusionClientAgent, sourceId, pPage );
        break;

    case tFusionClient::eST_FM:
        return new tNASFMTunerBar( fusionClientAgent, sourceId, pPage );
        break;

    case tFusionClient::eST_VHF:
        return new tNASVHFTunerBar( fusionClientAgent, sourceId, pPage );
        break;

    case tFusionClient::eST_Aux:
        // Recognize the microphone by its name to give it a special icon.
        if ( fusionClientAgent.GetSourceName( sourceId ) == "Mic")
        {
            return new tNASAuxBar( fusionClientAgent, sourceId, QPixmap( pStyle->GetFilePath(tNOSStyle::FP_AudioSourceHailer) ), false, pPage );
        }
        else
        {
            bool canAttachSirius = tProductSettings::Instance().WeatherAllowed() && tSystemSettings::Instance()->WeatherEnabled();
            return new tNASAuxBar( fusionClientAgent, sourceId, QPixmap( pStyle->GetFilePath(tNOSStyle::FP_AudioSourceLineIn) ), canAttachSirius, pPage );
        }
        break;

    case tFusionClient::eST_Sirius:
        // TODO_MCB: Sirius receiver connected to FusionLink device, not the weather module.
        // TODO_MCB: this can probably create tSiriusBar, but for now just treat like unknown source.
        return new tNASAuxBar( fusionClientAgent, sourceId, QPixmap( pStyle->GetFilePath(tNOSStyle::FP_AudioSourceLineIn) ), false, pPage );
        break;

    case tFusionClient::eST_Ipod:
    case tFusionClient::eST_USB:
    case tFusionClient::eST_MTP:
    case tFusionClient::eST_Bluetooth:
    case tFusionClient::eST_Pandora:
        return new tNASMusicPlayerBar( fusionClientAgent, sourceId, pPage );
        break;

    case tFusionClient::eST_DVD:
        return new tNASDvdPlayerBar( fusionClientAgent, sourceId, pPage );
        break;

    case tFusionClient::eST_Unknown:
    default:
        // Future proof against unknown source types.  Treat as if auxiliary input, so that at least volume can be controlled.
        // TODO_MCB: Use an 'unknown source' icon.
        return new tNASAuxBar( fusionClientAgent, sourceId, QPixmap( pStyle->GetFilePath(tNOSStyle::FP_AudioSourceLineIn) ), false, pPage );
        break;
    }
}