EventLaneViewer
index
/home/laszlo/Dev/joko-gtk-builder/Jokosher/EventLaneViewer.py

#       THIS FILE IS PART OF THE JOKOSHER PROJECT AND LICENSED UNDER THE GPL. SEE
#       THE 'COPYING' FILE FOR DETAILS
#
#       EventLaneViewer.py
#       
#       This is a gui class that acts as the container for all the 
#       EventViewers belonging to a single instrument. Graphically,
#       this class makes up the timeline portion of the instrument,
#       on which the events can be placed and moved.
#
#-------------------------------------------------------------------------------

 
Modules
       
ui.EventLaneHSeparator
Globals
PlatformUtils
Utils
cairo
gettext
gtk
itertools
os
sys
urllib

 
Classes
       
gtk.EventBox(gtk.Bin)
EventLaneViewer

 
class EventLaneViewer(gtk.EventBox)
    This class is a container for all the individual EventViewers
for a single Instrument.
 
 
Method resolution order:
EventLaneViewer
gtk.EventBox
gtk.Bin
gtk.Container
gtk.Widget
gtk.Object
gobject._gobject.GObject
atk.ImplementorIface
gtk.Buildable
gobject.GInterface
__builtin__.object

Methods defined here:
ChangeSize(self, small)
Changes the size of the event lane.
 
Parameters:
        small - True if the event lane is to be small.
CreateEventFromFile(self, event=None)
Called when "Import Audio File..." is selected from the right-click context menu.
Opens up a file chooser dialog to import an Event.
 
Parameters:
        event -- reserved for GTK callbacks, don't use it explicitly.
Destroy(self)
Called when the EventLaneViewer gets destroyed.
It also destroys any child widget and disconnects itself from any
gobject signals.
OnDelete(self, event=None)
Called when "Delete" is selected from context menu.
Deletes the selected Instrument from the Project.
 
Considerations:
        This delete is called when right-clicking an EMPTY section
        of the EventLaneViewer. For right-clicking over a selected
        Event see OnDelete in EventViewer.
        
Parameters:
        event -- reserved for GTK callbacks, don't use it explicitly.
OnDragDataReceived(self, widget, context, x, y, selection, targetType, time)
Called when the user releases MOUSE1, finishing a drag and drop
procedure.
Adds an Event for each "file://"-uri in the uri-list to the Instrument, 
one after the other. The files will be copied to the Project's audio directory.
        
Parameters:
        widget -- InstrumentViewer being dragged.
        context -- reserved for GTK callbacks, don't use it explicitly.
        x -- point in the X axis the dragged object was dropped.
        y -- point in the Y axis the dragged object was dropped..
        selection -- selected object area that was dragged.
        targetType -- mimetype of the dragged object.
        time -- reserved for GTK callbacks, don't use it explicitly.
        
Returns:
        True -- continue GTK signal propagation. *CHECK*
OnDragLeave(self, widget, drag_context, timestamp)
Called when the user moves the cursor ouf of the EventLaneViewer
while performing a drag and drop procedure.
Hides the highlight cursor.
 
Parameters:
        widget -- reserved for GTK callbacks, don't use it explicitly.
        drag_context -- reserved for GTK callbacks, don't use it explicitly.
        timestamp -- reserved for GTK callbacks, don't use it explicitly.
OnDragMotion(self, widget, context, x, y, time)
Called each time the user moves the mouse while dragging.
Draws a cursor on the EventLane while dragging something over it.
 
Parameters:
        widget -- InstrumentViewer the mouse is hovering over.
        context -- cairo widget context.
        x -- reserved for GTK callbacks, don't use it explicitly.
        y -- reserved for GTK callbacks, don't use it explicitly.
        time -- reserved for GTK callbacks, don't use it explicitly.
 
Returns:
        True -- continue GTK signal propagation. *CHECK*
OnDraw(self, widget, event)
Called everytime the window is drawn.
Handles the drawing of the lane edges and vertical line cursors.
 
Parameters:
        widget -- GTK widget to be repainted.
        event -- reserved for GTK callbacks, don't use it explicitly.
OnEventAdded(self, instrument, event)
Callback for when an event is added to our instrument.
 
Parameters:
        instrument -- the instrument instance that send the signal.
        event -- the event instance that was added.
OnEventRemoved(self, instrument, event)
Callback for when an event is removed from our instrument.
 
