internal DialogProvider(IntPtr hLib) { m_hLib = hLib; libvlc_dialog_cbs callbacks = new libvlc_dialog_cbs(); InitCallbacks(ref callbacks); LibVlcMethods.libvlc_dialog_set_callbacks(hLib, callbacks, IntPtr.Zero); }
private void InitCallbacks(ref libvlc_dialog_cbs cbs) { DisplayErrorCallback error = new DisplayErrorCallback(pf_display_error); DisplayLoginCallback login = new DisplayLoginCallback(pf_display_login); DisplayQuestionCallback question = new DisplayQuestionCallback(pf_display_question); DisplayProgressCallback progress = new DisplayProgressCallback(pf_display_progress); CancelCallback cancel = new CancelCallback(pf_cancel); UpdateProgressCallback updateProgress = new UpdateProgressCallback(pf_update_progress); cbs.pf_cancel = Marshal.GetFunctionPointerForDelegate(cancel); cbs.pf_display_error = Marshal.GetFunctionPointerForDelegate(error); cbs.pf_display_login = Marshal.GetFunctionPointerForDelegate(login); cbs.pf_display_progress = Marshal.GetFunctionPointerForDelegate(progress); cbs.pf_display_question = Marshal.GetFunctionPointerForDelegate(question); cbs.pf_update_progress = Marshal.GetFunctionPointerForDelegate(updateProgress); }