func (p *Player) ToggleMute() error {
	if err := p.assertInit(); err != nil {
		return err
	}
	C.libvlc_audio_toggle_mute(p.player)
	return getError()
}
ToggleMute mutes or unmutes the audio output of the player, depending on
the current status.
NOTE: If there is no active audio playback stream, the mute status might
not be available. If digital pass-through (S/PDIF, HDMI, etc.) is in use,
muting may not be applicable.
Some audio output plugins do not support muting.
package vlc
import "C"
import (
	"io"
	"time"
	"unsafe"
)
type PlayerRole uint
const (
	PlayerRoleNone PlayerRole = iota
	PlayerRoleMusic
	PlayerRoleVideo
	PlayerRoleCommunication
	PlayerRoleGame
	PlayerRoleNotification
	PlayerRoleAnimation
	PlayerRoleProduction
	PlayerRoleAccessibility
	PlayerRoleTest
)
type TitleFlag uint
const (
	TitleFlagMenu TitleFlag = iota + 0x01
	TitleFlagInteractive
)
type TitleInfo struct {
	Name     string         
	Duration time.Duration  
	Flags    TitleFlag      
}
type ChapterInfo struct {
	Name     string         
	Duration time.Duration  
	Offset   time.Duration  
}
type NavigationAction uint
const (
	NavigationActionActivate NavigationAction = iota
	NavigationActionUp
	NavigationActionDown
	NavigationActionLeft
	NavigationActionRight
	NavigationActionPopup
)
type Player struct {
	player *C.libvlc_media_player_t
}
func NewPlayer() (*Player, error) {
	if err := inst.assertInit(); err != nil {
		return nil, err
	}
	player := C.libvlc_media_player_new(inst.handle)
	if player == nil {
		return nil, errOrDefault(getError(), ErrPlayerCreate)
	}
	return &Player{player: player}, nil
}
func (p *Player) Release() error {
	if err := p.assertInit(); err != nil {
		return nil
	}
	C.libvlc_media_player_release(p.player)
	p.player = nil
	return getError()
}
func (p *Player) Play() error {
	if err := p.assertInit(); err != nil {
		return err
	}
	if p.IsPlaying() {
		return nil
	}
	if C.libvlc_media_player_play(p.player) < 0 {
		return getError()
	}
	return nil
}
func (p *Player) IsPlaying() bool {
	if err := p.assertInit(); err != nil {
		return false
	}
	return C.libvlc_media_player_is_playing(p.player) != 0
}
func (p *Player) WillPlay() bool {
	if err := p.assertInit(); err != nil {
		return false
	}
	return C.libvlc_media_player_will_play(p.player) != 0
}
func (p *Player) Stop() error {
	if err := p.assertInit(); err != nil {
		return err
	}
	C.libvlc_media_player_stop(p.player)
	return getError()
}
func (p *Player) SetPause(pause bool) error {
	if err := p.assertInit(); err != nil {
		return err
	}
	C.libvlc_media_player_set_pause(p.player, C.int(boolToInt(pause)))
	return getError()
}
func (p *Player) TogglePause() error {
	if err := p.assertInit(); err != nil {
		return err
	}
	C.libvlc_media_player_pause(p.player)
	return getError()
}
func (p *Player) CanPause() bool {
	if err := p.assertInit(); err != nil {
		return false
	}
	return C.libvlc_media_player_can_pause(p.player) != 0
}
func (p *Player) IsSeekable() bool {
	if err := p.assertInit(); err != nil {
		return false
	}
	return C.libvlc_media_player_is_seekable(p.player) != 0
}
func (p *Player) VideoOutputCount() int {
	if err := p.assertInit(); err != nil {
		return 0
	}
	return int(C.libvlc_media_player_has_vout(p.player))
}
func (p *Player) IsScrambled() bool {
	if err := p.assertInit(); err != nil {
		return false
	}
	return C.libvlc_media_player_program_scrambled(p.player) != 0
}
func (p *Player) PlaybackRate() float32 {
	if err := p.assertInit(); err != nil {
		return 0
	}
	return float32(C.libvlc_media_player_get_rate(p.player))
}
func (p *Player) SetPlaybackRate(rate float32) error {
	if err := p.assertInit(); err != nil {
		return err
	}
	C.libvlc_media_player_set_rate(p.player, C.float(rate))
	return getError()
}
func (p *Player) SetFullScreen(fullscreen bool) error {
	if err := p.assertInit(); err != nil {
		return err
	}
	C.libvlc_set_fullscreen(p.player, C.int(boolToInt(fullscreen)))
	return getError()
}
func (p *Player) ToggleFullScreen() error {
	if err := p.assertInit(); err != nil {
		return err
	}
	C.libvlc_toggle_fullscreen(p.player)
	return getError()
}
func (p *Player) IsFullScreen() (bool, error) {
	if err := p.assertInit(); err != nil {
		return false, err
	}
	return C.libvlc_get_fullscreen(p.player) != C.int(0), getError()
}
func (p *Player) Volume() (int, error) {
	if err := p.assertInit(); err != nil {
		return 0, err
	}
	return int(C.libvlc_audio_get_volume(p.player)), getError()
}
func (p *Player) SetVolume(volume int) error {
	if err := p.assertInit(); err != nil {
		return err
	}
	C.libvlc_audio_set_volume(p.player, C.int(volume))
	return getError()
}
func (p *Player) IsMuted() (bool, error) {
	if err := p.assertInit(); err != nil {
		return false, err
	}
	return C.libvlc_audio_get_mute(p.player) > C.int(0), getError()
}
func (p *Player) SetMute(mute bool) error {
	if err := p.assertInit(); err != nil {
		return err
	}
	C.libvlc_audio_set_mute(p.player, C.int(boolToInt(mute)))
	return getError()
}