mirror of
				https://github.com/onyx-and-iris/voicemeeter-rb.git
				synced 2025-10-31 12:21:46 +00:00 
			
		
		
		
	make docstrings rdoc compatible
This commit is contained in:
		
							parent
							
								
									84ba47843a
								
							
						
					
					
						commit
						330a1507c9
					
				
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -56,6 +56,9 @@ Gemfile.lock | |||||||
| # Used by RuboCop. Remote config files pulled in from inherit_from directive. | # Used by RuboCop. Remote config files pulled in from inherit_from directive. | ||||||
| # .rubocop-https?--* | # .rubocop-https?--* | ||||||
| 
 | 
 | ||||||
|  | # documentation | ||||||
|  | doc/ | ||||||
|  | 
 | ||||||
| # test | # test | ||||||
| quick.rb | quick.rb | ||||||
| config.yaml | config.yaml | ||||||
|  | |||||||
| @ -35,16 +35,17 @@ require_relative "voicemeeter/version" | |||||||
| 
 | 
 | ||||||
| module Voicemeeter | module Voicemeeter | ||||||
|   module Errors |   module Errors | ||||||
|     class VMError < StandardError; end |  | ||||||
|     # Base Voicemeeter error class |     # Base Voicemeeter error class | ||||||
|  |     class VMError < StandardError; end | ||||||
| 
 | 
 | ||||||
|  |     # Raised when errors occur during installation. | ||||||
|     class VMInstallError < VMError; end |     class VMInstallError < VMError; end | ||||||
|     # Errors raised during installation. |  | ||||||
| 
 | 
 | ||||||
|  |     # Raised when the C-API returns error codes | ||||||
|     class VMCAPIError < VMError |     class VMCAPIError < VMError | ||||||
|       # Errors raised when the C-API returns error codes |  | ||||||
|       attr_reader :fn_name, :code |       attr_reader :fn_name, :code | ||||||
| 
 | 
 | ||||||
|  |       # create a new VMCAPIError with given C-API function name and error code | ||||||
|       def initialize(fn_name, code) |       def initialize(fn_name, code) | ||||||
|         @fn_name = fn_name |         @fn_name = fn_name | ||||||
|         @code = code |         @code = code | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| module Voicemeeter | module Voicemeeter | ||||||
|  |   # Base class for Remote types | ||||||
|   class Base |   class Base | ||||||
|     # Base class for Remote types |  | ||||||
|     include Logging |     include Logging | ||||||
|     include Worker |     include Worker | ||||||
|     include Events::Director |     include Events::Director | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| module Voicemeeter | module Voicemeeter | ||||||
|   module Bus |   module Bus | ||||||
|  |     # Base class for Bus types | ||||||
|     class Base |     class Base | ||||||
|       # Base class for Bus types |  | ||||||
|       include IRemote |       include IRemote | ||||||
|       include Mixins::Fades |       include Mixins::Fades | ||||||
|       include Mixins::Return |       include Mixins::Return | ||||||
| @ -28,11 +28,11 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     class PhysicalBus < Base; end |  | ||||||
|     # Represents a Physical Bus |     # Represents a Physical Bus | ||||||
|  |     class PhysicalBus < Base; end | ||||||
| 
 | 
 | ||||||
|     class VirtualBus < Base; end |  | ||||||
|     # Represents a Virtual Bus |     # Represents a Virtual Bus | ||||||
|  |     class VirtualBus < Base; end | ||||||
| 
 | 
 | ||||||
|     class BusEq |     class BusEq | ||||||
|       include IRemote |       include IRemote | ||||||
|  | |||||||
| @ -26,8 +26,8 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|  |     # Base class for Button types | ||||||
|     class Base |     class Base | ||||||
|       # Base class for Button types |  | ||||||
|       include Logging |       include Logging | ||||||
|       include IRemote |       include IRemote | ||||||
|       include ButtonColorMixin |       include ButtonColorMixin | ||||||
|  | |||||||
| @ -1,7 +1,6 @@ | |||||||
| module Voicemeeter | module Voicemeeter | ||||||
|  |   # Ruby bindings for the C-API functions | ||||||
|   module CBindings |   module CBindings | ||||||
|     # Ruby bindings for the C-API functions |  | ||||||
| 
 |  | ||||||
|     private |     private | ||||||
| 
 | 
 | ||||||
|     extend Logging |     extend Logging | ||||||
|  | |||||||
| @ -12,7 +12,6 @@ module Voicemeeter | |||||||
|         eq = [:eq].to_h { |param| [param, {on: false}] } |         eq = [:eq].to_h { |param| [param, {on: false}] } | ||||||
| 
 | 
 | ||||||
|         overrides = {B1: true} |         overrides = {B1: true} | ||||||
|         # physical strip params |  | ||||||
|         phys_strip = |         phys_strip = | ||||||
|           (0...kind.phys_in).to_h do |i| |           (0...kind.phys_in).to_h do |i| | ||||||
|             [ |             [ | ||||||
| @ -22,7 +21,6 @@ module Voicemeeter | |||||||
|           end |           end | ||||||
| 
 | 
 | ||||||
|         overrides = {A1: true} |         overrides = {A1: true} | ||||||
|         # virtual strip params |  | ||||||
|         virt_strip = |         virt_strip = | ||||||
|           (kind.phys_in...kind.phys_in + kind.virt_in).to_h do |i| |           (kind.phys_in...kind.phys_in + kind.virt_in).to_h do |i| | ||||||
|             [ |             [ | ||||||
|  | |||||||
| @ -1,7 +1,6 @@ | |||||||
| module Voicemeeter | module Voicemeeter | ||||||
|  |   # Common interface with the base Remote class. | ||||||
|   module IRemote |   module IRemote | ||||||
|     # A commmon interface between the base Remote class and extended classes. |  | ||||||
| 
 |  | ||||||
|     include Logging |     include Logging | ||||||
|     include MetaFunctions |     include MetaFunctions | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,7 +1,5 @@ | |||||||
| module Voicemeeter | module Voicemeeter | ||||||
|   module Kinds |   module Kinds | ||||||
|     # KindMaps that describe the layout for each kind |  | ||||||
| 
 |  | ||||||
|     private |     private | ||||||
| 
 | 
 | ||||||
|     module KindEnum |     module KindEnum | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| module Voicemeeter | module Voicemeeter | ||||||
|   module Patch |   module Patch | ||||||
|  |     # Base class for Patch types | ||||||
|     class Base |     class Base | ||||||
|       # Base class for Patch types |  | ||||||
|       include IRemote |       include IRemote | ||||||
|       attr_reader :asio, :A2, :A3, :A4, :A5, :composite, :insert |       attr_reader :asio, :A2, :A3, :A4, :A5, :composite, :insert | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -7,8 +7,8 @@ module Voicemeeter | |||||||
|       MP3 = 100 |       MP3 = 100 | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|  |     # Base class for Recorder types | ||||||
|     class Base |     class Base | ||||||
|       # Base class for Recorder types |  | ||||||
|       include IRemote |       include IRemote | ||||||
|       include Mixins::Outputs |       include Mixins::Outputs | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,9 +1,6 @@ | |||||||
| module Voicemeeter | module Voicemeeter | ||||||
|  |   # Builder module for Remote factories. | ||||||
|   module Builder |   module Builder | ||||||
|     # Builder module for Remote factories. |  | ||||||
|     # Defines steps for building a Remote type of a kind. |  | ||||||
|     # Defines the base director |  | ||||||
| 
 |  | ||||||
|     private |     private | ||||||
| 
 | 
 | ||||||
|     def steps(step) |     def steps(step) | ||||||
| @ -29,8 +26,8 @@ module Voicemeeter | |||||||
|   module Remote |   module Remote | ||||||
|     extend Logging |     extend Logging | ||||||
| 
 | 
 | ||||||
|  |     # Concrete class for Remote types | ||||||
|     class Remote < Base |     class Remote < Base | ||||||
|       # Concrete class for Remote types |  | ||||||
|       include Builder |       include Builder | ||||||
| 
 | 
 | ||||||
|       public attr_reader :strip, :bus, :button, :vban, :command, :device, :option |       public attr_reader :strip, :bus, :button, :vban, :command, :device, :option | ||||||
| @ -57,11 +54,11 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     class RemoteBasic < Remote; end |  | ||||||
|     # Represents a RemoteBasic type |     # Represents a RemoteBasic type | ||||||
|  |     class RemoteBasic < Remote; end | ||||||
| 
 | 
 | ||||||
|  |     # Represents a RemoteBanana type | ||||||
|     class RemoteBanana < Remote |     class RemoteBanana < Remote | ||||||
|       # Represents a RemoteBanana type |  | ||||||
|       public attr_reader :recorder, :patch |       public attr_reader :recorder, :patch | ||||||
| 
 | 
 | ||||||
|       private def director |       private def director | ||||||
| @ -69,8 +66,8 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|  |     # Represents a RemotePotato type | ||||||
|     class RemotePotato < Remote |     class RemotePotato < Remote | ||||||
|       # Represents a RemotePotato type |  | ||||||
|       public attr_reader :recorder, :patch, :fx |       public attr_reader :recorder, :patch, :fx | ||||||
| 
 | 
 | ||||||
|       private def director |       private def director | ||||||
| @ -78,8 +75,8 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|  |     # Factory class for Remote types. Returns a Remote class of a kind. | ||||||
|     class RequestRemote |     class RequestRemote | ||||||
|       # Factory class for Remote types. Returns a Remote class of a kind. |  | ||||||
|       def self.for(kind, **) |       def self.for(kind, **) | ||||||
|         case kind.name |         case kind.name | ||||||
|         when :basic |         when :basic | ||||||
| @ -92,8 +89,8 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|  |     # Interface entry point. Wraps factory class and handles kind errors. | ||||||
|     def self.new(kind_id, **) |     def self.new(kind_id, **) | ||||||
|       # Interface entry point. Wraps factory class and handles kind errors. |  | ||||||
|       kind = Kinds.get(kind_id) |       kind = Kinds.get(kind_id) | ||||||
|     rescue KeyError => e |     rescue KeyError => e | ||||||
|       logger.error "#{e.class.name}: #{e.message}" |       logger.error "#{e.class.name}: #{e.message}" | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| module Voicemeeter | module Voicemeeter | ||||||
|   module Strip |   module Strip | ||||||
|  |     # Base class for Strip types | ||||||
|     class Base |     class Base | ||||||
|       # Base class for Strip types |  | ||||||
|       include IRemote |       include IRemote | ||||||
|       include Mixins::Outputs |       include Mixins::Outputs | ||||||
|       include Mixins::Fades |       include Mixins::Fades | ||||||
| @ -28,8 +28,8 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|  |     # Represents a Physical Strip | ||||||
|     class PhysicalStrip < Base |     class PhysicalStrip < Base | ||||||
|       # Represents a Physical Strip |  | ||||||
|       include Mixins::Xy::Pan |       include Mixins::Xy::Pan | ||||||
|       include Mixins::Xy::Color |       include Mixins::Xy::Color | ||||||
|       include Mixins::Xy::Fx |       include Mixins::Xy::Fx | ||||||
| @ -143,8 +143,8 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|  |     # Represents a Virtual Strip | ||||||
|     class VirtualStrip < Base |     class VirtualStrip < Base | ||||||
|       # Represents a Virtual Strip |  | ||||||
|       include Mixins::Xy::Pan |       include Mixins::Xy::Pan | ||||||
|       include Mixins::Apps |       include Mixins::Apps | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| module Voicemeeter | module Voicemeeter | ||||||
|   module Vban |   module Vban | ||||||
|  |     # Base class for Vban Stream types | ||||||
|     class VbanStream |     class VbanStream | ||||||
|       # Base class for Vban Stream types |  | ||||||
|       include IRemote |       include IRemote | ||||||
| 
 | 
 | ||||||
|       def initialize(remote, i) |       def initialize(remote, i) | ||||||
| @ -20,8 +20,8 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|  |     # Represents a Vban InStream | ||||||
|     class VbanInstream < VbanStream |     class VbanInstream < VbanStream | ||||||
|       # Represents a Vban InStream |  | ||||||
|       def initialize(remote, i) |       def initialize(remote, i) | ||||||
|         super |         super | ||||||
|         make_reader_int :sr, :channel, :bit |         make_reader_int :sr, :channel, :bit | ||||||
| @ -32,17 +32,17 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     class VbanAudioInstream < VbanInstream; end |  | ||||||
|     # Represents a Vban Audio InStream |     # Represents a Vban Audio InStream | ||||||
|  |     class VbanAudioInstream < VbanInstream; end | ||||||
| 
 | 
 | ||||||
|     class VbanMidiInstream < VbanInstream; end |  | ||||||
|     # Represents a Vban Midi InStream |     # Represents a Vban Midi InStream | ||||||
|  |     class VbanMidiInstream < VbanInstream; end | ||||||
| 
 | 
 | ||||||
|     class VbanTextInstream < VbanInstream; end |  | ||||||
|     # Represents a Vban Text InStream |     # Represents a Vban Text InStream | ||||||
|  |     class VbanTextInstream < VbanInstream; end | ||||||
| 
 | 
 | ||||||
|  |     # Represents a Vban OutStream | ||||||
|     class VbanOutstream < VbanStream |     class VbanOutstream < VbanStream | ||||||
|       # Represents a Vban OutStream |  | ||||||
|       def initialize(remote, i) |       def initialize(remote, i) | ||||||
|         super |         super | ||||||
|         make_accessor_int :sr, :channel, :bit |         make_accessor_int :sr, :channel, :bit | ||||||
| @ -53,11 +53,11 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     class VbanAudioOutstream < VbanOutstream; end |  | ||||||
|     # Represents a Vban Audio OutStream |     # Represents a Vban Audio OutStream | ||||||
|  |     class VbanAudioOutstream < VbanOutstream; end | ||||||
| 
 | 
 | ||||||
|     class VbanMidiOutstream < VbanOutstream; end |  | ||||||
|     # Represents a Vban Midi OutStream |     # Represents a Vban Midi OutStream | ||||||
|  |     class VbanMidiOutstream < VbanOutstream; end | ||||||
| 
 | 
 | ||||||
|     class RequestVbanStream |     class RequestVbanStream | ||||||
|       def self.for(remote, i, dir) |       def self.for(remote, i, dir) | ||||||
| @ -81,8 +81,8 @@ module Voicemeeter | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|  |     # Base class for Vban type | ||||||
|     class Base |     class Base | ||||||
|       # Base class for Vban type |  | ||||||
|       attr_reader :instream, :outstream |       attr_reader :instream, :outstream | ||||||
| 
 | 
 | ||||||
|       def initialize(remote) |       def initialize(remote) | ||||||
|  | |||||||
| @ -1,7 +1,5 @@ | |||||||
| module Voicemeeter | module Voicemeeter | ||||||
|   module Worker |   module Worker | ||||||
|     # Event threads, provides updates to observers |  | ||||||
| 
 |  | ||||||
|     include Logging |     include Logging | ||||||
| 
 | 
 | ||||||
|     private |     private | ||||||
| @ -48,7 +46,7 @@ module Voicemeeter | |||||||
|     public |     public | ||||||
| 
 | 
 | ||||||
|     def running? |     def running? | ||||||
|       @producer&.alive? # safe navigation |       @producer&.alive? | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     def init_event_threads |     def init_event_threads | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user