congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Music.setPosition
Code IndexAdd Tabnine to your IDE (free)

How to use
setPosition
method
in
com.badlogic.gdx.audio.Music

Best Java code snippets using com.badlogic.gdx.audio.Music.setPosition (Showing top 8 results out of 315)

origin: libgdx/libgdx

  @Override
  public void changed (ChangeEvent event, Actor actor) {
    if (!sliderUpdating && slider.isDragging()) music.setPosition((slider.getValue() / 100f) * songDuration);
  }
});
origin: kbz/SIFTrain

private void playMusicOnDemand() {
  if (!world.started) {
    world.started = true;
    if (hasMusic) {
      theSong.setLooping(false);
      theSong.setOnCompletionListener(this);
      theSong.setVolume(GlobalConfiguration.songVolume / 100f);
    }
  } else {
    if (world.paused) {
      world.paused = false;
      if (hasMusic) {
        theSong.setPosition(lastmtime);
        time = lastmtime + world.delay;
        theSong.play();
      }
    }
  }
}
origin: kbz/SIFTrain

@Override
public void render(float delta) {
  Gdx.gl.glClearColor(0, 0, 0, 1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  stage.act();
  stage.draw();
  if (theSong != null && theSong.isPlaying() && theSong.getPosition() > newBPosition) {
    theSong.setPosition(newAPosition);
  }
}
origin: kbz/SIFTrain

theSong.setPosition(newAPosition);
theSong.setVolume(GlobalConfiguration.songVolume / 100f);
theSong.play();
origin: bladecoder/bladecoder-adventure-engine

@Override
public void retrieveAssets() {
  if (voice == null && fileName != null) {
    EngineLogger.debug("RETRIEVING VOICE: " + fileName);
    voice = EngineAssetManager.getInstance().get(EngineAssetManager.VOICE_DIR + fileName, Music.class);
    voice.setOnCompletionListener(new OnCompletionListener() {
      @Override
      public void onCompletion(Music music) {
        if (textManager.getCurrentText() != null)
          textManager.getCurrentText().setAutoTime();
      }
    });
    if (voice != null)
      voice.setVolume(volume * VOLUME_MULTIPLIER);
    if (isPlayingSer) {
      voice.play();
      if (voice != null) {
        voice.setPosition(voicePosSer);
      }
      isPlayingSer = false;
      voicePosSer = 0f;
    }
  }
}
origin: bladecoder/bladecoder-adventure-engine

@Override
public void retrieveAssets() {
  if (music == null && desc != null) {
    // Check if not loaded, this happens when setting a cached scene
    if (!EngineAssetManager.getInstance().isLoaded(EngineAssetManager.MUSIC_DIR + desc.getFilename())) {
      // Load the music file in background to avoid
      // blocking the UI
      loadTask();
      return;
    }
    EngineLogger.debug("RETRIEVING MUSIC: " + desc.getFilename());
    music = EngineAssetManager.getInstance().getMusic(desc.getFilename());
    if (isPlayingSer) {
      playMusic();
      if (music != null) {
        music.setPosition(musicPosSer);
        musicPosSer = 0f;
      }
      isPlayingSer = false;
    }
  }
}
origin: kbz/SIFTrain

theSong.play();
if (aPosition != null)
  theSong.setPosition(aPosition);
lastmtime = theSong.getPosition();
time = lastmtime + world.delay;
origin: kbz/SIFTrain

if (hasMusic) {
  theSong.pause();
  theSong.setPosition(aPosition);
  theSong.play();
  lastmtime = theSong.getPosition();
com.badlogic.gdx.audioMusicsetPosition

Javadoc

Set the playback position in seconds.

Popular methods of Music

  • play
    Starts the play back of the music stream. In case the stream was paused this will resume the play ba
  • stop
    Stops a playing or paused Music instance. Next time play() is invoked the Music will start from the
  • isPlaying
  • setLooping
    Sets whether the music stream is looping. This can be called at any time, whether the stream is play
  • dispose
    Needs to be called when the Music is no longer needed.
  • setVolume
    Sets the volume of this music stream. The volume must be given in the range [0,1] with 0 being silen
  • pause
    Pauses the play back. If the music stream has not been started yet or has finished playing a call to
  • getPosition
    Returns the playback position in seconds.
  • setOnCompletionListener
    Register a callback to be invoked when the end of a music stream has been reached during playback.
  • getVolume

Popular in Java

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now