~ubuntu-branches/ubuntu/oneiric/openjdk-7/oneiric-security

« back to all changes in this revision

Viewing changes to pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-10-17 16:22:48 UTC
  • mfrom: (1.3.11) (8.1.25 quantal)
  • Revision ID: package-import@ubuntu.com-20121017162248-steblyv2lnk2t951
Tags: 7u9-2.3.3-0ubuntu1~11.10.1
Build IcedTea7 2.3.3 for oneiric.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
final class PulseAudioTargetPort extends PulseAudioPort {
44
44
 
45
 
        /* aka speaker */
46
 
 
47
 
        static {
48
 
                SecurityWrapper.loadNativeLibrary();
49
 
        }
50
 
 
51
 
        PulseAudioTargetPort(String name) {
52
 
                super(name);
53
 
        }
54
 
 
55
 
        @Override
56
 
        public void open() {
57
 
 
58
 
                super.open();
59
 
 
60
 
                PulseAudioMixer parent = PulseAudioMixer.getInstance();
61
 
                parent.addTargetLine(this);
62
 
        }
63
 
 
64
 
        @Override
65
 
        public void close() {
66
 
 
67
 
                if (!isOpen) {
68
 
                        throw new IllegalStateException("not open, so cant close Port");
69
 
                }
70
 
 
71
 
                PulseAudioMixer parent = PulseAudioMixer.getInstance();
72
 
                parent.removeTargetLine(this);
73
 
 
74
 
                super.close();
75
 
        }
76
 
 
77
 
        // FIXME
78
 
        public native byte[] native_set_volume(float newValue);
79
 
 
80
 
        // FIXME
81
 
        public native byte[] native_update_volume();
82
 
 
83
 
        @Override
84
 
        public Line.Info getLineInfo() {
85
 
                return new Port.Info(Port.class, getName(), false);
86
 
        }
 
45
    /* aka speaker */
 
46
 
 
47
    static {
 
48
        SecurityWrapper.loadNativeLibrary();
 
49
    }
 
50
 
 
51
    PulseAudioTargetPort(String name) {
 
52
        super(name);
 
53
    }
 
54
 
 
55
    @Override
 
56
    public void open() {
 
57
 
 
58
        super.open();
 
59
 
 
60
        PulseAudioMixer parent = PulseAudioMixer.getInstance();
 
61
        parent.addTargetLine(this);
 
62
    }
 
63
 
 
64
    @Override
 
65
    public void close() {
 
66
 
 
67
        if (!isOpen) {
 
68
            throw new IllegalStateException("not open, so cant close Port");
 
69
        }
 
70
 
 
71
        PulseAudioMixer parent = PulseAudioMixer.getInstance();
 
72
        parent.removeTargetLine(this);
 
73
 
 
74
        super.close();
 
75
    }
 
76
 
 
77
    // FIXME
 
78
    public native byte[] native_set_volume(float newValue);
 
79
 
 
80
    // FIXME
 
81
    public native byte[] native_update_volume();
 
82
 
 
83
    @Override
 
84
    public Line.Info getLineInfo() {
 
85
        return new Port.Info(Port.class, getName(), false);
 
86
    }
87
87
 
88
88
}