<commit_before>package org.openhab.binding.heos.api;

import org.openhab.binding.heos.resources.HeosEventListener;

public class HeosAPI {

    private HeosSystem controller = null;
    private HeosEventController event = null;

    public HeosAPI(HeosSystem controller, HeosEventController event) {

        this.controller = controller;
        this.event = event;
    }

    public void pause(String pid) {

        controller.send(controller.command().setPlayStatePause(pid));

    }

    public void play(String pid) {

        controller.send(controller.command().setPlayStatePlay(pid));

    }

    public void stop(String pid) {

        controller.send(controller.command().setPlayStateStop(pid));

    }

    public void next(String pid) {

        controller.send(controller.command().playNext(pid));

    }

    public void prevoious(String pid) {

        controller.send(controller.command().playPrevious(pid));

    }

    public void mute(String pid) {

        controller.send(controller.command().setMuteToggle(pid));
    }

    public void muteON(String pid) {

        controller.send(controller.command().setMuteOn(pid));

    }

    public void muteOFF(String pid) {

        controller.send(controller.command().setMuteOff(pid));

    }

    public void volume(String vol, String pid) {

        controller.send(controller.command().setVolume(vol, pid));

    }

    public void setHeosConnection(String ip, int port) {

        controller.setConnectionIP(ip);
        controller.setConnectionPort(port);
        controller.establishConnection();

    }

    public void setUserDate(String name, String password) {

        controller.command().setUsernamePwassword(name, password);

    }

    public void setActivePlayer(String playerID) {

        controller.command().setPlayerID(playerID);

    }

    public void registerforChangeEvents(HeosEventListener listener) {

        event.addListener(listener);

    }

}<commit_msg>Improvements<commit_after>package org.openhab.binding.heos.api;

import org.openhab.binding.heos.resources.HeosEventListener;

public class HeosAPI {

    private HeosSystem controller = null;
    private HeosEventController event = null;

    public HeosAPI(HeosSystem controller, HeosEventController event) {

        this.controller = controller;
        this.event = event;
    }

    public void pause(String pid) {

        controller.send(controller.command().setPlayStatePause(pid));

    }

    public void play(String pid) {

        controller.send(controller.command().setPlayStatePlay(pid));

    }

    public void stop(String pid) {

        controller.send(controller.command().setPlayStateStop(pid));

    }

    public void next(String pid) {

        controller.send(controller.command().playNext(pid));

    }

    public void prevoious(String pid) {

        controller.send(controller.command().playPrevious(pid));

    }

    public void mute(String pid) {

        controller.send(controller.command().setMuteToggle(pid));
    }

    public void muteON(String pid) {

        controller.send(controller.command().setMuteOn(pid));

    }

    public void muteOFF(String pid) {

        controller.send(controller.command().setMuteOff(pid));

    }

    public void volume(String vol, String pid) {

        controller.send(controller.command().setVolume(vol, pid));

    }

    public void setHeosConnection(String ip, int port) {

        controller.setConnectionIP(ip);
        controller.setConnectionPort(port);
        controller.establishConnection();

    }

    public void setUserDate(String name, String password) {

        controller.command().setUsernamePwassword(name, password);

    }

    public void setActivePlayer(String playerID) {

        controller.command().setPlayerID(playerID);

    }

    public void registerforChangeEvents(HeosEventListener listener) {

        event.addListener(listener);

    }

    public void unregisterforChangeEvents(HeosEventListener listener) {

        event.removeListener(listener);

    }

}
{'fraction_non_alphanumeric': 0.10521091811414392, 'fraction_numerical': 0.0, 'mean_word_length': 3.0965447154471546, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4551644', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1071, 'n_words': 203}