krähemann.com

Custom application design and development out-sourcing

The wanted cursor API

A cursor is way more efficient than doing bisection of storage objects like:

  • AgsNotation
  • AgsAutomation
  • AgsWave
  • AgsMidi

The idea is to implement the following cursors: AgsNoteCursor, AgsAccelerationCursor, AgsBufferCursor and AgsTrackCursor.

All implementing AgsCursor interface.

The cursor interface shall have following prototype:

  • ::get_default_offset()
    • the offset for chunks
    • fixed size
  • ::get_tact()
    • The tact segmentation it is using
  • ::get_bpm()
    • the BPM it is using
  • ::get_rate()
    • the maximum rate it is using
  • ::get_delay()
    • the current delay
    • variable size related to maximum rate and BPM
  • ::get_duration()
    • the absolute duration
    • fixed size
  • ::get_delay_counter()
    • the internal delay counter
    • providing additional resolution
  • ::get_offset()
    • the current cursor position as offset
    • variable interpretation by implementation
  • ::get_prev()
    • get previous item
    • may be NULL if no previous
  • ::get_next()
    • get next storage item
    • may be NULL if no next
  • ::get_current_copy()
    • get current storage items as copy
    • may be NULL
  • ::get_current()
    • get current storage item
    • may be NULL

The AgsCursor interface does basic cursor abstraction. To reposition the cursor use the yet available AgsSeekable interface.

In order to implement the cursor interface we have a need for a small refactoring.


by Joël