Parameters:
        instrument -- the instrument instance that send the signal.
        event -- the event instance that was removed.
OnMenuDone(self, widget=None)
Hides the right-click context menu after the user has selected one
of its options or clicked elsewhere.
 
Parameters:
        widget -- reserved for GTK callbacks, don't use it explicitly.
OnMouseDown(self, widget, mouse)
Called when the user pressed a mouse button.
If it's a right-click, creates a context menu on the fly for importing,
pasting and deleting Events.
 
Parameters:
        widget -- reserved for GTK callbacks, don't use it explicitly.
        mouse -- GTK mouse event that fired this method call.
OnMouseLeave(self, widget, mouse)
Clears the StatusBar message when the mouse moves out of the
EventLaneViewer area.
 
Parameters:
        widget -- reserved for GTK callbacks, don't use it explicitly.
        mouse -- GTK mouse event that fired this method call.
OnMouseMove(self, widget, mouse)
Display a message in the StatusBar when the mouse hovers over the
EventLaneViewer.
 
Parameters:
        widget -- reserved for GTK callbacks, don't use it explicitly.
        mouse -- GTK mouse event that fired this method call.
OnPaste(self, widget)
Called when "Paste" is selected from the context menu.
Adds the selected Event to the clipboard.
 
Parameters:
        widget -- reserved for GTK callbacks, don't use it explicitly.
OnProjectViewChange(self, project)
Callback function for when the project view changes,
and the "view-start" or the "zoom" signal is send, and we
need to update.
 
Parameters:
        project -- The project instance that send the signal.
OnTransportPosition(self, transportManager, extraString)
Callback for signal when the transport position changes.
Here we just redraw the playhead.
 
Parameters:
        transportManager -- the TransportManager instance that send the signal.
        extraString -- a string specifying the extra action details. i.e. "stop-action"
                        means that the position changed because the user hit stop.
PutDrawer(self, drawer, xvalue=1)
Places the drawer below in the event lane and makes it visible.
 
Parameters:
        drawer -- the widget to show.
        xvalue -- the horizontal position of the drawer in pixels
RemoveDrawer(self, drawer)
Removes the drawer from below in the event. This function does
nothing if the given drawer is not currenly shown.
 
Parameters:
        drawer -- the widget to remove.
UpdatePosition(self, eventViewer)
Moves the given EventViewer widget to the appropriate position.
 
Parameters:
        eventViewer -- the widget that has needs to be moved to a new position.
__init__(self, project, instrument, instrumentviewer, mainview, small=False)
Creates a new instance of EventLaneViewer.
 
Parameters:
        project -- the currently active Project.
        instrument -- the Instrument that the Event lane belongs to.
        instrumentviewer -- the InstrumentViewer holding the Event lane.
        mainview -- the MainApp Jokosher window.
        small -- set to True if we want small edit views (i.e. for mixing view).

Data and other attributes defined here:
DRAG_TARGETS = [('text/uri-list', 0, 84), ('text/plain', 0, 84)]
URI_DRAG_TYPE = 84

Methods inherited from gtk.EventBox:
__iter__(...)
x.__iter__() <==> iter(x)
get_above_child(...)
get_visible_window(...)
set_above_child(...)
set_visible_window(...)

Data and other attributes inherited from gtk.EventBox:
__gtype__ = <GType GtkEventBox (26939184)>

Methods inherited from gtk.Bin:
get_child(...)

Data descriptors inherited from gtk.Bin:
child

Methods inherited from gtk.Container:
__len__(...)
x.__len__() <==> len(x)
__nonzero__(...)
x.__nonzero__() <==> x != 0
add(...)
add_with_properties(...)
check_resize(...)
child_get(...)
child_get_property(...)
child_set(...)
child_set_property(...)
child_type(...)
children(...)
forall(...)
foreach(...)
get_border_width(...)
get_children(...)
get_focus_chain(...)
get_focus_child(...)
get_focus_hadjustment(...)
get_focus_vadjustment(...)
get_resize_mode(...)
propagate_expose(...)
remove(...)
resize_children(...)
set_border_width(...)
set_focus_chain(...)
set_focus_child(...)
set_focus_hadjustment(...)
set_focus_vadjustment(...)
set_reallocate_redraws(...)
set_resize_mode(...)
unset_focus_chain(...)

Data descriptors inherited from gtk.Container:
border_width
focus_child
has_focus_chain
need_resize
reallocate_redraws
resize_mode

