Module gwy :: Class MarkerBox
[hide private]
[frames] | no frames]

Class MarkerBox

source code

Instance Methods [hide private]
 
get_selected_marker()
Gets the index of the currently selected marker in a marker box.
source code
 
set_selected_marker(i)
Selects a marker in a marker box.
source code
 
get_marker_position(i)
Gets the position of a marker in a marker box.
source code
 
set_marker_position(i, pos)
Moves a marker in a marker box.
source code
 
add_marker(i, pos)
Adds a marker to a marker box.
source code
 
remove_marker(i)
Removes a marker from a marker box.
source code
 
get_nmarkers()
Gets the number of markers in a marker box.
source code
 
set_flipped(flipped)
Sets whether a marker box is drawn upside down.
source code
 
get_flipped()
Returns whether a marker box is drawn upside down.
source code
 
set_highlight_selected(highlight)
Sets whether a marker box highlights selected marker.
source code
 
get_highlight_selected()
Returns whether a marker box highlights selected marker.
source code
 
get_markers()
Gets all markers in a marker box.
source code
 
set_markers(markers)
Sets positions of all markers in a marker box.
source code
Method Details [hide private]

get_selected_marker()

source code 

Gets the index of the currently selected marker in a marker box.

Returns:
The index of currently selected marker, -1 when none is selected. (int)

set_selected_marker(i)

source code 

Selects a marker in a marker box.

Parameters:
  • i - The index of marker to select. Pass -1 to unselect. (int)

get_marker_position(i)

source code 

Gets the position of a marker in a marker box.

Parameters:
  • i - The index of marker to get position of. (int)
Returns:
The marker position, in the range [0.0, 1.0]. (float)

set_marker_position(i, pos)

source code 

Moves a marker in a marker box.

Parameters:
  • i - Index of marker to move. (int)
  • pos - The new marker position, in the range [0.0, 1.0]. (float)
Returns:
True on success. If the move does not validate, False is returned and the marker position does not change. (bool)

add_marker(i, pos)

source code 

Adds a marker to a marker box.

Parameters:
  • i - Index to insert marker at. (int)
  • pos - Position to insert marker to, in the range [0.0, 1.0]. (float)
Returns:
On success, the index the marker was added at. If the insertion does not validate, -1 is returned and no marker is added. (int)

remove_marker(i)

source code 

Removes a marker from a marker box.

Parameters:
  • i - Index of marker to remove. (int)
Returns:
True on success. If the removal does not validate, False is returned and the marker is kept. (bool)

get_nmarkers()

source code 

Gets the number of markers in a marker box.

Returns:
The number of markers. (int)

set_flipped(flipped)

source code 

Sets whether a marker box is drawn upside down.

Parameters:
  • flipped - True to draw markers upside down. (bool)

get_flipped()

source code 

Returns whether a marker box is drawn upside down.

Returns:
True if markers are drawn upside down. (bool)

set_highlight_selected(highlight)

source code 

Sets whether a marker box highlights selected marker.

Parameters:
  • highlight - True to visually differentiate selected marker, False to draw markers uniformly. (bool)

get_highlight_selected()

source code 

Returns whether a marker box highlights selected marker.

Returns:
True if selected marker is visually differentiated, False if markers are drawn uniformly. (bool)

get_markers()

source code 

Gets all markers in a marker box.

Returns:
The markers as an array of positions, owned by mbox. It must not be modified nor freed by caller and it's valid only until next marker change. (list)

set_markers(markers)

source code 

Sets positions of all markers in a marker box.

No validation is performed, even if validator is set. It's up to caller to set markers that do not logically conflict with the validator.

Parameters:
  • markers - Markers position. (list)