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
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 will
026     *                              silence the device. The effective frequency
027     *                              range is 10-20000 Hz.  Any nonzero frequency
028     *                              less than 10 Hz will be capped to 10 Hz.  Any
029     *                              frequency above 20 kHz will be capped to 20 kHz.
030     *   </ul>
031     * </ul>
032     *
033     * @param request Control object to request of the device
034     * @return Code response of the request
035     */
036    StatusCode setControl(MusicTone request);
037
038    /**
039     * Control device with generic control request object.
040     * <p>
041     * User must make sure the specified object is castable to a valid control request,
042     * otherwise this function will fail at run-time and return the NotSupported StatusCode
043     *
044     * @param request Control object to request of the device
045     * @return Status Code of the request, 0 is OK
046     */
047    StatusCode setControl(ControlRequest request);
048    
049}
050