Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
audiowmark
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
audiowmark
Commits
f9c11116
Commit
f9c11116
authored
Dec 11, 2019
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support --quiet argument (suppresses info() messages).
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
36378658
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
7 deletions
+25
-7
TODO
src/TODO
+0
-1
audiowmark.cc
src/audiowmark.cc
+6
-0
utils.cc
src/utils.cc
+15
-6
utils.hh
src/utils.hh
+4
-0
No files found.
src/TODO
View file @
f9c11116
...
@@ -7,5 +7,4 @@ streaming:
...
@@ -7,5 +7,4 @@ streaming:
- mp3 indexing / detect (resync-limit)
- mp3 indexing / detect (resync-limit)
- final documentation
- final documentation
- --snr
- --snr
- --quiet
- ab init lazy
- ab init lazy
src/audiowmark.cc
View file @
f9c11116
...
@@ -41,6 +41,7 @@ print_usage()
...
@@ -41,6 +41,7 @@ print_usage()
printf
(
" --strength <s> set watermark strength [%.6g]
\n
"
,
Params
::
water_delta
*
1000
);
printf
(
" --strength <s> set watermark strength [%.6g]
\n
"
,
Params
::
water_delta
*
1000
);
printf
(
" --linear disable non-linear bit storage
\n
"
);
printf
(
" --linear disable non-linear bit storage
\n
"
);
printf
(
" --key <file> load watermarking key from file
\n
"
);
printf
(
" --key <file> load watermarking key from file
\n
"
);
printf
(
" -q, --quiet disable information messages
\n
"
);
}
}
static
bool
static
bool
...
@@ -260,6 +261,11 @@ parse_options (int *argc_p,
...
@@ -260,6 +261,11 @@ parse_options (int *argc_p,
Params
::
raw_input_format
.
set_sample_rate
(
r
);
Params
::
raw_input_format
.
set_sample_rate
(
r
);
Params
::
raw_output_format
.
set_sample_rate
(
r
);
Params
::
raw_output_format
.
set_sample_rate
(
r
);
}
}
else
if
(
check_arg
(
argc
,
argv
,
&
i
,
"--quiet"
)
||
check_arg
(
argc
,
argv
,
&
i
,
"-q"
))
{
set_log_level
(
Log
::
WARNING
);
}
}
}
/* resort argc/argv */
/* resort argc/argv */
...
...
src/utils.cc
View file @
f9c11116
...
@@ -91,18 +91,27 @@ vec_to_hex_str (const vector<unsigned char>& vec)
...
@@ -91,18 +91,27 @@ vec_to_hex_str (const vector<unsigned char>& vec)
return
s
;
return
s
;
}
}
enum
class
Log
{
ERROR
,
WARNING
,
INFO
,
DEBUG
};
static
Log
log_level
=
Log
::
INFO
;
void
set_log_level
(
Log
level
)
{
log_level
=
level
;
}
static
void
static
void
logv
(
Log
log
,
const
char
*
format
,
va_list
vargs
)
logv
(
Log
log
,
const
char
*
format
,
va_list
vargs
)
{
{
char
buffer
[
1024
];
if
(
log
>=
log_level
)
{
char
buffer
[
1024
];
vsnprintf
(
buffer
,
sizeof
(
buffer
),
format
,
vargs
);
vsnprintf
(
buffer
,
sizeof
(
buffer
),
format
,
vargs
);
/* could support custom log function here */
/* could support custom log function here */
fprintf
(
stderr
,
"%s"
,
buffer
);
fprintf
(
stderr
,
"%s"
,
buffer
);
fflush
(
stderr
);
fflush
(
stderr
);
}
}
}
void
void
...
...
src/utils.hh
View file @
f9c11116
...
@@ -37,6 +37,10 @@ void warning (const char *format, ...) AUDIOWMARK_PRINTF (1, 2);
...
@@ -37,6 +37,10 @@ void warning (const char *format, ...) AUDIOWMARK_PRINTF (1, 2);
void
info
(
const
char
*
format
,
...)
AUDIOWMARK_PRINTF
(
1
,
2
);
void
info
(
const
char
*
format
,
...)
AUDIOWMARK_PRINTF
(
1
,
2
);
void
debug
(
const
char
*
format
,
...)
AUDIOWMARK_PRINTF
(
1
,
2
);
void
debug
(
const
char
*
format
,
...)
AUDIOWMARK_PRINTF
(
1
,
2
);
enum
class
Log
{
ERROR
=
3
,
WARNING
=
2
,
INFO
=
1
,
DEBUG
=
0
};
void
set_log_level
(
Log
level
);
class
Error
class
Error
{
{
public
:
public
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment