Skip to content

Commit

Permalink
Add Module#subsong_names to the ruby interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Apr 13, 2019
1 parent 9d2b19a commit 7b9f86d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ffi/openmpt/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def num_subsongs
openmpt_module_get_num_subsongs(@mod)
end

def subsong_names
get_names(num_subsongs, :openmpt_module_get_subsong_name)
end

def num_channels
return if closed?
openmpt_module_get_num_channels(@mod)
Expand Down
8 changes: 8 additions & 0 deletions test/openmpt_module_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ def test_informational_calls
assert_nil m.num_samples
end

def test_subsong_names
::FFI::OpenMPT::Module.open(MOD_LAST_SUN) do |mod|
mod.subsong_names.each do |name|
assert_equal name, ''
end
end
end

def test_channel_names
::FFI::OpenMPT::Module.open(MOD_LAST_SUN) do |mod|
mod.channel_names.each do |name|
Expand Down

0 comments on commit 7b9f86d

Please sign in to comment.