idx
int64
0
251k
question
stringlengths
53
3.53k
target
stringlengths
5
1.23k
len_question
int64
20
893
len_target
int64
3
238
230,300
def libvlc_media_list_player_event_manager ( p_mlp ) : f = _Cfunctions . get ( 'libvlc_media_list_player_event_manager' , None ) or _Cfunction ( 'libvlc_media_list_player_event_manager' , ( ( 1 , ) , ) , class_result ( EventManager ) , ctypes . c_void_p , MediaListPlayer ) return f ( p_mlp )
Return the event manager of this media_list_player .
106
12
230,301
def libvlc_media_list_player_set_media_player ( p_mlp , p_mi ) : f = _Cfunctions . get ( 'libvlc_media_list_player_set_media_player' , None ) or _Cfunction ( 'libvlc_media_list_player_set_media_player' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaListPlayer , MediaPlayer ) return f ( p_mlp , p_mi )
Replace media player in media_list_player with this instance .
115
14
230,302
def libvlc_media_list_player_set_media_list ( p_mlp , p_mlist ) : f = _Cfunctions . get ( 'libvlc_media_list_player_set_media_list' , None ) or _Cfunction ( 'libvlc_media_list_player_set_media_list' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaListPlayer , MediaList ) return f ( p_mlp , p_mlist )
Set the media list associated with the player .
117
9
230,303
def libvlc_media_list_player_is_playing ( p_mlp ) : f = _Cfunctions . get ( 'libvlc_media_list_player_is_playing' , None ) or _Cfunction ( 'libvlc_media_list_player_is_playing' , ( ( 1 , ) , ) , None , ctypes . c_int , MediaListPlayer ) return f ( p_mlp )
Is media list playing?
98
5
230,304
def libvlc_media_list_player_get_state ( p_mlp ) : f = _Cfunctions . get ( 'libvlc_media_list_player_get_state' , None ) or _Cfunction ( 'libvlc_media_list_player_get_state' , ( ( 1 , ) , ) , None , State , MediaListPlayer ) return f ( p_mlp )
Get current libvlc_state of media list player .
93
12
230,305
def libvlc_media_list_player_play_item_at_index ( p_mlp , i_index ) : f = _Cfunctions . get ( 'libvlc_media_list_player_play_item_at_index' , None ) or _Cfunction ( 'libvlc_media_list_player_play_item_at_index' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaListPlayer , ctypes . c_int ) return f ( p_mlp , i_index )
Play media list item at position index .
130
8
230,306
def libvlc_media_list_player_play_item ( p_mlp , p_md ) : f = _Cfunctions . get ( 'libvlc_media_list_player_play_item' , None ) or _Cfunction ( 'libvlc_media_list_player_play_item' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaListPlayer , Media ) return f ( p_mlp , p_md )
Play the given media item .
113
6
230,307
def libvlc_media_list_player_set_playback_mode ( p_mlp , e_mode ) : f = _Cfunctions . get ( 'libvlc_media_list_player_set_playback_mode' , None ) or _Cfunction ( 'libvlc_media_list_player_set_playback_mode' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaListPlayer , PlaybackMode ) return f ( p_mlp , e_mode )
Sets the playback mode for the playlist .
119
9
230,308
def libvlc_media_player_new ( p_libvlc_instance ) : f = _Cfunctions . get ( 'libvlc_media_player_new' , None ) or _Cfunction ( 'libvlc_media_player_new' , ( ( 1 , ) , ) , class_result ( MediaPlayer ) , ctypes . c_void_p , Instance ) return f ( p_libvlc_instance )
Create an empty Media Player object .
99
7
230,309
def libvlc_media_player_new_from_media ( p_md ) : f = _Cfunctions . get ( 'libvlc_media_player_new_from_media' , None ) or _Cfunction ( 'libvlc_media_player_new_from_media' , ( ( 1 , ) , ) , class_result ( MediaPlayer ) , ctypes . c_void_p , Media ) return f ( p_md )
Create a Media Player object from a Media .
102
9
230,310
def libvlc_media_player_set_media ( p_mi , p_md ) : f = _Cfunctions . get ( 'libvlc_media_player_set_media' , None ) or _Cfunction ( 'libvlc_media_player_set_media' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , Media ) return f ( p_mi , p_md )
Set the media that will be used by the media_player . If any previous md will be released .
99
21
230,311
def libvlc_media_player_get_media ( p_mi ) : f = _Cfunctions . get ( 'libvlc_media_player_get_media' , None ) or _Cfunction ( 'libvlc_media_player_get_media' , ( ( 1 , ) , ) , class_result ( Media ) , ctypes . c_void_p , MediaPlayer ) return f ( p_mi )
Get the media used by the media_player .
96
10
230,312
def libvlc_media_player_event_manager ( p_mi ) : f = _Cfunctions . get ( 'libvlc_media_player_event_manager' , None ) or _Cfunction ( 'libvlc_media_player_event_manager' , ( ( 1 , ) , ) , class_result ( EventManager ) , ctypes . c_void_p , MediaPlayer ) return f ( p_mi )
Get the Event Manager from which the media player send event .
97
12
230,313
def libvlc_media_player_set_agl ( p_mi , drawable ) : f = _Cfunctions . get ( 'libvlc_media_player_set_agl' , None ) or _Cfunction ( 'libvlc_media_player_set_agl' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_uint32 ) return f ( p_mi , drawable )
Set the agl handler where the media player should render its video output .
106
15
230,314
def libvlc_media_player_set_position ( p_mi , f_pos ) : f = _Cfunctions . get ( 'libvlc_media_player_set_position' , None ) or _Cfunction ( 'libvlc_media_player_set_position' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_float ) return f ( p_mi , f_pos )
Set movie position as percentage between 0 . 0 and 1 . 0 . This has no effect if playback is not enabled . This might not work depending on the underlying input format and protocol .
104
37
230,315
def libvlc_media_player_get_chapter_count_for_title ( p_mi , i_title ) : f = _Cfunctions . get ( 'libvlc_media_player_get_chapter_count_for_title' , None ) or _Cfunction ( 'libvlc_media_player_get_chapter_count_for_title' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaPlayer , ctypes . c_int ) return f ( p_mi , i_title )
Get title chapter count .
127
5
230,316
def libvlc_media_player_set_rate ( p_mi , rate ) : f = _Cfunctions . get ( 'libvlc_media_player_set_rate' , None ) or _Cfunction ( 'libvlc_media_player_set_rate' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaPlayer , ctypes . c_float ) return f ( p_mi , rate )
Set movie play rate .
105
5
230,317
def libvlc_media_player_get_state ( p_mi ) : f = _Cfunctions . get ( 'libvlc_media_player_get_state' , None ) or _Cfunction ( 'libvlc_media_player_get_state' , ( ( 1 , ) , ) , None , State , MediaPlayer ) return f ( p_mi )
Get current movie state .
84
5
230,318
def libvlc_media_player_get_fps ( p_mi ) : f = _Cfunctions . get ( 'libvlc_media_player_get_fps' , None ) or _Cfunction ( 'libvlc_media_player_get_fps' , ( ( 1 , ) , ) , None , ctypes . c_float , MediaPlayer ) return f ( p_mi )
Get movie fps rate .
89
5
230,319
def libvlc_media_player_has_vout ( p_mi ) : f = _Cfunctions . get ( 'libvlc_media_player_has_vout' , None ) or _Cfunction ( 'libvlc_media_player_has_vout' , ( ( 1 , ) , ) , None , ctypes . c_uint , MediaPlayer ) return f ( p_mi )
How many video outputs does this media player have?
92
10
230,320
def libvlc_media_player_navigate ( p_mi , navigate ) : f = _Cfunctions . get ( 'libvlc_media_player_navigate' , None ) or _Cfunction ( 'libvlc_media_player_navigate' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_uint ) return f ( p_mi , navigate )
Navigate through DVD Menu .
97
6
230,321
def libvlc_media_player_set_video_title_display ( p_mi , position , timeout ) : f = _Cfunctions . get ( 'libvlc_media_player_set_video_title_display' , None ) or _Cfunction ( 'libvlc_media_player_set_video_title_display' , ( ( 1 , ) , ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , Position , ctypes . c_int ) return f ( p_mi , position , timeout )
Set if and how the video title will be shown when media is played .
123
15
230,322
def libvlc_set_fullscreen ( p_mi , b_fullscreen ) : f = _Cfunctions . get ( 'libvlc_set_fullscreen' , None ) or _Cfunction ( 'libvlc_set_fullscreen' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_int ) return f ( p_mi , b_fullscreen )
Enable or disable fullscreen .
97
6
230,323
def libvlc_video_set_key_input ( p_mi , on ) : f = _Cfunctions . get ( 'libvlc_video_set_key_input' , None ) or _Cfunction ( 'libvlc_video_set_key_input' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_uint ) return f ( p_mi , on )
Enable or disable key press events handling according to the LibVLC hotkeys configuration . By default and for historical reasons keyboard events are handled by the LibVLC video widget .
100
35
230,324
def libvlc_video_get_size ( p_mi , num ) : f = _Cfunctions . get ( 'libvlc_video_get_size' , None ) or _Cfunction ( 'libvlc_video_get_size' , ( ( 1 , ) , ( 1 , ) , ( 2 , ) , ( 2 , ) , ) , None , ctypes . c_int , MediaPlayer , ctypes . c_uint , ctypes . POINTER ( ctypes . c_uint ) , ctypes . POINTER ( ctypes . c_uint ) ) return f ( p_mi , num )
Get the pixel dimensions of a video .
137
8
230,325
def libvlc_video_get_aspect_ratio ( p_mi ) : f = _Cfunctions . get ( 'libvlc_video_get_aspect_ratio' , None ) or _Cfunction ( 'libvlc_video_get_aspect_ratio' , ( ( 1 , ) , ) , string_result , ctypes . c_void_p , MediaPlayer ) return f ( p_mi )
Get current video aspect ratio .
99
6
230,326
def libvlc_video_set_aspect_ratio ( p_mi , psz_aspect ) : f = _Cfunctions . get ( 'libvlc_video_set_aspect_ratio' , None ) or _Cfunction ( 'libvlc_video_set_aspect_ratio' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_char_p ) return f ( p_mi , psz_aspect )
Set new video aspect ratio .
116
6
230,327
def libvlc_video_get_spu ( p_mi ) : f = _Cfunctions . get ( 'libvlc_video_get_spu' , None ) or _Cfunction ( 'libvlc_video_get_spu' , ( ( 1 , ) , ) , None , ctypes . c_int , MediaPlayer ) return f ( p_mi )
Get current video subtitle .
86
5
230,328
def libvlc_video_set_spu ( p_mi , i_spu ) : f = _Cfunctions . get ( 'libvlc_video_set_spu' , None ) or _Cfunction ( 'libvlc_video_set_spu' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaPlayer , ctypes . c_int ) return f ( p_mi , i_spu )
Set new video subtitle .
108
5
230,329
def libvlc_video_set_subtitle_file ( p_mi , psz_subtitle ) : f = _Cfunctions . get ( 'libvlc_video_set_subtitle_file' , None ) or _Cfunction ( 'libvlc_video_set_subtitle_file' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaPlayer , ctypes . c_char_p ) return f ( p_mi , psz_subtitle )
Set new video subtitle file .
118
6
230,330
def libvlc_video_set_spu_delay ( p_mi , i_delay ) : f = _Cfunctions . get ( 'libvlc_video_set_spu_delay' , None ) or _Cfunction ( 'libvlc_video_set_spu_delay' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaPlayer , ctypes . c_int64 ) return f ( p_mi , i_delay )
Set the subtitle delay . This affects the timing of when the subtitle will be displayed . Positive values result in subtitles being displayed later while negative values will result in subtitles being displayed earlier . The subtitle delay will be reset to zero each time the media changes .
113
50
230,331
def libvlc_video_get_chapter_description ( p_mi , i_title ) : f = _Cfunctions . get ( 'libvlc_video_get_chapter_description' , None ) or _Cfunction ( 'libvlc_video_get_chapter_description' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . POINTER ( TrackDescription ) , MediaPlayer , ctypes . c_int ) return f ( p_mi , i_title )
Get the description of available chapters for specific title .
112
10
230,332
def libvlc_video_set_crop_geometry ( p_mi , psz_geometry ) : f = _Cfunctions . get ( 'libvlc_video_set_crop_geometry' , None ) or _Cfunction ( 'libvlc_video_set_crop_geometry' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_char_p ) return f ( p_mi , psz_geometry )
Set new crop filter geometry .
113
6
230,333
def libvlc_video_set_teletext ( p_mi , i_page ) : f = _Cfunctions . get ( 'libvlc_video_set_teletext' , None ) or _Cfunction ( 'libvlc_video_set_teletext' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_int ) return f ( p_mi , i_page )
Set new teletext page to retrieve .
101
8
230,334
def libvlc_video_get_track_description ( p_mi ) : f = _Cfunctions . get ( 'libvlc_video_get_track_description' , None ) or _Cfunction ( 'libvlc_video_get_track_description' , ( ( 1 , ) , ) , None , ctypes . POINTER ( TrackDescription ) , MediaPlayer ) return f ( p_mi )
Get the description of available video tracks .
92
8
230,335
def libvlc_video_set_deinterlace ( p_mi , psz_mode ) : f = _Cfunctions . get ( 'libvlc_video_set_deinterlace' , None ) or _Cfunction ( 'libvlc_video_set_deinterlace' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_char_p ) return f ( p_mi , psz_mode )
Enable or disable deinterlace filter .
108
8
230,336
def libvlc_video_get_marquee_string ( p_mi , option ) : f = _Cfunctions . get ( 'libvlc_video_get_marquee_string' , None ) or _Cfunction ( 'libvlc_video_get_marquee_string' , ( ( 1 , ) , ( 1 , ) , ) , string_result , ctypes . c_void_p , MediaPlayer , ctypes . c_uint ) return f ( p_mi , option )
Get a string marquee option value .
115
7
230,337
def libvlc_video_set_marquee_string ( p_mi , option , psz_text ) : f = _Cfunctions . get ( 'libvlc_video_set_marquee_string' , None ) or _Cfunction ( 'libvlc_video_set_marquee_string' , ( ( 1 , ) , ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_uint , ctypes . c_char_p ) return f ( p_mi , option , psz_text )
Set a marquee string option .
130
6
230,338
def libvlc_video_get_logo_int ( p_mi , option ) : f = _Cfunctions . get ( 'libvlc_video_get_logo_int' , None ) or _Cfunction ( 'libvlc_video_get_logo_int' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaPlayer , ctypes . c_uint ) return f ( p_mi , option )
Get integer logo option .
108
5
230,339
def libvlc_video_set_logo_string ( p_mi , option , psz_value ) : f = _Cfunctions . get ( 'libvlc_video_set_logo_string' , None ) or _Cfunction ( 'libvlc_video_set_logo_string' , ( ( 1 , ) , ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_uint , ctypes . c_char_p ) return f ( p_mi , option , psz_value )
Set logo option as string . Options that take a different type value are ignored .
127
16
230,340
def libvlc_video_get_adjust_float ( p_mi , option ) : f = _Cfunctions . get ( 'libvlc_video_get_adjust_float' , None ) or _Cfunction ( 'libvlc_video_get_adjust_float' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_float , MediaPlayer , ctypes . c_uint ) return f ( p_mi , option )
Get float adjust option .
105
5
230,341
def libvlc_video_set_adjust_float ( p_mi , option , value ) : f = _Cfunctions . get ( 'libvlc_video_set_adjust_float' , None ) or _Cfunction ( 'libvlc_video_set_adjust_float' , ( ( 1 , ) , ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_uint , ctypes . c_float ) return f ( p_mi , option , value )
Set adjust option as float . Options that take a different type value are ignored .
116
16
230,342
def libvlc_audio_output_list_get ( p_instance ) : f = _Cfunctions . get ( 'libvlc_audio_output_list_get' , None ) or _Cfunction ( 'libvlc_audio_output_list_get' , ( ( 1 , ) , ) , None , ctypes . POINTER ( AudioOutput ) , Instance ) return f ( p_instance )
Gets the list of available audio output modules .
92
10
230,343
def libvlc_audio_output_list_release ( p_list ) : f = _Cfunctions . get ( 'libvlc_audio_output_list_release' , None ) or _Cfunction ( 'libvlc_audio_output_list_release' , ( ( 1 , ) , ) , None , None , ctypes . POINTER ( AudioOutput ) ) return f ( p_list )
Frees the list of available audio output modules .
91
10
230,344
def libvlc_audio_output_set ( p_mi , psz_name ) : f = _Cfunctions . get ( 'libvlc_audio_output_set' , None ) or _Cfunction ( 'libvlc_audio_output_set' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaPlayer , ctypes . c_char_p ) return f ( p_mi , psz_name )
Selects an audio output module .
107
7
230,345
def libvlc_audio_output_device_list_release ( p_list ) : f = _Cfunctions . get ( 'libvlc_audio_output_device_list_release' , None ) or _Cfunction ( 'libvlc_audio_output_device_list_release' , ( ( 1 , ) , ) , None , None , ctypes . POINTER ( AudioOutputDevice ) ) return f ( p_list )
Frees a list of available audio output devices .
98
10
230,346
def libvlc_audio_set_mute ( p_mi , status ) : f = _Cfunctions . get ( 'libvlc_audio_set_mute' , None ) or _Cfunction ( 'libvlc_audio_set_mute' , ( ( 1 , ) , ( 1 , ) , ) , None , None , MediaPlayer , ctypes . c_int ) return f ( p_mi , status )
Set mute status .
97
4
230,347
def libvlc_audio_set_volume ( p_mi , i_volume ) : f = _Cfunctions . get ( 'libvlc_audio_set_volume' , None ) or _Cfunction ( 'libvlc_audio_set_volume' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaPlayer , ctypes . c_int ) return f ( p_mi , i_volume )
Set current software audio volume .
103
6
230,348
def libvlc_audio_set_track ( p_mi , i_track ) : f = _Cfunctions . get ( 'libvlc_audio_set_track' , None ) or _Cfunction ( 'libvlc_audio_set_track' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaPlayer , ctypes . c_int ) return f ( p_mi , i_track )
Set current audio track .
103
5
230,349
def libvlc_audio_set_channel ( p_mi , channel ) : f = _Cfunctions . get ( 'libvlc_audio_set_channel' , None ) or _Cfunction ( 'libvlc_audio_set_channel' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , MediaPlayer , ctypes . c_int ) return f ( p_mi , channel )
Set current audio channel .
99
5
230,350
def libvlc_audio_get_delay ( p_mi ) : f = _Cfunctions . get ( 'libvlc_audio_get_delay' , None ) or _Cfunction ( 'libvlc_audio_get_delay' , ( ( 1 , ) , ) , None , ctypes . c_int64 , MediaPlayer ) return f ( p_mi )
Get current audio delay .
84
5
230,351
def libvlc_audio_equalizer_get_preset_name ( u_index ) : f = _Cfunctions . get ( 'libvlc_audio_equalizer_get_preset_name' , None ) or _Cfunction ( 'libvlc_audio_equalizer_get_preset_name' , ( ( 1 , ) , ) , None , ctypes . c_char_p , ctypes . c_uint ) return f ( u_index )
Get the name of a particular equalizer preset . This name can be used for example to prepare a preset label or menu in a user interface .
107
29
230,352
def libvlc_audio_equalizer_get_band_frequency ( u_index ) : f = _Cfunctions . get ( 'libvlc_audio_equalizer_get_band_frequency' , None ) or _Cfunction ( 'libvlc_audio_equalizer_get_band_frequency' , ( ( 1 , ) , ) , None , ctypes . c_float , ctypes . c_uint ) return f ( u_index )
Get a particular equalizer band frequency . This value can be used for example to create a label for an equalizer band control in a user interface .
102
30
230,353
def libvlc_audio_equalizer_get_preamp ( p_equalizer ) : f = _Cfunctions . get ( 'libvlc_audio_equalizer_get_preamp' , None ) or _Cfunction ( 'libvlc_audio_equalizer_get_preamp' , ( ( 1 , ) , ) , None , ctypes . c_float , ctypes . c_void_p ) return f ( p_equalizer )
Get the current pre - amplification value from an equalizer .
103
12
230,354
def libvlc_audio_equalizer_get_amp_at_index ( p_equalizer , u_band ) : f = _Cfunctions . get ( 'libvlc_audio_equalizer_get_amp_at_index' , None ) or _Cfunction ( 'libvlc_audio_equalizer_get_amp_at_index' , ( ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_float , ctypes . c_void_p , ctypes . c_uint ) return f ( p_equalizer , u_band )
Get the amplification value for a particular equalizer frequency band .
132
12
230,355
def libvlc_vlm_set_loop ( p_instance , psz_name , b_loop ) : f = _Cfunctions . get ( 'libvlc_vlm_set_loop' , None ) or _Cfunction ( 'libvlc_vlm_set_loop' , ( ( 1 , ) , ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , Instance , ctypes . c_char_p , ctypes . c_int ) return f ( p_instance , psz_name , b_loop )
Set a media s loop status .
130
7
230,356
def libvlc_vlm_seek_media ( p_instance , psz_name , f_percentage ) : f = _Cfunctions . get ( 'libvlc_vlm_seek_media' , None ) or _Cfunction ( 'libvlc_vlm_seek_media' , ( ( 1 , ) , ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , Instance , ctypes . c_char_p , ctypes . c_float ) return f ( p_instance , psz_name , f_percentage )
Seek in the named broadcast .
132
7
230,357
def libvlc_vlm_show_media ( p_instance , psz_name ) : f = _Cfunctions . get ( 'libvlc_vlm_show_media' , None ) or _Cfunction ( 'libvlc_vlm_show_media' , ( ( 1 , ) , ( 1 , ) , ) , string_result , ctypes . c_void_p , Instance , ctypes . c_char_p ) return f ( p_instance , psz_name )
Return information about the named media as a JSON string representation . This function is mainly intended for debugging use if you want programmatic access to the state of a vlm_media_instance_t please use the corresponding libvlc_vlm_get_media_instance_xxx - functions . Currently there are no such functions available for vlm_media_t though .
114
78
230,358
def libvlc_vlm_get_media_instance_position ( p_instance , psz_name , i_instance ) : f = _Cfunctions . get ( 'libvlc_vlm_get_media_instance_position' , None ) or _Cfunction ( 'libvlc_vlm_get_media_instance_position' , ( ( 1 , ) , ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_float , Instance , ctypes . c_char_p , ctypes . c_int ) return f ( p_instance , psz_name , i_instance )
Get vlm_media instance position by name or instance id .
142
14
230,359
def libvlc_vlm_get_media_instance_time ( p_instance , psz_name , i_instance ) : f = _Cfunctions . get ( 'libvlc_vlm_get_media_instance_time' , None ) or _Cfunction ( 'libvlc_vlm_get_media_instance_time' , ( ( 1 , ) , ( 1 , ) , ( 1 , ) , ) , None , ctypes . c_int , Instance , ctypes . c_char_p , ctypes . c_int ) return f ( p_instance , psz_name , i_instance )
Get vlm_media instance time by name or instance id .
142
14
230,360
def libvlc_vlm_get_event_manager ( p_instance ) : f = _Cfunctions . get ( 'libvlc_vlm_get_event_manager' , None ) or _Cfunction ( 'libvlc_vlm_get_event_manager' , ( ( 1 , ) , ) , class_result ( EventManager ) , ctypes . c_void_p , Instance ) return f ( p_instance )
Get libvlc_event_manager from a vlm media . The p_event_manager is immutable so you don t have to hold the lock .
100
33
230,361
def debug_callback ( event , * args , * * kwds ) : l = [ 'event %s' % ( event . type , ) ] if args : l . extend ( map ( str , args ) ) if kwds : l . extend ( sorted ( '%s=%s' % t for t in kwds . items ( ) ) ) print ( 'Debug callback (%s)' % ', ' . join ( l ) )
Example callback useful for debugging .
96
6
230,362
def event_attach ( self , eventtype , callback , * args , * * kwds ) : if not isinstance ( eventtype , EventType ) : raise VLCException ( "%s required: %r" % ( 'EventType' , eventtype ) ) if not hasattr ( callback , '__call__' ) : # callable() raise VLCException ( "%s required: %r" % ( 'callable' , callback ) ) # check that the callback expects arguments if not any ( getargspec ( callback ) [ : 2 ] ) : # list(...) raise VLCException ( "%s required: %r" % ( 'argument' , callback ) ) if self . _callback_handler is None : _called_from_ctypes = ctypes . CFUNCTYPE ( None , ctypes . POINTER ( Event ) , ctypes . c_void_p ) @ _called_from_ctypes def _callback_handler ( event , k ) : """(INTERNAL) handle callback call from ctypes. @note: We cannot simply make this an EventManager method since ctypes does not prepend self as the first parameter, hence this closure. """ try : # retrieve Python callback and arguments call , args , kwds = self . _callbacks [ k ] # deref event.contents to simplify callback code call ( event . contents , * args , * * kwds ) except KeyError : # detached? pass self . _callback_handler = _callback_handler self . _callbacks = { } k = eventtype . value r = libvlc_event_attach ( self , k , self . _callback_handler , k ) if not r : self . _callbacks [ k ] = ( callback , args , kwds ) return r
Register an event notification .
384
5
230,363
def media_player_new ( self , uri = None ) : p = libvlc_media_player_new ( self ) if uri : p . set_media ( self . media_new ( uri ) ) p . _instance = self return p
Create a new MediaPlayer instance .
57
7
230,364
def media_new ( self , mrl , * options ) : if ':' in mrl and mrl . index ( ':' ) > 1 : # Assume it is a URL m = libvlc_media_new_location ( self , str_to_bytes ( mrl ) ) else : # Else it should be a local path. m = libvlc_media_new_path ( self , str_to_bytes ( os . path . normpath ( mrl ) ) ) for o in options : libvlc_media_add_option ( m , str_to_bytes ( o ) ) m . _instance = self return m
Create a new Media instance .
140
6
230,365
def media_list_new ( self , mrls = None ) : l = libvlc_media_list_new ( self ) # We should take the lock, but since we did not leak the # reference, nobody else can access it. if mrls : for m in mrls : l . add_media ( m ) l . _instance = self return l
Create a new MediaList instance .
81
7
230,366
def audio_output_enumerate_devices ( self ) : r = [ ] head = libvlc_audio_output_list_get ( self ) if head : i = head while i : i = i . contents d = [ { 'id' : libvlc_audio_output_device_id ( self , i . name , d ) , 'longname' : libvlc_audio_output_device_longname ( self , i . name , d ) } for d in range ( libvlc_audio_output_device_count ( self , i . name ) ) ] r . append ( { 'name' : i . name , 'description' : i . description , 'devices' : d } ) i = i . next libvlc_audio_output_list_release ( head ) return r
Enumerate the defined audio output devices .
178
9
230,367
def vlm_add_input ( self , psz_name , psz_input ) : return libvlc_vlm_add_input ( self , str_to_bytes ( psz_name ) , str_to_bytes ( psz_input ) )
Add a media s input MRL . This will add the specified one .
60
15
230,368
def vlm_change_media ( self , psz_name , psz_input , psz_output , i_options , ppsz_options , b_enabled , b_loop ) : return libvlc_vlm_change_media ( self , str_to_bytes ( psz_name ) , str_to_bytes ( psz_input ) , str_to_bytes ( psz_output ) , i_options , ppsz_options , b_enabled , b_loop )
Edit the parameters of a media . This will delete all existing inputs and add the specified one .
113
19
230,369
def set_mrl ( self , mrl , * options ) : m = self . get_instance ( ) . media_new ( mrl , * options ) self . set_media ( m ) return m
Set the MRL to play .
45
7
230,370
def do ( self ) : self . _runner = self . _generator ( * self . args , * * self . kwargs ) rets = next ( self . _runner ) if isinstance ( rets , tuple ) : self . _text = rets [ 0 ] return rets [ 1 : ] elif rets is None : self . _text = '' return None else : self . _text = rets return None
Do or redo the action
93
6
230,371
def redo ( self ) : if self . canredo ( ) : undoable = self . _redos . pop ( ) with self . _pausereceiver ( ) : try : undoable . do ( ) except : self . clear ( ) raise else : self . _undos . append ( undoable ) self . docallback ( )
Redo the last undone action . This is only possible if no other actions have occurred since the last undo call .
73
23
230,372
def clear ( self ) : self . _undos . clear ( ) self . _redos . clear ( ) self . _savepoint = None self . _receiver = self . _undos
Clear the undo list .
42
5
230,373
def is_bbox_not_intersecting ( self , other ) : self_x_min , self_x_max , self_y_min , self_y_max = self . get_bbox ( ) other_x_min , other_x_max , other_y_min , other_y_max = other . get_bbox ( ) return self_x_min > other_x_max or other_x_min > self_x_max or self_y_min > other_y_max or other_y_min > self_y_max
Returns False iif bounding boxed of self and other intersect
129
12
230,374
def is_edge_not_excluding_vertices ( self , other ) : c_a = cos ( self . angle ) s_a = sin ( self . angle ) # Get min and max of other. other_x_min , other_x_max , other_y_min , other_y_max = other . get_bbox ( ) self_x_diff = 0.5 * self . width self_y_diff = 0.5 * self . height if c_a > 0 : if s_a > 0 : return c_a * other_x_max + s_a * other_y_max < - self_x_diff or c_a * other_x_min + s_a * other_y_min > self_x_diff or c_a * other_y_max - s_a * other_x_min < - self_y_diff or c_a * other_y_min - s_a * other_x_max > self_y_diff else : # s_a <= 0.0 return c_a * other_x_max + s_a * other_y_min < - self_x_diff or c_a * other_x_min + s_a * other_y_max > self_x_diff or c_a * other_y_max - s_a * other_x_max < - self_y_diff or c_a * other_y_min - s_a * other_x_min > self_y_diff else : # c_a <= 0.0 if s_a > 0 : return c_a * other_x_min + s_a * other_y_max < - self_x_diff or c_a * other_x_max + s_a * other_y_min > self_x_diff or c_a * other_y_min - s_a * other_x_min < - self_y_diff or c_a * other_y_max - s_a * other_x_max > self_y_diff else : # s_a <= 0.0 return c_a * other_x_min + s_a * other_y_min < - self_x_diff or c_a * other_x_max + s_a * other_y_max > self_x_diff or c_a * other_y_min - s_a * other_x_max < - self_y_diff or c_a * other_y_max - s_a * other_x_min > self_y_diff
Returns False iif any edge excludes all vertices of other .
578
13
230,375
def collides ( self , other ) : angle = self . angle width = self . width height = self . height if angle == 0 : return other . collides ( Rect ( - 0.5 * width , - 0.5 * height , width , height ) ) # Phase 1 # # * Form bounding box on tilted rectangle P. # * Check whether bounding box and other intersect. # * If not, then self and other do not intersect. # * Otherwise proceed to Phase 2. # Now perform the standard rectangle intersection test. if self . is_bbox_not_intersecting ( other ) : return False # Phase 2 # # If we get here, check the edges of self to see # * if one of them excludes all vertices of other. # * If so, then self and other do not intersect. # * (If not, then self and other do intersect.) return not self . is_edge_not_excluding_vertices ( other )
Returns collision with axis aligned rect
204
6
230,376
def get_vec_lr ( self ) : return self . width * self . cos_a ( ) , - self . width * self . sin_a ( )
Returns vector from left to right
35
6
230,377
def get_vec_tb ( self ) : return self . height * self . sin_a ( ) , self . height * self . cos_a ( )
Returns vector from top to bottom
35
6
230,378
def get_center ( self ) : lr_x , lr_y = self . get_vec_lr ( ) tb_x , tb_y = self . get_vec_tb ( ) center_x = self . x + ( lr_x + tb_x ) / 2.0 center_y = self . y + ( lr_y + tb_y ) / 2.0 return center_x , center_y
Returns rectangle center
101
3
230,379
def get_edges ( self ) : lr_x , lr_y = self . get_vec_lr ( ) tb_x , tb_y = self . get_vec_tb ( ) top_left = self . x , self . y top_right = self . x + lr_x , self . y + lr_y bottom_left = self . x + tb_x , self . y + tb_y bottom_right = self . x + lr_x + tb_x , self . y + lr_y + tb_y return top_left , top_right , bottom_left , bottom_right
Returns 2 - tuples for each edge
148
8
230,380
def collides_axisaligned_rect ( self , other ) : # Shift both rects so that self is centered at origin self_shifted = RotoOriginRect ( self . width , self . height , - self . angle ) s_a = self . sin_a ( ) c_a = self . cos_a ( ) center_x = self . x + self . width / 2.0 * c_a - self . height / 2.0 * s_a center_y = self . y - self . height / 2.0 * c_a - self . width / 2.0 * s_a other_shifted = Rect ( other . x - center_x , other . y - center_y , other . width , other . height ) # Calculate collision return self_shifted . collides ( other_shifted )
Returns collision with axis aligned other rect
182
7
230,381
def get_paths ( self , theme , icon_size ) : _size_str = "x" . join ( map ( str , icon_size ) ) theme_path = get_program_path ( ) + "share" + os . sep + "icons" + os . sep icon_path = theme_path + theme + os . sep + _size_str + os . sep action_path = icon_path + "actions" + os . sep toggle_path = icon_path + "toggles" + os . sep return theme_path , icon_path , action_path , toggle_path
Returns tuple of theme icon action and toggle paths
131
9
230,382
def CreateBitmap ( self , artid , client , size ) : if artid in self . extra_icons : return wx . Bitmap ( self . extra_icons [ artid ] , wx . BITMAP_TYPE_ANY ) else : return wx . ArtProvider . GetBitmap ( artid , client , size )
Adds custom images to Artprovider
72
7
230,383
def set_initial_state ( self , kwargs ) : self . main_window = kwargs . pop ( "main_window" ) try : statustext = kwargs . pop ( "statustext" ) except KeyError : statustext = "" try : self . total_lines = kwargs . pop ( "total_lines" ) self . statustext = statustext + _ ( "{nele} of {totalele} elements processed." ) except KeyError : self . total_lines = None self . statustext = statustext + _ ( "{nele} elements processed." ) try : self . freq = kwargs . pop ( "freq" ) except KeyError : self . freq = 1000 # The aborted attribute makes next() to raise StopIteration self . aborted = False # Line counter self . line = 0 # Bindings self . main_window . Bind ( wx . EVT_KEY_DOWN , self . on_key )
Sets class state from kwargs attributes pops extra kwargs
217
14
230,384
def progress_status ( self ) : if self . line % self . freq == 0 : text = self . statustext . format ( nele = self . line , totalele = self . total_lines ) if self . main_window . grid . actions . pasting : try : post_command_event ( self . main_window , self . main_window . StatusBarMsg , text = text ) except TypeError : # The main window does not exist any more pass else : # Write directly to the status bar because the event queue # is not emptied during file access self . main_window . GetStatusBar ( ) . SetStatusText ( text ) # Now wait for the statusbar update to be written on screen if is_gtk ( ) : try : wx . Yield ( ) except : pass self . line += 1
Displays progress in statusbar
179
6
230,385
def on_key ( self , event ) : if self . main_window . grid . actions . pasting and event . GetKeyCode ( ) == wx . WXK_ESCAPE : self . aborted = True event . Skip ( )
Sets aborted state if escape is pressed
53
8
230,386
def _get_tables ( self , ods ) : childnodes = ods . spreadsheet . childNodes qname_childnodes = [ ( s . qname [ 1 ] , s ) for s in childnodes ] return [ node for name , node in qname_childnodes if name == u"table" ]
Returns list of table nodes from ods object
73
9
230,387
def _get_rows ( self , table ) : childnodes = table . childNodes qname_childnodes = [ ( s . qname [ 1 ] , s ) for s in childnodes ] return [ node for name , node in qname_childnodes if name == u'table-row' ]
Returns rows from table
70
4
230,388
def _get_cells ( self , row ) : childnodes = row . childNodes qname_childnodes = [ ( s . qname [ 1 ] , s ) for s in childnodes ] return [ node for name , node in qname_childnodes if name == u'table-cell' ]
Returns rows from row
70
4
230,389
def _ods2code ( self ) : ods = ODSReader ( self . ods_file , clonespannedcolumns = True ) tables = ods . sheets for tab_id , table in enumerate ( tables ) : for row_id in xrange ( len ( table ) ) : for col_id in xrange ( len ( table [ row_id ] ) ) : key = row_id , col_id , tab_id text = unicode ( table [ row_id ] [ col_id ] ) self . code_array [ key ] = text
Updates code in code_array
123
7
230,390
def pyspread ( S = None ) : # Initialize main application app = MainApplication ( S = S , redirect = False ) app . MainLoop ( )
Holds application main loop
34
5
230,391
def readSheet ( self , sheet ) : name = sheet . getAttribute ( "name" ) rows = sheet . getElementsByType ( TableRow ) arrRows = [ ] # for each row for row in rows : row_comment = "" arrCells = GrowingList ( ) cells = row . getElementsByType ( TableCell ) # for each cell count = 0 for cell in cells : # repeated value? repeat = cell . getAttribute ( "numbercolumnsrepeated" ) if ( not repeat ) : repeat = 1 spanned = int ( cell . getAttribute ( 'numbercolumnsspanned' ) or 0 ) # clone spanned cells if self . clonespannedcolumns is not None and spanned > 1 : repeat = spanned ps = cell . getElementsByType ( P ) textContent = "" # for each text/text:span node for p in ps : for n in p . childNodes : if ( n . nodeType == 1 and n . tagName == "text:span" ) : for c in n . childNodes : if ( c . nodeType == 3 ) : textContent = u'{}{}' . format ( textContent , n . data ) if ( n . nodeType == 3 ) : textContent = u'{}{}' . format ( textContent , n . data ) if ( textContent ) : if ( textContent [ 0 ] != "#" ) : # ignore comments cells for rr in xrange ( int ( repeat ) ) : # repeated? arrCells [ count ] = textContent count += 1 else : row_comment = row_comment + textContent + " " else : for rr in xrange ( int ( repeat ) ) : count += 1 # if row contained something if ( len ( arrCells ) ) : arrRows . append ( arrCells ) #else: # print ("Empty or commented row (", row_comment, ")") self . sheets . append ( arrRows ) self . sheet_names . append ( name )
Reads a sheet in the sheet dictionary
436
8
230,392
def sniff ( filepath ) : with open ( filepath , "rb" ) as csvfile : sample = csvfile . read ( config [ "sniff_size" ] ) sniffer = csv . Sniffer ( ) dialect = sniffer . sniff ( sample ) ( ) has_header = sniffer . has_header ( sample ) return dialect , has_header
Sniffs CSV dialect and header info from csvfilepath
81
12
230,393
def get_first_line ( filepath , dialect ) : with open ( filepath , "rb" ) as csvfile : csvreader = csv . reader ( csvfile , dialect = dialect ) for first_line in csvreader : break return first_line
Returns List of first line items of file filepath
59
10
230,394
def digested_line ( line , digest_types ) : digested_line = [ ] for i , ele in enumerate ( line ) : try : digest_key = digest_types [ i ] except IndexError : digest_key = digest_types [ 0 ] digest = Digest ( acceptable_types = [ digest_key ] ) try : digested_line . append ( repr ( digest ( ele ) ) ) except Exception : digested_line . append ( "" ) return digested_line
Returns list of digested values in line
105
8
230,395
def csv_digest_gen ( filepath , dialect , has_header , digest_types ) : with open ( filepath , "rb" ) as csvfile : csvreader = csv . reader ( csvfile , dialect = dialect ) if has_header : # Ignore first line for line in csvreader : break for line in csvreader : yield digested_line ( line , digest_types )
Generator of digested values from csv file in filepath
91
13
230,396
def cell_key_val_gen ( iterable , shape , topleft = ( 0 , 0 ) ) : top , left = topleft for __row , line in enumerate ( iterable ) : row = top + __row if row >= shape [ 0 ] : break for __col , value in enumerate ( line ) : col = left + __col if col >= shape [ 1 ] : break yield row , col , value
Generator of row col value tuple from iterable of iterables
93
13
230,397
def encode_gen ( line , encoding = "utf-8" ) : for ele in line : if isinstance ( ele , types . UnicodeType ) : yield ele . encode ( encoding ) else : yield ele
Encodes all Unicode strings in line to encoding
44
9
230,398
def _get_csv_cells_gen ( self , line ) : digest_types = self . digest_types for j , value in enumerate ( line ) : if self . first_line : digest_key = None digest = lambda x : x . decode ( self . encoding ) else : try : digest_key = digest_types [ j ] except IndexError : digest_key = digest_types [ 0 ] digest = Digest ( acceptable_types = [ digest_key ] , encoding = self . encoding ) try : digest_res = digest ( value ) if digest_res == "\b" : digest_res = None elif digest_key is not types . CodeType : digest_res = repr ( digest_res ) except Exception : digest_res = "" yield digest_res
Generator of values in a csv line
166
9
230,399
def write ( self , iterable ) : io_error_text = _ ( "Error writing to file {filepath}." ) io_error_text = io_error_text . format ( filepath = self . path ) try : with open ( self . path , "wb" ) as csvfile : csv_writer = csv . writer ( csvfile , self . dialect ) for line in iterable : csv_writer . writerow ( list ( encode_gen ( line , encoding = self . encoding ) ) ) except IOError : txt = _ ( "Error opening file {filepath}." ) . format ( filepath = self . path ) try : post_command_event ( self . main_window , self . StatusBarMsg , text = txt ) except TypeError : # The main window does not exist any more pass return False
Writes values from iterable into CSV file
185
9