Data and other attributes inherited from gtk.Container:
do_add = <built-in method do_add of GObjectMeta object>
do_check_resize = <built-in method do_check_resize of GObjectMeta object>
do_child_type = <built-in method do_child_type of GObjectMeta object>
do_composite_name = <built-in method do_composite_name of GObjectMeta object>
do_forall = <built-in method do_forall of GObjectMeta object>
do_get_child_property = <built-in method do_get_child_property of GObjectMeta object>
do_remove = <built-in method do_remove of GObjectMeta object>
do_set_child_property = <built-in method do_set_child_property of GObjectMeta object>
do_set_focus_child = <built-in method do_set_focus_child of GObjectMeta object>
install_child_property = <built-in method install_child_property of GObjectMeta object>
list_child_properties = <built-in method list_child_properties of GObjectMeta object>

Methods inherited from gtk.Widget:
activate(...)
add_accelerator(...)
add_events(...)
add_mnemonic_label(...)
can_activate_accel(...)
child_focus(...)
child_notify(...)
class_path(...)
create_pango_context(...)
create_pango_layout(...)
destroy(...)
drag_begin(...)
drag_check_threshold(...)
drag_dest_add_image_targets(...)
drag_dest_add_text_targets(...)
drag_dest_add_uri_targets(...)
drag_dest_find_target(...)
drag_dest_get_target_list(...)
drag_dest_get_track_motion(...)
drag_dest_set(...)
drag_dest_set_proxy(...)
drag_dest_set_target_list(...)
drag_dest_set_track_motion(...)
drag_dest_unset(...)
drag_get_data(...)
drag_highlight(...)
drag_source_add_image_targets(...)
drag_source_add_text_targets(...)
drag_source_add_uri_targets(...)
drag_source_get_target_list(...)
drag_source_set(...)
drag_source_set_icon(...)
drag_source_set_icon_name(...)
drag_source_set_icon_pixbuf(...)
drag_source_set_icon_stock(...)
drag_source_set_target_list(...)
drag_source_unset(...)
drag_unhighlight(...)
draw(...)
ensure_style(...)
error_bell(...)
event(...)
freeze_child_notify(...)
get_accessible(...)
get_action(...)
get_allocation(...)
get_ancestor(...)
get_app_paintable(...)
get_can_default(...)
get_can_focus(...)
get_child_requisition(...)
get_child_visible(...)
get_clipboard(...)
get_colormap(...)
get_composite_name(...)
get_direction(...)
get_display(...)
get_double_buffered(...)
get_events(...)
get_extension_events(...)
get_has_tooltip(...)
get_has_window(...)
get_mapped(...)
get_modifier_style(...)
get_name(...)
get_no_show_all(...)
get_pango_context(...)
get_parent(...)
get_parent_window(...)
get_pointer(...)
get_realized(...)
get_receives_default(...)
get_requisition(...)
get_root_window(...)
get_screen(...)
get_sensitive(...)
get_settings(...)
get_size_request(...)
get_snapshot(...)
get_state(...)
get_style(...)
get_tooltip_markup(...)
get_tooltip_text(...)
get_tooltip_window(...)
get_toplevel(...)
get_visible(...)
get_visual(...)
get_window(...)
grab_add(...)
grab_default(...)
grab_focus(...)
grab_remove(...)
has_default(...)
has_focus(...)
has_grab(...)
has_rc_style(...)
has_screen(...)
hide(...)
hide_all(...)
hide_on_delete(...)
input_shape_combine_mask(...)
intersect(...)
is_ancestor(...)
is_composited(...)
is_drawable(...)
is_focus(...)
is_sensitive(...)
is_toplevel(...)
keynav_failed(...)
list_accel_closures(...)
list_mnemonic_labels(...)
map(...)
menu_get_for_attach_widget(...)
mnemonic_activate(...)
modify_base(...)
modify_bg(...)
modify_cursor(...)
modify_fg(...)
modify_font(...)
modify_style(...)
modify_text(...)
path(...)
queue_clear(...)
queue_clear_area(...)
queue_draw(...)
queue_draw_area(...)
queue_resize(...)
queue_resize_no_redraw(...)
rc_get_style(...)
realize(...)
region_intersect(...)
remove_accelerator(...)
remove_mnemonic_label(...)
render_icon(...)
reparent(...)
reset_rc_styles(...)
reset_shapes(...)
selection_add_target(...)
selection_add_targets(...)
selection_clear_targets(...)
selection_convert(...)
selection_owner_set(...)
selection_remove_all(...)
send_expose(...)
send_focus_change(...)
set_accel_path(...)
set_allocation(...)
set_app_paintable(...)
set_can_default(...)
set_can_focus(...)
set_child_visible(...)
set_colormap(...)
set_composite_name(...)
set_direction(...)
set_double_buffered(...)
set_events(...)
set_extension_events(...)
set_has_tooltip(...)
set_has_window(...)
set_mapped(...)
set_name(...)
set_no_show_all(...)
set_parent(...)
set_parent_window(...)
set_realized(...)
set_receives_default(...)
set_redraw_on_allocate(...)
set_scroll_adjustments(...)
set_sensitive(...)
set_size_request(...)
set_state(...)
set_style(...)
set_tooltip_markup(...)
set_tooltip_text(...)
set_tooltip_window(...)
set_uposition(...)
set_usize(...)
set_visible(...)
set_window(...)
shape_combine_mask(...)
show(...)
show_all(...)
show_now(...)
size_allocate(...)
size_request(...)
style_attach(...)
style_get_property(...)
thaw_child_notify(...)
translate_coordinates(...)
trigger_tooltip_query(...)
unmap(...)
unparent(...)
unrealize(...)

