Example #1
0
void CplayerDlg::OnEffectMode()
{
    int mode = 0;
    player_getparam(g_hplayer, PARAM_VISUAL_EFFECT, &mode);
    mode++; mode %= VISUAL_EFFECT_MAX_NUM;
    player_setparam(g_hplayer, PARAM_VISUAL_EFFECT, &mode);
}
Example #2
0
void CplayerDlg::OnVideoMode()
{
    int mode = 0;
    player_getparam(g_hplayer, PARAM_VIDEO_MODE, &mode);
    mode = (mode == VIDEO_MODE_LETTERBOX) ? VIDEO_MODE_STRETCHED : VIDEO_MODE_LETTERBOX;
    player_setparam(g_hplayer, PARAM_VIDEO_MODE, &mode);
}
Example #3
0
void CplayerDlg::OnVideoMode()
{
    int mode = 0;
    player_getparam(g_hplayer, PARAM_VIDEO_MODE, &mode);
    mode++; mode %= VIDEO_MODE_MAX_NUM;
    player_setparam(g_hplayer, PARAM_VIDEO_MODE, &mode);
}
Example #4
0
void CplayerDlg::PlayerOpenFile(void)
{
    CFileDialog dlg(TRUE);
    TCHAR       path[MAX_PATH];
    char        str [MAX_PATH];

    // kill player progress timer
    KillTimer(TIMER_ID_PROGRESS);

    // stop player first
    if (g_hplayer)
    {
        player_close(g_hplayer);
        g_hplayer = NULL;
    }

    // open file dialog
    if (dlg.DoModal() == IDOK)
    {
        wcscpy_s(path, dlg.GetPathName());
        WideCharToMultiByte(CP_ACP, 0, path, -1, str, MAX_PATH, NULL, NULL);
    }
    else
    {
        OnOK();
        return;
    }

    // player open file
    g_hplayer = player_open(str, GetSafeHwnd());
    if (g_hplayer)
    {
        m_bPlayPause = FALSE;

        /*
        int speed = 150;
        player_setparam(g_hplayer, PARAM_PLAYER_SPEED, &speed);
        */

        // software volume scale -30dB to 12dB
        // range for volume is [-182, 73]
        // -255 - mute, +255 - max volume, 0 - 0dB
        int volume = -0;
        player_setparam(g_hplayer, PARAM_AUDIO_VOLUME, &volume);

        player_setrect(g_hplayer, 0, 0, 0, m_rtClient.right, m_rtClient.bottom - 2);
        player_setrect(g_hplayer, 1, 0, 0, m_rtClient.right, m_rtClient.bottom - 2);
        player_play(g_hplayer);
        SetTimer(TIMER_ID_PROGRESS, 100, NULL);
    }
}
Example #5
0
/*
 * Class:     com_rockcarry_ffplayer_MediaPlayer
 * Method:    nativeSetParam
 * Signature: (JIJ)V
 */
static void JNICALL nativeSetParam(JNIEnv *env, jobject obj, jlong hplayer, jint id, jlong value)
{
    DO_USE_VAR(env);
    DO_USE_VAR(obj);
    player_setparam((void*)hplayer, id, &value);
}