Package aldrin :: Module patterns :: Class PatternView
[show private | hide private]
[frames | no frames]

Type PatternView

        CanvasBase --+    
                     |    
object --+           |    
         |           |    
    Object --+       |    
             |       |    
    EvtHandler --+   |    
                 |   |    
            Window --+    
                     |    
                Canvas --+
                         |
                        PatternView


Pattern viewer class.
Method Summary
  __init__(self, rootwindow, *args, **kwds)
Initialization.
  adjust_scrollbars(self)
  adjust_selection(self)
Adjusts the selection variables according to the selection mode.
(int, int, int, int, int) charpos_to_pattern(self, position)
Converts a (x,y) character coordinate into a pattern position.
  copy(self)
Copies the current selection into the clipboard
  cut(self)
Cuts the current selection into the clipboard
  DrawBuffer(self, row, rows, fulldraw)
Overriding a Canvas method that paints onto an offscreen buffer.
  get_charbounds(self)
Returns the outermost coordinates in characters.
(zzub.Plugin, zzub.Pattern) get_datasource(self)
Returns the plugin and the current pattern in the pattern view
  get_new_pattern_name(self)
Finds an unused pattern name.
zzub.Plugin get_plugin(self)
Returns the plugin of the pattern in the pattern view.
  get_virtual_size(self)
Returns the size in characters of the virtual view area.
  init_values(self)
Initializes pattern storage and information.
  interpolate_selection(self)
Fills the current selection with values interpolated from selection start to selection end.
  move_down(self, step)
Moves the cursor down.
  move_index_left(self)
Moves the cursor one index position left.
  move_index_right(self)
Moves the cursor one index position right.
  move_left(self)
Moves the cursor left.
  move_right(self)
Moves the cursor right.
  move_subindex_left(self)
Moves the cursor one subindex position left.
  move_subindex_right(self)
Moves the cursor one subindex position right.
  move_track_left(self)
Moves the cursor one track position left.
  move_track_right(self)
Moves the cursor one track position right.
  move_up(self, step)
Moves the cursor up.
  on_char(self, event)
Callback that responds to key stroke in pattern view.
  on_context_menu(self, event)
Callback that constructs and displays the popup menu
  on_copy(self, event)
Sent when the copy function is selected from the menu.
  on_cut(self, event)
Sent when the cut function is selected from the menu.
  on_key_down(self, event)
Callback that responds to key stroke in pattern view.
  on_left_down(self, event)
Callback that responds to left click in pattern view.
  on_mousewheel(self, event)
Callback that responds to mousewheeling in pattern view.
  on_paste(self, event)
Sent when the paste function is selected from the menu.
  on_popup_add_track(self, event)
Callback that adds a track.
  on_popup_create_copy(self, event)
Callback that creates a copy of the current pattern.
  on_popup_create_pattern(self, event)
Callback that creates a pattern.
  on_popup_delete_track(self, event)
Callback that deletes last track.
  on_popup_properties(self, event)
Callback that shows the properties of the current pattern.
  on_popup_remove_pattern(self, event)
Callback that removes the current pattern.
  on_popup_solo(self, event)
Callback that solos current plugin.
  on_scroll_window(self, event)
Handles window scrolling.
  onPostPaint(self, dc)
Overriding a Canvas method that is called after painting is completed.
  paste(self)
Pastes the clipboard data into the pattern view.
  pattern_changed(self)
Loads and redraws the pattern view after the pattern has been changed.
(int, int, int, int) pattern_range(self)
Iterator that moves through the entire pattern.
(int, int) pattern_to_charpos(self, row, group, track, index, subindex)
Converts a pattern position into a (x,y) character coordinate.
(int, int) pattern_to_pos(self, row, group, track, index, subindex)
Converts a pattern position into a (x,y) pixel coordinate.
(int, int, int, int, int) pos_to_pattern(self, position)
Converts a (x,y) pixel coordinate into a pattern position.
  prepare_textbuffer(self)
Initializes a buffer to handle the current pattern data.
  randomize_selection(self)
Fills the current selection with random values.
  refresh_view(self)
(int, int, int, int) selection_range(self)
Iterator that moves through the current selection.
  set_group(self, g)
Sets the current group position.
  set_index(self, i)
