新闻中心

EEPW首页 > 嵌入式系统 > 设计应用 > 基于MiniGUI的嵌入式媒体播放器设计与实现

基于MiniGUI的嵌入式媒体播放器设计与实现

作者:时间:2014-03-06来源:网络收藏


3.3 主要函数及具体实现

⑴ 播放控制事件回调函数

static int main_event_cb (HWND hwnd, skin_item_t* item, int event, void* data)

{ …

if (event==SIE_BUTTON_CLICKED) {

switch (item->id) {

case SIID_PLAY:



case SIID_PAUSE:



case SIID_STOP:



case SIID_CLOSE:



}

}

else if (event==SIE_SLIDER_CHANGED item->id!=SIID_VOLUME) {



}

return 1;

}

⑵ 列表事件处理函数

void playlist_handle_event(PEvent *event, void *data)

{



switch(event->type) {

case ButtonPress:



case ButtonRelease:



case KeyPress:

if(!playlist)

return;

mykeyevent = event->xkey;

LockDisplay(gGui->display);

len=LookupString(mykeyevent, kbuf, sizeof(kbuf), mykey, NULL);

UnlockDisplay(gGui->display);


switch (mykey) {

case K_Down:

case K_Next:

browser_step_up(playlist->playlist, NULL);

break;


case K_Up:

case K_Prior:

browser_step_down(playlist->playlist, NULL);

break;

default:

gui_handle_event(event, data);

break;

}


评论


相关推荐

技术专区

关闭