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

📄 profile.c

📁 VC++视频开发实例集锦(包括“远程视频监控”"语音识别系统"等13个经典例子)
💻 C
📖 第 1 页 / 共 2 页
字号:


#include "stdafx.h"
#include "globals.h"
#include "CPI_Playlist.h"
#include "CPI_PlaylistItem.h"


////////////////////////////////////////////////////////////
//
//
//
void    playlist_write_default(void)
{
    char    exepath[MAX_PATH];
    main_get_program_path(GetModuleHandle(NULL), exepath, MAX_PATH);
    strcat(exepath, "default.m3u");
    CPL_ExportPlaylist(globals.m_hPlaylist, exepath);
}
//
//
//
void    options_read(void)
{
    char    pathbuf[MAX_PATH];
    int     teller;
    int     widths[] = {   20,   200,  200,  200,  50,   50,   70,    100,  100,   100, 50};
    int     visibles[] = { TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE };
    int iColIDX;

    main_get_program_path(NULL, pathbuf, MAX_PATH);
    strcat(pathbuf, "coolplayer.ini");

    for(iColIDX = PLAYLIST_first; iColIDX <= PLAYLIST_last; iColIDX++)
    {
        char keyname[100];
        sprintf(keyname, "PlaylistCol%d", iColIDX);
        options.playlist_column_widths[iColIDX] = GetPrivateProfileInt("WindowPos", keyname, widths[iColIDX], pathbuf);

        sprintf(keyname, "PlaylistSeq%d", iColIDX);
        options.playlist_column_seq[iColIDX] = GetPrivateProfileInt("WindowPos", keyname, iColIDX, pathbuf);

        sprintf(keyname, "PlaylistVis%d", iColIDX);
        options.playlist_column_visible[iColIDX] = GetPrivateProfileInt("WindowPos", keyname, visibles[iColIDX], pathbuf) ? TRUE : FALSE;
    }

    options.main_window_pos.x = GetPrivateProfileInt("WindowPos",	// address of section name
                                "WindowX",	// address of key name
                                100,	// return value if key name is not found
                                pathbuf);	// address of initialization filename
    if (options.main_window_pos.x < -10)
        options.main_window_pos.x = 100;
    options.main_window_pos.y = GetPrivateProfileInt("WindowPos",	// address of section name
                                "WindowY",	// address of key name
                                100,	// return value if key name is not found
                                pathbuf);	// address of initialization filename
    if (options.main_window_pos.y < -10)
        options.main_window_pos.y = 100;
    options.playlist_window_pos.left = GetPrivateProfileInt("WindowPos",	// address of section name
                                       "PlaylistX",	// address of key name
                                       100,	// return value if key name is not found
                                       pathbuf);	// address of initialization filename
    if (options.playlist_window_pos.left < -10)
        options.playlist_window_pos.left = 100;
    options.playlist_window_pos.top = GetPrivateProfileInt("WindowPos",	// address of section name
                                      "PlaylistY",	// address of key name
                                      100,	// return value if key name is not found
                                      pathbuf);	// address of initialization filename
    if (options.playlist_window_pos.top < -10)
        options.playlist_window_pos.top = 100;
    options.playlist_window_pos.right = GetPrivateProfileInt("WindowPos",	// address of section name
                                        "PlaylistW",	// address of key name
                                        300,	// return value if key name is not found
                                        pathbuf) + options.playlist_window_pos.left;	// address of initialization filename
    options.playlist_window_pos.bottom = GetPrivateProfileInt("WindowPos",	// address of section name
                                         "PlaylistH",	// address of key name
                                         400,	// return value if key name is not found
                                         pathbuf) + options.playlist_window_pos.top;	// address of initialization filename

    GetPrivateProfileString("LastDirectory",	// points to section name
                            "Directory",	// points to key name
                            "",	// points to default string
                            options.last_used_directory,	// points to destination buffer
                            MAX_PATH,	// size of destination buffer
                            pathbuf);	// points to initialization filename

    options.repeat_playlist =
        GetPrivateProfileInt("Misc", "Repeat", 0, pathbuf);
    options.shuffle_play =
        GetPrivateProfileInt("Misc", "Shuffle", 0, pathbuf);
    options.always_on_top =
        GetPrivateProfileInt("Misc", "Ontop", 0, pathbuf);
    options.auto_exit_after_playing =
        GetPrivateProfileInt("Misc", "Autoexit", 0, pathbuf);
    options.remember_playlist =
        GetPrivateProfileInt("Misc", "Rememberpls", 1, pathbuf);
    options.show_remaining_time =
        GetPrivateProfileInt("Misc", "Remaining", 0, pathbuf);
    options.read_id3_tag =
        GetPrivateProfileInt("Misc", "ReadID3tag", 1, pathbuf);
    options.support_id3v2 =
        GetPrivateProfileInt("Misc", "SuportID3v2", 1, pathbuf);
    options.prefer_native_ogg_tags =
        GetPrivateProfileInt("Misc", "PreferNativeOGGtags", 1, pathbuf);
    options.read_id3_tag_in_background =
        GetPrivateProfileInt("Misc", "BackgroundReadID3", 1, pathbuf);
    options.work_out_track_lengths =
        GetPrivateProfileInt("Misc", "WorkOutTrackLengths", 1, pathbuf);
    options.allow_multiple_instances =
        GetPrivateProfileInt("Misc", "AllowMultipleInstances", 0, pathbuf);
    options.read_id3_tag_of_selected =
        GetPrivateProfileInt("Misc", "ReadSelID3tag", 1, pathbuf);
    options.seconds_delay_after_track =
        GetPrivateProfileInt("Misc", "DelayTime", 0, pathbuf);

    options.decoder_output_mode =
        GetPrivateProfileInt("Misc", "Outputmode", 1, pathbuf);
    options.easy_move =
        GetPrivateProfileInt("Misc", "Easymove", 1, pathbuf);
    options.remember_skin_count =
        GetPrivateProfileInt("Misc", "RememberSkins", 4, pathbuf);

    options.allow_file_once_in_playlist =
        GetPrivateProfileInt("Misc", "Fileonce", 1, pathbuf);
    options.auto_play_when_started =
        GetPrivateProfileInt("Misc", "Autoplay", 0, pathbuf);
    options.show_on_taskbar =
        GetPrivateProfileInt("Misc", "TaskBar", 0, pathbuf);

    options.show_playlist = GetPrivateProfileInt("Misc", "ShowPlaylist", 0, pathbuf);

    options.rotate_systray_icon =
        GetPrivateProfileInt("Misc", "RotateIcon", 1, pathbuf);
    options.scroll_track_title =
        GetPrivateProfileInt("Misc", "Scrolltitle", 1, pathbuf);

    GetPrivateProfileString("Misc",	// points to section name
                            "RememberLastSong",	// points to key name
                            "",	// points to default string
                            options.initial_file,	// points to destination buffer
                            MAX_PATH,	// size of destination buffer
                            pathbuf);	// points to initialization filename

    if(*options.initial_file)
        options.remember_last_played_track = TRUE;

    options.last_selected_skin_number =
        GetPrivateProfileInt("Skin", "LastSkin", 0, pathbuf);
    options.use_default_skin =
        GetPrivateProfileInt("Skin", "UseDefault", 1, pathbuf);
    options.use_playlist_skin =
        GetPrivateProfileInt("Skin", "Useplaylistskin", 0, pathbuf);

    {
        int     teller;
        for (teller = MENU_SKIN_DEFAULT+1; teller < MENU_SKIN_DEFAULT+1 + options.remember_skin_count;
                teller++) {
            char    SkinFileString[MAX_PATH];
            char    skinpath[MAX_PATH];
            sprintf(SkinFileString, "SkinFile%d", teller - MENU_SKIN_DEFAULT);
            GetPrivateProfileString("Skin", SkinFileString, "",
                                    skinpath, MAX_PATH, pathbuf);
            if (*skinpath != 0) {
                main_skin_add_to_menu(skinpath);
                if (options.last_selected_skin_number == teller - MENU_SKIN_DEFAULT) {
                    strcpy(options.main_skin_file, skinpath);
                }
            }
        }
    }

    GetPrivateProfileString("Skin", "PlaylistSkin", "",
                            options.playlist_skin_file, MAX_PATH, pathbuf);
    options.equalizer =
        GetPrivateProfileInt("Equalizer", "Active", 0, pathbuf);

    for (teller = 1; teller <= 8; teller++) {
        char    keyname[100];
        sprintf(keyname, "Eq%d", teller);
        options.eq_settings[teller] =
            GetPrivateProfileInt("Equalizer", keyname, 0, pathbuf);
    }

    // Read quick find defaults
    {
        char pcQuickFindOption[2];
        GetPrivateProfileString("Misc", "QuickFindSearchTerm", "T", pcQuickFindOption, 2, pathbuf);
        if(pcQuickFindOption[0] == 'M' || pcQuickFindOption[0] == 'm')
            options.m_enQuickFindTerm = qftAlbum;
        else if(pcQuickFindOption[0] == 'A' || pcQuickFindOption[0] == 'a')
            options.m_enQuickFindTerm = qftArtist;
        else
            options.m_enQuickFindTerm = qftTitle;
    }

    // Read mixer mode
    {
        char cMixerMode[32];
        GetPrivateProfileString("Mixer", "Mode", "Master", cMixerMode, 32, pathbuf);

        if(stricmp(cMixerMode, "wave") == 0)
            globals.m_enMixerMode = mmWaveVolume;
        else if(stricmp(cMixerMode, "internal") == 0)
            globals.m_enMixerMode = mmInternal;
        else
            globals.m_enMixerMode = mmMasterVolume;
        globals.m_iVolume = GetPrivateProfileInt("Mixer", "InternalVolume", 60, pathbuf);
    }
}

void    options_write()
{
    char    intbuf[33];
    int     teller;
    char    pathbuf[MAX_PATH];
    int iColIDX;

    main_get_program_path(NULL, pathbuf, MAX_PATH);

⌨️ 快捷键说明

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