Sets the current index position.
  set_octave(self, o)
Sets the octave.
  set_row(self, r)
Sets the current row position.
  set_subindex(self, si)
Sets the current subindex position.
  set_track(self, t)
Sets the current track position.
  show_cursor_left(self)
Puts the cursor into visible frame after a jump to the left.
  show_cursor_right(self)
Puts the cursor into visible frame after a jump to the right.
  transpose_selection(self, offset)
Transposes the current selection by an offset.
  unpack_clipboard_data(self, d)
Unpacks clipboard data
  update_line(self, row)
Updates a line of the pattern.
  update_position(self, event)
Updates the position.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
str CLIPBOARD_MAGIC = 'PATTERNDATA'

Instance Method Details

__init__(self, rootwindow, *args, **kwds)
(Constructor)

Initialization.
Parameters:
rootwindow - Window that contains the component.
           (type=main.AldrinFrame)
Overrides:
aldrin.canvas.Canvas.__init__

adjust_selection(self)

Adjusts the selection variables according to the selection mode.

charpos_to_pattern(self, position)

Converts a (x,y) character coordinate into a pattern position.
Parameters:
position - Character coordinate.
           (type=(int, int))
Returns:
(row, group, track, index, subindex) representing a pattern position.
           (type=(int, int, int, int, int))

copy(self)

Copies the current selection into the clipboard

cut(self)

Cuts the current selection into the clipboard

DrawBuffer(self, row=None, rows=None, fulldraw=True)

Overriding a Canvas method that paints onto an offscreen buffer. Draws the pattern view graphics.
Overrides:
aldrin.canvas.CanvasBase.DrawBuffer

get_charbounds(self)

Returns the outermost coordinates in characters.

get_datasource(self)

Returns the plugin and the current pattern in the pattern view
Returns:
A tuple holding the plugin and the current pattern
           (type=(zzub.Plugin, zzub.Pattern))

get_new_pattern_name(self)

Finds an unused pattern name.

get_plugin(self)

Returns the plugin of the pattern in the pattern view.
Returns:
zzub plugin plugin.
           (type=zzub.Plugin)

get_virtual_size(self)

Returns the size in characters of the virtual view area.

init_values(self)

Initializes pattern storage and information.

interpolate_selection(self)

Fills the current selection with values interpolated from selection start to selection end.

move_down(self, step=1)

Moves the cursor down.
Parameters:
step - Amount the cursor is moved down.
           (type=int)

move_index_left(self)

Moves the cursor one index position left.

move_index_right(self)

Moves the cursor one index position right.

move_left(self)

Moves the cursor left.

move_right(self)

Moves the cursor right.

move_subindex_left(self)

Moves the cursor one subindex position left.

move_subindex_right(self)

Moves the cursor one subindex position right.

move_track_left(self)

Moves the cursor one track position left.

move_track_right(self)

Moves the cursor one track position right.

move_up(self, step=1)

Moves the cursor up.
Parameters:
step - Amount the cursor is moved up.
           (type=int)

on_char(self, event)

Callback that responds to key stroke in pattern view.
Parameters:
event - Key event
           (type=wx.KeyEvent)

on_context_menu(self, event)

Callback that constructs and displays the popup menu
Parameters:
event - Menu event.
           (type=wx.CommandEvent)

on_copy(self, event)

Sent when the copy function is selected from the menu.
Parameters:
event - Menu event.
           (type=wx.MenuEvent)

on_cut(self, event)

Sent when the cut function is selected from the menu.
Parameters:
event - Menu event.
           (type=wx.MenuEvent)

on_key_down(self, event)

Callback that responds to key stroke in pattern view.
Parameters:
event - Key event
           (type=wx.KeyEvent)

on_left_down(self, event)

Callback that responds to left click in pattern view.
Parameters:
event - Mouse event
           (type=wx.MouseEvent)

on_mousewheel(self, event)

Callback that responds to mousewheeling in pattern view.
Parameters:
event - Mouse event
           (type=wx.MouseEvent)

on_paste(self, event)

Sent when the paste function is selected from the menu.
Parameters:
event - Menu event.
           (type=wx.MenuEvent)

on_popup_add_track(self, event=None)

Callback that adds a track.

