Thread: Client Music With Out. Jframe Music Stops When Loggedin?

Results 1 to 3 of 3
  1. #1 Client Music With Out. Jframe Music Stops When Loggedin? 
    Registered Member xoodreyoox's Avatar
    Join Date
    May 2013
    Posts
    141
    Thanks given
    5
    Thanks received
    0
    Rep Power
    11
    Client Music With Out. Jframe Music Stops When Loggedin

    client.java
    [spoil]
    private boolean musicEnabled;

    public static String findMP3() {
    return findcachedir() + "LOGIN.mp3";
    }



    private void method33(int i)
    {
    int j = Varp.cache[i].anInt709;
    if(j == 0)
    return;
    int k = variousSettings[i];
    if(j == 1)
    {
    if(k == 1)
    Texture.method372(0.90000000000000002D);
    if(k == 2)
    Texture.method372(0.80000000000000004D);
    if(k == 3)
    Texture.method372(0.69999999999999996D);
    if(k == 4)
    Texture.method372(0.59999999999999998D);
    ItemDef.mruNodes1.unlinkAll();
    welcomeScreenRaised = false;
    }
    if(j == 3)
    {
    boolean flag1 = musicEnabled;
    if(k == 0)
    {
    adjustVolume(musicEnabled, 0);
    musicEnabled = true;
    }
    if(k == 1)
    {
    adjustVolume(musicEnabled, 0);
    musicEnabled = true;
    }
    if(k == 2)
    {
    adjustVolume(musicEnabled, 0);
    musicEnabled = true;
    }
    if(k == 3)
    {
    adjustVolume(musicEnabled, 0);
    musicEnabled = true;
    }
    if(k == 4)
    musicEnabled = true;
    if(musicEnabled != flag1 && !lowMem)
    {
    if(musicEnabled)
    {
    nextSong = currentSong;
    songChanging = true;
    onDemandFetcher.method558(2, nextSong);
    } else
    {
    stopMidi();
    }
    prevSong = 0;
    }
    }
    if(j == 4)
    {
    if(k == 0)
    {
    aBoolean848 = true;
    setWaveVolume(0);
    }
    if(k == 1)
    {
    aBoolean848 = true;
    setWaveVolume(0);
    }
    if(k == 2)
    {
    aBoolean848 = true;
    setWaveVolume(0);
    }
    if(k == 3)
    {
    aBoolean848 = true;
    setWaveVolume(0);
    }
    if(k == 4)
    aBoolean848 = false;
    }
    if(j == 5)
    anInt1253 = k;
    if(j == 6)
    anInt1249 = k;
    if(j == 8)
    {
    splitPrivateChat = k;
    inputTaken = true;
    }
    if(j == 9)
    anInt913 = k;
    }
    [/spoil]
    MP3.java
    [spoil]

    /************************************************** ***********************
    * Compilation: javac -classpath .:jl1.0.jar MP3.java (OS X)
    * javac -classpath .;jl1.0.jar MP3.java (Windows)
    * Execution: java -classpath .:jl1.0.jar MP3 filename.mp3 (OS X / Linux)
    * java -classpath .;jl1.0.jar MP3 filename.mp3 (Windows)
    *
    * Plays an MP3 file using the JLayer MP3 library.
    *
    * Reference: Java MP3 Player
    *
    *
    * To execute, get the file jl1.0.jar from the website above or from
    *
    * http://www.cs.princeton.edu/introcs/24inout/jl1.0.jar
    *
    * and put it in your working directory with this file MP3.java.
    *
    ************************************************** ***********************/

    import java.io.BufferedInputStream;
    import java.io.FileInputStream;

    import javazoom.jl.player.Player;


    public class MP3 {
    private String filename;
    private Player player;

    // constructor that takes the name of an MP3 file
    public MP3(String filename) {
    this.filename = filename;
    }

    public void close() { if (player != null) player.close(); }

    // play the MP3 file to the sound card
    public void play() {
    try {
    FileInputStream fis = new FileInputStream(filename);
    BufferedInputStream bis = new BufferedInputStream(fis);
    player = new Player(bis);
    }
    catch (Exception e) {
    System.out.println("Problem playing file " + filename);
    System.out.println(e);
    }

    // run in new thread to play in background
    new Thread() {
    public void run() {
    try { player.play(); }
    catch (Exception e) { System.out.println(e); }
    }
    }.start();




    }


    // test client
    public static void main(String[] args) {
    String filename = args[0];
    MP3 mp3 = new MP3(filename);
    mp3.play();

    // do whatever computation you like, while music plays
    int N = 4000;
    double sum = 0.0;
    for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
    sum += Math.sin(i + j);
    }
    }
    System.out.println(sum);

    // when the computation is done, stop playing it
    mp3.close();

    // play from the beginning
    mp3 = new MP3(filename);
    mp3.play();

    }

    }
    [/spoil]how do i make this keep playing the song while loged in it only plays during login screen?
    Reply With Quote  
     

  2. #2  
    Registered Member xoodreyoox's Avatar
    Join Date
    May 2013
    Posts
    141
    Thanks given
    5
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by xoodreyoox View Post
    Client Music With Out. Jframe Music Stops When Loggedin

    client.java
    [spoil]
    private boolean musicEnabled;

    public static String findMP3() {
    return findcachedir() + "LOGIN.mp3";
    }



    private void method33(int i)
    {
    int j = Varp.cache[i].anInt709;
    if(j == 0)
    return;
    int k = variousSettings[i];
    if(j == 1)
    {
    if(k == 1)
    Texture.method372(0.90000000000000002D);
    if(k == 2)
    Texture.method372(0.80000000000000004D);
    if(k == 3)
    Texture.method372(0.69999999999999996D);
    if(k == 4)
    Texture.method372(0.59999999999999998D);
    ItemDef.mruNodes1.unlinkAll();
    welcomeScreenRaised = false;
    }
    if(j == 3)
    {
    boolean flag1 = musicEnabled;
    if(k == 0)
    {
    adjustVolume(musicEnabled, 0);
    musicEnabled = true;
    }
    if(k == 1)
    {
    adjustVolume(musicEnabled, 0);
    musicEnabled = true;
    }
    if(k == 2)
    {
    adjustVolume(musicEnabled, 0);
    musicEnabled = true;
    }
    if(k == 3)
    {
    adjustVolume(musicEnabled, 0);
    musicEnabled = true;
    }
    if(k == 4)
    musicEnabled = true;
    if(musicEnabled != flag1 && !lowMem)
    {
    if(musicEnabled)
    {
    nextSong = currentSong;
    songChanging = true;
    onDemandFetcher.method558(2, nextSong);
    } else
    {
    stopMidi();
    }
    prevSong = 0;
    }
    }
    if(j == 4)
    {
    if(k == 0)
    {
    aBoolean848 = true;
    setWaveVolume(0);
    }
    if(k == 1)
    {
    aBoolean848 = true;
    setWaveVolume(0);
    }
    if(k == 2)
    {
    aBoolean848 = true;
    setWaveVolume(0);
    }
    if(k == 3)
    {
    aBoolean848 = true;
    setWaveVolume(0);
    }
    if(k == 4)
    aBoolean848 = false;
    }
    if(j == 5)
    anInt1253 = k;
    if(j == 6)
    anInt1249 = k;
    if(j == 8)
    {
    splitPrivateChat = k;
    inputTaken = true;
    }
    if(j == 9)
    anInt913 = k;
    }
    [/spoil]
    MP3.java
    [spoil]

    /************************************************** ***********************
    * Compilation: javac -classpath .:jl1.0.jar MP3.java (OS X)
    * javac -classpath .;jl1.0.jar MP3.java (Windows)
    * Execution: java -classpath .:jl1.0.jar MP3 filename.mp3 (OS X / Linux)
    * java -classpath .;jl1.0.jar MP3 filename.mp3 (Windows)
    *
    * Plays an MP3 file using the JLayer MP3 library.
    *
    * Reference: Java MP3 Player
    *
    *
    * To execute, get the file jl1.0.jar from the website above or from
    *
    * http://www.cs.princeton.edu/introcs/24inout/jl1.0.jar
    *
    * and put it in your working directory with this file MP3.java.
    *
    ************************************************** ***********************/

    import java.io.BufferedInputStream;
    import java.io.FileInputStream;

    import javazoom.jl.player.Player;


    public class MP3 {
    private String filename;
    private Player player;

    // constructor that takes the name of an MP3 file
    public MP3(String filename) {
    this.filename = filename;
    }

    public void close() { if (player != null) player.close(); }

    // play the MP3 file to the sound card
    public void play() {
    try {
    FileInputStream fis = new FileInputStream(filename);
    BufferedInputStream bis = new BufferedInputStream(fis);
    player = new Player(bis);
    }
    catch (Exception e) {
    System.out.println("Problem playing file " + filename);
    System.out.println(e);
    }

    // run in new thread to play in background
    new Thread() {
    public void run() {
    try { player.play(); }
    catch (Exception e) { System.out.println(e); }
    }
    }.start();




    }


    // test client
    public static void main(String[] args) {
    String filename = args[0];
    MP3 mp3 = new MP3(filename);
    mp3.play();

    // do whatever computation you like, while music plays
    int N = 4000;
    double sum = 0.0;
    for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
    sum += Math.sin(i + j);
    }
    }
    System.out.println(sum);

    // when the computation is done, stop playing it
    mp3.close();

    // play from the beginning
    mp3 = new MP3(filename);
    mp3.play();

    }

    }
    [/spoil]how do i make this keep playing the song while loged in it only plays during login screen?
    Bump
    Reply With Quote  
     

  3. #3  
    Registered Member xoodreyoox's Avatar
    Join Date
    May 2013
    Posts
    141
    Thanks given
    5
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by xoodreyoox View Post
    Bump
    BUmp!
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 0
    Last Post: 07-19-2013, 01:23 AM
  2. Replies: 0
    Last Post: 07-02-2012, 04:36 PM
  3. Client with sounds and music system (original)
    By Its paris in forum Requests
    Replies: 0
    Last Post: 01-18-2010, 10:22 PM
  4. 508 hd client with basic jframe
    By Gluon in forum Requests
    Replies: 0
    Last Post: 06-17-2009, 02:09 AM
  5. how to run client with out putting cache in (C:)
    By Gluon in forum Configuration
    Replies: 7
    Last Post: 02-21-2009, 06:28 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •