Example #1
0
Slideshow::~Slideshow (void)
{
    // set the flag to indicate we are no longer in a slideshow
    m_bIsInSlideShow = false;

    // clean up timers so nothing fires an event at us when we're gone
    CleanUpTimers ();

    // stop sounds so nothing fires an event at us when we're gone
    StopSound ();

    // reset the focus for inputs
    GetWindow()->SetFocus(m_pkeyboardInputOldFocus);
}
Example #2
0
// do the work
void    Slideshow::NextSlide (void)
{
    // stop any playing sounds
    StopSound ();

    // clean up any existing timers
    CleanUpTimers ();

    // check to see if there are any more slides to show
    if (m_pSlideList->GetCurrent() != NULL)
    {
        // get the image and sound id for the slide
        TRef<IObjectPair> pPair;
        CastTo (pPair, m_pSlideList->GetCurrent());
        //TRef<Image>     pImage = Image::Cast((Value*)pPair->GetFirst ());
        TRef<Image>     pImage = Image::Cast (static_cast<Value*> (pPair->GetFirst ()));
        SoundID         soundID = static_cast<SoundID> (GetNumber (pPair->GetSecond ()));

        // advance to the next slide
        m_pSlideList->GetNext();

        // set the image to the next image in the list
        m_pWrapImage->SetImage (pImage);

        // start the sound
        m_pSoundInstance = GetWindow ()->StartSound (soundID);

        // wait for the sound to finish
        m_pSoundInstance->GetFinishEventSource ()->AddSink (m_pEventSink);
    }
    else
    {
        // get out of the slideshow
        Dismiss ();
    }

}
Example #3
0
/******************************************************************************
 *
 *  Name: FreeAdapterObject()
 *
 *  Description:  Device object clean-up routine
 *
 *
 *  Arguments:    IN NDIS_HANDLE MiniportAdapterContext
 *          Miniport context
 *
 *  Return Value:   None
 *
 *  Notes:
 *
 *****************************************************************************/
VOID
FreeAdapterObject(PMRVDRV_ADAPTER Adapter)
{
    //free TX Q
    CleanUpSingleTxBuffer(Adapter);
    // Free Rx Q
    FreeRxQ(Adapter);

    wlan_ccx_free(Adapter);
    ///CCX_CCKM
    if (Adapter->WaitCCKMIEEvent != NULL) {
        CloseHandle(Adapter->WaitCCKMIEEvent);
    }
    ///CCX_CCKM

    // Relase command buffer
    FreeCmdBuffer(Adapter);
    CleanUpStationHW(Adapter);

    if (Adapter->RoamingMode == SMLS_ROAMING_MODE) {
        wlan_roam_deinit(Adapter->pwlanRoamParam);
    }

    if ( Adapter->InitializationStatus & MRVDRV_INIT_STATUS_MAP_REGISTER_ALLOCATED )
    {
        // Release map registers
        NdisMFreeMapRegisters(Adapter->MrvDrvAdapterHdl);
    }

    CleanUpTimers(Adapter);

    // Free the adapter object itself
    MRVDRV_FREE_MEM((PVOID)Adapter, sizeof(MRVDRV_ADAPTER));

    return;
}
Example #4
0
/******************************************************************************
 *
 *  Name: ResetAdapterObject()
 *
 *  Description:  Reset all the variables in the Adapter object
 *
 *  Arguments:
 *
 *  Return Value:   None
 *
 *  Notes:
 *
 *****************************************************************************/
