Subversion Repositories Projects

Rev

Rev 82 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 82 Rev 149
Line 69... Line 69...
69
    public void start_playing(String name)
69
    public void start_playing(String name)
70
    {
70
    {
71
        try {
71
        try {
Line 72... Line 72...
72
               
72
               
73
            try {
73
            try {
74
                        player = Manager.createPlayer(getClass().getResourceAsStream(name+".mp3"), "audio/mp3");
74
                player = Manager.createPlayer(getClass().getResourceAsStream(name+".mp3"), "audio/mp3");
75
            }
75
            }
76
            catch (Exception e)  {
76
            catch (Exception e)  {
77
                player = Manager.createPlayer(getClass().getResourceAsStream(name+".wav"), "audio/x-wav");
77
                player = Manager.createPlayer(getClass().getResourceAsStream(name+".wav"), "audio/x-wav");
78
            }
78
            }
Line 88... Line 88...
88
                        player.prefetch();
88
                        player.prefetch();
89
                        player.setLoopCount(1);
89
                        player.setLoopCount(1);
90
                        player.start();
90
                        player.start();
91
        }
91
        }
92
        catch (Exception e)  {
92
        catch (Exception e)  {
93
 
-
 
Line 94... Line -...
94
           
-
 
95
 
-
 
96
 
93
           
97
        }      
94
        }      
Line 98... Line 95...
98
    }
95
    }
99
   
96
   
Line 106... Line 103...
106
            }
103
            }
Line 107... Line 104...
107
               
104
               
Line -... Line 105...
-
 
105
 
108
 
106
    }
109
    }
107
 
110
 
108
    int info_from_debug_set=-1;
111
    public void run()
109
    public void run()
Line 112... Line 110...
112
    {
110
    {
113
        while(true)
111
        while(true)
114
            {
112
            {
115
 
113
 
116
               
114
               
117
                if (mk.connected&&(canvas.do_sound)&&(mk.debug_data.UBatt()!=-1)&&(!mk.force_disconnect))
-
 
118
                    {
-
 
119
                        int ubatt=mk.debug_data.UBatt();
-
 
120
 
115
                if (mk.connected&&(canvas.do_sound)&&(mk.debug_data.UBatt()!=-1)&&(!mk.force_disconnect))
121
                        start_playing(""+(ubatt/10));
116
                    {
122
                        wait_for_end();
-
 
123
 
117
                        int ubatt=mk.debug_data.UBatt();
124
                        if((ubatt%10)!=0)
118
               
-
 
119
                        if (info_from_debug_set!=mk.debug_data_count)
-
 
120
                            {
-
 
121
                                info_from_debug_set=mk.debug_data_count;
-
 
122
                                start_playing(""+(ubatt/10));
-
 
123
                                wait_for_end();
-
 
124
                               
-
 
125
                                if((ubatt%10)!=0)
-
 
126
                                    {
-
 
127
                                        start_playing("komma");
125
                            {
128
                                        wait_for_end();
126
                                start_playing("komma");
-
 
127
                                wait_for_end();
-
 
Line 128... Line 129...
128
                                start_playing(""+(ubatt%10));
129
                                        start_playing(""+(ubatt%10));
Line 129... Line 130...
129
                                wait_for_end();
130
                                        wait_for_end();
130
                            }
131
                                    }