Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
purr-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Jonathan Wilkes
purr-data
Commits
20eb002e
Commit
20eb002e
authored
9 years ago
by
pokergaming
Browse files
Options
Downloads
Patches
Plain Diff
added blocksize delay and sample rate to audio prefs dialog
parent
4f6cd1e9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pd/nw/dialog_prefs.html
+61
-11
61 additions, 11 deletions
pd/nw/dialog_prefs.html
pd/nw/locales/en/translation.json
+13
-1
13 additions, 1 deletion
pd/nw/locales/en/translation.json
with
74 additions
and
12 deletions
pd/nw/dialog_prefs.html
+
61
−
11
View file @
20eb002e
...
...
@@ -23,7 +23,26 @@
<fieldset
id=
"audio"
>
<legend
data-i18n=
"prefs.heading.audio"
></legend>
<select
id=
"audio_api"
>
<select
id=
"audio_api"
onchange=
"change_api(this.value);"
>
</select>
<br/>
<label
data-i18n=
"[title]prefs.audio.sr"
>
<span
data-i18n=
"prefs.audio.sr"
></span>
<input
type=
"text"
id=
"rate"
name=
"rate"
>
</label>
<br/>
<label
data-i18n=
"[title]prefs.audio.advance"
>
<span
data-i18n=
"prefs.audio.advance"
></span>
<input
type=
"text"
id=
"advance"
name=
"advance"
>
</label>
<select
id=
"blocksize"
onchange=
"attr_change(this);"
>
<option
value=
"64"
>
64
</option>
<option
value=
"128"
>
128
</option>
<option
value=
"256"
>
256
</option>
<option
value=
"512"
>
512
</option>
<option
value=
"1024"
>
1024
</option>
<option
value=
"2048"
>
2048
</option>
</select>
Audio stuff
</fieldset>
...
...
@@ -50,6 +69,19 @@
</fieldset>
<div
class=
"submit_buttons"
>
<button
type=
"button"
onClick=
"ok()"
data-i18n=
"[title]prefs.ok_tt"
>
<span
data-i18n=
"prefs.ok"
></span>
</button>
<button
type=
"button"
onClick=
"apply()"
data-i18n=
"[title]prefs.apply_tt"
>
<span
data-i18n=
"prefs.apply"
></span>
</button>
<button
type=
"button"
onClick=
"cancel()"
data-i18n=
"[title]prefs.cancel_tt"
>
<span
data-i18n=
"prefs.cancel"
></span>
</button>
</div>
</div>
<script>
'
use strict
'
;
...
...
@@ -63,9 +95,7 @@
var
pd_object_callback
;
// nested arrays of attributes for each garray
// in this canvas
var
pd_garray_attrs
;
var
pd_audio_attrs
;
function
ok
()
{
apply
();
...
...
@@ -138,12 +168,11 @@
}
function
attr_change
(
elem
)
{
var
array_index
,
attr
,
arrays_select
,
name
;
arrays_select
=
document
.
getElementById
(
'
arrays_select
'
);
attr
=
pd_garray_attrs
[
arrays_select
.
value
];
name
=
elem
.
name
;
var
attr
,
name
;
attr
=
pd_audio_attrs
;
name
=
elem
.
id
;
attr
[
attr
.
indexOf
(
name
)
+
1
]
=
elem
.
value
;
pdgui
.
gui_post
(
"
name
is
"
+
elem
.
name
);
pdgui
.
gui_post
(
"
id
is
"
+
elem
.
id
);
pdgui
.
gui_post
(
"
value is
"
+
elem
.
value
);
}
...
...
@@ -313,6 +342,14 @@ pdgui.gui_post("guistub is " + gfxstub);
}
}
function
change_api
(
api_id
)
{
pdgui
.
pdsend
(
"
pd audio-setapi
"
+
api_id
);
}
function
get_attr
(
name
,
attrs
)
{
return
attrs
[
attrs
.
indexOf
(
name
)
+
1
];
}
function
populate_audio_apis
(
apis
,
current_api
)
{
pdgui
.
gui_post
(
"
curent api is
"
+
current_api
);
var
i
,
opt
,
api_select
=
document
.
getElementById
(
'
audio_api
'
);
...
...
@@ -327,10 +364,23 @@ pdgui.gui_post("guistub is " + gfxstub);
}
function
audio_prefs_callback
(
attrs
)
{
pd_audio_attrs
=
attrs
;
var
api_select
=
document
.
getElementById
(
'
audio_api
'
);
pdgui
.
gui_post
(
"
audio attrs are
"
+
attrs
);
pdgui
.
gui_post
(
"
attrs length
"
+
attrs
.
length
);
populate_audio_apis
(
attrs
[
attrs
.
indexOf
(
'
audio-apis
'
)
+
1
],
attrs
[
attrs
.
indexOf
(
'
current-api
'
)
+
1
]);
// We can get this callback multiple times while the dialog
// is open. This is because an API change requires a query
// for new properties. So we only populate the api options
// if they don't already exist
if
(
api_select
.
getElementsByTagName
(
'
option
'
).
length
<
1
)
{
populate_audio_apis
(
attrs
[
attrs
.
indexOf
(
'
audio-apis
'
)
+
1
],
attrs
[
attrs
.
indexOf
(
'
current-api
'
)
+
1
]);
}
document
.
getElementById
(
'
rate
'
).
value
=
get_attr
(
'
rate
'
,
attrs
);
document
.
getElementById
(
'
blocksize
'
).
value
=
get_attr
(
'
blocksize
'
,
attrs
);
document
.
getElementById
(
'
advance
'
).
value
=
get_attr
(
'
advance
'
,
attrs
);
}
function
midi_prefs_callback
(
attrs
)
{
...
...
This diff is collapsed.
Click to expand it.
pd/nw/locales/en/translation.json
+
13
−
1
View file @
20eb002e
...
...
@@ -287,6 +287,18 @@
"extended"
:
"Pd-Extended"
,
"l2ork"
:
"Pd-L2ork"
}
}
},
"audio"
:
{
"sr"
:
"sample rate"
,
"sr_tt"
:
"number of samples per second"
,
"advance"
:
"delay"
,
"advance_tt"
:
"delay"
},
"ok"
:
"ok"
,
"ok_tt"
:
"Update the audio properties and close the dialog"
,
"apply"
:
"apply"
,
"apply_tt"
:
"Update audio properties without closing this dialog"
,
"cancel"
:
"cancel"
,
"cancel_tt"
:
"Cancel updating the properties"
}
}
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