VOID
ResetAdapterObject(PMRVDRV_ADAPTER Adapter)
{
    //      Disable interrupt, reset INTCause
    If_DisableInterrupt(Adapter);
    Adapter->INTCause =0;

    CleanUpTimers(Adapter);
    Adapter->TimerInterval = MRVDRV_DEFAULT_TIMER_INTERVAL;

    // Tx-related variables
    CleanUpSingleTxBuffer(Adapter);

    // Rx-related variables
    ResetRxPDQ(Adapter);

    // Command-related variables
    ResetCmdBuffer(Adapter);

    // Operation characteristics
    Adapter->CurrentLookAhead = (ULONG)MRVDRV_MAXIMUM_ETH_PACKET_SIZE - MRVDRV_ETH_HEADER_SIZE;
    // 9/19/02: cannot set ProtocolOption to 0
    // Adapter->ProtocolOptions = 0;
    Adapter->MACOptions  = (ULONG)NDIS_MAC_OPTION_NO_LOOPBACK;
    DBGPRINT(DBG_LOAD, (L"set Disconnected!(3)\n"));
    Adapter->MediaConnectStatus = NdisMediaStateDisconnected;
    Adapter->MediaInUse = NdisMedium802_3;
    Adapter->LinkSpeed = MRVDRV_LINK_SPEED_0mbps;

    // Status variables
    Adapter->HardwareStatus = NdisHardwareStatusReady;

    // 802.11 specific
    // need to keep WEPStatus, AuthenticationMode, InfrastructureMode
    //Adapter->WEPStatus = Ndis802_11WEPDisabled;
    //Adapter->AuthenticationMode = Ndis802_11AuthModeOpen;
    //Adapter->InfrastructureMode = Ndis802_11Infrastructure;
    Adapter->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
    Adapter->ulNumOfBSSIDs =0;
    Adapter->ulCurrentBSSIDIndex =0;
    Adapter->ulAttemptedBSSIDIndex =0;
    ///Adapter->bAutoAssociation = FALSE;
    Adapter->bIsAssociateInProgress = FALSE;

    Adapter->bIsScanInProgress = FALSE;
    Adapter->ulLastScanRequestTime =0;

    // Memorize the previous SSID and BSSID
    if ( Adapter->CurrentSSID.SsidLength != 0 )
    {
        NdisMoveMemory( &(Adapter->PreviousSSID), &(Adapter->CurrentSSID), sizeof(NDIS_802_11_SSID));
        NdisMoveMemory( Adapter->PreviousBSSID, Adapter->CurrentBSSID, MRVDRV_ETH_ADDR_LEN);
    }

    NdisZeroMemory(&(Adapter->CurrentSSID), sizeof(NDIS_802_11_SSID));
    NdisZeroMemory(Adapter->CurrentBSSID, MRVDRV_ETH_ADDR_LEN);

    NdisZeroMemory( &(Adapter->CurrentBSSIDDesciptor),
                    sizeof(NDIS_WLAN_BSSID_EX));

    NdisZeroMemory( &(Adapter->CurrentBssDesciptor),
                    sizeof(BSS_DESCRIPTION_SET_ALL_FIELDS));

    NdisZeroMemory( Adapter->BSSIDList,
                    sizeof(NDIS_WLAN_BSSID_EX) * MRVDRV_MAX_BSSID_LIST);
    /*
      NdisZeroMemory( Adapter->PSBSSIDList,
            sizeof(NDIS_WLAN_BSSID_EX) * MRVDRV_MAX_BSSID_LIST);
    */
    NdisZeroMemory(Adapter->BssDescList,
                   sizeof(BSS_DESCRIPTION_SET_ALL_FIELDS) * MRVDRV_MAX_BSSID_LIST);
    /*
      NdisZeroMemory(Adapter->PSBssDescList,
            sizeof(BSS_DESCRIPTION_SET_ALL_FIELDS) * MRVDRV_MAX_BSSID_LIST);
    */
    NdisZeroMemory(&Adapter->CurrentConfiguration,sizeof(NDIS_802_11_CONFIGURATION));

    // Initialize RSSI-related variables
    Adapter->LastRSSI = MRVDRV_RSSI_DEFAULT_NOISE_VALUE;
    Adapter->RSSITriggerValue = MRVDRV_RSSI_TRIGGER_DEFAULT;
    Adapter->RSSITriggerCounter = 0;

    Adapter->CurPowerState = NdisDeviceStateD0;
    Adapter->SupportTxPowerLevel = MRVDRV_TX_POWER_LEVEL_TOTAL;
    Adapter->CurrentTxPowerLevel = HostCmd_ACT_TX_POWER_INDEX_MID;

    // Clean up current WEP key
    NdisZeroMemory(&(Adapter->CurrentWEPKey), sizeof(MRVL_WEP_KEY));

    Adapter->SoftwareFilterOn = FALSE;

    Adapter->bIsReconnectEnable = FALSE;

    //012207
    //Adapter->IsDeepSleep = FALSE;
    //Adapter->IsDeepSleepRequired = FALSE;
    SetDsState( Adapter, DS_STATE_NONE );

    Adapter->bIsSystemConnectNow = FALSE;
    Adapter->bIsReconnectEnable = FALSE;
    Adapter->bIsBeaconLoseEvent = FALSE;
    Adapter->bIsDeauthenticationEvent = FALSE;

    Adapter->WEPStatus = Ndis802_11WEPDisabled;
    Adapter->AuthenticationMode = Ndis802_11AuthModeOpen;
    Adapter->InfrastructureMode = Ndis802_11Infrastructure;
    Adapter->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
    Adapter->ulNumOfBSSIDs =0;
    Adapter->ulCurrentBSSIDIndex =0;
    Adapter->ulAttemptedBSSIDIndex =0;
    ///Adapter->bAutoAssociation = FALSE;
    Adapter->LastRSSI =  MRVDRV_RSSI_DEFAULT_NOISE_VALUE;
    // Adapter->RxPDIndex = 0;
    Adapter->ulLastScanRequestTime =0;

    //Adapter->EncryptionStatus = Ndis802_11EncryptionDisabled;
    // setup association information buffer
    {
        PNDIS_802_11_ASSOCIATION_INFORMATION pAssoInfo;
        //ULONG   ulLength;

        pAssoInfo = (PNDIS_802_11_ASSOCIATION_INFORMATION)
                    Adapter->AssocInfoBuffer;

        // ulLength = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);

        //ulLength = (ulLength) + 3

        DBGPRINT(DBG_LOAD, (L"pAssoInfo = 0x%x, pAssoInfo->Length = 0x%x\n", pAssoInfo,
                            &(pAssoInfo->Length)));
        // assume the buffer has already been zero-ed
        // no variable IE, so both request and response IE are
        // pointed to the end of the buffer, 4 byte aligned
        pAssoInfo->OffsetRequestIEs =
            pAssoInfo->OffsetResponseIEs =
                pAssoInfo->Length = ((sizeof(NDIS_802_11_ASSOCIATION_INFORMATION) + 3)
                                     /4) * 4 ;
    }

    return;
}