fmod 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,27 +1,35 @@
1
1
  module FMOD
2
2
  module Core
3
+
3
4
  ##
4
5
  # These definitions describe the native format of the hardware or software
5
6
  # buffer that will be used.
6
7
  module SoundFormat
8
+
7
9
  ##
8
10
  # Uninitialized / unknown.
9
11
  NONE = 0
12
+
10
13
  ##
11
14
  # 8-bit integer PCM data.
12
15
  PCM_8 = 1
16
+
13
17
  ##
14
18
  # 16-bit integer PCM data.
15
19
  PCM_16 = 2
20
+
16
21
  ##
17
22
  # 24-bit integer PCM data.
18
23
  PCM_24 = 3
24
+
19
25
  ##
20
26
  # 32-bit integer PCM data.
21
27
  PCM_32 = 4
28
+
22
29
  ##
23
30
  # 32-bit floating point PCM data.
24
31
  PCM_FLOAT = 5
32
+
25
33
  ##
26
34
  # Sound data is in its native compressed format.
27
35
  BIT_STREAM = 6
@@ -1,5 +1,6 @@
1
1
  module FMOD
2
2
  module Core
3
+
3
4
  ##
4
5
  # These definitions describe the type of song being played.
5
6
  module SoundType
@@ -1,17 +1,56 @@
1
1
  module FMOD
2
2
  module Core
3
+
4
+ ##
5
+ # Assigns an enumeration for a speaker index.
3
6
  module SpeakerIndex
7
+
8
+ ##
9
+ # The front left speaker.
4
10
  FRONT_LEFT = 0
11
+
12
+ ##
13
+ # The front right speaker.
5
14
  FRONT_RIGHT = 1
15
+
16
+ ##
17
+ # The front center speaker.
6
18
  FRONT_CENTER = 2
19
+
20
+ ##
21
+ # The LFE or "subwoofer" speaker.
7
22
  LOW_FREQUENCY = 3
23
+
24
+ ##
25
+ # The surround left (usually to the side) speaker.
8
26
  SURROUND_LEFT = 4
27
+
28
+ ##
29
+ # The surround right (usually to the side) speaker.
9
30
  SURROUND_RIGHT = 5
31
+
32
+ ##
33
+ # The back left speaker.
10
34
  BACK_LEFT = 6
35
+
36
+ ##
37
+ # The back right speaker.
11
38
  BACK_RIGHT = 7
39
+
40
+ ##
41
+ # The top front left speaker.
12
42
  TOP_FRONT_LEFT = 8
43
+
44
+ ##
45
+ # The top front right speaker.
13
46
  TOP_FRONT_RIGHT = 9
47
+
48
+ ##
49
+ # The top back left speaker.
14
50
  TOP_BACK_LEFT = 10
51
+
52
+ ##
53
+ # The top back right speaker.
15
54
  TOP_BACK_RIGHT = 11
16
55
  end
17
56
  end
@@ -1,15 +1,53 @@
1
1
 
2
2
  module FMOD
3
3
  module Core
4
+
5
+ ##
6
+ # These are speaker types defined for use with the software format commands.
4
7
  module SpeakerMode
8
+
9
+ ##
10
+ # Default speaker mode for the chosen output mode which will resolve after
11
+ # System.create.
5
12
  DEFAULT = 0
13
+
14
+ ##
15
+ # Assume there is no special mapping from a given channel to a speaker,
16
+ # channels map 1:1 in order.
6
17
  RAW = 1
18
+
19
+ ##
20
+ # 1 speaker setup (monaural).
7
21
  MONO = 2
22
+
23
+ ##
24
+ # 2 speaker setup (stereo) front left, front right.
8
25
  STEREO = 3
26
+
27
+ ##
28
+ # 4 speaker setup (4.0) front left, front right, surround left, surround
29
+ # right.
9
30
  QUAD = 4
31
+
32
+ ##
33
+ # 5 speaker setup (5.0) front left, front right, center, surround left,
34
+ # surround right.
10
35
  SURROUND = 5
36
+
37
+ ##
38
+ # 6 speaker setup (5.1) front left, front right, center, low frequency,
39
+ # surround left, surround right.
11
40
  FIVE_POINT_ONE = 6
41
+
42
+ ##
43
+ # 8 speaker setup (7.1) front left, front right, center, low frequency,
44
+ # surround left, surround right, back left, back right.
12
45
  SEVEN_POINT_ONE = 7
46
+
47
+ ##
48
+ # 12 speaker setup (7.1.4) front left, front right, center, low frequency,
49
+ # surround left, surround right, back left, back right, top front left,
50
+ # top front right, top back left, top back right.
13
51
  SEVEN_POINT_FOUR = 9
14
52
  end
15
53
  end
@@ -1,12 +1,23 @@
1
- require 'fiddle'
2
1
 
3
2
  module FMOD
4
3
  module Core
4
+
5
+ ##
6
+ # @abstract
7
+ # Expands upon a the built-in Fiddle::CStructEntity to provide some
8
+ # additional common functionality for FMOD structures.
5
9
  class Structure < Fiddle::CStructEntity
6
10
 
7
11
  include Fiddle
8
12
  include FMOD::Core
9
13
 
