Package javax.sound.sampled

Examples of javax.sound.sampled.LineEvent


      ringBuffers[i] = new DoubleHalfRingBuffer(new DoubleHalfBuffer(internalBuffers[i][0], internalBuffers[i][1]), format.getFrameSize() / format.getChannels());
      ringBuffers[i].open();
    }
   
    open = true;
    notifyListeners(new LineEvent(this, LineEvent.Type.OPEN, getFramePosition()));
  }
View Full Code Here


   * called from the Mixer to indicate that this line has been started
   */
  void started() {
    started = true;
    flushed = false;
    notifyListeners(new LineEvent(this, LineEvent.Type.START, getFramePosition()));
  }
View Full Code Here

   * called from the Mixer to indicate that this line has been stopped
   */
  void stopped(){
    if(!started) return;
    started = false;
    notifyListeners(new LineEvent(this, LineEvent.Type.STOP, getFramePosition()));
  }
View Full Code Here

    desiredBufferSize = AudioSystem.NOT_SPECIFIED;
    channels = 1;
    //internalBuffers = null;
    ringBuffers = null;
    open = false;
    notifyListeners(new LineEvent(this, LineEvent.Type.CLOSE, getFramePosition()));
  }
View Full Code Here

    int oldstatus = status;
    status = i;

    if (oldstatus < INITIALIZED && status >= INITIALIZED) {
      initVM();
      notifyListeners(new LineEvent(this, LineEvent.Type.OPEN, 0));
    } else if (oldstatus >= INITIALIZED && status < INITIALIZED) {
      freeVM();
      activeLines = null;
      notifyListeners(new LineEvent(this, LineEvent.Type.CLOSE, 0));
    }
    if (oldstatus < RUNNING && status == RUNNING)
      notifyListeners(new LineEvent(this, LineEvent.Type.START, 0));
    else if (oldstatus == RUNNING && status < RUNNING)
      notifyListeners(new LineEvent(this, LineEvent.Type.STOP, 0));
    status = i;
  }
View Full Code Here

    public void close() {
        if (!isOpen())
            return;

        sendEvent(new LineEvent(this, LineEvent.Type.CLOSE,
                AudioSystem.NOT_SPECIFIED));

        SoftAudioPusher pusher_to_be_closed = null;
        AudioInputStream pusher_stream_to_be_closed = null;
        synchronized (control_mutex) {
View Full Code Here

            if (targetFormat != null)
                format = targetFormat;

            mainmixer = new SoftMixingMainMixer(this);

            sendEvent(new LineEvent(this, LineEvent.Type.OPEN,
                    AudioSystem.NOT_SPECIFIED));

            return mainmixer.getInputStream();

        }
View Full Code Here

            }
        }

        if (sendEvents) {
            if (open) {
                sendEvents(new LineEvent(this, LineEvent.Type.OPEN, position));
            } else {
                sendEvents(new LineEvent(this, LineEvent.Type.CLOSE, position));
            }
        }
        if (Printer.trace) Printer.trace("< "+getClass().getName()+" (AbstractLine): setOpen(" + open + ")  this.open: " + this.open);
    }
View Full Code Here

        return (long) (getFrameLength() * (1000000.0 / (double) getFormat()
                .getSampleRate()));
    }

    public void loop(int count) {
        LineEvent event = null;

        synchronized (control_mutex) {
            if (isOpen()) {
                if (active)
                    return;
                active = true;
                active_sg = true;
                loopcount = count;
                event = new LineEvent(this, LineEvent.Type.START,
                        getLongFramePosition());
            }
        }

        if (event != null)
View Full Code Here

        }
    }

    public void start() {

        LineEvent event = null;

        synchronized (control_mutex) {
            if (isOpen()) {
                if (active)
                    return;
                active = true;
                active_sg = true;
                loopcount = 0;
                event = new LineEvent(this, LineEvent.Type.START,
                        getLongFramePosition());
            }
        }

        if (event != null)
View Full Code Here

TOP

Related Classes of javax.sound.sampled.LineEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.