Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


FractalMuse 1.6 :D
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jun 02, 2011 12:24 pm    Post subject: Reply with quote

got it compiled. gonna add the pause.
Back to top
View user's profile Send private message
Evil_Intentions
Expert Cheater
Reputation: 65

Joined: 07 Jan 2010
Posts: 214

PostPosted: Thu Jun 02, 2011 12:29 pm    Post subject: Reply with quote

How are you doing it, threads or modifying the play method?
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jun 02, 2011 12:33 pm    Post subject: Reply with quote

if it doesn't already supply pause/stop functionality (which makes it pretty shit) i guess second method is better.

//edit : http://www.jfugue.org/javadoc/org/jfugue/Player.html#pause() ....
Back to top
View user's profile Send private message
Evil_Intentions
Expert Cheater
Reputation: 65

Joined: 07 Jan 2010
Posts: 214

PostPosted: Thu Jun 02, 2011 12:35 pm    Post subject: Reply with quote

Slugsnack wrote:
if it doesn't already supply pause/stop functionality (which makes it pretty shit) i guess second method is better


It doesn't. It has pause and stop functions, but the play function stops all input to the program. I think the play method works by sleeping until the music pattern is done playing, so maybe simply removing the sleep portion?

EDIT: That pause method won't do anything. The program locks up to play music.

EDIT2: I'm looking at the JFugue source, and I've found this bit of code in teh play method

Code:
// Wait for the sequence to finish
        while (isOn())
        {
            try {
                Thread.sleep(20); // don't hog all of the CPU
            } catch (InterruptedException e) {
                try {
                    stop();
                } catch (Exception e2) {
                    // do nothing
                }
                throw new JFugueException(JFugueException.ERROR_SLEEP);
            }
        }


Would this be the culprit?
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jun 02, 2011 12:48 pm    Post subject: This post has 1 review(s) Reply with quote

i'm done. basically Player.play is a call which blocks till it finishes. easiest to branch it off to another thread. i've just done this as a proof of concept so haven't dealt with thread synchronization and shit but it works and you can have fun cleaning it up.

Rot1SucksCock.java
Code:
package fractalmuse;

import org.jfugue.Pattern;
import org.jfugue.Player;

public class Rot1SucksCock extends Thread {
   private final Player  player;
   private final Pattern music;
   
   public Rot1SucksCock( Player player, Pattern music ) {
      this.player = player;
      this.music  = music;
   }
   
   public void run() {
      player.play( music );
      player.close();
   }
}


to make a class which can be threaded you need to either implement runnable or extend thread. and then implement run() which is called when a thread is created. here it is spawning the thread:

Code:
Thread halfInchWonder = new Rot1SucksCock( player, music );
halfInchWonder.start();


and here is the pause function..
Code:
        pauseBtn.addActionListener(new java.awt.event.ActionListener() {
           public void actionPerformed(java.awt.event.ActionEvent evt) {
              pauseBtnActionPerformed(evt);
           }

         private void pauseBtnActionPerformed(ActionEvent evt) {
            player.pause();            
         }
        });


here is the final jar:
http://www.sendspace.com/file/uab160

i couldn't be bothered to space the pause button properly.. and here is the eclipse project:
http://www.sendspace.com/file/2r8k3a

as a general UI piece of advice. heavy work shouldn't be done in the UI thread which is usually single threaded. to make sure the app is responsive, this sort of work should be dispatched to worker threads so the UI thread can return and quickly continue processing other UI events.
Back to top
View user's profile Send private message
Evil_Intentions
Expert Cheater
Reputation: 65

Joined: 07 Jan 2010
Posts: 214

PostPosted: Thu Jun 02, 2011 1:05 pm    Post subject: Reply with quote

Thank you so much Slugsnack. I'll start messing with it.

EDIT: I now have a perfectly working stop button. I shall tell my kids about you. haha Very Happy
Back to top
View user's profile Send private message
InternetIsSeriousBusiness
Grandmaster Cheater Supreme
Reputation: 8

Joined: 12 Jul 2010
Posts: 1268

PostPosted: Thu Jun 02, 2011 6:00 pm    Post subject: Reply with quote

wat
_________________
FLAME FLAME FLAME!!!@@@
Back to top
View user's profile Send private message
Nirojan
How do I cheat?
Reputation: 108

Joined: 16 Sep 2008
Posts: 0
Location: seshville

PostPosted: Tue Apr 24, 2012 11:28 pm    Post subject: Reply with quote

virus
_________________
Quote:
yo i b 22 tryna make it in dis rap game but da steetz dont got luv for no wun na mean so im out hea tryna holla at da fams on dis innernet shit u no way i sayin
Back to top
View user's profile Send private message
InternetIsSeriousBusiness
Grandmaster Cheater Supreme
Reputation: 8

Joined: 12 Jul 2010
Posts: 1268

PostPosted: Tue Apr 24, 2012 11:38 pm    Post subject: Reply with quote

wat
_________________
FLAME FLAME FLAME!!!@@@
Back to top
View user's profile Send private message
the the the
Master Cheater
Reputation: 46

Joined: 15 Jun 2008
Posts: 429

PostPosted: Wed Apr 25, 2012 12:08 am    Post subject: Reply with quote

Slugsnack wrote:
i'm done. basically Player.play is a call which blocks till it finishes. easiest to branch it off to another thread. i've just done this as a proof of concept so haven't dealt with thread synchronization and shit but it works and you can have fun cleaning it up.

Rot1SucksCock.java
Code:
package fractalmuse;

import org.jfugue.Pattern;
import org.jfugue.Player;

public class Rot1SucksCock extends Thread {
   private final Player  player;
   private final Pattern music;
   
   public Rot1SucksCock( Player player, Pattern music ) {
      this.player = player;
      this.music  = music;
   }
   
   public void run() {
      player.play( music );
      player.close();
   }
}


to make a class which can be threaded you need to either implement runnable or extend thread. and then implement run() which is called when a thread is created. here it is spawning the thread:

Code:
Thread halfInchWonder = new Rot1SucksCock( player, music );
halfInchWonder.start();


and here is the pause function..
Code:
        pauseBtn.addActionListener(new java.awt.event.ActionListener() {
           public void actionPerformed(java.awt.event.ActionEvent evt) {
              pauseBtnActionPerformed(evt);
           }

         private void pauseBtnActionPerformed(ActionEvent evt) {
            player.pause();            
         }
        });


here is the final jar:
http://www.sendspace.com/file/uab160

i couldn't be bothered to space the pause button properly.. and here is the eclipse project:
http://www.sendspace.com/file/2r8k3a

as a general UI piece of advice. heavy work shouldn't be done in the UI thread which is usually single threaded. to make sure the app is responsive, this sort of work should be dispatched to worker threads so the UI thread can return and quickly continue processing other UI events.
wow good advice


Nirojan wrote:
virus
i had 2 reformat 4 time bcuz ur stupid java virus!!!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites