1 /*
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
1592
1593 /**
1594 * Like getMixerInfo, but return List
1595 */
1596 private static List getMixerInfoList() {
1597 List providers = getMixerProviders();
1598 return getMixerInfoList(providers);
1599 }
1600
1601
1602 /**
1603 * Like getMixerInfo, but return List
1604 */
1605 private static List getMixerInfoList(List providers) {
1606 List infos = new ArrayList();
1607
1608 Mixer.Info[] someInfos; // per-mixer
1609 Mixer.Info[] allInfos; // for all mixers
1610
1611 for(int i = 0; i < providers.size(); i++ ) {
1612 someInfos = (Mixer.Info[])
1613 ((MixerProvider)providers.get(i)).getMixerInfo();
1614
1615 for (int j = 0; j < someInfos.length; j++) {
1616 infos.add(someInfos[j]);
1617 }
1618 }
1619
1620 return infos;
1621 }
1622
1623
1624 /**
1625 * Obtains the set of services currently installed on the system
1626 * using sun.misc.Service, the SPI mechanism in 1.3.
1627 * @return a List of instances of providers for the requested service.
1628 * If no providers are available, a vector of length 0 will be returned.
1629 */
1630 private static List getProviders(Class providerClass) {
1631 return JDK13Services.getProviders(providerClass);
1632 }
1633 }
|
1 /*
2 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
1592
1593 /**
1594 * Like getMixerInfo, but return List
1595 */
1596 private static List getMixerInfoList() {
1597 List providers = getMixerProviders();
1598 return getMixerInfoList(providers);
1599 }
1600
1601
1602 /**
1603 * Like getMixerInfo, but return List
1604 */
1605 private static List getMixerInfoList(List providers) {
1606 List infos = new ArrayList();
1607
1608 Mixer.Info[] someInfos; // per-mixer
1609 Mixer.Info[] allInfos; // for all mixers
1610
1611 for(int i = 0; i < providers.size(); i++ ) {
1612 someInfos = ((MixerProvider)providers.get(i)).getMixerInfo();
1613
1614 for (int j = 0; j < someInfos.length; j++) {
1615 infos.add(someInfos[j]);
1616 }
1617 }
1618
1619 return infos;
1620 }
1621
1622
1623 /**
1624 * Obtains the set of services currently installed on the system
1625 * using sun.misc.Service, the SPI mechanism in 1.3.
1626 * @return a List of instances of providers for the requested service.
1627 * If no providers are available, a vector of length 0 will be returned.
1628 */
1629 private static List getProviders(Class providerClass) {
1630 return JDK13Services.getProviders(providerClass);
1631 }
1632 }
|