001/*
002 * Copyright (C) Cross The Road Electronics.  All rights reserved.
003 * License information can be found in CTRE_LICENSE.txt
004 * For support and suggestions contact support@ctr-electronics.com or file
005 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
006 */
007package com.ctre.phoenix6.hardware.traits;
008
009import com.ctre.phoenix6.StatusCode;
010import com.ctre.phoenix6.controls.*;
011
012/**
013 * Contains all control functions available for motors that support playing
014 * music.
015 */
016public interface SupportsMusic extends CommonDevice
017{
018    
019    
020    /**
021     * Plays a single tone at the user specified frequency.
022     * <ul>
023     *   <li> <b>MusicTone Parameters:</b> 
024     *   <ul>
025     *     <li> <b>AudioFrequency:</b> Sound frequency to play.  A value of zero
026     *                                 will silence the device. The effective
027     *                                 frequency range is 10-20000 Hz.  Any nonzero
028     *                                 frequency less than 10 Hz will be capped to
029     *                                 10 Hz.  Any frequency above 20 kHz will be
030     *                                 capped to 20 kHz.
031     *   </ul>
032     * </ul>
033     *
034     * @param request Control object to request of the device
035     * @return Status code of the request
036     */
037    StatusCode setControl(MusicTone request);
038
039    /**
040     * Apply a generic empty control used to do nothing.
041     *
042     * @param request Control object to request of the device
043     * @return Status code of the request
044     */
045    StatusCode setControl(EmptyControl request);
046
047    /**
048     * Control device with generic control request object.
049     * <p>
050     * User must make sure the specified object is castable to a valid control request,
051     * otherwise this function will fail at run-time and return the NotSupported StatusCode
052     *
053     * @param request Control object to request of the device
054     * @return Status code of the request
055     */
056    StatusCode setControl(ControlRequest request);
057    
058}
059