-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDSONG.CPP
executable file
·37 lines (37 loc) · 951 Bytes
/
DSONG.CPP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
_CLASSDEF(TDlgSong)
class TDlgSong :public TDialog
{
public:
char tempname[20];
TDlgSong(PTWindowsObject pwP, int nResourceID, char* filename)
:TDialog( pwP, nResourceID ) { strcpy(tempname, filename); }
virtual void SetupWindow()
{
TDialog::SetupWindow();
Play();
}
virtual void Cancel(RTMessage)
{
CloseWindow();
Destroy();
}
virtual void CloseWindow()
{
mciSendString( "stop oursong", NULL, NULL, NULL );
mciSendString( "close oursong", NULL, NULL, NULL );
TDialog::CloseWindow();
}
virtual void Play()
{
// always play if can, otherwise just save
char mcicommand[50];
sprintf(mcicommand, "open sequencer!%s alias oursong", tempname);
if ( ! mciSendString( (LPSTR) mcicommand, NULL, NULL, NULL ) )
if ( mciSendString( "play oursong from 0 notify", NULL, NULL, this->HWindow ))
CloseWindow();
}
virtual void ShutUp() = [MM_MCINOTIFY]
{
CloseWindow();
}
};