14
+ ##
15
+ # @param address [Integer, String] The memory address of the structure as
16
+ # an integer or packed binary string.
17
+ # @param types [Array<Integer>] Array of primitive C-type flags for the
18
+ # data type used by each field.
19
+ # @param members [Array<Symbol>] Array of names as symbols to use for the
20
+ # fields.
10
21
  def initialize(address, types, members)
11
22
  address = Pointer[address] if address.is_a?(String)
12
23
  address ||= Fiddle.malloc(self.class.size(types)).to_i
@@ -14,6 +25,22 @@ module FMOD
14
25
  assign_names members
15
26
  end
16
27
 
28
+ ##
29
+ # @return [Array<Symbol>] the names of the structure's fields as symbols.
30
+ # @since 0.9.1
31
+ def names
32
+ @members
33
+ end
34
+
35
+ ##
36
+ # @return [Array<Object>] the values of the structure's fields.
37
+ # @since 0.9.1
38
+ def values
39
+ @members.map { |sym| self[sym] }
40
+ end
41
+
42
+ ##
43
+ # @return [String] the structure as a string.
17
44
  def inspect
18
45
  values = @members.map { |sym| "#{sym}=#{self[sym]}"}.join(', ')
19
46
  super.sub(/free=0x(.)*/, values << '>')
@@ -1026,9 +1026,9 @@ module FMOD
1026
1026
  end
1027
1027
 
1028
1028
  def [](index)
1029
- reverb = int_ptr
1029
+ reverb = Reverb.new
1030
1030
  FMOD.invoke(:System_GetReverbProperties, self, index, reverb)
1031
- Reverb.new(reverb.unpack1('J'))
1031
+ reverb
1032
1032
  end
1033
1033
 
1034
1034
  def []=(index, reverb)
@@ -1,3 +1,3 @@
1
1
  module FMOD
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fmod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
- - Eric "ForeverZero" Freed
7
+ - Eric "ForeverZer0" Freed
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-09 00:00:00.000000000 Z
11
+ date: 2018-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,48 +52,28 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.9'
55
- description: |-
56
- A full-featured (complete Ruby wrapper) of the ultra-powerful FMOD Low-Level API. Uses the built-in Fiddle library (Ruby 2.0+), and has no external gem dependencies, all that is needed is the native FMOD platform-specific native FMOD libraries (included).
57
-
58
- FMOD supports a host of audio formats including:
59
-
60
- - Audio Interchange File Format (.aiff )
61
- - Advanced Systems Format (.asf)
62
- - Advanced Stream Redirector (.asx)
63
- - Downloadable Sound (.dls)
64
- - Free Lossless Audio Codec (.flac)
65
- - FMOD Sound Bank (.fsb)
66
- - Impulse Tracker (.it)
67
- - MPEG Audio Layer 3 URL (.m3u)
68
- - Musical Instrument Digital Interface (.mid, .midi)
69
- - Module Format (.mod)
70
- - MPEG Audio Layer 2 (.mp2)
71
- - MPEG Audio Layer 3 (.mp3)
72
- - OGG Vorbis (.ogg)
73
- - Playlist (.pls)
74
- - ScreamTracker 3 Module (.s3m )
75
- - PS2/PSP Format (.vag )
76
- - Waveform Audio File Forma (.wav )
77
- - Windows Media Audio Redirector (.wax )
78
- - Windows Media Audio (.wma )
79
- - Extended Module (.xm )
80
- - Windows Media Audio (Xbox 360) (.xma)
81
-
82
- FMOD is most widely known for its application in video games for sound effects, as it fully supports 3D sound, and can be found in all popular video game consoles (Sony, Microsoft, and Nintendo), as well as a large number of popular PC and mobile games. Built-in is a large collection of audio effects that can be applied to a sound, including various equalizers, advanced reverb environments, pitch-shifting, frequency, flange, chorus, and many, many more.
83
-
84
- The wrapper supports callbacks for various events, such as sync-points in wave files, sound playback ending (either by user or end of data), and various other scenarios. It additionally supports access to raw PCM data directly from the sound card, for creating visualizations or examining the sound in real-time.
55
+ description: A full-featured (complete Ruby wrapper) of the ultra-powerful FMOD Low-Level
56
+ API. Uses the built-in Fiddle library (Ruby 2.0+), and has no external gem dependencies,
57
+ all that is needed is the FMOD platform-specific libraries (included). FMOD supports
58
+ a host of audio formats including .aiff, .asf, .asx, .dls, .flac, .fsb, .it, .m3u,
59
+ .mid, .midi, .mod, .mp2, .mp3, .ogg .pls, .s3m , vag, .wav, .wax, .wma, .xm, and.xma.
85
60
  email:
86
61
  - efreed09@gmail.com
87
62
  executables: []
88
63
  extensions: []
89
64
  extra_rdoc_files: []
90
65
  files:
66
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
67
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
91
68
  - ".gitignore"
92
69
  - ".travis.yml"
93
70
  - ".yardopts"
94
71
  - CODE_OF_CONDUCT.md
72
+ - CONTRIBUTING.md
95
73
  - Gemfile
74
+ - HISTORY.txt
96
75
  - LICENSE.txt
76
+ - PULL_REQUEST_TEMPLATE.md
97
77
  - README.md
98
78
  - Rakefile
99
79
  - bin/console