summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/portmidi/finddefault.c
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2013-01-11 07:32:46 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2013-01-11 07:32:46 +0000
commit0e19f641d3186cdbf51f8ca857e2b07ab95779c2 (patch)
tree234109de1123b13f217494af4b3f8efad346d5cc /src/lib/portmidi/finddefault.c
parent111157ca09a9ff60fe4a9ba49173c315e94314fa (diff)
Cleanups and version bumpmame0148
Diffstat (limited to 'src/lib/portmidi/finddefault.c')
-rw-r--r--src/lib/portmidi/finddefault.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/lib/portmidi/finddefault.c b/src/lib/portmidi/finddefault.c
index bc95a4001a6..f6169192109 100644
--- a/src/lib/portmidi/finddefault.c
+++ b/src/lib/portmidi/finddefault.c
@@ -24,34 +24,34 @@ PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
returns matching device id if found, otherwise id
*/
{
- static char *pref_file = (char *)"com.apple.java.util.prefs.plist";
- char *pref_str = NULL;
- // read device preferences
- value_ptr prefs = bplist_read_user_pref(pref_file);
- if (prefs) {
- value_ptr pref_val = value_dict_lookup_using_path(prefs, path);
- if (pref_val) {
- pref_str = value_get_asciistring(pref_val);
- }
- }
- if (!pref_str) {
- bplist_free_data(); /* look elsewhere */
- prefs = bplist_read_system_pref(pref_file);
- if (prefs) {
- value_ptr pref_val = value_dict_lookup_using_path(prefs, path);
- if (pref_val) {
- pref_str = value_get_asciistring(pref_val);
- }
- }
- }
- if (pref_str) { /* search devices for match */
- int i = pm_find_default_device(pref_str, input);
- if (i != pmNoDevice) {
- id = i;
+ static char *pref_file = (char *)"com.apple.java.util.prefs.plist";
+ char *pref_str = NULL;
+ // read device preferences
+ value_ptr prefs = bplist_read_user_pref(pref_file);
+ if (prefs) {
+ value_ptr pref_val = value_dict_lookup_using_path(prefs, path);
+ if (pref_val) {
+ pref_str = value_get_asciistring(pref_val);
+ }
}
- }
- if (prefs) {
- bplist_free_data();
- }
- return id;
+ if (!pref_str) {
+ bplist_free_data(); /* look elsewhere */
+ prefs = bplist_read_system_pref(pref_file);
+ if (prefs) {
+ value_ptr pref_val = value_dict_lookup_using_path(prefs, path);
+ if (pref_val) {
+ pref_str = value_get_asciistring(pref_val);
+ }
+ }
+ }
+ if (pref_str) { /* search devices for match */
+ int i = pm_find_default_device(pref_str, input);
+ if (i != pmNoDevice) {
+ id = i;
+ }
+ }
+ if (prefs) {
+ bplist_free_data();
+ }
+ return id;
}