INSTRUCTION stringlengths 1 46.3k | RESPONSE stringlengths 75 80.2k |
|---|---|
Text color choice event handler | def OnTextColor(self, event):
"""Text color choice event handler"""
color = event.GetValue().GetRGB()
post_command_event(self, self.TextColorMsg, color=color) |
Text font choice event handler | def OnTextFont(self, event):
"""Text font choice event handler"""
fontchoice_combobox = event.GetEventObject()
idx = event.GetInt()
try:
font_string = fontchoice_combobox.GetString(idx)
except AttributeError:
font_string = event.GetString()
post... |
Text size combo text event handler | def OnTextSize(self, event):
"""Text size combo text event handler"""
try:
size = int(event.GetString())
except Exception:
size = get_default_font().GetPointSize()
post_command_event(self, self.FontSizeMsg, size=size) |
Sets code of cell key, marks grid as changed | def set_code(self, key, code):
"""Sets code of cell key, marks grid as changed"""
old_code = self.grid.code_array(key)
try:
old_code = unicode(old_code, encoding="utf-8")
except TypeError:
pass
if code == old_code:
return
if not (o... |
Returns string quoted code | def quote_code(self, key):
"""Returns string quoted code """
code = self.grid.code_array(key)
quoted_code = quote(code)
if quoted_code is not None:
self.set_code(key, quoted_code) |
Deletes key cell | def delete_cell(self, key):
"""Deletes key cell"""
try:
self.code_array.pop(key)
except KeyError:
pass
self.grid.code_array.result_cache.clear() |
Returns absolute reference code for key. | def _get_absolute_reference(self, ref_key):
"""Returns absolute reference code for key."""
key_str = u", ".join(map(str, ref_key))
return u"S[" + key_str + u"]" |
Returns absolute reference code for key.
Parameters
----------
cursor: 3-tuple of Integer
\tCurrent cursor position
ref_key: 3-tuple of Integer
\tAbsolute reference key | def _get_relative_reference(self, cursor, ref_key):
"""Returns absolute reference code for key.
Parameters
----------
cursor: 3-tuple of Integer
\tCurrent cursor position
ref_key: 3-tuple of Integer
\tAbsolute reference key
"""
magics = ["X", "... |
Appends reference code to cell code.
Replaces existing reference.
Parameters
----------
key: 3-tuple of Integer
\tKey of cell that gets the reference
ref_key: 3-tuple of Integer
\tKey of cell that is referenced
ref_type: Sting in ["absolute", "relative"]... | def append_reference_code(self, key, ref_key, ref_type="absolute"):
"""Appends reference code to cell code.
Replaces existing reference.
Parameters
----------
key: 3-tuple of Integer
\tKey of cell that gets the reference
ref_key: 3-tuple of Integer
\tKey... |
Sets cell attr for key cell and mark grid content as changed
Parameters
----------
attr: dict
\tContains cell attribute keys
\tkeys in ["borderwidth_bottom", "borderwidth_right",
\t"bordercolor_bottom", "bordercolor_right",
\t"bgcolor", "textfont",
\t"po... | def _set_cell_attr(self, selection, table, attr):
"""Sets cell attr for key cell and mark grid content as changed
Parameters
----------
attr: dict
\tContains cell attribute keys
\tkeys in ["borderwidth_bottom", "borderwidth_right",
\t"bordercolor_bottom", "borde... |
Sets attr of current selection to value | def set_attr(self, attr, value, selection=None):
"""Sets attr of current selection to value"""
if selection is None:
selection = self.grid.selection
if not selection:
# Add current cell to selection so that it gets changed
selection.cells.append(self.grid.ac... |
Sets border attribute by adjusting selection to borders
Parameters
----------
attr: String in ["borderwidth", "bordercolor"]
\tBorder attribute that shall be changed
value: wx.Colour or Integer
\tAttribute value dependent on attribute type
borders: Iterable over ... | def set_border_attr(self, attr, value, borders):
"""Sets border attribute by adjusting selection to borders
Parameters
----------
attr: String in ["borderwidth", "bordercolor"]
\tBorder attribute that shall be changed
value: wx.Colour or Integer
\tAttribute value... |
Toggles an attribute attr for current selection | def toggle_attr(self, attr):
"""Toggles an attribute attr for current selection"""
selection = self.grid.selection
# Selection or single cell access?
if selection:
value = self.get_new_selection_attr_state(selection, attr)
else:
value = self.get_new_ce... |
Changes frozen state of cell if there is no selection | def change_frozen_attr(self):
"""Changes frozen state of cell if there is no selection"""
# Selections are not supported
if self.grid.selection:
statustext = _("Freezing selections is not supported.")
post_command_event(self.main_window, self.StatusBarMsg,
... |
Unmerges all cells in unmerge_area | def unmerge(self, unmerge_area, tab):
"""Unmerges all cells in unmerge_area"""
top, left, bottom, right = unmerge_area
selection = Selection([(top, left)], [(bottom, right)], [], [], [])
attr = {"merge_area": None, "locked": False}
self._set_cell_attr(selection, tab, attr) |
Merges top left cell with all cells until bottom_right | def merge(self, merge_area, tab):
"""Merges top left cell with all cells until bottom_right"""
top, left, bottom, right = merge_area
cursor = self.grid.actions.cursor
top_left_code = self.code_array((top, left, cursor[2]))
selection = Selection([(top, left)], [(bottom, right)]... |
Merges or unmerges cells that are in the selection bounding box
Parameters
----------
selection: Selection object
\tSelection for which attr toggle shall be returned | def merge_selected_cells(self, selection):
"""Merges or unmerges cells that are in the selection bounding box
Parameters
----------
selection: Selection object
\tSelection for which attr toggle shall be returned
"""
tab = self.grid.current_table
# Get ... |
Returns new attr cell state for toggles
Parameters
----------
key: 3-Tuple
\tCell for which attr toggle shall be returned
attr_key: Hashable
\tAttribute key | def get_new_cell_attr_state(self, key, attr_key):
"""Returns new attr cell state for toggles
Parameters
----------
key: 3-Tuple
\tCell for which attr toggle shall be returned
attr_key: Hashable
\tAttribute key
"""
cell_attributes = self.grid.cod... |
Toggles new attr selection state and returns it
Parameters
----------
selection: Selection object
\tSelection for which attr toggle shall be returned
attr_key: Hashable
\tAttribute key | def get_new_selection_attr_state(self, selection, attr_key):
"""Toggles new attr selection state and returns it
Parameters
----------
selection: Selection object
\tSelection for which attr toggle shall be returned
attr_key: Hashable
\tAttribute key
"""
... |
Refreshes a frozen cell | def refresh_frozen_cell(self, key):
"""Refreshes a frozen cell"""
code = self.grid.code_array(key)
result = self.grid.code_array._eval_cell(key, code)
self.grid.code_array.frozen_cache[repr(key)] = result |
Refreshes content of frozen cells that are currently selected
If there is no selection, the cell at the cursor is updated.
Parameters
----------
selection: Selection, defaults to None
\tIf not None then use this selection instead of the grid selection | def refresh_selected_frozen_cells(self, selection=None):
"""Refreshes content of frozen cells that are currently selected
If there is no selection, the cell at the cursor is updated.
Parameters
----------
selection: Selection, defaults to None
\tIf not None then use thi... |
CSV import workflow | def _import_csv(self, path):
"""CSV import workflow"""
# If path is not set, do nothing
if not path:
return
# Get csv info
try:
dialect, has_header, digest_types, encoding = \
self.main_window.interfaces.get_csv_import_info(path)
... |
Imports external file
Parameters
----------
filepath: String
\tPath of import file
filterindex: Integer
\tIndex for type of file, 0: csv, 1: tab-delimited text file | def import_file(self, filepath, filterindex):
"""Imports external file
Parameters
----------
filepath: String
\tPath of import file
filterindex: Integer
\tIndex for type of file, 0: csv, 1: tab-delimited text file
"""
# Mark content as changed
... |
CSV export of code_array results
Parameters
----------
filepath: String
\tPath of export file
data: Object
\tCode array result object slice, i. e. one object or iterable of
\tsuch objects | def _export_csv(self, filepath, data, preview_data):
"""CSV export of code_array results
Parameters
----------
filepath: String
\tPath of export file
data: Object
\tCode array result object slice, i. e. one object or iterable of
\tsuch objects
""... |
Export of single cell that contains a matplotlib figure
Parameters
----------
filepath: String
\tPath of export file
data: Matplotlib Figure
\tMatplotlib figure that is eported
format: String in ["png", "pdf", "ps", "eps", "svg"] | def _export_figure(self, filepath, data, format):
"""Export of single cell that contains a matplotlib figure
Parameters
----------
filepath: String
\tPath of export file
data: Matplotlib Figure
\tMatplotlib figure that is eported
format: String in ["png",... |
Export data for other applications
Parameters
----------
filepath: String
\tPath of export file
__filter: String
\tImport filter
data: Object
\tCode array result object slice, i. e. one object or iterable of
\tsuch objects | def export_file(self, filepath, __filter, data, preview_data=None):
"""Export data for other applications
Parameters
----------
filepath: String
\tPath of export file
__filter: String
\tImport filter
data: Object
\tCode array result object slice, ... |
Returns wx.Rect that is correctly positioned on the print canvas | def get_print_rect(self, grid_rect):
"""Returns wx.Rect that is correctly positioned on the print canvas"""
grid = self.grid
rect_x = grid_rect.x - \
grid.GetScrollPos(wx.HORIZONTAL) * grid.GetScrollLineX()
rect_y = grid_rect.y - \
grid.GetScrollPos(wx.VERTICAL)... |
Exports grid to the PDF file filepath
Parameters
----------
filepath: String
\tPath of file to export
filetype in ["pdf", "svg"]
\tType of file to export | def export_cairo(self, filepath, filetype):
"""Exports grid to the PDF file filepath
Parameters
----------
filepath: String
\tPath of file to export
filetype in ["pdf", "svg"]
\tType of file to export
"""
if cairo is None:
return
... |
Launch print preview | def print_preview(self, print_area, print_data):
"""Launch print preview"""
if cairo is None:
return
print_info = \
self.main_window.interfaces.get_cairo_export_info("Print")
if print_info is None:
# Dialog has been canceled
return
... |
Print out print area
See:
http://aspn.activestate.com/ASPN/Mail/Message/wxpython-users/3471083 | def printout(self, print_area, print_data):
"""Print out print area
See:
http://aspn.activestate.com/ASPN/Mail/Message/wxpython-users/3471083
"""
print_info = \
self.main_window.interfaces.get_cairo_export_info("Print")
if print_info is None:
#... |
Returns code for given key (one cell)
Parameters
----------
key: 3-Tuple of Integer
\t Cell key | def _get_code(self, key):
"""Returns code for given key (one cell)
Parameters
----------
key: 3-Tuple of Integer
\t Cell key
"""
data = self.grid.code_array(key)
self.grid.code_array.result_cache.clear()
return data |
Returns code from selection in a tab separated string
Cells that are not in selection are included as empty.
Parameters
----------
selection: Selection object
\tSelection of cells in current table that shall be copied
getter: Function, defaults to _get_code
\tG... | def copy(self, selection, getter=None, delete=False):
"""Returns code from selection in a tab separated string
Cells that are not in selection are included as empty.
Parameters
----------
selection: Selection object
\tSelection of cells in current table that shall be c... |
Returns unicode string of result for given key (one cell)
Parameters
----------
key: 3-Tuple of Integer
\t Cell key | def _get_result_string(self, key):
"""Returns unicode string of result for given key (one cell)
Parameters
----------
key: 3-Tuple of Integer
\t Cell key
"""
row, col, tab = key
result_obj = self.grid.code_array[row, col, tab]
try:
... |
Returns result
If selection consists of one cell only and result is a bitmap then
the bitmap is returned.
Otherwise the method returns string representations of the result
for the given selection in a tab separated string. | def copy_result(self, selection):
"""Returns result
If selection consists of one cell only and result is a bitmap then
the bitmap is returned.
Otherwise the method returns string representations of the result
for the given selection in a tab separated string.
"""
... |
Generator for paste data
Can be used in grid.actions.paste | def _get_paste_data_gen(self, key, data):
"""Generator for paste data
Can be used in grid.actions.paste
"""
if type(data) is wx._gdi.Bitmap:
code_str = self.bmp2code(key, data)
return [[code_str]]
else:
return (line.split("\t") for line in d... |
Pastes wx.Image into single cell | def img2code(self, key, img):
"""Pastes wx.Image into single cell"""
code_template = \
"wx.ImageFromData({width}, {height}, " + \
"bz2.decompress(base64.b64decode('{data}'))).ConvertToBitmap()"
code_alpha_template = \
"wx.ImageFromDataWithAlpha({width}, {hei... |
Pastes data into grid
Parameters
----------
key: 2-Tuple of Integer
\tTop left cell
data: String or wx.Bitmap
\tTab separated string of paste data
\tor paste data image | def paste(self, key, data):
"""Pastes data into grid
Parameters
----------
key: 2-Tuple of Integer
\tTop left cell
data: String or wx.Bitmap
\tTab separated string of paste data
\tor paste data image
"""
data_gen = self._get_paste_data_g... |
Returns list of lists of obj than has dimensionality dim
Parameters
----------
dim: Integer
\tDimensionality of obj
obj: Object
\tIterable object of dimensionality dim | def _get_pasteas_data(self, dim, obj):
"""Returns list of lists of obj than has dimensionality dim
Parameters
----------
dim: Integer
\tDimensionality of obj
obj: Object
\tIterable object of dimensionality dim
"""
if dim == 0:
return... |
Paste and transform data
Data may be given as a Python code as well as a tab separated
multi-line strings similar to paste. | def paste_as(self, key, data):
"""Paste and transform data
Data may be given as a Python code as well as a tab separated
multi-line strings similar to paste.
"""
def error_msg(err):
msg = _("Error evaluating data: ") + str(err)
post_command_event(self.m... |
Executes macros and marks grid as changed | def execute_macros(self):
"""Executes macros and marks grid as changed"""
# Mark content as changed
post_command_event(self.main_window, self.ContentChangedMsg)
(result, err) = self.grid.code_array.execute_macros()
# Post event to macro dialog
post_command_event(self.m... |
Loads macros from file and marks grid as changed
Parameters
----------
filepath: String
\tPath to macro file | def open_macros(self, filepath):
"""Loads macros from file and marks grid as changed
Parameters
----------
filepath: String
\tPath to macro file
"""
try:
wx.BeginBusyCursor()
self.main_window.grid.Disable()
with open(filepat... |
Saves macros to file
Parameters
----------
filepath: String
\tPath to macro file
macros: String
\tMacro code | def save_macros(self, filepath, macros):
"""Saves macros to file
Parameters
----------
filepath: String
\tPath to macro file
macros: String
\tMacro code
"""
io_error_text = _("Error writing to file {filepath}.")
io_error_text = io_error_... |
Generic help launcher
Launches HTMLWindow that shows content of filename
or the Internet page with the filename url
Parameters
----------
filename: String
\thtml file or url | def launch_help(self, helpname, filename):
"""Generic help launcher
Launches HTMLWindow that shows content of filename
or the Internet page with the filename url
Parameters
----------
filename: String
\thtml file or url
"""
# Set up window
... |
Help window move event handler stores position in config | def OnHelpMove(self, event):
"""Help window move event handler stores position in config"""
position = event.GetPosition()
config["help_window_position"] = repr((position.x, position.y))
event.Skip() |
Help window size event handler stores size in config | def OnHelpSize(self, event):
"""Help window size event handler stores size in config"""
size = event.GetSize()
config["help_window_size"] = repr((size.width, size.height))
event.Skip() |
Returns a VLCPanel class
Parameters
----------
filepath: String
\tFile path of video
volume: Float, optional
\tSound volume | def vlcpanel_factory(filepath, volume=None):
"""Returns a VLCPanel class
Parameters
----------
filepath: String
\tFile path of video
volume: Float, optional
\tSound volume
"""
vlc_panel_cls = VLCPanel
VLCPanel.filepath = filepath
if volume is not None:
VLCPanel.vol... |
Positions and resizes video panel
Parameters
----------
rect: 4-tuple of Integer
\tRect area of video panel | def SetClientRect(self, rect):
"""Positions and resizes video panel
Parameters
----------
rect: 4-tuple of Integer
\tRect area of video panel
"""
panel_posx = rect[0] + self.grid.GetRowLabelSize()
panel_posy = rect[1] + self.grid.GetColLabelSize()
... |
Toggles the video status between play and hold | def OnTogglePlay(self, event):
"""Toggles the video status between play and hold"""
if self.player.get_state() == vlc.State.Playing:
self.player.pause()
else:
self.player.play()
event.Skip() |
Mouse wheel event handler | def OnMouseWheel(self, event):
"""Mouse wheel event handler"""
if event. ShiftDown():
self.OnShiftVideo(event)
else:
self.OnAdjustVolume(event) |
Shifts through the video | def OnShiftVideo(self, event):
"""Shifts through the video"""
length = self.player.get_length()
time = self.player.get_time()
if event.GetWheelRotation() < 0:
target_time = max(0, time-length/100.0)
elif event.GetWheelRotation() > 0:
target_time = min(le... |
Changes video volume | def OnAdjustVolume(self, event):
"""Changes video volume"""
self.volume = self.player.audio_get_volume()
if event.GetWheelRotation() < 0:
self.volume = max(0, self.volume-10)
elif event.GetWheelRotation() > 0:
self.volume = min(200, self.volume+10)
self... |
Loads configuration file | def load(self):
"""Loads configuration file"""
# Config files prior to 0.2.4 dor not have config version keys
old_config = not self.cfg_file.Exists("config_version")
# Reset data
self.data.__dict__.update(self.defaults.__dict__)
for key in self.defaults.__dict__:
... |
(INTERNAL) New ctypes function binding. | def _Cfunction(name, flags, errcheck, *types):
"""(INTERNAL) New ctypes function binding.
"""
if hasattr(dll, name) and name in _Globals:
p = ctypes.CFUNCTYPE(*types)
f = p((name, dll), flags)
if errcheck is not None:
f.errcheck = errcheck
# replace the Python fun... |
Saves configuration file | def save(self):
"""Saves configuration file"""
for key in self.defaults.__dict__:
data = getattr(self.data, key)
self.cfg_file.Write(key, data) |
(INTERNAL) New instance from ctypes. | def _Cobject(cls, ctype):
"""(INTERNAL) New instance from ctypes.
"""
o = object.__new__(cls)
o._as_parameter_ = ctype
return o |
(INTERNAL) New wrapper from ctypes. | def _Constructor(cls, ptr=_internal_guard):
"""(INTERNAL) New wrapper from ctypes.
"""
if ptr == _internal_guard:
raise VLCException("(INTERNAL) ctypes class. You should get references for this class through methods of the LibVLC API.")
if ptr is None or ptr == 0:
return None
return ... |
Errcheck function. Returns a string and frees the original pointer.
It assumes the result is a char *. | def string_result(result, func, arguments):
"""Errcheck function. Returns a string and frees the original pointer.
It assumes the result is a char *.
"""
if result:
# make a python string copy
s = bytes_to_str(ctypes.string_at(result))
# free original string ptr
libvlc_f... |
Errcheck function. Returns a function that creates the specified class. | def class_result(classname):
"""Errcheck function. Returns a function that creates the specified class.
"""
def wrap_errcheck(result, func, arguments):
if result is None:
return None
return classname(result)
return wrap_errcheck |
Convert a TrackDescription linked list to a Python list (and release the former). | def track_description_list(head):
"""Convert a TrackDescription linked list to a Python list (and release the former).
"""
r = []
if head:
item = head
while item:
item = item.contents
r.append((item.id, item.name))
item = item.next
try:
... |
Convert a ModuleDescription linked list to a Python list (and release the former). | def module_description_list(head):
"""Convert a ModuleDescription linked list to a Python list (and release the former).
"""
r = []
if head:
item = head
while item:
item = item.contents
r.append((item.name, item.shortname, item.longname, item.help))
it... |
Sets the LibVLC error status and message for the current thread.
Any previous error is overridden.
@param fmt: the format string.
@param ap: the arguments.
@return: a nul terminated string in any case. | def libvlc_vprinterr(fmt, ap):
'''Sets the LibVLC error status and message for the current thread.
Any previous error is overridden.
@param fmt: the format string.
@param ap: the arguments.
@return: a nul terminated string in any case.
'''
f = _Cfunctions.get('libvlc_vprinterr', None) or \
... |
Create and initialize a libvlc instance.
This functions accept a list of "command line" arguments similar to the
main(). These arguments affect the LibVLC instance default configuration.
@param argc: the number of arguments (should be 0).
@param argv: list of arguments (should be NULL).
@return: the... | def libvlc_new(argc, argv):
'''Create and initialize a libvlc instance.
This functions accept a list of "command line" arguments similar to the
main(). These arguments affect the LibVLC instance default configuration.
@param argc: the number of arguments (should be 0).
@param argv: list of arguments... |
Try to start a user interface for the libvlc instance.
@param p_instance: the instance.
@param name: interface name, or NULL for default.
@return: 0 on success, -1 on error. | def libvlc_add_intf(p_instance, name):
'''Try to start a user interface for the libvlc instance.
@param p_instance: the instance.
@param name: interface name, or NULL for default.
@return: 0 on success, -1 on error.
'''
f = _Cfunctions.get('libvlc_add_intf', None) or \
_Cfunction('libvlc... |
Sets the application name. LibVLC passes this as the user agent string
when a protocol requires it.
@param p_instance: LibVLC instance.
@param name: human-readable application name, e.g. "FooBar player 1.2.3".
@param http: HTTP User Agent, e.g. "FooBar/1.2.3 Python/2.6.0".
@version: LibVLC 1.1.1 or ... | def libvlc_set_user_agent(p_instance, name, http):
'''Sets the application name. LibVLC passes this as the user agent string
when a protocol requires it.
@param p_instance: LibVLC instance.
@param name: human-readable application name, e.g. "FooBar player 1.2.3".
@param http: HTTP User Agent, e.g. "... |
Sets some meta-information about the application.
See also L{libvlc_set_user_agent}().
@param p_instance: LibVLC instance.
@param id: Java-style application identifier, e.g. "com.acme.foobar".
@param version: application version numbers, e.g. "1.2.3".
@param icon: application icon name, e.g. "foobar... | def libvlc_set_app_id(p_instance, id, version, icon):
'''Sets some meta-information about the application.
See also L{libvlc_set_user_agent}().
@param p_instance: LibVLC instance.
@param id: Java-style application identifier, e.g. "com.acme.foobar".
@param version: application version numbers, e.g. ... |
Frees an heap allocation returned by a LibVLC function.
If you know you're using the same underlying C run-time as the LibVLC
implementation, then you can call ANSI C free() directly instead.
@param ptr: the pointer. | def libvlc_free(ptr):
'''Frees an heap allocation returned by a LibVLC function.
If you know you're using the same underlying C run-time as the LibVLC
implementation, then you can call ANSI C free() directly instead.
@param ptr: the pointer.
'''
f = _Cfunctions.get('libvlc_free', None) or \
... |
Register for an event notification.
@param p_event_manager: the event manager to which you want to attach to. Generally it is obtained by vlc_my_object_event_manager() where my_object is the object you want to listen to.
@param i_event_type: the desired event to which we want to listen.
@param f_callback: t... | def libvlc_event_attach(p_event_manager, i_event_type, f_callback, user_data):
'''Register for an event notification.
@param p_event_manager: the event manager to which you want to attach to. Generally it is obtained by vlc_my_object_event_manager() where my_object is the object you want to listen to.
@para... |
Unregister an event notification.
@param p_event_manager: the event manager.
@param i_event_type: the desired event to which we want to unregister.
@param f_callback: the function to call when i_event_type occurs.
@param p_user_data: user provided data to carry with the event. | def libvlc_event_detach(p_event_manager, i_event_type, f_callback, p_user_data):
'''Unregister an event notification.
@param p_event_manager: the event manager.
@param i_event_type: the desired event to which we want to unregister.
@param f_callback: the function to call when i_event_type occurs.
@p... |
Get an event's type name.
@param event_type: the desired event. | def libvlc_event_type_name(event_type):
'''Get an event's type name.
@param event_type: the desired event.
'''
f = _Cfunctions.get('libvlc_event_type_name', None) or \
_Cfunction('libvlc_event_type_name', ((1,),), None,
ctypes.c_char_p, ctypes.c_uint)
return f(event_type) |
Gets debugging information about a log message: the name of the VLC module
emitting the message and the message location within the source code.
The returned module name and file name will be NULL if unknown.
The returned line number will similarly be zero if unknown.
@param ctx: message context (as pas... | def libvlc_log_get_context(ctx):
'''Gets debugging information about a log message: the name of the VLC module
emitting the message and the message location within the source code.
The returned module name and file name will be NULL if unknown.
The returned line number will similarly be zero if unknown.... |
Gets VLC object information about a log message: the type name of the VLC
object emitting the message, the object header if any and a temporaly-unique
object identifier. This information is mainly meant for B{manual}
troubleshooting.
The returned type name may be "generic" if unknown, but it cannot be N... | def libvlc_log_get_object(ctx, id):
'''Gets VLC object information about a log message: the type name of the VLC
object emitting the message, the object header if any and a temporaly-unique
object identifier. This information is mainly meant for B{manual}
troubleshooting.
The returned type name may ... |
Sets the logging callback for a LibVLC instance.
This function is thread-safe: it will wait for any pending callbacks
invocation to complete.
@param cb: callback function pointer.
@param data: opaque data pointer for the callback function @note Some log messages (especially debug) are emitted by LibVLC ... | def libvlc_log_set(cb, data, p_instance):
'''Sets the logging callback for a LibVLC instance.
This function is thread-safe: it will wait for any pending callbacks
invocation to complete.
@param cb: callback function pointer.
@param data: opaque data pointer for the callback function @note Some log m... |
Sets up logging to a file.
@param p_instance: libvlc instance.
@param stream: FILE pointer opened for writing (the FILE pointer must remain valid until L{libvlc_log_unset}()).
@version: LibVLC 2.1.0 or later. | def libvlc_log_set_file(p_instance, stream):
'''Sets up logging to a file.
@param p_instance: libvlc instance.
@param stream: FILE pointer opened for writing (the FILE pointer must remain valid until L{libvlc_log_unset}()).
@version: LibVLC 2.1.0 or later.
'''
f = _Cfunctions.get('libvlc_log_set... |
Release a list of module descriptions.
@param p_list: the list to be released. | def libvlc_module_description_list_release(p_list):
'''Release a list of module descriptions.
@param p_list: the list to be released.
'''
f = _Cfunctions.get('libvlc_module_description_list_release', None) or \
_Cfunction('libvlc_module_description_list_release', ((1,),), None,
... |
Returns a list of audio filters that are available.
@param p_instance: libvlc instance.
@return: a list of module descriptions. It should be freed with L{libvlc_module_description_list_release}(). In case of an error, NULL is returned. See L{ModuleDescription} See L{libvlc_module_description_list_release}. | def libvlc_audio_filter_list_get(p_instance):
'''Returns a list of audio filters that are available.
@param p_instance: libvlc instance.
@return: a list of module descriptions. It should be freed with L{libvlc_module_description_list_release}(). In case of an error, NULL is returned. See L{ModuleDescription... |
Create a media with a certain given media resource location,
for instance a valid URL.
@note: To refer to a local file with this function,
the file://... URI syntax B{must} be used (see IETF RFC3986).
We recommend using L{libvlc_media_new_path}() instead when dealing with
local files.
See L{libv... | def libvlc_media_new_location(p_instance, psz_mrl):
'''Create a media with a certain given media resource location,
for instance a valid URL.
@note: To refer to a local file with this function,
the file://... URI syntax B{must} be used (see IETF RFC3986).
We recommend using L{libvlc_media_new_path}(... |
Create a media for a certain file path.
See L{libvlc_media_release}.
@param p_instance: the instance.
@param path: local filesystem path.
@return: the newly created media or NULL on error. | def libvlc_media_new_path(p_instance, path):
'''Create a media for a certain file path.
See L{libvlc_media_release}.
@param p_instance: the instance.
@param path: local filesystem path.
@return: the newly created media or NULL on error.
'''
f = _Cfunctions.get('libvlc_media_new_path', None) ... |
Create a media for an already open file descriptor.
The file descriptor shall be open for reading (or reading and writing).
Regular file descriptors, pipe read descriptors and character device
descriptors (including TTYs) are supported on all platforms.
Block device descriptors are supported where avail... | def libvlc_media_new_fd(p_instance, fd):
'''Create a media for an already open file descriptor.
The file descriptor shall be open for reading (or reading and writing).
Regular file descriptors, pipe read descriptors and character device
descriptors (including TTYs) are supported on all platforms.
Bl... |
Create a media with custom callbacks to read the data from.
@param instance: LibVLC instance.
@param open_cb: callback to open the custom bitstream input media.
@param read_cb: callback to read data (must not be NULL).
@param seek_cb: callback to seek, or NULL if seeking is not supported.
@param clo... | def libvlc_media_new_callbacks(instance, open_cb, read_cb, seek_cb, close_cb, opaque):
'''Create a media with custom callbacks to read the data from.
@param instance: LibVLC instance.
@param open_cb: callback to open the custom bitstream input media.
@param read_cb: callback to read data (must not be NU... |
Create a media as an empty node with a given name.
See L{libvlc_media_release}.
@param p_instance: the instance.
@param psz_name: the name of the node.
@return: the new empty media or NULL on error. | def libvlc_media_new_as_node(p_instance, psz_name):
'''Create a media as an empty node with a given name.
See L{libvlc_media_release}.
@param p_instance: the instance.
@param psz_name: the name of the node.
@return: the new empty media or NULL on error.
'''
f = _Cfunctions.get('libvlc_media_... |
Add an option to the media.
This option will be used to determine how the media_player will
read the media. This allows to use VLC's advanced
reading/streaming options on a per-media basis.
@note: The options are listed in 'vlc --long-help' from the command line,
e.g. "-sout-all". Keep in mind that ... | def libvlc_media_add_option(p_md, psz_options):
'''Add an option to the media.
This option will be used to determine how the media_player will
read the media. This allows to use VLC's advanced
reading/streaming options on a per-media basis.
@note: The options are listed in 'vlc --long-help' from the... |
Add an option to the media with configurable flags.
This option will be used to determine how the media_player will
read the media. This allows to use VLC's advanced
reading/streaming options on a per-media basis.
The options are detailed in vlc --long-help, for instance
"--sout-all". Note that all ... | def libvlc_media_add_option_flag(p_md, psz_options, i_flags):
'''Add an option to the media with configurable flags.
This option will be used to determine how the media_player will
read the media. This allows to use VLC's advanced
reading/streaming options on a per-media basis.
The options are detai... |
Get the media resource locator (mrl) from a media descriptor object.
@param p_md: a media descriptor object.
@return: string with mrl of media descriptor object. | def libvlc_media_get_mrl(p_md):
'''Get the media resource locator (mrl) from a media descriptor object.
@param p_md: a media descriptor object.
@return: string with mrl of media descriptor object.
'''
f = _Cfunctions.get('libvlc_media_get_mrl', None) or \
_Cfunction('libvlc_media_get_mrl', (... |
Duplicate a media descriptor object.
@param p_md: a media descriptor object. | def libvlc_media_duplicate(p_md):
'''Duplicate a media descriptor object.
@param p_md: a media descriptor object.
'''
f = _Cfunctions.get('libvlc_media_duplicate', None) or \
_Cfunction('libvlc_media_duplicate', ((1,),), class_result(Media),
ctypes.c_void_p, Media)
return... |
Read the meta of the media.
If the media has not yet been parsed this will return NULL.
This methods automatically calls L{libvlc_media_parse_async}(), so after calling
it you may receive a libvlc_MediaMetaChanged event. If you prefer a synchronous
version ensure that you call L{libvlc_media_parse}() be... | def libvlc_media_get_meta(p_md, e_meta):
'''Read the meta of the media.
If the media has not yet been parsed this will return NULL.
This methods automatically calls L{libvlc_media_parse_async}(), so after calling
it you may receive a libvlc_MediaMetaChanged event. If you prefer a synchronous
version... |
Set the meta of the media (this function will not save the meta, call
L{libvlc_media_save_meta} in order to save the meta).
@param p_md: the media descriptor.
@param e_meta: the meta to write.
@param psz_value: the media's meta. | def libvlc_media_set_meta(p_md, e_meta, psz_value):
'''Set the meta of the media (this function will not save the meta, call
L{libvlc_media_save_meta} in order to save the meta).
@param p_md: the media descriptor.
@param e_meta: the meta to write.
@param psz_value: the media's meta.
'''
f = ... |
Save the meta previously set.
@param p_md: the media desriptor.
@return: true if the write operation was successful. | def libvlc_media_save_meta(p_md):
'''Save the meta previously set.
@param p_md: the media desriptor.
@return: true if the write operation was successful.
'''
f = _Cfunctions.get('libvlc_media_save_meta', None) or \
_Cfunction('libvlc_media_save_meta', ((1,),), None,
ctype... |
Get current state of media descriptor object. Possible media states
are defined in libvlc_structures.c ( libvlc_NothingSpecial=0,
libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused,
libvlc_Stopped, libvlc_Ended,
libvlc_Error).
See libvlc_state_t.
@param p_md: a media descriptor obje... | def libvlc_media_get_state(p_md):
'''Get current state of media descriptor object. Possible media states
are defined in libvlc_structures.c ( libvlc_NothingSpecial=0,
libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused,
libvlc_Stopped, libvlc_Ended,
libvlc_Error).
See libvlc_state_t.... |
Get subitems of media descriptor object. This will increment
the reference count of supplied media descriptor object. Use
L{libvlc_media_list_release}() to decrement the reference counting.
@param p_md: media descriptor object.
@return: list of media descriptor subitems or NULL. | def libvlc_media_subitems(p_md):
'''Get subitems of media descriptor object. This will increment
the reference count of supplied media descriptor object. Use
L{libvlc_media_list_release}() to decrement the reference counting.
@param p_md: media descriptor object.
@return: list of media descriptor su... |
Get the current statistics about the media.
@param p_md:: media descriptor object.
@param p_stats:: structure that contain the statistics about the media (this structure must be allocated by the caller).
@return: true if the statistics are available, false otherwise \libvlc_return_bool. | def libvlc_media_get_stats(p_md, p_stats):
'''Get the current statistics about the media.
@param p_md:: media descriptor object.
@param p_stats:: structure that contain the statistics about the media (this structure must be allocated by the caller).
@return: true if the statistics are available, false o... |
Get event manager from media descriptor object.
NOTE: this function doesn't increment reference counting.
@param p_md: a media descriptor object.
@return: event manager object. | def libvlc_media_event_manager(p_md):
'''Get event manager from media descriptor object.
NOTE: this function doesn't increment reference counting.
@param p_md: a media descriptor object.
@return: event manager object.
'''
f = _Cfunctions.get('libvlc_media_event_manager', None) or \
_Cfun... |
Get duration (in ms) of media descriptor object item.
@param p_md: media descriptor object.
@return: duration of media item or -1 on error. | def libvlc_media_get_duration(p_md):
'''Get duration (in ms) of media descriptor object item.
@param p_md: media descriptor object.
@return: duration of media item or -1 on error.
'''
f = _Cfunctions.get('libvlc_media_get_duration', None) or \
_Cfunction('libvlc_media_get_duration', ((1,),),... |
Parse the media asynchronously with options.
This fetches (local or network) art, meta data and/or tracks information.
This method is the extended version of L{libvlc_media_parse_async}().
To track when this is over you can listen to libvlc_MediaParsedChanged
event. However if this functions returns an ... | def libvlc_media_parse_with_options(p_md, parse_flag):
'''Parse the media asynchronously with options.
This fetches (local or network) art, meta data and/or tracks information.
This method is the extended version of L{libvlc_media_parse_async}().
To track when this is over you can listen to libvlc_Media... |
Sets media descriptor's user_data. user_data is specialized data
accessed by the host application, VLC.framework uses it as a pointer to
an native object that references a L{Media} pointer.
@param p_md: media descriptor object.
@param p_new_user_data: pointer to user data. | def libvlc_media_set_user_data(p_md, p_new_user_data):
'''Sets media descriptor's user_data. user_data is specialized data
accessed by the host application, VLC.framework uses it as a pointer to
an native object that references a L{Media} pointer.
@param p_md: media descriptor object.
@param p_new_u... |
Get media descriptor's user_data. user_data is specialized data
accessed by the host application, VLC.framework uses it as a pointer to
an native object that references a L{Media} pointer.
@param p_md: media descriptor object. | def libvlc_media_get_user_data(p_md):
'''Get media descriptor's user_data. user_data is specialized data
accessed by the host application, VLC.framework uses it as a pointer to
an native object that references a L{Media} pointer.
@param p_md: media descriptor object.
'''
f = _Cfunctions.get('lib... |
Get codec description from media elementary stream.
@param i_type: i_type from L{MediaTrack}.
@param i_codec: i_codec or i_original_fourcc from L{MediaTrack}.
@return: codec description.
@version: LibVLC 3.0.0 and later. See L{MediaTrack}. | def libvlc_media_get_codec_description(i_type, i_codec):
'''Get codec description from media elementary stream.
@param i_type: i_type from L{MediaTrack}.
@param i_codec: i_codec or i_original_fourcc from L{MediaTrack}.
@return: codec description.
@version: LibVLC 3.0.0 and later. See L{MediaTrack}.
... |
Release media descriptor's elementary streams description array.
@param p_tracks: tracks info array to release.
@param i_count: number of elements in the array.
@version: LibVLC 2.1.0 and later. | def libvlc_media_tracks_release(p_tracks, i_count):
'''Release media descriptor's elementary streams description array.
@param p_tracks: tracks info array to release.
@param i_count: number of elements in the array.
@version: LibVLC 2.1.0 and later.
'''
f = _Cfunctions.get('libvlc_media_tracks_r... |
Get the media type of the media descriptor object.
@param p_md: media descriptor object.
@return: media type.
@version: LibVLC 3.0.0 and later. See libvlc_media_type_t. | def libvlc_media_get_type(p_md):
'''Get the media type of the media descriptor object.
@param p_md: media descriptor object.
@return: media type.
@version: LibVLC 3.0.0 and later. See libvlc_media_type_t.
'''
f = _Cfunctions.get('libvlc_media_get_type', None) or \
_Cfunction('libvlc_medi... |
Create a media discoverer object by name.
After this object is created, you should attach to events in order to be
notified of the discoverer state.
You should also attach to media_list events in order to be notified of new
items discovered.
You need to call L{libvlc_media_discoverer_start}() in ord... | def libvlc_media_discoverer_new(p_inst, psz_name):
'''Create a media discoverer object by name.
After this object is created, you should attach to events in order to be
notified of the discoverer state.
You should also attach to media_list events in order to be notified of new
items discovered.
... |
Get media service discover object its localized name.
@param p_mdis: media discover object.
@return: localized name. | def libvlc_media_discoverer_localized_name(p_mdis):
'''Get media service discover object its localized name.
@param p_mdis: media discover object.
@return: localized name.
'''
f = _Cfunctions.get('libvlc_media_discoverer_localized_name', None) or \
_Cfunction('libvlc_media_discoverer_localiz... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.