home *** CD-ROM | disk | FTP | other *** search
- #include <method\methodSx.h>
- #include <sxlib.h>
- #include "pcm8pp.h"
- #include "spsx.h"
-
-
- int MainDraw();
-
- proc_list_t /* 描画ルーチンリスト */
- mainDraw = {MainDraw, NULL};
-
- window_t /* ウインドウ定義 */
- mainWin = {&mainDraw, (window *) NULL, (window *) -1, {0, 0, 320, 112},
- "\@Sound Player SX-68K", 0, (49 << 4), 0b0001};
-
- /* 操作ボタン用イメージのポインタ */
- rectImg **pImgPlayButton; /* 再生ボタン */
- rectImg **pImgStopButton; /* 停止ボタン */
- rectImg **pImgNextButton; /* 次曲ボタン */
- rectImg **pImgBeforeButton; /* 前曲ボタン */
- rectImg **pImgRandomButton; /* ランダムボタン */
- rectImg **pImgPauseButton; /* 一時停止ボタン */
- rectImg **pImgRestartButton; /* 再開ボタン */
- rectImg **pImgDisRndButton; /* ランダム取り消しボタン */
- rectImg **pImgPushPlayButton; /* 再生ボタンを押した状態 */
- rectImg **pImgPushStopButton; /* 停止ボタンを押した状態 */
- rectImg **pImgPushNextButton; /* 次曲ボタンを押した状態 */
- rectImg **pImgPushBeforeButton; /* 前曲ボタンを押した状態 */
- rectImg **pImgPushRndButton; /* ランダムボタンを押した状態 */
- rectImg **pImgPushPauseButton; /* 一時停止ボタンを押した状態 */
- rectImg **pImgPushRestartButton; /* 再開ボタンを押した状態 */
- rectImg **pImgPushDisRndButton; /* ランダム取り消しボタンを押した状態 */
-
- rectImg **pImageH[5]; /* イメージボタン配列(通常ボタン) */
- rectImg **pImageL[5]; /* (押されている時) */
-
-
- point_t astButtonPoint[5] = { /* ボタンの位置 */
- Point_t(264,80), /* 再生 */
- Point_t(216,80), /* 停止 */
- Point_t(136,80), /* 次曲 */
- Point_t( 88,80), /* 前曲 */
- Point_t( 8,80) }; /* ランダム */
-
- m_picbtn_t stCtrlButton = {
- pImageH,
- pImageL,
- astButtonPoint,
- 5,
- 0x00,
- Rect(0, 0, 0, 0),
- NULL,
- NULL,
- 0 };
-
- method_t mFileDrop = {
- NULL,
- m_DRPDWN,
- NULL,
- iFileDrop };
-
- method_t mCtrlButton = {
- &mFileDrop,
- m_PICBTN,
- &stCtrlButton,
- NULL};
-
-
-
- extern int iPlayTime;
-
- extern int iPlayTrack;
-
- extern uchar *pcPlayTitle;
-
- extern stPlayList_t stPlayList;
-
- extern int iPlayMode; /* 再生種別 PLAY_NORMAL */
- /* PLAY_RANDOM */
-
- int MainDraw() /* 描画関数定義 */
- {
- graph *grp = PtrA0(GMExgGraph(&mainWin.wptr->wGraph));
- rect stRect;
- int iFontKind;
-
- iFontKind = GMFontKind(1); /* 16x16 dot Font */
-
- stRect.top = 8;
- stRect.left = 9;
-
- stRect.right=311;
- stRect.bottom = 71;
-
- ULD3Rect2( &stRect );
-
-
- GMPenMode(0);
- GMShadowStrZ( "Track", Point_t(120, 48) );
- GMShadowStrZ( "Time", Point_t(224, 48) );
-
- GMFontKind(iFontKind);
-
- GMExgGraph(grp); /* グラフポートを戻す */
-
- iDrawPlayTime();
- iDrawTrack();
- iDrawTitle();
-
- return 0;
- }
-
-
- int iDrawPlayTime()
- {
- int iTenMin;
- int iMin;
- int iTenSec;
- int iSec;
- graph *grp = PtrA0(GMExgGraph(&mainWin.wptr->wGraph));
- int kind = GMFontKind(1);
-
- iTenMin = iPlayTime / 600;
- iMin = (iPlayTime / 60) - (iTenMin * 10);
- iTenSec = (iPlayTime % 60) / 10;
- iSec = iPlayTime % 10;
-
- GMPenMode(0);
- GMFontMode(0);
-
- GMMove(Point_t(264, 48));
- GMDrawChar('0'+iTenMin);
- GMDrawChar('0'+iMin);
- GMDrawChar(':');
- GMDrawChar('0'+iTenSec);
- GMDrawChar('0'+iSec);
-
-
- GMFontKind(kind);
- GMExgGraph(grp); /* グラフポートを戻す */
-
- return 0;
- }
-
- int iDrawTrack()
- {
- int iTenTrack;
- int iTrack;
-
- graph *grp = PtrA0(GMExgGraph(&mainWin.wptr->wGraph));
- int kind;
-
- kind = GMFontKind(0);
-
- iTenTrack = iPlayTrack / 10;
- iTrack = iPlayTrack % 10;
-
- GMPenMode(0);
- GMFontMode(0);
-
- if ( iPlayMode == PLAY_RANDOM ) {
- GMMove(Point_t(40,52));
- GMDrawChar('R');
- GMDrawChar('A');
- GMDrawChar('N');
- GMDrawChar('D');
- GMDrawChar('O');
- GMDrawChar('M');
- }
- else {
- GMMove(Point_t(40,52));
- GMDrawChar(' ');
- GMDrawChar(' ');
- GMDrawChar(' ');
- GMDrawChar(' ');
- GMDrawChar(' ');
- GMDrawChar(' ');
- }
-
- GMFontKind(1);
-
- GMMove(Point_t(168, 48));
- GMDrawChar('0'+iTenTrack);
- GMDrawChar('0'+iTrack);
-
-
- iTenTrack = stPlayList.iMusicCount / 10;
- iTrack = stPlayList.iMusicCount % 10;
- GMDrawChar('/');
- GMDrawChar('0'+iTenTrack);
- GMDrawChar('0'+iTrack);
-
-
- GMFontKind(kind);
- GMExgGraph(grp); /* グラフポートを戻す */
-
- return 0;
- }
-
- iDrawTitle() {
- graph *grp = PtrA0(GMExgGraph(&mainWin.wptr->wGraph));
- int kind;
-
- GMPenMode(0);
- GMFontMode(0);
-
- kind = GMFontKind(2);
-
- GMMove(Point_t(16,16));
- ULDrawStrCenterL("\@ \0",24);
-
- if ( pcPlayTitle == NULL ) { /* タイトル未設定の場合 */
- GMMove(Point_t(16,16));
-
- ULDrawStrCenterL("\@----- NO TITLE -----\0",24);
-
- }
- else {
- if ( strlen(pcPlayTitle) <= 25 ) {
-
- GMMove(Point_t(16,16));
-
- ULDrawStrCenterL(pcPlayTitle,24);
- }
- else {
- GMFontKind(1);
- GMMove(Point_t(16,20));
-
- ULDrawStrCenterL(pcPlayTitle,36);
- }
- }
-
- GMFontKind(kind);
- GMExgGraph(grp);
-
- return 0;
- }