Skip to content

Commit e6f8103

Browse files
committed
Editorial changes
1 parent f71626d commit e6f8103

20 files changed

+141
-95
lines changed

src/riff.ads

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ package RIFF is
5050
FOURCC : String (1 .. 4);
5151
end record;
5252

53-
type Wave_Format_Chunk_Size is (Wave_Format_16_Size,
54-
Wave_Format_18_Size,
55-
Wave_Format_Extensible_Size);
53+
type Wave_Format_Chunk_Size is
54+
(Wave_Format_16_Size,
55+
Wave_Format_18_Size,
56+
Wave_Format_Extensible_Size);
5657

57-
for Wave_Format_Chunk_Size use (Wave_Format_16_Size => 16,
58-
Wave_Format_18_Size => 18,
59-
Wave_Format_Extensible_Size => 40);
58+
for Wave_Format_Chunk_Size use
59+
(Wave_Format_16_Size => 16,
60+
Wave_Format_18_Size => 18,
61+
Wave_Format_Extensible_Size => 40);
6062

6163
type Sub_GUID is array (1 .. 8) of Unsigned_8;
6264

@@ -68,31 +70,34 @@ package RIFF is
6870
Data_4 : Sub_GUID;
6971
end record;
7072

71-
GUID_Undefined : constant GUID := (16#00000000#,
72-
16#0000#,
73-
16#0000#,
74-
(16#00#, 16#00#,
75-
16#00#, 16#00#,
76-
16#00#, 16#00#,
77-
16#00#, 16#00#));
73+
GUID_Undefined : constant GUID :=
74+
(16#00000000#,
75+
16#0000#,
76+
16#0000#,
77+
(16#00#, 16#00#,
78+
16#00#, 16#00#,
79+
16#00#, 16#00#,
80+
16#00#, 16#00#));
7881
-- Undefined GUID
7982

80-
GUID_PCM : constant GUID := (16#00000001#,
81-
16#0000#,
82-
16#0010#,
83-
(16#80#, 16#00#,
84-
16#00#, 16#aa#,
85-
16#00#, 16#38#,
86-
16#9b#, 16#71#));
83+
GUID_PCM : constant GUID :=
84+
(16#00000001#,
85+
16#0000#,
86+
16#0010#,
87+
(16#80#, 16#00#,
88+
16#00#, 16#aa#,
89+
16#00#, 16#38#,
90+
16#9b#, 16#71#));
8791
-- CEA 861 0x01: KSDATAFORMAT_SUBTYPE_PCM (IEC 60958 PCM)
8892

89-
GUID_IEEE_Float : constant GUID := (16#00000003#,
90-
16#0000#,
91-
16#0010#,
92-
(16#80#, 16#00#,
93-
16#00#, 16#aa#,
94-
16#00#, 16#38#,
95-
16#9b#, 16#71#));
93+
GUID_IEEE_Float : constant GUID :=
94+
(16#00000003#,
95+
16#0000#,
96+
16#0010#,
97+
(16#80#, 16#00#,
98+
16#00#, 16#aa#,
99+
16#00#, 16#38#,
100+
16#9b#, 16#71#));
96101
-- CEA 861 0x01: KSDATAFORMAT_SUBTYPE_IEEE_FLOAT (IEEE Floating-Point PCM)
97102

98103
type Channel_Mask_Bit is new Boolean with Size => 1;

src/wavefiles-internals.adb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
package body Wavefiles.Internals is
3131

3232
use Ada.Streams.Stream_IO;
33-
procedure Skip_Bytes (F : in out Ada.Streams.Stream_IO.File_Type;
34-
Bytes : in Unsigned_32) is
33+
procedure Skip_Bytes
34+
(F : in out Ada.Streams.Stream_IO.File_Type;
35+
Bytes : in Unsigned_32) is
3536
begin
3637
Set_Index (F,
3738
Ada.Streams.Stream_IO.Index (F)

src/wavefiles-internals.ads

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ package Wavefiles.Internals is
3636
type Integer_24 is range -2 ** (24 - 1) .. 2 ** (24 - 1) - 1;
3737
for Integer_24'Size use 24;
3838

39-
procedure Skip_Bytes (F : in out Ada.Streams.Stream_IO.File_Type;
40-
Bytes : in Unsigned_32);
39+
procedure Skip_Bytes
40+
(F : in out Ada.Streams.Stream_IO.File_Type;
41+
Bytes : in Unsigned_32);
4142

4243
end Wavefiles.Internals;

src/wavefiles-pcm_buffers-data.adb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ package body Wavefiles.PCM_Buffers.Data is
3535
package Audio_Types is new Wavefiles.PCM_Buffers.Types
3636
(Audio_Res, PCM_Float_Type_Support, To_Long_Float);
3737

38-
procedure Read_Data (WF : in out Wavefile;
39-
Buf : in out PCM_Buffer) is
38+
procedure Read_Data
39+
(WF : in out Wavefile;
40+
Buf : in out PCM_Buffer)
41+
is
4042
Ch : constant Positive := Positive (WF.Wave_Format.Channels);
4143
type Audio_Sample is array (1 .. Ch) of Audio_Res;
4244
B : Audio_Sample;
4345
BB : Audio_Res;
44-
4546
begin
4647
Ada.Assertions.Assert (Ch <= Buf.Channels,
4748
"Unsufficient number of channel in buffer");
@@ -78,8 +79,10 @@ package body Wavefiles.PCM_Buffers.Data is
7879
end Read_Data;
7980

8081

81-
procedure Write_Data (WF : in out Wavefile;
82-
Buf : in PCM_Buffer) is
82+
procedure Write_Data
83+
(WF : in out Wavefile;
84+
Buf : in PCM_Buffer)
85+
is
8386
Ch : constant Positive := Positive (WF.Wave_Format.Channels);
8487
type Audio_Sample is array (1 .. Ch) of Audio_Res;
8588
B : Audio_Sample;

src/wavefiles-pcm_buffers-data.ads

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ private generic
3434
with function To_PCM_Type (A : Long_Float) return PCM_Type is <>;
3535
package Wavefiles.PCM_Buffers.Data is
3636

37-
procedure Read_Data (WF : in out Wavefile;
38-
Buf : in out PCM_Buffer);
37+
procedure Read_Data
38+
(WF : in out Wavefile;
39+
Buf : in out PCM_Buffer);
3940

40-
procedure Write_Data (WF : in out Wavefile;
41-
Buf : in PCM_Buffer);
41+
procedure Write_Data
42+
(WF : in out Wavefile;
43+
Buf : in PCM_Buffer);
4244

4345
end Wavefiles.PCM_Buffers.Data;

src/wavefiles-pcm_buffers-io.adb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ package body Wavefiles.PCM_Buffers.IO is
6666
end Is_Supported_Format;
6767

6868

69-
procedure Read (WF : in out Wavefile;
70-
Buf : out PCM_Buffer;
71-
EOF : out Boolean) is
69+
procedure Read
70+
(WF : in out Wavefile;
71+
Buf : out PCM_Buffer;
72+
EOF : out Boolean) is
7273
begin
7374
if not WF.Is_Opened then
7475
raise Wavefile_Error;
@@ -116,8 +117,9 @@ package body Wavefiles.PCM_Buffers.IO is
116117
end if;
117118
end Read;
118119

119-
procedure Write (WF : in out Wavefile;
120-
Buf : in PCM_Buffer) is
120+
procedure Write
121+
(WF : in out Wavefile;
122+
Buf : in PCM_Buffer) is
121123
begin
122124
if not WF.Is_Opened then
123125
raise Wavefile_Error;

src/wavefiles-pcm_buffers-io.ads

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ generic
3333
with function To_PCM_Type (A : Long_Float) return PCM_Type is <>;
3434
package Wavefiles.PCM_Buffers.IO is
3535

36-
procedure Read (WF : in out Wavefile;
37-
Buf : out PCM_Buffer;
38-
EOF : out Boolean);
36+
procedure Read
37+
(WF : in out Wavefile;
38+
Buf : out PCM_Buffer;
39+
EOF : out Boolean);
3940

40-
procedure Write (WF : in out Wavefile;
41-
Buf : in PCM_Buffer);
41+
procedure Write
42+
(WF : in out Wavefile;
43+
Buf : in PCM_Buffer);
4244

4345

4446
end Wavefiles.PCM_Buffers.IO;

src/wavefiles-pcm_buffers-operators.adb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ package body Wavefiles.PCM_Buffers.Operators is
9595
return PCM_Mix;
9696
end "-";
9797

98-
function "*" (Left : PCM_Buffer;
99-
Right : PCM_Type) return PCM_Buffer is
98+
function "*"
99+
(Left : PCM_Buffer;
100+
Right : PCM_Type)
101+
return PCM_Buffer
102+
is
100103
PCM_Out : PCM_Buffer (Left.Channels);
101104
begin
102105
PCM_Out.Info.Samples_Valid := Left.Info.Samples_Valid;

src/wavefiles-pcm_buffers-operators.ads

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ package Wavefiles.PCM_Buffers.Operators is
3636

3737
function "+" (Left, Right : PCM_Buffer) return PCM_Buffer;
3838
function "-" (Left, Right : PCM_Buffer) return PCM_Buffer;
39-
function "*" (Left : PCM_Buffer;
40-
Right : PCM_Type) return PCM_Buffer;
39+
function "*"
40+
(Left : PCM_Buffer;
41+
Right : PCM_Type) return PCM_Buffer;
4142

4243
end Wavefiles.PCM_Buffers.Operators;

src/wavefiles-pcm_buffers-types.adb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ with Ada.Text_IO; use Ada.Text_IO;
3131

3232
package body Wavefiles.PCM_Buffers.Types is
3333

34-
procedure Print_Sample_Read (Sample_In : Audio_Res;
35-
Sample_Out : PCM_Type) is
34+
procedure Print_Sample_Read
35+
(Sample_In : Audio_Res;
36+
Sample_Out : PCM_Type)
37+
is
3638
Bits_In : Audio_Res_Bit_Array;
3739
Bits_Out : PCM_Bit_Array;
3840
for Bits_In'Address use Sample_In'Address;
@@ -52,8 +54,10 @@ package body Wavefiles.PCM_Buffers.Types is
5254
end Print_Sample_Read;
5355

5456

55-
procedure Print_Sample_Write (Sample_In : PCM_Type;
56-
Sample_Out : Audio_Res) is
57+
procedure Print_Sample_Write
58+
(Sample_In : PCM_Type;
59+
Sample_Out : Audio_Res)
60+
is
5761
Bits_In : PCM_Bit_Array;
5862
Bits_Out : Audio_Res_Bit_Array;
5963
for Bits_In'Address use Sample_In'Address;
@@ -74,7 +78,6 @@ package body Wavefiles.PCM_Buffers.Types is
7478

7579

7680
function Convert_Sample (Sample : Audio_Res) return PCM_Type is
77-
7881
Sample_In : Audio_Res := Sample;
7982
Sample_Out : PCM_Type;
8083
Bits_In : Audio_Res_Bit_Array;
@@ -110,7 +113,6 @@ package body Wavefiles.PCM_Buffers.Types is
110113

111114

112115
function Convert_Sample (Sample : PCM_Type) return Audio_Res is
113-
114116
Sample_In : PCM_Type := Sample;
115117
Sample_Out : Audio_Res := 0;
116118
Bits_In : PCM_Bit_Array;

src/wavefiles-pcm_buffers-types.ads

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ package Wavefiles.PCM_Buffers.Types is
4343
Bool_Image : constant array (Boolean'Range) of Character := ('0', '1');
4444
Convert_Sample_Debug : constant Boolean := False;
4545

46-
procedure Print_Sample_Read (Sample_In : Audio_Res;
47-
Sample_Out : PCM_Type);
46+
procedure Print_Sample_Read
47+
(Sample_In : Audio_Res;
48+
Sample_Out : PCM_Type);
4849

49-
procedure Print_Sample_Write (Sample_In : PCM_Type;
50-
Sample_Out : Audio_Res);
50+
procedure Print_Sample_Write
51+
(Sample_In : PCM_Type;
52+
Sample_Out : Audio_Res);
5153

5254
function Convert_Sample (Sample : Audio_Res) return PCM_Type;
5355

src/wavefiles-pcm_buffers.adb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ with Ada.Text_IO; use Ada.Text_IO;
3131

3232
package body Wavefiles.PCM_Buffers is
3333

34-
function Is_Channel_Active (PCM_Buf : PCM_Buffer;
35-
Channel : Positive) return Boolean is
34+
function Is_Channel_Active
35+
(PCM_Buf : PCM_Buffer;
36+
Channel : Positive) return Boolean is
3637
begin
3738
return PCM_Buf.Info.Active (Channel);
3839
end Is_Channel_Active;
@@ -90,8 +91,11 @@ package body Wavefiles.PCM_Buffers is
9091
return True;
9192
end "=";
9293

93-
function Perform (Left, Right : PCM_Buffer;
94-
Op : PCM_Buffer_Op) return PCM_Buffer is
94+
function Perform
95+
(Left, Right : PCM_Buffer;
96+
Op : PCM_Buffer_Op)
97+
return PCM_Buffer
98+
is
9599
PCM_Out : PCM_Buffer (Positive'Max (Left.Channels, Right.Channels));
96100
begin
97101
PCM_Out.Info.Samples_Valid := Natural'Max (Left.Info.Samples_Valid,

src/wavefiles-pcm_buffers.ads

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,17 @@ package Wavefiles.PCM_Buffers is
5050

5151
type PCM_Buffer_Op is access function (A, B : PCM_Type) return PCM_Type;
5252

53-
function Is_Channel_Active (PCM_Buf : PCM_Buffer;
54-
Channel : Positive) return Boolean;
53+
function Is_Channel_Active
54+
(PCM_Buf : PCM_Buffer;
55+
Channel : Positive) return Boolean;
5556

5657
function Get_Number_Valid_Samples (PCM_Buf : PCM_Buffer) return Natural;
5758

5859
function "=" (Left, Right : PCM_Buffer) return Boolean;
5960

60-
function Perform (Left, Right : PCM_Buffer;
61-
Op : PCM_Buffer_Op) return PCM_Buffer;
61+
function Perform
62+
(Left, Right : PCM_Buffer;
63+
Op : PCM_Buffer_Op) return PCM_Buffer;
6264

6365
private
6466
type Audio_Active_Type is array (Positive range <>) of Boolean;

src/wavefiles-read.adb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ package body Wavefiles.Read is
3939

4040
use Ada.Streams.Stream_IO;
4141
use Interfaces;
42-
procedure Open (WF : in out Wavefile;
43-
File_Name : String) is
42+
procedure Open
43+
(WF : in out Wavefile;
44+
File_Name : String)
45+
is
4446
RIFF_Tag : RIFF_Tag_Type;
4547
RIFF_Chunk : RIFF_Chunk_Type;
4648
Verbose : constant Boolean := False;

src/wavefiles-read.ads

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929

3030
package Wavefiles.Read is
3131

32-
procedure Open (WF : in out Wavefile;
33-
File_Name : String);
32+
procedure Open
33+
(WF : in out Wavefile;
34+
File_Name : String);
3435

3536
procedure Display_Info (WF : in Wavefile);
3637

src/wavefiles-write.adb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ package body Wavefiles.Write is
3535
use Ada.Streams.Stream_IO;
3636
use Interfaces;
3737

38-
procedure Open (WF : in out Wavefile;
39-
File_Name : String;
40-
Wave_Format : RIFF.Wave_Format_Extensible) is
38+
procedure Open
39+
(WF : in out Wavefile;
40+
File_Name : String;
41+
Wave_Format : RIFF.Wave_Format_Extensible)
42+
is
4143
RIFF_Tag : RIFF_Tag_Type;
4244
RIFF_Chunk : RIFF_Chunk_Type;
4345
begin

src/wavefiles-write.ads

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ with RIFF;
3131

3232
package Wavefiles.Write is
3333

34-
procedure Open (WF : in out Wavefile;
35-
File_Name : String;
36-
Wave_Format : RIFF.Wave_Format_Extensible);
34+
procedure Open
35+
(WF : in out Wavefile;
36+
File_Name : String;
37+
Wave_Format : RIFF.Wave_Format_Extensible);
3738

3839
procedure Close (WF : in out Wavefile);
3940

src/wavefiles.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
package body Wavefiles is
3131

32-
function Get_Wave_Format (W : Wavefile)
33-
return RIFF.Wave_Format_Extensible is
32+
function Get_Wave_Format
33+
(W : Wavefile) return RIFF.Wave_Format_Extensible is
3434
begin
3535
return W.Wave_Format;
3636
end Get_Wave_Format;

0 commit comments

Comments
 (0)