Skip to content

Commit

Permalink
Add repeat_count to the ruby interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Nov 28, 2018
1 parent e7bb032 commit 4c75d27
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ffi/openmpt/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ def samples
openmpt_module_get_num_samples(@mod)
end

def repeat_count
openmpt_module_get_repeat_count(@mod)
end

def repeat_count=(count)
openmpt_module_set_repeat_count(@mod, count)
end

def metadata_keys
ptr = openmpt_module_get_metadata_keys(@mod)
str = ptr.read_string
Expand Down
11 changes: 11 additions & 0 deletions test/openmpt_module_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,17 @@ def test_render_params_ramping
end
end

def test_repeat_count
::FFI::OpenMPT::Module.open(MOD_LAST_SUN) do |mod|
assert_equal mod.repeat_count, 0

[-1, 2, 0].each do |count|
mod.repeat_count = count
assert_equal mod.repeat_count, count
end
end
end

def test_read_mono
duration = 10
raw = ::File.read(RAW_LAST_SUN_MONO_INT16)
Expand Down

0 comments on commit 4c75d27

Please sign in to comment.