Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CssLsd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florent Berthaut
CssLsd
Commits
96ef4c23
Commit
96ef4c23
authored
3 years ago
by
RANWEZ Pierre
Browse files
Options
Downloads
Patches
Plain Diff
feat: sensibility slider
parent
d85b9b54
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1
✨ feat: CSSLSD V2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
background.js
+2
-0
2 additions, 0 deletions
background.js
content.js
+6
-2
6 additions, 2 deletions
content.js
main.js
+11
-0
11 additions, 0 deletions
main.js
popup.html
+43
-2
43 additions, 2 deletions
popup.html
with
62 additions
and
4 deletions
background.js
+
2
−
0
View file @
96ef4c23
...
...
@@ -15,6 +15,7 @@ let audioI = false;
let
midiI
=
false
;
let
popup
=
false
;
let
loopPlay
=
false
;
let
sensibility
=
0.95
;
let
records
=
{
loop
:
[
[
...
...
@@ -59,6 +60,7 @@ chrome.runtime.onInstalled.addListener(() => {
chrome
.
storage
.
sync
.
set
({
loopPlay
});
chrome
.
storage
.
local
.
set
({
records
});
chrome
.
storage
.
sync
.
set
({
debug
});
chrome
.
storage
.
sync
.
set
({
sensibility
});
});
...
...
This diff is collapsed.
Click to expand it.
content.js
+
6
−
2
View file @
96ef4c23
...
...
@@ -9,6 +9,11 @@ var midi = false;
var
debug
=
false
;
var
audioSample
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
];
var
sensibility
;
chrome
.
storage
.
sync
.
get
([
'
sensibility
'
],
function
(
result
)
{
sensibility
=
result
.
sensibility
;
});
var
parameterSave
=
{};
function
range
(
template
,
value
)
{
if
(
template
.
options
.
includes
(
'
i
'
))
{
...
...
@@ -265,9 +270,8 @@ async function gotStream(stream) {
const
node
=
new
AudioWorkletNode
(
audioContext
,
'
vumeter
'
);
node
.
port
.
onmessage
=
event
=>
{
let
_volume
=
0
let
_sensibility
=
5
if
(
event
.
data
.
volume
)
_volume
=
event
.
data
.
volume
;
_volume
=
event
.
data
.
volume
*
sensibility
;
meter
=
{
volume
:
_volume
};
}
mediaStreamSource
.
connect
(
node
);
...
...
This diff is collapsed.
Click to expand it.
main.js
+
11
−
0
View file @
96ef4c23
...
...
@@ -112,6 +112,9 @@ function initUi() {
$
(
'
.midiI
'
).
removeClass
(
'
active
'
);
}
});
chrome
.
storage
.
sync
.
get
([
'
sensibility
'
],
function
(
result
)
{
$
(
'
#sensibility
'
).
val
(
result
.
sensibility
);
});
chrome
.
storage
.
local
.
get
([
'
records
'
],
function
(
result
)
{
$
(
'
#loopList
'
).
text
(
''
);
for
(
let
i
=
0
;
i
<
result
.
records
.
loop
.
length
;
i
++
)
{
...
...
@@ -377,6 +380,14 @@ $('.midiI').on('click', function () {
initUi
();
});
/**
* @description Sensibility slider.
*/
$
(
'
#sensibility
'
).
on
(
'
change
'
,
function
()
{
console
.
log
(
'
cc
'
);
chrome
.
storage
.
sync
.
set
({
sensibility
:
$
(
this
).
val
()
});
});
/**
* @description Duplicate the current row and save the parameters.
*/
...
...
This diff is collapsed.
Click to expand it.
popup.html
+
43
−
2
View file @
96ef4c23
...
...
@@ -48,7 +48,6 @@
</h3>
<div>
<div
id=
"editor"
></div>
</div>
<h3>
...
...
@@ -232,10 +231,52 @@
</tr>
</table>
</div>
<h3>
<svg
xmlns=
"http://www.w3.org/2000/svg"
class=
"icon icon-tabler icon-tabler-tool"
width=
"12"
height=
"12"
viewBox=
"0 0 24 24"
stroke-width=
"1.5"
stroke=
"currentColor"
fill=
"none"
stroke-linecap=
"round"
stroke-linejoin=
"round"
>
<path
stroke=
"none"
d=
"M0 0h24v24H0z"
fill=
"none"
></path>
<path
d=
"M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5"
></path>
</svg>
CONFIGURATION
</h3>
<div>
<table>
<tr>
<td>
<a
id=
"debug"
>
Mode debug
</a>
</td>
</tr>
<tr>
<td>
Sensibilite
<input
id=
"sensibility"
type=
"range"
min=
"0"
max=
"1"
step=
"0.01"
value=
"0.5"
>
</td>
</tr>
</table>
</div>
</div>
<p
style=
"text-align: center"
>
©
2022 - Universite de Lille -
<a
id=
"doc"
>
Voir la documentation
</a>
-
<a
id=
"debug"
>
Mode debug
</a>
©
2022 - Universite de Lille -
<a
id=
"doc"
>
Voir la documentation
</a>
</p>
<script
src=
"cssParser.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"ace/ace.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment