Skip to content

Commit

Permalink
Renamings wrt. Params_Scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
raph-amiard committed Oct 21, 2018
1 parent 3a92e0d commit b71bebd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
18 changes: 9 additions & 9 deletions src/sound_gen_interfaces.adb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ with Ada.Containers.Vectors;
package body Sound_Gen_Interfaces is

package PA_Vectors
is new Ada.Containers.Vectors (Natural, Params_Aggregator);
is new Ada.Containers.Vectors (Natural, Params_Scope);

Params_Aggregators : PA_Vectors.Vector;

function Current_FPA return Params_Aggregator is
function Current_FPA return Params_Scope is
(Params_Aggregators.Last_Element);

-----------------------------
Expand Down Expand Up @@ -83,17 +83,17 @@ package body Sound_Gen_Interfaces is
end Internal;

begin
Self.Params_Scope := new Params_Aggregator_Type;
Enter (Self.Params_Scope);
Self.Parameters := new Params_Scope_Type;
Enter (Self.Parameters);
Internal (Self);
Leave (Self.Params_Scope);
Leave (Self.Parameters);
end Compute_Params;

-----------
-- Enter --
-----------

procedure Enter (F : Params_Aggregator) is
procedure Enter (F : Params_Scope) is
begin
Params_Aggregators.Append (F);
end Enter;
Expand All @@ -102,7 +102,7 @@ package body Sound_Gen_Interfaces is
-- Leave --
-----------

procedure Leave (F : Params_Aggregator) is
procedure Leave (F : Params_Scope) is
begin
pragma Assert (F = Current_FPA);
Params_Aggregators.Delete_Last;
Expand Down Expand Up @@ -158,8 +158,8 @@ package body Sound_Gen_Interfaces is
function Internal
(G : Generator_Access) return Generator_Arrays.Array_Type
is
(if G.Params_Scope /= null
then Generator_Arrays.To_Array (G.Params_Scope.Generators)
(if G.Parameters /= null
then Generator_Arrays.To_Array (G.Parameters.Generators)
else Generator_Arrays.Empty_Array) with Inline_Always;

function Cat_Arrays
Expand Down
13 changes: 8 additions & 5 deletions src/sound_gen_interfaces.ads
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,21 @@ package Sound_Gen_Interfaces is
subtype Generator_Array is Generator_Arrays.Array_Type;
subtype Generator_Vector is Generator_Arrays.Vectors.Vector;
Empty_Generator_Array : Generator_Array := Generator_Arrays.Empty_Array;
----------------------
-- Parameter scope --
---------------------------

type Params_Aggregator_Type is record
type Params_Scope_Type is record
Generators : Generator_Arrays.Vector_Type;
end record;
type Params_Aggregator is access all Params_Aggregator_Type;
type Params_Scope is access all Params_Scope_Type;

procedure Enter (F : Params_Aggregator);
procedure Leave (F : Params_Aggregator);
procedure Enter (F : Params_Scope);
procedure Leave (F : Params_Scope);
procedure Add_To_Current (G : Generator_Access);

type Generator is abstract tagged record
Params_Scope : Params_Aggregator;
Parameters : Params_Scope;
end record;

procedure Next_Samples
Expand Down

0 comments on commit b71bebd

Please sign in to comment.