Data descriptors inherited from gtk.Widget:
allocation
name
parent
requisition
saved_state
state
style
window

Data and other attributes inherited from gtk.Widget:
do_button_press_event = <built-in method do_button_press_event of GObjectMeta object>
do_button_release_event = <built-in method do_button_release_event of GObjectMeta object>
do_can_activate_accel = <built-in method do_can_activate_accel of GObjectMeta object>
do_client_event = <built-in method do_client_event of GObjectMeta object>
do_composited_changed = <built-in method do_composited_changed of GObjectMeta object>
do_configure_event = <built-in method do_configure_event of GObjectMeta object>
do_delete_event = <built-in method do_delete_event of GObjectMeta object>
do_destroy_event = <built-in method do_destroy_event of GObjectMeta object>
do_direction_changed = <built-in method do_direction_changed of GObjectMeta object>
do_drag_begin = <built-in method do_drag_begin of GObjectMeta object>
do_drag_data_delete = <built-in method do_drag_data_delete of GObjectMeta object>
do_drag_data_get = <built-in method do_drag_data_get of GObjectMeta object>
do_drag_data_received = <built-in method do_drag_data_received of GObjectMeta object>
do_drag_drop = <built-in method do_drag_drop of GObjectMeta object>
do_drag_end = <built-in method do_drag_end of GObjectMeta object>
do_drag_leave = <built-in method do_drag_leave of GObjectMeta object>
do_drag_motion = <built-in method do_drag_motion of GObjectMeta object>
do_enter_notify_event = <built-in method do_enter_notify_event of GObjectMeta object>
do_event = <built-in method do_event of GObjectMeta object>
do_expose_event = <built-in method do_expose_event of GObjectMeta object>
do_focus = <built-in method do_focus of GObjectMeta object>
do_focus_in_event = <built-in method do_focus_in_event of GObjectMeta object>
do_focus_out_event = <built-in method do_focus_out_event of GObjectMeta object>
do_get_accessible = <built-in method do_get_accessible of GObjectMeta object>
do_grab_broken_event = <built-in method do_grab_broken_event of GObjectMeta object>
do_grab_focus = <built-in method do_grab_focus of GObjectMeta object>
do_grab_notify = <built-in method do_grab_notify of GObjectMeta object>
do_hide = <built-in method do_hide of GObjectMeta object>
do_hide_all = <built-in method do_hide_all of GObjectMeta object>
do_hierarchy_changed = <built-in method do_hierarchy_changed of GObjectMeta object>
do_key_press_event = <built-in method do_key_press_event of GObjectMeta object>
do_key_release_event = <built-in method do_key_release_event of GObjectMeta object>
do_leave_notify_event = <built-in method do_leave_notify_event of GObjectMeta object>
do_map = <built-in method do_map of GObjectMeta object>
do_map_event = <built-in method do_map_event of GObjectMeta object>
do_mnemonic_activate = <built-in method do_mnemonic_activate of GObjectMeta object>
do_motion_notify_event = <built-in method do_motion_notify_event of GObjectMeta object>
do_no_expose_event = <built-in method do_no_expose_event of GObjectMeta object>
do_parent_set = <built-in method do_parent_set of GObjectMeta object>
do_popup_menu = <built-in method do_popup_menu of GObjectMeta object>
do_property_notify_event = <built-in method do_property_notify_event of GObjectMeta object>
do_proximity_in_event = <built-in method do_proximity_in_event of GObjectMeta object>
do_proximity_out_event = <built-in method do_proximity_out_event of GObjectMeta object>
do_realize = <built-in method do_realize of GObjectMeta object>
do_screen_changed = <built-in method do_screen_changed of GObjectMeta object>
do_scroll_event = <built-in method do_scroll_event of GObjectMeta object>
do_selection_clear_event = <built-in method do_selection_clear_event of GObjectMeta object>
do_selection_get = <built-in method do_selection_get of GObjectMeta object>
do_selection_notify_event = <built-in method do_selection_notify_event of GObjectMeta object>
do_selection_received = <built-in method do_selection_received of GObjectMeta object>
do_selection_request_event = <built-in method do_selection_request_event of GObjectMeta object>
do_show = <built-in method do_show of GObjectMeta object>
do_show_all = <built-in method do_show_all of GObjectMeta object>
do_show_help = <built-in method do_show_help of GObjectMeta object>
do_size_allocate = <built-in method do_size_allocate of GObjectMeta object>
do_size_request = <built-in method do_size_request of GObjectMeta object>
do_state_changed = <built-in method do_state_changed of GObjectMeta object>
do_style_set = <built-in method do_style_set of GObjectMeta object>
do_unmap = <built-in method do_unmap of GObjectMeta object>
do_unmap_event = <built-in method do_unmap_event of GObjectMeta object>
do_unrealize = <built-in method do_unrealize of GObjectMeta object>
do_visibility_notify_event = <built-in method do_visibility_notify_event of GObjectMeta object>
do_window_state_event = <built-in method do_window_state_event of GObjectMeta object>
get_activate_signal = <built-in method get_activate_signal of GObjectMeta object>
set_activate_signal = <built-in method set_activate_signal of GObjectMeta object>
set_set_scroll_adjustments_signal = <built-in method set_set_scroll_adjustments_signal of GObjectMeta object>