on_popup_create_copy(self, event=None)

Callback that creates a copy of the current pattern.

on_popup_create_pattern(self, event=None)

Callback that creates a pattern.

on_popup_delete_track(self, event=None)

Callback that deletes last track.

on_popup_properties(self, event=None)

Callback that shows the properties of the current pattern.

on_popup_remove_pattern(self, event=None)

Callback that removes the current pattern.

on_popup_solo(self, event=None)

Callback that solos current plugin.

on_scroll_window(self, event)

Handles window scrolling.

onPostPaint(self, dc)

Overriding a Canvas method that is called after painting is completed. Draws an XOR play cursor over the pattern view.
Parameters:
dc - wx device context.
           (type=wx.PaintDC)
Overrides:
aldrin.canvas.CanvasBase.onPostPaint

paste(self)

Pastes the clipboard data into the pattern view.

The pasting mechanism looks a bit weird but its effective. you can serialize pattern data in a pasteable form, and upon deserialization the app tries to make parameters as valid as possible.

Buzz used to not paste at all if the format wasnt right we still try to make some sense out of what we get.

pattern_changed(self)

Loads and redraws the pattern view after the pattern has been changed.

pattern_range(self)

Iterator that moves through the entire pattern.
Returns:
Tuple pair of the next position (row, group, track, index)
           (type=(int, int, int, int))

pattern_to_charpos(self, row, group, track=0, index=0, subindex=0)

Converts a pattern position into a (x,y) character coordinate.
Parameters:
row - Pattern row
           (type=int)
group - Specific pattern group (Connection, Global or Tracks)
           (type=int)
track - Track of the group
           (type=int)
index - Parameter index of the track
           (type=int)
subindex - Subindex of the index
           (type=int)
Returns:
(x,y) character coordinate
           (type=(int, int))

pattern_to_pos(self, row, group, track=0, index=0, subindex=0)

Converts a pattern position into a (x,y) pixel coordinate.
Parameters:
row - Pattern row
           (type=int)
group - Specific pattern group (Connection, Global or Tracks)
           (type=int)
track - Track of the group
           (type=int)
index - Parameter index of the track
           (type=int)
subindex - Subindex of the index
           (type=int)
Returns:
(x,y) pixel coordinate
           (type=(int, int))

pos_to_pattern(self, position)

Converts a (x,y) pixel coordinate into a pattern position.
Parameters:
position - Pixel coordinate.
           (type=(int, int))
Returns:
(row, group, track, index, subindex) representing a pattern position.
           (type=(int, int, int, int, int))

prepare_textbuffer(self)

Initializes a buffer to handle the current pattern data.

randomize_selection(self)

Fills the current selection with random values.

selection_range(self)

Iterator that moves through the current selection.
Returns:
Tuple pair of the next position (row, group, track, index)
           (type=(int, int, int, int))

set_group(self, g)

Sets the current group position.
Parameters:
g - Group position.
           (type=int)

set_index(self, i)

Sets the current index position.
Parameters:
i - Index position.
           (type=int)

set_octave(self, o)

Sets the octave.
Parameters:
o - Octave
           (type=int)

set_row(self, r)

Sets the current row position.
Parameters:
r - Row position.
           (type=int)

set_subindex(self, si)

Sets the current subindex position.
Parameters:
si - Subindex position.
           (type=int)

set_track(self, t)

Sets the current track position.
Parameters:
t - Track position.
           (type=int)

show_cursor_left(self)

Puts the cursor into visible frame after a jump to the left.

show_cursor_right(self)

Puts the cursor into visible frame after a jump to the right.

transpose_selection(self, offset)

Transposes the current selection by an offset.
Parameters:
offset - The amount that the values is incremented.
           (type=int)

unpack_clipboard_data(self, d)

Unpacks clipboard data
Parameters:
d - Data that is to be unpacked.
           (type=unicode)

update_line(self, row)

Updates a line of the pattern.
Parameters:
row - Line that will be updated.
           (type=int)

update_position(self, event)

Updates the position.

Class Variable Details

CLIPBOARD_MAGIC

Type:
str
Value:
'PATTERNDATA'                                                          

Generated by Epydoc 2.1 on Sun Feb 4 18:01:16 2007 http://epydoc.sf.net