transport.h 4 KB
/*====================================================================
 * transport.h
 *
 * Copyright 1995, Silicon Graphics, Inc.
 * All Rights Reserved.
 *
 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
 * Inc.; the contents of this file may not be disclosed to third
 * parties, copied or duplicated in any form, in whole or in part,
 * without the prior written permission of Silicon Graphics, Inc.
 *
 * RESTRICTED RIGHTS LEGEND:
 * Use, duplication or disclosure by the Government is subject to
 * restrictions as set forth in subdivision (c)(1)(ii) of the Rights
 * in Technical Data and Computer Software clause at DFARS
 * 252.227-7013, and/or in similar or successor clauses in the FAR,
 * DOD or NASA FAR Supplement. Unpublished - rights reserved under the
 * Copyright Laws of the United States.
 *====================================================================*/

#ifndef __transport__
#define __transport__


/*
  transport.h

  Contains definitions and structures for transport controls.
*/


#include "UI.h"
#include "UIpane.h"
#include "music.h"	/* COMP_SEQ_PLAY */

/*
  UI item ids must start at zero since they are stored
  in an array and the ids are used to index the items.
*/
enum
{
    kRewItemID = 0,
    kStopItemID,
    kPlayItemID,
    kFwdItemID,
    kCueBackItemID,
    kCueFwdItemID,
    kCounterItemID,
    kAutoCueItemID,

    kLoopEnableItemID,	/* Must be last item since it is conditional on COMP_SEQ_PLAY */

#ifdef COMP_SEQ_PLAY
    kNumXptItems = kLoopEnableItemID
#else
    kNumXptItems
#endif
};


/*
  UI item locations are relative to the transport's origin
  which is defined by kXpt_l and kXpt_t.
*/
#define kXpt_l                  28
#define kXpt_t                  20
#define kXpt_h                  50
#define kXpt_delta              10

#define kXptBtn_t               30
#define kXptBtn_w               17
#define kXptBtn_h               13
#define kXptBtn_delta           1

#define kMiniBtn_w		11
#define kMiniBtn_h		11

#define kRewItem_l              kXpt_delta
#define kRewItem_t              kXptBtn_t

#define kStopItem_l             (kRewItem_l +kXptBtn_w  + kXptBtn_delta)
#define kStopItem_t             kXptBtn_t

#define kPlayItem_l             (kStopItem_l +kXptBtn_w  + kXptBtn_delta)
#define kPlayItem_t             kXptBtn_t

#define kFwdItem_l              (kPlayItem_l + kXptBtn_w + kXptBtn_delta)
#define kFwdItem_t              kXptBtn_t

#define kCueBackItem_l          (kFwdItem_l + kXptBtn_w + kXptBtn_delta)
#define kCueBackItem_t          kXptBtn_t

#define kCueFwdItem_l           (kCueBackItem_l + kXptBtn_w + kXptBtn_delta)
#define kCueFwdItem_t           kXptBtn_t

#define kXpt_w                  (kCueFwdItem_l + kXptBtn_w + kXpt_delta)

#define kCounterItem_w          64
#define kCounterItem_h          16
#define kCounterItem_l          kXpt_delta
#define kCounterItem_t          5

#define kAutoCueItem_l		(kCounterItem_l + kCounterItem_w + 5)
#define kAutoCueItem_t		kCounterItem_t

#define kLoopEnableItem_l	(kAutoCueItem_l + kMiniBtn_w + kXptBtn_delta)
#define kLoopEnableItem_t	kAutoCueItem_t


typedef enum 
{
    kStopped,
    kPlaying,
    kFastPlay
} TransportState;


typedef enum
{
    kRealTime,
    kMidiTime
} CounterUnits;


typedef struct
{
    TransportState      fState;                         /* Contains the state of the transport. */
    CounterUnits        fCounterUnits;
    char		fIsLooping;			/* TRUE if looping is enabled. */
    char		fAutoCue;			/* TRUE if next sequence is cued during auto stop. */

    UIPane              fPane;                          /* Contains window pane data. */
    UIItem              fItemList[kNumXptItems];        /* A list of control items in this pane. */
} Transport;


void    Xpt_Init (UIPane **ppPane);
void    Xpt_Fini (void);
void    Xpt_Play (void);
void    Xpt_Stop (void);
void    Xpt_AutoStop (void);
void    Xpt_RTZ (void);
void    Xpt_FastForward (void);
void    Xpt_NormalForward (void);
void    Xpt_CueBack (void);
void    Xpt_CueForward (void);
void	Xpt_SetLoopEnable (char enable);


#endif /* __transport__ */