📄 cpi_verbs.c
字号:
//
//
void CPVERB_SkipForwards(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
{
if(globals.m_bStreaming == FALSE)
{
globals.main_int_track_position++;
if(globals.main_int_track_position > Skin.Object[PositionSlider].w)
globals.main_int_track_position = Skin.Object[PositionSlider].w;
if (Skin.Object[PositionSlider].maxw == 1)
CPI_Player__Seek(globals.m_hPlayer, globals.main_int_track_position, Skin.Object[PositionSlider].h);
else
CPI_Player__Seek(globals.m_hPlayer, globals.main_int_track_position, Skin.Object[PositionSlider].w);
}
}
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "SkipForwards") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_SkipBackwards(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
{
if(globals.m_bStreaming == FALSE)
{
globals.main_int_track_position = globals.main_int_track_position - 3;
if (globals.main_int_track_position < 0)
globals.main_int_track_position = 0;
if (Skin.Object[PositionSlider].maxw == 1)
CPI_Player__Seek(globals.m_hPlayer, globals.main_int_track_position, Skin.Object[PositionSlider].h);
else
CPI_Player__Seek(globals.m_hPlayer, globals.main_int_track_position, Skin.Object[PositionSlider].w);
}
}
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "SkipBackwards") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_VolumeUp(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
{
globals.m_iVolume++;
if(globals.m_iVolume > 100)
globals.m_iVolume = 100;
main_draw_vu_from_value(windows.wnd_main, VolumeSlider, globals.m_iVolume);
CPI_Player__SetVolume(globals.m_hPlayer, globals.m_iVolume);
}
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "VolumeUp") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_VolumeDown(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
{
globals.m_iVolume--;
if (globals.m_iVolume < 0)
globals.m_iVolume = 0;
main_draw_vu_from_value(windows.wnd_main, VolumeSlider, globals.m_iVolume);
CPI_Player__SetVolume(globals.m_hPlayer, globals.m_iVolume);
}
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "VolumeDown") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_OpenFile(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
{
if(playlist_open_file(TRUE))
CPL_PlayItem(globals.m_hPlaylist, TRUE, pmCurrentItem);
}
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "OpenFile") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_About(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
about_create((HWND)_pParam);
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "About") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_Exit(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
DestroyWindow(windows.wnd_main);
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "Exit") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_SavePlaylist(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
playlist_write();
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "SavePlaylist") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_PlaylistShuffle(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
{
CPL_Stack_Shuffle(globals.m_hPlaylist, TRUE);
}
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "PlaylistShuffle") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_PlaylistOffsetUp(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
CPlaylistWindow_OffsetSelectedItems(-1);
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "PlaylistOffsetUp") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_PlaylistOffsetDown(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
CPlaylistWindow_OffsetSelectedItems(1);
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "PlaylistOffsetDown") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_AddDirectory(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
{
BROWSEINFO browseinfo;
LPITEMIDLIST itemlist;
int image = 0;
char directorychoice[MAX_PATH];
browseinfo.hwndOwner = (HWND)_pParam;
browseinfo.pidlRoot = NULL;
browseinfo.pszDisplayName = directorychoice;
browseinfo.lpszTitle = "Choose a directory to add";
browseinfo.ulFlags = BIF_EDITBOX;
browseinfo.lpfn = NULL;
browseinfo.lParam = 0;
browseinfo.iImage = image;
itemlist = SHBrowseForFolder(&browseinfo);
if(itemlist == NULL)
return;
SHGetPathFromIDList(itemlist, globals.main_text_last_browsed_dir);
CPL_SyncLoadNextFile(globals.m_hPlaylist);
CPL_AddDirectory_Recurse(globals.m_hPlaylist, globals.main_text_last_browsed_dir);
if(options.shuffle_play)
CPL_Stack_Shuffle(globals.m_hPlaylist, TRUE);
}
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "AddDirectory") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_PlaylistMinimise(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
ShowWindow(IF_GetHWnd(windows.m_hifPlaylist), SW_MINIMIZE);
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "PlaylistMinimise") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
void CPVERB_PlaylistMaximise(const CPe_VerbAction enAction, void* _pParam)
{
if(enAction == vaDoVerb)
{
if(IsZoomed(IF_GetHWnd(windows.m_hifPlaylist)))
ShowWindow(IF_GetHWnd(windows.m_hifPlaylist), SW_RESTORE);
else
ShowWindow(IF_GetHWnd(windows.m_hifPlaylist), SW_MAXIMIZE);
}
else if(enAction == vaQueryName)
{
CPs_VerbQueryName* pParam = (CPs_VerbQueryName*)_pParam;
if(stricmp(pParam->m_pcName, "PlaylistMaximise") == 0)
pParam->m_bNameMatched = TRUE;
}
}
//
//
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -