/*  File:         prefs.h
 *  Created:      20-10-95
 *  Updated:      30-12-95
 *  Version:      1.0
 *  Project:      Clicker
 *  Owner:        Jeroen Vermeulen
 *  Requirements: KickStart V39+
 *  Legal:        PD
 *  Status:       Release
 */

/* Defining this preprocessor symbol will disable all mouse-click code.  There
 * is no real reason for this except that it may help get a few instructions out
 * of the critical path of the input stream.  Clicker sniffs at any input event
 * that comes in, including mouse moves, so the faster it is done the better.
 *
 * If mouse-clicks are disabled at compile time, the gadget for it in the prefs
 * window will be ghosted.
 */
/* #define NOCLICKMOUSE */


struct SoundSettings
{
  /* Alter this value at will.  There's no need to notify through `newsettings'.
   */
  BOOL  ClickMouse;

  /* Change pitch/length/volume of click by poking new values into this struct,
   * and setting newsettings to TRUE afterwards to notify the click routine.
   */
  BOOL  newsettings;
  UWORD period, volume, cycles;

};


/* This global volatile variable enables asynchronous communication between
 * processes.  New settings for sample volume, click length and pitch will be
 * stored into this struct, so the key-click routine will feed the new data into
 * its audio request on the next key click.
 */
extern volatile struct SoundSettings ClickPrefs;


/* CopySoundPrefs():
 * Copies a SoundSettings structure, like CopyMem() but slightly safer in every-
 * day use.  It is volatile-safe and const-friendly, and also sets the
 * destination's newsettings flag.  NULL arguments are *not* safe.
 */
void CopySoundPrefs(volatile const struct SoundSettings *const src,
                    volatile       struct SoundSettings *const dst);

