当前位置: 首页>>代码示例>>C++>>正文


C++ CCString::ToInt方法代码示例

本文整理汇总了C++中CCString::ToInt方法的典型用法代码示例。如果您正苦于以下问题:C++ CCString::ToInt方法的具体用法?C++ CCString::ToInt怎么用?C++ CCString::ToInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCString的用法示例。


在下文中一共展示了CCString::ToInt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnEdit

void Plugin_Commercial::OnEdit()
{
    CCString s;
    LLSegment NewSegment;
    int iSegment;
    int iItem = this->cRanges.GetSelectionMark();

    if(iItem == -1) return;


    this->cRanges.GetItemText(iItem, COLUMN_ID, &s);
    iSegment = s.ToInt(10);

    // Delete that one.
    LLSegment* p = NULL;
    int nSegments;

    if(FAILED(this->pCore->db.GetSegmentCount(&nSegments, &this->pCore->Log)))
    {
        return;
    }

    p = (LLSegment*)malloc(sizeof(LLSegment) * nSegments);

    if(FAILED(this->pCore->db.GetSegmentData(p, &this->pCore->Log)))
    {
        free(p);
        return;
    }

    NewSegment.dwIn = p[iSegment].dwIn;
    NewSegment.dwOut = p[iSegment].dwOut;
    NewSegment.dwSize = p[iSegment].dwSize;

    if(FAILED(GetSegmentDataDlg(&NewSegment, this->cMainWindow)))
    {
        free(p);
        return;
    }

    p[iSegment].dwIn = NewSegment.dwIn;
    p[iSegment].dwOut = NewSegment.dwOut;
    p[iSegment].dwSize = NewSegment.dwSize;

    if(FAILED(this->pCore->db.SetSegmentData(nSegments, p, &this->pCore->Log)))
    {
        free(p);
        return;
    }

    LL_DBUPDATE_STRUCT us;
    us.dwOperation = DBUPDATE_CHANGED;
    us.dwType = DBUPDATE_SEGMENT;
    this->pCore->SendPluginMessage(LL_DBUPDATE, &us);

    free(p);
    return;
}
开发者ID:thenfour,项目名称:LoveLine,代码行数:58,代码来源:P_Commercial.cpp

示例2: OnRemove

void Plugin_Commercial::OnRemove()
{
    int iSegment;
    int iItem = this->cRanges.GetSelectionMark();
    if(iItem == -1) return;

    CCString s;

    this->cRanges.GetItemText(iItem, COLUMN_ID, &s);
    iSegment = s.ToInt(10);

    // Delete that one.
    LLSegment* p = NULL;
    int nSegments;

    if(FAILED(this->pCore->db.GetSegmentCount(&nSegments, &this->pCore->Log)))
    {
        return;
    }

    p = (LLSegment*)malloc(sizeof(LLSegment) * nSegments);

    if(FAILED(this->pCore->db.GetSegmentData(p, &this->pCore->Log)))
    {
        free(p);
        return;
    }

    // Close the gap.
    PVOID pFrom = &p[iSegment + 1];
    PVOID pTo = &p[iSegment];
    int nLen = (nSegments - (iSegment+1)) * sizeof(LLSegment);
    memmove(pTo, pFrom, nLen);

    nSegments --;

    if(FAILED(this->pCore->db.SetSegmentData(nSegments, p, &this->pCore->Log)))
    {
        free(p);
        return;
    }

    free(p);

    LL_DBUPDATE_STRUCT us;
    us.dwOperation = DBUPDATE_CHANGED;
    us.dwType = DBUPDATE_SEGMENT;
    this->pCore->SendPluginMessage(LL_DBUPDATE, &us);

    return;
}
开发者ID:thenfour,项目名称:LoveLine,代码行数:51,代码来源:P_Commercial.cpp

示例3: NotificationProc

void CALLBACK Plugin_Playback::NotificationProc(PVOID pUser, DWORD dwMsg, PVOID pParams)
{
    Plugin_Playback* pThis = (Plugin_Playback*)pUser;

    switch(dwMsg)
    {
    case LL_COMPLETE:
        {
            LL_SEEKEPISODE_STRUCT* lse = (LL_SEEKEPISODE_STRUCT*)pParams;

            // Advance to the next episode automatically.
            GUID idNew;
            LLEpisode ThisEpisode;

            if(pThis->bIsDragging == FALSE)
            {
                if(FAILED(pThis->pCore->db.GetEpisode(
                    lse->guidEpisode, &ThisEpisode, &pThis->pCore->Log)))
                {
                    //
                    return;
                }

                if(FAILED(pThis->pCore->db.GetNextEpisode(
                    MAKELLTIME(ThisEpisode.dwYear, ThisEpisode.dwMonth, ThisEpisode.dwDay),
                    &idNew, &pThis->pCore->Log)))
                {
                    // Gracefully cancel....
                    return;
                }

                // Seek to that episode.
                pThis->pCore->SeekEpisode(idNew, 0);
            }

            break;
        }
    case LL_SEEKEPISODE:
        {
            LL_SEEKEPISODE_STRUCT* lse = (LL_SEEKEPISODE_STRUCT*)pParams;
            pThis->Refresh();
            break;
        }
    case LL_SEEKCURRENT:
        {
            LL_SEEKCURRENT_STRUCT* lsc = (LL_SEEKCURRENT_STRUCT*)pParams;
			GUID id;
			pThis->pCore->GetCurrentEpisode(&id);
			pThis->UpdateNav(lsc->dwMS, id);
            pThis->NotifySeekCurrent();
            break;
        }
    case LL_SETFOCUS:
        {
            break;
        }
    case LL_INITIALIZE:
        {
            // Grab the last saved position and travel there..
            GUID guid;
            DWORD dwPos;

            if(FAILED(pThis->pCore->db.GetLastPosition(
                &guid, &dwPos, &pThis->pCore->Log)))
            {
                // Use defaults.
                dwPos = 0;
                ZeroMemory(&guid, sizeof(GUID));
            }

            // Load settings and set them up.
            CCString s;

            if(SUCCEEDED(
                pThis->pCore->db.GetSetting(
                L"Playback_IsPlaying", &s, &pThis->pCore->Log)))
            {
                if(s.ToInt(10) == TRUE) pThis->pCore->Player.Play(&pThis->pCore->Log);
            }

            if(SUCCEEDED(
                pThis->pCore->db.GetSetting(
                L"Playback_Volume", &s, &pThis->pCore->Log)))
            {
                pThis->pCore->Player.SetVolume(s.ToInt(10), &pThis->pCore->Log);
                pThis->cVol.SetPos(s.ToInt(10));
            }

            pThis->pCore->SeekEpisode(guid, dwPos);
            break;
        }
    case LL_DBUPDATE:
        {
            // The database has changed.  Pretty much we have to 
            // force the display to be updated.
            pThis->Refresh();
            break;
        }
    case LL_ATTACH:
        {
//.........这里部分代码省略.........
开发者ID:thenfour,项目名称:LoveLine,代码行数:101,代码来源:P_Playback.cpp


注:本文中的CCString::ToInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。