2 """Create a new Instance instance.
4 It may take as parameter either:
6 * a list of strings as first parameters
7 * the parameters given as the constructor parameters (must be strings)
8 * a MediaControl instance
13 elif p and isinstance(p[0], (int, long)):
14 # instance creation from ctypes
16 o._as_parameter_=ctypes.c_void_p(p[0])
18 elif len(p) == 1 and isinstance(p[0], basestring):
19 # Only 1 string parameter: should be a parameter line
21 elif len(p) == 1 and isinstance(p[0], (tuple, list)):
24 if p and isinstance(p[0], MediaControl):
25 return p[0].get_instance()
28 return libvlc_new(len(p), p, e)
31 """Create a new MediaControl instance
33 It may take as parameter either:
35 * a list of strings as first parameters
36 * the parameters given as the constructor parameters (must be strings)
42 elif p and isinstance(p[0], (int, long)):
43 # instance creation from ctypes
45 o._as_parameter_=ctypes.c_void_p(p[0])
47 elif len(p) == 1 and isinstance(p[0], basestring):
48 # Only 1 string parameter: should be a parameter line
50 elif len(p) == 1 and isinstance(p[0], (tuple, list)):
53 if p and isinstance(p[0], Instance):
54 e=MediaControlException()
55 return mediacontrol_new_from_instance(p[0])
57 e=MediaControlException()
58 return mediacontrol_new(len(p), p, e)