<commit_before>package com.virtuality.virtualaudio;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.SeekBar;

import java.io.IOException;


public class MainActivity extends Activity {

    Button playVirtualBarberAudio, playInterrogationChamberAudio;
    SeekBar controlVirtualBarberAudio, controlInterrogationChamberAudio;
    boolean virtualBarberStarted = false, interrogationChamberStarted = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        playVirtualBarberAudio = (Button) findViewById(R.id.play_audio001);
        controlVirtualBarberAudio = (SeekBar) findViewById(R.id.seekbar_audio001);
        playInterrogationChamberAudio = (Button) findViewById(R.id.play_audio002);
        controlInterrogationChamberAudio = (SeekBar) findViewById(R.id.seekbar_audio002);
        final MediaPlayer virtualBarberAudioPlayer = MediaPlayer.create(MainActivity.this, R.raw.audio001);
        final MediaPlayer interrogationRoomAudioPlayer = MediaPlayer.create(MainActivity.this, R.raw.audio002);
        controlVirtualBarberAudio.setMax(virtualBarberAudioPlayer.getDuration());
        controlInterrogationChamberAudio.setMax(interrogationRoomAudioPlayer.getDuration());
        playVirtualBarberAudio.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(virtualBarberStarted) {
                    virtualBarberAudioPlayer.stop();
                    try {
                        virtualBarberAudioPlayer.prepare();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    virtualBarberStarted = false;
                } else{
                    virtualBarberAudioPlayer.start();
                    virtualBarberStarted = true;
                    final Handler handlerVirtualBarberAudio = new Handler();
                    Runnable runnableVirtualBarberAudio = new Runnable() {
                        @Override
                        public void run() {
                            if(virtualBarberAudioPlayer != null) {
                                int currentAudioPosition = virtualBarberAudioPlayer.getCurrentPosition();
                                controlVirtualBarberAudio.setProgress(currentAudioPosition);
                            }
                            handlerVirtualBarberAudio.postDelayed(this, 1000);
                        }
                    };
                    runnableVirtualBarberAudio.run();
                }

            }
        });
        controlVirtualBarberAudio.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int i, boolean b) {

            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
                if(virtualBarberAudioPlayer!=null) {
                    virtualBarberAudioPlayer.seekTo(seekBar.getProgress());
                }
            }
        });
        playInterrogationChamberAudio.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(interrogationChamberStarted) {
                    interrogationRoomAudioPlayer.stop();
                    try {
                        interrogationRoomAudioPlayer.prepare();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    interrogationChamberStarted = false;
                } else{
                    interrogationRoomAudioPlayer.start();
                    interrogationChamberStarted = true;
                    final Handler handlerInterrogationRoomAudio = new Handler();
                    Runnable runnableInterrogationRoomAudio = new Runnable() {
                        @Override
                        public void run() {
                            if(interrogationRoomAudioPlayer != null) {<commit_msg>-Added Looping feature for the audio<commit_after>package com.virtuality.virtualaudio;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.SeekBar;

import java.io.IOException;


public class MainActivity extends Activity {

    Button playVirtualBarberAudio, playInterrogationChamberAudio;
    SeekBar controlVirtualBarberAudio, controlInterrogationChamberAudio;
    boolean virtualBarberStarted = false, interrogationChamberStarted = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        playVirtualBarberAudio = (Button) findViewById(R.id.play_audio001);
        controlVirtualBarberAudio = (SeekBar) findViewById(R.id.seekbar_audio001);
        playInterrogationChamberAudio = (Button) findViewById(R.id.play_audio002);
        controlInterrogationChamberAudio = (SeekBar) findViewById(R.id.seekbar_audio002);
        final MediaPlayer virtualBarberAudioPlayer = MediaPlayer.create(MainActivity.this, R.raw.audio001);
        final MediaPlayer interrogationRoomAudioPlayer = MediaPlayer.create(MainActivity.this, R.raw.audio002);
        controlVirtualBarberAudio.setMax(virtualBarberAudioPlayer.getDuration());
        controlInterrogationChamberAudio.setMax(interrogationRoomAudioPlayer.getDuration());
        playVirtualBarberAudio.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(virtualBarberStarted) {
                    virtualBarberAudioPlayer.stop();
                    try {
                        virtualBarberAudioPlayer.prepare();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    virtualBarberStarted = false;
                } else{
                    virtualBarberAudioPlayer.start();
                    virtualBarberAudioPlayer.setLooping(true);
                    virtualBarberStarted = true;
                    final Handler handlerVirtualBarberAudio = new Handler();
                    Runnable runnableVirtualBarberAudio = new Runnable() {
                        @Override
                        public void run() {
                            if(virtualBarberAudioPlayer != null) {
                                int currentAudioPosition = virtualBarberAudioPlayer.getCurrentPosition();
                                controlVirtualBarberAudio.setProgress(currentAudioPosition);
                            }
                            handlerVirtualBarberAudio.postDelayed(this, 1000);
                        }
                    };
                    runnableVirtualBarberAudio.run();
                }

            }
        });
        controlVirtualBarberAudio.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int i, boolean b) {

            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
                if(virtualBarberAudioPlayer!=null) {
                    virtualBarberAudioPlayer.seekTo(seekBar.getProgress());
                }
            }
        });
        playInterrogationChamberAudio.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(interrogationChamberStarted) {
                    interrogationRoomAudioPlayer.stop();
                    try {
                        interrogationRoomAudioPlayer.prepare();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    interrogationChamberStarted = false;
                } else{
                    interrogationRoomAudioPlayer.start();
                    interrogationRoomAudioPlayer.setLooping(true);
                    interrogationChamberStarted = true;
                    final Handler handlerInterrogationRoomAudio = new Handler();
                    Runnable runnableInterrogationRoomAudio = new Runnable() {
                        @Override
                        public void run() {
                            if(interrogationRoomAudioPlayer != null) {
{'fraction_non_alphanumeric': 0.06881696675135314, 'fraction_numerical': 0.004860267314702308, 'mean_word_length': 1.889881902330035, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3632304', 'n_tokens_mistral': 2182, 'n_tokens_neox': 2021, 'n_words': 353}