Methods inherited from gtk.Object:
flags(...)
remove_data(...)
remove_no_notify(...)
set_flags(...)
unset_flags(...)

Data and other attributes inherited from gtk.Object:
do_destroy = <built-in method do_destroy of GObjectMeta object>

Methods inherited from gobject._gobject.GObject:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__copy__(...)
__deepcopy__(...)
__delattr__(...)
x.__delattr__('name') <==> del x.name
__gobject_init__(...)
__hash__(...)
x.__hash__() <==> hash(x)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
chain(...)
connect(...)
connect_after(...)
connect_object(...)
connect_object_after(...)
disconnect(...)
disconnect_by_func(...)
emit(...)
emit_stop_by_name(...)
freeze_notify(...)
get_data(...)
get_properties(...)
get_property(...)
handler_block(...)
handler_block_by_func(...)
handler_disconnect(...)
handler_is_connected(...)
handler_unblock(...)
handler_unblock_by_func(...)
notify(...)
set_data(...)
set_properties(...)
set_property(...)
stop_emission(...)
thaw_notify(...)
weak_ref(...)

Data descriptors inherited from gobject._gobject.GObject:
__dict__
__grefcount__

Data and other attributes inherited from gobject._gobject.GObject:
__gdoc__ = 'Object GtkEventBox\n\n\n\tThis class is a container ...ointer\n\nSignals from GObject:\n notify (GParam)\n\n'
__new__ = <built-in method __new__ of GObjectMeta object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
props = <gobject.GProps object>

Methods inherited from atk.ImplementorIface:
ref_accessible(...)

Methods inherited from gtk.Buildable:
add_child(...)
construct_child(...)
get_internal_child(...)
parser_finished(...)

Data and other attributes inherited from gtk.Buildable:
do_add_child = <built-in method do_add_child of GObjectMeta object>
do_construct_child = <built-in method do_construct_child of GObjectMeta object>
do_get_internal_child = <built-in method do_get_internal_child of GObjectMeta object>
do_parser_finished = <built-in method do_parser_finished of GObjectMeta object>
do_set_name = <built-in method do_set_name of GObjectMeta object>