<commit_before>function Music(id,src,title,time){
    this.id = id;
    this.src = src;
    this.title = title;
    this.time = (time !=null)?parseInt(time):0;
}

var MusicPlayer = {
    player:null,
    // manage name device
    device:{
        name:"",
        input:null,
        init:function(){
            this.input = $('#idDeviceName');
            if(localStorage && localStorage["deviceName"]!=null){
                this.name =localStorage["deviceName"];
            }else {
                this.name = "Default";
            }
            this.input.val(this.name);            
             this.input.bind('click',(e)=>{
               if(this.input.hasClass('disabled')){
                $(this.input).removeClass('disabled').bind('keydown',(e)=>{
                   if(e.keyCode == 13){
                      MusicPlayer.device.save();
                   }    
                }).bind('blur',(e)=>MusicPlayer.device.save());
               }
            });
        },
        save:function(){
           this.name = this.input.val();
           this.input.addClass('disabled').unbind('keydown,blur');
           if(localStorage){
            localStorage["deviceName"] = this.name;
           }
        }
    },
    // Manage the list of music
    setPlaylist:function(playlist){
        this.playlist = playlist;
        $('.next,.previous',this.div).show();
    },
    // Contains all controls to manipulate player
    controls:{
        div:null,
        seeker:null,
        // Default implementation to avoid test shareManager every time
        shareManager:{event:function(){}},
        init:function(idDiv){
            this.div = $('#' + idDiv)
            this.seeker = $('.seeker',this.div);
            this.seeker.slider({
                min:0,
                value:0,
                slide:(e,ui)=>MusicPlayer.player.currentTime = ui.value
            });
            var _self = this;
            $('.play',this.div).bind('click',()=>_self.play());
            $('.pause',this.div).bind('click',()=>_self.pause());
            $('.next',this.div).bind('click',()=>_self.next());
            $('.previous',this.div).bind('click',()=>_self.previous());
            MusicPlayer.player.volume = 0.5;
            // Volume Behaviour
            $('.volume-plus',this.div).bind('click',()=>MusicPlayer.volume.up());
            $('.volume-minus',this.div).bind('click',()=>MusicPlayer.volume.down());
            $(document).bind('volume_up',()=>MusicPlayer.volume.up());
            $(document).bind('volume_down',()=>MusicPlayer.volume.down());
            VolumeDrawer.init('idVolume');
            VolumeDrawer.draw(Math.round(MusicPlayer.player.volume*10))
        },
        play:function(){
            MusicPlayer.play();
            this.shareManager.event('play');
        },
        pause:function(){
            MusicPlayer.pause();
            this.shareManager.event('pause');
        },
        next:function(){
            $(document).trigger('next_event');
        },
        previous:function(){
            $(document).trigger('previous_event');
        },
        setShareManager:function(manager){
          this.shareManager = manager;
        },
        setTitle:function(music){
            $('.title',this.div).text(music.title);
            $('title').html(music.artist + " - " + music.title);
            // Trigger that a music is loaded
            this.shareManager.event('load',music.id)
        },
        setMax:function(value){
            this.seeker.slider('option','max',value)
            $('.duration',this.div).text(MusicPlayer._formatTime(value));
        } ,
        update:function(value){
            // Check value, if max == value, launch next song
            this.seeker.slider('option','value',value)
            var ftime = MusicPlayer._formatTime(value);
            $('.position',this.div).text(ftime);
            $(document).trigger('update_time',ftime);
        }
    },
    volume:{
        up:function(){
            if(MusicPlayer.player.volume >= 0.9){
                 MusicPlayer.player.volume=1;
             }else{
                 MusicPlayer.player.volume+=0.1;
             }
             VolumeDrawer.draw(Math.round(MusicPlayer.player.volume*10))
            $.ajax({url:'/volume?volume=up'});
            // Share event
            MusicPlayer.controls.shareManager.event('volume',Math.round(MusicPlayer.player.volume*100));
        },
        down:function(){
            if(MusicPlayer.player.volume <= 0.1){
                MusicPlayer.player.volume=0;
            }else{
                MusicPlayer.player.volume-=0.1;
            }
            VolumeDrawer.draw(Math.round(MusicPlayer.player.volume*10));
            $.ajax({url:'/volume?volume=down'});
            MusicPlayer.controls.shareManager.event('volume',Math.round(MusicPlayer.player.volume*100));
        }<commit_msg>Change step volume to 0.05 instead of 0.1<commit_after>function Music(id,src,title,time){
    this.id = id;
    this.src = src;
    this.title = title;
    this.time = (time !=null)?parseInt(time):0;
}

var MusicPlayer = {
    player:null,
    // manage name device
    device:{
        name:"",
        input:null,
        init:function(){
            this.input = $('#idDeviceName');
            if(localStorage && localStorage["deviceName"]!=null){
                this.name =localStorage["deviceName"];
            }else {
                this.name = "Default";
            }
            this.input.val(this.name);            
             this.input.bind('click',(e)=>{
               if(this.input.hasClass('disabled')){
                $(this.input).removeClass('disabled').bind('keydown',(e)=>{
                   if(e.keyCode == 13){
                      MusicPlayer.device.save();
                   }    
                }).bind('blur',(e)=>MusicPlayer.device.save());
               }
            });
        },
        save:function(){
           this.name = this.input.val();
           this.input.addClass('disabled').unbind('keydown,blur');
           if(localStorage){
            localStorage["deviceName"] = this.name;
           }
        }
    },
    // Manage the list of music
    setPlaylist:function(playlist){
        this.playlist = playlist;
        $('.next,.previous',this.div).show();
    },
    // Contains all controls to manipulate player
    controls:{
        div:null,
        seeker:null,
        // Default implementation to avoid test shareManager every time
        shareManager:{event:function(){}},
        init:function(idDiv){
            this.div = $('#' + idDiv)
            this.seeker = $('.seeker',this.div);
            this.seeker.slider({
                min:0,
                value:0,
                slide:(e,ui)=>MusicPlayer.player.currentTime = ui.value
            });
            var _self = this;
            $('.play',this.div).bind('click',()=>_self.play());
            $('.pause',this.div).bind('click',()=>_self.pause());
            $('.next',this.div).bind('click',()=>_self.next());
            $('.previous',this.div).bind('click',()=>_self.previous());
            MusicPlayer.player.volume = 0.6;
            // Volume Behaviour
            $('.volume-plus',this.div).bind('click',()=>MusicPlayer.volume.up());
            $('.volume-minus',this.div).bind('click',()=>MusicPlayer.volume.down());
            $(document).bind('volume_up',()=>MusicPlayer.volume.up());
            $(document).bind('volume_down',()=>MusicPlayer.volume.down());
            VolumeDrawer.init('idVolume');
            VolumeDrawer.draw(Math.round(MusicPlayer.player.volume*10))
        },
        play:function(){
            MusicPlayer.play();
            this.shareManager.event('play');
        },
        pause:function(){
            MusicPlayer.pause();
            this.shareManager.event('pause');
        },
        next:function(){
            $(document).trigger('next_event');
        },
        previous:function(){
            $(document).trigger('previous_event');
        },
        setShareManager:function(manager){
          this.shareManager = manager;
        },
        setTitle:function(music){
            $('.title',this.div).text(music.title);
            $('title').html(music.artist + " - " + music.title);
            // Trigger that a music is loaded
            this.shareManager.event('load',music.id)
        },
        setMax:function(value){
            this.seeker.slider('option','max',value)
            $('.duration',this.div).text(MusicPlayer._formatTime(value));
        } ,
        update:function(value){
            // Check value, if max == value, launch next song
            this.seeker.slider('option','value',value)
            var ftime = MusicPlayer._formatTime(value);
            $('.position',this.div).text(ftime);
            $(document).trigger('update_time',ftime);
        }
    },
    volume:{
        step:0.05,
        up:function(){
            if(MusicPlayer.player.volume >= 1-this.step){
                 MusicPlayer.player.volume=1;
             }else{
                 MusicPlayer.player.volume+=this.step;
             }
             VolumeDrawer.draw(Math.round(MusicPlayer.player.volume*10))
            $.ajax({url:'/volume?volume=up'});
            // Share event
            MusicPlayer.controls.shareManager.event('volume',Math.round(MusicPlayer.player.volume*100));
        },
        down:function(){
            if(MusicPlayer.player.volume <= this.step){
                MusicPlayer.player.volume=0;
            }else{
                MusicPlayer.player.volume-=this.step;
            }
            VolumeDrawer.draw(Math.round(MusicPlayer.player.volume*10));
            $.ajax({url:'/volume?volume=down'});
            MusicPlayer.controls.shareManager.event('volume',Math.round(MusicPlayer.player.volume*100));
        }
{'fraction_non_alphanumeric': 0.1671241232082952, 'fraction_numerical': 0.005997763545796482, 'mean_word_length': 1.8148783977110157, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '942395', 'n_tokens_mistral': 2737, 'n_tokens_neox': 2658, 'n_words': 332}