⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 preferences.c

📁 uclinux下mplayer的源码
💻 C
📖 第 1 页 / 共 3 页
字号:
            {                case ID_EXTRASTEREO:                {                    if(SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_GETCHECK, 0, 0) == BST_CHECKED)                    {                        EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR1), 1);                        EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR2), 1);                    } else {                        EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR1), 0);                        EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR2), 0);                        SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_SETPOS, 1, (LPARAM)10.0);                        SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_SETPOS, 1, (LPARAM)0);                    }                    break;                }                case ID_CACHE:                {                    if(SendDlgItemMessage(hwnd, ID_CACHE, BM_GETCHECK, 0, 0) == BST_CHECKED)                    {                        EnableWindow(GetDlgItem(hwnd, ID_EDIT1), 1);                        EnableWindow(GetDlgItem(hwnd, ID_UPDOWN1), 1);                    } else {                        EnableWindow(GetDlgItem(hwnd, ID_EDIT1), 0);                        EnableWindow(GetDlgItem(hwnd, ID_UPDOWN1), 0);                        SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_SETPOS32, 1, (LPARAM)2048);                    }                    break;                }                case ID_AUTOSYNC:                {                    if(SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_GETCHECK, 0, 0) == BST_CHECKED)                    {                        EnableWindow(GetDlgItem(hwnd, ID_EDIT2), 1);                        EnableWindow(GetDlgItem(hwnd, ID_UPDOWN2), 1);                    } else {                        EnableWindow(GetDlgItem(hwnd, ID_EDIT2), 0);                        EnableWindow(GetDlgItem(hwnd, ID_UPDOWN2), 0);                        SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_SETPOS32, 1, (LPARAM)0);                    }                    break;                }                case ID_DEFAULTS:                {                    set_defaults();                    SendDlgItemMessage(hwnd, ID_VO_DRIVER, CB_SETCURSEL,                                       (WPARAM)SendMessage(vo_driver, CB_FINDSTRING, -1, (LPARAM)"directx"), 0);                    SendDlgItemMessage(hwnd, ID_AO_DRIVER, CB_SETCURSEL,                                       (WPARAM)SendMessage(ao_driver, CB_FINDSTRING, -1, (LPARAM)"dsound"), 0);                    SendDlgItemMessage(hwnd, ID_PRIO, CB_SETCURSEL,                                       (WPARAM)SendMessage(prio, CB_FINDSTRING, -1, (LPARAM)proc_priority), 0);                    SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_SETPOS, 1, (LPARAM)10.0);                    SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_SETPOS, 1, (LPARAM)0.0);                    SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_SETPOS32, 0, (LPARAM)gtkCacheSize);                    SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_SETPOS32, 0, (LPARAM)gtkAutoSync);                    SendDlgItemMessage(hwnd, ID_DOUBLE, BM_SETCHECK, 0, 0);                    SendDlgItemMessage(hwnd, ID_DIRECT, BM_SETCHECK, 0, 0);                    SendDlgItemMessage(hwnd, ID_FRAMEDROP, BM_SETCHECK, 0, 0);                    SendDlgItemMessage(hwnd, ID_NORMALIZE, BM_SETCHECK, 0, 0);                    SendDlgItemMessage(hwnd, ID_SOFTMIX, BM_SETCHECK, 0, 0);                    SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_SETCHECK, 0, 0);                    SendDlgItemMessage(hwnd, ID_CACHE, BM_SETCHECK, 0, 0);                    SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_SETCHECK, 0, 0);                    SendDlgItemMessage(hwnd, ID_SUBWINDOW, BM_SETCHECK, 1, 0);                    SendDlgItemMessage(hwnd, ID_NONE, BM_SETCHECK, 0, 0);                    SendDlgItemMessage(hwnd, ID_OSD1, BM_SETCHECK, 1, 0);                    SendDlgItemMessage(hwnd, ID_OSD2, BM_SETCHECK, 0, 0);                    SendDlgItemMessage(hwnd, ID_OSD3, BM_SETCHECK, 0, 0);                    SendDlgItemMessage(hwnd, ID_DVDDEVICE, WM_SETTEXT, 0, (LPARAM)"D:");                    SendDlgItemMessage(hwnd, ID_CDDEVICE, WM_SETTEXT, 0, (LPARAM)"D:");                    SendMessage(hwnd, WM_COMMAND, (WPARAM)ID_APPLY, 0);                    break;                }                case ID_CANCEL:                    DestroyWindow(hwnd);                    return 0;                case ID_APPLY:                {                    int strl;                    if(guiIntfStruct.Playing) guiGetEvent(guiCEvent, (void *)guiSetStop);                    /* Set the video driver */                    gfree(video_driver_list[0]);                    strl = SendMessage(vo_driver, CB_GETCURSEL, 0, 0);                    video_driver_list[0] = malloc(strl);                    SendMessage(vo_driver, CB_GETLBTEXT, (WPARAM)strl,                                (LPARAM)video_driver_list[0]);                    /* Set the audio driver */                    gfree(audio_driver_list[0]);                    strl = SendMessage(ao_driver, CB_GETCURSEL, 0, 0);                    audio_driver_list[0] = malloc(strl);                    SendMessage(ao_driver, CB_GETLBTEXT, (WPARAM)strl,                                (LPARAM)audio_driver_list[0]);                    /* Set the priority level */                    SendMessage(prio, CB_GETLBTEXT, (WPARAM)SendMessage(prio, CB_GETCURSEL, 0, 0), (LPARAM)procprio);                    proc_priority = strdup(procprio);                    /* double buffering */                    if(SendDlgItemMessage(hwnd, ID_DOUBLE, BM_GETCHECK, 0, 0) == BST_CHECKED)                        vo_doublebuffering = 1;                    else vo_doublebuffering = 0;                    /* direct rendering */                    if(SendDlgItemMessage(hwnd, ID_DIRECT, BM_GETCHECK, 0, 0) == BST_CHECKED)                        vo_directrendering = 1;                    else vo_directrendering = 0;                    /* frame dropping */                    if(SendDlgItemMessage(hwnd, ID_FRAMEDROP, BM_GETCHECK, 0, 0) == BST_CHECKED)                        frame_dropping = 1;                    else frame_dropping = 0;                    /* normalize */                    if(SendDlgItemMessage(hwnd, ID_NORMALIZE, BM_GETCHECK, 0, 0) == BST_CHECKED)                        gtkAONorm = 1;                    else gtkAONorm = 0;                    /* software mixer */                    if(SendDlgItemMessage(hwnd, ID_SOFTMIX, BM_GETCHECK, 0, 0) == BST_CHECKED)                        soft_vol = 1;                    else soft_vol = 0;                    /* extra stereo */                    if(SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_GETCHECK, 0, 0) == BST_CHECKED)                        gtkAOExtraStereo = 1;                    else {                        gtkAOExtraStereo = 0;                        gtkAOExtraStereoMul = 10.0;                    }                    gtkAOExtraStereoMul = SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_GETPOS, 0, 0) / 10.0;                    /* audio delay */                    audio_delay = SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_GETPOS, 0, 0) / 100.0;                    /* cache */                    if(SendDlgItemMessage(hwnd, ID_CACHE, BM_GETCHECK, 0, 0) == BST_CHECKED)                        gtkCacheOn = 1;                    else gtkCacheOn = 0;                    gtkCacheSize = SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_GETPOS32, 0, 0);                    /* autosync */                    if(SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_GETCHECK, 0, 0) == BST_CHECKED)                        gtkAutoSyncOn = 1;                    else gtkAutoSyncOn = 0;                    gtkAutoSync = SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_GETPOS32, 0, 0);                    /* sub window */                    if(SendDlgItemMessage(hwnd, ID_SUBWINDOW, BM_GETCHECK, 0, 0) == BST_CHECKED)                        sub_window = 1;                    else sub_window = 0;                    /* osd level */                    if(SendDlgItemMessage(hwnd, ID_NONE, BM_GETCHECK, 0, 0) == BST_CHECKED)                        osd_level = 0;                    else if(SendDlgItemMessage(hwnd, ID_OSD1, BM_GETCHECK, 0, 0) == BST_CHECKED)                        osd_level = 1;                    else if(SendDlgItemMessage(hwnd, ID_OSD2, BM_GETCHECK, 0, 0) == BST_CHECKED)                        osd_level = 2;                    else if(SendDlgItemMessage(hwnd, ID_OSD3, BM_GETCHECK, 0, 0) == BST_CHECKED)                        osd_level = 3;                    /* dvd and cd devices */                    SendDlgItemMessage(hwnd, ID_DVDDEVICE, WM_GETTEXT, MAX_PATH, (LPARAM)dvddevice);                    dvd_device = strdup(dvddevice);                    SendDlgItemMessage(hwnd, ID_CDDEVICE, WM_GETTEXT, MAX_PATH, (LPARAM)cdromdevice);                    cdrom_device = strdup(cdromdevice);                    MessageBox(hwnd, "You must restart MPlayer for the changes to take effect.", "MPlayer - Info:", MB_OK);                    DestroyWindow(hwnd);                    break;                }            }            return 0;        }        case WM_DESTROY:            PostQuitMessage (0);            return 0;    }    return DefWindowProc(hwnd, iMsg, wParam, lParam);}void display_prefswindow(gui_t *gui){    HWND hWnd;    HINSTANCE hInstance = GetModuleHandle(NULL);    WNDCLASS wc;    int x, y;    if(FindWindow(NULL, "MPlayer - Preferences")) return;    wc.style         = CS_HREDRAW | CS_VREDRAW;    wc.lpfnWndProc   = PrefsWndProc;    wc.cbClsExtra    = 0;    wc.cbWndExtra    = 0;    wc.hInstance     = hInstance;    wc.hCursor       = LoadCursor(NULL,IDC_ARROW);    wc.hIcon         = gui->icon;    wc.hbrBackground = SOLID_GREY;    wc.lpszClassName = "MPlayer - Preferences";    wc.lpszMenuName  = NULL;    RegisterClass(&wc);    x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (375 / 2);    y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (452 / 2);    hWnd = CreateWindow("MPlayer - Preferences",                        "MPlayer - Preferences",                        WS_POPUPWINDOW | WS_CAPTION,                        x,                        y,                        375,                        452,                        NULL,                        NULL,                        hInstance,                        NULL);   SetWindowLongPtr(hWnd, GWLP_USERDATA, (DWORD) gui);   ShowWindow(hWnd, SW_SHOW);   UpdateWindow(hWnd);}static void set_defaults(void){    proc_priority = "normal";    vo_doublebuffering = 1;    vo_directrendering = 0;    frame_dropping = 0;    soft_vol = 0;    gtkAONorm = 0;    gtkAOExtraStereo = 0;    gtkAOExtraStereoMul = 1.0;    audio_delay = 0.0;    sub_window = 1;    gtkCacheOn = 0;    gtkCacheSize = 2048;    gtkAutoSyncOn = 0;    gtkAutoSync = 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -