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
d351d09a
Commit
d351d09a
authored
8 years ago
by
Jonathan Wilkes
Browse files
Options
Downloads
Patches
Plain Diff
fix broken midi dialog, and remove the midi api select widget if there's only one api option
parent
8d070c0b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pd/nw/dialog_prefs.html
+17
-10
17 additions, 10 deletions
pd/nw/dialog_prefs.html
with
17 additions
and
10 deletions
pd/nw/dialog_prefs.html
+
17
−
10
View file @
d351d09a
...
@@ -208,7 +208,7 @@
...
@@ -208,7 +208,7 @@
</div>
</div>
<div
class=
"tab2"
>
<div
class=
"tab2"
>
<div
class=
"tab_settings"
>
<div
class=
"tab_settings
midi_api_container
"
>
<label
data-i18n=
"[title]prefs.midi.api_tt"
>
<label
data-i18n=
"[title]prefs.midi.api_tt"
>
<span
data-i18n=
"prefs.midi.api"
></span>
<span
data-i18n=
"prefs.midi.api"
></span>
<select
id=
"midi_api"
onchange=
"change_api(this);"
>
<select
id=
"midi_api"
onchange=
"change_api(this);"
>
...
@@ -331,18 +331,17 @@ function dev_change(elem) {
...
@@ -331,18 +331,17 @@ function dev_change(elem) {
// the same logic works for both channels and
// the same logic works for both channels and
// devices-- we use the variable 'type' to
// devices-- we use the variable 'type' to
// choose the parameter acoordingly
// choose the parameter acoordingly
var
type
;
var
type
,
midi
;
id
=
elem
.
id
;
id
=
elem
.
id
;
direction
=
id
.
slice
(
0
,
2
)
===
"
in
"
?
"
in
"
:
"
out
"
;
midi
=
id
.
slice
(
0
,
4
)
===
"
midi
"
?
true
:
false
;
direction
=
id
.
replace
(
"
midi_
"
,
""
).
slice
(
0
,
2
)
===
"
in
"
?
"
in
"
:
"
out
"
;
type
=
id
.
indexOf
(
"
chans
"
)
!==
-
1
?
"
chans
"
:
"
devs
"
;
type
=
id
.
indexOf
(
"
chans
"
)
!==
-
1
?
"
chans
"
:
"
devs
"
;
// This would need to change if there could ever be more than
// This would need to change if there could ever be more than
// 9 devices
// 9 devices
index
=
+
(
id
.
slice
(
-
1
))
-
1
;
index
=
+
(
id
.
slice
(
-
1
))
-
1
;
pdgui
.
post
(
"
direction is
"
+
direction
);
attrs
=
get_attr
(
"
pd-
"
+
direction
+
type
,
attrs
=
get_attr
(
"
pd-
"
+
direction
+
type
,
pd_audio_attrs
);
midi
?
pd_midi_attrs
:
pd_audio_attrs
);
attrs
[
index
]
=
elem
.
value
;
attrs
[
index
]
=
midi
?
+
elem
.
value
+
1
:
elem
.
value
;
pdgui
.
post
(
"
id is
"
+
elem
.
id
);
pdgui
.
post
(
"
new chan attrs is
"
+
attrs
);
disable_unused_chans
(
"
in
"
);
disable_unused_chans
(
"
in
"
);
disable_unused_chans
(
"
out
"
);
disable_unused_chans
(
"
out
"
);
...
@@ -376,7 +375,7 @@ function kludge_dev(type, attrs, index) {
...
@@ -376,7 +375,7 @@ function kludge_dev(type, attrs, index) {
}
}
// If the device is -1 ('None'), make the number of channels negative.
// If the device is -1 ('None'), make the number of channels negative.
// This is the way Pd's audio back
end turns off the device. (It works
// This is the way Pd's audio backend turns off the device. (It works
// this way so you can remember your number of channels even if
// this way so you can remember your number of channels even if
// you turn off the device.)
// you turn off the device.)
function
kludge_chans
(
type
,
attrs
,
index
)
{
function
kludge_chans
(
type
,
attrs
,
index
)
{
...
@@ -632,7 +631,15 @@ function midi_prefs_callback(attrs) {
...
@@ -632,7 +631,15 @@ function midi_prefs_callback(attrs) {
get_attr
(
"
current-api
"
,
attrs
)
get_attr
(
"
current-api
"
,
attrs
)
);
);
}
}
// If we still haven't gotten any apis, just assume that the
// only option is a generic "system" midi and hide the select widget.
// This should really be taken care of in Pd-- I don't know why, for
// example, it doesn't just send "MMIO" on Windows when that's the
// only API available...
if
(
api_select
.
getElementsByTagName
(
"
option
"
).
length
<
1
)
{
document
.
getElementsByClassName
(
"
midi_api_container
"
)[
0
].
style
.
setProperty
(
"
display
"
,
"
none
"
);
}
// Hide devs and only show the alsa in/out boxes. In the future
// Hide devs and only show the alsa in/out boxes. In the future
// we need an additional user friendly alsa interface here-- one that
// we need an additional user friendly alsa interface here-- one that
// just lets the user pick a single input device and single output
// just lets the user pick a single input device and single output
...
...
This diff is collapsed.
Click to expand it.
Jonathan Wilkes
@jwilkes
mentioned in issue
#92 (closed)
·
8 years ago
mentioned in issue
#92 (closed)
mentioned in issue #92
Toggle commit list
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