class

Crocket::SyncDevice

Inherits Reference < Object

Constants

DEFAULT_PORT = Rocket::SYNC_DEFAULT_PORT

Constructors

new(base : String)

Creates a new instance of Crocket::SyncDevice.

Source

Class methods

define_is_playing_callback
Source
define_pause_callback
Source
define_set_row_callback
Source

Instance methods

[](name : String)

Alias for #get_track.

Source
base
Source
finalize

Properly destroys the allocated sync device.

Source
get_track(name : String)

Returns a track.

Source
save_tracks

Saves the tracks to disk.

Source
tcp_connect(hostname : String, port : UInt16 = DEFAULT_PORT) : Bool

Connects to the Rocket editor listening on hostname at port via TCP.

Source
to_unsafe

to_unsafe returns the raw C pointer to this Rocket sync_device struct.

Useful for when you need to call the library functions directly.

For example:

device = Crocket::SyncDevice.new("sync")
callbacks = Crocket::Rocket::SyncCb.new(
  pause: ->(d : Void*, flag : Int32) {},
  # ...
)

# ...

loop do
  row = get_current_row(some_audio_context)
  Crocket::Rocket.sync_update(device, row.floor, pointerof(callbacks), nil)
end
Source
update(row : Int32) : Bool

Tells Rocket that we've moved to another row

Source
update(row : Float) : Bool

Tells Rocket that we've moved to another row

Lazy shortcut for

  device.update(row.floor.to_i)
Source